feat(turris,omnia): re-enable disk resizing
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit Details

This commit is contained in:
wpetit 2023-04-26 15:55:13 +02:00
parent 2cf46ed9a5
commit 81360c3fda
2 changed files with 13 additions and 17 deletions

View File

@ -1,25 +1,21 @@
#!/bin/sh
# set -eo pipefail
set -eo pipefail
# FLAG_FILE=/root/.disk_resized
block info
# if [ -f "$FLAG_FILE" ]; then
# exit
# fi
DISK=/dev/mmcblk0
PARTITION="${DISK}p2"
# DISK=/dev/mmcblk0
# PARTITION="${DISK}p2"
parted -s -a opt "$DISK" "resizepart 2 100%"
# parted -s -a opt "$DISK" "resizepart 2 100%"
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")"
# 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")"
e2fsck -y -f "$LOOP_DEVICE"
resize2fs "$LOOP_DEVICE"
# e2fsck -y -f "$LOOP_DEVICE"
# resize2fs "$LOOP_DEVICE"
rm -f /etc/uci-defaults/99-resize-disk.sh
# touch "$FLAG_FILE"
# reboot
reboot

View File

@ -5,7 +5,7 @@ turris: omnia
omnia:
$(MAKE) \
ADDITIONAL_INSTALL="install-turris-omnia-uci-defaults" \
ADDITIONAL_OPENWRT_PACKAGES="losetup squashfs-tools-unsquashfs resize2fs e2fsprogs parted" \
ADDITIONAL_OPENWRT_PACKAGES="losetup squashfs-tools-unsquashfs resize2fs e2fsprogs parted block-mount" \
OPENWRT_TARGET="mvebu/cortexa9" \
EMISSARY_ARCH="armv7" \
OPENWRT_PROFILE="cznic_turris-omnia" \