[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 <b_tsiligiannis@silverton.gr>
This commit is contained in:
Jo-Philipp Wich 2009-05-07 14:20:09 +00:00
parent e4d0d97fbb
commit 8cebaa45d6

View file

@ -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