Update docs; usage example and logic of $ARCH
[grml-live.git] / grml-live
1 #!/bin/bash
2 # Filename:      grml-live
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: Wed Oct 17 23:53:13 CEST 2007 [mika]
8 ################################################################################
9
10 # read configuration files, set some misc variables {{{
11
12 export LANG=C
13 export LC_ALL=C
14
15 # exit on any error:
16 set -e
17
18 # we need root permissions for the build-process:
19 if [ "$(id -u 2>/dev/null)" != 0 ] ; then
20    echo "Error: please run this script with uid 0 (root)." >&2
21    exit 1
22 fi
23
24 if [ -r /var/run/fai/FAI_INSTALLATION_IN_PROGRESS ] ; then
25    echo "/usr/sbin/fai already running or was aborted before.">&2
26    echo "You may remove /var/run/fai/FAI_INSTALLATION_IN_PROGRESS and try again.">&2
27    exit 1
28 fi
29
30 # make sure they are not set by default
31 VERBOSE=''
32 FORCE=''
33
34 if [ -r /etc/grml/lsb-functions ] ; then
35    . /etc/grml/lsb-functions
36 else
37    einfo()  { echo "  [*] $*" ;}
38    eerror() { echo "  [!] $*">&2 ;}
39    ewarn()  { echo "  [x] $*" ;}
40    eend()   { return 0 ;}
41 fi
42
43 # source main configuration file:
44 LIVE_CONF=/etc/grml/grml-live.conf
45 . $LIVE_CONF
46
47 PN=$(basename $0)
48 # }}}
49
50 # clean exit {{{
51 bailout() {
52   [ -n "$MIRROR_DIRECTORY" ] && umount "${CHROOT_OUTPUT}/${MIRROR_DIRECTORY}"
53   [ -n "$1" ] && EXIT="$1" || EXIT="1"
54   [ -n "$2" ] && eerror "$2">&2
55   exit "$EXIT"
56 }
57 trap bailout 1 2 3 15
58 # }}}
59
60 # check for important variables {{{
61 [ -n "$GRML_FAI_CONFIG" ] || GRML_FAI_CONFIG=/etc/grml/fai
62 [ -n "$HOSTNAME" ] || HOSTNAME=grml
63 [ -n "$USERNAME" ] || USERNAME=grml
64 [ -n "$CLASSES" ]  || CLASSES="GRML,I386"
65 [ -n "$BOOT_METHOD" ] || BOOT_METHOD='isolinux'
66 [ -n "$OUTPUT" ] || bailout 1 "${PN}: \$OUTPUT not specified. Please adjust $LIVE_CONF. Exiting."
67
68 [ -n "$VERSION" ]  || VERSION="0.0.1"
69 [ -n "$RELEASENAME" ] || RELEASENAME="grml-live rocks"
70 [ -n "$GRML_NAME" ] || GRML_NAME='grml'
71
72 [ -n "$LOGDIR" ] || LOGDIR="/var/log/"
73 LOGFILE="$LOGDIR/grml-live.log"
74 # }}}
75
76 # some important functions {{{
77
78 # log output:
79 # usage: log "string to log"
80 log() { echo "$*" >> $LOGFILE ; }
81
82 # cut string at character number int = $1
83 # usage: cut_string 5 "1234567890" will output "12345"
84 cut_string() {
85   [ -n "$2" ] || return 1
86   echo "$2" | head -c "$1"; echo -ne "\n"
87 }
88
89 # prepend int = $1 spaces before string = $2
90 # usage: extend_string_begin 5 "123" will output "  123"
91 extend_string_begin() {
92   [ -n "$2" ] || return 1
93   local COUNT="$(echo $2 | wc -c)"
94   local FILL="$(expr $COUNT - $1)"
95   while [ "$FILL" -gt 1 ] ; do
96     echo -n " "
97     local FILL=$(expr $FILL - 1)
98   done
99   while [ "$FILL" -lt 1 ] ; do
100     echo -n " "
101     local FILL=$(expr $FILL + 1)
102   done
103   echo "$2" | head -c "$1"; echo -ne "\n"
104 }
105
106 # append int = $1 spaces to string = $2
107 # usage: extend_string_begin 5 "123" will output "123  "
108 extend_string_end() {
109   [ -n "$2" ] || return 1
110   echo -n "$2" | head -c "$1"
111   local COUNT="$(echo $2 | wc -c)"
112   local FILL="$(expr $COUNT - $1)"
113   while [ "$FILL" -gt 1 ] ; do
114     echo -n " "
115     local FILL=$(expr $FILL - 1)
116   done
117   while [ "$FILL" -lt 1 ] ; do
118     echo -n " "
119     local FILL=$(expr $FILL + 1)
120   done
121   echo -ne "\n"
122 }
123 # }}}
124
125 # usage information {{{
126 usage()
127 {
128   echo "
129 $PN - build process script for generating a (grml based) Linux Live-ISO
130
131 Usage: $PN [-a <architecture>] [-c <classe[s]>] [-g <grml_name>] \\
132                  [-i <iso_name> ] [-o <output_directory>] [-s <suite>] \\
133                  [-t <template_directory>] [-s <suite>] \\
134                  [-v <version_number>] [-FVh]
135
136 Usage examples:
137
138     $PN
139     $PN -c GRMLBASE,GRML_SMALL,I386 -o /grml/
140     $PN -c GRMLBASE,GRML_MEDIUM,I386 -o /dev/shm/grml
141     $PN -c GRMLBASE,GRML_SMALL,I386 -g grml-small -v 1.0
142     $PN -c GRMLBASE,GRML_FULL,I386 -i grml_0.0-1.iso -v 0.0-1
143     $PN -c GRMLBASE,GRML_FULL,I386 -s sid -V -r 'grml-live rocks'
144
145 More details: man grml-live
146               /usr/share/doc/grml-live/grml-live.html
147
148 Please send your bug reports, feedback,.. to the grml-team.
149 http://grml.org/bugs/
150 "
151 }
152 # }}}
153
154 # command line parsing {{{
155
156 while getopts "a:c:g:i:o:r:s:t:v:FhV" opt; do
157   case "$opt" in
158     a) ARCH="$OPTARG" ;;
159     c) CLASSES="$OPTARG" ;;
160     g) GRML_NAME="$OPTARG" ;;
161     i) ISO_NAME="$OPTARG" ;;
162     o) OUTPUT="$OPTARG"
163        CHROOT_OUTPUT="$OUTPUT/grml_chroot"
164        BUILD_OUTPUT="$OUTPUT/grml_cd"
165        ISO_OUTPUT="$OUTPUT/grml_isos"
166        ;;
167     r) RELEASENAME="$OPTARG" ;;
168     s) SUITE="$OPTARG" ;;
169     t) TEMPLATE_DIRECTORY="$OPTARG";;
170     v) VERSION="$OPTARG" ;;
171     F) FORCE=1 ;;
172     h) usage ; bailout 0 ;;
173     V) VERBOSE="-v" ;;
174     ?) echo "invalid option -$OPTARG" >&2; bailout 1 ;;
175   esac
176 done
177 shift $(($OPTIND - 1))  # set ARGV to the first not parsed commandline parameter
178
179 echo "Executing: $(basename $0) $*" >> $LOGFILE
180 # }}}
181
182 # some misc checks before executing FAI {{{
183 [ -n "$CLASSES" ] || bailout 1 "Error: \$CLASSES unset, please set it in $LIVE_CONF or
184 specify it on the command line using the -c option."
185 [ -n "$OUTPUT" ] || bailout 1 "Error: \$OUTPUT unset, please set it in $LIVE_CONF or
186 specify it on the command line using the -o option."
187 # }}}
188
189 # ask user whether the setup is ok {{{
190 if [ -z "$FORCE" ] ; then
191    echo
192    echo "${PN}: check your configuration (or use -F to force execution without prompting):"
193    echo
194    echo "  FAI classes:       $CLASSES"
195    echo "  main directory:    $OUTPUT"
196    [ -n "$CHROOT_OUTPUT" ] && echo "  chroot target:     $CHROOT_OUTPUT"
197    [ -n "$BUILD_OUTPUT" ]  && echo "  build target:      $BUILD_OUTPUT"
198    [ -n "$ISO_OUTPUT" ]    && echo "  ISO target:        $ISO_OUTPUT"
199    [ -n "$GRML_NAME" ]     && echo "  grml name:         $GRML_NAME"
200    [ -n "$RELEASENAME" ]   && echo "  release name:      $RELEASENAME"
201    [ -n "$VERSION" ]       && echo "  grml version:      $VERSION"
202    [ -n "$SUITE" ]         && echo "  Debian suite:      $SUITE"
203    [ -n "$ARCH" ]          && echo "  Architecture:      $ARCH"
204    [ -n "$BOOT_METHOD" ]   && echo "  Boot method:       $BOOT_METHOD"
205    [ -n "$TEMPLATE_DIRECTORY" ] && echo "  Template files:    $TEMPLATE_DIRECTORY"
206    [ -n "$FAI_ARGS" ]      && echo "  additional arguments for FAI: $FAI_ARGS"
207    [ -n "$VERBOSE" ]       && echo "  Using VERBOSE mode."
208    echo
209    echo -n "Is this ok for you? [y/N] "
210    read a
211    if ! [ "$a" = 'y' -o "$a" = 'Y' ] ; then
212       bailout 1 "Exiting as requested."
213    fi
214    echo
215
216    start_seconds=$(cut -d . -f 1 /proc/uptime)
217    log "------------------------------------------------------------------------------"
218    log "Starting grml-live run [$(date)]"
219 fi
220 # }}}
221
222 # on-the-fly configuration {{{
223 if [ -n "$MIRROR_DIRECTORY" ] ; then
224    if ! [ -d "$MIRROR_DIRECTORY/debian" ] ; then
225       log "Sorry, $MIRROR_DIRECTORY/debian does not seem to exist. Exiting. [$(date)]"
226       eerror "Sorry, $MIRROR_DIRECTORY/debian does not seem to exist. Exiting."
227       bailout 1
228    fi
229    echo "$MIRROR_SOURCES" > /etc/grml/fai/apt/sources.list
230    if [ -n "$GRML_LIVE_SOURCES" ] ; then
231       echo "$GRML_LIVE_SOURCES" >> /etc/grml/fai/apt/sources.list
232    fi
233 elif [ -n "$GRML_LIVE_SOURCES" ] ; then
234    echo "$GRML_LIVE_SOURCES" > /etc/grml/fai/apt/sources.list
235 fi
236
237 if [ -n "$FAI_DEBOOTSTRAP" ] ; then
238    sed -i "s#^FAI_DEBOOTSTRAP=.*#FAI_DEBOOTSTRAP=\"$FAI_DEBOOTSTRAP\"#" /etc/grml/fai/make-fai-nfsroot.conf
239 fi
240
241 # does this suck? YES!
242 if [ -n "$SUITE" ] ; then
243    sed -i "s/SUITE=.*/SUITE=\"$SUITE\"/" $LIVE_CONF
244
245    DIST="\|\ etch\ \|\ stable\ \|\ lenny\ \|\ testing\ \|\ sid\ \|\ unstable\ "
246    sed -i "s/\(deb .\+\)\([ \t]+\)$DIST\([ \t]+\)\(main \)/\1\2 $SUITE \3\4/" $LIVE_CONF
247    sed -i "s/\(deb .\+\)\([ \t]+\)$DIST\([ \t]+\)\(main \)/\1\2 $SUITE \3\4/" /etc/grml/fai/apt/sources.list
248
249    sed -i "s|FAI_DEBOOTSTRAP=\"[a-z]* |FAI_DEBOOTSTRAP=\"$SUITE |" $LIVE_CONF
250    sed -i "s|FAI_DEBOOTSTRAP=\"[a-z]* |FAI_DEBOOTSTRAP=\"$SUITE |" /etc/grml/fai/make-fai-nfsroot.conf
251 fi
252
253 # set $ARCH
254 if grep -q -- 'FAI_DEBOOTSTRAP_OPTS.*--arch' /etc/grml/fai/make-fai-nfsroot.conf || \
255    [ "$(dpkg --print-architecture)" != "$ARCH" ] ; then
256    sed -i "s|FAI_DEBOOTSTRAP_OPTS=\"\(.*\)|FAI_DEBOOTSTRAP_OPTS=\"--arch $ARCH \1|" /etc/grml/fai/make-fai-nfsroot.conf
257 fi
258 # }}}
259
260 # CHROOT_OUTPUT - execute FAI {{{
261 [ -n "$CHROOT_OUTPUT" ] || CHROOT_OUTPUT="$OUTPUT/grml_chroot"
262
263 if [ -d "$CHROOT_OUTPUT/bin" ] ; then
264    log "$CHROOT_OUTPUT exists already, skipping stage 'fai dirinstall'"
265    ewarn "$CHROOT_OUTPUT exists already, skipping stage 'fai dirinstall'" ; eend 0
266 else
267    mkdir -p "$CHROOT_OUTPUT" || bailout 5 "Problem with creating $CHROOT_OUTPUT for FAI"
268    if [ -n "${MIRROR_DIRECTORY}" ] ; then
269       mkdir -p "${CHROOT_OUTPUT}/${MIRROR_DIRECTORY}"
270       mount --bind "${MIRROR_DIRECTORY}" "${CHROOT_OUTPUT}/${MIRROR_DIRECTORY}"
271    fi
272    fai $VERBOSE -C "$GRML_FAI_CONFIG" -c"$CLASSES" -u "$HOSTNAME" dirinstall "$CHROOT_OUTPUT" $FAI_ARGS | tee -a $LOGFILE
273    umount $CHROOT_OUTPUT/proc 2>/dev/null || /bin/true
274    umount $CHROOT_OUTPUT/sys  2>/dev/null || /bin/true
275    [ -n "$MIRROR_DIRECTORY" ] && umount "${CHROOT_OUTPUT}/${MIRROR_DIRECTORY}"
276
277    # notice: 'fai dirinstall' does not seem to exit appropriate, so:
278    ERROR=''
279    if [ -r "/var/log/fai/dirinstall/$HOSTNAME/software.log" ] ; then
280       # 1 errors during executing of commands
281       grep 'dpkg: error processing' /var/log/fai/dirinstall/$HOSTNAME/software.log >> $LOGFILE && ERROR=1
282       grep 'E: Method http has died unexpectedly!' /var/log/fai/dirinstall/$HOSTNAME/software.log >> $LOGFILE && ERROR=2
283       grep 'ERROR: chroot' /var/log/fai/dirinstall/$HOSTNAME/software.log >> $LOGFILE && ERROR=3
284    fi
285
286    if [ -r "/var/log/fai/dirinstall/$HOSTNAME/shell.log" ] ; then
287       grep 'FAILED with exit code' /var/log/fai/dirinstall/$HOSTNAME/shell.log >> $LOGFILE && ERROR=2
288    fi
289
290    if [ -n "$ERROR" ] ; then
291       log "There was an error [${ERROR}] during execution of stage 'fai dirinstall' [$(date)]"
292       eerror "There was an error during execution of stage 'fai dirinstall'"
293       echo "   Check out /var/log/fai/dirinstall/$HOSTNAME/ for details. [exit ${ERROR}]"
294       eend 1
295       bailout 1
296    else
297       log "Finished execution of stage 'fai dirinstall' [$(date)]"
298       einfo "Finished execution of stage 'fai dirinstall'"
299    fi
300 fi
301 # }}}
302
303 # BUILD_OUTPUT - execute arch specific stuff and squashfs {{{
304 [ -n "$BUILD_OUTPUT" ] || BUILD_OUTPUT="$OUTPUT/grml_cd"
305 mkdir -p "$BUILD_OUTPUT" || bailout 6 "Problem with creating $BUILD_OUTPUT for stage ARCH"
306
307 [ -n "$ARCH" ] || ARCH="$(dpkg --print-architecture)"
308
309 # i386:
310 if [ "$ARCH" = i386 ] || [ "$ARCH" = amd64 ] ; then
311    if [ -d "$BUILD_OUTPUT"/boot ] ; then
312       log "$BUILD_OUTPUT/boot exists already, skipping stage 'boot'"
313       ewarn "$BUILD_OUTPUT/boot exists already, skipping stage 'boot'" ; eend 0
314    else
315       # booting stuff:
316       mkdir -p "$BUILD_OUTPUT"/boot/isolinux
317       cp /boot/memtest86+.bin "$BUILD_OUTPUT"/boot/isolinux/memtest
318
319       # if we don't have an initrd we a) can't boot and b) there was an error
320       # during build, so check for the file:
321       if [ -f "$CHROOT_OUTPUT"/boot/initrd* ] ; then
322          cp "$CHROOT_OUTPUT"/boot/initrd*  "$BUILD_OUTPUT"/boot/isolinux/initrd.gz
323       else
324          log "No initrd found inside $CHROOT_OUTPUT/boot/ - Exiting"
325          eerror "No initrd found inside $CHROOT_OUTPUT/boot/ - Exiting" ; eend 1
326          bailout 10
327       fi
328
329       cp "$CHROOT_OUTPUT"/boot/vmlinuz*                    "$BUILD_OUTPUT"/boot/isolinux/linux26
330       cp /usr/lib/syslinux/chain.c32                       "$BUILD_OUTPUT"/boot/isolinux/
331       cp /usr/lib/syslinux/isolinux.bin                    "$BUILD_OUTPUT"/boot/isolinux/
332       cp /usr/lib/syslinux/memdisk                         "$BUILD_OUTPUT"/boot/isolinux/
333       cp /usr/lib/syslinux/menu.c32                        "$BUILD_OUTPUT"/boot/isolinux/
334
335       [ -n "$TEMPLATE_DIRECTORY" ] || TEMPLATE_DIRECTORY='/usr/share/grml-live/templates'
336       if ! [ -d "${TEMPLATE_DIRECTORY}"/boot ] ; then
337          log "${TEMPLATE_DIRECTORY}/boot does not exist. Exiting."
338          eerror "${TEMPLATE_DIRECTORY}/boot does not exist. Exiting." ; eend 1
339          bailout 8
340       fi
341       cp ${TEMPLATE_DIRECTORY}/boot/isolinux/*               "$BUILD_OUTPUT"/boot/isolinux/
342       cp ${TEMPLATE_DIRECTORY}/boot/isolinux/*               "$BUILD_OUTPUT"/boot/isolinux/
343       cp -a ${TEMPLATE_DIRECTORY}/boot/grub                  "$BUILD_OUTPUT"/boot/
344
345       if ! [ -d "${TEMPLATE_DIRECTORY}"/GRML ] ; then
346          log "${TEMPLATE_DIRECTORY}/GRML does not exist. Exiting."
347          eerror "${TEMPLATE_DIRECTORY}/GRML does not exist. Exiting." ; eend 1
348          bailout 9
349       fi
350       [ -d "$BUILD_OUTPUT"/GRML ] || mkdir "$BUILD_OUTPUT"/GRML
351       cp -a ${TEMPLATE_DIRECTORY}/GRML/* "$BUILD_OUTPUT"/GRML/
352
353       # adjust boot splash information:
354       ISO_DATE="$(date +%Y-%m-%d)"
355       RELEASE_INFO="$GRML_NAME $VERSION - Release Codename $RELEASENAME"
356       RELEASE_INFO="$(cut_string 68 "$RELEASE_INFO")"
357       RELEASE_INFO="$(extend_string_end 68 "$RELEASE_INFO")"
358
359       sed -i "s/%RELEASE_INFO%/$GRML_NAME $VERSION - $RELEASENAME/" "$BUILD_OUTPUT"/GRML/grml-version
360       sed -i "s/%DATE%/$ISO_DATE/"             "$BUILD_OUTPUT"/GRML/grml-version
361
362       sed -i "s/%RELEASE_INFO%/$RELEASE_INFO/" "$BUILD_OUTPUT"/boot/isolinux/boot.msg
363       sed -i "s/%DATE%/$ISO_DATE/"             "$BUILD_OUTPUT"/boot/isolinux/boot.msg
364
365       sed -i "s/%RELEASE_INFO%/$RELEASE_INFO/" "$BUILD_OUTPUT"/boot/isolinux/boot-beep.msg
366       sed -i "s/%DATE%/$ISO_DATE/"             "$BUILD_OUTPUT"/boot/isolinux/boot-beep.msg
367
368       sed -i "s/%VERSION%/$VERSION/"           "$BUILD_OUTPUT"/boot/grub/menu.lst
369       sed -i "s/%GRML_NAME%/$GRML_NAME/"       "$BUILD_OUTPUT"/boot/grub/menu.lst
370
371       # autostart for Windows:
372       if [ -d "${TEMPLATE_DIRECTORY}/windows/autostart/" ] ; then
373          cp ${TEMPLATE_DIRECTORY}/windows/autostart/* "$BUILD_OUTPUT"/
374       fi
375       # windows-binaries:
376       if [ -n "$WINDOWS_BINARIES" ] ; then
377          if [ -f "$BUILD_OUTPUT"/windows/putty.exe ] ; then
378             log "$BUILD_OUTPUT/windows exists already, skipping stage 'WINDOWS_BINARIES'"
379             ewarn "$BUILD_OUTPUT/windows exists already, skipping stage 'WINDOWS_BINARIES'" ; eend 0
380          else
381             mkdir "$BUILD_OUTPUT"/windows
382             ( cd "$BUILD_OUTPUT"/windows
383               for file in pageant plink pscp psftp putty puttygen ; do
384                  wget -O ${file}.exe ${WINDOWS_BINARIES}/${file}.exe
385               done )
386          fi
387       log "Finished execution of stage 'WINDOWS_BINARIES' [$(date)]"
388       einfo "Finished execution of stage 'WINDOWS_BINARIES'" ; eend 0
389       fi
390    einfo "Finished execution of stage 'boot'" ; eend 0
391    fi
392 # ppc:
393 elif [ "$ARCH" = powerpc ] ; then
394     ewarn 'Warning: formorer, it is your turn. :)'>&2
395 # unsuported:
396 else
397    eerror 'Error: Unsupported ARCH, sorry. Want to support it? Contribute!' ; eend 1
398 fi
399
400 if [ -f "$BUILD_OUTPUT"/live/grml.squashfs ] ; then
401    log "$BUILD_OUTPUT/live exists already, skipping stage 'squashfs'"
402    ewarn "$BUILD_OUTPUT/live exists already, skipping stage 'squashfs'" ; eend 0
403 else
404    mkdir "$BUILD_OUTPUT"/live
405    mksquashfs $CHROOT_OUTPUT/* $BUILD_OUTPUT/live/grml.squashfs -noappend
406    log "Finished execution of stage 'squashfs' [$(date)]"
407    einfo "Finished execution of stage 'squashfs'" ; eend 0
408 fi
409
410 # create md5sum file:
411 ( cd $BUILD_OUTPUT/GRML &&
412 find .. -type f -not -name md5sums -not -name isolinux.bin -exec md5sum {} \; > md5sums )
413 # }}}
414
415 # ISO_OUTPUT - mkisofs {{{
416 [ -n "$ISO_OUTPUT" ] || ISO_OUTPUT="$OUTPUT/grml_isos"
417 [ -n "$ISO_NAME" ] || ISO_NAME="${GRML_NAME}_${VERSION}.iso"
418
419 if [ "$BOOT_METHOD" = "isolinux" ] ; then
420    BOOT_FILE="boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat"
421 elif [ "$BOOT_METHOD" = "grub" ] ; then
422    BOOT_FILE="boot/grub/stage2_eltorito"
423 fi
424
425 if [ -f "${ISO_OUTPUT}/${ISO_NAME}" ] ; then
426    log "$ISO_OUTPUT exists already, skipping stage 'iso build'"
427    ewarn "$ISO_OUTPUT exists already, skipping stage 'iso build'" ; eend 0
428 else
429    mkdir -p "$ISO_OUTPUT" || bailout 6 "Problem with creating $ISO_OUTPUT for stage 'iso build'"
430    CURRENT_DIR=$(pwd)
431    cd "$BUILD_OUTPUT" &&
432    mkisofs -V "grml $VERSION" -publisher 'grml-live | grml.org' \
433            -l -r -J -no-emul-boot -boot-load-size 4 -boot-info-table    \
434            -b $BOOT_FILE \
435            -o "${ISO_OUTPUT}/${ISO_NAME}" . ; RC=$?
436    cd $CURRENT_DIR
437    if [ "$RC" = 0 ] ; then
438       log "Finished execution of stage 'iso build' [$(date)]"
439       einfo "Finished execution of stage 'iso build'" ; eend 0
440    else
441       log "There was an error ($RC) executing stage 'iso build' [$(date)]"
442       eerror "There was an error executing stage 'iso build'" ; eend 1
443       bailout $RC
444    fi
445 fi
446 # }}}
447
448 # finalize {{{
449 [ -n "$start_seconds" ] && SECONDS="$[$(cut -d . -f 1 /proc/uptime)-$start_seconds]"
450 einfo "Sucessfully finished execution of $PN [running ${SECONDS} seconds]" ; eend 0
451 log "Sucessfully finished execution of $PN [running ${SECONDS} seconds]"
452 log "------------------------------------------------------------------------------"
453 bailout 0
454 # }}}
455
456 ## END OF FILE #################################################################
457 # vim:foldmethod=marker ts=2 ft=sh ai expandtab tw=80 sw=3