Yet another bricked fonera recovered
I have been asked to recover another lost password/bricked fonera and upload an openwrt firmware.
I generally do not spend much time in trying to recover the system using the normal network system, since I have all the tools to connect to the internal serial port and go directly into the RedBoot system.
This is how I did it, most kept as a note for the next fonera I’m sure will come :)
This info are taken from this guide, read it if you are interesting in experimenting in more advanced feature or read others way to fix these kind of problems.
Connect the serial port using an usb->serial TTL converter as shown in this picture:
note: Be careful that the USB->serial is real a TTL (0-5v) level or you risk to damage the device.
note: I have used only the TX/RX and GND pin, no need for the 3.3V because on both the fonera and the serial adapter this is a source pin.
note: Some type of fonera does not boot if the serial port is connected, connect the cable just after it is turned on, more on the guide.
After entering in the RedBoot by pressing CTRL+C immediately after the power-on, I have increased the timeout in second for the next boot, this is completely optional.
Increase the boot timeout for CTRL+C to 10s
RedBoot> fconfig boot_script_timeout 10
This is the memory state before changing the firmware:
RedBoot> fis list
Name FLASH addr Mem addr Length Entry point
RedBoot 0xA8000000 0xA8000000 0x00030000 0x00000000
rootfs 0xA8030000 0xA8030000 0x00700000 0x00000000
vmlinux.bin.l7 0xA8730000 0x80041000 0x000B0000 0x80041000
FIS directory 0xA87E0000 0xA87E0000 0x0000F000 0x00000000
RedBoot config 0xA87EF000 0xA87EF000 0x00001000 0x00000000
Download the two images needed for the OpenWRT:
wget http://downloads.openwrt.org/barrier_breaker/14.07/atheros/generic/openwrt-atheros-root.squashfs
wget http://downloads.openwrt.org/barrier_breaker/14.07/atheros/generic/openwrt-atheros-vmlinux.lzma
The send these two files to the fonera using the serial connection and xmodem protocol, this require a lot of time at 9600bps, but in this way I can avoid all the TFTP server installation.
note: be sure your serial terminal support xmodem file exchange, I have used minicom.
load -r -b %{FREEMEMLO} -m xmodem openwrt-atheros-vmlinux.lzma
after watched your favorite movie
RedBoot> fis init
About to initialize [format] FLASH image system - continue (y/n)? y
*** Initialize FLASH Image System
... Erase from 0xa87e0000-0xa87f0000: .
... Program from 0x80ff0000-0x81000000 at 0xa87e0000: .
RedBoot> fis create -e 0x80041000 -r 0x80041000 vmlinux.bin.l7
... Erase from 0xa8030000-0xa8140000: ...
... Program from 0x80040800-0x80150800 at 0xa8030000: ...
... Erase from 0xa87e0000-0xa87f0000: .
... Program from 0x80ff0000-0x81000000 at 0xa87e0000: .
the memory situation after the first upload:
RedBoot> fis list
Name FLASH addr Mem addr Length Entry point
RedBoot 0xA8000000 0xA8000000 0x00030000 0x00000000
vmlinux.bin.l7 0xA8030000 0x80041000 0x00110000 0x80041000
FIS directory 0xA87E0000 0xA87E0000 0x0000F000 0x00000000
RedBoot config 0xA87EF000 0xA87EF000 0x00001000 0x00000000
now repeat the procedure for the second image:
RedBoot> load -r -b %{FREEMEMLO} -m xmodem openwrt-atheros-root.squashfs
CRaw file loaded 0x80040800-0x802a07ff, assumed entry at 0x80040800
xyzModem - CRC mode, 19456(SOH)/0(STX)/0(CAN) packets, 3 retries
RedBoot> fis create rootfs
... Erase from 0xa8140000-0xa83a0000: ...
... Program from 0x80040800-0x802a0800 at 0xa8140000: ...
... Erase from 0xa87e0000-0xa87f0000: .
... Program from 0x80ff0000-0x81000000 at 0xa87e0000: .
and now the image after the second upload:
RedBoot> fis list
Name FLASH addr Mem addr Length Entry point
RedBoot 0xA8000000 0xA8000000 0x00030000 0x00000000
vmlinux.bin.l7 0xA8030000 0x80041000 0x00110000 0x80041000
rootfs 0xA8140000 0x80040800 0x00260000 0x80040800
FIS directory 0xA87E0000 0xA87E0000 0x0000F000 0x00000000
RedBoot config 0xA87EF000 0xA87EF000 0x00001000 0x00000000
Do some check on the boot sequence, check the relative page on the guide, then
RedBoot> reset
The OpenWRT should boot now.
From: Morgan Read
Subject: Comment to blog/2014/yet_another_bricked_fonera_recovered
Date: Tue, 23 May 2017 11:39:00 +0100
Dear Enrico
(It looks like a lot below, but most is formatting and terminal output :-))
I have stumbled across your very helpful webpage after... Trying to
make some good use of my old Fonera!
I followed instructions here: https://lunxer.se/install-gargyole-on-a-fonera-fon2100/
At: 'Now we patch the kernel'
I was unable to get ssh working, so I downloaded files
'openwrt-ar531x-2.4-vmlinux-CAMICIA.lzma' and 'out.hex' to Fonera via wget.
From an old project I have this usb-ttl cable:
https://www.modmypi.com/adafruit-industries/adafruit-cables/adafruit-usb-cables/usb-to-ttl-serial-cable-debug--console-cable-for-raspberry-pi
This was the result:
# mtd -e vmlinux.bin.l7 write openwrt-ar531x-2.4-vmlinux-CAMICIA.lzma vmlinux.bin.l7
# reboot
+PHY ID is
0022:5521
Ethernet eth0: MAC address 00:18:84:29:1a:90
IP: 192.168.0.30/255.255.255.0, Gateway: 0.0.0.0
Default server: 192.168.0.140
RedBoot(tm) bootstrap and debug environment [ROMRAM]
Non-certified release, version v1.3.0 - built 16:57:58, Aug 7 2006
Copyright (C) 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
Board: ap51
RAM: 0x80000000-0x81000000, [0x80040450-0x80fe1000] available
FLASH: 0xa8000000 - 0xa87f0000, 128 blocks of 0x00010000 bytes each.
== Executing boot script in 10.000 seconds - enter ^C to abort
RedBoot> fis load -l
vmlinux.bin.l7
too long file.
lzma_decode failed.
res=1
RedBoot> exec
Now booting linux kernel:
Base address 0x80030000 Entry 0x80041000
Cmdline :
That's where boot hung.
Perhaps there was no need for that with the serial terminal...?
I am using minicom. I first set the default location for file upload
and download as /tmp/, but then cleared that following advice here:
https://www.raspberrypi.org/forums/viewtopic.php?t=42936&p=346554
And simply put 'openwrt-atheros-root.squashfs' and
'openwrt-atheros-vmlinux.lzma' in my home (root) directory.
I have found it difficult to discover where the default directory for
files for xmodem transfer from within minicom should be, perhaps I have
this wrong?
My memory state following the above and before following your
instructions to flash firmware is the same as yours:
RedBoot> fis list
Name FLASH addr Mem addr Length Entry point
RedBoot 0xA8000000 0xA8000000 0x00030000 0x00000000
rootfs 0xA8030000 0xA8030000 0x00700000 0x00000000
vmlinux.bin.l7 0xA8730000 0x80041000 0x000B0000 0x80041000
FIS directory 0xA87E0000 0xA87E0000 0x0000F000 0x00000000
RedBoot config 0xA87EF000 0xA87EF000 0x00001000 0x00000000
RedBoot>
I have followed your instructions on your page (twice, first with /tmp/
then with ~/ as upload directory) from:
'load -r -b %{FREEMEMLO} -m xmodem openwrt-atheros-vmlinux.lzma'
What shouldbe the output from that command?
The output I got was:
+PHY ID is 0022:5521
Ethernet eth0: MAC address 00:18:84:29:1a:90
IP: 192.168.0.30/255.255.255.0, Gateway: 0.0.0.0
Default server: 192.168.0.140
RedBoot(tm) bootstrap and debug environment [ROMRAM]
Non-certified release, version v1.3.0 - built 16:57:58, Aug 7 2006
Copyright (C) 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
Board: ap51
RAM: 0x80000000-0x81000000, [0x80040450-0x80fe1000] available
FLASH: 0xa8000000 - 0xa87f0000, 128 blocks of 0x00010000 bytes each.
== Executing boot script in 10.000 seconds - enter ^C to abort
^C
RedBoot> load -r -b %{FREEMEMLO} -m xmodem openwrt-atheros-vmlinux.lzma
CCCCCCCCCCCCCCCCCCCCCRaw file loaded 0x80040800-0x800407ff, assumed entry at 0x80040800
xyzModem - CRC mode, 0(SOH)/0(STX)/0(CAN) packets, 20 retries
RedBoot> fis init
About to initialize [format] FLASH image system - continue (y/n)? y
*** Initialize FLASH Image System
... Erase from 0xa87e0000-0xa87f0000: .
... Program from 0x80ff0000-0x81000000 at 0xa87e0000: .
RedBoot> fis create -e 0x80041000 -r 0x80041000 vmlinux.bin.l7
... Erase from 0xa8030000-0xa8030000:
... Program from 0x80040800-0x80040800 at 0xa8030000:
... Erase from 0xa87e0000-0xa87f0000: .
... Program from 0x80ff0000-0x81000000 at 0xa87e0000: .
RedBoot> fis list
Name FLASH addr Mem addr Length Entry point
RedBoot 0xA8000000 0xA8000000 0x00030000 0x00000000
vmlinux.bin.l7 0xA8030000 0x80041000 0x00000000 0x80041000
FIS directory 0xA87E0000 0xA87E0000 0x0000F000 0x00000000
RedBoot config 0xA87EF000 0xA87EF000 0x00001000 0x00000000
RedBoot> reset
** Error: Illegal command: "<Not a string: 0x8002D958>"
RedBoot> reset
+PHY ID is 0022:5521
Ethernet eth0: MAC address 00:18:84:29:1a:90
IP: 192.168.0.30/255.255.255.0, Gateway: 0.0.0.0
Default server: 192.168.0.140
RedBoot(tm) bootstrap and debug environment [ROMRAM]
Non-certified release, version v1.3.0 - built 16:57:58, Aug 7 2006
Copyright (C) 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
Board: ap51
RAM: 0x80000000-0x81000000, [0x80040450-0x80fe1000] available
FLASH: 0xa8000000 - 0xa87f0000, 128 blocks of 0x00010000 bytes each.
== Executing boot script in 10.000 seconds - enter ^C to abort
^C
When I did:
'load -r -b %{FREEMEMLO} -m xmodem openwrt-atheros-vmlinux.lzma'
I took a matter of seconds... Not time for my favourite movie!
And, I don't really understand hex numbers, but the length of
vmlinux.bin.l7 above at 0x00000000 looks like zero to me. That's not
the same as yours at 0x00110000, and might explain why the download is
so quick...
Please would you help where I'm going wrong...?
Also, I've used your exact files and commands so I can be confident I'm
not making a mistake in copying. However, I would prefer to flash with
this:
https://www.gargoyle-router.com/downloads/images/atheros/gargoyle_1.4.7-atheros-vmlinux.lzma
and:
https://www.gargoyle-router.com/downloads/images/atheros/gargoyle_1.4.7-atheros-root.squashfs
Many many thanks in advance.
Regards
Morgan.
PS therest- not surprisingly - doesn't look correct either:
RedBoot> load -r -b %{FREEMEMLO} -m xmodem openwrt-atheros-root.squashfs
CCCCCCCCCCCCCCCCCCCCCRaw file loaded 0x80040800-0x800407ff, assumed entry at 0x80040800
xyzModem - CRC mode, 0(SOH)/0(STX)/0(CAN) packets, 20 retries
RedBoot> fis create rootfs
... Erase from 0xa8030000-0xa8030000:
... Program from 0x80040800-0x80040800 at 0xa8030000:
... Erase from 0xa87e0000-0xa87f0000: .
... Program from 0x80ff0000-0x81000000 at 0xa87e0000: .
RedBoot> fis list
Name FLASH addr Mem addr Length Entry point
RedBoot 0xA8000000 0xA8000000 0x00030000 0x00000000
vmlinux.bin.l7 0xA8030000 0x80041000 0x00000000 0x80041000
FIS directory 0xA87E0000 0xA87E0000 0x0000F000 0x00000000
RedBoot config 0xA87EF000 0xA87EF000 0x00001000 0x00000000
RedBoot>
And, no. It doesn't boot:
RedBoot> reset
+PHY ID is 0022:5521
Ethernet eth0: MAC address 00:18:84:29:1a:90
IP: 192.168.0.30/255.255.255.0, Gateway: 0.0.0.0
Default server: 192.168.0.140
RedBoot(tm) bootstrap and debug environment [ROMRAM]
Non-certified release, version v1.3.0 - built 16:57:58, Aug 7 2006
Copyright (C) 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
Board: ap51
RAM: 0x80000000-0x81000000, [0x80040450-0x80fe1000] available
FLASH: 0xa8000000 - 0xa87f0000, 128 blocks of 0x00010000 bytes each.
== Executing boot script in 10.000 seconds - enter ^C to abort
RedBoot> fis load -l vmlinux.bin.l7
too long file.
lzma_decode failed.
res=1
RedBoot> exec
Now booting linux kernel:
Base address 0x80030000 Entry 0x80041000
Cmdline :
--
Morgan Read
---
Hi Morgan,
I try to help you the best I can, but I do not own a fonera anymore and
maybe something is changed in the software.
First I'd like to ask you if I can put these comments on the blog for
future use?
As far as I can see your trying to upload the kernel file fail.
[...]
> When I did:
> 'load -r -b %{FREEMEMLO} -m xmodem openwrt-atheros-vmlinux.lzma'
> I took a matter of seconds... Not time for my favourite movie!
Are you using the serial speed @ 9600 bps? Those serial adaptor? The
kernel size (compressed) is about 1MB, this means that @9600bps it will
take more or less 15 minutes to be transfered.
> Please would you help where I'm going wrong...?
Need to check cables, serial speed and parameters.
In order you have to upload the kernel, the rootfs and if everything
went ok, then you can reboot into the new kernel.
> Also, I've used your exact files and commands so I can be confident I'm
> not making a mistake in copying. However, I would prefer to flash with
> this:
> https://www.gargoyle-router.com/downloads/images/atheros/gargoyle_1.4.7-atheros-vmlinux.lzma
> And:
> https://www.gargoyle-router.com/downloads/images/atheros/gargoyle_1.4.7-atheros-root.squashfs
Once the upload works fine you can install everything compatibile with
the device, but first you have to fix the upload problem.
Let me know.
Bye
E.
---
From: Morgan Read
Subject: SUCCESS!!! Re: Comment to blog/2014/yet_another_bricked_fonera_recovered
Date: Wed, 31 May 2017 11:22:56 +0100
Hi Enrico
I gave up on xmodem after resetting it and trying it all over again and
it still didn't work - so I just set up tftpd which was very straight
forward - I have no idea what was happening xmodem, I'd like to know how
to use it, but I like my router working more :-)
Here's the process:
[root@morgansmachine ~]# ls -al | grep openwrt
-rw-r--r--. 1 root root 2490368 May 23 09:51 openwrt-atheros-root.squashfs
-rw-r--r--. 1 root root 1114112 May 23 09:51 openwrt-atheros-vmlinux.lzma
[root@morgansmachine ~]# minicom
Welcome to minicom 2.7
OPTIONS: I18n
Compiled on Feb 4 2016, 10:22:04.
Port /dev/ttyUSB0, 00:53:56
Press CTRL-A Z for help on special keys
+PHY ID is 0022:5521
Ethernet eth0: MAC address 00:18:84:29:1a:90
IP: 192.168.0.30/255.255.255.0, Gateway: 0.0.0.0
Default server: 192.168.0.140
RedBoot(tm) bootstrap and debug environment [ROMRAM]
Non-certified release, version v1.3.0 - built 16:57:58, Aug 7 2006
Copyright (C) 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
Board: ap51
RAM: 0x80000000-0x81000000, [0x80040450-0x80fe1000] available
FLASH: 0xa8000000 - 0xa87f0000, 128 blocks of 0x00010000 bytes each.
== Executing boot script in 10.000 seconds - enter ^C to abort
^C
RedBoot> fis list
Name FLASH addr Mem addr Length Entry point
RedBoot 0xA8000000 0xA8000000 0x00030000 0x00000000
vmlinux.bin.l7 0xA8030000 0x80041000 0x00000000 0x80041000
FIS directory 0xA87E0000 0xA87E0000 0x0000F000 0x00000000
RedBoot config 0xA87EF000 0xA87EF000 0x00001000 0x00000000
RedBoot> load -r -b %{FREEMEMLO} -m xmodem openwrt-atheros-vmlinux.lzma
CCCCCCCCCCCCCCCCCCCCCRaw file loaded 0x80040800-0x800407ff, assumed
entry at 0x80040800
xyzModem - CRC mode, 0(SOH)/0(STX)/0(CAN) packets, 20 retries
RedBoot> fis list
** Error: Illegal command: "<Not a string: 0x8002D958>"
RedBoot> fis list
Name FLASH addr Mem addr Length Entry point
RedBoot 0xA8000000 0xA8000000 0x00030000 0x00000000
vmlinux.bin.l7 0xA8030000 0x80041000 0x00000000 0x80041000
FIS directory 0xA87E0000 0xA87E0000 0x0000F000 0x00000000
RedBoot config 0xA87EF000 0xA87EF000 0x00001000 0x00000000
RedBoot> fis init
About to initialize [format] FLASH image system - continue (y/n)? y
*** Initialize FLASH Image System
... Erase from 0xa87e0000-0xa87f0000: .
... Program from 0x80ff0000-0x81000000 at 0xa87e0000: .
RedBoot> fis create -e 0x80041000 -r 0x80041000 vmlinux.bin.l7
... Erase from 0xa8030000-0xa8030000:
... Program from 0x80040800-0x80040800 at 0xa8030000:
... Erase from 0xa87e0000-0xa87f0000: .
... Program from 0x80ff0000-0x81000000 at 0xa87e0000: .
RedBoot> fis list
Name FLASH addr Mem addr Length Entry point
RedBoot 0xA8000000 0xA8000000 0x00030000 0x00000000
vmlinux.bin.l7 0xA8030000 0x80041000 0x00000000 0x80041000
FIS directory 0xA87E0000 0xA87E0000 0x0000F000 0x00000000
RedBoot config 0xA87EF000 0xA87EF000 0x00001000 0x00000000
RedBoot> load -r -b %{FREEMEMLO} -m xmodem openwrt-atheros-root.squashfs
CCCCCCCCCCCCCCCCCCCCCRaw file loaded 0x80040800-0x800407ff, assumed
entry at 0x80040800
xyzModem - CRC mode, 0(SOH)/0(STX)/0(CAN) packets, 20 retries
RedBoot> fis create rootfs
... Erase from 0xa8030000-0xa8030000:
... Program from 0x80040800-0x80040800 at 0xa8030000:
... Erase from 0xa87e0000-0xa87f0000: .
... Program from 0x80ff0000-0x81000000 at 0xa87e0000: .
RedBoot> fis list
Name FLASH addr Mem addr Length Entry point
RedBoot 0xA8000000 0xA8000000 0x00030000 0x00000000
vmlinux.bin.l7 0xA8030000 0x80041000 0x00000000 0x80041000
FIS directory 0xA87E0000 0xA87E0000 0x0000F000 0x00000000
RedBoot config 0xA87EF000 0xA87EF000 0x00001000 0x00000000
RedBoot> reset
+PHY ID is 0022:5521
Ethernet eth0: MAC address 00:18:84:29:1a:90
IP: 192.168.0.30/255.255.255.0, Gateway: 0.0.0.0
Default server: 192.168.0.140
RedBoot(tm) bootstrap and debug environment [ROMRAM]
Non-certified release, version v1.3.0 - built 16:57:58, Aug 7 2006
Copyright (C) 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
Board: ap51
RAM: 0x80000000-0x81000000, [0x80040450-0x80fe1000] available
FLASH: 0xa8000000 - 0xa87f0000, 128 blocks of 0x00010000 bytes each.
== Executing boot script in 10.000 seconds - enter ^C to abort
CTRL-A Z for help | 9600 8N1 | NOR | Minicom 2.7 | VT102 | Offline | ttyUSB0
[root@morgansmachine ~]# ls -al | grep openwrt
-rw-r--r--. 1 root root 2490368 May 23 09:51 openwrt-atheros-root.squashfs
-rw-r--r--. 1 root root 1114112 May 23 09:51 openwrt-atheros-vmlinux.lzma
[root@morgansmachine ~]# minicom
Welcome to minicom 2.7
OPTIONS: I18n
Compiled on Feb 4 2016, 10:22:04.
Port /dev/ttyUSB0, 01:09:13
Press CTRL-A Z for help on special keys
PHY ID is 0022:5521
Ethernet eth0: MAC address 00:18:84:29:1a:90
IP: 192.168.0.30/255.255.255.0, Gateway: 0.0.0.0
Default server: 192.168.0.140
RedBoot(tm) bootstrap and debug environment [ROMRAM]
Non-certified release, version v1.3.0 - built 16:57:58, Aug 7 2006
Copyright (C) 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
Board: ap51
RAM: 0x80000000-0x81000000, [0x80040450-0x80fe1000] available
FLASH: 0xa8000000 - 0xa87f0000, 128 blocks of 0x00010000 bytes each.
== Executing boot script in 10.000 seconds - enter ^C to abort
^C
RedBoot> fis list
Name FLASH addr Mem addr Length Entry point
RedBoot 0xA8000000 0xA8000000 0x00030000 0x00000000
vmlinux.bin.l7 0xA8030000 0x80041000 0x00000000 0x80041000
FIS directory 0xA87E0000 0xA87E0000 0x0000F000 0x00000000
RedBoot config 0xA87EF000 0xA87EF000 0x00001000 0x00000000
RedBoot> load -r -b %{FREEMEMLO} -m xmodem openwrt-atheros-vmlinux.lzma
CCCCCCCCCCCCCCCCCCCCCRaw file loaded 0x80040800-0x800407ff, assumed
entry at 0x80040800
xyzModem - CRC mode, 0(SOH)/0(STX)/0(CAN) packets, 20 retries
RedBoot> fis init
About to initialize [format] FLASH image system - continue (y/n)? y
*** Initialize FLASH Image System
... Erase from 0xa87e0000-0xa87f0000: .
... Program from 0x80ff0000-0x81000000 at 0xa87e0000: .
RedBoot> fis create -e 0x80041000 -r 0x80041000 vmlinux.bin.l7
... Erase from 0xa8030000-0xa8030000:
... Program from 0x80040800-0x80040800 at 0xa8030000:
... Erase from 0xa87e0000-0xa87f0000: .
... Program from 0x80ff0000-0x81000000 at 0xa87e0000: .
RedBoot> fis list
Name FLASH addr Mem addr Length Entry point
RedBoot 0xA8000000 0xA8000000 0x00030000 0x00000000
vmlinux.bin.l7 0xA8030000 0x80041000 0x00000000 0x80041000
FIS directory 0xA87E0000 0xA87E0000 0x0000F000 0x00000000
RedBoot config 0xA87EF000 0xA87EF000 0x00001000 0x00000000
RedBoot> load -r -b %{FREEMEMLO} -m xmodem openwrt-atheros-root.squashfs
CCCCCCCCCCCCCCCCCCCCCRaw file loaded 0x80040800-0x800407ff, assumed
entry at 0x80040800
xyzModem - CRC mode, 0(SOH)/0(STX)/0(CAN) packets, 20 retries
RedBoot> fis create rootfs
... Erase from 0xa8030000-0xa8030000:
... Program from 0x80040800-0x80040800 at 0xa8030000:
... Erase from 0xa87e0000-0xa87f0000: .
... Program from 0x80ff0000-0x81000000 at 0xa87e0000: .
RedBoot> fis list
Name FLASH addr Mem addr Length Entry point
RedBoot 0xA8000000 0xA8000000 0x00030000 0x00000000
vmlinux.bin.l7 0xA8030000 0x80041000 0x00000000 0x80041000
FIS directory 0xA87E0000 0xA87E0000 0x0000F000 0x00000000
RedBoot config 0xA87EF000 0xA87EF000 0x00001000 0x00000000
RedBoot> reset
[root@morgansmachine ~]# chkconfig tftp on
Note: Forwarding request to 'systemctl enable tftp.service'.
Created symlink from
/etc/systemd/system/sockets.target.wants/tftp.socket to
/usr/lib/systemd/system/tftp.socket.
[root@morgansmachine ~]# systemctl enable xinetd.service
[root@morgansmachine ~]# systemctl start xinetd.service
[root@morgansmachine ~]# systemctl status xinetd.service
● xinetd.service - Xinetd A Powerful Replacement For Inetd
Loaded: loaded (/usr/lib/systemd/system/xinetd.service; enabled;
vendor preset: enabled)
Active: active (running) since Tue 2017-05-30 18:34:20 BST; 6h ago
Docs: man:xinetd
man:xinetd.conf
man:xinetd.log
Main PID: 1420 (xinetd)
CGroup: /system.slice/xinetd.service
└─1420 /usr/sbin/xinetd -stayalive -pidfile /var/run/xinetd.pid
May 30 18:34:20 morgansmachine.lan xinetd[1420]: removing discard
May 30 18:34:20 morgansmachine.lan xinetd[1420]: removing echo
May 30 18:34:20 morgansmachine.lan xinetd[1420]: removing echo
May 30 18:34:20 morgansmachine.lan xinetd[1420]: removing tcpmux
May 30 18:34:20 morgansmachine.lan xinetd[1420]: removing time
May 30 18:34:20 morgansmachine.lan xinetd[1420]: removing time
May 30 18:34:20 morgansmachine.lan xinetd[1420]: xinetd Version 2.3.15
started with libwrap loadavg labeled-networking o
May 30 18:34:20 morgansmachine.lan xinetd[1420]: Started working: 1
available service
May 30 18:34:20 morgansmachine.lan systemd[1]: Started Xinetd A Powerful
Replacement For Inetd.
May 31 01:18:30 morgansmachine.lan systemd[1]: Started Xinetd A Powerful
Replacement For Inetd.
[root@morgansmachine ~]# chmod a+w /var/lib/tftpboot
[root@morgansmachine ~]# touch /var/lib/tftpboot/test20170531
[root@morgansmachine ~]# cd /var/lib/tftpboot/
[root@morgansmachine tftpboot]# ls
test20170531
[root@morgansmachine tftpboot]# tftp localhost
tftp> get test20170531
Transfer timed out.
tftp> q
[root@morgansmachine tftpboot]# ls
test20170531
[root@morgansmachine tftpboot]# cd ~/
[root@morgansmachine ~]# tftp localhost
tftp> get test20170531
Transfer timed out.
tftp> q
[root@morgansmachine ~]# ls | grep test20170531
test20170531
[root@morgansmachine ~]# systemctl status xinetd.service
● xinetd.service - Xinetd A Powerful Replacement For Inetd
Loaded: loaded (/usr/lib/systemd/system/xinetd.service; enabled;
vendor preset: enabled)
Active: active (running) since Tue 2017-05-30 18:34:20 BST; 15h ago
Docs: man:xinetd
man:xinetd.conf
man:xinetd.log
Main PID: 1420 (xinetd)
Tasks: 1 (limit: 512)
CGroup: /system.slice/xinetd.service
└─1420 /usr/sbin/xinetd -stayalive -pidfile /var/run/xinetd.pid
May 30 18:34:20 morgansmachine.lan xinetd[1420]: removing discard
May 30 18:34:20 morgansmachine.lan xinetd[1420]: removing echo
May 30 18:34:20 morgansmachine.lan xinetd[1420]: removing echo
May 30 18:34:20 morgansmachine.lan xinetd[1420]: removing tcpmux
May 30 18:34:20 morgansmachine.lan xinetd[1420]: removing time
May 30 18:34:20 morgansmachine.lan xinetd[1420]: removing time
May 30 18:34:20 morgansmachine.lan xinetd[1420]: xinetd Version 2.3.15
started with libwrap loadavg labeled-networking o
May 30 18:34:20 morgansmachine.lan xinetd[1420]: Started working: 1
available service
May 30 18:34:20 morgansmachine.lan systemd[1]: Started Xinetd A Powerful
Replacement For Inetd.
May 31 01:18:30 morgansmachine.lan systemd[1]: Started Xinetd A Powerful
Replacement For Inetd.
[root@morgansmachine ~]# ls -al | grep openwrt
-rw-r--r--. 1 root root 2490368 May 23 09:51
openwrt-atheros-root.squashfs
-rw-r--r--. 1 root root 1114112 May 23 09:51
openwrt-atheros-vmlinux.lzma
[root@morgansmachine ~]# cp ~/openwrt-atheros-root.squashfs
/var/lib/tftpboot/
[root@morgansmachine ~]# cp ~/openwrt-atheros-vmlinux.lzma
/var/lib/tftpboot/
[root@morgansmachine ~]# ls -al /var/lib/tftpboot/
total 3528
drwxrwxrwx. 2 root root 4096 May 31 10:13 .
drwxr-xr-x. 85 root root 4096 May 30 18:34 ..
-rw-r--r--. 1 root root 2490368 May 31 10:13 openwrt-atheros-root.squashfs
-rw-r--r--. 1 root root 1114112 May 31 10:13 openwrt-atheros-vmlinux.lzma
-rw-r--r--. 1 root root 0 May 31 01:33 test20170531
[root@morgansmachine ~]# cd /tmp
[root@morgansmachine tmp]# tftp localhost
tftp> get openwrt-atheros-root.squashfs
Transfer timed out.
tftp> get openwrt-atheros-vmlinux.lzma
Transfer timed out.
tftp> q
[root@morgansmachine tmp]# ls -al | grep openwrt
-rw-r--r--. 1 root root 0 May 31 10:15
openwrt-atheros-root.squashfs
-rw-r--r--. 1 root root 0 May 31 10:16
openwrt-atheros-vmlinux.lzma
[root@morgansmachine tmp]# minicom
Welcome to minicom 2.7
OPTIONS: I18n
Compiled on Feb 4 2016, 10:22:04.
Port /dev/ttyUSB0, 10:18:14
Press CTRL-A Z for help on special keys
+PHY ID is 0022:5521
Ethernet eth0: MAC address 00:18:84:29:1a:90
IP: 192.168.0.30/255.255.255.0, Gateway: 0.0.0.0
Default server: 192.168.0.140
RedBoot(tm) bootstrap and debug environment [ROMRAM]
Non-certified release, version v1.3.0 - built 16:57:58, Aug 7 2006
Copyright (C) 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
Board: ap51
RAM: 0x80000000-0x81000000, [0x80040450-0x80fe1000] available
FLASH: 0xa8000000 - 0xa87f0000, 128 blocks of 0x00010000 bytes each.
== Executing boot script in 10.000 seconds - enter ^C to abort
^C
RedBoot> reset
+PHY ID is 0022:5521
Ethernet eth0: MAC address 00:18:84:29:1a:90
IP: 192.168.0.30/255.255.255.0, Gateway: 0.0.0.0
Default server: 192.168.0.140
RedBoot(tm) bootstrap and debug environment [ROMRAM]
Non-certified release, version v1.3.0 - built 16:57:58, Aug 7 2006
Copyright (C) 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
Board: ap51
RAM: 0x80000000-0x81000000, [0x80040450-0x80fe1000] available
FLASH: 0xa8000000 - 0xa87f0000, 128 blocks of 0x00010000 bytes each.
== Executing boot script in 10.000 seconds - enter ^C to abort
^C
RedBoot> fis list
Name FLASH addr Mem addr Length Entry point
RedBoot 0xA8000000 0xA8000000 0x00030000 0x00000000
vmlinux.bin.l7 0xA8030000 0x80041000 0x00000000 0x80041000
FIS directory 0xA87E0000 0xA87E0000 0x0000F000 0x00000000
RedBoot config 0xA87EF000 0xA87EF000 0x00001000 0x00000000
RedBoot> load -r -b %{FREEMEMLO} openwrt-atheros-vmlinux.lzma
Using default protocol (TFTP)
Raw file loaded 0x80040800-0x801507ff, assumed entry at 0x80040800
RedBoot> fis init
About to initialize [format] FLASH image system - continue (y/n)? y
*** Initialize FLASH Image System
... Erase from 0xa87e0000-0xa87f0000: .
... Program from 0x80ff0000-0x81000000 at 0xa87e0000: .
RedBoot> fis create -e 0x80041000 -r 0x80041000 vmlinux.bin.l7
... Erase from 0xa8030000-0xa8140000: .................
... Program from 0x80040800-0x80150800 at 0xa8030000: .................
... Erase from 0xa87e0000-0xa87f0000: .
... Program from 0x80ff0000-0x81000000 at 0xa87e0000: .
RedBoot> fis list
Name FLASH addr Mem addr Length Entry point
RedBoot 0xA8000000 0xA8000000 0x00030000 0x00000000
vmlinux.bin.l7 0xA8030000 0x80041000 0x00110000 0x80041000
FIS directory 0xA87E0000 0xA87E0000 0x0000F000 0x00000000
RedBoot config 0xA87EF000 0xA87EF000 0x00001000 0x00000000
RedBoot> load -r -b %{FREEMEMLO} openwrt-atheros-root.squashfs
Using default protocol (TFTP)
Raw file loaded 0x80040800-0x802a07ff, assumed entry at 0x80040800
RedBoot> fis create rootfs
... Erase from 0xa8140000-0xa83a0000:
... Program from 0x80040800-0x802a0800 at 0xa8140000:
... Erase from 0xa87e0000-0xa87f0000: .
... Program from 0x80ff0000-0x81000000 at 0xa87e0000: .
RedBoot> fis list
Name FLASH addr Mem addr Length Entry point
RedBoot 0xA8000000 0xA8000000 0x00030000 0x00000000
vmlinux.bin.l7 0xA8030000 0x80041000 0x00110000 0x80041000
rootfs 0xA8140000 0x80040800 0x00260000 0x80040800
FIS directory 0xA87E0000 0xA87E0000 0x0000F000 0x00000000
RedBoot config 0xA87EF000 0xA87EF000 0x00001000 0x00000000
RedBoot>
RedBoot> reset
+PHY ID is 0022:5521
Ethernet eth0: MAC address 00:18:84:29:1a:90
IP: 192.168.0.30/255.255.255.0, Gateway: 0.0.0.0
Default server: 192.168.0.140
RedBoot(tm) bootstrap and debug environment [ROMRAM]
Non-certified release, version v1.3.0 - built 16:57:58, Aug 7 2006
Copyright (C) 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
Board: ap51
RAM: 0x80000000-0x81000000, [0x80040450-0x80fe1000] available
FLASH: 0xa8000000 - 0xa87f0000, 128 blocks of 0x00010000 bytes each.
== Executing boot script in 10.000 seconds - enter ^C to abort
RedBoot> fis load -l vmlinux.bin.l7
Image loaded from 0x80041000-0x8033d6a4
RedBoot> exec
Now booting linux kernel:
Base address 0x80030000 Entry 0x80041000
Cmdline :
[ 0.000000] Linux version 3.10.49 (bb@builder1) (gcc version 4.8.3
(OpenWrt/Linaro GCC 4.8-2014.04 r42625) ) #3 Wed 4
[ 0.000000] ar2315-gpio: registered 22 GPIOs
[ 0.000000] bootconsole [early0] enabled
[ 0.000000] CPU revision is: 00019064 (MIPS 4KEc)
[...] a lot of kernel outout
procd: - init complete -
BusyBox v1.22.1 (2014-09-21 00:45:02 CEST) built-in shell (ash)
Enter 'help' for a list of built-in commands.
_______ ________ __
| |.-----.-----.-----.| | | |.----.| |_
| - || _ | -__| || | | || _|| _|
|_______|| __|_____|__|__||________||__| |____|
|__| W I R E L E S S F R E E D O M
-----------------------------------------------------
BARRIER BREAKER (14.07, r42625)
-----------------------------------------------------
* 1/2 oz Galliano Pour all ingredients into
* 4 oz cold Coffee an irish coffee mug filled
* 1 1/2 oz Dark Rum with crushed ice. Stir.
* 2 tsp. Creme de Cacao
-----------------------------------------------------
root@OpenWrt:/#
--
Morgan Read