init_resize.sh: fixes to make it work after tests on aarch64

This commit is contained in:
Silvan Calarco 2021-01-31 17:32:35 +01:00
parent 12756b6a2b
commit 881d4c8019

View File

@ -113,18 +113,20 @@ main () {
check_kernel check_kernel
if [ "$ROOT_PART_END" -eq "$TARGET_END" ]; then 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 fi
if ! parted -m "$ROOT_DEV" u s resizepart "$ROOT_PART_NUM" "$TARGET_END"; then mount / -o remount,rw
FAIL_REASON="Root partition resize failed" if ! resize2fs "$ROOT_PART_DEV"; then
return 1
fi
if ! resize2fs "$ROOT_DEV"; then
FAIL_REASON="Root filesystem resize failed"
return 1 return 1
fi fi
mount / -o remount,ro
fix_partuuid fix_partuuid