From a5585109182c578d9d82463532b14016ed89f05e Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Wed, 22 Sep 2021 16:20:17 +0100 Subject: [PATCH] Handle 73-usb-net-by-mac.link when toggling network names --- debian/changelog | 7 +++++++ raspi-config | 6 +++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index d9e80a0..87fa318 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +raspi-config (20210922) bullseye; urgency=medium + + * Handle 73-usb-net-by-mac.link when toggling network names + - https://github.com/RPi-Distro/raspi-config/issues/166 + + -- Serge Schneider Wed, 22 Sep 2021 16:13:52 +0100 + raspi-config (20210827) bullseye; urgency=medium * Add switching for new camera detection in firmware diff --git a/raspi-config b/raspi-config index aec5ef2..b12a996 100755 --- a/raspi-config +++ b/raspi-config @@ -1880,7 +1880,9 @@ EOF } get_net_names() { - if grep -q "net.ifnames=0" $CMDLINE || [ "$(readlink -f /etc/systemd/network/99-default.link)" = "/dev/null" ] ; then + if grep -q "net.ifnames=0" $CMDLINE || \ + ( [ "$(readlink -f /etc/systemd/network/99-default.link)" = "/dev/null" ] && \ + [ "$(readlink -f /etc/systemd/network/73-usb-net-by-mac.link)" = "/dev/null" ] ); then echo 1 else echo 0 @@ -1906,9 +1908,11 @@ do_net_names () { if [ $RET -eq 0 ]; then sed -i $CMDLINE -e "s/net.ifnames=0 *//" rm -f /etc/systemd/network/99-default.link + rm -f /etc/systemd/network/73-usb-net-by-mac.link STATUS=enabled elif [ $RET -eq 1 ]; then ln -sf /dev/null /etc/systemd/network/99-default.link + ln -sf /dev/null /etc/systemd/network/73-usb-net-by-mac.link STATUS=disabled else return $RET