summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73>2009-05-07 13:51:45 +0000
committerjow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73>2009-05-07 13:51:45 +0000
commit2eba59293a00599cc62412cb3f36eec5015477ea (patch)
treed0bf2cba5aeca633da33be6897659dd09c40f9cf
parent9e6dab0a93d7947be3949a547ad4e4e7d6a2a00b (diff)
[sysupgrade] Don't try to pivot to new ramfs if already running on one
This patch allows the sysupgrade script to continue with the upgrade if openwrt is already running on a ramfs. This allows the use of the sysupgrade script as an _installer_ when running from an iso image. A user could boot the system from a bootable cd and invoke sysupgrade -n <URL> to write an image to the hard disk or CF. Signed-off-by: Vasilis Tsiligiannis <b_tsiligiannis@silverton.gr> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@15683 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rwxr-xr-xpackage/base-files/files/sbin/sysupgrade8
1 files changed, 6 insertions, 2 deletions
diff --git a/package/base-files/files/sbin/sysupgrade b/package/base-files/files/sbin/sysupgrade
index 83cc95682f..139135e8f7 100755
--- a/package/base-files/files/sbin/sysupgrade
+++ b/package/base-files/files/sbin/sysupgrade
@@ -109,5 +109,9 @@ else
fi
run_hooks "" $sysupgrade_pre_upgrade
-v "Switching to ramdisk..."
-run_ramfs '. /etc/functions.sh; include /lib/upgrade; do_upgrade'
+if [ -n "$(rootfs_type)" ]; then
+ v "Switching to ramdisk..."
+ run_ramfs '. /etc/functions.sh; include /lib/upgrade; do_upgrade'
+else
+ do_upgrade
+fi \ No newline at end of file