]> spindle.queued.net Git - xodist/blobdiff - mkext3.sh
mkjffs2: convert to reading partition info from config/*/fstab-jffs2
[xodist] / mkext3.sh
index 2960e275335110ad2d9ed51892918e2e128483b3..8d8532477cf0b5a09ec512b9f9e3f45bcafb398a 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,6 +112,18 @@ 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