[1/12/12][WIP][NativeSD] Ramdisk Patcher ; beta1 - HD2 Android SD Development

[Disclamer: Use the following at your own risk, I take no responsibility for the unrecoverable loss of any data as a direct consequence of using anything attached]
The following patcher(s) will modify the nand ramdisk for various functions, primarily enabling NativeSD support:​--------------------------------------------------------------------
#1 NativeSD SD ramdisk to NativeSD nand ramdisk patch
#2 NAND (Non NativeSD) to NativeSD patch
#3 Boot.img (/also clk) patcher
#4 other devices ???
#5 FAQ
---------------------------------------------------------------------​
NativeSD SD ramdisk to NativeSD NAND ramdisk
Things resolved by using nand ramdisk over sd ramdisk
Bluetooth issues
Changing rom name to whatever you want prior to install i.e for testing purposes (just need to change rom_name in install.sh and the one in the ramdisk will mirror it)
...
...
Instructions.
Removed the old zips, have attached just one, should run on linux, on device and during installation, needs a install.sh file with at least ROM_NAME=rom_name in it, and a copy of the nand ramdisk to be added into NativeSD folder or copied to /tmp (i.e during ROM _installation ) and to execute nativesd.sh (a copy of which is currently attached as well as being in the zip). Should work with nilfs2 and ext4 and should allow for easy adjustments and modifications to be made to the mount commands carried out in init.rc and/or mountfs.sh
Add a copy of nativesd.sh.txt saved as nativesd.sh to the downloaded and unzipped NativeSD folder and add to rom zip.
During ROM installation the NativeSD folder needs to be emptied to /tmp along with a nand ramdisk and /tmp/nativesd.sh needs to be run.
package_extract_dir("NativeSD", "/tmp");
set_perm(0, 0, 0777, "/tmp/nativesd.sh");
run_program("/tmp/nativesd.sh");​and either send nand ramdisk to /tmp/ or add a copy to the NativeSD folder before installation.
The set up at the moment will leave the default NativeSD in tact and add two others, just rename them (or edit nativesd.sh to do so).
If using nilfs2 again two addition ramdisks will be added, the two created ones which will boot to nilfs2 and the original which won't boot as it's set to ext4, you may also need to edit install.sh (or mount_NativeSD.sh) so that it reads "mount auto" or "mount nilfs2" rather than "mount ext4".
Legacy Instructions:
Code:
NANDtoNativeSD.zip (will add another version)
[INDENT]This is a CWM(/recovery) zip, instructions are similar to Combi:
need to change install.sh to have the right rom_name at the top, and add the nand ramdisk to the NativeSD folder and install via recovery[/INDENT]
Combi
[INDENT]The zips marked ext4 and nilfs2 should make both sc and v versions and should work during installation and from running build (although that may need one line change). They should create initrd-nilfs-sc.gz and initrd-nilfs-v.gz or initrd-ext4-sc.gz and initrd-ext4-v.gz accordingly and thus can't be booted from until you rename them to initrd.gz.
[B]During ROM installation:[/B]
[INDENT]Copy the nand ramdisk (it should be ~200kb) into the NativeSD folder and copy NativeSD into the ROM zip
Edit the updater script by adding:
[B]package_extract_dir("NativeSD", "/tmp");
set_perm(0, 0, 0777, "/tmp/nativesd.sh");
run_program("/tmp/nativesd.sh");[/B][/INDENT]
before [B]package_extract_dir("system", "/system");[/B]
no other change needed so this should be universal
[B]During running ROM:[/B]
[INDENT]Copy NativeSD folder to sdcard, copy in nand ramdisk and create a text file called [B]install.sh[/B] with the words [B]ROM_NAME=writeROMname[/B] writing the rom name after =.
Open terminal cd into NativeSD folder and run script:
[B]su
chmod 777 nativesd.sh
./nativesd.sh[/B][/INDENT]
Let me know if there is a problem as I might need to change a few lines to get it to run on device - This is completely untested
(will also run on linux after a few minor changes i.e changing sbin to bin on first line and removing/changing the [B]cp initrd*.gz /boot*[/B] lines, will properly comment this in next version if/when the current ones need fixing
[/INDENT]
Modifying during Installation
[INDENT]1. Download the attached NativeSD.zip or NativeSD-sc.zip and have original NativeSD-ROM.zip to be modified
2. Unzip it and open nativesd.sh
3. Add the romname to the start of the script (the same romname that's in install.sh)
3. Add the NativeSD folder to a current NativeSD-ROM.zip
4. Edit the updater-script, by changing the following:
[B]ui_print("@ Installing System");
package_extract_dir("kernel/bootsd", "/boot");
package_extract_dir("kernel/kernel", "/boot");
package_extract_dir("kernel/bootsd", "/boot_dir");
package_extract_dir("kernel/kernel", "/boot_dir");
package_extract_dir("sdcard", "/sdcard");
package_extract_dir("system", "/system");[/B]
to
[B]ui_print("@ Installing System");
package_extract_dir("kernel/boot", "/boot");
package_extract_dir("kernel/kernel", "/boot");
package_extract_dir("kernel/kernel", "/boot_dir");
package_extract_dir("NativeSD", "/tmp");
set_perm(0, 0, 0777, "/tmp/nativesd.sh");
run_program("/tmp/nativesd.sh");
package_extract_dir("sdcard", "/sdcard");
package_extract_dir("system", "/system");[/B]
[I][SIZE="1"](this will vary slightly by rom)[/SIZE][/I]
5. Copy rom to sdcard and install via recovery[/INDENT]
Modifying during running NativeSD ROM
[INDENT]1. Download nativesd.sh.txt and nativeSDv1.1 attached
2. Obtain nand ramdisk from the NativeSD-ROM.zip (kernel/boot/initrd.gz for example)
3. Unzip NativeSDv1.1.zip
4. Rename nativesd.sh.txt to nativesd.sh and copy over the one in the NativeSD folder
5. Copy the nand ramdisk (initrd.gz) into the NativeSD folder
6. Copy NativeSD folder to device for example to /sdcard/Downloads/
7. Open terminal and run the following
[B]su
cd /sdcard/Downloads/NativeSD
ROM_NAME=AddRomNameHere
chmod 777 nativesd.sh
./nativesd.sh
exit
exit[/B]
This should modify the ramdisk and copy it to /sdcard/NativeSD and will leave the one in the romfolder as is, if it works great if not, replace the initrd.gz in /sdcard/NativeSD with the one in /sdcard/NativeSD/ROMNAME/
[/INDENT]
(If using nilfs2, you will also need to look in install.sh and change ext4 to auto)
Details
Confirmed working:
Booting to ext4
Booting to nilfs2 (using nilfs2 zips)
Untested:
Modifying from running build
Tested Working ROMs:
NexusHD2-ICS
PACman
MIUIJB
PA-HD2
sundawg
CM9ite 1.1 (QMA version won't work)
Versions
Releases with v will be based on marco.palumbi's method - adding mounts to init.rc
Releases with sc will be based on securecrt's method - using an additional script
Changelog -beta 1
nilfs2 and ext4 tested with same rom, nativesd.sh file removed from zip (as the other files with remain unchanged for the time being)
-------------------------------------
-nilfs-ext4-sc-v
Stripped down andcombined to the one zip
-------------------------------------
-ext4(4) and -nilfs2(4)
sc fixed
-------------------------------------
-ext4(3) and -nilfs2(3)
Bug fixes
-------------------------------------
-ext4(2) and -nilfs2(2)
Fix initrd.gz names with ext4 version,
tmp file copied into NativeSD (hopefully) for debugging purposes
------------------------------------
-ext4 and -nilfs2 versions
Seperate zips for the two file systems for now
Hopefully removed the need to have to manually change the rom_name by reading from install.sh (confirmed)
Completely untested
-------------------------------------
sc1.2
Should now be fixed and work with ext4 (and nilfs2 after removing some lines)
--------------------------------------
sc1.1
Tidy up and fixing issue reported here
--------------------------------------
v1.1
Tidy up
--------------------------------------
sc1 (NativeSD-sc1) :
Based on securecrt's code
EXT4 support
--------------------------------------
v1 (NativeSD.zip) :
Based on marco.palumbi's code
EXT4 and (untested) basic NILFS2 support​
Credits: securecrt, Xylograph, marco.palumbi, ph03n!x, Kokotas,
Testers: Robbie P and jerrysue (for testing the alpha builds)

NAND (Non NativeSD) to NativeSD patch
Have attempted with BBCM7 (as I thought the updater script would be simple) but to no avail.
Also attempted with (the now pulled) SlimICS
Theoretically should just require: adding:
package_extract_file("kernel/install.sh", "/tmp/install.sh");
set_perm(0,0, 0777, "/tmp/install.sh");
run_program("/tmp/install.sh");
if file_getprop("/tmp/nfo.prop","NativeSD") == "true"
then
ui_print("@ Installing System");
package_extract_dir("kernel/bootsd", "/boot");
package_extract_dir("kernel/kernel", "/boot");
package_extract_dir("kernel/bootsd", "/boot_dir");
package_extract_dir("kernel/kernel", "/boot_dir");
package_extract_dir("NativeSD", "/tmp");
set_perm(0, 0, 0777, "/tmp/nativesd.sh");
run_program("/tmp/nativesd.sh");
package_extract_dir("sdcard", "/sdcard");
package_extract_dir("system", "/system");
to the start and adding the below to the end
endif;
delete("/tmp");
unmount("/ext4p");
unmount("/system");
unmount("/data");
modifying according to ROM, removing any yaffs/format references, and adding in a NativeSD folder (#1) and an install.sh​

Boot.img (/also clk) patcher
Once NAND is done should be able to integrate mkbootimg scripts and allow flash boot and sboot

Other devices ???
Anyone willing to try let me know.

FAQ
Fixes Required:
NILFS2
NILFS2 support is currently attempted to be implemented by the following code:
Mount_Type=`mount | grep "nilfs2" | cut -d ' ' -f 5`
if [ "$Mount_Type" == "nilfs2" ]
then
sed -i 's/auto/nilfs2/1
/(NativeSD)/a \mkdir /nilfs\
mount nilfs2 /dev/block/mmcblk0p2 /nilfs' ns/init.rc
else
sed -i 's/auto/ext4/1' ns/init.rc (or ns/mountfs.sh with sc)
Have tried various combinations and added in other lines, to no avail.
Running mount | grep "nilfs2" | cut -d ' ' -f 3 on a running nilfs2 rom will return:
nilfs2
nilfs2
nilfs2
(there might be a fourth (can't recall), due to system, data and NativeSD being mounted as nilfs2)
Is there something I've overlooked? (Have tried with busybox mount | busybox grep | busybox cut)
Or can anyone see the mistake, it runs fine but $Mount_Type wont be reported as nilfs2.
I will post a workaround for nilfs2 but would rather have it integrated.
Edit not the workaround I was thinking of but if using nilfs2 changing == to != should make it work. doesn't seem to runon android
Current workaround is to remove the lines posted above leaving just:
sed -i 's/auto/nilfs2/1
/(NativeSD)/a \mkdir /nilfs\
mount nilfs2 /dev/block/mmcblk0p2 /nilfs' ns/init.rc (or ns/mountfs.sh if using sc)
​
Remove the need for changing ROM_NAME in nativesd.sh

I must be doing something wrong here.
Tried securecrt's zip on mokee and nilfs, reboot after htc screen.
Tred v zip on qsea v2 and ext4, reboot after htc screen.
Tried v zip on nexusHD2 ics and ext4 and it worked.
Tried v zip on pacman and ext4 and reboot.
It seems i am having trouble editing updater script when the rom has separate folders for initrd.gz and zImage. Each time the nand ramdisk appears in folders but is not edited.
Can you post your working edited updater script for pacman rom so that i can see where i have gone wrong.

Robbie P said:
I must be doing something wrong here.
Tried securecrt's zip on mokee and nilfs, reboot after htc screen.
Tred v zip on qsea v2 and ext4, reboot after htc screen.
Tried v zip on nexusHD2 ics and ext4 and it worked.
Tried v zip on pacman and ext4 and reboot.
It seems i am having trouble editing updater script when the rom has separate folders for initrd.gz and zImage. Each time the nand ramdisk appears in folders but is not edited.
Can you post your working edited updater script for pacman rom so that i can see where i have gone wrong.
Click to expand...
Click to collapse
PAC changes with full script attached:
ui_print("@ Installing System");
package_extract_dir("kernel/boot", "/boot");
package_extract_dir("kernel/kernel", "/boot");
package_extract_dir("kernel/kernel", "/boot_dir");
package_extract_dir("NativeSD", "/tmp");
set_perm(0, 0, 0777, "/tmp/nativesd.sh");
run_program("/tmp/nativesd.sh");
package_extract_dir("sdcard", "/sdcard");
package_extract_dir("system", "/system");
as far as I recall I used the attached v1 so should be no problems there, just make sure to change rom_name.
Have tried modifying nand updater-scripts (BBCM7 and SlimICS) but not working at the moment.
Will also post modified scripts to change the ramdisk from a running build (which datagr shouldn't have any problems incoporating into his app).
In terms of nilfs2, have you tried that with v1? Will have a look through sc to see if it's running correctly

In your instructions first post, the code is inserted after "package_extract_dir("system","/system");"
But the working script has it before this. That seems to be where it went wrong for me, because now pacman 1.1 on v with ext4 boots Edit; track forwards/backwards now working too.
The instructions worked for NexusHD2 ics 2.7 though, with the initrd.gz and zImage in the same folder.

Tried nativesdsc1.1 on nilfs with != on pac1.1 -stuck on magldr gogogo. Native sd folder initrd.gz 915.1Mb, NativeSD/PAC folder initrd.gz 168.3Mb
BTW i didn't see a nilfs2 file in sc1.1, does this matter.
BTW2 i have got a working rom on nilfs, but installed it via diff files on post3 fs superthread

Robbie P said:
Tried nativesdsc1.1 on nilfs with != on pac1.1 -stuck on magldr gogogo. Native sd folder initrd.gz 915.1Mb, NativeSD/PAC folder initrd.gz 168.3Mb
BTW i didn't see a nilfs2 file in sc1.1, does this matter.
BTW2 i have got a working rom on nilfs, but installed it via diff files on post3 fs superthread
Click to expand...
Click to collapse
No I incorporated nilfs2 into the nativesd script as it's only two lines. It seems != doesn't work on android, another workaround then that should work is to remove the lines
Mount_Type=`mount | grep "nilfs2" | cut -d ' ' -f 5`
if [ "$Mount_Type" == "nilfs2" ]
then
else
sed -i 's/auto/ext4/1' ns/init.rc altogether
And haven't tested sc at all yet, have been trying to made a text driven script for the on device one.
If your getting that with sc then the script isn't running at all, there'll be a mistake somewhere
Edit. fixed now (sc1 was more right than 1.1)

Just tried sc1.2 on pac1.1 nilfs changed ROM_NAME in install.sh and nativesd.sh and auto in install.sh-hangs on white htc screen
tried deleting everything in between # changing auto to ext4 or nilfs2 and # fixing permissions (and auto to nilfs2 in install.sh), and it hangs on black htc screen.
Edit; just found out i had wrong kernel in my zip.....
Did these two tests again-both times hangs on black htc screen. have attached DMESGs. (i had edited updater-script for these, did not mention this above).

tried pacman 1.1te with v1.1 on ext4 -working
will post initrd.gz on pacman thread

Robbie P said:
Just tried sc1.2 on pac1.1 nilfs changed ROM_NAME in install.sh and nativesd.sh and auto in install.sh-hangs on white htc screen
tried deleting everything in between # changing auto to ext4 or nilfs2 and # fixing permissions (and auto to nilfs2 in install.sh), and it hangs on black htc screen.
Edit; just found out i had wrong kernel in my zip.....
Did these two tests again-both times hangs on black htc screen. have attached DMESGs. (i had edited updater-script for these, did not mention this above).
Click to expand...
Click to collapse
Between # changing auto to ext4 or nilfs2 and # fixing permissions in v you need to leave
sed -i 's/auto/nilfs2/1
/(NativeSD)/a \mkdir /nilfs\
mount nilfs2 /dev/block/mmcblk0p2 /nilfs' ns/init.rc (or ns/mountfs.sh with sc).

Still hanging on htc screen m8.
Will give v1.1 a go.
Edit; Tried v1.1 on pac1.1te on nilfs using working ext4 build as it seemed like it might work-hangs on boot.
Edited as post above (already auto in install.sh), aroma says installed ok, but it took a few seconds. no initrd.gz created.

Just tried cmtight beta v1.0 with nativesd-ext4(2) and it boots with normal initrd.gz
it also boots with v initrd.gz
But with sc initrd.gz it just hangs on htc screen
tmp folder created in NativeSD/CMTight folder, but is empty (on pc)
There seems to be a problem with bt on this ROM, doesn't want to send sound, but skipping tracks works (on v). Saw a post in the nand thread about bt not working.
Will try again with sundawg's cm7 but no luck so far.

Robbie P said:
Just tried cmtight beta v1.0 with nativesd-ext4(2) and it boots with normal initrd.gz
it also boots with v initrd.gz
But with sc initrd.gz it just hangs on htc screen
tmp folder created in NativeSD/CMTight folder, but is empty (on pc)
There seems to be a problem with bt on this ROM, doesn't want to send sound, but skipping tracks works (on v). Saw a post in the nand thread about bt not working.
Will try again with sundawg's cm7 but no luck so far.
Click to expand...
Click to collapse
Thanks, again for testing these, have pulled and readded those zips, the tmp folder should copy now and have changed the sc side based on marco's suggestions (thought I'd already done that).
Should have my phone at the very least in a condition where I can install zips, so will get some testing done myself soon enough.
(Have posted ramdisk for Sundawg-CM7 in the other thead if you haven't seen it, will add another in a few mins)

tried latest on miuijb
tmp folder is full
normal initrd boots
v initrd reboots almost immediately
sc initrd reboots almost immediately
Do you need me to post anything as i am off to bed soon.

Robbie P said:
tried latest on miuijb
tmp folder is full
normal initrd boots
v initrd reboots almost immediately
sc initrd reboots almost immediately
Do you need me to post anything as i am off to bed soon.
Click to expand...
Click to collapse
The init.rc's if you wouldn't mind (off soon myself) and is there a rom_name.txt?
Edit: The init.rc's should be in NativeSD/tmp/ns2 (and ns3) if the folders copied correctly, I take it that there are no folders in tmp then.
Edit. Opened those ramdisks and they just have bin folders (and mountfs.sh with sc); did you remember to add the nand ramdisk to the NativeSD folder in the zip?
That explains why you can't find any init.rc files

couldn't find init.rc, found initrcmod, renamed it to .txt
Edit; doh! they are in these, sorry. Night

ooh, just tried to DL from market using cmtight and initrd-ext4-v.gz from before, and can't DL (error 101). It works ok using normal initrd.gz. No bootloop though, as gtbluesky got in nativesd thread.
Also perhaps miuijb was not best choice for last test, as got the same results as gtbluesky.
---------- Post added at 02:27 PM ---------- Previous post was at 02:12 PM ----------
HypoTurtle said:
did you remember to add the nand ramdisk to the NativeSD folder in the zip?
That explains why you can't find any init.rc files
Click to expand...
Click to collapse
Sorry m8, just checked and no ramdisk.

Related

[Q] Question about making a flashable ROM...

I am trying to build a flashable zip that i compile from the stock system.img and boot.img files from 2.00.405.3 using dsixda's HTC Android Kitchen...
When i go to flash the rom that it creates (even if i dont mod anything else ...) i get a status 0 error..
I edited the update script so that every line could be identified so i could find the last error...
and the last print was "package_extract_dir"...
script follows:
Code:
...
ui_print("format");
format("MTD", "system");
ui_print("mount");
mount("MTD", "system", "/system");
ui_print("package_extract_dir");
package_extract_dir("system", "/system");
ui_print("symlinks");
....
The really interesting thing is that a few lines above this (as can be seen) i format the system partition and upon re-boot the stuff from the old device rom (before my flash attempt) is still on there! ...
What the heck is going on?
Thanks
Kris
Because the flyer/view doesn't use mtd partitions...it uses emmc.
The dsixda kitchen does some conversions on the updater-script that requires some device specific information about mounts. He created a definition folder where you drop device specific definitions for the common mount points.
Go into the kitchen folder > tools/edify_defs
Inside of that folder there are various device definitions. Create one for the flyer. There's also a template in there, but I didn't have much luck editing the template. I just looked at some of the newer defs and plugged in the View mount points.
Here's the one I used for the View, but I'm not sure if the mount points are the same on the Flyer. Also, I'm not sure what the boot mount point for the View is, but writing the boot doesn't seem to require the specific mount.
Code:
change_mnt=yes
param1=ext4
param2=EMMC
param1_sdcard=vfat
param2_sdcard=MTD
sys_mnt=\/dev\/block\/mmcblk0p26
cache_mnt=\/dev\/block\/mmcblk0p31
boot_mnt=???
data_mnt=\/dev\/block\/mmcblk0p30
sdcard_mnt=\/dev\/block\/mmcblk1p1
Ahh that explains it ... i looked through my procs/mounts and found the info
sys_mnt=\/dev\/block\/mmcblk0p25
cache_mnt=\/dev\/block\/mmcblk0p30
boot_mnt=???
data_mnt=\/dev\/block\/mmcblk0p29
Kris
I put in:
Code:
format("ext3", "EMMC", "/dev/block/mcblk0p25");
mount("ext3", "EMMC", "/dev/block/mcblk0p25", "/system");
This causes the status 0 error still when i copy over the files tho with package_extract_dir
Also tried ext4 ... this produces the same issue as above (status 0)
Thanks
Kris
I tried using what was listed about for the View but it doesn't work on the wifi Flyer. How do you find out what they should be? I get a Status 1 error when trying to flash.
Try cat /proc/emmc. Boot is mmcblk0p22 on the view. Thanks to IEF for the pointer
Sent from my SPH-D700 using XDA App

[HOW-TO][TUTORIAL][WIP]DEODEX, BUILD KERNEL, BUILD CUSTOM ROM and MORE

Hi all,
In this thread, I will try to share the knowledge I have on deodexing, making custom ROMs, modifying initramfs, building kernel and much more.
Please check the below posts for each of these tutorials.
Hope this opens doors to many new ROM and Kernel developers.
NOTE: THESE TUTORIALS ARE WRITTEN FOR GT-I9100. WILL NOT WORK ON OTHER DEVICES. I DON'T TAKE ANY RESPONSIBILITY IF YOU MESS UP AND BRICK YOUR DEVICE OR ANYTHING ELSE. USE AT YOUR OWN RISK.
Deodexing Stock Rom
For GINGERBREAD ROMS:
What you need to have:
xUltimate v2.3.3 - you can download it HERE (Thanks and Credits to Xeudoxus for this awesome app)
Rooted kernel with busybox
JDK installed on your Windows system
If adb is not available in your windows PC, in xUltimate folder open "jar" folder. You'll find adb there.
Extract stock app & framework folders and Deodex:
Connect your device to computer.
Start xUltimate (double-click on Main.exe)
Select option 1. (Pull /system/app)
Once option is done, select option 2. (Pull /system/framework)
In the same folder, now you'll see two new folders (origi_app, origi_frame)
Select option 3 in Main menu (Deodex /system/app)
Once its done, select option 4 in Main menu (Deodex /system/framework)
DONE!!
NOTE: If any apk/odex gives issues while deodexing, remove that corresponding apk and odex from origi_app folder and deodex again. (Mostly the apps which can be downloaded from play store might give errors.. ex: Maps, Voice search etc.)
Now you'll see two new folders done_app and done_frame.
Push deodexed app and framework to device:
Connect your device to PC in USB debugging mode.
Copy done_app and done_frame folders to root of sdcard (/sdcard).
Open Windows command prompt and type the below commands.
Code:
[LIST]
[*]adb shell
[*]su
[*]stop
[*]mount -o remount,rw /dev/block/mmcblk0p9 /system
[*]rm /system/app/*.odex
[*]rm /system/framework/*.odex
[*]busybox cp /sdcard/done_app/* /system/app/
[*]busybox cp /sdcard/done_frame/* /system/framework/
[*]chmod 644 /system/app/*
[*]chmod 644 /system/framework/*
[*]mount -o remount,ro /dev/block/mmcblk0p9 /system
[*]sync
[*]reboot recovery
[/LIST]
In Recovery, Wipe Cache and Wipe Data/Factory reset.
Reboot.
Now you've deodexed app and framework.
For ICS ROMS:
For ICS Roms, the process is quite easy. (Thanks and Credits to jaydvn.)
Download the attached zip file.
Extract it on your windows PC.
Copy your /system/app to _app folder
Copy your /system/framework to _framework folder.
Run AutoDEOToolMain.bat
Follow the instructions.
deodexed jars and apks will be found in deodexed_APK and deodexed_JAR.
Push deodexed app and framework to device:
Connect your device to PC in USB debugging mode.
Copy deodexed_APK and deodexed_JAR folders to root of sdcard (/sdcard).
Open Windows command prompt and type the below commands.
Code:
[LIST]
[*]adb shell
[*]su
[*]stop
[*]mount -o remount,rw /dev/block/mmcblk0p9 /system
[*]rm /system/app/*.odex
[*]rm /system/framework/*.odex
[*]busybox cp /sdcard/deodexed_APK/* /system/app/
[*]busybox cp /sdcard/deodexed_JAR/* /system/framework/
[*]chmod 644 /system/app/*
[*]chmod 644 /system/framework/*
[*]mount -o remount,ro /dev/block/mmcblk0p9 /system
[*]sync
[*]reboot recovery
[/LIST]
In Recovery, Wipe Cache and Wipe Data/Factory reset.
Reboot.
Done.
Enjoy.
Building kernel
Okay. Let's learn how to build kernel for GT-I9100. There are many ways to build. I am just presenting here the way I build and make kernel.
NOTE 1: Follow the instructions exactly.
NOTE 2: Kernel is opensource. If you make any changes to it, you're expected to share your source. (Usually people share it over github )
NOTE 3: FLASHING KERNEL IS RISKY AND DANGEROUS. BE CAREFUL. BUILD AND FLASH ON YOUR OWN RISK.
What you need to have:
Ubuntu 10.04 and above (I use 10.04 )
ARM tool chain (Download HERE. Click on IA32 GNU/Linux TAR under Advanced Packages)
Samsung's opensource kernel for GT-I9100 (Download HERE. Go to Mobile->Mobile Phone-> Select I9100 (update 3 for Gingerbread and update 4 for ICS) and download the zip)
Setting up toolchain:
Extract the tar you downloaded(Suggestion: Extract to one folder where you can have everything. In my case /home/superatmos/build_kernel).
After extracting, you'll see a folder named arm-2010q1. Inside there will be many folders (ex. bin, lib and so on.)
Folder structure will be: /home/<your_name>/build_kernel/arm-2010q1
Setting up kernel:
Extract the zip you've downloaded from samsung's opensource.
You'll find two zips.
Extract GT-I9100_Kernel.tar.gz to /home/<your_name>/build_kernel/
Folder structure: /home/<your_name>/build_kernel/GT-I9100_Kernel
Setting up initramfs:
Samsung's zImage is divided into two parts: Opensource kernel (which you downloaded from samsung's website) and initramfs (which is root file system to boot up the device).
You can extract initramfs from your zImage using the below mentioned links (Credits and Thanks to Chenglu) Original Thread: HERE
To extract initramfs from Gingerbread zImage: HERE
To extract initramfs from ICS zImage: HERE
Folder structure: /home/<your_name>/build_kernel/initramfs
Now the entire setup is ready. Let's start modifying kernel configuration.
Setting up kernel config:
For Gingerbread:
Go to /home/<your_name>/build_kernel/GT-I9100_Kernel/arch/arm/configs folder.
Copy c1_rev02_defconfig file and paste it in kernel root folder (/home/<your_name>/build_kernel/GT-I9100_Kernel/).
Rename c1_rev02_defconfig to .config in kernel root folder.
Now open Makefile which is in your kernel root folder(/home/<your_name>/build_kernel/GT-I9100_Kernel/).
Modify the below lines (I guess line 195 and 196).
For ICS:
Go to /home/<your_name>/build_kernel/GT-I9100_Kernel/arch/arm/configs folder.
Copy u1_defconfig file and paste it in kernel root folder (/home/<your_name>/build_kernel/GT-I9100_Kernel/).
Rename u1_defconfig to .config in kernel root folder.
Now open Makefile which is in your kernel root folder(/home/<your_name>/build_kernel/GT-I9100_Kernel/).
Modify the below lines (I guess line 195 and 196).
Code:
ARCH ?= arm
CROSS_COMPILE ?= /home/<your_name>/build_kernel/arm-2010q1/bin/arm-none-linux-gnueabi-
Save and close.
Modifying kernel configuration:
Now open .config file(which you renamed). If its not seen, it might be hidden. Go to View->Show hidden files and there you go.
Do the below things:
Adding local version:
Change CONFIG_LOCALVERSION=" " to anything you like. I add this way:
CONFIG_LOCALVERSION="-I9100-superatmos"
Adding initramfs path:
You need to let kernel know the path from which it needs to take initramfs.
Change CONFIG_INITRAMFS_SOURCE=" " to ../initramfs (In this tutorial it's the path. If you had copied anywhere else, give the path properly).
Enough for now. Once you get experience, you can modify many configurations as per your liking and save. This configuration can be changed by GUI too with the command make menuconfig.
The Important part: Building the kernel:
For Gingerbread:
Open terminal.
Go to path /home/<your_name>/build_kernel/GT-I9100_Kernel/
Type make.
For ICS:
Open terminal.
Go to path /home/<your_name>/build_kernel/GT-I9100_Kernel/
Type export USE_SEC_FIPS_MODE=true
Type make.
THAT'S ALL. YOUR zImage is ready and is available in /home/<your_name>/build_kernel/GT-I9100_Kernel/arch/arm/boot/zImage.
Install the zImage on the device:
Go to the path where zImage is present and type the below line in command line.
Code:
tar cvf I9100_kernel.tar zImage
Flash the tar using odin.
DONE. CONGRATULATIONS. NOW YOU'VE YOUR OWN KERNEL.
Give me your feedback so that I can improve this tutorial. And post here about how your build went. All the best.
Making custom ROM
Let's move on to make a custom ROM.
Inputs/Feedback/Suggestions are more than welcome. Lets improve this tutorial together for the betterment of the android community.
Steps involved in making a custom ROM:
Getting the system dump from the device.
Deodexing app and framework folders.
Creating various mods by modifying framework and system files.
Modifying build.prop and adding tweaks.
Making META-INF folder and writing an updater-script (edify scripting).
Signing the ROM and making a flashable zip.
Folder Structure:
Before going forward, let's follow the below structure folder to make the tutorial more understandable.
Let our ROM name be CustomROM. The folder structure will be C:\Users\<your name>\CustomROM.
Let's move step by step. Are you ready??
Getting the system dump from the device
Click to expand...
Click to collapse
Make sure USB debugging is ON and connect your device to the PC.
Open command prompt on your windows PC and go to CustomROM folder path.
Type adb devices. You should be able to see the device detected. (If not check environmental variables whether adb is in system path or not. If not present, add the adb path.)
Type the below command to get the dump of system folder.
Code:
adb pull /system system/
Now inside the folder CustomROM, you should be able to see system folder with many folders like app, etc, framework etc inside.
Done with first step.
Deodexing app and framework folders
Click to expand...
Click to collapse
Look HERE how to deodex app and framework folders. Copy the app and framework folders to xUltimate folder, rename them to origi_app and origi_frame and follow the given link to deodex.
NOTE: After deodexing, merge origi_app folder with app folder under C:\Users\<your name>\CustomROM\system\app and origi_frame with framework folder under C:\Users\<your name>\CustomROM\system\framework.
Creating various mods by modifying framework and system files
Click to expand...
Click to collapse
Okay. This the section where your hardwork, innovation and talent comes in. You can use the mods available already, create your own mods, port various mods from other devices and so on.
Below is a list of various mods which can be ported on to GT-I9100. All the credits go these respective thread owners. Thanks to them.
Lidroid 14 toggle mod
Extended power menu with/without header
CRT Off Animation & SIP Over LTE/HSPA
Swipe to remove notifications
NOTE: Let me know more mods with links so that I can add here.
Modifying build.prop and adding tweaks
Click to expand...
Click to collapse
Okay. This is one of those files where you name your ROM(to be visible in settings. ) and add many tweaks.
To name your ROM (to be visible in settings), change the below code.
Code:
ro.build.display.id=CustomROM v1.0
Check the below links for many other tweaks. All credits go to respective thread owners. Thanks to them.
build.prop tweaks by TheFrankenstain
build.prop tweaks by dhlalit11
Making META-INF folder and writing an updater-script (edify scripting)
Click to expand...
Click to collapse
Once you're done with all the modifications, mods and additions, its time to create META-INF folder and make the updater script. Once the user flashes the ROM zip, this is the script that runs and does everything written inside the script. PLEASE BE CAREFUL WITH THIS. TAKE REFERENCE FROM OTHER (SAME DEVICE) ROMS' UPDATER-SCRIPT. (In this case, take reference from other GT-I9100 roms.)
Check the below links for tutorial and how-to on writing edify script and making updater script. All credits go to respective owners of the threads. Thanks to them.
Edify Scripting, Making Flashable ZIPs, ZIP Signing & Key Creation
Edify Scripting Notes
How to Write an Updater-Script with Edify Code
Edify Installation Script Syntax's
NOTE: system folders path, boot/kernel partition path, modem partition path and so on are COMPLETELY DIFFERENT for DIFFERENT DEVICES. Check the partitions for your device properly, carefully and then work on updater-script. TAKE HELP OR REFERENCE FROM OTHER ROM DEVELOPERS FOR YOUR DEVICE.
Lets move on to last step. Making a signing and making a flashable zip.
Signing the ROM and making a flashable zip
Click to expand...
Click to collapse
Make sure, now you should be able to find two folders (META-INF and system) inside C:\Users\<your name>\CustomROM.
Check in THIS thread for test signing your ROM. It WORKS with GT-I9100.
or Check THIS thread to create your own signing key and certificate.
Now you're done with making a custom ROM. Hope to see more custom ROMs from many users.
Give me your feedback so that I can improve this tutorial. And post here about how your custom ROM making went. All the best.
last one
i don't see any tutorials just links to a diff thread and a rom that won't work on i9100
buster041284 said:
i don't see any tutorials just links to a diff thread and a rom that won't work on i9100
Click to expand...
Click to collapse
You're quite fast Updated Deodexing and Building kernel section..
Great thread Superatmos. I'll definately have a go at this.
Quick question ? Am i right in assuming that although your tutorial says to connect your device this line from xUltimate seperceeds that ?
"Alright xUltimate has been updated to v2 What this means is that you do not need your phone connect to your computer to deodex. So you can just manually place the .odex files in (\origi_frame\) and (\origi_app\) and it will deodex. You can also transfer the .odex files from your phone like the last version."
where do I get the zImage to extract the initramfs from? I can't seem to find the zImage on my phone or in the source anywhere.
Great
Very useful.. Added to my favorite.
Thank's man, i'll read that
puccini said:
Great thread Superatmos. I'll definately have a go at this.
Quick question ? Am i right in assuming that although your tutorial says to connect your device this line from xUltimate seperceeds that ?
"Alright xUltimate has been updated to v2 What this means is that you do not need your phone connect to your computer to deodex. So you can just manually place the .odex files in (\origi_frame\) and (\origi_app\) and it will deodex. You can also transfer the .odex files from your phone like the last version."
Click to expand...
Click to collapse
Connect your device to the PC and double click Main.exe inside xUltimate folder. Follow the instructions you see from then. Its quite self explanatory.
If you already have origi_app and origi_frame folders, then just double click on Main Skip.bat.
dmp450 said:
where do I get the zImage to extract the initramfs from? I can't seem to find the zImage on my phone or in the source anywhere.
Click to expand...
Click to collapse
Use ktool (available on market.. compatible with I9100) and click on Dump current kernel. You'll find it on sdcard.
One more way is when you download firmware from sammobile.com, just extract the file and you'll find zImage inside it.
Nice thread,
I m waiting from long time.
Thanks for your work.
Sent from my GT-I9100 using XDA
Making custom ROM section updated
Hi all,
Please find updated custom rom section HERE.
Feedback and suggestions welcome.
Thanks for the kernel part, will come in handy
Enviado desde mi GT-I9100 usando Tapatalk 2
Good tutorial, thanks.
How do you guys sign the rom if you are on Linux (ubuntu for me)
hi superatmos
thanks for this handy thread...may i ask your for a help here?why in my every deodexing always gives error result?
I attach the screenshots.
Many thanks in advance
tks mate will try to pack my own kernel following this method
Sent from my GT-I9100 using Tapatalk 2

[GUIDE][How to Make CWM Recovery Flashable Zip file without Computer]

Hey Ace Users,
I am going to provide you all the guide to create your own CWM Flashable zip file.
The Best Part of this guide is that you wont need your computer to create the CWM Flashable zip file as this guide will teach you all how to create the CWM Flashable Zip file with the help of the Root Explorer App.
The things you will need for this guide are:-
1.Root Explorer App.
2.Your Ace.
3.A little patience.
So without much ado,Lets start the guide.
STEPS:-
1.Download and install the Root Explorer App.
2.Open the Root Explorer App and Navigate to the Root of your SD Card.
3.Create a Folder and name it whatever you like or whatever name you want to give to your Zip File(I will be reffering to the folder as "Main Folder" throughout this guide)
4.In the Main Folder,you will need to have Two Sub-Folders which are as "META-INF" And "system".
5.The META-INF Folder consists of various files and they should be untouched(The only file in the META-INF folder which we are going to edit is the updater-script).
6.The system folder which you put in the Main Folder contains the apps or various other mods which you want to apply to your ace.
Steps on How to Edit the updater-script:-
1.Go to the META-INF Sub-Folder in the Main Folder.
2.open the com folder which you will find in the META-INF Sub-Folder.
3.Then you will see google folder as soon as you enter "com" folder,enter the google folder,now you will see "android" folder,open it.
4.In the android folder,you wll see two files named as update-binary and updater-script.
5.Open the updater-script file by selecting it.
6.You will see various options.
7.Select the Text Editor option and then the updater-script will open in the text editor.
8.Now we need to type some code so as to have the following functions.
Editing the updater-script:-
So once the updater-script is opened in the text editor,you will need to type some code so as to have the following functions.
CODE:-
Case 1:-
To Display the information of the particular Mod when you select to flash it in CWM Recovery(It is the display you see when you flash a particular Flashable zip file. For Example:- if you are flashing beats mod then when you select to flash the zip file and when the flashing starts you see some infomation like "Beats For Ace" and when the flashing is over you can see that the display shows flashing is done and it tells to reboot phone and stuff)
CODE:-
ui_print("The Text you want to display");
For Example if you want to display "beats Mod for Ace" then you must enter the code as ui_print("Beats Mod for Ace");
NOTE:-
semi-colon and the double quotes in the above code are to be put as they are compulsary to execute the code.
Case 2:-
If You want the updater-script to mount the /system partition,then the code is:-
CODE:-
run_program("/sbin/busybox", "mount", "/system");
NOTE:-
semi-colon and double quotes are compulsary.
Case 3:-
Now we need to put the apps in the /system partition and for that we need to type the code as:-
CODE:-
package_extract_dir("system", "/system");
NOTE:-
semi-colon and double quotes are compulsary.
Case 4:-
After typing the mount /system code you will also need to unmount the /system partition and to unmount the /system partition the code is:-
CODE:-
run_program("/sbin/busybox", "unmount", "/system");
NOTE:-
Semi-colon and double quotes are compulsary.
Special Case:-
After each case we need to have a special code.
At the start of updating the updater-script,we mostly write the introduction of the mod/script etc. in the ui_print.
so before you add the name & info of the mod in the ui_print you need to write show_progress(0.500000, 0);
and after writing the name/info of the mod,you will be mostly writing the code to mount the system partition,so after writing the code to mount the system partition,you need to write show_progress(0.500000, 20)
Now once you are done writing the code to mount the system partition the next thing you will be doing is extracting the package from the system partition by writing the code for extracting the system partition contents,so after you are done writing the code for extracting the system partition contents,you need to write show_progress(0.500000, 40)
Now after this,you will be writing the code to unmount the system partition so after writing that code you need to write show_progress(0.500000, 60)
After finishing writing the code to unmount the system partition,
you will add some more lines in the ui_print as for example Done flashing mod,so after writing that lines in the ui_print you will need to write show_progress(0.500000, 80)
After that you will probably write some more lines in the ui_print to notify the user to reboot his/her phone so after you write that code you will need to write show_progress(1.000000, 0)
Basically the show_progress command indicates the progress of the installation of the mod.
Sample of the whole updater-script codes in short:-
ui_print("Battery Mod For SGA");
ui_print("|-----by XYZ-----|");
ui_print("10% starting installation");
show_progress(0.500000, 0);
ui_print("20% mounting /system");
run_program("/sbin/busybox", "mount", "/system");
show_progress(0.500000, 20);
ui_print("40% Extracting Files");
package_extract_dir("system", "/system");
show_progress(0.500000, 40);
ui_print("60% unmounting /system");
run_program("/sbin/busybox", "unmount", "/system");
show_progress(0.500000, 60);
ui_print("|---Mod Flashed Successfully---|");
show_progress(0.500000, 80);
show_progress(1.000000, 0);
ui_print("Please Reboot Your Phone");
If you don't understand the show_progress procedure then check this link:-
http://rootzwiki.com/topic/6761-show...me-flashables/
NOTE FOR CM7 USERS:-
IF THE ABOVE CODE FOR MOUNTING AND UNMOUNTING THE /SYSTEM PARTITION DOESNT WORK FOR YOU,THEN YOU CAN MANUALLY MOUNT /SYSTEM BEFORE FLASHING AND THEN MANUALLY UMMOUNT IT(IF YOU WANT TO) AFTER FLASHIMG.
NOTE:-
AFTER SAVING THE CHANGES DONE TO THE updater-script,A FILE WILL BE CREATED AS "updater-script.bak".DELETE "updater-script.bak" file.
Okay so we are almost done.
Now some information about the system Sub-folder in the Main Folder.
The system Sub-folder contains another Sub-folder(s) like:-
For example if you want to add an app's apk file then the system sub-folder will contain "app" sub-folder and that app folder contains the apk file(s) that you want to put in the system partition of the ROM.
If you want to Put Framework Mods then the system sub-folder will contain "framework" sub-folder and the "framework" sub-folder wil contain the framework Mod(mostly the Framework mods are in Framework-res.apk file.)
If you want to put libs then the subfolder in the system subfolder will be "lib" and it will contain the libs.
If you want to put bin files then the subfolder in the system subfolder will be "bin" and it will contain the bin files.
If you want to add scripts then the subfolder in the system subfolder will be "etc" subfolder and in that "etc" subfolder there will be another subfolder as "init.d" and in the init.d subfolder there you can put the scripts.
After doing all that(i.e editing the updater-script and putting the files in the subfolders in the system subfolder) go back to the directory where you created the Main Folder and in Root explorer long press the Main Folder and you will get various options.
scroll down and select "zip this folder" and after the folder is zipped you can go to /SD Card/speed software/zip and find the flashable zip there.
Here ends my guide
Download Links:-
Sample file dl link
Screenshots of guide
Good..!!Helpful for lot of people:thumbup:
side_effect said:
Good..!!Helpful for lot of people:thumbup:
Click to expand...
Click to collapse
Helpful. Thanks
Sent from my GT-P6200 using Tapatalk 2
great guide :good::good::good:
but AFAIK guides are supposed to b in general...EET will move this soon
-RDR- said:
great guide :good::good::good:
but AFAIK guides are supposed to b in general...EET will move this soon
Click to expand...
Click to collapse
No they are meant to be in Development section.
I have seen many guides in development section of many phones.
Nope. Guides should be in General Section. Guides are not developing project.
This was sent from my impulses, not my Galaxy Ace.
Moving to General
Well we will have to remember alot of things before making a zip..
It will not be so easy
Really great guide....................
Sent from my GT-S6102 using Tapatalk 2
thanks for sharing
helpful
for
newbies
.......
i will try this when i get time.
thanks for this man!!
Sent from my GT-S5830 using xda premium
Thx!!!!!
Thx a lot man !!
Depuis mon Galaxy Ace GT-S5830-SGSII v9 modifié !!!
@Ace King 34
Hahaha...i think that you have forgot of put some things in this guide, and then about the command show_progress i think that you not have understood really how works.
Sent with my Evil GT-S5570 from Hell
EVIL THOR said:
@Ace King 34
Hahaha...i think that you have forgot of put some things in this guide, and then about the command show_progress i think that you not have understood really how works.
Sent with my Evil GT-S5570 from Hell
Click to expand...
Click to collapse
You Surely don't know how to read.
Read the Special Case in the OP Carefully.
It has got the show_progress.
and btw read the OP carefully next time before posting such replies.
Ace King 34 said:
You Surely don't know how to read.
Read the Special Case in the OP Carefully.
It has got the show_progress.
and btw read the OP carefully next time before posting such replies.
Click to expand...
Click to collapse
Surely you don't know read because i know read better than you Ace Chick, at least you know what do the value 40 in the command show_progress? your guide has only some commands copied from others updater-scripts but you don't know not even what they do...pfff...
Sent with my Evil GT-S5570 from Hell
@ EVIL THOR Thanks for Reporting me the issue mate.
I have changed the OP a bit.
Have a Look.
Ace King 34 said:
@ EVIL THOR Thanks for Reporting me the issue mate.
I have changed the OP a bit.
Have a Look.
Click to expand...
Click to collapse
Yes ok but the last show_progress should be 100 not 0 if not the bar of progress show only 80% and then go back to 0%.
Sent with my Evil GT-S5570 from Hell
EVIL THOR said:
Yes ok but the last show_progress should be 100 not 0 if not the bar of progress show only 80% and then go back to 0%.
Sent with my Evil GT-S5570 from Hell
Click to expand...
Click to collapse
mate I have changed the 0.500000 to 1.00000 and then I have written 0 so it changes the progress from 0.500000 to 1.000000 and I have tested it mate
it worked flawlessly.

[Q] Fujitsu M532 (pegatron chagall) system.img issue (custom ROM)

Hello
I'm trying to flash custom ROM for this tablet. I have made rom based on stock rom with Android Kitchen. I also received from fujitsu kernel source code, unfortunetely without make file (lol), so I can not compile it. Still, I'm using stock kernel, CWMR
Problem is that only stock ROM witch it's ORIGINAL *.img files inside works. Nothing other works - android do not boots.
I have tried in many ways and noticed folowing problems:
1. after stock ROM instalaton, I removed content of /system, and than push with adb the SAME /system folder - stops booting
2. Android Kitchen can not unpack stock system.img file
3. Ext2explorer is openig system.img, but with following error:
Code:
Partition Table Error on system.img
Invalid End of sector markerBlock size 4096, inp 8192, inodesize 256
Linux Partition found on disk 2 partition 0
Error reading Inode 0 parent inode 2.
4. The stock ROM has CUSTOM partition.
5. Flashing custom rom trought CWMR with system directory or img is not working - same result as after changing files on system parition
6. Flashing stock rom with unpacked system.img (as folder) is not workig.
This is updater-script of stock ROM:
Code:
run_program("/system/bin/mkdir", "/etc/firmware");
package_extract_file("mcuLoader","/cache/mcuLoader");
run_program("/system/bin/chmod", "777", "/cache/mcuLoader");
package_extract_file("CY8C20324_BAT_16.i2c","/etc/firmware/CY8C20324.i2c");
run_program("/cache/mcuLoader");
run_program("/system/bin/rm", "/etc/firmware/CY8C20324.i2c");
run_program("/system/bin/rm", "/cache/mcuLoader");
sleep(20);
package_extract_file("CY8C20324.i2c","/etc/firmware/CY8C20324.i2c");
package_extract_file("mcuLoader","/cache/mcuLoader");
run_program("/system/bin/chmod", "777", "/cache/mcuLoader");
run_program("/cache/mcuLoader");
unmount("/system");
mount("ext4", "EMMC", "/dev/block/platform/sdhci-tegra.3/by-name/APP", "/system");
show_progress(0.500000, 0);
package_extract_file("boot.img", "/dev/block/platform/sdhci-tegra.3/by-name/LNX");
package_extract_file("system.img", "/dev/block/platform/sdhci-tegra.3/by-name/APP");
show_progress(0.200000, 0);
package_extract_file("custom.img", "/dev/block/platform/sdhci-tegra.3/by-name/CUS");
assert(nv_copy_blob_file("blob", "/staging"));
show_progress(0.100000, 0);
What is mcuLoader and *.i2c files for?
Conclusion:
Exchanging almost every file (I menaged to delete odex files and push them again with working result) on system parition prevents booting (before adb starts, so I do not know how to get any logs).
Can anyone help solve the problem?
BTW: It would be nice to create some custom ROMs for this device - It's quite popular, as it is the same tablet as Pegatron Chagall, Olivetti Olipad 3, Siragon N4 and Realpad Bunaken
Help
Hey, i have the Siragon 4N and i accidentally bricked the device and can't go to fastboot mode, can you help me with that? is there any way i can create an update.zip with the original files to flash it with the original recovery? Please Answer me
rupertst said:
Hello
I'm trying to flash custom ROM for this tablet. I have made rom based on stock rom with Android Kitchen. I also received from fujitsu kernel source code, unfortunetely without make file (lol), so I can not compile it. Still, I'm using stock kernel, CWMR
Problem is that only stock ROM witch it's ORIGINAL *.img files inside works. Nothing other works - android do not boots.
I have tried in many ways and noticed folowing problems:
1. after stock ROM instalaton, I removed content of /system, and than push with adb the SAME /system folder - stops booting
2. Android Kitchen can not unpack stock system.img file
3. Ext2explorer is openig system.img, but with following error:
Code:
Partition Table Error on system.img
Invalid End of sector markerBlock size 4096, inp 8192, inodesize 256
Linux Partition found on disk 2 partition 0
Error reading Inode 0 parent inode 2.
4. The stock ROM has CUSTOM partition.
5. Flashing custom rom trought CWMR with system directory or img is not working - same result as after changing files on system parition
6. Flashing stock rom with unpacked system.img (as folder) is not workig.
This is updater-script of stock ROM:
Code:
run_program("/system/bin/mkdir", "/etc/firmware");
package_extract_file("mcuLoader","/cache/mcuLoader");
run_program("/system/bin/chmod", "777", "/cache/mcuLoader");
package_extract_file("CY8C20324_BAT_16.i2c","/etc/firmware/CY8C20324.i2c");
run_program("/cache/mcuLoader");
run_program("/system/bin/rm", "/etc/firmware/CY8C20324.i2c");
run_program("/system/bin/rm", "/cache/mcuLoader");
sleep(20);
package_extract_file("CY8C20324.i2c","/etc/firmware/CY8C20324.i2c");
package_extract_file("mcuLoader","/cache/mcuLoader");
run_program("/system/bin/chmod", "777", "/cache/mcuLoader");
run_program("/cache/mcuLoader");
unmount("/system");
mount("ext4", "EMMC", "/dev/block/platform/sdhci-tegra.3/by-name/APP", "/system");
show_progress(0.500000, 0);
package_extract_file("boot.img", "/dev/block/platform/sdhci-tegra.3/by-name/LNX");
package_extract_file("system.img", "/dev/block/platform/sdhci-tegra.3/by-name/APP");
show_progress(0.200000, 0);
package_extract_file("custom.img", "/dev/block/platform/sdhci-tegra.3/by-name/CUS");
assert(nv_copy_blob_file("blob", "/staging"));
show_progress(0.100000, 0);
What is mcuLoader and *.i2c files for?
Conclusion:
Exchanging almost every file (I menaged to delete odex files and push them again with working result) on system parition prevents booting (before adb starts, so I do not know how to get any logs).
Can anyone help solve the problem?
BTW: It would be nice to create some custom ROMs for this device - It's quite popular, as it is the same tablet as Pegatron Chagall, Olivetti Olipad 3, Siragon N4 and Realpad Bunaken
Click to expand...
Click to collapse
hey man, i just got the tablet, did you get any progress on your rom? or found any other rom for this deivce?
Need boot.img for DNS/Pegatron 110G. ICS 4.03. Franco.kernel updater fails
Hello. I need help and maybe I can somehow help You. I need to reflash DNS/Pegatron 110G, Android 4.03. It is a copy of Fujitsu STYLISTIC M532
I need kernel update- a file boot.img for this device for JB 4.11
The tested procedure of reflashing for Pegatron is to update kernel by franco.kernel updater (FKU) and then update from SD card by M532 firmware pkg with corrected 07 byte. Unfortunately FKU is no more compatible with this device, FKU old versions cannot connect to server. I need kernel file boot.img for this device - there is a good utility from 4pda.ru that also can update kernel. This utility by AlexBlast can do a lot of things trough ADB interface. A link is in attached file. Also I placed a link to nvflash drivers. Nvflash is used to flash Nvidia chipset. I think they will be usefull for You.
I made a backup and took a risk to flash M532 version 14405 without kernel update. Now it hangs after boot but ADB interface works and recovery mode works. So I must make kernel update or make a restore. I need boot.img
I need to attach file since I cannot place outside link in the post
Hi,
Does anyone have been able to cook a ROM for this tablet?

How to bump yourself stock kernel, modify ramdisk to add init.d + SELinux permissive

Hello,
I spent a lot of time searching and finding the material to understand and reproduce process about bump!.
After a few times shared the results of my manipulations on stock kernel, which I applied the method I'll describe here, I will try now to explain how you can make for yourself an identical result.
If you are still wondering what is Bump! I can only invite you to look for yourself, and even give you the link where I tried to answer this question on the section of the G2.
The purpose of this topic is to get you to bump kernel, from a PC, Linux, or Windows, or even from the phone.
I'll try to explain as why certain steps are essential to ensure a good result, steps that, at first, did not seem obvious.
When you will try it, and will want to test the result, make sure nice to have taken the necessary precautions before: Make a backup of your current kernel foremost flashing.
Now, you know what is BUMP! and why kernel must be bumped. Bump! basically involves injecting a signature in a file (boot).
This injection of the signature to be made in hexadecimal format, and immediately after the last used page of the kernel, we have to remove unnecessary bytes before doing so, and unpack/repack kernel is the easiest way to do so (http://forum.xda-developers.com/showpost.php?p=60086231&postcount=42). To do that, we need two binaries (unpackbootimg and mkbootimg).
About these two binaries, we can compile them ourselves from source, or taking already compiled bins.
@osm0sis made and share a super tool containing all that we need, these compiled bins, in his Android Image Kitchen - Unpack/Repack Kernel Ramdisk [Win/Android/Linux].
So i propose to use it here. The big advantage to this, is that @osm0sis compiled for windows, linux, and phone (arm). He created scripts that automate unpack and repack too.
The purpose of this topic is not to learn how to get the kernel file (boot), I assume that this prerequisite is acquired. However, I give you some hints for beginners, you can take a look at KDZ and TOT Extractor from @bullghost or the dd command to achieve.
1) Simply Bump a stock kernel in Linux (no change in ramdisk) to obtain a bumped working untouched stock kernel
Download the linux version of Android Image Kitchen - Unpack/Repack Kernel Ramdisk [Win/Android/Linux] ( AIK-Linux-v1.9.1-ALL.tar.gz), and untar it somewhere. Create, in the root directory of AIK, one file named "one_shot_bump.sh" (or the name that you like) containing this code I gave in osm0sis AIK thread (or, if you prefer, you can take the file named "linux_one_shot_bump_only.tar.gz" in attached files here), and chmod it 755.
Now you can use it by opening a terminal and drag and drop this file inside following by drag and drop kernel file too. Press enter, it's done You'll find a file named bumped.img, in AIK root directory, wich is your bumped kernel.
Note: bash for this script is very important for an expected result for printf cmd. It doesn't work as expected with sh.
2) Simply Bump a stock kernel in Windows (no change in ramdisk) to obtain a bumped working untouched stock kernel
I've not made a one click script to bump on this OS, but I'll explain very simply how to get there using the scripts offered natively in the osm0sis tools . This fair will be in three stages, for the reasons discussed in the preamble:
1) unpack the kernel
2) repack the kernel
3) inject hexa signature (bump!)
So to begin, download the windows version of Android Image Kitchen - Unpack/Repack Kernel Ramdisk [Win/Android/Linux] (Android.Image.Kitchen.v2.3-Win32.zip).
Unzip it where you want. Open a dos prompt and drag and drop unpackimg.bat on the prompt windows, tape one spaces in the command and drag and drop your kernel file in the prompt windows. Tape on enter: You made the first step, your kernel is unpacked.
Don't close window prompt, tape one touch to continue, as the prompt invite you to do.
Now, just drag and drop repackimg.bat in the prompt windows, and tape on enter. Done, you just finished the second step, you've repacked the kernel (image-new.img on the root folder of AIK).
Now, for doing the step 3, you need to inject the signature. I have not found other solutions at the moment than to use a hex editor to do this. I tried with a shareware (Hex Editor) and also with a freeware (HxD) with succes for these two softwares. With Hex Editor, after opening image-new.img, click on the first free byte at the end of the file and copy paste there "41A9E467744D1D1BA429F2ECEA655279" (without double quote). Save the file.
Or with HxD, after opening image-new.img, click at the end of the file, just after the last used byte, and in the menu"edition", choose "insert bytes". On the dialog box, type 10 on the first field (amount), let "hex" checked, and paste in the second field the value "41A9E467744D1D1BA429F2ECEA655279" (without double quote). Save the file.
Done, you just finished bumping your kernel in windows
I can give later screenshot if needed/asked.
Edit: i've found a workaround for using @osmosis tool to sign (bump) kernel just after repacking. Details can be found here: http://forum.xda-developers.com/showthread.php?p=63884919#post63884919
Edit2: After talking with @osmosis, the best solution for signing (bump) the kernel just after repacking should be to use cygwin printf.exe (I've attached this file to this post), that can be added in aik/bin folder (the real name of this folder is android_win_tools and it can be found in the root of AIK tool). So we just need to put printf.exe in android_win_tools folder, and replace this code in repackimg.bat
Code:
%bin%\mkbootimg --kernel "split_img/%kernel%" %ramdisk% %second% --cmdline "%cmdline%" --board "%board%" --base %base% --pagesize %pagesize% --kernel_offset %kerneloff% --ramdisk_offset %ramdiskoff% %second_offset% --tags_offset %tagsoff% %dtb% -o image-new.img %errout%
by
Code:
%bin%\mkbootimg --kernel "split_img/%kernel%" %ramdisk% %second% --cmdline "%cmdline%" --board "%board%" --base %base% --pagesize %pagesize% --kernel_offset %kerneloff% --ramdisk_offset %ramdiskoff% %second_offset% --tags_offset %tagsoff% %dtb% -o image-new.img %errout%
%bin%\printf \x41\xA9\xE4\x67\x74\x4D\x1D\x1B\xA4\x29\xF2\xEC\xEA\x65\x52\x79 >> image-new.img
As you can see, just one new line was inserted for injecting the signature.
3) Simply Bump a stock kernel in Phone (no change in ramdisk) to obtain a bumped working untouched stock kernel
I will not reinvent the wheel, you can use an existing tool for some time, made by @somboons, which uses the technique I mentioned here (unpack the kernel, repack it and injection of signing , all in the phone).
This script is an adaptation of Live bump by @Skin1980 that uses the arm versions of unpackbootimg and mkbootimg.
You will find the instructions and the tool here:
http://forum.xda-developers.com/lg-g2/development/tools-bump-kernel-offline-t3073261
---​
Credits and thank's a lot:
codefire team for bump!:
@thecubed , @Shelnutt2 , @IllegalArgument , @autoprime , @AnimatronicRocketReptile , @Dees_Troy
@Skin1980 for his live bump and these explanations
@osm0sis for his Android Image Kitchen - Unpack/Repack Kernel Ramdisk [Win/Android/Linux]
@zequav for explain me at the beginning what happen with bump and what can be done on linux
How to add init.d support and SELinux permissive on the Ramdisk​
Here, i explain how to implement in Ramdisk init.d and SELinux permissive.
We start from untouched kernel not bumped (so not from the kernel we eventually have bumped with the previous post).
Use @osmosis tool android image kitchen version for your system to unpack it.
After that, navigate to the AIK root folder and:
in split_img/boot.bin-cmdline, replace
Code:
console=ttyHSL0,115200,n8 user_debug=31 ehci-hcd.park=3 msm_rtb.filter=0x37 androidboot.hardware=g3
by
Code:
console=ttyHSL0,115200,n8 user_debug=31 ehci-hcd.park=3 msm_rtb.filter=0x37 androidboot.hardware=g3 androidboot.selinux=permissive
in ramdisk/init.qcom.rc replace
Code:
on property:sys.boot_completed=1
start qcom-post-boot
by
Code:
service sysinit /sbin/sysinit.sh
oneshot
class late_start
user root
group root
disabled
on property:sys.boot_completed=1
start qcom-post-boot
start sysinit
and on /sbin folder, add a file named "sysinit.sh" that contains this code:
Code:
#!/system/bin/sh
mount -o rw,remount /system
if [ ! -e /system/etc/init.d ]; then
mkdir /system/etc/init.d
chown -R root.root /system/etc/init.d
chmod -R 755 /system/etc/init.d
fi;
mount -o ro,remount /system
run-parts /system/etc/init.d/
/system/xbin/daemonsu --auto-daemon &
Note: This previous code on sysinit.sh is only for those who have run-parts installed (with busybox by example). Otherwise, for those who don't want to use run-parts, you can put the next one that don't need it:
Code:
#!/system/bin/sh
mount -o rw,remount /system
if [ ! -e /system/etc/init.d ]; then
mkdir /system/etc/init.d
chown -R root.root /system/etc/init.d
chmod -R 755 /system/etc/init.d
fi;
mount -o ro,remount /system
setenforce 0
FILES=/system/etc/init.d/*
for f in $FILES
do
$f
done
/system/xbin/daemonsu --auto-daemon &
Now you are ready to repack the kernel. Use AIK repackimg script for that. After repacking the kernel, you still have to sign it (Bump!).
For this last formality depending on the OS which you find yourself:
1) On Linux
put a file that you name as you want with sh ext(bump.sh should be a great idea ) on the AIK root folder, and chmod it 755.
On this file put the code above:
Code:
#!/bin/bash
printf '\x41\xA9\xE4\x67\x74\x4D\x1D\x1B\xA4\x29\xF2\xEC\xEA\x65\x52\x79' >> image-new.img
Save it, and now just drag and drop this file on a window terminal and valid. That's all
2) On Windows
Refer to the OP, i explained there how I bump on windows
3) On Phone
Refer to the OP, i explained there how I bump on the phone
Wow great, waiting for chapter 2
reserved
u25150 said:
Wow great, waiting for chapter 2
Click to expand...
Click to collapse
I feel that few people seem really passionate about what I say, if I refer to the answers
Also I'm going to focus on those who, like you, arise, and seem interested in this subject.
What specifically would you like to see some detail (what do you call "chapter two" ) ?
Duckscreen said:
reserved
Click to expand...
Click to collapse
Welcome, pleased to meet you
@6ril1 great work my freind
jac10000 said:
@6ril1 great work my freind
Click to expand...
Click to collapse
Hi my friend (not my freind, which is an advantage of German expression, ) , thank's, I assume that it is better to teach to fish than give fish, but perhaps this concept is it outdated ?
Could you making how to kexec hardboot patch Guide please
(for support Multirom)
Really nice work my friend !!!
In Linux, I just make my first bump boot thanks to you :good:
jac10000 said:
Really nice work my friend !!!
In Linux, I just make my first bump boot thanks to you :good:
Click to expand...
Click to collapse
You are welcome
And great thank's for having notify me my mistake about code i wrote in post 2 (class late_sart instead of class late_start )
Code is edited and correct now
Yeaah @6ril1 and my first bump boot with SELinux permissive
jac10000 said:
Yeaah @6ril1 and my first bump boot with SELinux permissive
Click to expand...
Click to collapse
LOL, thank's to have testing all of that i described in this thread, and for having mentioning me in private some others mistakes (unexpected one space inserted during copy-paste on the post 2 and one code tag not closed) . I have edited again with all that you find and now it should be correct
THANK'S again my friend
For windows user, new stuff added, i'll edit op with that too:
http://forum.xda-developers.com/showpost.php?p=63884919&postcount=716
Edit2: One more simple solution just added in OP
I have new-img but how do you use hex editor exactly? i can not figure it out. can u help with screenshots please?
I tried your tutorial (windows x64)(only bump no change in ramdisk) for 30c MM kernel but my phone wont boot(i don't have security error). Any ideas? Thank you!

Categories

Resources