Compare commits

...

6 Commits

Author SHA1 Message Date
David Abdurachmanov 18cf4e0842
Allow lazy unmount of special bind-mounts
Signed-off-by: David Abdurachmanov <davidlt@rivosinc.com>
2024-03-22 16:14:50 +02:00
Fedora Release Engineering 4cd9e54e57 Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild 2024-01-25 04:26:05 +00:00
Fedora Release Engineering 45d4d1dd58 Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild 2024-01-21 06:03:03 +00:00
Mamoru TASAKA f481cec1f6 Workaround for python3.12 distutils removal 2023-07-27 14:43:24 +09:00
Fedora Release Engineering 8659b6cfda Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-07-20 12:52:52 +00:00
Python Maint 2ba7122993 Rebuilt for Python 3.12 2023-06-13 20:40:44 +02:00
3 changed files with 115 additions and 1 deletions

View File

@ -0,0 +1,11 @@
--- livecd-tools-31.0/Makefile.py312 2022-06-15 20:49:24.000000000 +0900
+++ livecd-tools-31.0/Makefile 2023-07-27 14:10:19.460042745 +0900
@@ -14,7 +14,7 @@ define COMPILE_PYTHON
$(PYTHON_PROGRAM) -c "import compileall as c; c.compile_dir('$(1)', force=1)"
$(PYTHON_PROGRAM) -O -c "import compileall as c; c.compile_dir('$(1)', force=1)"
endef
-PYTHONDIR := $(shell $(PYTHON_PROGRAM) -c "from __future__ import print_function; from distutils.sysconfig import get_python_lib; print(get_python_lib())")
+PYTHONDIR := $(shell $(PYTHON_PROGRAM) -c "import sysconfig; print(sysconfig.get_path('purelib', vars={'platbase': '/usr', 'base': '/usr'}))")
all:

View File

@ -17,13 +17,17 @@
Summary: Tools for building live CDs
Name: livecd-tools
Version: 31.0
Release: 3%{?dist}
Release: 8.0.riscv64%{?dist}
%if 0%{?fedora}
Epoch: 1
%endif
License: GPLv2
URL: https://github.com/livecd-tools/livecd-tools
Source0: https://releases.pagure.org/%{name}/%{name}-%{version}.tar.gz
Patch0: livecd-tools-31.0-py312-distutils-removal.patch
# RISCV (riscv64)
Patch1: test-fix.patch
BuildRequires: make
%if %{with python2}
@ -63,6 +67,8 @@ Requires: dosfstools >= 2.11-8
Requires: e2fsprogs
Requires: lorax >= 18.3
Requires: rsync
Requires: lsof
Requires: psmisc
%if ! 0%{?rhel}
# hfs+ support for Macs
@ -225,6 +231,25 @@ rm -rfv %{buildroot}%{_mandir}/man8/livecd-iso-to-*
%endif
%changelog
* Fri Mar 22 2024 David Abdurachmanov <davidlt@rivosinc.com> - 1:31.0-8.0.riscv64
- Collect more information what is blocking mount point.
- Special bind-mounts can be lazy unmounted.
* Thu Jan 25 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1:31.0-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Sun Jan 21 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1:31.0-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Thu Jul 27 2023 Mamoru TASAKA <mtasaka@fedoraproject.org> - 1:31.0-6
- Workaround for python3.12 distutils removal
* Thu Jul 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1:31.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Tue Jun 13 2023 Python Maint <python-maint@redhat.com> - 1:31.0-4
- Rebuilt for Python 3.12
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1:31.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild

78
test-fix.patch Normal file
View File

@ -0,0 +1,78 @@
diff --git a/imgcreate/fs.py b/imgcreate/fs.py
index f999d05..5c5a003 100644
--- a/imgcreate/fs.py
+++ b/imgcreate/fs.py
@@ -820,8 +820,18 @@ class DiskMount(Mount):
def unmount(self):
if self.mounted:
logging.info("Unmounting directory %s" % self.mountdir)
+ time.sleep(10)
rc = call(['umount', self.mountdir])
if rc != 0:
+ logging.info("- - - lsof %s - - -" % self.mountdir)
+ call(['lsof', '+c0', self.mountdir])
+ logging.info("- - - lsof %s - - -" % self.mountdir)
+ logging.info("- - - fuser %s - - -" % self.mountdir)
+ call(['fuser', '-v', '-m', self.mountdir])
+ logging.info("- - - fuser %s - - -" % self.mountdir)
+ logging.info("- - - pstree - - -")
+ call(['pstree', '-Talp'])
+ logging.info("- - - pstree - - -")
call(['umount', '-l', self.mountdir])
raise MountError(umount_fail_fmt % self.mountdir)
self.mounted = False
@@ -981,8 +991,18 @@ class OverlayFSMount(Mount):
if not self.mounted:
return
+ time.sleep(10)
rc = call(['umount', self.mountdir])
if rc != 0:
+ logging.info("- - - lsof %s - - -" % self.mountdir)
+ call(['lsof', '+c0', self.mountdir])
+ logging.info("- - - lsof %s - - -" % self.mountdir)
+ logging.info("- - - fuser %s - - -" % self.mountdir)
+ call(['fuser', '-v', '-m', self.mountdir])
+ logging.info("- - - fuser %s - - -" % self.mountdir)
+ logging.info("- - - pstree - - -")
+ call(['pstree', '-Talp'])
+ logging.info("- - - pstree - - -")
call(['umount', '-l', self.mountdir])
raise MountError(umount_fail_fmt % self.mountdir)
if self.cowmnt:
@@ -1059,10 +1079,21 @@ class BindChrootMount():
self.mounted = False
return
+ time.sleep(10)
rc = call(['umount', self.dest])
if rc != 0:
+ logging.info("- - - lsof %s - - -" % self.dest)
+ call(['lsof', '+c0', self.dest])
+ logging.info("- - - lsof %s - - -" % self.dest)
+ logging.info("- - - fuser %s - - -" % self.dest)
+ call(['fuser', '-v', '-m', self.dest])
+ logging.info("- - - fuser %s - - -" % self.dest)
+ logging.info("- - - pstree - - -")
+ call(['pstree', '-Talp'])
+ logging.info("- - - pstree - - -")
call(['umount', '-l', self.dest])
- raise MountError(umount_fail_fmt % self.dest)
+ if self.src.strip() not in ('/sys', '/proc', '/dev/pts'):
+ raise MountError(umount_fail_fmt % self.dest)
self.mounted = False
def cleanup(self):
diff --git a/imgcreate/util.py b/imgcreate/util.py
index fad6772..04380c9 100644
--- a/imgcreate/util.py
+++ b/imgcreate/util.py
@@ -32,7 +32,7 @@ def call(*popenargs, **kwargs):
stderr=subprocess.STDOUT, **kwargs)
rc = p.wait()
fp = io.open(p.stdout.fileno(), mode="r", encoding="utf-8", closefd=False)
- stdout = fp.read().split()
+ stdout = fp.read().splitlines()
fp.close()
# Log output using logging module