This tool i came across when i was working on the Ubuntu for Eris.
Code:
It copies your bootimage to a temp file so it has a space to work in
It then unpack the boot.img
Replaces the zImage you included ith the original one
Repacks the boot.img
Flashes the new boot.img with your kernel in it.
All you need to do is rename your kernel zimage, and place it in the kernel folder and re-sign it. MUCH easier than fastboot or baking up a custom boot.img each time you have to swap the kernel.
All thanks to Koush, i just found the thing
Related
Im trying to add some ringtones and apps into one of my favorite roms so things will be a little easier when Im testing out other roms...I think the new zip file I make though needs to be signed. Can anyone point me into the right direction??
Amon_RA said:
You can get any custom ROM working on your Rogers Magic and basically on every HTC branded Magic around. If you like to "port" a custom Google-branded ROM to a HTC-branded ROM follow these steps :
- I assume that you have basic Linux knowledge and that you know how to set up your own environment and tools, unpack gz files and cpio them etc...
- Download these tools. They contain the JesusFreke's SignApp, William Enck's splitboot using my recompiled mkbootimg-H binary (including the HTC branded offsets), and a repack pearl script.
Now the actually work :
1. Get the boot.img and recovery.img from your original HTC branded Magic (fastboot my recovery image and use nandroid for this).
2. unpack the boot.img and recovery.img using unpack-H.pl.
3. move both kernels somewhere save, you'll need them later.
4. Download the google branded custom ROM you want to port, most of the custom ROMs come in the form of a update.zip file.
5. Extract the boot.img and recovery.img (if there is one) from the update.zip.
6. unpack the boot.img and recovery.img (same as step 2).
7. replace both kernels with the ones you saved previously in step 3.
8. repack boot boot.img and recovery.img using repack-H.pl
9. copy both boot.img and recovery.img in the update.zip package making sure you overwrite the existing ones inside with the new ones.
10. Sign the update.zip file with SignApp (see readme inside rar).
11. Copy the update.zip file to your SDcard.
12. fastboot my recovery image and choose data wipe and then update.
13. reboot
Good luck
Click to expand...
Click to collapse
This is where I get confused at. I read this "Usage:
java -jar signapk.jar testkey.x509.pem testkey.pk8 <update.zip> <update_signed.zip>" But I dont know how to do that...Im using OSX right now is there any way to do it or do I need linux?
Can anyone give me some advice??
Here is everything you need to know:
http://forum.xda-developers.com/showthread.php?t=473580
(A search would have found you the answer faster than I did...)
betelgeuse74 said:
Here is everything you need to know:
http://forum.xda-developers.com/showthread.php?t=473580
(A search would have found you the answer faster than I did...)
Click to expand...
Click to collapse
Agreed
But at least he made the effort unlike some!
Sorry for the totally newbie question (for both android and linux).
I've rom images from legend ruu: android-info.txt, boot.img, hboot_legend_7227_1.01.0000_101108.nb0, radio.img, rcdata.img, recovery.img, splash1.nb0, system.img, userdata.img.
Is there any way to mount them (especially boot.img, recovery.img and system.img) on a linux box using a loop device?
The files boot.img and recovery.img are starting with magic word "ANDROID!°¨#", while I cannot recognize any string in system.img. What kind of file systems are these?
Thank you in advance,
TiceRex
system.img should just be a yaffs image and can be mounted loopback if you have the yaffs drivers installed. boot.img and recovery.img are ramdisk images which consist of a kernel and a cpio archive (containing the files for the root filesystem) bundled together in a package. HBOOT loads the kernel first, then unzips the cpio archive into a newly created ramdisk. Once all is loaded, execution is passed off to the kernel which has a nice ramdisk full of the init files needed for the remainder of the boot process. system and data images are then mounted to mountpoints in the ramdisk.
To extract and manipulate boot.img and recovery.img, see this thread:
http://forum.xda-developers.com/showthread.php?t=551711
Thank you very much.
Seeing into dsixda's rom kitchen scripts I was able to extract the boot.img and recovery.img files (and found the kernel and initrd).
I will look for the yaffs drivers.
Regards, TiceRex
Hi,
I've compiled a modified version of the 2.6.36.3 kernel (downloaded from the git repository) to include a USB Network Adapter driver (AX88772A) into a zImage. But I don't know how to flash the zImage onto my A500. When I run "fastboot flash zimage zImage" it always returns < waiting for device >. But I am able to run adb to pull and push files to the tablet.
How can I update the kernel so that it can detect my USB -> Ethernet adapter (chipset AX88772A)? Any ideas? Thanks!
You have to put it in the boot.img, then you can dd it or create a zip update, like custom roms!
You can ask for more info to a kernel guy like richardtrip or thor202ro!
Try to open one of their zip update to see how it works!
you should use android's mkbootimg
like
mkbootimg --ramdisk initrd.gz --kernel zImage -o boot.img
then you can dd it to boot partition (/dev/mmcblk0p2) and run itsmagic. And do not flash both p1 and p2 at the same time - if you flash two unbootable images or forget to update the checksum, you'll have to pm sc2k to recover the device via nvflash.
Moving to General.
PS: Every Q? thread should be posted in General.
MyMinds_Kernel_Swap
===================
Based on AnyKernel, but pretty much rebuilt in every way so that it will actually work. So, many thanks to Koush for the idea.
The Idea and What It Does...
=======================
Some but not all of this script has been snippets here and there from ArchiKitchen and DSIXDA Kitchen.
This has allowed me to formulate a zip as such without the need to technically build from scratch saving me LOADS OF HOURS.
It currently uses my static compiled mkbootimg, unmkbootimg, and mkbootfs binaries to allow editing, and rebuilding of the boot.img.
Some serious modifications were made to get this to work successfully with MUCH DEBUGGING. If you change something and it breaks another function then that is on you!
# IT IS CURRENTLY STABLE!
1. It will pull your current boot.img using dd.
2. It will search for the Android! header in the boot.img and remove the unnecessary junk before it if needed to.
3. It will split the boot.img in to the kernel and ramdisk.
4. It will unpack the contents inside the ramdisk.
5. It will modify the default.prop file giving you insecure ADB. If you already have it then this will not affect you.
6. It will modify the init.rc file to give support for init.d. If you already have it then this will not affect you.
7. It will write to sysinit and install-recovery.sh for the completion of init.d support. If already done, then this will not affect you.
8. It will make the init.d folder under /system/etc on your device with required permissions.
9. It will place an init.d script to test to see if init.d is fully working. If it works, you will find a file called, HAS_INIT, located in the /dev directory of your device.
10. It will swap out the original kernel with a new prebuilt kernel upon rebuilding the new boot.img
11. It will repack you a new ramdisk using mkbootfs to be applied to your new boot.img upon rebuilding it.
12. It will remove your old modules and push your new modules that came with your new prebuilt kernel.
13. It will write your new boot.img to your boot partition using dd.
14. Hopefully, more to come!
MAKE SURE YOU CHANGE...
=======================
"$BOOT_PARTITION" ACCORDING TO YOUR DEVICE BEFORE USING THIS SCRIPT!!!!!!
How to use it...
==============
1. Place your prebuilt kernel in the prebuilt folder and insure it is named, zImage.
2. Place kernel modules in the modules folder.
3. Zip, and flash in TWRP recovery.
If you have any suggestions then let me know. My ears are open to them.
https://github.com/ModdingMyMind/MyMinds_Kernel_Swap
Sent from my C525c using Tapatalk
I downloaded and compiled code that is supposed to communicate with the Android OS. The instructions stated to put the .img file on a different partition from the Android OS. How can I accomplish this please? I have SM-N900P. I compiled Samsung Source, and AOSP. I also have a copy of the stock firmware, and used unmkbootimg to extract the ramdisk. I do not have access to fastboot. Can I put my .img file in the ramdisk with zImage and dt.img and flash with Odin? I think I tried this once and it failed towards the end. Can I just put my desired .img file in the ramdisk and flash with Odin? Do I have to add the boot and dt.img every time I flash?