Implement sdcard resizing.

This commit is contained in:
parazyd 2018-02-12 15:07:46 +01:00
parent 35569c10a2
commit d94cca5318
No known key found for this signature in database
GPG Key ID: F0CB28FCF78637DE
2 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,24 @@
#!/bin/sh
# This should resize the sdcard to its full capacity.
[ -f /etc/part-expanded ] && exit 0
cat <<EOF | fdisk /dev/mmcblk0
d
2
n
p
2
Y
w
EOF
partprobe
mount /dev/mmcblk0p2 /mnt
btrfs fi re max /mnt
umount /mnt
echo yes > /etc/part-expanded

View File

@ -2,6 +2,7 @@
# rc.local for base images
[ -f /etc/ssh/ssh_host_rsa_key.pub ] || ssh-keygen -A
[ -f /etc/part-expand.sh ] || /etc/part-expand.sh
netdata