X-Git-Url: https://git.grml.org/?p=grml-live.git;a=blobdiff_plain;f=grml-live;h=5ef31a192e01bc6f54e800fc86abd83f2c5ae4a1;hp=b62e89b742b974edb8c44cebedd22fb90dfad232;hb=bfb132d5c8d0fcf23ba6ce1b3e249824dce14552;hpb=a7f99c464099634bbb5472b5889430f84f1fe9f5 diff --git a/grml-live b/grml-live index b62e89b..5ef31a1 100755 --- a/grml-live +++ b/grml-live @@ -12,6 +12,9 @@ export LANG=C export LC_ALL=C +# avoid leaking into chroots +unset TMPDIR + # define function getfilesize before "set -e" if stat --help >/dev/null 2>&1; then getfilesize='stat -c %s' # GNU stat @@ -61,7 +64,7 @@ Usage: $PN [options, see as follows] -q skip mksquashfs -Q skip netboot package build -r release name - -s Debian suite; values: etch, lenny, squeeze, sid + -s Debian suite/release, like: stable, testing, unstable -t place of the templates -u update existing chroot instead of rebuilding it from scratch -U arrange output to be owned by specified username @@ -74,7 +77,7 @@ Usage examples: $PN $PN -c GRMLBASE,GRML_FULL,AMD64 -o /dev/shm/grml $PN -c GRMLBASE,GRML_FULL,AMD64 -i grml_0.0-1.iso -v 0.0-1 - $PN -c GRMLBASE,GRML_FULL,AMD64 -s sid -V -r 'grml-live rocks' + $PN -c GRMLBASE,GRML_FULL,AMD64 -s stable -V -r 'grml-ftw' More details: man grml-live + /usr/share/doc/grml-live/grml-live.html http://grml.org/grml-live/ @@ -144,7 +147,13 @@ fi # source main configuration file: LIVE_CONF=/etc/grml/grml-live.conf -. $LIVE_CONF +if ! [ -r "$LIVE_CONF" ] ; then + ewarn "Configuration file $LIVE_CONF can not be read, ignoring" +else + einfo "Sourcing configuration file $LIVE_CONF" + . $LIVE_CONF + eend $? +fi # }}} # umount all directories {{{ @@ -330,10 +339,15 @@ while getopts "a:C:c:d:D:e:g:i:I:o:r:s:t:U:v:AbBFhnNqQuVz" opt; do U) CHOWN_USER="$OPTARG" ;; V) VERBOSE="-v" ;; z) SQUASHFS_ZLIB=1 ;; - ?) echo "invalid option -$OPTARG" >&2; bailout 1 ;; + ?) echo "invalid option -$OPTARG" >&2; usage; bailout 1 ;; esac done shift $(($OPTIND - 1)) # set ARGV to the first not parsed commandline parameter + +if [ -n "$1" ] ; then + echo "Error: unknown argument '$1' in options. Exiting to avoid possible data loss." >&2 + bailout 1 +fi # }}} # read local (non-packaged) configuration {{{ @@ -463,7 +477,9 @@ if [ -z "$FORCE" ] ; then echo -n "Is this ok for you? [y/N] " read a if ! [ "$a" = 'y' -o "$a" = 'Y' ] ; then - bailout 1 "Exiting as requested." + CLEAN_ARTIFACTS=0 + echo "Exiting as requested." + exit 0 fi echo fi @@ -592,7 +608,7 @@ export SUITE # make sure it's available in FAI scripts # validate whether the specified architecture class matches the # architecture (option), otherwise installation of kernel will fail -if echo $CLASSES | grep -qi i386 ; then +if echo $CLASSES | grep -qw I386 ; then if ! [[ "$ARCH" == "i386" ]] ; then log "Error: You specified the I386 class but are trying to build something else (AMD64?)." eerror "Error: You specified the I386 class but are trying to build something else (AMD64?)." @@ -612,7 +628,7 @@ fi # generate nfsroot configuration for FAI on the fly if [ -z "$FAI_DEBOOTSTRAP" ] ; then - FAI_DEBOOTSTRAP="$SUITE http://cdn.debian.net/debian" + FAI_DEBOOTSTRAP="$SUITE http://http.debian.net/debian" fi if [ -z "$FAI_DEBOOTSTRAP_OPTS" ] ; then @@ -1211,7 +1227,7 @@ fi # create md5sum file: if [ -z "$BOOTSTRAP_ONLY" ] ; then ( cd $BUILD_OUTPUT/GRML/"${GRML_NAME}" && - find .. -type f -not -name md5sums -not -name isolinux.bin -exec md5sum {} \; > md5sums ) + find ../.. -type f -not -name md5sums -not -name isolinux.bin -exec md5sum {} \; > md5sums ) fi # }}} @@ -1357,9 +1373,14 @@ else # (hidden NTFS, IIRC), as the partition type is sometimes needed # to get the BIOS even look at the partition created by isohybrid if isohybrid --help | grep -q -- --uefi ; then - log "Detected uefi support for isohybrid, enabling" - einfo "Detected uefi support for isohybrid, enabling" - ISOHYBRID_OPTIONS=--uefi + if echo $CLASSES | grep -qw I386 ; then + log "Detected uefi support for isohybrid but 32bit systems do not support it, ignoring." + einfo "Detected uefi support for isohybrid but 32bit systems do not support it, ignoring." + else + log "Detected uefi support for isohybrid, enabling" + einfo "Detected uefi support for isohybrid, enabling" + ISOHYBRID_OPTIONS=--uefi + fi fi log "isohybrid $ISOHYBRID_OPTIONS ${ISO_OUTPUT}/${ISO_NAME}" @@ -1414,7 +1435,7 @@ create_netbootpackage() { mkdir -p "$NETBOOT" - if ! [ -r "${CHROOT}/usr/lib/syslinux/pxelinux.0" ] ; then + if ! [ -r "${CHROOT_OUTPUT}/usr/lib/syslinux/pxelinux.0" ] ; then ewarn "File /usr/lib/syslinux/pxelinux.0 not found in build chroot." ; eend 0 eindent einfo "Install syslinux[-common] package in chroot to get a netboot package."