From: Zoltán Felleg Date: Tue, 5 Nov 2019 15:45:20 +0000 (+0100) Subject: Added pns.pm (cvm -> vhost migration, Fedora 31 upgrade). X-Git-Url: http://git.useribm.hu/?a=commitdiff_plain;h=5dcff3834f387fe8803b0461455d9a2a2f8c55b7;p=user-lxc.git Added pns.pm (cvm -> vhost migration, Fedora 31 upgrade). --- diff --git a/sources/pns.pm/config b/sources/pns.pm/config new file mode 100644 index 0000000..d2bf142 --- /dev/null +++ b/sources/pns.pm/config @@ -0,0 +1,22 @@ +lxc.include = /usr/share/lxc/config/common.conf + +lxc.arch = x86_64 +lxc.uts.name = pns.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-dev +lxc.net.0.hwaddr = 02:0c:18:03:ad:ae + +lxc.cgroup.devices.allow = +lxc.cgroup.devices.deny = + +lxc.autodev = 1 + +lxc.signal.halt = SIGRTMIN+4 + +lxc.start.auto = 1 +lxc.start.order = 12 +lxc.start.delay = 3 diff --git a/sources/pns.pm/envvars b/sources/pns.pm/envvars new file mode 100644 index 0000000..c48ba9b --- /dev/null +++ b/sources/pns.pm/envvars @@ -0,0 +1,4 @@ +DISTRIBUTION=Fedora +DISTRIBUTION_VERSION=31 +BASE_PACKAGES="NetworkManager hostname initscripts iproute iputils logrotate rootfiles rsyslog tar vim-minimal" +SPEC_PACKAGES="bind bind-utils" diff --git a/sources/pns.pm/firstboot/01_setupnetworking.sh b/sources/pns.pm/firstboot/01_setupnetworking.sh new file mode 100755 index 0000000..9c87c34 --- /dev/null +++ b/sources/pns.pm/firstboot/01_setupnetworking.sh @@ -0,0 +1,56 @@ +#!/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.174/24" \ + ipv4.dns "127.0.0.1" \ + 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" \ + save yes + +nmcli connection show diff --git a/sources/pns.pm/firstboot/02_settimezone.sh b/sources/pns.pm/firstboot/02_settimezone.sh new file mode 100755 index 0000000..20b2a71 --- /dev/null +++ b/sources/pns.pm/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/pns.pm/firstboot/03_setupldap.sh b/sources/pns.pm/firstboot/03_setupldap.sh new file mode 100755 index 0000000..4b58626 --- /dev/null +++ b/sources/pns.pm/firstboot/03_setupldap.sh @@ -0,0 +1,10 @@ +#!/bin/sh + + +exit 0 +authselect select sssd with-mkhomedir --force + +cat >>/etc/openldap/ldap.conf <