* [PATCHv3] makedevs: add nativesdk to BBCLASSEXTENDS
@ 2013-09-23 16:33 David Nyström
2013-09-23 16:34 ` [PATCH] shadow: Create recipe nativesdk-shadow David Nyström
2013-09-23 16:34 ` [PATCHv2] libpam: Avoid host contamination issue w. libprelude David Nyström
0 siblings, 2 replies; 10+ messages in thread
From: David Nyström @ 2013-09-23 16:33 UTC (permalink / raw)
To: openembedded-core
This is a first in a series of patches to add items
to the nativesdk toolchain tarball.
Many of which are Yocto specific and needed to create a
rootfs with pre and post install hooks successfully run,
using only the toolchain tarball.
End goal is to create a sandbox where _users_ of a Yocto
based distribution can customize a rootfs from a package feed
with their package manager of choice.
Signed-off-by: David Nyström <david.nystrom@enea.com>
---
meta/recipes-devtools/makedevs/makedevs_1.0.0.bb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meta/recipes-devtools/makedevs/makedevs_1.0.0.bb b/meta/recipes-devtools/makedevs/makedevs_1.0.0.bb
index 2b9fd37..e6860f0 100644
--- a/meta/recipes-devtools/makedevs/makedevs_1.0.0.bb
+++ b/meta/recipes-devtools/makedevs/makedevs_1.0.0.bb
@@ -19,4 +19,4 @@ do_install() {
install -m 0755 ${S}/makedevs ${D}${base_sbindir}/makedevs
}
-BBCLASSEXTEND = "native"
+BBCLASSEXTEND = "native nativesdk"
--
1.8.3.2
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH] shadow: Create recipe nativesdk-shadow
2013-09-23 16:33 [PATCHv3] makedevs: add nativesdk to BBCLASSEXTENDS David Nyström
@ 2013-09-23 16:34 ` David Nyström
2013-09-23 18:01 ` Mark Hatle
2013-09-23 16:34 ` [PATCHv2] libpam: Avoid host contamination issue w. libprelude David Nyström
1 sibling, 1 reply; 10+ messages in thread
From: David Nyström @ 2013-09-23 16:34 UTC (permalink / raw)
To: openembedded-core
This is a second in a series of patches to enable
offline rootfs creation from a package repository.
Some postinstall cmds are Yocto specific and needed to create a
rootfs with pre and post install hooks successfully run,
using only the toolchain tarball + a package repo.
End goal is to create a sandbox where _users_ of a Yocto
based distribution can customize a rootfs from a package feed
with their package manager of choice.
With this patch, I can successfully create packagegroup-core-boot
with only the toolchain tarball(OPKG). More fixes for a few postinstall
hooks outside of packagegroup-core-boot will come next.
Signed-off-by: David Nyström <david.nystrom@enea.com>
---
.../nativesdk-packagegroup-sdk-host.bb | 1 +
.../shadow/nativesdk-shadow_4.1.4.3.bb | 62 ++++++++++++++++++++++
2 files changed, 63 insertions(+)
create mode 100644 meta/recipes-extended/shadow/nativesdk-shadow_4.1.4.3.bb
diff --git a/meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bb b/meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bb
index 84fb95d..5a64934 100644
--- a/meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bb
+++ b/meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bb
@@ -20,6 +20,7 @@ RDEPENDS_${PN} = "\
nativesdk-libtool \
nativesdk-autoconf \
nativesdk-automake \
+ ${@base_contains('DISTRO_FEATURES', 'pam', 'nativesdk-shadow', '', d)} \
"
RDEPENDS_${PN}_darwin = "\
diff --git a/meta/recipes-extended/shadow/nativesdk-shadow_4.1.4.3.bb b/meta/recipes-extended/shadow/nativesdk-shadow_4.1.4.3.bb
new file mode 100644
index 0000000..22f4cf3
--- /dev/null
+++ b/meta/recipes-extended/shadow/nativesdk-shadow_4.1.4.3.bb
@@ -0,0 +1,62 @@
+SUMMARY = "Tools to change and administer password and group data"
+DESCRIPTION = "Tools to change and administer password and group data"
+HOMEPAGE = "http://pkg-shadow.alioth.debian.org"
+BUGTRACKER = "https://alioth.debian.org/tracker/?group_id=30580"
+SECTION = "base utils"
+LICENSE = "BSD | Artistic-1.0"
+LIC_FILES_CHKSUM = "file://COPYING;md5=08c553a87d4e51bbed50b20e0adcaede \
+ file://src/passwd.c;beginline=8;endline=30;md5=d83888ea14ae61951982d77125947661"
+
+PR = "r8"
+
+inherit autotools gettext nativesdk
+
+SRC_URI = "http://pkg-shadow.alioth.debian.org/releases/shadow-${PV}.tar.bz2 \
+ file://shadow.automake-1.11.patch \
+ file://shadow-4.1.3-dots-in-usernames.patch \
+ file://shadow-4.1.4.2-env-reset-keep-locale.patch \
+ file://add_root_cmd_options.patch \
+ file://disable-syslog.patch \
+ file://useradd.patch \
+ file://shadow_fix_for_automake-1.12.patch \
+ file://add_root_cmd_groupmems.patch \
+ "
+
+SRC_URI[md5sum] = "b8608d8294ac88974f27b20f991c0e79"
+SRC_URI[sha256sum] = "633f5bb4ea0c88c55f3642c97f9d25cbef74f82e0b4cf8d54e7ad6f9f9caa778"
+
+S = "${WORKDIR}/shadow-${PV}"
+
+EXTRA_OECONF += "--without-audit \
+ --without-libcrack \
+ --without-libpam \
+ --without-selinux \
+ --without-nscd"
+
+do_install() {
+ oe_runmake DESTDIR="${D}" sbindir="${base_sbindir}" usbindir="${sbindir}" install
+
+ # Info dir listing isn't interesting at this point so remove it if it exists.
+ if [ -e "${D}${infodir}/dir" ]; then
+ rm -f ${D}${infodir}/dir
+ fi
+
+ # Enable CREATE_HOME by default.
+ sed -i 's/#CREATE_HOME/CREATE_HOME/g' ${D}${sysconfdir}/login.defs
+
+ # As we are on an embedded system, ensure the users mailbox is in
+ # ~/ not /var/spool/mail by default, as who knows where or how big
+ # /var is. The system MDA will set this later anyway.
+ sed -i 's/MAIL_DIR/#MAIL_DIR/g' ${D}${sysconfdir}/login.defs
+ sed -i 's/#MAIL_FILE/MAIL_FILE/g' ${D}${sysconfdir}/login.defs
+
+ # Disable checking emails.
+ sed -i 's/MAIL_CHECK_ENAB/#MAIL_CHECK_ENAB/g' ${D}${sysconfdir}/login.defs
+
+ # Now we don't have a mail system. Disable mail creation for now.
+ sed -i 's:/bin/bash:/bin/sh:g' ${D}${sysconfdir}/default/useradd
+ sed -i '/^CREATE_MAIL_SPOOL/ s:^:#:' ${D}${sysconfdir}/default/useradd
+
+ # Use users group by default
+ sed -i 's,^GROUP=1000,GROUP=100,g' ${D}${sysconfdir}/default/useradd
+}
--
1.8.3.2
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCHv2] libpam: Avoid host contamination issue w. libprelude
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 16:34 ` David Nyström
1 sibling, 0 replies; 10+ messages in thread
From: David Nyström @ 2013-09-23 16:34 UTC (permalink / raw)
To: openembedded-core
Since we dont use prelude in OE, we just disable autodetection of
prelude in the libpam configuration.
Seems like an old bug:
http://lists.openembedded.org/pipermail/openembedded-devel/2012-March/083804.html
Signed-off-by: David Nyström <david.nystrom@enea.com>
---
meta/recipes-extended/pam/libpam_1.1.6.bb | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/meta/recipes-extended/pam/libpam_1.1.6.bb b/meta/recipes-extended/pam/libpam_1.1.6.bb
index f7493c5..c9bdcb0 100644
--- a/meta/recipes-extended/pam/libpam_1.1.6.bb
+++ b/meta/recipes-extended/pam/libpam_1.1.6.bb
@@ -37,7 +37,8 @@ EXTRA_OECONF = "--with-db-uniquename=_pam \
--includedir=${includedir}/security \
--libdir=${base_libdir} \
--disable-nis \
- --disable-regenerate-docu"
+ --disable-regenerate-docu \
+ --disable-prelude"
CFLAGS_append = " -fPIC "
--
1.8.3.2
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH] shadow: Create recipe nativesdk-shadow
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
0 siblings, 1 reply; 10+ messages in thread
From: Mark Hatle @ 2013-09-23 18:01 UTC (permalink / raw)
To: openembedded-core
This looks to be the same as the 'native' package, but I don't think you can
just add a BBCLASSEXTEND = "nativesdk"
Perhaps (in 1.6) someone should look at merging the three back together.
If this is the same as the native version, I'd suggest adding a comment stating
as much so we can hopefully keep them in sync.
--Mark
On 9/23/13 11:34 AM, David Nyström wrote:
> This is a second in a series of patches to enable
> offline rootfs creation from a package repository.
>
> Some postinstall cmds are Yocto specific and needed to create a
> rootfs with pre and post install hooks successfully run,
> using only the toolchain tarball + a package repo.
>
> End goal is to create a sandbox where _users_ of a Yocto
> based distribution can customize a rootfs from a package feed
> with their package manager of choice.
>
> With this patch, I can successfully create packagegroup-core-boot
> with only the toolchain tarball(OPKG). More fixes for a few postinstall
> hooks outside of packagegroup-core-boot will come next.
>
> Signed-off-by: David Nyström <david.nystrom@enea.com>
> ---
> .../nativesdk-packagegroup-sdk-host.bb | 1 +
> .../shadow/nativesdk-shadow_4.1.4.3.bb | 62 ++++++++++++++++++++++
> 2 files changed, 63 insertions(+)
> create mode 100644 meta/recipes-extended/shadow/nativesdk-shadow_4.1.4.3.bb
>
> diff --git a/meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bb b/meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bb
> index 84fb95d..5a64934 100644
> --- a/meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bb
> +++ b/meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bb
> @@ -20,6 +20,7 @@ RDEPENDS_${PN} = "\
> nativesdk-libtool \
> nativesdk-autoconf \
> nativesdk-automake \
> + ${@base_contains('DISTRO_FEATURES', 'pam', 'nativesdk-shadow', '', d)} \
> "
>
> RDEPENDS_${PN}_darwin = "\
> diff --git a/meta/recipes-extended/shadow/nativesdk-shadow_4.1.4.3.bb b/meta/recipes-extended/shadow/nativesdk-shadow_4.1.4.3.bb
> new file mode 100644
> index 0000000..22f4cf3
> --- /dev/null
> +++ b/meta/recipes-extended/shadow/nativesdk-shadow_4.1.4.3.bb
> @@ -0,0 +1,62 @@
> +SUMMARY = "Tools to change and administer password and group data"
> +DESCRIPTION = "Tools to change and administer password and group data"
> +HOMEPAGE = "http://pkg-shadow.alioth.debian.org"
> +BUGTRACKER = "https://alioth.debian.org/tracker/?group_id=30580"
> +SECTION = "base utils"
> +LICENSE = "BSD | Artistic-1.0"
> +LIC_FILES_CHKSUM = "file://COPYING;md5=08c553a87d4e51bbed50b20e0adcaede \
> + file://src/passwd.c;beginline=8;endline=30;md5=d83888ea14ae61951982d77125947661"
> +
> +PR = "r8"
> +
> +inherit autotools gettext nativesdk
> +
> +SRC_URI = "http://pkg-shadow.alioth.debian.org/releases/shadow-${PV}.tar.bz2 \
> + file://shadow.automake-1.11.patch \
> + file://shadow-4.1.3-dots-in-usernames.patch \
> + file://shadow-4.1.4.2-env-reset-keep-locale.patch \
> + file://add_root_cmd_options.patch \
> + file://disable-syslog.patch \
> + file://useradd.patch \
> + file://shadow_fix_for_automake-1.12.patch \
> + file://add_root_cmd_groupmems.patch \
> + "
> +
> +SRC_URI[md5sum] = "b8608d8294ac88974f27b20f991c0e79"
> +SRC_URI[sha256sum] = "633f5bb4ea0c88c55f3642c97f9d25cbef74f82e0b4cf8d54e7ad6f9f9caa778"
> +
> +S = "${WORKDIR}/shadow-${PV}"
> +
> +EXTRA_OECONF += "--without-audit \
> + --without-libcrack \
> + --without-libpam \
> + --without-selinux \
> + --without-nscd"
> +
> +do_install() {
> + oe_runmake DESTDIR="${D}" sbindir="${base_sbindir}" usbindir="${sbindir}" install
> +
> + # Info dir listing isn't interesting at this point so remove it if it exists.
> + if [ -e "${D}${infodir}/dir" ]; then
> + rm -f ${D}${infodir}/dir
> + fi
> +
> + # Enable CREATE_HOME by default.
> + sed -i 's/#CREATE_HOME/CREATE_HOME/g' ${D}${sysconfdir}/login.defs
> +
> + # As we are on an embedded system, ensure the users mailbox is in
> + # ~/ not /var/spool/mail by default, as who knows where or how big
> + # /var is. The system MDA will set this later anyway.
> + sed -i 's/MAIL_DIR/#MAIL_DIR/g' ${D}${sysconfdir}/login.defs
> + sed -i 's/#MAIL_FILE/MAIL_FILE/g' ${D}${sysconfdir}/login.defs
> +
> + # Disable checking emails.
> + sed -i 's/MAIL_CHECK_ENAB/#MAIL_CHECK_ENAB/g' ${D}${sysconfdir}/login.defs
> +
> + # Now we don't have a mail system. Disable mail creation for now.
> + sed -i 's:/bin/bash:/bin/sh:g' ${D}${sysconfdir}/default/useradd
> + sed -i '/^CREATE_MAIL_SPOOL/ s:^:#:' ${D}${sysconfdir}/default/useradd
> +
> + # Use users group by default
> + sed -i 's,^GROUP=1000,GROUP=100,g' ${D}${sysconfdir}/default/useradd
> +}
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] shadow: Create recipe nativesdk-shadow
2013-09-23 18:01 ` Mark Hatle
@ 2013-09-23 19:01 ` David Nystrom
2013-09-23 21:14 ` Richard Purdie
0 siblings, 1 reply; 10+ messages in thread
From: David Nystrom @ 2013-09-23 19:01 UTC (permalink / raw)
To: Mark Hatle; +Cc: openembedded-core
[-- Attachment #1: Type: text/plain, Size: 594 bytes --]
On Sep 23, 2013 8:01 PM, "Mark Hatle" <mark.hatle@windriver.com> wrote:
>
> This looks to be the same as the 'native' package, but I don't think you
can just add a BBCLASSEXTEND = "nativesdk"
It mostly is and I cant, your right.
> Perhaps (in 1.6) someone should look at merging the three back together.
Agree, the merged recipe will also get a bit messy, but probably easier to
maintain than in its current state.
> If this is the same as the native version, I'd suggest adding a comment
stating as much so we can hopefully keep them in sync.
Will do, will return with v2
[-- Attachment #2: Type: text/html, Size: 803 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] shadow: Create recipe nativesdk-shadow
2013-09-23 19:01 ` David Nystrom
@ 2013-09-23 21:14 ` Richard Purdie
2013-09-24 8:25 ` Richard Purdie
0 siblings, 1 reply; 10+ messages in thread
From: Richard Purdie @ 2013-09-23 21:14 UTC (permalink / raw)
To: David Nystrom; +Cc: openembedded-core
On Mon, 2013-09-23 at 21:01 +0200, David Nystrom wrote:
>
> On Sep 23, 2013 8:01 PM, "Mark Hatle" <mark.hatle@windriver.com>
> wrote:
> >
> > This looks to be the same as the 'native' package, but I don't think
> you can just add a BBCLASSEXTEND = "nativesdk"
>
> It mostly is and I cant, your right.
Why not? Just the SRC_URI or other issues?
> > Perhaps (in 1.6) someone should look at merging the three back
> together.
>
> Agree, the merged recipe will also get a bit messy, but probably
> easier to maintain than in its current state.
>
> > If this is the same as the native version, I'd suggest adding a
> comment stating as much so we can hopefully keep them in sync.
>
> Will do, will return with v2
>
Well, I'm not happy with the idea of duplicating all this code.
shadow-native shouldn't exist and this makes things worse. With a few
minutes, I could write this patch:
http://git.yoctoproject.org/cgit.cgi/poky-contrib/commit/?h=rpurdie/t2&id=0730423fcda165a12112182b093d2f6df2f9c5eb
which at least makes the situation a bit less ugly. I guess I did spend
years doing these kinds of patches back when we had 50 versions of
everything and BBCLASSEXTEND didn't yet exist. With a few more minutes
perhaps I can get rid of the separate -native, now the differences are
clear. meld is a nice too for this kind of work btw.
Cheers,
Richard
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] shadow: Create recipe nativesdk-shadow
2013-09-23 21:14 ` Richard Purdie
@ 2013-09-24 8:25 ` Richard Purdie
2013-09-24 14:30 ` David Nyström
0 siblings, 1 reply; 10+ messages in thread
From: Richard Purdie @ 2013-09-24 8:25 UTC (permalink / raw)
To: David Nystrom; +Cc: openembedded-core
On Mon, 2013-09-23 at 22:14 +0100, Richard Purdie wrote:
> On Mon, 2013-09-23 at 21:01 +0200, David Nystrom wrote:
> >
> > On Sep 23, 2013 8:01 PM, "Mark Hatle" <mark.hatle@windriver.com>
> > wrote:
> > >
> > > This looks to be the same as the 'native' package, but I don't think
> > you can just add a BBCLASSEXTEND = "nativesdk"
> >
> > It mostly is and I cant, your right.
>
> Why not? Just the SRC_URI or other issues?
>
> > > Perhaps (in 1.6) someone should look at merging the three back
> > together.
> >
> > Agree, the merged recipe will also get a bit messy, but probably
> > easier to maintain than in its current state.
> >
> > > If this is the same as the native version, I'd suggest adding a
> > comment stating as much so we can hopefully keep them in sync.
> >
> > Will do, will return with v2
> >
> Well, I'm not happy with the idea of duplicating all this code.
> shadow-native shouldn't exist and this makes things worse. With a few
> minutes, I could write this patch:
>
> http://git.yoctoproject.org/cgit.cgi/poky-contrib/commit/?h=rpurdie/t2&id=0730423fcda165a12112182b093d2f6df2f9c5eb
>
> which at least makes the situation a bit less ugly. I guess I did spend
> years doing these kinds of patches back when we had 50 versions of
> everything and BBCLASSEXTEND didn't yet exist. With a few more minutes
> perhaps I can get rid of the separate -native, now the differences are
> clear. meld is a nice too for this kind of work btw.
Better still, a conversion to BBCLASSEXTEND:
http://git.yoctoproject.org/cgit.cgi/poky-contrib/commit/?h=rpurdie/t2&id=142d11b9b61bf18567cdb0527b7e63683c5afa1a
Cheers,
Richard
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] shadow: Create recipe nativesdk-shadow
2013-09-24 8:25 ` Richard Purdie
@ 2013-09-24 14:30 ` David Nyström
2013-09-25 10:03 ` Richard Purdie
0 siblings, 1 reply; 10+ messages in thread
From: David Nyström @ 2013-09-24 14:30 UTC (permalink / raw)
To: Richard Purdie; +Cc: openembedded-core
On 09/24/2013 10:25 AM, Richard Purdie wrote:
> On Mon, 2013-09-23 at 22:14 +0100, Richard Purdie wrote:
>> On Mon, 2013-09-23 at 21:01 +0200, David Nystrom wrote:
>>>
>>> On Sep 23, 2013 8:01 PM, "Mark Hatle" <mark.hatle@windriver.com>
>>> wrote:
>>>>
>>>> This looks to be the same as the 'native' package, but I don't think
>>> you can just add a BBCLASSEXTEND = "nativesdk"
>>>
>>> It mostly is and I cant, your right.
>>
>> Why not? Just the SRC_URI or other issues?
>>
>>>> Perhaps (in 1.6) someone should look at merging the three back
>>> together.
>>>
>>> Agree, the merged recipe will also get a bit messy, but probably
>>> easier to maintain than in its current state.
>>>
>>>> If this is the same as the native version, I'd suggest adding a
>>> comment stating as much so we can hopefully keep them in sync.
>>>
>>> Will do, will return with v2
>>>
>> Well, I'm not happy with the idea of duplicating all this code.
>> shadow-native shouldn't exist and this makes things worse. With a few
>> minutes, I could write this patch:
>>
>> http://git.yoctoproject.org/cgit.cgi/poky-contrib/commit/?h=rpurdie/t2&id=0730423fcda165a12112182b093d2f6df2f9c5eb
>>
>> which at least makes the situation a bit less ugly. I guess I did spend
>> years doing these kinds of patches back when we had 50 versions of
>> everything and BBCLASSEXTEND didn't yet exist. With a few more minutes
>> perhaps I can get rid of the separate -native, now the differences are
>> clear. meld is a nice too for this kind of work btw.
>
> Better still, a conversion to BBCLASSEXTEND:
>
> http://git.yoctoproject.org/cgit.cgi/poky-contrib/commit/?h=rpurdie/t2&id=142d11b9b61bf18567cdb0527b7e63683c5afa1a
Thanks for that, I'll take above as a learning experience.
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.
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.
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 ?
Br,
David
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] shadow: Create recipe nativesdk-shadow
2013-09-24 14:30 ` David Nyström
@ 2013-09-25 10:03 ` Richard Purdie
2013-09-25 12:24 ` David Nyström
0 siblings, 1 reply; 10+ messages in thread
From: Richard Purdie @ 2013-09-25 10:03 UTC (permalink / raw)
To: David Nyström; +Cc: openembedded-core
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
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] shadow: Create recipe nativesdk-shadow
2013-09-25 10:03 ` Richard Purdie
@ 2013-09-25 12:24 ` David Nyström
0 siblings, 0 replies; 10+ messages in thread
From: David Nyström @ 2013-09-25 12:24 UTC (permalink / raw)
To: Richard Purdie; +Cc: openembedded-core
On 09/25/2013 12:03 PM, Richard Purdie wrote:
> 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.
>
Sorry, bad wording on my end. I was worried about nativesdk
post/prefuncs beeing added.
<snip>
>> 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 Agree, it would be good with a consistent handling between nativesdk
and target pre/postinstall hooks.
I'll try to dive into this subject when I have more time.
> 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
>
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2013-09-25 12:24 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2013-09-25 12:24 ` David Nyström
2013-09-23 16:34 ` [PATCHv2] libpam: Avoid host contamination issue w. libprelude David Nyström
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.