Skip to contentSkip to conversation

linux/linux.mk: add automatic selinux config selection

PATCH New aduskett at gmail.com 2 participants 2 messages Mar 12, 2020 – Mar 14, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 linux/linux.mk: add automatic selinux config selection

From: Adam Duskett <[email protected]>

Enabling SELinux support in the kernel requires several options, many of which are in different areas. These options are as follows:

- CONFIG_AUDIT
- CONFIG_DEFAULT_SECURITY_SELINUX
- CONFIG_INET
- CONFIG_NET
- CONFIG_SECURITY
- CONFIG_SECURITY_NETWORK
- CONFIG_SECURITY_SELINUX

As such, if a user selects the libselinux package, it is much easier to select these packages for them, much like we already do with other packages such as systemd or iptables.

---
 linux/linux.mk | 8 ++++++++
 1 file changed, 8 insertions(+)
linux/linux.mk +8 -0
index 4b60f33ff3..f8c34c3dca 100644
@@ -406,6 +406,14 @@ define LINUX_KCONFIG_FIXUP_CMDS
 		$(call KCONFIG_ENABLE_OPT,CONFIG_FB,$(@D)/.config)
 		$(call KCONFIG_ENABLE_OPT,CONFIG_LOGO,$(@D)/.config)
 		$(call KCONFIG_ENABLE_OPT,CONFIG_LOGO_LINUX_CLUT224,$(@D)/.config))
+	$(if $(BR2_PACKAGE_LIBSELINUX),
+		$(call KCONFIG_ENABLE_OPT,CONFIG_AUDIT,$(@D)/.config)
+		$(call KCONFIG_ENABLE_OPT,CONFIG_DEFAULT_SECURITY_SELINUX,$(@D)/.config)
+		$(call KCONFIG_ENABLE_OPT,CONFIG_INET,$(@D)/.config)
+		$(call KCONFIG_ENABLE_OPT,CONFIG_NET,$(@D)/.config)
+		$(call KCONFIG_ENABLE_OPT,CONFIG_SECURITY,$(@D)/.config)
+		$(call KCONFIG_ENABLE_OPT,CONFIG_SECURITY_NETWORK,$(@D)/.config)
+		$(call KCONFIG_ENABLE_OPT,CONFIG_SECURITY_SELINUX,$(@D)/.config))
 endef
 
 ifeq ($(BR2_LINUX_KERNEL_DTS_SUPPORT),y)
Signature · 1 line
2.24.1
#1 lore raw

PATCH 1/1 linux/linux.mk: add automatic selinux config selection

Quoted 13 lines · On Thu, 12 Mar 2020 11:09:08 -0700 aduskett at gmail.com wrote:

From: Adam Duskett <[email protected]>

Enabling SELinux support in the kernel requires several options, many of which are in different areas. These options are as follows:

- CONFIG_AUDIT
- CONFIG_DEFAULT_SECURITY_SELINUX
- CONFIG_INET
- CONFIG_NET
- CONFIG_SECURITY
- CONFIG_SECURITY_NETWORK
- CONFIG_SECURITY_SELINUX

Quoted 8 lines

As such, if a user selects the libselinux package, it is much easier to select these packages for them, much like we already do with other packages such as systemd or iptables.

---
 linux/linux.mk | 8 ++++++++
 1 file changed, 8 insertions(+)

Applied to master, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com