| Summary: | systemd ldconfig.service: always re-generates ld.so.cache (?) and fails on read-only rootfs | ||
|---|---|---|---|
| Product: | [Build System, Metadata & Runtime] OE-Core | Reporter: | Patrick Ohly <patrick.ohly> |
| Component: | core | Assignee: | Richard Purdie <richard.purdie> |
| Status: | RESOLVED WORKSFORME | QA Contact: | |
| Severity: | normal | ||
| Priority: | Medium | CC: | juro.bystricky, meta.mr.watcher, meta.watcher, randy.macleod, rap, stephano |
| Version: | unspecified | ||
| Target Milestone: | 3.4 | ||
| Hardware: | x86 | ||
| OS: | Multiple | ||
| Whiteboard: | |||
| OS type for building Yocto: | --- | Type of Regression: | --- |
| Verified: | Documentation change: | No (bug/feature does not impact docs) | |
|
Description
Patrick Ohly
2017-07-10 19:31:35 UTC
Would this be solved by this which just landed into master:
initramfs-live-boot: disable systemd-update-done.service on live images
(In reply to comment #1) > Would this be solved by this which just landed into master: > > initramfs-live-boot: disable systemd-update-done.service on live images No, that only solves the issue for an initramfs that uses init-live.sh. It is not solved for a normal read-only rootfs, not does it address the "ld.so.cache also gets re-generated unnecessarily when booting into a read/write image" part. But probably the technique used in that patch can be generalized also for the other scenarios. Maxin, can you take this? (In reply to comment #3) > Maxin, can you take this? Sure. (In reply to comment #0) > > I think (but haven't checked again) that ld.so.cache also gets re-generated > unnecessarily when booting into a read/write image. > This has been puzzling me for a while, looking at the source code of ldconfig https://github.com/lattera/glibc/blob/master/elf/ldconfig.c We can see the the cache file contains directory entries. So I don't understand how you can actually "cross-compile" a cache file, as the directory entries reflect the build host machine. So the way I understand this, a cross-compiled ld.so.cache needs to re-generate right away, as all entries are originally invalid, originating from the build host. Can't reproduce. ldconfig.service not even to start because start condition is not met.
root@qemux86-64:~# touch /abc
touch: /abc: Read-only file system
root@qemux86-64:~#
root@qemux86-64:~# systemctl status ldconfig| more
● ldconfig.service - Rebuild Dynamic Linker Cache
Loaded: loaded (/lib/systemd/system/ldconfig.service; static; vendor preset: enabled)
Active: inactive (dead)
Condition: start condition failed at Tue 2019-01-08 03:05:36 UTC; 5min ago
├─ ConditionNeedsUpdate=|/etc was not met
└─ ConditionFileNotEmpty=|!/etc/ld.so.cache was not met
Docs: man:ldconfig(8)
Patrick, did you have extra configure?
(In reply to comment #6) > Can't reproduce. ldconfig.service not even to start because start condition > is not met. > > root@qemux86-64:~# touch /abc > touch: /abc: Read-only file system > root@qemux86-64:~# > root@qemux86-64:~# systemctl status ldconfig| more > > ● ldconfig.service - Rebuild Dynamic Linker Cache > Loaded: loaded (/lib/systemd/system/ldconfig.service; static; vendor > preset: enabled) > > Active: inactive (dead) > Condition: start condition failed at Tue 2019-01-08 03:05:36 UTC; 5min ago > ├─ ConditionNeedsUpdate=|/etc was not met > └─ ConditionFileNotEmpty=|!/etc/ld.so.cache was not met > Docs: man:ldconfig(8) > > > Patrick, did you have extra configure? Hi I just ran into this issue. We get the same error as OP. We have a bb file adding a symlink like so: ln -s /var/run/ld.so.cache ${D}${sysconfdir}/ld.so.cache I built a systemd image (core-image-sato) and agree this seems to work fine for me:
root@qemux86-64:~# systemctl status ldconfig
○ ldconfig.service - Rebuild Dynamic Linker Cache
Loaded: loaded (/lib/systemd/system/ldconfig.service; static)
Active: inactive (dead)
Condition: start condition failed at Tue 2021-09-28 16:41:57 UTC; 2min 49s ago
├─ ConditionNeedsUpdate=|/etc was not met
└─ ConditionFileNotEmpty=|!/etc/ld.so.cache was not met
with ldconfig -p showing cache entries which seem to match the system.
|