From: Andres Salomon Date: Fri, 5 Nov 2010 18:49:54 +0000 (-0700) Subject: mkext3: add --skip-grub option X-Git-Tag: v0.6~21 X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5983c5431630ed30c1e8a9c85d22688ec6f8866f;p=xodist mkext3: add --skip-grub option For buildling debxo images (or other non-x86 images), we don't care about installing grub. Furthermore, on some platforms, we don't have the grub command.. so requiring grub to generate images is a non-starter. The long-term solution to this is to have something like: --use-bootloader=grub ...where one can use that to select between grub, ofw, uboot, etc. Signed-off-by: Andres Salomon --- diff --git a/mkext3.sh b/mkext3.sh index 09501a2..08a1c41 100755 --- a/mkext3.sh +++ b/mkext3.sh @@ -18,6 +18,7 @@ IMG_NAME="" ROOT_DIR="" +SKIP_GRUB="n" . ./functions.sh @@ -201,7 +202,9 @@ mk_ext3_fs() # populate the filesystem cp -ra "$root_dir"/* "$mount_point_root" || true - grub_install "$img" "$mount_point_root" + if [ "$SKIP_GRUB" != "y" ]; then + grub_install "$img" "$mount_point_root" + fi # umount the filesystem sed -ne 's/^LABEL=//p' configs/${CONFIG_TYPE}/fstab-ext3 | \ @@ -232,6 +235,7 @@ usage() 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 } @@ -247,6 +251,9 @@ do } shift ;; + --skip-grub) + SKIP_GRUB="y" + ;; --help|-h) usage ;; @@ -277,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