Skip to contentSkip to conversation

Issues with the system startup when the IMAGE_TYPE is squashfs

DISCUSSION Christian Pössinger 6 participants 9 messages Nov 13, 2008 – Nov 17, 2008

lore
Share & tools
lore
#0 lore raw

Hello,

I'm currently building a rootfs that will be stored in a squashfs container. The file is properly created by OpenEmbedded, but I noticed some issues:

First of all, when I boot an OE generated rootfs for the first time, a file called /etc/volatile.cache will be generated. As of the fact that squashfs is read-only this file can't be created.

The second issue comes with the kernel modules. Again, the first system startup will create the modules.dep file inside the /lib/modules/$(uname -a) directory. But as stated before, this is not possible on a read-only filesystem.

Is there any way within OpenEmbedded to create those files before the actual rootfs image is packed?

Best regards,

Christian Pössinger
Software Development

Mixed Mode GmbH
Lochhamer Schlag 17
D-82166 Gräfelfing/München
Tel. +49 / 89 / 89 86 8-200
Fax +49 / 89 / 89 86 8-222
Mobil +49 / 172 /
http://www.mixed-mode.de

#1 lore raw
Quoted 6 lines · Christian Pössinger

Hello,

I'm currently building a rootfs that will be stored in a squashfs container. The file is properly created by OpenEmbedded, but I noticed some issues:

Quoted 10 lines

First of all, when I boot an OE generated rootfs for the first time, a file called /etc/volatile.cache will be generated. As of the fact that squashfs is read-only this file can't be created.

The second issue comes with the kernel modules. Again, the first system startup will create the modules.dep file inside the /lib/modules/$(uname -a) directory. But as stated before, this is not possible on a read-only filesystem.

I did this some time ago: http://bugs.openembedded.net/show_bug.cgi?id=3714
I guess you can do something like this with /etc/volatile.cache too.

Quoted 25 lines

Is there any way within OpenEmbedded to create those files before the actual rootfs image is packed?

Best regards,

Christian Pössinger
Software Development

Mixed Mode GmbH
Lochhamer Schlag 17
D-82166 Gräfelfing/München
Tel. +49 / 89 / 89 86 8-200
Fax +49 / 89 / 89 86 8-222
Mobil +49 / 172 /
http://www.mixed-mode.de

_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel

#2 lore raw
Quoted 2 lines · Thomas Kunze

I did this some time ago: http://bugs.openembedded.net/show_bug.cgi?id=3714
I guess you can do something like this with /etc/volatile.cache too.

Are you interested in making the changes that were suggest in the bug report to allow us to merge it?

- move it to update-modules-cross
- make it a distro option; not a requirement

Signature · 8 lines
        O T A V I O    S A L V A D O R
---------------------------------------------
 E-mail: [email protected]      UIN: 5906116
 GNU/Linux User: 239058     GPG ID: 49A5F855
 Home Page: http://otavio.ossystems.com.br
---------------------------------------------
"Microsoft sells you Windows ... Linux gives
 you the whole house."
#3 lore raw
Quoted 8 lines · Otavio Salvador
Quoted 3 lines · Thomas Kunze

I did this some time ago: http://bugs.openembedded.net/show_bug.cgi?id=3714
I guess you can do something like this with /etc/volatile.cache too.

I don't have time for working on OE atm.

Quoted 5 lines

Are you interested in making the changes that were suggest in the bug report to allow us to merge it?

- move it to update-modules-cross

This is just a simple rename.

Quoted 3 lines

- make it a distro option; not a requirement

I don't agree with that. It really don't see how this patch could break images. If it works I see no reason why any distro doesn't want to have this.

#4 lore raw
Quoted 7 lines · Thomas Kunze

This is just a simple rename.

Quoted 3 lines

- make it a distro option; not a requirement

I don't agree with that. It really don't see how this patch could break images. If it works I see no reason why any distro doesn't want to have this.

This is a behaviour change and before making it a requirement it needs to be tested.

Personally I also see no reason for it to break images but it is always better be safe then sorry.

Signature · 8 lines
        O T A V I O    S A L V A D O R
---------------------------------------------
 E-mail: [email protected]      UIN: 5906116
 GNU/Linux User: 239058     GPG ID: 49A5F855
 Home Page: http://otavio.ossystems.com.br
---------------------------------------------
"Microsoft sells you Windows ... Linux gives
 you the whole house."
#5 lore raw
Quoted 5 lines · Otavio Salvador

This is a behaviour change and before making it a requirement it needs to be tested.

Personally I also see no reason for it to break images but it is always better be safe then sorry.

I tested the patch and it worked quiet well for me on the stable tree. Seeing this build into OpenEmbedded would be great.

Best regards,
Christian

#6 lore raw
In reply to Christian Pössinger

Thursday 13 of November 2008 12:19:28 Christian Pössinger napisał(a):

Quoted 11 lines

I'm currently building a rootfs that will be stored in a squashfs container. The file is properly created by OpenEmbedded, but I noticed some issues:

The second issue comes with the kernel modules. Again, the first system startup will create the modules.dep file inside the /lib/modules/$(uname -a) directory. But as stated before, this is not possible on a read-only filesystem.

Is there any way within OpenEmbedded to create those files before the actual rootfs image is packed?

Each kernel module has postinstall script (added by kernel.bbclass) which calls 'depmod -a' and update-modules. Opkg intercepts depmod calls to make it just one call in 'opkg configure' during first boot. In effect your rootfs has all module dependencies generated on build time. You can probably remove second part of those postinstalls to not call them on device at all.

Regards,

Signature · 3 lines
JID:      [email protected]
Website:  http://blog.haerwu.biz/
LinkedIn: http://www.linkedin.com/in/marcinjuszkiewicz
#7 lore raw
Quoted 13 lines · Marcin Juszkiewicz

Thursday 13 of November 2008 12:19:28 Christian Pössinger napisa??(a):

Quoted 11 lines

I'm currently building a rootfs that will be stored in a squashfs container. The file is properly created by OpenEmbedded, but I noticed some issues:

The second issue comes with the kernel modules. Again, the first system startup will create the modules.dep file inside the /lib/modules/$(uname -a) directory. But as stated before, this is not possible on a read-only filesystem.

Is there any way within OpenEmbedded to create those files before the actual rootfs image is packed?

Quoted 6 lines

Each kernel module has postinstall script (added by kernel.bbclass) which calls 'depmod -a' and update-modules. Opkg intercepts depmod calls to make it just one call in 'opkg configure' during first boot. In effect your rootfs has all module dependencies generated on build time. You can probably remove second part of those postinstalls to not call them on device at all.

Another option, if your kernel only builds the modules you want to
install, is have module.dep, etc, be built in the install section of the kernel recipe and package them up into the kernel-modules package. The
only slight trick is that you need to do this in kernel_do_install in kernel.bbclass:
oe_runmake DEPMOD=which ${TARGET_PREFIX}depmod-2.6 INSTALL_MOD_PATH="${D}" modules_install Since the kernel does some tests which mean that DEPMOD must be passed
as a full path.

Signature · 1 line
Tom Rini
#8 lore raw
In reply to Marcin Juszkiewicz
Quoted 3 lines · Marcin Juszkiewicz

Each kernel module has postinstall script (added by kernel.bbclass) which calls 'depmod -a' and update-modules. Opkg intercepts depmod calls to make it just one call in 'opkg configure' during first boot.

I doesn't. Opkg doesn't ship the intercept scripts anymore.

regards,

Koen