about summary refs log tree commit diff
path: root/mkimage.sh.in
diff options
context:
space:
mode:
authorJuan RP <xtraeme@gmail.com>2013-11-10 08:42:04 +0100
committerJuan RP <xtraeme@gmail.com>2013-11-10 08:42:04 +0100
commit81378ab3c6ae9f7cd5e910527c197d80ed66ebd4 (patch)
tree37348302ba9ebfb1000f63a33a0531bda6a4c07a /mkimage.sh.in
parentd4cd939375436a4951f71dcc9b32fe2b93b99a58 (diff)
downloadhrmpf-81378ab3c6ae9f7cd5e910527c197d80ed66ebd4.tar.gz
hrmpf-81378ab3c6ae9f7cd5e910527c197d80ed66ebd4.tar.xz
hrmpf-81378ab3c6ae9f7cd5e910527c197d80ed66ebd4.zip
mkimage: allow -r f2fs or any other fs and check we have required cmds.
Diffstat (limited to 'mkimage.sh.in')
-rw-r--r--mkimage.sh.in8
1 files changed, 7 insertions, 1 deletions
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