]> spindle.queued.net Git - xodist/blobdiff - mkext3.sh
debxo: use initramfs-tools and xserver-xorg-video-geode from backports
[xodist] / mkext3.sh
index 2960e275335110ad2d9ed51892918e2e128483b3..09501a241ef2fca5d81443bc4da29dbf34d372a4 100755 (executable)
--- a/mkext3.sh
+++ b/mkext3.sh
@@ -94,11 +94,16 @@ default 0
 timeout 5
 color cyan/blue white/blue
 EOF
+       installer_added=0
        label=`sed -ne 's/^LABEL=\(.\+\)[[:space:]]\+\/[[:space:]]\+.*/\1/p' configs/${CONFIG_TYPE}/fstab-ext3`
        prefix=
        grep -q ' ${mntpt}/boot ' /proc/mounts && prefix=/boot
        for kern in ${mntpt}/boot/vmlinuz-*; do
                v=$(basename $kern | sed 's/vmlinuz-//')
+               if [ "${v}" = '*' ]; then
+                       echo "*** Error: no kernel images found in /boot!" 1>&2
+                       exit 1
+               fi
                cat >>${mntpt}/boot/grub/menu.lst<<EOF
 
 title          Debian GNU/Linux, kernel ${v}
@@ -107,11 +112,23 @@ kernel            ${prefix}/vmlinuz-${v} root=LABEL=${label} ro
 initrd         ${prefix}/initrd.img-${v}
 boot
 EOF
+               if [ "$installer_added" = "0" ]; then
+                       installer_added=1
+                       cat >>${mntpt}/boot/grub/menu.lst<<EOF
+
+title           Debian GNU/Linux Installer
+root            (hd0,0)
+kernel          ${prefix}/vmlinuz-${v} root=LABEL=${label} ro installer
+initrd          ${prefix}/initrd.img-${v}
+boot
+EOF
+               fi
+
        done
 
        # grub-install is pretty broken, so we do this manually
        geom=`parted -s "$img" "unit chs" "print" | sed -ne 's/geometry: \([0-9]\+\),\([0-9]\+\),\([0-9]\+\)/:\1 \2 \3:/p' | cut -d: -f2`
-       grub --device-map=/dev/null <<EOF
+       grub --batch --device-map=/dev/null <<EOF
 device (hd0) $img
 geometry (hd0) $geom
 root (hd0,0)
@@ -281,3 +298,5 @@ mk_ext3_fs ${IMG_NAME} ${ROOT_DIR}
 #mount ${IMG_NAME}.ext3 $MOUNT_POINT -o loop,offset=$OS_PART1_BEGIN -t ext3
 #cp -r "$ROOT_DIR"/* $MOUNT_POINT
 #umount $MOUNT_POINT
+
+exit 0