[Q] Heimdall 1.4 on GSIII JB or ICS - General Questions and Answers

[Q] I am trying to do some kernel mods on my GSIII running 4.1.4. or later. I am used to using an older version of heimdall and an older version of Android, and simply flashing the zImage into the --kernel partition. I know the new version of heimdall uses the phones names for the partitions, and the partition has changed from KERNEL to something else, but I can't really figure out what.
The partitions I see are BOOTLOADER, TZSW, PIT, MD5HDR, BOTA0, BOTA1, EFS, PARAM, BOOT, RECOVERY, RADIO, CACHE, SYSTEM, HIDDEN, OTA, and USERDATA.
Should I flash the zImage to one of these partitions, or do I have to create a zip file with the zImage, modules, and other stuff to make an image loadable with a rom manager?

Related

[Q] Boot Process

I've looked in quite a few threads, including the custom mix ROMs. What I want to know is who has knowledge of how this thing boots? I've noticed on the 2 droids I've messed with you upgrade them with an update.zip and basically an empty file on the SD card.
I'm guessing the update.zip contains a squashfs or something similar along with a kernel, but I don't know for sure. Who can explain exactly what happens on boot, what devices it looks for filesystems/loop filesystems on etc?
muqali said:
I've looked in quite a few threads, including the custom mix ROMs. What I want to know is who has knowledge of how this thing boots? I've noticed on the 2 droids I've messed with you upgrade them with an update.zip and basically an empty file on the SD card.
I'm guessing the update.zip contains a squashfs or something similar along with a kernel, but I don't know for sure. Who can explain exactly what happens on boot, what devices it looks for filesystems/loop filesystems on etc?
Click to expand...
Click to collapse
The best way to learn about this stuff is by tearing down existing .zip flashers and reading about how boot.img files are built and trying to build your own.
The boot process is controlled by the bootloader (the thing that displays the Viewsonic birds logo and decides whether you are trying to boot into recovery, APX mode, or a standard boot).
The ZIP files that you flash actually run a script that writes an .IMG file contents to one or more partitions.
Most ROM flashers have two images they flash - a boot.img and a system.img. The system.img is a filesystem image of the system partition. The boot.img consists of two parts - a kernel and a ramdisk image (well, and a boot header). The kernel is the Linux kernel that's been compiled to provide all the core system functionality for Android. The ramdisk image (which is a GZIPed CPIO file) contains the init.rc file that does all the initialization, mounting of the main filesystem images and so on.
Once everything is mounted and configured, the Android ROM itself boots up.
I recommend reading this page for more info:
http://android-dls.com/wiki/index.php?title=HOWTO:_Unpack,_Edit,_and_Re-Pack_Boot_Images
Hope that helps!
That's more or less what I wanted, but for our device do you know the exact boot order? Mtd partitions then SD sd2 and maybe a USB disk? I'd really like to put a custom Roman on the sd2 and leave the rom factory.
muqali said:
That's more or less what I wanted, but for our device do you know the exact boot order? Mtd partitions then SD sd2 and maybe a USB disk? I'd really like to put a custom Roman on the sd2 and leave the rom factory.
Click to expand...
Click to collapse
I *think* (could be wrong) that both the externalSD (/sdcard2) and the USBDISK (/usbdisk) are mounted dynamically, via vold.
At least that's the way I understood it...
There's a thread here in this forum, about (dual) booting Ubuntu, that does something along the lines of what you're asking about...
Jim
rcgabriel said:
The best way to learn about this stuff is by tearing down existing .zip flashers and reading about how boot.img files are built and trying to build your own.
The boot process is controlled by the bootloader (the thing that displays the Viewsonic birds logo and decides whether you are trying to boot into recovery, APX mode, or a standard boot).
The ZIP files that you flash actually run a script that writes an .IMG file contents to one or more partitions.
Most ROM flashers have two images they flash - a boot.img and a system.img. The system.img is a filesystem image of the system partition. The boot.img consists of two parts - a kernel and a ramdisk image (well, and a boot header). The kernel is the Linux kernel that's been compiled to provide all the core system functionality for Android. The ramdisk image (which is a GZIPed CPIO file) contains the init.rc file that does all the initialization, mounting of the main filesystem images and so on.
Once everything is mounted and configured, the Android ROM itself boots up.
I recommend reading this page for more info:
http://android-dls.com/wiki/index.php?title=HOWTO:_Unpack,_Edit,_and_Re-Pack_Boot_Images
Hope that helps!
Click to expand...
Click to collapse
rcgabriel,
When you do an nvflash (ala bekit's), does the contents of bootloader.bin end up getting stored permanently on the Gtab's internal SDcard? And, whenever the Gtab is booted, the code in that bootloader is the first code that runs, deciding, as you said, whether or not to do a recovery or execute the boot.img?
Thanks,
Jim
Isn't the bootloader on one of the MTD partitions and not the sdcard? What I'm having the hardest time wrapping my head around is how this system boots in comparison to an x86 Debian 5.0 system.
The basic picture I have is that there is the rom/flash portion of the boot process and then the kernel and real filesystem are loaded and mounted. But using these custom roms, is it changing the flash and bootloader or just the kernel and OS? Meaning where exactly is the first thing the CPU hits to boot? Flash MTD partitions for the bootloader. Then is the kernel on the mtd partitions or on some separate partition on sdcard.
Since you can basically stick 2 files on an external uSD and send it into upgrade mode, can't you customize the filesystem contained in a zip and then stick it in and have a custom system with whatever you wanted added or removed?

[Q] What's in the firmware blob?

I'm currently looking at the latest firmware update zip file (WW_epad_user_10_4_4_18_UpdateLauncher.zip), hoping it contains driver binaries etc. that could be reused in a custom rom (a script that downloads the latest official firmware and extracts needed bits is legal -- just distributing the drivers and all might not be).
The content is another zip file, that in turn contains a META-INF directory with information and an updater, and one huge file called "blob" that probably contains all we care about.
Has anyone investigated that "blob" file yet?
Unfortunately it doesn't seem to be an ext4 image like what you'd flash with "fastboot flash system"...
If nobody else has done it, I'll look into this more myself, but obviously if it's already been done, no need to start over.
The blob can be unpacked using BlobTools (https://github.com/AndroidRoot/BlobTools). It contains partition images:
PT ... Tegra Partition Table
EBT ... bootloader
SOS ... recovery kernel image
LNX ... Android kernel image
APP ... /system partition
The kernel images can again be split into the kernel itself and the initramfs image, and APP is an ext4 image.

[Q] Is it safe to flash this?

Hi there XDA! I have a really big question/problem. I want to theme Clockworkmod Recovery with custom pictures/icons/themes and such. So far I installed Ubuntu VM, decompiled the Recovery Image into Kernel and Ramdisk, replaced the pre-loaded icons with my custom icons to the ramdisk. Finally, I recompiled it into a new recovery image!
However, since this program is designed for device boot images, Im still curious, can this be used for recovery images? I haven't editing anything within the kernel, just opened the ramdisk, replaced the /res/images with my own and did abootimg --create newcwm.img.
EDIT : All I know is that in the boot.cfg the boot parameter size has to be exact fit or hardbrick.
so I have attached the 2 files that shows the recovery image data/config of both of them.
Don't worry its just 2 txt files. Inside the other archive has the flash ready images. BOTH OF THEM. Also includes the already decompiled ramdisk and kernel to take a look at. In addition the bootimg.cfg is also in. It has everything you need to know
So, heres the question. If I decide to flash it to mmcblk0p21 which is the verified recovery partition for the GT-i9505, (Info on the partition informations/mount points below
http://forum.xda-developers.com/showthread.php?t=2342841
Then, hopefuly the flash to the recovery partition shouldn't hardbrick my device. Am I right? Or missing something.
I will attach both my image and the cwm recovery Image I decompiled. Please if you can tell me if theres something that has to be fixed to prevent me getting a $700 paperweight.
Note: The layout might be confusing inside the Archive, just please bear with me and just take your time. I can wait
PRESS ME TO DOWNLOAD

[How To] Load ramdisk files not packed with the kernel, and modifying for F2FS cache

When I first installed KatKiss 6, I had to unpack and repack kernels in order to try out different combinations of zImage, ramdisk files, and modules. Many people may not want to go through the trouble, but there is an easier way to do that.
So, why do we want to try different combinations of zImage, ramdisk files, and modules? To see if performance is better could be an incentive, but the main reason is that sometimes a different combination of zImage, ramdisk files, and modules may fix things that are not working properly. For example, with cm kernel, GPS can't get good signals in the PAC ROM 5.1.1 I compiled. The problem is solved by using ramdisk of Cyanogenmod, and zImage and modules of Grimlock kernel 5.1.1.
Actually, @_that mentioned the two ways that can accomplish this back in January, but I went with the more complicated one because I had little knowledge of programming. I finally figured out how to do that the easier way recently.
The downside is that you must use a zImage supporting preinit in order to load ramdisk files that are not packed in the kernel. that kernel and Grimlock kernel both support preinit.
If you don't use kexecboot, zImage will always be from the kernel you installed for internal ROM. If it's a ROM2SD installation, the ramdisk files will be from the kernel you choose during ROM2SD installation. The modules are usually copied from internal during ROM2SD installation.
If you want to change zImage, then you have to flash a different kernel to /boot partition. If you want to change ramdisk file for ROM2SD installation, then you need to first delete the boot/ folder on the /system partition of the micro SD card. Then you can flash the kernel containing the ramdisk files between rom2sd1.zip and rom2sd2.zip following the method by @_that. Alternatively, you can also use the ones in this post. The differences are that the updated scripts from ZOMBi-POP will copy modules from internal /system, instead of using the ones packed by @_that.
If you want to use that kernel with KatKiss 6, you have to load ramdisk files from KatKernel to use with zImage of that kernel. To load different ramdisk files for a ROM installed on internal storage, you need to revise '20detect-microsd' file in internal /system/boot/preinit.d/ , which will copy ramdisk files from internal /system/boot/ramdisk to /. You can download the one I used, which is attached. The following lines are added to the original file.
Code:
else
# copy ramdisk files from internal /system/boot/ramdisk to /
$BB cp -a /system/boot/ramdisk/* / || echo "failed to copy ramdisk files from /system/boot/ramdisk"
You certainly need to extract the ramdisk files to internal /system/boot/ramdisk/ . To do that, you can use the attached extract ramdisk to internal system.zip. Just replace the 'boot.blob' inside with the one you'd like to use. Basically, it's the rom2sd2.zip from @_that, but without the scripts doing revision for ROM2SD.
At least for some ROMs, you can see performance gain with F2FS /cache. If you want to try to see if F2FS /cache works better for you. You can convert /cache to F2FS with TWRP 2.8.+. Just go to Wipe->Advanced Wipe, select Cache, and Change file system to F2FS. You also need to revise 'fstab.cardhu' in /system/boot/ramdisk/ for all the ROMs you are running. Just replacing the line for /cache with the following one
Code:
/dev/block/mmcblk0p2 /cache f2fs noatime,nosuid,nodev,errors=panic wait,encryptable=footer
Alternatively, you can use attached extract ramdisk to internal system f2fs cache .zip or rom2sd2 f2fs cache.zip when extracting the ramdisk files to internal or ROM2SD /system. The following line is added to 'extract-ramdisk.sh' so that 'fstab.cardhu' will be revised during extraction.
Code:
sed -i '/mmcblk0p2/{;s/ext4/f2fs/;s/barrier=.,//;s/nodiratime,//;s/noauto_da_alloc,//;s/nomblk_io_submit,//;}' $f
I am able to use different zImages for internal and external ROMs and choose which one to boot with kexecboot. If someone is interested in how to set that up, please just ask in the comments.
There is a 'boot.blob' (I beleive it's for PAC511) in 'extract ramdisk to internal system f2fs cache .zip' You need to replace it with the one you'd like to use, or delete it and flash your kernel before flashing this zip.

Install kernel on galaxy ace 2?

Hi, I'm not sure if I have to flash the kernel partition with the kernel zImage or install the kernel in order to apply it? I am going to recompile the kernel with the swap option enabled, so it's basically a small change. Is there anything that I should know before I do this? How do I flash this? Is odin allright? BTW I have seen that the A2N kernel has a zip rom which is being installed from the cwm recovery. It has the kernel zImage placed as boot.img, in the root of the zip. It's strage to me, because I don't have boot.img in the partition mounted on / on the stock kernel, so where does it go? Or is the modified kernel being swapped with the stock one during boot-time?
zielonykid1234 said:
Hi, I'm not sure if I have to flash the kernel partition with the kernel zImage or install the kernel in order to apply it? I am going to recompile the kernel with the swap option enabled, so it's basically a small change. Is there anything that I should know before I do this? How do I flash this? Is odin allright? BTW I have seen that the A2N kernel has a zip rom which is being installed from the cwm recovery. It has the kernel zImage placed as boot.img, in the root of the zip. It's strage to me, because I don't have boot.img in the partition mounted on / on the stock kernel, so where does it go? Or is the modified kernel being swapped with the stock one during boot-time?
Click to expand...
Click to collapse
Convert your kernel into an Odin flashable zip using 7zip with its highest level of compression in tar format, make sure the file is converted into a .tar file or a .tar.md5 then flash that file via Odin in the AP or PDA slot. You might need to use a modified version of Odin.

Categories

Resources