Skip to contentSkip to conversation

util-linux: Disable chfn-chsh on non-target builds

PATCH Superseded Khem Raj 2 participants 2 messages Jul 7, 2021 – Jul 8, 2021

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 util-linux: Disable chfn-chsh on non-target builds

They are also provided by shadow-native e.g. when building native recipes and packages where they depend on both shadow-native and util-linux-native, this can conflict

Fixes
ERROR: systemd-1_248.3-r0 do_prepare_recipe_sysroot: The file /usr/bin/chsh is installed by both util-linux-native and shadow-native, aborting

---
 meta/recipes-core/util-linux/util-linux_2.37.bb | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
meta/recipes-core/util-linux/util-linux_2.37.bb +2 -1
index 399f66d6a0..285e182e0f 100644
@@ -91,7 +91,7 @@ EXTRA_OECONF_append = " --disable-hwclock-gplv3"
 # build host versions during development
 #
 PACKAGECONFIG ?= "pcre2"
-PACKAGECONFIG_class-target ?= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}"
+PACKAGECONFIG_class-target ?= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)} chfn-chsh"
 PACKAGECONFIG[pam] = "--enable-su --enable-runuser,--disable-su --disable-runuser, libpam,"
 # Respect the systemd feature for uuidd
 PACKAGECONFIG[systemd] = "--with-systemd --with-systemdsystemunitdir=${systemd_system_unitdir}, --without-systemd --without-systemdsystemunitdir,systemd"
@@ -102,6 +102,7 @@ PACKAGECONFIG[readline] = "--with-readline,--without-readline,readline"
 # PCRE support in hardlink
 PACKAGECONFIG[pcre2] = ",,libpcre2"
 PACKAGECONFIG[cryptsetup] = "--with-cryptsetup,--without-cryptsetup,cryptsetup"
+PACKAGECONFIG[chfn-chsh] = "--enable-chfn-chsh,--disable-chfn-chsh,"
 
 EXTRA_OEMAKE = "ARCH=${TARGET_ARCH} CPU= CPUOPT= 'OPT=${CFLAGS}'"
 
Signature · 1 line
2.32.0
#1 lore raw

Hi Khem,

Quoted 7 lines · Khem Raj

They are also provided by shadow-native e.g. when building native recipes and packages where they depend on both shadow-native and util-linux-native, this can conflict

Fixes
ERROR: systemd-1_248.3-r0 do_prepare_recipe_sysroot: The file /usr/bin/chsh is installed by both util-linux-native and shadow-native, aborting

This breaks poky-tiny and most probably other distros:

https://autobuilder.yoctoproject.org/typhoon/#/builders/15/builds/3935/steps/12/logs/stdio

configure: error: chfn_chsh selected, but required PAM header file not available

Quoted 34 lines
---
 meta/recipes-core/util-linux/util-linux_2.37.bb | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
meta/recipes-core/util-linux/util-linux_2.37.bb +2 -1
index 399f66d6a0..285e182e0f 100644
@@ -91,7 +91,7 @@ EXTRA_OECONF_append = " --disable-hwclock-gplv3"
 # build host versions during development
 #
 PACKAGECONFIG ?= "pcre2"
-PACKAGECONFIG_class-target ?= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}"
+PACKAGECONFIG_class-target ?= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)} chfn-chsh"
 PACKAGECONFIG[pam] = "--enable-su --enable-runuser,--disable-su --disable-runuser, libpam,"
 # Respect the systemd feature for uuidd
 PACKAGECONFIG[systemd] = "--with-systemd --with-systemdsystemunitdir=${systemd_system_unitdir}, --without-systemd --without-systemdsystemunitdir,systemd"
@@ -102,6 +102,7 @@ PACKAGECONFIG[readline] = "--with-readline,--without-readline,readline"
 # PCRE support in hardlink
 PACKAGECONFIG[pcre2] = ",,libpcre2"
 PACKAGECONFIG[cryptsetup] = "--with-cryptsetup,--without-cryptsetup,cryptsetup"
+PACKAGECONFIG[chfn-chsh] = "--enable-chfn-chsh,--disable-chfn-chsh,"
 
 EXTRA_OEMAKE = "ARCH=${TARGET_ARCH} CPU= CPUOPT= 'OPT=${CFLAGS}'"
 
Signature · 1 line
2.32.0
Signature · 3 lines
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com