mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-28 05:06:43 +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
|
esac
|
||||||
|
|
||||||
|
rm -f /storage/.please_resize_me
|
||||||
|
sync
|
||||||
|
|
||||||
# just in case
|
# just in case
|
||||||
if [ ! -z "$DISK" -a ! -z "$PART" ] ; then
|
if [ ! -z "$DISK" -a ! -z "$PART" ] ; then
|
||||||
# get storage partition start
|
# get storage partition start
|
||||||
@ -38,8 +41,6 @@ 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
|
||||||
rm -f /storage/.please_resize_me
|
|
||||||
sync
|
|
||||||
umount $PART
|
umount $PART
|
||||||
# TODO: clean up debug
|
# TODO: clean up debug
|
||||||
echo "resizing /storage..."
|
echo "resizing /storage..."
|
||||||
@ -54,7 +55,7 @@ if [ -e /storage/.please_resize_me ] ; then
|
|||||||
resize2fs $PART &>/dev/null
|
resize2fs $PART &>/dev/null
|
||||||
echo "...done. rebooting in 15s"
|
echo "...done. rebooting in 15s"
|
||||||
sleep 15
|
sleep 15
|
||||||
reboot
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
reboot
|
||||||
|
@ -662,6 +662,10 @@
|
|||||||
if [ "$STORAGE_NETBOOT" = "yes" ] ; then
|
if [ "$STORAGE_NETBOOT" = "yes" ] ; then
|
||||||
echo "" > /sysroot/dev/.storage_netboot
|
echo "" > /sysroot/dev/.storage_netboot
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -f /sysroot/storage/.please_resize_me ] ; then
|
||||||
|
INIT_ARGS="--unit=fs-resize.target"
|
||||||
|
fi
|
||||||
# switch to new sysroot and start real init
|
# switch to new sysroot and start real init
|
||||||
exec /bin/busybox switch_root /sysroot /usr/lib/systemd/systemd $INIT_ARGS
|
exec /bin/busybox switch_root /sysroot /usr/lib/systemd/systemd $INIT_ARGS
|
||||||
|
|
||||||
|
@ -1,16 +1,10 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=FS Resize
|
Description=FS Resize
|
||||||
DefaultDependencies=false
|
DefaultDependencies=no
|
||||||
After=show-version.service
|
|
||||||
Before=local-fs-pre.target shutdown.target
|
|
||||||
Conflicts=shutdown.target
|
|
||||||
|
|
||||||
ConditionPathExists=|/storage/.please_resize_me
|
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=idle
|
||||||
ExecStart=/usr/lib/openelec/fs-resize
|
ExecStart=/usr/lib/openelec/fs-resize
|
||||||
StandardOutput=tty
|
StandardInput=tty-force
|
||||||
|
StandardOutput=inherit
|
||||||
[Install]
|
StandardError=inherit
|
||||||
WantedBy=local-fs-pre.target
|
|
||||||
|
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