[poky] Small Patches to Poky

Richard Purdie richard.purdie at linuxfoundation.org
Wed Nov 28 08:05:05 PST 2018


On Wed, 2018-11-28 at 10:45 -0500, Michael Eden wrote:
> Hi all,
> 
> Forgive me because I'm new, but I'm currently I'm maintaining 2
> patches to issues that I'd like to officially fix.
> The first is more of a convenience and changes `cp` to `cp -f` since
> I've noticed that this operation sometimes fails (if the file already
> exists):
> 
> diff --git a/meta/classes/autotools.bbclass
> b/meta/classes/autotools.bbclass
> index cc857acc3e..0e234fae42 100644
> --- a/meta/classes/autotools.bbclass
> +++ b/meta/classes/autotools.bbclass
> @@ -202,7 +202,7 @@ autotools_do_configure() {
>                         fi
>                 elif [ "${BPN}" != "gettext" ] && grep -q
> "^[[:space:]]*AM_GNU_GETTEXT" $CONFIGURE_AC; then
>                         # We'd call gettextize here if it wasn't so
> broken...
> -                       cp
> ${STAGING_DATADIR_NATIVE}/gettext/config.rpath ${AUTOTOOLS_AUXDIR}/
> +                       cp -f
> ${STAGING_DATADIR_NATIVE}/gettext/config.rpath ${AUTOTOOLS_AUXDIR}/
>                         if [ -d ${S}/po/ ]; then
>                                 cp -f
> ${STAGING_DATADIR_NATIVE}/gettext/po/Makefile.in.in ${S}/po/
>                                 if [ ! -e ${S}/po/remove-potcdate.sin 
> ]; then

The default operation of cp is to replace existing files, -f would only
help if they were readonly. Is your distro or config somehow aliasing
"cp" to "cp -n"? Which recipes are you seeing this with?

> The second is more complex and I've been using the following
> workaround:
> 
> diff --git a/meta/classes/useradd_base.bbclass
> b/meta/classes/useradd_base.bbclass
> index 551c82c322..ef27ae6cae 100644
> --- a/meta/classes/useradd_base.bbclass
> +++ b/meta/classes/useradd_base.bbclass
> @@ -34,6 +34,7 @@ perform_useradd () {
>         local username=`echo "$opts" | awk '{ print $NF }'`
>         local user_exists="`grep "^$username:" $rootdir/etc/passwd ||
> true`"
>         if test "x$user_exists" = "x"; then
> +               export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/lib"
>                 eval flock -x $rootdir${sysconfdir} -c  \"$PSEUDO
> useradd \$opts\" || true
>                 user_exists="`grep "^$username:" $rootdir/etc/passwd
> || true`"
>                 if test "x$user_exists" = "x"; then
> 
> The above is needed because useradd (native) depends on libattr.so.1
> which is _not_ built and put in the native-sysroot.
> Somewhere an attr-native dependency has to be added but I'm not sure
> where since this is a class that can be inherited into many recipes.
> I worked around this by installing attr on my machine and adding the
> correct path to LD_LIBRARY_PATH.
> 
> I'd appreciate help in debugging and submitting the updated useradd
> class to sumo.

It would help to know exactly which command is failing with the missing
library?

Cheers,

Richard



More information about the poky mailing list