Add scripts/GRMLBASE/38-udev to get rid of automatically generated udev rules file.
[grml-live.git] / etc / grml / fai / config / scripts / GRMLBASE / 38-udev
1 #!/bin/sh
2 # Filename:      /etc/grml/fai/config/scripts/GRMLBASE/38-udev
3 # Purpose:       configure udev of live-system
4 # Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
5 # Bug-Reports:   see http://grml.org/bugs/
6 # License:       This file is licensed under the GPL v2 or any later version.
7 ################################################################################
8
9 set -u
10 set -e
11
12 [ -r /etc/grml/grml-live.conf ]  && . /etc/grml/grml-live.conf
13 [ -r /etc/grml/grml-live.local ] && . /etc/grml/grml-live.local
14
15 CONFFILE="$target/etc/udev/rules.d/70-persistent-net.rules"
16 STRING='This file was automatically generated by the /lib/udev/write_net_rules'
17
18 # We do not want to get a predefined entry for eth0 of the *build* system, like:
19 #   Unknown net device (/devices/virtio-pci/virtio0/net/eth0) (virtio_net)
20 #   SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="XX:XX:XX:XX:XX:XX", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
21 # so therefore remove such an automatically generated file instead.
22 if grep -q "$STRING" "$CONFFILE" ; then
23    echo "Automatically generated /etc/udev/rules.d/70-persistent-net.rules found, removing it."
24    rm -f "$CONFFILE"
25 fi
26
27 ## END OF FILE #################################################################
28 # vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=3