From 8c1769284e73b7ecc5d84146ad148c0228d52d05 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 26 Jun 2017 21:25:51 +0100 Subject: [PATCH] Move predictable network device setup to first boot on mesh --- src/freedombone-image-customise | 1 - src/freedombone-image-mesh | 9 +++++++++ src/freedombone-utils-wifi | 9 ++------- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/freedombone-image-customise b/src/freedombone-image-customise index 61dd310a..66bf38f5 100755 --- a/src/freedombone-image-customise +++ b/src/freedombone-image-customise @@ -591,7 +591,6 @@ initialise_mesh() { chroot "$rootdir" apt-get -yq install apt-transport-https - enable_predictable_device_names configure_firewall install_avahi install_batman diff --git a/src/freedombone-image-mesh b/src/freedombone-image-mesh index 5eeca993..f6320f36 100755 --- a/src/freedombone-image-mesh +++ b/src/freedombone-image-mesh @@ -74,6 +74,14 @@ IPFS_PORT=4001 CURRENT_BLOG_INDEX=/home/$MY_USERNAME/.blog-index +# Debian stretch has a problem where the formerly predictable wlan0 and eth0 +# device names get assigned random names. This is a hacky workaround. +# Also adding net.ifnames=0 to kernel options on bootloader may work. +function enable_predictable_device_names { + ln -s /dev/null /etc/udev/rules.d/80-net-setup-link.rules + update-initramfs -u +} + function create_avahi_mesh_service { service_name=$1 service_type=$2 @@ -591,6 +599,7 @@ if [ -f $MESH_INSTALL_SETUP ]; then #tomb slam all tmp_ram_disk 100 + enable_predictable_device_names enable_batman_daemon #create_ram_disk 1 #setup_amnesic_data diff --git a/src/freedombone-utils-wifi b/src/freedombone-utils-wifi index 4a01714e..cdfa4ee7 100755 --- a/src/freedombone-utils-wifi +++ b/src/freedombone-utils-wifi @@ -49,13 +49,8 @@ function default_network_config { # device names get assigned random names. This is a hacky workaround. # Also adding net.ifnames=0 to kernel options on bootloader may work. function enable_predictable_device_names { - if [ $rootdir ]; then - chroot "$rootdir" ln -s /dev/null /etc/udev/rules.d/80-net-setup-link.rules - chroot "$rootdir" update-initramfs -u - else - ln -s /dev/null /etc/udev/rules.d/80-net-setup-link.rules - update-initramfs -u - fi + ln -s /dev/null /etc/udev/rules.d/80-net-setup-link.rules + update-initramfs -u } function wifi_is_running {