9
9
apparmor-$(CONFIG_SECURITY_APPARMOR_COMPAT_24) += apparmorfs-24.o
11
clean-files: capability_names.h af_names.h
11
clean-files := capability_names.h rlim_names.h af_names.h
13
# Build a lower case string table of capability names
14
# Transforms lines from
15
# #define CAP_DAC_OVERRIDE 1
17
# [1] = "dac_override",
13
18
quiet_cmd_make-caps = GEN $@
14
cmd_make-caps = echo "static const char *capability_names[] = {" > $@ ; sed -n -e "/CAP_FS_MASK/d" -e "s/^\#define[ \\t]\\+CAP_\\([A-Z0-9_]\\+\\)[ \\t]\\+\\([0-9]\\+\\)\$$/[\\2] = \"\\1\",/p" $< | tr A-Z a-z >> $@ ; echo "};" >> $@
19
cmd_make-caps = echo "static const char *capability_names[] = {" > $@ ;\
20
sed $< >>$@ -r -n -e '/CAP_FS_MASK/d' \
21
-e 's/^\#define[ \t]+CAP_([A-Z0-9_]+)[ \t]+([0-9]+)/[\2] = "\L\1",/p';\
16
24
quiet_cmd_make-af = GEN $@
17
25
cmd_make-af = echo "static const char *address_family_names[] = {" > $@ ; sed -n -e "/AF_MAX/d" -e "/AF_LOCAL/d" -e "s/^\#define[ \\t]\\+AF_\\([A-Z0-9_]\\+\\)[ \\t]\\+\\([0-9]\\+\\)\\(.*\\)\$$/[\\2] = \"\\1\",/p" $< | tr A-Z a-z >> $@ ; echo "};" >> $@
27
# Build a lower case string table of rlimit names.
28
# Transforms lines from
29
# #define RLIMIT_STACK 3 /* max stack size */
31
# [RLIMIT_STACK] = "stack",
33
# and build a second integer table (with the second sed cmd), that maps
34
# RLIMIT defines to the order defined in asm-generic/resource.h Thi is
35
# required by policy load to map policy ordering of RLIMITs to internal
36
# ordering for architectures that redefine an RLIMIT.
37
# Transforms lines from
38
# #define RLIMIT_STACK 3 /* max stack size */
19
41
quiet_cmd_make-rlim = GEN $@
20
cmd_make-rlim = echo "static const char *rlim_names[] = {" > $@ ; sed -n --e "/AF_MAX/d" -e "s/^\# \\?define[ \\t]\\+RLIMIT_\\([A-Z0-9_]\\+\\)[ \\t]\\+\\([0-9]\\+\\)\\(.*\\)\$$/[\\2] = \"\\1\",/p" $< | tr A-Z a-z >> $@ ; echo "};" >> $@ ; echo "static const int rlim_map[] = {" >> $@ ; sed -n -e "/AF_MAX/d" -e "s/^\# \\?define[ \\t]\\+\\(RLIMIT_[A-Z0-9_]\\+\\)[ \\t]\\+\\([0-9]\\+\\)\\(.*\\)\$$/\\1,/p" $< >> $@ ; echo "};" >> $@
42
cmd_make-rlim = echo "static const char *rlim_names[] = {" > $@ ;\
44
-e 's/^\# ?define[ \t]+(RLIMIT_([A-Z0-9_]+)).*/[\1] = "\L\2",/p';\
46
echo "static const int rlim_map[] = {" >> $@ ;\
47
sed -r -n "s/^\# ?define[ \t]+(RLIMIT_[A-Z0-9_]+).*/\1,/p" $< >> $@ ;\
22
50
$(obj)/capability.o : $(obj)/capability_names.h
23
51
$(obj)/net.o : $(obj)/af_names.h