aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Chris Lesiak <chris.lesiak@licor.com>2018-04-30 12:14:11 -0500
committerGravatar Peter Korsgaard <peter@korsgaard.com>2018-05-03 23:25:12 +0200
commitfea6cf8c09c1d8ac7f1a86bd6568e36d10810e14 (patch)
tree258ce5db3b745147be944de3b96bf0f5e4b5b8d8
parent36e19e3f6a5edb7b644e5269d2b07be3d44c5288 (diff)
downloadbuildroot-fea6cf8c09c1d8ac7f1a86bd6568e36d10810e14.tar.gz
buildroot-fea6cf8c09c1d8ac7f1a86bd6568e36d10810e14.tar.bz2
Makefile: Update mtime of $(TARGET_DIR)/usr in target-finalize
The systemd ConditionNeedsUpdate option is useful when offline updates of the vendor operating system resources in /usr require updating of /etc or /var on the next following boot. Two examples of services making use of this option are systemd-hwdb-update.service and systemd-sysusers.service. ConditionNeedsUpdate=/etc will be true if the mtime of /etc/.updated is older than the mtime of /usr. After services conditional on ConditionNeedsUpdate have run, systemd-update-done.service will synch the mtime of /usr to /etc/.updated so that the condition will be false on subsequent boots. For systems with writable /usr partitions where updates are done to the running system, the update program will touch /usr as a final step. But with Buildroot, where updates are often done by dumping a new image onto the device, and where /usr is on a filesystem mounted read-only, touching /usr as part of the update process is not practical. Instead, it should be done a build time. For testers, please note that systemd-update-done in v234 added a regression where the mtime of /etc/.updated is set to the current time instead of the mtime or /usr. This will be fixed in v239. For more details, see: http://0pointer.de/public/systemd-man/systemd.unit.html http://0pointer.de/public/systemd-man/systemd-update-done.service.html Signed-off-by: Chris Lesiak <chris.lesiak@licor.com> Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com> (cherry picked from commit bbe5c6dad4da9cd174d5ef21caa73557e4592b31) Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
-rw-r--r--Makefile2
1 files changed, 2 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 8004cc2925..479ce74dc1 100644
--- a/Makefile
+++ b/Makefile
@@ -761,6 +761,8 @@ endif
$(call MESSAGE,"Executing post-build script $(s)"); \
$(EXTRA_ENV) $(s) $(TARGET_DIR) $(call qstrip,$(BR2_ROOTFS_POST_SCRIPT_ARGS))$(sep))
+ touch $(TARGET_DIR)/usr
+
.PHONY: target-post-image
target-post-image: $(TARGETS_ROOTFS) target-finalize
@$(foreach s, $(call qstrip,$(BR2_ROOTFS_POST_IMAGE_SCRIPT)), \