From: Michael Prokop Date: Tue, 4 Aug 2009 17:27:04 +0000 (+0200) Subject: check whether arch option and arch class correspond X-Git-Tag: v0.9.20~6 X-Git-Url: http://git.grml.org/?p=grml-live.git;a=commitdiff_plain;h=102276a66f3f0e75f1c4b0043f9b9b24470c2e0e check whether arch option and arch class correspond --- diff --git a/debian/changelog b/debian/changelog index 2ce324b..e72a40c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -33,8 +33,10 @@ grml-live (0.9.20) UNRELEASED; urgency=low * Really add support for genisoimage (thanks for the bugreport, Worf). * Set subdirectories of $OUTPUT independent of cmdline parsing so it is possible to set it via conffile as well. + * Validate whether the specified architecture class matches the + architecture (option), otherwise installation of kernel will fail. - -- Michael Prokop Tue, 04 Aug 2009 13:16:10 +0200 + -- Michael Prokop Tue, 04 Aug 2009 19:26:20 +0200 grml-live (0.9.19) unstable; urgency=low diff --git a/grml-live b/grml-live index 29d19f9..42157e8 100755 --- a/grml-live +++ b/grml-live @@ -416,6 +416,22 @@ if [ -n "$SUITE" ] ; then done fi +# validate whether the specified architecture class matches the +# architecture (option), otherwise installation of kernel will fail +if echo $CLASSES | grep -qi i386 ; then + if ! [[ "$ARCH" == "i386" ]] ; then + eerror "You specified the I386 class but are trying to build something else (AMD64?)." + eerror "-> Either invoke grml-live with '-i i386' or adjust the architecture class. Exiting." + bailout + fi +elif echo $CLASSES | grep -qi amd64 ; then + if ! [[ "$ARCH" == "amd64" ]] ; then + eerror "You specified the AMD64 class but are trying to build something else (I386?)." + eerror "-> Either invoke grml-live with '-i amd64' or adjust the architecture class. Exiting." + bailout + fi +fi + # set $ARCH [ -n "$ARCH" ] || ARCH="$(dpkg --print-architecture)" if grep -q -- 'FAI_DEBOOTSTRAP_OPTS.*--arch' "$NFSROOT_CONF" ; then @@ -768,9 +784,9 @@ if [ -f "${ISO_OUTPUT}/${ISO_NAME}" -a -z "$UPDATE" -a -z "$BUILD_ONLY" -a -z "$ # support mkisofs as well as genisoimage if which mkisofs >/dev/null 2>&1; then - MKISOFS=mkisofs + MKISOFS='mkisofs' elif which genisoimage >/dev/null 2>&1; then - MKISOFS=genisoimage + MKISOFS='genisoimage' else log "Sorry, neither mkisofs nor genisoimage available - can not create ISO." eerror "Sorry, neither mkisofs nor genisoimage available - can not create ISO." ; eend 1 @@ -785,7 +801,7 @@ else CURRENT_DIR=$(pwd) if cd "$BUILD_OUTPUT" ; then log "$MKISOFS -V '${GRML_NAME} ${VERSION}' -publisher 'grml-live | grml.org' -l -r -J -no-emul-boot -boot-load-size 4 -boot-info-table -b $BOOT_FILE -o ${ISO_OUTPUT}/${ISO_NAME} ." - $MKISOFS -V "${GRML_NAME} ${VERSION}" -publisher 'grml-live | grml.org' \ + "$MKISOFS" -V "${GRML_NAME} ${VERSION}" -publisher 'grml-live | grml.org' \ -l -r -J -no-emul-boot -boot-load-size 4 -boot-info-table \ -b $BOOT_FILE -no-pad \ -o "${ISO_OUTPUT}/${ISO_NAME}" . ; RC=$?