Getting rid of constant repacking

Search This thread

Xmister

Senior Member
Jul 4, 2010
1,037
1,946
Hi guys!

I think the need of repacking and repacked images for every kernel-rom combination is a huge nuisance.

What would be if ROMs would contain their ramdisk on the system partition, and the kernels would just contain a minimal ramdisk that loads the ROMs ramdisk?

One idea:
My first idea would break compatibility with system recovery zips, so a little modified:

There would be a new "ramdisk" directory on system partition, that would containt all the ramdisk files a ROM should have, except the system folder.
So it would contain:
bin
etc
data
...
init.rc
...
and so on.

The init in the actual ramdisk would mount system first, and then make the links:
/bin -> /system/ramdisk/bin
/etc -> /system/ramdisk/etc
/data -> /system/ramdisk/data
...
and then we would include init.rc from /system/ramdisk.

Of course all the ROMs would need to change, but after that, there would be no need for repack. Also for the old ROMs, factory ROM, some could still repack.
 
Last edited:

Freezeil

Senior Member
May 27, 2012
68
40
That's a nice idea! I thought a little bit about it and here are my thoughts (a novice, please don't laugh at me :silly:):

if I understand your idea correctly, your intention is to store the specific ROM's ramdisk in the rootfs, and make a global, generic ramdisk which will be stored in all the kernels.
Upon loading the kernel's ramdisk, it will know to take the ROM's ramdisk from the rootfs (upon mounting it?) and run whatever is in it, thus eliminating the need for repacking.

Do correct me if I'm talking absolute rubbish, but wouldn't this be a security risk?
Currently with S-ON, you actually can't change the kernel's ramdisk, but if the ramdisk will be stored in a writeable filesystem...?
 

Xmister

Senior Member
Jul 4, 2010
1,037
1,946
That's a nice idea! I thought a little bit about it and here are my thoughts (a novice, please don't laugh at me :silly:):

if I understand your idea correctly, your intention is to store the specific ROM's ramdisk in the rootfs, and make a global, generic ramdisk which will be stored in all the kernels.
Upon loading the kernel's ramdisk, it will know to take the ROM's ramdisk from the rootfs (upon mounting it?) and run whatever is in it, thus eliminating the need for repacking.

Do correct me if I'm talking absolute rubbish, but wouldn't this be a security risk?
Currently with S-ON, you actually can't change the kernel's ramdisk, but if the ramdisk will be stored in a writeable filesystem...?

On s-off phones ramdisk can be changed on the fly with repacking, and reflashing the kernel if rooted. There is no more security risk in this, than that. And system is ro mostly, so file corruption isn't something to be afraid of either.

Sent from my HTC One X using xda premium
 

Freezeil

Senior Member
May 27, 2012
68
40
On s-off phones ramdisk can be changed on the fly with repacking, and reflashing the kernel if rooted. There is no more security risk in this, than that. And system is ro mostly, so file corruption isn't something to be afraid of either.

Sent from my HTC One X using xda premium

I agree, other than the fact that repacking+reflashing the kernel on S-ON devices can only be done manually, by a person (which is the device owner, most of the time), and most of the One X's out there are S-ON and not S-OFF...
Sure, a malicious coder can write evil code in the kernel, but that's relatively less threatening since most kernels have their sources published.
If the ramdisk will be placed on a rw fs (or a ro, but it matters not because of the user elevation rooted users can achieve easily), we are adding the risk of malicious code accessing and changing that ramdisk, without the user's knowledge.

Still, this seems like a nice programming challenge, so I'm up for the task. Will start reading the init's code and see how to do it :)
 

TripNRaVeR

Senior Member
Jun 25, 2010
2,914
12,633
Maasbracht
Is anyone really seriously responding to this?
What would be the advantages of modifying Android layout for 1 device only, its so annoying to see this stuff here when even a s-off thread is locked.. currently when all the sources are going to a way whereas all the basic files are device independent makin this even more.. timewasting effort and still we have the same issues. You just lock every rom dev to a ramdisk instead of a kernel dev to a ramdisk.

This is only usefull with a locked bootloader. I never implement this, another reason is that i spend more time getting my stuff aligned with the mainline that is giving me more succes then randomly adding stuff the a system partition.

Oh and btw when youre system partition gets messed up or altered or whatever you wish you had a decent ramdisk. Not to forget the huge amount of users ending up like that and flooding the forums with questions.
 
Last edited:
  • Like
Reactions: matt95

Xmister

Senior Member
Jul 4, 2010
1,037
1,946
Is anyone really seriously responding to this?
What would be the advantages of modifying Android layout for 1 device only, its so annoying to this stuff here.. when all the sources are going to a way whereas all the basic files are device independent.
Adding 1 directory is not an "android layout modification". They are moving there, yet it isn't independent between the ROMS even on the same phone.

This is only usefull with a locked bootloader.
That's what 99% of us have.

Oh and btw when youre system partition gets messed up or altered or whatever you wish you had a decent ramdisk. Not to forget the huge amount of users ending up like that and flooding the forums with questions.
If your system messes up you are probably can't boot android either. What the r=1 user do this time? Goes to recovery, wipe, if that doesn't help, reflash.
Since we have different kernel and ramdisk for recovery, this is not a problem.
 

TripNRaVeR

Senior Member
Jun 25, 2010
2,914
12,633
Maasbracht
That's what 99% of us have.

Lol 99% of us DOESNT have this, if we did we cant flash custom roms.


Adding 1 directory is changing Android layout, Google doesnt have it, you want it on /system you alter the layout. Plain simple.

Also if anyone, like me, doesnt like to include youre mod users still need to repack between roms who contain that dir and roms who dont have that dir. That repacking also requires the same kernel edits so basicly you just move the repacking arround.
 

Xmister

Senior Member
Jul 4, 2010
1,037
1,946
Lol 99% of us DOESNT have this, if we did we cant flash custom roms.
Sorry, I was reading S-ON in my mind, I don't know why.
But then it's not only useful for locked devices. It helps just in what it says in the title.


Also if anyone, like me, doesnt like to include youre mod users still need to repack between roms who contain that dir and roms who dont have that dir. That repacking also requires the same kernel edits so basicly you just move the repacking arround.

Yes, it can only work if there are enough ROMs taking the change.

And right, call it a layout modification. Why is adding 1 directory bad for anything? It won't break compatibility over anything.
 

TripNRaVeR

Senior Member
Jun 25, 2010
2,914
12,633
Maasbracht
Sorry, I was reading S-ON in my mind, I don't know why.
But then it's not only useful for locked devices. It helps just in what it says in the title.




Yes, it can only work if there are enough ROMs taking the change.

And right, call it a layout modification. Why is adding 1 directory bad for anything? It won't break compatibility over anything.


I dont want to call it bad, i just dont think this developer discussion, as we all know, and probably you also, this kinda stuff is only stuff to think about. As long as the whole community isnt adopting this it will never happen.

As you also state, it only works when enough roms are using it.. THAT is my problem here, currently we need to repack because of compat. issues sometimes.

Cool that sucks i know, you come up with this idea, without proper thinking people say cool lets do that.

When building roms, some devs like this and some devs dont like this, that will happen you can count on that. If you have 3 devs that dont use it you could end up doing MORE repacking then we need to do now.. that is what i'm trying to explain..

Therefore i said cant believe this is seriously looked into at a high mod level dev section. Hope i made my point clearer now
 
Last edited:

Xmister

Senior Member
Jul 4, 2010
1,037
1,946
I dont want to call it bad, i just dont think this developer discussion, as we all know, and probably you also, this kinda stuff is only stuff to think about. As long as the whole community isnt adopting this it will never happen.

As you also state, it only works when enough roms are using it.. THAT is my problem here, currently we need to repack because of compat. issues sometimes.

Cool that sucks i know, you come up with this idea, without proper thinking people say cool lets do that.

When building roms, some devs like this and some devs dont like this, that will happen you can count on that. If you have 3 devs that dont use it you could end up doing MORE repacking then we need to do now.. that is what i'm trying to explain..

Therefore i said cant believe this is seriously looked into at a high mod level dev section. Hope i made my point clearer now

So your point is: "They won't use it anyway"
And why would need more repack? If half of the ROMs would use it, there would be half as much repack needed.

And in the section rules it says even overriding a notification widget should go in this forum. It's not S-OFF forum, it's Dev related forum, such as my idea.

Sent from my HTC One X using xda premium
 

Giblet-dono

Senior Member
Mar 24, 2009
1,507
702
OnePlus 7T Pro
OnePlus Nord
Lets all be honest and say: people (users) are lazy...
So if they CAN, they WILL go for the non-repack option

Now, as I am a normal User I am not sure what the exact mechanics are behind this.
But as far as I understand it would be less work for the kernel devs.
They only have to take the "minimal" ramdisk, and put it in their kernel.
The rom makers will have to do "more" work.
But it is work they already are doing, most roms are released with a specific boot.img/kernel.
Some romdevs already are making their own kernels to get some functions (within the ramdisk) to work!
They will gladly adapt to a new way of using ramdisks...

Now I suggest to X Mister, Go for it!
Make a tutorial for rom devs, make a tutorial for kernel devs, and make a tutorial for users.
Make it easy for everyone to use this method!

Now I get what Trip is saying, when we have S-Off we won't need this..
This is very true, but S-Off is most likely not going to happen any time soon.
So in the mean time, why not try it for this device?

- I know this is not really a dev related post, but nor were the last 8 or so
 

Top Liked Posts

  • There are no posts matching your filters.
  • 15
    Hi guys!

    I think the need of repacking and repacked images for every kernel-rom combination is a huge nuisance.

    What would be if ROMs would contain their ramdisk on the system partition, and the kernels would just contain a minimal ramdisk that loads the ROMs ramdisk?

    One idea:
    My first idea would break compatibility with system recovery zips, so a little modified:

    There would be a new "ramdisk" directory on system partition, that would containt all the ramdisk files a ROM should have, except the system folder.
    So it would contain:
    bin
    etc
    data
    ...
    init.rc
    ...
    and so on.

    The init in the actual ramdisk would mount system first, and then make the links:
    /bin -> /system/ramdisk/bin
    /etc -> /system/ramdisk/etc
    /data -> /system/ramdisk/data
    ...
    and then we would include init.rc from /system/ramdisk.

    Of course all the ROMs would need to change, but after that, there would be no need for repack. Also for the old ROMs, factory ROM, some could still repack.
    5
    Lets all be honest and say: people (users) are lazy...
    So if they CAN, they WILL go for the non-repack option

    Now, as I am a normal User I am not sure what the exact mechanics are behind this.
    But as far as I understand it would be less work for the kernel devs.
    They only have to take the "minimal" ramdisk, and put it in their kernel.
    The rom makers will have to do "more" work.
    But it is work they already are doing, most roms are released with a specific boot.img/kernel.
    Some romdevs already are making their own kernels to get some functions (within the ramdisk) to work!
    They will gladly adapt to a new way of using ramdisks...

    Now I suggest to X Mister, Go for it!
    Make a tutorial for rom devs, make a tutorial for kernel devs, and make a tutorial for users.
    Make it easy for everyone to use this method!

    Now I get what Trip is saying, when we have S-Off we won't need this..
    This is very true, but S-Off is most likely not going to happen any time soon.
    So in the mean time, why not try it for this device?

    - I know this is not really a dev related post, but nor were the last 8 or so
    1
    Is anyone really seriously responding to this?
    What would be the advantages of modifying Android layout for 1 device only, its so annoying to see this stuff here when even a s-off thread is locked.. currently when all the sources are going to a way whereas all the basic files are device independent makin this even more.. timewasting effort and still we have the same issues. You just lock every rom dev to a ramdisk instead of a kernel dev to a ramdisk.

    This is only usefull with a locked bootloader. I never implement this, another reason is that i spend more time getting my stuff aligned with the mainline that is giving me more succes then randomly adding stuff the a system partition.

    Oh and btw when youre system partition gets messed up or altered or whatever you wish you had a decent ramdisk. Not to forget the huge amount of users ending up like that and flooding the forums with questions.