Creating partitions through script in init.rc Context/Resume:


I'm changing the android platform to create two partitions in a SD Card. I need to do this as early as possible. I'm currently trying in init.rc
It would be nice to obfuscate the access to one of the partitions. If I could keep it hidden would be better


And...the long story:

I'm trying to create new partitions on an SD card in a
device, and I need to be done as early as possible.
 I thought that the init.rc should be the best location for this, so I
tried to add a script call to perform the task, but I'm unable to
create these partitions (or get the reason it fails).
 First of all, is this premise valid? Should I be able to do this?

I call the script by:

service myscript /system/bin/logwrapper /system/bin/myscript.sh
   disabled
   oneshot


at init-time.  And the content´s of the .sh file is

fdisk /dev/sdcard &lt; mykeys.input


where "mykeys.input" is the sequence of commands used to perform the task
of creating the partitions.

Is this the recommended way of doing this?
service myscript /system/bin/logwrapper /system/bin/myscript.sh
   disabled
   oneshot


If you declare the service as disabled, it wont run unless you later explicitly start it.

But do you really want to repartition the card every time you boot the system? I would think you would want to partition it once, and then perhaps mount the partitions in the init script.