2
0
mirror of https://github.com/xcat2/confluent.git synced 2026-05-16 19:34:19 +00:00

Add architecture handling in pkglist

To handle amd64/arm64 profiles, have the pkglist allow for architecture specific qualifiers.

Additionally, soften failure to accomplish selinux changes.
This commit is contained in:
Jarrod Johnson
2026-01-15 12:52:07 -05:00
parent 72c4868073
commit ccaf22f44f
3 changed files with 27 additions and 4 deletions
+5 -1
View File
@@ -19,4 +19,8 @@ fuse-libs
libnl3
dhcpcd
openssh-keysign
chrony kernel net-tools nfs-utils openssh-server rsync tar util-linux python3 tar dracut dracut-network ethtool parted openssl openssh-clients bash vim-minimal rpm iputils lvm2 efibootmgr shim-x64.x86_64 grub2-efi-x64 attr
chrony kernel net-tools nfs-utils openssh-server rsync tar util-linux python3 tar dracut dracut-network ethtool parted openssl openssh-clients bash vim-minimal rpm iputils lvm2 efibootmgr attr
%onlyarch x86_64
shim-x64.x86_64 grub2-efi-x64
%onlyarch aarch64
shim-aa64.aarch64 grub2-efi-aa64
+6 -1
View File
@@ -1,3 +1,4 @@
system-release
dnf
hostname
irqbalance
@@ -17,4 +18,8 @@ xfsprogs
e2fsprogs
fuse-libs
libnl3
chrony kernel net-tools nfs-utils openssh-server rsync tar util-linux python3 tar dracut dracut-network ethtool parted openssl dhclient openssh-clients bash vim-minimal rpm iputils lvm2 efibootmgr shim-x64.x86_64 grub2-efi-x64 attr
chrony kernel net-tools nfs-utils openssh-server rsync tar util-linux python3 tar dracut dracut-network ethtool parted openssl dhclient openssh-clients bash vim-minimal rpm iputils lvm2 efibootmgr attr
%onlyarch x86_64
shim-x64.x86_64 grub2-efi-x64
%onlyarch aarch64
shim-aa64.aarch64 grub2-efi-aa64
+16 -2
View File
@@ -519,9 +519,18 @@ class OsHandler(object):
pkglistfile = pkglistfile[:-1]
with open(pkglistfile, 'r') as pkglist:
pkgs = ''
ignoremode = False
for line in pkglist.readlines():
line = line.split('#', 1)[0].strip()
pkgs += line + ' '
if line.startswith(r'%onlyarch '):
archs = line[len(r'%onlyarch '):].split()
if self.arch not in archs:
ignoremode = True
else:
ignoremode = False
continue
if not ignoremode:
pkgs += line + ' '
pkgs = pkgs.split()
retpkgs = []
for pkg in pkgs:
@@ -764,7 +773,12 @@ class ElHandler(OsHandler):
if line.startswith('selinuxfs '):
break
else:
self.relabel_targdir()
try:
self.relabel_targdir()
except subprocess.CalledProcessError:
# Some filesystem contexts can not accommodate the selinux labels, warn that
# this failed, but allow it to proceed in case it can boot anyway
sys.stderr.write('Warning: could not relabel target filesystem for SELinux\n')
def relabel_targdir(self):
subprocess.check_call(