From a0c690b535373a91456c5d717a41735a0f423c4e Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Thu, 7 May 2009 13:51:45 +0000 Subject: [PATCH] [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 to write an image to the hard disk or CF. Signed-off-by: Vasilis Tsiligiannis SVN-Revision: 15683 --- package/base-files/files/sbin/sysupgrade | 8 ++++++-- 1 file 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 -- 2.30.2