From ce686c244a6862469c404f333041b5d5f79d044b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Sat, 7 Dec 2019 03:28:14 +0100 Subject: [PATCH] select fstype in autoresize --- modules/autoresize.mk | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/modules/autoresize.mk b/modules/autoresize.mk index fba31eb..012aec9 100644 --- a/modules/autoresize.mk +++ b/modules/autoresize.mk @@ -4,6 +4,7 @@ define autoresize := #!/bin/sh rootfs="$$(mount |grep -w / |cut -d' ' -f1)" +roottype="$$(mount |grep -w / |cut -d' ' -f5)" case $$rootfs in /dev/mmcblk?p2) rootdev="$${rootfs%p2}";; @@ -20,7 +21,11 @@ after="$$(sfdisk --dump "$$rootdev")" if [ "$$before" = "$$after" ]; then # second stage - resize2fs "$$rootfs" + case $$roottype in + ext[234]) resize2fs "$$rootfs";; + btrfs) btrfs filesystem resize max /;; + nilfs2) nilfs-resize "$$rootfs";; + esac systemctl disable autoresize else # finish first stage @@ -31,7 +36,7 @@ endef define autoresize_unit := [Unit] -Description=Resize root filesystem at boot +Description=Resize root filesystem during first boot [Service] ExecStart=/opt/autoresize.sh -- 2.39.2