mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-29 13:46:49 +00:00
fs-resize: use progress meters for long running tasks
This commit is contained in:
parent
4a66245618
commit
245651567e
@ -18,15 +18,20 @@
|
|||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
if [ -e /storage/.please_resize_me ] ; then
|
if [ -e /storage/.please_resize_me ] ; then
|
||||||
|
. /usr/lib/libreelec/functions
|
||||||
|
|
||||||
|
hidecursor
|
||||||
|
|
||||||
# this sh** was never intended to be used
|
# this sh** was never intended to be used
|
||||||
# on already installed and runing system
|
# on already installed and runing system
|
||||||
if [ -d /storage/.kodi -o -d /storage/.config -o -d /storage/.cache ] ; then
|
if [ -d /storage/.kodi -o -d /storage/.config -o -d /storage/.cache ] ; then
|
||||||
rm -f /storage/.please_resize_me
|
rm -f /storage/.please_resize_me
|
||||||
sync
|
sync
|
||||||
echo "resizing not allowed. rebooting in 15s"
|
echo "Resizing is not permitted - the system has already been initialised."
|
||||||
sleep 15
|
StartProgress countdown "Rebooting in 15s... " 15 "NOW"
|
||||||
reboot -f
|
reboot -f
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# get the disk. /storage on 2nd partition
|
# get the disk. /storage on 2nd partition
|
||||||
PART=$(grep "/storage " /proc/mounts | cut -d" " -f1 | grep '2$')
|
PART=$(grep "/storage " /proc/mounts | cut -d" " -f1 | grep '2$')
|
||||||
|
|
||||||
@ -51,18 +56,18 @@ if [ -e /storage/.please_resize_me ] ; then
|
|||||||
# failed to get partition start offset ?
|
# failed to get partition start offset ?
|
||||||
if [ ! -z "$PART_START" ] ; then
|
if [ ! -z "$PART_START" ] ; then
|
||||||
umount $PART
|
umount $PART
|
||||||
echo "resizing /storage..."
|
|
||||||
echo "this may take a while. please do not reboot or turn off your computer"
|
echo "Resizing partitions to make use of all available space."
|
||||||
echo "... parted -s -m $DISK rm 2"
|
echo ""
|
||||||
parted -s -m $DISK rm 2 &>/dev/null
|
echo "This procedure may take a while - please do NOT reboot or turn off your computer!"
|
||||||
echo "... parted -s -m $DISK unit b mkpart primary $PART_START 100%"
|
echo ""
|
||||||
parted -s -m $DISK unit b mkpart primary $PART_START 100% &>/dev/null
|
|
||||||
echo "... e2fsck -f -p $PART"
|
StartProgress spinner "Deleting /storage... " "parted -s -m $DISK rm 2 &>/dev/null"
|
||||||
e2fsck -f -p $PART &>/dev/null
|
StartProgress spinner "Creating /storage ..." "parted -s -m $DISK unit b mkpart primary $PART_START 100% &>/dev/null"
|
||||||
echo "... resize2fs $PART"
|
StartProgress spinner "Checking /storage... " "e2fsck -f -p $PART &>/dev/null"
|
||||||
resize2fs $PART &>/dev/null
|
StartProgress spinner "Resizing /storage... " "resize2fs $PART &>/dev/null"
|
||||||
echo "...done. rebooting in 15s"
|
|
||||||
sleep 15
|
StartProgress countdown "Rebooting in 15s... " 15 "NOW"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user