All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: "David Nyström" <david.c.nystrom@gmail.com>
Cc: openembedded-core@lists.openembedded.org
Subject: Re: [PATCH] shadow: Create recipe nativesdk-shadow
Date: Wed, 25 Sep 2013 11:03:20 +0100	[thread overview]
Message-ID: <1380103400.18603.318.camel@ted> (raw)
In-Reply-To: <5241A215.4020501@gmail.com>

On Tue, 2013-09-24 at 16:30 +0200, David Nyström wrote:
> I'm have a question about this though.
> 
> diff --git a/meta/recipes-extended/shadow/shadow.inc 
> b/meta/recipes-extended/shadow/shadow.inc
> index 4df5e5e..75b0afc 100644
> --- a/meta/recipes-extended/shadow/shadow.inc
> +++ b/meta/recipes-extended/shadow/shadow.inc
> <snip>
> +pkg_postinst_${PN} () {
> +	if [ "x$D" != "x" ]; then
> +	  rootarg="--root=$D"
> +	else
> +	  rootarg=""
> +	fi
> +
> +	pwconv $rootarg
> +	grpconv $rootarg
> +}
> <snip>
> 
> This will introduce the postinstall hook for both ${BPN}-native and 
> ${BPN} ?. Before the change, the postinstall hook was activated only by 
> ${BPN} afaict. Tried removing it from native* through 
> pkg_postinst_${BPN}, but that does not seem to work.

Basically the postinst is ignored for the -native version. It never gets
packaged so isn't relevant. Adding in special cases for native for each
and every recipe would get ugly very quickly.

> Hmm, slightly off-topic, but when looking at the postinstalls:
> 
> shadow:
> cat /tmp/opkg-extract-574/CONTROL/postinst
> 	if [ "x$D" != "x" ]; then
> 	  rootarg="--root=$D"
> 	else
> 	  rootarg=""
> 	fi
> 
> 	pwconv $rootarg
> 	grpconv $rootarg
> 	update-alternatives --install /usr/bin/passwd passwd 
> /usr/bin/passwd.shadow 200
> 	update-alternatives --install /usr/bin/chfn chfn /usr/bin/chfn.shadow 200
> 	update-alternatives --install /usr/bin/newgrp newgrp 
> /usr/bin/newgrp.shadow 200
> 
> Above is not a problem since OPKG_OFFLINE_ROOT in update-alternatives 
> can be used to redirect symlink creation when creating a from a package 
> repo.
> 
> nativesdk-shadow:
> if [ "x$D" != "x" ]; then
> 	  rootarg="--root=$D"
> 	else
> 	  rootarg=""
> 	fi
> 
> 	pwconv $rootarg
> 	grpconv $rootarg
> 	update-alternatives --install 
> /opt/poky/1.4+snapshot/sysroots/x86_64-pokysdk-linux/usr/bin/passwd 
> passwd 
> /opt/poky/1.4+snapshot/sysroots/x86_64-pokysdk-linux/usr/bin/passwd.shadow 
> 200
> 	update-alternatives --install 
> /opt/poky/1.4+snapshot/sysroots/x86_64-pokysdk-linux/usr/bin/chfn chfn 
> /opt/poky/1.4+snapshot/sysroots/x86_64-pokysdk-linux/usr/bin/chfn.shadow 200
> 	update-alternatives --install 
> /opt/poky/1.4+snapshot/sysroots/x86_64-pokysdk-linux/usr/bin/newgrp 
> newgrp 
> /opt/poky/1.4+snapshot/sysroots/x86_64-pokysdk-linux/usr/bin/newgrp.shadow 
> 200
> 	update-alternatives --install 
> /opt/poky/1.4+snapshot/sysroots/x86_64-pokysdk-linux/usr/bin/chsh chsh 
> /opt/poky/1.4+snapshot/sysroots/x86_64-pokysdk-linux/usr/bin/chsh.shadow 200
> 
> Could we not add a "--root" option to update-alternatives like done to 
> update-rc.d instead of hardcoding paths or using envs.

nativesdk are built to run in that specific path. We're therefore not
installing them to some subdirectory where a root makes sense, the
prefix really was /opt/xxx. We then manipulate things later to make them
more relocatable.

> 
> Also, seems like ${sysconfdir} in the nativesdk-opkg postinstall expands to:
> 
> chmod 0755 $D${sysconfdir}/rcS.d/S${POSTINSTALL_INITPOSITION}run-postinsts
> chmod 0755 
> $D/opt/poky/1.4+snapshot/sysroots/x86_64-pokysdk-linux/etc/rcS.d/S98run-postinsts
> 
> Is this really expected behaviour ?

nativesdk postinstalls are probably badly handled at the moment. I
suspect if things can run at rootfs creation time they work out, if they
can't run then, they never happen at all. We don't have a "first boot"
of the sdk...

Cheers,

Richard



  reply	other threads:[~2013-09-25 10:03 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-23 16:33 [PATCHv3] makedevs: add nativesdk to BBCLASSEXTENDS David Nyström
2013-09-23 16:34 ` [PATCH] shadow: Create recipe nativesdk-shadow David Nyström
2013-09-23 18:01   ` Mark Hatle
2013-09-23 19:01     ` David Nystrom
2013-09-23 21:14       ` Richard Purdie
2013-09-24  8:25         ` Richard Purdie
2013-09-24 14:30           ` David Nyström
2013-09-25 10:03             ` Richard Purdie [this message]
2013-09-25 12:24               ` David Nyström
2013-09-23 16:34 ` [PATCHv2] libpam: Avoid host contamination issue w. libprelude David Nyström

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1380103400.18603.318.camel@ted \
    --to=richard.purdie@linuxfoundation.org \
    --cc=david.c.nystrom@gmail.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.