Fix resizerootfs

This commit is contained in:
Christian Schlüter 2018-07-15 00:03:02 +02:00
parent d4874ba3df
commit 4341e7353d
No known key found for this signature in database
GPG Key ID: 4955EB2D53B5CBD2
2 changed files with 13 additions and 2 deletions

View File

@ -4,10 +4,20 @@ roottmp=$(lsblk -l -o MAJ:MIN,MOUNTPOINT | grep '/$')
rootpart=/dev/block/${roottmp% /}
rootdev=${rootpart%:*}:0
sfdisk -f $rootdev -N 2 <<EOF
flock $rootdev sfdisk -f $rootdev -N 2 <<EOF
,+
EOF
partprobe
sleep 5
udevadm settle
sleep 5
flock $rootdev partprobe $rootdev
mount -o remount,rw $rootpart
resize2fs $rootpart
exit 0

View File

@ -5,6 +5,7 @@ DefaultDependencies=no
[Service]
Type=oneshot
TimeoutSec=600
ExecStart=/usr/sbin/rpi3-resizerootfs
ExecStart=/bin/systemctl --no-reload disable %n