X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?p=xodist;a=blobdiff_plain;f=mkext3.sh;h=08a1c41c165e2493a492c646a4f98db18ef5a67f;hp=37cec9949073629476083c3f6ccc41f55a3648c0;hb=4147cb5472e422ccff6c96040c303c4cc6e8a120;hpb=16af9c68f4900785c94a0cd3e65dfb44e81d4aff diff --git a/mkext3.sh b/mkext3.sh index 37cec99..08a1c41 100755 --- a/mkext3.sh +++ b/mkext3.sh @@ -18,6 +18,7 @@ IMG_NAME="" ROOT_DIR="" +SKIP_GRUB="n" . ./functions.sh @@ -94,11 +95,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<>${mntpt}/boot/grub/menu.lst<&2 echo "Options:" 1>&2 echo " --config-type directory name in configs/ to use" 1>&2 + echo " --help display this help screen" 1>&2 + echo " --skip-grub don't install GRUB on image" 1>&2 echo "" 1>&2 exit 1 } @@ -229,6 +251,12 @@ do } shift ;; + --skip-grub) + SKIP_GRUB="y" + ;; + --help|-h) + usage + ;; *) ROOT_DIR="$1" shift @@ -256,7 +284,10 @@ if [ ! -d "$ROOT_DIR" ]; then usage fi -check_for_cmds losetup parted mke2fs tune2fs grub || exit 1 +check_for_cmds losetup parted mke2fs tune2fs || exit 1 +if [ "$SKIP_GRUB" != "y" ]; then + check_for_cmds grub || exit 1 +fi # create image's /etc/fstab if [ ! -f ./configs/${CONFIG_TYPE}/fstab-ext3 ]; then @@ -277,3 +308,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