]> sourceware.org Git - systemtap.git/blob - stap-env
Consolidate task_finder/vma tracker initialization.
[systemtap.git] / stap-env
1 #!/bin/bash
2
3 # Generate a certificate for the systemtap server and add it to the
4 # database of trusted servers for the client.
5 #
6 # Copyright (C) 2009 Red Hat Inc.
7 #
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
11 # later version.
12
13 # Common environment setup for stap scripts
14
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
17 # INSTALL-HOOK time.
18 stap_exec_prefix=
19 stap_sysconfdir=`pwd`/net
20 stap_pkglibexecdir=
21 stap_localstatedir=`pwd`/net/var
22
23 # General configuration
24 stap_tmpdir_prefix_client=stap.client
25 stap_tmpdir_prefix_server=stap.server
26 stap_avahi_service_tag=_stap._tcp
27
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
32 else
33 stap_user_ssl_db=$SYSTEMTAP_DIR/ssl
34 fi
35
36 if test $EUID = 0; then
37 stap_ssl_db=$stap_root_ssl_db
38 else
39 stap_ssl_db=$stap_user_ssl_db
40 fi
41
42 stap_signing_db=$stap_sysconfdir/systemtap/staprun
43 stap_certfile=stap.cert
44
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).
49
50 local machine=`uname -m`
51 machine=`expr "$machine" : '\(...\).*'`
52 case $machine in
53 i48) machine="i386" ;;
54 i58) machine="i386" ;;
55 i68) machine="i386" ;;
56 sun) machine="sparc64" ;;
57 arm) machine="arm" ;;
58 sa1) machine="arm" ;;
59 s39) machine="s390" ;;
60 ppc) machine="powerpc" ;;
61 mip) machine="mips" ;;
62 sh2) machine="sh" ;;
63 sh3) machine="sh" ;;
64 sh4) machine="sh" ;;
65 *) machine="unknown" ;;
66 esac
67
68 echo $machine
69 }
This page took 0.038357 seconds and 5 git commands to generate.