summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorDave Brolley <brolley@redhat.com>2009-11-25 14:14:03 -0500
committerDave Brolley <brolley@redhat.com>2009-11-25 14:14:03 -0500
commit0da3e7a0e77120670cb69c55ad5418f2bf2afb9d (patch)
tree3ef463df086114aeb42630db819ff9d048712b97 /runtime
parentff3576d585aee3140b41bb77a0e8e4063e704f43 (diff)
downloadsystemtap-steved-0da3e7a0e77120670cb69c55ad5418f2bf2afb9d.tar.gz
systemtap-steved-0da3e7a0e77120670cb69c55ad5418f2bf2afb9d.tar.xz
systemtap-steved-0da3e7a0e77120670cb69c55ad5418f2bf2afb9d.zip
- Allow root, the owner of the uprobes build directory and the members of the
group owner of the uprobes buld directory to build uprobes.ko. - When building uprobes.ko, make all generated files writable by the group owner of the uprobes build directory. - Don't change the group owner of the uprobes build directory during 'make install'
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)