Skip to content

Instantly share code, notes, and snippets.

@wrtcoder
Forked from probonopd/A5-V11.txt
Created January 10, 2016 08:08
Show Gist options
  • Save wrtcoder/1bd4b6a6d01aac753e66 to your computer and use it in GitHub Desktop.
Save wrtcoder/1bd4b6a6d01aac753e66 to your computer and use it in GitHub Desktop.
Very cheap (8 USD) "3G/4G Router", apparently similar to Hame MPR-A1 (but a clone since I can login with admin/admin via telnet). On the PCB it has a W9825G6EH-75 RAM chip. Ethernet MAC address starts with 2C:67:FB:
I flashed OpenWrt CHAOS CALMER (Bleeding Edge, r43793) using the stock web interface of the device. Just connect the router with an Ethernet cable to a network, it will switch on the blue and red LEDs. Find you the IP address from the DHCP server, and log into the router using your web browser.
Login: admin
Password: admin
Switch the language to English from the drop down menu. I got reconnected to a wrong IP address, so I had to type the correct one again in the URL field of the browser, then the interface was English. Using the Administrator -> Firmware menu, I flashed https://dl.dropboxusercontent.com/u/98389203/openwrt-ramips-rt305x-a5-v11-squashfs-factory.bin
Or, if you want to make the image yourself, use the OpenWrt Image Generator:
wget https://downloads.openwrt.org/snapshots/trunk/ramips/OpenWrt-ImageBuilder-ramips_rt305x-for-linux-x86_64.tar.bz2
tar xfj OpenWrt-ImageBuilder-ramips_rt305x-for-linux-x86_64.tar.bz2
cd OpenWrt-ImageBuilder-ramips_rt305x-for-linux-x86_64/
make image PROFILE="A5-V11"
cp bin/ramips/* $WEBSERVER
I have opened https://dev.openwrt.org/ticket/18712 to ask for A5-V11 images missing in ramips-rt305x snapshots.
Thereafter, the router is waiting for you to log in with telnet and no password via Ethernet on IP address 192.168.1.1. To access this, set your computer's IP address to 192.168.1.2 subnet 255.255.255.0.
We can always enter OpenWrt failsafe mode, plug in power, wait until the red light disappears, then press the button a couple of times.
To switch to Ethernet DHCP client mode, we do:
mount_root
passwd
/etc/init.d/dnsmasq stop
/etc/init.d/firewall stop
/etc/init.d/dnsmasq disable
/etc/init.d/firewall disable
cat > /etc/config/network <<\EOF
config interface 'loopback'
option ifname 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config interface 'lan0'
option ifname 'eth0.1'
option proto 'dhcp'
EOF
sync
/etc/init.d/network reload
Now we can connect the device to Ethernet and it will fetch an IP address with DHCP. Note that we have to use 'eth0.1' on this device and NOT 'eth0' or 'eth1' as on some other devices. Probably the /etc/uci-defaults/02_network pre-populates the stock configuration accordingly somewhere in the firmware generation process.
Now let's check the GPIOs:
root@OpenWrt:/# cat /sys/kernel/debug/gpio
GPIOs 0-21, platform/10000600.gpio, 10000600.gpio:
gpio-0 (reset ) in hi
gpio-7 (usb ) out hi
gpio-12 (root_hub ) out hi
gpio-17 (a5-v11:red:power ) out lo
gpio-20 (a5-v11:blue:system ) out hi
Possibly there are more, but how do we find them on the PCB?
===
With the factory firmware, just connect the router with an Ethernet cable to a network, it will switch on the blue and red LEDs. Find you the IP address from the DHCP server, and log into the router via telnet:
telnet 192.168.0.13
BoC Login: admin
Password: admin
BusyBox v1.12.1 (2013-06-20 00:48:37 HKT) built-in shell (msh)
Enter 'help' for a list of built-in commands.
BoC Router>
addgroup gpio mkdir route
adduser halt mknod sdparm
ated hostname mount sh
brctl hotplugd mount.ntfs-3g sleep
busybox httpd msh smartd
cat ifconfig mv smbd
chmod inadyn ntfs-3g smbpasswd
chown init ntfsfix start_3g
chpasswd insmod ntpclient stop_3g
cp iptables nvram stupid-ftpd
csqd iptables-restore outhttpd switch
date iwconfig passwd sync
df iwpriv ping sysK
dial_3g kill poweroff telnetd
dnsmasq killall pppd touch
echo ln ps udhcpc
eject login pwd udhcpd
ethtool ls rc umount
fdisk lsmod reboot upgraded
fluxd lsusb reg upnpd
free mdev rm usb_modeswitch
ftpput mii_mgr rmmod vconfig
However, every command fails and only gives:
BoC Router> ls
Unknow command
BoC Router> help
? ->Display help information.
help ->Display help information, same as '?' command.
clear ->Clear various talbes, type clear for help.
ping ->ping HOST, type ping for help.
traceroute ->route trace, type traceroute for help.
ipmac ->ip mac bind settings.
quit ->Close terminal session.
show ->Display various talbes information, type show for help.
restart_httpd ->Restart web server.
restore_defaults ->Restore the config to the default factory value.
ated ->run ated for MP test.
BoC Router> show system revision
software version: 2.1.3.8
product model: Mifi-Storage-3G
serial number: ZJL2014XXXXX
hardware version: 1.0
f/w release date: Aug. 23, 2013 15:27:22
===
Mirror from http://www.digitalinferno.com/wiki/Wiki.jsp?page=Mini3G4GUSBRouterOpenWrtExternalUSB&skin=raw
as of Jan 9, 2015
!!! Mini 3G Router; install OpenWrt, use an external USB storage
\\
%%note
This device seems to be coming with a number of different firmwares.\\
Using telnet to access ''my'' stick(s), I got to a garbage "msh"
busybox shell, without root access, so I was unable to do
anything useful with the original firmware.\\
This page is about the one ''I'' got, obviously!\\
\\
''Another firmware variant'', with more relaxed telnet root access,
is described [here|http://my-embedded.blogspot.se/2014/01/mini-usb-portable-3g4g-router-rt5350f.html]\\
And, according to that bloke, with the firmware he's got,
you might brick the device if you flash a OpenWrt firmware nilly-willy,
as I've done on multiple occasions. Ignorance ''is'' bliss I guess :)\\
\\
%%
\\
\\
%%tabbedSection
%%tab-TheDevice
\\
The gizmo in all its gory details:\\
\\
[{Image src='package_small.jpg' align='left' style='' class=''
link='/wiki/attach/Mini3G4GUSBRouterOpenWrtExternalUSB/package.jpg' }]
[{Image src='mini_router_enclosing_small.png' align='left' style='' class=''
link='/wiki/attach/Mini3G4GUSBRouterOpenWrtExternalUSB/mini_router_enclosing.png' }]
\\
[{Image src='mini_router_front_small.png' align='left' style='' class=''
link='/wiki/attach/Mini3G4GUSBRouterOpenWrtExternalUSB/mini_router_front.png' }]
[{Image src='mini_router_back_small.png' align='left' style='' class=''
link='/wiki/attach/Mini3G4GUSBRouterOpenWrtExternalUSB/mini_router_back.png' }]
\\
!! Basics
These devices sell at aliexpress and ebay for about $8-$10.\\
They are described as {{"Mini 3G/4G Wireless USB WiFi Router 150Mbps"}}\\
and/or\\
{{"Mini 3G/4G Wireless USB MiFi Router 150Mbps"}}\\
give or take a few terms, and you should be able to locate them.\\
''(I dunno' if "mifi" is some brand name or term,
or just a spelling error (__w__ifi -> __m__ifi)
that has spread)''\\
Printing on the gizmo says "3G/4G Router", no other name,
and it's about the size of a large/old USB memory stick.\\
You can easily open it using your nails (or teeth, if you must).\\
The silk screen on the PCB has the version number "A5-V11" printed on it.\\
There is also a similar more "rounded" type, with some fancy
colour stripe running along the side, that I also __belive__ is
an RT5350 based stick, but it is more expensive.\\
''(Possibly, Hame A5 devices/clones.. in disguise)''\\
\\
! Specs
{{{
Brand: none (possibly made by "Bococom"?)
(let us call it "Gizmo" for now)
CPU: Ralink RT5350F
RAM: Winbond W9825G6EH-6J
(256Mbit = 32MB RAM)
EEPROM: Pm25LQ032 ...
(32Mbit = 4MB flash ROM)
Ethernet: Pulse H1102NL
1 standard USB (input) port
1 micro USB port (for power only!?)
1 RJ45 Ethernet port
1 reset pin-hole (nearest the micro USB)
1 pin-hole for led lightning effect
(don't try to "reset" anything through
this hole, or you may pry loose one or
more of the leds directly inside!)
}}}
The Ralink microprocessor [[MCU] is MIPS based and seems quite capable,
running at 360MHz.\\
''(If I remember correct, the MIPS architecture is ''also'' RISC
(Reduced Instruction Set), actually even more so, as MIPS uses
an even smaller instruction set than typical RISC processors)''\\
Blah-blah.. bottom line is; MIPS need to do several instructions to
accomplish the same as a processor with a more "feature rich"
instruction set... so don't let the speed alone dazzle you.\\
Nevertheless, this MCU should be pretty capable, but we ain't
talking 3D-anything here!\\
\\
The MCU support several different types of (slow) interfaces,
such as I2C, UART and JTAG.\\
The MCU pins are those nasty ball grid array (BGA) types
("underneath" the chip casing), and there are lots of 'em;
196 pins (or "balls") or thereabouts.\\
Solder-fiddling-on-wires is be pretty much impossible I would think,
so we are left with whatever pathways the manufacturer has
decided to route from the MCU to the board (PCB).\\
\\
The chip offers something like 20 GPIO pins (most shared
with other stuff), but I have no idea if all/some/any
of these are available to fiddle with.\\
! Content delivered
My device also came with a regular-to-micro USB cable
and a "Quick Installation Guide" paper.\\
''(The pictures in the Guide does not match the gizmo I received,
but then again, the Guide state the "images are just for reference".\\
Unfortunately, the images are used to point out several
buttons, lights and doo-dah, and my stick had none of
those, so all in all I guess the Guide itself is
also "for reference only". To what, I 'dunno..)''\\
\\
! RAM
The Winbond RAM thing on this one is 4M x 4 banks x 16 bits,
and if I got it right, that translates to 32MB!\\
''(4M = 4 * 1024 * 1024 = 4194304, and\\
4194304 * 4 (banks) * 16 (bits) = 268435456, and
268435456 / 1024 / 1024 = 256 Mega__bit__ = 32 Mega__byte__ (?))''\\
! User interfaces [[UI] (unmodified/original) and other stuffs
Default ip seems to be set to {{192.168.100.1}}\\
Despite what my device claimed on it's sticker,
the username/password for both telnet and the
web UI was simply: {{admin}}\\
The web UI starts off in chinese, but is easily changed to English
from an obvious dropdown, presenting you with an UI of
(more or) less coherent English.\\
You can also telnet to the device, but the severely
restricted default BusyBox "{{msh}}" prompt
is mostly just annoying, with no root access!\\
The status page in the web UI says:\\
{{{
CPU Type: MIPS 4kc 360MHZ Memory Size: 32MB
Serial Number: ZJL130512345 Software Version: 2.1.3.8
Run Time: 00:43:16 CPU Load: 3.0%
Memory Usage: 73% Session Used: 5%
}}}
Wohoo, 32MB!\\
\\
The telnet terminal says
{{{
BoC Router> show system revision
software version: 2.1.3.8
product model: Mifi-Storage-3G
serial number: ZJL130512345
hardware version: 1.0
f/w release date: Aug. 23, 2013 15:27:22
}}}
! Boot up
If booted (power on) when holding in the reset button,
the gizmo will grab some ip address in the
192.168.1.x range, and will look for a TFTP server at
ip address {{192.168.1.55}}, and an image named {{<some-numbers>.bin}}\\
I did not investigate this option any further.\\
\\
/%
%%tab-BuildAndInstallOpenwrtFirmware
!! OpenWrt
OpenWrt is a linux distribution aimed at embedded and
bare-bones devices. You may be able to throw together
your own linux soup, but this distro is probably
far less painful.\\
Recent OpenWrt distributions require more than 16MB RAM to run.\\
The rt5350 device has 32MB, so it should be sufficient.\\
\\
!! Getting/creating an OpenWrt firmware
You need a {{squashfs}} image (whatever that is).
! Feeling lucky?
If you have already compiled/built the darn thing as described
below OR you want to try the latest developer imagebuilder
snapshot from OpenWrt, now would be a good time.\\
Unzip the imagebuilder archive somewhere, go there, then
I suppose you need to do something like this:
{{{
make image PROFILE='A5-V11' \
PACKAGES='kmod-usb-storage kmod-usb-storage-extras \
kmod-fs-ext4 block-mount'
}}}
from a terminal.. wherever you unzipped the ImageBuilder thing\\
If successful this should/may create an openwrt "..sysupgrade.."
bin file somwhere in the maze of folders under where you
unzipped the ImageBuilder and did your dirty deed.\\
\\
! OpenWrt; Compile the firmware yerself
Support for this gizmo is not yet in any OpenWrt __release__ (Barrier Braker
being the latest as of this writing), but support is present in the
latest development source code, so you need to compile a snapshot
of the OpenWrt GNU linux firmware/binary yourself.\\
All of this happens on a proper pc (not on the device/gizmo, good heavens!)\\
You should use a pc with linux installed (or install VirtualBox and
install a linux distribution in that).\\
The compilation of all the bells and whizzles will take some resources,
so the more horsepower and ram you got, the better!\\
I built the thing on a Fedora 21 box, running on an i7-3770k and 8gb ram,
and it was pretty painfully slow (like, ~3 hours slow, give or take a few hours).\\
A SSD disk may help, and a ramdisk even more.\\
Just install whatever
you think you need onto the linux box. I got tired of guessing
and grabbed whatever I could think of, something like:
{{{
sudo yum -y install asciidoc bc binutils bzip2 libgcj flex \
git gcc-c++ gcc util-linux gawk gtk2-devel intltool jikes \
ziplib-devel ziplib-headers hg genisoimage \
ncurses-devel openssl-devel patch perl-ExtUtils-MakeMaker \
python-devel rsync sdcc unzip wget gettext libxslt zlib-devel \
zlib mc wget nano jed openssl zlib git git-core gitweb \
subversion cvs finger dos2unix patch diff tar gzip \
readline readline-devel libedit libedit-devel \
cifs-utils libstdc++ glibc curl-devel expat-devel \
gettext-devel openssl-devel zlib-devel patchutils \
perl-Proc-ProcessTable bison make autoconf automake \
compat-libstdc++-33 gcc-plugin-devel rpmdevtools \
yum-utils sed qt3-devel libXi-devel gettext getgentext \
libtool libgcc compat-gcc-34 compat-gcc-34-c++ \
relaxngcc kernel-modules-extra kernel-tools \
kernel-tools-libs kmod kmod-libs libtool-ltdl-devel \
libtool-ltdl libunistring libunistring-devel libffi \
libffi-devel
}}}
Yeah, probably forgotten a few, and added way too many..\\
\\
Open a terminal window (yes-yes, still on the big proper pc linux box) as
a regular user, and do:
{{{
mkdir ~/src
cd ~/src
git clone git://git.openwrt.org/openwrt.git
cd openwrt
./scripts/feeds update -a
./scripts/feeds install -a
}}}
In addition you really-really want to set your download
and binary directories to outside the openwrt folder structure,
to avoid having to do a lot of unneccessary stuff every
time you build again.\\
For example, add the following directories as well
{{{
mkdir -p ~/src/openwrt-data/download
mkdir -p ~/src/openwrt-data/binaries
}}}
Now, configure what you want to do
{{{
make menuconfig
}}}
In the menuconfig menu, I check/choose/make
sure the following is set
{{{
Target System (Ralink RT288x/RT3xxx)
Subtarget (RT3x5x/RT5350 based boards)
Target Profile (A5-V11)
Target Images --->
[*] squashfs
Global build settings --->
[*] Select all packages by default
[*] Advanced configuration options (for developers) --->
----------- REPLACE THE PATHS WITH YOUR OWN BELOW! ----------
(/home/media/src/openwrt-data/binaries) Binary folder
(/home/media/src/openwrt-data/download) Download folder
[*] Build the OpenWrt Image Builder
[*] Build the OpenWrt SDK
[*] Package the OpenWrt-based Toolchain
Base system --->
{*} block-mount........................... Block device mounting
Kernel modules --->
Filesystems --->
<*> kmod-fs-ext4..................................... EXT4 filesy
USB Support --->
-*- kmod-usb-storage..................................... USB Sto
<*> kmod-usb-storage-extras.................... Extra drivers for
}}}
Exit-save.\\
Since __I__ want to use an USB flash stick with some space on it,
I added {{usb storage}}, {{ext4}} and {{block-mount}} as
in-kernel modules (the {{<*>}} things).\\
If you choose to build "Imagebuilder", "Toolchain" and stuffs
(you probably should), you can use the ImageBuilder package later
to generate images with different contents.\\
You can use the compiler in the Toolchain to compile.., well,
I guess anything for the rt5350 gizmo, on the pc linux box.\\
%%note
2014-12-29:\\
The OpenWrt {{ntpdate/ntpd}} was broken in latest source from trunk,
so in the menuconfig I unchecked all {{Network -> Time Synchronization -> ntp}} stuffs,
except the {{ntp-client}}\\
Some things named {{baresip}} and {{freeswitch}}, both located under
{{Network -> Telephony}} refuses to build, and I could care less,
so I unchecked those useless things.\\
By the time you read this, these error may all have
been sorted out (and new ones probably introduced).\\
%%
Anyways, when you have configured what you want; save, exit and continue with
{{{
make defconfig
make V=s
}}}
If it starts and goes on for a minute or so, go grab a pepsi
and watch some TV 'cause this is going to take some bloody time!\\
\\
If everything succeeds (it probably won't, something is always missing,
or there is some patch that refuses to patch, or something, but hey,
that's life), you should have have a "...factory.." and "...sysupgrade.."
bin somewhere in the maze of folders.\\
The bin file(s) should be around 3.5-4MB in size.\\
%%note
If something fails, fix it (doh!) and run {{make V=s}} again.\\
{{make ..}} should/will skip the parts it have already done,
so if it has built for hours and just failed, you can always stare at
the screen until it fails again since it will get to the new stuffs
pretty quickly.. Then rinse, repeat until it all compiles ok..\\
Sometimes the build will fail nilly-willy due to some fatal
{{"Connection reset by peer"}} crap. If so, try running {{make V=s}} one more time\\
If it continues to blow up, either remove the bloody package
(in {{make menuconfig}}) OR __cheat__ by google'ing for the source
code bundle it fails to get (typically named something like {{<filename>.tar.bz2}}),
download the thing and copy it to the openwrt 'download' folder you configured
in the menuconfig step, harr-harr, make will be none the wiser...\\
%%
\\
All in all; spend a day or so, and you might get something built.
That's life on the bleeding edge!\\
\\
I don't really know why on earth you get two different images/firmware bins,
but I think if you have already installed some OpenWrt image/firmware,
you may need to use the "...sysupgrade.." binary, if not,
use the "...factory..." bin thing.\\
And by "use", I mean "install it"... on the rt5350 device, the gizmo.\\
\\
!! Upgrade/install appropriate OpenWrt image
Make sure you have created the image containing
packages: {{block-mount}}, {{kmod-usb-storage}},
{{kmod-fs-ext4}} (or whatever filesystem you want).\\
(__''If''__ you want to use an external USB stick that
is (''you __do!__''))\\
\\
! Got root?
If you already have OpenWrt installed, you may try
{{{
sysupgrade -v <path-and-name-to-sysupgrade-binary>.bin
}}}
from a terminal on the gizmo.\\
''I haven't tried this yet, so it may or may be totally wrong!''\\
! Original firmware still installed?
If you still have the original firmware installed, you are in luck;
just upgrade as usual using the web UI ({{Admin -> Firmware Upgrade}})
and pick the ..factory.. bin file you have created, and
the gizmo should do the rest.\\
If not... I suppose you must use a serial console (easiest), or
attempt to use just the network cable from the gizmo to your pc.\\
! Network cable only
__''This is pure guesswork, I haven't tested this!''__\\
In the case you do not want to embark on serial port
soldering/hacking and serial-to-USB magic,
you need a pc box running a tftp server\\
''(actually, you need a tftp server either which way you choose)''\\
On the pc box:
* set up your pc box to use (as in: ''claim'') ip 192.168.1.55
* (install and) start a tftp server on your pc box (fix the firewall and all that crap)
* copy your ..sysupgrade.. bin to wherever the tftp server serves its files from
* plug in a network cable from your gizmo to the pc box
Make sure all the above is ok.\\
Next, for the gizmo:
* hold the reset button pressed (use the correct "hole")
* then plug in the power (i.e: plug in USB cable) so gizmo gets its juice
(still holding the reset button, right?)
* release reset button when you feel you should... a couple of seconds may be enough
The gizmo will now spin in an endless loop trying
to get a filename-you-do-not-yet-know-what-is, from ip 192.168.1.55
(which is your pc box, right?)\\
Now comes the pain; you need to figure out what bloody name
the stupid gizmo bootloader wants (probably {{<some-sequence-of-digits>.bin}}).\\
I guess wireshark/tcpdump might crack it, or
most simple: the __tftp server log__.\\
Once you know the name of the file the gizmo want, rename
your ..sysupgrade.. bin file to that name,
and the gizmo should/may find the image,
and should/may be able to downloaded and install.\\
If nothing happens (nothing attempts to fetch anything
from your tftp server), you probably missed the bootloader
trying to read from 192.168.1.55 thing, so you may want to
unplug gizmo,press reset button ... doo-dah-doo-dah... all over again.\\
! Install using serial console (with ethernet/network cable)
This is way easier, since you __''see''__ what is going on!\\
First, you need to solder/attach 2 wires
to the serial connector of the gizmo,
see [this|Mini3G4GUSBRouterSerialConnect].\\
Hook up your serial-to-USB thing to the gizmo
({{tx to rx}}, and {{rx to tx}}).\\
Plug the serial-to-USB thing into your PC\\
Start the serial console (for instance, Putty),
on whatever COM port or {{/dev/tty-weirdness}},
using 57600 baud, 8 data bits, 1 stop bit,
0/no parity and no flow control.\\
(Install and) start a tftp server on the PC containing the OpenWrt
...sysupgrade... binary image, and make sure the binary
is accessible on the tftp server (i.e: open firewalls and shit).\\
''(You can rename the ..sysupgrade.. binary file to something
short, like {{s.bin}}.. if you are really lazy)''\\
Connect the gizmo to the PC with an ethernet cable.\\
Power up the gizmo by plugging in the micro USB to USB cable.\\
On gizmo bootup, in the serial console window a menu appears.
Quickly press '2' to halt any further booting of old linux,
and to pick the ''"Load system code then write to Flash via TFTP"''
option (yeah, that is.. 2.. in the menu..).\\
Now, just follow/enter the info that is requested:\\
-answer 'y', you are not crazy\\
-set gizmos ip to some unused ip on the same subnet as your PC\\
''(I.e: if you have an IP of, say, 192.168.100.101, the gizmo
ip may be something like 192.168.100.199. The last number
is what makes the gizmo ip unique)''\\
-add the ip address of your pc box (for instance, 192.168.100.101).\\
-enter the name of the sysupgrade binary file you wish to flash,
i.e.: the binary file that is served by the tftp server,
that you may or may not have renamed to something simple, like {{s.bin}}\\
\\
Ready, set, go!\\
Look for suspicious errors early on, like "unable to blahblah, need to reboot"\\
If the gizmo serial output seems to spin without finding the
tftp server and/or binary file, and you know you have set the
correct ip addresses, a firewall is the usual suspect.\\
Oh, and if you use the horror that is 'selinux', you are on your own!\\
\\
!! Upgrade existing OpenWrt install
I have now tried the {{sysupgrade -v <sysupgrade...bin>}} method (using the
...sysupgrade.. bin image from the attachments on the top of this page)
and it worked!... amazingly well in fact!\\
One added benefit of using this way of upgrading (rather than just reflashing
the unconfigured firmware)
was that this method also preserved (at least most of) your
existing configurations (if you had changed anything... if not, this would
be a moot benefit I guess).\\
%%note
__Note__ that after upgrade and boot, you are running on the __gizmo flash__,
so __if you have been using an external USB device__, you need to
redo some of the steps explained in the next "tab"/chapter.\\
Most of this is also explained in the next tab,
about using USB storage, but to preemp that,
here is the jist of it:
{{{
mkdir /mnt/usb
mount /dev/sda1 /mnt/usb
mv /mnt/usb/etc /mnt/usb/etc.old
mv /mnt/usb/mnt /mnt/usb/mnt.old
tar -C /overlay -cvf - . | tar -C /mnt/usb -xf -
}}}
Finally, update the {{/etc/config/fstab}} (on the gizmo, remember?),
so the overlay will run off the USB.\\
Content of the {{/dev/sda1}} entry in the {{fstab}} file
(if it exist, if not add it) should be exactly
{{{
config 'mount'
option target /overlay
option device /dev/sda1
option fstype ext4
option options rw,sync
option enabled 1
option enabled_fsck 0
}}}
Save the updated {{fstab}}, and reboot.\\
You should now be running off the USB... again!\\
%%
/%
%%tab-UsingExternalUSBStorage
!! Sticking it to the USB
Make sure you have installed an image containing
packages: {{block-mount}}, {{kmod-usb-storage}},
{{kmod-fs-ext4}} (or whatever filesystem you want).\\
If not, now is the time to install them ({{opkg install <package>}})\\
! Important
Configure basic passwords and security now.\\
If not, and your USB flash stick fail, the system contained
on the flash of the gizmo will load, possibly leaving it
very vulnerable, with default/no passwords and whatnot.\\
You are probably better off keeping your wireless OFF (disabled),
until after you have switched to using the USB flash stick for storage.\\
! Prepare USB flash stick
''(Or any old USB hard-drive storage I guess, should make no difference)''\\
Format the USB storage as {{ext4}} (I did this on a "proper" linux box)\\
\\
%%note
\\
I have learned later that it probably is a good idea to create not only one big
partition, but __three__ partitions on the USB storage;\\
-one big ext4 for all the files and stuff in root ({{/}}), as before\\
-in addition, also create a small ext4 for a future {{/tmp}} folder\\
-finally, the really useful one, a small partition for {{swap}}\\
This is easily done on a full linux distro pc, using {{gparted}}\\
''(For sanity reasons, you might want to create the partitions
in the order above, then they will become {{/dev/sda1}},
{{/dev/sda2}} and {{/dev/sda3}}.\\
I wasn't thinking, so I got the last two flipped)''\\
A size of, say, 64MB may be sane for the two smaller ({{/tmp}} and {{swap}})
partitions (and the remainder to the root ({{/}}) partition of course).\\
\\
%%
\\
! Test USB
Insert your USB flash stick into the gizmo and make sure you
can mount it and write to it ok.\\
Unless you have done horrible things, the USB flash partition
should be {{/dev/sda1}}
{{{
mkdir /mnt/usb
mount -t ext4 /dev/sda1 /mnt/usb
cp /etc/config/network /mnt/usb/
cat /mnt/usb/network
rm -Rf /mnt/usb/*
}}}
\\
! Prepare USB flash stick to take over
Copy the {{overlay}} folder from the gizmo flash to the USB flash stick
{{{
tar -C /overlay -cvf - . | tar -C /mnt/usb -xf -
}}}
On the __original__ (gizmo) filesystem create/update {{/etc/config/fstab}}
with the following
{{{
config mount
option target /overlay
option device /dev/sda1
option fstype ext4
option options rw,sync
option enabled 1
option enabled_fsck 0
}}}
''(the {{block-mount}} package may have created its own
version of mounts in the {{/etc/config/fstab}},
if so, and the {{/dev/sda1}} is already present,
update/change it to match the above)''\\
\\
\\
Reboot, pray.\\
The gizmo should now use the USB stick as its file system.\\
Using my good old 1Gig USB flash stick I get
\\
{{{
root@rt5350:/# df -h
Filesystem Size Used Available Use% Mounted on
rootfs 970.4M 1.4M 902.9M 0% /
/dev/root 2.5M 2.5M 0 100% /rom
tmpfs 14.3M 60.0K 14.3M 0% /tmp
/dev/sda1 970.4M 1.4M 902.9M 0% /overlay
overlayfs:/overlay 970.4M 1.4M 902.9M 0% /
tmpfs 512.0K 0 512.0K 0% /dev
}}}
Yeah baby, power!\\
\\
%%note
If you have been a smartypants, you have also created a {{swap}}
partition on the USB storage.
If so, after reboot (using the USB storage), you can add
a swap option to {{/etc/config/fstab}}\\
The swap partition I created (with {{gparted}} on a full blown linux pc),
ended up as {{/dev/sda2}}, so this is what I added
{{{
config 'swap'
option device '/dev/sda2'
option enabled '1'
}}}
\\
I also had the bright idea of trying to replace the
annoying "tmpfs" {{/tmp}} RAM partition thing with a real,
physical disk partition,
but I'm not sure how to actually disable this tmpfs-RAM-stealing bastard
or what the hell is going on with it, so I probably need to
revisit this point if RAM shortage becomes a major pain.\\
Anyways, this is my additional
{{/etc/config/fstab}}
entry (the partition for some reason
ended up as {{/dev/sda3}}, because I created the swap
partition before the {{/tmp}} partition)\\
{{{
config 'mount'
option 'target' '/tmp'
option 'device' '/dev/sda3'
option 'fstype' 'ext4'
option 'enabled_fsck' '0'
option 'enabled' '1'
}}}
\\
Oh, well...\\
\\
%%
/%
%%tab-FinalTweaks
! OpenWrt GNU Linux, oh well...
OpenWrt is about as user friendly as any other GNU linux distribution (i.e: it ain't!)\\
You'll probably need to add {{--force-depends}} to a few {{opkg install}}
attempts, like so: {{ opkg --force-depends install <whatever>}},
and it may still not succeed.\\
\\
If you built the OpenWrt thing from scratch, you may want to
change the repository address ({{/etc/opkg.conf}})
to point at a local server, where you can put any and all
packages you have built.\\
Since apache is black magic, and I was unable to traverse a bloody symlink,
I copied the entire packages structure to my local linux pc box to {{/var/www/html/openwrt/}}\\
My {{opkg.conf}} file looks like so
{{{
dest root /
dest ram /tmp
lists_dir ext /var/opkg-lists
option overlay_root /overlay
src/gz chaos_calmer_base http://192.168.1.77/openwrt/packages/base
src/gz chaos_calmer_telephony http://192.168.1.77/openwrt/packages/telephony
src/gz chaos_calmer_packages http://192.168.1.77/openwrt/packages/packages
src/gz chaos_calmer_routing http://192.168.1.77/openwrt/packages/routing
src/gz chaos_calmer_luci http://192.168.1.77/openwrt/packages/luci
src/gz chaos_calmer_management http://192.168.1.77/openwrt/packages/management
#src/gz chaos_calmer_base http://downloads.openwrt.org/snapshots/trunk/ramips/packages/base
#src/gz chaos_calmer_telephony http://downloads.openwrt.org/snapshots/trunk/ramips/packages/telephony
#src/gz chaos_calmer_packages http://downloads.openwrt.org/snapshots/trunk/ramips/packages/packages
#src/gz chaos_calmer_routing http://downloads.openwrt.org/snapshots/trunk/ramips/packages/routing
#src/gz chaos_calmer_luci http://downloads.openwrt.org/snapshots/trunk/ramips/packages/luci
#src/gz chaos_calmer_management http://downloads.openwrt.org/snapshots/trunk/ramips/packages/management
}}}
''(The lines starting with # are commented out)''\\
! luci, the reluctant OpenWrt web UI
Installing and then starting/entering luci (the web UI of OpenWrt), I get no love
{{{
[ 148.060000] WARNING: CPU: 0 PID: 0 at net/sched/sch_generic.c:264 dev_watchdog+0x1e8/0x26c()
[ 148.080000] NETDEV WATCHDOG: eth0 (ralink_soc_eth): transmit queue 0 timed out
[ 148.090000] Modules linked in: rt2800soc rt2800mmio rt2800lib pppoe ppp_async
iptable_nat rt2x00soc rt2x00mmio rt2x00lib pppox ppp_generic nf_nat_ipv4
nf_conntrack_ipv6 nf_conntrack_ipv4 mac80211 ipt_MASQUERADE cfg80211 xt_time
xt_tcpudp xt_state xt_nat xt_multiport xt_mark xt_mac xt_limit xt_id xt_conntrack
xt_comment xt_TCPMSS xt_REDIRECT xt_LOG xt_CT ums_usbat ums_sddr55 ums_sddr09
ums_karma ums_jumpshot ums_isd200 ums_freecom ums_datafab ums_cypress
ums_alauda slhc nf_nat_irc nf_nat_ftp nf_nat nf_defrag_ipv6 nf_defrag_ipv4
nf_conntrack_rtcache nf_conntrack_irc nf_conntrack_ftp nf_conntrack iptable_raw
iptable_mangle iptable_filter ipt_REJECT ip_tables crc_itu_t crc_ccitt compat
ip6t_REJECT ip6table_raw ip6table_mangle ip6table_filter ip6_tables x_tables
ipv6 eeprom_93cx6 arc4 crypto_blkcipher usb_storage leds_gpio ohci_platform
ohci_hcd ehci_platform ehci_hcd sd_mod scsi_mod gpio_button_hotplug
ext4 crc16 jbd2 mbcache usbcore nls_base usb_common crypto_hash
[ 148.260000] CPU: 0 PID: 0 Comm: swapper Not tainted 3.14.26 #1
[ 148.280000] Stack : 00000006 00000000 00000000 00000000 00000000 00000000 8034b9ce 00000032
[ 148.280000] 802e6af0 000000a5 802a32e4 802e6f17 00000000 803439c0 802e6af0 000000a5
[ 148.280000] 8034b348 00000001 00000004 802407c4 00000003 801a5c88 00000108 000000a5
[ 148.280000] 802a6488 802dbc74 00000000 00000000 00000000 00000000 00000000 00000000
[ 148.280000] 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 148.280000] ...
[ 148.340000] Call Trace:
[ 148.350000] [<801e464c>] show_stack+0x48/0x70
[ 148.360000] [<8025202c>] warn_slowpath_common+0x84/0xb4
[ 148.370000] [<80252088>] warn_slowpath_fmt+0x2c/0x38
[ 148.380000] [<800b559c>] dev_watchdog+0x1e8/0x26c
[ 148.390000] [<800902c8>] call_timer_fn.isra.38+0x24/0x84
[ 148.400000] [<801ccf94>] run_timer_softirq+0x17c/0x1bc
[ 148.410000] [<80036378>] __do_softirq+0xf8/0x228
[ 148.420000] [<8012e1e8>] irq_exit+0x54/0x70
[ 148.430000] [<80004430>] ret_from_irq+0x0/0x4
[ 148.430000] [<80004680>] __r4k_wait+0x20/0x40
[ 148.450000] [<800a4884>] cpu_startup_entry+0xa4/0x104
[ 148.450000] [<802f8954>] start_kernel+0x3d0/0x3e8
[ 148.470000]
[ 148.470000] ---[ end trace 945db4ff995e1f7e ]---
[ 148.470000] ralink_soc_eth 10100000.ethernet eth0: transmit timed out, waking up the queue
[ 148.500000] ralink_soc_eth 10100000.ethernet eth0: : dma_cfg:00000057, free_idx:108,
dma_ctx_idx=114, dma_crx_idx=76
[ 151.040000] ralink_soc_eth 10100000.ethernet eth0: transmit timed out, waking up the queue
[ 151.060000] ralink_soc_eth 10100000.ethernet eth0: : dma_cfg:00000057, free_idx:108,
dma_ctx_idx=114, dma_crx_idx=83
[ 153.190000] ralink_soc_eth 10100000.ethernet eth0: transmit timed out, waking up the queue
[ 153.190000] ralink_soc_eth 10100000.ethernet eth0: : dma_cfg:00000057, free_idx:108,
dma_ctx_idx=114, dma_crx_idx=85
[ 155.040000] ralink_soc_eth 10100000.ethernet eth0: transmit timed out, waking up the queue
[ 155.040000] ralink_soc_eth 10100000.ethernet eth0: : dma_cfg:00000057, free_idx:108,
dma_ctx_idx=114, dma_crx_idx=86
[ 157.120000] ralink_soc_eth 10100000.ethernet eth0: transmit timed out, waking up the queue
[ 157.120000] ralink_soc_eth 10100000.ethernet eth0: : dma_cfg:00000057, free_idx:108,
dma_ctx_idx=114, dma_crx_idx=88
[ 159.040000] ralink_soc_eth 10100000.ethernet eth0: transmit timed out, waking up the queue
[ 159.060000] ralink_soc_eth 10100000.ethernet eth0: : dma_cfg:00000057, free_idx:108,
dma_ctx_idx=114, dma_crx_idx=89
[ 161.040000] ralink_soc_eth 10100000.ethernet eth0: transmit timed out, waking up the queue
...
}}}
\\
Hrmph... __always__ there is some bullocks!\\
\\
It seems I need to allow the gizmo plenty of time to settle down
(without accessing the web UI) for luci to work.\\
! Final tuning
Now you probably have plenty of space, but still measly amounts of ram!\\
Expect lousy memory handling, small amounts of available ram,
and frequent faults when trying to run/build/install semi-large programs.\\
I assume the {{swap}} partition will help greatly.\\
You may want to try tell tmpfs to leave your ram the hell alone alltogether,
but unfortunately, this seems impossible. But you can at least
try have tmpfs give
up precious RAM by swapping, by setting the {{swappiness}} property
{{{
sysctl -w vm.swappiness=30
}}}
''(I'm not sure what value to use, too big and everything may become
painfully slow, too small and you may get faults due to out of memory..)''\\
The number is a percentage from 0 to 100.
The higher the number, the more the system will try to
dump memory stuffs to disk (i.e.: it will swap/write contents to
disk instead of using memory).\\
The number goes from 0 (do not swap to disk) to 100 (use disk only)\\
\\
Yay, whatever, good luck!\\
\\
/%
%%tab-Files
!! OpenWrt RT5350 A5-V11 files
! May or may not burn down your house
[factory binary|https://dl.dropboxusercontent.com/u/98389203/openwrt-ramips-rt305x-a5-v11-squashfs-factory.bin]\\
[sysupgrade bnary|https://dl.dropboxusercontent.com/u/98389203/openwrt-ramips-rt305x-a5-v11-squashfs-sysupgrade.bin]\\
\\
[OpenWRT packages|https://dl.dropboxusercontent.com/u/98389203/openwrt-packages-a5-v11_20141229.tar]\\
[OpenWRT toolchain|https://dl.dropboxusercontent.com/u/98389203/OpenWrt-Toolchain-ramips-for-mipsel_24kec%2Bdsp-gcc-4.8-linaro_uClibc-0.9.33.2.tar.bz2]\\
[OpenWRT SDK|https://dl.dropboxusercontent.com/u/98389203/OpenWrt-SDK-ramips-for-redhat-x86_64-gcc-4.8-linaro_uClibc-0.9.33.2.tar.bz2]\\
\\
I have tried to build (cross compile) GNU 'make' and some other
GNU stuffs I was unable to locate in the OpenWrt packages.\\
I have no idea how to create the OpenWrt {{ipk}} package thingies.\\
I spent ~2 minutes reading the OpenWrt packaging documentation before
I ran away, screaming, so these are plain binaries/script files
that may or may not work.\\
If you dare, unzip into {{/usr/bin}},
or somewhere else in your path..\\
\\
GNU [make|https://dl.dropboxusercontent.com/u/98389203/make.zip]\\
GNU [bison|https://dl.dropboxusercontent.com/u/98389203/bison.zip]\\
GNU [m4|https://dl.dropboxusercontent.com/u/98389203/m4.zip]\\
GNU [sed|https://dl.dropboxusercontent.com/u/98389203/sed.zip]\\
GNU [tar|https://dl.dropboxusercontent.com/u/98389203/tar.zip]\\
\\
GNU [automake and autoconf|https://dl.dropboxusercontent.com/u/98389203/auto_make_and_conf.zip]... perhaps...\\
Copy the zip to {{/usr/local}} and extract the zip there.
Expect potentially spectacular explosions if/when used.\\
\\
I have tried, but been unable to build {{xz}}, {{autogen}} and {{buildtools}}
since I have no idea what they are and what I'm doing,
and I've gotten more than fed up with all this
black-magic-mumbo-jumbo for now.\\
\\
/%
%%tab-SerialConsoleDumps
! OpenWrt firmware upgrade
The bare bones firmware upgrade done from the
web UI looked like this in the serial console.. not very sexy at all!
{{{
...
save crc = 158b
.................................................................................
.................................................................................
.................................................................................
...
.................................................................................
.................................................................................
.................................................................................
............................................................................done
Wirte Firmware
Upgrade successfully, system will be reboot...
}}}
1st OpenWrt boot output, serial terminal
{{{
U-Boot 1.1.3 (Jan 9 2014 - 17:10:03)
Board: Ralink APSoC DRAM: 32 MB
relocate_code Pointer at: 81fb4000
******************************
Software System Reset Occurred
******************************
spi_wait_nsec: 42
spi device id: 7f 9d 46 7f 9d (9d467f9d)
Warning: un-recognized chip ID, please update bootloader!
raspi_read: from:30000 len:1000
.raspi_read: from:30000 len:1000
.============================================
Ralink UBoot Version: 3.6.0.0
--------------------------------------------
ASIC 5350_MP (Port5<->None)
DRAM_CONF_FROM: Boot-Strapping
DRAM_TYPE: SDRAM
DRAM_SIZE: 256 Mbits
DRAM_WIDTH: 16 bits
DRAM_TOTAL_WIDTH: 16 bits
TOTAL_MEMORY_SIZE: 32 MBytes
Flash component: SPI Flash
Date:Jan 9 2014 Time:17:10:03
============================================
icache: sets:256, ways:4, linesz:32 ,total:32768
dcache: sets:128, ways:4, linesz:32 ,total:16384
##### The CPU freq = 360 MHZ ####
estimate memory size =32 Mbytes
Please choose the operation:
1: Load system code to SDRAM via TFTP.
2: Load system code then write to Flash via TFTP.
3: Boot system code via Flash (default).
4: Entr boot command line interface.
7: Load Boot Loader code then write to Flash via Serial.
9: Load Boot Loader code then write to Flash via TFTP. 0
3: System Boot system code via Flash.
## Booting image at bc050000 ...
raspi_read: from:50000 len:40
. Image Name: MIPS OpenWrt Linux-3.14.26
Created: 2014-12-12 15:59:52 UTC
Image Type: MIPS Linux Kernel Image (lzma compressed)
Data Size: 1053608 Bytes = 1 MB
Load Address: 80000000
Entry Point: 80000000
raspi_read: from:50040 len:1013a8
................. Verifying Checksum ... OK
Uncompressing Kernel Image ... OK
No initrd
## Transferring control to Linux (at address 80000000) ...
## Giving linux memsize in MB, 32
Starting kernel ...
[ 0.000000] Linux version 3.14.26 (geirru@urd) (gcc version 4.8.3
(OpenWrt/Linaro GCC 4.8-2014.04 r43641) ) #1 Fri Dec 12 16:58:31 CET 2014
[ 0.000000] SoC Type: Ralink RT5350 id:1 rev:3
[ 0.000000] bootconsole [early0] enabled
[ 0.000000] CPU0 revision is: 0001964c (MIPS 24KEc)
[ 0.000000] MIPS: machine is A5-V11
[ 0.000000] Determined physical RAM map:
[ 0.000000] memory: 02000000 @ 00000000 (usable)
[ 0.000000] Initrd not found or empty - disabling initrd
[ 0.000000] Zone ranges:
[ 0.000000] Normal [mem 0x00000000-0x01ffffff]
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x00000000-0x01ffffff]
[ 0.000000] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
[ 0.000000] Primary data cache 16kB, 4-way, VIPT, no aliases, linesize 32 bytes
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 8128
[ 0.000000] Kernel command line: console=ttyS0,57600 rootfstype=squashfs,jffs2
[ 0.000000] PID hash table entries: 128 (order: -3, 512 bytes)
[ 0.000000] Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.000000] Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.000000] Writing ErrCtl register=00000001
[ 0.000000] Readback ErrCtl register=00000001
[ 0.000000] Memory: 29216K/32768K available (2293K kernel code, 118K rwdata,
456K rodata, 132K init, 180K bss, 3552K reserved)
[ 0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] NR_IRQS:256
[ 0.000000] CPU Clock: 360MHz
[ 0.000000] systick: running - mult: 214748, shift: 32
[ 0.000000] genirq: Flags mismatch irq 7. 00014600 (timer) vs. 00014600 (systick)
[ 0.010000] Calibrating delay loop... 479.23 BogoMIPS (lpj=2396160)
[ 0.070000] pid_max: default: 32768 minimum: 301
[ 0.070000] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.080000] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.090000] pinctrl core: initialized pinctrl subsystem
[ 0.090000] NET: Registered protocol family 16
[ 0.120000] bio: create slab <bio-0> at 0
[ 0.120000] rt2880_gpio 10000600.gpio: registering 22 gpios
[ 0.130000] rt2880_gpio 10000600.gpio: registering 22 irq handlers
[ 0.130000] rt2880_gpio 10000660.gpio: registering 6 gpios
[ 0.140000] rt2880_gpio 10000660.gpio: registering 6 irq handlers
[ 0.150000] Switched to clocksource systick
[ 0.150000] NET: Registered protocol family 2
[ 0.170000] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.190000] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.190000] TCP: Hash tables configured (established 1024 bind 1024)
[ 0.210000] TCP: reno registered
[ 0.220000] UDP hash table entries: 256 (order: 0, 4096 bytes)
[ 0.220000] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[ 0.240000] NET: Registered protocol family 1
[ 0.250000] rt-timer 10000100.timer: maximum frequency is 7324Hz
[ 0.270000] futex hash table entries: 256 (order: -1, 3072 bytes)
[ 0.330000] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[ 0.330000] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY)
(c) 2001-2006 Red Hat, Inc.
[ 0.360000] msgmni has been set to 57
[ 0.360000] io scheduler noop registered
[ 0.380000] io scheduler deadline registered (default)
[ 0.380000] gpio-export gpio_export.6: 2 gpio(s) exported
[ 0.400000] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[ 0.420000] 10000c00.uartlite: ttyS0 at MMIO 0x10000c00 (irq = 20, base_baud =
2500000) is a 16550A
[ 0.440000] console [ttyS0] enabled
[ 0.440000] console [ttyS0] enabled
[ 0.450000] bootconsole [early0] disabled
[ 0.450000] bootconsole [early0] disabled
[ 0.470000] m25p80 spi32766.0: pm25lq032 (4096 Kbytes)
[ 0.490000] 4 ofpart partitions found on MTD device spi32766.0
[ 0.500000] Creating 4 MTD partitions on "spi32766.0":
[ 0.510000] 0x000000000000-0x000000030000 : "u-boot"
[ 0.520000] 0x000000030000-0x000000040000 : "u-boot-env"
[ 0.540000] 0x000000040000-0x000000050000 : "factory"
[ 0.550000] 0x000000050000-0x000000400000 : "firmware"
[ 0.570000] 0x0000001513e8-0x000000400000 : "rootfs"
[ 0.570000] mtd: partition "rootfs" must either start or end on erase block boundary
or be smaller than an erase block -- forcing read-only
[ 0.610000] mtd: device 4 (rootfs) set to be root filesystem
[ 0.610000] 1 squashfs-split partitions found on MTD device rootfs
[ 0.630000] 0x0000003b0000-0x000000400000 : "rootfs_data"
[ 0.650000] ralink_soc_eth 10100000.ethernet eth0: ralink at 0xb0100000, irq 5
[ 0.670000] rt3xxx-usbphy usbphy.3: loaded
[ 0.680000] rt2880_wdt 10000120.watchdog: Initialized
[ 0.690000] TCP: cubic registered
[ 0.700000] NET: Registered protocol family 17
[ 0.710000] 8021q: 802.1Q VLAN Support v1.8
[ 0.740000] VFS: Mounted root (squashfs filesystem) readonly on device 31:4.
[ 0.760000] Freeing unused kernel memory: 132K (802cf000 - 802f0000)
procd: Console is alive
procd: - watchdog -
[ 6.950000] usbcore: registered new interface driver usbfs
[ 6.970000] usbcore: registered new interface driver hub
[ 6.980000] usbcore: registered new device driver usb
[ 7.020000] SCSI subsystem initialized
[ 7.040000] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 7.040000] ehci-platform: EHCI generic platform driver
[ 7.370000] rt3xxx-usbphy usbphy.3: remote usb device wakeup disabled
[ 7.370000] rt3xxx-usbphy usbphy.3: UTMI 16bit 30MHz
[ 7.370000] ehci-platform 101c0000.ehci: EHCI Host Controller
[ 7.370000] ehci-platform 101c0000.ehci: new USB bus registered, assigned bus number 1
[ 7.370000] ehci-platform 101c0000.ehci: irq 26, io mem 0x101c0000
[ 7.690000] ehci-platform 101c0000.ehci: USB 2.0 started, EHCI 1.00
[ 7.710000] hub 1-0:1.0: USB hub found
[ 7.710000] hub 1-0:1.0: 1 port detected
[ 7.730000] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[ 7.740000] ohci-platform: OHCI generic platform driver
[ 7.760000] ohci-platform 101c1000.ohci: Generic Platform OHCI controller
[ 7.760000] ohci-platform 101c1000.ohci: new USB bus registered, assigned bus number 2
[ 7.790000] ohci-platform 101c1000.ohci: irq 26, io mem 0x101c1000
[ 7.850000] hub 2-0:1.0: USB hub found
[ 7.850000] hub 2-0:1.0: 1 port detected
[ 7.880000] usbcore: registered new interface driver usb-storage
procd: - preinit -
[ 9.990000] rt305x-esw 10110000.esw: link changed 0x00
[ 10.400000] random: mktemp urandom read with 75 bits of entropy available
Press the [f] key and hit [enter] to enter failsafe mode
Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level
[ 12.130000] rt305x-esw 10110000.esw: link changed 0x01
jffs2 is not ready - marker found
procd: - early -
procd: - watchdog -
procd: - ubus -
Command failed: Not found
procd: - init -
Please press Enter to activate this console.
[ 17.420000] NET: Registered protocol family 10
[ 17.440000] Loading modules backported from Linux version master-2014-11-04-0-gf3660a2
[ 17.460000] Backport generated by backports.git backports-20141023-2-g4ff890b
[ 17.480000] nf_conntrack version 0.5.0 (458 buckets, 1832 max)
[ 17.550000] xt_time: kernel timezone is -0000
[ 17.610000] ip_tables: (C) 2000-2006 Netfilter Core Team
[ 17.620000] cfg80211: Calling CRDA to update world regulatory domain
[ 17.660000] cfg80211: World regulatory domain updated:
[ 17.660000] cfg80211: DFS Master region: unset
[ 17.680000] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)
[ 17.700000] cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
[ 17.700000] cfg80211: (2457000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
[ 17.730000] cfg80211: (2474000 KHz - 2494000 KHz @ 20000 KHz), (N/A, 2000 mBm), (N/A)
[ 17.740000] cfg80211: (5170000 KHz - 5250000 KHz @ 80000 KHz), (N/A, 2000 mBm), (N/A)
[ 17.760000] cfg80211: (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (0 s)
[ 17.780000] cfg80211: (5490000 KHz - 5730000 KHz @ 160000 KHz), (N/A, 2000 mBm), (0 s)
[ 17.790000] cfg80211: (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 2000 mBm), (N/A)
[ 17.810000] cfg80211: (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 0 mBm), (N/A)
[ 17.860000] ieee80211 phy0: rt2x00_set_rt: Info - RT chipset 5350, rev 0500 detected
[ 17.860000] ieee80211 phy0: rt2x00_set_rf: Info - RF chipset 5350 detected
[ 23.980000] rt305x-esw 10110000.esw: link changed 0x00
[ 25.720000] rt305x-esw 10110000.esw: link changed 0x01
[ 27.780000] random: nonblocking pool is initialized
[ 30.020000] jffs2_scan_eraseblock(): End of filesystem marker found at 0x0
[ 30.080000] jffs2_build_filesystem(): unlocking the mtd device... done.
[ 30.100000] jffs2_build_filesystem(): erasing all blocks after the end marker...
[ 30.660000] device eth0.1 entered promiscuous mode
[ 30.660000] device eth0 entered promiscuous mode
[ 30.710000] br-lan: port 1(eth0.1) entered forwarding state
[ 30.710000] br-lan: port 1(eth0.1) entered forwarding state
[ 32.710000] br-lan: port 1(eth0.1) entered forwarding state
[ 34.220000] done.
[ 34.230000] jffs2: notice: (836) jffs2_build_xattr_subsystem: complete building
xattr subsystem, 0 of xdatum (0 unchecked, 0 orphan) and 0 of xref (0 dead, 0 orphan) found.
procd: - init complete -
BusyBox v1.22.1 (2014-12-12 16:44:54 CET) 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
-----------------------------------------------------
CHAOS CALMER (Bleeding Edge, r43641)
-----------------------------------------------------
* 1 1/2 oz Gin Shake with a glassful
* 1/4 oz Triple Sec of broken ice and pour
* 3/4 oz Lime Juice unstrained into a goblet.
* 1 1/2 oz Orange Juice
* 1 tsp. Grenadine Syrup
-----------------------------------------------------
root@OpenWrt:/#
}}}
/%
/%
----
References:\\
[http://wiki.openwrt.org]\\
\\
After having flashed OpenWrt, the boot process on the serial console looks like this:
U-Boot 1.1.7 (Dec 13 2011 - 13:49:42)
Board: Ralink APSoC DRAM: 32 MB
relocate_code Pointer at: 81fb4000
spi_wait_nsec: 42
spi device id: 7f 9d 46 7f 9d (9d467f9d)
Warning: un-recognized chip ID, please update bootloader!
raspi_read: from:30000 len:1000
.*** Warning - bad CRC, using default environment
============================================
Ralink UBoot Version: 3.6.0.0
--------------------------------------------
ASIC 5350_MP (Port5<->None)
DRAM_CONF_FROM: Boot-Strapping
DRAM_TYPE: SDRAM
DRAM_SIZE: 256 Mbits
DRAM_WIDTH: 16 bits
DRAM_TOTAL_WIDTH: 16 bits
TOTAL_MEMORY_SIZE: 32 MBytes
Flash component: SPI Flash
Date:Dec 13 2011 Time:13:49:42
============================================
icache: sets:256, ways:4, linesz:32 ,total:32768
dcache: sets:128, ways:4, linesz:32 ,total:16384
##### The CPU freq = 360 MHZ ####
estimate memory size =32 Mbytes
raspi_read: from:40028 len:6
.
raspi_read: from:0 len:30004
....*************Is_update = 0 plat = 1**************
Please choose the operation:
1: Load system code to SDRAM via TFTP.
2: Load system code then write to Flash via TFTP.
3: Boot system code via Flash (default).
4: Entr boot command line interface.
7: Load Boot Loader code then write to Flash via Serial.
9: Load Boot Loader code then write to Flash via TFTP.
 1  0
3: System Boot system code via Flash.
## Booting image at bc050000 ...
raspi_read: from:50000 len:40
. Image Name: MIPS OpenWrt Linux-3.14.27
Created: 2015-01-10 14:26:49 UTC
Image Type: MIPS Linux Kernel Image (lzma compressed)
Data Size: 1110484 Bytes = 1.1 MB
Load Address: 80000000
Entry Point: 80000000
raspi_read: from:50040 len:10f1d4
................. Verifying Checksum ... OK
Uncompressing Kernel Image ... OK
No initrd
## Transferring control to Linux (at address 80000000) ...
## Giving linux memsize in MB, 32
Starting kernel ...
[ 0.000000] Linux version 3.14.27 (openwrt@gb-10) (gcc version 4.8.3 (OpenWrt/Linaro GCC 4.8-2014.04 r43888) ) #1 Fri Jan 9 12:40:17 UTC 2015
[ 0.000000] SoC Type: Ralink RT5350 id:1 rev:3
[ 0.000000] bootconsole [early0] enabled
[ 0.000000] CPU0 revision is: 0001964c (MIPS 24KEc)
[ 0.000000] MIPS: machine is A5-V11
[ 0.000000] Determined physical RAM map:
[ 0.000000] memory: 02000000 @ 00000000 (usable)
[ 0.000000] Initrd not found or empty - disabling initrd
[ 0.000000] Zone ranges:
[ 0.000000] Normal [mem 0x00000000-0x01ffffff]
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x00000000-0x01ffffff]
[ 0.000000] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
[ 0.000000] Primary data cache 16kB, 4-way, VIPT, no aliases, linesize 32 bytes
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 8128
[ 0.000000] Kernel command line: console=ttyS0,57600 rootfstype=squashfs,jffs2
[ 0.000000] PID hash table entries: 128 (order: -3, 512 bytes)
[ 0.000000] Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.000000] Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.000000] Writing ErrCtl register=0004f376
[ 0.000000] Readback ErrCtl register=0004f376
[ 0.000000] Memory: 29024K/32768K available (2437K kernel code, 122K rwdata, 472K rodata, 160K init, 183K bss, 3744K reserved)
[ 0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] NR_IRQS:256
[ 0.000000] CPU Clock: 360MHz
[ 0.000000] systick: running - mult: 214748, shift: 32
[ 0.000000] genirq: Flags mismatch irq 7. 00014600 (timer) vs. 00014600 (systick)
[ 0.010000] Calibrating delay loop... 479.23 BogoMIPS (lpj=2396160)
[ 0.070000] pid_max: default: 32768 minimum: 301
[ 0.070000] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.080000] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.090000] pinctrl core: initialized pinctrl subsystem
[ 0.090000] NET: Registered protocol family 16
[ 0.120000] bio: create slab <bio-0> at 0
[ 0.120000] rt2880_gpio 10000600.gpio: registering 22 gpios
[ 0.130000] rt2880_gpio 10000600.gpio: registering 22 irq handlers
[ 0.130000] rt2880_gpio 10000660.gpio: registering 6 gpios
[ 0.140000] rt2880_gpio 10000660.gpio: registering 6 irq handlers
[ 0.150000] Switched to clocksource systick
[ 0.150000] NET: Registered protocol family 2
[ 0.170000] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.190000] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.190000] TCP: Hash tables configured (established 1024 bind 1024)
[ 0.210000] TCP: reno registered
[ 0.220000] UDP hash table entries: 256 (order: 0, 4096 bytes)
[ 0.230000] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[ 0.240000] NET: Registered protocol family 1
[ 0.250000] rt-timer 10000100.timer: maximum frequency is 7324Hz
[ 0.270000] futex hash table entries: 256 (order: -1, 3072 bytes)
[ 0.330000] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[ 0.330000] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[ 0.360000] msgmni has been set to 56
[ 0.370000] io scheduler noop registered
[ 0.380000] io scheduler deadline registered (default)
[ 0.390000] gpio-export gpio_export.6: 2 gpio(s) exported
[ 0.400000] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled
[ 0.430000] 10000c00.uartlite: ttyS0 at MMIO 0x10000c00 (irq = 20, base_baud = 2500000) is a 16550A
[ 0.450000] console [ttyS0] enabled
[ 0.450000] console [ttyS0] enabled
[ 0.470000] bootconsole [early0] disabled
[ 0.470000] bootconsole [early0] disabled
[ 0.490000] m25p80 spi32766.0: pm25lq032 (4096 Kbytes)
[ 0.510000] 4 ofpart partitions found on MTD device spi32766.0
[ 0.510000] Creating 4 MTD partitions on "spi32766.0":
[ 0.530000] 0x000000000000-0x000000030000 : "u-boot"
[ 0.530000] 0x000000030000-0x000000040000 : "u-boot-env"
[ 0.550000] 0x000000040000-0x000000050000 : "factory"
[ 0.570000] 0x000000050000-0x000000400000 : "firmware"
[ 0.590000] 2 uimage-fw partitions found on MTD device firmware
[ 0.610000] 0x000000050000-0x00000015f214 : "kernel"
[ 0.620000] mtd: partition "kernel" must either start or end on erase block boundary or be smaller than an erase block -- forcing read-only
[ 0.650000] 0x00000015f214-0x000000400000 : "rootfs"
[ 0.650000] mtd: partition "rootfs" must either start or end on erase block boundary or be smaller than an erase block -- forcing read-only
[ 0.690000] mtd: device 5 (rootfs) set to be root filesystem
[ 0.690000] 1 squashfs-split partitions found on MTD device rootfs
[ 0.710000] 0x000000330000-0x000000400000 : "rootfs_data"
[ 0.730000] ralink_soc_eth 10100000.ethernet eth0: ralink at 0xb0100000, irq 5
[ 0.750000] rt3xxx-usbphy usbphy.3: loaded
[ 0.760000] rt2880_wdt 10000120.watchdog: Initialized
[ 0.780000] TCP: cubic registered
[ 0.780000] NET: Registered protocol family 17
[ 0.780000] Bridge firewalling registered
[ 0.800000] 8021q: 802.1Q VLAN Support v1.8
[ 0.820000] VFS: Mounted root (squashfs filesystem) readonly on device 31:5.
[ 0.820000] Freeing unused kernel memory: 160K (802f8000 - 80320000)
procd: Console is alive
procd: - watchdog -
[ 6.730000] usbcore: registered new interface driver usbfs
[ 6.750000] usbcore: registered new interface driver hub
[ 6.760000] usbcore: registered new device driver usb
[ 6.780000] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 6.800000] ehci-platform: EHCI generic platform driver
[ 7.200000] rt3xxx-usbphy usbphy.3: remote usb device wakeup disabled
[ 7.220000] rt3xxx-usbphy usbphy.3: UTMI 16bit 30MHz
[ 7.230000] ehci-platform 101c0000.ehci: EHCI Host Controller
[ 7.250000] ehci-platform 101c0000.ehci: new USB bus registered, assigned bus number 1
[ 7.250000] ehci-platform 101c0000.ehci: irq 26, io mem 0x101c0000
[ 7.290000] ehci-platform 101c0000.ehci: USB 2.0 started, EHCI 1.00
[ 7.310000] hub 1-0:1.0: USB hub found
[ 7.310000] hub 1-0:1.0: 1 port detected
[ 7.330000] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[ 7.350000] ohci-platform: OHCI generic platform driver
[ 7.350000] ohci-platform 101c1000.ohci: Generic Platform OHCI controller
[ 7.370000] ohci-platform 101c1000.ohci: new USB bus registered, assigned bus number 2
[ 7.370000] ohci-platform 101c1000.ohci: irq 26, io mem 0x101c1000
[ 7.700000] hub 2-0:1.0: USB hub found
[ 7.700000] hub 2-0:1.0: 1 port detected
procd: - preinit -
[ 9.830000] rt305x-esw 10110000.esw: link changed 0x00
[ 9.990000] random: mktemp urandom read with 70 bits of entropy available
Press the [f] key and hit [enter] to enter failsafe mode
Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level
[ 11.300000] rt305x-esw 10110000.esw: link changed 0x01
jffs2 is ready
No jffs2 marker was found
[ 13.810000] jffs2: notice: (313) jffs2_build_xattr_subsystem: complete building xattr subsystem, 15 of xdatum (1 unchecked, 14 orphan) and 23 of xref (0 dead, 16 orphan) found.
switching to overlay
procd: - early -
procd: - watchdog -
procd: - ubus -
procd: - init -
[ 17.300000] NET: Registered protocol family 10
[ 17.320000] ip6_tables: (C) 2000-2006 Netfilter Core Team
[ 17.350000] Loading modules backported from Linux version master-2014-11-04-0-gf3660a2
[ 17.370000] Backport generated by backports.git backports-20141023-2-g4ff890b
[ 17.390000] ip_tables: (C) 2000-2006 Netfilter Core Team
[ 17.430000] nf_conntrack version 0.5.0 (456 buckets, 1824 max)
[ 17.510000] xt_time: kernel timezone is -0000
[ 17.560000] cfg80211: Calling CRDA to update world regulatory domain
[ 17.590000] cfg80211: World regulatory domain updated:
[ 17.600000] cfg80211: DFS Master region: unset
[ 17.610000] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)
[ 17.630000] cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
[ 17.650000] cfg80211: (2457000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
[ 17.660000] cfg80211: (2474000 KHz - 2494000 KHz @ 20000 KHz), (N/A, 2000 mBm), (N/A)
[ 17.680000] cfg80211: (5170000 KHz - 5250000 KHz @ 80000 KHz), (N/A, 2000 mBm), (N/A)
[ 17.700000] cfg80211: (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (0 s)
[ 17.710000] cfg80211: (5490000 KHz - 5730000 KHz @ 160000 KHz), (N/A, 2000 mBm), (0 s)
[ 17.730000] cfg80211: (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 2000 mBm), (N/A)
[ 17.750000] cfg80211: (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 0 mBm), (N/A)
[ 17.850000] PPP generic driver version 2.4.2
[ 17.850000] NET: Registered protocol family 24
[ 17.870000] ieee80211 phy0: rt2x00_set_rt: Info - RT chipset 5350, rev 0500 detected
[ 17.870000] ieee80211 phy0: rt2x00_set_rf: Info - RF chipset 5350 detected
procd: - init complete -
[ 29.380000] random: nonblocking pool is initialized
ssh -l root 192.168.0.16
echo "nameserver 8.8.8.8" > /etc/resolv.conf
grep -r oldpackages /etc/opkg.conf || (
cat >> /etc/opkg.conf <<\EOF
src/gz oldpackages http://downloads.openwrt.org/barrier_breaker/14.07/ramips/rt305x/packages/oldpackages
EOF
)
sed -i -e 's/.rt305x//g' /etc/opkg.conf
opkg update
opkg -d ram install madplay
# Recursively symlink
cp -rs /tmp/usr/* /usr/
cp -rs /tmp/etc/* /etc/
# Remove broken links
find -L /usr/ -type l -exec rm {} \;
find -L /etc/ -type l -exec rm {} \;
cat > /etc/config/network <<\EOF
config interface 'loopback'
option ifname 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config interface 'lan0'
option ifname 'eth0.1'
option proto 'dhcp'
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment