From: Paul Hänsch Date: Sat, 7 Dec 2019 02:28:14 +0000 (+0100) Subject: select fstype in autoresize X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=ce686c244a6862469c404f333041b5d5f79d044b;p=blast select fstype in autoresize --- 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