PDA

View Full Version : RockChip ROM Building Tips and Tricks by Finless



Pages : [1] 2 3 4

wa0tko
02-25-2012, 11:43 AM
At Finless Bob's request I'm starting this thread to collect information about the tools and techniques for unpacking, modding and building of ROMs for the Nextbook Premium 7.

Any contributions will be welcome.

Randy R.

Finless
02-25-2012, 06:53 PM
OK so whats the first question you all have?

Bob

wa0tko
02-25-2012, 07:07 PM
Bob,

First question is what set of tools you're using to unpack the .img files?
- I found Wendal's RK2918 tools but I couldn't unpack the system.img from your build.
- I could however unpack the one that came from the nextbook recovery kit zip file.

Second question is whether you've got notes on the basic procedure for unpacking, removing apps, making changes and then repacking to build a loadable image set. I haven't had the time to scour the forums but if you've got some links to posts that might be helpful I can probably start putting it all together.

That's probably good for starters.

I'd like to just try it and see if I could build one that would actually run on my tablet.

Thanks,

Randy R.

Finless
02-25-2012, 07:35 PM
OK the Wendal tool was made to specifically unpack manufacturers update.img for RK29 ROMs that the system.img is in cramfs format! If system.img is in another format Wendal's tool will not unpack system.img. However it will still pull out all the .img's into the TEMP folder.

However with that said. It is again specific to certain constucted update.img's I have done other ROMs where wendals tool would NOT unpack the update.img. For instance the Momo7 Tablet update.img it would not handle.

You do not use Wendal's tool if the ROM package is setup like mine where the img's are all pulled out anyway.

Now another note. Some ROM makers are screwing with the cramfs format to keep people from easily getting at system.img!!!! For instance the Polaroid tablet. You could not mount the cramfs system in Linux!!! SO someone made another version of cramfs called cramfs1.1. It is not a mounting tool but it unpacks cramfs images and is modified to handle the messed up cramfs systems some ROM have. Some people are calling it crapfs ;)


Finally if your going to do this, you are not going to be fully successful in Windows. I started that way and even tried cgywin to try and keep from installing and learning linux. I gave up. So you do need linux as some tools or scripts only work in a real linux setup!
What I did was
1) Download VirtualBox. This a a VM environment
2) Created a new VM and installed the latest Ubuntu Linux on it.
This gives me both worlds at one time. I do not have to dual boot between windows and linux.

So now the first lesson. How to see the files and change them in system.img

Most ROMs the system.img is either cramfs, ext3 or ext4. Some may even be yaffs.

All you need to do in linux is mount the system.img!!! Super easy!

So in linux you do this:

First make a directory for the mount

mkdir system

Now mount the system.img. If your unsure of the format you can try to see if linux can figure it out with the simple mount command (FYI for Ubuntu and some distros you need to use sudo to get superuser permissions)

sudo mount -o loop system.img system

If you get an error you may have to specifiy the file system type. Here are two different commands. One if for cramfs and the other is for ext3:

sudo mount -t cramfs -o loop system.img system

sudo mount -t ext3 -o loop system.img system

Once you have it mounted simply browse into the system folder you created and all the files will be there! You can edit, delete, add, etc. When adding be careful you do not over fill the system.img. It is a static size so many times puting files in, you will get an error!

Once you all done just unmount system. It will close the system.img and if you look the system folder will now be empty again. The command to unmount is:

sudo umount system


OK first lesson over.... I am going to dinner and probably on the couch after that. So next answer will be in the AM.

Bob

wa0tko
02-25-2012, 08:33 PM
Bob,

Thanks for taking the time to go into so much detail. That will get a lot if us off and running.

I've been a UNIX Sysadmin for a number if years so am familiar with the command line stuff and working with file systems so i'll be able to dive right in.

Randy R.


Sent from my SGH-T959 using Tapatalk

wa0tko
02-25-2012, 08:49 PM
I'm also starting to go through the Rockchip rooting and other forums so hopefully will be able to pick up a lot more now that you've provided the basics. Will try to ask questions only about what I can't figure out on my own.

Randy R.

Sent from my SGH-T959 using Tapatalk

Finless
02-26-2012, 07:10 PM
OK so I know many want to learn.

So why no questions?
Please feel free to ask! I wont hold anything back.

I know some of you are probably trying to figure out boot.img or have you got it figured?

FYI, there are MANY formats of boot.img! So be ready for that one :)

Bob

HaroldG
02-26-2012, 07:14 PM
OK so I know many want to learn.

So why no questions?
Please feel free to ask! I wont hold anything back.

I know some of you are probably trying to figure out boot.img or have you got it figured?

FYI, there are MANY formats of boot.img! So be ready for that one :)

Bob

I don't know about anyone else, but I am going to need a few days to get my Ubuntu VM operating. I'll ask away once I have things rolling.


Sent from my AN10G2 using Tapatalk

wa0tko
02-26-2012, 08:29 PM
Starting a new job this week so haven't had much time to fool with the tablet. Will probably get going again soon.

Randy R.

Sent from my SGH-T959 using Tapatalk

ZonaMojo
02-27-2012, 09:39 AM
I tried opening your boot.img using cygwin. No dice. I just installed VM w/ Ubuntu, as you suggested. I doubt I'll have much trouble learning commands (my 1st computer ran on DOS)...but I'm sure once I have time to sit down & mess with the boot.img, I'll have plenty of questions.

Finless
02-27-2012, 10:05 AM
There are many formats of boot.img out there so it depends on what ROM.
For RK devices I have seen 4 different ones so far.

1) Boot.img in "Android" format. That is it is just a file with a header, kernel inside it, blank space for a RAM disk, and a footer. This setup was used a lot on RK28 and a few RX29 tablets (Momo and A-10 uses this).

2) Boot.img is a cramfs file system! Just mount it and have at it.

3) Boot.img is a crapfs file system. (we jokingly call it crapfs) It's a modified cramfs that will not mount in linux! They do this to try and stop people from tampering. You will need cramfs1.1 to unpack it.

4) Boot.img is a modifed gzip. It will not unpack with gzip however because it has a header and a bunch of footer info so gzip complains. This is what is used on Arnova, Polaroid, Nextbook, and many other RK29 tabs.

There are also some derivatives of #4.

By the way I have found that #1 and #4 can both be used. e.g. I converted a ROM from #1 to #4 style and it worked (again the Momo7). The tablet should be faster with kernel.img being a separate img rather than stuffed in boot.img. However all the clockwork mods and stuff use #1 style!!! You will never get a CWM mod with #4 style.

So to take apart #4 style there are 2 ways. RKtools written by someone on XDA. Or a couple simple linux commands. I found that some of the derivatives of #4 the RK tools will not work on so I always use my method.

1) You need to strip off the 8 by header. I use DD command.
dd if=boot.img of=bootimg.gz skip=8 bs=1 count=20000000

For linux newbees DD options used here
if= is the input file
of= is the output file
skip= is obvious skip X bytes
bs= is the block size in this case 1 byte blocks
count= is how many bytes DD will take out of the input file and put in the output file.
Now count and bs work together. If I said bs=100 then bs is now a multiplier.
For instance if bs=1 and count=100 you would get 100 bytes in and out
if bs=10 and count=100 you would get 1000 bytes in and out.

So the above command will make a .gz file (which boot.img is) by removing the 8 byte Android header. Now watch out for count. I make it larger than the actual file size. DD will hit the end of the file and stop anyway. But if you make count too small you wont get a full file.
Now unzip it. gz will complain of trailing garbage. Thats the footer. Don't worry about it. You now have boot.img all apart :)


OK lesson 1 for boot.img done.

Let me know if you have any questions,
Bob

WillJames
02-27-2012, 02:21 PM
I don't know about anyone else, but I am going to need a few days to get my Ubuntu VM operating. I'll ask away once I have things rolling.


Sent from my AN10G2 using Tapatalk

Dude... WTH is up with this whine....? You want people to help you? Take take take take take and then whine whine whine. Bob spend your time helping people who really appreciate your work is MHO. Sheesh.:ROLL:DONTKNOW:HA


--------------------------------------


Propprop, my sentiments exactly. The boot screen on Finless' ROM looks like a tacky billboard. It has no fewer than 6 plugs. It's certainly Finless choice to do whatever he wants with his firmware, but it's bad form and just not done with ROMs. Check out pretty much any other ROM on any other platform and you just won't see that.



For instance, NilsP, one of the recognized developers on XDA, has a custom animation that has Andy the Android waiving and it simply says "Nils Business GingerSense." Cyanogen doesn't self-promote in its splash screens or boot animations. Neither do Virus, Joel, or any of the other recognized developers in the platform.



It's just bad form. The kudos belong in the build.prop. If Finless wants to put a "Finless 1.4" logo on the splash screen, that's totally cool, but this splash screen is just antithetical to what is typically done in the Android community. As far as the rest of the functionality of his ROM, it's great, and it's what I run on my 10 G2. His work is genuinely appreciated, there's just this one annoyance. And, frankly, if everybody did what he did with his splash screen, I wouldn't dare mention it. It's just that having seen literally dozens of ROMs for many MANY other devices, this is the only one where I see this kind of thing.



And this has absolutely nothing to do with whatever differences Finless and admin here have.

_________________________________________

blinkydamo
02-28-2012, 01:44 PM
Wondering if you could help a beginner with some of the simple stuff.

I'm trying to strip the individual img files from sowa's image for the 8g2. How do I strip the original image files and then rebuild it back to a flashable image again?

I have ubuntu installed already. I don't know if I'm allowed to use sowa's image, just thought it would be a safe bet as it works and is already rooted.

Cheers in advance.

Blinky.

Sent from my HTC Desire HD using Tapatalk

Finless
02-28-2012, 01:49 PM
Do a google search for AFPTool. It is a standard RK29 tool. Make sure you get the one for RK29 and not RK28 as they are different. This tool will not only take all the .img's out of update.img but it will also make a update.img.

In Windows you open a command shell in the directory where the update.img is.
Make sure you have AFPTool there and the DLLs that come with it.
Then at the command prompt type
AFPTool -unpack update.img //temp

If you cant find the tool let me know and I will upload the kit.

As for using SOWA's ROM, you should ask him first to make sure. Just remember this. Moding a ROM and making no real changes and putting your name on it, is not ROM cooking. If you want to put your name on it, you need to add value. Otherwise your ripping people off. Just my take on ROM cooking to be nice to the original authors.

Bob

blinkydamo
02-28-2012, 02:02 PM
Thank you very much.

I am not looking at releasing the rom, I am just looking at how its done and how to make them. If I get to a point where I think I can make a rom of my own then I will start from scratch.

I would never tweak someone else's rom and call it my own, thats just wrong.

Cheers blinky.

Sent from my HTC Desire HD using Tapatalk

Finless
02-28-2012, 02:11 PM
Thank you very much.

I am not looking at releasing the rom, I am just looking at how its done and how to make them. If I get to a point where I think I can make a rom of my own then I will start from scratch.

I would never tweak someone else's rom and call it my own, thats just wrong.

Cheers blinky.

Sent from my HTC Desire HD using Tapatalk

Perfect.... I love a man with honor!

Making your own personal ROM is OK. Have at it!

Bob

ericdurbin
03-04-2012, 10:02 AM
Do a google search for AFPTool. It is a standard RK29 tool. Make sure you get the one for RK29 and not RK28 as they are different. This tool will not only take all the .img's out of update.img but it will also make a update.img.

If you cant find the tool let me know and I will upload the kit.

Bob

Could you please upload the kit?

blinkydamo
03-04-2012, 01:51 PM
You can download it from this link.

https://docs.google.com/file/d/0B8hUXYDeoy_hNTc1YTVkYTMtNTNjZS00YjI2LTgyNDYtYjRjZ jFmODdiZTQ1/edit

This will unpack the image file into the seperate images. It worked for me.

Good luck,

Blinky

Sent from my AN8G2 using Tapatalk

Finless
03-04-2012, 01:55 PM
Thanks Blinky!

Thats the one. Even setup to run in Windows :)

Bob

blinkydamo
03-04-2012, 02:23 PM
Yeah worked a treat, just got to figure out the linux side now.

Is there a site you know of that supplies info on how to root a stock image file. Would like to try making my own rom from scratch before trying the harder stuff.

I can strip the image into the individual files and can mount the system.img, past that its all new to me. Also i am a linux noob.

Cheers in advance,

Blinky

Sent from my AN8G2 using Tapatalk

ericdurbin
03-04-2012, 03:27 PM
Thanks

Finless
03-04-2012, 03:57 PM
Yeah worked a treat, just got to figure out the linux side now.

Is there a site you know of that supplies info on how to root a stock image file. Would like to try making my own rom from scratch before trying the harder stuff.

I can strip the image into the individual files and can mount the system.img, past that its all new to me. Also i am a linux noob.

Cheers in advance,

Blinky

Sent from my AN8G2 using Tapatalk

No sorry there is NO ONE SITE I know that explains how to do this style of ROM. This is one reason I started this site :)
The information to do a ROM of this style is spread all over the place! It took me weeks to learn it all.

But Blinky.... Please.... Feel free to ask and I will teach you how to do it! I love someone that is willing to do it on their own! So trust me I will help you.

Bob

ericdurbin
03-05-2012, 06:13 PM
OK so I know many want to learn.

So why no questions?
Please feel free to ask! I wont hold anything back.

Bob

Sure, I have a few questions

Are the offset values in the RKUpdate flash utility the default values, or did you have to set them to a value? At what point if any do you have to alter these?

My biggest curiosity is the "parameter" file with KERNEL_IMG. What sets these values, is it simiar to grub.conf in linux?

I'd eventually like to learn to build ICS on my polaroid tablet, I assume this is going to require a new kernel(3.01+), so the relevant portions of the older 2.6 rockchip gingerbread kernel will need to be ported to the newer kernel?

http://www.odys.de/downloads/software/odys_xpress_GPLSourceCode.zip

Will probably need a list of modules to build in to the kernel, like the realtek wifi?

Aside from getting the source from android, building it, and customizing the kernel for rk29xx what other action items need to happen to get it integrated into the rockchip flash utility?

Also, this thread is starting to get pretty long with multiple lessons, perhaps one lesson per thread and making this thread the parent topic would make it easier to find the relevant information that you're trying to find?

Thanks,

Eric

neillmchi
03-05-2012, 09:01 PM
Hello,

I just recently purchased an Arnova 10 G2 Philly Inq edition for hacking on and I'm learning how to get up to speed with making my own roms and I'm able to unpack/modify/repack system.img files, but have run into issues with doing that for the boot.img file. I was wondering if you could give me any tips.

For example, I can take a working boot.img file and do the following (notice no modifications to files within, just a simple unpack/repack) and it bricks the tablet (i can quickly recover from bricks using rkflashtool under linux):

rkunpack boot.img
mkdir myboot
cd myboot
sudo gunzip < ../boot.img-raw | sudo cpio -i --make-directories
cd ..
mkcramfs myboot myboot-temp.img
rkcrc myboot-temp.img customboot.img

Now when I flash this:

sudo rkflashtool w 0x00008000 0x00002000 < customboot.img

The device is bricked (doesn't start up, screen stays blank).

Any ideas here? I would really appreciate some help -- I have a feeling this is second nature to you!

NOTE: to unbrick, I run the exact same rkflashtool command, but with a known working/originally unpacked boot.img (like the one in your rom, or the stock arnova one).

thanks,
-Neill.

Finless
03-05-2012, 09:02 PM
The stock parameter file was very limited on available memory for installing apps. Like 255mb. Yes I modified the stock parameter file to give more user memory space. I took it up to 1 gig.

The parameter file is setup with each value being defined as: size@offset

For instance lets look the stock parameter file for the Arnova 10 G2:
mtdparts=rk29xxnand:0x00002000@0x00002000(misc),0x 00004000@0x00004000(kernel),0x00002000@0x00008000( boot),0x00004000@0x0000A000(recovery),0x00080000@0 x0000E000(system),0x00082000@0x0008E000(backup),0x 0003a000@0x00110000(cache),0x00100000@0x0014a000(u serdata),0x00002000@0x0024a000(kpanic),-@0x0024c000(user)

So from the start we have MISC which has a size of 2000 (hex) blocks. It's STARTS at block 2000 (not 0).
Now when we go to the kernel which is next in the list look at it's offset. MISC starts at 2000 and it's size is 2000. 2000+2000=4000 so that is where kernels offset starts. Now kernel is 4000 is size. So we now take the kernel offset of 4000 and add kernels size of 4000 = 8000. So the next one in the list is boot so it will start at 8000. And so on down the list.

The size is just made to hold the actual .img file size for:
boot.img
kernel.img
misc.img
revocery.img
system.img
backup.img which we really do not use on these ROMs but for some reason it needs to be there.
Yes they are larger than the actual .img file! Some speculate this is wasting memory so you could trim these down if you know you .img file size. However my testing shows the space can get used anyway (like leaving room for system to expand for rooted apps etc).

The other items in the parameter file set space up in memory for use by
cache system
kpanic (never mess with this)
userdata
and finally any remaining ram is "user" rame for flash storage (or sd card if you do not have one).

So in my parameter file to give more space I had to do to things
1) increase the space for userdata where apps get installed
2) Increase the system.img EXT4 file size for more space in /system for rooted apps and stuff (system apps).

To do this I had to move system deffinition to the end. The tablet would not boot otherwise.

So now that you know what you know :)
Here is the parameter file from my ROM.

mtdparts=rk29xxnand:0x00002000@0x00002000(misc),0x 00004000@0x00004000(kernel),0x00002000@0x00008000( boot),0x00004000@0x0000A000(recovery),0x00082000@0 x0000E000(backup),0x0003a000@0x00090000(cache),0x0 0200000@0x000ca000(userdata),0x00002000@0x002ca000 (kpanic),0x00080000@0x002cc000(system),-@0x0034c000(user)

As you can see the userdata size is now much larger (1gig) and system is moved to the end but before the left over user memory (flash).

Let me know if you have questions.

Bob

Finless
03-05-2012, 09:17 PM
He Neill, Hope to see you get up to speed and join the team :)

So you said:


rkunpack boot.img
mkdir myboot
cd myboot
sudo gunzip < ../boot.img-raw | sudo cpio -i --make-directories
mkcramfs myboot myboot-temp.img
rkcrc myboot-temp.img customboot.img


OK rkunpck will unpack boot.img. but it should make the files and directories for you? I do not use rkunpack myself.

Understand boot.img is not a cramfs file system! The older rk28 tablets were and some others but for rk29 they changed that. So your problem is you should not be copying files into a cramfs file system to make boot.img.

Boot.img is nothing more the a gzip file with a header and footer (rkcrc)! Unless you strip off the header, gzip will complain it is not a valid gzip file. So I use DD to do that then unzip the file. Again rkunpack should do all this for you as well but let me explain my way:
Also see post #11 in this very thread.
http://www.freaktab.com/showthread.php?287-ROM-Building-Tips-and-Tricks-by-Finless&p=3541&viewfull=1#post3541

You need to strip off the 8 by header. I use DD command.
dd if=boot.img of=bootimg.gz skip=8 bs=1 count=20000000

So the above command will make a .gz file (which boot.img is) by removing the 8 byte Android header. Now watch out for count. I make it larger than the actual file size. DD will hit the end of the file and stop anyway. But if you make count too small you wont get a full file.
Now unzip it. gz will complain of trailing garbage. That’s the footer. Don't worry about it. You now have boot.img all apart.

To make boot.img just gzip it back up again. However! There is something boot.img does not like inside of it. Touched dates on files!!!! You need to reset them. So here is how I make boot.img

I do this to reset the dates
sudo find . -exec touch -d "1970-01-01 01:00" {} \;

Then just zip it all up
sudo find . ! -name "."|sort|cpio -oa -H newc|gzip -n >../newboot.gz

Finally just add the CRC using rkcrc. NOTE: you need to have the rkcrc that supports the -k parameter. Some other versions out there only supported the -p. If you don’t have that version then once the crc is applied open the file in a hex editor and change the first for bytes from PARM to KRNL.
Anyway add the crc
./rkcrc -k newboot.gz newboot.img

Hope this helps!

Bob

neillmchi
03-05-2012, 10:26 PM
He Neill, Hope to see you get up to speed and join the team :)

So you said:



OK rkunpck will unpack boot.img. but it should make the files and directories for you? I do not use rkunpack myself.

Understand boot.img is not a cramfs file system! The older rk28 tablets were and some others but for rk29 they changed that. So your problem is you should not be copying files into a cramfs file system to make boot.img.

Boot.img is nothing more the a gzip file with a header and footer (rkcrc)! Unless you strip off the header, gzip will complain it is not a valid gzip file. So I use DD to do that then unzip the file. Again rkunpack should do all this for you as well but let me explain my way:
Also see post #11 in this very thread.
http://www.freaktab.com/showthread.php?287-ROM-Building-Tips-and-Tricks-by-Finless&p=3541&viewfull=1#post3541

You need to strip off the 8 by header. I use DD command.
dd if=boot.img of=bootimg.gz skip=8 bs=1 count=20000000

So the above command will make a .gz file (which boot.img is) by removing the 8 byte Android header. Now watch out for count. I make it larger than the actual file size. DD will hit the end of the file and stop anyway. But if you make count too small you wont get a full file.
Now unzip it. gz will complain of trailing garbage. That’s the footer. Don't worry about it. You now have boot.img all apart.

To make boot.img just gzip it back up again. However! There is something boot.img does not like inside of it. Touched dates on files!!!! You need to reset them. So here is how I make boot.img

I do this to reset the dates
sudo find . -exec touch -d "1970-01-01 01:00" {} \;

Then just zip it all up
sudo find . ! -name "."|sort|cpio -oa -H newc|gzip -n >../newboot.gz

Finally just add the CRC using rkcrc. NOTE: you need to have the rkcrc that supports the -k parameter. Some other versions out there only supported the -p. If you don’t have that version then once the crc is applied open the file in a hex editor and change the first for bytes from PARM to KRNL.
Anyway add the crc
./rkcrc -k newboot.gz newboot.img

Hope this helps!

Bob

Wow, thanks, that was it! It properly addressed the gaps I was missing, and I'm providing my own instructions based on yours (assuming you have a working boot.img file already):



dd if=boot.img of=bootimg.gz skip=8 bs=1 count=20000000
mkdir myboot
cd myboot/
sudo gunzip < ../bootimg.gz | sudo cpio -i --make-directories

.. DO CUSTOM EDITS HERE ...

sudo find . -exec touch -d "1970-01-01 01:00" {} \;
sudo find . ! -name "." | sort | sudo cpio -oa -H newc | sudo gzip -n >../customboot.gz
cd ../
rkcrc -k customboot.gz customboot.img

<<BOOT TABLET INTO FLASH MODE>>

# write the new boot image
sudo rkflashtool w 0x00008000 0x00002000 < customboot.img

# optionally reboot now
sudo rkflashtool b


You may have noticed that I modified one of the lines, as i was trying to avoid this warning:



$ sudo find . ! -name "."|sort|cpio -oa -H newc|gzip -n >../customboot.gz
cpio: ./default.prop: Cannot utime: Operation not permitted
cpio: ./init: Cannot open: Permission denied
cpio: ./init_battery.sh: Cannot open: Permission denied
cpio: ./init.goldfish.rc: Cannot open: Permission denied
cpio: ./initlogo.rle: Cannot utime: Operation not permitted
cpio: ./init.rc: Cannot open: Permission denied
cpio: ./init.rk29board.rc: Cannot open: Permission denied
cpio: ./rk29xxnand_ko.ko: Cannot utime: Operation not permitted
cpio: ./sbin/adbd: Cannot stat: Permission denied
cpio: ./sbin/sh: Cannot stat: Permission denied
cpio: ./sbin/ueventd: Cannot stat: Permission denied
cpio: ./ueventd.goldfish.rc: Cannot utime: Operation not permitted
cpio: ./ueventd.rc: Cannot utime: Operation not permitted
cpio: ./ueventd.rk29board.rc: Cannot utime: Operation not permitted


If I was running as root, all of the sudo commands could be removed, but since I wasn't, I had to add sudo in the appropriate places in that command.

Also, I got the following warning on this command:



sudo gunzip < ../bootimg.gz | sudo cpio -i --make-directories

gzip: stdin: decompression OK, trailing garbage ignored


And I just wanted to note that while it's a warning, the resulting boot image is just fine!

Thanks again, Bob!

-Neill.

Finless
03-06-2012, 08:01 AM
Your welcome Niell... Cant wait to see what you cook up :)

Yes as I said the warning from gzip is because of the footer (crc added at the end by rkcrc). It is just ignored.

Have fun,
Bob

neillmchi
03-06-2012, 04:28 PM
Your welcome Niell... Cant wait to see what you cook up :)


Please don't hold your breath -- SO many more questions! So at this point I'm able to build custom boot and system images, roll them into an update image and flash it properly. Things I'm still trying to understand are:

1) generating kernel.img (I'm very familar with compiling Linux kernels), but I haven't located the code for this board yet (driver combinations, etc). Any info or pointers there?

2) locating the android source that builds the default apks. I've got the android stock code and am familiar with things like compiling cyanogenmod for my HTC phone, but have not figured out how to target rockchip devices. help?

3) I'm also looking into your memory location modifications for re-arranging the parameter locations. I understand what's written where and what size it is, but haven't put it all together of how you know which ones can be resized for more usable space, etc. is that documented somewhere, or did you find that experimentally?

I realize I asked a lot of questions that are all over the place. If there's a better place to ask, just let me know! :-)

thanks,
-Neill.

Finless
03-06-2012, 04:43 PM
Hehehhee..... many of us are looking for the source for kernels. We would love to have them!

kernel.img is the same as boot.img format but on extraction all you will have is kernel.bin. Not much use really as it is a compiled kernel.

As for APK's not sure about being directed at RK29? APKs (general apps) should not be hardware specific unless they are ROM specific like some of the ROM tools, or apps directed at specific hardware. Thats linux which is the core of Android.

For taking apart APKs and modding them might I suggest this youtube video:
http://www.youtube.com/watch?v=017pMX8otf8&feature=plcp&context=C36f6e39UDOEgsToPDskLT-eVDerj2TYIBi3X8vexF

NOW WARNING! In some of our tablets the "system" apps are odex'ed. That is they consist of a .apk and a .odex file. So the APK tools out there wont work with this. You have to learn how to de-odex those APKs to make changes to them.

As for the parameter file. They all can be changed depending on what you want to do. As I said in my post above the parameter file specifies the area in "nand memory" to be reserved for loading a .img, or just making memory space for cache, user, etc. Think of it like a formatting file (or for a hard disk the MBR) It tells init how to setup memory (or the hard disk) to put things in and in what order.

Hope this helps,
Bob

Finless
03-06-2012, 04:53 PM
Just to elaborate on the parameter file. It's not magic. Again think of it like a hard disk partitioning table. It describes the partitions, size and where the partions are located from sector 0 (the offset). Again this is like a hard disks MBR (Master Boot Record).

So it is setting up NAND memory in chunks dedicated to a specific partitions or in our case .img's and user disk space.

For instance, I have a SSD hard disk on my PC. A SSD hard disk in nothing more than NAND memory in a box. However to be used as a hard disk I have to "partition" it and then format the partitions. When I do that I put in sector 0 (the loader) information that says: Partion1 is HERE and is THIS LARGE. Partition2 is after partion1 and is THIS large, so on and so forth. e.g. the master MBR of a hard disk so to speak.

The parameter file is the same thing. It not only tells boot where to PUT THINGS in memory but also lets the kernal and other things know where they are. It is basically partitioning NAND memory for the emulated disk partitions! :)

Hope this makes sense?
Bob

ericdurbin
03-06-2012, 05:04 PM
Hehehhee..... many of us are looking for the source for kernels. We would love to have them!


Here's the 2.6 kernel source for a Rockchip 2918 device.
http://www.odys.de/downloads/softwar...SourceCode.zip (http://www.odys.de/downloads/software/odys_xpress_GPLSourceCode.zip)

Finless
03-06-2012, 05:10 PM
Thats all fine and good but alas the kernels for our tablets are customized for our hardware. Not all drivers are insmod inserted at init! So many have tried to use this kernel or others but find things like screen rotation sensing, wifi, sound, etc, etc ,etc, do not work! So then you have to go chasing drivers. Bottom line the source for each tablet ROM is really needed unless you want to spend the huge amount of time recreating the wheel for each device. So unlike standard unix kernels, these are not the same. They have been tweaked to work on specific hardware by the Tablet manufacturer :(
You cannot just take a generic Android kernal and expect it to work on any hardware. Yes it will function but most of the hardware specific stuff, will not work.

Bob

neillmchi
03-06-2012, 05:21 PM
Hehehhee..... many of us are looking for the source for kernels. We would love to have them!

kernel.img is the same as boot.img format but on extraction all you will have is kernel.bin. Not much use really as it is a compiled kernel.

As for APK's not sure about being directed at RK29? APKs (general apps) should not be hardware specific unless they are ROM specific like some of the ROM tools, or apps directed at specific hardware. Thats linux which is the core of Android.

For taking apart APKs and modding them might I suggest this youtube video:
http://www.youtube.com/watch?v=017pMX8otf8&feature=plcp&context=C36f6e39UDOEgsToPDskLT-eVDerj2TYIBi3X8vexF

NOW WARNING! In some of our tablets the "system" apps are odex'ed. That is they consist of a .apk and a .odex file. So the APK tools out there wont work with this. You have to learn how to de-odex those APKs to make changes to them.

As for the parameter file. They all can be changed depending on what you want to do. As I said in my post above the parameter file specifies the area in "nand memory" to be reserved for loading a .img, or just making memory space for cache, user, etc. Think of it like a formatting file (or for a hard disk the MBR) It tells init how to setup memory (or the hard disk) to put things in and in what order.

Hope this helps,
Bob

Thanks a lot -- this helps a lot (along with your other post about the parameter file)! I was able to modify parameter locations and flash a working image with it. I'm familiar with APK development too, I just didn't realize that the APKs weren't being generated from a more official (i.e. android) source. My mistake -- makes sense though.

For now I have plenty to play with, but I have a feeling I'll have more questions soon :-)

-Neill.

ericdurbin
03-06-2012, 05:23 PM
You cannot just take a generic Android kernal and expect it to work on any hardware. Yes it will function but most of the hardware specific stuff, will not work.

Bob

Right, but that kernel provides the cpu architecture as a starting point. The polaroid tablets use a realtek wifi chipset. We will need a list of modules to compile in the kernel.

ericdurbin
03-06-2012, 05:27 PM
What's in misc.img. How do you unpack it?

Finless
03-06-2012, 05:36 PM
Misc.img is just a stupid little left over to tell the recovery system what to do on reboot recovery command! Open it with a hex editor and you will see it is almost all 00. EXCEPT one place about in the middle where text says
Recovery Wipe data etc. What it says there in misc.img is how the recovery system will handle a recovery request on boot.

Our stock roms said recovery wipe. This was changed to support the ext4 file system format in my ROMs to not wipe! We don't want the recovery system to refomat ext3 (thats all it knows) after we just formatted ext4 with a custom script. So we (actually Fenice57 instructed us) changed misc.img at the needed location. Again have a look with a hex editor :)

Bob

Finless
03-06-2012, 05:44 PM
One more thing about misc.img. I think it also has hidden purposes. e.g. well not know to all the community. I hacked at a ROM from a manufacturer that had a TEST menu system and testing hardware code. This was all in misc.img!!! So there is more to misc.img that I know about! It clearly can do more than just a large file with a few text recovery commands!

Bob

neillmchi
03-06-2012, 06:40 PM
The parameter file is the same thing. It not only tells boot where to PUT THINGS in memory but also lets the kernal and other things know where they are. It is basically partitioning NAND memory for the emulated disk partitions! :)

Hope this makes sense?
Bob

Ok, new questions! I'm enlarging the userdata section to be 512M like yours. Is this the max? If I had things working, I'd be trying bigger, but if you happen to know what the max is, that would save me some time.

And my actual question is -- how do you re-pack the userdata.img file? I started by pulling mine from the device (which was 256MB at the time), created a new ext3 fs (matching my init.rc specification) of 512MB, copied over the data (preserving permissions), and unmounted. But obviously it doesn't go into the final update.img just like that, or else the update ends up being 600+MB! Is the userdata file supposed to be gzipped and crc'd like the boot image?

thanks,
-Neill.

Finless
03-06-2012, 08:56 PM
As far as I know there is no max other than physical memory. But before you go hog wild remember the other part -user. This is the memory for other user data like huge video files, etc. So feel free to increase app space but unless you install like 300 aps or something, go larger here buys you nothing. Balance this.

Now your question about userdata. I am not sure I explined it right if your asking this. As I said the parameter file explains how to setup partitions in NAND. Userdata after a ROM flash is BLANK! You are not putting anything in to this area unlike SYSTEM.IMG. Userdata is a blank area like a new hard disk! This is where ALL user installed apps, and other info for apps is stored! This is the "empty OS disk" area of the ROM used for installing apps, etc. This is in fact what I increased is size..

But don't confuse this area with "flash memory" e.g. /flash /sdcard (when you dont have one). This part of memory is the left over that is not part of the ROM. This is yet another area for storing movies and large files that wont fit in the defined area called userdata defined by the ROM. The OS installs apps in /data (which is userdata). Unless you try to move them to SDcard. Then this area is a different MOUNT in the OS than userdata (again /data). The reason it is setup this way is it maybe removable. So the parameter file sets up a built in NAND area of memory that is expected to always be there foe the OS and installed apps!

Make sense?

Bob

neillmchi
03-06-2012, 09:20 PM
As far as I know there is no max other than physical memory. But before you go hog wild remember the other part -user. This is the memory for other user data like huge video files, etc. So feel free to increase app space but unless you install like 300 aps or something, go larger here buys you nothing. Balance this.

Now your question about userdata. I am not sure I explined it right if your asking this. As I said the parameter file explains how to setup partitions in NAND. Userdata after a ROM flash is BLANK! You are not putting anything in to this area unlike SYSTEM.IMG. Userdata is a blank area like a new hard disk! This is where ALL user installed apps, and other info for apps is stored! This is the "empty OS disk" area of the ROM used for installing apps, etc. This is in fact what I increased is size..

But don't confuse this area with "flash memory" e.g. /flash /sdcard (when you dont have one). This part of memory is the left over that is not part of the ROM. This is yet another area for storing movies and large files that wont fit in the defined area called userdata defined by the ROM. The OS installs apps in /data (which is userdata). Unless you try to move them to SDcard. Then this area is a different MOUNT in the OS than userdata (again /data). The reason it is setup this way is it maybe removable. So the parameter file sets up a built in NAND area of memory that is expected to always be there foe the OS and installed apps!

Make sense?

Bob

Ok, I am missing something. This makes sense, but then aside from the apps that come stock in the system.img, how are custom apps to be added? I was thinking I could install them with specific settings (let's take the case of a "just for me" update, for now) and then pull the 'configured' userdata area and restore it later on in a fresh build. I've tried this a few times, but it doesn't seem to work, so clearly I'm misunderstanding something ;-)

Maybe I should have just asked -- what's the best way to make sure apps with specific settings are preserved/configured in my build? Is this all done on a per .apk level that's loaded in the system.img?

And somewhat related, but different, do you know the init.rc (or whatever) syntax I can use to always preserve a Wi-Fi (WEP) password across builds? Obviously this isn't general case, but it would be convenient for testing/private builds!

thanks,
-Neill.

Finless
03-07-2012, 06:47 AM
Neill, see this post about backing up apps and data.

http://www.freaktab.com/showthread.php?150-How-to-do-a-FAST-backup-and-recovery

User install apps go in /data/app
On a stock ROM /data is writeable. Again this is the "userdata" part of the parameter file.
On the stock ROM system is not writeable so none of the standard OS stuff ever even tries to write to /system because it assumes it cant! This is even true for factory reset! The factory reset program thinks system is cramfs and thus it does not need to over write it because nothing should have changed it!


Bob

HaroldG
03-07-2012, 08:02 AM
Neill, see this post about backing up apps and data.

http://www.freaktab.com/showthread.php?150-How-to-do-a-FAST-backup-and-recovery

User install apps go in /data/app
On a stock ROM /data is writeable. Again this is the "userdata" part of the parameter file.
On the stock ROM system is not writeable so none of the standard OS stuff ever even tries to write to /system because it assumes it cant! This is even true for factory reset! The factory reset program thinks system is cramfs and thus it does not need to over write it because nothing should have changed it!


BTW, that post Bob points to is possibly one of the most simple and elegant solutions to a long-time annoyance for a flashaholic like me. Now, whenever I flash a new ROM, I use a file manager to install a copy of Terminal which I've saved on the sd card, then run the restore command, then use Titanium to selectively restore data. Takes mere minutes to get my Android tablet or phone back up and running where it used to take hours. It has made me utterly fearless (which may be a dangerous thing). Earlier this week, I flashed 3 different firmwares on my AN10G2 just to try them out.

neillmchi
03-07-2012, 12:33 PM
BTW, that post Bob points to is possibly one of the most simple and elegant solutions to a long-time annoyance for a flashaholic like me. Now, whenever I flash a new ROM, I use a file manager to install a copy of Terminal which I've saved on the sd card, then run the restore command, then use Titanium to selectively restore data. Takes mere minutes to get my Android tablet or phone back up and running where it used to take hours. It has made me utterly fearless (which may be a dangerous thing). Earlier this week, I flashed 3 different firmwares on my AN10G2 just to try them out.

Hello Bob and HaroldG,

Thanks a lot! I'll take a look into this thread asap. I'm on vacation (travel) the rest of this week, but hope to make some progress on my ROM efforts as I can!

In general, the information and feedback on this forum is incredible, and of course, I see both of your names popping up quite a bit :-)

-Neill.

neillmchi
03-08-2012, 09:26 PM
So just curious, is there a general rule of when the data and cache partitions need to be formatted? It's a pretty expensive operation in terms of time, but I've been doing it more often than not to be on the safe side for new builds. I've determined that you don't need to when flashing a new boot.img. Are there cases when you DO need to when flashing the system.img?

Obviously, if you change the parameters file and place things in different locations, it would make sense to flash all new things and include the formats. But assuming that the locations don't change, when have you been doing this?

thanks,
-Neill.

neillmchi
03-08-2012, 09:46 PM
Oh, and just to clarify, what I mean by formatting the data and cache is flashing the misc.img, which forces the boot to recovery, which does those operations for me. I don't attempt to manually do them :-)

-Neill.

Finless
03-09-2012, 01:40 AM
You will want to do this if you have made major APK changes to /system/app. The reason is the Dalvic-cache and the /data will have "stuff" in it related to what APKs were there on last boot or use. These areas hold all user data, accounts database, other databases, etc etc.. So when you want a clean setup then you should flash so those get formatted. Basically this is what a factory reset does.

If you have just tweaked some setting files in system.img or boot.img then yes you can get by without forcing a data and cache format. If some apps start force closing or errors, then it's because some data left over is not compatible with your changes and you should do a factory reset or as you noticed flash misc.img to force it.

Bob

HaroldG
03-09-2012, 07:16 AM
You will want to do this if you have made major APK changes to /system/app. The reason is the Dalvic-cache and the /data will have "stuff" in it related to what APKs were there on last boot or use. These areas hold all user data, accounts database, other databases, etc etc.. So when you want a clean setup then you should flash so those get formatted. Basically this is what a factory reset does.

If you have just tweaked some setting files in system.img or boot.img then yes you can get by without forcing a data and cache format. If some apps start force closing or errors, then it's because some data left over is not compatible with your changes and you should do a factory reset or as you noticed flash misc.img to force it.

Bob

+1 to what Bob said above. By way of analogy, when making any significant changes to an Android device with a more robust recovery system than on the Rockchip, you always wipe cache and dalvik cache before flashing any changes, such as kernels (usually in boot.img) or changes to framework or other system functions. In fact, when doing nandroids, I never backup cache because it's constantly changing anyway.

blinkydamo
03-14-2012, 03:17 AM
Hi all,

Question if I could, When I mount a system.img so that I and add and remove apk`s from inside all go`s well. The problem I have is once I have finished moving apk`s around and have unmounted and flashed the images. The apk`s that I have placed into the system.img look like they install but all of them crash on boot and I am unable to run any other the programs.

Could someone let me know what I am doing wrong. Am I supposed to do something else after placing the apk`s into the image file and unmounting?

Cheers in advance,

Blinky.

Finless
03-14-2012, 08:43 AM
You probably need to set permissions on the APKs you move into system.img. Especially if you touched them with Windows in any way.

So try this. Change owner to root or system

sudo chown root "the name of the APK"

Now change to r/w and executable

sudo chmod 6755 "the name of the APK"


Bob

kibmcz
03-26-2012, 01:13 AM
Thanks for this thread.. i will be releasing my ext3 based full root next7p rom soon on xda :)

Many thanks Bob.

ZonaMojo
04-01-2012, 02:40 PM
I'm now running Ubuntu w/ VirtualWare on an XP machine I upgraded to Win 7. Ubuntu lags and runs real slow. Sometimes freezing up. I ordered a new 4GB RAM chip (even though only 3.5GB will be utilized by my machine). Was told my VirtualWare set up should then fly. Can't wait to start breaking down ROMS. I learn better hands on, than through reading so I plan to tear Bob's 1.4 Nextbook ROM apart, tweak it a bit, and then repack. Once I am confident I know what I'm doing, I may start building custom ROMS for the Nextbook 7 from the ground up. However, when Bob releases the 1.5 for the Nextbook 7 I'm not sure much else can be improved upon. My 1.4 is already out performing to my expectations. fast and smooth. Can't wait to use Petrus injection tool. Anyway, this is going to be a great learning process for me. Thanks to Finless for this thread, and his willingness to post tips. At the very least I hope I can learn something about the Nextbook 7 that can contribute to any future ROMS he makes for it.

kibmcz
05-22-2012, 10:07 PM
In trying to add google apps and root to the Nextbook Premium 7 SE rom I keep running into space issues... How can i resize the ext3 image?.

Also what is the maximum system image size allowed by the rk2918 hardware?

Finless
05-23-2012, 09:43 AM
So basically your going to make a new IMG file using the DD command, then format the new image, and then your going to mount the original system.img and copy everything over from old to new.

You cant do this in Windows by the way as Windows cannot handle the permissions aspect of copying over files and keeping linux permissions.

DD takes the following parameters:
infile (if), outfile (of), block size (bs), count (number of bytes / size to make file)

So make a new img file using DD. You will need to calculate the size (count) yourself for what you need

# dd if=/dev/zero of=system_new.img bs=1 count=xxxxxxx

Note: dont try and get tricky and use infile from your original IMG. DD will hit EOF (end of file) and stop before it makes the new file larger.

OK you now have a new blank IMG file. Now you need to format it. I assume your going to format ext3. So use the mkfs

# mkfs.ext3 system6.img

OK now mount the original system.img then mount the new system.img so both are mounted.

Now just you the cp (copy) command and copy everying from old to new.

Then unmount both systems and your done.

Bob

kibmcz
05-23-2012, 10:51 AM
So basically your going to make a new IMG file using the DD command, then format the new image, and then your going to mount the original system.img and copy everything over from old to new.

You cant do this in Windows by the way as Windows cannot handle the permissions aspect of copying over files and keeping linux permissions.

DD takes the following parameters:
infile (if), outfile (of), block size (bs), count (number of bytes / size to make file)

So make a new img file using DD. You will need to calculate the size (count) yourself for what you need

# dd if=/dev/zero of=system_new.img bs=1 count=xxxxxxx

Note: dont try and get tricky and use infile from your original IMG. DD will hit EOF (end of file) and stop before it makes the new file larger.

OK you now have a new blank IMG file. Now you need to format it. I assume your going to format ext3. So use the mkfs

# mkfs.ext3 system6.img

OK now mount the original system.img then mount the new system.img so both are mounted.

Now just you the cp (copy) command and copy everying from old to new.

Then unmount both systems and your done.

Bob

Great thanks :)

Got workflow down for it now too.... but what about the max image size for rk2918?


mv ~/android/devices/next7p12/working/system.img ~/android/devices/next7p12/working/system_old.img
sudo mount -t ext3 -o loop ~/android/devices/next7p12/working/system_old.img ~/android/devices/next7p12/working/system_old
dd if=/dev/zero of=~/android/devices/next7p12/working/system.img bs=1024 count=300000
mkfs.ext3 ~/android/devices/next7p12/working/system.img
sudo mount -t ext3 -o loop ~/android/devices/next7p12/working/system.img ~/android/devices/next7p12/working/system
sudo cp -Rfv ~/android/devices/next7p12/working/system_old/* ~/android/devices/next7p12/working/system
sudo umount ~/android/devices/next7p12/working/system
sudo umount ~/android/devices/next7p12/working/system_old


edit: Also the new image has less useable space & larger file size???

Finless
05-23-2012, 11:01 AM
OK for max size you have to work with the parameter file!

Look in the parameter file and you will see:
mtdparts=rk29xxnand:0x00002000@0x00002000(misc),0x 00004000@0x00004000(kernel),0x00002000@0x00008000( boot),0x00004000@0x0000A000(recovery),0x00082000@0 x0000E000(backup),0x0003a000@0x00090000(cache),0x0 0200000@0x000ca000(userdata),0x00002000@0x002ca000 (kpanic),0x00080000@0x002cc000(system),-@0x0034c000(user)

Now if you dont want to mess with this then stay within the size defined here. In another post in this thread I describe how to adjust the sizes here and recalculate the offset. But for now lets stick with what the parameter file as it is.

system is size of 80000. This is 80000 HEX of block size 512.
So convert 80000 hex to decimal = 524,288
Now multiply by 512 decimal = 268,435,456 bytes.

That is how large you can go. If you go larger trust me you will hose the user data area and it wont boot.

Bob

kibmcz
05-23-2012, 11:40 AM
OK for max size you have to work with the parameter file!

Look in the parameter file and you will see:
mtdparts=rk29xxnand:0x00002000@0x00002000(misc),0x 00004000@0x00004000(kernel),0x00002000@0x00008000( boot),0x00004000@0x0000A000(recovery),0x00082000@0 x0000E000(backup),0x0003a000@0x00090000(cache),0x0 0200000@0x000ca000(userdata),0x00002000@0x002ca000 (kpanic),0x00080000@0x002cc000(system),-@0x0034c000(user)

Now if you dont want to mess with this then stay within the size defined here. In another post in this thread I describe how to adjust the sizes here and recalculate the offset. But for now lets stick with what the parameter file as it is.

system is size of 80000. This is 80000 HEX of block size 512.
So convert 80000 hex to decimal = 524,288
Now multiply by 512 decimal = 268,435,456 bytes.

That is how large you can go. If you go larger trust me you will hose the user data area and it wont boot.

Bob

So on next7p12 that means... sorry abit slow at math here LOL (and im changing sleep routine so abit fuzzy)

ok... 460mb (482344960) and dd takes them in kilobytes :)

mtdparts=rk29xxnand:0x00002000@0x00002000(misc),0x 00004000@0x00004000(kernel),0x00008000@0x00008000( boot),0x00008000@0x00010000(recovery),0x000F0000@0 x00018000(backup),0x0003a000@0x00108000(cache),0x0 0100000@0x00142000(userdata),0x00002000@0x00242000 (kpanic),0x000E6000@0x00244000(system),-@0x0032A000(user)

Tip: http://www.csgnetwork.com/memconv.html is your friend when it comes to this LOL

Here is all the info i've collected (with credit given) plus the scripts i use: http://pastebin.com/C8VVCtyE

I hope it can help others :)

kuazar
06-11-2012, 07:24 PM
Hello everyone
Hello Bob

I have been using Linux since around '99 - 2000, have built my own kernels etc. I will always be a noob, because you can never learn enough and just when you think you have figured something out something new comes along and changes everything, lol.

I am currently using your ext4 Nextbook Premium7 #0811. Thank you so much and humbly for this.

I have read and understand prior posts regarding the kernel.img and kernel.bin.
I am interested in using bfs (I use it on an old 'nix box and love it) and overclocking the kernel.
As I am sure you know, no source.
I am not sure, but I believe I read somewhere (was it you, Bob???) about "injecting" the kernel?
If so, how?
Is there a method to change the govenor and scheduler without a source?
There is also a wi-fi update.img for this tab. is there a way to extract the .ko file and put it in a new kernel?

(two side notes:
1.Apps Lib: is there a way to get this to recognize this tab? Do you feel it is worth the effort?
2. Flash 11: I believe that I read that you think you have found a way to get this to work? Any progress?)

Thank you in advance and for all your efforts.........
- Kuazar

Finless
06-11-2012, 09:56 PM
Flash 11 works on my 2.0 ROM. Ity is kernel independant really.

You can inject modules into a kernel. The command is insmod.
But the .ko file must be a kernel module compiled for the version of kerenel you are running.

On your nextbook if you download terminal emulator and run it, sype SU for root and then type lsmod you will see 2 modules. These are what I injected to get ext4 working on that kernel.

Bob

dragonpat
06-26-2012, 08:14 AM
Hello Finless. I am Spanish, he excuses my English. I have a Spanish tablet that is one rk2918 as the cube for example. I have put him roms of the cube but I am trying to create a rom but I do not succeed. I have modified the system.img but it me remains in the logo of beginning. Why can it be? Thank you!

Enviado desde mi Galaxy Nexus usando Tapatalk 2

Finless
06-26-2012, 08:32 AM
The boot image is not in system.img but is in boot.img. Only the bootanimation.zip is in system.img

Also there can be a boot image in the kernel that you wont be able to edit without kernel sources. Not all tablet makers put a image in the kernel though.

Bob

dragonpat
06-26-2012, 03:56 PM
I've tried to modify system.img. I mounted the img, change apps, include su, and unmounted it.
I flash the rom with that system.img and it don't succeed. The tablet stay at logo all time.

Enviado desde mi Galaxy Nexus usando Tapatalk 2

Finless
06-26-2012, 04:01 PM
Is your tablet's system already ext3? Or is it cramfs or something else?

You canot change cramfs by just mounting it. Yes you can mount it but you cannot write to it.

If it is ext3 then you should be able to change it without causing the tablet to not boot. Make simple changes at first. For instance if SU and superuser.apk are not for your processor it can hang on boot. Apps you change and put in /sytem/app if they are not compatible with your tabletr, it can cause it to not boot. So you need to look at what changes you are trying to do and try them one at a time to find out what your doing that causes it not to boot.

FYI, some major changes may require you to erase IDB and flash the entire ROM. For instance, making system size LARGER for sure requires a full reflash of the ROM and possibly modifications to the parameter file.

Bob

dragonpat
06-26-2012, 04:13 PM
I don't know if it's ext 3 or cramfs.

I'm trying it for hobby but I don't know a lot of do it.

The last chance I only included the su file in bin.

So if I change the size of system.img I must change parameters? and how do it?

Enviado desde mi Galaxy Nexus usando Tapatalk 2

dragonpat
06-28-2012, 06:34 AM
So Bob i have created a system.img and copy all the original system.img in it. I only changed the name of tablet in build.prop and the tablet doesn't boot. I have created a img bigger than the original. it is the problem? do i must change parameters¿¿??

Thanks!

Finless
06-28-2012, 07:51 AM
Look at post #25 where I explain the parameter file. If you made system larger than the size defined in the parameter file then yes this is a problem. You need to then adjust the parameter file per post #25.

Bob

dragonpat
06-28-2012, 08:15 AM
Look at post #25 where I explain the parameter file. If you made system larger than the size defined in the parameter file then yes this is a problem. You need to then adjust the parameter file per post #25.

Bob

Ok. I've read it. So if I increase size of system in parameter could boot correctly. But what size must be write? can my parameter file be exactly as yours?

Enviado desde mi Galaxy Nexus usando Tapatalk 2

Finless
06-28-2012, 08:24 AM
Ok. I've read it. So if I increase size of system in parameter could boot correctly. But what size must be write? can my parameter file be exactly as yours?

Enviado desde mi Galaxy Nexus usando Tapatalk 2

Like mine? Which ROM are you talking about that is like mine? I have many with many different parameter files?

Bob

dragonpat
06-28-2012, 08:30 AM
Like mine? Which ROM are you talking about that is like mine? I have many with many different parameter files?

Bob

Don't be angry with me brother...

im referring at parameter file in post 25.

I have a tablet like a cube, g2.. With chip.rk2918.

Enviado desde mi Galaxy Nexus usando Tapatalk 2

Finless
06-28-2012, 08:41 AM
Not angry at all.... Just trying to understand what your asking.

That parameter file is the stock 10G2. The 0x00080000 is stock for a cramfs file system. I had to increase that to 0x00096000 for ext3. But you need to do the math I show to figure it out. Then once you change it for system, recalculate the offsets for everything after system. Also if your system def is in the middle of the parameter file, you need to move it to the end just before the -@ user def and of course recalculate all the other offsets.
Your calculator in windows can be set to "programmer" style in which you can do the math in hex directly. Just remember this. The size has to be in even blocks of 512.

Bob

dragonpat
06-28-2012, 08:51 AM
Sorry but you're talking in chinese for me...jeje

Because I see numbers and letters that I don't understand.

Im afraid I will stay in stock...:(

Enviado desde mi Galaxy Nexus usando Tapatalk 2

Finless
06-28-2012, 10:46 AM
Sorry but you're talking in chinese for me...jeje

Because I see numbers and letters that I don't understand.

Im afraid I will stay in stock...:(

Enviado desde mi Galaxy Nexus usando Tapatalk 2

Do you have a ROM dump I can look at? I can make a ROM for you if I have the ROM. either backup.img or update.img

Bob

dragonpat
06-28-2012, 04:15 PM
Are you OK qith the offial update to ICS of my tablet. If it's ok, here is the link (http://wolderelectronics.com/descargas/ActualizacionAndroid4.0miTabSunset_20120611.rar).

If not, tomorrow will try to dump my tablet on XP, because in W7 didn't work.

Finless
06-28-2012, 04:16 PM
Are you OK qith the offial update to ICS of my tablet. If it's ok, here is the link (http://wolderelectronics.com/descargas/ActualizacionAndroid4.0miTabSunset_20120611.rar).

If not, tomorrow will try to dump my tablet on XP, because in W7 didn't work.

Does this update work on your tablet? I dont want to start a project unless it works to start with.

Let me know,
Bob

dragonpat
06-28-2012, 04:21 PM
Does this update work on your tablet? I dont want to start a project unless it works to start with.

Let me know,
Bob

Yes. It runs ok.

Enviado desde mi Galaxy Nexus usando Tapatalk 2

Finless
06-28-2012, 04:32 PM
Yes. It runs ok.

Enviado desde mi Galaxy Nexus usando Tapatalk 2

OK I am downloading it now... But it is very slow for me :(

Bob

Finless
06-29-2012, 04:04 PM
Dragonpat, are you still around? I have downloaded your ROM and have looked at it.

The cool thing is it has a updated RKAndroid Flash tool V1.34. The BAD is that the manufacturer of this tablet doesnt know how to use it correctly!
THIS IS A MESSED UP ROM!!!! The flash tool is not setup right. The instructions make you pick each file. That is just NOT GOOD CUSTOMER SUPPORT!

I think part of your problem is the flash tool!

Would you like me to make a ROM for you?

Bob

dragonpat
06-29-2012, 04:49 PM
Dragonpat, are you still around? I have downloaded your ROM and have looked at it.

The cool thing is it has a updated RKAndroid Flash tool V1.34. The BAD is that the manufacturer of this tablet doesnt know how to use it correctly!
THIS IS A MESSED UP ROM!!!! The flash tool is not setup right. The instructions make you pick each file. That is just NOT GOOD CUSTOMER SUPPORT!

I think part of your problem is the flash tool!

Would you like me to make a ROM for you?

Bob

Yes please!. First you make a rom for me and after that you teach me how to do it...don't you?

Enviado desde mi Galaxy Nexus usando Tapatalk 2

beovoz
07-03-2012, 02:50 PM
I want to make rooted ROM for Prestigio MultiPad PMP5080B (RK29), using newest version of ICS on their site, 2.0.3. However, i have problems with unpacking boot.img, system.img .. etc
I looked at this site - https://sites.google.com/site/rk2918tools/convert-cramfs-system-img-to-ext3
but i can't use ./rkunpack boot.img - error 'invalid signature'

even when i found the right tool to unpack boot.img, i got 3 files - boot.img-ramdisk.cpio.gz, boot.img-kernel.gz so i opened the first one and tried to edit init.rc (search for mtd and change ro to rw), but it is not writable

i use arch linux, any help ?

Finless
07-03-2012, 02:53 PM
Give me the link to the stock ROM and I will have a look.

The perl scripts you used to unpack boot.img means the kernel is inside boot.img. Unfortunatly you will NEVER be able to reconstruct that using repack perl script. e.g. make a boot.img with kernel inside. Why? Because each manufacturer adds a seed to the encryption (like rkcrc but not the same) and if you do not know what that is, the repack will never work. Thus you have to take those parts you got and make a kernel.img and a boot.img without the kernel.

FYI, to fix the kernel you must know what your doing with a hex editor after it has been extracted. They are also NOT real .gz files...... So you have to be good with a hex editor to fix all the parts!

Bob

beovoz
07-03-2012, 04:20 PM
Thanks for the reply :D

Here's the link - http://yf.value4it.com/Service_Files/TabletPC/PMP5080B-BRU/PMP5080B_2.0.3_20120613.zip

Finless
07-03-2012, 04:32 PM
Downloading now.

So what would you like me to do with it? Root it? Make my 1.5 ROM out of it? Google Play Store? etc?

Bob

Finless
07-03-2012, 04:52 PM
Damn... the download stopped at 35% and this site does not support resume :(

I am trying again.

Bob

beovoz
07-03-2012, 05:31 PM
If you could just root it, that would be fine! And you could show me the steps you did, if it is not problem?

Thanks for the effort!

Finless
07-03-2012, 06:10 PM
I got the download. As for teaching I try my best but time is a problem. The ROM I make will have kernel outside of boot.img so all the TIPS I have posted here in this thread will allow you to do more and take apart the ROM.

I just do not have time to go into the boot.img with kernel unpack as it is very complicated. A video on how would be required as posting how would be 18 pages long or something. Sorry...

Bob

kibmcz
07-05-2012, 10:34 AM
Give this a shot I used it when I rooted the next7p1n rom for use on my next7p.
Download unpack-bootimg.pl & rkcrc (http://www.freaktab.com/attachment.php?attachmentid=570&d=1341509591)
Put unpack-bootimg.pl, rkcrc & boot.img in folder
Naviate to the folder in terminal
Type ./unpack-bootimg.pl boot.img
Type ./rkcrc -k boot.img-kernel.gz kernel_temp.img
Open kernel_temp.img in a hex editor and remove everything before D3 F0 at the start of the file
Type ./rkcrc -k kernel_temp.img kernel.img
Type cd boot.img-ramdisk
Type sudo find . -exec touch -d "1970-01-01 01:00" {} \;
Type sudo find . ! -name "." | sort | sudo cpio -oa -H newc | sudo gzip -n >../customboot.gz
Type cd ../
Type ./rkcrc -k customboot.gz boot.img'
Edit: Added hex editor step thanks to Bob

Finless
07-05-2012, 11:40 AM
kibmcz, thanks for explainig that. However one problem I found is the extracted kernel.img

The first 2 bytes of the kernel should start with D3 F0. If you open the extracted kernel with a hex editor you will see it has a bunch of 00 data in front of it left over from the ram disk. Some tablets can handle this OK some will not. What you should do is remove all that padding up to D3 F0. Then add the rkcrc.

Bob

kibmcz
07-05-2012, 12:31 PM
kibmcz, thanks for explainig that. However one problem I found is the extracted kernel.img

The first 2 bytes of the kernel should start with D3 F0. If you open the extracted kernel with a hex editor you will see it has a bunch of 00 data in front of it left over from the ram disk. Some tablets can handle this OK some will not. What you should do is remove all that padding up to D3 F0. Then add the rkcrc.

Bob


Ok revised the guide to include hex editor step thanks :)

beovoz
07-05-2012, 03:07 PM
...

Type ./unpack-bootimg.pl boot.img
Type ./rkcrc -k boot.img-kernel.gz kernel_temp.img
Open kernel_temp.img in a hex editor and remove everything before D3 at the start of the file
Type ./rkcrc -k kernel_temp.img kernel.img
Type cd boot.img-ramdisk
Type sudo find . -exec touch -d "1970-01-01 01:00" {} \;
Type sudo find . ! -name "." | sort | sudo cpio -oa -H newc | sudo gzip -n >../customboot.gz
Type cd ../
Type ./rkcrc -k customboot.gz boot.img'



OK when I type the first command i get boot.img.kernel and boot.img-ramdisk.gz .
Second command, i did "./rkcrc -k boot.img-kernel kernel_temp.img"
Then i opened kernel_temp in Bless hex editor and removed that
but when doing the fourth command the new kernel.img again does not have numbers to D3 removed

in fact i could not overwrite kernel_temp.img with that deleted (program error) so i saved the file somewhere else, renamed it to "kernel_temp.img" and overwrited manually, did i do it right?
and i cannot switch to boot.img-ramdisk, cause that is not a directory, just a .gz file

kibmcz
07-05-2012, 04:53 PM
OK when I type the first command i get boot.img.kernel and boot.img-ramdisk.gz .
Second command, i did "./rkcrc -k boot.img-kernel kernel_temp.img"
Then i opened kernel_temp in Bless hex editor and removed that
but when doing the fourth command the new kernel.img again does not have numbers to D3 removed

in fact i could not overwrite kernel_temp.img with that deleted (program error) so i saved the file somewhere else, renamed it to "kernel_temp.img" and overwrited manually, did i do it right?
and i cannot switch to boot.img-ramdisk, cause that is not a directory, just a .gz file

The kernel image padding only needed to be removed teh first time.... after that and running rkcrc to final kernel.img it should be valid kernel image.

Sounds like it was not able to unpack the ramdisk cause with the images i got the folder was made perhaps bob could shed some light on this?

Edit: I was able to split it and i found the area to remove in the kernel. Give this a shot and see if it boots... http://www.mediafire.com/?9aiuso0oq5j3jfa

beovoz
07-06-2012, 06:31 PM
Thanks :D but do i need to mount boot.img to change mtd@system ... ro to rw? cause i can extract it but not repack it (Bob said that also) and i want to know, if i am rooting, is it enough just to put rw to mount in boot.img or i have to put additional apps (su, busybox, Superuser.apk) to system.img ? i mean i can do that later when all is up and running? if i need that i must enlarge system.img cause there's no space in it for all apps

kibmcz
07-06-2012, 07:16 PM
Thanks :D but do i need to mount boot.img to change mtd@system ... ro to rw? cause i can extract it but not repack it (Bob said that also) and i want to know, if i am rooting, is it enough just to put rw to mount in boot.img or i have to put additional apps (su, busybox, Superuser.apk) to system.img ? i mean i can do that later when all is up and running? if i need that i must enlarge system.img cause there's no space in it for all apps

Modifying boot is simple now that it is split you can find out how to do that here http://www.freaktab.com/showthread.php?287-RockChip-ROM-Building-Tips-and-Tricks-by-Finless&p=4053&viewfull=1#post4053. Tho use rkcrc -k instead of what it sys for rkcrc.

And yep the su,busybox, and superuser.apk go in system but the instructions for modifying that will vary depending on if it is ext3 or cramfs. I will look at the system.img and see what is and get back to you you :).

Edit: Heres how to edit system


mkdir ~/system
sudo mount -t ext3 -o loop ~/system.img ~/system
<make changes>
sudo umount ~/system

beovoz
07-07-2012, 06:01 AM
OK managed to modify boot.img without any problems :D

As for system.img, i used resize2fs to enlarge it to 330MB instead of 316MB it previously had

now i inserted su, Superuser.apk but could not find busybox to copy in /xbin, so i copied app busybox.apk into /app

the question is, do i have to change offsets cause the file is bigger now? how do i do that?

Finless
07-07-2012, 10:08 AM
Post your parameter file contents and I will have a look and see how big you can go before you have to adjust it.

Bob

kibmcz
07-07-2012, 10:12 AM
OK managed to modify boot.img without any problems :D

As for system.img, i used resize2fs to enlarge it to 330MB instead of 316MB it previously had

now i inserted su, Superuser.apk but could not find busybox to copy in /xbin, so i copied app busybox.apk into /app

the question is, do i have to change offsets cause the file is bigger now? how do i do that?

First off here is the busybox binary that i use... http://www.mediafire.com/?h8utar15fadx206 i have it in /system/bin and all root apps seem to take it.

Use this to calculate the maximum system.img you can use: http://www.freaktab.com/showthread.php?287-RockChip-ROM-Building-Tips-and-Tricks-by-Finless&p=13226&viewfull=1#post13226 also if you really must change the paramiters this will help you... http://www.freaktab.com/showthread.php?287-RockChip-ROM-Building-Tips-and-Tricks-by-Finless&p=4054&viewfull=1#post4054.

beovoz
07-07-2012, 11:29 AM
That's why i asked if i need to modify parameter file, if i don't, that's fine

cause i don't want to mess something up and get a bricked device... i'll try with these parameters to flash the device...

Finless
07-07-2012, 11:37 AM
You cannot permanently brick a RK29 tablet.

Bob

kibmcz
07-07-2012, 11:43 AM
You cannot permanently brick a RK29 tablet.

Bob

Well i can only think of ONE way LOL... bad bootloader flash but yea beyond that unbrickable.

beovoz
07-07-2012, 11:55 AM
I ran the flash through RK29Update on Windows, and it flashes fine, but when the device starts up, it goes to the recovery, "formatting /data... formatting /mnt/sdcard... formatting /flash... rebooting..." And it goes off, and cannot turn on. Somehow it successfully rebooted, but then it went again in the recovery with the image of a bricked Android robot. Is it the recovery problem ??

Finless
07-07-2012, 02:21 PM
No it's going into rtecovery because it cannot boot. So you messed up your system.img near I can tell.

You are not applying rkcrc to system.img are you? If so you do not do that. system.img is nothing more than a file system image.

Bob

beovoz
07-07-2012, 04:25 PM
No, i didn't apply rkcrc on it, just the following
e2fsck check (don't know the complete command)
resize2fs system.img 316M
sudo mount -t ext3 system.img /mnt/1
<changes - add su, busybox, Su-user.apk>
sudo umount /mnt/1

that's all i did to system.img

kibmcz
07-07-2012, 05:34 PM
No, i didn't apply rkcrc on it, just the following
e2fsck check (don't know the complete command)
resize2fs system.img 316M
sudo mount -t ext3 system.img /mnt/1
<changes - add su, busybox, Su-user.apk>
sudo umount /mnt/1

that's all i did to system.img

Sounds like your issue is the method you used to resize the image... this is the method that is known to work http://www.freaktab.com/showthread.php?287-RockChip-ROM-Building-Tips-and-Tricks-by-Finless&p=13205&viewfull=1#post13205.

To know your maximum system image size use this http://www.freaktab.com/showthread.php?287-RockChip-ROM-Building-Tips-and-Tricks-by-Finless&p=13226&viewfull=1#post13226.

beovoz
07-08-2012, 02:07 AM
OK now i used DD and all boots fine ... BUT is not rooted :BANG
i have copied su to /system/xbin and /system/bin busybox was already at /system/bin
Superuser was of course pre-installed and it says the binary is outdated, when i click update when it says "remounting /system as rw..." shows "legacy" ?? apps do not recognise su except superuser ??

beovoz
07-08-2012, 02:47 AM
OK now i used DD and all boots fine ... BUT is not rooted :BANG
i have copied su to /system/xbin and /system/bin busybox was already at /system/bin
Superuser was of course pre-installed and it says the binary is outdated, when i click update when it says "remounting /system as rw..." shows "legacy" ?? apps do not recognise su except superuser ??


edit : success, it needed chmod 6755 , thank you guys for help!! :)

kibmcz
07-08-2012, 04:34 AM
edit : success, it needed chmod 6755 , thank you guys for help!! :)

Congrats :)

On another note did you use the latest su/superuser from http://androidsu.com/superuser/ if not id suggest to use them its what i got on mine.

beovoz
07-08-2012, 04:38 AM
I have just updated them :D

dragonpat
07-08-2012, 04:46 AM
I have just updated them :D

So you have created your own rom? Congratulations!

I want to do it too...:confused:

All these indications are for linux?


Enviado desde mi Galaxy Nexus usando Tapatalk 2

beovoz
07-08-2012, 05:25 AM
Yeah, these are for Linux

Finless
07-08-2012, 08:10 AM
edit : success, it needed chmod 6755 , thank you guys for help!! :)

:CLAP

Good job!

Bob

dragonpat
07-10-2012, 11:34 AM
I'm trying to do it myself but it's impossible. Too difficult for me. :o

Enviado desde mi Galaxy Nexus usando Tapatalk 2

Finless
07-10-2012, 12:42 PM
I'm trying to do it myself but it's impossible. Too difficult for me. :o

Enviado desde mi Galaxy Nexus usando Tapatalk 2

Dragonpat, I am super busy right now with my 2.1 ROMs but I promise I will make you a kick butt ROM soon!

Bob

dragonpat
07-10-2012, 12:55 PM
Dragonpat, I am super busy right now with my 2.1 ROMs but I promise I will make you a kick butt ROM soon!

Bob

Don't worry bob. Only I would like to learn and do it myself but I very new in kitchen, in ubuntu...
I've think also to do a zip but I tried without prize.

Enviado desde mi Galaxy Nexus usando Tapatalk 2

dragonpat
07-15-2012, 01:04 AM
Dragonpat, I am super busy right now with my 2.1 ROMs but I promise I will make you a kick butt ROM soon!

Bob

Hi bob!

how are you with your roms work?

Will you have time for my rom?

Thanks and sorry for my english!

Enviado desde mi Galaxy Nexus usando Tapatalk 2

Finless
07-15-2012, 01:20 PM
Folks I got asked this question about a ROM vs user data and factory reset.
I figured I would share the response I gave so people can understand.

___________________

Yes update.img will be your stock ROM. It does not contain any user data or anything. So if you flash update.img you will have the ROM you got when you got the tablet.

Now understand how Android works. A ROM consists of these partions:
system, kernel, boot, recovery, misc.
As you see it does not contain
/data or /cache
These directories are made on first boot up. THIS is where are you user data is stored.

All a data factory reset does is erase /data and /cache. It does not flash the ROM. So if you were rooted and you modified /system for instance. A data factory reset will not erase or change /system. To do that and get that back to stock, you must flash update.img which will erase and replace those.


Bob

Finless
07-15-2012, 04:01 PM
Hi bob!

how are you with your roms work?

Will you have time for my rom?

Thanks and sorry for my english!

Enviado desde mi Galaxy Nexus usando Tapatalk 2

DragonPat, sorry man... been a busy week and me having to fix some of my BETA ROMS.

OK I am ready to work on your now. So what would you like me to do exactly?
Root? Is Gplay installed already? Etc?

Also your English is fine! Better than some people here in the US :)

Bob

dragonpat
07-15-2012, 05:00 PM
DragonPat, sorry man... been a busy week and me having to fix some of my BETA ROMS.

OK I am ready to work on your now. So what would you like me to do exactly?
Root? Is Gplay installed already? Etc?

Also your English is fine! Better than some people here in the US :)

Bob

Jaja...thanks.

I can root the tablet. I would like to test a rom made from you, rooted and with some fixes of battery or what you want.

This is the beginning, I think.

So if you do that I'll thank you a lot.

Enviado desde mi Galaxy Nexus usando Tapatalk 2

Finless
07-15-2012, 05:20 PM
Jaja...thanks.

I can root the tablet. I would like to test a rom made from you, rooted and with some fixes of battery or what you want.

This is the beginning, I think.

So if you do that I'll thank you a lot.

Enviado desde mi Galaxy Nexus usando Tapatalk 2


Battery fixes? Whats the problem? I need more info on what to fix?

Bob

dragonpat
07-15-2012, 05:50 PM
Battery fixes? Whats the problem? I need more info on what to fix?

Bob

Not exactly fix it. I want to say to better performance of the battery. Or nothing. Only a finless rom for my tablet.:)

Enviado desde mi Galaxy Nexus usando Tapatalk 2

Finless
07-15-2012, 06:00 PM
Many people think a ROM can fix battery life. While you can make some tweaks, RK29 ROM cannot do much for battery life! It's not like Apple or something. So I can make tweaks to wifi, etc, to help ONLY A TINY BIT, but other than that it will not be dramatic!

I see a lot of JUNK in this ROM? Can you please give me a list of BLOAT you think can be removed? I cannot test or run this ROM so I have no way to know what is bloat!

So that would help me.

Bob

dragonpat
07-15-2012, 11:13 PM
Many people think a ROM can fix battery life. While you can make some tweaks, RK29 ROM cannot do much for battery life! It's not like Apple or something. So I can make tweaks to wifi, etc, to help ONLY A TINY BIT, but other than that it will not be dramatic!

I see a lot of JUNK in this ROM? Can you please give me a list of BLOAT you think can be removed? I cannot test or run this ROM so I have no way to know what is bloat!

So that would help me.

Bob

I don't know exactly what are you referring. are you talking about apps?

Enviado desde mi Galaxy Nexus usando Tapatalk 2

dragonpat
07-16-2012, 02:15 PM
Bob? Have you abandoned me??. :(

Enviado desde mi Full AOSP on Rk29sdk usando Tapatalk 2

Finless
07-16-2012, 02:18 PM
No but I am at work today so cant do anything. Yes what APPs do you want removed from this ROM as "bloat"? It seems to have a lot of preinstalled APPs but I do not know what they are. What must stay and what can go.

Bob

dragonpat
07-16-2012, 02:26 PM
No but I am at work today so cant do anything. Yes what APPs do you want removed from this ROM as "bloat"? It seems to have a lot of preinstalled APPs but I do not know what they are. What must stay and what can go.

Bob

Ok. It was a joke.

I don't need any app especially. I only need a file explorer, browser and gplay if you can.

Enviado desde mi Galaxy Nexus usando Tapatalk 2

Finless
07-16-2012, 05:03 PM
Dragonpat, this is getting WAY off subject for this post.

Can you please make a NEW post in the OEM forum asking for a ROM. I have many questions and this thread here is not the place to be discussing building you a ROM.

So make a new posts here:
http://www.freaktab.com/forumdisplay.php?48-Other-(OEM)-Tablets

Bob

d3kilo
07-19-2012, 05:22 PM
I want to ask?
I there is different ROM size using rkdump (win) & rkdump.pl (linux)

after get step by step from Bob (thank you Bob)
http://www.freaktab.com/showthread.php?1198-Stuck-to-temporary-Root-Rockchip-RK29

I have already dump a backup.img, but i can't use afptool for unpack it. I don't know why. (It there any a special step to unpack it?)
I tried again to dump using rkdump (win) and i get the backup.img and i can unpack it. but the different size is so large.

503Mb vs 285Mb

Here is the file :
Using rkdump.pl (linux) : http://www.4shared.com/archive/hD-cKHIb/Vandroid_T2i_STOCK_ROM_Updatei.html
Using rkdump (windows) : http://www.4shared.com/archive/tAwy2wXv/vandroid_t2i_update_img_repack.html

So why there is a different size in the same ROM using 2 different way to dump?

Another question : is boot.img = kernel.img ?

-----------------------------
STOCK ROM From : Advan Vandroid T2i Resistive (identical with Nextbook 7P S)

Finless
07-19-2012, 06:41 PM
I am downloading them now and will have a look.

I think I can explain to you why but let me have a look first.

Bob

Finless
07-19-2012, 06:44 PM
Sorry I cannot download them. I refuse to sign up for a 4shared account.

I can give you a FTP location to upload them that is SPAM free. This is the only way I will work. These sites will go by the way of megaupload, and I do not want my name in their database. sorry....

Let me know if you want to FTP to me,
Bob

kibmcz
07-21-2012, 03:23 PM
Oh and one quick tip for modding most rockchip tablets... a good easy to use reset tool to push the recessed reset pin.

Of course I went overkill on mine lol.

Finless
07-21-2012, 04:38 PM
Oh and one quick tip for modding most rockchip tablets... a good easy to use reset tool to push the recessed reset pin.

Of course I went overkill on mine lol.

:WTF:WTF

What the hell is that or "was that"?

I took a dremmel moto tool to a standard cork board stick pin and made my tool.... No picture needed :)

Bob

kibmcz
07-21-2012, 04:51 PM
:WTF:WTF

What the hell is that or "was that"?

I took a dremmel moto tool to a standard cork board stick pin and made my tool.... No picture needed :)

Bob

It is about my only paperclip that i had with paper towel wrapped around it then masking tape (with color added).

I had nothing else to use lol.

vendorz
07-28-2012, 11:03 AM
So now the first lesson. How to see the files and change them in system.img

Most ROMs the system.img is either cramfs, ext3 or ext4. Some may even be yaffs.

All you need to do in linux is mount the system.img!!! Super easy!

So in linux you do this:

First make a directory for the mount

mkdir system

Now mount the system.img. If your unsure of the format you can try to see if linux can figure it out with the simple mount command (FYI for Ubuntu and some distros you need to use sudo to get superuser permissions)

sudo mount -o loop system.img system

If you get an error you may have to specifiy the file system type. Here are two different commands. One if for cramfs and the other is for ext3:

sudo mount -t cramfs -o loop system.img system

sudo mount -t ext3 -o loop system.img system

Once you have it mounted simply browse into the system folder you created and all the files will be there! You can edit, delete, add, etc. When adding be careful you do not over fill the system.img. It is a static size so many times puting files in, you will get an error!

Once you all done just unmount system. It will close the system.img and if you look the system folder will now be empty again. The command to unmount is:

sudo umount system


OK first lesson over.... I am going to dinner and probably on the couch after that. So next answer will be in the AM.

Bob

Beautiful, baby! Thanks again finless one and cookers all.

My Next7 now sees my very large MicroSD as internal storage and it's only wasting a couple of GBs on the virtual sdcard.

I'll get to that waste later. For now I can revel a moment in my success and download music from Rhapsody to my heart's content. Well... 32 GBs of my heart's content n-e-way.

Finless
07-28-2012, 12:55 PM
Guys, please use the nextbook forum to post stuff about it not here as people will never find it in this thread.

Bob

vendorz
07-28-2012, 05:45 PM
Guys, please use the nextbook forum to post stuff about it not here as people will never find it in this thread.

Bob

Sorry, Bob.

I posted success with the tip or trick in - I think - the thread from which I quoted it... I was meaning to remain topical...

jimsie
07-29-2012, 01:09 PM
Hello Bob,

Stumbled across your forum while trying to find a way to unpack add in super user and repack for the Andypad Standard. Have managed to extract .img file as per your guide. Made an empty ext3 partition and tried to repack. Might be posting in the wrong forum, but i saw you were offering to root roms if you were supplied with the system.img. If you could point me in the right direction it would be much appreciated. The Andypad has been out for about a year and have just bought my eldest boy one, didn't want to spend to much in case he broke it. Would be good to have Titanium backup on there and Google play.

I have a ZTE Blade and also an Advent Vega. So had a bit of experience, not really had that much to do with linux. Thanks again

Jimsie

Finless
07-29-2012, 01:39 PM
I need more than just system.img. I need the stock ROM. If one is not available then I need the backup.img from your original ROM dump. Is there a stock ROM I can download?

Bob

jimsie
07-29-2012, 01:55 PM
Hello Bob,

Thanks for your quick response. The link for the rom is below its a zip file with 5 .img files boot, kernel, recovery, misc and system. Don't know whether you need all these? If you manage to root the rom would it be ok to link back here from Modaco?

http://www.andypad.co.uk/Downloads/StandardRomUpgrade.zip

Finless
07-29-2012, 02:01 PM
Hello Bob,

Thanks for your quick response. The link for the rom is below its a zip file with 5 .img files boot, kernel, recovery, misc and system. Don't know whether you need all these? If you manage to root the rom would it be ok to link back here from Modaco?

http://www.andypad.co.uk/Downloads/StandardRomUpgrade.zip

Oh trust me... I can root this ROM.... One hasnt kicked my butt yet :)

Give me a day to look at it and make a FInless ROM. It will be updated with fast ext4 file system, fully rooted, etc.

Does the ROM already have Google Play installed?

Bob

jimsie
07-29-2012, 02:07 PM
That's what i like to hear :) I might have been able to do given a few weeks and lots of googling, just really need to get to grips with Linux. Keep promising myself I'll learn but so much to learn!

No rom doesn't come with play market, have installed but it FC. Guess it's to do with build.prop. Listed as unknown under device. If you could include it it would be nice. It's an ICS rom btw.

Thanks

Jimsie

Finless
07-29-2012, 02:27 PM
Please make a post in this forum for the tablet. Provide links to it if you can and information.

We will move the ROM topic there.

http://www.freaktab.com/forumdisplay.php?48-Other-(OEM)-Tablets



Bob

jimsie
07-29-2012, 02:56 PM
Hi, have moved this to a new thread here:

http://www.freaktab.com/showthread.php?1323-ANDYPAD-STANDARD-Finless-ROM-Devolopment

Thanks Bob, looking forward to seeing your work :)

monk3ybidzness
07-30-2012, 07:06 AM
Thank You Finless!

I now have an Android Tablet customized just the way I like it :)

8" RK2918 Tablet (was on GB)
Used stock ICS Image from TomTec

Unpack update.img using Wendal's Tool, replaced su & superuser.apk with latest version
Mounted system.img in Virtualbox/Ubuntu, edited /apps and /xbin
Re-pack > Wendal's
Flashed tablet > RKBatch Tool

Didn't do much, I just wanted 'root' to use SetCPU and other cool root-only apps

It's the explanation on this thread about that crapfs file format that helped me a lot, again thanks!

Finless
07-30-2012, 08:51 AM
If you changed to ext3? from CrapFS, you must also have opened boot.img and edited init.rc yes?

ICS ROM's are usually already ext3? Anyway if you did not have to edit init.rc you should unpack boot.img and edit init.rc to make system mount as RW. This makes it easier for rooted apps etc that need to write to /system. Otherwise you have to use a tool or command shell to always remount system as RW.

Bob

hostile
08-02-2012, 10:06 PM
wrong area.

wolff
08-08-2012, 09:21 PM
Hi Finless, how are you?

First of all, many thanks for all these explanations, it helped me a lot. And sorry for my english in the next sentences.

My knowledge: Searching here and there i've managed to unpack/modify/repack/reflash/rooted images for my android device (it's a set top box, Android 2.3.1, RK2918 with 4 USB), using rkutils and wendal tools.
One rooted update.img of this device can be found here: http://www.mediafire.com/?idiaukpv66dzgc6

I also have another set top tv box, named Measy A5A (3 usb, Android 2.3.1, RK2918 also, not rooted yet). You already worked on a ROM of this Measy on this thread: http://www.freaktab.com/showthread.php?740-Rooting-Measy-A5A-Android-Player

Both box are very similar, in OS and chipset.

These tv boxes have a Display Scale Settings to fit the screen through HDMI. Usually i set to 100% in both box to fullfit the tv screen.

When i reboot the boxes, Measy A5A runs ok, scaling the display 100% accordingly.

But the other box (with 4 usb) did not, it started scaled ~95%. When i go to Display Scale Settings, it's configured to 100%, just as i set before boot, but screen remains ~95%. If i press ok, cancel or back, the screen scales to 100% as i expected upon boot.

in both boxes, this settings is saved in /data/data/com.android.settings/shared_prefs/com.android.settings_preferences.xml
<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<map>
<int name="screen_scale_setting" value="0" />
</map>


when 0 means 100%,
5 = 95%
10 = 90%
...
100 - value = scale

I've decompiled Settings.apk (among other apks) of both boxes and found a class com.android.settings.ScreenAdjust with a method setScale(String scale) to achieve the desired scale. Even i found a libscreen_adjust_jni.so related.
I will not going deeper, because is more a java/dalvik issue. I mentioned it just to you see how deep i went.

Finally, my question:

If both boxes use the same apks, why one get scaled right after boot and the other didn't? Is this call of setScale related to kernel.img?

facts:
kernel.img are distinct in each box.
I could not find any init*.rc or other script related to setScale in any of the boxes.

Thx for your attention and good will, Finless

Maddie_Q
08-11-2012, 02:07 AM
Hi everyone, I'm Maddie Q from Vietnam.

First, thank you all (especially Finless) for sharing your knowledge. I almost break my poor keyboard wasting time with mr Google but finally (thank God) find this thread. I have alot of question but I'm not sure that this thread's still alive or forgotten. So somebody plz give me a sign cuz I dont wanna hurt my keyboard anymore :p

Now, I should start to learn from the 1st post.

PS: Finless, maybe you'll never back in this thread again but I have to say that I respect you so much when I read these words in your post: "Feel free to ask."

Finless
08-11-2012, 08:24 AM
Thread is not dead.... Ask your questions here.

Bob

Maddie_Q
08-14-2012, 11:32 AM
Thread is not dead.... Ask your questions here.

Bob
Thanks, bro. Here is my first question...

I wanna change the splash logo, located in kernel. I know it's rle format and how to creat it. But I dont know how to pack/unpack kernel. So could you plz show me?

I've just installed Ubuntu on my PC and tablet. But it's a brand new OS for me and it takes a long time to learn for sure. Is there anyway in Windows?

Finless
08-14-2012, 12:38 PM
There are 3 screens.

1) Initial logo which is in kernel. You cannot unpack it. It is binary code. You have to use a hex editor and do it manually! This is not something easily explained as I would have to type 15 pages.

2) Boot logo. This is in boot.img. I give instructions for how to take apart boot.img here:

http://www.freaktab.com/showthread.php?287-RockChip-ROM-Building-Tips-and-Tricks-by-Finless


3) Boot animation. Easily replaced. bootanimation.sip is in /system/media/


Bob

Maddie_Q
08-14-2012, 02:17 PM
There are 3 screens.

1) Initial logo which is in kernel. You cannot unpack it. It is binary code. You have to use a hex editor and do it manually! This is not something easily explained as I would have to type 15 pages.

2) Boot logo. This is in boot.img. I give instructions for how to take apart boot.img here:

http://www.freaktab.com/showthread.php?287-RockChip-ROM-Building-Tips-and-Tricks-by-Finless


3) Boot animation. Easily replaced. bootanimation.sip is in /system/media/


Bob
Thanks for your early answer (although it's a bad news for T_T).

So if we wanna edit kernel, we must do it manually in hex. It's more complicated than what I've thought. I just wanna add some images but it takes 15 pages to explain. Hmm... Do you think that I should quit?

Finless
08-14-2012, 02:45 PM
Thanks for your early answer (although it's a bad news for T_T).

So if we wanna edit kernel, we must do it manually in hex. It's more complicated than what I've thought. I just wanna add some images but it takes 15 pages to explain. Hmm... Do you think that I should quit?

I do not know. It depends on how good you are with a hex editor?

What ROM is this you want to change and what is the kernel version?

Bob

Maddie_Q
08-16-2012, 03:40 AM
I do not know. It depends on how good you are with a hex editor?

What ROM is this you want to change and what is the kernel version?

Bob
I got an ICS for rk29 ROM with 3.0.8 kernel. I dont like the Chinese logo. One more problem is the CPU speed has changed from 1GHz to 0.9 but it's still acceptable.

Honestly, the Chinese logo is the only real nightmare. I've thought that there's noway to fix it til a day I find a kernel made by Dehepo (an Asian developer), he can do it but I cant contact him.

So there's one more thing I have to learn: hex editting. Where I should start from, what's the god hex editor for the beginers? It's so impolite if I ask you to teach me all the little details, just show me the way and I will learn by myself. Just ask you when I have some big trouble and I'll make you proud someday.

duvvid
08-17-2012, 05:48 AM
Thanks to everyone who has contributed to this thread.

I recently remembered i had a Nextbook 7 Premium lying around, so i made a new ROM for it. It has a 1011 serial number outside the ranges listed on the firmware download page, so (i assume) i had to make my own rather than use one of DocHoppy/FinlessBobs ROMs.

It was a piece of crap with the default cramfs /system, but now it's quite decent. But i learnt the hard way those file mtimes in boot.img really do matter.:)

wolff
08-19-2012, 02:45 PM
Hi Finless, how are you?

I have some questions, could you please answer me?

1) I have 2 parameter file, the first one from stock extracted with wendal tools, did not work, i.e., i'm trying to mount a /system as ext3 rw, following your and others guides about boot.img, init.rc, cramfs, mount as ext3, dd, rkcrc on boot.img etc, but after flashing new custom images, installing few apps and boot, the fs got corrupted. Sometimes it never boots again, it hangs on "loading...".
The faulty parameter file is this:


FIRMWARE_VER:1.2.3

MACHINE_MODEL:SUNVEK
MACHINE_ID:007
MANUFACTURER:rock-chips
MAGIC: 0x5041524B
ATAG: 0x60000800
MACHINE: 2929
CHECK_MASK: 0x80
KERNEL_IMG: 0x60408000
CMDLINE: console=ttyS1,115200n8n androidboot.console=ttyS1 init=/init initrd=0x62000000,0x300000 mtdparts=rk29xxnand:0x00002000@0x00002000(misc),0x 00004000@0x00004000(kernel),0x00002000@0x00008000( boot),0x00004000@0x0000A000(recovery),0x00080000@0 x0000E000(system),0x00082000@0x0008E000(backup),0x 0003a000@0x00110000(cache),0x00100000@0x0014a000(u serdata),0x00002000@0x0024a000(kpanic),-@0x0024c000(user)


Fortunately, looking at this thread http://www.freaktab.com/showthread.php?1122-G-Box-RK2918-(2-USB-Ports)-Rooting-(read-amp-write), i got the parameter file inside of your v1.2 rom, used the SAME boot.img, system.img as above and it WORKS! /system, ext3, rw not going corrupted after installing apps, like previously happen. The OK parameter file is this:


FIRMWARE_VER:0.2.3

MACHINE_MODEL:G-BOX
MACHINE_ID:007
MANUFACTURER:RK29SDK
MAGIC: 0x5041524B
ATAG: 0x60000800
MACHINE: 2929
CHECK_MASK: 0x80
KERNEL_IMG: 0x60408000
CMDLINE: console=ttyS1,115200n8n androidboot.console=ttyS1 init=/init initrd=0x62000000,0x00500000 mtdparts=rk29xxnand:0x00002000@0x00002000(misc),0x 00004000@0x00004000(kernel),0x00002000@0x00008000( boot),0x00004000@0x0000A000(recovery),0x00082000@0 x0000E000(backup),0x0003a000@0x00090000(cache),0x0 0100000@0x000ca000(userdata),0x00002000@0x001ca000 (kpanic),0x00080000@0x001cc000(system),-@0x0024c000(user)


I know parameter is like a partition table to NAND flash. Did the system address moved to the end was the reason for success? Why the first one got corrupted?

PS: Warning for other readers, the g-box v1.2 rom is NOT suitable for this board (my board, 4 USB):

http://s10.postimage.org/tofluvzih/swk101_v03_legendado.jpg

because you will lose the led lights. If you don't know what you're doing, it looks like you half-bricked your device. Can be reverted back with stock or good working rom. If you want to know more how to flash this board, look at this post: http://www.freaktab.com/showthread.php?1053-RK2918-set-top-box-linux-installation&p=22308#post22308

Now my second question:
2) Can i use any bootloader?
My stock rom came with this loader: RK29xxLoader(L)_DDR3_400Mhz_V1.64.bin
The G-Box v 1.2 rom came with this: RK29xxLoader(L)_V2.05.bin (tried and worked with my rom)
I've found other loader in other working roms for my board: RK29xxLoader(L)_V2.08.bin

Every loader seems to work, but i don't know the basic function :RED and if i can use other than the stock one.

For any purpose, here it go my stock rom (update.img, unrooted, system as cramfs): http://www.mediafire.com/?66wy8yeyk8e97sc
I will not post my rooted, system (ext3 rw) ROM because it is in development yet (not sure about loader, parameter etc)

Anyway, thx for the good guides and explanation, Finless. The V1.2 G-BOX rom helped me a lot

Finless
08-21-2012, 07:21 AM
1) Do not use different loaders! The loaders are a mystery. I have not found any information on them. However flashing the wrong loader can mess up your IDB range and how big it thinks your flash chip is.
I also know the loader contains info for how ther MD5 sums work for when ANDROID style IMG are used. This is why we cannot recreate and android style IMG with kernel inside of boot.img for instance. We need the magic numbers used when the loader was created.

2) Yes you must move system to the end just before -user to convert cramfs to EXT3 in the parameter file. Why I do not know but again possibly something to do with how the loader works. If you try to leave system in it's original position, it will not boot.


Bob

pancoi23
08-30-2012, 11:15 PM
Hi everyone, can somebody help me with my boot.img please.. it is only 200+kb in size and I can't unpack it to edit the init.rc. here's the link http://www.mediafire.com/?ilgsltrcwcyslby.

I keep on getting this message in Terminal

697

I'm done with the converting cramfs to ext3. I also still need to modify its parameter. beacause system.im is bigger now than the original cramfs image.

by the way my tablet is cherrypad turbo. and this is my first time in modifying a rom.
Thank you in advance

wolff
08-31-2012, 04:23 AM
Hi everyone, can somebody help me with my boot.img please.. it is only 200+kb in size and I can't unpack it to edit the init.rc. here's the link http://www.mediafire.com/?ilgsltrcwcyslby.

I keep on getting this message in Terminal

697

I'm done with the converting cramfs to ext3. I also still need to modify its parameter. beacause system.im is bigger now than the original cramfs image.

by the way my tablet is cherrypad turbo. and this is my first time in modifying a rom.
Thank you in advance

Hi, pancoi23, how are you?

Please follow these steps (as root, preferable):


su
mkdir work
cd work
git clone git://github.com/lamegopinto/rk2918tools
cd rk2918tools
sudo apt-get install build-essential libusb-1.0-0-dev libssl-dev
make
mkdir stock_imgs
cp <your boot.img> stock_imgs
cp -a stock_imgs new_imgs
./rkunpack new_imgs/boot.img
mkdir -p new_imgs/boot
cd new_imgs/boot
gunzip < ../boot.img-raw | sudo cpio -i --preserve-modification-time --make-directories


Edit your init.rc as you want, for an example:
Replace "mount cramfs mtd@system /system" with "mount ext3 mtd@system /system wait rw"

after all changes desired, fix dates, repack and crc your new boot.img:


find . -exec touch -d "1970-01-01 01:00" {} \;
find . ! -name "."|sort|sudo cpio -oa -H newc|gzip -n >../newinitrd.gz
cd ../..
./rkcrc -k new_imgs/newinitrd.gz new_imgs/boot.img

Maddie_Q
08-31-2012, 06:04 AM
Hi Finless.

In my last post, I said: just show me the way and I'll make you proud someday. And today, I'm so glad to tell you I'm building my own rom :BANANA

Now I can edit boot and system img, parameter, decompile app, edit resourses, and something else. I'm trying to make a CWM touch recovery and its gonna be done next week (I hope so :D ).

But I'm still stuck with kernel.img (in this case: initial logo). I'll research more about hex as you advised. And swear with God, I'll put your photo into it :cool:

Finless
08-31-2012, 07:44 AM
Good Job! :CLAP

What build is the kernel? ICS? GB? As how you find the image in the kernel with a hex editor depends on what the kernel is.

Bob

Maddie_Q
08-31-2012, 08:59 AM
Good Job! :CLAP

What build is the kernel? ICS? GB? As how you find the image in the kernel with a hex editor depends on what the kernel is.

Bob
Thanks so much, Finless.
It's an ICS kernel, ver 3.0.8 as I remember. So how can I find the image in this kernel? I'm so excited man :BANANA

Finless
08-31-2012, 09:49 AM
First tip.
unpack kernel.img to kernel.bin. Basically you are removing the RKcrc

dd if=kernel.img of=kernel.bin skip=8 bs=1 count=200000000


Now open this in a hex editor and search for text logo. If you find something like logo_clut, logo start, or something like that, this is the start of the logo. Finding the end is the hard part but you will see there is a pattern to the data and a black area in the image is 20 20 20 20 20 20 etc. When you find the end and the start of regular data, then you have the logo.

Copy this out to image.raw. Now in GIMP image editor. OPen this as a RAW and play with the setting until you see the image properly.

Bob

Maddie_Q
08-31-2012, 07:53 PM
First tip.
unpack kernel.img to kernel.bin. Basically you are removing the RKcrc

dd if=kernel.img of=kernel.bin skip=8 bs=1 count=200000000


Now open this in a hex editor and search for text logo. If you find something like logo_clut, logo start, or something like that, this is the start of the logo. Finding the end is the hard part but you will see there is a pattern to the data and a black area in the image is 20 20 20 20 20 20 etc. When you find the end and the start of regular data, then you have the logo.

Copy this out to image.raw. Now in GIMP image editor. OPen this as a RAW and play with the setting until you see the image properly.

Bob
Thanks alot.
I'll check it out.

Maddie_Q
09-02-2012, 06:59 AM
Yeah, it works.

It's not too difficult to find out the image inside the kernel.bin . But it's a real trouble to open it in PTS. I tried a lot of options but finally it's done.
Now I have to design some 9.png images to replace the original in ICS framework.

Finless, pls send me your photo or logo. I wanna set it as the initial logo of my first rom (just when it's really stable). Just a small gift to show my respect for you.

Finless
09-02-2012, 07:26 AM
Here you go! THANKS!

http://video.freaktab.com/?subpath=finless/test&filename=logo.zip


Bob

900supersport
09-03-2012, 01:46 PM
I've taken a quick look at the boot.img from the n101, this does not seem to unpack in the same way. Inspecting with a hex editor it starts android rather than kern...

It's going to be a couple of days before I can look at this again, any tips?

Finless
09-03-2012, 03:52 PM
Google search for these perl scripts.

unpack-boot.pl

So you know. Whenever you see a IMG that has a header of "Android" this is a android style pack and it is because ot contains the kernel and a ramdisk. It is not a RKCRC -k style IMG.

If you cant find them, let me know and I will supply them.

Bob

900supersport
09-03-2012, 09:50 PM
Perl now.too.;-)

Thanks

iJohnny
09-07-2012, 10:40 AM
Hi.

Could you Finless help me with parameter file?

This is my current file:


FIRMWARE_VER:1.0.6MACHINE_MODEL:PMP5097CPRO
MACHINE_ID:007
MANUFACTURER:RK29SDK
MAGIC: 0x5041524B
ATAG: 0x60000800
MACHINE: 2929
CHECK_MASK: 0x80
KERNEL_IMG: 0x60408000
COMBINATION_KEY: 0,6,A,7,0
CMDLINE: console=ttyS1,115200n8n androidboot.console=ttyS1 init=/init initrd=0x62000000,0x800000 mtdparts=rk29xxnand:0x00002000@0x00002000(misc),0x 00004000@0x00004000(kernel),0x00008000@0x00008000( boot),0x00008000@0x00010000(recovery),0x000F0000@0 x00018000(backup),0x0003a000@0x00108000(cache),0x0 0200000@0x00142000(userdata),0x00002000@0x00342000 (kpanic),0x000E6000@0x00344000(system),-@0x0042A000(user)

Currently I have 512 MB for user apps, but I would like to have 1 GB. I tried modifying it myself but with no success, and everything remained the same after I flashed img with new parameter file. I acquired root, removed some system apps and added others, set permissions and packed it all to img then flashed. That works for me, but I cant figure out the parameter file. :RED

I hope you can help.

Finless
09-07-2012, 11:43 AM
While I could do it for you, the point is learning. So see post #25 as I explain exactly how to edit the parameter file and recalculate the offsets.

Give it a try. If your confused ask specific questions and I will help.

Bob

Maddie_Q
09-10-2012, 02:54 PM
Hi Finless, it's me again.
I almost finish my 1st ICS rom. I'm testing on my device Yuandao N50DT. Everything seems to be ok but still have a bug.
Whenever anysound is playing, if I touch the screen, the sound will be slow down or scratch. I tried to fix but it doesnt work. I think its becuz of the kernel (ver 3.0.8). I've never seen any bug like this in GB. Could you plz explain?
I'm so excited to complete and post my build.

Finless
09-10-2012, 03:25 PM
Hard to say really. In ICS they really changed how the drivers are setup etc. So possible the kernel or the sound drivers need to be tweaked. None of which you can do without sources I do not think.

Bob

bluetigger68
09-11-2012, 11:26 AM
Hey everybody, and thanks to Bob for this thread!

I've got a AN8CG3 dumped it and now I'm trying to get started with tweaking the ROM.
I've tested your ROM for the 8BG3 and I was impressed by the speed due to the change of the fs and I want to do the same with my second tab.
Therefore my question is how do I convert the filesystem from ext3 to ext4 and which img can be converted?
thanks

Finless
09-11-2012, 01:03 PM
This is not a simple question.

You will need a linux box and some linux know how. I can give tips but you need to know linux PK enough to know how to make a file system.

Bob

bluetigger68
09-11-2012, 01:30 PM
I've got a Linux box up and running, got the system.img mounted. Got basic Linux know how but I do not know what you mean with PK?

Gesendet von meinem Galaxy Nexus mit Tapatalk 2

Finless
09-11-2012, 01:41 PM
OK what I do is use DD to make a new blank IMG file. Then I format it EXT4. Then I copy from the original mounted system.img everything to the new. Then using scripts etc I mod the new file system. When done I close the file systems and I have a new system.img.

Make sense?

FYI.. the PK was a typo. I meant OK.

Bob

bluetigger68
09-11-2012, 02:56 PM
so far all clear except the stuff with the scripts, as I don't have them. regarding the size of the new file I'll start with the original size.

Cping the stuff from one img to the other won't be any problem, modding the fs will be fun though.

created new img, created ext4 fs and copied everything. chowned and chmoded.

What exactly do you mod in the newly created fs?

Finless
09-12-2012, 06:48 AM
Whatever you want. Most add Google Play if it's not there already. Update the APPs so you do not have to do that first power up and logon to GPlay, etc.

By the way to make your new EXT4 file system work, you need to take apart init.rc and mod it to mount system as ext4 or you new file system will not work.

Bob

Maddie_Q
09-12-2012, 09:24 AM
Hi everyone.
I'm building an ICS rom with some mods. Everything seems ok but a scratch of sound when long touch. I guess (and hope) that my kernel is the reason. So Finless, if you dont mind, I'll post it here. Maybe someone will enjoy it, or someone can fix it and explain for me.

Change logs:

- CWM 5 recovery. I'm trying to build a touch ver, not done yet.
- 1GB data, 500Mb ROM (200 Mb free)
- Root, supersu 0.75 binary
- Build.prop tweaks

- Apps:
--Titanium Backup
--Rom Toolbox
--Notes Pad
--Terminal Emulator
--ICS modded Keyboard (with alot of layouts and languages)
--Estrong Explorer
--Some Google apps

-Hidden apps: (can access with activities picker)
--Activities picker
--ADB wireless
--Contacts
--Downloads

-iPad interface:
--iOS bootlogo
--Bootanimation
--iOS launcher
--Phone UI but dual pane (like tablet)
--Disable navigation bar
--Transparent status bar, 1% increment battery
--Transparent buttons and pane
--iOS default background for most windows
--Some iOS icons
--Flying and flip animation

Screenshots:

--Bootlogo:
https://lh6.googleusercontent.com/-hI-Mrfo_o80/UFC1Oixj0rI/AAAAAAAAABY/xpn2JwmTrOA/h120/Bootlogo.png
--Desktop:
https://lh4.googleusercontent.com/-OLai-VJD96o/UFC10h1N3XI/AAAAAAAAABw/hVDd3fCuztA/h120/Desktop.png
--Search bar:
https://lh3.googleusercontent.com/-MCRw9O31zUo/UFC1acxN6nI/AAAAAAAAABg/FbHz1OwsyTc/h120/Search.png
--Media bar:
https://lh6.googleusercontent.com/-iR8DAaVBEqA/UFC2KMdhBFI/AAAAAAAAACA/jut1CPbW2Lo/h120/Taskbar.png
--Control bar:
https://lh5.googleusercontent.com/-p34oPSp57Yg/UFC4KKzIiuI/AAAAAAAAACU/zoLudOc6oOk/h120/Controlbar.png
--Popup window:
https://lh6.googleusercontent.com/-pFNcsURaSu4/UFC1l2XyqhI/AAAAAAAAABo/A7Ury6yEwqU/h120/Panel.png
--Window with dual pane:
https://lh5.googleusercontent.com/-e1b-jZZGZkM/UFC2BaqH6mI/AAAAAAAAAB4/qw47-Km5hSI/h120/Settings.png
--Window with single pane:
https://lh6.googleusercontent.com/-ZFrT-YdWPYw/UFC2OFLJ2gI/AAAAAAAAACI/B6sohg2ENaE/h120/Window.png

Once again: can I post my rom here?

Damo
09-12-2012, 09:42 AM
The only problem with posting this here is do you have permission to use those apps in your Rom ?

Sent using Tapatalk 2 from Sony Xperia Mini Pro - Ics 4.0.4

Maddie_Q
09-12-2012, 09:51 AM
The only problem with posting this here is do you have permission to use those apps in your Rom ?

Sent using Tapatalk 2 from Sony Xperia Mini Pro - Ics 4.0.4

Thanks for your advice.
I've just tested this rom with my only N50DT device and get a small bug with sound. It's 90% becuz of my kernel. Just hope that people could run it well with theirs.
So anyone care about it, pls send me a message.

bluetigger68
09-12-2012, 11:36 AM
Whatever you want. Most add Google Play if it's not there already. Update the APPs so you do not have to do that first power up and logon to GPlay, etc.

By the way to make your new EXT4 file system work, you need to take apart init.rc and mod it to mount system as ext4 or you new file system will not work.

Bob

Thanks Bob, modified system.img and boot.img, modded the adresses and flashed it with your rom flashing tool for testing purposes. It booted and works, next will be the userdata and cache imgs to round it up and I'll look into the arrangement of the blocks to get some more userspace.

thanks a lot

Maddie_Q
09-12-2012, 11:53 AM
Hey Finless.
I've almost finished my rom. Pls check it out in my last post and leave a comment (if you had free time). How can I convert it to CWM flashable update.zip? It's simple to creat an update.zip for apps. But what about a rom?

yash3339
09-14-2012, 05:13 AM
Hi Bob, I'm extremely sorry to be posting here but if you haven't yet noticed, please check again the thread for OEM tablets. I have linked the original firmware for the Aoson M11. Thanks.



Sent from my LG Optimus One using Tapatalk 2

bluetigger68
09-15-2012, 09:15 AM
Hey Bob,

I've been looking for a possibility to change the fs from userdata and cache to ext4 but I didn't find a clou how to do it?

There are no images to be converted, do I have to create one and flash them or is there another way?

Finless
09-15-2012, 11:01 AM
You have to take apart recovery.img and mod the fstab to format ext4 for /userdata and /cache
Then in boot.img you have to change the mount command from ext3 to ext4

THe recovery system is what creates and formats /userdata and /cache. If you do not modify that, you will never get full ext4. Only system will be ext4 which does not buy you much.

Additionally the kernel MUST already support ext4! If it does not you must find ext43 kernel modules and insmod them in boot init.rc and recovery init.rc


Bob

bluetigger68
09-15-2012, 11:29 AM
Ok, thanks, tried to mount recovery.img, not working, is this a gzip again with some header and footer like boot.img?

Finless
09-15-2012, 01:56 PM
Recovery is like boot.img and remember there are 2 ways it can be made. the standard rkcrc gzip file type or the "Android" type with ramdisk and kernel inside. Recovery is almost always the Android style. To unpack it you need the perl scripts available. unpack.pl Google it you should find them easily. Also the latest linux rkunpack should work too.

Bob

bluetigger68
09-15-2012, 04:02 PM
I'm not sure what I am dong wrong here. I tried everything from mounting as stated before to handling it like a gzip with header and using unpack.pl or the latest rkunpack that gives me the error message "invalid signature".

Any hints for me?

Runner71
09-16-2012, 12:29 AM
i'm new to this forum , and i'm new to android, but what i see here is really outstanding.


seeing you guys literally teach and help each other is awesome and i'm really lucky to find this kind of forum....

please continue with your fantastic work. :CLAP:CLAP:CLAP

wish you all the best

with best regards Runner71

Finless
09-16-2012, 07:52 AM
I'm not sure what I am dong wrong here. I tried everything from mounting as stated before to handling it like a gzip with header and using unpack.pl or the latest rkunpack that gives me the error message "invalid signature".

Any hints for me?

Let me download your recovery and have a look at it.

Bob

bluetigger68
09-16-2012, 08:41 AM
Here it is
https://docs.google.com/open?id=0B9VEwOF7qc_HTmo1dTRWRVd1NHc

Finless
09-16-2012, 09:10 AM
Use this attached perl script in linux

# perl unpack.pl recovery.img

It will leave you with a kernel recovery.img-kernel.gz which will not be usable without more work. I assume your ROM already has kernel.img available?

You will also have this file which you can just trash. recovery.img-ramdisk.cpio.gz

And a folder recovery.img-ramdisk which contains your recovery.
Make your changes in this folder. I rename the folder to work for ease.

Once your done to repack it do this:
cd work
find . | cpio -o -H newc | cat > ../newinitrd.gz
cd ..
./rkcrc -k newinitrd.gz newrecovery.img


Bob

iJohnny
09-17-2012, 12:56 PM
While I could do it for you, the point is learning. So see post #25 as I explain exactly how to edit the parameter file and recalculate the offsets.

Give it a try. If your confused ask specific questions and I will help.

Bob

I managed to set 1 GB for apps on my tablet. :D

Are there any other tweaks that you would recommend for a beginner, maybe some tweaks that would speed up the tablet?

iJohnny
09-19-2012, 10:53 AM
How can I remove those ugly boot screens on my Prestigio PMP5097c PRO?

Maddie_Q
09-20-2012, 01:50 AM
How can I remove those ugly boot screens on my Prestigio PMP5097c PRO?
Which exactly image/animation do you wanna remove? I used to ask Finless about this, back to page 9 for details.
This is my quick guide:
1. initlogo.rle in boot.img --> unpack boot.img, simply delete it
2. Manufacturer logo in kernel.img --> convert kernel.img to kernel.bin, edit with any hex-editor
3. bootanimation.zip in /system/media --> just delete
4. Original Android bootanimation --> extract framework-res.apk, edit files in assets/images
5. add this line to build.prop in /system: debug.sf.nobootanimation=0 or in terminal: #setprop debug.sf.nobootanimation 0

yash3339
09-21-2012, 01:08 AM
Hi Finless, as the title suggests, I'm unable to modify the contents of system.img after mounting it. I'm using Ubuntu 12.04 LTS. This, even after I'm logged in as root. And there is a lock symbol on the folder. Help!
Thanks in advance

iJohnny
09-21-2012, 03:29 PM
Hi Finless, as the title suggests, I'm unable to modify the contents of system.img after mounting it. I'm using Ubuntu 12.04 LTS. This, even after I'm logged in as root. And there is a lock symbol on the folder. Help!
Thanks in advance

Start terminal and type: sudo nautilus
then go where you have mounted the system.img
in my case it's in home directory folder named system

make the changes and then umount system.img

bluetigger68
09-22-2012, 01:28 PM
Use this attached perl script in linux

# perl unpack.pl recovery.img

It will leave you with a kernel recovery.img-kernel.gz which will not be usable without more work. I assume your ROM already has kernel.img available?

You will also have this file which you can just trash. recovery.img-ramdisk.cpio.gz

And a folder recovery.img-ramdisk which contains your recovery.
Make your changes in this folder. I rename the folder to work for ease.

Once your done to repack it do this:
cd work
find . | cpio -o -H newc | cat > ../newinitrd.gz
cd ..
./rkcrc -k newinitrd.gz newrecovery.img


Bob

I was able to unpack it and yes there is a kernel.img available.
Which files have to be edited?

Thanks

deadhp1
09-22-2012, 11:17 PM
deleted

yash3339
09-23-2012, 06:15 AM
Start terminal and type: sudo nautilus
then go where you have mounted the system.img
in my case it's in home directory folder named system

make the changes and then umount system.img

Thanks, sudo chown did the trick for me.



Sent from my LG Optimus One using Tapatalk 2

iJohnny
09-23-2012, 09:59 AM
Are there any advantages by going from EXT3 to EXT4 for tablet?

Finless
09-23-2012, 10:13 AM
Yes. ext3 is faster than ext4. Every ROM I have done that I converted to ext4 got a speed boost and every user noticed it. But to do it right you do not just convert system.img to ext4. cache and user must also be converted. Those areas are where all the writing goes to. system is concidered by the OS as RO and never wrties there so there is not a large benefit to just converting system.img.

Bob

iJohnny
09-23-2012, 10:31 AM
Yes. ext3 is faster than ext4. Every ROM I have done that I converted to ext4 got a speed boost and every user noticed it. But to do it right you do not just convert system.img to ext4. cache and user must also be converted. Those areas are where all the writing goes to. system is concidered by the OS as RO and never wrties there so there is not a large benefit to just converting system.img.

Bob

Great to hear that, but I was under the impression that I just convert system.img to ext4 and edit init.rc. :BANG
I have already run to a problem because it seams that I can't mount or unpack boot.img.

Is there any step by step tutorial on how to do this (init.rc, system.img, cache and user)?
I am trying to do this for Prestigio PMP5097C PRO tablet.

Finless
09-23-2012, 11:05 AM
All the instructions for doing that are in this post. Your going to need to read through it.

Bob

yash3339
09-23-2012, 11:11 AM
Hi Bob, when creating a ROM package in update.zip format, is it necessary to include the kernel in it?

Finless
09-23-2012, 11:13 AM
That depends. If you had to strip kernel from boot.img then yes you will need a kernel.img.

Bob

yash3339
09-23-2012, 11:25 AM
What if I flash everything apart from system via RkAndroidTool and system via CWM? is it possible?



Sent from my LG Optimus One using Tapatalk 2

Finless
09-23-2012, 11:36 AM
What are you trying to do?

Bob

yash3339
09-23-2012, 11:47 AM
What are you trying to do?

Bob

As there are a few limitations when mounting system and changing files, I thought it'd be easier to flash system via a zip package.

iJohnny
09-23-2012, 11:48 AM
All the instructions for doing that are in this post. Your going to need to read through it.

Bob

Did you forget to link it to the post that has instructions?

Finless
09-23-2012, 11:51 AM
Did you forget to link it to the post that has instructions?

No, this thread you are posting in is IT! Start from page one. I have posts all about taking apart boot.img

Bob

iJohnny
09-23-2012, 12:26 PM
I tried:

sudo mount -t cramfs -o loop boot.img boot
sudo mount -t ext3 -o loop boot.img boot

this is the output that I get with both options:


wrong fs type, bad option, bad superblock on /dev/loop1, missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so


I also tried this:

dd if=boot.img of=bootimg.gz skip=8 bs=1 count=20000000

This is result when I try to open gzip in Ubuntu:


8814584+0 records in8814584+0 records out

8814584 bytes (8,8 MB) copied, 16,5742 s, 532 kB/s

Opening:


gzip: /home/name/bootimg.gz: not in gzip format

900supersport
09-23-2012, 12:31 PM
Have you tried the perl script split_booting.pl?

bluetigger68
09-24-2012, 02:35 PM
I was able to unpack it and yes there is a kernel.img available.
Which files have to be edited?

Thanks

Hey Bob,

I need your assistance.

Thanks

Gesendet von meinem Galaxy Nexus mit Tapatalk 2

Finless
09-24-2012, 03:38 PM
Hey Bob,

I need your assistance.

Thanks

Gesendet von meinem Galaxy Nexus mit Tapatalk 2

What are you trying to do?

Bob

Maddie_Q
09-24-2012, 10:37 PM
What if I flash everything apart from system via RkAndroidTool and system via CWM? is it possible?



Sent from my LG Optimus One using Tapatalk 2
It's possible but I'm so sorry bro. Why do you have to make it more complicated like that?

Take a look at some RK29-CM roms. Inside their zip package, the boot and recovery are the normal type as we already know and work well with RK flash tool. But they extracted the system img to files and folders. So if you prefer to flash system via zip, you should combine other imgs and forget about RK tool.

BTW, I'm so glad to know about ur idea cuz I'm trying to make a CWM flashable rom too. All my imgs are ready but I got a headache with updater-script and update-binary. Could we learn from each other? I'm so happy to share my project.

iJohnny
09-25-2012, 09:38 AM
It's possible but I'm so sorry bro. Why do you have to make it more complicated like that?

Take a look at some RK29-CM roms. Inside their zip package, the boot and recovery are the normal type as we already know and work well with RK flash tool. But they extracted the system img to files and folders. So if you prefer to flash system via zip, you should combine other imgs and forget about RK tool.

BTW, I'm so glad to know about ur idea cuz I'm trying to make a CWM flashable rom too. All my imgs are ready but I got a headache with updater-script and update-binary. Could we learn from each other? I'm so happy to share my project.

Do you have a working CWM for RK2918?
I have same chip, but there seams to be a problem with my Ubuntu and I can't compile it.
I'd be very grateful if you could share a version that works.

yash3339
09-25-2012, 11:21 AM
It's possible but I'm so sorry bro. Why do you have to make it more complicated like that?


Reading through this thread, Bob mentioned that it is not possible to make too many changes to system.img because it has a fixed size. With .zip format, I thought we'd be much more flexible as there is no such limitation.




Take a look at some RK29-CM roms. Inside their zip package, the boot and recovery are the normal type as we already know and work well with RK flash tool. But they extracted the system img to files and folders. So if you prefer to flash system via zip, you should combine other imgs and forget about RK tool.

BTW, I'm so glad to know about ur idea cuz I'm trying to make a CWM flashable rom too. All my imgs are ready but I got a headache with updater-script and update-binary. Could we learn from each other? I'm so happy to share my project.

I'll have a look.. btw, I just did the same with a few ROMs meant for my optimus one. I'm not sure, but should boot.img contain the kernel when making a CWM flashable ROM?
I'm glad too! Most definitely, it will great, I'm looking forward to it.

Finless
09-25-2012, 12:07 PM
System still has a limited size. Think of it like a disk drive. So if your current system has only say 3 meg available then even a CWM zip file may not work if you try to put too many files from it into system. So the limitation DOES still exist with ZIPs for "system" apps, etc.

All CWM does with zip files is COPY the files from it into either /system or /data. The space to do so must be available! /data is usually only limited based on about of NAND memory. System is fixed based on the parameter file AND how system.img was made. This is why whenver I make a ROM I increased available space in /system so user can put more "system" APP in there.


Bob

yash3339
09-25-2012, 12:16 PM
System still has a limited size. Think of it like a disk drive. So if your current system has only say 3 meg available then even a CWM zip file may not work if you try to put too many files from it into system. So the limitation DOES still exist with ZIPs for "system" apps, etc.

All CWM does with zip files is COPY the files from it into either /system or /data. The space to do so must be available! /data is usually only limited based on about of NAND memory. System is fixed based on the parameter file AND how system.img was made. This is why whenver I make a ROM I increased available space in /system so user can put more "system" APP in there.


Bob


Thank you Bob. I got what you meant to say.. but take for example the system is partitioned with 1GB of space using the parameter file, whereas a system.img you are trying to modify is 500MB in size. And you want to add more apps, what do you do then? If I'm wrong please correct.
Another question, I'm trying to mod a particular system.img from PiPo M1's JB f/w. I added two apks to system/app, and then I flashed the ROM. But now on boot the two apps I added do not run. One was a launcher, it is installed because when I press home I get the option to choose as to which one to use. But when I choose the one I added; there's the FC. 'Unfortunately, Holo launcher has crashed'

Thanks in advance, looking forward to your reply.

Finless
09-25-2012, 01:16 PM
OK to make system.img larger you have to make a new system.img that is larger and then copy everything from the original system.img to the new larger system.img.

As for APPs you put in system, they must be compatible with the SDK level the ROM is. Then some apps CANNOT be system APPs period! Some APPs when installed install library files. So just copying an APK to /system/app does not always work unless the APP was built to be a system APP.


Bob

Maddie_Q
09-25-2012, 07:20 PM
Do you have a working CWM for RK2918?
I have same chip, but there seams to be a problem with my Ubuntu and I can't compile it.
I'd be very grateful if you could share a version that works.
Yep, I do have CWM and am using it. I can share it, but I'm sure that it wont work with ur device. To make it work, you have to put somefiles from your kernel into it and remap the keys to. You can get them from ur stock recovery.
Here you are.
http://www.mediafire.com/?40wsdoa5uz9uolz
If you have rktools, I wrote a simple script to unpack, mod and repack boot/recovery. Ask me if you need bro, then you can build a CWM recovery in 5 minutes.

Maddie_Q
09-25-2012, 07:36 PM
Reading through this thread, Bob mentioned that it is not possible to make too many changes to system.img because it has a fixed size. With .zip format, I thought we'd be much more flexible as there is no such limitation.

I'll have a look.. btw, I just did the same with a few ROMs meant for my optimus one. I'm not sure, but should boot.img contain the kernel when making a CWM flashable ROM?
I'm glad too! Most definitely, it will great, I'm looking forward to it.
I have a solution for you. It's not a smart way but very simple.
First, flash all ya stock img with rk-flash-tool (mod the parameter to reach the system size that you want). After flashing, just copy the system from your device with dd.
I have a 400 Mb system by this way. Is it enough for you? Here is my parameter.
http://www.mediafire.com/?uxx7b97o3x34hik
Or you can resize the img in linux using rk-kitchen. I'll upload it later.

About the boot img for CWM, as I said, it's the same type as the stock one. And my stock boot contains no kernel. I'm not sure what about you, just do a test then you have the right answer.

yash3339
09-26-2012, 06:33 AM
OK to make system.img larger you have to make a new system.img that is larger and then copy everything from the original system.img to the new larger system.img.

As for APPs you put in system, they must be compatible with the SDK level the ROM is. Then some apps CANNOT be system APPs period! Some APPs when installed install library files. So just copying an APK to /system/app does not always work unless the APP was built to be a system APP.


Bob

Okay.. so the new one can be ext3 formatted right. And then how do you change the filesystem of the cache?

Yeah.. the launcher was for android 2.2+.. is this what you mean by SDK level, Bob?

And if the apps can't be in system/app, is there a workaround for this? Do we need to make a new 'data.img' containing data/app?

Thank you Bob! Please let me know if my questions are going out of topic.



Sent from my LG Optimus One using Tapatalk 2

iJohnny
09-26-2012, 09:17 AM
Yep, I do have CWM and am using it. I can share it, but I'm sure that it wont work with ur device. To make it work, you have to put your kernel into it and remap the keys to. You can get them from ur stock recovery.
Here you are.
http://www.mediafire.com/?40wsdoa5uz9uolz
If you have rktools, I wrote a simple script to unpack, mod and repack boot/recovery. Ask me if you need bro, then you can build a CWM recovery in 5 minutes.

That would be great :noted because I was unable to unpack boot.img when I wanted to replace ext3 with ext4.

Finless
09-26-2012, 09:19 AM
OK first. If you do not plan to take apart boot.img then you must format system at the same format it was stock. If it was ext3 then use ext3. To convert to ext4 you will need to edit init.rc and make a new system.img formatted as ext4.

Now this is ONLY for system.img. WHY? Because recovery formats data and cache! So if you edit init.rc to mount data and cache as ext4, it will not work. You then have to modify recovery to format data and cache as ext4 to make it work.

Bob

iJohnny
09-26-2012, 09:34 AM
OK first. If you do not plan to take apart boot.img then you must format system at the same format it was stock. If it was ext3 then use ext3. To convert to ext4 you will need to edit init.rc and make a new system.img formatted as ext4.

Now this is ONLY for system.img. WHY? Because recovery formats data and cache! So if you edit init.rc to mount data and cache as ext4, it will not work. You then have to modify recovery to format data and cache as ext4 to make it work.

Bob

I plan to leave it in ext3 as it is now, because I need to learn more so that I can do that.
I think for now it would be easier to have CWM and learn how to make a ROM that can be flashed with CWM.

Finless
09-26-2012, 09:38 AM
You will never be able to make a CWM that can flash a full ROM. CWM will not flash a kernel.img period. WHY? Because it cant. The kernel has to be running thus you cant flash it.

If we could figure out how to make a "android" style image with kernel and ramdisk inside recovery, then it is possible. Unfortunatly I have found no way to do this yet.

Then finally if the new ROM you want to flash makes modifications to the parameter file for more APP space, etc, this can only be done with a flash tool.


Bob

iJohnny
09-26-2012, 09:43 AM
You will never be able to make a CWM that can flash a full ROM. CWM will not flash a kernel.img period. WHY? Because it cant. The kernel has to be running thus you cant flash it.

If we could figure out how to make a "android" style image with kernel and ramdisk inside recovery, then it is possible. Unfortunatly I have found no way to do this yet.

Then finally if the new ROM you want to flash makes modifications to the parameter file for more APP space, etc, this can only be done with a flash tool.


Bob

Thanks for explaining it. I have one more question. :)
Can CWM be used for backup/restore option?

It's not easy to setup everything after I test 2-3 versions of my ROM.

Also are there any build.prop tweaks that you would recommend for RK2918?

Finless
09-26-2012, 09:50 AM
Yes CWM will backup boot, system, data, and cache. It will also backup .android_secure for APPs that are moved to sdcard (IF YOUR ROM supports that!).

What it will not backup is kernel.img. So there in lies a little problem. If you flash a new ROM with a new kernel, the old system.img from your backup "may" not be compatible! This can be hit and miss but its the case for everyone. You really do not want to mix systems between different kernels! So even if we could backup kernel, you woudl not want to flash a new ROM and put back the old ROM system.
So really CWM is good for backup and restore of your stuff on the same ROM.

If you are flashing a NEW ROM my reccomendation is to use one of the many backup programs that backup user data and APPs. These do not mess with system files. I like titanium myself.

As for build.prop mods. There are MANY! I have no real reccomendation as they vary from ROM to ROM and SDK level (e.g. Gingerbread, ICS, etc). Just try some and see how it works for you.

Bob

Maddie_Q
09-29-2012, 07:52 AM
Yes CWM will backup boot, system, data, and cache. It will also backup .android_secure for APPs that are moved to sdcard (IF YOUR ROM supports that!).

What it will not backup is kernel.img. So there in lies a little problem. If you flash a new ROM with a new kernel, the old system.img from your backup "may" not be compatible! This can be hit and miss but its the case for everyone. You really do not want to mix systems between different kernels! So even if we could backup kernel, you woudl not want to flash a new ROM and put back the old ROM system.
So really CWM is good for backup and restore of your stuff on the same ROM.
Bob
What if we write something such as bonus command for CWM to backup and restore kernel.img? Do you think that its possible or not? In case it was possible, we had to write a new misc img, right?

And I'm still messing with updater-script for CWM. As I know, we have a list to do in updater-script:
1. Mount and format system
2. Extract folders and files, set permissions
3. Do a Nand-write for another imgs (such as boot.img)
Am I missing something? Could anybody pls show me a working updater-script for example?

Finless
09-29-2012, 09:57 AM
The problem which is why all CWM's for Rockchip wont flash the kernel image. Most stock ROMs have a kernel in boot.img with a ramdisk. Same with recovery.img. These are called "Android" images. They are made by the manufacturer and they use some kind of MD5 hash. So if you take apart boot.img (using the known perl scripts) and try to put it back together with kernal etc, we cannot seem to make it work. This is because we do not know how to recreate the proper MD5 check for the image. It fails to boot every time.
BTW every manufacturer can use a different MD5 value! This entire setup is so they could one day LOCK the boot image! However rockchip design seems to allow use of both the android style and the older RK style images. If they ever change that, it will become MUCH harder for us ROM modders to make ROM mods! Lets hope they never do that.

This is why modders of ROMs take apart the original boot.img and extract the kernel from it. When they make the new boot.img it is the old way using RKCRC and is now a RK image not a Android image type and thus no kernel. Now when we also make a ClockWork recovery the same happens. Kernel is removed and recovery.img is now a RK image type. This leaves the kernel as a stand alone RK img. So when recovery boots it nopw uses this external kernel and guess what. We cannot write over it while it is running. So this is why CWM for rockchip devices cannot write kernel.img

If we could figure out how to make the Android type image that works, we might be able to get somewhere with writing kernel with CWM. But I have yet to figure it out. I believe in the Parameter file the MAGIC: value has something to do with the MD5 check of Android images. Maybe also the offset value too. Again this is somehting I have been unable to figure out.

However for info sharing I will share this so you know. You can have a ROM with 3 kernels! Boot.img with a kernel, recovery with a kernel and a stand alone kernel.img. Which one is used? I will tell you because I tested this extensively

On normal boot if a kernel in is boot.img then that is the kernel that is used to boot Android OS.
On recovery boot if kernel is in recovery, that kernel is used to handle doing the recovery work
The stand alone kernel.img is never used unless kernel is missing from boot or recovery.

So how could we make a CWM that writes kernel? The only way is to have kernel in boot.img! Then it will work. CWM will be using the external kernel.img thus leaving us free to write boot.img with the new kernel! But we are back to the problem... We cannot seem to make a Android style IMG that works!

Hope that helps,
Bob

bluetigger68
09-29-2012, 10:56 AM
What are you trying to do?

Bob

I unpacked recovery.img and I need to know which files to edit for getting recovery to format data and cache with ext4?

Finless
09-29-2012, 10:59 AM
What you want me to tell you all my secrets? :)

/etc/recovery.fstab change ext3 to ext4

Bob

yash3339
09-29-2012, 11:04 AM
That's straightforward!!
Why would manufacturers use ext3 in the first place then Bob?



Sent from my LG Optimus One using Tapatalk 2

Finless
09-29-2012, 11:39 AM
When they made the kernel if they did not add EXT4 support then they use EXT3! Most ICS and JB kernels now use EXT4 butnot all of them! 4.0.3 mostly still had EXT3. However understand this! If your kernel does not support EXT4, then you will need to find EXT4.ko modules and insmod them into the kernel in boot.img or you WILL NOT boot! It will hang because it does not know how to mount EXT4.

Also know this, an EXT4 mount command (if the kernel supports it) will mount EXT3 formatted parition and report it is mounted EXT4 but in fact the file system is still EXT3 and your not getting EXT4 performance!

Bob

Gine
09-30-2012, 06:36 AM
Hi, I'm new to this forum but got a lot of knowledges here.

Thanks to you all.

Now, I have questions to ask

1. Is it possible to mod Jelly bean to RK29 devices. I thinks a lot of chinese's tablet will be discard for update.

2. After read this thread, I'm not sure about modding rom for RK29 device. If I want to mod it. I must keep their rom's size to the same as factory's stock rom, am I right?

bluetigger68
09-30-2012, 11:00 AM
When they made the kernel if they did not add EXT4 support then they use EXT3! Most ICS and JB kernels now use EXT4 butnot all of them! 4.0.3 mostly still had EXT3. However understand this! If your kernel does not support EXT4, then you will need to find EXT4.ko modules and insmod them into the kernel in boot.img or you WILL NOT boot! It will hang because it does not know how to mount EXT4.

Also know this, an EXT4 mount command (if the kernel supports it) will mount EXT3 formatted parition and report it is mounted EXT4 but in fact the file system is still EXT3 and your not getting EXT4 performance!

Bob

Well my tab hangs on boot and this obviously means the kernel doesn't support ext4 natively. Insmodding ext4.ko can be done via the init.rc? And if so I guess it has to be done on init of the tab?

Thanks

Maddie_Q
10-02-2012, 03:47 PM
Hi, I'm new to this forum but got a lot of knowledges here.

Thanks to you all.

Now, I have questions to ask

1. Is it possible to mod Jelly bean to RK29 devices. I thinks a lot of chinese's tablet will be discard for update.

2. After read this thread, I'm not sure about modding rom for RK29 device. If I want to mod it. I must keep their rom's size to the same as factory's stock rom, am I right?

1. It's possible, I think. You can download the JB's system img with SDK, use unyaffs get files then make a new RK system img. But I'm not sure that it could run with your kernel. Has anybody in 4rum ever made JB for RK29?

2. Size of a modded rom doesn't depend on the original. All you have to do is edit the parameter file in ur update.img Back to page 1 or 2, Finless explained every litte thing in his post.

900supersport
10-09-2012, 11:49 AM
This post over on fma may be of interest if you want to change the boot screen embedded in the kernel.

http://www.flashmyandroid.com/forum/showthread.php?p=13379

It will be a few days before I can test this myself.

Finless
10-09-2012, 12:55 PM
This post over on fma may be of interest if you want to change the boot screen embedded in the kernel.

http://www.flashmyandroid.com/forum/showthread.php?p=13379

It will be a few days before I can test this myself.

I downloaded this and checked it out. I can tell you for fact this will not work on every kernel out there. Not all of them have the term he searches for in kernel for the image:
3. Finding and replacing the bootlogo in kernel.img
in logo.whs for winhex he searches for: Find "logo_RKlogo_clut"
Trust me, not all in fact very FEW have that!

ALso it would be much better if he read the existing kernel and wrote a new kernal rather than making it read from the tablet and flash it again.

Then on top of this you have to be VERY careful what kind of PNG you use! Trust me on this one :)

Bob

900supersport
10-13-2012, 01:06 PM
Just created my own version of the batch file to edit a kernel.img without connecting to the tab.

Worked a treat.

grillergt
10-14-2012, 04:38 AM
It is done! Just in time for my birthday, hehehe. Its rooted and root checker agrees :BANANA

I'll write down what I did later... as much to remember it as to show that if I can do it anyone can :cool:

Cheers!

Finless
10-14-2012, 08:19 AM
Congrats and happy birthday!

Bob

grillergt
10-14-2012, 09:33 AM
Congrats and happy birthday!

Bob

Thanks! However I realize now I posted in the wrong thread :o

JDfense
10-20-2012, 10:59 AM
Hi everybody,
I tried to change the boot.img to mount the ext4 system as rw for my rk2918 easypad970. Base is a moage jellybean
What I have done:
dd if=boot.img of=bootimg.gz skip=8 bs=1 count=20000000
mkdir myboot
cd myboot/
sudo gunzip < ../bootimg.gz | sudo cpio -i --make-directories

In /boot/init.rc
> mount ext4 mtd@system /system ro noatime nodiratime ---should be set on rw
> mount rootfs rootfs / ro remount ---- forgot this line to rw

sudo find . -exec touch -d "1970-01-01 01:00" {} \;
sudo find . ! -name "." | sort | sudo cpio -oa -H newc | sudo gzip -n >../customboot.gz
cd ../
rkcrc -k customboot.gz customboot.img

I got no error messages in linux ubuntu 12.04 final, but the boot.img does not start after flashing. I got only into cwm, rebooting get me into loop.

Thanks for any help.
JDfense

Edit:
I think all lines are correct, but I assume that I not found all lines for the ext4 system rw, so I run with uncomplete settings in the bootloop.
Anyone an idea ?

@900supersport
Could it be, that you have a similar problem with your first jellybean version for the cube?

sas_sas
10-21-2012, 01:40 AM
hi finless and other specialists,

my hyundai rock x rkcp 3066 came v404 FW.
Its touch function defected after a few days I upgraded factory made 4.1 w/o reason.
the three newer vers of factory FW did not solve.

Strange, not possible to flash previous FWs, why?
what part of rom controls touch feature?
How can we verify if it is hardware or software trouble?
Ths in advance.

900supersport
10-21-2012, 02:49 AM
JDfense

Not sure how how much you have done with working with boot.img. I'm assuming this is you first attempt, apologies if this is not the case.

On that basis, I'd start by confirming that you have the flash, un pack and repack of boot.img right, if that's the case then the error is with your changes.

1 flash just a base boot.img you are going to work on. This should replace the boot.img on the tab. Can you boot?
2 unpack the base boot.img, repack and flash just this custom boot.img. does the tab boot?

If the tab boots, flash your modified boot.img, I assume this will not boot but confirm.
Flash again the boot.img from 2. Does the tab boot?

After these changes we will know if the issue is with
Flashing boot.img
Unpack and re-pack of boot.img
The changes you have made to unit.rc

BTW at one time I used to have to restart my PC to windows to flash then restart back to Linux. I now do most of my flashing from Linux. I pretty much only flash from windows to prove a full ROM kit.

Finless
10-21-2012, 08:05 AM
Yes and 900 pointed out. Make sure you are making a good boot.img.

Now as for adding EXT4 support. There is MUCH more to it than just modifying boot.img!

1) The kernel must support EXT4! If it does not then you have to insmod kernel modules in boot.img to get it to support EXT4. THis is what I had to do for ALL Gingerbread ROMs. Most ICS kernels now support EXT4 but not ALL! Arnova for instance does not have full EXT4 support in the kernel.

2) Once you have modified boot.img you must now make a new system.img that is EXT4! Sure many times the EXT4 mount command will mount a EXT3 formatted system but not always.

3) Now getting system.img to EXT4 is one thing. Try that first. Then to get /data and /cache to EXT4 requires a modification to recovery.img. You have to tell it that /data and /cache are now EXT4. Recovery is what formats data and cache so just changing init.rc in boot.img is not going to do it.

Bob

JDfense
10-21-2012, 08:57 AM
Hi 900supersport and Bob Finless,
thanks and yes, your are right. It is the first time I stumble into the boot.img of a rk2918. Before with my rk2818 cramfs roms it was easier. The windows tools like Newtuxflash, with afptool and rkcrc did the job fine.

I'm very shure that the format is right of my changed boot.img, but I think now the lines I changed in the boot.img are not enough, but I will try to flash only the changed boot.img instead of the all files with Rktool.

My system is ext4 as fare as I understand the linux as beginner, but take a look for yourself:




u0_a19@android:/ $ mount
rootfs / rootfs rw,relatime 0 0
tmpfs /dev tmpfs rw,nosuid,relatime,mode=755 0 0
devpts /dev/pts devpts rw,relatime,mode=600 0 0
proc /proc proc rw,relatime 0 0
sysfs /sys sysfs rw,relatime 0 0
none /acct cgroup rw,relatime,cpuacct 0 0
tmpfs /mnt/asec tmpfs rw,relatime,mode=755,gid=1000 0 0
tmpfs /mnt/obb tmpfs rw,relatime,mode=755,gid=1000 0 0
none /dev/cpuctl cgroup rw,relatime,cpu 0 0
/dev/block/mtdblock8 /system ext4 ro,noatime,nodiratime,barrier=1,data=ordered 0 0
/dev/block/mtdblock6 /data ext4 rw,nosuid,nodev,noatime,nodiratime,barrier=1,data= ordered 0 0
/dev/block/mtdblock5 /cache ext4 rw,nosuid,nodev,noatime,nodiratime,barrier=1,data= ordered 0 0
/sys/kernel/debug /sys/kernel/debug debugfs rw,relatime 0 0
/dev/block/vold/179:1 /mnt/external_sd vfat rw,dirsync,nosuid,nodev,noexec,noatime,nodiratime, uid=1000,gid=1015,fmask=0002,dmask=0002,allow_utim e=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
/dev/block/vold/31:9 /mnt/sdcard vfat rw,dirsync,nosuid,nodev,noexec,noatime,nodiratime, uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utim e=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
/dev/block/vold/31:9 /mnt/secure/asec vfat rw,dirsync,nosuid,nodev,noexec,noatime,nodiratime, uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utim e=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
tmpfs /mnt/sdcard/.android_secure tmpfs ro,relatime,size=0k,mode=000 0 0
u0_a19@android:/ $

My problem is this line
/dev/block/mtdblock8 /system ext4 ro,noatime,nodiratime,barrier=1,data=ordered 0 0

I want it rw to change the system in the tablet again.
So I changed this two lines in the /boot/init.rc
> mount ext4 mtd@system /system ro noatime nodiratime ---should be set on rw
> mount rootfs rootfs / ro remount ---- forgot this line to rw

What do I miss to make my ext4 system read and writeable?

The cwm 5.5.0.4 I use is for ext4, too.

JDfense

900supersport
10-21-2012, 09:18 AM
Have you unpacked a boot.img, repacked it and flashed to prove this side of things. Once you have done that we can building it to get you to an ext4 system image.