X-Git-Url: https://git.grml.org/?p=grml2usb.git;a=blobdiff_plain;f=grml2iso;h=a1eb11763acdf342f6916b3804cdc2bf953443a9;hp=c323e1e9523c2102376ba6397c13e01ec92a0248;hb=9ad819c6cc0031bf348066972e08fbd1391be8e0;hpb=fa60c0972f333c8f819b8f0bd8b081ec7da13410 diff --git a/grml2iso b/grml2iso index c323e1e..a1eb117 100755 --- a/grml2iso +++ b/grml2iso @@ -6,7 +6,9 @@ # Bug-Reports: see http://grml.org/bugs/ # License: This file is licensed under the GPL v2 or any later version. ################################################################################ -# TODO: support isolinux as bootloader on the ISO +# TODO: +# * support isolinux as bootloader on the ISO +# * support setting grml2usb options (e.g. --bootoptions=...) ################################################################################ # define function getfilesize before "set -e" {{{ @@ -65,8 +67,8 @@ # variables {{{ ORIG_DIR="$(pwd)" - # note: grub-pc_1.96+20090603-1_i386.deb seems to be b0rken - GRUB_DEB="grub-pc_1.96+20080724-16_i386.deb" + # note: grub-pc_1.96+20090603-1 seems to be b0rken + GRUB_VERSION="grub-pc_1.96+20080724-16" # normalise path case $ISOFILE in @@ -76,6 +78,7 @@ # }}} # create necessary stuff under WRKDIR {{{ + [ -d "$WRKDIR" ] && WRKDIR_EXISTED='true' || WRKDIR_EXISTED='false' rm -rf "$WRKDIR/cddir" "$WRKDIR/grub_tmp" mkdir -p "$WRKDIR/cddir" "$WRKDIR/grub_tmp" # }}}} @@ -87,6 +90,13 @@ # install grub2 files {{{ # as we don't want to rely on a grub2 installation on the # running system let's grab it from the net + if which dpkg >/dev/null 2>&1 ; then + ARCH="$(dpkg --print-architecture)" + else + [[ $(uname -m) == x86_64 ]] && ARCH=amd64 || ARCH=i386 + fi + GRUB_DEB="${GRUB_VERSION}_${ARCH}.deb" + cd "$WRKDIR"/grub_tmp/ wget http://ftp.de.debian.org/debian/pool/main/g/grub2/"$GRUB_DEB" ar x "$GRUB_DEB" @@ -134,6 +144,7 @@ cd "$ORIG_DIR" sync rm -rf "$WRKDIR/cddir" "$WRKDIR/grub_tmp" + [[ $WRKDIR_EXISTED = 'false' ]] && rmdir "$WRKDIR" echo "Generated $ISOFILE" # }}}