Patchwork [v3] rootfs_ipk bbclass: special-case base-passwd preinst to run first

login
register
mail settings
Submitter Koen Kooi
Date Nov. 4, 2011, 11:44 a.m.
Message ID <1320407079-24810-1-git-send-email-koen@dominion.thruhere.net>
Download mbox | patch
Permalink /patch/14263/
State Accepted
Commit d6793165feb26c51b5f19ad1e6d1a4099878e879
Headers show

Comments

Koen Kooi - Nov. 4, 2011, 11:44 a.m.
Preinst are run alphabetically which breaks when e.g. avahi-daemon needs /etc/passwd present.

Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
---
 meta/classes/rootfs_ipk.bbclass |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
Richard Purdie - Nov. 4, 2011, 3:45 p.m.
On Fri, 2011-11-04 at 12:44 +0100, Koen Kooi wrote:
> Preinst are run alphabetically which breaks when e.g. avahi-daemon needs /etc/passwd present.
> 
> Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
> ---
>  meta/classes/rootfs_ipk.bbclass |    6 ++++++
>  1 files changed, 6 insertions(+), 0 deletions(-)

I've merged this to master. I'm not particularly happy about it but
right now I can't see a good way to fix this short/medium term.

Saul: We'd better check if the rpm rootfs class needs this help

Cheers,

Richard
Koen Kooi - Nov. 4, 2011, 4:09 p.m.
Op 4 nov. 2011, om 16:45 heeft Richard Purdie het volgende geschreven:

> On Fri, 2011-11-04 at 12:44 +0100, Koen Kooi wrote:
>> Preinst are run alphabetically which breaks when e.g. avahi-daemon needs /etc/passwd present.
>> 
>> Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
>> ---
>> meta/classes/rootfs_ipk.bbclass |    6 ++++++
>> 1 files changed, 6 insertions(+), 0 deletions(-)
> 
> I've merged this to master. I'm not particularly happy about it but
> right now I can't see a good way to fix this short/medium term.

RP and discussed this and we're both not happy with it, but no viable other options short/medium term. The idea is to see if we can have opkg run all the preinsts since opkg does dependency resolving nowadays.

regards,

Koen
Mark Hatle - Nov. 4, 2011, 4:23 p.m.
One way to possibly address this is to create a distribution image creation
policy.  (That is how most of the distributions I'm aware of do it..
desktop/server and embedded.)

The policy is generally:

install passwd/group files
install filesystem hierarchy (it's second because it needs uid/gids)
install "everything else"

Something needs to set down the base set of components so the filesystem is sane
before we do the actual package installs and pre/post install scripts for each.

We could make this generic by defining "critical" or "base" or whatever name you
want packages and setting a specific order for these packages.  (The list needs
to kept small, there generally are one or two items that need to be done very
early.)

--Mark


On 11/4/11 11:09 AM, Koen Kooi wrote:
> 
> Op 4 nov. 2011, om 16:45 heeft Richard Purdie het volgende geschreven:
> 
>> On Fri, 2011-11-04 at 12:44 +0100, Koen Kooi wrote:
>>> Preinst are run alphabetically which breaks when e.g. avahi-daemon needs /etc/passwd present.
>>>
>>> Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
>>> ---
>>> meta/classes/rootfs_ipk.bbclass |    6 ++++++
>>> 1 files changed, 6 insertions(+), 0 deletions(-)
>>
>> I've merged this to master. I'm not particularly happy about it but
>> right now I can't see a good way to fix this short/medium term.
> 
> RP and discussed this and we're both not happy with it, but no viable other options short/medium term. The idea is to see if we can have opkg run all the preinsts since opkg does dependency resolving nowadays.
> 
> regards,
> 
> Koen
> 
> 
> 
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core

Patch

diff --git a/meta/classes/rootfs_ipk.bbclass b/meta/classes/rootfs_ipk.bbclass
index e02b816..3094c1a 100644
--- a/meta/classes/rootfs_ipk.bbclass
+++ b/meta/classes/rootfs_ipk.bbclass
@@ -77,6 +77,12 @@  fakeroot rootfs_ipk_do_rootfs () {
 	${ROOTFS_POSTINSTALL_COMMAND}
 	
 	runtime_script_required=0
+
+	# Base-passwd needs to run first to install /etc/passwd and friends
+	if [ -e ${IMAGE_ROOTFS}${opkglibdir}/info/base-passwd.preinst ] ; then
+		sh ${IMAGE_ROOTFS}${opkglibdir}/info/base-passwd.preinst
+	fi
+
 	for i in ${IMAGE_ROOTFS}${opkglibdir}/info/*.preinst; do
 		if [ -f $i ] && ! sh $i; then
 		     	runtime_script_required=1