| Summary: | kernel: do_symlink_kernsrc is not reentrant when S is overriden | ||
|---|---|---|---|
| Product: | [Build System, Metadata & Runtime] OE-Core | Reporter: | Etienne Cordonnier <ecordonnier> |
| Component: | kernel | Assignee: | Unassigned <unassigned> |
| Status: | IN PROGRESS REVIEW --- | QA Contact: | |
| Severity: | normal | ||
| Priority: | Medium | CC: | randy.macleod, tom.zanussi |
| Version: | 5.1 | ||
| Target Milestone: | 6.1 | ||
| Hardware: | x86 | ||
| OS: | Multiple | ||
| Whiteboard: | |||
| OS type for building Yocto: | --- | Type of Regression: | --- |
| Verified: | Documentation change: | No (bug/feature does not impact docs) | |
Patch on list, thanks! Etienne, I took a quick look but didn't find a commit in master. Please provide a commit link if that exists. Randy, there is no patch merged. I received some feedback after a couple of months, and then haven't found time to react on the feedback and work on a new version of the patch. Thanks for the update, Etienne. This was the latest feedback I got: https://lists.openembedded.org/g/openembedded-core/message/195238?p=%2C%2C%2C20%2C0%2C0%2C0%3A%3Acreated%2C%2Creentrant%2C20%2C2%2C0%2C103308574 Bulk move of 5.1 bugs to 5.2. -- YP bug review (Randy) I unassigned myself, because I don't know when I will have time to work on this. In principle this should be fixed, even though it's only a corner-case with some specific preconditions, so not high priority. Bulk move of all unassigned 5.2 medium importance bugs to 5.3. |
The function do_symlink_kernsrc is not reentrant in the case where S is defined to a non-default value. How to reproduce (tested with commit 7d06e4e30b39a901a3d0b263d5de43f954c3270b of poky which is quite close to master): - add this line to meta/recipes-kernel/linux/linux-yocto_6.5.bb: S = "${WORKDIR}/my-kernel-source-dir" - build linux-yocto a first time: bitbake linux-yocto This works, and you can see that the function do_symlink_kernsrc created a symlink : ``` poky/build$ ls -l tmp/work-shared/qemux86-64/ total 8 drwxr-xr-x 2 ecordonnier ecordonnier 4096 Dec 15 13:18 kernel-build-artifacts drwxr-xr-x 2 ecordonnier ecordonnier 4096 Dec 15 13:18 kernel-source poky/build$ ls -l tmp/work/qemux86_64-poky-linux/linux-yocto/6.5.13+git/ total 1480 ... ... lrwxrwxrwx 1 ecordonnier ecordonnier 73 Dec 15 13:18 my-kernel-source-dir -> /home/ecordonnier/dev/poky/build/tmp/work-shared/qemux86-64/kernel-source ``` - Build a second time (in reality this happened to me when building again after updating poky to a version which modified kernel.bbclass): bitbake -C symlink_kernsrc linux-yocto This will fail, and leave the directory structure in a completely broken state: kernel-source is now a symlink to itself, and my-kernel-source-dir is a broken symlink: ``` poky/build$ ls -l tmp/work-shared/qemux86-64/ total 8 drwxr-xr-x 2 ecordonnier ecordonnier 4096 Dec 15 13:18 kernel-build-artifacts lrwxrwxrwx 1 ecordonnier ecordonnier 73 Dec 15 13:18 kernel-source -> /home/ecordonnier/dev/poky/build/tmp/work-shared/qemux86-64/kernel-source poky/build$ ls -l tmp/work/qemux86_64-poky-linux/linux-yocto/6.5.13+git/ ... lrwxrwxrwx 1 ecordonnier ecordonnier 73 Dec 15 13:20 my-kernel-source-dir -> /home/ecordonnier/dev/poky/build/tmp/work-shared/qemux86-64/kernel-source ```