X-Git-Url: https://git.grml.org/?p=grml-debootstrap.git;a=blobdiff_plain;f=chroot-script;h=3650c6f7cfa98fbb2d8a38b9e52495aad5cd9176;hp=ac11325d0911324790a6faab3c50ba64171e8731;hb=aad526af3708cc6796d906eb877253435aa0c29c;hpb=b8e833aa58b68b6fac29ca2256096495c135e034 diff --git a/chroot-script b/chroot-script index ac11325..3650c6f 100755 --- a/chroot-script +++ b/chroot-script @@ -17,10 +17,10 @@ set -e # exit on any error # use aptitude only if it's available if [ -x /usr/bin/aptitude ] ; then - APTINSTALL='aptitude -y --without-recommends install ' + APTINSTALL="aptitude -y --without-recommends install $DPKG_OPTIONS" APTUPDATE='aptitude update' else - APTINSTALL='apt-get --force-yes -y install' + APTINSTALL="apt-get --force-yes -y install $DPKG_OPTIONS" APTUPDATE='apt-get update' fi @@ -363,7 +363,12 @@ hostname() { # generate initrd/initramfs {{{ initrd() { # assume the first available kernel as our main kernel - KERNELIMG=$(ls -1 /boot/vmlinuz-* | head -1) + KERNELIMG=$(ls -1 /boot/vmlinuz-* 2>/dev/null | head -1) + if [ -z "$KERNELIMG" ] ; then + echo 'No kernel image found, skipping initrd stuff.'>&2 + return + fi + KERNELVER=${KERNELIMG#/boot/vmlinuz-} # generate initrd