mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-24 11:16:51 +00:00
fs-resize: move as systemd target
This commit is contained in:
parent
7c2fcdc256
commit
4fffa76c53
@ -31,6 +31,9 @@ if [ -e /storage/.please_resize_me ] ; then
|
||||
;;
|
||||
esac
|
||||
|
||||
rm -f /storage/.please_resize_me
|
||||
sync
|
||||
|
||||
# just in case
|
||||
if [ ! -z "$DISK" -a ! -z "$PART" ] ; then
|
||||
# get storage partition start
|
||||
@ -38,8 +41,6 @@ if [ -e /storage/.please_resize_me ] ; then
|
||||
|
||||
# failed to get partition start offset ?
|
||||
if [ ! -z "$PART_START" ] ; then
|
||||
rm -f /storage/.please_resize_me
|
||||
sync
|
||||
umount $PART
|
||||
# TODO: clean up debug
|
||||
echo "resizing /storage..."
|
||||
@ -54,7 +55,7 @@ if [ -e /storage/.please_resize_me ] ; then
|
||||
resize2fs $PART &>/dev/null
|
||||
echo "...done. rebooting in 15s"
|
||||
sleep 15
|
||||
reboot
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
reboot
|
||||
|
@ -662,6 +662,10 @@
|
||||
if [ "$STORAGE_NETBOOT" = "yes" ] ; then
|
||||
echo "" > /sysroot/dev/.storage_netboot
|
||||
fi
|
||||
|
||||
if [ -f /sysroot/storage/.please_resize_me ] ; then
|
||||
INIT_ARGS="--unit=fs-resize.target"
|
||||
fi
|
||||
# switch to new sysroot and start real init
|
||||
exec /bin/busybox switch_root /sysroot /usr/lib/systemd/systemd $INIT_ARGS
|
||||
|
||||
|
@ -1,16 +1,10 @@
|
||||
[Unit]
|
||||
Description=FS Resize
|
||||
DefaultDependencies=false
|
||||
After=show-version.service
|
||||
Before=local-fs-pre.target shutdown.target
|
||||
Conflicts=shutdown.target
|
||||
|
||||
ConditionPathExists=|/storage/.please_resize_me
|
||||
DefaultDependencies=no
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
Type=idle
|
||||
ExecStart=/usr/lib/openelec/fs-resize
|
||||
StandardOutput=tty
|
||||
|
||||
[Install]
|
||||
WantedBy=local-fs-pre.target
|
||||
StandardInput=tty-force
|
||||
StandardOutput=inherit
|
||||
StandardError=inherit
|
||||
|
5
packages/sysutils/busybox/system.d/fs-resize.target
Normal file
5
packages/sysutils/busybox/system.d/fs-resize.target
Normal file
@ -0,0 +1,5 @@
|
||||
[Unit]
|
||||
Description=FS Resize target
|
||||
Requires=fs-resize.service
|
||||
After=fs-resize.service
|
||||
AllowIsolate=yes
|
Loading…
x
Reference in New Issue
Block a user