[Q] Leedroid v3.2 --> boot.img? - HTC EVO 3D

Hello,
i have got a problem: i want to flash aLeedroid kernel to my MikRunny v1.0 rom...
but: i'm s-on and i need the correct boot.img can anyone give me a tip / program to unpack the boot.img from the kernel?
http://leedroid.ftp.rshost.eu/Shooter-Kernels/LeeDrOiD_Evo-3D-GSM_V3.2.0-1.94GHz-KERNEL.zip
in the archive i found the following lines that my be interesting for unpacking, but i don't know how...
Code:
#!/sbin/sh
echo \#!/sbin/sh > /tmp/createnewboot.sh
echo /tmp/mkbootimg --kernel /tmp/zImage --ramdisk /tmp/boot.img-ramdisk.gz --cmdline \"$(cat /tmp/boot.img-cmdline)\" --base $(cat /tmp/boot.img-base) --output /tmp/newboot.img >> /tmp/createnewboot.sh
chmod 777 /tmp/createnewboot.sh
/tmp/createnewboot.sh
return $?

e3d said:
Hello,
i have got a problem: i want to flash aLeedroid kernel to my MikRunny v1.0 rom...
but: i'm s-on and i need the correct boot.img can anyone give me a tip / program to unpack the boot.img from the kernel?
http://leedroid.ftp.rshost.eu/Shooter-Kernels/LeeDrOiD_Evo-3D-GSM_V3.2.0-1.94GHz-KERNEL.zip
in the archive i found the following lines that my be interesting for unpacking, but i don't know how...
Code:
#!/sbin/sh
echo \#!/sbin/sh > /tmp/createnewboot.sh
echo /tmp/mkbootimg --kernel /tmp/zImage --ramdisk /tmp/boot.img-ramdisk.gz --cmdline \"$(cat /tmp/boot.img-cmdline)\" --base $(cat /tmp/boot.img-base) --output /tmp/newboot.img >> /tmp/createnewboot.sh
chmod 777 /tmp/createnewboot.sh
/tmp/createnewboot.sh
return $?
Click to expand...
Click to collapse
Just download the entire rom instead of the kernel only. Inside the rom (if you just open it with WinRar or similar), it will have a boot.img file and you can just extract that.

Moonbloom said:
Just download the entire rom instead of the kernel only. Inside the rom (if you just open it with WinRar or similar), it will have a boot.img file and you can just extract that.
Click to expand...
Click to collapse
not working i will stay at the otther rom
(i got s-on and hboot 1.49.0018) + revolutionary cwm

Related

[Q] Problems building a boot.img : Is this safe to use?

I am trying to replace the kernel in a boot.img, and then repackage it to a zip that can be flashed. I am trying to follow a guide. Since I am not allowed to post a link, I'll post an excerpt:
E. The Boot.img
We already know that this is the kernel and ramdisk needed to boot up the device. You can pull this apart and swap out the kernel if you would like. For this, you're going to have to run Linux. If you're not able to run Linux natively, download Sun's Virtual Box and an easy to use Linux distro like Ubuntu or Fedora. We will leave custom kernel compilation for another day. To extract and rebuild the Boot.img we need some tools. These are in the attached Boot-tools.zip file found in the first post. Extract the entire zip file into a tools directory in the top level of your working directory. Open your terminal and navigate to your working directory, then enter the following commands:
Code:
/tools/extract-kernel.pl boot.img
/tools/extract-ramdisk.pl boot.img
This will place a copy of the kernel and ramdisk in your working directory. Overwrite the kernel image with the kernel you would like to use. Then re-package everything as so:
Code:
mkbootfs boot.img-ramdisk | gzip > ramdisk-boot
mkbootimg --kernel boot.img-kernel --ramdisk ramdisk-boot --cmdline "no_console_suspend=1 console=null" -o newBoot.img --base 0x19200000
Click to expand...
Click to collapse
I have no problem with the first 3 commands:
extract-kernel.pl boot.img
extract-ramdisk.pl boot.img
mkbootfs boot.img-ramdisk | gzip > ramdisk-boot
But this last command just returns the mkbootimg syntax help blurb:
mkbootimg --kernel boot.img-kernel --ramdisk ramdisk-boot --cmdline "no_console_suspend=1 console=null" -o newBoot.img --base 0x19200000
it returns this:
usage: mkbootimg
--kernel <filename>
--ramdisk <filename>
[ --second <2ndbootloader-filename> ]
[ --cmdline <kernel-commandline> ]
[ --board <boardname> ]
-o|--output <filename>
I noticed that the --base option isn't included in the help, so I left out the "--base 0x19200000". This worked fine and created the newBoot.img file. Will this be safe to use?
Thanks in advance.

[Q] Kernel compiling

First off I'd like to say I'm no noob when it comes to the linux kernel, though this is my first time on android. I have attempted to compile my own kernel (defaults for now) for my thunderbolt.
Mostly followed
http://htcevohacks.com/htc-evo-hacks/how-to-build-your-own-htc-evo-4g-android-kernel/
Tools from here
http://forum.xda-developers.com/showthread.php?t=551711
Pulled the Thunderbolt sources and extracted
Ran
CROSS_COMPILE=~/android-sdk-linux_x86/android-ndk-r5b/toolchains/arm-eabi-4.4.0/prebuilt/linux-x86/bin/arm-eabi- make clean
CROSS_COMPILE=~/android-sdk-linux_x86/android-ndk-r5b/toolchains/arm-eabi-4.4.0/prebuilt/linux-x86/bin/arm-eabi- make mecha-lte_defconfig
CROSS_COMPILE=~/android-sdk-linux_x86/android-ndk-r5b/toolchains/arm-eabi-4.4.0/prebuilt/linux-x86/bin/arm-eabi- make -j3 ARCH=arm
no errors
make working folder next te kernel sources with tools and stock boot.img in it.
rm ./zImage
rm -rf ./boot.img-ramdisk
rm ./boot.img-ramdisk.cpio.gz
rm ./myBoot.img
rm -rf ./ramdisk-boot
cp ../kernel_htc-mecha/arch/arm/boot/zImage ./
./extract-kernel.pl boot.img
./extract-ramdisk.pl boot.img
rm boot.img-kernel
mv zImage boot.img-kernel
./mkbootfs boot.img-ramdisk | gzip > ramdisk-boot
./mkbootimg --kernel boot.img-kernel --ramdisk ramdisk-boot --cmdline "no_console_suspend=1 console=null" -o myBoot.img --base 0x19200000
and the resulting image built is myBoot.img, renamed to boot.img and installed through fastboot, hboot, or clockwork. My only issue with this is that my system refuses to boot with the kernel and stays at the splash screen. Not the boot animation even. Please tell me if I missed a step (I manually ran all of that checking for errors, all appeared to go fine, though it still won't boot.
Thanks in advance!
EDIT: Returning to any known working kernel (anyone else's or stock) works fine. I con still boot clockwork and hboot with my kernel)
kdb424 said:
./mkbootimg --kernel boot.img-kernel --ramdisk ramdisk-boot --cmdline "no_console_suspend=1 console=null" -o myBoot.img --base 0x19200000
Click to expand...
Click to collapse
change "--base 0x1920000" to "--base 0x05200000"
The offset is different for each device. I believe you are using the offset for the hero. The one that I gave you should be the one for the TB. That's the only obvious thing that I see, but I don't have a TB to test...

[Q]How to Unpack/Split Samsung boot.img ?

Maybe a noob question, but how do you guys split and repack SGS3 boot.img ?
The usual perl scripts don't seem to work with any S3 boot.img I came across (neither for the Galaxy Tab 7.7 boot.img's btw).
I keep getting this error :
Android Magic not found in boot.img. Giving Up.
Click to expand...
Click to collapse
Thanks for answering.
To unpack, you can do this:
Code:
abootimg -x boot.img && mkdir newramdisk && cd newramdisk && zcat ../initrd.img | cpio -i --no-absolute-filenames
Of course, that assumes you have abootimg installed. The above will split the zImage and the ramdisk from the boot.img and then proceed to extract the files from the ramdisk. Some ramdisks are not Gzip compressed so in that case use cat instead of zcat. Also: run that as root to make sure you don't mangle the files' permissions. I haven't tried repacking, though. ("find . -print | cpio -o -H newc | gzip > ../initrd.img" followed by "cd .. ; abootimg -u boot.img -r initrd.img" worked for my U8800pro, but I've had no need to try it with GS3 images.) I'd start by looking at the tools that come with the official Samsung source distribution and guides that tell you how to build a Samsung kernel.
Thanks a lot for this thorough answer
Trying this right now.
Couldn't find a specific Samsung kernel-related tutorial, though good idea to go take a look at Samsung's official kernel documentation.
qwerty12 said:
To unpack, you can do this:
Code:
abootimg -x boot.img && mkdir newramdisk && cd newramdisk && zcat ../initrd.img | cpio -i --no-absolute-filenames
Of course, that assumes you have abootimg installed. The above will split the zImage and the ramdisk from the boot.img and then proceed to extract the files from the ramdisk. Some ramdisks are not Gzip compressed so in that case use cat instead of zcat. Also: run that as root to make sure you don't mangle the files' permissions. I haven't tried repacking, though. ("find . -print | cpio -o -H newc | gzip > ../initrd.img" followed by "cd .. ; abootimg -u boot.img -r initrd.img" worked for my U8800pro, but I've had no need to try it with GS3 images.) I'd start by looking at the tools that come with the official Samsung source distribution and guides that tell you how to build a Samsung kernel.
Click to expand...
Click to collapse
Great!! Thanks for your information.
Here is what I use. Inside there are three binaries and two perl scripts,, copy the binaries into /usr/bin/ or you can add them in their own place and add that to the path. Then use this to help you use the files
Thanks for that too, ima try those scripts
Getting this error :
~$ perl unpack-bootimg.pl boot.img
could not find any embeded ramdisk images. Are you sure this is a full boot image?
Click to expand...
Click to collapse
Apparently, from what I have been reading, Samsung uses a different type of kernels than other manufacturers.
Although there's a huge number of custom samsung kernels out there. There might be a way^^
Here is the kernel i'm trying to edit if anyone wanna give a try at unpacking it for me.
That is true up until the S3 boot.img/kernel They have always used a zImage. Now Google has forced them to move over to EXT4 system and change the kernel format.
That file is only 2.88 mb's that is way too small to be a full kernel. Even for stock with no tweaks. That's why you are having an error.
This is the original boot.img from the CM9 for Galaxy Tab 7.7 update.zip
However i get the same error when trying to unpack S3 stock boot.img or even CM10 boot.img, although when i try the same scripts on my Xperia Play's kernels they unpack properly.
Good thing if Google made Samsung do kernels like others
Hi,
Did you manage to unpack/repack the SGS3 boot image? I'm trying to modify init.rc in an international SGS3 (i9300).
I've managed to unpack the boot image (from /dev/block/mmcblk0p5) as per qwerty12's command but how do I repack it?
Thanks!

How do I get the zImage ( the original kernel) from my Samsung Galaxy Tab S?

I am trying to install Linux on my Samsung Galaxy Tab S using the directions described in How to run Debian or Ubuntu GNU/Linux on your Android (I am not yet allowed to specify the URL but you might google it). However I cannot find the zImage (which is the original kernel in the tablet) to be used in the command
Code:
# mkbootimg --base 0x00200000 --kernel zImage --ramdisk initramfs.cpio.gz -o my-boot.img
What dælen can I do to find and extract it?
Thanks in advance.
CMJager said:
I am trying to install Linux on my Samsung Galaxy Tab S using the directions described in How to run Debian or Ubuntu GNU/Linux on your Android (I am not yet allowed to specify the URL but you might google it). However I cannot find the zImage (which is the original kernel in the tablet) to be used in the command
Code:
# mkbootimg --base 0x00200000 --kernel zImage --ramdisk initramfs.cpio.gz -o my-boot.img
What dælen can I do to find and extract it?
Thanks in advance.
Click to expand...
Click to collapse
You need to unpack the boot image to separate the kernel(zImage) and ramdisk. There are various tools about to do this.
ashyx said:
You need to unpack the boot image to separate the kernel(zImage) and ramdisk. There are various tools about to do this.
Click to expand...
Click to collapse
So where (or how) do i find the boot image?
CMJager said:
So where (or how) do i find the boot image?
Click to expand...
Click to collapse
The boot.img can either be found in the stock firmware or pulled frm the device or use a custom kernel posted in development.
Found it:
Code:
# ls -l /dev/block/platform/dw_mmc.0/by-name/BOOT
lrwxrwxrwx root root 2015-12-27 19:43 BOOT -> /dev/block/mmcblk0p9
Put the contents in a file:
Code:
# cat /dev/block/mmcblk0p9 /sdcard/boot.img
And at my linux box extracted the contents:
Code:
$ adb pull /storage/sdcard0/boot.img
$ unpackbootimg -i boot.img
BOARD_KERNEL_CMDLINE
BOARD_KERNEL_BASE 10000000
BOARD_PAGE_SIZE 2048
$
Then I also found a more robust mkbootimg-command:
Code:
$ mkbootimg --kernel boot.img-zImage --ramdisk boot.img-ramdisk.gz -o my-boot.img --base $(cat boot.img-base)

[Q] Help with boot image unpack/repack please.

I've read several tutorials both here and elsewhere. I've got a few different methods down using mkbootimg, unpackbootimg, abootimg, the perl scripts, and I have gzip/gunzip/cpio commands down. Splitting and repacking go without errors.
However, I cannot, to save my life, whether I modify something or not, get a boot image that I split and repacked to boot on my device.
I have a G4 H811 the T-Mobile variant. I have been playing with boot images and kernels included with ROMs and a custom kernel, even dd'd the working boot partition from my device. I simply cannot repack something that boots.
Here's an example approach, here I'm using binaries from a custom kernel zip mkbootimg, unpackbootimg, and the busybox included in the zip. I'm doing exactly what the kernel maintainer does to split the image, replace zImage and repack, only manually in a terminal and modifying the ramdisk leaving everything else alone.
mkdir boot
cd boot/
cat /dev/block/bootdevice/by-name/boot >boot.img
chmod 755 busybox
chmod 755 mkbootimg
chmod 755 unpackbootimg
./unpackbootimg -i boot.img
mkdir initrd
cd initrd
cat ../boot.img-ramdisk.gz | ../busybox gunzip | ../busybox cpio -vid
vi init.rc(made changes)
../busybox find . | ../busybox cpio -o -H newc | ../busybox gzip >../myinitrd.img
cd ..
./mkbootimg --kernel boot.img-zImage --ramdisk myinitrd.img --cmdline "$(cat boot.img-cmdline)" --base 0x$(cat boot.img-base) --pagesize 4096 --ramdisk_offset $(cat boot.img-ramdiskoffset) --tags_offset $(cat boot.img-tagsoffset) --output myboot.img
./busybox dd if=myboot.img of=/dev/block/bootdevice/by-name/boot
I end up with with a 26.8MB myboot.img and a bootloop
Here's a really good example, I changed absolutely nothing. After unpacking and repacking I end up with two different size boot images. What am I missing here?

Categories

Resources