Created attachment 5076 [details] Log of do_image step for core-image-minimal When DISTRO_FEATURES contains systemd, systemd_preset_all is added to IMAGE_PREPROCESS_COMMAND. This function uses recipe-sysroot-native/usr/bin/systemctl to create links in etc/systemd/system/, but in the rootfs of the image the processed files can point on nothing (depending on the host distro, mine is Ubunut 20.04). In fact it points to a file in /usr/lib/, that will be OK on the target but can not exist on the dev environment. In my case /dd/test-scarthgap-bug/build/tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0/rootfs/etc/systemd/system/default.target -> /usr/lib/systemd/system/multi-user.target, which triggers the error. This leads to an error in path.is_dir() test of systemctl, due to self.stat() test in python3.12 pathlib.py : def stat(self, *, follow_symlinks=True): """ Return the result of the stat() system call on this path, like os.stat() does. """ return os.stat(self, follow_symlinks=follow_symlinks) Same image with dunfell, using python3.8, worked fine, with different code in pathlib.py : def stat(self): """ Return the result of the stat() system call on this path, like os.stat() does. """ return self._accessor.stat(self) Tests conditions: build core-image-minimal with just poky layer activated.
We're potentially going to remove the systemctl reimplmentation shortly which hopefully will fix this.
I've verified that the proper systemctl does the right thing, and that is queued for master.
This should be fixed in oe-core 7a580800db391891a3a0f838c4ae6e1513c710a2.