From a523df80e867ccfd411331697af2ccb41f186fa8 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 16 May 2023 14:51:27 -0400 Subject: [PATCH] Handle newer SuSE After SP4, suse drops mkinird requirement. Switch to dracut -f in such a scenario. --- imgutil/imgutil | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/imgutil/imgutil b/imgutil/imgutil index 57e5539b..e7e55942 100644 --- a/imgutil/imgutil +++ b/imgutil/imgutil @@ -549,7 +549,10 @@ class SuseHandler(OsHandler): subprocess.check_call(cmd) subprocess.check_call(['zypper', '-R', self.targpath, 'install'] + self.zyppargs) os.symlink('/usr/lib/systemd/system/sshd.service', os.path.join(self.targpath, 'etc/systemd/system/multi-user.target.wants/sshd.service')) - args.cmd = ['mkinitrd'] + if os.path.exists(os.path.join(self.targpath, 'sbin/mkinitrd')): + args.cmd = ['mkinitrd'] + else: + args.cmd = ['dracut', '-f'] run_constrainedx(fancy_chroot, (args, self.targpath))