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.
This commit is contained in:
Thomas Haller
2022-08-04 17:38:34 +02:00
parent d966c2ac4c
commit 341c46de84

View File

@@ -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"