tests: Add rudimentary debugging to dhclient-script

We now supply a minimal dhclient-script of our own in the mbuto boot image.
There are some problems with it, so add some basic logging to help debug
it.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
David Gibson 2022-07-15 15:21:26 +10:00 committed by Stefano Brivio
parent e6e2e30c34
commit 1fb2bd6754

View file

@ -21,11 +21,15 @@ LINKS="${LINKS:-
ash,dash,bash /init ash,dash,bash /init
ash,dash,bash /bin/sh}" ash,dash,bash /bin/sh}"
DIRS="${DIRS} /tmp /sbin" DIRS="${DIRS} /tmp /sbin /var/log"
FIXUP="${FIXUP}"' FIXUP="${FIXUP}"'
cat > /sbin/dhclient-script << EOF cat > /sbin/dhclient-script << EOF
#!/bin/sh #!/bin/sh
LOG=/var/log/dhclient-script.log
echo \${reason} \${interface} >> \$LOG
set >> \$LOG
[ -n "\${new_interface_mtu}" ] && ip link set dev \${interface} mtu \${new_interface_mtu} [ -n "\${new_interface_mtu}" ] && ip link set dev \${interface} mtu \${new_interface_mtu}
[ -n "\${new_ip_address}" ] && ip addr add \${new_ip_address}/\${new_subnet_mask} dev \${interface} [ -n "\${new_ip_address}" ] && ip addr add \${new_ip_address}/\${new_subnet_mask} dev \${interface}