From: Phil Blundell <philb@gnu.org>
To: Patches and discussions about the oe-core layer
<openembedded-core@lists.openembedded.org>
Subject: Re: [PATCH 2/7] shadow: add a -native recipe with customized utilities
Date: Fri, 02 Sep 2011 10:50:56 +0100 [thread overview]
Message-ID: <1314957057.19905.224.camel@phil-desktop> (raw)
In-Reply-To: <1314914360.5939.574.camel@rex>
[-- Attachment #1: Type: text/plain, Size: 2130 bytes --]
On Thu, 2011-09-01 at 22:59 +0100, Richard Purdie wrote:
> The latter sounds like what we'll need to do. I haven't looked at shadow
> to see what kind of finessing is required though...
Fixing the immediate problem with shadow turned out to be rather
straightforward, see attached. However, with this done, I now encounter
two new issues.
1. the logic around $D in useradd.bbclass seems to be backwards to me
(and, empirically, isn't working because the supposedly-created users
are not showing up in my rootfs). Specifically, it does:
useradd_preinst () {
OPT=""
SYSROOT=""
if test "x$D" != "x"; then
# Installing into a sysroot
SYSROOT="${STAGING_DIR_TARGET}"
OPT="--root ${STAGING_DIR_TARGET}"
[...]
useradd_sysroot () {
export PSEUDO="${STAGING_DIR_NATIVE}/usr/bin/pseudo"
export PSEUDO_LOCALSTATEDIR="${STAGING_DIR_TARGET}/var/pseudo"
# Explicitly set $D since it isn't set to anything
# before do_install
D=${D}
useradd_preinst
}
It looks to me as though the code in useradd_preinst() should be using
SYSROOT="$D" (and likewise for OPT), and useradd_sysroot() should be
setting D=${STAGING_DIR_TARGET}. But maybe there is some clever thing
going on here that I'm not properly understanding.
2. during rootfs construction, the script ordering is wrong. All the
preinsts run before all the postinsts, which has always been a bit wrong
but hasn't caused too much of a problem in the past. However,
crucially, this means that the useradd_preinst() runs before
base-passwd's postinst and hence /etc/passwd doesn't exist at the point
where useradd tries to modify it.
I can't think of any reasonable fix for (2) other than to teach
rootfs_ipk how to track package dependencies and run the scripts in the
right order. I guess that wouldn't be impossible by any means but
trying to do it in a shell script is not a prospect that fills me with a
lot of enthusiasm. Any better suggestions?
p.
[-- Attachment #2: shadow.diff --]
[-- Type: text/x-patch, Size: 1053 bytes --]
diff --git a/meta/recipes-extended/shadow/shadow_4.1.4.3.bb b/meta/recipes-extended/shadow/shadow_4.1.4.3.bb
index 728b8e5..c5a6848 100644
--- a/meta/recipes-extended/shadow/shadow_4.1.4.3.bb
+++ b/meta/recipes-extended/shadow/shadow_4.1.4.3.bb
@@ -9,7 +9,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=08c553a87d4e51bbed50b20e0adcaede \
DEPENDS = "${@base_contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
RDEPENDS_${PN} = "${@base_contains('DISTRO_FEATURES', 'pam', '${PAM_PLUGINS}', '', d)}"
-PR = "r3"
+PR = "r4"
SRC_URI = "http://pkg-shadow.alioth.debian.org/releases/${BPN}-${PV}.tar.bz2 \
file://login_defs_pam.sed \
@@ -122,12 +122,13 @@ pkg_postinst_${PN} () {
update-alternatives --install ${base_sbindir}/vipw vipw vipw.${PN} 200
update-alternatives --install ${base_sbindir}/vigr vigr vigr.${PN} 200
- if [ "x$D" != "x" ]; then
- exit 1
- fi
-
- pwconv
- grpconv
+ if [ -n "$D" ]; then
+ pwconv -R $D
+ grpconv -R $D
+ else
+ pwconv
+ grpconv
+ fi
}
pkg_prerm_${PN} () {
next prev parent reply other threads:[~2011-09-02 9:55 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-31 19:53 [PATCH 0/7] User/group creation at preinstall Scott Garman
2011-05-31 18:45 ` [poky] " Koen Kooi
2011-05-31 19:06 ` Saul Wold
2011-05-31 19:51 ` Scott Garman
2011-05-31 19:57 ` Otavio Salvador
2011-05-31 21:16 ` Mark Hatle
2011-05-31 21:27 ` Scott Garman
2011-05-31 21:51 ` Richard Purdie
2011-05-31 21:25 ` Richard Purdie
2011-05-31 19:53 ` [PATCH 1/7] shadow: recipe and patch cleanup Scott Garman
2011-05-31 19:53 ` [PATCH 2/7] shadow: add a -native recipe with customized utilities Scott Garman
2011-06-01 9:47 ` Phil Blundell
2011-06-01 12:34 ` Martyn Welch
2011-06-01 13:42 ` Phil Blundell
2011-06-01 17:43 ` Scott Garman
2011-06-01 21:05 ` Mark Hatle
2011-06-02 11:19 ` Phil Blundell
2011-09-01 14:46 ` Phil Blundell
2011-09-01 16:41 ` Phil Blundell
2011-09-01 16:54 ` Mark Hatle
2011-09-01 16:58 ` Phil Blundell
2011-09-01 17:25 ` Mark Hatle
2011-09-01 19:44 ` Phil Blundell
2011-09-01 21:59 ` Richard Purdie
2011-09-02 0:02 ` Mark Hatle
2011-09-02 7:15 ` Phil Blundell
2011-09-02 9:50 ` Phil Blundell [this message]
2011-09-02 14:03 ` Richard Purdie
2011-09-02 18:43 ` Phil Blundell
2011-09-02 19:17 ` Mark Hatle
2011-05-31 19:53 ` [PATCH 3/7] base-passwd: add -cross recipe with default login.defs Scott Garman
2011-05-31 19:53 ` [PATCH 4/7] useradd.bbclass: new class for managing user/group permissions Scott Garman
2011-05-31 19:53 ` [PATCH 5/7] useradd-example: example recipe for using inherit useradd Scott Garman
2011-05-31 19:53 ` [PATCH 6/7] bitbake.conf: set PSEUDO_PASSWD within FAKEROOTENV Scott Garman
2011-05-31 19:53 ` [PATCH 7/7] package_rpm.bbclass: make RPM use on-disk permissions Scott Garman
-- strict thread matches above, loose matches on Subject: below --
2011-06-02 23:50 [PATCH 0/7] User/group creation at preinstall v2 Scott Garman
2011-06-02 23:50 ` [PATCH 2/7] shadow: add a -native recipe with customized utilities Scott Garman
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=1314957057.19905.224.camel@phil-desktop \
--to=philb@gnu.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox