Re: [PATCH 1/4] tools: add fakeroot

2020-08-09 Thread Paul Spooren



On 07.08.20 20:18, Felix Fietkau wrote:

On 2020-08-07 23:12, Paul Spooren wrote:

From: Thomas Petazzoni 

SELinux support requires setting the appropriate SELinux security context
to files and directories, which needs to happen at build time in order
to support read-only root filesystem scenarios. In order to create these
security contexts, we will have to run some SELinux-specific tools on
the host machine, but that requires root access. This adds support for
fakeroot, which the build process will use to run the SELinux security
context creation and the image creation.

Signed-off-by: Thomas Petazzoni 

Apply to current master, and adjust commit message

Thomas' original work is available at
http://lists.infradead.org/pipermail/openwrt-devel/2019-November/025976.html.

Signed-off-by: W. Michael Petullo 
[add rules.mk FAKEROOT variable]
Signed-off-by: Paul Spooren 
---
--- /dev/null
+++ b/tools/fakeroot/Makefile
@@ -0,0 +1,20 @@
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=fakeroot
+PKG_VERSION:=1.20.2

This version is rather ancient and also breaks on macOS.
I've updated it, fixed macOS support and pushed the result to my staging
tree at https://git.openwrt.org/?p=openwrt/staging/nbd.git;a=summary

Feel free to pick my version from there if you respin or merge the
series. When you do, please test it on a Linux machine again to make
sure I didn't break anything with my fixes :)

- Felix
Your latest version compiles fine on Linux and MacOS. The initial patch 
here is thereby obsolete.


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [PATCH 1/4] tools: add fakeroot

2020-08-08 Thread Felix Fietkau
On 2020-08-07 23:12, Paul Spooren wrote:
> From: Thomas Petazzoni 
> 
> SELinux support requires setting the appropriate SELinux security context
> to files and directories, which needs to happen at build time in order
> to support read-only root filesystem scenarios. In order to create these
> security contexts, we will have to run some SELinux-specific tools on
> the host machine, but that requires root access. This adds support for
> fakeroot, which the build process will use to run the SELinux security
> context creation and the image creation.
> 
> Signed-off-by: Thomas Petazzoni 
> 
> Apply to current master, and adjust commit message
> 
> Thomas' original work is available at
> http://lists.infradead.org/pipermail/openwrt-devel/2019-November/025976.html.
> 
> Signed-off-by: W. Michael Petullo 
> [add rules.mk FAKEROOT variable]
> Signed-off-by: Paul Spooren 
> ---
> --- /dev/null
> +++ b/tools/fakeroot/Makefile
> @@ -0,0 +1,20 @@
> +#
> +# This is free software, licensed under the GNU General Public License v2.
> +# See /LICENSE for more information.
> +#
> +include $(TOPDIR)/rules.mk
> +
> +PKG_NAME:=fakeroot
> +PKG_VERSION:=1.20.2
This version is rather ancient and also breaks on macOS.
I've updated it, fixed macOS support and pushed the result to my staging
tree at https://git.openwrt.org/?p=openwrt/staging/nbd.git;a=summary

Feel free to pick my version from there if you respin or merge the
series. When you do, please test it on a Linux machine again to make
sure I didn't break anything with my fixes :)

- Felix

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH 1/4] tools: add fakeroot

2020-08-07 Thread Paul Spooren
From: Thomas Petazzoni 

SELinux support requires setting the appropriate SELinux security context
to files and directories, which needs to happen at build time in order
to support read-only root filesystem scenarios. In order to create these
security contexts, we will have to run some SELinux-specific tools on
the host machine, but that requires root access. This adds support for
fakeroot, which the build process will use to run the SELinux security
context creation and the image creation.

Signed-off-by: Thomas Petazzoni 

Apply to current master, and adjust commit message

Thomas' original work is available at
http://lists.infradead.org/pipermail/openwrt-devel/2019-November/025976.html.

Signed-off-by: W. Michael Petullo 
[add rules.mk FAKEROOT variable]
Signed-off-by: Paul Spooren 
---
 rules.mk|  1 +
 tools/Makefile  |  2 +-
 tools/fakeroot/Makefile | 20 
 3 files changed, 22 insertions(+), 1 deletion(-)
 create mode 100644 tools/fakeroot/Makefile

diff --git a/rules.mk b/rules.mk
index 479172de03..45d96d6be4 100644
--- a/rules.mk
+++ b/rules.mk
@@ -264,6 +264,7 @@ endif
 
 BUILD_KEY=$(TOPDIR)/key-build
 
+FAKEROOT:=$(STAGING_DIR_HOST)/bin/fakeroot
 TARGET_CC:=$(TARGET_CROSS)gcc
 TARGET_CXX:=$(TARGET_CROSS)g++
 KPATCH:=$(SCRIPT_DIR)/patch-kernel.sh
diff --git a/tools/Makefile b/tools/Makefile
index 9bae09ece6..f038c90ba9 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -26,7 +26,7 @@ tools-y += m4 libtool autoconf autoconf-archive automake flex 
bison pkgconf mkli
 tools-y += sstrip make-ext4fs e2fsprogs mtd-utils mkimage
 tools-y += firmware-utils patch-image quilt padjffs2
 tools-y += mm-macros missing-macros cmake bc findutils gengetopt patchelf
-tools-y += mtools dosfstools libressl
+tools-y += mtools dosfstools libressl fakeroot
 tools-$(CONFIG_TARGET_orion_generic) += wrt350nv2-builder upslug2
 tools-$(CONFIG_TARGET_x86) += qemu
 tools-$(CONFIG_TARGET_mxs) += elftosb sdimage
diff --git a/tools/fakeroot/Makefile b/tools/fakeroot/Makefile
new file mode 100644
index 00..04d9a0dd60
--- /dev/null
+++ b/tools/fakeroot/Makefile
@@ -0,0 +1,20 @@
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=fakeroot
+PKG_VERSION:=1.20.2
+
+PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.bz2
+PKG_SOURCE_URL:=http://snapshot.debian.org/archive/debian/20141005T221953Z/pool/main/f/fakeroot
+PKG_HASH:=7c0a164d19db3efa9e802e0fc7cdfeff70ec6d26cdbdc4338c9c2823c5ea230c
+
+include $(INCLUDE_DIR)/host-build.mk
+
+HOST_CONFIGURE_VARS += \
+   ac_cv_header_sys_capability_h=no \
+   ac_cv_func_capset=no
+
+$(eval $(call HostBuild))
-- 
2.25.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel