X-Git-Url: http://git.grml.org/?p=grml-live.git;a=blobdiff_plain;f=grml-live;h=e31244d1edc6df35eec2626b0a32150fda285135;hp=cde31dbec752bd6edbcf733d896ab42000517798;hb=4f8937bce96f552121e525eb927a2daea4dfae88;hpb=ba7961163922f615bca1ae148a9c462e5320e626 diff --git a/grml-live b/grml-live index cde31db..e31244d 100755 --- a/grml-live +++ b/grml-live @@ -4,7 +4,7 @@ # Authors: grml-team (grml.org), (c) Michael Prokop # Bug-Reports: see http://grml.org/bugs/ # License: This file is licensed under the GPL v2 or any later version. -# Latest change: Fri Sep 21 11:44:43 CEST 2007 [mika] +# Latest change: Sat Sep 29 10:44:26 CEST 2007 [mika] ################################################################################ # read configuration files, set some misc variables {{{ @@ -61,6 +61,7 @@ trap bailout 1 2 3 15 [ -n "$VERSION" ] || VERSION="0.0.1" [ -n "$RELEASENAME" ] || RELEASENAME="grml-live rocks" +[ -n "$GRML_NAME" ] || GRML_NAME='grml' [ -n "$LOGDIR" ] || LOGDIR="/var/log/fai/dirinstall/$HOSTNAME" [ -d "$LOGDIR" ] || mkdir -p $LOGDIR @@ -122,17 +123,18 @@ usage() echo " $PN - build process script for generating a (grml based) Linux Live-ISO -Usage: $PN [-c ] [-i ] [-r ] \\ - [-s ] [-t ] [-v ] [-Fvh] +Usage: $PN [-c ] [-g ] [-i ] \\ + [-r ] [-s ] [-t ] \\ + [-v ] [-FVh] Usage examples: $PN $PN -c GRMLBASE,GRML_X,I386 -t /grml/ $PN -c GRMLBASE,I386 -t /dev/shm/grml - $PN -c GRMLBASE,GRML_SMALL,I386 - $PN -c GRMLBASE,I386 -v -i grml_0.0-1.iso - $PN -c GRMLBASE,I386 -s sid + $PN -c GRMLBASE,GRML_SMALL,I386 -g grml-small -v 1.0 + $PN -c GRMLBASE,I386 -i grml_0.0-1.iso + $PN -c GRMLBASE,I386 -s sid -V More details: man grml-live /usr/share/doc/grml-live/grml-live.html @@ -145,9 +147,10 @@ http://grml.org/bugs/ # command line parsing {{{ -while getopts "c:i:r:s:t:v:FhV" opt; do +while getopts "c:g:i:r:s:t:v:FhV" opt; do case "$opt" in c) CLASSES="$OPTARG" ;; + g) GRML_NAME="$OPTARG" ;; i) ISO_NAME="$OPTARG" ;; r) RELEASENAME="$OPTARG" ;; s) SUITE="$OPTARG" ;; @@ -247,7 +250,7 @@ else mkdir -p "${CHROOT_TARGET}/${MIRROR_DIRECTORY}" mount --bind "${MIRROR_DIRECTORY}" "${CHROOT_TARGET}/${MIRROR_DIRECTORY}" fi - fai $VERBOSE -C "$GRML_FAI_CONFIG" -c"$CLASSES" dirinstall "$CHROOT_TARGET" $FAI_ARGS | tee -a $LOGFILE + fai $VERBOSE -C "$GRML_FAI_CONFIG" -c"$CLASSES" -u "$HOSTNAME" dirinstall "$CHROOT_TARGET" $FAI_ARGS | tee -a $LOGFILE umount $CHROOT_TARGET/proc 2>/dev/null || /bin/true umount $CHROOT_TARGET/sys 2>/dev/null || /bin/true [ -n "$MIRROR_DIRECTORY" ] && umount "${CHROOT_TARGET}/${MIRROR_DIRECTORY}" @@ -265,7 +268,7 @@ else if [ -n "$ERROR" ] ; then log "There was an error during execution of stage 'fai dirinstall' [$(date)]" eerror "There was an error during execution of stage 'fai dirinstall'" - echo " Check out /var/log/fai/dirinstall/$HOSTNAME/... for details. [exit ${ERROR}]" + echo " Check out /var/log/fai/dirinstall/$HOSTNAME/ for details. [exit ${ERROR}]" eend 1 ; exit 1 else log "Finished execution of stage 'fai dirinstall' [$(date)]" @@ -288,38 +291,40 @@ if [ "$ARCH" = i386 ] || [ "$ARCH" = amd64 ] ; then else # booting stuff: mkdir -p "$BUILD_TARGET"/boot/isolinux + cp /boot/memtest86+.bin "$BUILD_TARGET"/boot/isolinux/memtest + cp "$CHROOT_TARGET"/boot/initrd* "$BUILD_TARGET"/boot/isolinux/initrd.gz + cp "$CHROOT_TARGET"/boot/vmlinuz* "$BUILD_TARGET"/boot/isolinux/linux26 + cp /usr/lib/syslinux/chain.c32 "$BUILD_TARGET"/boot/isolinux/ + cp /usr/lib/syslinux/isolinux.bin "$BUILD_TARGET"/boot/isolinux/ + cp /usr/lib/syslinux/memdisk "$BUILD_TARGET"/boot/isolinux/ + cp /usr/lib/syslinux/menu.c32 "$BUILD_TARGET"/boot/isolinux/ + cp /usr/share/grml-live/templates/boot/isolinux/* "$BUILD_TARGET"/boot/isolinux/ + cp /usr/share/grml-live/templates/boot/isolinux/* "$BUILD_TARGET"/boot/isolinux/ + cp -a /usr/share/grml-live/templates/boot/grub "$BUILD_TARGET"/boot/ + [ -d "$BUILD_TARGET"/GRML ] || mkdir "$BUILD_TARGET"/GRML - cp /boot/memtest86+.bin "$BUILD_TARGET"/boot/isolinux/memtest - cp "$CHROOT_TARGET"/boot/initrd* "$BUILD_TARGET"/boot/isolinux/initrd.gz - cp "$CHROOT_TARGET"/boot/vmlinuz* "$BUILD_TARGET"/boot/isolinux/linux26 - cp /usr/lib/syslinux/chain.c32 "$BUILD_TARGET"/boot/isolinux/ - cp /usr/lib/syslinux/isolinux.bin "$BUILD_TARGET"/boot/isolinux/ - cp /usr/lib/syslinux/memdisk "$BUILD_TARGET"/boot/isolinux/ - cp /usr/lib/syslinux/menu.c32 "$BUILD_TARGET"/boot/isolinux/ - cp /usr/share/grml-live/i386_files/boot/isolinux/* "$BUILD_TARGET"/boot/isolinux/ - cp /usr/share/grml-live/i386_files/boot/isolinux/* "$BUILD_TARGET"/boot/isolinux/ - cp -a /usr/share/grml-live/i386_files/boot/grub "$BUILD_TARGET"/boot/ + cp -a /usr/share/grml-live/templates/GRML/* "$BUILD_TARGET"/GRML/ # adjust boot splash information: ISO_DATE="$(date +%Y-%m-%d)" - VERSION="$(cut_string 5 "$VERSION")" ; VERSION="$(extend_string_end 5 "$VERSION")" - RELEASENAME="$(cut_string 30 "$RELEASENAME")" ; RELEASENAME="$(extend_string_end 30 "$RELEASENAME")" + RELEASE_INFO="$GRML_NAME $VERSION - Release Codename $RELEASENAME" + RELEASE_INFO="$(cut_string 68 "$RELEASE_INFO")" + RELEASE_INFO="$(extend_string_end 68 "$RELEASE_INFO")" + + sed -i "s/%RELEASE_INFO%/$GRML_NAME $VERSION - $RELEASENAME/" "$BUILD_TARGET"/GRML/grml-version + sed -i "s/%DATE%/$ISO_DATE/" "$BUILD_TARGET"/GRML/grml-version - sed -i "s/%VERSION%/$VERSION/" "$BUILD_TARGET"/boot/isolinux/boot.msg - sed -i "s/%RELEASENAME%/$RELEASENAME/" "$BUILD_TARGET"/boot/isolinux/boot.msg - sed -i "s/%DATE%/$ISO_DATE/" "$BUILD_TARGET"/boot/isolinux/boot.msg + sed -i "s/%RELEASE_INFO%/$RELEASE_INFO/" "$BUILD_TARGET"/boot/isolinux/boot.msg + sed -i "s/%DATE%/$ISO_DATE/" "$BUILD_TARGET"/boot/isolinux/boot.msg - sed -i "s/%VERSION%/$VERSION/" "$BUILD_TARGET"/boot/isolinux/boot-beep.msg - sed -i "s/%RELEASENAME%/$RELEASENAME/" "$BUILD_TARGET"/boot/isolinux/boot-beep.msg - sed -i "s/%DATE%/$ISO_DATE/" "$BUILD_TARGET"/boot/isolinux/boot-beep.msg + sed -i "s/%RELEASE_INFO%/$RELEASE_INFO/" "$BUILD_TARGET"/boot/isolinux/boot-beep.msg + sed -i "s/%DATE%/$ISO_DATE/" "$BUILD_TARGET"/boot/isolinux/boot-beep.msg - sed -i "s/%VERSION%/$VERSION/" "$BUILD_TARGET"/boot/grub/menu.lst + sed -i "s/%VERSION%/$VERSION/" "$BUILD_TARGET"/boot/grub/menu.lst + sed -i "s/%GRML_NAME%/$GRML_NAME/" "$BUILD_TARGET"/boot/grub/menu.lst # autostart for Windows: - cp /usr/share/grml-live/windows/autostart/autorun.bat "$BUILD_TARGET"/ - cp /usr/share/grml-live/windows/autostart/autorun.inf "$BUILD_TARGET"/ - cp /usr/share/grml-live/windows/autostart/autorun.pif "$BUILD_TARGET"/ - cp /usr/share/grml-live/windows/autostart/cdrom.ico "$BUILD_TARGET"/ + cp /usr/share/grml-live/templates/windows/autostart/* "$BUILD_TARGET"/ # windows-binaries: if [ -n "$WINDOWS_BINARIES" ] ; then if [ -f "$BUILD_TARGET"/windows/putty.exe ] ; then @@ -354,11 +359,15 @@ else log "Finished execution of stage 'squashfs' [$(date)]" einfo "Finished execution of stage 'squashfs'" ; eend 0 fi + +# create md5sum file: +( cd $BUILD_TARGET/GRML && +find .. -type f -not -name md5sums -exec md5sum {} \; > md5sums ) # }}} # ISO_TARGET - mkisofs {{{ [ -n "$ISO_TARGET" ] || ISO_TARGET="$TARGET/grml_isos" -[ -n "$ISO_NAME" ] || ISO_NAME="grml_${VERSION}.iso" +[ -n "$ISO_NAME" ] || ISO_NAME="$GRML_NAME_${VERSION}.iso" if [ "$BOOT_METHOD" = "isolinux" ] ; then BOOT_FILE="boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat" @@ -390,7 +399,7 @@ fi # }}} # finalize {{{ -SECONDS="$[$(cut -d . -f 1 /proc/uptime)-$start_seconds]" +[ -n "$start_seconds" ] && SECONDS="$[$(cut -d . -f 1 /proc/uptime)-$start_seconds]" einfo "Sucessfully finished execution of $PN [running ${SECONDS} seconds]" ; eend 0 log "Sucessfully finished execution of $PN [running ${SECONDS} seconds]" log "------------------------------------------------------------------------------"