X-Git-Url: http://git.plutz.net/?a=blobdiff_plain;f=modules%2Fautoresize.mk;h=012aec9d4ea2a0757c5337d621f10223a35cdba1;hb=e29f3cdb786efa296a3812ca0afca2ef774e7794;hp=fba31eb441765cd850cdb4f309df728a17240b24;hpb=107a8d7f321374ffd5dbfa35803fb0acc46353f0;p=blast 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