Bug 8421 - util-linux installs systemd files in output/target/home/
Summary: util-linux installs systemd files in output/target/home/
Status: RESOLVED FIXED
Alias: None
Product: buildroot
Classification: Unclassified
Component: Other (show other bugs)
Version: unspecified
Hardware: PC Mac OS
: P5 minor
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-21 12:21 UTC by Thijs Vermeir
Modified: 2015-10-22 20:43 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thijs Vermeir 2015-10-21 12:21:09 UTC
When I use a user table and enable systemd, the home folder of the user contains systemd files from the util-linux package and other directories.

~/buildroot/sheeva/output/target/home/tvermeir$ tree .
.
`-- buildroot
    |-- host
    |   `-- sheevaplug-glibc
    |       `-- usr
    |           `-- arm-buildroot-linux-gnueabi
    |               `-- sysroot
    |                   `-- lib
    |                       `-- systemd
    |                           `-- system
    |                               |-- fstrim.service
    |                               `-- fstrim.timer
    `-- sheeva
 
10 directories, 2 files
 
~/buildroot/sheeva$ find ./ -name "fstrim.service"
./output/target/home/tvermeir/buildroot/host/sheevaplug-glibc/usr/arm-buildroot-linux-gnueabi/sysroot/lib/systemd/system/fstrim.service
./output/build/util-linux-2.27/sys-utils/fstrim.service
Comment 1 Peter Korsgaard 2015-10-21 12:32:55 UTC
Looks to be caused by the recent pkgconf version bump, which now prefixes all variables with the sysroot:

commit 3fe434bf35b09ddf438392e6e5b4bc0b849495c7
Author: Gustavo Zacarias <gustavo@zacarias.com.ar>
Date:   Mon Oct 5 16:54:30 2015 -0300

    glib-networking: specify GIO_MODULE_DIR for target
    
    Since the upgrade to pkgconf 0.9.12 all directories and variables with
    directories are sysroot-prefixed, whereas with the old patch only some
    variables were (includedir, mapdir, sdkdir, libdir).
    
    libglib2 uses a giomoduledir=${libdir}/gio/modules variable in
    gio-2.0.pc, which when expanded via sysroot by pkgconf at configure time
    points to the staging directory (via libdir expansion).
    When target install gets called the gio module gets installed to staging
    rather than target, with the obvious consequences this has.
    
    Work-around this pkgconfig abuse by overriding GIO_MODULE_DIR at target
    install time.
    
    Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
    Signed-off-by: Peter Korsgaard <peter@korsgaard.com>

I'll add a workaround for util-linux as well.
Comment 2 Peter Korsgaard 2015-10-22 20:43:23 UTC
Hi,

I've committed a fix to disable systemd support in util-linux. You must have ended up with the problem by rebuilding util-linux after building systemd, because system depends on util-linux, so it gets built before systemd and will not be able to find the systemd .pc files.

We cannot enable systemd support as that would cause a circular dependency.

commit 762b64daa2fd1424053754ed55d0f9704ccc2405
Author: Peter Korsgaard <peter@korsgaard.com>
Date:   Thu Oct 22 22:36:50 2015 +0200

    util-linux: disable systemd support
    
    Fixes (works around) #8421
    
    Util-linux has optional systemd support, but we cannot enable it as systemd
    depends on util-linux, so that would create a circular dependency.
    
    The systemd unit directory location detection also fails as pkg-config
    0.9.12+ prefixes all directory variables with the sysroot, and the configure
    script expects to see the target location, so disable that as well for good
    measure.
    
    The systemd support doesn't seem to add much, so it isn't a big loss.
    
    Signed-off-by: Peter Korsgaard <peter@korsgaard.com>