Handle 73-usb-net-by-mac.link when toggling network names

This commit is contained in:
Serge Schneider 2021-09-22 16:20:17 +01:00
parent 64d5c2c25d
commit a558510918
2 changed files with 12 additions and 1 deletions

7
debian/changelog vendored
View File

@ -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 <serge@raspberrypi.com> Wed, 22 Sep 2021 16:13:52 +0100
raspi-config (20210827) bullseye; urgency=medium raspi-config (20210827) bullseye; urgency=medium
* Add switching for new camera detection in firmware * Add switching for new camera detection in firmware

View File

@ -1880,7 +1880,9 @@ EOF
} }
get_net_names() { 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 echo 1
else else
echo 0 echo 0
@ -1906,9 +1908,11 @@ do_net_names () {
if [ $RET -eq 0 ]; then if [ $RET -eq 0 ]; then
sed -i $CMDLINE -e "s/net.ifnames=0 *//" sed -i $CMDLINE -e "s/net.ifnames=0 *//"
rm -f /etc/systemd/network/99-default.link rm -f /etc/systemd/network/99-default.link
rm -f /etc/systemd/network/73-usb-net-by-mac.link
STATUS=enabled STATUS=enabled
elif [ $RET -eq 1 ]; then elif [ $RET -eq 1 ]; then
ln -sf /dev/null /etc/systemd/network/99-default.link 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 STATUS=disabled
else else
return $RET return $RET