diff options
author | Sven Gothel <[email protected]> | 2021-07-22 20:32:24 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2021-07-22 20:32:24 +0200 |
commit | e73d8effd7068f1c6e52e5756ddc307792b17511 (patch) | |
tree | a7496a41456b682490db0159fa4cceb2d5f41aa3 /stage2 | |
parent | 6bafdbead3f434c9a10891f75a012c881aa57974 (diff) |
stage2 mutable image: Fix resize2fs_once: On raspi the scripting mode works, on amd64 not. Hence try scripting 1st and fallback to fake tty input for amd64.
Tested w/ sdcard on raspi3b and pc-amd64
Diffstat (limited to 'stage2')
-rwxr-xr-x | stage2/01-sys-tweaks/files/resize2fs_once | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/stage2/01-sys-tweaks/files/resize2fs_once b/stage2/01-sys-tweaks/files/resize2fs_once index dbeba59..cd42e19 100755 --- a/stage2/01-sys-tweaks/files/resize2fs_once +++ b/stage2/01-sys-tweaks/files/resize2fs_once @@ -26,10 +26,11 @@ case "$1" in PART_NEW_END=`parted -s -m ${ROOT_DEV} unit B print free | tail -1 | awk -F: ' { print substr($3,1,length($3)-1) } '` if [ -n "${PART_END}" -a -n "${PART_NEW_END}" -a ${PART_NEW_END} -gt ${PART_END} ]; then echo "Resize partition ${PART_NO} from ${PART_START} - ${PART_END} to ${PART_NEW_END}" - # Nope: parted -s ${ROOT_DEV} unit B resizepart ${PART_NO} ${PART_NEW_END} - # Nope: parted -s ${ROOT_DEV} rm ${PART_NO} - # Nope: parted -s ${ROOT_DEV} unit B mkpart primary ${PART_START} ${PART_NEW_END} - parted "${ROOT_DEV}" ---pretend-input-tty <<EOF + if parted -s ${ROOT_DEV} unit B resizepart ${PART_NO} ${PART_NEW_END} ; then + echo "Resize partition OK (scripting mode)" + else + echo "Resize partition scripting mode failed, trying tty input..." + parted "${ROOT_DEV}" ---pretend-input-tty <<EOF unit B resizepart ${PART_NO} @@ -37,6 +38,7 @@ Yes ${PART_NEW_END} quit EOF + fi echo "Resize fs on partition ${PART_NO}, ${ROOT_PART}" resize2fs $ROOT_PART else |