DebWrt

Debian on embedded devices

Welcome Guest 

Show/Hide Header

Welcome Guest, posting in this forum requires registration.





Pages: [1]
Author Topic: Failsafe to OpenWrt
blizzard.m-
l
Newbie
Posts: 1
Post Failsafe to OpenWrt
on: February 16, 2012, 09:26

Is it somehow possible to do failsafe to OpenWrt when USB stick/HDD with DebWrt root and kernel is not found? Let's say I have normal OpeWrt installation up and running, but when I connect an usb device with DebWrt root filesystem (with kernel in /boot/) and reboot to load and boot into DebWrt (and kexec kernel on usb).

I wonder if this is possible by rewriting openwrt's /ets/preinit script to use one from debwrt (http://dev.debwrt.net/browser/trunk/openwrt/files/package/base-files/files/etc/preinit)...

Any thoughts?

amain
Administrator
Posts: 137
Post Re: Failsafe to OpenWrt
on: February 16, 2012, 20:18

Yes, that is very much possible. There are several approaches. DebWrt uses a minimum openwrt rootfs to provide advanced booting. Instead of running /bin/sh as now is done in DebWrt as failsafe in /etc/preinit, run OpenWrts original /etc/preinit.

exec /etc/preinit.openwrt

During debWrt build, OpenWrts preinit script is overwritten by the one of DebWrt. You will need to preserve openwrts preinit instead. In the above example saved as preinit.openwrt. Now DebWrt looks for root devices. if not found it will exec into preinit of openwrt to boot openwrt normally. Note that debwrt has disabled most openwrt packages to create a minimum preboot environment. Also DebWrt patches OpenWrt to not store all kernel modules, again to keep things small. You may want to reenable all those packages and disable the patch that prevents kernel module from being copied to the preboot root fs.

Alterntively build openwrt norally and integrate some of /etc/preinit from debwrt into openwrt.

Pages: [1]
Mingle Forum by cartpauj
Version: 1.0.33 ; Page loaded in: 0.02 seconds.