summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorYann E. MORIN <yann.morin.1998@free.fr>2016-07-03 17:08:19 +0200
committerPeter Korsgaard <peter@korsgaard.com>2016-07-03 20:58:46 +0200
commit9cdb281fa64eb2b58ec1d25cb62c29268aa4b906 (patch)
tree4fac43d182183ac5c7a1d5d8d1890097ffdb6428 /fs
parent7d56f0cc554dd5deb7220323f46a7962b4ca804f (diff)
fs/common: add option to execute custom scripts under fakeroot
Some users have the need to be able to tweak the content of the target rootfs with root-like rights, that is, from inside the fakeroot script. Add a new system option to allow those users to provide a list of scripts, like the post-build and post-image scripts, that will be run from our fakeroot script. [Peter: pass TARGET_DIR to scripts, tweak help text] Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Cc: Peter Korsgaard <peter@korsgaard.com> Cc: Cam Hutchison <camh@xdna.net> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/common.mk3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/common.mk b/fs/common.mk
index b7202c30a..2b31e1293 100644
--- a/fs/common.mk
+++ b/fs/common.mk
@@ -92,6 +92,9 @@ endif
$$(call PRINTF,$$(PACKAGES_PERMISSIONS_TABLE)) >> $$(FULL_DEVICE_TABLE)
echo "$$(HOST_DIR)/usr/bin/makedevs -d $$(FULL_DEVICE_TABLE) $$(TARGET_DIR)" >> $$(FAKEROOT_SCRIPT)
endif
+ $$(foreach s,$$(call qstrip,$$(BR2_ROOTFS_POST_FAKEROOT_SCRIPT)),\
+ echo "echo '$$(TERM_BOLD)>>> Executing fakeroot script $$(s)$$(TERM_RESET)'" >> $$(FAKEROOT_SCRIPT); \
+ echo $$(s) $$(TARGET_DIR) $$(BR2_ROOTFS_POST_SCRIPT_ARGS) >> $$(FAKEROOT_SCRIPT)$$(sep))
$$(call PRINTF,$$(ROOTFS_$(2)_CMD)) >> $$(FAKEROOT_SCRIPT)
chmod a+x $$(FAKEROOT_SCRIPT)
PATH=$$(BR_PATH) $$(HOST_DIR)/usr/bin/fakeroot -- $$(FAKEROOT_SCRIPT)