When mkfs.btrfs "command not found", it will user mkfs.ext4. beacuse mkfs.ext4 is common, other mkfs.*** is not considered.
Signed-off-by: Hu XueJiao huxuejiao1@huawei.com --- lib/bootstrap.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/lib/bootstrap.sh b/lib/bootstrap.sh index a7776d68..e384a933 100755 --- a/lib/bootstrap.sh +++ b/lib/bootstrap.sh @@ -456,7 +456,12 @@ mount_rootfs() ROOTFS_DIR=/opt/rootfs mkdir -p $ROOTFS_DIR mount $rootfs_partition $ROOTFS_DIR || { - mkfs.btrfs -f $rootfs_partition + if command -v mkfs.btrfs > /dev/null; then + mkfs.btrfs -f $rootfs_partition + else + mkfs.ext4 -F $rootfs_partition || return + fi + mount $rootfs_partition $ROOTFS_DIR } mkdir -p $ROOTFS_DIR/tmp