RPM-based Kernels for Fedora ARM

From CDOT Wiki
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

Project Release 0.3

I released my SBR600 project version 0.3. I tested my last package several times and it worked successfully. It was actually an extension of my project version 0.2. Not only I changed version 0.2 to works with any kernel, including the new kernels, but also I merged my package with primary kernel package. So, when the Arch is ARM, it installs my package (RPM-based kernel for ARM) and when the Arch is something else, it works as a regular kernel installation. In other words, I could create a RPM-based kernel for ARM which was my project. I built my package on both ARM and Primary architecture to make sure that it works.

This is the output of ll command before installing of last version of kernel in my ARM board:

[root@fedora-arm khosro]# ll /boot/

total 7824

drwxr-xr-x 2 root root 4096 Apr 14 2011 grub

-rw-r--r-- 1 root root 2071652 Apr 14 2011 initramfs-2.6.32.img

-rw-r--r-- 1 root root 2071652 Apr 14 2011 initramfs.img

-rw-r--r-- 1 root root 1909048 Apr 14 2011 uImage-2.6.32

-rw-r--r-- 1 root root 1909048 Apr 14 2011 uImage.bin

And here is the output of ll command after installing my package which shows the new files: (pay attention to link files):

[root@fedora-arm ~]# ll /boot/

total 11900

drwxr-xr-x 2 root root 4096 Apr 14 2011 grub

-rw-r--r-- 1 root root 2071652 Apr 14 2011 initramfs-2.6.32.img

-rw-r--r-- 2 root root 2070985 Dec 31 1999 initramfs-2.6.35.img

-rw-r--r-- 2 root root 2070985 Dec 31 1999 initramfs.img

-rw-r--r-- 1 root root 1909048 Apr 14 2011 uImage-2.6.32

-rw-r--r-- 2 root root 2003236 Apr 21 2011 uImage-2.6.35

-rw-r--r-- 2 root root 2003236 Apr 21 2011 uImage.bin

The 2.6.35 is the last version of kernel up to this point that I wrote this blog.

Now, this is the output of booting my ARM board with new kernel (also, pay attention to “uname” command after logging to system):

Booting kernel from Legacy Image at 80200000 ...

Image Name: Linux-2.6.35

Image Type: ARM Linux Kernel Image (uncompressed)'

Data Size: 2003172 Bytes = 1.9 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, booting the kernel.

Data Size: Linux version 2.6.35 (mockbuild@koji3.laptop.org) (gcc version 4.4.5 20101112 (Red Hat 4.4.5-2) (GCC) ) #1 Thu Apr 21 14:40:04 EDT 2011

CPU: ARMv7 Processor [411fc083] revision 3 (ARMv7), cr=10c53c7f

CPU: VIPT nonaliasing data cache, VIPT nonaliasing instruction cache

Machine: OMAP3 Beagle Board

Memory policy: ECC disabled, Data cache writeback

OMAP3430/3530 ES3.1 (l2cache iva sgx neon isp )

SRAM: Mapped pa 0x40200000 to va 0xfe400000 size: 0x100000

Built 1 zonelists in Zone order, mobility grouping on. Total pages: 65024

Kernel command line: console=ttyS2,115200n8 root=/dev/mmcblk0p2 rootfstype=ext2 eq rootdelay=1 nohz=off

PID hash table entries: 1024 (order: 0, 4096 bytes)

Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)

Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)

Memory: 128MB 128MB = 256MB total

Memory: 253360k/253360k available, 8784k reserved, 0K highmem

Virtual kernel memory layout:

vector  : 0xffff0000 - 0xffff1000 ( 4 kB)

fixmap  : 0xfff00000 - 0xfffe0000 ( 896 kB)

DMA  : 0xffc00000 - 0xffe00000 ( 2 MB)

vmalloc : 0xd0800000 - 0xf8000000 ( 632 MB)

lowmem  : 0xc0000000 - 0xd0000000 ( 256 MB)

modules : 0xbf000000 - 0xc0000000 ( 16 MB)

.init : 0xc0008000 - 0xc0027000 ( 124 kB)

.text : 0xc0027000 - 0xc037d000 (3416 kB)

.data : 0xc0394000 - 0xc03c58c0 ( 199 kB)

Hierarchical RCU implementation.

Verbose stalled-CPUs detection is disabled.

NR_IRQS:402

Clocking rate (Crystal/Core/MPU): 26.0/332/720 MHz

omap_hwmod: l3_hwmod: cannot be enabled (3)

omap_hwmod: l4_core_hwmod: cannot be enabled (3)

omap_hwmod: l4_per_hwmod: cannot be enabled (3)

omap_hwmod: l4_wkup_hwmod: cannot be enabled (3)

Reprogramming SDRC clock to 332000000 Hz

GPMC revision 5.0

IRQ: Found an INTC at 0xfa200000 (revision 4.0) with 96 interrupts

Total of 96 interrupts on 1 active controller

OMAP GPIO hardware version 2.5

OMAP clockevent source: GPTIMER12 at 32768 Hz

Console: colour dummy device 80x30

Calibrating delay loop... 742.58 BogoMIPS (lpj=2899968)

pid_max: default: 32768 minimum: 301

Mount-cache hash table entries: 512

CPU: Testing write buffer coherency: ok

regulator: core version 0.5

NET: Registered protocol family 16

Found NAND on CS0

Registering NAND on CS0

Unable Setting up Logical Volume Management: No volume groups found

[ OK ]

Checking filesystems

Checking all file systems.

[/sbin/fsck.ext2 (1) -- /] fsck.ext2 -a /dev/mmcblk0p2

/dev/mmcblk0p2: Superblock last mount time is in the future.

(by less than a day, probably due to the hardware clock being incorrectly set) FIXED.

/dev/mmcblk0p2: Superblock last write time is in the future.

(by less than a day, probably due to the hardware clock being incorrectly set). FIXED.

/dev/mmcblk0p2: clean, 46024/425152 files, 301506/1699840 blocks (check after next mount)

[ OK ]

Remounting root filesystem in read-write mode: [ 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: [ 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.35 on an armv7l (console)

fedora-arm login: root

Password:

Last login: Fri Dec 31 19:01:49 on console

[root@fedora-arm ~]# uname -a

Linux fedora-arm 2.6.35 #1 Thu Apr 21 14:40:04 EDT 2011 armv7l armv7l armv7l GNU/Linux

These are the all links for downloading packages and also more details and explanations about release 0.3:

More details about release 0.3
SPEC File
Download Package
My Blog Page

Best Regards,

Khosro Taraghi

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