[LEDE-DEV] mount_root skipped on initramfs builds

Josua Mayer josua.mayer97 at gmail.com
Sun Aug 7 02:45:09 PDT 2016


Hi John,

Am 07.08.2016 um 08:42 schrieb John Crispin:
> 
> 
> On 06/08/2016 18:25, Josua Mayer wrote:
>> Hi everyone,
>>
>> During my work on supporting a block-device as overlay partition,
>> without using extroot I came across this phenomenon:
>>
>> When booting my mvebu-based board with an initramfs, mount_root was not
>> executed. This seems unusual to me, I certainly expected the init
>> process to be exactly the same.
>> So I traced the cause to line 15 in the 80_mount_root preinit script.
>> It says: [ "$INITRAMFS" = "1" ] || boot_hook_add preinit_main do_mount_root
>>
>> Very clearly, this behaviour is intentional. Would anyone be willing to
>> shed some light on why this is?
>> Can it be removed? And if not: What is stopping us?
> 
> its by design. initramfs will reside in ram. in your usecase, you would
> want to run the initramfs and then mount an external media as root. at
> this point the initramfs's rootfs will continue to reside in ram and
> waste it.
Thanks for clarifying this. I am on your side there, it makes little
sense to waste ram with an initramfs. Only I was doing my tests with an
initramfs because thats the only image type already properly implemented
for the Clearfog.

Perhaps we can add a console message stating that mount_root was skipped
on purpose? This would make it much easier for future developers should
they ever run into the same situation.
> 
> why do you not want to use extroot ? it is desinged for the exact
> purpose of what you are trying to do.
Well, this is why:
a) I did not yet understand how to set up extroot when creating images,
aka in the target/linux/mvebu/.../Makefile
b) Isn't extroot meant for the user to control? What would happen if
extroot was already set up in teh read-only rootfs? Chain-extroot?
c) I would really love a solution thats obvious when inspecting the
system. So to me that means: 3 partitions, and all the magic visible in
bootargs (e.g. root=/dev/mmcblk0p2 rootfstype=squashfs
overlay=/dev/mmcblk0p3)

Now I already got this working, and intend to submit a new version of
that patch once I can show off how it is meant to be used.

br
Josua Mayer
> 
> 	John
> 
>>
>> John I added you in CC because it is your commit that added the
>> initramfs-check:
>> https://git.lede-project.org/?p=source.git;a=blobdiff;f=package/base-files/files/lib/preinit/80_mount_root;h=9a99ee91097129205e7cee966ce4bf2ecd0d7c72;hp=ad24fb8ace70707e434c9980d948399834ce160f;hb=f43b7934d2850c2f545736253a0f8cbe4915fdff;hpb=1360067c4a75cd1804710e6f25871f695d3271b2
>>
>> br
>> Josua Mayer
>>
>> _______________________________________________
>> Lede-dev mailing list
>> Lede-dev at lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/lede-dev
>>
> 
> _______________________________________________
> Lede-dev mailing list
> Lede-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev
> 



More information about the Lede-dev mailing list