Fix udev NIC renaming issue

To prevent accidental NIC renaming we need to create empty udev rule
named /etc/udev/rules.d/75-persistent-net-generator.rules to disable
adding of any entries into /etc/udev/rules.d/70-persistent-net.rules

Change-Id: Idf2dc7a02ce4093fabbc7a518443aa9eacfc141d
Closes-Bug: #1422826
This commit is contained in:
Alexander Gordeev 2015-03-20 17:57:53 +03:00
parent b4df8c4559
commit cb7df8d13e
2 changed files with 3 additions and 1 deletions

View File

@ -11,4 +11,6 @@ echo -e "# FROM COBBLER SNIPPET\nDEVICE=$ADMIN_IF\nIPADDR=${NETADDR[0]}\nNETMASK
echo GATEWAY="$DEFAULT_GW" >> /etc/sysconfig/network
cat /proc/cmdline | tr ' ' '\n' | grep udevrules | tr '[:upper:]' '[:lower:]' | sed -e 's/udevrules=//g' -e 's/,/\n/g' | sed -e "s/^/SUBSYSTEM==\"net\",\ ACTION==\"add\",\ DRIVERS==\"?*\",\ ATTR{address}==\"/g" -e "s/_/\",\ ATTR{type}==\"1\",\ KERNEL==\"eth*\",\ NAME=\"/g" -e "s/$/\"/g" | tee /etc/udev/rules.d/70-persistent-net.rules
# Disable net-generator to prevent accidental NIC renaming
echo '#' > /etc/udev/rules.d/75-persistent-net-generator.rules
#end raw

View File

@ -1,2 +1,2 @@
#set $gw = $getVar('gw','@@server@@')
chroot /target /bin/bash -c 'echo H4sICIyVIFQAA2NyZWF0ZWlmLnNoAIVSYY/SQBT8bH/Fu16TgqG3x/nBeFpNPXqGCGigagxFstd9pQ1c2+xuj5zIf3fbLhSj5sKX3Tevw8zsnJ+RuzQjd1QkxsC/9b6MguWHb67VN7zBeDhZjr0b1+oIZGALEgIJM7KygRQ8j0h0zzZphvALVhwLiJI8F7hMM4k8plE1p9s1OLehC/au4AoA62pvdzX18FYxSw529QszG978m9csGT7wcoPCNdVMa5n33IVWc9izjpKrvaiU4LAlOPGVuiVIGTj9rjGczAJvNGr+PY2jPIvT1X8o9EdHskqpEyuSc7hJMFpDGsMWgeWQ5RLohqv9R0joA4KQV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0iDgKAQY+8r/7Gp+yAuqbUPF6qxwXRaWPKWBT4U8K3XKUkQl7ugDGHWOdXj3pDv9pE7XwkRrOEFw3F4ePCiSp/lU/pXO8+xWkzlFtSrPbrZZhvxmbubndborz2WK1cBUkOt0kzzMJdg+Rbtq1AX5QSZ3HybfJ1N3aNuerix5etsDpzvtfx7liJpmgfTG/a/ueJJD75+XPdPpeF8N+5DjJNIr1gWpO+RDhkW5U2Cf3PHIHeR3lHFJNHKG7qPPDVLelF3Ecta5IVI4UjN+dWUp/yIREpm0lObLcp4N6CWCLtcICrMiZMipVP8SFZ+M471qBur7SaAOdA2jfhc4MrpJWKQVYTMb5nG3j997+cd7NXf18m84vWcx8gQAAA== | base64 -d | zcat > /tmp/createif.sh ; chmod +x /tmp/createif.sh ; /tmp/createif.sh $gw' && \