X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=grml-live;h=a9eebae7ce48e68037aa7949d7f925ed5692a4e8;hb=6946cc59d5dcc03c6531619491d635b42da5d2b4;hp=c39e5d541058ece9669ea751ee8358f5e3b47fc9;hpb=c87434dfc266018f9fed5e0f471749fad154a1a0;p=grml-live.git diff --git a/grml-live b/grml-live index c39e5d5..a9eebae 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: Thu Oct 04 22:16:28 CEST 2007 [mika] +# Latest change: Sat Oct 06 18:28:57 CEST 2007 [mika] ################################################################################ # read configuration files, set some misc variables {{{ @@ -152,14 +152,14 @@ http://grml.org/bugs/ # command line parsing {{{ -while getopts "c:g:i:r:s:t:v:FhV" opt; do +while getopts "c:g:i:o: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" ;; - t) TEMPLATE_DIRECTORY="$OPTARG" + t) TEMPLATE_DIRECTORY="$OPTARG";; o) OUTPUT="$OPTARG" CHROOT_OUTPUT="$OUTPUT/grml_chroot" BUILD_OUTPUT="$OUTPUT/grml_cd" @@ -178,9 +178,9 @@ shift $(($OPTIND - 1)) # set ARGV to the first not parsed commandline parameter # some misc checks before executing FAI {{{ [ -n "$CLASSES" ] || bailout 1 "Error: \$CLASSES unset, please set it in $LIVE_CONF or -specify it on the command line using the -c|--classes option." +specify it on the command line using the -c option." [ -n "$OUTPUT" ] || bailout 1 "Error: \$OUTPUT unset, please set it in $LIVE_CONF or -specify it on the command line using the -t|--target option." +specify it on the command line using the -o option." # }}} # ask user whether the setup is ok {{{ @@ -300,20 +300,40 @@ if [ "$ARCH" = i386 ] || [ "$ARCH" = amd64 ] ; then else # booting stuff: mkdir -p "$BUILD_OUTPUT"/boot/isolinux - cp /boot/memtest86+.bin "$BUILD_OUTPUT"/boot/isolinux/memtest - # do not keep the initrd inside the chroot, let's save space instead: - mv "$CHROOT_OUTPUT"/boot/initrd* "$BUILD_OUTPUT"/boot/isolinux/initrd.gz + cp /boot/memtest86+.bin "$BUILD_OUTPUT"/boot/isolinux/memtest + + # if we don't have an initrd we a) can't boot and b) there was an error + # during build, so check for the file: + if [ -f "$CHROOT_OUTPUT"/boot/initrd* ] ; then + cp "$CHROOT_OUTPUT"/boot/initrd* "$BUILD_OUTPUT"/boot/isolinux/initrd.gz + else + log "No initrd found inside $CHROOT_OUTPUT/boot/ - Exiting" + eerror "No initrd found inside $CHROOT_OUTPUT/boot/ - Exiting" ; eend 1 + bailout 10 + fi + cp "$CHROOT_OUTPUT"/boot/vmlinuz* "$BUILD_OUTPUT"/boot/isolinux/linux26 cp /usr/lib/syslinux/chain.c32 "$BUILD_OUTPUT"/boot/isolinux/ cp /usr/lib/syslinux/isolinux.bin "$BUILD_OUTPUT"/boot/isolinux/ cp /usr/lib/syslinux/memdisk "$BUILD_OUTPUT"/boot/isolinux/ cp /usr/lib/syslinux/menu.c32 "$BUILD_OUTPUT"/boot/isolinux/ - cp /usr/share/grml-live/templates/boot/isolinux/* "$BUILD_OUTPUT"/boot/isolinux/ - cp /usr/share/grml-live/templates/boot/isolinux/* "$BUILD_OUTPUT"/boot/isolinux/ - cp -a /usr/share/grml-live/templates/boot/grub "$BUILD_OUTPUT"/boot/ + if ! [ -d "${TEMPLATE_DIRECTORY}"/boot ] ; then + log "${TEMPLATE_DIRECTORY}/boot does not exist. Exiting." + eerror "${TEMPLATE_DIRECTORY}/boot does not exist. Exiting." ; eend 1 + bailout 8 + fi + cp ${TEMPLATE_DIRECTORY}/boot/isolinux/* "$BUILD_OUTPUT"/boot/isolinux/ + cp ${TEMPLATE_DIRECTORY}/boot/isolinux/* "$BUILD_OUTPUT"/boot/isolinux/ + cp -a ${TEMPLATE_DIRECTORY}/boot/grub "$BUILD_OUTPUT"/boot/ + + if ! [ -d "${TEMPLATE_DIRECTORY}"/GRML ] ; then + log "${TEMPLATE_DIRECTORY}/GRML does not exist. Exiting." + eerror "${TEMPLATE_DIRECTORY}/GRML does not exist. Exiting." ; eend 1 + bailout 9 + fi [ -d "$BUILD_OUTPUT"/GRML ] || mkdir "$BUILD_OUTPUT"/GRML - cp -a /usr/share/grml-live/templates/GRML/* "$BUILD_OUTPUT"/GRML/ + cp -a ${TEMPLATE_DIRECTORY}/GRML/* "$BUILD_OUTPUT"/GRML/ # adjust boot splash information: ISO_DATE="$(date +%Y-%m-%d)" @@ -334,7 +354,9 @@ if [ "$ARCH" = i386 ] || [ "$ARCH" = amd64 ] ; then sed -i "s/%GRML_NAME%/$GRML_NAME/" "$BUILD_OUTPUT"/boot/grub/menu.lst # autostart for Windows: - cp /usr/share/grml-live/templates/windows/autostart/* "$BUILD_OUTPUT"/ + if [ -d "${TEMPLATE_DIRECTORY}/windows/autostart/" ] ; then + cp ${TEMPLATE_DIRECTORY}/windows/autostart/* "$BUILD_OUTPUT"/ + fi # windows-binaries: if [ -n "$WINDOWS_BINARIES" ] ; then if [ -f "$BUILD_OUTPUT"/windows/putty.exe ] ; then