mirror of
https://gitlab.com/alemaire/image-specs.git
synced 2025-01-11 01:03:29 +00:00
91381c16c9
rootfs subdirectory See merge request raspi-team/image-specs!12
23 lines
277 B
Bash
Executable File
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
|