From Fedora Project Wiki
 
(7 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{Draft}}
= How To: Use the Fedora rootfs on a Pogoplug =  
{{Message|This page is based on the [[Architectures/ARM/BeagleBoardxMSDCard|howto for Fedora 12 on a BeagleBoard-xM]]}}
The [http://pogoplug.com Pogoplug] is installed with a very minimal (busybox) imate on the 3rd MTD-partition. In order to boot a full distribution from a USB-stick or disk, like Fedora, it is needed to replace the bootloader (u-boot) to make it USB-aware. Changing the bootloader will probably make the Pogoplug unsupported by the vendor. This guide describes how to install Fedora on the pink/grey Pogoplug V2.
=How To: Use the Fedora 13 rootfs on a Pogoplug=  
The [http://pogoplug.com Pogoplug] is installed with a very minimal (busybox) imate on the 3rd MTD-partition. In order to boot a full distribution from a USB-stick or disk, like Fedora, it is needed to replace the bootloader (u-boot) to make it USB-aware. Changing the bootloader will probably make the Pogoplug unsupported by the vendor. This guide describes how to install Fedora on the pink Pogoplug V2.


== What you need ==
== What you need ==
Line 14: Line 12:
# [http://jeff.doozan.com/debian/uboot update the bootloader]
# [http://jeff.doozan.com/debian/uboot update the bootloader]


== Preparation of the USB-stick or disk ==
After updating uboot, but '''before rebooting''' there are some additional changes to the uboot envoirment that need to be made in order to work with the filesystem layout for the Fedora images.
Create a partition on the USB-storage. Note that it should be a primary partition with number 1 (like <tt>/dev/sdX1</tt>).


Label the partition <tt>rootfs</tt>, and format it as ext3:
=== Fedora 18 ===
<pre>mkfs -t ext3 -L rootfs /dev/sdX1
<pre>
tune2fs -c 0 -i 0 /dev/sdX1
/usr/sbin/fw_setenv usb_scan 'usb_scan_done=0;for scan in $usb_scan_list; do run usb_scan_$scan; if test $usb_scan_done -eq 0 && ext2load usb $usb 0x800000 uImage 1; then usb_scan_done=1; echo "Found bootable drive on usb $usb"; setenv usb_device $usb; setenv usb_root /dev/$dev; fi; done'
/usr/sbin/fw_setenv usb_boot 'mw 0x800000 0 1; ext2load usb $usb_device 0x800000 uImage; if ext2load usb $usb_device 0x1100000 uInitrd; then bootm 0x800000 0x1100000; else bootm 0x800000; fi'
/usr/sbin/fw_setenv usb_scan_1 "usb=0:1 dev=sda3"
/usr/sbin/fw_setenv usb_scan_2 "usb=1:1 dev=sdb3"
/usr/sbin/fw_setenv usb_scan_3 "usb=2:1 dev=sdc3"
/usr/sbin/fw_setenv usb_scan_4 "usb=3:1 dev=sdd3"
/usr/sbin/fw_setenv usb_rootfstype ext4
</pre>
</pre>
   
 
Mount the partition:
=== Fedora 17 ===
<pre>mount /dev/sdX1 /mnt
<pre>
/usr/sbin/fw_setenv usb_scan 'usb_scan_done=0;for scan in $usb_scan_list; do run usb_scan_$scan; if test $usb_scan_done -eq 0 && fatload usb $usb 0x800000 /uImage-kirkwood 1; then usb_scan_done=1; echo "Found bootable drive on usb $usb"; setenv usb_device $usb; setenv usb_root /dev/$dev; fi; done'
/usr/sbin/fw_setenv usb_boot 'mw 0x800000 0 1; fatload usb $usb_device 0x800000 uImage-kirkwood; if fatload usb $usb_device 0x1100000 uInitrd-kirkwood; then bootm 0x800000 0x1100000; else bootm 0x800000; fi'
/usr/sbin/fw_setenv usb_scan_1 "usb=0:1 dev=sda2"
/usr/sbin/fw_setenv usb_scan_2 "usb=1:1 dev=sdb2"
/usr/sbin/fw_setenv usb_scan_3 "usb=2:1 dev=sdc2"
/usr/sbin/fw_setenv usb_scan_4 "usb=3:1 dev=sdd2"
</pre>
</pre>


== Copy rootfs to USB-storage ==
'''Note:''' The changes must be made from either the Pogoplug systems or in uboot at the serial console during boot. The updated version of uboot is not compatible with the uboot tools in fedora. '''DO NOT ATTEMPT to write the Pogoplug uboot enviorment with fw_saveenv provided by fedora.''' You will brick your system. If you do 'brick' your system, you can recover but it isn't easy or well documented.
Now that the <tt>rootfs</tt> partition has been created, it's time to extract the Fedora 13 root filesystem onto it. First, download the [http://scotland.proximity.on.ca/fedora-arm/beta/f13/rootfs-f13-beta-2011-03-23.tar.bz2 prebuilt root file system]. Once it's downloaded, navigate to the <tt>rootfs</tt> partition in a terminal, and extract the rootfs using the following commands:
<pre>su -c 'tar xjvf /path/to/rootfs-f13-beta-2011-03-23.tar.bz2 ./'</pre>


Replace <tt>/path/to/rootfs-f13-beta-2011-03-23.tar.bz2</tt> with the path to <tt>rootfs-f13-beta-2011-03-23.tar.bz2</tt> on your system.
== Preparation of the USB-stick or disk ==  
 
== Copy kernel and modules to the USB-storage ==
A working kernel (2.6.31.1) and modules can be taken are available from the [[Architectures/ARM/F13-ARM-Beta2#Kernel|Fedora 13 ARM Beta2 page]]:
* http://scotland.proximity.on.ca/arm/kernel/guruplug/2.6.36.1/uImage.tar.gz
* http://scotland.proximity.on.ca/arm/kernel/guruplug/2.6.36.1/modules.tar.gz
 
=== Make the kernel findable by the modified u-boot ===
<pre>su -c 'tar xzvf /path/to/uImage.tgz -C ./boot'</pre>
 
The <tt>uImage</tt> file should be placed under <tt>/boot</tt> on the first partition of the USB-storage. This is where u-boot tries to find it.
 
=== Make the modules available for loading during runtime ===
<pre>su -c 'tar xzvf /path/to/modules.tgz'</pre>
 
Replace <tt>/path/to/modules.tgz</tt> with the location of your downloaded <tt>modules.tgz</tt> file. There is no need to run <tt>depmod</tt> as the generated files are already part of the archive. All <tt>.ko</tt> files should be located under the <tt>/lib/modules/2.6.36.1</tt> directory on the USB-storage.
 
 
== Extra settings ==
This section outlines some of the additional configuration changes that need to be made.


=== Filesystems ===
Write the Fedora Image for Kickwood SoCs following the instuctions on the [[Architectures/ARM/Kirkwood#Writing_the_Image|Kirkwood]] page. Insert the drive into the Pogoplug and reboot. After about one minute you should be able to ssh to the PogoPlug (be patient, the first boot may take up to 10 minutes depending on your media speed.) the root password for F17 is 'fedoraarm', the root password for F18 is 'fedora'. Remember to recheck what dhcp address has been supplied as it will likely have changed from the uboot update step. (You can use: 'nmap 192.168.1.0/24' to find it from a machine on the same network.)
The Fedora 13 root filesystem is set up by default to mount a NFS share as the root partition.  This can be corrected by changing <tt>/etc/fstab</tt>. In the <tt>rootfs</tt> partition, open the <tt>etc/fstab</tt> (note there is NO prepending slash) and change the first line to read:
<pre>LABEL=rootfs        /          ext3    defaults    0 0</pre>


= Finished =
== Optional Configuration ==
Unmount the USB-storage on your PC, connect it to the Pogoplug and reboot it.
Because of the limited memory on the PogoPlug, on Fedora 17 or earlier it is advisable to add a swap partition/file. See, [http://docs.fedoraproject.org/en-US/Fedora/14/html/Storage_Administration_Guide/s2-swap-creating-file.html Fedora Documentation: Creating a Swap File]. Use count=262144 for a 256MB swap partiation. The Fedora 18 image already comes with a swap partition.

Latest revision as of 16:45, 11 February 2013

How To: Use the Fedora rootfs on a Pogoplug

The Pogoplug is installed with a very minimal (busybox) imate on the 3rd MTD-partition. In order to boot a full distribution from a USB-stick or disk, like Fedora, it is needed to replace the bootloader (u-boot) to make it USB-aware. Changing the bootloader will probably make the Pogoplug unsupported by the vendor. This guide describes how to install Fedora on the pink/grey Pogoplug V2.

What you need

To complete this guide, you'll need

  • Internet access on the Pogoplug
  • An external USB-stick or disk

Replace u-boot to be able to boot from USB-storage

  1. register the Pogoplug
  2. enable SSH access
  3. update the bootloader

After updating uboot, but before rebooting there are some additional changes to the uboot envoirment that need to be made in order to work with the filesystem layout for the Fedora images.

Fedora 18

/usr/sbin/fw_setenv usb_scan 'usb_scan_done=0;for scan in $usb_scan_list; do run usb_scan_$scan; if test $usb_scan_done -eq 0 && ext2load usb $usb 0x800000 uImage 1; then usb_scan_done=1; echo "Found bootable drive on usb $usb"; setenv usb_device $usb; setenv usb_root /dev/$dev; fi; done'
/usr/sbin/fw_setenv usb_boot 'mw 0x800000 0 1; ext2load usb $usb_device 0x800000 uImage; if ext2load usb $usb_device 0x1100000 uInitrd; then bootm 0x800000 0x1100000; else bootm 0x800000; fi'
/usr/sbin/fw_setenv usb_scan_1 "usb=0:1 dev=sda3"
/usr/sbin/fw_setenv usb_scan_2 "usb=1:1 dev=sdb3"
/usr/sbin/fw_setenv usb_scan_3 "usb=2:1 dev=sdc3"
/usr/sbin/fw_setenv usb_scan_4 "usb=3:1 dev=sdd3"
/usr/sbin/fw_setenv usb_rootfstype ext4

Fedora 17

/usr/sbin/fw_setenv usb_scan 'usb_scan_done=0;for scan in $usb_scan_list; do run usb_scan_$scan; if test $usb_scan_done -eq 0 && fatload usb $usb 0x800000 /uImage-kirkwood 1; then usb_scan_done=1; echo "Found bootable drive on usb $usb"; setenv usb_device $usb; setenv usb_root /dev/$dev; fi; done'
/usr/sbin/fw_setenv usb_boot 'mw 0x800000 0 1; fatload usb $usb_device 0x800000 uImage-kirkwood; if fatload usb $usb_device 0x1100000 uInitrd-kirkwood; then bootm 0x800000 0x1100000; else bootm 0x800000; fi'
/usr/sbin/fw_setenv usb_scan_1 "usb=0:1 dev=sda2"
/usr/sbin/fw_setenv usb_scan_2 "usb=1:1 dev=sdb2"
/usr/sbin/fw_setenv usb_scan_3 "usb=2:1 dev=sdc2"
/usr/sbin/fw_setenv usb_scan_4 "usb=3:1 dev=sdd2"

Note: The changes must be made from either the Pogoplug systems or in uboot at the serial console during boot. The updated version of uboot is not compatible with the uboot tools in fedora. DO NOT ATTEMPT to write the Pogoplug uboot enviorment with fw_saveenv provided by fedora. You will brick your system. If you do 'brick' your system, you can recover but it isn't easy or well documented.

Preparation of the USB-stick or disk

Write the Fedora Image for Kickwood SoCs following the instuctions on the Kirkwood page. Insert the drive into the Pogoplug and reboot. After about one minute you should be able to ssh to the PogoPlug (be patient, the first boot may take up to 10 minutes depending on your media speed.) the root password for F17 is 'fedoraarm', the root password for F18 is 'fedora'. Remember to recheck what dhcp address has been supplied as it will likely have changed from the uboot update step. (You can use: 'nmap 192.168.1.0/24' to find it from a machine on the same network.)

Optional Configuration

Because of the limited memory on the PogoPlug, on Fedora 17 or earlier it is advisable to add a swap partition/file. See, Fedora Documentation: Creating a Swap File. Use count=262144 for a 256MB swap partiation. The Fedora 18 image already comes with a swap partition.