RPM-based Kernels for Fedora ARM

From CDOT Wiki
Revision as of 08:05, 5 April 2011 by Ktaraghi (talk | contribs) (Project Release 0.2)
Jump to: navigation, search

RPM-based Kernels for Fedora ARM

Project Description

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.


Project Leader(s)

Chris Tyler, Fedora ARM List

Project Contributor(s)

[Khosro Taraghi]

Project Details

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.

Project Plan

Tracking mechanism (bugzilla, trac, github, ...):

Key contacts:

Goals for each release and plans for reaching those goals:

  • 0.1
     Find a solution for Dracut to work in ARM system

Please see Project News and release 0.1.

  • 0.2
     Design Spec file for ARM Kernel and find an alternative way for GRUB in ARM system

At this stage, I am trying to design a spec file for current kernel in my Fedora-ARM board since there is no any specific design in current rpm and spec file for kernel. This will merge to the main spec file in the kernel to include the ARM architecture for my ARM board. I should include my initramfs and current kernel to my spec file and find an alternative way to replace the GRUB since there is no any GRUB in ARM architecture. Although the hardware for this board doesn't change except adding hardware to the board such as RAID, which is good in designing iniramfs with dracut, different kinds of ARM board, for example, Beagleboard(OMAP3) or Panada boards and so on, make it hard and complicate in designing rpm kernel for ARM architecture.

  • 0.3
     Bind together as a package, Documentation, and Presentation.

Communication

Mailing Lists

  • arm@lists.fedoraproject.org
  • devel@lists.fedoraproject.org

Upsteam Wiki and Web

Fedora Dracut wiki

Links/Bugs/Tracking

Source Code Control

Blogs

Seneca Particpants

Non-Seneca Participants

Planets

Project News

         Normal  0          false  false  false    EN-CA  X-NONE  X-NONE

Project Release 0.2

I released SBR600 project release 0.2. It is a rough package to install kernel and initramfs in a ARM board. It is almost close to end and I should change some parameters and hardcodes and then merge it to the original file such as kernel or grub, or even a separate package. You can find more details about release 0.2 in my weblog. Furthermore, you can download my spec, rpm, and srpm files from my weblog to further review.
These are the links:
My blog page
rpm file
srpm file
spec file

Project Release 0.1 Update

Hello, After working on my project for the whole study week, I could figure out how to make initramfs with dracut for my Fedora-ARM board. After successfully booting and getting prompt for logging to Fedora 13 beta, I had trouble to install dracut on my ARM borad.Fortunately, I solved the problem and you can click on this link to get full details that I posted on my blob.Installation of dracut in Fedora-ARM 13 BetaAfter installing dracut, I had to compile the kernel in order to get modules for the ARM board which is a must for dracut to work properly. For full details and explanations, click on this link that I posted on my blog page:Kernel Compilation for ARM and Installation of Modules. Finally, I could boot my ARM board up with initramfs that I made it with dracut. Here is the link to my initramfs for Fedora 13 beta so that you click on this link to download the initramfs file(uImage.ramdisk) Download my initramfs. This just work with OMAP3 family.And here is the output of the kernel before logging that shows booting system with dracut and initramfs:

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:

Project Release 0.1

Hello everybody,

I released version 0.1 of my SBR600 project. It is roughly close to what I expected. After several problems in booting system up, I could figure out how to boot the Fedora ARM system. The next step that I am working on that is "dracut". I am looking for a way to create an initial ramdisk image for preloading modules. This can be done by dracut command. After this step, it is the final step which is packaging(I hope).Now, let's see some of my testing result and my explanations on those test.

This shows my successful boot on Fedora-ARM:'

VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 1
Console: switching to colour frame buffer device 80x30
clock: clksel_round_rate_div: dpll4_m4_ck target_rate 48000000
clock: new_div = 9, new_rate = 48000000
twl4030_rtc twl4030_rtc: setting system clock to 2000-01-01 00:00:00 UTC (946684800)
Waiting 1sec before mounting root device...
mmc0: new high speed SDHC card at address 0007
mmcblk0: mmc0:0007 SD08G 7.48 GiB
mmcblk0: p1 p2
EXT2-fs warning: mounting unchecked fs, running e2fsck is recommended
VFS: Mounted root (ext2 filesystem).
Freeing init memory: 168K
Welcome to Fedora
Press 'I' to enter interactive startup.
Starting udev: udevd-work[652]: error opening ATTR{/sys/class/sound/controlC0/../uevent} for writing: No such file or directory
[ OK ]
Setting hostname fedora-arm: [ OK ]
Checking filesystems
Checking all file systems.
[/sbin/fsck.ext2 (1) -- /] fsck.ext2 -a /dev/mmcblk0p2
/dev/mmcblk0p2 is mounted.
WARNING!!! Running e2fsck on a mounted filesystem may cause
SEVERE filesystem damage.
Do you really want to continue (y/n)? no
check aborted.
[ OK ]
Mounting local filesystems: [ OK ]
Enabling /etc/fstab swaps: [ OK ]
Entering non-interactive startup
FATAL: Module ipv6 not found.
Bringing up loopback interface: [ OK ]
Bringing up interface eth0: RTNETLINK answers: File exists
[ OK ]
FATAL: Module ipv6 not found.
Starting system logger: [ OK ]
Mounting other filesystems: [ OK ]
Retrigger failed udev events[ OK ]
Starting sshd: [ OK ]
Fedora release 12 (Constantine)
Kernel 2.6.28-omap1 on an armv7l (console)
fedora-arm login: root
Password:
Last login: Fri Dec 31 19:32:49 on console

This one shows my network configuration and successful connection to getway and Internet:

[root@fedora-arm ~]# ifconfig
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:2 errors:0 dropped:0 overruns:0 frame:0
TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:168 (168.0 b) TX bytes:168 (168.0 b)
usb0 Link encap:Ethernet HWaddr 1E:11:18:90:28:EF
inet addr:10.0.0.2 Bcast:10.255.255.255 Mask:255.0.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:6 errors:0 dropped:0 overruns:0 frame:0
TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1444 (1.4 KiB) TX bytes:504 (504.0 b)
[root@fedora-arm ~]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
169.254.0.0 0.0.0.0 255.255.0.0 U 1002 0 0 usb0
10.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 usb0
0.0.0.0 10.0.0.1 0.0.0.0 UG 0 0 0 usb0
[root@fedora-arm ~]# ping 10.0.0.1
PING 10.0.0.1 (10.0.0.1) 56(84) bytes of data.
64 bytes from 10.0.0.1: icmp_seq=1 ttl=64 time=8.14 ms
64 bytes from 10.0.0.1: icmp_seq=2 ttl=64 time=1.49 ms
64 bytes from 10.0.0.1: icmp_seq=3 ttl=64 time=1.55 ms

And ping google.ca:

[root@fedora-arm ~]# ping 74.125.225.16
PING 74.125.225.16 (74.125.225.16) 56(84) bytes of data.
64 bytes from 74.125.225.16: icmp_seq=2 ttl=55 time=849 ms
64 bytes from 74.125.225.16: icmp_seq=3 ttl=55 time=26.9 ms
64 bytes from 74.125.225.16: icmp_seq=4 ttl=55 time=28.3 ms

Then I tried to update my Fedora-Arm system. It was successful too:

root@fedora-arm ~]# yum update
fedora | 3.4 kB 00:00
fedora/primary_db | 7.5 MB 06:46
updates | 951 B 00:00
updates/primary | 204 B 00:00
Setting up Update Process
Resolving Dependencies
--> Running transaction check
---> Package cpp.armv5tel 0:4.4.2-5.fc12.fa4 set to be updated
---> Package gcc.armv5tel 0:4.4.2-5.fc12.fa4 set to be updated
---> Package libgcc.armv5tel 0:4.4.2-5.fc12.fa4 set to be updated
---> Package libgomp.armv5tel 0:4.4.2-5.fc12.fa4 set to be updated
---> Package libstdc++.armv5tel 0:4.4.2-5.fc12.fa4 set to be updated
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Updating:
cpp armv5tel 4.4.2-5.fc12.fa4 fedora 3.1 M
gcc armv5tel 4.4.2-5.fc12.fa4 fedora 6.1 M
libgcc armv5tel 4.4.2-5.fc12.fa4 fedora 248 k
libgomp armv5tel 4.4.2-5.fc12.fa4 fedora 89 k
libstdc++ armv5tel 4.4.2-5.fc12.fa4 fedora 234 k
Transaction Summary
================================================================================
Install 0 Package(s)
Upgrade 5 Package(s)
Total download size: 9.8 M
Is this ok [y/N]: y
Downloading Packages:
(1/5): cpp-4.4.2-5.fc12.fa4.armv5tel.rpm | 3.1 MB 03:58
(2/5): gcc-4.4.2-5.fc12.fa4.armv5tel.rpm | 6.1 MB 03:21
(3/5): libgcc-4.4.2-5.fc12.fa4.armv5tel.rpm | 248 kB 00:20
(4/5): libgomp-4.4.2-5.fc12.fa4.armv5tel.rpm | 89 kB 00:01
(5/5): libstdc++-4.4.2-5.fc12.fa4.armv5tel.rpm | 234 kB 00:43
--------------------------------------------------------------------------------
Total 20 kB/s | 9.8 MB 08:31
warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID 35805f14
fedora/gpgkey | 2.7 kB 00:00 ...
Importing GPG key 0x35805F14 "Fedora 12 ARM (Signing key for F-12 ARM) <fedora-arm@redhat.com>" from /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-armv5tel
Is this ok [y/N]: y
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Updating  : libgcc-4.4.2-5.fc12.fa4.armv5tel 1/10
Updating  : libgomp-4.4.2-5.fc12.fa4.armv5tel 2/10
Updating  : libstdc++-4.4.2-5.fc12.fa4.armv5tel 3/10
Updating  : cpp-4.4.2-5.fc12.fa4.armv [################ ] 4/10
Updating  : gcc-4.4.2-5.fc12.fa4.armv5tel 5/10
Cleanup  : libstdc++-4.4.2-5.fc12.fa3.armv5tel 6/10
Cleanup  : libgcc-4.4.2-5.fc12.fa3.armv5tel 7/10
Cleanup  : cpp-4.4.2-5.fc12.fa3.armv5tel 8/10
Cleanup  : libgomp-4.4.2-5.fc12.fa3.armv5tel 9/10
Cleanup  : gcc-4.4.2-5.fc12.fa3.armv5tel 10/10
Updated:
cpp.armv5tel 0:4.4.2-5.fc12.fa4 gcc.armv5tel 0:4.4.2-5.fc12.fa4
libgcc.armv5tel 0:4.4.2-5.fc12.fa4 libgomp.armv5tel 0:4.4.2-5.fc12.fa4
libstdc++.armv5tel

And finally, I used git for dracut since I couldn't install through yum command:

racut@fedora-arm ~]# git clone git://dracut.git.sourceforge.net/gitroot/dracut/d
Initialized empty Git repository in /root/dracut/.git/
remote: Counting objects: 9670, done.
remote: Compressing objects: 100% (6208/6208), done.
remote: Total 9670 (delta 6805), reused 4965 (delta 3351)
Receiving objects: 100% (9670/9670), 1.23 MiB | 8 KiB/s, done.
Resolving deltas: 11% (754/6805)[root@fedora-arm ~]#
[root@fedora-arm ~]# ls
dracut
[root@fedora-arm ~]# cd dracut/
[root@fedora-arm dracut]# ls
AUTHORS debian dracut.conf.d
COPYING dracut dracut.kernel.7.xml
HACKING dracut-catimages dracut.png
Makefile dracut-catimages.8.xml dracut.spec
NEWS dracut-functions dracut.svg
PKGBUILD dracut-gencmdline dracut.xml
README dracut-gencmdline.8.xml lsinitrd
README.generic dracut-update-initramfs mkinitrd-dracut.sh
README.kernel dracut.8.x