File: runtime_container_config.sh

package info (click to toggle)
systemtap 5.1-5
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 47,964 kB
  • sloc: cpp: 80,838; ansic: 54,757; xml: 49,725; exp: 43,665; sh: 11,527; python: 5,003; perl: 2,252; tcl: 1,312; makefile: 1,006; javascript: 149; lisp: 105; awk: 101; asm: 91; java: 70; sed: 16
file content (24 lines) | stat: -rwxr-xr-x 1,386 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash
# A runtime config for the isystemtap container
# Copyright (C) 2023 Red Hat Inc.
#
# This file is part of systemtap, and is free software.  You can
# redistribute it and/or modify it under the terms of the GNU General
# Public License (GPL); either version 2, or (at your option) any
# later version.

# We need to get some of the info from the host's version of systemtap (at runtime) and add it here
# ISystemtap is already installed, so we need to find that location and add the ssh dest
localhost=127.0.0.1
INSTALL_PATH=`python -c 'import os; import isystemtap; print(os.path.abspath(isystemtap.__path__[-1]))'`
echo "STAP_VERSION    = $STAP_VERSION"    >  $INSTALL_PATH/constants.py
echo "STAP_PKGDATADIR = $STAP_PKGDATADIR" >> $INSTALL_PATH/constants.py
echo "STAP_PREFIX     = $STAP_PREFIX"     >> $INSTALL_PATH/constants.py
echo "SSH_DEST        = '$localhost'"     >> $INSTALL_PATH/constants.py

# Update the language server config. Convert stap to PREFIX/bin/stap (Ex. /usr/bin/stap)
ABSOLUTE_STAP_PATH=`echo "$STAP_PREFIX" | tr -d "'\t\n\r"`/bin/stap
LSP_CONFIG=`jupyter --config`/jupyter_server_config.d/jupyter_stap_lsp.json
cp $LSP_CONFIG ${LSP_CONFIG}_old
jq --arg STAP $ABSOLUTE_STAP_PATH '.LanguageServerManager.language_servers."stap-language".argv = ["ssh", "127.0.0.1", $STAP + " --language-server"]' ${LSP_CONFIG}_old > $LSP_CONFIG
rm ${LSP_CONFIG}_old