3 # Purpose: build process script for generating a (grml based) Linux Live-ISO
4 # Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
5 # Bug-Reports: see http://grml.org/bugs/
6 # License: This file is licensed under the GPL v2 or any later version.
7 # Latest change: Sun Nov 25 17:16:07 CET 2007 [mika]
8 ################################################################################
10 # read configuration files, set some misc variables {{{
18 GRML_LIVE_VERSION='0.0.10'
20 ISO_DATE="$(date +%Y-%m-%d)"
22 # we need root permissions for the build-process:
23 if [ "$(id -u 2>/dev/null)" != 0 ] ; then
24 echo "Error: please run this script with uid 0 (root)." >&2
28 if [ -r /var/run/fai/FAI_INSTALLATION_IN_PROGRESS ] ; then
29 echo "/usr/sbin/fai already running or was aborted before.">&2
30 echo "You may remove /var/run/fai/FAI_INSTALLATION_IN_PROGRESS and try again.">&2
35 if [ -r /var/run/fai/fai_softupdate_is_running ] ; then
36 echo "/usr/sbin/fai softupdate already running or was aborted before.">&2
37 echo "You may remove /var/run/fai/fai_softupdate_is_running and try again.">&2
41 # make sure they are not set by default
46 if [ -r /etc/grml/lsb-functions ] ; then
47 . /etc/grml/lsb-functions
49 einfo() { echo " [*] $*" ;}
50 eerror() { echo " [!] $*">&2 ;}
51 ewarn() { echo " [x] $*" ;}
55 # source main configuration file:
56 LIVE_CONF=/etc/grml/grml-live.conf
64 [ -n "$MIRROR_DIRECTORY" ] && umount "${CHROOT_OUTPUT}/${MIRROR_DIRECTORY}"
65 rm -f /var/run/fai/fai_softupdate_is_running /var/run/fai/FAI_INSTALLATION_IN_PROGRESS
66 [ -n "$1" ] && EXIT="$1" || EXIT="1"
67 [ -n "$2" ] && eerror "$2">&2
68 log "------------------------------------------------------------------------------"
74 # check for important variables {{{
75 [ -n "$GRML_FAI_CONFIG" ] || GRML_FAI_CONFIG=/etc/grml/fai
76 [ -n "$HOSTNAME" ] || HOSTNAME=grml
77 [ -n "$USERNAME" ] || USERNAME=grml
78 [ -n "$CLASSES" ] || CLASSES="GRML,I386"
79 [ -n "$BOOT_METHOD" ] || BOOT_METHOD='isolinux'
80 [ -n "$OUTPUT" ] || bailout 1 "${PN}: \$OUTPUT not specified. Please adjust $LIVE_CONF. Exiting."
82 [ -n "$VERSION" ] || VERSION="0.0.1"
83 [ -n "$RELEASENAME" ] || RELEASENAME="grml-live rocks"
84 [ -n "$GRML_NAME" ] || GRML_NAME='grml'
87 if [ -z "$LOGFILE" ] ; then
88 LOGFILE=/var/log/grml-live.log
91 chown root:adm $LOGFILE
94 if [ -n "$ZERO_LOGFILE" ] ; then
98 NFSROOT_CONF=/etc/grml/fai/make-fai-nfsroot.conf
102 # some important functions {{{
105 # usage: log "string to log"
106 log() { echo "$*" >> $LOGFILE ; }
108 # cut string at character number int = $1
109 # usage: cut_string 5 "1234567890" will output "12345"
111 [ -n "$2" ] || return 1
112 echo "$2" | head -c "$1"; echo -ne "\n"
115 # prepend int = $1 spaces before string = $2
116 # usage: extend_string_begin 5 "123" will output " 123"
117 extend_string_begin() {
118 [ -n "$2" ] || return 1
119 local COUNT="$(echo $2 | wc -c)"
120 local FILL="$(expr $COUNT - $1)"
121 while [ "$FILL" -gt 1 ] ; do
123 local FILL=$(expr $FILL - 1)
125 while [ "$FILL" -lt 1 ] ; do
127 local FILL=$(expr $FILL + 1)
129 echo "$2" | head -c "$1"; echo -ne "\n"
132 # append int = $1 spaces to string = $2
133 # usage: extend_string_begin 5 "123" will output "123 "
134 extend_string_end() {
135 [ -n "$2" ] || return 1
136 echo -n "$2" | head -c "$1"
137 local COUNT="$(echo $2 | wc -c)"
138 local FILL="$(expr $COUNT - $1)"
139 while [ "$FILL" -gt 1 ] ; do
141 local FILL=$(expr $FILL - 1)
143 while [ "$FILL" -lt 1 ] ; do
145 local FILL=$(expr $FILL + 1)
151 # usage information {{{
155 $PN - build process script for generating a (grml based) Linux Live-ISO
157 Usage: $PN [-a <architecture>] [-c <classe[s]>] [-g <grml_name>] \\
158 [-i <iso_name> ] [-o <output_directory>] [-s <suite>] \\
159 [-t <template_directory>] [-s <suite>] \\
160 [-v <version_number>] [-FVhu]
165 $PN -c GRMLBASE,GRML_SMALL,I386 -o /grml/
166 $PN -c GRMLBASE,GRML_MEDIUM,I386 -o /dev/shm/grml
167 $PN -c GRMLBASE,GRML_SMALL,I386 -g grml-small -v 1.0
168 $PN -c GRMLBASE,GRML_FULL,I386 -i grml_0.0-1.iso -v 0.0-1
169 $PN -c GRMLBASE,GRML_FULL,I386 -s sid -V -r 'grml-live rocks'
171 More details: man grml-live
172 /usr/share/doc/grml-live/grml-live.html
174 Please send your bug reports, feedback,.. to the grml-team.
175 http://grml.org/bugs/
180 # command line parsing {{{
182 while getopts "a:c:g:i:o:r:s:t:v:FhuV" opt; do
185 c) CLASSES="$OPTARG" ;;
186 g) GRML_NAME="$OPTARG" ;;
187 i) ISO_NAME="$OPTARG" ;;
189 CHROOT_OUTPUT="$OUTPUT/grml_chroot"
190 BUILD_OUTPUT="$OUTPUT/grml_cd"
191 ISO_OUTPUT="$OUTPUT/grml_isos"
193 r) RELEASENAME="$OPTARG" ;;
194 s) SUITE="$OPTARG" ;;
195 t) TEMPLATE_DIRECTORY="$OPTARG";;
196 v) VERSION="$OPTARG" ;;
198 h) usage ; bailout 0 ;;
201 ?) echo "invalid option -$OPTARG" >&2; bailout 1 ;;
204 shift $(($OPTIND - 1)) # set ARGV to the first not parsed commandline parameter
207 # some misc checks before executing FAI {{{
208 [ -n "$CLASSES" ] || bailout 1 "Error: \$CLASSES unset, please set it in $LIVE_CONF or
209 specify it on the command line using the -c option."
210 [ -n "$OUTPUT" ] || bailout 1 "Error: \$OUTPUT unset, please set it in $LIVE_CONF or
211 specify it on the command line using the -o option."
214 # ask user whether the setup is ok {{{
215 if [ -z "$FORCE" ] ; then
217 echo "${PN} [${GRML_LIVE_VERSION}]: check your configuration (or use -F to force execution):"
219 echo " FAI classes: $CLASSES"
220 echo " main directory: $OUTPUT"
221 [ -n "$CHROOT_OUTPUT" ] && echo " chroot target: $CHROOT_OUTPUT"
222 [ -n "$BUILD_OUTPUT" ] && echo " build target: $BUILD_OUTPUT"
223 [ -n "$ISO_OUTPUT" ] && echo " ISO target: $ISO_OUTPUT"
224 [ -n "$GRML_NAME" ] && echo " grml name: $GRML_NAME"
225 [ -n "$RELEASENAME" ] && echo " release name: $RELEASENAME"
226 [ -n "$VERSION" ] && echo " grml version: $VERSION"
227 [ -n "$SUITE" ] && echo " Debian suite: $SUITE"
228 [ -n "$ARCH" ] && echo " Architecture: $ARCH"
229 [ -n "$BOOT_METHOD" ] && echo " Boot method: $BOOT_METHOD"
230 [ -n "$TEMPLATE_DIRECTORY" ] && echo " Template files: $TEMPLATE_DIRECTORY"
231 [ -n "$FAI_ARGS" ] && echo " additional arguments for FAI: $FAI_ARGS"
232 [ -n "$LOGFILE" ] && echo " Logging to file: $LOGFILE"
233 [ -n "$VERBOSE" ] && echo " Using VERBOSE mode."
234 [ -n "$UPDATE" ] && echo " Executing UPDATE instead of fresh installation."
236 echo -n "Is this ok for you? [y/N] "
238 if ! [ "$a" = 'y' -o "$a" = 'Y' ] ; then
239 bailout 1 "Exiting as requested."
244 start_seconds=$(cut -d . -f 1 /proc/uptime)
245 log "------------------------------------------------------------------------------"
246 log "Starting grml-live [${GRML_LIVE_VERSION}] run on $(date)"
247 log "Executed grml-live command line:"
250 einfo "Logging actions to logfile $LOGFILE"
253 # on-the-fly configuration {{{
254 if [ -n "$MIRROR_DIRECTORY" ] ; then
255 if ! [ -d "$MIRROR_DIRECTORY/debian" ] ; then
256 log "Sorry, $MIRROR_DIRECTORY/debian does not seem to exist. Exiting. [$(date)]"
257 eerror "Sorry, $MIRROR_DIRECTORY/debian does not seem to exist. Exiting."
260 echo "$MIRROR_SOURCES" > /etc/grml/fai/apt/sources.list
261 if [ -n "$GRML_LIVE_SOURCES" ] ; then
262 echo "$GRML_LIVE_SOURCES" >> /etc/grml/fai/apt/sources.list
264 elif [ -n "$GRML_LIVE_SOURCES" ] ; then
265 echo "$GRML_LIVE_SOURCES" > /etc/grml/fai/apt/sources.list
268 if [ -n "$FAI_DEBOOTSTRAP" ] ; then
269 sed -i "s#^FAI_DEBOOTSTRAP=.*#FAI_DEBOOTSTRAP=\"$FAI_DEBOOTSTRAP\"#" $NFSROOT_CONF
272 # does this suck? YES!
273 if [ -n "$SUITE" ] ; then
274 sed -i "s/SUITE=.*/SUITE=\"$SUITE\"/" $LIVE_CONF
276 DIST="\|\ etch\ \|\ stable\ \|\ lenny\ \|\ testing\ \|\ sid\ \|\ unstable\ "
277 sed -i "s/\(deb .\+\)\([ \t]+\)$DIST\([ \t]+\)\(main \)/\1\2 $SUITE \3\4/" $LIVE_CONF
278 sed -i "s/\(deb .\+\)\([ \t]+\)$DIST\([ \t]+\)\(main \)/\1\2 $SUITE \3\4/" /etc/grml/fai/apt/sources.list
279 # notice: activate grml-live pool only if we are building against unstable:
280 if grep -qe unstable -qe sid /etc/grml/fai/apt/sources.list ; then
281 grep -q 'grml-live.*main' /etc/grml/fai/apt/sources.list || \
282 grep grml-stable /etc/grml/fai/apt/sources.list | \
283 sed 's/grml-stable/grml-live/' >> /etc/grml/fai/apt/sources.list
285 grep -q 'grml-live.*main' /etc/grml/fai/apt/sources.list && \
286 sed -i 's/.*grml-live.*/# removed grml-live repository/' /etc/grml/fai/apt/sources.list
289 sed -i "s|FAI_DEBOOTSTRAP=\"[a-z]* |FAI_DEBOOTSTRAP=\"$SUITE |" $LIVE_CONF
290 sed -i "s|FAI_DEBOOTSTRAP=\"[a-z]* |FAI_DEBOOTSTRAP=\"$SUITE |" $NFSROOT_CONF
294 [ -n "$ARCH" ] || ARCH="$(dpkg --print-architecture)"
295 if grep -q -- 'FAI_DEBOOTSTRAP_OPTS.*--arch' $NFSROOT_CONF ; then
296 sed -i "s/--arch [a-z0-9]* /--arch $ARCH /" $NFSROOT_CONF
298 sed -i "s|FAI_DEBOOTSTRAP_OPTS=\"\(.*\)|FAI_DEBOOTSTRAP_OPTS=\"--arch $ARCH \1|" $NFSROOT_CONF
302 # CHROOT_OUTPUT - execute FAI {{{
303 [ -n "$CHROOT_OUTPUT" ] || CHROOT_OUTPUT="$OUTPUT/grml_chroot"
305 if [ -n "$UPDATE" ] ; then
306 FAI_ACTION=softupdate
308 FAI_ACTION=dirinstall
311 if [ -n "$UPDATE" ] ; then
312 if ! [ -r "$CHROOT_OUTPUT/etc/grml_version" ] ; then
313 log "Error: It does not look like you have a working chroot system. Updating not possible."
314 eerror "Error: It does not look like you have a working chroot system. Updating not possible."
320 if [ -d "$CHROOT_OUTPUT/bin" -a -z "$UPDATE" ] ; then
321 log "$CHROOT_OUTPUT exists already, skipping stage 'fai dirinstall'"
322 ewarn "$CHROOT_OUTPUT exists already, skipping stage 'fai dirinstall'" ; eend 0
324 mkdir -p "$CHROOT_OUTPUT" || bailout 5 "Problem with creating $CHROOT_OUTPUT for FAI"
325 if [ -n "${MIRROR_DIRECTORY}" ] ; then
326 mkdir -p "${CHROOT_OUTPUT}/${MIRROR_DIRECTORY}"
327 mount --bind "${MIRROR_DIRECTORY}" "${CHROOT_OUTPUT}/${MIRROR_DIRECTORY}"
329 log "Executed FAI command line:"
330 log "fai $VERBOSE -C $GRML_FAI_CONFIG -c$CLASSES -u $HOSTNAME $FAI_ACTION $CHROOT_OUTPUT $FAI_ARGS"
331 fai $VERBOSE -C "$GRML_FAI_CONFIG" -c"$CLASSES" -u "$HOSTNAME" $FAI_ACTION "$CHROOT_OUTPUT" $FAI_ARGS | tee -a $LOGFILE
334 log "Setting /etc/grml_version to $GRML_NAME $VERSION Release Codename $RELEASENAME [$ISO_DATE]"
335 echo "$GRML_NAME $VERSION Release Codename $RELEASENAME [$ISO_DATE]" > $CHROOT_OUTPUT/etc/grml_version
336 chmod 644 $CHROOT_OUTPUT/etc/grml_version
338 # Remove all FAI logs from chroot if class RELEASE is used:
339 if [ -f $CHROOT_OUTPUT/etc/grml_fai_release ] ; then
340 rm -rf $CHROOT_OUTPUT/var/log/fai/*
343 umount $CHROOT_OUTPUT/proc 2>/dev/null || /bin/true
344 umount $CHROOT_OUTPUT/sys 2>/dev/null || /bin/true
345 [ -n "$MIRROR_DIRECTORY" ] && umount "${CHROOT_OUTPUT}/${MIRROR_DIRECTORY}"
347 # notice: 'fai dirinstall' does not seem to exit appropriate, so:
349 CHECKLOG=/var/log/fai/$HOSTNAME/last
350 if [ -r "$CHECKLOG/software.log" ] ; then
351 # 1 errors during executing of commands
352 # Unable to write mmap - msync (28 No space left on device)
353 # 'No candidate version found for' [/var/log/fai/current/software.log]
354 grep 'dpkg: error processing' $CHECKLOG/software.log >> $LOGFILE && ERROR=1
355 grep 'E: Method http has died unexpectedly!' $CHECKLOG/software.log >> $LOGFILE && ERROR=2
356 grep 'ERROR: chroot' $CHECKLOG/software.log >> $LOGFILE && ERROR=3
359 if [ -r "$CHECKLOG/shell.log" ] ; then
360 grep 'FAILED with exit code' $CHECKLOG/shell.log >> $LOGFILE && ERROR=2
363 if [ -n "$ERROR" ] ; then
364 log "There was an error [${ERROR}] during execution of stage 'fai dirinstall' [$(date)]"
365 eerror "There was an error during execution of stage 'fai dirinstall'"
366 echo " Check out $CHECKLOG for details. [exit ${ERROR}]"
370 log "Finished execution of stage 'fai dirinstall' [$(date)]"
371 einfo "Finished execution of stage 'fai dirinstall'"
376 # BUILD_OUTPUT - execute arch specific stuff and squashfs {{{
377 [ -n "$BUILD_OUTPUT" ] || BUILD_OUTPUT="$OUTPUT/grml_cd"
378 mkdir -p "$BUILD_OUTPUT" || bailout 6 "Problem with creating $BUILD_OUTPUT for stage ARCH"
381 if [ "$ARCH" = i386 ] || [ "$ARCH" = amd64 ] ; then
382 if [ -d "$BUILD_OUTPUT"/boot -a -z "$UPDATE" ] ; then
383 log "$BUILD_OUTPUT/boot exists already, skipping stage 'boot'"
384 ewarn "$BUILD_OUTPUT/boot exists already, skipping stage 'boot'" ; eend 0
387 [ -d "$BUILD_OUTPUT"/boot/isolinux ] || mkdir -p "$BUILD_OUTPUT"/boot/isolinux
388 cp /boot/memtest86+.bin "$BUILD_OUTPUT"/boot/isolinux/memtest
390 # if we don't have an initrd we a) can't boot and b) there was an error
391 # during build, so check for the file:
392 INITRD="$(ls $CHROOT_OUTPUT/boot/initrd* 2>/dev/null| grep -v '.bak$' | sort -r | head -1)"
393 if [ -n "$INITRD" ] ; then
394 cp $INITRD "$BUILD_OUTPUT"/boot/isolinux/initrd.gz
395 find $CHROOT_OUTPUT/boot/ -name initrd\*.bak -exec rm {} \;
397 log "No initrd found inside $CHROOT_OUTPUT/boot/ - Exiting"
398 eerror "No initrd found inside $CHROOT_OUTPUT/boot/ - Exiting" ; eend 1
402 KERNEL_IMAGE="$(ls $CHROOT_OUTPUT/boot/vmlinuz* 2>/dev/null | sort -r | head -1)"
403 if [ -n "$KERNEL_IMAGE" ] ; then
404 cp "$KERNEL_IMAGE" "$BUILD_OUTPUT"/boot/isolinux/linux26
406 log "No kernel found inside $CHROOT_OUTPUT/boot/ - Exiting"
407 eerror "No kernel found inside $CHROOT_OUTPUT/boot/ - Exiting" ; eend 1
411 cp /usr/lib/syslinux/chain.c32 "$BUILD_OUTPUT"/boot/isolinux/
412 cp /usr/lib/syslinux/isolinux.bin "$BUILD_OUTPUT"/boot/isolinux/
413 cp /usr/lib/syslinux/memdisk "$BUILD_OUTPUT"/boot/isolinux/
414 cp /usr/lib/syslinux/menu.c32 "$BUILD_OUTPUT"/boot/isolinux/
416 [ -n "$TEMPLATE_DIRECTORY" ] || TEMPLATE_DIRECTORY='/usr/share/grml-live/templates'
417 if ! [ -d "${TEMPLATE_DIRECTORY}"/boot ] ; then
418 log "${TEMPLATE_DIRECTORY}/boot does not exist. Exiting."
419 eerror "${TEMPLATE_DIRECTORY}/boot does not exist. Exiting." ; eend 1
423 cp ${TEMPLATE_DIRECTORY}/boot/isolinux/* "$BUILD_OUTPUT"/boot/isolinux/
424 cp ${TEMPLATE_DIRECTORY}/boot/isolinux/* "$BUILD_OUTPUT"/boot/isolinux/
426 if ! [ -d "${BUILD_OUTPUT}/boot/grub" ] ; then
427 cp -a ${TEMPLATE_DIRECTORY}/boot/grub "$BUILD_OUTPUT"/boot/
430 if ! [ -d "${TEMPLATE_DIRECTORY}"/GRML ] ; then
431 log "${TEMPLATE_DIRECTORY}/GRML does not exist. Exiting."
432 eerror "${TEMPLATE_DIRECTORY}/GRML does not exist. Exiting." ; eend 1
436 [ -d "$BUILD_OUTPUT"/GRML ] || mkdir "$BUILD_OUTPUT"/GRML
437 cp -a ${TEMPLATE_DIRECTORY}/GRML/* "$BUILD_OUTPUT"/GRML/
439 # adjust boot splash information:
440 RELEASE_INFO="$GRML_NAME $VERSION - Release Codename $RELEASENAME"
441 RELEASE_INFO="$(cut_string 68 "$RELEASE_INFO")"
442 RELEASE_INFO="$(extend_string_end 68 "$RELEASE_INFO")"
444 sed -i "s/%RELEASE_INFO%/$GRML_NAME $VERSION - $RELEASENAME/" "$BUILD_OUTPUT"/GRML/grml-version
445 sed -i "s/%DATE%/$ISO_DATE/" "$BUILD_OUTPUT"/GRML/grml-version
447 sed -i "s/%RELEASE_INFO%/$RELEASE_INFO/" "$BUILD_OUTPUT"/boot/isolinux/boot.msg
448 sed -i "s/%DATE%/$ISO_DATE/" "$BUILD_OUTPUT"/boot/isolinux/boot.msg
450 sed -i "s/%RELEASE_INFO%/$RELEASE_INFO/" "$BUILD_OUTPUT"/boot/isolinux/boot-beep.msg
451 sed -i "s/%DATE%/$ISO_DATE/" "$BUILD_OUTPUT"/boot/isolinux/boot-beep.msg
453 sed -i "s/%VERSION%/$VERSION/" "$BUILD_OUTPUT"/boot/grub/menu.lst
454 sed -i "s/%GRML_NAME%/$GRML_NAME/" "$BUILD_OUTPUT"/boot/grub/menu.lst
456 # autostart for Windows:
457 if [ -d "${TEMPLATE_DIRECTORY}/windows/autostart/" ] ; then
458 cp ${TEMPLATE_DIRECTORY}/windows/autostart/* "$BUILD_OUTPUT"/
462 if [ -n "$WINDOWS_BINARIES" ] ; then
463 if [ -f "$BUILD_OUTPUT"/windows/putty.exe ] ; then
464 log "$BUILD_OUTPUT/windows exists already, skipping stage 'WINDOWS_BINARIES'"
465 ewarn "$BUILD_OUTPUT/windows exists already, skipping stage 'WINDOWS_BINARIES'" ; eend 0
467 if ! [ -d "$BUILD_OUTPUT"/windows ] ; then
468 mkdir "$BUILD_OUTPUT"/windows
469 ( cd "$BUILD_OUTPUT"/windows
470 for file in pageant plink pscp psftp putty puttygen ; do
471 wget -O ${file}.exe ${WINDOWS_BINARIES}/${file}.exe
472 md5sum ${file}.exe > ${file}.exe.md5
476 log "Finished execution of stage 'WINDOWS_BINARIES' [$(date)]"
477 einfo "Finished execution of stage 'WINDOWS_BINARIES'" ; eend 0
479 einfo "Finished execution of stage 'boot'" ; eend 0
482 elif [ "$ARCH" = powerpc ] ; then
483 ewarn 'Warning: formorer, it is your turn. :)'>&2
486 eerror 'Error: Unsupported ARCH, sorry. Want to support it? Contribute!' ; eend 1
489 if [ -f "$BUILD_OUTPUT"/live/grml.squashfs -a -z "$UPDATE" ] ; then
490 log "$BUILD_OUTPUT/live exists already, skipping stage 'squashfs'"
491 ewarn "$BUILD_OUTPUT/live exists already, skipping stage 'squashfs'" ; eend 0
493 [ -d "$BUILD_OUTPUT"/live ] || mkdir "$BUILD_OUTPUT"/live
494 mksquashfs $CHROOT_OUTPUT/* $BUILD_OUTPUT/live/grml.squashfs -noappend
495 log "Finished execution of stage 'squashfs' [$(date)]"
496 einfo "Finished execution of stage 'squashfs'" ; eend 0
499 # create md5sum file:
500 ( cd $BUILD_OUTPUT/GRML &&
501 find .. -type f -not -name md5sums -not -name isolinux.bin -exec md5sum {} \; > md5sums )
504 # ISO_OUTPUT - mkisofs {{{
505 [ -n "$ISO_OUTPUT" ] || ISO_OUTPUT="$OUTPUT/grml_isos"
506 [ -n "$ISO_NAME" ] || ISO_NAME="${GRML_NAME}_${VERSION}.iso"
508 if [ "$BOOT_METHOD" = "isolinux" ] ; then
509 BOOT_FILE="boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat"
510 elif [ "$BOOT_METHOD" = "grub" ] ; then
511 BOOT_FILE="boot/grub/stage2_eltorito"
514 if [ -f "${ISO_OUTPUT}/${ISO_NAME}" -a -z "$UPDATE" ] ; then
515 log "$ISO_OUTPUT exists already, skipping stage 'iso build'"
516 ewarn "$ISO_OUTPUT exists already, skipping stage 'iso build'" ; eend 0
518 mkdir -p "$ISO_OUTPUT" || bailout 6 "Problem with creating $ISO_OUTPUT for stage 'iso build'"
520 cd "$BUILD_OUTPUT" &&
521 mkisofs -V "grml $VERSION" -publisher 'grml-live | grml.org' \
522 -l -r -J -no-emul-boot -boot-load-size 4 -boot-info-table \
524 -o "${ISO_OUTPUT}/${ISO_NAME}" . ; RC=$?
526 if [ "$RC" = 0 ] ; then
527 log "Finished execution of stage 'iso build' [$(date)]"
528 einfo "Finished execution of stage 'iso build'" ; eend 0
530 log "There was an error ($RC) executing stage 'iso build' [$(date)]"
531 eerror "There was an error executing stage 'iso build'" ; eend 1
538 [ -n "$start_seconds" ] && SECONDS="$[$(cut -d . -f 1 /proc/uptime)-$start_seconds]" || SECONDS="unknown"
539 einfo "Sucessfully finished execution of $PN [running ${SECONDS} seconds]" ; eend 0
540 log "Sucessfully finished execution of $PN [running ${SECONDS} seconds]"
544 ## END OF FILE #################################################################
545 # vim:foldmethod=marker ts=2 ft=sh ai expandtab tw=80 sw=3