From: Jo-Philipp Wich Date: Thu, 7 May 2009 14:20:09 +0000 (+0000) Subject: [PATCH] Don't try to pivot to new ramfs if already running on one X-Git-Tag: 0.9.0~482 X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=commitdiff_plain;h=8cebaa45d6cd56347d18ab7c18fe6d6cf0040d0b [PATCH] Don't try to pivot to new ramfs if already running on one This patch allows the luci-flash script to continue with the upgrade if openwrt is already running on a ramfs. This allows the use of luci-flash as an _installer_ when running from an iso image. A user could boot the system from a bootable cd and write an image to the hard disk or CF from the Flash Firmware page. Signed-off-by: Vasilis Tsiligiannis --- diff --git a/modules/admin-core/root/sbin/luci-flash b/modules/admin-core/root/sbin/luci-flash index 819be40b5..5600cddec 100755 --- a/modules/admin-core/root/sbin/luci-flash +++ b/modules/admin-core/root/sbin/luci-flash @@ -85,5 +85,9 @@ done [ -n "$sysupgrade_init_conffiles" ] && do_save_conffiles 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