Updated xfr.pm (converted to the new c3d format, updated to Fedora 38).
authorZoltán Felleg <zoltan.felleg@userrendszerhaz.hu>
Wed, 19 Apr 2023 07:45:43 +0000 (09:45 +0200)
committerZoltán Felleg <zoltan.felleg@userrendszerhaz.hu>
Wed, 19 Apr 2023 07:45:43 +0000 (09:45 +0200)
13 files changed:
sources/xfr.pm/c3d/firstboot/scripts/01_setupnetworking.sh [new file with mode: 0755]
sources/xfr.pm/c3d/firstboot/scripts/02_settimezone.sh [moved from sources/xfr.pm/firstboot/02_settimezone.sh with 100% similarity]
sources/xfr.pm/c3d/firstboot/scripts/03_setupldap.sh [moved from sources/xfr.pm/firstboot/03_setupldap.sh with 100% similarity]
sources/xfr.pm/c3d/firstboot/scripts/99_cleanup.sh [moved from sources/xfr.pm/firstboot/99_cleanup.sh with 100% similarity]
sources/xfr.pm/c3d/mode.txt [new file with mode: 0644]
sources/xfr.pm/c3d/postinstall/install-data/etc/httpd/conf.d/xfr.80.conf [moved from sources/xfr.pm/postinstall/install/etc/httpd/conf.d/xfr.80.conf with 100% similarity]
sources/xfr.pm/c3d/postinstall/scripts/01_setownership.sh [moved from sources/xfr.pm/postinstall/01_setownership.sh with 100% similarity]
sources/xfr.pm/c3d/postinstall/scripts/02_setpermissions.sh [moved from sources/xfr.pm/postinstall/02_setpermissions.sh with 100% similarity]
sources/xfr.pm/c3d/postinstall/scripts/03_installfiles.sh [moved from sources/xfr.pm/postinstall/03_installfiles.sh with 100% similarity]
sources/xfr.pm/c3d/postinstall/scripts/10_setupservices.sh [moved from sources/xfr.pm/postinstall/10_setupservices.sh with 100% similarity]
sources/xfr.pm/c3d/postinstall/scripts/99_cleanup.sh [moved from sources/xfr.pm/postinstall/99_cleanup.sh with 100% similarity]
sources/xfr.pm/envvars
sources/xfr.pm/firstboot/01_setupnetworking.sh [deleted file]

diff --git a/sources/xfr.pm/c3d/firstboot/scripts/01_setupnetworking.sh b/sources/xfr.pm/c3d/firstboot/scripts/01_setupnetworking.sh
new file mode 100755 (executable)
index 0000000..8fc291d
--- /dev/null
@@ -0,0 +1,81 @@
+#!/bin/sh
+
+
+export PAGER=
+
+
+sleep 1
+systemctl --quiet is-active NetworkManager.service
+NM_RC=$?
+CYCLES_WAITED=0
+while [ $NM_RC -ne 0 ]
+do
+    if [ $CYCLES_WAITED -ge 10 ]
+    then
+        exit 1
+    fi
+    if [ $CYCLES_WAITED -eq 0 ]
+    then
+        echo -n "Waiting for NetworkManager"
+    fi
+    echo -n .
+    sleep 1
+    CYCLES_WAITED=$(( $CYCLES_WAITED + 1 ))
+    systemctl --quiet is-active NetworkManager.service
+    NM_RC=$?
+done
+[ $CYCLES_WAITED -gt 0 ] && echo
+
+# wait for the two network connections to come up
+CONNECTION_DEVICES_UP=$(nmcli --terse connection show \
+                            | grep --invert-match ':$' | wc -l)
+CYCLES_WAITED=0
+while [ $CONNECTION_DEVICES_UP -lt 2 ]
+do
+    if [ $CYCLES_WAITED -ge 10 ]
+    then
+        nmcli connection show
+        exit 1
+    fi
+    if [ $CYCLES_WAITED -eq 0 ]
+    then
+        echo -n "Waiting for the network connection"
+    fi
+    echo -n .
+    sleep 1
+    CYCLES_WAITED=$(( $CYCLES_WAITED + 1 ))
+    CONNECTION_DEVICES_UP=$(nmcli --terse connection show \
+                                | grep --invert-match ':$' | wc -l)
+done
+[ $CYCLES_WAITED -gt 0 ] && echo
+
+CONNECTIONS=$(nmcli --terse connection show | wc -l)
+if [ $CONNECTIONS -ne 2 ]
+then
+    echo "Number of connections: $CONNECTIONS instead of 2" >&2
+    exit 1
+fi
+
+CONNECTION_LINE=$(nmcli --terse connection show | grep ':eth0$')
+CONNECTION_UUID=$(echo $CONNECTION_LINE | cut -f 2 -d ':')
+CONNECTION_DEVICE=$(echo $CONNECTION_LINE | cut -f 4 -d ':')
+
+nmcli connection delete uuid "$CONNECTION_UUID"
+
+nmcli connection add \
+    connection.autoconnect yes \
+    connection.id perimeter \
+    connection.interface-name $CONNECTION_DEVICE \
+    connection.type 802-3-ethernet \
+    ipv4.addresses "192.168.173.251/24" \
+    ipv4.dns "192.168.173.174" \
+    ipv4.dns-search "pm.user.hu" \
+    ipv4.gateway "192.168.173.254" \
+    ipv4.method "manual" \
+    ipv6.method "auto" \
+    save yes
+
+nmcli connection show
+
+hostnamectl hostname xfr.pm.useribm.hu
+hostnamectl
diff --git a/sources/xfr.pm/c3d/mode.txt b/sources/xfr.pm/c3d/mode.txt
new file mode 100644 (file)
index 0000000..9b8459e
--- /dev/null
@@ -0,0 +1,4 @@
+# mode file (relative to /c3d)
+755 firstboot/scripts/*.sh
+755 postinstall/install-data/usr/local/bin/*
+755 postinstall/scripts/*.sh
index c11d08c685086651e88bd93cd93c2c046c7a622d..88e4883cfe3c6f31aaf8233f8b98c9578c0b271c 100644 (file)
@@ -1,5 +1,5 @@
 DISTRIBUTION=Fedora
-DISTRIBUTION_VERSION=37
+DISTRIBUTION_VERSION=38
 ROOT_PACKAGES="hostname initscripts iproute rootfiles systemd-udev"
 BASE_PACKAGES="NetworkManager iputils logrotate rsyslog tar vim-minimal"
 SPEC_PACKAGES="httpd mod_wsgi"
diff --git a/sources/xfr.pm/firstboot/01_setupnetworking.sh b/sources/xfr.pm/firstboot/01_setupnetworking.sh
deleted file mode 100755 (executable)
index e76a2b3..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/bin/sh
-
-
-sleep 1
-systemctl --quiet is-active NetworkManager.service
-NM_RC=$?
-WAITED=0
-while [ $NM_RC -ne 0 ]
-do
-    echo -n .
-    sleep 1
-    WAITED=1
-    systemctl --quiet is-active NetworkManager.service
-    NM_RC=$?
-done
-[ $WAITED -eq 1 ] && echo
-
-CONNECTIONS=$(nmcli --terse connection show | wc -l)
-while [ $CONNECTIONS -ne 1 ]
-do
-    echo "Number of connections: $CONNECTIONS" >&2
-    sleep 1
-    CONNECTIONS=$(nmcli --terse connection show | wc -l)
-done
-
-nmcli --terse connection show | grep ':$' >/dev/null
-ALL_CONNECTION_DEVICES_KNOWN=$?
-while [ $ALL_CONNECTION_DEVICES_KNOWN -eq 0 ]
-do
-    echo "Not all connection devices are known yet" >&2
-    sleep 1
-    nmcli --terse connection show | grep ':$' >/dev/null
-    ALL_CONNECTION_DEVICES_KNOWN=$?
-done
-
-CONNECTION_LINE=$(nmcli --terse connection show)
-CONNECTION_UUID=$(echo $CONNECTION_LINE | cut -f 2 -d ':')
-CONNECTION_DEVICE=$(echo $CONNECTION_LINE | cut -f 4 -d ':')
-
-nmcli connection delete uuid "$CONNECTION_UUID"
-
-nmcli connection add \
-    connection.autoconnect yes \
-    connection.id perimeter \
-    connection.interface-name $CONNECTION_DEVICE \
-    connection.type 802-3-ethernet \
-    ipv4.addresses "192.168.173.251/24" \
-    ipv4.dns "192.168.173.174" \
-    ipv4.dns-search "pm.user.hu" \
-    ipv4.gateway "192.168.173.254" \
-    ipv4.method "manual" \
-    ipv6.method "auto" \
-    save yes
-
-nmcli connection show