* postinst problem: module vs. update-rc.d
@ 2011-10-14 14:00 Steffen Sledz
2011-10-14 14:04 ` Phil Blundell
2011-10-14 14:08 ` Martin Jansa
0 siblings, 2 replies; 3+ messages in thread
From: Steffen Sledz @ 2011-10-14 14:00 UTC (permalink / raw)
To: openembedded-devel; +Cc: Dirk Nilius
We have a problem with a package that needs to install a kernel module and an initscript.
The recipe contains
inherit module update-rc.d
The generated postinst script is
#!/bin/sh
if [ -n "$D" ]; then
exit 1
else
depmod -a 2.6.24.7
update-modules || true
fi
if test "x$D" != "x"; then
OPT="-r $D"
else
OPT="-s"
fi
update-rc.d $OPT somescript start 90 S . stop 10 0 1 6 .
The 'exit 1' leads to an error if $D contains a nonzero length string (what is the case in the OE image creation step at the build host) and suppresses the execution of the second (update-rc.d) part.
Because of this error the postinst is run a second time when the target device boots the first time ("opkg-cl configure" from /etc/rcS.d/S40configure).
The problem is that the update-rc.d execution (and therefor the creation of the new symlink into rcS.d) is done from within rcS itself. So the rcS.d/S90somescript will *not* be executed at this boot. :(
We see two possible solutions.
A) Don't use "inherit module update-rc.d" but write the pkg_postint ourselfs.
B) Create two packages (one for the module, one for the initscript) with a runtime dependency.
I don't like both of them. Any other ideas? Is it possible to force the order of postinst fragments (update-rc.d code before module code)?
Regards,
Steffen
--
DResearch Fahrzeugelektronik GmbH
Otto-Schmirgal-Str. 3, 10319 Berlin, Germany
Tel: +49 30 515932-237 mailto:sledz@dresearch-fe.de
Fax: +49 30 515932-299
Geschäftsführer: Dr. Michael Weber, Werner Mögle;
Amtsgericht Berlin Charlottenburg; HRB 130120 B;
Ust.-IDNr. DE273952058
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: postinst problem: module vs. update-rc.d
2011-10-14 14:00 postinst problem: module vs. update-rc.d Steffen Sledz
@ 2011-10-14 14:04 ` Phil Blundell
2011-10-14 14:08 ` Martin Jansa
1 sibling, 0 replies; 3+ messages in thread
From: Phil Blundell @ 2011-10-14 14:04 UTC (permalink / raw)
To: openembedded-devel; +Cc: Dirk Nilius
On Fri, 2011-10-14 at 16:00 +0200, Steffen Sledz wrote:
> The 'exit 1' leads to an error if $D contains a nonzero length string (what is the case in the OE image creation step at the build host) and suppresses the execution of the second (update-rc.d) part.
>
> Because of this error the postinst is run a second time when the target device boots the first time ("opkg-cl configure" from /etc/rcS.d/S40configure).
>
> The problem is that the update-rc.d execution (and therefor the creation of the new symlink into rcS.d) is done from within rcS itself. So the rcS.d/S90somescript will *not* be executed at this boot. :(
>
> We see two possible solutions.
>
> A) Don't use "inherit module update-rc.d" but write the pkg_postint ourselfs.
>
> B) Create two packages (one for the module, one for the initscript) with a runtime dependency.
>
> I don't like both of them. Any other ideas? Is it possible to force the order of postinst fragments (update-rc.d code before module code)?
I think either update-rc.d or update-rc.d.bbclass should probably invoke
the script as "start" when it installs it for the first time.
p.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: postinst problem: module vs. update-rc.d
2011-10-14 14:00 postinst problem: module vs. update-rc.d Steffen Sledz
2011-10-14 14:04 ` Phil Blundell
@ 2011-10-14 14:08 ` Martin Jansa
1 sibling, 0 replies; 3+ messages in thread
From: Martin Jansa @ 2011-10-14 14:08 UTC (permalink / raw)
To: openembedded-devel; +Cc: Dirk Nilius
[-- Attachment #1: Type: text/plain, Size: 2019 bytes --]
On Fri, Oct 14, 2011 at 04:00:04PM +0200, Steffen Sledz wrote:
> We have a problem with a package that needs to install a kernel module and an initscript.
>
> The recipe contains
>
> inherit module update-rc.d
>
> The generated postinst script is
>
> #!/bin/sh
> if [ -n "$D" ]; then
> exit 1
> else
> depmod -a 2.6.24.7
> update-modules || true
> fi
> if test "x$D" != "x"; then
> OPT="-r $D"
> else
> OPT="-s"
> fi
> update-rc.d $OPT somescript start 90 S . stop 10 0 1 6 .
>
> The 'exit 1' leads to an error if $D contains a nonzero length string (what is the case in the OE image creation step at the build host) and suppresses the execution of the second (update-rc.d) part.
>
> Because of this error the postinst is run a second time when the target device boots the first time ("opkg-cl configure" from /etc/rcS.d/S40configure).
>
> The problem is that the update-rc.d execution (and therefor the creation of the new symlink into rcS.d) is done from within rcS itself. So the rcS.d/S90somescript will *not* be executed at this boot. :(
>
> We see two possible solutions.
>
> A) Don't use "inherit module update-rc.d" but write the pkg_postint ourselfs.
>
> B) Create two packages (one for the module, one for the initscript) with a runtime dependency.
>
> I don't like both of them. Any other ideas? Is it possible to force the order of postinst fragments (update-rc.d code before module code)?
>
> Regards,
> Steffen
BTW: there is another problem with update-modules:
SHR root@gjama ~ $ opkg files syslog-ng | grep modules.conf
/etc/modules.conf
SHR root@gjama ~ $ update-modules
Error: the current /etc/modules.conf is not automatically generated.
Use "update-modules force" to force (re)generation.
so if someone is using syslog-ng, than kernel-module-* or any "inherit
module" package won't update ie autoloads properly..
--
Martin 'JaMa' Jansa jabber: Martin.Jansa@gmail.com
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 205 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-10-14 14:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-14 14:00 postinst problem: module vs. update-rc.d Steffen Sledz
2011-10-14 14:04 ` Phil Blundell
2011-10-14 14:08 ` Martin Jansa
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.