Skip to contentSkip to conversation

modutils-initscripts: fix wrong order of module loading happening in udev

RFC PATCH In review Petr Štetiar 4 participants 7 messages Apr 4, 2011 – May 3, 2011

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 modutils-initscripts: fix wrong order of module loading happening in udev

In the current state, udev init script is loaded as 3rd and modutils.sh as 20th, so udevadm called in udev init script loads all kernel modules in some unpredictable order, not honoring in any way specified order of modules in /etc/modules. This causes some troubles mainly in the first boot. So to fix this we now move loading of the kernel modules just before we exec udev init script. Example of the current state:

	Starting udev
	rtc-m48t86 rtc-m48t86: rtc core: registered m48t86 as rtc0
	rtc-m48t86 rtc-m48t86: battery ok
	ep93xx-rtc ep93xx-rtc: rtc core: registered ep93xx-rtc as rtc1

	root@ts72xx:~# cat /etc/modules
	rtc-ep93xx
	ohci-hcd
	ts72xx_sbcinfo
	rtc-m48t86

As you can guess, this is really wrong behaviour, because I've rtc1 as the main time source for my system.

	root@ts72xx:~# cat /etc/default/hwclock
	HWCLOCKACCESS=yes
	HWCLOCKDEVICE=/dev/rtc1

Expected behaviour with this patch applied:

Please wait: booting...
ep93xx-rtc ep93xx-rtc: rtc core: registered ep93xx-rtc as rtc0
usbcore: registered new device driver usb
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
...
rtc-m48t86 rtc-m48t86: rtc core: registered m48t86 as rtc1 rtc-m48t86 rtc-m48t86: battery ok
Starting udev

---
 recipes/modutils/modutils-initscripts.bb |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
recipes/modutils/modutils-initscripts.bb +2 -2
index 07f4810..797acb3 100644
@@ -2,10 +2,10 @@ SECTION = "base"
 DESCRIPTION = "modutils configuration files"
 LICENSE = "PD"
 SRC_URI = "file://modutils.sh"
-PR = "r3"
+PR = "r4"
 
 INITSCRIPT_NAME = "modutils.sh"
-INITSCRIPT_PARAMS = "start 20 S ."
+INITSCRIPT_PARAMS = "start 2 S ."
 
 inherit update-rc.d
 
Signature · 1 line
1.7.1
#1 lore raw
Quoted 20 lines

---
 recipes/modutils/modutils-initscripts.bb |    4 ++--

 1 files changed, 2 insertions(+), 2 deletions(-)
recipes/modutils/modutils-initscripts.bb +0 -0
index 07f4810..797acb3 100644
@@ -2,10 +2,10 @@ SECTION = "base"

 DESCRIPTION = "modutils configuration files"
 LICENSE = "PD"
 SRC_URI = "file://modutils.sh"

recipes/modutils/modutils-initscripts.bb +1 -1
-PR = "r3"
+PR = "r4"

 INITSCRIPT_NAME = "modutils.sh"

recipes/modutils/modutils-initscripts.bb +1 -1
-INITSCRIPT_PARAMS = "start 20 S ."
+INITSCRIPT_PARAMS = "start 2 S ."
Quoted 4 lines

 inherit update-rc.d

--
1.7.1

I tested that on minimal-image and on my c7x0 machine it helps. Just to be sure, I moved udev to 04 after 03 sysfs.

I'll do further tests on current images.

Regards

Andrea

#2 lore raw
Quoted 1 line

Just to be sure, I moved udev to 04 after 03 sysfs.

I'll add that /initscripts_1.0.bb expects udev as S04

...

	# udev will run as S04 if installed
	ln -sf		../init.d/sysfs.sh	${D}${sysconfdir}/rcS.d/S03sysfs
...

but udev starts as S03 since commit 523f22b938703b56a823fa9e9c577869669ddb82 (udev: Use udev.inc and add udevadm to udev pacakge instead of udev-utils)

Seems udev needs a fix...

Andrea

#3 lore raw
Quoted 5 lines · Andrea Adami
Quoted 1 line

Just to be sure, I moved udev to 04 after 03 sysfs.

I'll add that /initscripts_1.0.bb expects udev as S04

...

Quoted 8 lines
       # udev will run as S04 if installed
       ln -sf          ../init.d/sysfs.sh      ${D}${sysconfdir}/rcS.d/S03sysfs
...

but udev starts as S03 since commit 523f22b938703b56a823fa9e9c577869669ddb82 (udev: Use udev.inc and add udevadm to udev pacakge instead of udev-utils)

Seems udev needs a fix...

yeah most of old recipes started it at 03 except 1 if its expected at 04 please change it

Quoted 9 lines

Andrea

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

Acked-by on v1 1/1
#4 lore raw
In reply to Petr Štetiar
Quoted 36 lines · Petr Štetiar

In the current state, udev init script is loaded as 3rd and modutils.sh as 20th, so udevadm called in udev init script loads all kernel modules in some unpredictable order, not honoring in any way specified order of modules in /etc/modules. This causes some troubles mainly in the first boot. So to fix this we now move loading of the kernel modules just before we exec udev init script. Example of the current state:

       Starting udev
       rtc-m48t86 rtc-m48t86: rtc core: registered m48t86 as rtc0 rtc-m48t86 rtc-m48t86: battery ok
       ep93xx-rtc ep93xx-rtc: rtc core: registered ep93xx-rtc as rtc1

       root@ts72xx:~# cat /etc/modules
       rtc-ep93xx
       ohci-hcd
       ts72xx_sbcinfo
       rtc-m48t86

As you can guess, this is really wrong behaviour, because I've rtc1 as the main time source for my system.

       root@ts72xx:~# cat /etc/default/hwclock
       HWCLOCKACCESS=yes
       HWCLOCKDEVICE=/dev/rtc1

Expected behaviour with this patch applied:

       Please wait: booting...
       ep93xx-rtc ep93xx-rtc: rtc core: registered ep93xx-rtc as rtc0
       usbcore: registered new device driver usb
       ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
       ...
       rtc-m48t86 rtc-m48t86: rtc core: registered m48t86 as rtc1 rtc-m48t86 rtc-m48t86: battery ok
       Starting udev

Quoted 1 line

Looks ok.

Quoted 30 lines

---
 recipes/modutils/modutils-initscripts.bb |    4 ++--

 1 files changed, 2 insertions(+), 2 deletions(-)
recipes/modutils/modutils-initscripts.bb +0 -0
index 07f4810..797acb3 100644
@@ -2,10 +2,10 @@ SECTION = "base"

 DESCRIPTION = "modutils configuration files"
 LICENSE = "PD"
 SRC_URI = "file://modutils.sh"

recipes/modutils/modutils-initscripts.bb +1 -1
-PR = "r3"
+PR = "r4"

 INITSCRIPT_NAME = "modutils.sh"

recipes/modutils/modutils-initscripts.bb +1 -1
-INITSCRIPT_PARAMS = "start 20 S ."
+INITSCRIPT_PARAMS = "start 2 S ."

 inherit update-rc.d

--
1.7.1

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

#5 lore raw
Quoted 58 lines · Khem Raj
Quoted 36 lines · Petr Štetiar

In the current state, udev init script is loaded as 3rd and modutils.sh as 20th, so udevadm called in udev init script loads all kernel modules in some unpredictable order, not honoring in any way specified order of modules in /etc/modules. This causes some troubles mainly in the first boot. So to fix this we now move loading of the kernel modules just before we exec udev init script. Example of the current state:

        Starting udev
        rtc-m48t86 rtc-m48t86: rtc core: registered m48t86 as rtc0
        rtc-m48t86 rtc-m48t86: battery ok
        ep93xx-rtc ep93xx-rtc: rtc core: registered ep93xx-rtc as rtc1

        root@ts72xx:~# cat /etc/modules
        rtc-ep93xx
        ohci-hcd
        ts72xx_sbcinfo
        rtc-m48t86

As you can guess, this is really wrong behaviour, because I've rtc1 as the main time source for my system.

        root@ts72xx:~# cat /etc/default/hwclock
        HWCLOCKACCESS=yes
        HWCLOCKDEVICE=/dev/rtc1

Expected behaviour with this patch applied:

Please wait: booting...
ep93xx-rtc ep93xx-rtc: rtc core: registered ep93xx-rtc as rtc0
usbcore: registered new device driver usb
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
...
rtc-m48t86 rtc-m48t86: rtc core: registered m48t86 as rtc1 rtc-m48t86 rtc-m48t86: battery ok
Starting udev

Quoted 1 line

Looks ok.

Quoted 15 lines
---
  recipes/modutils/modutils-initscripts.bb |    4 ++--
  1 files changed, 2 insertions(+), 2 deletions(-)
recipes/modutils/modutils-initscripts.bb +1 -1
index 07f4810..797acb3 100644
@@ -2,10 +2,10 @@ SECTION = "base"
  DESCRIPTION = "modutils configuration files"
  LICENSE = "PD"
  SRC_URI = "file://modutils.sh"
-PR = "r3"
+PR = "r4"
 
Quoted 8 lines
Quoted 8 lines
recipes/modutils/modutils-initscripts.bb +1 -2
  INITSCRIPT_NAME = "modutils.sh"
-INITSCRIPT_PARAMS = "start 20 S ."
+INITSCRIPT_PARAMS = "start 2 S ."
 
  inherit update-rc.d
 
--

1.7.1

I'm not clear why this information is duplicated, but shouldn't these changes also be applied to modutils/modutils_2.4.27.bb as well?

Something like this:

recipes/modutils/modutils_2.4.27.bb +2 -2
index 791707c..ef3f152 100644
@@ -3,7 +3,7 @@ DESCRIPTION = "These utilities are intended to make a Linux modular kernel \
 manageable for all users, administrators and distribution maintainers."
 LICENSE = "GPLv2"
 DEPENDS = "bison-native"
-PR = "r8"
+PR = "r9"
 
 SRC_URI = "${KERNELORG_MIRROR}/pub/linux/utils/kernel/modutils/v2.4/modutils-${PV}.tar.bz2 \
            file://lex.l.diff \
@@ -46,7 +46,7 @@ if test -n "$D"; then
                done
        fi
 fi
-update-rc.d $D modutils.sh start 20 S .
+update-rc.d $D modutils.sh start 2 S .
 }
 
 pkg_prerm_modutils () {
Signature · 4 lines
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------