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

Submitted by Petr Štetiar on April 4, 2011, 10:12 p.m.

Details

Message ID 1301955176-14829-1-git-send-email-ynezz@true.cz
State New, archived
Headers show

Commit Message

Petr Štetiar April 4, 2011, 10:12 p.m.
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

Signed-off-by: Petr Štetiar <ynezz@true.cz>
---
 recipes/modutils/modutils-initscripts.bb |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/recipes/modutils/modutils-initscripts.bb b/recipes/modutils/modutils-initscripts.bb
index 07f4810..797acb3 100644
--- a/recipes/modutils/modutils-initscripts.bb
+++ b/recipes/modutils/modutils-initscripts.bb
@@ -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
 

Comments

Andrea Adami April 12, 2011, 11:11 p.m.
> Signed-off-by: Petr Štetiar <ynezz@true.cz>
> ---
>  recipes/modutils/modutils-initscripts.bb |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/recipes/modutils/modutils-initscripts.bb b/recipes/modutils/modutils-initscripts.bb
> index 07f4810..797acb3 100644
> --- a/recipes/modutils/modutils-initscripts.bb
> +++ b/recipes/modutils/modutils-initscripts.bb
> @@ -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
>
> --
> 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
Andrea Adami April 13, 2011, 9:23 a.m.
> 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
Khem Raj April 23, 2011, 9:31 p.m.
On Mon, Apr 4, 2011 at 3:12 PM, Petr Štetiar <ynezz@true.cz> wrote:
> 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
>
> Signed-off-by: Petr Štetiar <ynezz@true.cz>

Looks ok.

Acked-by: Khem Raj <raj.khem@gmail.com>

> ---
>  recipes/modutils/modutils-initscripts.bb |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/recipes/modutils/modutils-initscripts.bb b/recipes/modutils/modutils-initscripts.bb
> index 07f4810..797acb3 100644
> --- a/recipes/modutils/modutils-initscripts.bb
> +++ b/recipes/modutils/modutils-initscripts.bb
> @@ -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
>
> --
> 1.7.1
>
>
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
>
Khem Raj April 23, 2011, 9:35 p.m.
On Wed, Apr 13, 2011 at 2:23 AM, Andrea Adami <andrea.adami@gmail.com> wrote:
>> 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...

yeah most of old recipes started it at 03 except 1
if its expected at 04 please change it
>
>
> Andrea
>
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
>