Hacking the S7

ivyvisors

Senior Member
Dec 29, 2010
233
52
Hi everyone,

Anyway I'm Ivy, a unix hacker type who's just stumbled upon the android scene.

So far, I've rooted the device, and got a few things working.

Anyway currently I'm working through the init.rc script. The init.rc script is one of the first thing runs when the tablet runs. This sets up the device for everything else to run.

One part of the init script that interests me is how it sets up the "data" partition.

The data partition is 256mb in size which is not really large enough. But there may be a work around on this.

Firstly the init script sets up what are called environment variables, like the path, and a few other things. There is also one for the data partition:

export ANDROID_DATA /data

Now, as the init script goes on it creates in the root partition (this is created on boot) the directories where things are stored for example cache.

Now we come to mounting the data partition:

mount yaffs2 mtd@userdata /data nosuid nodev

Here is where it starts to interest me.

If I was to create a partition on the sdcard, using the same file system, I might be able to mount that instead of the internal data partition.

Now the difficult part will be creating a new boot image to do this, but from what I can tell this itself isn't too hard.

It's almost like making linux boot floppys and ramdisks =)

Another interesting thing I've found out about the device is that there are a lot of startup scripts that have been sourced from the Code Aurora Forum. Whom I'd not heard of before today, though these are more specific to the processor in the device.

Finally, where too from here. well I'd love to see if I could get Froyo ported to the device, but who knows how successful I will be. Only time will tell.

~Ivy
 
I was looking into the same thing. Playing about with the init.rc script to get A2SD working... If you are new to Android, from what i can guess you are talking about is using the SD as a place to mount some of the file system and swap partitions and what not. It would give greater flexability to expand the data partition, which should help with freeing up RAM...

Can i say, you are probably better getting on some forums and reading about A2SD (apps to SD) to see how these guys have done it in the past. Im still trying to work it out how to get init.rc to load SD partitions on 2.1 (internal or external SD, as my Telstra T-Tab only has external until i bust it open and have a look at its guts.)

Most guys cook this into custom ROMS, but i think, with root, it should be able to be worked out to get it working on stock ROM... just init.rc needs to know to load it that way at boot.

Like the Samsung Galaxy S, i think freeing up RAM would help with a lot of the lag issues as well :)

If only i could work out why these widgets wont work... :/
 
Hi Pegaxs,

I've been looking into how the thing boots at the moment, unfortunately it's not enough to modify the init.rc, as this comes from the boot image on one for the partitons.

I'm spenidng the morning getting my dev box up to speed with the SDK and source for android. I also need to get the Huawei kernel source, and see if what they're using in the kernel is in the android sources.

Also I need to get the source from the "code aurora forums" as they have a lot of the cpu code and scripts I will need to get going with this task.

What I want to do first is create an alternative rom, or boot image, so I can use the sdcard for the /data/ partition.

But first is to get my dev machine up and going for a good weekend of coffee and hacking.

~Ivy
 
Good luck Ivy.
Have you had a look at the xda-developers forum?
They don't have as much going on for the S7 but they do have a lot of rom cookers over there.
Maybe you can find some info over there.


Sent from my S7 using Android Tablet Forum App
 
Hi Claian,

I've joined up on those forums, and am looking at all of the information I can find.

Currently I'm also looking at the Huawai supplied kernel source, and their own modifications.

~ivy
 
You can change the system partition to read write, then you can change unit.rc. I tried creating an ext2 partition and I can successfully mount it. I tried many edits to init.rc but could not get it to auto mount. There is no /etc/fstab which is in some android roms, which would help with auto mounting. Happy to share my scripts and efforts. If we can auto mount, then we can just create a symbolic link to replace /data/apps.

Sent from my Ideos S7 using Android Tablet Forum App
 
Hi Pvella,

the init.rc that might need to be edited is the in / This means we need to edit the boot image which makes things a little difficult.

Looking on the xda forums, it appears someone has done it by creating a script in /system/etc/ called install-recovery.sh

This might be the easiest way to do it, but the risk of getting stuck in a boot loop is rather high.

I've also now got all the android source code, it's taken all morning. Lots of fun =)

~ivy
 
To mount root
mount -oremount,rw rootfs /

To mount sdcard
mount -rw -t ext2 /dev/block/vold/179:2 /data/sd

I tried adding a line like this in init.rc

mount ext3 /dev/block/mmcblk0p2 /data/app nosuid nodev noatime nodiratime

It ignores my line.....

Sent from my Ideos S7 using Android Tablet Forum App
 
hmm, I'm not sure the kernel on the s7 has ext3 support.

I will have a look at the config.gz file (the compile time options) and see, but that could be the reason.
 
In /proc/ there is a file called config.gz which shows all of the compile options used when building the kernel.

In the section marked filesystem I can see the following filesystems that the kernel supports. These are:
  • ext2
  • vfat
  • yaffs

So you will need to create a ext2 partition for the device. Unless someone (maybe myself) recompiles the kernel with ext3 support. To be honest the easiest option would be to create an ext2 partition.

~Ivy
 
Oh wait you mentioned ext2 first. But your change to init.rc mentions ext3. Which partition type was ir?

Sent from my S7 using Android Tablet Forum App
 
Back
Top