diff --git a/SOURCES/0001-Backport-dracut-chroot-umount-fix.patch b/SOURCES/0001-Backport-dracut-chroot-umount-fix.patch new file mode 100644 index 0000000..d08a6cb --- /dev/null +++ b/SOURCES/0001-Backport-dracut-chroot-umount-fix.patch @@ -0,0 +1,34 @@ +From 4969d3ffd744c9f63be41fbccf54bae121073d6e Mon Sep 17 00:00:00 2001 +From: Eugene Zamriy +Date: Thu, 6 Apr 2023 21:16:26 +0300 +Subject: [PATCH] Backport dracut chroot umount fix + +--- + src/pylorax/imgutils.py | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/src/pylorax/imgutils.py b/src/pylorax/imgutils.py +index d713e4c..80e8c2f 100644 +--- a/src/pylorax/imgutils.py ++++ b/src/pylorax/imgutils.py +@@ -498,12 +498,14 @@ class DracutChroot(object): + return self + + def __exit__(self, exc_type, exc_value, tracebk): +- runcmd(["umount", self.root + "/proc" ]) +- runcmd(["umount", self.root + "/dev" ]) ++ umount(self.root + '/proc', delete=False) ++ umount(self.root + '/dev', delete=False) + + # cleanup bind mounts + for _, d in self.bind: +- runcmd(["umount", self.root + d ]) ++ # In case parallel building of two or more images ++ # some mounts in /var/tmp/lorax can be busy at the moment of unmounting ++ umount(self.root + d, maxretry=10, retrysleep=5, delete=False) + + def Run(self, args): + runcmd(["dracut"] + args, root=self.root) +-- +2.39.2 + diff --git a/SPECS/lorax.spec b/SPECS/lorax.spec index 7a7f2d1..184f0b0 100644 --- a/SPECS/lorax.spec +++ b/SPECS/lorax.spec @@ -4,7 +4,7 @@ Name: lorax Version: 34.9.20 -Release: 1%{?dist} +Release: 1%{?dist}.inferit Summary: Tool for creating the anaconda install images License: GPLv2+ @@ -15,14 +15,21 @@ URL: https://github.com/weldr/lorax # tito build --tgz Source0: %{name}-%{version}.tar.gz +# MSVSphere patches +Patch1001: 0001-Backport-dracut-chroot-umount-fix.patch + BuildRequires: python3-devel BuildRequires: make BuildRequires: systemd-rpm-macros Requires: lorax-templates +%if 0%{?msvsphere} >= 9 +Requires: lorax-templates-msvsphere +%else %if 0%{?rhel} >= 9 Requires: lorax-templates-rhel %endif +%endif Requires: cpio Requires: device-mapper @@ -185,8 +192,11 @@ make DESTDIR=$RPM_BUILD_ROOT mandir=%{_mandir} install %{_datadir}/lorax/templates.d/* %changelog -* Wed Mar 15 2023 MSVSphere Packaging Team - 34.9.20-1 -- Rebuilt for MSVSphere 9.1. +* Thu Apr 06 2023 Eugene Zamriy - 34.9.20-1.inferit +- Backported DracutChroot dirs umount patch from upstream + Without that patch pungi fails on building an EL9 image +- lorax-templates-rhel requirement replaced with lorax-templates-msvsphere +- Rebuilt for MSVSphere 9.1 * Fri Jul 29 2022 Brian C. Lane 34.9.20-1 - templates: Update runtime-* templates (bcl)