summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorPeter Korsgaard <peter@korsgaard.com>2016-11-27 00:40:27 +0100
committerPeter Korsgaard <peter@korsgaard.com>2016-11-27 20:31:37 +0100
commit01354e1a0f4333ffee40a20260a5689e3846560c (patch)
tree1e96f2c76bc055e02f02ef06376540b876a3db2d /fs
parentc11156270601758cb2c877d56a4568d4e57372f9 (diff)
fs/ubifs: work around fakeroot / sed -i issue on systems with SELinux enabled
Fixes #9386 GNU sed -i misbehaves on systems with SELinux enabled, as it tries to copy to the SELinux security context (xattr) from the source file to to the new destination file, which fails under fakeroot and leaves the file with 000 permissions, causing ubinize to fail when it cannot read to configuration file. So as a workaround, combine the install and tweak steps in a single sed with a redirect to the destination file instead. Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/ubifs/ubi.mk6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/ubifs/ubi.mk b/fs/ubifs/ubi.mk
index cda4bf489..e488cb5f8 100644
--- a/fs/ubifs/ubi.mk
+++ b/fs/ubifs/ubi.mk
@@ -20,9 +20,11 @@ else
UBINIZE_CONFIG_FILE_PATH = fs/ubifs/ubinize.cfg
endif
+# don't use sed -i as it misbehaves on systems with SELinux enabled when this is
+# executed through fakeroot (see #9386)
define ROOTFS_UBI_CMD
- $(INSTALL) -m 0644 $(UBINIZE_CONFIG_FILE_PATH) $(BUILD_DIR)/ubinize.cfg
- $(SED) 's;BR2_ROOTFS_UBIFS_PATH;$@fs;' $(BUILD_DIR)/ubinize.cfg
+ sed 's;BR2_ROOTFS_UBIFS_PATH;$@fs;' \
+ $(UBINIZE_CONFIG_FILE_PATH) > $(BUILD_DIR)/ubinize.cfg
$(HOST_DIR)/usr/sbin/ubinize -o $@ $(UBI_UBINIZE_OPTS) $(BUILD_DIR)/ubinize.cfg
rm $(BUILD_DIR)/ubinize.cfg
endef