mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-10-14 20:18:39 +00:00
contrib: improve nm-in-container.sh script (5)
This commit is contained in:
parent
e947053c23
commit
6f2c69f484
|
@ -82,7 +82,7 @@ bind_files() {
|
||||||
H=~
|
H=~
|
||||||
|
|
||||||
for f in ~/.gitconfig* ~/.vim* ; do
|
for f in ~/.gitconfig* ~/.vim* ; do
|
||||||
test -f "$f" || continue
|
test -e "$f" || continue
|
||||||
f2="${f#$H/}"
|
f2="${f#$H/}"
|
||||||
[[ "$f2" = .viminf* ]] && continue
|
[[ "$f2" = .viminf* ]] && continue
|
||||||
[[ "$f2" = *.tmp ]] && continue
|
[[ "$f2" = *.tmp ]] && continue
|
||||||
|
@ -118,6 +118,18 @@ EOF
|
||||||
alias m="make -j 8"
|
alias m="make -j 8"
|
||||||
alias n="ninja -C build"
|
alias n="ninja -C build"
|
||||||
|
|
||||||
|
alias l='ls -l --color=auto'
|
||||||
|
|
||||||
|
nm_run_gdb() {
|
||||||
|
systemctl stop NetworkManager.service
|
||||||
|
gdb --args "\${1:-/opt/test/sbin/NetworkManager}" --debug
|
||||||
|
}
|
||||||
|
|
||||||
|
nm_run_normal() {
|
||||||
|
systemctl stop NetworkManager.service
|
||||||
|
"\${1:-/opt/test/sbin/NetworkManager}" --debug 2>&1 | tee /tmp/nm-log.txt
|
||||||
|
}
|
||||||
|
|
||||||
. /usr/share/git-core/contrib/completion/git-prompt.sh
|
. /usr/share/git-core/contrib/completion/git-prompt.sh
|
||||||
PS1="\[\\033[01;36m\]\u@\h\[\\033[00m\]:\\t:\[\\033[01;34m\]\w\\\$(__git_ps1 \\" \[\\033[01;36m\](%s)\[\\033[00m\]\\")\[\\033[00m\]\$ "
|
PS1="\[\\033[01;36m\]\u@\h\[\\033[00m\]:\\t:\[\\033[01;34m\]\w\\\$(__git_ps1 \\" \[\\033[01;36m\](%s)\[\\033[00m\]\\")\[\\033[00m\]\$ "
|
||||||
|
|
||||||
|
@ -146,14 +158,17 @@ managed=1
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
cat <<EOF | tmp_file "$BASEDIR/data-bash_history" 600
|
cat <<EOF | tmp_file "$BASEDIR/data-bash_history" 600
|
||||||
|
NM-log
|
||||||
|
NM-log /tmp/nm-log.txt
|
||||||
cd $BASEDIR_NM
|
cd $BASEDIR_NM
|
||||||
|
journalctl | NM-log
|
||||||
nm-env-prepare.sh
|
nm-env-prepare.sh
|
||||||
|
nm_run_gdb
|
||||||
|
nm_run_normal
|
||||||
systemctl status NetworkManager
|
systemctl status NetworkManager
|
||||||
systemctl stop NetworkManager
|
systemctl stop NetworkManager
|
||||||
systemctl stop NetworkManager; /opt/test/sbin/NetworkManager --debug 2>&1 | tee -a /tmp/nm-log.txt
|
systemctl stop NetworkManager; /opt/test/sbin/NetworkManager --debug 2>&1 | tee -a /tmp/nm-log.txt
|
||||||
systemctl stop NetworkManager; gdb --args /opt/test/sbin/NetworkManager --debug
|
systemctl stop NetworkManager; gdb --args /opt/test/sbin/NetworkManager --debug
|
||||||
NM-log
|
|
||||||
NM-log /tmp/nm-log.txt
|
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
cat <<EOF | tmp_file "$BASEDIR/data-gdbinit"
|
cat <<EOF | tmp_file "$BASEDIR/data-gdbinit"
|
||||||
|
@ -190,6 +205,7 @@ RUN dnf install -y \\
|
||||||
glib2-doc \\
|
glib2-doc \\
|
||||||
gnutls-devel \\
|
gnutls-devel \\
|
||||||
gobject-introspection-devel \\
|
gobject-introspection-devel \\
|
||||||
|
grc \\
|
||||||
gtk-doc \\
|
gtk-doc \\
|
||||||
intltool \\
|
intltool \\
|
||||||
iproute \\
|
iproute \\
|
||||||
|
@ -242,6 +258,15 @@ COPY data-bash_history /root/.bash_history
|
||||||
COPY data-gdbinit /root/.gdbinit
|
COPY data-gdbinit /root/.gdbinit
|
||||||
COPY data-gdb_history /root/.gdb_history
|
COPY data-gdb_history /root/.gdb_history
|
||||||
|
|
||||||
|
# Generate a stable machine id.
|
||||||
|
RUN echo "10001000100010001000100010001000" > /etc/machine-id
|
||||||
|
|
||||||
|
# Generate a fixed (version 1) secret key.
|
||||||
|
RUN mkdir -p /var/lib/NetworkManager
|
||||||
|
RUN chmod 700 /var/lib/NetworkManager
|
||||||
|
RUN echo -n "nm-in-container-secret-key" > /var/lib/NetworkManager/secret_key
|
||||||
|
RUN chmod 600 /var/lib/NetworkManager/secret_key
|
||||||
|
|
||||||
RUN sed 's/.*RateLimitBurst=.*/RateLimitBurst=0/' /etc/systemd/journald.conf -i
|
RUN sed 's/.*RateLimitBurst=.*/RateLimitBurst=0/' /etc/systemd/journald.conf -i
|
||||||
|
|
||||||
RUN rm -rf /etc/NetworkManager/system-connections/*
|
RUN rm -rf /etc/NetworkManager/system-connections/*
|
||||||
|
|
Loading…
Reference in a new issue