2023-04-07 11:38:27 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
2023-04-17 11:30:50 +02:00
|
|
|
# set -eo pipefail
|
2023-04-07 11:38:27 +02:00
|
|
|
|
2023-04-17 11:30:50 +02:00
|
|
|
# FLAG_FILE=/root/.disk_resized
|
2023-04-14 17:37:12 +02:00
|
|
|
|
2023-04-17 11:30:50 +02:00
|
|
|
# if [ -f "$FLAG_FILE" ]; then
|
|
|
|
# exit
|
|
|
|
# fi
|
2023-04-14 17:37:12 +02:00
|
|
|
|
2023-04-17 11:30:50 +02:00
|
|
|
# DISK=/dev/mmcblk0
|
|
|
|
# PARTITION="${DISK}p2"
|
2023-04-07 11:38:27 +02:00
|
|
|
|
2023-04-17 11:30:50 +02:00
|
|
|
# parted -s -a opt "$DISK" "resizepart 2 100%"
|
2023-04-07 11:38:27 +02:00
|
|
|
|
2023-04-17 11:30:50 +02:00
|
|
|
# FS_SIZE="$(unsquashfs -s "$PARTITION" | grep -o 'Filesystem size [0-9]* bytes' | grep -o '[0-9][0-9]*')"
|
|
|
|
# FS_OFFSET="$(expr '(' "$FS_SIZE" + 65535 ')' / 65536 '*' 65536)"
|
|
|
|
# LOOP_DEVICE="$(losetup -f --show -o "$FS_OFFSET" "$PARTITION")"
|
2023-04-07 11:38:27 +02:00
|
|
|
|
2023-04-17 11:30:50 +02:00
|
|
|
# e2fsck -y -f "$LOOP_DEVICE"
|
|
|
|
# resize2fs "$LOOP_DEVICE"
|
2023-04-14 17:37:12 +02:00
|
|
|
|
2023-04-17 11:30:50 +02:00
|
|
|
# touch "$FLAG_FILE"
|
2023-04-14 17:37:12 +02:00
|
|
|
|
2023-04-17 11:30:50 +02:00
|
|
|
# reboot
|