OpenWrt Forum Archive

Topic: Failsafe mode from redboot...

The content of this topic has been archived on 28 Mar 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

My fonera is rebooting continiously after a wrong entry in /etc/sysctl.conf. I have tried to get it into failsafe mode by pressing the reset button, but it is not succeeding...

Is it possible to boot into failsafe mode from redboot using a kernel boot parameter or is the exec command line overwritten as I read somewhere... if that is the case will I need to reflash ?

I have no serial connection atm and running atheros 2.6 snapshot kamikaze.

I would really like to know how to get my fonera into failsafe mode. Does it work on Kamikaze ? Reset button or otherwise ?

Anyone care to reply ?

Is there a failsafe kernel I could flash ? I have access to redboot and really only need to change sysctl.conf, which is causing the circulair reboot,  so don't want to reflash and start configuring all again from scratch...

Why doesn't the reset button work on the fonera to get it into failsafe mode and why for godsake are you overwriting the command line parameter to the kernel at startup ? Couldn't this be setup a bit more intelligently f.i. not overwriting if there is a command line passed through from redboot ?

Can anybody help ?

(Last edited by intrax on 11 Mar 2007, 03:08)

no, i don't think there is failsafe way.

@Goldserve - Appreciate your reply...

No way to start without sysctrl.conf ?

Would be nice to have some kind of mini kernel with jffs2 support to recover from this kind of silly trouble...

(Last edited by intrax on 11 Mar 2007, 13:49)

Hi,

Yes I read that, but unfortunately that is not working because some openwrt developper decided in his/her 'infinite wisdom' that the exec string for the kernel can easily be overwritten at kernel startup so to leave me and others in a similar situation screwed ! Moreover so as apparantly there is NO WAY to enter failsafe mode on a fonera, reset button does nothing ! Thats why I suggested to come up with a more 'intelligent' way to do this and NOT overwrite the kernel exec parameter string if the user has specifically entered something there.... well I guess idle hope and for now only a reflash can solve this... sigh...

Anyway fabsoft many thanks for bearing with me... :-)

(Last edited by intrax on 11 Mar 2007, 18:45)

it would not be terribly hard to make a 'failsafe' kernel with an embedded initramfs image and jffs2 support for recovery. if you still want one i'll make one, but I think there's actually an option you could use in the buildroot configuration, to make a kernel and rootfs image combined

if you do make/get such an image, just load it into ram from redboot and run it, no need to flash it.

Hi Kevin,

Thanks for your reply.

I would appreciate if you could build such a 'failsafe kernel' as I don't have access to an openwrt buildroot system atm.

cheers

Anyone who can make a kamikaze 'failsafe kernel' for Atheros 2.6 ?

Or, for ~$10-$12 you could get a LVTTL -> RS232 converter so small you could permanently mount it in your router.

http://www.digilentinc.com/Products/Det … Peripheral

Note - these are available from a lot of places, I just provided this link as an example.

jshamlet wrote:

Or, for ~$10-$12 you could get a LVTTL -> RS232 converter so small you could permanently mount it in your router.

http://www.digilentinc.com/Products/Det … Peripheral

Note - these are available from a lot of places, I just provided this link as an example.

Not asking for any ads and it wouldn't work if you had read the thread a bit more carefully...

(Last edited by intrax on 14 Mar 2007, 19:35)

While I was compiling the sources for redboot, I noticed there was a file system support with JFFS2. It is enabled on my build but i don't know how to mount the file system. Let me look into it further.

Edit: I had a look and redboot can not write to jffs2 file systems. It can only read. Sorry, out of luck!

(Last edited by GoldServe on 14 Mar 2007, 20:17)

intrax wrote:
jshamlet wrote:

Or, for ~$10-$12 you could get a LVTTL -> RS232 converter so small you could permanently mount it in your router.

http://www.digilentinc.com/Products/Det … Peripheral

Note - these are available from a lot of places, I just provided this link as an example.

Not asking for any ads and it wouldn't work if you had read the thread a bit more carefully...

I'm not posting any ads, either. I just posted a link to a board that is small enough to fit inside the router. I don't work for, or have any affiliation with, the company or product.

However, unless you have mounted your router where you can't physically access it, using a serial converter is still the best way to recover in this situation. I always make sure I have a console port handy when I'm debugging an embedded system, since you can't always count on software fail-safes.

Also, the reset button on the bottom is not a standard reset button. It's actually running between to two GPIO lines, so it would require some level of software to function. One GPIO line is setup as an input, while the second is setup as an output. The button is "pulled up" to the output, which allows you to do a soft-reset by driving the output low. Note that the reset line isn't involved here, everything that occurs happens in software.

I would assume that the kernel has been modified to look for this input, and reset/recover when it sees it go low. This tracks, since you have to hold the button for nearly 30 seconds after power-up for the recovery to begin. (it takes a few seconds for the kernel to load) I suspect that FON's changes would need to be ported to support the same mechanism. (IOW, Kamikaze probably doesn't know about the button yet)

@GoldServe - Thanks for trying, goodluck with redboot and your awsome 32MB fonera...

@jshamlet - The serial console will not let me recover from this situation as it's a continous reboot caused by the kernel startup. I am perfectly aware of the ttl/rs232 level shifter but have not needed it and would like (if at all possible..) to keep it that way. I know the reset button will not bring the fonera in failsafe mode as I have tried several times and development should care to fix this. And yes this has all been in written in this thread before so please read...

I tried to build a openwrt failsafe kernel with kernel embedded rootfs for the fonera myself. I installed a colinux (debian) system and downloaded kamikaze trunk and all needed packages. The compile fails with error: /usr/initramfs_data.gpio.gz error 255....

edit: compiling without initramfs support works flawless....

Anyone know what's wrong here ?

(Last edited by intrax on 16 Mar 2007, 23:47)

I have built the initramfs kernel for fonera and loaded it into ram using tftp (openwrt-atheros-2.6-vmlinux.lzma from /trunk/bin)...

I load than execute the kernel using:

load -r -b %{FREEMEMLO} openwrt-atheros-2.6-vmlinux.lzma
exec

Doesn't seem to work, nothing on 192.168.1.1
Do I need to add any command line parameters ?

Kernel does not seem to be booting... Please help ?

(Last edited by intrax on 21 Mar 2007, 01:45)

Um, try it without compression:

load /openwrt-atheros-2.6-vmlinux.elf
exec

(I think also the gzipped image should work with -c , but I have not test it yet.)

@olg
Thanks for your reply. I tried all three kernel images (lzma, gz and elf) and none of them seems to be working...

Are you testing this yourself as well ?

It works fine for me:

RedBoot> ip -h XX.XX.XX.XX
IP: 192.168.2.86/255.255.255.0, Gateway: 192.168.2.1
Default server: XX.XX.XX.XX
RedBoot> load -m http -p 2000 /openwrt-atheros-2.6-vmlinux.elf
Entry point: 0x802a7000, address range: 0x80041000-0x803cddca
RedBoot> exec

What is your output?

I load kernel through tftp i.o http, but it loads fine.

When I start kernel from redboot (connected through telnet 192.168.1.254:9000)  there is no output anymore in the redboot console, which is normal as I have no serial connection...

If the initramfs kernel would be booting correctly I expect to be able to connect through telnet at 192.168.1.1 but sofar nothing...

What is your output ? Any special kernel_config ?

(Last edited by intrax on 23 Mar 2007, 01:33)

I checked with serial console, the initramfs kernel is simply not booting. Has anyone loaded and ran an initramfs failsafe kernel successfully on fonera ?

edit:

pity noone but olg cared to help me...

the kernel does boot using:

load openwrt-atheros-2.6-vmlinux.elf
exec

i.o. load -r -b

than you can simply mount the jffs2 filesystem on mtd1 and correct anything wrong, reboot and voila loop SOLVED !

(Last edited by intrax on 3 Apr 2007, 23:26)

Redboot in the Atheros boards doesn't appear to be able to pass the exec'd command line to the kernel correctly, it corrupts the command line area when you use the -c option.  Here's a work around:

1) Find the address of the compiled in boot command line in System.map (in the build_dir), in my kernel it's 0x80240860.
2) Load your Gzip'd kernel (or elf file or however),  eg:
   load -d -b 0x80041000 -r openwrt-atheros-vmlinux.gz
3) Wipe the original command line
   mfill -b 0x80240860 -l 256 -p 0
4) load a text file using tftp or http (create this with vi or whatever) with the command line, into the command line location
   load -r -b 0x80240860 kernel_cmdline
5) exec the image (need to specify the entry point, as last load sets the default)
  exec 0x80041000

This works fine for me.  Know if anyone getst the recipe to create the failsafe image let me know ;-)

The discussion might have continued from here.