Browse Source

Move predictable network device setup to first boot on mesh

Bob Mottram 7 years ago
parent
commit
8c1769284e
3 changed files with 11 additions and 8 deletions
  1. 0
    1
      src/freedombone-image-customise
  2. 9
    0
      src/freedombone-image-mesh
  3. 2
    7
      src/freedombone-utils-wifi

+ 0
- 1
src/freedombone-image-customise View File

@@ -591,7 +591,6 @@ initialise_mesh() {
591 591
 
592 592
     chroot "$rootdir" apt-get -yq install apt-transport-https
593 593
 
594
-    enable_predictable_device_names
595 594
     configure_firewall
596 595
     install_avahi
597 596
     install_batman

+ 9
- 0
src/freedombone-image-mesh View File

@@ -74,6 +74,14 @@ IPFS_PORT=4001
74 74
 
75 75
 CURRENT_BLOG_INDEX=/home/$MY_USERNAME/.blog-index
76 76
 
77
+# Debian stretch has a problem where the formerly predictable wlan0 and eth0
78
+# device names get assigned random names. This is a hacky workaround.
79
+# Also adding net.ifnames=0 to kernel options on bootloader may work.
80
+function enable_predictable_device_names {
81
+    ln -s /dev/null /etc/udev/rules.d/80-net-setup-link.rules
82
+    update-initramfs -u
83
+}
84
+
77 85
 function create_avahi_mesh_service {
78 86
     service_name=$1
79 87
     service_type=$2
@@ -591,6 +599,7 @@ if [ -f $MESH_INSTALL_SETUP ]; then
591 599
 
592 600
     #tomb slam all
593 601
     tmp_ram_disk 100
602
+    enable_predictable_device_names
594 603
     enable_batman_daemon
595 604
     #create_ram_disk 1
596 605
     #setup_amnesic_data

+ 2
- 7
src/freedombone-utils-wifi View File

@@ -49,13 +49,8 @@ function default_network_config {
49 49
 # device names get assigned random names. This is a hacky workaround.
50 50
 # Also adding net.ifnames=0 to kernel options on bootloader may work.
51 51
 function enable_predictable_device_names {
52
-    if [ $rootdir ]; then
53
-        chroot "$rootdir" ln -s /dev/null /etc/udev/rules.d/80-net-setup-link.rules
54
-        chroot "$rootdir" update-initramfs -u
55
-    else
56
-        ln -s /dev/null /etc/udev/rules.d/80-net-setup-link.rules
57
-        update-initramfs -u
58
-    fi
52
+    ln -s /dev/null /etc/udev/rules.d/80-net-setup-link.rules
53
+    update-initramfs -u
59 54
 }
60 55
 
61 56
 function wifi_is_running {