[openwrt/openwrt] build: use numeric uid/gid on cpio calls

LEDE Commits lede-commits at lists.infradead.org
Wed Mar 3 15:10:28 GMT 2021


nbd pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/785ab2b62c8d9366023095641f2ba237e2b0ed8e

commit 785ab2b62c8d9366023095641f2ba237e2b0ed8e
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Wed Mar 3 16:09:04 2021 +0100

    build: use numeric uid/gid on cpio calls
    
    There are systems that don't have the 'root' group, so don't rely on host
    specific user/group names
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 include/image.mk           | 2 +-
 include/kernel-defaults.mk | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/image.mk b/include/image.mk
index 7f0d27b746..993de5ff53 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -301,7 +301,7 @@ endif
 
 ifdef CONFIG_TARGET_ROOTFS_CPIOGZ
   define Image/Build/cpiogz
-	( cd $(TARGET_DIR); find . | $(STAGING_DIR_HOST)/bin/cpio -o -H newc -R root:root | gzip -9n >$(BIN_DIR)/$(IMG_ROOTFS).cpio.gz )
+	( cd $(TARGET_DIR); find . | $(STAGING_DIR_HOST)/bin/cpio -o -H newc -R 0:0 | gzip -9n >$(BIN_DIR)/$(IMG_ROOTFS).cpio.gz )
   endef
 endif
 
diff --git a/include/kernel-defaults.mk b/include/kernel-defaults.mk
index ade31b0dc1..4b0b136a03 100644
--- a/include/kernel-defaults.mk
+++ b/include/kernel-defaults.mk
@@ -163,7 +163,7 @@ ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS_SEPARATE),y)
 ifeq ($(CONFIG_EXTERNAL_CPIO),y)
 	$(CP) $(CONFIG_EXTERNAL_CPIO) $(KERNEL_BUILD_DIR)/initrd.cpio
 else
-	( cd $(TARGET_DIR); find . | $(STAGING_DIR_HOST)/bin/cpio -o -H newc -R root:root > $(KERNEL_BUILD_DIR)/initrd.cpio )
+	( cd $(TARGET_DIR); find . | $(STAGING_DIR_HOST)/bin/cpio -o -H newc -R 0:0 > $(KERNEL_BUILD_DIR)/initrd.cpio )
 endif
 	$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_BZIP2),bzip2 -9 -c < $(KERNEL_BUILD_DIR)/initrd.cpio > $(KERNEL_BUILD_DIR)/initrd.cpio.bzip2)
 	$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_GZIP),gzip -f -S .gzip -9n $(KERNEL_BUILD_DIR)/initrd.cpio)



More information about the lede-commits mailing list