[KERNEL] Universal external lagfix (btrfs,jfs,ext4,reiserfs) - Galaxy S I9000 Android Development

This lagfix will mount /data /dbdata /cache on your external SD almost whichever
FS you choose.
You must partition your SD with 4 partitions in this order:
primary FAT32 (size you wish)
primary your_FS 2Gb for /data
primary your_FS 128Mb for /dbdata
primary your_FS 30Mb for /cache
Supported filesystems are btrfs, ext4, jfs, reiserfs
Sizes are given as indication
This kernel mounts filesystems noatime,nodiratime
Kernel includes busybox full and su. adbd starts at boot by default.
You can even mix and match FS like reiserfs on dbdata, ext4 on data and jfs on cache
How to do:
1: partition your external SD appropriately and format it (using i.e. http://partedmagic.com/)
2: flash zImage_0.1 as kernel with Heimdall
or alternatively flash zImage_0.1.tar with Odin
Kernel can be found at http://llorien.org/samsung_galaxys/jpm/universal
This will obviously wipe your data, if you don't copy it first.
I only tested this on the international Samsung Galaxy S GT-I9000 running froyo JPM.
NOTE: Do not flash unnumbered versions
If you want to revert back to the normal behavior, just flash a stock jpm kernel and you should be fine.

Well, this seems very promising.
Thank you Nikademus.
+1
What do you mean by unnumbered versions?

And what about battery life on HD2 if filesystem is on SD it drains more battery?

nikademus said:
This lagfix will mount /data /dbdata /cache on your external SD almost whichever
FS you choose.
You must partition your SD with 4 partitions in this order:
primary FAT32 (size you wish)
primary your_FS 2Gb for /data
primary your_FS 128Mb for /dbdata
primary your_FS 30Mb for /cache
Supported filesystems are btrfs, ext4, jfs, reiserfs
Sizes are given as indication
This kernel mounts filesystems noatime,nodiratime
Kernel includes busybox full and su. adbd starts at boot by default.
You can even mix and match FS like reiserfs on dbdata, ext4 on data and jfs on cache
How to do:
1: partition your external SD appropriately and format it (using i.e. http://partedmagic.com/)
2: flash zImage_0.1 as kernel with Heimdall
or alternatively flash zImage_0.1.tar with Odin
Kernel can be found at http://llorien.org/samsung_galaxys/jpm/universal
This will obviously wipe your data, if you don't copy it first.
I only tested this on the international Samsung Galaxy S GT-I9000 running froyo JPM.
NOTE: Do not flash unnumbered versions
If you want to revert back to the normal behavior, just flash a stock jpm kernel and you should be fine.
Click to expand...
Click to collapse
Can you somehow make this automated? Not a lot of people here are on linux & repartitioning is not really everyone's cup of tea.
Thnaks.

Some bugs:
1.Tried o flash zImage_0.1.tar and that did corrupt the phone system, so beware!!
The zImage in the tar file is named zImage_0.1, it should be named zImage (more on this later).
2.Extracted zImage_0.1.tar and renamed zImage_0.1 to zImage and added it to a tar file using 7-zip and tried using Odin, that did not work, Odin would hang on flashing zImage.
3. Downloaded zImage_0.1 and renamed that to zImage and flashed using Heimdall, this worked, but the phone seemed to continue scan the external SD-card.
4. Powered down the phone and did a cache wipe and a factory reset and rebooted the phone, it booted but then got to a black screen with the return-key and menu-key on all the time.
The card was partitioned using Partedmagic in external card-reader.
Will try again now and report back.

eclair or froyo ?
hi
Can't read anywhere.
Is this lagfix for eclair rom or froyo ?
It seems the mounbt point of external sdcard isn't just the same on those roms.
Op, could you make the light, please ?
Thanks

deli_gt said:
And what about battery life on HD2 if filesystem is on SD it drains more battery?
Click to expand...
Click to collapse
That does not seem to really affect battery usage.

ragin said:
Can you somehow make this automated? Not a lot of people here are on linux & repartitioning is not really everyone's cup of tea.
Thnaks.
Click to expand...
Click to collapse
That is planned, although you will probably have to put a config file somewhere to define filesystems you want.

[Ramad] said:
Some bugs:
1.Tried o flash zImage_0.1.tar and that did corrupt the phone system, so beware!!
The zImage in the tar file is named zImage_0.1, it should be named zImage (more on this later).
Click to expand...
Click to collapse
Well, I just verified and it's called zImage, not zImage_0.1
[email protected]:~/galaxy$ tar xvf zImage_0.1.tar
zImage
2.Extracted zImage_0.1.tar and renamed zImage_0.1 to zImage and added it to a tar file using 7-zip and tried using Odin, that did not work, Odin would hang on flashing zImage.
Click to expand...
Click to collapse
I don't know what created this. But I haven't tested with Odin yet.
3. Downloaded zImage_0.1 and renamed that to zImage and flashed using Heimdall, this worked, but the phone seemed to continue scan the external SD-card.
Click to expand...
Click to collapse
You don't need to rename it to flash with Heimdall.
What do you mean by phone seems to continue scan the external SD?
4. Powered down the phone and did a cache wipe and a factory reset and rebooted the phone, it booted but then got to a black screen with the return-key and menu-key on all the time.
The card was partitioned using Partedmagic in external card-reader.
Will try again now and report back.
Click to expand...
Click to collapse
Did you format the filesystems?

@nikademus
Here is the deal...The zImage_0.1.tar that can be downloaded from the link you provided is not a tar file but a Gzip file, when extracted then there is what appears to be a file named zImage_0.1, this is not a file but a tar file, that is missing the tar extension, by adding the tar extension, i.e renaming it to zImage_0.1.tar then it can be flashed using Odin. The majority of us are using windows, and some of us are using Linux and OSX where these archives might be read right by the operating system, but in windows it can only be checked by using winrar or 7-zip.
I'm not a novice Windows or Linux user, I know enough, and offcourse I did format the 3 partitions as jfs.

Well, I don't know how you have got a gzipped file but I can ensure you that the tar file is a real tar file. I don't use windows at all, so it's a little bit hard for me to test on windows to find the reason behind this.

@nikademus
Details of the zImage_0.1.tar when downloaded from http://llorien.org/samsung_galaxys/jpm/universal/ :
Uploaded with ImageShack.us
Details when the zImage_0.1.tar is extracted:
Uploaded with ImageShack.us
.tar extension added:
Uploaded with ImageShack.us
Details on the file above, viewed by winrar (se the zImage inside it, now this tar file can be flashed using Odin):
Uploaded with ImageShack.us
I hope that these pictures does show what I mean.

nikademus said:
Well, I don't know how you have got a gzipped file but I can ensure you that the tar file is a real tar file. I don't use windows at all, so it's a little bit hard for me to test on windows to find the reason behind this.
Click to expand...
Click to collapse
He's right. Although it's strange that "tar xvf" would extract without the z option (pipe through gzip), but if you rename the file to .tar.gz, then gunzip will work on it, and more importantly, 'file' identifies it as a gzipped file:
[email protected]:~/Downloads$ ls -l zImage_0.1.tar
-rw-r--r-- 1 carl carl 5704623 2010-10-29 21:32 zImage_0.1.tar
[email protected]:~/Downloads$ file zImage_0.1.tar
zImage_0.1.tar: gzip compressed data, from Unix, last modified: Fri Oct 29 13:42:54 2010
[email protected]:~/Downloads$
Click to expand...
Click to collapse
then, rename to .tar.gz and gunzip, and identify again:
[email protected]:~/Downloads$ mv zImage_0.1.tar zImage_0.1.tar.gz
[email protected]:~/Downloads$ gunzip zImage_0.1.tar.gz
[email protected]:~/Downloads$ file zImage_0.1.tar
zImage_0.1.tar: POSIX tar archive (GNU)
[email protected]:~/Downloads$
Click to expand...
Click to collapse

cmf said:
He's right.
Click to expand...
Click to collapse
Thanks, at last
I was trying to point out that the file can be flashed by Heimdall but not by Odin, Odin can only flash tar files, if you flash the file in it's current stat then it will corrupt the system and when the majority here are using Odin this should have been taken seriously, but it appear that it does not matter, unless a member reporting a bug has been spaming the forum and has a load of posts to backup his words.
I'm done testing this release...good luck.

Well, I must admit this is quite strange because this is not gzipped. Which program did you use to download the file? I would say it's probably because the web server compresses pages using gzip to reduce bandwidth and the program who fetched the file did not uncompress the file like it should have done.

nikademus said:
Well, I must admit this is quite strange because this is not gzipped. Which program did you use to download the file? I would say it's probably because the web server compresses pages using gzip to reduce bandwidth and the program who fetched the file did not uncompress the file like it should have done.
Click to expand...
Click to collapse
I used Google Chrome on Ubuntu Maverick x64. I'll try wget and see what happens, but that's an interesting thought regarding mod_gzip or whatever the apache extension is called.
Regardless, perhaps it would be best to supply a .tgz instead? What's the point in tar-ing a single file ? The idea of tar is to pretty much concatenate multiple files into a single file, without compression, isn't it?

cmf said:
I used Google Chrome on Ubuntu Maverick x64. I'll try wget and see what happens, but that's an interesting thought regarding mod_gzip or whatever the apache extension is called.
Click to expand...
Click to collapse
I am not using apache, but the idea is about the same.
Regardless, perhaps it would be best to supply a .tgz instead? What's the point in tar-ing a single file ? The idea of tar is to pretty much concatenate multiple files into a single file, without compression, isn't it?
Click to expand...
Click to collapse
Because Odin only understands .tar format. If you run from linux, just download the zImage_0.1 with tar, you can flash this one with heimdall

Same with wget:
[email protected]:~/Downloads$ wget http://llorien.org/samsung_galaxys/jpm/universal/zImage_0.1.tar
--2010-10-29 23:09:29-- http://llorien.org/samsung_galaxys/jpm/universal/zImage_0.1.tar
Resolving llorien.org... 206.251.244.96
Connecting to llorien.org|206.251.244.96|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5704623 (5.4M) [application/octet-stream]
Saving to: `zImage_0.1.tar'
100%[==========================================================>] 5,704,623 332K/s in 13s
2010-10-29 23:09:43 (442 KB/s) - `zImage_0.1.tar' saved [5704623/5704623]
[email protected]:~/Downloads$ file zImage_0.1.tar
zImage_0.1.tar: gzip compressed data, from Unix, last modified: Fri Oct 29 13:42:54 2010
[email protected]:~/Downloads$
Click to expand...
Click to collapse

nikademus said:
I am not using apache, but the idea is about the same.
Because Odin only understands .tar format. If you run from linux, just download the zImage_0.1 with tar, you can flash this one with heimdall
Click to expand...
Click to collapse
Ah, fair enough.
Strange then!

BTW, "tar xvf" *does* still work on the apparently gzipped file. Which is weird. Unless GNU tar is just being 'clever' by detecting the gzip compression..
At first I was just looking at your output from before where you did tar xvf, but I just tried it myself on the supposedly gzip file. Weird.

Related

Howto: Format SD card to use Android ports requiring ext2 or linuxswap

Theoretically, this method eliminates the need for using GParted or any Linux Ubuntu to install Neopeek android ports (or XDandroid if babijoee decides release Ext2 ) Partition within Windows.
>> http://www.youtube.com/watch?v=oyO6DOS1leQ << Watch in 720p please
Recording program used: Camstudio
Partitioning program used: MiniTool Partition Wizard Home Edition
Operating system: Windows 7
Partitioning tool >>http://www.partitionwizard.com/free-partition-manager.html <<
If I did anything wrong such as partitioning as "primary" instead of "logical" please tell me...
I have also found a program (shareware) that can open, add files, and recompress tar.gz files (especially androidinstall.tar.gz) I have tried using 7-zip, Win-Zip, and Win-Rar to do this but Winrar and Winzip will not allow me to do thos. 7-zip just gives me a memory allocation error.
Normally, you would have to install .apk files one by one which is time consuming but by adding the apk files you want to install to the directory /sdcard/npkinstall/androidinstall.tar.gz/data/apps , you can save time and it will automatically install it when you run install.exe or when you first install a neopeek android port onto your device.
The program name is "PowerArchiver"
http://www.powerarchiver.com/ <<the official website. It gives you a 30 day trial, sort of like winrar but better
A video to demonstrate the process of installing neopeek builds..
http://www.youtube.com/watch?v=ArWYwjKEACo
I am going to use this video on my site if you don't mind!?!? Some users still have problems to get an EXT2 partition working! Especially windows users have this kind of problems! Anyway thank you for sharing this. Great work!
e334 said:
I have also found a program (shareware) that can open, add files, and recompress tar.gz files (especially androidinstall.tar.gz) I have tried using 7-zip, Win-Zip, and Win-Rar to do this but Winrar and Winzip will not allow me to do thos. 7-zip just gives me a memory allocation error.
Normally, you would have to install .apk files one by one which is time consuming but by adding the apk files you want to install to the directory /sdcard/npkinstall/androidinstall.tar.gz/data/apps , you can save time and it will automatically install it when you run install.exe or when you first install a neopeek android port onto your device.
The program name is "PowerArchiver"
http://www.powerarchiver.com/ <<the official website. It gives you a 30 day trial, sort of like winrar but better
Click to expand...
Click to collapse
I could add apk into the tar.gz with total commander with installed bzip plugin.
i didnt try to install the new androidinstall, but next time i'll add some apps before installing.
I haven't tried total commander for PC with the bzip plugin but I'm sure its a better method than using PowerArchiver but it works both ways.
I also tried G-zip but it wasn't very noob friendly.
2 build on same sd card?
hi. is it possible to install both neopeek build ang xdandroid build on same sd card? i am too lazy to clear my sd card each time a new build came out. tq
kazuya87 said:
hi. is it possible to install both neopeek build ang xdandroid build on same sd card? i am too lazy to clear my sd card each time a new build came out. tq
Click to expand...
Click to collapse
Yes, but to my knowledge you can only run one neopeek build.
I basically have a folder called "Androids" and then I have several builds in their own folders. You just have to adjust the startup.txt in each to reflect the folder location.
Oh and if you're having problems dual booting windows mobile and neopeek builds with GEN.Y dual boot (not dual booting 2 android builds though) follow this link..
http://www.neopeek.com/en/forum/12-...EODual-Boot-Neopeeks-Android-Ports-by-Mohamad
arrrghhh said:
Yes, but to my knowledge you can only run one neopeek build.
I basically have a folder called "Androids" and then I have several builds in their own folders. You just have to adjust the startup.txt in each to reflect the folder location.
Click to expand...
Click to collapse
did u mean by adding rel_path=XXXXXXXX on the startup.txt? i will give it a try to store neopeek build and xdandroid build on same sd card this way.
by the way, i already dual booting my winmo and android but i just can't resist the temptation to try latest android build by xandroid and noepeek. they both awesome
kazuya87 said:
did u mean by adding rel_path=XXXXXXXX on the startup.txt?
Click to expand...
Click to collapse
Yes, that is correct.
kazuya87 said:
did u mean by adding rel_path=XXXXXXXX on the startup.txt?
Click to expand...
Click to collapse
can someone elaborate on this, for a andn00b?
benjamminzIS said:
can someone elaborate on this, for a andn00b?
Click to expand...
Click to collapse
You add "rel_path=path/to/android" to the cmdline section... This would be if the build was 3 folders deep from the root. If you just have Android say in a folder 'andboot' off of the root of the SD, your statement would read "rel_path=andboot" - make sense?
You also realize this has absolutely nothing to do with the builds that require an ext2 partition right? It's just a way to organize multiple builds of Android, but only the "normal" builds that don't require an ext2 partition.
How about the 8 gigabyte sd memory?
I understand 2G sd rom format, but when I format 8G sd as you showen with my own size, android phone could not distinguish it exactly. Could you explain about the 8G sd card?
necafe said:
I understand 2G sd rom format, but when I format 8G sd as you showen with my own size, android phone could not distinguish it exactly. Could you explain about the 8G sd card?
Click to expand...
Click to collapse
From what i know on the sd card there must be 3 partition:ext2 and swap have to be always the same size (EXT2: about 350 mb and SWAP: 64 mb) and the fat32 one has to be the free space should be something like 6.5-7gb on 8 gb card,
What problem do you experience?
Added, how to change keymaps under linux
e334 said:
Added, how to change keymaps under linux
Click to expand...
Click to collapse
Great! Thanks e334, updating rootfs.img in Neopeek's ROMs should now be easier with your how to guide.
Do you think it should deserve a new thread instead of using this "howto format ..." thread? If I may, would suggest something like [Howto] Update rootfs.img in Neopeek ROMs. "Older ROMs" do not apply to XDAndroid ROMs because updating those even if older is straightforward.
Ok.. I will do that then..
thanks! mod may now delete off-topic post's from this thread ... including this & my previous post.
STARTUP.TXT File
set ramsize 0x8000000
set ramaddr 0x10000000
set mtype 2006
set FBDURINGBOOT 0
set cmdline "root=/dev/mmcblk0p2 init=/init rootwait rw rootdelay=3 console=tty0 rootdelay=3 fbcon=rotate:2 ro.sf.hwrotation=180 lcd.density=240 msmvkeyb_toggle=off msmts_calib=0x0366.0x04b.0x0c8.0x038e acpuclock.oc_freq_khz=600000 pmem.extra=1 no_console_suspend clock-7x00.mddi=0xa51 physkeyboard=kovsq hw3d.force=1"
boot

[GUIDE] Noob Friendly RFS Browsing/Extracting Guide

Ok guys,
So after having seen a million and one questions on how to extract RFS files and all the complex answers we keep getting on mounting rfs files in linux and blah blah blah (all a waste of time if all you need is to view/extract files from an RFS file from some firmware)... and now there is no excuse for those few requesting other members to extract stuff for them.. you can do it yourself!
Here is the easy/fast way to do it without having to go through all the trouble
NOTE: This, mind you is mainly for extracting/viewing. Not for editing RFS files.
Go to:
-http://www.magiciso.com/
-Download MagicISO (its free trial but that don't matter for viewing/extracting)
-Install
-Open MagicISO
-Hit File->Open
-In the section "Files of type:" - Click the drop down and select "All Files (*.*)"
-Select RFS file of your choosing (For example: factoryfs.rfs where all firmware apps are located)
and..
VIOLA!
Browse/Extract anything you need... No hassles.
To extract you can simply click and drag to another folder/desktop as needed
Cheers!
TY for this guide. Unlike htc hd2 forums I really have hard time getting answers to my questions in tab forums so this kind of guides helps me very much. Again TY.
You sir, are very welcome!
Glad it helped. Thats what we're here for!
Make it a sticky !
add it to the wiki rather than making this post sticky. http://modadroid.com/index.php/Main_Page
Just tried it with UltraISO. It seems to work, too.
Thanks
tovarish said:
add it to the wiki rather than making this post sticky. http://modadroid.com/index.php/Main_Page
Click to expand...
Click to collapse
Its locked for editting
MagicISO didn't work for me. I copied the .rfs file to a directory on Linux and mounted as read/write and was able to modify the file system. Then, I unmounted it and flashed the changes to my GT using Heimdall.
Sent from my SCH-I800 using XDA App
chuckbeasley said:
MagicISO didn't work for me. I copied the .rfs file to a directory on Linux and mounted as read/write and was able to modify the file system. Then, I unmounted it and flashed the changes to my GT using Heimdall.
Sent from my SCH-I800 using XDA App
Click to expand...
Click to collapse
This guide is only for browsing and extracting RFS files hence the name. It is not for modification.
I'm aware of what the original post was explaining. I tried that solution and it failed. That's why I suggested another method. MagicISO didn't work for me. If others try it and it doesn't work for them either, at least they have another solution that will always work and the option to modify the file system, if they so choose.
Sent from my SCH-I800 using XDA App
chuckbeasley said:
I copied the .rfs file to a directory on Linux and mounted as read/write and was able to modify the file system. Then, I unmounted it and flashed the changes to my GT using Heimdall.
Click to expand...
Click to collapse
That's the Linux command line, right ?
#mount -o loop factoryfs.rfs /mnt/rfs
Otherwise on Mac OS X, you can use this:
#sudo mkdir /Volumes/RFS
#sudo hdiutil attach -imagekey diskimage-class=CRawDiskImage -nomount ARCHIVE.rfs
#sudo mount_msdos /dev/disk{n} /Volumes/RFS
daniel.weck said:
That's the Linux command line, right ?
#mount -o loop factoryfs.rfs /mnt/rfs
Otherwise on Mac OS X, you can use this:
#sudo mkdir /Volumes/RFS
#sudo hdiutil attach -imagekey diskimage-class=CRawDiskImage -nomount ARCHIVE.rfs
#sudo mount_msdos /dev/disk{n} /Volumes/RFS
Click to expand...
Click to collapse
Please don't forget when you finished on OSX to run:
sudo umount /Volumes/RFS/
hdiutil detach /dev/disk{n}
i can't open the factoryfs.rfs of a samsung galaxy s. can anyone send me the /lib folder from galaxy s and the flash apk in the app folder...thanks
seven2099 said:
Ok guys,
-In the section "Files of type:" - Click the drop down and select "All Files (*.*)"
-Select RFS file of your choosing (For example: factoryfs.rfs where all firmware apps are located)
and.. VIOLA!
Browse/Extract anything you need... No hassles.
Click to expand...
Click to collapse
Didn't work for me either. MagicISO did extract four files only from factoryfs.rfs.
Two were exe files of significant size... Samsun_Mobile_USB_Driver.exe, and ToolLauncher-Bootstrap.exe.
All the files apk files are probably empedded in the first of those, but no further extraction was possible from the .exe file using MagicISO.
I'm trying to find the origianal VZW Vcast apk files that I stupidly deleted instead of just renaming. I need them so the EC02 update script will run. Any ideas, anyone?
Robin M said:
Didn't work for me either. MagicISO did extract four files only from factoryfs.rfs.
Two were exe files of significant size... Samsun_Mobile_USB_Driver.exe, and ToolLauncher-Bootstrap.exe.
All the files apk files are probably empedded in the first of those, but no further extraction was possible from the .exe file using MagicISO.
I'm trying to find the origianal VZW Vcast apk files that I stupidly deleted instead of just renaming. I need them so the EC02 update script will run. Any ideas, anyone?
Click to expand...
Click to collapse
you could look up the long way of mounting and extracting RFS.. Its a major pain though, why dont you make a post asking for those missing files in the forum.
Better bet.
Robin M said:
Didn't work for me either. MagicISO did extract four files only from factoryfs.rfs.
Two were exe files of significant size... Samsun_Mobile_USB_Driver.exe, and ToolLauncher-Bootstrap.exe.
All the files apk files are probably empedded in the first of those, but no further extraction was possible from the .exe file using MagicISO.
I'm trying to find the origianal VZW Vcast apk files that I stupidly deleted instead of just renaming. I need them so the EC02 update script will run. Any ideas, anyone?
Click to expand...
Click to collapse
I used Root Uninstaller and got rid of a vcastmusic.apk file. It's 4.46mb. Is this what you need?
Where is the thanks button!! It worked for me..!! I needed it!!
one question: I am unable to extract one particular factoryfs.rf of one rom, MagicISO says it is not an image file. Can you help me there?
Use linux disk reader to open ext4 files (even .rfs files can be ext4)
@neo yea magiciso says so on ext4 archives
cdesai said:
Use linux disk reader to open ext4 files (even .rfs files can be ext4)
@neo yea magiciso says so on ext4 archives
Click to expand...
Click to collapse
@cd if i select factoryfs.rfs from linux reader i only get the same single file as the output!! No use yaar
Works for Galaxy Ace's firmwares. Thanks. I'm trying to cook my first ROM for Galaxy Ace (cooper). Wish me luck!

[TUT][20110115][Expert Users & ROM Makers]To add userdata everywhere to your HD2 ROM

[TUT][20110115][Expert Users & ROM Makers]To add userdata everywhere to your HD2 ROM
*FOR EXPERT USERS OR ROM MAKERS ONLY*
*I AM NOT RESPONSIBLE FOR ANY DAMAGE CAUSED TO YOUR DEVICE BY USING THIS*
Features:
- Able to have userdata on NAND or in ext sdcard partition or in /sdcard/.data/data.img
- Check if NAND partition exist
- Check if ext sdcard partition exist
- Resizable data.img (bigger or smaller)
- Able to prioritize data.img, ext or NAND
- Able to copy data from NAND to data.img, or ext to data.img (in this order)
- Write data.log in /sdcard/.data/
- Automatic update data.config if it haven't all options
Click to expand...
Click to collapse
Requirements
Kernel with:
# -File systems: yaffs2, ext2, ext3 (, ext4)
# -MTD partition in /proc/mtd
# -MTD block in /dev/block/mtdblock*
# -SD Card in /sys/block/mmcblk0
InitRD with:
# -/system
# -/proc
# -/sys
# -/data
# -/mfbin
SD Card with first partition as FAT32 or EXT*: mmcblk0p1
SD Card with second partition as EXT*: mmcblk0p2
Click to expand...
Click to collapse
How to use it
In your initrd root
Rename your android init (binary) to init.android
Comment "mount yaffs2 [email protected] /data nosuid nodev noatime nodiratime" in your init.rc
Past mfbin folder
Modify mfbin/.data/data.config with your default setup and "Some variables" in init script
Use new init script and chmod it with 755
Click to expand...
Click to collapse
Download : http://www.multiupload.com/F86WGU6H70
Zip content:
- my initrd.gz example (normally for ManusFreedom or tytung ROM)
- init (extracted from initrd.gz)
- .data folder sample
Click to expand...
Click to collapse
Logical description
To prioritize use data.img over userdata on NAND or ext sdcard partition:
Change data_force_mount to y
To prioritize use ext sdcard partition over userdata on NAND:
Change data_force_mount to n
Change data_ext_priority to y
To prioritize use NAND:
Change data_force_mount to n
Change data_ext_priority to n
Click to expand...
Click to collapse
Use data_copy_to_img=y to copy data from NAND to data.img. If no data on NAND, it try to mount ext partition to copy it to data.img. Works only during creation of data.img (not after).
Click to expand...
Click to collapse
To resize to a bigger data.img (backup your data.img before):
1. If you don't have on sd a directory .data copy .data from install to the root of your sd
2. Open .data/data.config of root of SD Card
3. Change data_size to the size you want in megabytes (recommand not less than 128MB and not over 2GB)
4. Change data_resize to y
5. Boot your phone
6. Wait (time depend)
7. You will be normally under Android
8. You can change data_resize to n for security
To resize to a smaller data.img [CHECK THE FREE SPACE BEFORE SHRINK] (backup your data.img before):
1. If you don't have on sd a directory .data copy .data from install to the root of your sd
2. Open .data/data.config of root of SD Card
3. Change data_size to the size you want in megabytes (recommand not less than 128MB and not over 2GB)
4. Change data_resize to y
5. Change data_force_shrink to y
6. Boot your phone
7. Wait (time depend)
8. You will be normally under Android
8. You can change data_resize and data_force_shrink to n for security
Click to expand...
Click to collapse
Please test it and give feedback.
Thanks meter click .
And if you appreciate my work and want to buy me a drink, please consider making a donation too, thanks.
Added ext sdcard partition support.
manusfreedom said:
Added ext sdcard partition support.
Click to expand...
Click to collapse
Great stuff! I will test it out...
Quick question... how do I create the boot.img using this initrd.gz and the kernel of my choice?
pongster said:
Quick question... how do I create the boot.img using this initrd.gz and the kernel of my choice?
Click to expand...
Click to collapse
the easy way for me is using android itself, put initrd.gz and zimage in /sdcard/boot/
adb shell
mkyaffs2image /sdcard/boot/ /sdcard/boot.img
edit..
this is great, make me so easy creating a rom.. thanks manus
lesjaw said:
the easy way for me is using android itself, put initrd.gz and zimage in /sdcard/boot/
adb shell
mkyaffs2image /sdcard/boot/ /sdcard/boot.img
Click to expand...
Click to collapse
Thanks. I actually created one using mkfs.yaffs2 in linux... but it gave me a kernel error after successfully installing via clockwork... Possible reason as well is the update-script I use... what update-script do you use for your ROM-ZIPs?
pongster said:
Thanks. I actually created one using mkfs.yaffs2 in linux... but it gave me a kernel error after successfully installing via clockwork... Possible reason as well is the update-script I use... what update-script do you use for your ROM-ZIPs?
Click to expand...
Click to collapse
i don't know this for sure, i don't make boot.img for a zip rom, i just put initrd.gz and zimage in boot folder, for update script i use just like raider zip build then compare it with original update script from my original build so i know what i should change in my update script..
lesjaw said:
the easy way for me is using android itself, put initrd.gz and zimage in /sdcard/boot/
adb shell
mkyaffs2image /sdcard/boot/ /sdcard/boot.img
edit..
this is great, make me so easy creating a rom.. thanks manus
Click to expand...
Click to collapse
I actually got the 'NAND kernel open failed' error using another boot.img works though... any ideas to what I'm goofing up?
lesjaw said:
i don't know this for sure, i don't make boot.img for a zip rom, i just put initrd.gz and zimage in boot folder, for update script i use just like raider zip build then compare it with original update script from my original build so i know what i should change in my update script..
Click to expand...
Click to collapse
is your boot folder inside the /system folder? so initrd.gz and zImage inside /system/boot
then you take the META from RaiderX and compare update scripts
before finally creating an update.zip using 1. /system folder and 2. META folder ?
pongster said:
is your boot folder inside the /system folder? so initrd.gz and zImage inside /system/boot
Click to expand...
Click to collapse
No, boot folder is on itself, together with system folder and Meta folder, so we have three folder inside zip
pongster said:
then you take the META from RaiderX and compare update scripts
before finally creating an update.zip using 1. /system folder and 2. META folder ?
Click to expand...
Click to collapse
yes, i need to do that to see if any spesific file permission need to be added
lesjaw said:
No, boot folder is on itself, together with system folder and Meta folder, so we have three folder inside zip
yes, i need to do that to see if any spesific file permission need to be added
Click to expand...
Click to collapse
Thanks.. tried the 3 folders before reading your post... got past the error but its stuck at gogogo...
could you attach the meta folder you use so i can test it out... ?
lesjaw said:
No, boot folder is on itself, together with system folder and Meta folder, so we have three folder inside zip
yes, i need to do that to see if any spesific file permission need to be added
Click to expand...
Click to collapse
so for this manus initrd.gz you just put this in your /boot folder in the romzip and flash away? it must be my update-script then... installing via daf works so i know my system works...
pongster said:
so for this manus initrd.gz you just put this in your /boot folder in the romzip and flash away? it must be my update-script then... installing via daf works so i know my system works...
Click to expand...
Click to collapse
uploading..btw, you can hit me up at gtalk [email protected] rather then we talk about it here..i'm afraid our conversation is getting out of topic from OP thread..
lesjaw said:
uploading..btw, you can hit me up at gtalk [email protected] rather then we talk about it here..i'm afraid our conversation is getting out of topic from OP thread..
Click to expand...
Click to collapse
i know... sorry mods...
back on topic...
did this initrdgz detect your ext partition on sd properly?
New version available (v3)
Added:
- Able to prioritize data.img, ext or NAND
- Able to copy data from NAND to data.img, or ext to data.img (in this order)
- Write data.log in /sdcard/.data/
- Automatic update data.config if it haven't all options
The download file is removed from all servers!!
zooz11 said:
The download file is removed from all servers!!
Click to expand...
Click to collapse
No more direct support for this thread.
You can extract my init script from my updated zip:
http://forum.xda-developers.com/showthread.php?p=11986922#post11986922

[REF] A quick rundown of android for noobs

Hello everyone. I see a lot of very basic android questions floating around the forums, so I figured I'd give a VERY basic rundown of the android filesystem for those who don't know. (If you're even slighty experienced, this'll seem like a "duh" thread, you should skip this. This is for new people.)
Ok, to understand android, first thing you need to understand are the basic partition structures. There are 5 android partitions.
boot
cache
recovery
system
data
Before I get into the partitions, you'll have to understand what a mount point is. When you "mount" a drive, you are making it available to the system. On linux (and by extension, android), you need to have a mount point. This is a directory somewhere that serves as a path for the mounted filesystem. So for example, let's say I wanted to mount mmcblk0p1 to a temp directory to edit it. For this example I'll create a directory /data/temp. Now you'd mount mmcblk0p1 /data/temp. When you read the contents of the directory temp under the directory data, you'll see all the info stored on mmcblk0p1. Even something as simple as a flash drive needs to be mounted under linux. If you're an ubuntu user, usually it automounts to /mnt/name of device.
Now, when you boot android, the first thing it does is boot up the linux kernel (when you see the tmobile splashscreen, that's when the kernel is loading.) Next, it loads up the ramdisk. Both of these files are on the boot partition. (When you open up a cwm zip file, you'll see boot.img in there, that's where these reside.) There are two files on the boot partition. zImage (the linux kernel), and initrd.gz (the cpio archive containing the ramdisk.)
What is the ramdisk you ask? Well, very simply, it's the place where the root file system is loaded, and where the init.rc resides. The init.rc is the android startup script (again, basic analogy). If you'd really like to learn about android and how it works, this is the first file I'd start reading.
On to the partitions:
boot - Described above, containing the zimage and initrd.gz
recovery - this is where either the stock recovery or clockwork recovery is located. This is only accessed when entering recovery mode.
cache - You guessed it, this is where some parts of android cache it's file. (Not to be confused with the dalvlik cache, that's located on the data partition.)
system - this is where the system is located. (Esentially the rom you're flashing.)
data - this is the partition where all your installed apps go, as well as the location of a couple parts of the system, like the dalvik-cache and the batterystats.bin file. (Quite a few more, just givinig examples.)
So what does all this mean to you? Well, I see a LOT of people asking about wipes before installs, or asking about flashing kernels, this is why I took the time to explain this.
When you enter cwm, and do a backup, it creates 5 .img files on your sdcard. (One for each of the partitions mentioned above.) When you flash a kernel, it only replaces the boot.img, and a couple files in the system folder. Usually these are kernel modules like the wifi module, and any other modules that aren't compiled into the system. (Although most kernel builders build cifs.ko and all that right into the kernel so the modules aren't needed.)
When you flash a rom, it will always replace the /system and /boot partitions. The rest, that depends on the rom. If you'd like to know what your rom is doing, open up the cwm zip file, and go to meta-inf/com/google/android and you'll see 2 files. Updater-script and update-binary. Updater-script will tell you what it does on install. (You'll see it mounting the partitions it needs, what it does and doesn't format, and also it does a whole bunch of simlinks.) Simlinks, or symbolic links, are either files or directories that point to somewhere else. For example, let's say you are a user who uses ext-sd. What you do is create a simlink for /data that points to the ext3 partition on your sdcard. This way, anytime the system goes to /data it writes somewhere else. Most of the simlinks created in android are more for busybox commands, but that's for another post
If you'd like to see what your mount points are, from an android terminal emulator (or of course adb, but if you are experienced with adb chances are you don't need any of this info in the first place ), type mount. (You might need to type su first, hit enter, then mount). This will list all your mount info. If you'd like to know the actual device name of the mount point, you'd look here. On ours, for example, it's:
mmcblk0p24 is /system
mmcblk0p26 is /cache
mmcblk0p25 is /data
and so on.
Ok, finally, a couple other questions I see often:
Why does my system "hotboot"?
When a system hotboots, it means that zygote has crashed. This is the virtual machine that android runs in. So if you are using your phone, and you all of a sudden go back to the boot animation (NOT the splashscreen with the kernel logo), you just hot-booted. When an application allows you to hotboot all it does is the following command from inside linux: pkill zygote (or pkill -9 zygote).
How do I calibrate my battery?
The batter calibration is a file called batterystats.bin. This is located in /data/system. When you get to 100% charge, if you delete this file, it'll start over on the battery calibration. (There are also market apps to do this for you for the squeamish.)
Other notable files:
gps.conf
Located in the /system/etc folder. This has all the gps configuration, nameservers, and things like this.
build.prop
Located in /system
A lot of device info is stored in here. For more info, google it.
Hopefully this wasn't too mashed together and confusing. I tried to follow a logical order, but I've had way too much turkey and beer today, so I'll post this and let it fly.
Have a happy thanksgiving everyone!
Good stuff, thanks OP.
Powered by the SGSII....
Very very useful for someone like me who knows a bit here a bit there but not sure of the whole picture.
Thanks!!
this should be useful for alot of noobs!
Thanks so much for this, being new to android this is incredibly useful. Bookmarking!
Sent from my SGH-T989 using xda premium
This thread should help alot of new people that just joined this forum and that are new .
Very informative, thank you.

[Q] Mounting Stock ROM system.img on W7/8/Linux to view and copy files

- I unzipped e.g. T705XXU1ANF from samdownloads.de.rar.
- Then I opened the T705XXU1ANF7.tar.md5 and extracted the *.img files with winrar.
- Then I tried to mount system.img / recovery.img with OSFMount.
Mounting worked but non of the ext2 tools (Ext2Fsd, ext2explore, explore2fs-1.08beta9, Paragon ExtFS for Windows, LinuReader ) would recognice the mounted image or could mount the image itself to view the files.
For ICS/JB I read about ext4_unpacker. Do we have something like that for Kitkat ? Or is it possible under Linux (I am a noob there)
Basically on Linux, it's really easy.
mount -o loop disk1.iso /mnt/disk
Or wherever that you want it to be.
did one of you mount an system.img from Kitkat Stock Rom already ?? Because I dont think ist about W7/8 .... some of the tools listed should be able to read ext4 ... (ext4_unpacker wont work either !!)
pegasus21 said:
Basically on Linux, it's really easy.
mount -o loop disk1.iso /mnt/disk
Or wherever that you want it to be.
Click to expand...
Click to collapse
no it cant be mounted that way... I tried under unbuntu LiveDVD. the System.img can be mounted, but there is no readable filesystem. So it must be processed in some form like ext4unpacker did for ICS/JB ...
gggg said:
no it cant be mounted that way... I tried under unbuntu LiveDVD. the System.img can be mounted, but there is no readable filesystem. So it must be processed in some form like ext4unpacker did for ICS/JB ...
Click to expand...
Click to collapse
You're right... I thought it worked out of the box.
Anyway, I used RKwinTools to extract the system.img contents on Windows.
Place system.img in RKwinTools_v133\unpack\firmware\image\
Run the batch file and select option 6 and you'll find the contents under RKwinTools_v133\unpack\System
pegasus21 said:
You're right... I thought it worked out of the box.
Anyway, I used RKwinTools to extract the system.img contents on Windows. Place system.img in RKwinTools_v133\unpack\firmware\image\
Run the batch file and select option 6 and you'll find the contents under RKwinTools_v133\unpack\System
Click to expand...
Click to collapse
THX unpacking worked like a charm, but is there also a way of just converting the img to one that is a mountable.ext4. This one I could use under Win and Linux as it would keep permissions ... (Simg2img didnt work)
This is the error:
Code:
*** Please wait... ***
Ext4Extractor version 1.5.2 Created by And_PDA Based on sources ext4_unpacker
Extractor for images in EXT2\EXT3\EXT4\SPARSE formats
Open image file Unpack/Firmware/Image/system.img successfull...
Found SPARSE FORMAT
Convert to EXT4 format started...
Convert to EXT4 format finish success
*********************************
*** Error! ***
*********************************
gggg said:
THX unpacking worked like a charm, but is there also a way of just converting the img to one that is a mountable.ext4. This one I could use under Win and Linux as it would keep permissions ... (Simg2img didnt work)
This is the error:
Code:
*** Please wait... ***
Ext4Extractor version 1.5.2 Created by And_PDA Based on sources ext4_unpacker
Extractor for images in EXT2\EXT3\EXT4\SPARSE formats
Open image file Unpack/Firmware/Image/system.img successfull...
Found SPARSE FORMAT
Convert to EXT4 format started...
Convert to EXT4 format finish success
*********************************
*** Error! ***
*********************************
Click to expand...
Click to collapse
Well option 7 will convert the sparse ext4 image to a normal ext4 image. The message shows error but it would seem that it's converted. Find the image in the same location that you placed system.img.
Mount system_ext4.img on linux using
Code:
mount -t ext4 -o loop system_ext4.img /mnt
pegasus21 said:
Well option 7 will convert the sparse ext4 image to a normal ext4 image. The message shows error but it would seem that it's converted. Find the image in the same location that you placed system.img.
Click to expand...
Click to collapse
THX so far, I can mount it on my Linux PC not under Win8
- Linux Rader still cant open it
- I can Mount it with OSFMount, but neither paragon ExtFS nor ext2Mgr recognice the mounted Drive ????
ideas very welcome
gggg said:
ideas very welcome
Click to expand...
Click to collapse
try this windows system to ext4 double click bat file then drag your system.ing,cache.img or data.img to the open window
pegasus21 said:
You're right... I thought it worked out of the box.
Anyway, I used RKwinTools to extract the system.img contents on Windows.
Place system.img in RKwinTools_v133\unpack\firmware\image\
Run the batch file and select option 6 and you'll find the contents under RKwinTools_v133\unpack\System
Click to expand...
Click to collapse
How to decompile the boot and the kernel?
hello... how to repack the unpacked files?
pegasus21 said:
You're right... I thought it worked out of the box.
Anyway, I used RKwinTools to extract the system.img contents on Windows.
Place system.img in RKwinTools_v133\unpack\firmware\image\
Run the batch file and select option 6 and you'll find the contents under RKwinTools_v133\unpack\System
Click to expand...
Click to collapse
bro can you little explain how its work, i have win , after extract i have just this 3 folders
_in
app
cywim
so where i put system.img.ext4 files?
i really don,t care about extracted i need to repack to ext4

Categories

Resources