From 881d4c8019da1fcfea4f426a863bc6b2a204e443 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Sun, 31 Jan 2021 17:32:35 +0100 Subject: [PATCH] init_resize.sh: fixes to make it work after tests on aarch64 --- src/init_resize.sh | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/init_resize.sh b/src/init_resize.sh index 4e47d30..e87993d 100755 --- a/src/init_resize.sh +++ b/src/init_resize.sh @@ -113,18 +113,20 @@ main () { check_kernel if [ "$ROOT_PART_END" -eq "$TARGET_END" ]; then - reboot_pi + # Issue a warning but continue trying to resize filesystem + echo "Warning: root partition already resized\n" + else + if ! parted -m "$ROOT_DEV" u s resizepart "$ROOT_PART_NUM" "$TARGET_END"; then + FAIL_REASON="Root partition resize failed" + return 1 + fi fi - if ! parted -m "$ROOT_DEV" u s resizepart "$ROOT_PART_NUM" "$TARGET_END"; then - FAIL_REASON="Root partition resize failed" - return 1 - fi - - if ! resize2fs "$ROOT_DEV"; then - FAIL_REASON="Root filesystem resize failed" + mount / -o remount,rw + if ! resize2fs "$ROOT_PART_DEV"; then return 1 fi + mount / -o remount,ro fix_partuuid