From 76cdd958ec2bcdf0510eeb192f44a2e65e880386 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Mon, 8 Feb 2021 09:24:46 -0500 Subject: [PATCH] Add AlmaLinux recognition This imports ALmaLinux --- .../el8/profiles/default/initprofile.sh | 2 +- confluent_server/confluent/osimage.py | 20 +++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/confluent_osdeploy/el8/profiles/default/initprofile.sh b/confluent_osdeploy/el8/profiles/default/initprofile.sh index e8419f0a..d0125588 100644 --- a/confluent_osdeploy/el8/profiles/default/initprofile.sh +++ b/confluent_osdeploy/el8/profiles/default/initprofile.sh @@ -1,5 +1,5 @@ #!/bin/sh -sed -i 's/centos/CentOS/; s/rhel/Red Hat Enterprise Linux/; s/oraclelinux/Oracle Linux/' $2/profile.yaml +sed -i 's/centos/CentOS/; s/rhel/Red Hat Enterprise Linux/; s/oraclelinux/Oracle Linux/; s/alma/AlmaLinux/' $2/profile.yaml ln -s $1/images/pxeboot/vmlinuz $2/boot/kernel && \ ln -s $1/images/pxeboot/initrd.img $2/boot/initramfs/distribution mkdir -p $2/boot/efi/boot && \ diff --git a/confluent_server/confluent/osimage.py b/confluent_server/confluent/osimage.py index 36f51c47..7a8d4ea0 100644 --- a/confluent_server/confluent/osimage.py +++ b/confluent_server/confluent/osimage.py @@ -229,6 +229,26 @@ def extract_file(filepath, flags=0, callback=lambda x: None, imginfo=(), extract extract_entries(archive, flags, callback, totalsize, extractlist) +def check_alma(isoinfo): + ver = None + arch = None + cat = None + for entry in isoinfo[0]: + if 'almalinux-release-8' in entry: + ver = entry.split('-')[2] + arch = entry.split('.')[-2] + cat = 'el8' + break + else: + return None + if arch == 'noarch' and '.discinfo' in isoinfo[1]: + prodinfo = isoinfo[1]['.discinfo'] + arch = prodinfo.split(b'\n')[2] + if not isinstance(arch, str): + arch = arch.decode('utf-8') + return {'name': 'alma-{0}-{1}'.format(ver, arch), 'method': EXTRACT, 'category': cat} + + def check_centos(isoinfo): ver = None arch = None