mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: ruggero <rrossi@atb-biomag.de>
To: ptxdist@pengutronix.de
Subject: [ptxdist] Problems compiling package dbus with ptxdist 2023.11.0
Date: Fri, 8 Dec 2023 08:37:14 +0100	[thread overview]
Message-ID: <20231208083714.0991e973@Laptop-RR> (raw)

Hello everybody,

I hope I'm posting on the right mailing list - if not, please redirect
me.

I'm having a problem while migrating from ptxdist.2023.09.0 to
ptxdist.2023.11.0

Package dbus fails to install.

The relevant messages are the following:

make: *** [/usr/local/lib/ptxdist-2023.10.0/rules/post/ptxd_make_world_install.make:41:
           /...../platform-phyFLEX-i.MX6/state/dbus.install] Error 1

Traceback (most recent call last):
  File "/...../platform-phyFLEX-i.MX6/build-target/dbus-1.15.8/meson_post_install.py",
     line 106, in <module> post_install_exe() File
     ".......x/platform-phyFLEX-i.MX6/build-target/dbus-1.15.8/meson_post_install.py",
     line 95, in post_install_exe os.chown(exe_path, 0, grp.getgrnam(dbus_user).gr_gid)
                                                       ^^^^^^^^^^^^^^^^^^^^^^^ 
     KeyError: "getgrnam(): name not found: 'messagebus'"

It looks like, that a python script now takes care of some phasis of
the installation, and the python script fails.

The same problem occurs also migrating from ptxdist.2023.09.0 to
ptxdist.2023.10.0 (where the new version of dbus with the meson
installer was introduced), and migrating form ptxdist.2023.09.0 to
ptxdist.2023.12.0 (the very last published version).

I did some investigations:
The installer calls the python script meson_post_install.py. The python
scripts uses the native host python, since the build-host python will
be compiled later.

The relevant part of the failing script is the following: 

def post_install_exe():
    # Setuid, chmod and chown for dbus-daemon-launch-helper
    daemon_launch_helper = get_target('dbus-daemon-launch-helper')
    if daemon_launch_helper:
        import grp
        exe_name =os.path.basename(daemon_launch_helper['install_filename'][0])
        exe_path = abs_libexecdir / exe_name 
        dbus_user = get_option('dbus_user')    ####### dbus_user is 'messagebus'
        if os.getuid() == 0:
            os.chown(exe_path, 0, grp.getgrnam(dbus_user).gr_gid)  
            ####<<<--- error occurs here
            os.chmod(exe_path, stat.S_ISUID | stat.S_IXUSR | stat.S_IXGRP)
        else:
            print('Not installing {0} binary setuid!'.format(exe_path))
            print('You\'ll need to manually set permissions to root:{0}
                   and permissions 4750'.format(dbus_user) )


The problem seems to be that grp.getgrnam(dbus_user) search on the host
native /etc/group, and not in the target /etc/group (that is still to
be generated), and I do not have a messagebus user [and nobody can say
that my messagebus has the same gid as the target].

Even if I manually targetinstall rootfs (it provides root/etc/group)
and host-python, the error persists: the script continues to read the
host native /etc/group (retrieving the GroupID of my user succeeds).

Any opinion / suggestion?

Ruggero







             reply	other threads:[~2023-12-08  7:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-08  7:37 ruggero [this message]
2023-12-11  7:56 ` Michael Olbrich
2023-12-11  8:23   ` ruggero
2023-12-11 16:41     ` Michael Olbrich
2023-12-11 17:03       ` ruggero

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=20231208083714.0991e973@Laptop-RR \
    --to=rrossi@atb-biomag.de \
    --cc=ptxdist@pengutronix.de \
    /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