Skip to contentSkip to conversation

Early image startup

DISCUSSION Gary Thomas 4 participants 9 messages Apr 8, 2011

lore
Share & tools
lore
#0 lore raw

I have a Poky image which uses a number of kernel modules. For whatever reason, the raw image has not had the modules configured (no /lib/modules/.../modules.dep) This file is created by 'update-modules' but that is run too late in the boot process. The problem is that other code, e.g. I'm using iptables via modules, requires the modules be configured early and this fails. If I reboot (after 'update-modules' has run), everything is fine.

My system is PowerPC and I'm using ipk packaging.

Here's a snippet from my initial boot log:
Please wait: booting...
Starting udev
Configuring network interfaces... udhcpc (v1.17.3) started Setting IP address 0.0.0.0 on eth0
Sending discover...
PHY: mdio@ff024520:01 - Link is Up - 1000/Full Sending discover...

    Sending select for 192.168.12.140...

Lease of 192.168.12.140 obtained, lease time 600
Setting IP address 192.168.12.140 on eth0
Deleting routers
Adding router 192.168.12.1
Recreating /etc/resolv.conf
Adding DNS server 192.168.12.1
done.
modprobe: can't open 'modules.dep': No such file or directory
iptables v1.4.9: can't initialize iptables table `filter': iptables who? (do you need to insmod?) Perhaps iptables or your kernel needs to be upgraded.
Starting DHCP server: .
Fri Apr 8 12:29:00 UTC 2011
Configuring update-modules.
Configuring kernel-image-2.6.37.3.
Configuring kernel-module-nf-conntrack.
Configuring kernel-module-x-tables.
Configuring kernel-module-ip-tables.
Configuring kernel-module-nf-defrag-ipv4.
Configuring kernel-module-nf-conntrack-ipv4.
Configuring kernel-module-iptable-mangle.
Configuring kernel-module-xt-state.
Configuring kernel-module-nf-nat.
Configuring kernel-module-nf-conntrack-tftp.
Configuring kernel-module-nf-nat-tftp.
Configuring kernel-module-ipt-masquerade.
Configuring kernel-module-iptable-nat.
Configuring kernel-module-iptable-filter.
Configuring netkit-tftpd.
Configuring kernel-module-xt-tcpudp.

So, what decides when these 'configuring' steps run?

Thanks

Signature · 4 lines
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------
#1 lore raw
Quoted 49 lines · Gary Thomas

I have a Poky image which uses a number of kernel modules. For whatever reason, the raw image has not had the modules configured (no /lib/modules/.../modules.dep) This file is created by 'update-modules' but that is run too late in the boot process. The problem is that other code, e.g. I'm using iptables via modules, requires the modules be configured early and this fails. If I reboot (after 'update-modules' has run), everything is fine.

My system is PowerPC and I'm using ipk packaging.

Here's a snippet from my initial boot log:
Please wait: booting...
Starting udev
Configuring network interfaces... udhcpc (v1.17.3) started
Setting IP address 0.0.0.0 on eth0
Sending discover...
PHY: mdio@ff024520:01 - Link is Up - 1000/Full
Sending discover...
Sending select for 192.168.12.140...
Lease of 192.168.12.140 obtained, lease time 600
Setting IP address 192.168.12.140 on eth0
Deleting routers
Adding router 192.168.12.1
Recreating /etc/resolv.conf
Adding DNS server 192.168.12.1
done.
modprobe: can't open 'modules.dep': No such file or directory
iptables v1.4.9: can't initialize iptables table `filter': iptables who? (do you need to insmod?) Perhaps iptables or your kernel needs to be upgraded.
Starting DHCP server: .
Fri Apr 8 12:29:00 UTC 2011
Configuring update-modules.
Configuring kernel-image-2.6.37.3.
Configuring kernel-module-nf-conntrack.
Configuring kernel-module-x-tables.
Configuring kernel-module-ip-tables.
Configuring kernel-module-nf-defrag-ipv4.
Configuring kernel-module-nf-conntrack-ipv4.
Configuring kernel-module-iptable-mangle.
Configuring kernel-module-xt-state.
Configuring kernel-module-nf-nat.
Configuring kernel-module-nf-conntrack-tftp.
Configuring kernel-module-nf-nat-tftp.
Configuring kernel-module-ipt-masquerade.
Configuring kernel-module-iptable-nat.
Configuring kernel-module-iptable-filter.
Configuring netkit-tftpd.
Configuring kernel-module-xt-tcpudp.

Quoted 1 line

So, what decides when these 'configuring' steps run?

FAOD, these are my init.S steps:
/etc/rcS.d:
S02banner.sh -> ../init.d/banner.sh
S03sysfs.sh -> ../init.d/sysfs.sh
S04udev -> ../init.d/udev
S10checkroot.sh -> ../init.d/checkroot.sh S20modutils.sh -> ../init.d/modutils.sh S35mountall.sh -> ../init.d/mountall.sh S36udev-cache -> ../init.d/udev-cache S37populate-volatile.sh -> ../init.d/populate-volatile.sh S38devpts.sh -> ../init.d/devpts.sh S39hostname.sh -> ../init.d/hostname.sh S40networking -> ../init.d/networking S41nat_setup -> ../init.d/nat_setup S45mountnfs.sh -> ../init.d/mountnfs.sh S50dhcp-server -> ../init.d/dhcp-server S55bootmisc.sh -> ../init.d/bootmisc.sh

Signature · 4 lines
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------
#2 lore raw
In reply to Gary Thomas

Op 8 apr 2011, om 15:20 heeft Gary Thomas het volgende geschreven:

Quoted 7 lines

I have a Poky image which uses a number of kernel modules. For whatever reason, the raw image has not had the modules configured (no /lib/modules/.../modules.dep) This file is created by 'update-modules' but that is run too late in the boot process. The problem is that other code, e.g. I'm using iptables via modules, requires the modules be configured early and this fails. If I reboot (after 'update-modules' has run), everything is fine.

Sound like you need http://patches.openembedded.org/patch/1917/

#3 lore raw
Quoted 11 lines · Koen Kooi

Op 8 apr 2011, om 15:20 heeft Gary Thomas het volgende geschreven:

Quoted 7 lines

I have a Poky image which uses a number of kernel modules. For whatever reason, the raw image has not had the modules configured (no /lib/modules/.../modules.dep) This file is created by 'update-modules' but that is run too late in the boot process. The problem is that other code, e.g. I'm using iptables via modules, requires the modules be configured early and this fails. If I reboot (after 'update-modules' has run), everything is fine.

Sound like you need http://patches.openembedded.org/patch/1917/

To be honest that sounds like a more fundamental problem as if the user cares which rtc should be rtc0, there are other ordering constraints being imposed such as a symlink to the "best" rtc device...

Cheers,

Richard

#4 lore raw
Quoted 11 lines · Richard Purdie
Quoted 10 lines · Koen Kooi

Op 8 apr 2011, om 15:20 heeft Gary Thomas het volgende geschreven:

Quoted 7 lines

I have a Poky image which uses a number of kernel modules. For whatever reason, the raw image has not had the modules configured (no /lib/modules/.../modules.dep) This file is created by 'update-modules' but that is run too late in the boot process. The problem is that other code, e.g. I'm using iptables via modules, requires the modules be configured early and this fails. If I reboot (after 'update-modules' has run), everything is fine.

Quoted 5 lines
Quoted 1 line

Sound like you need http://patches.openembedded.org/patch/1917/

To be honest that sounds like a more fundamental problem as if the user cares which rtc should be rtc0, there are other ordering constraints being imposed such as a symlink to the "best" rtc device...

Indeed, this patch did not help my situation at all.

I think my problem is that of post-install package scripts (hence 'Configuring ...') not being run until quite late.

Signature · 4 lines
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------
#5 lore raw
Quoted 14 lines · Gary Thomas
Quoted 13 lines · Richard Purdie
Quoted 11 lines · Koen Kooi

Op 8 apr 2011, om 15:20 heeft Gary Thomas het volgende geschreven:

Quoted 7 lines

I have a Poky image which uses a number of kernel modules. For whatever reason, the raw image has not had the modules configured (no /lib/modules/.../modules.dep) This file is created by 'update-modules' but that is run too late in the boot process. The problem is that other code, e.g. I'm using iptables via modules, requires the modules be configured early and this fails. If I reboot (after 'update-modules' has run), everything is fine.

Sound like you need http://patches.openembedded.org/patch/1917/

Quoted 8 lines
Quoted 3 lines

To be honest that sounds like a more fundamental problem as if the user cares which rtc should be rtc0, there are other ordering constraints being imposed such as a symlink to the "best" rtc device...

Indeed, this patch did not help my situation at all.

I think my problem is that of post-install package scripts (hence 'Configuring ...') not being run until quite late.

Looking at the pre-run image, I see that there is /etc/rcS.d/S98configure which runs these scripts. Is there any reason I can't move it earlier?

Signature · 4 lines
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------
#6 lore raw
Quoted 19 lines · Gary Thomas
Quoted 18 lines · Gary Thomas
Quoted 16 lines · Richard Purdie
Quoted 11 lines · Koen Kooi

Op 8 apr 2011, om 15:20 heeft Gary Thomas het volgende geschreven:

Quoted 7 lines

I have a Poky image which uses a number of kernel modules. For whatever reason, the raw image has not had the modules configured (no /lib/modules/.../modules.dep) This file is created by 'update-modules' but that is run too late in the boot process. The problem is that other code, e.g. I'm using iptables via modules, requires the modules be configured early and this fails. If I reboot (after 'update-modules' has run), everything is fine.

Sound like you need http://patches.openembedded.org/patch/1917/

To be honest that sounds like a more fundamental problem as if the user cares which rtc should be rtc0, there are other ordering constraints being imposed such as a symlink to the "best" rtc device...

Quoted 7 lines
Quoted 4 lines

Indeed, this patch did not help my situation at all.

I think my problem is that of post-install package scripts (hence 'Configuring ...') not being run until quite late.

Looking at the pre-run image, I see that there is /etc/rcS.d/S98configure which runs these scripts. Is there any reason I can't move it earlier?

Found it:
ipk systems - meta/recipes-devtools/opkg/opkg_0.1.8.bb rpm systems - meta/classes/rootfs_rpm.bbclass

Note: the ipk version is quasi-configurable, the rpm version hardwired at 98. Since these are package install scripts, which presumable could have been run at image creation time but needed to run on the target hardware, why put it off to so late? I would think that this should be done _first_, not _last_

Signature · 4 lines
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------
#7 lore raw

As for the rpm ordering this was preserved from an earlier version. If there is a more appropriate place to run the late configuration scripts, let's move it. I think that it's likely a good place to move it to soon after the filesystem has been mounted RW. Do any of the scripts normally require networking or other system resources?

Quoted 47 lines · Gary Thomas
Quoted 19 lines · Gary Thomas
Quoted 18 lines · Gary Thomas
Quoted 16 lines · Richard Purdie
Quoted 11 lines · Koen Kooi

Op 8 apr 2011, om 15:20 heeft Gary Thomas het volgende geschreven:

Quoted 7 lines

I have a Poky image which uses a number of kernel modules. For whatever reason, the raw image has not had the modules configured (no /lib/modules/.../modules.dep) This file is created by 'update-modules' but that is run too late in the boot process. The problem is that other code, e.g. I'm using iptables via modules, requires the modules be configured early and this fails. If I reboot (after 'update-modules' has run), everything is fine.

Sound like you need http://patches.openembedded.org/patch/1917/

To be honest that sounds like a more fundamental problem as if the user cares which rtc should be rtc0, there are other ordering constraints being imposed such as a symlink to the "best" rtc device...

Quoted 7 lines
Quoted 4 lines

Indeed, this patch did not help my situation at all.

I think my problem is that of post-install package scripts (hence 'Configuring ...') not being run until quite late.

Looking at the pre-run image, I see that there is /etc/rcS.d/S98configure which runs these scripts. Is there any reason I can't move it earlier?

Found it:
ipk systems - meta/recipes-devtools/opkg/opkg_0.1.8.bb rpm systems - meta/classes/rootfs_rpm.bbclass

Note: the ipk version is quasi-configurable, the rpm version hardwired at 98. Since these are package install scripts, which presumable could have been run at image creation time but needed to run on the target hardware, why put it off to so late? I would think that this should be done _first_, not _last_

Signature · 9 lines
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------

_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
#8 lore raw
Quoted 1 line · Mark

As for the rpm ordering this was preserved from an earlier version. If there is a more appropriate place to run the late configuration scripts, let's move it. I think that it's likely a good place to move it to soon after the filesystem has been mounted RW. Do any of the scripts normally require networking or other system resources?

Hard to say what's perfect, but I certainly don't believe that they need
to be put off to the very last. In any case, I think the best thing is
to make it easily adjustable, per my patch.

Can we please keep this discussion on the Poky list where it started? It seems that OE (and maybe OE-core) handle this differently - I've not looked in depth - and I'm mostly interested in getting my Poky builds healthy.

Quoted 54 lines · Gary Thomas
Quoted 44 lines · Gary Thomas
Quoted 19 lines · Gary Thomas
Quoted 18 lines · Richard Purdie
Quoted 16 lines · Koen Kooi
Quoted 11 lines

Op 8 apr 2011, om 15:20 heeft Gary Thomas het volgende geschreven:

Quoted 7 lines

I have a Poky image which uses a number of kernel modules. For whatever reason, the raw image has not had the modules configured (no /lib/modules/.../modules.dep) This file is created by 'update-modules' but that is run too late in the boot process. The problem is that other code, e.g. I'm using iptables via modules, requires the modules be configured early and this fails. If I reboot (after 'update-modules' has run), everything is fine.

Sound like you need http://patches.openembedded.org/patch/1917/

To be honest that sounds like a more fundamental problem as if the user cares which rtc should be rtc0, there are other ordering constraints being imposed such as a symlink to the "best" rtc device...

Quoted 7 lines
Quoted 4 lines

Indeed, this patch did not help my situation at all.

I think my problem is that of post-install package scripts (hence 'Configuring ...') not being run until quite late.

Looking at the pre-run image, I see that there is /etc/rcS.d/S98configure which runs these scripts. Is there any reason I can't move it earlier?

Found it:
ipk systems - meta/recipes-devtools/opkg/opkg_0.1.8.bb rpm systems - meta/classes/rootfs_rpm.bbclass

Note: the ipk version is quasi-configurable, the rpm version hardwired at 98. Since these are package install scripts, which presumable could have been run at image creation time but needed to run on the target hardware, why put it off to so late? I would think that this should be done _first_, not _last_

--
------------------------------------------------------------
Gary Thomas | Consulting for the
MLB Associates | Embedded world
------------------------------------------------------------

Quoted 4 lines

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

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

Signature · 4 lines
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------