marcelo8989 / moboot

Automatically exported from code.google.com/p/moboot
MIT License
1 stars 0 forks source link

How to create a moboot-compatible kernel with ramdisk? #20

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
i.e. procedure I expected to work but that did not.
This is a test case with CyanogenMod uImage multi-image but the same happens 
using a kernel built from 
https://github.com/CyanogenMod/hp-kernel-tenderloin.git with 
tenderloin_android_defconfig

1. download moboot and build uimage-extract (for host platform)
        git clone https://code.google.com/p/moboot
        make moboot/lib/zlib/crc32.o
        make moboot/tools/uimage-extract.o
        cc -o moboot/tools/uimage-extract moboot/tools/uimage-extract.o moboot/lib/zlib/crc32.o
2. extract kernel.img and ramdisk.img from uImage.CyanogenMod
        moboot/tools/uimage-extract uImage.CyanogenMod
3. rebuild multi-image uImage from kernel.img and initramfs.img
        mkimage -A arm -T multi -C none -a 0x00000000 -e 0x00000000 -n test-multi-image -d kernel.img:ramdisk.img uImage.rebuilt
4. load onto touchpad and attempt to build or test with uimage-extract
        moboot/tools/uimage-extract uImage.rebuilt

What is the expected output? What do you see instead?

expected the kernel to boot or, with uimage-extract, to see

Image 1@00000001: OK
Image 2@0000d95a: OK
Image 0: Tue Oct 18 21:52:36 2011
Image 0: MULTI 'test-multi-image'

Image 1: Tue Oct 18 21:52:05 2011
Image 1: KERNEL 'Linux-2.6.35-palm-tenderloin'
Image 1: SIZE: 3560948
Image 1: LOAD: 0x40208000
Image 1:   EP: 0x40208000
Writing 3560948 bytes to kernel.img

Image 2: Tue Oct 18 21:52:36 2011
Image 2: RAMDISK 'Image'
Image 2: SIZE: 162950
Writing 162950 bytes to ramdisk.img

instead saw

Image 1: Invalid Magic

What version of the product are you using? On what operating system?

moboot  from git
commit 2e9950189327540745b1d2ee10a5ac880fc21629
Author: James Sullins <jcsullins@gmail.com>
Date:   Thu Oct 6 23:50:22 2011 -0500

    fix argc check

mkimage from u-boot 1.3.2 or 1.1.2 with HP patches

OS: Arch Linux on x86

Original issue reported on code.google.com by k...@bijna.net on 3 Nov 2011 at 3:50

GoogleCodeExporter commented 8 years ago
uimage-extract not only unpacks the sections within a uImage multi-image, it 
then unpacks those uImages, so I hadn't realized that they were packed as such. 
To create a moboot:

mkimage -A arm -T kernel -C none -d kernel.img uImage
mkimage -A arm -T ramdisk -C none -d ramdisk.img ramdisk
mkimage -A arm -T multi -C none -n test-multi-image -d uImage:ramdisk 
uImage.rebuilt

I am now able to boot with a kernel built from source.
It would be nice to have this information in the README and the google code 
page wiki.

Original comment by k...@bijna.net on 3 Nov 2011 at 7:42

GoogleCodeExporter commented 8 years ago
Hi,
I have problem with boot custom kernel. How to fix it? I've followed 
instruction to using mkimage.

Original comment by G.Veniamin on 9 Nov 2011 at 10:03

Attachments:

GoogleCodeExporter commented 8 years ago
I have the same issue. I create an uImage using the exact same CM7 files that 
were extracted, and no luck, it doesn't boot.

So this is the same kernel and the same ramdisk.

I get past this screen, but i get a blank screen...

Original comment by jeanfran...@gmail.com on 9 Nov 2011 at 11:37

GoogleCodeExporter commented 8 years ago
I got Cyanogenmod's kernel + ramdisk to boot using the following :

# mkimage -A arm -O linux -T kernel -C none -a 0x40208000 -e 0x40208000 -n 
"Kernel" -d kernel.img uImage

# mkimage -A arm -O linux -T ramdisk -C none -a 0x60000000 -e 0x60000000 -n 
"Image" -d ramdisk.img uRamdisk

#mkimage -A arm -O linux -T multi -a 0x40208000  -e  0x40208000 -C none -n 
"multi image" -d uImage:uRamdisk  uImage.CyanogenMod.new

Parts of the information was taken on 
http://forum.xda-developers.com/showthread.php?p=19080005

Original comment by jeanfran...@gmail.com on 11 Nov 2011 at 3:13

GoogleCodeExporter commented 8 years ago
To build the non-CM kernel I had to enable everything under Drivers -> Staging 
-> Android and then also disable V4L under Drivers -> Multimedia. Otherwise, 
the procedure was the same. I'm using the non-CM kernel because ar6000.ko was 
causing kernel panics when using WPA with the CM kernel.

Original comment by crimsonr...@gmail.com on 28 Nov 2011 at 10:16