[luci] [PATCH] Don't try to pivot to new ramfs if already running on one

Vasilis Tsiligiannis b_tsiligiannis at silverton.gr
Thu May 7 15:40:15 CEST 2009


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 <b_tsiligiannis at silverton.gr>
---
 trunk/modules/admin-core/root/sbin/luci-flash |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/trunk/modules/admin-core/root/sbin/luci-flash b/trunk/modules/admin-core/root/sbin/luci-flash
index 819be40..5600cdd 100755
--- a/trunk/modules/admin-core/root/sbin/luci-flash
+++ b/trunk/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
-- 
1.5.4.3



More information about the luci mailing list