From c6c3577b0b3cb28a80a42cee63e5544d7a010735 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zolt=C3=A1n=20Felleg?= Date: Wed, 7 Nov 2018 12:23:11 +0100 Subject: [PATCH] Added ens.pm.f29. --- sources/ens.pm.f29/config | 19 ++ sources/ens.pm.f29/envvars | 4 + .../firstboot/01_setupnetworking.sh | 55 ++++++ .../ens.pm.f29/firstboot/02_settimezone.sh | 21 ++ sources/ens.pm.f29/firstboot/03_setupldap.sh | 10 + sources/ens.pm.f29/firstboot/99_cleanup.sh | 6 + .../ens.pm.f29/postinstall/01_setownership.sh | 9 + .../postinstall/02_setpermissions.sh | 7 + .../ens.pm.f29/postinstall/03_installfiles.sh | 15 ++ .../postinstall/10_setupservices.sh | 7 + sources/ens.pm.f29/postinstall/99_cleanup.sh | 6 + .../ens.pm.f29/postinstall/install/etc/hosts | 4 + .../postinstall/install/etc/named.conf | 180 ++++++++++++++++++ .../install/etc/sysctl.d/01-ipv6.conf | 2 + 14 files changed, 345 insertions(+) create mode 100644 sources/ens.pm.f29/config create mode 100644 sources/ens.pm.f29/envvars create mode 100755 sources/ens.pm.f29/firstboot/01_setupnetworking.sh create mode 100755 sources/ens.pm.f29/firstboot/02_settimezone.sh create mode 100755 sources/ens.pm.f29/firstboot/03_setupldap.sh create mode 100755 sources/ens.pm.f29/firstboot/99_cleanup.sh create mode 100755 sources/ens.pm.f29/postinstall/01_setownership.sh create mode 100755 sources/ens.pm.f29/postinstall/02_setpermissions.sh create mode 100755 sources/ens.pm.f29/postinstall/03_installfiles.sh create mode 100755 sources/ens.pm.f29/postinstall/10_setupservices.sh create mode 100755 sources/ens.pm.f29/postinstall/99_cleanup.sh create mode 100644 sources/ens.pm.f29/postinstall/install/etc/hosts create mode 100644 sources/ens.pm.f29/postinstall/install/etc/named.conf create mode 100644 sources/ens.pm.f29/postinstall/install/etc/sysctl.d/01-ipv6.conf diff --git a/sources/ens.pm.f29/config b/sources/ens.pm.f29/config new file mode 100644 index 0000000..2b2cfd4 --- /dev/null +++ b/sources/ens.pm.f29/config @@ -0,0 +1,19 @@ +lxc.include = /usr/share/lxc/config/common.conf + +lxc.arch = x86_64 +lxc.uts.name = ens.pm.user.hu +lxc.rootfs.path = __CONTAINER_PATH__/rootfs +lxc.mount.auto = proc:rw sys:ro + +lxc.net.0.type = veth +lxc.net.0.flags = up +lxc.net.0.link = brh +lxc.net.0.hwaddr = 02:0c:18:03:ad:40 + +lxc.autodev = 1 + +lxc.signal.halt = SIGRTMIN+4 + +lxc.start.auto = 1 +lxc.start.order = 11 +lxc.start.delay = 10 diff --git a/sources/ens.pm.f29/envvars b/sources/ens.pm.f29/envvars new file mode 100644 index 0000000..225fcb0 --- /dev/null +++ b/sources/ens.pm.f29/envvars @@ -0,0 +1,4 @@ +#BASE_PACKAGES="NetworkManager initscripts openssh-server openssh-clients openssh-ldap rootfiles rsyslog sudo tar vim-minimal" +#SPEC_PACKAGES="authselect bind bind-utils openldap-clients nss-pam-ldapd pam_ssh passwd" +BASE_PACKAGES="NetworkManager initscripts rootfiles rsyslog tar" +SPEC_PACKAGES="bind bind-utils" diff --git a/sources/ens.pm.f29/firstboot/01_setupnetworking.sh b/sources/ens.pm.f29/firstboot/01_setupnetworking.sh new file mode 100755 index 0000000..d0ee46d --- /dev/null +++ b/sources/ens.pm.f29/firstboot/01_setupnetworking.sh @@ -0,0 +1,55 @@ +#!/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 -ne 0 ] && echo + +CONNECTIONS=$(nmcli connection show | grep -v '^NAME' | wc -l) +if [ $CONNECTIONS -ne 1 ] +then + echo "Number of connections: $CONNECTIONS" >&2 + exit 1 +fi + +CONNECTION_LINE=$(nmcli connection show | grep -v '^NAME') +CONNECTION_TOKENS=$(echo $CONNECTION_LINE | wc -w) +#CONNECTION_NAME_POS=$(( $CONNECTION_TOKENS - 3 )) +CONNECTION_UUID_POS=$(( $CONNECTION_TOKENS - 2 )) +#CONNECTION_TYPE_POS=$(( $CONNECTION_TOKENS - 1 )) +CONNECTION_DEVICE_POS=$CONNECTION_TOKENS +#CONNECTION_NAME=$(echo $CONNECTION_LINE \ +# | cut -f -$CONNECTION_NAME_POS -d ' ') +CONNECTION_UUID=$(echo $CONNECTION_LINE \ + | cut -f $CONNECTION_UUID_POS -d ' ') +#CONNECTION_TYPE=$(echo $CONNECTION_LINE \ +# | cut -f $CONNECTION_TYPE_POS -d ' ') +CONNECTION_DEVICE=$(echo $CONNECTION_LINE \ + | cut -f $CONNECTION_DEVICE_POS -d ' ') + +nmcli connection delete uuid "$CONNECTION_UUID" + +nmcli connection add \ + type 802-3-ethernet \ + ifname $CONNECTION_DEVICE \ + con-name perimeter \ + autoconnect yes \ + save yes \ + ipv4.addresses "192.168.173.64/24" \ + ipv4.dns "192.168.173.174" \ + ipv4.dns-search "pm.user.hu" \ + ipv4.gateway "192.168.173.254" \ + ipv4.method "manual" \ + ipv4.routes "10.228.0.0/16 192.168.173.1" \ + ipv6.method "ignore" +nmcli connection show diff --git a/sources/ens.pm.f29/firstboot/02_settimezone.sh b/sources/ens.pm.f29/firstboot/02_settimezone.sh new file mode 100755 index 0000000..20b2a71 --- /dev/null +++ b/sources/ens.pm.f29/firstboot/02_settimezone.sh @@ -0,0 +1,21 @@ +#!/bin/sh + + +sleep 1 +systemctl --quiet is-active dbus.service +DBUS_RC=$? +WAITED=0 +while [ $DBUS_RC -ne 0 ] +do + if [ $WAITED -eq 0 ] + then + echo -n "Waiting for dbus.service" + fi + echo -n . + sleep 1 + WAITED=1 + systemctl --quiet is-active dbus.service + DBUS_RC=$? +done +[ $WAITED -ne 0 ] && echo +timedatectl set-timezone Europe/Budapest diff --git a/sources/ens.pm.f29/firstboot/03_setupldap.sh b/sources/ens.pm.f29/firstboot/03_setupldap.sh new file mode 100755 index 0000000..4b58626 --- /dev/null +++ b/sources/ens.pm.f29/firstboot/03_setupldap.sh @@ -0,0 +1,10 @@ +#!/bin/sh + + +exit 0 +authselect select sssd with-mkhomedir --force + +cat >>/etc/openldap/ldap.conf <