summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2022-08-04 17:38:34 +0200
committerThomas Haller <thaller@redhat.com>2022-08-08 11:54:27 +0200
commit341c46de84b18226f95b07bbd4c35ba56b42dd40 (patch)
tree9904a404e4fbb454f542d64ab0e54ebc4a09cf8b
parentd966c2ac4c2aa2147104b7b5b5fc1e56f1268383 (diff)
downloadNetworkManager-341c46de84b18226f95b07bbd4c35ba56b42dd40.tar.gz
contrib: improve motd for nm-in-container.sh script
Leave a hint about core-dumps. Also, now we have `contrib/fedora/rpm/configure-for-system.sh` script, which can configure the build in a way similar to what we get when doing an RPM build. That means, inside "contrib/scripts/nm-in-container.sh" we can just type `make install`, and it will replace the pre-installed NetworkManager. The main advantage is that it becomes convenient to run NetworkManager as a systemd service. Previously, the suggested was to to install NetworkManager inside another prefix, and run it in the terminal. Running NetworkManager as systemd service is also necessary for NM-ci, which restarts the NetworkManager service, and you couldn't run a test, if you just started NetworkManager in a terminal. Previously, you had to build a complete RPM, which takes a lot of time.
-rwxr-xr-xcontrib/scripts/nm-in-container.sh18
1 files changed, 17 insertions, 1 deletions
diff --git a/contrib/scripts/nm-in-container.sh b/contrib/scripts/nm-in-container.sh
index 72b3f1130a..c8f5ad62e2 100755
--- a/contrib/scripts/nm-in-container.sh
+++ b/contrib/scripts/nm-in-container.sh
@@ -113,7 +113,19 @@ create_dockerfile() {
find NetworkManager bind mounted at $BASEDIR_NM
run \`nm-env-prepare.sh setup --idx 1\` to setup test interfaces
-Configure NetworkManager with
+Coredumps: coredumps are not namespaced, so by default they will
+be sent to coredumpctl of the outer host, which has no idea where
+to get the debugging symbols from. A possible workaround is setting
+
+ $ echo '/tmp/core.%e.%p' | sudo tee /proc/sys/kernel/core_pattern
+
+so that core dumps get written to file. Afterwards, restore with
+
+ echo '|/usr/lib/systemd/systemd-coredump %P %u %g %s %t %c %h' | sudo tee /proc/sys/kernel/core_pattern
+
+from /usr/lib/sysctl.d/50-coredump.conf.
+
+For example, configure NetworkManager with
\$ ./configure \\
--enable-address-sanitizer=no \\
--enable-compile-warnings=yes \\
@@ -164,6 +176,10 @@ Configure NetworkManager with
"\${NM_CONFIGURE_OTPS[@]}"
Test with:
\$ systemctl stop NetworkManager; /opt/test/sbin/NetworkManager --debug 2>&1 | tee -a /tmp/nm-log.txt
+
+Alternatively, configure with \`contrib/fedora/rpm/configure-for-system.sh\`,
+subsequent \`make && make install\` will overwrite your system's NetworkManager,
+and you can test it with \`systemctl daemon-reload ; systemctl restart NetworkManager\`.
EOF
cat <<EOF | tmp_file "$BASEDIR/data-bashrc.my"