3 # Generate a certificate for the systemtap server and add it to the
4 # database of trusted servers for the client.
6 # Copyright (C) 2009 Red Hat Inc.
8 # This file is part of systemtap, and is free software. You can
9 # redistribute it and/or modify it under the terms of the GNU General
10 # Public License (GPL); either version 2, or (at your option) any
13 # Common environment setup for stap scripts
15 # INSTALL-HOOK These settings work for running the server from the source tree
16 # INSTALL-HOOK using the dejagnu test harness and will be overridden at install
19 stap_sysconfdir
=`pwd`/net
21 stap_localstatedir
=`pwd`/net
/var
23 # General configuration
24 stap_tmpdir_prefix_client
=stap.client
25 stap_tmpdir_prefix_server
=stap.server
26 stap_avahi_service_tag
=_stap._tcp
28 # NSS certificate databases
29 stap_root_ssl_db
=$stap_sysconfdir/systemtap
/ssl
30 if test "X$SYSTEMTAP_DIR" = "X"; then
31 stap_user_ssl_db
=$HOME/.systemtap
/ssl
33 stap_user_ssl_db
=$SYSTEMTAP_DIR/ssl
36 if test $EUID = 0; then
37 stap_ssl_db
=$stap_root_ssl_db
39 stap_ssl_db
=$stap_user_ssl_db
42 stap_signing_db
=$stap_sysconfdir/systemtap
/staprun
43 stap_certfile
=stap.cert
45 function stap_get_arch
{
46 # PR4186: Copy logic from coreutils uname (uname -i) to squash
47 # i?86->i386. Actually, copy logic from linux top-level Makefile
48 # to squash uname -m -> $(SUBARCH).
50 local machine
=`uname -m`
51 machine
=`expr "$machine" : '\(...\).*'`
53 i48
) machine
="i386" ;;
54 i58
) machine
="i386" ;;
55 i68
) machine
="i386" ;;
56 sun
) machine
="sparc64" ;;
59 s39
) machine
="s390" ;;
60 ppc
) machine
="powerpc" ;;
61 mip
) machine
="mips" ;;
65 *) machine
="unknown" ;;