image-specs/rootfs/usr/sbin/rpi-resizerootfs
Gunnar Wolf 91381c16c9 Merge branch 'rootfs' into 'master'
rootfs subdirectory

See merge request raspi-team/image-specs!12
2020-08-15 05:06:18 +00:00

23 lines
277 B
Bash
Executable File

#!/bin/sh
rootpart="$(findmnt -n -o SOURCE /)"
rootdev="/dev/$(lsblk -no pkname "$rootpart")"
flock $rootdev sfdisk -f $rootdev -N 2 <<EOF
,+
EOF
sleep 5
udevadm settle
sleep 5
flock $rootdev partprobe $rootdev
mount -o remount,rw $rootpart
resize2fs $rootpart
exit 0