Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve fs-resize, fix delay and simplify #2993

Merged
merged 3 commits into from Nov 4, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
36 changes: 14 additions & 22 deletions packages/sysutils/busybox/scripts/fs-resize
Expand Up @@ -36,31 +36,23 @@ if [ -e /storage/.please_resize_me ] ; then

# just in case
if [ ! -z "$DISK" -a ! -z "$PART" ] ; then
# get storage partition start
PART_START=$(parted -s -m $DISK unit b print 2>/dev/null | grep -v ^/dev | grep -v BYT | grep ^2: | cut -f2 -d ":")
umount $PART

# failed to get partition start offset ?
if [ ! -z "$PART_START" ] ; then
umount $PART
echo "PARTITION RESIZING IN PROGRESS"
echo ""
echo "Please do not reboot or turn off your @DISTRONAME@ device!"
echo ""

echo "PARTITION RESIZING IN PROGRESS"
echo ""
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
StartProgress spinner "Checking layout... " "sgdisk -e $DISK &>/dev/null"
fi

StartProgress spinner "Deleting /storage... " "parted -s -m $DISK rm 2 &>/dev/null"
StartProgress spinner "Creating /storage... " "parted -s -m $DISK unit b mkpart primary $PART_START 100% &>/dev/null"
StartProgress spinner "Checking /storage... " "e2fsck -f -p $PART &>/dev/null"
StartProgress spinner "Resizing /storage... " "resize2fs $PART &>/dev/null"

StartProgress countdown "Rebooting in 15s... " 15 "NOW"
# 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
StartProgress spinner "Checking layout... " "sgdisk -e $DISK &>/dev/null"
fi

StartProgress spinner "Resizing partition... " "parted -s -m $DISK resizepart 2 100% &>/dev/null"
StartProgress spinner "Checking file system... " "e2fsck -f -p $PART &>/dev/null"
StartProgress spinner "Resizing file system... " "resize2fs $PART &>/dev/null"
StartProgress countdown "Rebooting in 15s... " 15 "NOW"
fi
fi
reboot -f &>/dev/null
4 changes: 2 additions & 2 deletions packages/sysutils/gptfdisk/package.mk
Expand Up @@ -2,8 +2,8 @@
# Copyright (C) 2017-present Team LibreELEC (https://libreelec.tv)

PKG_NAME="gptfdisk"
PKG_VERSION="1.0.1"
PKG_SHA256="864c8aee2efdda50346804d7e6230407d5f42a8ae754df70404dd8b2fdfaeac7"
PKG_VERSION="1.0.4"
PKG_SHA256="b663391a6876f19a3cd901d862423a16e2b5ceaa2f4a3b9bb681e64b9c7ba78d"
PKG_LICENSE="GPL"
PKG_SITE="http://www.rodsbooks.com/gdisk/"
PKG_URL="https://downloads.sourceforge.net/project/$PKG_NAME/$PKG_NAME/$PKG_VERSION/$PKG_NAME-$PKG_VERSION.tar.gz"
Expand Down
6 changes: 3 additions & 3 deletions packages/sysutils/util-linux/package.mk
Expand Up @@ -3,10 +3,10 @@
# Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv)

PKG_NAME="util-linux"
PKG_VERSION="2.31"
PKG_SHA256="f9be7cdcf4fc5c5064a226599acdda6bdf3d86c640152ba01ea642d91108dc8a"
PKG_VERSION="2.32.1"
PKG_SHA256="86e6707a379c7ff5489c218cfaf1e3464b0b95acf7817db0bc5f179e356a67b2"
PKG_LICENSE="GPL"
PKG_URL="http://www.kernel.org/pub/linux/utils/util-linux/v${PKG_VERSION%-*}/$PKG_NAME-$PKG_VERSION.tar.xz"
PKG_URL="http://www.kernel.org/pub/linux/utils/util-linux/v${PKG_VERSION%.*}/$PKG_NAME-$PKG_VERSION.tar.xz"
PKG_DEPENDS_HOST=""
PKG_DEPENDS_TARGET="toolchain"
PKG_DEPENDS_INIT="toolchain"
Expand Down