Skip to contentSkip to conversation

util-linux: Use PACKAGECONFIG to control pam and system config options

PATCH In review Saul Wold 3 participants 6 messages Jul 8, 2013 – Jul 25, 2013

lore
Share & tools
lore

Saul Wold

author
#0 lore raw

PATCH v2 1/1 util-linux: Use PACKAGECONFIG to control pam and system config options

The PACKAGECONFIG will ensure consistent enabling and disabling of the pam and systemd related options for configure and the correct dependencies

v2: fixed PACKAGECONFIG line continuation grammar
added _class-target for PACKAGECONFIG to work on target only

---
 meta/recipes-core/util-linux/util-linux.inc | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
meta/recipes-core/util-linux/util-linux.inc +5 -6
index 5bae370..7d50856 100644
@@ -42,18 +42,17 @@ EXTRA_OECONF = "--libdir=${base_libdir} --disable-use-tty-group \
                 --disable-makeinstall-chown --enable-elvtune --enable-init \
                 --enable-kill --enable-last --enable-mesg --enable-partx \
                 --enable-raw --enable-rdev --enable-reset --disable-login \
-                --disable-vipw --disable-newgrp --disable-chfn-chsh --disable-su \
+                --disable-vipw --disable-newgrp --disable-chfn-chsh \
                 --enable-write --enable-arch --enable-mount --with-fsprobe=builtin \
                 --enable-libuuid --enable-libblkid --enable-fsck --without-udev \
-                --disable-runuser \
 		usrsbin_execdir='${sbindir}' \
 "
+PACKAGECONFIG_class-target ??= "${@base_contains('DISTRO_FEATURES', 'pam', 'pam', '', d)} \
+                                ${@base_contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} "
+PACKAGECONFIG[pam] = "--enable-su --enable-runuser,--disable-su --disable-runuser, pam,"
 
 # Respect the systemd feature for uuidd
-EXTRA_OECONF += "${@base_contains('DISTRO_FEATURES', 'systemd', '--enable-socket-activation', '--disable-socket-activation', d)}"
-EXTRA_OECONF += "${@base_contains('DISTRO_FEATURES', 'systemd', '--with-systemdsystemunitdir=${systemd_unitdir}/system/', '--without-systemdsystemunitdir', d)}"
-
-EXTRA_OECONF_append_class-native = " --disable-login --disable-su --disable-runuser"
+PACKAGECONFIG[systemd] = "--enable-socket-activation --with-systemdsystemunitdir=${systemd_unitdir}/system/, --disable-socket-activation --without-systemdsystemunitdir"
 
 FILES_${PN}-bash-completion += "${datadir}/bash-completion"
 FILES_${PN}-doc += "${datadir}/getopt/getopt-*.*"
Signature · 1 line
1.8.1.4
#1 lore raw

meta/recipes-core/util-linux/util-linux.inc EXTRA_OECONF = "--libdir=${base_libdir} --disable-use-tty-group \ · line 51

Quoted 8 lines · Saul Wold

The PACKAGECONFIG will ensure consistent enabling and disabling of the pam and systemd related options for configure and the correct dependencies

v2: fixed PACKAGECONFIG line continuation grammar
added _class-target for PACKAGECONFIG to work on target only
...

meta/recipes-core/util-linux/util-linux.inc +2 -0
+PACKAGECONFIG_class-target ??= "${@base_contains('DISTRO_FEATURES', 'pam', 'pam', '', d)} \
+                                ${@base_contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} "

This does not work here. d.getVar('PACKAGECONFIG', True) evaluates to 'None' in the anonymous python function in base.bbclass so that non-systemd options are selected in systemd distributions and packaging fails in a sanity check.

Using the less weak '?=' operator makes thing work as expected.

Enrico

#2 lore raw

Op 10 jul. 2013, om 18:26 heeft Enrico Scholz <[email protected]> het volgende geschreven:

Quoted 11 lines

meta/recipes-core/util-linux/util-linux.inc EXTRA_OECONF = "--libdir=${base_libdir} --disable-use-tty-group \ · line 51

Quoted 8 lines · Saul Wold

The PACKAGECONFIG will ensure consistent enabling and disabling of the pam and systemd related options for configure and the correct dependencies

v2: fixed PACKAGECONFIG line continuation grammar
added _class-target for PACKAGECONFIG to work on target only
...

meta/recipes-core/util-linux/util-linux.inc +2 -0
+PACKAGECONFIG_class-target ??= "${@base_contains('DISTRO_FEATURES', 'pam', 'pam', '', d)} \
+                                ${@base_contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} "
Quoted 5 lines

This does not work here. d.getVar('PACKAGECONFIG', True) evaluates to 'None' in the anonymous python function in base.bbclass so that non-systemd options are selected in systemd distributions and packaging fails in a sanity check.

Using the less weak '?=' operator makes thing work as expected.

And a different version of this patch got merged:

	https://github.com/openembedded/oe-core/commit/7cde7c639c53724327d981cbc0db5e123607de1c

Which has the following bug:

PACKAGECONFIG_class-target ??= "${@base_contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)} \
[..]
PACKAGECONFIG[pam] = "--enable-su --enable-runuser,--disable-su --disable-runuser, pam,"

It sets 'libpam' as PACKAGECONFIG option, but the option is actually named 'pam'. The patches posted to this list don't seem to have this bug.

regards,

Koen

#3 lore raw

Op 25 jul. 2013, om 14:58 heeft Koen Kooi <[email protected]> het volgende geschreven:

Quoted 24 lines

Op 10 jul. 2013, om 18:26 heeft Enrico Scholz <[email protected]> het volgende geschreven:

Quoted 11 lines

Review

Quoted 8 lines · Saul Wold

The PACKAGECONFIG will ensure consistent enabling and disabling of the pam and systemd related options for configure and the correct dependencies

v2: fixed PACKAGECONFIG line continuation grammar
added _class-target for PACKAGECONFIG to work on target only
...

(quoted diff) +2 -0
+PACKAGECONFIG_class-target ??= "${@base_contains('DISTRO_FEATURES', 'pam', 'pam', '', d)} \
+                                ${@base_contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} "
Quoted 5 lines

This does not work here. d.getVar('PACKAGECONFIG', True) evaluates to 'None' in the anonymous python function in base.bbclass so that non-systemd options are selected in systemd distributions and packaging fails in a sanity check.

Using the less weak '?=' operator makes thing work as expected.

And a different version of this patch got merged:

	https://github.com/openembedded/oe-core/commit/7cde7c639c53724327d981cbc0db5e123607de1c
Quoted 7 lines

Which has the following bug:

PACKAGECONFIG_class-target ??= "${@base_contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)} \
[..]
PACKAGECONFIG[pam] = "--enable-su --enable-runuser,--disable-su --disable-runuser, pam,"

It sets 'libpam' as PACKAGECONFIG option, but the option is actually named 'pam'. The patches posted to this list don't seem to have this bug.

Here's what I used with dylan + backports:

commit 2f318d0f9627e1872732db1ecafaed9caeb68ebf

Author: Koen Kooi <[email protected]>
Date:   Thu Jul 25 14:58:27 2013 +0200

util-linux: fix PACKAGECONFIG options

The ??= operator is too weak and it's setting a non-existent PACKAGECONFIG option ('libpam' instead of 'pam').

meta/recipes-core/util-linux/util-linux.inc +2 -2
index d373cec..3d1198a 100644
@@ -47,9 +47,9 @@ EXTRA_OECONF = "--libdir=${base_libdir} --disable-use-tty-group \
                 --enable-libuuid --enable-libblkid --enable-fsck --without-udev \
                usrsbin_execdir='${sbindir}' \
 "
-PACKAGECONFIG_class-target ??= "${@base_contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)} \
+PACKAGECONFIG_class-target ?= "${@base_contains('DISTRO_FEATURES', 'pam', 'pam', '', d)} \
                                 ${@base_contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} "
-PACKAGECONFIG[pam] = "--enable-su --enable-runuser,--disable-su --disable-runuser, pam,"
+PACKAGECONFIG[pam] = "--enable-su --enable-runuser,--disable-su --disable-runuser, libpam,"
 
 # Respect the systemd feature for uuidd
 PACKAGECONFIG[systemd] = "--enable-socket-activation --with-systemdsystemunitdir=${systemd_unitdir}/system/, --disable-socket-activation --without-systemdsystemunitdir"
author
#4 lore raw
Quoted 40 lines · Koen Kooi

Op 25 jul. 2013, om 14:58 heeft Koen Kooi <[email protected]> het volgende geschreven:

Quoted 24 lines

Op 10 jul. 2013, om 18:26 heeft Enrico Scholz <[email protected]> het volgende geschreven:

Quoted 11 lines

Review

Quoted 8 lines · Saul Wold

The PACKAGECONFIG will ensure consistent enabling and disabling of the pam and systemd related options for configure and the correct dependencies

v2: fixed PACKAGECONFIG line continuation grammar
added _class-target for PACKAGECONFIG to work on target only
...

(quoted diff) +2 -0
+PACKAGECONFIG_class-target ??= "${@base_contains('DISTRO_FEATURES', 'pam', 'pam', '', d)} \
+                                ${@base_contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} "
Quoted 5 lines

This does not work here. d.getVar('PACKAGECONFIG', True) evaluates to 'None' in the anonymous python function in base.bbclass so that non-systemd options are selected in systemd distributions and packaging fails in a sanity check.

Using the less weak '?=' operator makes thing work as expected.

And a different version of this patch got merged:

	https://github.com/openembedded/oe-core/commit/7cde7c639c53724327d981cbc0db5e123607de1c
Quoted 7 lines

Which has the following bug:

PACKAGECONFIG_class-target ??= "${@base_contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)} \
[..]
PACKAGECONFIG[pam] = "--enable-su --enable-runuser,--disable-su --disable-runuser, pam,"

It sets 'libpam' as PACKAGECONFIG option, but the option is actually named 'pam'. The patches posted to this list don't seem to have this bug.

Here's what I used with dylan + backports:

commit 2f318d0f9627e1872732db1ecafaed9caeb68ebf

Quoted 9 lines
Author: Koen Kooi <[email protected]>
Date:   Thu Jul 25 14:58:27 2013 +0200

util-linux: fix PACKAGECONFIG options

The ??= operator is too weak and it's setting a non-existent PACKAGECONFIG option ('libpam' instead of 'pam').

Koen,

Good catch, can you send this as a proper patch to the OE-Core list also.

Thanks
Sau!

Quoted 20 lines
meta/recipes-core/util-linux/util-linux.inc +2 -2
index d373cec..3d1198a 100644
@@ -47,9 +47,9 @@ EXTRA_OECONF = "--libdir=${base_libdir} --disable-use-tty-group \
                  --enable-libuuid --enable-libblkid --enable-fsck --without-udev \
                 usrsbin_execdir='${sbindir}' \
  "
-PACKAGECONFIG_class-target ??= "${@base_contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)} \
+PACKAGECONFIG_class-target ?= "${@base_contains('DISTRO_FEATURES', 'pam', 'pam', '', d)} \
                                  ${@base_contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} "
-PACKAGECONFIG[pam] = "--enable-su --enable-runuser,--disable-su --disable-runuser, pam,"
+PACKAGECONFIG[pam] = "--enable-su --enable-runuser,--disable-su --disable-runuser, libpam,"
 
  # Respect the systemd feature for uuidd
  PACKAGECONFIG[systemd] = "--enable-socket-activation --with-systemdsystemunitdir=${systemd_unitdir}/system/, --disable-socket-activation --without-systemdsystemunitdir"
#5 lore raw
In reply to Koen Kooi

Koen Kooi <[email protected]>

meta/recipes-core/util-linux/util-linux.inc EXTRA_OECONF = "--libdir=${base_libdir} --disable-use-tty-group \ · line 51

Quoted 5 lines · writes:

The ??= operator is too weak
...

meta/recipes-core/util-linux/util-linux.inc +1 -1
-PACKAGECONFIG_class-target ??= "${@base_contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)} \
+PACKAGECONFIG_class-target ?= "${@base_contains('DISTRO_FEATURES', 'pam', 'pam', '', d)} \
                                 ${@base_contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} "

good to see that I am not the only one hitting this problem. But does there exist some explanation for this behavior? Lots of other packages have

| PACKAGECONFIG ??=

and it seems to work there. It might be related to the '_class-target' override but that's a nasty, unpredictable bug causing silent breakage.

Something like

| localconfig = ""
| localconfig_class-target = "${@base_contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}...
|
| PACKAGECONFIG ??= "${localconfig}"

and forbidding '??' in override-constructs might make things clearer.

Enrico