A2sd installation
First and foremost you need to either edit the boot.img you have or grab one from a rom that has it enabled already.
For the purpose of editing the boot.img>
unpack , there will be two new files kernel + ramdisk
then unpack ramdisk to find init.rc, these are the edits needed.
Below this “setprop net.tcp.buffersize.wimax4096,87380,110208,4096,16384,110208”
add this
Code:
start a2sd
on property:cm.filesystem.ready=1
class_start default
below this “install-recovery.sh”
add this
Code:
service a2sd /system/bin/logwrapper /system/bin/sh /system/bin/a2sd
disabled
oneshot
then repack.
Download the 2.7 update one, unpack and copy the system folder to the system folder of your rom.
Next is the update script, you need to add this
# a2sd
set_perm 0 0 0777 SYSTEM:bin/a2sd
set_perm 0 0 0777 SYSTEM:bin/fixa2sd
set_perm 0 0 0777 SYSTEM:bin/boota2sd
set_perm 0 0 0777 SYSTEM:bin/chka2sd
set_perm 0 0 0777 SYSTEM:bin/setupa2sd
set_perm 0 0 0777 SYSTEM:bin/starta2sd
set_perm 0 0 0777 SYSTEM:bin/bash
set_perm 0 0 0777 SYSTEM:bin/e2fsck
set_perm 0 0 0777 SYSTEM:bin/busybox.a2sd
set_perm 0 0 0777 SYSTEM:bin/apps2sd
set_perm 0 0 0777 SYSTEM:xbin/a2sd
set_perm 0 0 0777 SYSTEM:xbin/apps2sd
set_perm 0 0 0777 SYSTEM:etc/init.d/04apps2sd
set_perm 0 0 0777 SYSTEM:xbin/e2fsck
set_perm 0 0 0777 SYSTEM:bin/zipalign
set_perm 0 0 0777 SYSTEM:bin/aligna2sd
If I missed anything please let me know and I will update it ASAP
Thanks again
Your welcome, for as many request as I had to post info on this you where the only on to reply, LOL....
Hope this helps everyone...
I just don't think that it's release was very what's the word i'm looking for?
are you using avabox (found here ) to decompile your boot.img
I'm using a Perl script caleld split_bootimg.pl to separate the kernel and the ramdisk from the boot.img. The modifications required to get A2SD working on a rom are in the ramdisk portion of boot.img.
thatguythatdid said:
I just don't think that it's release was very what's the word i'm looking for?
are you using avabox (found here ) to decompile your boot.img
Click to expand...
Click to collapse
Well I just learned something and I hope that it helps someone. If your using avabox to split a boot.img into the kernel and ramdisk the first time u use it. Run the activeperl exe. then go to all programs and run the activeperl program and give it a sec to do it's things.
Then cd to the the boot sripts folder using command prompt and type
Code:
perl split_bootimg.pl boot.img
that will split your boot img now to figure out how to read it?
never mind I used 7zip to extract it then extract the next folder now i can see it in english
How do I repackage it?
See, I run Ubuntu Linux. The procedures are different for me.
To repackage, I run a program called mkbootimg (it's a linux binary...there may be an equivalent one in Windows). That creates a new boot image.
But, first, you have to gzip your ramdisk again. Once you do that, I run the following command:
mkbootimg --kernel <kernel segment of boot.img> --ramdisk <newly compressed ramdisk> --cmdline "no_console_suspend=1 console=null" -o <name of new boot image> --base 0x19200000
For me:
./mkbootimg --kernel boot.img-kernel --ramdisk newramdisk.gz --cmdline "no_console_suspend=1 console=null" -o newboot.img --base 0x19200000
boot.img-kernel is the kernel segment of the boot.img I separated.
newramdisk.gz is a gzip file containing the new ramdisk I modified
newboot.img is the image file I'm creating that has the old kernel and new ramdisk.
thatguythatdid said:
Well I just learned something and I hope that it helps someone. If your using avabox to split a boot.img into the kernel and ramdisk the first time u use it. Run the activeperl exe. then go to all programs and run the activeperl program and give it a sec to do it's things.
Then cd to the the boot sripts folder using command prompt and type
Code:
perl split_bootimg.pl boot.img
that will split your boot img now to figure out how to read it?
never mind I used 7zip to extract it then extract the next folder now i can see it in english
How do I repackage it?
Click to expand...
Click to collapse
I tried doing this to a HTC Boot.img and it didn't work, it would just never boot up.
Could there be something im doing wrong? Im using the perl scripts on a ubuntu box.
The four parameters are vital, especially the base address.
If the base address is wrong, it won't boot.
If the ramdisk isn't ran through cpio first, then gzipped, then it won't boot (or at least I don't think it will)
There are also other factors...but the most common is a wrong base address. The one in the example is for the Sprint Hero. Evo is different...so is Eris. Nexus One is the same as the Evo, but still different from our phones. Not sure about the rest since I can't seem to find base addresses for them.
t2noob said:
I tried doing this to a HTC Boot.img and it didn't work, it would just never boot up.
Could there be something im doing wrong? Im using the perl scripts on a ubuntu box.
Click to expand...
Click to collapse
I've unpacked and saw: 'The fu** ... is already there.'
ATM I try to build up a2sd for the desire-sense-2.2 ROM.
But ... when I say with the ... uh, what was it?
[A2SD] Darktremor Apps2SD 2.7.5 Preview Fix 3 Test 2 (07-07-2010)
This one.
When I now say: a2sd check
It says following:
[X] Ext partition found, but not mounted.
Your rom may not be setup to run A2SD.
Check with your rom developer if the boot image
is programmed to run A2SD.
Where I stucked? Maybe other suggestions for A2SD?
DarkMio said:
I've unpacked and saw: 'The fu** ... is already there.'
ATM I try to build up a2sd for the desire-sense-2.2 ROM.
But ... when I say with the ... uh, what was it?
[A2SD] Darktremor Apps2SD 2.7.5 Preview Fix 3 Test 2 (07-07-2010)
This one.
When I now say: a2sd check
It says following:
[X] Ext partition found, but not mounted.
Your rom may not be setup to run A2SD.
Check with your rom developer if the boot image
is programmed to run A2SD.
Where I stucked? Maybe other suggestions for A2SD?
Click to expand...
Click to collapse
That means that the init.rc in the ramdisk isn't patched or for some reason it isn't executing at boot.
So I dualbooted with ubuntu 10.04 good read.
so I'm having problems with cpio the ramdisk. I used split_bootimg.pl to split the boot.img of darches boot.img and then again on the tmo mytouch 32b froyo boot.img. I used the mkbootimg to combine the kernel and the ramdisk and flashed it to my phone that worked. Then I wanted to change the r.o secure to 0 so I unzipped the ramdisk changed it and then re-cpio using this command
Code:
find . | cpio -o -H newc | gzip > ../newramdisk.cpio.gz
and then I zipped it and ran the mkbootimg and flashed that to my phone. But it didn't work
this is what i also changed in the default prop
Code:
ro.secure=0
ro.allow.mock.location=0
ro.debuggable=0
persist.service.adb.enable=1
any ideas what I'm doing wrong?
I'm running ubuntu 10.04 64bit
does mkbootfs recpio it?
Related
Disclaimer: Do only use this information if you know what you're doing!
PATH=$PATH:/home/markus/android/sdk/platform-tools
Get kernel from phone:
adb shell
su
dd if=/dev/block/mmcblk0p8 of=/sdcard/external_sd/stockboot.img
Exit adb shell
adb pull /sdcard/external_sd/stockboot.img
Separate the zImage from the ramdisk (see below for abootimg):
abootimg -x stockboot.img
unpacks the archive and copies contents to working directory:
gunzip -c initrd.img | cpio -i
Do your edits, e.g. default.prop, add:
debug.performance.tuning=1
video.accelerate.hw=1
windowsmgr.max_events_per_sec=150
--> move all files to new folder, cd into this folder:
repacks files from working directory into an archive (MAKE SURE NO OTHER FILES ARE IN THE WORKING DIRECTORY!!)
find . | cpio -o -H newc | gzip > ../myinitrd.img
New boot.img:
./mkbootimg --kernel zImage --ramdisk myinitrd.img --cmdline "console=null androidboot.hardware=qcom androidboot.emmc=true hw=6" -o myBuiltBoot.img --base 0x00400000 --pagesize 4096
You can also use abootimg to create your new .img file, it has an easier syntax as it exports the commandline to a .cfg file and you can use that while creating the package.
Push your new kernel.img to the phone:
adb push myBuiltBoot.img /sdcard/external_sd/myBuiltBoot.img
Write kernel to kernel-partition in phone:
adb shell
su
dd if=/sdcard/external_sd/myBuiltBoot.img of=/dev/block/mmcblk0p8
adb reboot
< pray >
Sources:
http://forums.androidcentral.com/lg...ense-back-up-your-phone-without-nandroid.html
http://forum.xda-developers.com/showthread.php?t=1227269
http://forum.xda-developers.com/showthread.php?t=1292557
Also quite handy: http://packages.debian.org/de/sid/abootimg
wouldnt just editing build.prop in /system without touching kernel do the same job? ^_^
Yep. I just wanted to describe the whole process of extracting and packing the needed files. The edit was just an example. And in fact, i made a typo, it's called default.prop.
Hi,
My Question is
How do i extract initramfs from a Kernel.bin file ?
the Galaxy S Advance uses Kernel.bin instead of a boot.img
I tried dsixda's kitchen, but it couldn't recognize the file format
I just want to replace a certain binary in the /sbin folder and repack the kernel.
Edit:this phone is kinda different,
it seems that the recovery and kernel partitions are the same
Figured it out
The zImage created after compilation process is actually the same, a kernel binary aka kernel.bin
I just had to rename the zImage to kernel.bin and add md5sum to the kernel.bin and pack it into a tarball to make it flashable via odin.
that can be done like this
Code:
md5sum -t kernel.bin >> kernel.bin
mv kernel.bin kernel.bin.md5
tar -cvf mykernel.tar kernel.bin.md5
As for packing the ramdisk into the kernel.bin
that can be done before compiling by editing the .config file or any config you gonna use
just have to add the path to the ramdisk at CONFIG_INITRAMFS_SOURCE="path to your ramdisk"
There's also a script to unpack the ramdisk from the kernel.bin, i'll attach it here
usage:
place the script at the same location of the kernel.bin
Code:
chmod +x unpack-initramfs.sh
bash unpack-initramfs.sh kernel.bin.md5
OR
/bin/sh unpack-initramfs.sh kernel.bin.md5
Hope this helped Others who were facing the same problem
how to repack it?
U all must be thinking that there are a hell lot of guides for this than what this guide is here for?
And the answer is that i have used almost all guides to extract our kernel for latest builds like cm7,cm9 etc but after using the guides present here on xda , after the last step i didn't get any directories instead got two files name ramdisk.gz and recovery.cpio now this guide will tell what to do next!!!
First of all download the perl scripts from
HERE
Now after download do this:
1. Create two directories and sub directories:
$ mkdir -p old-boot/ramdisk
$ mkdir new-boot
2. Copy the zImage file which ye have made to the "new-boot"
3. Put your old directory boot.img to the "old-boot"
4. Extract the directory bootimgutils.zip to "old-boot"
5. Split boot.img with the command:
$ cd old-boot
$ ./boot.img split_bootimg.pl
or
$ perl split_bootimg.pl boot.img
there will be an appearance of more or less like this (depending on the type of your device):
Page size: 2048 (0x00000800)
Kernel size: 1388548 (0x00153004)
Ramdisk size: 141 518 (0x000228ce)
Second size: 0 (0x00000000)
Board name:
Command line: no_console_suspend = 1
Writing boot.img-kernel ... complete.
Writing boot.img-ramdisk.gz ... complete.
of the split will produce two files, namely boot.img-kernel and boot.img-ramdisk.gz
boot.img-kernel = kernel/zImage
boot.img-ramdisk = ramdisk
6. Now to edit the ramdisk then unpack the boot-img-ramdisk.gz with the following command :
$ cd ramdisk
$ gzip -dc ../boot.img-ramdisk.gz | cpio -i
after that u will have two files "ramdisk.gz" and "recovery.cpio"
7. Now go to ubuntu software center n download a application know as Ark
8. now right click on ramdisk.gz choose open with ark after that extract all the files
9.Now u will have all those directories n files u want!!!!
10. After editing repacking them by drag n drop method i.e. open ramdisk.gz file again using ark than select all those files u just extracted drag them and drop them on ramdisk.gz (opend in ark)
11.Now do the same with recovery.cpio if u want to edit something from it else skip
12 Now u have to repack all that stuff for that do
first repack ramdisk for that use
"find . | cpio -o -H newc | gzip > ../newramdisk.cpio.gz"
After that u have to repack boot.img for that use this
(if u have editing ramdisk)
$ ./mkbootimg --kernel /home/your user_id/new-boot/zImage --ramdisk /home/your user-id/old-boot/newramdisk.cpio.gz --base 0x80000000 --pagesize 2048 -o /home/user-id/new-boot/boot.img
(if u have not edited ramdisk that use)
$ ./mkbootimg --kernel /home/your user_id/new-boot/zImage --ramdisk /home/your user-id/old-boot/boot.img-ramdisk --base 0x80000000 --pagesize 2048 -o /home/user-id/new-boot/boot.img
Note: if u have made ur own zimage than place it in the "New-boot" folder n delete all other files
if u want repack the old zimage than rename the ur extracted "boot.img-kernel" to "zimage" n place in "New-boot" folder
Remeber u will have ur new boot.img in "New boot folder"
========================================================
Now for those who can't Download ark using Software center
1. download ark from this site
2. upack the ramdisk.gz/recovery.cpio using this command
ark --extract /home/your user-id/old-boot/ramdisk/ramdisk.gz
3. repack using
ark --add /home/your user-id/old-boot/ramdisk
it will promp the name of archive to add files to
choose the ramdisk.gz file!!!
The End
"HAVE A HAPPY KERNELING"
sachin sharma said:
U all must be thinking that there are a hell lot of guides for this than what this guide is here for?
And the answer is that i have used almost all guides to extract our kernel for latest builds like cm7,cm9 etc but after using the guides present here on xda , after the last step i didn't get any directories instead got two files name ramdisk.gz and recovery.cpio now this guide will tell what to do next!!!
First of all download the perl scripts from
HERE
Now after download do this:
1. Create two directories and sub directories:
$ mkdir -p old-boot/ramdisk
$ mkdir new-boot
2. Copy the zImage file which ye have made to the "new-boot"
3. Put your old directory boot.img to the "old-boot"
4. Extract the directory bootimgutils.zip to "old-boot"
5. Split boot.img with the command:
$ cd old-boot
$ ./boot.img split_bootimg.pl
or
$ perl split_bootimg.pl boot.img
there will be an appearance of more or less like this (depending on the type of your device):
Page size: 2048 (0x00000800)
Kernel size: 1388548 (0x00153004)
Ramdisk size: 141 518 (0x000228ce)
Second size: 0 (0x00000000)
Board name:
Command line: no_console_suspend = 1
Writing boot.img-kernel ... complete.
Writing boot.img-ramdisk.gz ... complete.
of the split will produce two files, namely boot.img-kernel and boot.img-ramdisk.gz
boot.img-kernel = kernel/zImage
boot.img-ramdisk = ramdisk
6. Now to edit the ramdisk then unpack the boot-img-ramdisk.gz with the following command :
$ cd ramdisk
$ gzip -dc ../boot.img-ramdisk.gz | cpio -i
after that u will have two files "ramdisk.gz" and "recovery.cpio"
7. Now go to ubuntu software center n download a application know as Ark
8. now right click on ramdisk.gz choose open with ark after that extract all the files
9.Now u will have all those directories n files u want!!!!
10. After editing repacking them by drag n drop method i.e. open ramdisk.gz file again using ark than select all those files u just extracted drag them and drop them on ramdisk.gz (opend in ark)
11.Now do the same with recovery.cpio if u want to edit something from it else skip
12 Now u have to repack all that stuff for that do
first repack ramdisk for that use
"find . | cpio -o -H newc | gzip > ../newramdisk.cpio.gz"
After that u have to repack boot.img for that use this
(if u have editing ramdisk)
$ ./mkbootimg --kernel /home/your user_id/new-boot/zImage --ramdisk /home/your user-id/old-boot/newramdisk.cpio.gz --base 0x80000000 --pagesize 2048 -o /home/user-id/new-boot/boot.img
(if u have not edited ramdisk that use)
$ ./mkbootimg --kernel /home/your user_id/new-boot/zImage --ramdisk /home/your user-id/old-boot/boot.img-ramdisk --base 0x80000000 --pagesize 2048 -o /home/user-id/new-boot/boot.img
Note: if u have made ur own zimage than place it in the "New-boot" folder n delete all other files
if u want repack the old zimage than rename the ur extracted "boot.img-kernel" to "zimage" n place in "New-boot" folder
Remeber u will have ur new boot.img in "New boot folder"
========================================================
Now for those who can't Download ark using Software center
1. download ark from this site
2. upack the ramdisk.gz/recovery.cpio using this command
ark --extract /home/your user-id/old-boot/ramdisk/ramdisk.gz
3. repack using
ark --add /home/your user-id/old-boot/ramdisk
it will promp the name of archive to add files to
choose the ramdisk.gz file!!!
The End
"HAVE A HAPPY KERNELING"
Click to expand...
Click to collapse
It is use with Linux
Sent from my Droid X using XDA Premium HD app
I wish to quote all post too
Sent from my GT-I9003 using XDA
yes it is to be done in linux
loukalok said:
It is use with Linux
Sent from my Droid X using XDA Premium HD app
Click to expand...
Click to collapse
if possible plz remove quoted post
sachin sharma said:
U all must be thinking that there are a hell lot of guides for this than what this guide is here for?
And the answer is that i have used almost all guides to extract our kernel for latest builds like cm7,cm9 etc but after using the guides present here on xda , after the last step i didn't get any directories instead got two files name ramdisk.gz and recovery.cpio now this guide will tell what to do next!!!
First of all download the perl scripts from
HERE
Now after download do this:
1. Create two directories and sub directories:
$ mkdir -p old-boot/ramdisk
$ mkdir new-boot
2. Copy the zImage file which ye have made to the "new-boot"
3. Put your old directory boot.img to the "old-boot"
4. Extract the directory bootimgutils.zip to "old-boot"
5. Split boot.img with the command:
$ cd old-boot
$ ./boot.img split_bootimg.pl
or
$ perl split_bootimg.pl boot.img
there will be an appearance of more or less like this (depending on the type of your device):
Page size: 2048 (0x00000800)
Kernel size: 1388548 (0x00153004)
Ramdisk size: 141 518 (0x000228ce)
Second size: 0 (0x00000000)
Board name:
Command line: no_console_suspend = 1
Writing boot.img-kernel ... complete.
Writing boot.img-ramdisk.gz ... complete.
of the split will produce two files, namely boot.img-kernel and boot.img-ramdisk.gz
boot.img-kernel = kernel/zImage
boot.img-ramdisk = ramdisk
6. Now to edit the ramdisk then unpack the boot-img-ramdisk.gz with the following command :
$ cd ramdisk
$ gzip -dc ../boot.img-ramdisk.gz | cpio -i
after that u will have two files "ramdisk.gz" and "recovery.cpio"
7. Now go to ubuntu software center n download a application know as Ark
8. now right click on ramdisk.gz choose open with ark after that extract all the files
9.Now u will have all those directories n files u want!!!!
10. After editing repacking them by drag n drop method i.e. open ramdisk.gz file again using ark than select all those files u just extracted drag them and drop them on ramdisk.gz (opend in ark)
11.Now do the same with recovery.cpio if u want to edit something from it else skip
12 Now u have to repack all that stuff for that do
first repack ramdisk for that use
"find . | cpio -o -H newc | gzip > ../newramdisk.cpio.gz"
After that u have to repack boot.img for that use this
(if u have editing ramdisk)
$ ./mkbootimg --kernel /home/your user_id/new-boot/zImage --ramdisk /home/your user-id/old-boot/newramdisk.cpio.gz --base 0x80000000 --pagesize 2048 -o /home/user-id/new-boot/boot.img
(if u have not edited ramdisk that use)
$ ./mkbootimg --kernel /home/your user_id/new-boot/zImage --ramdisk /home/your user-id/old-boot/boot.img-ramdisk --base 0x80000000 --pagesize 2048 -o /home/user-id/new-boot/boot.img
Note: if u have made ur own zimage than place it in the "New-boot" folder n delete all other files
if u want repack the old zimage than rename the ur extracted "boot.img-kernel" to "zimage" n place in "New-boot" folder
Remeber u will have ur new boot.img in "New boot folder"
========================================================
Now for those who can't Download ark using Software center
1. download ark from this site
2. upack the ramdisk.gz/recovery.cpio using this command
ark --extract /home/your user-id/old-boot/ramdisk/ramdisk.gz
3. repack using
ark --add /home/your user-id/old-boot/ramdisk
it will promp the name of archive to add files to
choose the ramdisk.gz file!!!
The End
"HAVE A HAPPY KERNELING"
Click to expand...
Click to collapse
Can I build a custom kernel for Android using any distros that is based on Ubuntu?
Silentkiller101197 said:
Can I build a custom kernel for Android using any distros that is based on Ubuntu?
Click to expand...
Click to collapse
Just above ur post plz read my post. Plz remove quoted post.
Silentkiller101197 said:
Can I build a custom kernel for Android using any distros that is based on Ubuntu?
Click to expand...
Click to collapse
Yes, you can use any *nix system
Few observations:
To make boot.img use:
Code:
mkbootimg --kernel zImage --ramdisk bootimg-ramdisk.cpio.gz --cmdline [URL="https://github.com/teamhacksung/android_device_samsung_galaxysl/blob/ics/BoardConfig.mk#L20"]"console=ttySAC2,115200 consoleblank=0"[/URL] --base [URL="https://github.com/teamhacksung/android_device_samsung_galaxysl/blob/ics/BoardConfig.mk#L21"]0x10000000[/URL] --pagesize [URL="https://github.com/teamhacksung/android_device_samsung_galaxysl/blob/ics/BoardConfig.mk#L19"]4096[/URL] --output boot.img
Use BBCODE to make the guide easier to read.
You don't necessarily need Ark, nearly every file archiver in linux can do that and there are also command line tools that are surely included in your linux distro (see the content of the script attached).
You need to sign up to download the scripts.
Are you sure about this?
Code:
./boot.img split_bootimg.pl
I think you swapped the names (I can't verify it, the reason is right above )
___
Here attached there's a script I made to easly unpack and repack CM kernels. It's based on this: http://forum.xda-developers.com/showthread.php?t=1242675
How to use it:
Place your boot.img in the same directory of the scripts and then run:
Code:
./unpack
It will extract the kernel and the compressed ramdisk.
Code:
./unpack -a
Same as above, but it will completely extract the ramdisk.
Code:
./repack
To make the new boot.img. It will also create kernel-updater.zip to flash the kernel from recovery.
If you put a directory named modules inside ./outfiles/ (it's created after you run ./unpack) with your self built modules (those that will go in /system/lib/modules/), they will be included in the updater zip.
Thanks to alfrix for the updated mkbootimg and the "teamhacksung styled" updater-script .
loSconosciuto said:
Few observations:
To make boot.img use:
Code:
mkbootimg --kernel zImage --ramdisk bootimg-ramdisk.cpio.gz --cmdline [URL="https://github.com/teamhacksung/android_device_samsung_galaxysl/blob/ics/BoardConfig.mk#L20"]"console=ttySAC2,115200 consoleblank=0"[/URL] --base [URL="https://github.com/teamhacksung/android_device_samsung_galaxysl/blob/ics/BoardConfig.mk#L21"]0x10000000[/URL] --pagesize [URL="https://github.com/teamhacksung/android_device_samsung_galaxysl/blob/ics/BoardConfig.mk#L19"]4096[/URL] --output boot.img
Use BBCODE to make the guide easier to read.
You don't necessarily need Ark, nearly every file archiver in linux can do that and there are also command line tools that are surely included in your linux distro (see the content of the script attached).
You need to sign up to download the scripts.
Are you sure about this?
Code:
./boot.img split_bootimg.pl
I think you swapped the names (I can't verify it, the reason is right above )
___
Here attached there's a script I made to easly unpack and repack CM kernels. It's based on this: http://forum.xda-developers.com/showthread.php?t=1242675
How to use it:
Place your boot.img in the same directory of the scripts and then run:
Code:
./unpack
It will extract the kernel and the compressed ramdisk.
Code:
./unpack -a
Same as above, but it will completely extract the ramdisk.
Code:
./repack
To make the new boot.img. It will also create kernel-updater.zip to flash the kernel from recovery.
If you put a directory named modules inside ./outfiles/ (it's created after you run ./unpack) with your self built modules (those that will go in /system/lib/modules/), they will be included in the updater zip.
Thanks to alfrix for the updated mkbootimg and the "teamhacksung styled" updater-script .
Click to expand...
Click to collapse
NO i tried most archives but they dont work they again give the same file i.e. ramdisk.gz
try it than say anything!!!
n there are many ways to unpack / repack anything so don't say that this is not neccessary or that is not neccessary
this thread is just about my preferred way!!!
if have ur own way than we will be happy to see ur guide thread!!
waiting for ur thread!!!
unpacking repacking can b easily done with Skin's unpack repack tools i use those best way to split kernels and ramdisk works like a charm
sachin sharma said:
NO i tried most archives but they dont work they again give the same file i.e. ramdisk.gz
try it than say anything!!!
n there are many ways to unpack / repack anything so don't say that this is not neccessary or that is not neccessary
this thread is just about my preferred way!!!
if have ur own way than we will be happy to see ur guide thread!!
waiting for ur thread!!!
Click to expand...
Click to collapse
I'm sorry, I didn't want to bother with my post.
I won't open a new thread, I was almost adding my scripts to skin's thread, but then I saw this one and it was about unpacking a CyanogenMod boot.img, so I added it here. There's no need to open a new thread in my opinion, because I don't have nothing more to say.
For the file archiver thing, I'm pretty sure of what I'm saying. Maybe you couldn't open it with other programs because you need to do it twice. The ramdisk is first gzip compressed and then cpio compressed. Maybe Ark does it twice automatically, but in linux there's not so much difference between a file archiver and another, they are all frontend and use the same tools almost always or maybe when you installed Ark other needed programs where automatically installed.
Regarding the mkbootimg arguments. I downloaded your tools and they confirmed what I wrote and I'm not surprised of this, because I'm using the same arguments amit/codeworkx/waleedq/dhiru used/are using in their kernels (as I linked you in my previous post).
Code:
Page size: 4096 (0x00001000)
Kernel size: 3429280 (0x003453a0)
Ramdisk size: 2957744 (0x002d21b0)
Second size: 0 (0x00000000)
Board name:
Command line: console=ttySAC2,115200 consoleblank=0
Writing boot.img-kernel ... complete.
Writing boot.img-ramdisk.gz ... complete.
It doesn't mean that you must use them, I've never said anything like this, but I'm pretty sure they all know better than me what they are doing, so I prefer to stick with those values and that's what I wanted to say in my previous post, but I admit that it sounded like "you are wrong, you must do this like this".
I really appreciate your effort, it was not easy for me at first to understand the differences between a stock boot.img and a CM one, so a guide like this would have been really helpful.
shriomman said:
unpacking repacking can b easily done with Skin's unpack repack tools i use those best way to split kernels and ramdisk works like a charm
Click to expand...
Click to collapse
So you are saying that with those tools you were able to unpack and repack the ramdisk changing things in it? Because I can't see this in his tools, so if they are working it simply means that you are not completely unpacking your boot.img, but simply splitting the kernel and the ramdisk.
loSconosciuto said:
I'm sorry, I didn't want to bother with my post.
I won't open a new thread, I was almost adding my scripts to skin's thread, but then I saw this one and it was about unpacking a CyanogenMod boot.img, so I added it here. There's no need to open a new thread in my opinion, because I don't have nothing more to say.
For the file archiver thing, I'm pretty sure of what I'm saying. Maybe you couldn't open it with other programs because you need to do it twice. The ramdisk is first gzip compressed and then cpio compressed. Maybe Ark does it twice automatically, but in linux there's not so much difference between a file archiver and another, they are all frontend and use the same tools almost always or maybe when you installed Ark other needed programs where automatically installed.
Regarding the mkbootimg arguments. I downloaded your tools and they confirmed what I wrote and I'm not surprised of this, because I'm using the same arguments amit/codeworkx/waleedq/dhiru used/are using in their kernels (as I linked you in my previous post).
Code:
Page size: 4096 (0x00001000)
Kernel size: 3429280 (0x003453a0)
Ramdisk size: 2957744 (0x002d21b0)
Second size: 0 (0x00000000)
Board name:
Command line: console=ttySAC2,115200 consoleblank=0
Writing boot.img-kernel ... complete.
Writing boot.img-ramdisk.gz ... complete.
It doesn't mean that you must use them, I've never said anything like this, but I'm pretty sure they all know better than me what they are doing, so I prefer to stick with those values and that's what I wanted to say in my previous post, but I admit that it sounded like "you are wrong, you must do this like this".
I really appreciate your effort, it was not easy for me at first to understand the differences between a stock boot.img and a CM one, so a guide like this would have been really helpful.
So you are saying that with those tools you were able to unpack and repack the ramdisk changing things in it? Because I can't see this in his tools, so if they are working it simply means that you are not completely unpacking your boot.img, but simply splitting the kernel and the ramdisk.
Click to expand...
Click to collapse
ok thnx for ur suggestions
but i have tried all the steps i have written
i successfully complete compiling kernel using this guide n will sill use it
if u dont want to use this guide or like another guide that its ur choice
have a good day!!!
So you are saying that with those tools you were able to unpack and repack the ramdisk changing things in it? Because I can't see this in his tools, so if they are working it simply means that you are not completely unpacking your boot.img, but simply splitting the kernel and the ramdisk.
Click to expand...
Click to collapse
Skin's tool splits kernel and ramdisk.... after that you can use gunzip from the command line to extract, modify and repack the cpio archive into the gz archive. Then again use skin's tool to repack the boot.img
Sent from my GT-I9003 using XDA
Do u guyz think that i shud delete this thread?
if so plz do tell me i will request mods to delete it!!!!!
Why?
Sent from my Droid X using XDA Premium HD app
loukalok said:
Why?
Sent from my Droid X using XDA Premium HD app
Click to expand...
Click to collapse
see all post above!!!!
all stating other ways to do the same!!!
sachin sharma said:
see all post above!!!!
all stating other ways to do the same!!!
Click to expand...
Click to collapse
Buddy u are taking this in wrong way. Nobody is saying that your guide is wrong or not useful. People are just sharing different way of unpacking & repacking kernel. If in future if any new member visit this thread then he can find different ways of kernel unpacking & repacking. Take people suggestion in positive way buddy We all really appreciate ur work buddy.
Guys can also refer to my thread which i created a long time back.
http://forum.xda-developers.com/showthread.php?t=1500889
sachin sharma said:
Do u guyz think that i shud delete this thread?
if so plz do tell me i will request mods to delete it!!!!!
Click to expand...
Click to collapse
We're just sharing buddy... chill...
Sent from my GT-I9003 using XDA
Could someone point me to some instructions on how to unpack, modify, and repack a boot.blob out of a kernel?
I'm trying to update bryce's kernel to use Data2SD mod, and I'm following the instructions from here:
http://forum.xda-developers.com/showpost.php?p=29532041&postcount=15
However, I tried unpacking and repacking without even modifying anything and I just get bootlooped.
Read this: http://forum.xda-developers.com/showpost.php?p=36925180&postcount=4
Do you want to use the Data2SD mod with CM or with CROMI? For CROMI I posted a kernel with auto-detection of Data2SD in bryce's thread - only for CM you'd have to do it yourself.
Thanks for the help. I actually just figured out a different way right before seeing your reply. I use blobpack and blobunpack from BlobTools git, and abootimg installed from Ubuntu repository. This script has the extracted bryce kernel zip in a directory called result, so I overwrite his boot.blob with my new one.
Code:
#!/bin/bash
#Clean:
rm out boot.img new_boot.img boot2.blob linux_processed.zip -r
mkdir -p out
echo;echo "**** Unpacking boot.blob to boot.img";echo
cp result/boot.blob .
../linux/blobunpack boot.blob
mv boot.blob.LNX boot.img
cd out
# now in out
echo;echo "**** Unpacking boot.img";echo
abootimg -x ../boot.img
#zcat initramfs|cpio -tiv
echo;echo "**** Extracting initrd.img";echo
mkdir -p initramfs
cp initrd.img initramfs/initramfs.gz
mv initrd.img old_initrd.img
cd initramfs
# now in old/initramfs
gzip -d initramfs.gz
cpio -i < initramfs
echo;echo "**** Modifying boot information";echo
perl -pi -e 's/mmcblk0p2/mmcblk1p3/g' *
perl -pi -e 's/mmcblk0p8/mmcblk1p2/g' *
echo;echo "**** Recompressing initrd.img";echo
find | cpio -H newc -o | lzma -9 > ../initrd.img
cd ..
# now in out
echo;echo "**** Creating new_boot.img";echo
abootimg --create ../new_boot.img -f bootimg.cfg -k zImage -r initrd.img
cd ..
#now out of out
echo;echo "**** Pack boot2.blob";echo
../linux/blobpack boot2.blob LNX new_boot.img
cp boot2.blob result/boot.blob
cd result
echo;echo "**** Zip it all up";echo
zip ../linux_processed.zip * -r
cd ..
I am trying to get bryce's CM10.1 kernel working with Data2SD. I thought all I needed to do was change the mount commands in fstab.cardhu so that data (and I'm trying to do cache too) moved to external partitions.
Those perl pie commands in the middle were supposed to change internal data partition and internal cache partition into the external SD card partition 2 and 3, respectively. As far as I can tell, the changes were made correctly and the blob and zip were re-created, but it didn't work when I booted with the new blob.
Any ideas why it doesn't seem to have worked? Are there other changes I'm missing?
Edit:
Looks like my boot.blob is not being applied. I've tried both flashing the zip and dd'ing it to mmcblk0p4, but in both cases, I do not get the bootloader update screen on reboot, it just boots straight into my old settings. What am I missing?
Edit again:
Oops, I had stopped adding the signature on the blobs for some reason, looks like I'm off a few steps, because now I get bootloops again.
AW: [Q] Need help modifying boot blob
oblib__ said:
Thanks for the help. I actually just figured out a different way right before seeing your reply. I use blobpack and blobunpack from BlobTools git, and abootimg installed from Ubuntu repository. This script has the extracted bryce kernel zip in a directory called result, so I overwrite his boot.blob with my new one.
Code:
#!/bin/bash
#Clean:
rm out boot.img new_boot.img boot2.blob linux_processed.zip -r
mkdir -p out
echo;echo "**** Unpacking boot.blob to boot.img";echo
cp result/boot.blob .
../linux/blobunpack boot.blob
mv boot.blob.LNX boot.img
cd out
# now in out
echo;echo "**** Unpacking boot.img";echo
abootimg -x ../boot.img
#zcat initramfs|cpio -tiv
echo;echo "**** Extracting initrd.img";echo
mkdir -p initramfs
cp initrd.img initramfs/initramfs.gz
mv initrd.img old_initrd.img
cd initramfs
# now in old/initramfs
gzip -d initramfs.gz
cpio -i < initramfs
echo;echo "**** Modifying boot information";echo
perl -pi -e 's/mmcblk0p2/mmcblk1p3/g' *
perl -pi -e 's/mmcblk0p8/mmcblk1p2/g' *
echo;echo "**** Recompressing initrd.img";echo
find | cpio -H newc -o | lzma -9 > ../initrd.img
cd ..
# now in out
echo;echo "**** Creating new_boot.img";echo
abootimg --create ../new_boot.img -f bootimg.cfg -k zImage -r initrd.img
cd ..
#now out of out
echo;echo "**** Pack boot2.blob";echo
../linux/blobpack boot2.blob LNX new_boot.img
cp boot2.blob result/boot.blob
cd result
echo;echo "**** Zip it all up";echo
zip ../linux_processed.zip * -r
cd ..
I am trying to get bryce's CM10.1 kernel working with Data2SD. I thought all I needed to do was change the mount commands in fstab.cardhu so that data (and I'm trying to do cache too) moved to external partitions.
Those perl pie commands in the middle were supposed to change internal data partition and internal cache partition into the external SD card partition 2 and 3, respectively. As far as I can tell, the changes were made correctly and the blob and zip were re-created, but it didn't work when I booted with the new blob.
Any ideas why it doesn't seem to have worked? Are there other changes I'm missing?
Edit:
Looks like my boot.blob is not being applied. I've tried both flashing the zip and dd'ing it to mmcblk0p4, but in both cases, I do not get the bootloader update screen on reboot, it just boots straight into my old settings. What am I missing?
Edit again:
Oops, I had stopped adding the signature on the blobs for some reason, looks like I'm off a few steps, because now I get bootloops again.
Click to expand...
Click to collapse
I had a hard time getting this done too. I couldn't find working blob tools at first. So I ended up using blob tools for windows. They also sign them directly. But I am also running Ubuntu in a vm
Sent from my Nexus 4 using xda premium
Here I consolidate the custom tools necessary to unpack, modify, repack and loki your JB 4.2.2 ROM zip boot.img!
These Windows/cygwin tools invoke the djrbliss loki bootloader exploit for your rooted SGS4!
See my Instructional Demo below! Results are tested working on my AT&T SGH-I337 running Liquid Smooth v2.8 (JB 4.2.2) and TWRP Recovery 2.5.0.2.
SGS4 Boot Image Toolset (sgs4-boot-tools.zip): http://www.mediafire.com/?6sp3pp33lxgm3ua
Contents
Executive shell script: modify-boot-sgs4.sh to unpack boot image to kernel and ramdisk, thus enabling user to modify boot image
Perl scripts: unpack-bootimg-sgs4.pl and repack-bootimg-sgs4.pl
mkbootimg.exe (make boot image from kernel and ramdisk)
loki-boot directory with ROM-like directory structure --- contains all files needed to “loki” your boot.img
The loki-boot directory also contains two boot files: boot-ref.img (extracted directly from Liquid Smooth ROM zip) and a modified boot.img (generated using the Instructional Demo further below).
My custom repack-bootimg-sgs4.pl invokes the following command string:
./mkbootimg.exe --cmdline 'androidboot.hardware=qcom user_debug=31 zcache' --base 0x80200000 --kernel boot.img-kernel --ramdisk ramdisk-repack.cpio.gz -o $boot-repack.img
Detail:
--cmdline 'androidboot.hardware=qcom user_debug=31 zcache' (command line tellback from unpack-bootimg-sgs4.pl)
--base 0x80200000 (from Liquid Smooth /proc/config.gz: CONFIG_PHYS_OFFSET=0x80200000)
--kernel $boot.img-kernel (ROM kernel file)
--ramdisk ramdisk-repack.cpio.gz (gzipped cpio of/ramdisk)
-o $boot-repack.img (output file)
Click to expand...
Click to collapse
Preliminaries
If you don’t have cygwin, you can download it here: http://www.cygwin.com/ and install.
Cygwin packages installed on my XP workstation are shown below. You probably don’t need all of them, though I believe many come with the base cygwin.
But you definitely need perl
Code:
$ cygcheck -c
Cygwin Package Information
Package Version Status
_autorebase 000199-1 OK
_update-info-dir 01102-1 OK
alternatives 1.3.30c-10 OK
base-cygwin 3.1-1 OK
base-files 4.1-1 OK
bash 4.1.10-4 OK
bzip2 1.0.6-2 OK
coreutils 8.15-1 OK
cpio 2.11-2 OK
crypt 1.2-1 OK
cygutils 1.4.10-2 OK
cygwin 1.7.17-1 OK
cygwin-doc 1.7-1 OK
dash 0.5.7-1 OK
diffutils 3.2-1 OK
dos2unix 6.0.3-1 OK
editrights 1.01-2 OK
file 5.11-1 OK
findutils 4.5.9-2 OK
gawk 4.0.2-1 OK
gettext 0.18.1.1-2 OK
grep 2.6.3-1 OK
groff 1.21-2 OK
gzip 1.4-1 OK
ipc-utils 1.0-1 OK
less 444-1 OK
libattr1 2.4.46-1 OK
libbz2_1 1.0.6-2 OK
libdb4.5 4.5.20.2-3 OK
libexpat1 2.1.0-1 OK
libgcc1 4.5.3-3 OK
libgdbm4 1.8.3-20 OK
libgmp3 4.3.2-1 OK
libiconv2 1.14-2 OK
libintl8 0.18.1.1-2 OK
liblzma5 5.0.2_20110517-1 OK
libncurses10 5.7-18 OK
libncursesw10 5.7-18 OK
libopenssl100 1.0.1c-2 OK
libpcre0 8.21-2 OK
libpopt0 1.6.4-4 OK
libreadline7 6.1.2-3 OK
libsigsegv2 2.10-1 OK
libssp0 4.5.3-3 OK
libstdc++6 4.5.3-3 OK
libxml2 2.9.0-1 OK
login 1.10-10 OK
man 1.6g-1 OK
mintty 1.1.2-1 OK
perl 5.14.2-3 OK
perl_vendor 5.14.2-3 OK
rebase 4.4.0-1 OK
run 1.1.13-1 OK
sed 4.2.1-2 OK
tar 1.26-1 OK
terminfo 5.7_20091114-14 OK
texinfo 4.13-4 OK
tzcode 2012j-1 OK
vim 7.3.762-1 OK
vim-common 7.3.762-1 OK
which 2.20-2 OK
xxd 7.3.762-1 OK
xz 5.0.2_20110517-1 OK
zlib0 1.2.7-1 OK
Instructional Demo
1. Boot SGS4 to recovery and Nandroid backup existing ROM for peace of mind
2. (One time) Create a cygwin working directory (e.g. ~/cygwin/home/modify-boot-sgs4) and unzip the SGS4 Boot Image Toolset files to it
3. On Windows, extract ROM boot.img (e.g. from Liquid-JB-v2.8-OFFICIAL-jflteatt.zip) and place boot.img in cygwin working directory.
4. Launch cygwin command window in working directory and enter script command:
sh modify-boot-sgs4.sh boot.img (produces ramdisk directory: boot.img-ramdisk/)
CNTL-C out of shell script and back to cygwin prompt.
5. Edit boot.img-ramdisk/default.prop, set: ro.secure=0 and save and close.
Note: The setting: ro.secure=0 instructs Android to grant root to ADB so user does not have to keep entering “su” at the beginning of each ADB session.
6. At cygwin terminal enter:
perl repack-bootimg-sgs4.pl boot.img
This yields boot-repack.img.
Here’s a dump of my cygwin session…
Code:
[email protected] /home
$ mkdir modify-boot-sgs4
[email protected] /home
$ cd modify-boot-sgs4
[email protected] /home/modify-boot-sgs4
$ pwd
/home/modify-boot-sgs4
[email protected] /home/modify-boot-sgs4
$ sh modify-boot-sgs4.sh boot.img
Unpack/Repack SGS4 ROM Boot Image
Initial Release (14 Jul 2013)
sendust7 @ xda developers
Current directory: /home/modify-boot-sgs4
Unpacking boot image...
Page size: 2048 (0x00000800)
Kernel size: 4961224 (0x004bb3c8)
Ramdisk size: 488535 (0x00077457)
Second size: 0 (0x00000000)
Board name:
Command line: androidboot.hardware=qcom user_debug=31 zcache
Writing boot.img-kernel ... complete.
Writing boot.img-ramdisk.gz ... complete.
Unzipping: boot.img-ramdisk.gz to boot.img-ramdisk
1708 blocks
Press ENTER to repack boot image or CNTL C to exit (and modify ramdisk offline):
[COLOR="Blue"](Modify /ramdisk/default.prop then resume cygwin session)[/COLOR]
[email protected] /home/modify-boot-sgs4
$ perl repack-bootimg-sgs4.pl boot.img
find . | cpio -o -H newc | gzip > /home/modify-boot-sgs4/ramdisk-repack.cpio.gz
1708 blocks
./mkbootimg.exe --cmdline 'androidboot.hardware=qcom user_debug=31 zcache' --base 0x80200000 --kernel boot.img-kernel --ramdisk ramdisk-repack.cpio.gz -o boot-repack.img
Repacked boot image written to boot-repack.img
[email protected] /home/modify-boot-sgs4
$
7. Exit cygwin and drop boot-repack.img into loki-boot directory and rename to boot.img. Then 7-zip contents of loki-boot directory to loki-boot.zip (CNTL-A (Select All) then right-click > 7-zip > Add to “loki-boot.zip”).
8. Connect SGS4 to your ADB-enabled computer, then
adb push loki-boot.zip /external_sd/Download (or your favorite flash directory)
9. Boot to recovery and flash loki-boot.zip (takes a few seconds)
10. Reboot system and achieve “pre-rooted” ADB sessions on Liquid Smooth!
C:\Program Files\Android\android-sdk\platform-tools>adb kill-server
C:\Program Files\Android\android-sdk\platform-tools>adb shell
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
[email protected]:/ #
Click to expand...
Click to collapse
BTW here's a nice little app: https://play.google.com/store/apps/details?id=com.siriusapplications.quickboot&hl=en
With Quick Boot, you can reboot to recovery via soft key, which is easier than booting to recovery from cold start.
Blessings. Enjoy!
Credits:
djrbliss @ xda developers and other contributors for the loki exploit: https://github.com/djrbliss/loki)
William Enck (split_bootimg): http://www.enck.org/
Android Development Team (Unpack, Edit, Repack Boot Images): http://www.android-dls.com/wiki/?title=HOWTO:_Unpack,_Edit,_and_Re-Pack_Boot_Images
Cygwin Project Team: http://cygwin.com/who.html
sendust7 said:
If you don’t have cygwin, you can
Click to expand...
Click to collapse
use native Linux
svs57 said:
use native Linux
Click to expand...
Click to collapse
L.O.L, I totally agree
;
;Warning: Boot.ini is used on Windows XP and earlier operating systems.
;Warning: Use BCDEDIT.exe to modify Windows Vista boot options.
;
[boot loader]
timeout=10
default=multi(0)disk(0)rdisk(0)partition(2)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(2)\WINDOWS="Microsoft Windows XP Professional" /NOEXECUTE=OPTIN /FASTDETECT
C:\wubildr.mbr="Ubuntu"
Click to expand...
Click to collapse
But my past experience is that most users prefer Windows
I am not sure, but I don't think this will work on a fresh install of Cygwin. When i installed cygwin i selected "all" for packages. The directory structure does not match your script, /bin is not under /usr but in the root of cygwin directory. Also, i checked the installed packages, many are missing, and when i search cygwin.com for the missing, i cant find quite a few. Im new to cygwin, as in this op, but not new to software. i tried several boot.img (4.3) thinking it might be the image, but it was a strech and all failed the same. I dont find the .dll your script is looking for, so the error is correct.
I get this error:
$ sh modify-boot-sgs4.sh boot.img
Unpack/Repack SGS4 ROM Boot Image
Initial Release (14 Jul 2013)
sendust7 @ xda developers
Current directory: /home/modify-boot-sg4
Unpacking boot image...
/usr/bin/perl.exe: error while loading shared libraries: cygssp-0.dll: cannot open shared object file: No such file or directory
UPDATE: well I went through the cygwin install/update again and after searching for each package you listed, installing everything associated with each package, your scripts WORK. I have unpacked/edited/repacked and loaded. ADB as root......profit
Thanks for this
Thanks
sendust7 said:
Here I consolidate the custom tools necessary to unpack, modify, repack and loki your JB 4.2.2 ROM zip boot.img!
These Windows/cygwin tools invoke the djrbliss loki bootloader exploit for your rooted SGS4!
See my Instructional Demo below! Results are tested working on my AT&T SGH-I337 running Liquid Smooth v2.8 (JB 4.2.2) and TWRP Recovery 2.5.0.2.
SGS4 Boot Image Toolset (sgs4-boot-tools.zip): http://www.mediafire.com/?6sp3pp33lxgm3ua
Contents
Executive shell script: modify-boot-sgs4.sh to unpack boot image to kernel and ramdisk, thus enabling user to modify boot image
Perl scripts: unpack-bootimg-sgs4.pl and repack-bootimg-sgs4.pl
mkbootimg.exe (make boot image from kernel and ramdisk)
loki-boot directory with ROM-like directory structure --- contains all files needed to “loki” your boot.img
The loki-boot directory also contains two boot files: boot-ref.img (extracted directly from Liquid Smooth ROM zip) and a modified boot.img (generated using the Instructional Demo further below).
My custom repack-bootimg-sgs4.pl invokes the following command string:
Preliminaries
If you don’t have cygwin, you can download it here: http://www.cygwin.com/ and install.
Cygwin packages installed on my XP workstation are shown below. You probably don’t need all of them, though I believe many come with the base cygwin.
But you definitely need perl
Code:
$ cygcheck -c
Cygwin Package Information
Package Version Status
_autorebase 000199-1 OK
_update-info-dir 01102-1 OK
alternatives 1.3.30c-10 OK
base-cygwin 3.1-1 OK
base-files 4.1-1 OK
bash 4.1.10-4 OK
bzip2 1.0.6-2 OK
coreutils 8.15-1 OK
cpio 2.11-2 OK
crypt 1.2-1 OK
cygutils 1.4.10-2 OK
cygwin 1.7.17-1 OK
cygwin-doc 1.7-1 OK
dash 0.5.7-1 OK
diffutils 3.2-1 OK
dos2unix 6.0.3-1 OK
editrights 1.01-2 OK
file 5.11-1 OK
findutils 4.5.9-2 OK
gawk 4.0.2-1 OK
gettext 0.18.1.1-2 OK
grep 2.6.3-1 OK
groff 1.21-2 OK
gzip 1.4-1 OK
ipc-utils 1.0-1 OK
less 444-1 OK
libattr1 2.4.46-1 OK
libbz2_1 1.0.6-2 OK
libdb4.5 4.5.20.2-3 OK
libexpat1 2.1.0-1 OK
libgcc1 4.5.3-3 OK
libgdbm4 1.8.3-20 OK
libgmp3 4.3.2-1 OK
libiconv2 1.14-2 OK
libintl8 0.18.1.1-2 OK
liblzma5 5.0.2_20110517-1 OK
libncurses10 5.7-18 OK
libncursesw10 5.7-18 OK
libopenssl100 1.0.1c-2 OK
libpcre0 8.21-2 OK
libpopt0 1.6.4-4 OK
libreadline7 6.1.2-3 OK
libsigsegv2 2.10-1 OK
libssp0 4.5.3-3 OK
libstdc++6 4.5.3-3 OK
libxml2 2.9.0-1 OK
login 1.10-10 OK
man 1.6g-1 OK
mintty 1.1.2-1 OK
perl 5.14.2-3 OK
perl_vendor 5.14.2-3 OK
rebase 4.4.0-1 OK
run 1.1.13-1 OK
sed 4.2.1-2 OK
tar 1.26-1 OK
terminfo 5.7_20091114-14 OK
texinfo 4.13-4 OK
tzcode 2012j-1 OK
vim 7.3.762-1 OK
vim-common 7.3.762-1 OK
which 2.20-2 OK
xxd 7.3.762-1 OK
xz 5.0.2_20110517-1 OK
zlib0 1.2.7-1 OK
Instructional Demo
1. Boot SGS4 to recovery and Nandroid backup existing ROM for peace of mind
2. (One time) Create a cygwin working directory (e.g. ~/cygwin/home/modify-boot-sgs4) and unzip the SGS4 Boot Image Toolset files to it
3. On Windows, extract ROM boot.img (e.g. from Liquid-JB-v2.8-OFFICIAL-jflteatt.zip) and place boot.img in cygwin working directory.
4. Launch cygwin command window in working directory and enter script command:
sh modify-boot-sgs4.sh boot.img (produces ramdisk directory: boot.img-ramdisk/)
CNTL-C out of shell script and back to cygwin prompt.
5. Edit boot.img-ramdisk/default.prop, set: ro.secure=0 and save and close.
Note: The setting: ro.secure=0 instructs Android to grant root to ADB so user does not have to keep entering “su” at the beginning of each ADB session.
6. At cygwin terminal enter:
perl repack-bootimg-sgs4.pl boot.img
This yields boot-repack.img.
Here’s a dump of my cygwin session…
Code:
[email protected] /home
$ mkdir modify-boot-sgs4
[email protected] /home
$ cd modify-boot-sgs4
[email protected] /home/modify-boot-sgs4
$ pwd
/home/modify-boot-sgs4
[email protected] /home/modify-boot-sgs4
$ sh modify-boot-sgs4.sh boot.img
Unpack/Repack SGS4 ROM Boot Image
Initial Release (14 Jul 2013)
sendust7 @ xda developers
Current directory: /home/modify-boot-sgs4
Unpacking boot image...
Page size: 2048 (0x00000800)
Kernel size: 4961224 (0x004bb3c8)
Ramdisk size: 488535 (0x00077457)
Second size: 0 (0x00000000)
Board name:
Command line: androidboot.hardware=qcom user_debug=31 zcache
Writing boot.img-kernel ... complete.
Writing boot.img-ramdisk.gz ... complete.
Unzipping: boot.img-ramdisk.gz to boot.img-ramdisk
1708 blocks
Press ENTER to repack boot image or CNTL C to exit (and modify ramdisk offline):
[COLOR="Blue"](Modify /ramdisk/default.prop then resume cygwin session)[/COLOR]
[email protected] /home/modify-boot-sgs4
$ perl repack-bootimg-sgs4.pl boot.img
find . | cpio -o -H newc | gzip > /home/modify-boot-sgs4/ramdisk-repack.cpio.gz
1708 blocks
./mkbootimg.exe --cmdline 'androidboot.hardware=qcom user_debug=31 zcache' --base 0x80200000 --kernel boot.img-kernel --ramdisk ramdisk-repack.cpio.gz -o boot-repack.img
Repacked boot image written to boot-repack.img
[email protected] /home/modify-boot-sgs4
$
7. Exit cygwin and drop boot-repack.img into loki-boot directory and rename to boot.img. Then 7-zip contents of loki-boot directory to loki-boot.zip (CNTL-A (Select All) then right-click > 7-zip > Add to “loki-boot.zip”).
8. Connect SGS4 to your ADB-enabled computer, then
adb push loki-boot.zip /external_sd/Download (or your favorite flash directory)
9. Boot to recovery and flash loki-boot.zip (takes a few seconds)
10. Reboot system and achieve “pre-rooted” ADB sessions on Liquid Smooth!
BTW here's a nice little app: https://play.google.com/store/apps/details?id=com.siriusapplications.quickboot&hl=en
With Quick Boot, you can reboot to recovery via soft key, which is easier than booting to recovery from cold start.
Blessings. Enjoy!
Credits:
djrbliss @ xda developers and other contributors for the loki exploit: https://github.com/djrbliss/loki)
William Enck (split_bootimg): http://www.enck.org/
Android Development Team (Unpack, Edit, Repack Boot Images): http://www.android-dls.com/wiki/?title=HOWTO:_Unpack,_Edit,_and_Re-Pack_Boot_Images
Cygwin Project Team: http://cygwin.com/who.html
Click to expand...
Click to collapse
Hi,
When I understand more I can't wait to revisit this instruction. But I love that it's here for me.
Ms. K:angel:
nevermind
nevermind
hello
Hi! I'm trying...but my ramdisk folder remains empty!
dump:
$ sh modify-boot-sgs4.sh boot.img
Unpack/Repack SGS4 ROM Boot Image
Initial Release (14 Jul 2013)
sendust7 @ xda developers
Current directory: /cygdrive/c/cygwin64/home/modify-boot-sgs4
Unpacking boot image...
Page size: 2048 (0x00000800)
Kernel size: 7157864 (0x006d3868)
Ramdisk size: 1142288 (0x00116e10)
Second size: 0 (0x00000000)
Board name:
Command line: console=null androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x3F ehci-hcd.park=3
Writing boot.img-kernel ... complete.
Writing boot.img-ramdisk.gz ... complete.
Unzipping: boot.img-ramdisk.gz to boot.img-ramdisk
modify-boot-sgs4.sh: line 23: cpio: command not found
_____________________________________________________
I'm doing this on 4.3 MJ7 I9505 kernel.
I assume I can unzip myself boot.img-ramdisk.gz, right?
ocaldini said:
Hi! I'm trying...but my ramdisk folder remains empty!
dump:
$ sh modify-boot-sgs4.sh boot.img
Unpack/Repack SGS4 ROM Boot Image
Initial Release (14 Jul 2013)
sendust7 @ xda developers
Current directory: /cygdrive/c/cygwin64/home/modify-boot-sgs4
Unpacking boot image...
Page size: 2048 (0x00000800)
Kernel size: 7157864 (0x006d3868)
Ramdisk size: 1142288 (0x00116e10)
Second size: 0 (0x00000000)
Board name:
Command line: console=null androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x3F ehci-hcd.park=3
Writing boot.img-kernel ... complete.
Writing boot.img-ramdisk.gz ... complete.
Unzipping: boot.img-ramdisk.gz to boot.img-ramdisk
modify-boot-sgs4.sh: line 23: cpio: command not found
_____________________________________________________
I'm doing this on 4.3 MJ7 I9505 kernel.
I assume I can unzip myself boot.img-ramdisk.gz, right?
Click to expand...
Click to collapse
Make sure you install the cpio packages for cygwin.
You can install additional packages by running the setup/install again.
You can also search for cpio via the search bar at the top left when presented with the list of packages.
Hope that helps.
Hello
Can anyone tell what is wrong? it keeps saying its doing it, but it does nothing...
[email protected] ~
$ cd modify-boot-sgs4
[email protected] ~/modify-boot-sgs4
$ pwd
/home/Home/modify-boot-sgs4
[email protected] ~/modify-boot-sgs4
$ sh modify-boot-sgs4.sh boot.img
Unpack/Repack SGS4 ROM Boot Image
Initial Release (14 Jul 2013)
sendust7 @ xda developers
Current directory: /home/Home/modify-boot-sgs4
Unpacking boot image...
Page size: 2048 (0x00000800)
Kernel size: 7195952 (0x006dcd30)
Ramdisk size: 1144962 (0x00117882)
Second size: 0 (0x00000000)
Board name:
Command line: console=null androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x3F ehci-hcd.park=3
Writing boot.img-kernel ... complete.
Writing boot.img-ramdisk.gz ... complete.
Directory: boot.img-ramdisk already exists
Press ENTER to repack boot image or CNTL-C to exit (and modify ramdisk offline):
Repacking boot image...
find . | cpio -o -H newc | gzip > /home/Home/modify-boot-sgs4/ramdisk-repack.cpio.gz
4560 blocks
./mkbootimg.exe --cmdline 'androidboot.hardware=qcom user_debug=31 zcache' --base 0x80200000 --kernel boot.img-kernel --ramdisk ramdisk-repack.cpio.gz -o boot-repack.img
sh: ./mkbootimg.exe: Permission denied
Althoug, now it is telling me Permission Denied, I don't know why, or how to change that in windows 7, but it wasn't giving me any errors before, it just wasn't writing the image
lijojohnson said:
Make sure you install the cpio packages for cygwin.
You can install additional packages by running the setup/install again.
You can also search for cpio via the search bar at the top left when presented with the list of packages.
Hope that helps.
Click to expand...
Click to collapse
Thank you, you helped me a lot! It worked!
Oh, when I searched for cpio I had to click on "default" ( and select "install" on the windows before clicking "advance"), to install it properly!
A VERY IMPORTANT INFORMATION:
I was trying with Cygwin 64 bit and I had problem repacking it.
I found out mkbootimg only works on Linux 32 bits.
So it is necessary to use Cygwin 32 bit version!
Finally it worked! Thanks a lot!
---------- Post added at 04:09 AM ---------- Previous post was at 03:18 AM ----------
Yeah, I did that...same result...the problem is with permissions, when I run it in compatibility mode, it tells me permission denied. I'm suspecting
it is a Windows 7 problem, mkbootimg.exe is saying permission denied. I appreciate the answer though. maybe an antivirus program is blocking it or something. my cygwin icon is showing the security essentials icon on it for some reason...i dunno, i'll research it some more and figure it out when I have time, thanks again
Keithgordon said:
Yeah, I did that...same result...the problem is with permissions, when I run it in compatibility mode, it tells me permission denied. I'm suspecting
it is a Windows 7 problem, mkbootimg.exe is saying permission denied. I appreciate the answer though. maybe an antivirus program is blocking it or something. my cygwin icon is showing the security essentials icon on it for some reason...i dunno, i'll research it some more and figure it out when I have time, thanks again
Click to expand...
Click to collapse
I'm doing this on windows 8.1 64bit with cygwin 32 bits. It works. I don't use antivirus, turn off security essentials and other system protecting programs, I'm sure you will do it.
Try it with boot.img from I9505 International , unpack and repack without problem , flash it and phone restart and vibrate constantly.
Any ideas how to fix this problem ?