Jump to content

Hardware hacking this puppy, input?


Guest popetodd

Recommended Posts

Guest plink212

OK so have hit a few speed bumps here

It appears that the filesystems are mapped by init.rc and that this file is stored in the boot.img file which is loaded at each boot.

This means that I can use my extra space but only manually, as I cannot use vold to mount the partition for me.

So here is where I am at

1. work out how to modify the boot image to create a sub folder under /sdcard on the rootfs and modify vold.conf to mount the sdcard to the subfolder, then modify init.rc to mount the internal partition to /sdcard

2. leave everything as it is and mount my new partition to a folder I create on each boot.

any tips and tricks would be appreciated

Tim

Link to comment
Share on other sites

Guest popetodd
OK so have hit a few speed bumps here

It appears that the filesystems are mapped by init.rc and that this file is stored in the boot.img file which is loaded at each boot.

This means that I can use my extra space but only manually, as I cannot use vold to mount the partition for me.

So here is where I am at

1. work out how to modify the boot image to create a sub folder under /sdcard on the rootfs and modify vold.conf to mount the sdcard to the subfolder, then modify init.rc to mount the internal partition to /sdcard

2. leave everything as it is and mount my new partition to a folder I create on each boot.

any tips and tricks would be appreciated

Tim

Do you have a Linux box available to repartition and format this card with?

If so give what I outlined above a shot, I bet it works.

Link to comment
Share on other sites

Guest plink212
Do you have a Linux box available to repartition and format this card with?

If so give what I outlined above a shot, I bet it works.

Problem with that is that say I extended partition 6 i would have a large /data partition and if i extended partition 5 i would have a large cache partition

The numbers need to be 5 and 6 as they are the entries in the init.rc file.

Unless of course I have completely missed the point of what you are suggesting

Tim

Link to comment
Share on other sites

Guest popetodd
Problem with that is that say I extended partition 6 i would have a large /data partition and if i extended partition 5 i would have a large cache partition

The numbers need to be 5 and 6 as they are the entries in the init.rc file.

Unless of course I have completely missed the point of what you are suggesting

Tim

You do misunderstand (or maybe I do...).

What you want is a large data partition and a reasonable cache.

This card is where the apps get installed to and the data partition is where that happens.

So in Linux run fdisk, create partitions 1->4 with a single sector apiece, that will take care of any partition reordering that may occur.

Create partition 5 and make it reasonable, it's just a cache partition, say around 1Gb (twice the internal memory).

Create partition 6 and make it the rest of the card.

Then format each one with ext3.

Then copy over the data from the respective partitions on the original card using tar.

Put it back in and boot it up, that OS will mount it and it should show as a ton of space to install programs into.

I don't think you are going to be using the internal card as some kind of extra storage unless you play some games like creating a partition from what you have after you dd that is the rest of the card, mount it by hand as a subdirectory hanging off the /sdcard directory and then make a script that runs on startup that mounts it there all the time. But even that should be trivial.

Come to think of it that kind of opens up the possibility of a secret (security through obscurity) storage space that is only accessible when mounted but isn't obvious due to the devices factory specified 2 Gb internal capacity. Hmmm...

Edited by popetodd
Link to comment
Share on other sites

Guest plink212
You do misunderstand (or maybe I do...).

What you want is a large data partition and a reasonable cache.

This card is where the apps get installed to and the data partition is where that happens.

So in Linux run fdisk, create partitions 1->4 with a single sector apiece, that will take care of any partition reordering that may occur.

Create partition 5 and make it reasonable, it's just a cache partition, say around 1Gb (twice the internal memory).

Create partition 6 and make it the rest of the card.

Then format each one with ext3.

Then copy over the data from the respective partitions on the original card using tar.

Put it back in and boot it up, that OS will mount it and it should show as a ton of space to install programs into.

I don't think you are going to be using the internal card as some kind of extra storage unless you play some games like creating a partition from what you have after you dd that is the rest of the card, mount it by hand as a subdirectory hanging off the /sdcard directory and then make a script that runs on startup that mounts it there all the time. But even that should be trivial.

Come to think of it that kind of opens up the possibility of a secret (security through obscurity) storage space that is only accessible when mounted but isn't obvious due to the devices factory specified 2 Gb internal capacity. Hmmm...

hmm, okay with you know.

I was thinking of using the space for media, do I really need that amount of space for applications?

I like the idea of a startup script have you any ideas of how to make one.

Also if you mount the extra space beneath /sdcard then when you connect the streak in mass storage it will not work as you will not be able to dismount the /sdcard mount as it will have a locked folder, no?

What I think the ideal solution would be to use vold/dbus or something similar to automount the space beneath the sdcard or mount the sdcard beneath the /sdcard mount, as the dell media app if nothing else seems to look directly at the /sdcard mount point

Tim

Link to comment
Share on other sites

Guest popetodd
hmm, okay with you know.

I was thinking of using the space for media, do I really need that amount of space for applications?

I like the idea of a startup script have you any ideas of how to make one.

Also if you mount the extra space beneath /sdcard then when you connect the streak in mass storage it will not work as you will not be able to dismount the /sdcard mount as it will have a locked folder, no?

What I think the ideal solution would be to use vold/dbus or something similar to automount the space beneath the sdcard or mount the sdcard beneath the /sdcard mount, as the dell media app if nothing else seems to look directly at the /sdcard mount point

Tim

Hmm, excellent points.

Don't want to use vold for this as it won't need to be controlled for random mounting.

First things first though, have you picked up Root Explorer yet? With this you can make the flash read write and create a mount point and edit files on it. This would be the first step as a directory in root (/intstorage for example) needs to be created for a mount point.

vold.cfg looks good but I am sure there is a standard Unix type fstab somewhere that can be edited to add the mount to, as I said this can be done with Root Explorer and should persist through a shutdown and restart.

I'll start looking now for the fstab file for Android, if you know what and where this is let me know and I'll get you the exact string to add to it.

Same for all you devs out there, pipe in if you already know where this is to save us some time looking for it.

[EDIT] Found it, it's /init.rc.

I'm working out what out add and where to add it.

Edited by popetodd
Link to comment
Share on other sites

Guest plink212
Hmm, excellent points.

Don't want to use vold for this as it won't need to be controlled for random mounting.

First things first though, have you picked up Root Explorer yet? With this you can make the flash read write and create a mount point and edit files on it. This would be the first step as a directory in root (/intstorage for example) needs to be created for a mount point.

vold.cfg looks good but I am sure there is a standard Unix type fstab somewhere that can be edited to add the mount to, as I said this can be done with Root Explorer and should persist through a shutdown and restart.

I'll start looking now for the fstab file for Android, if you know what and where this is let me know and I'll get you the exact string to add to it.

Same for all you devs out there, pipe in if you already know where this is to save us some time looking for it.

[EDIT] Found it, it's /init.rc.

I'm working out what out add and where to add it.

Problem with the init.rc is that the rootfs partition that it loads into is a ram disk and all changes seem to be lost at restart

Edited by plink212
Link to comment
Share on other sites

Guest popetodd
Problem with the init.rc is that the rootfs partition that it loads into is a ram disk and all changes seem to be lost at restart

Yup. I see that is the issue.

So, without actually modifying the image itself (looks like that is what will be required to make it a perm change) a script that can be run after startup looks like the best way.

Something like this then:

#!/system/bin/sh
/system/bin/mount -w -o remount rootfs /
/system/bin/mkdir /storage
/system/bin/mount -t ext3 -w /dev/block/innersd0p1 /storage
/system/bin/mount -r -o remount rootfs /[/codebox]

This assumes that your new partition is number 1, if it is not change the "p" designation in the block device to the partition number you set up for the extra space on the card. It also assumes that you have formatted the filesystem in that partition as ext3.

I read on another thread in another platform forum here that someone thought Paul was placing init scripts in /data/system/etc/init.d to have them run at boot, if that is the case you could call this script S99InternalMount or similar and place it in that directory and it should mount up the partition after the system has started.

[EDIT] Nope, that's not the init script directory on this device. Will look around a bit to see if I can find one.

On the plus side the script work perfectly to create the mount pint.

Then to access it while plugged in through USB place a soft link on the SD card to this directory? Don't know if that will work as there is some funny business with the SD card when USB charging.

Be sure to chmod 755 so no one will be able to start something you don't want started by modifying the file.

Edited by popetodd
Link to comment
Share on other sites

Guest plink212

ok was wondering if this might help us

service flash_recovery /system/etc/install-recovery.sh

disabled

oneshot

#Jeff flash recovery image

on property:sys.init.fdiskcmd_complete=1

start flash_recovery

it seems that, that shell script does not exist in /system/etc/ if this is the case maybe we can use it to our advantage and run the remount script that way

Tim

Link to comment
Share on other sites

Guest popetodd

You know Tim, I have some apps on my machine that I installed that start up at boot so there must be a way to register them or a file they create somewhere that does this. It's just a matter of figuring out what and where and then the script can be run automatically.

Link to comment
Share on other sites

Guest craigdabbs
You know Tim, I have some apps on my machine that I installed that start up at boot so there must be a way to register them or a file they create somewhere that does this. It's just a matter of figuring out what and where and then the script can be run automatically.

im using startup manager to stop all these programs starting up for no reason, in the apps there is a custom tab where you can run your own programs at start. I assume you can somehow add it there or find aanother similar app. Iv not done this btw. You need root tho, but thats not so bad to get done :lol:

Link to comment
Share on other sites

Guest popetodd

Just gave that a try, couldn't find anywhere that I could specify a particular script to run from.

Edited by popetodd
Link to comment
Share on other sites

Guest plink212
That didn't quite pan out, the boot image was the wrong size and I managed to screw it up

Anyone got any tips for opening the boot image

Tim

hmm if i open the image with unpack-bootimg.pl and repack with repack-bootimg.pl it fails to load once flashed so I think i am doing something wrong here

Link to comment
Share on other sites

Guest mobiholic

Have you made any further progress with this?

Has anyone else tried swapping out the internal SD card for a larger one?

Thanks

Link to comment
Share on other sites

Guest popetodd

I see in the custom rom that there is a /system/init.d with a init file in it.

I'm going to try and put the mount script into a custom rom and see if it works there.

[EDIT] Nope, doesn't autorun anything in that directory.

Edited by popetodd
Link to comment
Share on other sites

Guest popetodd
any updates?

Not yet, teaching myself how this all fits together right now.

I'm a long time Unix Admin so it's familiar except for the image packages and how to deal with unpacking and packing them again.

I am working on it though, there are just too many things I would hack differently for this particular device (Android seems stuck in phone mode as installed on this thing) for me to give it up and accept it as it is.

Just have to work in the time to do it around a 140 mile commute and 9 hours in the office...

Edited by popetodd
Link to comment
Share on other sites

  • 4 weeks later...
Guest mobiholic
Not yet, teaching myself how this all fits together right now.

I'm a long time Unix Admin so it's familiar except for the image packages and how to deal with unpacking and packing them again.

I am working on it though, there are just too many things I would hack differently for this particular device (Android seems stuck in phone mode as installed on this thing) for me to give it up and accept it as it is.

Just have to work in the time to do it around a 140 mile commute and 9 hours in the office...

Bit of thread necro I know but has anybody made any progress along these lines yet? Or have we as a community hit a brick wall when it comes to upgrading the internal SD card due to the issues already presented within this thread or perhaps something else entirely?

Link to comment
Share on other sites

Guest popetodd
Bit of thread necro I know but has anybody made any progress along these lines yet? Or have we as a community hit a brick wall when it comes to upgrading the internal SD card due to the issues already presented within this thread or perhaps something else entirely?

In my case a shattered nose and seriously bad side effects from the blood pressure meds needed to get it low enough so the can get the 5 plus peices back into place have been my hamper. I'm planning on picking this back up after my operation next week.

Link to comment
Share on other sites

Guest MrPokeylope
In my case a shattered nose and seriously bad side effects from the blood pressure meds needed to get it low enough so the can get the 5 plus peices back into place have been my hamper. I'm planning on picking this back up after my operation next week.

Sounds like a pet-shopping / lighter incident. flaming rodent fireball to the nose? :)

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.