From 81378ab3c6ae9f7cd5e910527c197d80ed66ebd4 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sun, 10 Nov 2013 08:42:04 +0100 Subject: mkimage: allow -r f2fs or any other fs and check we have required cmds. --- mkimage.sh.in | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'mkimage.sh.in') diff --git a/mkimage.sh.in b/mkimage.sh.in index aff4f14..ce074d5 100644 --- a/mkimage.sh.in +++ b/mkimage.sh.in @@ -85,6 +85,12 @@ if [ "$(id -u)" -ne 0 ]; then die "need root perms to continue, exiting." fi +for f in parted mkfs.${BOOT_FSTYPE} mkfs.${ROOT_FSTYPE}; do + if ! which ${f} >/dev/null; then + die "Cannot find ${f}, exiting." + fi +done + IMGSIZE="$2" if [ -z "$IMGSIZE" ]; then IMGSIZE="2G" @@ -111,7 +117,7 @@ if [ "$BOOT_FSTYPE" = "vfat" ]; then _btype="fat32" fi parted $FILENAME mkpart primary ${_btype} 2048s 256M -parted $FILENAME mkpart primary ${ROOT_FSTYPE} 256M 100% +parted $FILENAME mkpart primary ext2 256M 100% parted $FILENAME toggle 1 boot LOOPDEV=$(losetup --show --find -P $FILENAME) mkfs.${BOOT_FSTYPE} ${LOOPDEV}p1 >/dev/null 2>&1 -- cgit 1.4.1