OpenWrt Forum Archive

Topic: HOWTO: Install stock openWrt snapshot onto SD for Sheevaplug

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

This describes how to download snapshots from the openWrt repository and load them onto an SD/mmc card, and then to boot from the SD.  You need a serial console to do this, and not to have a network cable plugged in.

First download the uImage file and the root file system from here:

http://downloads.openwrt.org/snapshots/ … ood-uImage
http://downloads.openwrt.org/snapshots/ … tfs.tar.gz

(For openWrt info, see www.openWrt.org)

Next partition and format an SD card.  I am using a 512mb card, and am making a single partition.  From a linux command line, do this (assuming /dev/sdb--note: if you get this wrong, you could break your system--really).

fdisk -l
fdisk /dev/sdb
p [check that you have the device you think you have]
[if you must delete existing partitions, use the "d" command until none remain]
n
p
1
1
<enter> [to select through the last cylinder]
t
83
p [Check that your selections are rational.  Do not make this bootable.]
w
umount /dev/sdb1
mkfs.ext2 /dev/sdb1
[next mount the device, perhaps on a directory named "/usb"]
mount /dev/sdb1 /usb
[copy the two openWrt files to the SD device]
[untar the file system]
cd /usb
tar xvpfz kirkwood/openwrt-kirkwood-rootfs.tar.gz -C /usb

Now get to the Marvell uboot prompt on the Sheevaplug (you may need uboot version 3.4.19 (at least) to do this--see http://www.cyrius.com/debian/kirkwood/s … stall.html -- Upgrading U-Boot).  Enter the following commands to set up the environment and to copy the uImage file to RAM for booting.

setenv mainlineLinux yes; setenv arcNumber 2097;
setenv bootargs_console console=ttyS0,115200
setenv bootmmc3_root 'root=/dev/mmcblk0p1 rootdelay=10'
setenv bootcmd_mmc3 'mmcinit; ext2load mmc 0:1 0x00800000 /openwrt-kirkwood-uImage'
setenv bootmmc3 'setenv bootargs $(bootargs_console) $(bootmmc3_root); saveenv; run bootcmd_mmc3; bootm 0x00800000'
saveenv
run bootmmc3

(Note:  I use "mmc3" because I have two other mmc boot routines.  Once this tests out, you can set it to always boot to the SD by running "setenv bootcmd 'run bootmmc3'; saveenv".)

Your system should boot.  Hit <enter> to get a propmt.  OpenWrt assumes that it is running on a router, so there are several things you need to do to get it connected to your network.

/etc/init.d/dnsmasq disable [this turns off the dns server]
passwd [set your password so you can ssh in--telnet is enabled until this is done]
vi /etc/config/network [set the static ip address to something convenient, like 192.168.1.70, and set your gateway and dns IPs, e.g., "option gateway 192.168.1.1" and "option dns 192.168.1.1".]
vi /etc/config/system [to set a device name, if you like]
reboot

At this point, if you get the Marvell>> prompt, again enter "run bootmmc3" or set the bootcmd variable as above and enter "boot".  You should be able to ssh in to the IP address you set, using the password you set.

Next post:  customizing the system.

I add the packages I want by doing the following:

opkg update
opkg install usbutils e2fsprogs cfdisk fdisk
opkg install kmod-usb-core kmod-usb-storage kmod-usb2 kmod-fs-vfat kmod-nls-cp437 kmod-nls-iso8859-1
opkg install kmod-video-core kmod-video-uvc kmod-video-pwc
opkg install ssmtp microcom luci-admin-full openssh-sftp-server empty picocom coreutils-stty wget nano
opkg install mjpg-streamer ffmpeg motion streamripper ushare
opkg install kmod-usb-audio madplay mpd alsa-utils
opkg install kmod-usb-serial kmod-usb-serial-pl2303 kmod-usb-serial-ftdi
opkg install sqlite3-cli luafilesystem luasocket luasql-sqlite3

These packages bring you up to 5% utilization of a 512MB SD card.  They give you usb storage for ext2, ext3 (built-in) and fat, usb video for a webcam, usb audio, usb serial, and some other stuff. 

See http://downloads.openwrt.org/snapshots/ … /packages/ for the hundreds of packages available.  You can also use the openWrt build system to make a custom image, but with a full set of packages, that may not be necessary.  The Sheevaplug obviates the need for the compressed storage available with a custom build.

The discussion might have continued from here.