• Home
  • Help
  • Search
  • Login
  • Register
Pages: [1]
Author Topic: Fedora 12 and rootfs on SD card with Sheevaplug Dev Kit  (Read 7196 times)
joe
Newbie
*

Karma: 0
Posts: 7


View Profile
« on: December 02, 2009, 10:46:28 AM »

I have been able to install Fedora (12) on an SD card and run that on a Sheevaplug Dev
kit. There is a good bit of info on the web but I wasn’t able to find it all in one place. So
I thought I’d write it all down.


######################################################
#First lets prep the SD card:
######################################################

Inser the SD card to your linux system, tail dmesg to find out how your system saw it:


[root@wigeon ~]# dmesg | tail

scsi 8:0:0:0: Direct-Access     HP       v100w            4096 PQ: 0 ANSI: 0 CCS
sd 8:0:0:0: Attached scsi generic sg2 type 0
sd 8:0:0:0: [sdb] 7831552 512-byte hardware sectors: (4.00 GB/3.73 GiB)
sd 8:0:0:0: [sdb] Write Protect is off
sd 8:0:0:0: [sdb] Mode Sense: 43 00 00 00
sd 8:0:0:0: [sdb] Assuming drive cache: write through
sd 8:0:0:0: [sdb] Assuming drive cache: write through
 sdb: sdb1
sd 8:0:0:0: [sdb] Attached SCSI removable disk
[root@wigeon ~]#



Next run fdisk to create the partition table. I created one large partition skipping swap, no
need to swap on to an SD card.

[root@wigeon ~]# fdisk /dev/sdb

The number of cylinders for this disk is set to 1125.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)


Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4):
Value out of range.
Partition number (1-4): 1
First cylinder (1-1125, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-1125, default 1125):
Using default value 1125

Command (m for help): a
Partition number (1-4): 1

Command (m for help): t
Selected partition 1
         be  Solaris boot    ff  BBT
Hex code (type L to list codes): 83

Command (m for help): p

Disk /dev/sdb: 4009 MB, 4009754624 bytes
145 heads, 48 sectors/track, 1125 cylinders
Units = cylinders of 6960 * 512 = 3563520 bytes
Disk identifier: 0xc3072e18

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1        1125     3914976   83  Linux

Command (m for help):  w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.


Create the filesystem:
[root@wigeon ~]# mkfs.ext2 /dev/sdb1
mke2fs 1.41.4 (27-Jan-2009)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
244800 inodes, 978744 blocks
48937 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=1002438656
30 block groups
32768 blocks per group, 32768 fragments per group
8160 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736

Writing inode tables: done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 29 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.


######################################################
#Get OS and Kernel
######################################################


[root@wigeon tmp]# wget

http://ftp.linux.org.uk/pub/linux/arm/fedora/platforms/sheevaplug/uImage-2.6.30-sheevaplug

[root@wigeon tmp]# wget http://ftp.linux.org.uk/pub/linux/arm/fedora/rootfs/rootfs-

f12.tar.bz2

######################################################
#Install OS
######################################################

[root@wigeon tmp]# mkdir /media/flash
[root@wigeon tmp]# mount /dev/sdb1 /media/flash/
[root@wigeon tmp]# tar -jxf rootfs-f12.tar.bz2
[root@wigeon tmp]# cp -r rootfs-f12/* /media/flash/
[root@wigeon tmp]# cp uImage-2.6.30-sheevaplug /media/flash/boot/


######################################################
#Customize OS
######################################################

Edit the fstab to boot off of the SD card.
[root@wigeon tmp]# vi /media/flash/etc/fstab
Change the / partition to:
/dev/mmcblk0p1          /                       ext2     defaults        1 0

Edit the /etc/shadow so root can login, I don't know roots pw, we will make it empty.
[root@wigeon tmp]# vi /media/flash/etc/shadow
root:65946945gkfhkfjghkfghfkngdfshgt843:14495:0:99999:7:::
to
root::14495:0:99999:7:::

Edit the ethernet configuration:
[root@wigeon tmp]# vi /media/flash/etc/sysconfig/network
NETWORKING=yes
HOSTNAME=YourHostnameHere
[root@wigeon tmp]# 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


######################################################
#To boot off of the SD card, you need to update the uboot
#Download it, then put it on a tftp server.
#Make sure the firewall allows port 69 through
######################################################
[root@wigeon tmp]# yum install tftp-server
[root@wigeon tmp]# cd /var/lib/tftpboot/
[root@wigeon tftpboot]# wget http://www.cyrius.com/tmp/u-boot.bin-3.4.19
[root@wigeon tftpboot]# mv u-boot.bin-3.4.19 uboot.bin
[root@wigeon tftpboot]# vi /etc/xinetd.d/tftp
   change "disable  = yes " to "disable = no "


######################################################
#Set up the linux box for serial over usb support - FTDI
#I took this off of the fedoraprojecrt wiki page
#http://fedoraproject.org/wiki/Architectures/ARM/SheevaplugUSB
######################################################

[root@wigeon tftpboot]# 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

######################################################
#Connect to the sheevaplug
#######################################################
[root@wigeon tftpboot]# screen /dev/ttyUSBX 115200

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


######################################################
#Configure boot params
#######################################################

Marvell>>  setenv mainlineLinux yes
Marvell>>  setenv arcNumber 2097
Marvell>> setenv bootargs_console console=ttyS0,115200
Marvell>> setenv bootargs_root 'rw root=/dev/mmcblk0p1 rootdelay=10 rootfstype=ext2'
Marvell>> setenv bootcmd_mmc 'mmcinit; ext2load mmc 0 0x800000 /boot/uImage-2.6.30-sheevaplug'
Marvell>> setenv bootcmd 'setenv bootargs $(bootargs_console) $(bootargs_root); run bootcmd_mmc; bootm 0x0800000'
Marvell>>  saveenv
Marvell>> reset

It should boot now


######################################################
#Post install notes
#######################################################
I installed dnsmarq as an internal dns server, its lighter weight than bind
I installed ntpdate, and ntpd to set the date
CHANGE THE ROOT PASSWORD!!! Add a new user and install sudo
Disable root login in /etc/ssh/sshd_config
I still can't get the right modules for iptables to load....

The little sheevaplug is fast and fast enough for a home server.

Hope this helps someone.
-Joe

« Last Edit: December 02, 2009, 10:48:13 AM by joe » Logged

joe
Newbie
*

Karma: 0
Posts: 7


View Profile
« Reply #1 on: December 15, 2009, 06:05:23 AM »

I put step by step instructions up with screen caps etc over on instructables:
http://www.instructables.com/id/How-to-install-Fedora-on-a-SheevaPlug-and-boot-off/


-Joe
 
Logged

MarkF
Full Member
***

Karma: 7
Posts: 144


View Profile
« Reply #2 on: December 15, 2009, 06:56:38 AM »

Very nice.

By the way:
in step 7 you say "mount the USB key".  What USB key? Smiley (I think you meant SD card)
in step 8 you may want to mention turning off or down "access updates" in the FS (noatime, relatime) to reduce the writes to the SD card.
Logged

Mark

joe
Newbie
*

Karma: 0
Posts: 7


View Profile
« Reply #3 on: December 17, 2009, 11:55:31 AM »

Very nice.

By the way:
in step 7 you say "mount the USB key".  What USB key? Smiley (I think you meant SD card)
in step 8 you may want to mention turning off or down "access updates" in the FS (noatime, relatime) to reduce the writes to the SD card.

Thanks for the tips Mark! I updated the instructable .

-Joe
Logged

marcus
Jr. Member
**

Karma: 5
Posts: 83


View Profile
« Reply #4 on: December 19, 2009, 05:09:59 AM »


Edit the /etc/shadow so root can login, I don't know roots pw, we will make it empty.
[root@wigeon tmp]# vi /media/flash/etc/shadow
root:65946945gkfhkfjghkfghfkngdfshgt843:14495:0:99999:7:::
to
root::14495:0:99999:7:::


The default password is fedoraarm

I was able to use the installer to put Fedora 12 onto the NAND by downloading the rootfs-f12.tar.bz2, extracting it then recompressing to rootfs.tar.gz:

Code:
sudo tar -jxvf rootfs-f12.tar.bz2
cd rootfs-f12/
sudo tar czf ../rootfs.tar.gz *

Then copied rootfs.tar.gz to a USB stick prepared in the usual manner (ie alongside Initrd, modules.tar.gz, and uImage).

Of course, any tweaks to the Fedora rootfs can be applied prior to recompressing. Now that I know the process works, that's what I am going to go back and do - determine if there are any other changes that ought to be applied. (sshd is running, so changing the root password to nosoup4u and maybe a name change is all that ought to be done).
Logged

maisondouf
Newbie
*

Karma: 0
Posts: 7



View Profile WWW
« Reply #5 on: June 19, 2010, 11:07:46 PM »

I've installed rootfs-f12.tar.bz2 in an USB key with your method and Fedora run fine...

A simple question: For what I always have errors messages about /lib/modules/2.6.xxx/modules.dep Huh

As this:
Code:
modprobe: FATAL: Could not load /lib/modules/2.6.30-00000-v2.6.30/modules.dep: No such file or directory

Welcome to Fedora
Press 'I' to enter interactive startup.
Starting udev: modprobe: FATAL: Could not load /lib/modules/2.6.30-00000-v2.6.30/modules.dep: No such file or directory

Thanks
Logged

In love with Linux since Vista is born Cheesy

Pages: [1]
Print
Jump to: