aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files/files/lib/upgrade/stage2
Commit message (Collapse)AuthorAgeFilesLines
* base-files: add /usr/share/libubox/jshn.sh to sysupgrade stage2Russell Senior2019-11-141-1/+1
| | | | | | | | Discovered recent changes had broken sysupgrade for ar71xx mikrotik rb-493g, traced the problem to missing /usr/share/libubox/jshn.sh after switching to tmpfs. Signed-off-by: Russell Senior <russell@personaltelco.net>
* treewide: use new procd sysupgrade $UPGRADE_BACKUP variableRafał Miłecki2019-09-121-1/+0
| | | | | | | | | | | It's a variable set by procd that should replace hardcoded /tmp/sysupgrade.tgz. This change requires the most recent procd with the commit 0f3c136 ("sysupgrade: set UPGRADE_BACKUP env variable"). Signed-off-by: Rafał Miłecki <rafal@milecki.pl> (cherry picked from commit 641f6b6c26cb9ab5e1198810015e5f4b2b5b34ad)
* treewide: sysupgrade: pass "save_partitions" option to the "sysupgrade" methodRafał Miłecki2019-09-041-5/+0
| | | | | | | | This explicitly lets stage2 know if partitions should be preserved. No more "touch /tmp/sysupgrade.always.overwrite.bootdisk.partmap" hack. Signed-off-by: Rafał Miłecki <rafal@milecki.pl> (cherry picked from commit b6f4cd57e19a8cfcd9ff52582b65164ce6213c3d)
* base-files: pass "save_config" option to the "sysupgrade" methodRafał Miłecki2019-09-041-2/+0
| | | | | | | This explicitly lets stage2 know if config should be preserved. Signed-off-by: Rafał Miłecki <rafal@milecki.pl> (cherry picked from commit b534ba96110012d2697d19d71b7dcd60bd4cd375)
* base-files: don't set ARGV and ARGCRafał Miłecki2019-09-041-3/+0
| | | | | | | Those are not used by any image check function anymore. Signed-off-by: Rafał Miłecki <rafal@milecki.pl> (cherry picked from commit 3f4c785a6bbde87296e362c315f10b55c98843e3)
* base-files: move stage2 upgrade to separated fileRafał Miłecki2019-09-041-1/+1
| | | | | | | | | | 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> (cherry picked from commit f7edd94a6588aa6a3e2e7a72410a34392a9fbe78)
* base-files: drop support for NAND upgrade in platform_pre_upgrade()Rafał Miłecki2019-09-041-4/+1
| | | | | | | | With bcm53xx switched to the new procedure there is no more need for keeping that backward compatibility code. Signed-off-by: Rafał Miłecki <rafal@milecki.pl> (cherry picked from commit ea4e1dac71dfa015c0da10e68149478fa25878f9)
* treewide: consolidate upgrade state setMathias Kresin2018-08-161-0/+1
| | | | | | | | | | Set the (sys)upgrade state when sourcing the stage2 script instead of setting the state for each target individual. This change fixes the, due to a missing state set, not working upgrade led on ath79 and apm821xx. Signed-off-by: Mathias Kresin <dev@kresin.me>
* sysupgrade: don't kill our own parentMat Trudel2017-11-151-2/+3
| | | | | | | | Add the parent of the sysupgrade script to the list of pids not getting killed Signed-off-by: Mat Trudel <mat@geeky.net> Signed-off-by: John Crispin <john@phrozen.org>
* base-files: upgrade: don't loop forever trying to kill processesMatthias Schiffer2017-07-201-1/+10
| | | | | | | | | | When processes don't die on SIGKILL (usually because of kernel bugs), it's better to give up instead of looping forever. upgraded will trigger a reboot in this case (and if this fails, a hardware watchdog will eventually time out and reset the system, if present). Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
* base-files: automatically handle paths and symlinks for RAMFS_COPY_BINMatthias Schiffer2017-07-111-26/+17
| | | | | | | | | | | | Depending on busybox applet selection, paths of basic utiilties may differ, and may not work as symlinks to busybox. Simply using whatever binary is found in PATH and detecting symlinks automatically is more robust and easier to maintain. The list of binaries is also slightly cleaned up and duplicates are removed. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
* bcm53xx: upgrade: fix RAMFS_COPY_*Matthias Schiffer2017-07-111-1/+1
| | | | | Fixes: 30f61a34b4cf "base-files: always use staged sysupgrade" Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
* mvebu: fix sysupgradeMatthias Schiffer2017-06-011-1/+1
| | | | | | | | | | | | | | | | | mvebu was modifying RAMFS_COPY_BIN and RAMFS_COPY_DATA from a sysupgrade_pre_upgrade hook. As the ramfs is created from stage2, this did not have an effect anymore after the staged sysupgrade changes. As it doesn't really hurt to copy fw_printenv and fw_setenv unconditionally, simply add them in /lib/upgrade/platform.sh, so stage2 will see them. Config copying is moved to a function called by platform_copy_config, where it belongs. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net> Fixes: FS#821 Fixes: 30f61a34b4cf "base-files: always use staged sysupgrade"
* base-files: sysupgrade cleanupMatthias Schiffer2017-05-291-3/+102
| | | | | | | | | | | | Some functions only used by stage2 are moved there from common.sh. One piece that could still use more cleanup is platform_pre_upgrade: many targets reference files from there are aren't available in the ramfs, so we need to evaluate it before the switch; conversely, flash writes happen in that function on some targets. Targets that do the latter should be fixed eventually to use platform_do_upgrade for that purpose. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
* base-files: always use staged sysupgradeMatthias Schiffer2017-05-291-0/+50
Support for the -d and -p options is dropped; it may be added again at some point by adding these flags to the ubus sysupgrade call. A downside of this is that we get a lot less information about the progress of the upgrade: as soon as the actual upgrade starts, all shell sessions are killed to allow unmounting the root filesystem. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>