base-files: move stage2 upgrade to separated file
do_upgrade_stage2() isn't really any common code. It isn't used anywhere except for /sbin/sysupgrade that passes it to the stage2. Moving its code to separated file also simplifies COMMAND variable. Signed-off-by: Rafał Miłecki <rafal@milecki.pl>master
parent
087e14ab59
commit
f7edd94a65
@ -0,0 +1,25 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
. /lib/functions.sh
|
||||||
|
|
||||||
|
include /lib/upgrade
|
||||||
|
|
||||||
|
v "Performing system upgrade..."
|
||||||
|
if type 'platform_do_upgrade' >/dev/null 2>/dev/null; then
|
||||||
|
platform_do_upgrade "$IMAGE"
|
||||||
|
else
|
||||||
|
default_do_upgrade "$IMAGE"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$SAVE_CONFIG" -eq 1 ] && type 'platform_copy_config' >/dev/null 2>/dev/null; then
|
||||||
|
platform_copy_config
|
||||||
|
fi
|
||||||
|
|
||||||
|
v "Upgrade completed"
|
||||||
|
sleep 1
|
||||||
|
|
||||||
|
v "Rebooting system..."
|
||||||
|
umount -a
|
||||||
|
reboot -f
|
||||||
|
sleep 5
|
||||||
|
echo b 2>/dev/null >/proc/sysrq-trigger
|
Loading…
Reference in New Issue