Trying to understand initramfs

Linux, initramfs, kernel No Comments »

I just want to have a faster booting process to test and learn more about Linux on my HTC Wizard.

I decided to start from scratch rather than enjoying the GPE. I am going to start with a bare minimum system - with just a busybox.

Instead of having two separate images, zImage and initrd, I believe having a single zImage is not only cool, but also convenient. 

I created the initramfs folder and bin,sbin,dev,etc,sys,proc, newroot folders under initramfs

I downloaded busybox 1.12.1 

Compiled busybox using the cross compiler and installed it using CONFIG_PREFIX=path/to/initramfs

Created the following generic terminals

mknod tty c 5 0

mknod console c 5 1

mknod null c 1 3

chmod 666 tty console null

mknod ram0 b 1 0

chmod 600 ram0

Created a initramfs.cpio.gz using the following command:

find . | cpio –quiet -o -H newc | gzip > ../initramfs.cpio.gz

Then I configured the option CONFIG_INITRAMFS_SOURCE=/path/to/initramfs.cpio.gz

Recompiled the kernel

The zImage is around 2.13MB.

I reconfigured the kernel and set the path to the source of initramfs.cpio.gz

HTC Wizard won’t load kernel. I get the following error

VFS: Cannot open root device "ram0" or unknown-block(1,0)
Please append a correct "root=" boot option
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

I have read almost all posts related to this error and unable to get out of this. If you ahve any suggestions, let me know

I may need to clean the distribution and start all over again rather than recooking the same thing

Share/Save/Bookmark

Struggle in compiling the kernel for OMAP850/OMAP730

Linux, kernel, tool chain No Comments »

Warning: I am newbie on embedded systems, kernels, etc. All disclaimers apply -read at yout own risk!

I hate to use binaries on Linux and I learnt I am not the only one who would like to make some changes to the code, compile it and use it. Many tell me that I am wasting time in doing so, but I love this. Old habits die hard. For the same reason, I do not want to use LinWizard. Is there a LinWizard source?

I decided to tread the difficult task of compiling the kernel and and ended up in downloading several versions and bookmarking various sites.

I found muru.com to be very useful.

This is what I did:

  1. Got the git tree from mvista and created a clone in my Linux box and created my branch “vairam” meaning diamond in Tamil. Then installed the GNU arm eabi tool chain from codesourcery.com. Created the .config file by selecting all default options using “make config”. 
  2. In the Makefile changed the prefix CROSS_COMPILE = arm-none-eabi. 
  3. Make menuconfig
  4. Selected OMAP Core type as OMAP=730 and OMAP board type FSAMPLE
  5. Make

I got the following error:

In file included from arch/arm/kernel/entry-armv.S:21:
arch/arm/plat-omap/include/mach/entry-macro.S:18:2: error: #error “FIXME: OMAP730 doesn’t support multiple-OMAP”

     6.  Then I reconfigured to exclude OMAP 15XX After the reconfiguration, .config shows

# CONFIG_ARCH_OMAP15XX is not set

     7. make 

This time I got the following error.

arch/arm/plat-omap/gpio.c: In function ‘_set_gpio_wakeup’:

arch/arm/plat-omap/gpio.c:848: warning: unused variable ‘flags’
arch/arm/plat-omap/gpio.c: In function ‘dbg_gpio_show’:
arch/arm/plat-omap/gpio.c:1834: error: ’struct gpio_bank’ has no member named ’suspend_wakeup’
arch/arm/plat-omap/gpio.c:1860: error: ’struct gpio_bank’ has no member named ’suspend_wakeup’

I tried to turn this switch off  in the .config and ended up corrupting it :-). I know I am blindly compiling the kernel, but I want to at least compile it with out any error.

I decided to patch the code with the CONFIG_ARCH_OMAP730 in the gpio_bank struct along with CONFIG_ARCH_OMAP16XX and CONFIG_ARCH_OMAP24XX. I am not sure whether it is right or wrong, but the error during kernel compilation went away.

I also got an error on related VGA_CONSOLE. I unset the VGA_CONSOLE=n and recompiled the kernel again.

With lot of struggle, I created the first kernel image vlinux (around 3.5MB) and ZImage (1.2MB) and it did not boot my HTC Wizard!  

Let me know if you have better ideas!

Share/Save/Bookmark

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in