Winter 2011 Handout - RPM-Based ARM Kernels for Fedora ARM

From CDOT Wiki
Revision as of 17:45, 12 April 2011 by Ktaraghi (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Status

This page status is: DONE.

Title

RPM-Based ARM Kernels for Fedora ARM

Participants

Khosro Taraghi

Introduction

This project is related to making a RPM for kernels in Fedora ARM. Because of different architecture and hardware compared to PCs, the way that ARM loads kernels and other boot processes is different than PCs. We are going to make a RPM that loads kernels, modules, init, and other boot process in ARM system in standard way like PCs (Finding an alternative way for GRUB) and try to bind these packages together.

Approach

In PCs, when you turn on the machine, the system reads BIOS to locate the MBR which is the first 512 byte of hard disk. Then, the MBR says the location of GRUB and the GRUB program starts to load kernel. Finally, the kernel loads modules and init scripts to boot system up. In ARM system, because we do not have any BIOS or Hard disk, the process is different and it dose not have any GRUB. Instead, it has a Ramdisk or an image from file system that kernel loads that and boots from that. Now, we are going to make a package or RPM in case that we have several kernels installed in ARM and it should figure out to select the current kernel that it wants to load because it does not have any GRUB like PCs. So, this is the first approach for this project. Because we want to use initrd and modules which has a lot of features, we should build a kernel for a specific device which is impossible. Instead, we go to or load the generic kernel and the generic kernel can grab the module to know how to have access to hardware, but in order to do that, we should use a software such as Dracut to make the right module for a particular system. So, the Dracut is the second approach, and we should find a solution for working Dracut in ARM system.

Challenges

One of the big challenges is compiling kernel and hardware modules in koji server. For each compile, it takes around two and half hours plus 40 minutes upload from remote connection which make situation hard for me to keep track of errors and focus on problems. Another challenge could be compiling kernel and setting parameters for config file for kernel. Binding this rpm with original kernel rpm can be also challenge since it needs to figure out all specific items in spec file and also pre and post script for installation.

Results

So far, I could make a RPM for 2.6.28 kernel for a Beagle ARM board which works fine just for that specific kernel. Now, I am working on this rpm to expand it for any kernel and also to bind it with original(main) rpm. Here is the result of booting Beagle ARM board with this kernel. Also, it shows the result of loading Ramdisk via dracut software:

Booting kernel from Legacy Image at 80200000 ...
Image Name: Linux-2.6.28-omap1
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 2577980 Bytes = 2.5 MB
Load Address: 80008000
Entry Point: 80008000
Verifying Checksum ... OK
Loading init Ramdisk from Legacy Image at 81600000 ...
Image Name: boot initramfs
Image Type: ARM Linux RAMDisk Image (gzip compressed)
Data Size: 2631748 Bytes = 2.5 MB
Load Address: 81600000
Entry Point: 81600000
Verifying Checksum ... OK
Loading Kernel Image ... OK
OK
Starting kernel ...
Uncompressing Linux..................................................................................................................................................................... done, booti.
Linux version 2.6.28-omap1 (root@tiioss) (gcc version 4.2.1 (CodeSourcery Sourcery G++ Lite 2007q3-51)) #2 Thu Feb 19 12:45:34 IST 2009
CPU: ARMv7 Processor [411fc083] revision 3 (ARMv7), cr=10c5387f
CPU: VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
Machine: OMAP3 Beagle Board
.
.
.
.
mmc0: new high speed SDHC card at address 0007
mmcblk0: mmc0:0007 SD08G 7.48 GiB
mmcblk0: p1 p2
dracut: Mounted root filesystem /dev/mmcblk0p2
dracut: Switching root
Welcome to Fedora
Press 'I' to enter [ OK ]
FATAL: Module ipv6 not found.
Mounting other filesystems: [ OK ]
Retrigger failed udev events[ OK ]
Starting sshd: [ OK ]
Fedora release 13 (Goddard)
Kernel 2.6.28-omap1 on an armv7l (console)
fedora-arm login:

Links

You can find a lots of details about this project in the following address: Khosro Taraghi's blog

Acknowledgments

Pictures / Graphics

A picture of my ARM-based board rev C4