Hi Thomas!
> > # less /var/log/fai/localhost/last/shell.log
> > ===== shell: DEBIAN/30-interface =====
> > Device "ens192" does not exist.
> > DEBIAN/30-interface OK.
> I wonder which command prints the 'Device does not exist'
> message. Oh I see. It's this call:
> ip -o -f inet addr show $NIC1
> Now I also see this error messages in my fai logs. But in my
> environment the interface config is created correctly, because I use
> the class DHCPC.
> Please try to exchange the two lines in 30-interface
> newnicnames
> CIDR=$(ip -o -f inet........)
Thanks for pointing me to the correct location where the problem really
occurs -- I did not notice that it is the emptiness of $CIDR which leads
to the not-creation of /etc/network/interfaces ...
> I hope this fixes the issue.
Yes, it indeed does.
Should I file a bug report somewhere, or do you change the simple examples?
With regards, Alex
P.S.: I use some more (minor) modifications for 30-interface, probably
you like to apply the attached patch?
--
Alexander Bugl
--- 30-interface 2018-08-23 09:42:44.336892673 +0200
+++ 30-interface.new 2018-08-23 09:31:48.085071551 +0200
@@ -29,21 +29,33 @@
fi
}
-newnicnames
CIDR=$(ip -o -f inet addr show $NIC1 | awk '{print $4}')
+newnicnames
if ifclass DHCPC && [ $FAI_ACTION = "install" -o $FAI_ACTION = "dirinstall" ]; then
cat > $target/etc/network/interfaces <<-EOF
# generated by FAI
- auto lo $NIC1
+ # interfaces(5) file used by ifup(8) and ifdown(8)
+ # Include files from /etc/network/interfaces.d:
+ source-directory /etc/network/interfaces.d
+
+ auto lo
iface lo inet loopback
+
+ auto $NIC1
iface $NIC1 inet dhcp
EOF
elif [ $FAI_ACTION = "install" -o $FAI_ACTION = "dirinstall" ]; then
[ -n "$CIDR" ] && cat > $target/etc/network/interfaces <<-EOF
# generated by FAI
- auto lo $NIC1
+ # interfaces(5) file used by ifup(8) and ifdown(8)
+ # Include files from /etc/network/interfaces.d:
+ source-directory /etc/network/interfaces.d
+
+ auto lo
iface lo inet loopback
+
+ auto $NIC1
iface $NIC1 inet static
address $CIDR
gateway $GATEWAYS