aboutsummaryrefslogtreecommitdiffstats
path: root/meta/classes/rootfs-postcommands.bbclass
AgeCommit message (Collapse)Author
2017-12-09rootfs-postcommands.bbclass: ensure that rootfs gets mounted roPatrick Ohly
When read-only-rootfs is active, we need to ensure that the rootfs does not get mounted read/write by the kernel or initramfs. Adding "ro" to the boot parameters achieves that. Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-09-25meta: drop True option to getVar callsMing Liu
Search made with the following regex: getVar ?\((.*), True\). Signed-off-by: Ming Liu <liu.ming50@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-25classes: drop image dependencies on TOPDIR variablePaul Eggleton
We don't need a dependency on this variable changing, and having one causes locked signature warnings during eSDK installation if you have INITRAMFS_IMAGE_* set (since TOPDIR will always be different between the eSDK and the environment in which it was built). Relates to [YOCTO #12102]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-05rootfs-postcommands: add test for unsatisfied RRECOMMENDSJose Alarcon
The do_rootfs log contains a number of unsatisfied package recommendations. At the moment those are only visible when reviewing the rootfs log. This patch adds an extra check to surface any unsatisfied recommendation as WARNINGS to the build output. Enable this check with: ROOTFS_POSTPROCESS_COMMAND += "rootfs_log_check_recommends;" Signed-off-by: Jose Alarcon <jose.alarcon@ge.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-05rootfs-postcommands: remove empty lineJose Alarcon
Signed-off-by: Jose Alarcon <jose.alarcon@ge.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-18rootfs-postcommands.bbclass: Filter out dangling symlinks in ↵Khem Raj
ssh_allow_empty_password() In images built with pam in DISTRO_FEATURES, we end up with dangling symlinks if su is not packaged into image $ ls /mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/core-image-minimal/1.0-r0/rootfs/etc/pam.d/su-l -l lrwxrwxrwx 1 kraj users 2 Aug 9 07:56 /mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/core-image-minimal/1.0-r0/rootfs/etc/pam.d/su-l -> su This causes image do_rootfs to fail | sed: can't read /mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/core-image-minimal/1.0-r0/rootfs/etc/pam.d/s u-l: No such file or directory | WARNING: /mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/core-image-minimal/1.0-r0/temp/run.ssh_allow_empty_ password.19238:1 exit 2 from 'sed -i 's/nullok_secure/nullok/' /mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi /core-image-minimal/1.0-r0/rootfs/etc/pam.d/*' Therefore we need to filter out dangling symlinks before sed'ing things out Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-18rootfs-postcommands.bbclass: Prevent linking testdata to itselfMike Looijmans
testdata and testdata_link may point to the same file, in particular when IMAGE_LINK_NAME and IMAGE_NAME are equal. Check if this is the case before creating a symlink that points to itself and makes the next build fail. Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-12openssh: allow to override OpenSSL HostKeys when read-only-rootfsAndré Draszik
With these changes it is possible to have a .bbappend that - sets SYSCONFDIR to some persistent storage - modifies SYSCONFDIR/sshd_config to use ssh host keys from the (writable) sysconfdir Signed-off-by: André Draszik <adraszik@tycoint.com> Reviewed-by: Stephane Ayotte <sayotte@tycoint.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-05-16rootfs-postcommands.bbclass: Check if "/etc/fstab" existsPanagiotis Tamtamis
Using "read-only-rootfs" feature in minimal or special purpose images (eg mounted images) makes build to fail because ${IMAGE_ROOTFS}/etc/fstab file does not exist. Signed-off-by: Panagiotis Tamtamis <panagiotis.tamtamis@unify.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-04-20rootfs-postcommands.bbclass: save relative pathsbrian avery
We pass the TOPDIR to do a search/replace in export2json so that we save relative paths in the testdata.json file rather than absolute paths. This is to allow the images and kernels to be relocated yet still allow testimage to work. [YOCTO #11375] Signed-off-by: brian avery <brian.avery@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-01-31rootfs-postcommands.bbclass: drop insert_feed_uris functionMing Liu
The source makes no reference to insert_feed_uris any more, simply drop the unused reference, to avoid confusing the developers. Signed-off-by: Ming Liu <peter.x.liu@external.atlascopco.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-01-31meta: remove remaining True option to getVar callsMing Liu
This is a complementary fix to commit 7c552996: [ meta: remove True option to getVar calls ] it intended to remove all True option to getVar calls, but there are still some remaining. Search made with the following regex: getVar ?\((.*), True\) Signed-off-by: Ming Liu <peter.x.liu@external.atlascopco.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-01-23classes/rootfs-postcommands: Add write_image_test_dataAníbal Limón
This function will generates testdata.json by image type. [YOCTO #10231] Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
2017-01-16rootfs-postcommands.bbclass: sort passwd entriesPatrick Ohly
The /etc passwd files in a rootfs consist of the default entries from base-passwd plus anything that gets added via package installation, EXTRA_USERS_PARAMS and/or system sysusers. The execution order of preinst scripts is not perfectly deterministic, or at least unrelated changes caused it to change in a non-deterministic way, resulting in irrelevant changes in the order of passwd entries. useradd-staticids.bbclass ensures that the numeric IDs don't change, but re-ordering can still occur, which is bad for reproducible builds and file-based update mechanisms like swupd which work best if changes are as minimal as possible. To achieve that, the files get sorted in a post-processing command, enabled by default. Sorting is based primarily on the numeric IDs, so for example, the "root" user continues to be listed first. "nobody" now is at the end, which wasn't the case before. The order of the entries should not matter, but in obscure cases where it does (like having multiple entries for the same numeric ID) this behavior can be disabled by setting SORT_PASSWD_POSTPROCESS_COMMAND to an empty string. Fixes: YOCTO #10520 Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-12-16meta: remove True option to getVar callsJoshua Lock
getVar() now defaults to expanding by default, thus remove the True option from getVar() calls with a regex search and replace. Search made with the following regex: getVar ?\(( ?[^,()]*), True\) Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-10-15Remove RM_OLD_IMAGE, it's no longer usefulJoshua Lock
Since the move to put image deployment under sstate control in d54339d4b1a7e884de636f6325ca60409ebd95ff old images are automatically removed before a new image is deployed (the default behaviour of the sstate logic). RM_OLD_IMAGE is therefore no longer required to provide this behaviour, remove the variable and its users. Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-09-04image: Deploy images to IMGDEPLOYDIREd Bartosh
Changed deployment directory from DEPLOY_DIR_IMAGE to IMGDEPLOYDIR to make sstate machinery to do final deployment and generate manifest. Renamed variable deploy_dir to deploy_dir_image in selftest code to avoid confusion with DEPLOYDIR variable. Updated the code of rootfs.py:Rootfs class to use IMGDEPLOYDIR variable as it's now used as a new deployment destination. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-21systemd: allow add users to groups in rootfs postprocessStephano Cetola
Currently the functionality checks for the "u" and "g" flags to create users and groups, but not the "m" flag to add users to groups. This change first checks to be sure that the users and groups are created, creates them if necessary, then adds the user to the group. Signed-off-by: Stephano Cetola <stephano.cetola@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-01systemd: allow add users as a rootfs postprocess cmdStephano Cetola
Adding all the users / groups to systemd is only available for readonly file systems. This change allows users to add them to read / write file systems as well by specifying: ROOTFS_POSTPROCESS_COMMAND += "systemd_create_users" Also, add "--shell /sbin/nologin" to each user's add params. [ YOCTO #9497 ] Signed-off-by: Stephano Cetola <stephano.cetola@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-14rootfs-postcommands: handle broken links when writing manifestRoss Burton
If the manifest link is broken then os.path.exists() returns False so the link isn't removed, resulting in the os.symlink() call failing as the file already exists. Prevent this by using os.path.lexists to check that the symlink itself exists, not the target. Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-03-28rootfs-postcommands: don't write manifest when IMAGE_MANIFEST emptyJoshua Lock
Return early in write_image_manifest () if the IMAGE_MANIFEST variable is unset. This allows us to prevent writing of the manifest where we prevent images being created for a recipe by unsetting IMAGE_FSTYPES. Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-28rootfs-postcommands: fix ssh_allow_empty_password checkingJonathan Liu
The ssh_allow_empty_password function doesn't check if sshd_config_readonly exists before running sed which can result in an error if sshd_config exists but sshd_config_readonly doesn't. Signed-off-by: Jonathan Liu <net147@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-01-26rootfs-postcommands: fix allow-empty-password on read-only rootfsRoss Burton
When a read-only rootfs is being used sshd uses a different sshd_config file, which also needs to be editted. [ YOCTO #8680 ] Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-20lib/oe/rootfs: Use list_pkgs() instead of list()Mariano Lopez
This patch changes the use list_pkgs() instead of list() from class RpmPkgsList. The change is in two functions, image_list_installed_packages from rootfs.py and sdk_list_installed_packages from sdk.py. With this change the functions calling the functions listed above, must format the output as they required. The formatting can be done using format_pkg_list() from oe.utils. The classes calling the afected functions are changed too with this patch, to keep the same functionality using the new data structure. [YOCTO #7427] Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-01-19rootfs-postcommands: Ensure license manifests respect RM_OLD_IMAGERichard Purdie
When RM_OLD_IMAGE is set, old manifest files should be removed along with old image files and our QA tests expect this. This patch ensures this happens. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-11image: Create separate tasks for rootfs constructionRichard Purdie
This patch splits the code in lib/oe/image into separate tasks, one per image type. This removes the need for the simple task graph code and defers to the bitbake task management code to handle this instead. This is a good step forward in splitting up the monolithic code and starting to make it more accessible to people. It should also make it easier for people to hook in other tasks and processes into the rootfs code. Incidentally, the reason this code was all combined originally was due to limitations of fakeroot where if you exited the session, you lost permissions data. With pseudo this constraint was removed. We did start to rework the rootfs/image code previously and got so far with untangling it however we did prioritise some performance tweaks over splitting into separate tasks and in hindsight, this was a mistake and should have been done the other way around. That work was suspended due to changes in the people working on the project but this split has always been intended, now is the time to finish it IMO. There were some side effects of doing this: * The symlink for the manifest moves to the rootfs-postcommands class and into the manifest function. * There is no seperate "symlink removal" and "symlink creation", they are merged * The date/time stamps of the manifest and the built images can now be different since the tasks can be run separately and the datetime stamp will then be different between do_rootfs and the do_image_* tasks. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-05image/rootfs-postcommands: Separate out post rootfs commands to separate classRichard Purdie
Reading image.bbclass is a little difficult as it has many post rootfs helper functions and its hard to separate those from the core contents of the rootfs/image code. Moving it to a separate class would be one way of making it clearer what these functions are. There are some comment layout improvements but no code changes. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>