[pve-devel] [PATCH container] fix #5762: lxc: setup: support `opensuse-slowroll` as OpenSUSE flavor

Christoph Heiss c.heiss at proxmox.com
Fri Oct 11 13:29:47 CEST 2024


See the original bug report [0]. OpenSUSE Tumbleweed Slowroll fails to
be detected corrected due to featuring a different ID in
/etc/os-release.

Simply map that ID to the existing opensuse plugin - much like
Tumbleweed itself. Slowroll is basically just a midway solution between
Leap and Tumbleweed, so there shouldn't be any incompatibilities
really - since we determine specifics in the plugin by version anyway.

[0] https://bugzilla.proxmox.com/show_bug.cgi?id=5762
[1] https://en.opensuse.org/Portal:Slowroll

Signed-off-by: Christoph Heiss <c.heiss at proxmox.com>
---
 src/PVE/LXC/Setup.pm                          |  1 +
 src/test/test-opensuse-slowroll-001/config    |  5 +++++
 .../test-opensuse-slowroll-001/etc/hosts.exp  |  5 +++++
 .../test-opensuse-slowroll-001/etc/os-release | 16 +++++++++++++++
 .../etc/resolv.conf.exp                       |  5 +++++
 .../test-opensuse-slowroll-001/etc/securetty  |  7 +++++++
 .../etc/securetty.exp                         | 12 +++++++++++
 .../etc/sysconfig/network/ifcfg-eth0.exp      |  3 +++
 .../etc/sysconfig/network/ifcfg-eth1.exp      |  3 +++
 .../etc/sysconfig/network/ifcfg-eth2.exp      |  2 ++
 .../etc/sysconfig/network/ifcfg-eth3.exp      |  2 ++
 .../etc/sysconfig/network/ifroute-eth0.exp    |  3 +++
 .../etc/sysconfig/network/ifroute-eth1        |  1 +
 .../etc/sysconfig/network/ifroute-eth1.exp    |  1 +
 .../root/.ssh/authorized_keys.exp             |  3 +++
 .../systemd/system/container-getty at .service   | 20 +++++++++++++++++++
 16 files changed, 89 insertions(+)
 create mode 100644 src/test/test-opensuse-slowroll-001/config
 create mode 100644 src/test/test-opensuse-slowroll-001/etc/hosts.exp
 create mode 100644 src/test/test-opensuse-slowroll-001/etc/os-release
 create mode 100644 src/test/test-opensuse-slowroll-001/etc/resolv.conf.exp
 create mode 100644 src/test/test-opensuse-slowroll-001/etc/securetty
 create mode 100644 src/test/test-opensuse-slowroll-001/etc/securetty.exp
 create mode 100644 src/test/test-opensuse-slowroll-001/etc/sysconfig/network/ifcfg-eth0.exp
 create mode 100644 src/test/test-opensuse-slowroll-001/etc/sysconfig/network/ifcfg-eth1.exp
 create mode 100644 src/test/test-opensuse-slowroll-001/etc/sysconfig/network/ifcfg-eth2.exp
 create mode 100644 src/test/test-opensuse-slowroll-001/etc/sysconfig/network/ifcfg-eth3.exp
 create mode 100644 src/test/test-opensuse-slowroll-001/etc/sysconfig/network/ifroute-eth0.exp
 create mode 100644 src/test/test-opensuse-slowroll-001/etc/sysconfig/network/ifroute-eth1
 create mode 100644 src/test/test-opensuse-slowroll-001/etc/sysconfig/network/ifroute-eth1.exp
 create mode 100644 src/test/test-opensuse-slowroll-001/root/.ssh/authorized_keys.exp
 create mode 100644 src/test/test-opensuse-slowroll-001/usr/lib/systemd/system/container-getty at .service

diff --git a/src/PVE/LXC/Setup.pm b/src/PVE/LXC/Setup.pm
index 5c9114c..3a937a9 100644
--- a/src/PVE/LXC/Setup.pm
+++ b/src/PVE/LXC/Setup.pm
@@ -38,6 +38,7 @@ my $plugins = {
 my $plugin_alias = {
     'opensuse-leap' => 'opensuse',
     'opensuse-tumbleweed' => 'opensuse',
+    'opensuse-slowroll' => 'opensuse',
     arch => 'archlinux',
     sles => 'opensuse',
 };
diff --git a/src/test/test-opensuse-slowroll-001/config b/src/test/test-opensuse-slowroll-001/config
new file mode 100644
index 0000000..6c4e028
--- /dev/null
+++ b/src/test/test-opensuse-slowroll-001/config
@@ -0,0 +1,5 @@
+hostname: pvesuseslow1
+net0: bridge=vmbr0,name=eth0,ip=1.2.3.4/24,gw=1.2.3.1
+net1: bridge=vmbr0,name=eth1,ip=10.2.3.4/24
+net2: bridge=vmbr0,name=eth2,ip=manual
+net3: bridge=vmbr0,name=eth3
diff --git a/src/test/test-opensuse-slowroll-001/etc/hosts.exp b/src/test/test-opensuse-slowroll-001/etc/hosts.exp
new file mode 100644
index 0000000..69cc2b7
--- /dev/null
+++ b/src/test/test-opensuse-slowroll-001/etc/hosts.exp
@@ -0,0 +1,5 @@
+# --- BEGIN PVE ---
+127.0.0.1 localhost.localnet localhost
+::1 localhost.localnet localhost
+1.2.3.4 pvesuseslow1.proxmox.com pvesuseslow1
+# --- END PVE ---
diff --git a/src/test/test-opensuse-slowroll-001/etc/os-release b/src/test/test-opensuse-slowroll-001/etc/os-release
new file mode 100644
index 0000000..2ff0f75
--- /dev/null
+++ b/src/test/test-opensuse-slowroll-001/etc/os-release
@@ -0,0 +1,16 @@
+NAME="openSUSE Tumbleweed-Slowroll"
+# VERSION="20240901"
+ID="opensuse-slowroll"
+ID_LIKE="opensuse suse"
+VERSION_ID="20240901"
+PRETTY_NAME="openSUSE Tumbleweed-Slowroll"
+ANSI_COLOR="0;32"
+# CPE 2.3 format, boo#1217921
+CPE_NAME="cpe:2.3:o:opensuse:slowroll:20240901:*:*:*:*:*:*:*"
+#CPE 2.2 format
+#CPE_NAME="cpe:/o:opensuse:slowroll:20240901"
+BUG_REPORT_URL="https://bugzilla.opensuse.org"
+SUPPORT_URL="https://bugs.opensuse.org"
+HOME_URL="https://www.opensuse.org"
+DOCUMENTATION_URL="https://en.opensuse.org/openSUSE:Slowroll"
+LOGO="distributor-logo-Slowroll"
diff --git a/src/test/test-opensuse-slowroll-001/etc/resolv.conf.exp b/src/test/test-opensuse-slowroll-001/etc/resolv.conf.exp
new file mode 100644
index 0000000..35181cc
--- /dev/null
+++ b/src/test/test-opensuse-slowroll-001/etc/resolv.conf.exp
@@ -0,0 +1,5 @@
+# --- BEGIN PVE ---
+search proxmox.com
+nameserver 8.8.8.8
+nameserver 8.8.8.9
+# --- END PVE ---
diff --git a/src/test/test-opensuse-slowroll-001/etc/securetty b/src/test/test-opensuse-slowroll-001/etc/securetty
new file mode 100644
index 0000000..e0bd229
--- /dev/null
+++ b/src/test/test-opensuse-slowroll-001/etc/securetty
@@ -0,0 +1,7 @@
+tty1
+tty2
+tty3
+tty4
+tty5
+tty6
+console
diff --git a/src/test/test-opensuse-slowroll-001/etc/securetty.exp b/src/test/test-opensuse-slowroll-001/etc/securetty.exp
new file mode 100644
index 0000000..a0f3062
--- /dev/null
+++ b/src/test/test-opensuse-slowroll-001/etc/securetty.exp
@@ -0,0 +1,12 @@
+tty1
+tty2
+tty3
+tty4
+tty5
+tty6
+console
+lxc/console
+lxc/tty1
+lxc/tty2
+lxc/tty3
+lxc/tty4
diff --git a/src/test/test-opensuse-slowroll-001/etc/sysconfig/network/ifcfg-eth0.exp b/src/test/test-opensuse-slowroll-001/etc/sysconfig/network/ifcfg-eth0.exp
new file mode 100644
index 0000000..65bbdac
--- /dev/null
+++ b/src/test/test-opensuse-slowroll-001/etc/sysconfig/network/ifcfg-eth0.exp
@@ -0,0 +1,3 @@
+STARTMODE=onboot
+BOOTPROTO=static
+IPADDR=1.2.3.4/24
diff --git a/src/test/test-opensuse-slowroll-001/etc/sysconfig/network/ifcfg-eth1.exp b/src/test/test-opensuse-slowroll-001/etc/sysconfig/network/ifcfg-eth1.exp
new file mode 100644
index 0000000..eeeb459
--- /dev/null
+++ b/src/test/test-opensuse-slowroll-001/etc/sysconfig/network/ifcfg-eth1.exp
@@ -0,0 +1,3 @@
+STARTMODE=onboot
+BOOTPROTO=static
+IPADDR=10.2.3.4/24
diff --git a/src/test/test-opensuse-slowroll-001/etc/sysconfig/network/ifcfg-eth2.exp b/src/test/test-opensuse-slowroll-001/etc/sysconfig/network/ifcfg-eth2.exp
new file mode 100644
index 0000000..28fdc31
--- /dev/null
+++ b/src/test/test-opensuse-slowroll-001/etc/sysconfig/network/ifcfg-eth2.exp
@@ -0,0 +1,2 @@
+STARTMODE=manual
+BOOTPROTO=static
diff --git a/src/test/test-opensuse-slowroll-001/etc/sysconfig/network/ifcfg-eth3.exp b/src/test/test-opensuse-slowroll-001/etc/sysconfig/network/ifcfg-eth3.exp
new file mode 100644
index 0000000..28fdc31
--- /dev/null
+++ b/src/test/test-opensuse-slowroll-001/etc/sysconfig/network/ifcfg-eth3.exp
@@ -0,0 +1,2 @@
+STARTMODE=manual
+BOOTPROTO=static
diff --git a/src/test/test-opensuse-slowroll-001/etc/sysconfig/network/ifroute-eth0.exp b/src/test/test-opensuse-slowroll-001/etc/sysconfig/network/ifroute-eth0.exp
new file mode 100644
index 0000000..2f6cdb5
--- /dev/null
+++ b/src/test/test-opensuse-slowroll-001/etc/sysconfig/network/ifroute-eth0.exp
@@ -0,0 +1,3 @@
+# --- BEGIN PVE ---
+default 1.2.3.1 0.0.0.0 eth0
+# --- END PVE ---
diff --git a/src/test/test-opensuse-slowroll-001/etc/sysconfig/network/ifroute-eth1 b/src/test/test-opensuse-slowroll-001/etc/sysconfig/network/ifroute-eth1
new file mode 100644
index 0000000..b864673
--- /dev/null
+++ b/src/test/test-opensuse-slowroll-001/etc/sysconfig/network/ifroute-eth1
@@ -0,0 +1 @@
+# Nothing else
diff --git a/src/test/test-opensuse-slowroll-001/etc/sysconfig/network/ifroute-eth1.exp b/src/test/test-opensuse-slowroll-001/etc/sysconfig/network/ifroute-eth1.exp
new file mode 100644
index 0000000..b864673
--- /dev/null
+++ b/src/test/test-opensuse-slowroll-001/etc/sysconfig/network/ifroute-eth1.exp
@@ -0,0 +1 @@
+# Nothing else
diff --git a/src/test/test-opensuse-slowroll-001/root/.ssh/authorized_keys.exp b/src/test/test-opensuse-slowroll-001/root/.ssh/authorized_keys.exp
new file mode 100644
index 0000000..1cb3ec3
--- /dev/null
+++ b/src/test/test-opensuse-slowroll-001/root/.ssh/authorized_keys.exp
@@ -0,0 +1,3 @@
+# --- BEGIN PVE ---
+ssh-rsa ABCDEFG ABC at DEF
+# --- END PVE ---
diff --git a/src/test/test-opensuse-slowroll-001/usr/lib/systemd/system/container-getty at .service b/src/test/test-opensuse-slowroll-001/usr/lib/systemd/system/container-getty at .service
new file mode 100644
index 0000000..9740d3d
--- /dev/null
+++ b/src/test/test-opensuse-slowroll-001/usr/lib/systemd/system/container-getty at .service
@@ -0,0 +1,20 @@
+[Unit]
+Description=Container Getty on /dev/lxc/tty%I
+Documentation=man:agetty(8) man:machinectl(1)
+After=systemd-user-sessions.service plymouth-quit-wait.service
+After=rc-local.service
+Before=getty.target
+IgnoreOnIsolate=yes
+
+[Service]
+ExecStart=-/sbin/agetty --noclear --keep-baud lxc/tty%I 115200,38400,9600 $TERM
+Type=idle
+Restart=always
+RestartSec=0
+UtmpIdentifier=%I
+TTYPath=/dev/%I
+TTYReset=yes
+TTYVHangup=yes
+KillMode=process
+IgnoreSIGPIPE=no
+SendSIGHUP=yes
-- 
2.46.0





More information about the pve-devel mailing list