How to Install Fedora on a SheevaPlug and Boot Off a SD Card.
13546 Views, 8 Favorites, 0 Comments
How to Install Fedora on a SheevaPlug and Boot Off a SD Card.
I saw a post on the SheevaPlug at Slashdot and then in Popular Mechanics. It seemed like an interesting device it runs @ 2.5w, no fans, solid state and no need for a monitor.
For years I have carried around an old CRT monitor just in case my linux box crashed, no need as this has a real serial console built in.
This instructable will detail how to build a SheevaPlug with Fedora (v12), to both run and boot off of a SD card.
I got a lot of good info from the PlugComputer Forum and a FedoraProject Wiki
For years I have carried around an old CRT monitor just in case my linux box crashed, no need as this has a real serial console built in.
This instructable will detail how to build a SheevaPlug with Fedora (v12), to both run and boot off of a SD card.
I got a lot of good info from the PlugComputer Forum and a FedoraProject Wiki
Supplies
You will need:
SheevaPlug Dev Kit (I bought mine from Global Scale)
SD Card
SD Card Reader
A linux box to install the OS on the SD card.
SheevaPlug Dev Kit (I bought mine from Global Scale)
SD Card
SD Card Reader
A linux box to install the OS on the SD card.
Prep the SD Card.
Add the SD Card to your linux box you are building this on and run:
dmesg | tail
The output here shows me that it has been mounted as /dev/sdc.
dmesg | tail
The output here shows me that it has been mounted as /dev/sdc.
Partition the SD Card
We will partition the SD card now.
fdisk /dev/sdc
Delete any existing partitions.
d
1
fdisk /dev/sdc
Delete any existing partitions.
d
1
Partition SD Card (cont)
Create the new partition.
c
accept defaults
Make it bootable
a
Verify it
p
Write the new parition table
w
c
accept defaults
Make it bootable
a
Verify it
p
Write the new parition table
w
Create the File System
Create the filesystem.
mkfs.ext2 /dev/sdc1
mkfs.ext2 /dev/sdc1
Get the Distro and Kernel
Download the Kernel and Distro
wget http://ftp.linux.org.uk/pub/linux/arm/fedora/platforms/sheevaplug/uImage-2.6.30-sheevaplug
wget http://ftp.linux.org.uk/pub/linux/arm/fedora/rootfs/rootfs-f12.tar.bz2
wget http://ftp.linux.org.uk/pub/linux/arm/fedora/platforms/sheevaplug/uImage-2.6.30-sheevaplug
wget http://ftp.linux.org.uk/pub/linux/arm/fedora/rootfs/rootfs-f12.tar.bz2
Install OS
Create a mount point
mkdir /media/flash
Mount the SD Card
mount /dev/sdc1 /media/flash
Uncompress the filesystem
tar -jxf rootfs-f12.tar.bz2
Copy the filesystem over to the sd card
cp -r rootfs-f12/* /media/flash/
Copy the kernel over to the sd card
cp uImage-2.6.30-sheevaplug /media/flash/boot/
mkdir /media/flash
Mount the SD Card
mount /dev/sdc1 /media/flash
Uncompress the filesystem
tar -jxf rootfs-f12.tar.bz2
Copy the filesystem over to the sd card
cp -r rootfs-f12/* /media/flash/
Copy the kernel over to the sd card
cp uImage-2.6.30-sheevaplug /media/flash/boot/
Edit the Fstab
The fstab needs to be edited to point to the SD card. The Sheevaplug see's the SD card as /dev/mmcblk0pX
vi /etc/fstab
change /root to
/dev/mmcblk0p1 / ext2 relatime 1 0
vi /etc/fstab
change /root to
/dev/mmcblk0p1 / ext2 relatime 1 0
Reset the Root Password
I have no idea what roots password is set to. So we'll remove it.
vi /media/flash/etc/shadow
Change the remove the password:
root:65946945gkfhkfjghkfghfkngdfshgt843:14495:0:99999:7:::
to
root::14495:0:99999:7:::
vi /media/flash/etc/shadow
Change the remove the password:
root:65946945gkfhkfjghkfghfkngdfshgt843:14495:0:99999:7:::
to
root::14495:0:99999:7:::
Edit the Network Configuration
Edit the network configuration for your network
vi /media/flash/etc/sysconfig/network
NETWORKING=yes
HOSTNAME=YourHostnameHere
vi /media/flash/etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=static
ONBOOT=yes
NETMASK=255.255.255.0
IPADDR=10.0.0.2
GATEWAY=10.0.0.1
DNS1=10.0.0.1
TYPE=Ethernet
USERCTL=no
PEERDNS=no
IPV6INIT=no
NM_CONTROLLED=no
Unmount the sd card
umount /media/flash
Put it in the SheevaPlug
vi /media/flash/etc/sysconfig/network
NETWORKING=yes
HOSTNAME=YourHostnameHere
vi /media/flash/etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=static
ONBOOT=yes
NETMASK=255.255.255.0
IPADDR=10.0.0.2
GATEWAY=10.0.0.1
DNS1=10.0.0.1
TYPE=Ethernet
USERCTL=no
PEERDNS=no
IPV6INIT=no
NM_CONTROLLED=no
Unmount the sd card
umount /media/flash
Put it in the SheevaPlug
Prep Your Linux Box to Update the Kernel
The SheevaPlug ships with a firmware that can boot off of SD cards. So you need to update it over TFTP
Install a tftp server
yum install tftp-server
Get the u-boot image and make it available to the sheevaplug
cd /var/lib/tftpboot/
wget http://www.cyrius.com/tmp/u-boot.bin-3.4.19
mv u-boot.bin-3.4.19 uboot.bin
vi /etc/xinetd.d/tftp
change "disable = yes " to "disable = no "
Add the script to load the ftdi driver when the SheevaPlug is connected:
vi /etc/udev/rules.d/85-sheevaplug.rules
# if no driver has claimed the interface yet, load ftdi_sio
ACTION=="add", SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_interface", \
ATTRS{idVendor}=="9e88", ATTRS{idProduct}=="9e8f", \
DRIVER=="", \
RUN+="/sbin/modprobe -b ftdi_sio"
# add the sheevaplug VID and PID to the list of devices supported by ftdi_sio
ACTION=="add", SUBSYSTEM=="drivers", \
ENV{DEVPATH}=="/bus/usb-serial/drivers/ftdi_sio", \
ATTR{new_id}="9e88 9e8f"
# optionally create a convenience symlink for the console device
ACTION=="add", KERNEL=="ttyUSB*", \
ATTRS{interface}=="SheevaPlug JTAGKey FT2232D B", \
ATTRS{bInterfaceNumber}=="01", \
SYMLINK+="sheevaplug"
***Plug in the serial cable from the Sheevaplug, if a /dev/ttyUSBx is not created, reboot
your linux system
Install a tftp server
yum install tftp-server
Get the u-boot image and make it available to the sheevaplug
cd /var/lib/tftpboot/
wget http://www.cyrius.com/tmp/u-boot.bin-3.4.19
mv u-boot.bin-3.4.19 uboot.bin
vi /etc/xinetd.d/tftp
change "disable = yes " to "disable = no "
Add the script to load the ftdi driver when the SheevaPlug is connected:
vi /etc/udev/rules.d/85-sheevaplug.rules
# if no driver has claimed the interface yet, load ftdi_sio
ACTION=="add", SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_interface", \
ATTRS{idVendor}=="9e88", ATTRS{idProduct}=="9e8f", \
DRIVER=="", \
RUN+="/sbin/modprobe -b ftdi_sio"
# add the sheevaplug VID and PID to the list of devices supported by ftdi_sio
ACTION=="add", SUBSYSTEM=="drivers", \
ENV{DEVPATH}=="/bus/usb-serial/drivers/ftdi_sio", \
ATTR{new_id}="9e88 9e8f"
# optionally create a convenience symlink for the console device
ACTION=="add", KERNEL=="ttyUSB*", \
ATTRS{interface}=="SheevaPlug JTAGKey FT2232D B", \
ATTRS{bInterfaceNumber}=="01", \
SYMLINK+="sheevaplug"
***Plug in the serial cable from the Sheevaplug, if a /dev/ttyUSBx is not created, reboot
your linux system
Change Boot Parms
Hook up the usb cable to the mini usb connector on the SheevaPlug to a usb port on your linux box.
screen /dev/ttyUSBX 115200
Update the firmware
Marvell>> setenv serverip 192.168.1.2 # IP of your TFTP server
Marvell>> setenv ipaddr 192.168.1.200 #IP of sheevaplug
Marvell>> bubt uboot.bin
**Warning**
If U-Boot Endiannes is going to change (LE->BE or BE->LE),
Then Env parameters should be overridden..
Override Env parameters? (y/n) n
Next you need to configure the bootloader to boot off of the SD card
setenv mainlineLinux yes
setenv arcNumber 2097
setenv bootargs_console console=ttyS0,115200
setenv bootargs_root 'rw root=/dev/mmcblk0p1 rootdelay=10 rootfstype=ext2'
setenv bootcmd_mmc 'mmcinit; ext2load mmc 0 0x800000 /boot/uImage-2.6.30-sheevaplug'
setenv bootcmd 'setenv bootargs $(bootargs_console) $(bootargs_root); run bootcmd_mmc; bootm 0x0800000'
saveenv
reset
It should boot up now.
screen /dev/ttyUSBX 115200
Update the firmware
Marvell>> setenv serverip 192.168.1.2 # IP of your TFTP server
Marvell>> setenv ipaddr 192.168.1.200 #IP of sheevaplug
Marvell>> bubt uboot.bin
**Warning**
If U-Boot Endiannes is going to change (LE->BE or BE->LE),
Then Env parameters should be overridden..
Override Env parameters? (y/n) n
Next you need to configure the bootloader to boot off of the SD card
setenv mainlineLinux yes
setenv arcNumber 2097
setenv bootargs_console console=ttyS0,115200
setenv bootargs_root 'rw root=/dev/mmcblk0p1 rootdelay=10 rootfstype=ext2'
setenv bootcmd_mmc 'mmcinit; ext2load mmc 0 0x800000 /boot/uImage-2.6.30-sheevaplug'
setenv bootcmd 'setenv bootargs $(bootargs_console) $(bootargs_root); run bootcmd_mmc; bootm 0x0800000'
saveenv
reset
It should boot up now.
Post Install Notes
You need to change the root password.
IP Tables is not loading right on my f12 install. So edit /etc/hosts.allow and hosts.deny until someone can figure it out...
I run Apache/PHP/DNSmasq/samba/etc on it and can't really notice any big performance hit.
IP Tables is not loading right on my f12 install. So edit /etc/hosts.allow and hosts.deny until someone can figure it out...
I run Apache/PHP/DNSmasq/samba/etc on it and can't really notice any big performance hit.