X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=grml-live;h=150615bd9d1c311489b981dc92da34da1256c7fb;hb=0b3a678cb1bed476ece53502433fcc7b033eb62a;hp=0e0a63945fbbb51fe3211f694d9ce4fc0ca97e1a;hpb=e9c7fea2cb457d9492078acdc6f3739a8dcb33ed;p=grml-live.git diff --git a/grml-live b/grml-live index 0e0a639..150615b 100755 --- a/grml-live +++ b/grml-live @@ -1,7 +1,9 @@ #!/bin/bash # Filename: grml-live # Purpose: build process script for generating a (grml based) Linux Live-ISO -# Authors: grml-team (grml.org), (c) Michael Prokop +# Authors: grml-team (grml.org), +# (c) Michael Prokop , +# (c) Thorsten Glaser # Bug-Reports: see http://grml.org/bugs/ # License: This file is licensed under the GPL v2 or any later version. ################################################################################ @@ -11,6 +13,13 @@ export LANG=C export LC_ALL=C +# define function getfilesize before "set -e" +if stat --help >/dev/null 2>&1; then + getfilesize='stat -c %s' # GNU stat +else + getfilesize='stat -f %z' # BSD stat +fi + # exit on any error: set -e @@ -553,7 +562,7 @@ if [ "$ARCH" = i386 ] || [ "$ARCH" = amd64 ] ; then if [ -z "$NO_ADDONS" ] ; then if ! [ -d /usr/share/grml-live/templates/boot/addons/bsd4grml ] ; then - ewarn "Boot addons not found, skipping therefor. (Consider installing package grml-live-addons)" ; eend 0 + ewarn "Boot addons not found, skipping therefore. (Consider installing package grml-live-addons)" ; eend 0 else # copy only files so we can handle bsd4grml on its own for file in ${TEMPLATE_DIRECTORY}/boot/addons/* ; do @@ -735,9 +744,16 @@ else 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' \ -l -r -J -no-emul-boot -boot-load-size 4 -boot-info-table \ - -b $BOOT_FILE \ + -b $BOOT_FILE -no-pad \ -o "${ISO_OUTPUT}/${ISO_NAME}" . ; RC=$? + # pad the output ISO to multiples of 256 KiB for partition table support + siz=$($getfilesize "${ISO_OUTPUT}/${ISO_NAME}") + cyls=$((siz / 512 / 32 / 16 + 1)) # C=$cyls H=16 S=32 + siz=$((cyls * 16 * 32 * 512)) # size after padding + dd if=/dev/zero bs=1 count=1 seek=$((siz - 1)) \ + of="${ISO_OUTPUT}/${ISO_NAME}" 2>/dev/null + # support disabling hybrid ISO image if [ "$HYBRID_METHOD" = "disable" ] ; then\ log "Skipping creation of hybrid ISO file as requested via HYBRID_METHOD=disable" @@ -760,7 +776,10 @@ else else log "Creating hybrid ISO file with manifold method" einfo "Creating hybrid ISO file with manifold method" - echo 1 63 | mksh /usr/share/grml-live/scripts/bootgrub.mksh | cat - boot/grub/core.img | dd conv=notrunc of="${ISO_OUTPUT}/${ISO_NAME}" conv=notrunc + echo 1 63 | \ + mksh /usr/share/grml-live/scripts/bootgrub.mksh -A -M 1 -p 0x83 -g $cyls:16:32 | \ + cat - boot/grub/core.img | \ + dd conv=notrunc of="${ISO_OUTPUT}/${ISO_NAME}" conv=notrunc 2>/dev/null eend $? fi fi