commit a6a8838d20f0722f5c483e478375e259cf7e88f1 parent 2d4e03804640ef8981b6ce87ba021176869dbab5 Author: parazyd <parazyd@dyne.org> Date: Tue, 13 Mar 2018 20:11:45 +0100 Implement variable rootfs types as well. Diffstat:
M | zlibs/imaging | | | 30 | ++++++++++++++++++++++++++++-- |
1 file changed, 28 insertions(+), 2 deletions(-)
diff --git a/zlibs/imaging b/zlibs/imaging @@ -63,8 +63,34 @@ image_format_partitions() { ;; esac - act "formatting root as ext4" - sudo mkfs.ext4 ${rootpart} + # default to ext4 + [[ -z "$rootfs"]] && rootfs=ext4 + + case "$rootfs" in + none) + act "skipping root partition" + ;; + vfat|fat|dos) + act "formatting root as vfat" + sudo mkfs.vfat ${=rootopts} ${rootpart} + ;; + ext4) + act "formatting root as ext4" + sudo mkfs.ext4 ${=rootopts} ${rootpart} + ;; + ext2) + act "formating root as ext2" + sudo mkfs.ext2 ${=rootopts} ${rootpart} + ;; + btrfs) + act "formatting root as btrfs" + sudo mfks.btrfs ${=rootopts} ${rootpart} + ;; + *) + error "unknown parted_rootfs type '$rootfs'" + zerr + ;; + esac } image_partition_raw_dos() {