busybox: fs-resize: use parted to fix gpt errors instead of sgdisk

parted's 6.3 "--fix" parameter now allows non-interactive fixing

gptfdisk package dependency is removed
This commit is contained in:
mglae 2023-06-04 12:17:09 +02:00
parent 35cc629970
commit 671a358b65
2 changed files with 2 additions and 8 deletions

View File

@ -8,7 +8,7 @@ PKG_SHA256="b8cc24c9574d809e7279c3be349795c5d5ceb6fdf19ca709f80cde50e47de314"
PKG_LICENSE="GPL"
PKG_SITE="http://www.busybox.net"
PKG_URL="https://busybox.net/downloads/${PKG_NAME}-${PKG_VERSION}.tar.bz2"
PKG_DEPENDS_TARGET="toolchain hdparm dosfstools e2fsprogs zip usbutils parted procps-ng gptfdisk libtirpc"
PKG_DEPENDS_TARGET="toolchain hdparm dosfstools e2fsprogs zip usbutils parted procps-ng libtirpc"
PKG_DEPENDS_INIT="toolchain libtirpc"
PKG_LONGDESC="BusyBox combines tiny versions of many common UNIX utilities into a single small executable."
PKG_BUILD_FLAGS="-parallel"

View File

@ -58,13 +58,7 @@ if [ -e /storage/.please_resize_me ] ; then
echo "Please do not reboot or turn off your @DISTRONAME@ device!"
echo ""
# identify the partition scheme, and if gpt fix minor issues such as gpt header not at end of disk
SCHEME=$(blkid -s PTTYPE -o value $DISK)
if [ "$SCHEME" = "gpt" ]; then
StartProgressLog spinner "Checking layout... " "sgdisk -e $DISK >>$LOG 2>&1"
fi
StartProgressLog spinner "Resizing partition... " "parted -s -m $DISK resizepart 2 100% >>$LOG 2>&1"
StartProgressLog spinner "Resizing partition... " "parted -s -f -m $DISK resizepart 2 100% >>$LOG 2>&1"
StartProgressLog spinner "Checking file system... " "e2fsck -f -p $PART >>$LOG 2>&1"
StartProgressLog spinner "Resizing file system... " "resize2fs $PART >>$LOG 2>&1"
StartProgress countdown "Rebooting in 15s... " 15 "NOW"