[debian-lan-devel] [debian-lan] 05/08: Switch to systemd-networkd, FAI upstream updates.

Andreas B. Mundt andi at moszumanska.debian.org
Wed Aug 10 12:49:46 UTC 2016


This is an automated email from the git hooks/post-receive script.

andi pushed a commit to branch master
in repository debian-lan.

commit 8c5ebfebb1d0db15e831063e38dd65f7bebf6bd9
Author: Andreas B. Mundt <andi at debian.org>
Date:   Tue Aug 9 09:23:14 2016 +0200

    Switch to systemd-networkd, FAI upstream updates.
---
 fai/config/scripts/DEBIAN/30-interface | 39 +++++++++++++++++++---------------
 fai/config/scripts/DEBIAN/40-misc      | 22 ++++++++++++++++---
 2 files changed, 41 insertions(+), 20 deletions(-)

diff --git a/fai/config/scripts/DEBIAN/30-interface b/fai/config/scripts/DEBIAN/30-interface
index 201d6bb..3474ecd 100755
--- a/fai/config/scripts/DEBIAN/30-interface
+++ b/fai/config/scripts/DEBIAN/30-interface
@@ -2,28 +2,33 @@
 
 error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error code
 
-if ifclass DHCPC && [ $FAI_ACTION = "install" ]
+if ifclass DHCPC && [ $FAI_ACTION = "install" -o $FAI_ACTION = "dirinstall" ]
 then
-    cat > $target/etc/network/interfaces <<-EOF
-	# generated by FAI
-	auto lo $NIC1
-	iface lo inet loopback
-	iface $NIC1 inet dhcp
+    cat > $target/etc/systemd/network/80-dhcp.network <<-EOF
+## generated by FAI
+[Match]
+Name=en*
+
+[Network]
+DHCP=yes
 EOF
-elif [ $FAI_ACTION = "install" ]
+    $ROOTCMD systemctl enable systemd-networkd
+elif [ $FAI_ACTION = "install" -o $FAI_ACTION = "dirinstall" ]
 then
-      [ -n "$IPADDR" ] && cat > $target/etc/network/interfaces <<-EOF
-	# generated by FAI
-	auto lo $NIC1
-	iface lo inet loopback
-	iface $NIC1 inet static
-	  address $IPADDR
-	  netmask $NETMASK
-	  broadcast $BROADCAST
-	  gateway $GATEWAYS
+      [ -n "$IPADDR" ] && cat > $target/etc/systemd/network/50-static.network <<-EOF
+## generated by FAI
+[Match]
+Name=$NIC1
+
+[Network]
+Address=$IPADDR
+Gateway=$GATEWAYS
 EOF
+    $ROOTCMD systemctl enable systemd-networkd
     [ -n "$NETWORK" ] && echo "localnet $NETWORK" > $target/etc/networks
-    [ -L $target/etc/resolv.conf ] || cp -p /etc/resolv.conf $target/etc
+    if [ ! -L $target/etc/resolv.conf -a -e /etc/resolv.conf ]; then
+	cp -p /etc/resolv.conf $target/etc
+    fi
 fi
 
 # here fcopy is mostly used, when installing a client for running in a
diff --git a/fai/config/scripts/DEBIAN/40-misc b/fai/config/scripts/DEBIAN/40-misc
index 30ff938..fc7effb 100755
--- a/fai/config/scripts/DEBIAN/40-misc
+++ b/fai/config/scripts/DEBIAN/40-misc
@@ -1,6 +1,6 @@
 #! /bin/bash
 
-# (c) Thomas Lange, 2001-2013, lange at debian.org
+# (c) Thomas Lange, 2001-2015, lange at debian.org
 # (c) Michael Goetze, 2010-2011, mgoetze at mgoetze.net
 
 error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error code
@@ -21,10 +21,26 @@ else
     sed -i -e 's:^UTC$:LOCAL:' $target/etc/adjtime
 fi
 
+# enable linuxlogo
+if [ -f $target/etc/inittab ]; then
+    sed -i -e 's#/sbin/getty 38400#/sbin/getty -f /etc/issue.linuxlogo 38400#' ${target}/etc/inittab
+elif [ -f $target/lib/systemd/system/getty at .service ]; then
+    sed -i -e 's#sbin/agetty --noclear#sbin/agetty -f /etc/issue.linuxlogo --noclear#' $target/lib/systemd/system/getty at .service
+fi
+
+if [ ! -f $target/etc/machine-id -a -f $target/bin/systemd-machine-id-setup ]; then
+    $ROOTCMD systemd-machine-id-setup
+fi
+
+ln -fs /proc/mounts $target/etc/mtab
+
 rm -f $target/etc/dpkg/dpkg.cfg.d/fai
 
-[ $FAI_ACTION = "install" ] && cp /etc/fai/fai.conf $target/etc/fai/fai.conf
-ainsl -av /etc/fai/fai.conf "FAI_CONFIG_SRC=$FAI_CONFIG_SRC"
+if [ $FAI_ACTION = "install" -o $FAI_ACTION = "dirinstall" ] ; then
+  [ -f /etc/fai/fai.conf ] && cp /etc/fai/fai.conf $target/etc/fai/fai.conf
+fi
+
+ainsl -a /etc/fai/fai.conf "FAI_CONFIG_SRC=$FAI_CONFIG_SRC"
 
 fcopy -Miv /etc/fai/fai.conf
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/collab-maint/debian-lan.git



More information about the debian-lan-devel mailing list