Skip to contentSkip to conversation

tests/Makefile: silence modprobe output

PATCH In review Ondrej Mosnacek 1 participant 2 messages Nov 4, 2020 – Nov 9, 2020 SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests/Makefile: silence modprobe output

Avoid obtrusive error messages when the kernel doesn't support some of the filesystems.

---
 tests/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/Makefile +1 -1
index b441031..4c00b5f 100644
@@ -19,7 +19,7 @@ MAX_KERNEL_POLICY := $(shell cat $(SELINUXFS)/policyvers)
 POL_TYPE := $(shell ./pol_detect $(SELINUXFS))
 
 # Filter out unavailable filesystems
-FILESYSTEMS := $(foreach fs,$(FILESYSTEMS),$(shell modprobe $(fs) && echo $(fs)))
+FILESYSTEMS := $(foreach fs,$(FILESYSTEMS),$(shell modprobe $(fs) &>/dev/null && echo $(fs)))
 
 SUBDIRS:= domain_trans entrypoint execshare exectrace execute_no_trans \
 	fdreceive inherit link mkdir msg open ptrace readlink relabel rename \
Signature · 1 line
2.26.2
#1 lore raw
Quoted 22 lines · Ondrej Mosnacek

Avoid obtrusive error messages when the kernel doesn't support some of the filesystems.

---
 tests/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/Makefile +1 -2
index b441031..4c00b5f 100644
@@ -19,7 +19,7 @@ MAX_KERNEL_POLICY := $(shell cat $(SELINUXFS)/policyvers)
 POL_TYPE := $(shell ./pol_detect $(SELINUXFS))
 
 # Filter out unavailable filesystems
-FILESYSTEMS := $(foreach fs,$(FILESYSTEMS),$(shell modprobe $(fs) && echo $(fs)))
+FILESYSTEMS := $(foreach fs,$(FILESYSTEMS),$(shell modprobe $(fs) &>/dev/null && echo $(fs)))
 
 SUBDIRS:= domain_trans entrypoint execshare exectrace execute_no_trans \
        fdreceive inherit link mkdir msg open ptrace readlink relabel rename \
--
Quoted 1 line

2.26.2

Applied"
https://github.com/SELinuxProject/selinux-testsuite/commit/bfa5a13114e4871b93cf87112b075f2d23698e6f

--
Ondrej Mosnacek
Software Engineer, Platform Security - SELinux kernel Red Hat, Inc.