| Summary: | systemd 239 bash file test bug | ||
|---|---|---|---|
| Product: | [Build System, Metadata & Runtime] OE-Core | Reporter: | wei.qingjun |
| Component: | core | Assignee: | wei.qingjun |
| Status: | RESOLVED WORKSFORME | QA Contact: | |
| Severity: | critical | ||
| Priority: | Medium | CC: | jku, meta.mr.watcher, meta.watcher, randy.macleod |
| Version: | 2.6.1 | ||
| Target Milestone: | 2.8 M4 | ||
| Hardware: | All | ||
| OS: | arm | ||
| Whiteboard: | |||
| OS type for building Yocto: | --- | Type of Regression: | --- |
| Verified: | Documentation change: | No (bug/feature does not impact docs) | |
I tried to modify the code but I still get error: Log below: | Running custom install script 'XXXXXXXXXXX/tmp/hosttools/sh -c touch $DESTDIR/usr' | ln: failed to create symbolic link 'XXXXXXXXXX/tmp/work/cortexa17hf-neon-vfpv4-rk-linux-gnueabi/systemd/1_239-r0/image/sbin/init': File exists No idea why the init file exists. I can confirm it is a bug.
Althought I have not traced to the cause.
I had to add a line to remove the sbin/init file.
mv ${D}/${base_sbindir}/init
Then I had to mount the ext4 rootfs and manully create the link.
The current symbolic link is linked to a wrong location.
Can you explain in detail how to reproduce the error? Lots of people are building systemd but perhaps this is a silent failure that we've been ignoring or it could be that you have a custom install script and have made an error. We need more info to proceed. I have a local recipe that installs a systemd service to start my system at startup.
The bb file is something like below.
Hope it helps.
Thanks
Qingjun
SUMMARY = "XXX"
LICENSE = "CLOSED"
PV = "1.0"
SRC_URI = "... \
"
S = "${WORKDIR}"
inherit systemd
inherit bin_package
INSANE_SKIP_${PN} = "ldflags"
INHIBIT_PACKAGE_STRIP = "1"
INHIBIT_SYSROOT_STRIP = "1"
INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
do_compile() {
}
do_install () {
install -Dm 0644 ${S}/XXX.service ${D}/${systemd_unitdir}/system/XXX.service
}
SYSTEMD_SERVICE_${PN} = "XXX.service"
INSANE_SKIP_${PN} += "installed-vs-shipped"
Chen, It appears an answer to the question has been given. I have cleared NEEDINFO. Thanks, Stephen (In reply to comment #0) > line 231: > [ ! -e ${D}/init ] && ln -s ${rootlibexecdir}/systemd/systemd ${D}/init This is not line 231 in yocto 2.6.1 systemd_239.bb. Do you have local modifications or are you actually running some other yocto version? wei,
Sorry for late reply. I guess the cause is that your ubuntu18.04 does not have /lib/systemd/systemd, causing ${D}/init being a dead link.
I think you are right, using '-L' could solve this problem. As an alternative, you can use 'ln -sf' instead 'ln -s'.
You can send out patch if you like, as you have already found the solution.
You can send patch to openembedded-core@lists.openembedded.org, for both thud and master branches.
If not convenient, I'll do it for you.
Best Regards,
Chen Qi
wei, Do you still have this bug reproduced on your host? I cannot reproduce this problem, nor can I find out the host environment of the reporter. Qingjun(In reply to comment #9) > I cannot reproduce this problem, nor can I find out the host environment of > the reporter. Sorry didn't have a chance to try new release of Yocto. Will try to test against latest release in this week. Regards (In reply to comment #9) > I cannot reproduce this problem, nor can I find out the host environment of > the reporter. Hello Chen, I just tried systemd 2.41 on latest warrior-next branch. The problem still exists Below is the log. BTW I am running on a Ubuntu 18.04 X64. ln: failed to create symbolic link '/home/weiqj/rk-yocto-bsp/libre-hub/tmp/work/cortexa17hf-neon-vfpv4-rk-linux-gnueabi/systemd/1_241+AUTOINC+c1f8ff8d0d-r0/image/sbin/init': $ WARNING: exit code 1 from a shell command. ERROR: Function failed: do_install (log file is located at /home/weiqj/rk-yocto-bsp/libre-hub/tmp/work/cortexa17hf-neon-vfpv4-rk-linux-gnueabi/systemd/1_241+AUTOINC+c1f8ff8d0$ Still, I had to manually modify the script to make it work. Hi Wei,
I'm wondering why other people don't have such problem. I also use ubuntu hosts.
Do you have some additional layer which might have systemd bbappend files?
What does your run.do_install file under ${WORKDIR}/temp look like?
What creates the ${D}/init link before this line? [ ! -e ${D}/init ] && xxx
Could you please show your run.do_install file?
Also, you mentioned ${D}/init, but your error log is about ${D}/sbin/init.
Anyway, I think showing your run.do_install will help.
Wei? No reponse so I'm closing the defect. We'd be happy to have the defect re-opened if the needed info is provided. |
line 231: [ ! -e ${D}/init ] && ln -s ${rootlibexecdir}/systemd/systemd ${D}/init Will trigger symbolic link already exists error. On Ubuntu 18.04 bash. Should it be [ ! -L ${D}/init ] && ln -s ${rootlibexecdir}/systemd/systemd ${D}/init