summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
Diffstat (limited to 'runtime')
-rw-r--r--runtime/uprobes/Makefile44
1 files changed, 20 insertions, 24 deletions
diff --git a/runtime/uprobes/Makefile b/runtime/uprobes/Makefile
index 35942052..4e1280ef 100644
--- a/runtime/uprobes/Makefile
+++ b/runtime/uprobes/Makefile
@@ -10,12 +10,9 @@ CLEAN_FILES += Module.markers modules.order Module.symvers
CLEAN_DIRS := .tmp_versions
# Build the module and sign it.
-# Make sure that all of the generated files belong the group stap-server
-# and are writable by that group. This is so that the stap-server service
-# can build or rebuild the module, if necessary.
-# If the chgrp and/or chmod commands fail, it is because we are not the
-# owner of the file for directory. In this case the file or directory
-# was created during a previous build and already has the correct permissions.
+# Ensure that the generated files are writeable by the group which
+# owns this build directory. This is so that the stap-server service
+# can rebuild the module, if necessary.
default:
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
if test -f ../../../../bin/stap-sign-module; then \
@@ -25,26 +22,25 @@ default:
fi \
done \
fi
- if getent group stap-server >/dev/null; then \
- for f in $(CLEAN_FILES); do \
- test ! -f $$f && continue; \
- chgrp stap-server $$f 2>/dev/null; \
- chmod 664 $$f 2>/dev/null; \
+ group=`stat -c %G $(PWD)`; \
+ for f in $(CLEAN_FILES); do \
+ test ! -f $$f && continue; \
+ chgrp -f $$group $$f; \
+ chmod -f 664 $$f; \
+ done; \
+ for d in $(CLEAN_DIRS); do \
+ test ! -d $$d && continue; \
+ chgrp -f $$group $$d; \
+ chmod -f 775 $$d; \
+ for dd in `find $$d -type d`; do \
+ chgrp -f $$group $$dd; \
+ chmod -f 775 $$dd; \
done; \
- for d in $(CLEAN_DIRS); do \
- test ! -d $$d && continue; \
- chgrp stap-server $$d 2>/dev/null; \
- chmod 775 $$d 2>/dev/null; \
- for dd in `find $$d -type d`; do \
- chgrp stap-server $$dd 2>/dev/null; \
- chmod 775 $$dd 2>/dev/null; \
- done; \
- for f in `find $$d -type f`; do \
- chgrp stap-server $$f 2>/dev/null; \
- chmod 664 $$f 2>/dev/null; \
- done; \
+ for f in `find $$d -type f`; do \
+ chgrp -f $$group $$f; \
+ chmod -f 664 $$f; \
done; \
- fi
+ done
# This target is used with "make -q" to see whether a "real" build is needed.
uprobes.ko: $(DEPENDENCIES)