On Thu, Oct 29, 2020 at 04:47:11PM +0800, Hu Xuejiao wrote:
When mkfs.btrfs "command not found", it will user mkfs.ext4. beacuse
^ beacuse=>because
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
} mkdir -p $ROOTFS_DIR/tmpmount $rootfs_partition $ROOTFS_DIR
-- 2.23.0