meta data for this page
This is an old revision of the document!
split packages
How to customise /etc/fstab per image ?
/etc/fstab is provided by base-files.
- create
base-files-Xandbase-files-Ypackages with the same content asbase-fileswith only changed/etc/fstab: https:// yocto.yoctoproject.narkive.com/XcannnRd/per-image-customizations - Search in Yocto for
python populate_packagesand see what others do
almost works
Adapted solution from 1st link almost works. Until SPDX fails because base-files-devel provides base-files.
PACKAGES += "${PN}-devel" PROVIDES += "${PN}-devel" CONFFILES:${PN}-devel = "${CONFFILES:${PN}}" RREPLACES:${PN}-devel = "${PN}" RCONFLICTS:${PN}-devel = "${PN}" # ${PN}-devel also provides ${PN} - for compatibility with other packages # But it breaks SPDX generation in do_rootfs so disable it RPROVIDES:${PN}-devel = "${PN}" CVE_PRODUCT:${PN}-devel = "base-files" python populate_packages:prepend() { import shutil packages = ("${PN}-devel",) # PKGD (Package Destination Directory): This is the directory where files are # staged before they are split into individual packages. It represents the intermediate, # unsplit state of the files that do_install has already installed. # # PKGDEST (Package Destination): This is the parent directory where packages reside after they have # been split. It is often referred to as the packages-split directory, containing subdirectories for # each package (e.g., pkg-name, pkg-name-dbg, pkg-name-dev). preinst = d.getVar('pkg_preinst:${PN}') for package in packages: d.setVar(d.expand(f"pkg_preinst:{package}"), preinst) # copy ${PN} content to other packages shutil.copytree(d.expand("${PKGD}"), d.expand("${PKGDEST}"+ f"/{package}"), symlinks=True) # replace fstab if package == "${PN}-devel": shutil.copy(d.expand("${WORKDIR}/fstab-devel"), d.expand("${PKGDEST}/${PN}-devel/etc/fstab")) } INSANE_SKIP:${PN}-devel += "empty-dirs"
Headline
Create second .bb file and include content of original file.