Add udev rule to name network interface eth0
authorroot <root@chambers64.mongol.com>
Fri, 15 Aug 2014 02:15:54 +0000 (22:15 -0400)
committerHugo Villeneuve <hugo@hugovil.com>
Mon, 24 Nov 2014 13:41:02 +0000 (08:41 -0500)
Also automate installation of future udev rules.

stage2/misc/udev/20-network.rules [new file with mode: 0644]
stage2/pkg/eudev

diff --git a/stage2/misc/udev/20-network.rules b/stage2/misc/udev/20-network.rules
new file mode 100644 (file)
index 0000000..d7ef635
--- /dev/null
@@ -0,0 +1,2 @@
+SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="00:04:0b:80:80:80", NAME="eth0"
+
index d3cdeb9..ef42cb4 100644 (file)
@@ -24,10 +24,10 @@ hvbuild_post()
 {
     install -v -m755 ${SCRDIR}/misc/udev/udev-create-persistent-net.sh \
         /usr/local/bin
-    install -v -m644 ${SCRDIR}/misc/udev/10-media-automount.rules \
-        /etc/udev/rules.d/
-    install -v -m644 ${SCRDIR}/misc/udev/11-sd-card-automount.rules \
-        /etc/udev/rules.d/
+
+    for f in ${SCRDIR}/misc/udev/*.rules; do
+        install -v -m644 ${f} /etc/udev/rules.d
+    done
 
     sed -i -e "s/\(SYMLINK+=\"cdrom\)\"/\1 dvd\"/" \
         /lib/udev/rules.d/60-cdrom_id.rules