I have a custom Yocto 'image' recipe, that uses IMAGE_INSTALL += "... "
to construct the image, which also contains Python 3.5. Unfortunately, the often-used /usr/bin/pdb
symlink is not created, and my users expect to be able to run pdb
from the command line. So I want to make a single symlink for this, within the image. If it were run on the target, it would be the result of this command:
ln -s /usr/lib/python3.5/pdb.py /usr/bin/pdb
I understand I can create a custom task in the image recipe with this sort of construct:
addtask create_pdb_symlink before do_image
do_create_pdb_symlink () {
ln -s /usr/lib/python3.5/pdb.py ${D}/usr/bin/pdb
}
However this doesn't work because I'm guessing at using ${D}
, and I don't think the filesystem is staged at that point. It generates this error:
DEBUG: Executing shell function do_create_pdb_symlink
ln: failed to create symbolic link
'/home/user/project/build/tmp/work/custom-linux/my-image/1.0-r0/image/usr/bin/pdb': No such file or directory
WARNING: exit code 1 from a shell command.
Inspecting the filesystem confirms that /home/user/project/build/tmp/work/custom-linux/
exists, but /home/user/project/build/tmp/work/custom-linux/my-image
does not.
There are some directories in that custom-linux
directory, one of which is called rootfs
and looks suspiciously useful, but I'm not sure if my task should be poking around below the my-image
directory.
So my questions are:
- is this the right approach?
- or should I create a brand new recipe just to construct this single symlink?
- or should I create a
python3-core.bbappend
to do this task? - or is there a reason why this isn't being created by the python recipe itself?