diff --git a/xCAT-genesis-builder/80-net-name-slot.rules b/xCAT-genesis-builder/80-net-name-slot.rules new file mode 100644 index 000000000..c5f1b3885 --- /dev/null +++ b/xCAT-genesis-builder/80-net-name-slot.rules @@ -0,0 +1,14 @@ +# do not edit this file, it will be overwritten on update + +ACTION!="add", GOTO="net_name_slot_end" +SUBSYSTEM!="net", GOTO="net_name_slot_end" +NAME!="", GOTO="net_name_slot_end" + +IMPORT{cmdline}="net.ifnames" +ENV{net.ifnames}=="0", GOTO="net_name_slot_end" + +NAME=="", ENV{ID_NET_NAME_ONBOARD}!="", NAME="$env{ID_NET_NAME_ONBOARD}" +NAME=="", ENV{ID_NET_NAME_SLOT}!="", NAME="$env{ID_NET_NAME_SLOT}" +NAME=="", ENV{ID_NET_NAME_PATH}!="", NAME="$env{ID_NET_NAME_PATH}" + +LABEL="net_name_slot_end" diff --git a/xCAT-genesis-builder/buildrpm b/xCAT-genesis-builder/buildrpm index 28f3985aa..45de0953a 100755 --- a/xCAT-genesis-builder/buildrpm +++ b/xCAT-genesis-builder/buildrpm @@ -178,6 +178,10 @@ for d in `echo $PERL_LIB_DIR`; do fi done +# create the predictable naming for nics +LIB_UDEV_RULES="/lib/udev/rules.d/" +cp $DRACUTMODDIR/80-net-name-slot.rules /tmp/xcatgenesis.$$/opt/xcat/share/xcat/netboot/genesis/$BUILDARCH/fs/lib/udev/rules.d/ + if [ $? -ne 0 ]; then echo "ERROR - expanding the initramfs, please correct the issues and try again" exit 1