From 43d7ad8fb43ee9097e18aec0f18bb30759a5a9c8 Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Wed, 7 Jun 2023 20:11:15 +0100 Subject: [PATCH 01/99] common map of architectures --- udocker/helper/archinfo.py | 100 +++++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 udocker/helper/archinfo.py diff --git a/udocker/helper/archinfo.py b/udocker/helper/archinfo.py new file mode 100644 index 00000000..0676e6b3 --- /dev/null +++ b/udocker/helper/archinfo.py @@ -0,0 +1,100 @@ +# -*- coding: utf-8 -*- +"""Common architecture info and methods for hostinfo and osinfo""" + +class ArchInfo(object): + """Common object for architecture information""" + + # { 'docker':['docker_arch'], 'qemu':['qemu_arch'], + # 'UDOCKER':['udocker_arch'], 'uname':['uname string]', + # 'file':['file string'], 'readelf':['readelf string'] + # } + + _arch_list = [ + {'docker':['amd64'], 'qemu':['x86_64'], 'UDOCKER':['x86_64'], + 'uname':['x86_64'], 'file':['x86_64'], 'readelf':['X86_64']}, + {'docker':['386'], 'qemu':['i386'], 'UDOCKER':['x86'], + 'uname':['i386'], 'file':['Intel 80386'], 'readelf':['Intel 80386']}, + {'docker':['arm64'], 'qemu':['aarch64'], 'UDOCKER':['arm64'], + 'uname':['aarch64'], 'file':['aarch64'], 'readelf':['AArch64']}, + {'docker':['arm'], 'qemu':['arm'], 'UDOCKER':['arm'], + 'uname':['arm'], 'file':[' ARM'], 'readelf':[' ARM']}, + {'docker':['ppc64le'], 'qemu':['ppc64le'], 'UDOCKER':['ppc64le'], + 'uname':['ppc64le'], 'file':['64-bit PowerPC', 'LSB executable'], + 'readelf':['PowerPC64', 'little endian']}, + {'docker':['ppc64'], 'qemu':['ppc64'], 'UDOCKER':['ppc64'], + 'uname':['ppc64'], 'file':['PowerPC', '64-bit'], + 'readelf':['PowerPC', 'ELF64']}, + {'docker':['ppc'], 'qemu':['ppc'], 'UDOCKER':['ppc'], + 'uname':['ppc'], 'file':['PowerPC', '32-bit'], + 'readelf':['PowerPC', 'ELF32']}, + {'docker':['mipsle'], 'qemu':['mipsel'], 'UDOCKER':['mipsle'], + 'uname':['mips'], 'file':['mips', '32-bit', 'LSB executable'], + 'readelf':['mips', 'ELF32', 'little endian']}, + {'docker':['mips'], 'qemu':['mips'], 'UDOCKER':['mips'], + 'uname':['mips'], 'file':['mips', '32-bit', 'MSB'], + 'readelf':['mips', 'ELF32', 'big endian']}, + {'docker':['mips64le'], 'qemu':['mips64el'], 'UDOCKER':['mips64le'], + 'uname':['mips64'], 'file':['mips', '64-bit', 'LSB executable'], + 'readelf':['mips', 'ELF64', 'little endian']}, + {'docker':['mips64'], 'qemu':['mips64'], 'UDOCKER':['mips64'], + 'uname':['mips64'], 'file':['mips', '64-bit', 'MSB'], + 'readelf':['mips', 'ELF64', 'big endian']}, + {'docker':['riscv64'], 'qemu':['riscv64'], 'UDOCKER':['riscv64'], + 'uname':['riscv64'], 'file':['riscv', '64-bit'], + 'readelf':['riscv', 'ELF64']}, + {'docker':['s390x'], 'qemu':['s390x'], 'UDOCKER':['s390x'], + 'uname':['s390x'], 'file':['IBM S/390', '64-bit', 'MSB'], + 'readelf':['IBM S/390', 'ELF64', 'big endian']} + ] + + # binaries from which to get architecture information using + # host tools such as "readelf -h" and "file" + + _binaries_list = ["/lib64/ld-linux-x86-64.so", + "/lib64/ld-linux-x86-64.so.2", + "/lib64/ld-linux-x86-64.so.3", + "/bin/bash", "/bin/sh", "/bin/zsh", + "/bin/csh", "/bin/tcsh", "/bin/ash", + "/bin/ls", "/bin/busybox", + "/system/bin/sh", "/system/bin/ls", + "/lib/ld-linux.so", + "/lib/ld-linux.so.2", + ] + + def get_binaries_list(self): + """Return list of binary files""" + return self._binaries_list + + def get_arch(self, source_type, arch_info, target_type="UDOCKER"): + """ + Return (docker_arch, qemu_arch, udocker_arch) by source type + source can be "uname", "file" or "readelf" + arch_info is data previously produced by uname, file or readelf + target_type can be docker, qemu, UDOCKER or ALL + """ + try: + for arch_dict in self._arch_list: + for arch_expression in arch_dict[source_type]: + if not arch_expression in arch_info: + break + if target_type == "ALL": + return (arch_dict['docker'], arch_dict['qemu'], + arch_dict['UDOCKER']) + return (arch_dict[target_type], [], []) + except (KeyError, ValueError, TypeError, AttributeError): + pass + return ([], [], []) + + def translate_arch(self, source_arch, source_type, target_type): + """ + For a source architecture return the matching target architecture + Example: translate_arch("ppc64le" "docker", "udocker") + """ + try: + for arch_dict in self._arch_list: + for arch_expression in arch_dict[source_type]: + if arch_expression == source_arch: + return arch_dict[target_type] + except (KeyError, ValueError, TypeError, AttributeError): + pass + return [] From 6f29d9384ca6e6e9e877b1a7cb0dd08d7c63eb23 Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Wed, 7 Jun 2023 20:11:53 +0100 Subject: [PATCH 02/99] hostinfo using common archinfo.py --- udocker/helper/hostinfo.py | 35 ++++++++++------------------------- 1 file changed, 10 insertions(+), 25 deletions(-) diff --git a/udocker/helper/hostinfo.py b/udocker/helper/hostinfo.py index af7cb083..a6ca31bc 100644 --- a/udocker/helper/hostinfo.py +++ b/udocker/helper/hostinfo.py @@ -8,9 +8,10 @@ from udocker.genstr import is_genstr from udocker.utils.uprocess import Uprocess +from udocker.helper.archinfo import ArchInfo -class HostInfo(object): +class HostInfo(ArchInfo): """Get information from the host system""" uid = os.getuid() gid = os.getgid() @@ -22,27 +23,12 @@ def username(self): except KeyError: return "" - def arch(self): + # ARCHNEW + def arch(self, target="UDOCKER"): """Get the host system architecture""" - arch = "" - try: - machine = platform.machine() - bits = platform.architecture()[0] - if machine == "x86_64": - if bits == "32bit": - arch = "i386" - else: - arch = "amd64" - elif machine in ("i386", "i486", "i586", "i686"): - arch = "i386" - elif machine.startswith("arm") or machine.startswith("aarch"): - if bits == "32bit": - arch = "arm" - else: - arch = "arm64" - except (NameError, AttributeError): - pass - return arch + machine = platform.machine() + (arch, dummy, dummy) = self.get_arch("uname", machine, target) + return arch[0] if arch[0] else "" def osversion(self): """Get operating system""" @@ -113,12 +99,11 @@ def platform_to_str(self, platform_in): return "%s/%s" % parsed_platform[0:2] return parsed_platform[0] + # ARCHNEW def platform(self, return_str=True): """get docker platform os/architecture/variant""" - translate_architecture = {"i386":"386", "i486":"486", "i586":"586", "i686":"686"} - architecture = self.arch() - host_platform = self.osversion() + "/" + \ - translate_architecture.get(architecture, architecture) + architecture = self.arch("docker") + host_platform = self.osversion() + "/" + architecture if return_str: return host_platform.lower() return self.parse_platform(host_platform) From 396024e358f8ea2df690e46e8c9114cfe3a9751a Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Wed, 7 Jun 2023 20:12:06 +0100 Subject: [PATCH 03/99] osinfo using common archinfo.py --- udocker/helper/osinfo.py | 52 ++++++++++++++++------------------------ 1 file changed, 20 insertions(+), 32 deletions(-) diff --git a/udocker/helper/osinfo.py b/udocker/helper/osinfo.py index 94834a0a..fb46570a 100644 --- a/udocker/helper/osinfo.py +++ b/udocker/helper/osinfo.py @@ -6,28 +6,17 @@ from udocker.utils.uprocess import Uprocess from udocker.utils.fileutil import FileUtil +from udocker.helper.archinfo import ArchInfo - -class OSInfo(object): - """Get os information from a directory tree""" - - _binarylist = ["/lib64/ld-linux-x86-64.so", - "/lib64/ld-linux-x86-64.so.2", - "/lib64/ld-linux-x86-64.so.3", - "/bin/bash", "/bin/sh", "/bin/zsh", - "/bin/csh", "/bin/tcsh", "/bin/ash", - "/bin/ls", "/bin/busybox", - "/system/bin/sh", "/system/bin/ls", - "/lib/ld-linux.so", - "/lib/ld-linux.so.2", - ] +class OSInfo(ArchInfo): + """Get os information""" def __init__(self, root_dir): self._root_dir = root_dir + # ARCH NEW def get_filetype(self, filename): - """Get the file architecture""" - filetype = "" + """Get architecture information from binary using file and readelf""" if not filename.startswith(self._root_dir): filename = self._root_dir + '/' + filename if os.path.islink(filename): @@ -37,26 +26,24 @@ def get_filetype(self, filename): return self.get_filetype(f_path) if os.path.isfile(filename): filetype = Uprocess().get_output(["file", filename]) - if not filetype: - filetype = Uprocess().get_output(["readelf", "-h", filename]) - return filetype + if filetype: + return ("file", filetype) + filetype = Uprocess().get_output(["readelf", "-h", filename]) + if filetype: + return ("readelf", filetype) + return ("", "") - def arch(self): + # ARCH NEW + def arch(self, target="UDOCKER"): """Get guest system architecture""" - for filename in OSInfo._binarylist: + for filename in self.get_binaries_list(): f_path = self._root_dir + filename - filetype = self.get_filetype(f_path) - if not filetype: + (sourcetype, fileinfo) = self.get_filetype(f_path) + if not sourcetype: continue - if "x86-64" in filetype.lower(): - return "amd64" - if "Intel 80386" in filetype: - return "i386" - if "aarch64" in filetype.lower(): - return "arm64" - if " ARM" in filetype: - return "arm" - return "" + + (arch, dummy, dummy) = self.get_arch(sourcetype, fileinfo, target) + return arch[0] if arch[0] else "" def osdistribution(self): """Get guest operating system distribution""" @@ -100,6 +87,7 @@ def osdistribution(self): return ("", "") + # ARCH NEW def osversion(self): """Get guest operating system""" if self.osdistribution()[0]: From 0c13f94daf57a7c08e04007c4065aa9fa9d3be22 Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Wed, 7 Jun 2023 20:13:14 +0100 Subject: [PATCH 04/99] container_json using correct docker architecture --- udocker/commonlocalfile.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/udocker/commonlocalfile.py b/udocker/commonlocalfile.py index 3f4eccd3..6a9ba257 100644 --- a/udocker/commonlocalfile.py +++ b/udocker/commonlocalfile.py @@ -80,6 +80,7 @@ def _untar_saved_container(self, tarfile, destdir): status = Uprocess().call(cmd, stderr=Msg.chlderr, close_fds=True) return not status + # ARCHNEW def create_container_meta(self, layer_id, comment="created by udocker"): """Create metadata for a given container layer, used in import. A file for import is a tarball of a directory tree, does not contain @@ -90,7 +91,7 @@ def create_container_meta(self, layer_id, comment="created by udocker"): container_json["comment"] = comment container_json["created"] = \ time.strftime("%Y-%m-%dT%H:%M:%S.000000000Z") - container_json["architecture"] = HostInfo().arch() + container_json["architecture"] = HostInfo().arch("docker") container_json["os"] = HostInfo().osversion() layer_file = self.localrepo.layersdir + '/' + layer_id + ".layer" container_json["size"] = FileUtil(layer_file).size() From 7d31277cfcfee3a1ef286bf08603db4140dd5f50 Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Wed, 7 Jun 2023 20:14:16 +0100 Subject: [PATCH 05/99] _osenv calls fixed --- udocker/engine/base.py | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/udocker/engine/base.py b/udocker/engine/base.py index 1d2478e4..0918844b 100644 --- a/udocker/engine/base.py +++ b/udocker/engine/base.py @@ -11,6 +11,7 @@ from udocker.config import Config from udocker.helper.nixauth import NixAuthentication from udocker.helper.hostinfo import HostInfo +from udocker.helper.osinfo import OSInfo from udocker.container.structure import ContainerStructure from udocker.utils.filebind import FileBind from udocker.utils.mountpoint import MountPoint @@ -626,20 +627,29 @@ def _run_init(self, container_id): return exec_path + # ARCHNEW + def _get_saved_osenv(self, filename): + """get saved osenv from json file""" + try: + return json.loads(FileUtil(filename).getdata()) + except (IOError, OSError, ValueError, TypeError): + return {} + + # ARCHNEW def _is_same_osenv(self, filename): """Check if the host has changed""" + saved = self._get_saved_osenv(filename) try: - saved = json.loads(FileUtil(filename).getdata()) if (saved["osversion"] == HostInfo().osversion() and saved["oskernel"] == HostInfo().oskernel() and saved["arch"] == HostInfo().arch() and - saved["osdistribution"] == str(HostInfo().osdistribution())): + saved["osdistribution"] == str(OSInfo("/").osdistribution())): return saved - except (IOError, OSError, AttributeError, ValueError, TypeError, - IndexError, KeyError): + except (ValueError, TypeError, KeyError): pass return {} + # ARCHNEW def _save_osenv(self, filename, save=None): """Save host info for is_same_host()""" if save is None: @@ -648,10 +658,9 @@ def _save_osenv(self, filename, save=None): save["osversion"] = HostInfo().osversion() save["oskernel"] = HostInfo().oskernel() save["arch"] = HostInfo().arch() - save["osdistribution"] = str(HostInfo().osdistribution()) + save["osdistribution"] = str(OSInfo("/").osdistribution()) if FileUtil(filename).putdata(json.dumps(save)): return True - except (AttributeError, ValueError, TypeError, - IndexError, KeyError): + except (ValueError, TypeError, IndexError, KeyError): pass return False From 59a5c88f42a908f83776ca4b30b9c495994055af Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Wed, 7 Jun 2023 20:15:42 +0100 Subject: [PATCH 06/99] simplified architecture selection --- udocker/helper/elfpatcher.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/udocker/helper/elfpatcher.py b/udocker/helper/elfpatcher.py index 62102268..02df5222 100644 --- a/udocker/helper/elfpatcher.py +++ b/udocker/helper/elfpatcher.py @@ -39,18 +39,11 @@ def __init__(self, localrepo, container_id): self._shlib = re.compile(r"^lib\S+\.so(\.\d+)*$") self._uid = HostInfo.uid + # ARCHNEW def select_patchelf(self): """Set patchelf executable""" arch = HostInfo().arch() - image_list = [] - if arch == "amd64": - image_list = ["patchelf-x86_64", "patchelf"] - elif arch == "i386": - image_list = ["patchelf-x86", "patchelf"] - elif arch == "arm64": - image_list = ["patchelf-arm64", "patchelf"] - elif arch == "arm": - image_list = ["patchelf-arm", "patchelf"] + image_list = ["patchelf-%s" % (arch), "patchelf"] f_util = FileUtil(self.localrepo.bindir) patchelf_exec = f_util.find_file_in_dir(image_list) From 10280e2f12db3c5777707fde7c89de8c03e3f371 Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Wed, 7 Jun 2023 20:16:16 +0100 Subject: [PATCH 07/99] simplified architecture selection in all engines --- udocker/engine/fakechroot.py | 20 ++++---------------- udocker/engine/proot.py | 31 +++++++++---------------------- udocker/engine/runc.py | 11 ++--------- udocker/engine/singularity.py | 11 ++--------- 4 files changed, 17 insertions(+), 56 deletions(-) diff --git a/udocker/engine/fakechroot.py b/udocker/engine/fakechroot.py index 9ab31bdf..1141beab 100644 --- a/udocker/engine/fakechroot.py +++ b/udocker/engine/fakechroot.py @@ -29,6 +29,7 @@ def __init__(self, localrepo, exec_mode): self._elfpatcher = None self._recommend_expand_symlinks = False + # ARCHNEW def select_fakechroot_so(self): """Select fakechroot sharable object library""" image_list = [] @@ -53,22 +54,9 @@ def select_fakechroot_so(self): if "Alpine" not in distro: version = version.split(".")[0] - if arch == "amd64": - image_list = ["%s-%s-%s-x86_64.so" % (lib, distro, version), - "%s-%s-x86_64.so" % (lib, distro), - "%s-x86_64.so" % (lib), deflib] - elif arch == "i386": - image_list = ["%s-%s-%s-x86.so" % (lib, distro, version), - "%s-%s-x86.so" % (lib, distro), - "%s-x86.so" % (lib), deflib] - elif arch == "arm64": - image_list = ["%s-%s-%s-arm64.so" % (lib, distro, version), - "%s-%s-arm64.so" % (lib, distro), - "%s-arm64.so" % (lib), deflib] - elif arch == "arm": - image_list = ["%s-%s-%s-arm.so" % (lib, distro, version), - "%s-%s-arm.so" % (lib, distro), - "%s-arm.so" % (lib), deflib] + image_list = ["%s-%s-%s-%s.so" % (lib, distro, version, arch), + "%s-%s-%s.so" % (lib, distro, arch), + "%s-%s.so" % (lib, arch), deflib] f_util = FileUtil(self.localrepo.libdir) fakechroot_so = f_util.find_file_in_dir(image_list) diff --git a/udocker/engine/proot.py b/udocker/engine/proot.py index 8dba6dbe..41b5b060 100644 --- a/udocker/engine/proot.py +++ b/udocker/engine/proot.py @@ -29,6 +29,7 @@ def __init__(self, localrepo, exec_mode): self.proot_newseccomp = False # New seccomp mode self._kernel = HostInfo().oskernel() # Emulate kernel + # ARCHNEW def select_proot(self): """Set proot executable and related variables""" self.executable = Config.conf['use_proot_executable'] @@ -38,27 +39,10 @@ def select_proot(self): if self.executable == "UDOCKER" or not self.executable: self.executable = "" arch = HostInfo().arch() - image_list = [] - if arch == "amd64": - if HostInfo().oskernel_isgreater([4, 8, 0]): - image_list = ["proot-x86_64-4_8_0", "proot-x86_64", "proot"] - else: - image_list = ["proot-x86_64", "proot"] - elif arch == "i386": - if HostInfo().oskernel_isgreater([4, 8, 0]): - image_list = ["proot-x86-4_8_0", "proot-x86", "proot"] - else: - image_list = ["proot-x86", "proot"] - elif arch == "arm64": - if HostInfo().oskernel_isgreater([4, 8, 0]): - image_list = ["proot-arm64-4_8_0", "proot-arm64", "proot"] - else: - image_list = ["proot-arm64", "proot"] - elif arch == "arm": - if HostInfo().oskernel_isgreater([4, 8, 0]): - image_list = ["proot-arm-4_8_0", "proot-arm", "proot"] - else: - image_list = ["proot-arm", "proot"] + if HostInfo().oskernel_isgreater([4, 8, 0]): + image_list = ["proot-%s-4_8_0" % (arch), "proot-%s" % (arch), "proot"] + else: + image_list = ["proot-%s" % (arch), "proot"] f_util = FileUtil(self.localrepo.bindir) self.executable = f_util.find_file_in_dir(image_list) @@ -73,6 +57,7 @@ def select_proot(self): if self._is_seccomp_patched(self.executable): self.proot_newseccomp = True + # ARCHNEW def _is_seccomp_patched(self, executable): """Check if kernel has ptrace/seccomp fixes added on 4.8.0. @@ -85,8 +70,10 @@ def _is_seccomp_patched(self, executable): self.proot_noseccomp or HostInfo().oskernel_isgreater([4, 8, 0])): return False + host_file = self.container_dir + "/osenv.json" - host_info = self._is_same_osenv(host_file) + #host_info = self._is_same_osenv(host_file) + host_info = self._get_saved_osenv(host_file) if host_info: if "PROOT_NEW_SECCOMP" in host_info: return True diff --git a/udocker/engine/runc.py b/udocker/engine/runc.py index 5d55dfe5..524025d6 100644 --- a/udocker/engine/runc.py +++ b/udocker/engine/runc.py @@ -37,6 +37,7 @@ def __init__(self, localrepo, exec_mode): self.execution_id = None self.engine_type = "" + # ARCHNEW def select_runc(self): """Set runc executable and related variables""" self.executable = Config.conf['use_runc_executable'] @@ -51,15 +52,7 @@ def select_runc(self): arch = HostInfo().arch() image_list = [] eng = ["runc", "crun"] - if arch == "amd64": - image_list = [eng[0]+"-x86_64", eng[0], - eng[1]+"-x86_64", eng[1]] - elif arch == "i386": - image_list = [eng[0]+"-x86", eng[0], eng[1]+"-x86", eng[1]] - elif arch == "arm64": - image_list = [eng[0]+"-arm64", eng[0], eng[1]+"-arm64", eng[1]] - elif arch == "arm": - image_list = [eng[0]+"-arm", eng[0], eng[1]+"-arm", eng[1]] + image_list = [eng[0]+"-"+arch, eng[0], eng[1]+"-"+arch, eng[1]] f_util = FileUtil(self.localrepo.bindir) self.executable = f_util.find_file_in_dir(image_list) diff --git a/udocker/engine/singularity.py b/udocker/engine/singularity.py index c74e287d..8d2d1665 100644 --- a/udocker/engine/singularity.py +++ b/udocker/engine/singularity.py @@ -27,6 +27,7 @@ def __init__(self, localrepo, exec_mode): self.executable = None # singularity self.execution_id = None + # ARCHNEW def select_singularity(self): """Set singularity executable and related variables""" self.executable = Config.conf['use_singularity_executable'] @@ -36,15 +37,7 @@ def select_singularity(self): if self.executable == "UDOCKER" or not self.executable: self.executable = "" arch = HostInfo().arch() - image_list = [] - if arch == "amd64": - image_list = ["singularity-x86_64", "singularity"] - elif arch == "i386": - image_list = ["singularity-x86", "singularity"] - elif arch == "arm64": - image_list = ["singularity-arm64", "singularity"] - elif arch == "arm": - image_list = ["singularity-arm", "singularity"] + image_list = ["singularity-%s" % (arch), "singularity"] f_util = FileUtil(self.localrepo.bindir) self.executable = f_util.find_file_in_dir(image_list) From 17f8858077b0564274b24ba77f5cf112f98cbead Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Wed, 7 Jun 2023 20:29:00 +0100 Subject: [PATCH 08/99] set devel3 version to alpha release 1.3.10a1 --- udocker/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/udocker/__init__.py b/udocker/__init__.py index e372d648..9cd49f5d 100644 --- a/udocker/__init__.py +++ b/udocker/__init__.py @@ -31,5 +31,5 @@ "Singularity http://singularity.lbl.gov" ] __license__ = "Licensed under the Apache License, Version 2.0" -__version__ = "1.3.9" +__version__ = "1.3.10a1" __date__ = "2023" From b75287aa262dbc4fe8a8376386c83c8a574b19d7 Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Thu, 8 Jun 2023 00:27:37 +0100 Subject: [PATCH 09/99] improved handling and mapping of architecture information --- udocker/helper/archinfo.py | 16 ++++++++++------ udocker/helper/hostinfo.py | 2 +- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/udocker/helper/archinfo.py b/udocker/helper/archinfo.py index 0676e6b3..05505a26 100644 --- a/udocker/helper/archinfo.py +++ b/udocker/helper/archinfo.py @@ -11,7 +11,7 @@ class ArchInfo(object): _arch_list = [ {'docker':['amd64'], 'qemu':['x86_64'], 'UDOCKER':['x86_64'], - 'uname':['x86_64'], 'file':['x86_64'], 'readelf':['X86_64']}, + 'uname':['x86_64'], 'file':['x86-64'], 'readelf':['X86_64']}, {'docker':['386'], 'qemu':['i386'], 'UDOCKER':['x86'], 'uname':['i386'], 'file':['Intel 80386'], 'readelf':['Intel 80386']}, {'docker':['arm64'], 'qemu':['aarch64'], 'UDOCKER':['arm64'], @@ -72,15 +72,19 @@ def get_arch(self, source_type, arch_info, target_type="UDOCKER"): arch_info is data previously produced by uname, file or readelf target_type can be docker, qemu, UDOCKER or ALL """ + found = False try: for arch_dict in self._arch_list: for arch_expression in arch_dict[source_type]: - if not arch_expression in arch_info: + if arch_expression not in arch_info: + found = False break - if target_type == "ALL": - return (arch_dict['docker'], arch_dict['qemu'], - arch_dict['UDOCKER']) - return (arch_dict[target_type], [], []) + found = True + if found: + if target_type == "ALL": + return (arch_dict['docker'], arch_dict['qemu'], + arch_dict['UDOCKER']) + return (arch_dict[target_type], [], []) except (KeyError, ValueError, TypeError, AttributeError): pass return ([], [], []) diff --git a/udocker/helper/hostinfo.py b/udocker/helper/hostinfo.py index a6ca31bc..955d00a1 100644 --- a/udocker/helper/hostinfo.py +++ b/udocker/helper/hostinfo.py @@ -27,7 +27,7 @@ def username(self): def arch(self, target="UDOCKER"): """Get the host system architecture""" machine = platform.machine() - (arch, dummy, dummy) = self.get_arch("uname", machine, target) + (arch, dummy, dummy) = self.get_arch("uname", machine, target) return arch[0] if arch[0] else "" def osversion(self): From e3becbc9be9e492f202f2e38d5b24c9beb9b1459 Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Thu, 8 Jun 2023 00:28:22 +0100 Subject: [PATCH 10/99] support for qemu on Pn modes --- udocker/engine/proot.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/udocker/engine/proot.py b/udocker/engine/proot.py index 41b5b060..14f93f5f 100644 --- a/udocker/engine/proot.py +++ b/udocker/engine/proot.py @@ -9,6 +9,7 @@ from udocker.config import Config from udocker.engine.base import ExecutionEngineCommon from udocker.helper.hostinfo import HostInfo +from udocker.helper.osinfo import OSInfo from udocker.utils.uprocess import Uprocess from udocker.utils.fileutil import FileUtil from udocker.utils.uvolume import Uvolume @@ -120,6 +121,17 @@ def _get_network_map(self): proot_netmap_list.extend(["-n", ]) return proot_netmap_list + # ARCHNEW + def _get_qemu(self): + """Get the qemu string for container run command if emulation needed""" + container_qemu_arch = OSInfo(self.container_root).arch("qemu") + host_qemu_arch = OSInfo("/").arch("qemu") + if not (container_qemu_arch and host_qemu_arch): + return [] + if container_qemu_arch != host_qemu_arch: + return ["-q", "qemu-%s " % container_qemu_arch, ] + return [] + def run(self, container_id): """Execute a Docker container using PRoot. This is the main method invoked to run the a container with PRoot. @@ -165,6 +177,7 @@ def run(self, container_id): cmd_l.append(self.executable) cmd_l.extend(proot_verbose) cmd_l.extend(proot_kill_on_exit) + cmd_l.extend(self._get_qemu()) cmd_l.extend(self._get_volume_bindings()) cmd_l.extend(self._set_uid_map()) cmd_l.extend(["-k", self._kernel, ]) From 78b674357b6d3ea650afd5bbe6c39b5f51104e51 Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Thu, 8 Jun 2023 00:28:40 +0100 Subject: [PATCH 11/99] update CHANGELOG --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index eb74dff5..43247dee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## udocker (1.3.10) + +* improved handling and mapping of architecture information +* added support for qemu on Pn modes enabling execution of + containers with architectures different than the host + ## udocker (1.3.9) * add support to access non-config metadata from containers From 58b995d1ef260a33d62123b879d06ccf01a2d3ca Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Thu, 8 Jun 2023 18:00:40 +0100 Subject: [PATCH 12/99] architecture comparison from OS trees --- udocker/helper/osinfo.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/udocker/helper/osinfo.py b/udocker/helper/osinfo.py index fb46570a..3ab5046f 100644 --- a/udocker/helper/osinfo.py +++ b/udocker/helper/osinfo.py @@ -26,8 +26,8 @@ def get_filetype(self, filename): return self.get_filetype(f_path) if os.path.isfile(filename): filetype = Uprocess().get_output(["file", filename]) - if filetype: - return ("file", filetype) + if filetype and ":" in filetype: + return ("file", filetype.split(":", 1)[1]) filetype = Uprocess().get_output(["readelf", "-h", filename]) if filetype: return ("readelf", filetype) @@ -35,9 +35,9 @@ def get_filetype(self, filename): # ARCH NEW def arch(self, target="UDOCKER"): - """Get guest system architecture""" + """Get OS architecture""" for filename in self.get_binaries_list(): - f_path = self._root_dir + filename + f_path = self._root_dir + "/" + filename (sourcetype, fileinfo) = self.get_filetype(f_path) if not sourcetype: continue @@ -45,6 +45,15 @@ def arch(self, target="UDOCKER"): (arch, dummy, dummy) = self.get_arch(sourcetype, fileinfo, target) return arch[0] if arch[0] else "" + # ARCH NEW + def is_same_arch(self, other_root_dir="/" ,target="UDOCKER"): + """Compare architectures for two system trees""" + this_arch = self.arch(target) + other_arch = OSInfo(other_root_dir).arch(target) + if not (this_arch and other_arch): + return None + return this_arch == other_arch + def osdistribution(self): """Get guest operating system distribution""" for f_path in FileUtil(self._root_dir + "/etc/.+-release").match(): From f37e79c00608c966dd7c45cf4507a53bd4ef4a69 Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Thu, 8 Jun 2023 18:02:53 +0100 Subject: [PATCH 13/99] get qemu pathname and warn on different architecture --- udocker/engine/base.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/udocker/engine/base.py b/udocker/engine/base.py index 0918844b..546d38b9 100644 --- a/udocker/engine/base.py +++ b/udocker/engine/base.py @@ -664,3 +664,30 @@ def _save_osenv(self, filename, save=None): except (ValueError, TypeError, IndexError, KeyError): pass return False + + # ARCHNEW + def _check_arch(self, fail=False): + """Check if architecture is the same""" + if not OSInfo(self.container_root).is_same_arch(): + if fail: + Msg().err("Error: host and container architectures mismatch") + return False + Msg().err("Warning: host and container architectures mismatch", + l=Msg.WAR) + return True + + # ARCHNEW + def _get_qemu(self, return_path=False): + """Get the qemu binary name if emulation needed""" + container_qemu_arch = OSInfo(self.container_root).arch("qemu") + host_qemu_arch = OSInfo("/").arch("qemu") + if not (container_qemu_arch and host_qemu_arch): + return "" + if container_qemu_arch == host_qemu_arch: + return "" + qemu_filename = "qemu-%s" % container_qemu_arch + qemu_path = FileUtil(qemu_filename).find_exec() + if not qemu_path: + Msg().err("Warning: qemu required but not available", l=Msg.WAR) + return "" + return qemu_path if return_path else qemu_filename From 3bf641f6b0dd3615add3ab24bc3cbfd71b19e584 Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Thu, 8 Jun 2023 18:03:52 +0100 Subject: [PATCH 14/99] warn of different architecture --- udocker/engine/fakechroot.py | 1 + udocker/engine/runc.py | 1 + udocker/engine/singularity.py | 2 ++ 3 files changed, 4 insertions(+) diff --git a/udocker/engine/fakechroot.py b/udocker/engine/fakechroot.py index 1141beab..cfe68ec5 100644 --- a/udocker/engine/fakechroot.py +++ b/udocker/engine/fakechroot.py @@ -236,6 +236,7 @@ def run(self, container_id): if not exec_path: return 2 + self._check_arch() self._run_invalid_options() # execution mode and get patcher diff --git a/udocker/engine/runc.py b/udocker/engine/runc.py index 524025d6..b098df38 100644 --- a/udocker/engine/runc.py +++ b/udocker/engine/runc.py @@ -355,6 +355,7 @@ def run(self, container_id): if not self._run_init(container_id): return 2 + self._check_arch() self._run_invalid_options() self._container_specfile = "config.json" diff --git a/udocker/engine/singularity.py b/udocker/engine/singularity.py index 8d2d1665..dd9bd32d 100644 --- a/udocker/engine/singularity.py +++ b/udocker/engine/singularity.py @@ -139,6 +139,8 @@ def run(self, container_id): if not exec_path: return 2 + self._check_arch() + self.opt["cmd"][0] = exec_path.replace(self.container_root + "/", "") self._run_invalid_options() self._make_container_directories() From 915a41a9ad145802b6dda38879547f3c842170fd Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Thu, 8 Jun 2023 18:06:54 +0100 Subject: [PATCH 15/99] improve qemu in proot --- udocker/engine/proot.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/udocker/engine/proot.py b/udocker/engine/proot.py index 14f93f5f..f7f0a6ea 100644 --- a/udocker/engine/proot.py +++ b/udocker/engine/proot.py @@ -9,7 +9,6 @@ from udocker.config import Config from udocker.engine.base import ExecutionEngineCommon from udocker.helper.hostinfo import HostInfo -from udocker.helper.osinfo import OSInfo from udocker.utils.uprocess import Uprocess from udocker.utils.fileutil import FileUtil from udocker.utils.uvolume import Uvolume @@ -122,15 +121,10 @@ def _get_network_map(self): return proot_netmap_list # ARCHNEW - def _get_qemu(self): + def _get_qemu_string(self): """Get the qemu string for container run command if emulation needed""" - container_qemu_arch = OSInfo(self.container_root).arch("qemu") - host_qemu_arch = OSInfo("/").arch("qemu") - if not (container_qemu_arch and host_qemu_arch): - return [] - if container_qemu_arch != host_qemu_arch: - return ["-q", "qemu-%s " % container_qemu_arch, ] - return [] + qemu_filename = self._get_qemu() + return ["-q", qemu_filename ] if qemu_filename else [] def run(self, container_id): """Execute a Docker container using PRoot. This is the main method @@ -177,7 +171,7 @@ def run(self, container_id): cmd_l.append(self.executable) cmd_l.extend(proot_verbose) cmd_l.extend(proot_kill_on_exit) - cmd_l.extend(self._get_qemu()) + cmd_l.extend(self._get_qemu_string()) cmd_l.extend(self._get_volume_bindings()) cmd_l.extend(self._set_uid_map()) cmd_l.extend(["-k", self._kernel, ]) From 935002d16736b99e3150809a4fbe648eb53be411 Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Thu, 8 Jun 2023 18:33:32 +0100 Subject: [PATCH 16/99] update get_filetype in image verify --- udocker/container/localrepo.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/udocker/container/localrepo.py b/udocker/container/localrepo.py index 379f76b3..7be81049 100644 --- a/udocker/container/localrepo.py +++ b/udocker/container/localrepo.py @@ -706,6 +706,7 @@ def _split_layer_id(self, layer_id): return ("", layer_id) + # ARCHNEW def _verify_layer_file(self, structure, layer_id): """Verify layer file in repository""" (layer_algorithm, layer_hash) = self._split_layer_id(layer_id) @@ -719,7 +720,8 @@ def _verify_layer_file(self, structure, layer_id): os.readlink(layer_f)): Msg().err("Error: layer data file not found") return False - if "gzip" in OSInfo('/').get_filetype(layer_f): + (dummy, filetype) = OSInfo('/').get_filetype(layer_f) + if "gzip" in filetype: if not FileUtil(layer_f).verify_tar(): Msg().err("Error: layer tar verify failed:", layer_f) return False From 62a670c24a8d42eb495a1cefa3cffe98615d9d4f Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Thu, 8 Jun 2023 18:34:01 +0100 Subject: [PATCH 17/99] update get_filetype in image verify --- udocker/engine/fakechroot.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/udocker/engine/fakechroot.py b/udocker/engine/fakechroot.py index cfe68ec5..069a432f 100644 --- a/udocker/engine/fakechroot.py +++ b/udocker/engine/fakechroot.py @@ -192,9 +192,8 @@ def _run_invalid_options(self): def _run_add_script_support(self, exec_path): """Add an interpreter for non binary executables (scripts)""" - filetype = OSInfo(self.container_root).get_filetype(exec_path) - if "ELF" in filetype and ("static" in filetype or - "dynamic" in filetype): + (dummy, filetype) = OSInfo(self.container_root).get_filetype(exec_path) + if "ELF" in filetype and ("static" in filetype or "dynamic" in filetype): self.opt["cmd"][0] = exec_path return [] env_exec = FileUtil("env").find_exec("/bin:/usr/bin", self.container_root) From 6a75f9ee8395ffdac2e9512178cbad4bb533f42e Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Thu, 8 Jun 2023 19:23:17 +0100 Subject: [PATCH 18/99] fix _run_add_script_support() for scripts --- udocker/engine/fakechroot.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/udocker/engine/fakechroot.py b/udocker/engine/fakechroot.py index 069a432f..382c922b 100644 --- a/udocker/engine/fakechroot.py +++ b/udocker/engine/fakechroot.py @@ -190,20 +190,21 @@ def _run_invalid_options(self): Msg().out("Warning: this execution mode does not support " "-P --netcoop --publish-all", l=Msg.WAR) + # ARCHNEW def _run_add_script_support(self, exec_path): """Add an interpreter for non binary executables (scripts)""" (dummy, filetype) = OSInfo(self.container_root).get_filetype(exec_path) if "ELF" in filetype and ("static" in filetype or "dynamic" in filetype): self.opt["cmd"][0] = exec_path return [] - env_exec = FileUtil("env").find_exec("/bin:/usr/bin", self.container_root) - if env_exec: - return [self.container_root + '/' + env_exec, ] + #env_exec = FileUtil("env").find_exec("/bin:/usr/bin", self.container_root) + #if env_exec: + # return [self.container_root + '/' + env_exec, ] relc_path = exec_path.split(self.container_root, 1)[-1] real_path = FileUtil(self.container_root).cont2host(relc_path, self.opt["vol"]) hashbang = FileUtil(real_path).get1stline() - match = re.match("#! *([^ ]+)(.*)", hashbang) + match = re.search("#! *([^ ]+)(.*)", hashbang.decode()) if match and not match.group(1).startswith('/'): Msg().err("Error: no such file", match.group(1), "in", exec_path) sys.exit(1) From 4b9b3e74a528f700f4dc0d38cc75ab0d1335a006 Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Fri, 9 Jun 2023 10:52:42 +0100 Subject: [PATCH 19/99] documentation update for --platform --- docs/udocker.1 | 9 ++++++--- docs/user_manual.md | 3 +++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/docs/udocker.1 b/docs/udocker.1 index 728e8668..a8ba9643 100644 --- a/docs/udocker.1 +++ b/docs/udocker.1 @@ -1,7 +1,7 @@ .\" Manpage for udocker .\" Contact udocker@lip.pt to correct errors or typos. .\" To read this man page use: man -l udocker.1 -.TH udocker 1 "23 Jun 2021" "version 1.3.2" "udocker man page" +.TH udocker 1 "9 Jun 2023" "version 1.3.10" "udocker man page" .SH NAME udocker \- execute Docker containers in user space without privileges .SH SYNOPSIS @@ -47,8 +47,8 @@ Prints a usage summary. Further help for specific udocker commands can be obtain .BR search " " [ " " \-a " " ] " " | " " [ " " \--list-tags " " ] " " | " " [ " " --registry=REGISTRY " " ] " " | " " STRING Search for IMAGES in a Docker registry. Not all registries support searching. The \-a option displays all matching entries without pausing. The \--list-tags option lists the tags for a given repository in this case STRING must be a repository name. .TP -.BR pull " " [ " " \--httpproxy=PROXY " " | " " \--index=INDEX " " | " " \--registry=REGISTRY " " ] " " IMAGE -Pull an IMAGE from Docker Hub or from a private repository. A socks4 or socks5 proxy can be specified with \--httpproxy the syntax of PROXY is socks[4|5|4a|5h]://user:pass@host:port. The --registry and --index options enable other repositories (beyond dockerhub) to be selected, it is an URL prefix (ex. https://myrepository.mydomain). +.BR pull " " [ " " \--httpproxy=PROXY " " | " " \--index=INDEX " " | " " \--registry=REGISTRY " " | " " \--platform=OS/ARCH " " ] " " IMAGE +Pull an IMAGE from Docker Hub or from a private repository. A socks4 or socks5 proxy can be specified with \--httpproxy the syntax of PROXY is socks[4|5|4a|5h]://user:pass@host:port. The --registry and --index options enable other repositories (beyond dockerhub) to be selected, it is an URL prefix (ex. https://myrepository.mydomain). If the image is multi-platform the operating system and architecture of the image to be pulled can be specified using \--platform. .TP .BR images " " [ " " \-l " " ] Lists IMAGES available in the local udocker repository. The \-l option provides additional image details. @@ -185,6 +185,9 @@ Do not print the startup banner. .TP --entrypoint="COMMAND" Override the container metadata entrypoint. +.TP +--platform=OS/ARCH +Specify the operating system and/or architecture of the image to be pulled and executed. .RE .SH ENVIRONMENT diff --git a/docs/user_manual.md b/docs/user_manual.md index 39938d3c..02cd287c 100644 --- a/docs/user_manual.md +++ b/docs/user_manual.md @@ -257,6 +257,7 @@ Options: * `--index=url` specify an index other than index.docker.io * `--registry=url` specify a registry other than registry-1.docker.io * `--httpproxy=proxy` specify a socks proxy for downloading +* `--platform=os/architecture` specify a different platform to be pulled Examples: @@ -273,6 +274,7 @@ udocker pull --httpproxy=socks4a://host:port busybox udocker pull --httpproxy=socks5h://host:port busybox udocker pull --httpproxy=socks4a://user:pass@host:port busybox udocker pull --httpproxy=socks5h://user:pass@host:port busybox +udocker pull --platform=linux/arm64 fedora:latest ``` ### 3.6. images @@ -632,6 +634,7 @@ Options: * `--bindhome` attempt to make the user home directory appear inside the container * `--kernel=KERNELID` use a specific kernel id to emulate useful when the host kernel is too old * `--location=DIR` execute a container in a given directory +* `--platform=os/architecture` specify a different platform to be pulled Options valid only in Pn execution modes: From 6cd75e302b9b0f9f3fd70f46c534714deb24a8a9 Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Fri, 9 Jun 2023 11:43:06 +0100 Subject: [PATCH 20/99] add --platform to the run help --- udocker/cli.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/udocker/cli.py b/udocker/cli.py index 53ef7fb4..f2fb0db1 100644 --- a/udocker/cli.py +++ b/udocker/cli.py @@ -67,19 +67,24 @@ def _cdrepo(self, cmdp): self.localrepo.setup(topdir) return True + # ARCHNEW def _check_imagespec(self, imagespec, def_imagespec=None): """Check image:tag syntax""" if (not imagespec) and def_imagespec: imagespec = def_imagespec - + try: - (imagerepo, tag) = imagespec.rsplit(":", 1) + (imagerepo, tag) = imagespec.split("@", 1) except (ValueError, AttributeError): - imagerepo = imagespec - tag = "latest" + try: + (imagerepo, tag) = imagespec.split(":", 1) + except (ValueError, AttributeError): + imagerepo = imagespec + tag = "latest" if not (imagerepo and tag and - self.dockerioapi.is_repo_name(imagespec)): + (self.dockerioapi.is_repo_name(imagespec) or + self.dockerioapi.is_layer_name(imagespec))): Msg().err("Error: must specify image:tag or repository/image:tag") return (None, None) @@ -742,6 +747,7 @@ def do_run(self, cmdp): --location= :use container outside the repository --nobanner :don't print a startup banner --entrypoint :override the container metadata entrypoint + --platform=os/arch :pull image for OS and architecture Only available in Rn execution modes: --device=/dev/xxx :pass device to container (R1 mode only) From 5592c81890f3627d6a8cd41c424931737dfee921 Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Fri, 9 Jun 2023 15:29:44 +0100 Subject: [PATCH 21/99] add is_repo_name() to docker.py --- udocker/docker.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/udocker/docker.py b/udocker/docker.py index 355a556b..74b7c8eb 100644 --- a/udocker/docker.py +++ b/udocker/docker.py @@ -46,12 +46,20 @@ def set_index(self, index_url): """Change docker index url""" self.index_url = index_url + # ARCHNEW def is_repo_name(self, imagerepo): """Check if name matches authorized characters for a docker repo""" if imagerepo and re.match("^[a-zA-Z0-9][a-zA-Z0-9-_./:]+$", imagerepo): return True return False + # ARCHNEW + def is_layer_name(self, layername): + """Check if name matches authorized characters for a docker layer""" + if layername and re.match("^[a-zA-Z0-9]+@[a-z0-9]+:[a-z0-9]+$", layername): + return True + return False + def _get_url(self, *args, **kwargs): """Encapsulates the call to GetURL.get() so that authentication for v1 and v2 repositories can be treated differently. From 9a14f84f7a59bb6b3052528937c7cbce66487ece Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Fri, 9 Jun 2023 15:30:30 +0100 Subject: [PATCH 22/99] remove comment --- udocker/helper/osinfo.py | 1 - 1 file changed, 1 deletion(-) diff --git a/udocker/helper/osinfo.py b/udocker/helper/osinfo.py index 3ab5046f..d0ef2edd 100644 --- a/udocker/helper/osinfo.py +++ b/udocker/helper/osinfo.py @@ -96,7 +96,6 @@ def osdistribution(self): return ("", "") - # ARCH NEW def osversion(self): """Get guest operating system""" if self.osdistribution()[0]: From 57ecb74298baf3bf07ab68119b7887e2a19ecce6 Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Fri, 9 Jun 2023 16:21:55 +0100 Subject: [PATCH 23/99] add run --pull --- docs/udocker.1 | 3 +++ docs/user_manual.md | 1 + udocker/cli.py | 9 ++++++++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/docs/udocker.1 b/docs/udocker.1 index a8ba9643..735477ee 100644 --- a/docs/udocker.1 +++ b/docs/udocker.1 @@ -188,6 +188,9 @@ Override the container metadata entrypoint. .TP --platform=OS/ARCH Specify the operating system and/or architecture of the image to be pulled and executed. +.TP +--pull=WHEN +Specify when to pull the image. The argument WHEN can take the values of "missing", "never" or "always". .RE .SH ENVIRONMENT diff --git a/docs/user_manual.md b/docs/user_manual.md index 02cd287c..35b670e8 100644 --- a/docs/user_manual.md +++ b/docs/user_manual.md @@ -635,6 +635,7 @@ Options: * `--kernel=KERNELID` use a specific kernel id to emulate useful when the host kernel is too old * `--location=DIR` execute a container in a given directory * `--platform=os/architecture` specify a different platform to be pulled +* `--pull=missing|never|always` specify when to pull the image Options valid only in Pn execution modes: diff --git a/udocker/cli.py b/udocker/cli.py index f2fb0db1..87aed274 100644 --- a/udocker/cli.py +++ b/udocker/cli.py @@ -701,6 +701,10 @@ def _get_run_options(self, cmdp, exec_engine=None): "platform": { "fl": ("--platform=",), "act": 'R', "p2": "CMD_OPT", "p3": False + }, + "pull": { + "fl": ("--pull="), "act": 'R', + "p2": "CMD_OPT", "p3": False } } for option, cmdp_args in list(cmd_options.items()): @@ -748,6 +752,7 @@ def do_run(self, cmdp): --nobanner :don't print a startup banner --entrypoint :override the container metadata entrypoint --platform=os/arch :pull image for OS and architecture + --pull= :when to pull missing|never|always Only available in Rn execution modes: --device=/dev/xxx :pass device to container (R1 mode only) @@ -767,6 +772,8 @@ def do_run(self, cmdp): Config.conf['location'] = cmdp.get("--location=") delete = cmdp.get("--rm") name = cmdp.get("--name=") + pull = cmdp.get("--pull=") + dummy = cmdp.get("--pull") # if invoked without option if cmdp.missing_options(): # syntax error return self.STATUS_ERROR @@ -783,7 +790,7 @@ def do_run(self, cmdp): if (imagerepo and self.localrepo.cd_imagerepo(imagerepo, tag)): container_id = self._create(imagerepo + ":" + tag) - if not container_id: + if pull != "never" and (not container_id or pull == "always"): self.do_pull(cmdp) if self.localrepo.cd_imagerepo(imagerepo, tag): container_id = self._create(imagerepo + ":" + tag) From 78a4c27f29ebe2ae2f29831f6960ee5ec2e1d2f2 Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Fri, 9 Jun 2023 19:26:11 +0100 Subject: [PATCH 24/99] implement udocker tag --- udocker/cli.py | 36 +++++++++++++++++++++++++++++++++- udocker/container/localrepo.py | 26 ++++++++++++++++++++++++ udocker/umain.py | 1 + 3 files changed, 62 insertions(+), 1 deletion(-) diff --git a/udocker/cli.py b/udocker/cli.py index 87aed274..bee5f52a 100644 --- a/udocker/cli.py +++ b/udocker/cli.py @@ -72,7 +72,7 @@ def _check_imagespec(self, imagespec, def_imagespec=None): """Check image:tag syntax""" if (not imagespec) and def_imagespec: imagespec = def_imagespec - + try: (imagerepo, tag) = imagespec.split("@", 1) except (ValueError, AttributeError): @@ -916,6 +916,40 @@ def do_rm(self, cmdp): return exit_status + def do_tag(self, cmdp): + """ + tag: create a new tag for a given image + tag + """ + source_imagespec = str(cmdp.get("P1")) + target_imagespec = str(cmdp.get("P2")) + if cmdp.missing_options(): # syntax error + return self.STATUS_ERROR + + (tgt_imagerepo, tgt_tag) = self._check_imagespec(target_imagespec) + if not (tgt_imagerepo and tgt_tag): + Msg().err("Error: target name is invalid") + return self.STATUS_ERROR + + if self.localrepo.cd_imagerepo(tgt_imagerepo, tgt_tag): + Msg().err("Error: target already exists") + return self.STATUS_ERROR + + (src_imagerepo, src_tag) = self._check_imagespec(source_imagespec) + if not self.localrepo.cd_imagerepo(src_imagerepo, src_tag): + Msg().err("Error: source does not exist") + return self.STATUS_ERROR + + if self.localrepo.isprotected_imagerepo(src_imagerepo, src_tag): + Msg().err("Error: source repository is protected") + return self.STATUS_ERROR + + if not self.localrepo.tag(src_imagerepo, src_tag, tgt_imagerepo, tgt_tag): + Msg().err("Error: creation of new image tag failed") + return self.STATUS_ERROR + + return self.STATUS_OK + def do_rmi(self, cmdp): """ rmi: delete an image in the local repository diff --git a/udocker/container/localrepo.py b/udocker/container/localrepo.py index 7be81049..16a39317 100644 --- a/udocker/container/localrepo.py +++ b/udocker/container/localrepo.py @@ -336,6 +336,32 @@ def cd_imagerepo(self, imagerepo, tag): return self.cur_tagdir return "" + def tag(self, src_imagerepo, src_tag, new_imagerepo, new_tag): + """Change the repository tag name""" + src_tag_dir = self.cd_imagerepo(src_imagerepo, src_tag) + if (not src_tag_dir) or self.cd_imagerepo(new_imagerepo, new_tag): + return None + + if not (self.setup_imagerepo(new_imagerepo) is not None + and self.setup_tag(new_tag)): + return False + + new_tag_dir = self.cd_imagerepo(new_imagerepo, new_tag) + if not new_tag_dir: + return False + + for fname in os.listdir(src_tag_dir): + filename = src_tag_dir + "/" + fname + if os.path.islink(filename): + if not self.add_image_layer(os.path.realpath(filename)): + return False + elif fname == "TAG": + continue + elif os.path.isfile(filename): + if not FileUtil(filename).copyto(new_tag_dir + "/" + fname): + return False + return True + def _find(self, filename, in_dir): """is a specific layer filename referenced by another image TAG""" found_list = [] diff --git a/udocker/umain.py b/udocker/umain.py index 82431eb5..0a2ee79e 100644 --- a/udocker/umain.py +++ b/udocker/umain.py @@ -84,6 +84,7 @@ def execute(self): "showconf": self.cli.do_showconf, "save": self.cli.do_save, "inspect": self.cli.do_inspect, "login": self.cli.do_login, "setup": self.cli.do_setup, "install": self.cli.do_install, + "tag": self.cli.do_tag, } if ((len(self.argv) == 1) or From cec8a665e63c42d2da4453380ce89b29e93cbe6f Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Fri, 9 Jun 2023 23:16:54 +0100 Subject: [PATCH 25/99] Docs for udocker tag --- docs/udocker.1 | 3 +++ docs/user_manual.md | 20 ++++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/docs/udocker.1 b/docs/udocker.1 index 735477ee..a1f2c53f 100644 --- a/docs/udocker.1 +++ b/docs/udocker.1 @@ -118,6 +118,9 @@ Remove authentication information created by "login". By default authentication .BR setup " " --execmode= " " | " " --execmode= " " | " " --execmode= " " | " " --execmode= " " | " " --force " " | " " --nvidia " " | " " --purge " " CONTAINER\-ID Change container execution settings. The option --execmode enables selection of an alternative execution engine. In certain cases when experiencing execution errors changing the execution mode to mode P2 may solve the problem. The option --force can be used with --execmode to force a given execution mode upon a setup error. The option --nvidia enables access to GPGPUs by adding the necessary host libraries to the container (EXPERIMENTAL). The option --force can also be used with --nvidia to force the setup of the nvidia environment. The option --purge cleans mountpoints and auxiliary files created by udocker. .TP +.BR tag " " SOURCEIMAGE " " TARGETIMAGE +Creates a new image tag from an existing source image. The newly created image tag is a replica of the source image. The source image can be removed or further updated via pull without affecting the newly created tag. A new tag does not occupy additional space as the image layers are shared. The image layers are only removed from the local udocker repository when no other image is referencing them. +.TP .BR run " " [ " " RUNOPTIONS " " ] " " IMAGE " " | " " CONTAINER-ID " " | " " ALIAS " " [ " " COMMAND " " ARG1 " " ARG2 " " ... " " ] Execute a CONTAINER identified by CONTAINER-ID or ALIAS name. If an IMAGE name is provided instead of a CONTAINER-ID or ALIAS, then a CONTAINER will be automatically created from the specified IMAGE and executed. The "run" command will try to respect the execution information specified in the container or image metadata, if such information is not provided it will try to find a shell interpreter inside the container and execute it. Optionally a COMMAND to be executed inside the CONTAINER environment can be provided in the command line. The following RUNOPTIONS are available: .RS diff --git a/docs/user_manual.md b/docs/user_manual.md index 35b670e8..4fa33480 100644 --- a/docs/user_manual.md +++ b/docs/user_manual.md @@ -971,6 +971,26 @@ Example: UDOCKER_DEFAULT_EXECUTION_MODE=P2 ./udocker run mycontainer /bin/ls ``` +### 3.28. tag + +```bash +udocker tag SOURCEREPO/IMAGE:TAG TARGETREPO/IMAGE:TAG +``` + +Creates a new image tag from an existing source image. The newly created +image tag is a replica of the source image. The source image can be removed +or further updated via pull without affecting the newly created tag. A +new tag does not occupy additional space as the image layers are shared. +The image layers are only removed from the local udocker repository when +no other image is referencing them. + +Examples: + +```bash +udocker tag centos:centos7 mycentos:mycentos7 +``` + + ## 4. Running MPI jobs In this section we will use the Lattice QCD simulation software openQCD to From 1e56b41cf08a5763cb5cadcba25c95c471312628 Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Sat, 10 Jun 2023 01:51:22 +0100 Subject: [PATCH 26/99] docs for manifest inspect --- docs/udocker.1 | 3 +++ docs/user_manual.md | 17 ++++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/docs/udocker.1 b/docs/udocker.1 index a1f2c53f..23dd6815 100644 --- a/docs/udocker.1 +++ b/docs/udocker.1 @@ -106,6 +106,9 @@ Protect an IMAGE or CONTAINER against accidental deletion by "udocker rm" or "ud .BR unprotect " " IMAGE " " | " " CONTAINER\-ID " " | " " ALIAS Remove a protection flag placed by "protect". .TP +.BR manifest " " inspect " " IMAGE +Obtain and print information about an IMAGE manifest from a remote registry. +.TP .BR mkrepo " " DIRECTORY Setup a local repository in the host DIRECTORY. The required directory structure is created. .TP diff --git a/docs/user_manual.md b/docs/user_manual.md index 4fa33480..cf0a8d0d 100644 --- a/docs/user_manual.md +++ b/docs/user_manual.md @@ -984,12 +984,27 @@ new tag does not occupy additional space as the image layers are shared. The image layers are only removed from the local udocker repository when no other image is referencing them. -Examples: +Example: ```bash udocker tag centos:centos7 mycentos:mycentos7 ``` +### 3.29. manifest + +```bash +udocker manifest inspect REPO/IMAGE:TAG +``` + +Obtain and print information about an IMAGE manifest from a remote registry. + +Example: + +```bash +udocker manifest inspect centos:centos7 +``` + + ## 4. Running MPI jobs From 21ce08c9a66cca62d517955504d831e2f628c74f Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Sat, 10 Jun 2023 01:56:40 +0100 Subject: [PATCH 27/99] add command manifest inspect --- udocker/cli.py | 47 +++++++++++++++++++++++++++++++++++++++++++++++ udocker/docker.py | 13 ++++++++++++- udocker/umain.py | 2 +- 3 files changed, 60 insertions(+), 2 deletions(-) diff --git a/udocker/cli.py b/udocker/cli.py index bee5f52a..1e4c2867 100644 --- a/udocker/cli.py +++ b/udocker/cli.py @@ -1084,6 +1084,53 @@ def do_rmname(self, cmdp): Msg().out("Info: container name: %s removed." % name) return self.STATUS_OK + def do_manifest(self, cmdp): + """ + manifest: commands for image manifests + manifest inspect + --httpproxy=socks4://user:pass@host:port :use http proxy + --httpproxy=socks5://user:pass@host:port :use http proxy + --httpproxy=socks4://host:port :use http proxy + --httpproxy=socks5://host:port :use http proxy + --httpproxy=socks4a://user:pass@host:port :use http proxy + --httpproxy=socks5h://user:pass@host:port :use http proxy + --httpproxy=socks4a://host:port :use http proxy + --httpproxy=socks5h://host:port :use http proxy + --index=https://index.docker.io/v1 :docker index + --registry=https://registry-1.docker.io :docker registry + --platform=os/arch :docker platform + + Examples: + manifest inspect quay.io/something/somewhere:latest + """ + index_url = cmdp.get("--index=") + registry_url = cmdp.get("--registry=") + http_proxy = cmdp.get("--httpproxy=") + platform = cmdp.get("--platform=") + if platform is False: + platform = "" + if cmdp.get("P1") != "inspect": + return self.STATUS_ERROR + + (imagerepo, tag) = self._check_imagespec(cmdp.get("P2")) + if (not imagerepo) or cmdp.missing_options(): # syntax error + return self.STATUS_ERROR + + self._set_repository(registry_url, index_url, imagerepo, http_proxy) + v2_auth_token = self.keystore.get(self.dockerioapi.registry_url) + self.dockerioapi.set_v2_login_token(v2_auth_token) + (dummy, manifest_json) = \ + self.dockerioapi.get_manifest(imagerepo, tag, platform) + + try: + Msg().out(json.dumps(manifest_json, sort_keys=True, + indent=4, separators=(',', ': '))) + except (IOError, OSError, AttributeError, ValueError, TypeError): + Msg().out(manifest_json) + return self.STATUS_ERROR + + return self.STATUS_OK + def do_inspect(self, cmdp): """ inspect: print container metadata JSON from an imagerepo or container diff --git a/udocker/docker.py b/udocker/docker.py index 74b7c8eb..999770cc 100644 --- a/udocker/docker.py +++ b/udocker/docker.py @@ -423,6 +423,8 @@ def get_v2_image_manifest(self, imagerepo, tag, platform=""): if ("docker.distribution.manifest.list.v2" in content_type or "oci.image.index.v1+json" in content_type): image_index = json.loads(buf.getvalue().decode()) + if not platform: + return (hdr.data, image_index) digest = self._get_v2_digest_from_image_index(image_index, platform) if not digest: @@ -433,7 +435,7 @@ def get_v2_image_manifest(self, imagerepo, tag, platform=""): digest, platform) except (OSError, KeyError, AttributeError, ValueError, TypeError): pass - return (hdr.data, []) + return (hdr.data, {}) def get_v2_image_layer(self, imagerepo, layer_id): """Get one image layer data file (tarball)""" @@ -607,6 +609,15 @@ def get(self, imagerepo, tag, platform=""): self.localrepo.del_imagerepo(imagerepo, tag, False) return files + def get_manifest(self, imagerepo, tag, platform=""): + """Get image manifest""" + Msg().out("Debug: get manifest imagerepo: %s tag: %s" + % (imagerepo, tag), l=Msg.DBG) + (dummy, remoterepo) = self._parse_imagerepo(imagerepo) + if self.is_v2(): + return self.get_v2_image_manifest(remoterepo, tag, platform) + return ({}, {}) + def get_tags(self, imagerepo): """List tags from a v2 or v1 repositories""" Msg().out("Debug: get tags", imagerepo, l=Msg.DBG) diff --git a/udocker/umain.py b/udocker/umain.py index 0a2ee79e..3d78ecb0 100644 --- a/udocker/umain.py +++ b/udocker/umain.py @@ -84,7 +84,7 @@ def execute(self): "showconf": self.cli.do_showconf, "save": self.cli.do_save, "inspect": self.cli.do_inspect, "login": self.cli.do_login, "setup": self.cli.do_setup, "install": self.cli.do_install, - "tag": self.cli.do_tag, + "tag": self.cli.do_tag, "manifest": self.cli.do_manifest, } if ((len(self.argv) == 1) or From f267507e6fd29680d0d568e00f42604391ed9097 Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Sat, 10 Jun 2023 15:14:58 +0100 Subject: [PATCH 28/99] improve manifest inspect --- udocker/cli.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/udocker/cli.py b/udocker/cli.py index 1e4c2867..783137c7 100644 --- a/udocker/cli.py +++ b/udocker/cli.py @@ -752,7 +752,7 @@ def do_run(self, cmdp): --nobanner :don't print a startup banner --entrypoint :override the container metadata entrypoint --platform=os/arch :pull image for OS and architecture - --pull= :when to pull missing|never|always + --pull= :when to pull (missing|never|always) Only available in Rn execution modes: --device=/dev/xxx :pass device to container (R1 mode only) @@ -1087,7 +1087,7 @@ def do_rmname(self, cmdp): def do_manifest(self, cmdp): """ manifest: commands for image manifests - manifest inspect + manifest [options] inspect --httpproxy=socks4://user:pass@host:port :use http proxy --httpproxy=socks5://user:pass@host:port :use http proxy --httpproxy=socks4://host:port :use http proxy @@ -1107,13 +1107,11 @@ def do_manifest(self, cmdp): registry_url = cmdp.get("--registry=") http_proxy = cmdp.get("--httpproxy=") platform = cmdp.get("--platform=") - if platform is False: - platform = "" - if cmdp.get("P1") != "inspect": - return self.STATUS_ERROR + platform = "" if platform is False else platform + subcommand = cmdp.get("P1") (imagerepo, tag) = self._check_imagespec(cmdp.get("P2")) - if (not imagerepo) or cmdp.missing_options(): # syntax error + if (not imagerepo) or cmdp.missing_options() or subcommand != "inspect": return self.STATUS_ERROR self._set_repository(registry_url, index_url, imagerepo, http_proxy) @@ -1357,6 +1355,7 @@ def do_help(self, cmdp): clone :Duplicate container rm :Delete container rmi :Delete image + tag :Tag image import :Import tar file (exported by docker) import - :Import from stdin (exported by docker) @@ -1366,8 +1365,13 @@ def do_help(self, cmdp): load :Load image from stdin (saved by docker) save -o :Save image with layers to file - inspect -p :Return low level information on image + inspect -p :Print image or container metadata verify :Verify a pulled image + manifest inspect :Print manifest metadata + + udocker manifest inspect centos/centos8 + udocker pull --platform=linux/arm64 centos/centos8 + udocker tag centos/centos8 mycentos/centos8:arm64 protect :Protect repository unprotect :Unprotect repository From 9be28aab0c1f7ed7160943bcc46978930a64b3c7 Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Sat, 10 Jun 2023 17:42:44 +0100 Subject: [PATCH 29/99] default exec from /bin/bash to bash --- udocker/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/udocker/config.py b/udocker/config.py index 08772987..3d45470e 100644 --- a/udocker/config.py +++ b/udocker/config.py @@ -46,7 +46,7 @@ class Config(object): conf['tmpdir'] = os.getenv("TMPDIR", "/tmp") # for tmp files only # defaults for container execution - conf['cmd'] = ["/bin/bash", "-i"] # Comand to execute + conf['cmd'] = ["bash", "-i"] # Comand to execute # default path for executables conf['root_path'] = "/usr/sbin:/sbin:/usr/bin:/bin" From 8471a6109e463df86b9ec1a9f50cf338bbc8eaed Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Sat, 10 Jun 2023 17:43:42 +0100 Subject: [PATCH 30/99] enable lowercase keys in metadata --- udocker/container/structure.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/udocker/container/structure.py b/udocker/container/structure.py index 8b555e80..ab565f3a 100644 --- a/udocker/container/structure.py +++ b/udocker/container/structure.py @@ -44,7 +44,7 @@ def get_container_attr(self): return (container_dir, container_json) - def get_container_meta(self, param, default, cntjson): + def _get_container_meta(self, param, default, cntjson): """Get the metadata configuration from the container""" cidx = "" if "config" in cntjson: @@ -77,6 +77,13 @@ def get_container_meta(self, param, default, cntjson): return default + def get_container_meta(self, param, default, cntjson): + """Get the metadata configuration normalcase or lowercase""" + meta_item = self._get_container_meta(param, default, cntjson) + if meta_item: + return meta_item + return self._get_container_meta(param.lower(), default, cntjson) + def _dict_to_str(self, in_dict): """Convert dict to str""" out_str = "" From fc8a09f2e3fc00974f8d316505a03e4a9761e94f Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Sat, 10 Jun 2023 17:44:44 +0100 Subject: [PATCH 31/99] isfile --- udocker/utils/fileutil.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/udocker/utils/fileutil.py b/udocker/utils/fileutil.py index 3244012d..0360a433 100644 --- a/udocker/utils/fileutil.py +++ b/udocker/utils/fileutil.py @@ -327,6 +327,16 @@ def isdir(self): return False + def isfile(self): + """Is filename a plain file""" + try: + if os.path.isfile(self.filename): + return True + except (IOError, OSError, TypeError): + pass + + return False + def size(self): """File size in bytes""" try: From 56b0bc9cd0aab5bb04650508f5c713eb277aaa3c Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Sat, 10 Jun 2023 17:45:41 +0100 Subject: [PATCH 32/99] address load of v1 images not produced by docker --- udocker/docker.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/udocker/docker.py b/udocker/docker.py index 999770cc..6b707a6a 100644 --- a/udocker/docker.py +++ b/udocker/docker.py @@ -711,11 +711,12 @@ def _load_structure(self, tmp_imagedir): elif fname == "manifest.json": structure["manifest"] = \ self.localrepo.load_json(f_path) - elif len(fname) >= 69 and fname.endswith(".json"): + #elif len(fname) >= 69 and fname.endswith(".json"): + elif fname.endswith(".json") and FileUtil(f_path).isfile(): structure["repoconfigs"][fname] = {} structure["repoconfigs"][fname]["json"] = self.localrepo.load_json(f_path) structure["repoconfigs"][fname]["json_f"] = f_path - elif len(fname) >= 64 and FileUtil(f_path).isdir(): + elif FileUtil(f_path).isdir(): layer_id = fname structure["repolayers"][layer_id] = {} for layer_f in os.listdir(f_path): From 3889b51639c42365358a67643a8b055fb5c76b1d Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Sat, 10 Jun 2023 20:39:21 +0100 Subject: [PATCH 33/99] add import --platform --- udocker/cli.py | 6 ++++-- udocker/commonlocalfile.py | 22 ++++++++++++++-------- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/udocker/cli.py b/udocker/cli.py index 783137c7..8abe5bb8 100644 --- a/udocker/cli.py +++ b/udocker/cli.py @@ -367,10 +367,12 @@ def do_import(self, cmdp): --tocontainer :import to container, no image is created --clone :import udocker container format with metadata --name= :with --tocontainer or --clone to add an alias + --platform=os/arch :docker platform """ move_tarball = cmdp.get("--mv") to_container = cmdp.get("--tocontainer") name = cmdp.get("--name=") + platform = cmdp.get("--platform=") clone = cmdp.get("--clone") from_stdin = cmdp.get('-') if from_stdin: @@ -395,7 +397,7 @@ def do_import(self, cmdp): (imagerepo, tag) = self._check_imagespec(imagespec, "IMPORTED:unknown") container_id = self.localfileapi.import_tocontainer( - tarfile, imagerepo, tag, name) + tarfile, imagerepo, tag, name, platform) if container_id: Msg().out(container_id) return self.STATUS_OK @@ -404,7 +406,7 @@ def do_import(self, cmdp): if not imagerepo: return self.STATUS_ERROR if self.localfileapi.import_toimage(tarfile, imagerepo, tag, - move_tarball): + move_tarball, platform): return self.STATUS_OK Msg().err("Error: importing") return self.STATUS_ERROR diff --git a/udocker/commonlocalfile.py b/udocker/commonlocalfile.py index 6a9ba257..356ab809 100644 --- a/udocker/commonlocalfile.py +++ b/udocker/commonlocalfile.py @@ -81,18 +81,22 @@ def _untar_saved_container(self, tarfile, destdir): return not status # ARCHNEW - def create_container_meta(self, layer_id, comment="created by udocker"): + def create_container_meta(self, layer_id, platform=""): """Create metadata for a given container layer, used in import. A file for import is a tarball of a directory tree, does not contain metadata. This method creates minimal metadata. """ + (p_os, p_arch, p_variant) = HostInfo().parse_platform(platform) container_json = {} container_json["id"] = layer_id - container_json["comment"] = comment + container_json["comment"] = "created by udocker" container_json["created"] = \ time.strftime("%Y-%m-%dT%H:%M:%S.000000000Z") - container_json["architecture"] = HostInfo().arch("docker") - container_json["os"] = HostInfo().osversion() + container_json["architecture"] = \ + p_arch if p_arch else HostInfo().arch("docker") + if p_variant: + container_json["variant"] = p_variant + container_json["os"] = p_os if p_os else HostInfo().osversion() layer_file = self.localrepo.layersdir + '/' + layer_id + ".layer" container_json["size"] = FileUtil(layer_file).size() if container_json["size"] == -1: @@ -153,7 +157,8 @@ def create_container_meta(self, layer_id, comment="created by udocker"): } return container_json - def import_toimage(self, tarfile, imagerepo, tag, move_tarball=True): + def import_toimage(self, tarfile, imagerepo, tag, move_tarball=True, + platform=""): """Import a tar file containing a simple directory tree possibly created with Docker export and create local image""" if not os.path.exists(tarfile) and tarfile != '-': @@ -185,13 +190,14 @@ def import_toimage(self, tarfile, imagerepo, tag, move_tarball=True): return False self.localrepo.add_image_layer(layer_file) self.localrepo.save_json("ancestry", [layer_id]) - container_json = self.create_container_meta(layer_id) + container_json = self.create_container_meta(layer_id, platform) self.localrepo.save_json(json_file, container_json) self.localrepo.add_image_layer(json_file) Msg().out("Info: added layer", layer_id, l=Msg.INF) return layer_id - def import_tocontainer(self, tarfile, imagerepo, tag, container_name): + def import_tocontainer(self, tarfile, imagerepo, tag, container_name, + platform=""): """Import a tar file containing a simple directory tree possibly created with Docker export and create local container ready to use""" if not imagerepo: @@ -206,7 +212,7 @@ def import_tocontainer(self, tarfile, imagerepo, tag, container_name): container_name) return False layer_id = Unique().layer_v1() - container_json = self.create_container_meta(layer_id) + container_json = self.create_container_meta(layer_id, platform) container_id = ContainerStructure(self.localrepo).create_fromlayer( imagerepo, tag, tarfile, container_json) if container_name: From 50e465b76dbd9fdcb139d9df1f33e2ffd6421dae Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Sat, 10 Jun 2023 21:33:45 +0100 Subject: [PATCH 34/99] docs add import --platform --- docs/udocker.1 | 6 +++--- docs/user_manual.md | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/udocker.1 b/docs/udocker.1 index 23dd6815..0c1a09eb 100644 --- a/docs/udocker.1 +++ b/docs/udocker.1 @@ -77,12 +77,12 @@ Change a given container ALIAS name. .BR rmi " " [ " " -f " " ] " " IMAGE Delete an IMAGE in the local repository. Any related CONTAINERS previously extracted are NOT affected by the parent IMAGE removal. The option \-f forces the deletion, and can be used when the IMAGE structure is damaged. .TP -.BR import " " [ " " --mv " " ] " " TARBALL " " IMAGE " " | " " - " " IMAGE +.BR import " " [ " " --mv " " ] " " [ " " --platform=OS/ARCH " " ] " " TARBALL " " IMAGE " " | " " - " " IMAGE .TP -.BR import " " --tocontainer " " --name=ALIAS " " TARBALL " " | " " --tocontainer " " --name=ALIAS " " - " " +.BR import " " --tocontainer " " --name=ALIAS " " [ " " --platform=OS/ARCH " " ] " " TARBALL " " | " " --tocontainer " " --name=ALIAS " " - " " .TP .BR import " " --clone " " --name=ALIAS " " TARBALL " " | " " --clone " " --name=ALIAS " " - " " -Import a tarball from file or stdin. The tarball can be imported into a new image or container. The first form can be used to import a container exported by docker into a new image. The second form uses --tocontainer to import directly into a container without creating an image. The third form uses --clone to import a udocker container (e.g. exported with udocker export --clone) into a new container without creating an image, preserving the container metadata and execution modes. When importing to an image (default) the option --mv will try to move the tarball file into the repository instead of copying the content. When importing to a container the option --name can be used to provide a name alias to the created container. +Import a tarball from file or stdin. The tarball can be imported into a new image or container. The first form can be used to import a container exported by docker into a new image. The second form uses --tocontainer to import directly into a container without creating an image. The third form uses --clone to import a udocker container (e.g. exported with udocker export --clone) into a new container without creating an image, preserving the container metadata and execution modes. When importing to an image (default) the option --mv will try to move the tarball file into the repository instead of copying the content. When importing to a container the option --name can be used to provide a name alias to the created container. The operating system and architecture of the tarball content can be specified with --platform. .TP .BR load " " - " " .TP diff --git a/docs/user_manual.md b/docs/user_manual.md index cf0a8d0d..2676b35f 100644 --- a/docs/user_manual.md +++ b/docs/user_manual.md @@ -499,6 +499,7 @@ Options: * `--tocontainer` import directly into a container. * `--clone` import udocker container format with both metadata and container * `--name=ALIAS` with `--tocontainer` or `--clone` to give an alias to the container +* `--platform=os/architecture` specify the architecture of the binaries in the tarball Examples: @@ -990,7 +991,7 @@ Example: udocker tag centos:centos7 mycentos:mycentos7 ``` -### 3.29. manifest +### 3.29. manifest inspect ```bash udocker manifest inspect REPO/IMAGE:TAG From 97da0aa6382f6144c2158cbeb614278ca1b7cf56 Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Sat, 10 Jun 2023 22:14:21 +0100 Subject: [PATCH 35/99] update list of udocker commands --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index feb79aab..8ef986b9 100644 --- a/README.md +++ b/README.md @@ -96,6 +96,7 @@ but is still available pull :Pull container image from dockerhub create :Create container from a pulled image run :Execute container + run :Pull, create and execute container images -l :List container images ps -m -s :List created containers @@ -105,6 +106,7 @@ but is still available clone :Duplicate container rm :Delete container rmi :Delete image + tag :Tag image import :Import tar file (exported by docker) import - :Import from stdin (exported by docker) @@ -116,6 +118,7 @@ but is still available inspect -p :Return low level information on image verify :Verify a pulled or loaded image + manifest inspect :Print manifest metadata protect :Protect repository unprotect :Unprotect repository @@ -169,6 +172,14 @@ udocker pull quay.io/biocontainers/scikit-bio:0.2.3--np112py35_0 udocker images ``` +Pull a different architecture such as arm64 instead of amd64. + +```bash +udocker manifest inspect centos/centos8 +udocker pull --platform=linux/arm64 centos/centos8 +udocker tag centos/centos8 mycentos/centos8:arm64 +``` + Create a container from a pulled image, assign a name to the created container and run it. A created container can be run multiple times until it is explicitely removed. From af5305ca2ce01eb57e9ecc48b340aed8a9c017b0 Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Sat, 10 Jun 2023 22:15:42 +0100 Subject: [PATCH 36/99] update clip help --- udocker/cli.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/udocker/cli.py b/udocker/cli.py index 8abe5bb8..2b95e82f 100644 --- a/udocker/cli.py +++ b/udocker/cli.py @@ -1400,6 +1400,10 @@ def do_help(self, cmdp): udocker inspect mycontainer udocker inspect -p mycontainer + udocker manifest inspect centos/centos8 + udocker pull --platform=linux/arm64 centos/centos8 + udocker tag centos/centos8 mycentos/centos8:arm64 + udocker run mycontainer cat /etc/redhat-release udocker run --hostauth --hostenv --bindhome mycontainer udocker run --user=root mycontainer yum install firefox From 8aea5189b28fad446ef8ea7dbac75b90a8fc8c9c Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Sat, 10 Jun 2023 23:24:39 +0100 Subject: [PATCH 37/99] ubuntu:23 --- utils/build_tarball.sh | 141 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 140 insertions(+), 1 deletion(-) diff --git a/utils/build_tarball.sh b/utils/build_tarball.sh index b2e34938..960e236f 100755 --- a/utils/build_tarball.sh +++ b/utils/build_tarball.sh @@ -5536,6 +5536,140 @@ EOF_ubuntu22_runc set +xv } +# ############################################################################# +# Ubuntu 23.04 +# ############################################################################# + +ubuntu23_setup() +{ + echo "ubuntu23_setup : $1" + local OS_ARCH="$1" + local OS_NAME="ubuntu" + local OS_RELVER="23" + local OS_ROOTDIR="${BUILD_DIR}/${OS_NAME}_${OS_RELVER}_${OS_ARCH}" + + if [ -x "${OS_ROOTDIR}/usr/lib/gcc" ] ; then + echo "os already setup : ${OS_ROOTDIR}" + return + fi + + SUDO=sudo + + $SUDO debootstrap --arch=$OS_ARCH --variant=buildd lunar $OS_ROOTDIR http://archive.ubuntu.com/ubuntu/ + + $SUDO /bin/chown -R "$(id -u).$(id -g)" "$OS_ROOTDIR" + $SUDO /bin/chmod -R u+rw "$OS_ROOTDIR" +} + +ubuntu23_build_fakechroot() +{ + echo "ubuntu23_build_fakechroot : $1" + local OS_ARCH="$1" + local FAKECHROOT_SOURCE_DIR="$2" + local OS_NAME="ubuntu" + local OS_RELVER="23" + local OS_ROOTDIR="${BUILD_DIR}/${OS_NAME}_${OS_RELVER}_${OS_ARCH}" + local PROOT="" + + if [ "$OS_ARCH" = "i386" ]; then + #PROOT="$S_PROOT_DIR/proot-x86 -q qemu-i386" + #PROOT="$S_PROOT_DIR/proot-x86" + PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + elif [ "$OS_ARCH" = "amd64" ]; then + #PROOT="$S_PROOT_DIR/proot-x86_64" + PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + else + echo "unsupported $OS_NAME architecture: $OS_ARCH" + exit 2 + fi + + if [ -x "${FAKECHROOT_SOURCE_DIR}/libfakechroot-Ubuntu-23.so" ] ; then + echo "fakechroot binary already compiled : ${FAKECHROOT_SOURCE_DIR}/libfakechroot-Ubuntu-23.so" + return + fi + + export PROOT_NO_SECCOMP=1 + + # compile fakechroot + set -xv + if [ ! -x "$OS_ROOTDIR/bin/bash" ] ; then + SHELL=/bin/bash CONFIG_SHELL=/bin/bash PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/lib \ + $PROOT -0 -r "$OS_ROOTDIR" -b "${FAKECHROOT_SOURCE_DIR}:/fakechroot" -w / -b /dev \ + -b /etc/resolv.conf:/etc/resolv.conf /bin/bash <<'EOF_ubuntu23_packages' +apt-get -y update +apt-get -y --no-install-recommends install wget debconf devscripts gnupg nano +apt-get -y update +apt-get -y install locales build-essential gcc make autoconf m4 automake gawk libtool bash diffutils file +EOF_ubuntu23_packages + fi + + SHELL=/bin/bash CONFIG_SHELL=/bin/bash PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/lib \ + $PROOT -r "$OS_ROOTDIR" -b "${FAKECHROOT_SOURCE_DIR}:/fakechroot" -w / -b /dev \ + /bin/bash <<'EOF_ubuntu23_fakechroot' +# BUILD FAKECHROOT +export SHELL=/bin/bash +export CONFIG_SHELL=/bin/bash +export PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/lib +cd /fakechroot +make distclean +bash ./configure +make +cp src/.libs/libfakechroot.so libfakechroot-Ubuntu-23.so +make clean +EOF_ubuntu23_fakechroot + set +xv +} + +ubuntu23_build_runc() +{ + echo "ubuntu23_build_runc : $1" + local OS_ARCH="$1" + local RUNC_SOURCE_DIR="$2" + local OS_NAME="ubuntu" + local OS_RELVER="23" + local OS_ROOTDIR="${BUILD_DIR}/${OS_NAME}_${OS_RELVER}_${OS_ARCH}" + local PROOT="" + + if [ "$OS_ARCH" = "i386" ]; then + #PROOT="$S_PROOT_DIR/proot-x86 -q qemu-i386" + PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + elif [ "$OS_ARCH" = "amd64" ]; then + #PROOT="$S_PROOT_DIR/proot-x86_64" + PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + else + echo "unsupported $OS_NAME architecture: $OS_ARCH" + exit 2 + fi + + if [ -x "${RUNC_SOURCE_DIR}/runc" ] ; then + echo "runc binary already compiled : ${RUNC_SOURCE_DIR}/runc" + return + fi + + export PROOT_NO_SECCOMP=1 + + # compile runc + mkdir -p ${OS_ROOTDIR}/go/src/github.com/opencontainers + set -xv + SHELL=/bin/bash CONFIG_SHELL=/bin/bash PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/lib \ + $PROOT -0 -r "$OS_ROOTDIR" -b "${RUNC_SOURCE_DIR}:/go/src/github.com/opencontainers/runc" -w / -b /dev \ + -b /etc/resolv.conf:/etc/resolv.conf /bin/bash <<'EOF_ubuntu23_runc' +apt-get -y update +apt-get -y install golang libseccomp-dev git software-properties-common +#add-apt-repository ppa:gophers/archive +#apt-get -y update +#apt-get -y install golang-1.11-go +#export GOROOT=/usr/lib/go-1.11 +#export GOPATH=/go +#export PATH=$GOPATH/bin:$GOROOT/bin:$PATH +#go get github.com/sirupsen/logrus +cd /go/src/github.com/opencontainers/runc +make static +EOF_ubuntu23_runc + + set +xv +} + # ############################################################################# @@ -7241,7 +7375,12 @@ ubuntu20_build_fakechroot "amd64" "${BUILD_DIR}/fakechroot-source-glibc-x86_64" ubuntu22_setup "amd64" ubuntu22_build_fakechroot "amd64" "${BUILD_DIR}/fakechroot-source-glibc-x86_64" ubuntu22_build_runc "amd64" "${BUILD_DIR}/runc-source-x86_64" -#ostree_delete "amd64" "ubuntu" "21" +#ostree_delete "amd64" "ubuntu" "22" +# +ubuntu23_setup "amd64" +ubuntu23_build_fakechroot "amd64" "${BUILD_DIR}/fakechroot-source-glibc-x86_64" +ubuntu23_build_runc "amd64" "${BUILD_DIR}/runc-source-x86_64" +#ostree_delete "amd64" "ubuntu" "23" # From defd53c261db618a644fe154937a8f3a570f5381 Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Sun, 11 Jun 2023 02:56:52 +0100 Subject: [PATCH 38/99] build for udockertools 1.2.10 --- utils/build_tarball.sh | 612 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 593 insertions(+), 19 deletions(-) diff --git a/utils/build_tarball.sh b/utils/build_tarball.sh index 960e236f..c4b07b61 100755 --- a/utils/build_tarball.sh +++ b/utils/build_tarball.sh @@ -28,8 +28,8 @@ DEVEL3=$(realpath "$0" | grep "devel3") -TARBALL_VERSION_P3="1.2.9" -TARBALL_VERSION_P2="1.1.9" +TARBALL_VERSION_P3="1.2.10" +TARBALL_VERSION_P2="1.1.10" sanity_check() { @@ -2762,6 +2762,331 @@ EOF_fedora36_fakechroot } +# ############################################################################# +# Fedora 38 +# ############################################################################# + +fedora38_create_dnf() +{ + echo "fedora38_create_dnf : $1" + local FILENAME="$1" + local ARCH="$2" + + cat > "$FILENAME" < ${APK_TOOLS}) + (cd ${APK_TOOLS_DIR}; tar xzvf ${APK_TOOLS}) + if [ ! -e "${APK_TOOLS_DIR}/sbin" ] ; then + echo "apk-tools install failed: ${APK_TOOLS_DIR}" + exit + fi + fi + + SUDO=sudo + + set -x + $SUDO ${APK_TOOLS_DIR}/sbin/apk.static \ + -X ${ALPINE_MIRROR}/${OS_RELVER}/main \ + -U \ + --allow-untrusted \ + --root ${OS_ROOTDIR} \ + --initdb add alpine-base alpine-sdk bash libc-dev make autoconf m4 automake \ + libbsd libbsd-dev musl-fts musl-fts-dev libconfig-dev musl-dev bash diffutils file + set +x + + $SUDO /bin/chown -R "$(id -u).$(id -g)" "${OS_ROOTDIR}" + $SUDO /bin/chmod -R u+rw "${OS_ROOTDIR}" + /bin/mkdir -p ${OS_ROOTDIR}/proc + /bin/mkdir -p ${OS_ROOTDIR}/root + /bin/mkdir -p ${OS_ROOTDIR}/etc/apk + /bin/echo "$ALPINE_MIRROR/$OS_RELVER/main" > ${OS_ROOTDIR}/etc/apk/repositories +} + +alpine317_build_fakechroot() +{ + echo "alpine317_build_fakechroot : $1" + local OS_ARCH="$1" + local FAKECHROOT_SOURCE_DIR="$2" + local OS_NAME="alpine" + local OS_RELVER="v3.17" + local OS_ROOTDIR="${BUILD_DIR}/${OS_NAME}_${OS_RELVER}_${OS_ARCH}" + local PROOT="" + + if [ "$OS_ARCH" = "i386" ]; then + #PROOT="$S_PROOT_DIR/proot-x86 -q qemu-i386" + #PROOT="$S_PROOT_DIR/proot-x86" + PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + elif [ "$OS_ARCH" = "x86_64" ]; then + #PROOT="$S_PROOT_DIR/proot-x86_64" + PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + else + echo "unsupported $OS_NAME architecture: $OS_ARCH" + exit 2 + fi + + if [ -x "${FAKECHROOT_SOURCE_DIR}/libfakechroot-Alpine-3.17.so" ] ; then + echo "fakechroot binary already compiled : ${FAKECHROOT_SOURCE_DIR}/libfakechroot-Alpine-3.17.so" + return + fi + + export PROOT_NO_SECCOMP=1 + + # compile fakechroot + set -xv + + SHELL=/bin/bash CONFIG_SHELL=/bin/bash PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/lib \ + $PROOT -r "$OS_ROOTDIR" -b "${FAKECHROOT_SOURCE_DIR}:/fakechroot" -w / -b /dev \ + /bin/bash <<'EOF_alpine317_fakechroot' +# BUILD FAKECHROOT +export SHELL=/bin/bash +export CONFIG_SHELL=/bin/bash +export PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/lib +cd /fakechroot +make distclean +bash ./configure +make +cp src/.libs/libfakechroot.so libfakechroot-Alpine-3.17.so +make clean +EOF_alpine317_fakechroot + set +xv +} + + +# ############################################################################# +# Alpine 3.18.x +# ############################################################################# + +alpine318_setup() +{ + echo "alpine318_setup : $1" + local ALPINE_MIRROR="http://dl-5.alpinelinux.org/alpine" + local APK_TOOLS="apk-tools-static-2.12.9-r3.apk" + local APK_TOOLS_DIR="${BUILD_DIR}/apk-tools-2.12.9-r3" + local OS_ARCH="$1" + local OS_NAME="alpine" + local OS_RELVER="v3.18" + local OS_ROOTDIR="${BUILD_DIR}/${OS_NAME}_${OS_RELVER}_${OS_ARCH}" + + if [ -x "${OS_ROOTDIR}/etc/alpine-release" ] ; then + echo "os already setup : ${OS_ROOTDIR}" + return + fi + + if [ -e "${APK_TOOLS_DIR}/sbin" ] ; then + echo "apk-tools already installed : ${APK_TOOLS_DIR}" + else + /bin/rm -f ${APK_TOOLS} + mkdir ${APK_TOOLS_DIR} + local APK_TOOLS_URL="${ALPINE_MIRROR}/${OS_RELVER}/main/${OS_ARCH}/${APK_TOOLS}" + echo "download apk-tools : ${APK_TOOLS_URL}" + (cd ${APK_TOOLS_DIR}; curl ${APK_TOOLS_URL} > ${APK_TOOLS}) + (cd ${APK_TOOLS_DIR}; tar xzvf ${APK_TOOLS}) + if [ ! -e "${APK_TOOLS_DIR}/sbin" ] ; then + echo "apk-tools install failed: ${APK_TOOLS_DIR}" + exit + fi + fi + + SUDO=sudo + + set -x + $SUDO ${APK_TOOLS_DIR}/sbin/apk.static \ + -X ${ALPINE_MIRROR}/${OS_RELVER}/main \ + -U \ + --allow-untrusted \ + --root ${OS_ROOTDIR} \ + --initdb add alpine-base alpine-sdk bash libc-dev make autoconf m4 automake \ + libbsd libbsd-dev musl-fts musl-fts-dev libconfig-dev musl-dev bash diffutils file + set +x + + $SUDO /bin/chown -R "$(id -u).$(id -g)" "${OS_ROOTDIR}" + $SUDO /bin/chmod -R u+rw "${OS_ROOTDIR}" + /bin/mkdir -p ${OS_ROOTDIR}/proc + /bin/mkdir -p ${OS_ROOTDIR}/root + /bin/mkdir -p ${OS_ROOTDIR}/etc/apk + /bin/echo "$ALPINE_MIRROR/$OS_RELVER/main" > ${OS_ROOTDIR}/etc/apk/repositories +} + +alpine318_build_fakechroot() +{ + echo "alpine318_build_fakechroot : $1" + local OS_ARCH="$1" + local FAKECHROOT_SOURCE_DIR="$2" + local OS_NAME="alpine" + local OS_RELVER="v3.18" + local OS_ROOTDIR="${BUILD_DIR}/${OS_NAME}_${OS_RELVER}_${OS_ARCH}" + local PROOT="" + + if [ "$OS_ARCH" = "i386" ]; then + #PROOT="$S_PROOT_DIR/proot-x86 -q qemu-i386" + #PROOT="$S_PROOT_DIR/proot-x86" + PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + elif [ "$OS_ARCH" = "x86_64" ]; then + #PROOT="$S_PROOT_DIR/proot-x86_64" + PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + else + echo "unsupported $OS_NAME architecture: $OS_ARCH" + exit 2 + fi + + if [ -x "${FAKECHROOT_SOURCE_DIR}/libfakechroot-Alpine-3.18.so" ] ; then + echo "fakechroot binary already compiled : ${FAKECHROOT_SOURCE_DIR}/libfakechroot-Alpine-3.18.so" + return + fi + + export PROOT_NO_SECCOMP=1 + + # compile fakechroot + set -xv + + SHELL=/bin/bash CONFIG_SHELL=/bin/bash PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/lib \ + $PROOT -r "$OS_ROOTDIR" -b "${FAKECHROOT_SOURCE_DIR}:/fakechroot" -w / -b /dev \ + /bin/bash <<'EOF_alpine318_fakechroot' +# BUILD FAKECHROOT +export SHELL=/bin/bash +export CONFIG_SHELL=/bin/bash +export PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/lib +cd /fakechroot +make distclean +bash ./configure +make +cp src/.libs/libfakechroot.so libfakechroot-Alpine-3.18.so +make clean +EOF_alpine318_fakechroot + set +xv +} + + # ############################################################################# # Nix using chroot # ############################################################################# @@ -6855,6 +7390,10 @@ create_package_tarball() echo "ERROR: failed to compile : ${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Fedora-36.so" return fi + if [ ! -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Fedora-38.so" ] ; then + echo "ERROR: failed to compile : ${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Fedora-38.so" + return + fi if [ ! -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-CentOS-6.so" ] ; then echo "ERROR: failed to compile : ${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-CentOS-6.so" return @@ -6907,14 +7446,18 @@ create_package_tarball() echo "ERROR: failed to compile : ${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Ubuntu-20.so" return fi - #if [ ! -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Ubuntu-21.so" ] ; then - # echo "ERROR: failed to compile : ${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Ubuntu-21.so" - # return - #fi + if [ ! -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Ubuntu-21.so" ] ; then + echo "ERROR: failed to compile : ${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Ubuntu-21.so" + return + fi if [ ! -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Ubuntu-22.so" ] ; then echo "ERROR: failed to compile : ${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Ubuntu-22.so" return fi + if [ ! -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Ubuntu-23.so" ] ; then + echo "ERROR: failed to compile : ${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Ubuntu-23.so" + return + fi if [ ! -f "${BUILD_DIR}/fakechroot-source-musl-x86_64/libfakechroot-Alpine-3.6.so" ] ; then echo "ERROR: failed to compile : ${BUILD_DIR}/fakechroot-source-musl-x86_64/libfakechroot-Alpine-3.6.so" return @@ -6955,6 +7498,14 @@ create_package_tarball() echo "ERROR: failed to compile : ${BUILD_DIR}/fakechroot-source-musl-x86_64/libfakechroot-Alpine-3.16.so" return fi + if [ ! -f "${BUILD_DIR}/fakechroot-source-musl-x86_64/libfakechroot-Alpine-3.17.so" ] ; then + echo "ERROR: failed to compile : ${BUILD_DIR}/fakechroot-source-musl-x86_64/libfakechroot-Alpine-3.17.so" + return + fi + if [ ! -f "${BUILD_DIR}/fakechroot-source-musl-x86_64/libfakechroot-Alpine-3.18.so" ] ; then + echo "ERROR: failed to compile : ${BUILD_DIR}/fakechroot-source-musl-x86_64/libfakechroot-Alpine-3.18.so" + return + fi if [ ! -f "${BUILD_DIR}/runc-source-x86_64/runc" ] ; then echo "ERROR: failed to compile : ${BUILD_DIR}/runc-source-x86_64/runc" return @@ -7008,6 +7559,8 @@ create_package_tarball() "${PACKAGE_DIR}/udocker_dir/lib/libfakechroot-Fedora-35-x86_64.so" /bin/cp -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Fedora-36.so" \ "${PACKAGE_DIR}/udocker_dir/lib/libfakechroot-Fedora-36-x86_64.so" + /bin/cp -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-CentOS-6.so" \ + "${PACKAGE_DIR}/udocker_dir/lib/libfakechroot-Fedora-38-x86_64.so" /bin/cp -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-CentOS-6.so" \ "${PACKAGE_DIR}/udocker_dir/lib/libfakechroot-CentOS-6-x86_64.so" /bin/cp -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-CentOS-7.so" \ @@ -7034,10 +7587,12 @@ create_package_tarball() "${PACKAGE_DIR}/udocker_dir/lib/libfakechroot-Ubuntu-19-x86_64.so" /bin/cp -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Ubuntu-20.so" \ "${PACKAGE_DIR}/udocker_dir/lib/libfakechroot-Ubuntu-20-x86_64.so" - #/bin/cp -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Ubuntu-21.so" \ - # "${PACKAGE_DIR}/udocker_dir/lib/libfakechroot-Ubuntu-21-x86_64.so" + /bin/cp -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Ubuntu-21.so" \ + "${PACKAGE_DIR}/udocker_dir/lib/libfakechroot-Ubuntu-21-x86_64.so" /bin/cp -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Ubuntu-22.so" \ "${PACKAGE_DIR}/udocker_dir/lib/libfakechroot-Ubuntu-22-x86_64.so" + /bin/cp -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Ubuntu-23.so" \ + "${PACKAGE_DIR}/udocker_dir/lib/libfakechroot-Ubuntu-23-x86_64.so" /bin/cp -f "${BUILD_DIR}/fakechroot-source-musl-x86_64/libfakechroot-Alpine-3.6.so" \ "${PACKAGE_DIR}/udocker_dir/lib/libfakechroot-Alpine-3.6-x86_64.so" /bin/cp -f "${BUILD_DIR}/fakechroot-source-musl-x86_64/libfakechroot-Alpine-3.8.so" \ @@ -7058,6 +7613,10 @@ create_package_tarball() "${PACKAGE_DIR}/udocker_dir/lib/libfakechroot-Alpine-3.15-x86_64.so" /bin/cp -f "${BUILD_DIR}/fakechroot-source-musl-x86_64/libfakechroot-Alpine-3.16.so" \ "${PACKAGE_DIR}/udocker_dir/lib/libfakechroot-Alpine-3.16-x86_64.so" + /bin/cp -f "${BUILD_DIR}/fakechroot-source-musl-x86_64/libfakechroot-Alpine-3.17.so" \ + "${PACKAGE_DIR}/udocker_dir/lib/libfakechroot-Alpine-3.17-x86_64.so" + /bin/cp -f "${BUILD_DIR}/fakechroot-source-musl-x86_64/libfakechroot-Alpine-3.18.so" \ + "${PACKAGE_DIR}/udocker_dir/lib/libfakechroot-Alpine-3.18-x86_64.so" /bin/cp -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/LICENSE" \ "${PACKAGE_DIR}/udocker_dir/doc/LICENSE.fakechroot" /bin/cp -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/COPYING" \ @@ -7085,7 +7644,8 @@ create_package_tarball() ln -s libfakechroot-Fedora-25-x86_64.so libfakechroot-Fedora-26-x86_64.so ; \ ln -s libfakechroot-Fedora-25-x86_64.so libfakechroot-Fedora-27-x86_64.so ; \ ln -s libfakechroot-Fedora-25-x86_64.so libfakechroot-Fedora-28-x86_64.so ; \ - ln -s libfakechroot-Fedora-36-x86_64.so libfakechroot-Fedora-x86_64.so ; \ + ln -s libfakechroot-Fedora-36-x86_64.so libfakechroot-Fedora-37-x86_64.so ; \ + ln -s libfakechroot-Fedora-38-x86_64.so libfakechroot-Fedora-x86_64.so ; \ ln -s libfakechroot-CentOS-6-x86_64.so libfakechroot-Red-4-x86_64.so ; \ ln -s libfakechroot-CentOS-6-x86_64.so libfakechroot-Red-5-x86_64.so ; \ ln -s libfakechroot-CentOS-6-x86_64.so libfakechroot-Red-6-x86_64.so ; \ @@ -7105,9 +7665,8 @@ create_package_tarball() ln -s libfakechroot-Ubuntu-14-x86_64.so libfakechroot-Debian-8-x86_64.so ; \ ln -s libfakechroot-Ubuntu-16-x86_64.so libfakechroot-Debian-9-x86_64.so ; \ ln -s libfakechroot-Ubuntu-19-x86_64.so libfakechroot-Debian-10-x86_64.so ; \ - ln -s libfakechroot-Ubuntu-22-x86_64.so libfakechroot-Debian-11-x86_64.so ; \ - ln -s libfakechroot-Ubuntu-22-x86_64.so libfakechroot-Debian-12-x86_64.so ; \ - ln -s libfakechroot-Ubuntu-22-x86_64.so libfakechroot-Debian-x86_64.so ; \ + ln -s libfakechroot-Ubuntu-21-x86_64.so libfakechroot-Debian-11-x86_64.so ; \ + ln -s libfakechroot-Ubuntu-23-x86_64.so libfakechroot-Debian-x86_64.so ; \ ln -s libfakechroot-CentOS-6-x86_64.so libfakechroot-CentOS-4-x86_64.so ; \ ln -s libfakechroot-CentOS-6-x86_64.so libfakechroot-CentOS-5-x86_64.so ; \ ln -s libfakechroot-CentOS-9-x86_64.so libfakechroot-CentOS-x86_64.so ; \ @@ -7122,17 +7681,17 @@ create_package_tarball() ln -s libfakechroot-Ubuntu-18-x86_64.so libfakechroot-LinuxMint-18-x86_64.so ; \ ln -s libfakechroot-Ubuntu-19-x86_64.so libfakechroot-LinuxMint-19-x86_64.so ; \ ln -s libfakechroot-Ubuntu-20-x86_64.so libfakechroot-LinuxMint-20-x86_64.so ; \ - ln -s libfakechroot-Ubuntu-22-x86_64.so libfakechroot-LinuxMint-21-x86_64.so ; \ + ln -s libfakechroot-Ubuntu-21-x86_64.so libfakechroot-LinuxMint-21-x86_64.so ; \ ln -s libfakechroot-Ubuntu-22-x86_64.so libfakechroot-LinuxMint-22-x86_64.so ; \ - ln -s libfakechroot-Ubuntu-22-x86_64.so libfakechroot-LinuxMint-x86_64.so ; \ + ln -s libfakechroot-Ubuntu-22-x86_64.so libfakechroot-LinuxMint-23-x86_64.so ; \ + ln -s libfakechroot-Ubuntu-23-x86_64.so libfakechroot-LinuxMint-x86_64.so ; \ ln -s libfakechroot-Ubuntu-14-x86_64.so libfakechroot-Ubuntu-9-x86_64.so ; \ ln -s libfakechroot-Ubuntu-14-x86_64.so libfakechroot-Ubuntu-10-x86_64.so ; \ ln -s libfakechroot-Ubuntu-14-x86_64.so libfakechroot-Ubuntu-11-x86_64.so ; \ ln -s libfakechroot-Ubuntu-14-x86_64.so libfakechroot-Ubuntu-13-x86_64.so ; \ ln -s libfakechroot-Ubuntu-16-x86_64.so libfakechroot-Ubuntu-15-x86_64.so ; \ ln -s libfakechroot-Ubuntu-18-x86_64.so libfakechroot-Ubuntu-17-x86_64.so ; \ - ln -s libfakechroot-Ubuntu-22-x86_64.so libfakechroot-Ubuntu-21-x86_64.so ; \ - ln -s libfakechroot-Ubuntu-22-x86_64.so libfakechroot-Ubuntu-x86_64.so ; \ + ln -s libfakechroot-Ubuntu-23-x86_64.so libfakechroot-Ubuntu-x86_64.so ; \ ln -s libfakechroot-Alpine-3.6-x86_64.so libfakechroot-Alpine-3.0-x86_64.so ; \ ln -s libfakechroot-Alpine-3.6-x86_64.so libfakechroot-Alpine-3.1-x86_64.so ; \ ln -s libfakechroot-Alpine-3.6-x86_64.so libfakechroot-Alpine-3.2-x86_64.so ; \ @@ -7261,6 +7820,13 @@ fedora36_setup "x86_64" #fedora36_build_patchelf "x86_64" "${BUILD_DIR}/patchelf-source-x86_64" fedora36_build_fakechroot "x86_64" "${BUILD_DIR}/fakechroot-source-glibc-x86_64" #ostree_delete "x86_64" "fedora" "36" +# +fedora38_setup "x86_64" +#fedora38_build_proot "x86_64" "${BUILD_DIR}/proot-source-x86_64" +#fedora38_build_patchelf "x86_64" "${BUILD_DIR}/patchelf-source-x86_64" +fedora38_build_fakechroot "x86_64" "${BUILD_DIR}/fakechroot-source-glibc-x86_64" +#ostree_delete "x86_64" "fedora" "38" + # @@ -7310,6 +7876,14 @@ alpine315_build_fakechroot "x86_64" "${BUILD_DIR}/fakechroot-source-musl-x86_64" alpine316_setup "x86_64" alpine316_build_fakechroot "x86_64" "${BUILD_DIR}/fakechroot-source-musl-x86_64" #ostree_delete "x86_64" "alpine" "3.16" +# +alpine317_setup "x86_64" +alpine317_build_fakechroot "x86_64" "${BUILD_DIR}/fakechroot-source-musl-x86_64" +#ostree_delete "x86_64" "alpine" "3.17" +# +alpine318_setup "x86_64" +alpine318_build_fakechroot "x86_64" "${BUILD_DIR}/fakechroot-source-musl-x86_64" +#ostree_delete "x86_64" "alpine" "3.18" # centos6_setup "x86_64" @@ -7368,8 +7942,8 @@ ubuntu20_setup "amd64" ubuntu20_build_fakechroot "amd64" "${BUILD_DIR}/fakechroot-source-glibc-x86_64" #ostree_delete "amd64" "ubuntu" "20" # -#ubuntu21_setup "amd64" -#ubuntu21_build_fakechroot "amd64" "${BUILD_DIR}/fakechroot-source-glibc-x86_64" +ubuntu21_setup "amd64" +ubuntu21_build_fakechroot "amd64" "${BUILD_DIR}/fakechroot-source-glibc-x86_64" #ostree_delete "amd64" "ubuntu" "21" # ubuntu22_setup "amd64" From 0b55d433c2e81b3b539d7bb14c8f576f0b9a243d Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Sun, 11 Jun 2023 02:57:26 +0100 Subject: [PATCH 39/99] add udockertools 1.2.10 to udocker 1.3.10a1 --- udocker/config.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/udocker/config.py b/udocker/config.py index 3d45470e..2ae08ad1 100644 --- a/udocker/config.py +++ b/udocker/config.py @@ -29,13 +29,13 @@ class Config(object): # udocker installation tarball the release is the minimum requirement # the actual tarball used in the installation can have a higher version - conf['tarball_release'] = "1.2.9" + conf['tarball_release'] = "1.2.10" conf['tarball'] = ( "https://download.ncg.ingrid.pt/" - "webdav/udocker/udocker-englib-1.2.9.tar.gz" + "webdav/udocker/udocker-englib-1.2.10.tar.gz" " " "https://raw.githubusercontent.com" - "/jorge-lip/udocker-builds/master/tarballs/udocker-englib-1.2.9.tar.gz" + "/jorge-lip/udocker-builds/master/tarballs/udocker-englib-1.2.10.tar.gz" ) conf['installinfo'] = [ "https://raw.githubusercontent.com/indigo-dc/udocker/master/messages", ] From 0b4701499d6997e511dbe0cbda4f23813c1a7489 Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Tue, 20 Jun 2023 18:12:26 +0100 Subject: [PATCH 40/99] build for udocker tools 1.2.10 --- utils/build_tarball.sh | 760 ++++++++++++++++++++++++++++------------- 1 file changed, 514 insertions(+), 246 deletions(-) diff --git a/utils/build_tarball.sh b/utils/build_tarball.sh index c4b07b61..ff1d6f74 100755 --- a/utils/build_tarball.sh +++ b/utils/build_tarball.sh @@ -26,7 +26,7 @@ # This script produces the following udocker-englib tarball -DEVEL3=$(realpath "$0" | grep "devel3") +DEVEL3=$(realpath "$0" | egrep "devel3|devel4") TARBALL_VERSION_P3="1.2.10" TARBALL_VERSION_P2="1.1.10" @@ -55,7 +55,7 @@ get_proot_static() echo "get_proot_static" cd "$BUILD_DIR" - if [ -d "$BUILD_DIR/proot-static-build" ] ; then + if [ -d "$BUILD_DIR/proot-static-build/static" ] ; then echo "proot static already exists: $BUILD_DIR/proot-static-build" return fi @@ -64,6 +64,48 @@ get_proot_static() /bin/rm -Rf $BUILD_DIR/proot-static-build/.git } +get_udocker_build() +{ + local BUILD_VERSION="$1" + + echo "get_udocker_tools" + cd "$BUILD_DIR" + + if [ -d "$BUILD_DIR/proot-static-build/static" ] ; then + echo "udocker build directory already exists: $BUILD_DIR/proot-static-build" + return + fi + /bin/mkdir -p "$BUILD_DIR/proot-static-build/static" + + curl "https://raw.githubusercontent.com/jorge-lip/udocker-builds/master/tarballs/udocker-englib-${BUILD_VERSION}.tar.gz" > \ + "$BUILD_DIR/proot-static-build/udocker-englib.tar.gz" + (cd "$BUILD_DIR/proot-static-build"; tar xvf udocker-englib.tar.gz) + (cd "$BUILD_DIR/proot-static-build"; /bin/mv udocker_dir/bin/proot-x86-4_8_0 static/proot-x86) + (cd "$BUILD_DIR/proot-static-build"; /bin/mv udocker_dir/bin/proot-x86_64-4_8_0 static/proot-x86_64) + (cd "$BUILD_DIR/proot-static-build"; /bin/mv udocker_dir/bin/proot-arm static/proot-arm) + (cd "$BUILD_DIR/proot-static-build"; /bin/mv udocker_dir/bin/proot-arm64-4_8_0 static/proot-arm64) + chmod u+rx "$BUILD_DIR/proot-static-build/static/*" +} + +get_libtalloc() +{ + echo "get_libtalloc" + + if [ -f "$S_PROOT_PACKAGES_DIR/talloc.tar.gz" ] ; then + echo "talloc.tar.gz already exists: " \ + "$S_PROOT_PACKAGES_DIR/talloc.tar.gz" + return + fi + [ ! -d "$S_PROOT_PACKAGES_DIR" ] && /bin/mkdir -p "$S_PROOT_PACKAGES_DIR" + + #June 2013 + #https://www.samba.org/ftp/talloc/talloc-2.1.16.tar.gz + #https://www.samba.org/ftp/talloc/talloc-2.3.4.tar.gz + #https://www.samba.org/ftp/talloc/talloc-2.4.0.tar.gz + curl "https://www.samba.org/ftp/talloc/talloc-2.1.16.tar.gz" > \ + "$S_PROOT_PACKAGES_DIR/talloc.tar.gz" +} + prepare_proot_source() { echo "prepare_proot_source : $1" @@ -78,7 +120,7 @@ prepare_proot_source() #git clone --branch v5.1.0 --depth=1 https://github.com/proot-me/PRoot #git clone --branch udocker-2 --depth=1 https://github.com/jorge-lip/proot-udocker.git - git clone --branch udocker-3 https://github.com/jorge-lip/proot-udocker.git + git clone --branch udocker-4 https://github.com/jorge-lip/proot-udocker.git #/bin/rm -Rf $BUILD_DIR/proot-udocker/.git #/bin/rm -Rf $BUILD_DIR/proot-udocker/static/care* @@ -123,7 +165,7 @@ prepare_fakechroot_glibc_source() fi #git clone --depth=1 --branch 2.18 https://github.com/dex4er/fakechroot.git - git clone --branch udocker-2 --depth=1 \ + git clone --branch udocker-3 --depth=1 \ https://github.com/jorge-lip/libfakechroot-glibc-udocker.git /bin/rm -Rf $BUILD_DIR/libfakechroot-glibc-udocker/.git /bin/mv libfakechroot-glibc-udocker "$FAKECHROOT_SOURCE_DIR" @@ -313,12 +355,14 @@ fedora25_setup() $SUDO /usr/bin/dnf -y -c "${OS_ROOTDIR}/etc/dnf/dnf.conf" \ install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" \ - gcc kernel-devel make libtalloc libtalloc-devel glibc-static glibc-devel tar python \ - gzip zlib diffutils file dnf + --forcearch="$OS_ARCH" \ + gcc kernel-devel make libtalloc libtalloc-devel glibc-static \ + glibc-devel tar python gzip zlib diffutils file dnf which - if [ "$OS_ARCH" = "x86_64" ]; then + if [ "$OS_ARCH" = "x86_64" -o "$OS_ARCH" = "aarch64" -o "$OS_ARCH" = "arm" ]; then $SUDO /usr/bin/dnf -y -c "${OS_ROOTDIR}/etc/dnf/dnf.conf" \ install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" \ + --forcearch="$OS_ARCH" \ autoconf m4 gcc-c++ libstdc++-static automake gawk libtool fi @@ -344,7 +388,8 @@ fedora25_build_proot() #PROOT="$S_PROOT_DIR/proot-x86 -q qemu-i386" PROOT="$S_PROOT_DIR/proot-x86" elif [ "$OS_ARCH" = "x86_64" ]; then - PROOT="$HOME/.udocker/bin/proot-x86_64" + #PROOT="$HOME/.udocker/bin/proot-x86_64" + PROOT="$S_PROOT_DIR/proot-x86_64" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -360,15 +405,17 @@ fedora25_build_proot() -b "${S_PROOT_PACKAGES_DIR}:/proot-static-packages" /bin/bash <<'EOF_fedora25_proot_1' cd /proot /bin/rm -f proot-Fedora-25.bin src/proot src/libtalloc.a src/talloc.h +/bin/rm -Rf talloc* # BUILD TALLOC -tar xzvf /proot-static-packages/talloc-2.1.1.tar.gz -cd talloc-2.1.1 +tar xzvf /proot-static-packages/talloc.tar.gz +cd talloc* make clean ./configure make cp talloc.h /proot/src cd bin/default -ar qf libtalloc.a talloc_3.o +[ -f talloc.c.6.o ] && ar qf libtalloc.a talloc.c.6.o +[ -f talloc.c.5.o -a ! -f libtalloc.a ] && ar qf libtalloc.a talloc.c.5.o cp libtalloc.a /proot/src && make clean # BUILD PROOT cd /proot/src @@ -376,7 +423,7 @@ make clean make loader.elf make loader-m32.elf make build.h -make proot +LDFLAGS="-L/proot/usr/src -static" make proot EOF_fedora25_proot_1 fi @@ -447,11 +494,11 @@ fedora25_build_fakechroot() if [ "$OS_ARCH" = "i386" ]; then #PROOT="$S_PROOT_DIR/proot-x86 -q qemu-i386" - #PROOT="$S_PROOT_DIR/proot-x86" - PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-25.bin" + #PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-25.bin" + PROOT="$S_PROOT_DIR/proot-x86" elif [ "$OS_ARCH" = "x86_64" ]; then - #PROOT="$S_PROOT_DIR/proot-x86_64" - PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-25.bin" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-25.bin" + PROOT="$S_PROOT_DIR/proot-x86_64" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -563,7 +610,7 @@ fedora29_setup() $SUDO /usr/bin/dnf -y -c "${OS_ROOTDIR}/etc/dnf/dnf.conf" \ install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" --forcearch="$OS_ARCH" \ gcc kernel-devel make libtalloc libtalloc-devel glibc-static glibc-devel tar python \ - python2 gzip zlib diffutils file dnf + python2 gzip zlib diffutils file dnf which if [ "$OS_ARCH" = "x86_64" ]; then $SUDO /usr/bin/dnf -y -c "${OS_ROOTDIR}/etc/dnf/dnf.conf" \ @@ -571,7 +618,8 @@ fedora29_setup() autoconf m4 gcc-c++ libstdc++-static automake gawk libtool fi if [ "$OS_ARCH" = "aarch64" ]; then - PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-25.bin -q qemu-aarch64" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-25.bin -q qemu-aarch64" + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" export PROOT_NO_SECCOMP=1 $PROOT -r "$OS_ROOTDIR" -0 -w / -b /dev -b /etc/resolv.conf "dnf -y reinstall $(rpm -qa)" fi @@ -595,11 +643,11 @@ fedora29_build_proot() local PROOT="" if [ "$OS_ARCH" = "i386" ]; then - #PROOT="$S_PROOT_DIR/proot-x86 -q qemu-i386" - PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86" elif [ "$OS_ARCH" = "x86_64" ]; then - #PROOT="$S_PROOT_DIR/proot-x86_64" - PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86_64" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -615,14 +663,16 @@ fedora29_build_proot() -b "${S_PROOT_PACKAGES_DIR}:/proot-static-packages" /bin/bash <<'EOF_fedora29_proot_1' cd /proot /bin/rm -f proot-Fedora-29.bin src/proot src/libtalloc.a src/talloc.h +/bin/rm -Rf talloc* # BUILD TALLOC -tar xzvf /proot-static-packages/talloc-2.1.1.tar.gz -cd talloc-2.1.1 +tar xzvf /proot-static-packages/talloc.tar.gz +cd talloc* ./configure make cp talloc.h /proot/src cd bin/default -ar qf libtalloc.a talloc_3.o +[ -f talloc.c.6.o ] && ar qf libtalloc.a talloc.c.6.o +[ -f talloc.c.5.o -a ! -f libtalloc.a ] && ar qf libtalloc.a talloc.c.5.o cp libtalloc.a /proot/src && make clean # BUILD PROOT cd /proot/src @@ -630,7 +680,7 @@ make clean make loader.elf make loader-m32.elf make build.h -make proot +LDFLAGS="-L/proot/usr/src -static" make proot EOF_fedora29_proot_1 fi @@ -657,10 +707,12 @@ fedora29_build_patchelf() if [ "$OS_ARCH" = "i386" ]; then #PROOT="$S_PROOT_DIR/proot-x86 -q qemu-i386" - PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86" elif [ "$OS_ARCH" = "x86_64" ]; then #PROOT="$S_PROOT_DIR/proot-x86_64" - PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86_64" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -702,10 +754,12 @@ fedora29_build_fakechroot() if [ "$OS_ARCH" = "i386" ]; then #PROOT="$S_PROOT_DIR/proot-x86 -q qemu-i386" - PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86" elif [ "$OS_ARCH" = "x86_64" ]; then #PROOT="$S_PROOT_DIR/proot-x86_64" - PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86_64" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -814,16 +868,19 @@ fedora30_setup() $SUDO /usr/bin/dnf -y -c "${OS_ROOTDIR}/etc/dnf/dnf.conf" \ install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" \ - gcc kernel-devel make libtalloc libtalloc-devel glibc-static glibc-devel tar python \ - python2 gzip zlib diffutils file dnf + --forcearch="$OS_ARCH" \ + gcc kernel-devel make libtalloc libtalloc-devel glibc-static glibc-devel \ + tar python python2 gzip zlib diffutils file dnf which $SUDO /usr/bin/dnf -y -c "${OS_ROOTDIR}/etc/dnf/dnf.conf" \ downgrade --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" \ + --forcearch="$OS_ARCH" \ coreutils-8.31-1.fc30.x86_64 coreutils-common-8.31-1.fc30.x86_64 - if [ "$OS_ARCH" = "x86_64" ]; then + if [ "$OS_ARCH" = "x86_64" -o "$OS_ARCH" = "aarch64" ]; then $SUDO /usr/bin/dnf -y -c "${OS_ROOTDIR}/etc/dnf/dnf.conf" \ install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" \ + --forcearch="$OS_ARCH" \ autoconf m4 gcc-c++ libstdc++-static automake gawk libtool fi @@ -847,11 +904,12 @@ fedora30_build_proot() if [ "$OS_ARCH" = "i386" ]; then #PROOT="$S_PROOT_DIR/proot-x86 -q qemu-i386" - PROOT="$S_PROOT_DIR/proot-x86" #PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-25.bin" + PROOT="$S_PROOT_DIR/proot-x86" elif [ "$OS_ARCH" = "x86_64" ]; then #PROOT="$S_PROOT_DIR/proot-x86_64" - PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-25.bin" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-25.bin" + PROOT="$S_PROOT_DIR/proot-x86_64" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -867,14 +925,16 @@ fedora30_build_proot() -b "${S_PROOT_PACKAGES_DIR}:/proot-static-packages" /bin/bash <<'EOF_fedora30_proot_1' cd /proot /bin/rm -f proot-Fedora-30.bin src/proot src/libtalloc.a src/talloc.h +/bin/rm -Rf talloc* # BUILD TALLOC -tar xzvf /proot-static-packages/talloc-2.1.1.tar.gz -cd talloc-2.1.1 +tar xzvf /proot-static-packages/talloc.tar.gz +cd talloc* ./configure make cp talloc.h /proot/src cd bin/default -ar qf libtalloc.a talloc_3.o +[ -f talloc.c.6.o ] && ar qf libtalloc.a talloc.c.6.o +[ -f talloc.c.5.o -a ! -f libtalloc.a ] && ar qf libtalloc.a talloc.c.5.o cp libtalloc.a /proot/src && make clean # BUILD PROOT cd /proot/src @@ -882,7 +942,7 @@ make clean make loader.elf make loader-m32.elf make build.h -make proot +LDFLAGS="-L/proot/usr/src -static" make proot EOF_fedora30_proot_1 fi @@ -909,10 +969,12 @@ fedora30_build_patchelf() if [ "$OS_ARCH" = "i386" ]; then #PROOT="$S_PROOT_DIR/proot-x86 -q qemu-i386" - PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86" elif [ "$OS_ARCH" = "x86_64" ]; then #PROOT="$S_PROOT_DIR/proot-x86_64" - PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86_64" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -954,10 +1016,12 @@ fedora30_build_fakechroot() if [ "$OS_ARCH" = "i386" ]; then #PROOT="$S_PROOT_DIR/proot-x86 -q qemu-i386" - PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86" elif [ "$OS_ARCH" = "x86_64" ]; then #PROOT="$S_PROOT_DIR/proot-x86_64" - PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86_64" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -1067,23 +1131,26 @@ fedora31_setup() fedora31_create_dnf "${OS_ROOTDIR}/etc/dnf/dnf.conf" "$OS_ARCH" $SUDO /usr/bin/dnf -y -c "${OS_ROOTDIR}/etc/dnf/dnf.conf" \ - install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" --forcearch="$OS_ARCH" \ + install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" \ + --forcearch="$OS_ARCH" \ gcc kernel-devel make libtalloc libtalloc-devel glibc-static glibc-devel tar python \ - python2 gzip zlib diffutils file glibc-headers dnf git + python2 gzip zlib diffutils file glibc-headers dnf git which #$SUDO /usr/bin/dnf -y -c "${OS_ROOTDIR}/etc/dnf/dnf.conf" \ # downgrade --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" --forcearch="$OS_ARCH" \ # coreutils-8.31-1.fc31.x86_64 coreutils-common-8.31-1.fc31.x86_64 - if [ "$OS_ARCH" = "x86_64" ]; then + if [ "$OS_ARCH" = "x86_64" -o "$OS_ARCH" = "aarch64" ]; then $SUDO /usr/bin/dnf -y -c "${OS_ROOTDIR}/etc/dnf/dnf.conf" \ install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" --forcearch="$OS_ARCH" \ + --forcearch="$OS_ARCH" \ autoconf m4 gcc-c++ libstdc++-static automake gawk libtool xz fi if [ "$OS_ARCH" = "aarch64" ]; then $SUDO chown -R $(id -u):$(id -g) "$OS_ROOTDIR" - PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" export PROOT_NO_SECCOMP=1 $PROOT -r "$OS_ROOTDIR" -0 -w / -b /dev -b /etc/resolv.conf /bin/bash <<'EOF_fedora31_reinstall' dnf -y reinstall --releasever=31 $(rpm -qa) @@ -1110,14 +1177,16 @@ fedora31_build_proot() if [ "$OS_ARCH" = "i386" ]; then #PROOT="$S_PROOT_DIR/proot-x86 -q qemu-i386" - PROOT="$S_PROOT_DIR/proot-x86" #PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86" elif [ "$OS_ARCH" = "x86_64" ]; then #PROOT="$S_PROOT_DIR/proot-x86_64" - PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86_64" elif [ "$OS_ARCH" = "aarch64" ]; then #PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" - PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -1136,14 +1205,16 @@ rm python ln -s python2 python cd /proot /bin/rm -f proot-Fedora-31.bin src/proot src/libtalloc.a src/talloc.h +/bin/rm -Rf talloc* # BUILD TALLOC -tar xzvf /proot-static-packages/talloc-2.1.1.tar.gz -cd talloc-2.1.1 +tar xzvf /proot-static-packages/talloc.tar.gz +cd talloc* ./configure make cp talloc.h /proot/src cd bin/default -ar qf libtalloc.a talloc_3.o +[ -f talloc.c.6.o ] && ar qf libtalloc.a talloc.c.6.o +[ -f talloc.c.5.o -a ! -f libtalloc.a ] && ar qf libtalloc.a talloc.c.5.o cp libtalloc.a /proot/src && make clean # BUILD PROOT cd /proot/src @@ -1151,7 +1222,7 @@ make clean make loader.elf make loader-m32.elf make build.h -make proot +LDFLAGS="-L/proot/usr/src -static" make proot EOF_fedora31_proot_1 fi @@ -1178,10 +1249,12 @@ fedora31_build_patchelf() if [ "$OS_ARCH" = "i386" ]; then #PROOT="$S_PROOT_DIR/proot-x86 -q qemu-i386" - PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86" elif [ "$OS_ARCH" = "x86_64" ]; then #PROOT="$S_PROOT_DIR/proot-x86_64" - PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86_64" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -1223,10 +1296,12 @@ fedora31_build_fakechroot() if [ "$OS_ARCH" = "i386" ]; then #PROOT="$S_PROOT_DIR/proot-x86 -q qemu-i386" - PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86" elif [ "$OS_ARCH" = "x86_64" ]; then #PROOT="$S_PROOT_DIR/proot-x86_64" - PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86_64" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -1337,7 +1412,7 @@ fedora32_setup() $SUDO /usr/bin/dnf -y -c "${OS_ROOTDIR}/etc/dnf/dnf.conf" \ install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" --forcearch="$OS_ARCH" \ gcc kernel-devel make libtalloc libtalloc-devel glibc-static glibc-devel tar python \ - python2 gzip zlib diffutils file glibc-headers dnf + python2 gzip zlib diffutils file glibc-headers dnf git which #$SUDO /usr/bin/dnf -y -c "${OS_ROOTDIR}/etc/dnf/dnf.conf" \ # downgrade --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" --forcearch="$OS_ARCH" \ @@ -1351,7 +1426,8 @@ fedora32_setup() if [ "$OS_ARCH" = "aarch64" ]; then $SUDO chown -R $(id -u):$(id -g) "$OS_ROOTDIR" - PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" export PROOT_NO_SECCOMP=1 $PROOT -r "$OS_ROOTDIR" -0 -w / -b /dev -b /etc/resolv.conf /bin/bash <<'EOF_fedora32_reinstall' dnf -y reinstall $(rpm -qa) @@ -1377,14 +1453,17 @@ fedora32_build_proot() if [ "$OS_ARCH" = "i386" ]; then #PROOT="$S_PROOT_DIR/proot-x86 -q qemu-i386" - PROOT="$S_PROOT_DIR/proot-x86" + #PROOT="$S_PROOT_DIR/proot-x86" #PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86" elif [ "$OS_ARCH" = "x86_64" ]; then #PROOT="$S_PROOT_DIR/proot-x86_64" - PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86_64" elif [ "$OS_ARCH" = "aarch64" ]; then #PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" - PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -1403,14 +1482,16 @@ rm python ln -s python2 python cd /proot /bin/rm -f proot-Fedora-32.bin src/proot src/libtalloc.a src/talloc.h +/bin/rm -Rf talloc* # BUILD TALLOC -tar xzvf /proot-static-packages/talloc-2.1.1.tar.gz -cd talloc-2.1.1 +tar xzvf /proot-static-packages/talloc.tar.gz +cd talloc* ./configure make cp talloc.h /proot/src cd bin/default -ar qf libtalloc.a talloc_3.o +[ -f talloc.c.6.o ] && ar qf libtalloc.a talloc.c.6.o +[ -f talloc.c.5.o -a ! -f libtalloc.a ] && ar qf libtalloc.a talloc.c.5.o cp libtalloc.a /proot/src && make clean # BUILD PROOT cd /proot/src @@ -1418,7 +1499,7 @@ make clean make loader.elf make loader-m32.elf make build.h -make proot +LDFLAGS="-L/proot/usr/src -static" make proot EOF_fedora32_proot_1 fi @@ -1445,10 +1526,12 @@ fedora32_build_patchelf() if [ "$OS_ARCH" = "i386" ]; then #PROOT="$S_PROOT_DIR/proot-x86 -q qemu-i386" - PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86" elif [ "$OS_ARCH" = "x86_64" ]; then #PROOT="$S_PROOT_DIR/proot-x86_64" - PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86_64" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -1490,10 +1573,12 @@ fedora32_build_fakechroot() if [ "$OS_ARCH" = "i386" ]; then #PROOT="$S_PROOT_DIR/proot-x86 -q qemu-i386" - PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86" elif [ "$OS_ARCH" = "x86_64" ]; then #PROOT="$S_PROOT_DIR/proot-x86_64" - PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86_64" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -1604,7 +1689,7 @@ fedora33_setup() $SUDO /usr/bin/dnf -y -c "${OS_ROOTDIR}/etc/dnf/dnf.conf" \ install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" --forcearch="$OS_ARCH" \ gcc kernel-devel make libtalloc libtalloc-devel glibc-static glibc-devel tar python \ - python2 gzip zlib diffutils file glibc-headers dnf + python2 gzip zlib diffutils file glibc-headers dnf git which #$SUDO /usr/bin/dnf -y -c "${OS_ROOTDIR}/etc/dnf/dnf.conf" \ # downgrade --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" --forcearch="$OS_ARCH" \ @@ -1618,7 +1703,8 @@ fedora33_setup() if [ "$OS_ARCH" = "aarch64" ]; then $SUDO chown -R $(id -u):$(id -g) "$OS_ROOTDIR" - PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" export PROOT_NO_SECCOMP=1 $PROOT -r "$OS_ROOTDIR" -0 -w / -b /dev -b /etc/resolv.conf /bin/bash <<'EOF_fedora33_reinstall' dnf -y reinstall $(rpm -qa) @@ -1644,14 +1730,17 @@ fedora33_build_proot() if [ "$OS_ARCH" = "i386" ]; then #PROOT="$S_PROOT_DIR/proot-x86 -q qemu-i386" - PROOT="$S_PROOT_DIR/proot-x86" + #PROOT="$S_PROOT_DIR/proot-x86" #PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86" elif [ "$OS_ARCH" = "x86_64" ]; then #PROOT="$S_PROOT_DIR/proot-x86_64" - PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86_64" elif [ "$OS_ARCH" = "aarch64" ]; then #PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" - PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -1670,14 +1759,16 @@ rm python ln -s python2 python cd /proot /bin/rm -f proot-Fedora-33.bin src/proot src/libtalloc.a src/talloc.h +/bin/rm -Rf talloc* # BUILD TALLOC -tar xzvf /proot-static-packages/talloc-2.1.1.tar.gz -cd talloc-2.1.1 +tar xzvf /proot-static-packages/talloc.tar.gz +cd talloc* ./configure make cp talloc.h /proot/src cd bin/default -ar qf libtalloc.a talloc_3.o +[ -f talloc.c.6.o ] && ar qf libtalloc.a talloc.c.6.o +[ -f talloc.c.5.o -a ! -f libtalloc.a ] && ar qf libtalloc.a talloc.c.5.o cp libtalloc.a /proot/src && make clean # BUILD PROOT cd /proot/src @@ -1685,7 +1776,7 @@ make clean make loader.elf make loader-m32.elf make build.h -make proot +LDFLAGS="-L/proot/usr/src -static" make proot EOF_fedora33_proot_1 fi @@ -1712,10 +1803,12 @@ fedora33_build_patchelf() if [ "$OS_ARCH" = "i386" ]; then #PROOT="$S_PROOT_DIR/proot-x86 -q qemu-i386" - PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86" elif [ "$OS_ARCH" = "x86_64" ]; then #PROOT="$S_PROOT_DIR/proot-x86_64" - PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86_64" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -1757,10 +1850,12 @@ fedora33_build_fakechroot() if [ "$OS_ARCH" = "i386" ]; then #PROOT="$S_PROOT_DIR/proot-x86 -q qemu-i386" - PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86" elif [ "$OS_ARCH" = "x86_64" ]; then #PROOT="$S_PROOT_DIR/proot-x86_64" - PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86_64" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -1871,7 +1966,7 @@ fedora34_setup() $SUDO /usr/bin/dnf -y -c "${OS_ROOTDIR}/etc/dnf/dnf.conf" \ install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" --forcearch="$OS_ARCH" \ gcc kernel-devel make libtalloc libtalloc-devel glibc-static glibc-devel tar python \ - python2 gzip zlib diffutils file glibc-headers dnf + python2 gzip zlib diffutils file glibc-headers dnf git which #$SUDO /usr/bin/dnf -y -c "${OS_ROOTDIR}/etc/dnf/dnf.conf" \ # downgrade --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" --forcearch="$OS_ARCH" \ @@ -1885,7 +1980,8 @@ fedora34_setup() if [ "$OS_ARCH" = "aarch64" ]; then $SUDO chown -R $(id -u):$(id -g) "$OS_ROOTDIR" - PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" export PROOT_NO_SECCOMP=1 $PROOT -r "$OS_ROOTDIR" -0 -w / -b /dev -b /etc/resolv.conf /bin/bash <<'EOF_fedora34_reinstall' dnf -y reinstall $(rpm -qa) @@ -1923,14 +2019,16 @@ rm python ln -s python2 python cd /proot /bin/rm -f proot-Fedora-34.bin src/proot src/libtalloc.a src/talloc.h +/bin/rm -Rf talloc* # BUILD TALLOC -tar xzvf /proot-static-packages/talloc-2.1.1.tar.gz -cd talloc-2.1.1 +tar xzvf /proot-static-packages/talloc.tar.gz +cd talloc* ./configure make cp talloc.h /proot/src cd bin/default -ar qf libtalloc.a talloc_3.o +[ -f talloc.c.6.o ] && ar qf libtalloc.a talloc.c.6.o +[ -f talloc.c.5.o -a ! -f libtalloc.a ] && ar qf libtalloc.a talloc.c.5.o cp libtalloc.a /proot/src && make clean # BUILD PROOT cd /proot/src @@ -1938,7 +2036,7 @@ make clean make loader.elf make loader-m32.elf make build.h -make proot +LDFLAGS="-L/proot/usr/src -static" make proot EOF_fedora34_proot_1 sync $SUDO umount "$OS_ROOTDIR/proot" @@ -1968,14 +2066,17 @@ fedora34_build_proot() if [ "$OS_ARCH" = "i386" ]; then #PROOT="$S_PROOT_DIR/proot-x86 -q qemu-i386" - PROOT="$S_PROOT_DIR/proot-x86" + #PROOT="$S_PROOT_DIR/proot-x86" #PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86" elif [ "$OS_ARCH" = "x86_64" ]; then #PROOT="$S_PROOT_DIR/proot-x86_64" - PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86_64" elif [ "$OS_ARCH" = "aarch64" ]; then #PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" - PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -1994,14 +2095,16 @@ rm python ln -s python2 python cd /proot /bin/rm -f proot-Fedora-34.bin src/proot src/libtalloc.a src/talloc.h +/bin/rm -Rf talloc* # BUILD TALLOC -tar xzvf /proot-static-packages/talloc-2.1.1.tar.gz -cd talloc-2.1.1 +tar xzvf /proot-static-packages/talloc.tar.gz +cd talloc* ./configure make cp talloc.h /proot/src cd bin/default -ar qf libtalloc.a talloc_3.o +[ -f talloc.c.6.o ] && ar qf libtalloc.a talloc.c.6.o +[ -f talloc.c.5.o -a ! -f libtalloc.a ] && ar qf libtalloc.a talloc.c.5.o cp libtalloc.a /proot/src && make clean # BUILD PROOT cd /proot/src @@ -2009,7 +2112,7 @@ make clean make loader.elf make loader-m32.elf make build.h -make proot +LDFLAGS="-L/proot/usr/src -static" make proot EOF_fedora34_proot_1 fi @@ -2036,10 +2139,12 @@ fedora34_build_patchelf() if [ "$OS_ARCH" = "i386" ]; then #PROOT="$S_PROOT_DIR/proot-x86 -q qemu-i386" - PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86" elif [ "$OS_ARCH" = "x86_64" ]; then #PROOT="$S_PROOT_DIR/proot-x86_64" - PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86_64" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -2081,10 +2186,12 @@ fedora34_build_fakechroot() if [ "$OS_ARCH" = "i386" ]; then #PROOT="$S_PROOT_DIR/proot-x86 -q qemu-i386" - PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86" elif [ "$OS_ARCH" = "x86_64" ]; then #PROOT="$S_PROOT_DIR/proot-x86_64" - PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86_64" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -2195,7 +2302,7 @@ fedora35_setup() $SUDO /usr/bin/dnf -y -c "${OS_ROOTDIR}/etc/dnf/dnf.conf" \ install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" --forcearch="$OS_ARCH" \ gcc kernel-devel make libtalloc libtalloc-devel glibc-static glibc-devel tar python \ - python2 gzip zlib diffutils file glibc-headers dnf + python2 gzip zlib diffutils file glibc-headers dnf git which #$SUDO /usr/bin/dnf -y -c "${OS_ROOTDIR}/etc/dnf/dnf.conf" \ # downgrade --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" --forcearch="$OS_ARCH" \ @@ -2209,7 +2316,8 @@ fedora35_setup() if [ "$OS_ARCH" = "aarch64" ]; then $SUDO chown -R $(id -u):$(id -g) "$OS_ROOTDIR" - PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" export PROOT_NO_SECCOMP=1 $PROOT -r "$OS_ROOTDIR" -0 -w / -b /dev -b /etc/resolv.conf /bin/bash <<'EOF_fedora35_reinstall' dnf -y reinstall $(rpm -qa) @@ -2247,14 +2355,16 @@ rm python ln -s python2 python cd /proot /bin/rm -f proot-Fedora-35.bin src/proot src/libtalloc.a src/talloc.h +/bin/rm -Rf talloc* # BUILD TALLOC -tar xzvf /proot-static-packages/talloc-2.1.1.tar.gz -cd talloc-2.1.1 +tar xzvf /proot-static-packages/talloc.tar.gz +cd talloc* ./configure make cp talloc.h /proot/src cd bin/default -ar qf libtalloc.a talloc_3.o +[ -f talloc.c.6.o ] && ar qf libtalloc.a talloc.c.6.o +[ -f talloc.c.5.o -a ! -f libtalloc.a ] && ar qf libtalloc.a talloc.c.5.o cp libtalloc.a /proot/src && make clean # BUILD PROOT cd /proot/src @@ -2262,7 +2372,7 @@ make clean make loader.elf make loader-m32.elf make build.h -make proot +LDFLAGS="-L/proot/usr/src -static" make proot EOF_fedora35_proot_1 sync $SUDO umount "$OS_ROOTDIR/proot" @@ -2292,14 +2402,17 @@ fedora35_build_proot() if [ "$OS_ARCH" = "i386" ]; then #PROOT="$S_PROOT_DIR/proot-x86 -q qemu-i386" - PROOT="$S_PROOT_DIR/proot-x86" + #PROOT="$S_PROOT_DIR/proot-x86" #PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86" elif [ "$OS_ARCH" = "x86_64" ]; then #PROOT="$S_PROOT_DIR/proot-x86_64" - PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86_64" elif [ "$OS_ARCH" = "aarch64" ]; then #PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" - PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -2318,14 +2431,16 @@ rm python ln -s python2 python cd /proot /bin/rm -f proot-Fedora-35.bin src/proot src/libtalloc.a src/talloc.h +/bin/rm -Rf talloc* # BUILD TALLOC -tar xzvf /proot-static-packages/talloc-2.1.1.tar.gz -cd talloc-2.1.1 +tar xzvf /proot-static-packages/talloc.tar.gz +cd talloc* ./configure make cp talloc.h /proot/src cd bin/default -ar qf libtalloc.a talloc_3.o +[ -f talloc.c.6.o ] && ar qf libtalloc.a talloc.c.6.o +[ -f talloc.c.5.o -a ! -f libtalloc.a ] && ar qf libtalloc.a talloc.c.5.o cp libtalloc.a /proot/src && make clean # BUILD PROOT cd /proot/src @@ -2333,7 +2448,7 @@ make clean make loader.elf make loader-m32.elf make build.h -make proot +LDFLAGS="-L/proot/usr/src -static" make proot EOF_fedora35_proot_1 fi @@ -2360,10 +2475,12 @@ fedora35_build_patchelf() if [ "$OS_ARCH" = "i386" ]; then #PROOT="$S_PROOT_DIR/proot-x86 -q qemu-i386" - PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86" elif [ "$OS_ARCH" = "x86_64" ]; then #PROOT="$S_PROOT_DIR/proot-x86_64" - PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86_64" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -2405,10 +2522,12 @@ fedora35_build_fakechroot() if [ "$OS_ARCH" = "i386" ]; then #PROOT="$S_PROOT_DIR/proot-x86 -q qemu-i386" - PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86" elif [ "$OS_ARCH" = "x86_64" ]; then #PROOT="$S_PROOT_DIR/proot-x86_64" - PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86_64" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -2519,7 +2638,7 @@ fedora36_setup() $SUDO /usr/bin/dnf -y -c "${OS_ROOTDIR}/etc/dnf/dnf.conf" \ install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" --forcearch="$OS_ARCH" \ gcc kernel-devel make libtalloc libtalloc-devel glibc-static glibc-devel tar python \ - python2 gzip zlib diffutils file glibc-headers dnf + python2 gzip zlib diffutils file glibc-headers dnf git which #$SUDO /usr/bin/dnf -y -c "${OS_ROOTDIR}/etc/dnf/dnf.conf" \ # downgrade --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" --forcearch="$OS_ARCH" \ @@ -2533,7 +2652,8 @@ fedora36_setup() if [ "$OS_ARCH" = "aarch64" ]; then $SUDO chown -R $(id -u):$(id -g) "$OS_ROOTDIR" - PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" export PROOT_NO_SECCOMP=1 $PROOT -r "$OS_ROOTDIR" -0 -w / -b /dev -b /etc/resolv.conf /bin/bash <<'EOF_fedora36_reinstall' dnf -y reinstall $(rpm -qa) @@ -2571,14 +2691,16 @@ rm python ln -s python2 python cd /proot /bin/rm -f proot-Fedora-36.bin src/proot src/libtalloc.a src/talloc.h +/bin/rm -Rf talloc* # BUILD TALLOC -tar xzvf /proot-static-packages/talloc-2.1.1.tar.gz -cd talloc-2.1.1 +tar xzvf /proot-static-packages/talloc.tar.gz +cd talloc* ./configure make cp talloc.h /proot/src cd bin/default -ar qf libtalloc.a talloc_3.o +[ -f talloc.c.6.o ] && ar qf libtalloc.a talloc.c.6.o +[ -f talloc.c.5.o -a ! -f libtalloc.a ] && ar qf libtalloc.a talloc.c.5.o cp libtalloc.a /proot/src && make clean # BUILD PROOT cd /proot/src @@ -2586,7 +2708,7 @@ make clean make loader.elf make loader-m32.elf make build.h -make proot +LDFLAGS="-L/proot/usr/src -static" make proot EOF_fedora36_proot_1 sync $SUDO umount "$OS_ROOTDIR/proot" @@ -2616,14 +2738,17 @@ fedora36_build_proot() if [ "$OS_ARCH" = "i386" ]; then #PROOT="$S_PROOT_DIR/proot-x86 -q qemu-i386" - PROOT="$S_PROOT_DIR/proot-x86" + #PROOT="$S_PROOT_DIR/proot-x86" #PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86" elif [ "$OS_ARCH" = "x86_64" ]; then #PROOT="$S_PROOT_DIR/proot-x86_64" - PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86_64" elif [ "$OS_ARCH" = "aarch64" ]; then #PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" - PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -2642,14 +2767,16 @@ rm python ln -s python2 python cd /proot /bin/rm -f proot-Fedora-36.bin src/proot src/libtalloc.a src/talloc.h +/bin/rm -Rf talloc* # BUILD TALLOC -tar xzvf /proot-static-packages/talloc-2.1.1.tar.gz -cd talloc-2.1.1 +tar xzvf /proot-static-packages/talloc.tar.gz +cd talloc* ./configure make cp talloc.h /proot/src cd bin/default -ar qf libtalloc.a talloc_3.o +[ -f talloc.c.6.o ] && ar qf libtalloc.a talloc.c.6.o +[ -f talloc.c.5.o -a ! -f libtalloc.a ] && ar qf libtalloc.a talloc.c.5.o cp libtalloc.a /proot/src && make clean # BUILD PROOT cd /proot/src @@ -2657,7 +2784,7 @@ make clean make loader.elf make loader-m32.elf make build.h -make proot +LDFLAGS="-L/proot/usr/src -static" make proot EOF_fedora36_proot_1 fi @@ -2684,10 +2811,12 @@ fedora36_build_patchelf() if [ "$OS_ARCH" = "i386" ]; then #PROOT="$S_PROOT_DIR/proot-x86 -q qemu-i386" - PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86" elif [ "$OS_ARCH" = "x86_64" ]; then #PROOT="$S_PROOT_DIR/proot-x86_64" - PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86_64" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -2729,10 +2858,12 @@ fedora36_build_fakechroot() if [ "$OS_ARCH" = "i386" ]; then #PROOT="$S_PROOT_DIR/proot-x86 -q qemu-i386" - PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86" elif [ "$OS_ARCH" = "x86_64" ]; then #PROOT="$S_PROOT_DIR/proot-x86_64" - PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86_64" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -2843,7 +2974,7 @@ fedora38_setup() $SUDO /usr/bin/dnf -y -c "${OS_ROOTDIR}/etc/dnf/dnf.conf" \ install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" --forcearch="$OS_ARCH" \ gcc kernel-devel make libtalloc libtalloc-devel glibc-static glibc-devel tar python \ - python2 gzip zlib diffutils file glibc-headers dnf + python2 gzip zlib diffutils file glibc-headers dnf git which #$SUDO /usr/bin/dnf -y -c "${OS_ROOTDIR}/etc/dnf/dnf.conf" \ # downgrade --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" --forcearch="$OS_ARCH" \ @@ -2857,7 +2988,8 @@ fedora38_setup() if [ "$OS_ARCH" = "aarch64" ]; then $SUDO chown -R $(id -u):$(id -g) "$OS_ROOTDIR" - PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" export PROOT_NO_SECCOMP=1 $PROOT -r "$OS_ROOTDIR" -0 -w / -b /dev -b /etc/resolv.conf /bin/bash <<'EOF_fedora38_reinstall' dnf -y reinstall $(rpm -qa) @@ -2895,14 +3027,16 @@ rm python ln -s python2 python cd /proot /bin/rm -f proot-Fedora-38.bin src/proot src/libtalloc.a src/talloc.h +/bin/rm -Rf talloc* # BUILD TALLOC -tar xzvf /proot-static-packages/talloc-2.1.1.tar.gz -cd talloc-2.1.1 +tar xzvf /proot-static-packages/talloc.tar.gz +cd talloc* ./configure make cp talloc.h /proot/src cd bin/default -ar qf libtalloc.a talloc_3.o +[ -f talloc.c.6.o ] && ar qf libtalloc.a talloc.c.6.o +[ -f talloc.c.5.o -a ! -f libtalloc.a ] && ar qf libtalloc.a talloc.c.5.o cp libtalloc.a /proot/src && make clean # BUILD PROOT cd /proot/src @@ -2910,7 +3044,7 @@ make clean make loader.elf make loader-m32.elf make build.h -make proot +LDFLAGS="-L/proot/usr/src -static" make proot EOF_fedora38_proot_1 sync $SUDO umount "$OS_ROOTDIR/proot" @@ -2940,14 +3074,17 @@ fedora38_build_proot() if [ "$OS_ARCH" = "i386" ]; then #PROOT="$S_PROOT_DIR/proot-x86 -q qemu-i386" - PROOT="$S_PROOT_DIR/proot-x86" + #PROOT="$S_PROOT_DIR/proot-x86" #PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86" elif [ "$OS_ARCH" = "x86_64" ]; then #PROOT="$S_PROOT_DIR/proot-x86_64" - PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86_64" elif [ "$OS_ARCH" = "aarch64" ]; then #PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" - PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -2966,14 +3103,16 @@ rm python ln -s python2 python cd /proot /bin/rm -f proot-Fedora-38.bin src/proot src/libtalloc.a src/talloc.h +/bin/rm -Rf talloc* # BUILD TALLOC -tar xzvf /proot-static-packages/talloc-2.1.1.tar.gz -cd talloc-2.1.1 +tar xzvf /proot-static-packages/talloc.tar.gz +cd talloc* ./configure make cp talloc.h /proot/src cd bin/default -ar qf libtalloc.a talloc_3.o +[ -f talloc.c.6.o ] && ar qf libtalloc.a talloc.c.6.o +[ -f talloc.c.5.o -a ! -f libtalloc.a ] && ar qf libtalloc.a talloc.c.5.o cp libtalloc.a /proot/src && make clean # BUILD PROOT cd /proot/src @@ -2981,7 +3120,7 @@ make clean make loader.elf make loader-m32.elf make build.h -make proot +LDFLAGS="-L/proot/usr/src -static" make proot EOF_fedora38_proot_1 fi @@ -3008,10 +3147,12 @@ fedora38_build_patchelf() if [ "$OS_ARCH" = "i386" ]; then #PROOT="$S_PROOT_DIR/proot-x86 -q qemu-i386" - PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86" elif [ "$OS_ARCH" = "x86_64" ]; then #PROOT="$S_PROOT_DIR/proot-x86_64" - PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86_64" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -3053,10 +3194,12 @@ fedora38_build_fakechroot() if [ "$OS_ARCH" = "i386" ]; then #PROOT="$S_PROOT_DIR/proot-x86 -q qemu-i386" - PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86" elif [ "$OS_ARCH" = "x86_64" ]; then #PROOT="$S_PROOT_DIR/proot-x86_64" - PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86_64" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -3212,7 +3355,8 @@ centos6_setup() $SUDO /usr/bin/yum -y -c "${OS_ROOTDIR}/etc/yum.conf" \ install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" \ - gcc make libtalloc libtalloc-devel glibc-static glibc-devel tar python gzip zlib diffutils file + gcc make libtalloc libtalloc-devel glibc-static glibc-devel \ + tar python gzip zlib diffutils file git which if [ "$OS_ARCH" = "x86_64" ]; then $SUDO /usr/bin/yum -y -c "${OS_ROOTDIR}/etc/yum.conf" \ @@ -3240,6 +3384,7 @@ centos6_build_fakechroot() if [ "$OS_ARCH" = "i386" ]; then #PROOT="$S_PROOT_DIR/proot-x86 -q qemu-i386" + #PROOT="$S_PROOT_DIR/proot-x86" PROOT="$S_PROOT_DIR/proot-x86" elif [ "$OS_ARCH" = "x86_64" ]; then PROOT="$S_PROOT_DIR/proot-x86_64" @@ -3379,11 +3524,14 @@ centos7_setup() $SUDO /usr/bin/yum -y -c "${OS_ROOTDIR}/etc/yum.conf" \ install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" \ - gcc make libtalloc libtalloc-devel glibc-static glibc-devel tar python gzip zlib diffutils file + --forcearch="$OS_ARCH" \ + gcc make libtalloc libtalloc-devel glibc-static glibc-devel \ + tar python gzip zlib diffutils file git which - if [ "$OS_ARCH" = "x86_64" ]; then + if [ "$OS_ARCH" = "x86_64" -o "$OS_ARCH" = "aarch64" ]; then $SUDO /usr/bin/yum -y -c "${OS_ROOTDIR}/etc/yum.conf" \ install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" \ + --forcearch="$OS_ARCH" \ autoconf m4 gcc-c++ automake gawk libtool fi @@ -3407,10 +3555,12 @@ centos7_build_fakechroot() if [ "$OS_ARCH" = "i386" ]; then #PROOT="$S_PROOT_DIR/proot-x86 -q qemu-i386" - PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86" elif [ "$OS_ARCH" = "x86_64" ]; then #PROOT="$S_PROOT_DIR/proot-x86_64" - PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86_64" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -3452,10 +3602,12 @@ centos7_build_proot() if [ "$OS_ARCH" = "i386" ]; then #PROOT="$S_PROOT_DIR/proot-x86 -q qemu-i386" #PROOT="$S_PROOT_DIR/proot-x86" - PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86" elif [ "$OS_ARCH" = "x86_64" ]; then #PROOT="$HOME/.udocker/bin/proot-x86_64" - PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + PROOT="$HOME/.udocker/bin/proot-x86_64" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -3471,15 +3623,17 @@ centos7_build_proot() -b "${S_PROOT_PACKAGES_DIR}:/proot-static-packages" /bin/bash <<'EOF_centos7_proot_1' cd /proot /bin/rm -f proot-CentOS-7.bin src/proot src/libtalloc.a src/talloc.h +/bin/rm -Rf talloc* # BUILD TALLOC -tar xzvf /proot-static-packages/talloc-2.1.1.tar.gz -cd talloc-2.1.1 +tar xzvf /proot-static-packages/talloc.tar.gz +cd talloc* make clean ./configure make cp talloc.h /proot/src cd bin/default -ar qf libtalloc.a talloc_3.o +[ -f talloc.c.6.o ] && ar qf libtalloc.a talloc.c.6.o +[ -f talloc.c.5.o -a ! -f libtalloc.a ] && ar qf libtalloc.a talloc.c.5.o cp libtalloc.a /proot/src && make clean # BUILD PROOT cd /proot/src @@ -3487,7 +3641,7 @@ make clean make loader.elf make loader-m32.elf make build.h -make proot +LDFLAGS="-L/proot/usr/src -static" make proot EOF_centos7_proot_1 fi @@ -3649,12 +3803,16 @@ centos8_setup() centos8_create_yum "${OS_ROOTDIR}/etc/yum.conf" "$OS_ARCH" $SUDO /usr/bin/yum -y -c "${OS_ROOTDIR}/etc/yum.conf" \ - install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" --setopt=module_platform_id=platform:el$OS_RELVER \ - dnf dnf-data gcc make libtalloc libtalloc-devel glibc-static glibc-devel tar python3 python2 gzip zlib diffutils file + install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" \ + --setopt=module_platform_id=platform:el$OS_RELVER \ + --forcearch="$OS_ARCH" \ + dnf dnf-data gcc make libtalloc libtalloc-devel glibc-static \ + glibc-devel tar python3 python2 gzip zlib diffutils file git which - if [ "$OS_ARCH" = "x86_64" ]; then + if [ "$OS_ARCH" = "x86_64" -o "$OS_ARCH" = "aarch64" ]; then $SUDO /usr/bin/yum -y -c "${OS_ROOTDIR}/etc/yum.conf" \ install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" \ + --forcearch="$OS_ARCH" \ autoconf m4 gcc-c++ automake gawk libtool fi @@ -3678,10 +3836,12 @@ centos8_build_fakechroot() if [ "$OS_ARCH" = "i386" ]; then #PROOT="$S_PROOT_DIR/proot-x86 -q qemu-i386" - PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86" elif [ "$OS_ARCH" = "x86_64" ]; then #PROOT="$S_PROOT_DIR/proot-x86_64" - PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86_64" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -3872,12 +4032,16 @@ centos_stream8_setup() centos_stream8_create_yum "${OS_ROOTDIR}/etc/yum.conf" "$OS_ARCH" $SUDO /usr/bin/yum -y -c "${OS_ROOTDIR}/etc/yum.conf" \ - install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" --setopt=module_platform_id=platform:el${OS_RELVER} \ - dnf dnf-data gcc make libtalloc libtalloc-devel glibc-devel tar python3 python2 gzip zlib diffutils file + install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" \ + --setopt=module_platform_id=platform:el${OS_RELVER} \ + --forcearch="$OS_ARCH" \ + dnf dnf-data gcc make libtalloc libtalloc-devel glibc-devel tar \ + python3 python2 gzip zlib diffutils file git which if [ "$OS_ARCH" = "x86_64" ]; then $SUDO /usr/bin/yum -y -c "${OS_ROOTDIR}/etc/yum.conf" \ install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" \ + --forcearch="$OS_ARCH" \ autoconf m4 gcc-c++ automake gawk libtool fi @@ -3901,10 +4065,12 @@ centos_stream8_build_fakechroot() if [ "$OS_ARCH" = "i386" ]; then #PROOT="$S_PROOT_DIR/proot-x86 -q qemu-i386" - PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86" elif [ "$OS_ARCH" = "x86_64" ]; then #PROOT="$S_PROOT_DIR/proot-x86_64" - PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86_64" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -4085,12 +4251,16 @@ centos_stream9_setup() centos_stream9_create_yum "${OS_ROOTDIR}/etc/yum.conf" "$OS_ARCH" $SUDO /usr/bin/yum -y -c "${OS_ROOTDIR}/etc/yum.conf" \ - install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" --setopt=module_platform_id=platform:el${OS_RELVER} \ - dnf dnf-data gcc make libtalloc libtalloc-devel glibc-devel tar python3 python2 gzip zlib diffutils file + install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" \ + --setopt=module_platform_id=platform:el${OS_RELVER} \ + --forcearch="$OS_ARCH" \ + dnf dnf-data gcc make libtalloc libtalloc-devel glibc-devel tar \ + python3 python2 gzip zlib diffutils file git which - if [ "$OS_ARCH" = "x86_64" ]; then + if [ "$OS_ARCH" = "x86_64" -o "$OS_ARCH" = "aarch64" ]; then $SUDO /usr/bin/yum -y -c "${OS_ROOTDIR}/etc/yum.conf" \ install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" \ + --forcearch="$OS_ARCH" \ autoconf m4 gcc-c++ automake gawk libtool fi @@ -4114,10 +4284,12 @@ centos_stream9_build_fakechroot() if [ "$OS_ARCH" = "i386" ]; then #PROOT="$S_PROOT_DIR/proot-x86 -q qemu-i386" - PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86" elif [ "$OS_ARCH" = "x86_64" ]; then #PROOT="$S_PROOT_DIR/proot-x86_64" - PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86_64" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -4318,15 +4490,17 @@ rocky8_setup() /bin/mkdir -p "${OS_ROOTDIR}/etc/yum.repos.d" rocky8_create_yum "${OS_ROOTDIR}/etc/yum.conf" "$OS_ARCH" -set -v $SUDO /usr/bin/yum -y -c "${OS_ROOTDIR}/etc/yum.conf" \ - install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" --setopt=module_platform_id=platform:el$OS_RELVER \ - dnf rpm dnf-data gcc make libtalloc libtalloc-devel glibc-devel tar python3 python2 gzip zlib diffutils file -set +v + install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" \ + --setopt=module_platform_id=platform:el$OS_RELVER \ + --forcearch="$OS_ARCH" \ + dnf rpm dnf-data gcc make libtalloc libtalloc-devel glibc-devel tar \ + python3 python2 gzip zlib diffutils file git which - if [ "$OS_ARCH" = "x86_64" ]; then + if [ "$OS_ARCH" = "x86_64" -o "$OS_ARCH" = "aarch64" ]; then $SUDO /usr/bin/yum -y -c "${OS_ROOTDIR}/etc/yum.conf" \ install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" \ + --forcearch="$OS_ARCH" \ autoconf m4 gcc-c++ automake gawk libtool fi @@ -4350,10 +4524,16 @@ rocky8_build_fakechroot() if [ "$OS_ARCH" = "i386" ]; then #PROOT="$S_PROOT_DIR/proot-x86 -q qemu-i386" - PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86" elif [ "$OS_ARCH" = "x86_64" ]; then #PROOT="$S_PROOT_DIR/proot-x86_64" - PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86_64" + elif [ "$OS_ARCH" = "aarch64" ]; then + #PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -4577,13 +4757,17 @@ rocky9_setup() set -v $SUDO /usr/bin/yum -y -c "${OS_ROOTDIR}/etc/yum.conf" \ - install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" --setopt=module_platform_id=platform:el$OS_RELVER \ - dnf rpm dnf-data gcc make libtalloc libtalloc-devel glibc-devel tar python3 python2 gzip zlib diffutils file + install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" \ + --setopt=module_platform_id=platform:el$OS_RELVER \ + --forcearch="$OS_ARCH" \ + dnf rpm dnf-data gcc make libtalloc libtalloc-devel glibc-devel tar \ + python3 python2 gzip zlib diffutils file git which set +v - if [ "$OS_ARCH" = "x86_64" ]; then + if [ "$OS_ARCH" = "x86_64" -o "$OS_ARCH" = "aarch64" ]; then $SUDO /usr/bin/yum -y -c "${OS_ROOTDIR}/etc/yum.conf" \ install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" \ + --forcearch="$OS_ARCH" \ autoconf m4 gcc-c++ automake gawk libtool fi @@ -4607,10 +4791,12 @@ rocky9_build_fakechroot() if [ "$OS_ARCH" = "i386" ]; then #PROOT="$S_PROOT_DIR/proot-x86 -q qemu-i386" - PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86" elif [ "$OS_ARCH" = "x86_64" ]; then #PROOT="$S_PROOT_DIR/proot-x86_64" - PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86_64" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -4834,13 +5020,17 @@ alma9_setup() set -v $SUDO /usr/bin/yum -y -c "${OS_ROOTDIR}/etc/yum.conf" \ - install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" --setopt=module_platform_id=platform:el$OS_RELVER \ - dnf rpm dnf-data gcc make libtalloc libtalloc-devel glibc-devel tar python3 python2 gzip zlib diffutils file + install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" \ + --setopt=module_platform_id=platform:el$OS_RELVER \ + --forcearch="$OS_ARCH" \ + dnf rpm dnf-data gcc make libtalloc libtalloc-devel glibc-devel tar \ + python3 python2 gzip zlib diffutils file git which set +v - if [ "$OS_ARCH" = "x86_64" ]; then + if [ "$OS_ARCH" = "x86_64" -o "$OS_ARCH" = "aarch64" ]; then $SUDO /usr/bin/yum -y -c "${OS_ROOTDIR}/etc/yum.conf" \ install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" \ + --forcearch="$OS_ARCH" \ autoconf m4 gcc-c++ automake gawk libtool fi @@ -4864,10 +5054,12 @@ alma9_build_fakechroot() if [ "$OS_ARCH" = "i386" ]; then #PROOT="$S_PROOT_DIR/proot-x86 -q qemu-i386" - PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86" elif [ "$OS_ARCH" = "x86_64" ]; then #PROOT="$S_PROOT_DIR/proot-x86_64" - PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86_64" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -4936,6 +5128,7 @@ ubuntu12_build_fakechroot() if [ "$OS_ARCH" = "i386" ]; then #PROOT="$S_PROOT_DIR/proot-x86 -q qemu-i386" + #PROOT="$S_PROOT_DIR/proot-x86" PROOT="$S_PROOT_DIR/proot-x86" elif [ "$OS_ARCH" = "amd64" ]; then PROOT="$S_PROOT_DIR/proot-x86_64" @@ -4959,7 +5152,8 @@ ubuntu12_build_fakechroot() apt-get -y update apt-get -y --no-install-recommends install wget debconf devscripts gnupg nano apt-get -y update -apt-get -y install locales build-essential gcc make autoconf m4 automake gawk libtool bash diffutils file +apt-get -y install locales build-essential gcc make autoconf m4 automake gawk libtool bash i +apt-get -y install diffutils file which EOF_ubuntu12_packages SHELL=/bin/bash CONFIG_SHELL=/bin/bash PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/lib \ @@ -5017,6 +5211,7 @@ ubuntu14_build_fakechroot() if [ "$OS_ARCH" = "i386" ]; then #PROOT="$S_PROOT_DIR/proot-x86 -q qemu-i386" + #PROOT="$S_PROOT_DIR/proot-x86" PROOT="$S_PROOT_DIR/proot-x86" elif [ "$OS_ARCH" = "amd64" ]; then PROOT="$S_PROOT_DIR/proot-x86_64" @@ -5041,7 +5236,8 @@ ubuntu14_build_fakechroot() apt-get -y update apt-get -y --no-install-recommends install wget debconf devscripts gnupg nano apt-get -y update -apt-get -y install locales build-essential gcc make autoconf m4 automake gawk libtool bash diffutils file +apt-get -y install locales build-essential gcc make autoconf m4 automake gawk libtool bash +apt-get -y install diffutils file which EOF_ubuntu14_packages fi @@ -5099,6 +5295,7 @@ ubuntu16_build_fakechroot() if [ "$OS_ARCH" = "i386" ]; then #PROOT="$S_PROOT_DIR/proot-x86 -q qemu-i386" + #PROOT="$S_PROOT_DIR/proot-x86" PROOT="$S_PROOT_DIR/proot-x86" elif [ "$OS_ARCH" = "amd64" ]; then PROOT="$S_PROOT_DIR/proot-x86_64" @@ -5123,7 +5320,8 @@ ubuntu16_build_fakechroot() apt-get -y update apt-get -y --no-install-recommends install wget debconf devscripts gnupg nano apt-get -y update -apt-get -y install locales build-essential gcc make autoconf m4 automake gawk libtool bash diffutils file +apt-get -y install locales build-essential gcc make autoconf m4 automake gawk libtool bash +apt-get -y install diffutils file which EOF_ubuntu16_packages fi @@ -5248,7 +5446,8 @@ ubuntu18_build_fakechroot() apt-get -y update apt-get -y --no-install-recommends install wget debconf devscripts gnupg nano apt-get -y update -apt-get -y install locales build-essential gcc make autoconf m4 automake gawk libtool bash diffutils file +apt-get -y install locales build-essential gcc make autoconf m4 automake gawk libtool bash +apt-get -y install diffutils file which EOF_ubuntu18_packages fi @@ -5281,10 +5480,12 @@ ubuntu18_build_runc() if [ "$OS_ARCH" = "i386" ]; then #PROOT="$S_PROOT_DIR/proot-x86 -q qemu-i386" - PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86" elif [ "$OS_ARCH" = "amd64" ]; then #PROOT="$S_PROOT_DIR/proot-x86_64" - PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86_64" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -5359,10 +5560,12 @@ ubuntu19_build_fakechroot() if [ "$OS_ARCH" = "i386" ]; then #PROOT="$S_PROOT_DIR/proot-x86 -q qemu-i386" #PROOT="$S_PROOT_DIR/proot-x86" - PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86" elif [ "$OS_ARCH" = "amd64" ]; then #PROOT="$S_PROOT_DIR/proot-x86_64" - PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86_64" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -5384,7 +5587,8 @@ ubuntu19_build_fakechroot() apt-get -y update apt-get -y --no-install-recommends install wget debconf devscripts gnupg nano apt-get -y update -apt-get -y install locales build-essential gcc make autoconf m4 automake gawk libtool bash diffutils file +apt-get -y install locales build-essential gcc make autoconf m4 automake gawk libtool bash +apt-get -y install diffutils file which EOF_ubuntu19_packages fi @@ -5417,10 +5621,12 @@ ubuntu19_build_runc() if [ "$OS_ARCH" = "i386" ]; then #PROOT="$S_PROOT_DIR/proot-x86 -q qemu-i386" - PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86" elif [ "$OS_ARCH" = "amd64" ]; then #PROOT="$S_PROOT_DIR/proot-x86_64" - PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86_64" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -5495,10 +5701,12 @@ ubuntu20_build_fakechroot() if [ "$OS_ARCH" = "i386" ]; then #PROOT="$S_PROOT_DIR/proot-x86 -q qemu-i386" #PROOT="$S_PROOT_DIR/proot-x86" - PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86" elif [ "$OS_ARCH" = "amd64" ]; then #PROOT="$S_PROOT_DIR/proot-x86_64" - PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86_64" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -5520,7 +5728,8 @@ ubuntu20_build_fakechroot() apt-get -y update apt-get -y --no-install-recommends install wget debconf devscripts gnupg nano apt-get -y update -apt-get -y install locales build-essential gcc make autoconf m4 automake gawk libtool bash diffutils file +apt-get -y install locales build-essential gcc make autoconf m4 automake gawk libtool bash +apt-get -y install diffutils file which EOF_ubuntu20_packages fi @@ -5553,10 +5762,12 @@ ubuntu20_build_runc() if [ "$OS_ARCH" = "i386" ]; then #PROOT="$S_PROOT_DIR/proot-x86 -q qemu-i386" - PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86" elif [ "$OS_ARCH" = "amd64" ]; then #PROOT="$S_PROOT_DIR/proot-x86_64" - PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86_64" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -5630,10 +5841,12 @@ ubuntu21_build_fakechroot() if [ "$OS_ARCH" = "i386" ]; then #PROOT="$S_PROOT_DIR/proot-x86 -q qemu-i386" #PROOT="$S_PROOT_DIR/proot-x86" - PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86" elif [ "$OS_ARCH" = "amd64" ]; then #PROOT="$S_PROOT_DIR/proot-x86_64" - PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86_64" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -5655,7 +5868,8 @@ ubuntu21_build_fakechroot() apt-get -y update apt-get -y --no-install-recommends install wget debconf devscripts gnupg nano apt-get -y update -apt-get -y install locales build-essential gcc make autoconf m4 automake gawk libtool bash diffutils file +apt-get -y install locales build-essential gcc make autoconf m4 automake gawk libtool bash +apt-get -y install diffutils file which EOF_ubuntu21_packages fi @@ -5688,10 +5902,12 @@ ubuntu21_build_runc() if [ "$OS_ARCH" = "i386" ]; then #PROOT="$S_PROOT_DIR/proot-x86 -q qemu-i386" - PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86" elif [ "$OS_ARCH" = "amd64" ]; then #PROOT="$S_PROOT_DIR/proot-x86_64" - PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86_64" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -5765,10 +5981,12 @@ ubuntu22_build_fakechroot() if [ "$OS_ARCH" = "i386" ]; then #PROOT="$S_PROOT_DIR/proot-x86 -q qemu-i386" #PROOT="$S_PROOT_DIR/proot-x86" - PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86" elif [ "$OS_ARCH" = "amd64" ]; then #PROOT="$S_PROOT_DIR/proot-x86_64" - PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86_64" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -5790,7 +6008,8 @@ ubuntu22_build_fakechroot() apt-get -y update apt-get -y --no-install-recommends install wget debconf devscripts gnupg nano apt-get -y update -apt-get -y install locales build-essential gcc make autoconf m4 automake gawk libtool bash diffutils file +apt-get -y install locales build-essential gcc make autoconf m4 automake gawk libtool bash +apt-get -y install diffutils file which EOF_ubuntu22_packages fi @@ -5823,10 +6042,12 @@ ubuntu22_build_runc() if [ "$OS_ARCH" = "i386" ]; then #PROOT="$S_PROOT_DIR/proot-x86 -q qemu-i386" - PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86" elif [ "$OS_ARCH" = "amd64" ]; then #PROOT="$S_PROOT_DIR/proot-x86_64" - PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86_64" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -5899,10 +6120,12 @@ ubuntu23_build_fakechroot() if [ "$OS_ARCH" = "i386" ]; then #PROOT="$S_PROOT_DIR/proot-x86 -q qemu-i386" #PROOT="$S_PROOT_DIR/proot-x86" - PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86" elif [ "$OS_ARCH" = "amd64" ]; then #PROOT="$S_PROOT_DIR/proot-x86_64" - PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86_64" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -5924,7 +6147,8 @@ ubuntu23_build_fakechroot() apt-get -y update apt-get -y --no-install-recommends install wget debconf devscripts gnupg nano apt-get -y update -apt-get -y install locales build-essential gcc make autoconf m4 automake gawk libtool bash diffutils file +apt-get -y install locales build-essential gcc make autoconf m4 automake gawk libtool bash +apt-get -y install diffutils file which EOF_ubuntu23_packages fi @@ -5957,10 +6181,12 @@ ubuntu23_build_runc() if [ "$OS_ARCH" = "i386" ]; then #PROOT="$S_PROOT_DIR/proot-x86 -q qemu-i386" - PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86" elif [ "$OS_ARCH" = "amd64" ]; then #PROOT="$S_PROOT_DIR/proot-x86_64" - PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86_64" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -6040,7 +6266,8 @@ alpine36_setup() --allow-untrusted \ --root ${OS_ROOTDIR} \ --initdb add alpine-base alpine-sdk bash libc-dev make autoconf m4 automake \ - libbsd libbsd-dev fts fts-dev libconfig-dev musl-dev bash diffutils file + libbsd libbsd-dev fts fts-dev libconfig-dev musl-dev bash diffutils \ + file $SUDO /bin/chown -R "$(id -u).$(id -g)" "${OS_ROOTDIR}" $SUDO /bin/chmod -R u+rw "${OS_ROOTDIR}" @@ -6543,7 +6770,8 @@ alpine312_setup() --allow-untrusted \ --root ${OS_ROOTDIR} \ --initdb add alpine-base alpine-sdk bash libc-dev make autoconf m4 automake \ - libbsd libbsd-dev fts fts-dev libconfig-dev musl-dev bash diffutils file + libbsd libbsd-dev fts fts-dev libconfig-dev musl-dev bash diffutils \ + file $SUDO /bin/chown -R "$(id -u).$(id -g)" "${OS_ROOTDIR}" $SUDO /bin/chmod -R u+rw "${OS_ROOTDIR}" @@ -6644,7 +6872,8 @@ alpine313_setup() --allow-untrusted \ --root ${OS_ROOTDIR} \ --initdb add alpine-base alpine-sdk bash libc-dev make autoconf m4 automake \ - libbsd libbsd-dev fts fts-dev libconfig-dev musl-dev bash diffutils file + libbsd libbsd-dev fts fts-dev libconfig-dev musl-dev bash diffutils \ + file $SUDO /bin/chown -R "$(id -u).$(id -g)" "${OS_ROOTDIR}" $SUDO /bin/chmod -R u+rw "${OS_ROOTDIR}" @@ -6745,7 +6974,8 @@ alpine314_setup() --allow-untrusted \ --root ${OS_ROOTDIR} \ --initdb add alpine-base alpine-sdk bash libc-dev make autoconf m4 automake \ - libbsd libbsd-dev fts fts-dev libconfig-dev musl-dev bash diffutils file + libbsd libbsd-dev fts fts-dev libconfig-dev musl-dev bash diffutils \ + file $SUDO /bin/chown -R "$(id -u).$(id -g)" "${OS_ROOTDIR}" $SUDO /bin/chmod -R u+rw "${OS_ROOTDIR}" @@ -6768,10 +6998,12 @@ alpine314_build_fakechroot() if [ "$OS_ARCH" = "i386" ]; then #PROOT="$S_PROOT_DIR/proot-x86 -q qemu-i386" #PROOT="$S_PROOT_DIR/proot-x86" - PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86" elif [ "$OS_ARCH" = "x86_64" ]; then #PROOT="$S_PROOT_DIR/proot-x86_64" - PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86_64" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -6848,7 +7080,8 @@ alpine315_setup() --allow-untrusted \ --root ${OS_ROOTDIR} \ --initdb add alpine-base alpine-sdk bash libc-dev make autoconf m4 automake \ - libbsd libbsd-dev fts fts-dev libconfig-dev musl-dev bash diffutils file + libbsd libbsd-dev fts fts-dev libconfig-dev musl-dev bash diffutils \ + file $SUDO /bin/chown -R "$(id -u).$(id -g)" "${OS_ROOTDIR}" $SUDO /bin/chmod -R u+rw "${OS_ROOTDIR}" @@ -6871,10 +7104,12 @@ alpine315_build_fakechroot() if [ "$OS_ARCH" = "i386" ]; then #PROOT="$S_PROOT_DIR/proot-x86 -q qemu-i386" #PROOT="$S_PROOT_DIR/proot-x86" - PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86" elif [ "$OS_ARCH" = "x86_64" ]; then #PROOT="$S_PROOT_DIR/proot-x86_64" - PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86_64" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -6951,7 +7186,8 @@ alpine316_setup() --allow-untrusted \ --root ${OS_ROOTDIR} \ --initdb add alpine-base alpine-sdk bash libc-dev make autoconf m4 automake \ - libbsd libbsd-dev fts fts-dev libconfig-dev musl-dev bash diffutils file + libbsd libbsd-dev fts fts-dev libconfig-dev musl-dev bash diffutils \ + file $SUDO /bin/chown -R "$(id -u).$(id -g)" "${OS_ROOTDIR}" $SUDO /bin/chmod -R u+rw "${OS_ROOTDIR}" @@ -6974,10 +7210,12 @@ alpine316_build_fakechroot() if [ "$OS_ARCH" = "i386" ]; then #PROOT="$S_PROOT_DIR/proot-x86 -q qemu-i386" #PROOT="$S_PROOT_DIR/proot-x86" - PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86" elif [ "$OS_ARCH" = "x86_64" ]; then #PROOT="$S_PROOT_DIR/proot-x86_64" - PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86_64" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -7055,7 +7293,8 @@ alpine317_setup() --allow-untrusted \ --root ${OS_ROOTDIR} \ --initdb add alpine-base alpine-sdk bash libc-dev make autoconf m4 automake \ - libbsd libbsd-dev musl-fts musl-fts-dev libconfig-dev musl-dev bash diffutils file + libbsd libbsd-dev musl-fts musl-fts-dev libconfig-dev musl-dev bash \ + diffutils file set +x $SUDO /bin/chown -R "$(id -u).$(id -g)" "${OS_ROOTDIR}" @@ -7079,10 +7318,12 @@ alpine317_build_fakechroot() if [ "$OS_ARCH" = "i386" ]; then #PROOT="$S_PROOT_DIR/proot-x86 -q qemu-i386" #PROOT="$S_PROOT_DIR/proot-x86" - PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86" elif [ "$OS_ARCH" = "x86_64" ]; then #PROOT="$S_PROOT_DIR/proot-x86_64" - PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86_64" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -7160,7 +7401,8 @@ alpine318_setup() --allow-untrusted \ --root ${OS_ROOTDIR} \ --initdb add alpine-base alpine-sdk bash libc-dev make autoconf m4 automake \ - libbsd libbsd-dev musl-fts musl-fts-dev libconfig-dev musl-dev bash diffutils file + libbsd libbsd-dev musl-fts musl-fts-dev libconfig-dev musl-dev bash \ + diffutils file set +x $SUDO /bin/chown -R "$(id -u).$(id -g)" "${OS_ROOTDIR}" @@ -7184,10 +7426,12 @@ alpine318_build_fakechroot() if [ "$OS_ARCH" = "i386" ]; then #PROOT="$S_PROOT_DIR/proot-x86 -q qemu-i386" #PROOT="$S_PROOT_DIR/proot-x86" - PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86" elif [ "$OS_ARCH" = "x86_64" ]; then #PROOT="$S_PROOT_DIR/proot-x86_64" - PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86_64" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -7515,6 +7759,11 @@ create_package_tarball() return fi + if [ ! -f "${BUILD_DIR}/fakechroot-source-glibc-aarch64/libfakechroot-Rocky-8.so" ] ; then + echo "ERROR: failed to compile : ${BUILD_DIR}/fakechroot-source-glibc-aarch/libfakechroot-Rocky-8.so" + return + fi + if [ -n "$DEVEL3" ] ; then echo "$TARBALL_VERSION_P3" echo "$TARBALL_VERSION_P3" > "${PACKAGE_DIR}/udocker_dir/lib/VERSION" @@ -7622,6 +7871,9 @@ create_package_tarball() /bin/cp -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/COPYING" \ "${PACKAGE_DIR}/udocker_dir/doc/COPYING.fakechroot" + /bin/cp -f "${BUILD_DIR}/fakechroot-source-glibc-aarch64/libfakechroot-Rocky-8.so" \ + "${PACKAGE_DIR}/udocker_dir/lib/libfakechroot-Rocky-8-arm64.so" + /bin/cp -f "${BUILD_DIR}/runc-source-x86_64/runc" \ "${PACKAGE_DIR}/udocker_dir/bin/runc-x86_64" /bin/cp -f "${BUILD_DIR}/runc-source-x86_64/LICENSE" \ @@ -7683,7 +7935,7 @@ create_package_tarball() ln -s libfakechroot-Ubuntu-20-x86_64.so libfakechroot-LinuxMint-20-x86_64.so ; \ ln -s libfakechroot-Ubuntu-21-x86_64.so libfakechroot-LinuxMint-21-x86_64.so ; \ ln -s libfakechroot-Ubuntu-22-x86_64.so libfakechroot-LinuxMint-22-x86_64.so ; \ - ln -s libfakechroot-Ubuntu-22-x86_64.so libfakechroot-LinuxMint-23-x86_64.so ; \ + ln -s libfakechroot-Ubuntu-23-x86_64.so libfakechroot-LinuxMint-23-x86_64.so ; \ ln -s libfakechroot-Ubuntu-23-x86_64.so libfakechroot-LinuxMint-x86_64.so ; \ ln -s libfakechroot-Ubuntu-14-x86_64.so libfakechroot-Ubuntu-9-x86_64.so ; \ ln -s libfakechroot-Ubuntu-14-x86_64.so libfakechroot-Ubuntu-10-x86_64.so ; \ @@ -7729,6 +7981,7 @@ BUILD_DIR="${HOME}/udocker-englib-${TARBALL_VERSION_P3}" S_PROOT_DIR="${BUILD_DIR}/proot-static-build/static" S_PROOT_PACKAGES_DIR="${BUILD_DIR}/proot-static-build/packages" PACKAGE_DIR="${BUILD_DIR}/package" +TALLOC_TAR="$BUILD_DIR/libtalloc/talloc.tar.gz" if [ -n "$DEVEL3" ]; then TARBALL_FILE="${BUILD_DIR}/udocker-englib-${TARBALL_VERSION_P3}.tar.gz" @@ -7742,7 +7995,11 @@ fi # Prepare # ####### -get_proot_static +#get_proot_static + +get_udocker_build "1.2.10" + +get_libtalloc prepare_crun_source "${BUILD_DIR}/crun-source-x86_64" @@ -7754,7 +8011,7 @@ prepare_package ERASE # ####### prepare_proot_source "${BUILD_DIR}/proot-source-x86" # -fedora25_setup "i386" +#fedora25_setup "i386" fedora25_build_proot "i386" "${BUILD_DIR}/proot-source-x86" #ostree_delete "i386" "fedora" "25" # @@ -7962,10 +8219,21 @@ ubuntu23_build_runc "amd64" "${BUILD_DIR}/runc-source-x86_64" # aarch64 # ####### prepare_proot_source "${BUILD_DIR}/proot-source-aarch64" +#prepare_patchelf_source "${BUILD_DIR}/patchelf-source-aarch64" +prepare_fakechroot_glibc_source "${BUILD_DIR}/fakechroot-source-glibc-aarch64" # fedora31_setup "aarch64" fedora31_build_proot "aarch64" "${BUILD_DIR}/proot-source-aarch64" #ostree_delete "aarch64" "fedora" "31" +# +rocky8_setup "aarch64" +rocky8_build_fakechroot "aarch64" "${BUILD_DIR}/fakechroot-source-glibc-aarch64" +#ostree_delete "aarch64" "rocky" "8" +# +#rocky9_setup "aarch64" +#rocky9_build_fakechroot "aarch64" "${BUILD_DIR}/fakechroot-source-glibc-aarch64" +#ostree_delete "x86_64" "rocky" "9" + # ####### From f3f7150d657a94b688d1406f8dfb968c11423784 Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Tue, 20 Jun 2023 20:00:53 +0100 Subject: [PATCH 41/99] build for fakechroot lib on rocky arm64 --- utils/build_tarball.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/utils/build_tarball.sh b/utils/build_tarball.sh index ff1d6f74..0f34915c 100755 --- a/utils/build_tarball.sh +++ b/utils/build_tarball.sh @@ -4797,6 +4797,10 @@ rocky9_build_fakechroot() #PROOT="$S_PROOT_DIR/proot-x86_64" #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" PROOT="$S_PROOT_DIR/proot-x86_64" + elif [ "$OS_ARCH" = "aarch64" ]; then + #PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -5060,6 +5064,10 @@ alma9_build_fakechroot() #PROOT="$S_PROOT_DIR/proot-x86_64" #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" PROOT="$S_PROOT_DIR/proot-x86_64" + elif [ "$OS_ARCH" = "aarch64" ]; then + #PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -8230,8 +8238,8 @@ rocky8_setup "aarch64" rocky8_build_fakechroot "aarch64" "${BUILD_DIR}/fakechroot-source-glibc-aarch64" #ostree_delete "aarch64" "rocky" "8" # -#rocky9_setup "aarch64" -#rocky9_build_fakechroot "aarch64" "${BUILD_DIR}/fakechroot-source-glibc-aarch64" +rocky9_setup "aarch64" +rocky9_build_fakechroot "aarch64" "${BUILD_DIR}/fakechroot-source-glibc-aarch64" #ostree_delete "x86_64" "rocky" "9" From e45e792ed4e1daeb187e246ac908ef39e6c88d0a Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Tue, 20 Jun 2023 20:20:38 +0100 Subject: [PATCH 42/99] build for fakechroot lib on CentOS 7 arm64 --- utils/build_tarball.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/utils/build_tarball.sh b/utils/build_tarball.sh index 0f34915c..c0fbddfc 100755 --- a/utils/build_tarball.sh +++ b/utils/build_tarball.sh @@ -3561,6 +3561,10 @@ centos7_build_fakechroot() #PROOT="$S_PROOT_DIR/proot-x86_64" #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" PROOT="$S_PROOT_DIR/proot-x86_64" + elif [ "$OS_ARCH" = "aarch64" ]; then + #PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -8234,6 +8238,10 @@ fedora31_setup "aarch64" fedora31_build_proot "aarch64" "${BUILD_DIR}/proot-source-aarch64" #ostree_delete "aarch64" "fedora" "31" # +centos7_setup "aarch64" +centos7_build_fakechroot "aarch64" "${BUILD_DIR}/fakechroot-source-glibc-aarch64" +#ostree_delete "x86_64" "centos" "7" +# rocky8_setup "aarch64" rocky8_build_fakechroot "aarch64" "${BUILD_DIR}/fakechroot-source-glibc-aarch64" #ostree_delete "aarch64" "rocky" "8" From cee38b670a410372f10e2218ddf03e77fecd0f41 Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Tue, 20 Jun 2023 22:45:40 +0100 Subject: [PATCH 43/99] architecture fixes for nvidia support --- udocker/config.py | 4 ++-- udocker/engine/nvidia.py | 6 +++--- udocker/helper/archinfo.py | 13 +++++++++++-- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/udocker/config.py b/udocker/config.py index 2ae08ad1..d483024f 100644 --- a/udocker/config.py +++ b/udocker/config.py @@ -29,7 +29,7 @@ class Config(object): # udocker installation tarball the release is the minimum requirement # the actual tarball used in the installation can have a higher version - conf['tarball_release'] = "1.2.10" + conf['tarball_release'] = "1.2.9" conf['tarball'] = ( "https://download.ncg.ingrid.pt/" "webdav/udocker/udocker-englib-1.2.10.tar.gz" @@ -89,7 +89,7 @@ class Config(object): conf['fakechroot_expand_symlinks'] = None # sharable library directories - conf['lib_dirs_list_x86_64'] = ("/usr/lib/x86_64-linux-gnu", + conf['lib_dirs_list_nvidia'] = ("/usr/lib/x86_64-linux-gnu", "/usr/lib64",) # fakechroot sharable library directories diff --git a/udocker/engine/nvidia.py b/udocker/engine/nvidia.py index 4a84f573..7f598375 100644 --- a/udocker/engine/nvidia.py +++ b/udocker/engine/nvidia.py @@ -93,12 +93,12 @@ def _get_nvidia_libs(self, host_dir): Msg().out("Debug: List nvidia libs", lib_list, l=Msg.DBG) return lib_list - def _find_host_dir_ldconfig(self, arch="x86-64"): + def _find_host_dir_ldconfig(self, arch=""): """Find host nvidia libraries via ldconfig""" dir_list = set() ld_data = Uprocess().get_output(["ldconfig", "-p"]) if ld_data: - regexp = "[ |\t]%s[^ ]* .*%s.*=> (/.*)" + regexp = "[ |\t]%s[^ ]* .*%s => (/.*)" for line in ld_data.split('\n'): for lib in self._nvidia_main_libs: match = re.search(regexp % (lib, arch), line) @@ -122,7 +122,7 @@ def _find_host_dir_ldpath(self, library_path): def _find_host_dir(self): """Find the location of the host nvidia libraries""" dir_list = set() - library_path = ':'.join(Config.conf['lib_dirs_list_x86_64']) + library_path = ':'.join(Config.conf['lib_dirs_list_nvidia']) dir_list.update(self._find_host_dir_ldpath(library_path)) dir_list.update(self._find_host_dir_ldconfig()) library_path = os.getenv("LD_LIBRARY_PATH", "") diff --git a/udocker/helper/archinfo.py b/udocker/helper/archinfo.py index 05505a26..bfc06888 100644 --- a/udocker/helper/archinfo.py +++ b/udocker/helper/archinfo.py @@ -51,14 +51,23 @@ class ArchInfo(object): # host tools such as "readelf -h" and "file" _binaries_list = ["/lib64/ld-linux-x86-64.so", + "/lib64/ld-linux-x86-64.so.1", "/lib64/ld-linux-x86-64.so.2", "/lib64/ld-linux-x86-64.so.3", + "/lib64/ld-linux-aarch64.so", + "/lib64/ld-linux-aarch64.so.1", + "/lib64/ld-linux-aarch64.so.2", + "/lib64/ld-linux-aarch64.so.3", + "/lib64/ld64.so", "/lib64/ld64.so.1", + "/lib64/ld64.so.2", "/lib64/ld64.so.3", + "/usr/sbin/ldconfig", "/sbin/ldconfig", "/bin/bash", "/bin/sh", "/bin/zsh", "/bin/csh", "/bin/tcsh", "/bin/ash", "/bin/ls", "/bin/busybox", "/system/bin/sh", "/system/bin/ls", - "/lib/ld-linux.so", - "/lib/ld-linux.so.2", + "/lib/ld-linux.so", "/lib/ld-linux.so.1", + "/lib/ld-linux.so.2", "/lib/ld-linux.so.3", + "/usr/bin/coreutils", "/bin/coreutils", ] def get_binaries_list(self): From c2660f4779e74e2c60476e42d9da870a3585982a Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Tue, 20 Jun 2023 22:46:24 +0100 Subject: [PATCH 44/99] add match recursively --- udocker/utils/fileutil.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/udocker/utils/fileutil.py b/udocker/utils/fileutil.py index 0360a433..3b1ee8fa 100644 --- a/udocker/utils/fileutil.py +++ b/udocker/utils/fileutil.py @@ -685,3 +685,26 @@ def match(self): matching_files.append(directory + "/" + f_name) return matching_files + + def match_recursively(self, filetype='F'): + """Find matching file with wildcard matching expression""" + directory = os.path.dirname(self.filename) + matching_expression = os.path.basename(self.filename) + matching_files = [] + if not os.path.isdir(directory): + return [] + + for dir_path, dirs, files in os.walk(directory): + f_list = [] + if 'F' in filetype: + f_list += files + if 'D' in filetype: + f_list += dirs + for f_name in f_list: + f_path = dir_path + "/" + f_name + if os.path.islink(f_path) and 'L' not in filetype: + continue + if re.match(matching_expression, f_name): + matching_files.append(f_path) + + return matching_files From a8e6a486737e807d761c672e1e90034aa08c510a Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Wed, 21 Jun 2023 00:23:37 +0100 Subject: [PATCH 45/99] add support for FAKECHROOT_LIBC --- udocker/config.py | 17 +++++++++++++---- udocker/engine/fakechroot.py | 30 ++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 4 deletions(-) diff --git a/udocker/config.py b/udocker/config.py index d483024f..5f454b7e 100644 --- a/udocker/config.py +++ b/udocker/config.py @@ -57,7 +57,7 @@ class Config(object): "/etc/resolv.conf", "/etc/host.conf", "/lib/modules", ) - # POSSIBLE DEPRECATED + # DEPRECATED # directories to be mapped in containers with: run --hostauth # conf['hostauth_list'] = ("/etc/passwd", "/etc/group", # "/etc/shadow", "/etc/gshadow", ) @@ -85,12 +85,19 @@ class Config(object): # conf['fakechroot_so'] = "libfakechroot-CentOS-7-x86_64.so" conf['fakechroot_so'] = None - # translate symbolic links in pathnames None means automatic + # translate symbolic links into pathnames None means automatic conf['fakechroot_expand_symlinks'] = None + # patterns to search for libc.so for bypass in fakechroot + conf['libc_search'] = ("/lib64/libc.so.[0-9]+", "/usr/lib64/libc.so.[0-9]+", + "/lib/libc.so.[0-9]+", "/usr/lib/libc.so.[0-9]+", + "/usr/libc.so.[0-9]+", "/libc.so.[0-9]+", "/libc.so",) + + # override the above search for libc with a specified relative pathname + conf['fakechroot_libc'] = None + # sharable library directories - conf['lib_dirs_list_nvidia'] = ("/usr/lib/x86_64-linux-gnu", - "/usr/lib64",) + conf['lib_dirs_list_nvidia'] = ("/usr/lib/x86_64-linux-gnu", "/usr/lib64",) # fakechroot sharable library directories conf['lib_dirs_list_essential'] = ("/lib/x86_64-linux-gnu", @@ -237,6 +244,8 @@ def _env_override(self): Config.conf['default_execution_mode']) Config.conf['fakechroot_so'] = \ os.getenv("UDOCKER_FAKECHROOT_SO", Config.conf['fakechroot_so']) + Config.conf['fakechroot_libc'] = \ + os.getenv("UDOCKER_FAKECHROOT_LIBC", Config.conf['fakechroot_libc']) Config.conf['tmpdir'] = os.getenv("UDOCKER_TMP", Config.conf['tmpdir']) Config.conf['keystore'] = \ os.getenv("UDOCKER_KEYSTORE", Config.conf['keystore']) diff --git a/udocker/engine/fakechroot.py b/udocker/engine/fakechroot.py index 382c922b..22ca9957 100644 --- a/udocker/engine/fakechroot.py +++ b/udocker/engine/fakechroot.py @@ -67,6 +67,31 @@ def select_fakechroot_so(self): Msg().out("Debug: fakechroot_so:", fakechroot_so, l=Msg.DBG) return fakechroot_so + def _get_libc_pathname(self): + """Get the pathname of libc in the container""" + if Config.conf['fakechroot_libc']: + return Config.conf['fakechroot_libc'] + + libc_search_list = [] + if Config.conf['libc_search']: + if isinstance(Config.conf['libc_search'], list): + libc_search_list = Config.conf['libc_search'] + elif isinstance(Config.conf['libc_search'], tuple): + libc_search_list = Config.conf['libc_search'] + elif is_genstr(Config.conf['libc_search']): + libc_search_list = [Config.conf['libc_search'], ] + + for libc_pattern in libc_search_list: + libc_matches = \ + FileUtil(self.container_root + "/" + libc_pattern).match_recursive() + for libc_abs_path in libc_matches: + libc_relative_path = libc_abs_path[len(self.container_root):] + (dummy, filetype) = \ + OSInfo(self.container_root).get_filetype(libc_relative_path) + if "ELF" in filetype and "dynamic" in filetype: + return libc_relative_path + return "" + def _setup_container_user(self, user): """Override of _setup_container_user()""" return self._setup_container_user_noroot(user) @@ -122,10 +147,12 @@ def _fakechroot_env_set(self): (host_volumes, map_volumes) = self._get_volume_bindings() self._fakechroot_so = self.select_fakechroot_so() access_filesok = self._get_access_filesok() + fakechroot_libc = self._get_libc_pathname() self.opt["env"].append("PWD=" + self.opt["cwd"]) self.opt["env"].append("FAKECHROOT_BASE=" + os.path.realpath(self.container_root)) self.opt["env"].append("LD_PRELOAD=" + self._fakechroot_so) + if Config.conf['fakechroot_expand_symlinks'] is None: self.opt["env"].append("FAKECHROOT_EXPAND_SYMLINKS=" + str(self._recommend_expand_symlinks).lower()) @@ -133,6 +160,9 @@ def _fakechroot_env_set(self): self.opt["env"].append("FAKECHROOT_EXPAND_SYMLINKS=" + str(Config.conf['fakechroot_expand_symlinks']).lower()) + if fakechroot_libc: + self.opt["env"].append("FAKECHROOT_LIBC=" + fakechroot_libc) + if not self._is_volume("/tmp"): self.opt["env"].append("FAKECHROOT_AF_UNIX_PATH=" + Config.conf['tmpdir']) From 0bcf4ae9da9ad226a61274e4e086c08e41a6172f Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Wed, 21 Jun 2023 00:25:10 +0100 Subject: [PATCH 46/99] parse symbolic links by default in match_recursive --- udocker/utils/fileutil.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/udocker/utils/fileutil.py b/udocker/utils/fileutil.py index 3b1ee8fa..2614f41f 100644 --- a/udocker/utils/fileutil.py +++ b/udocker/utils/fileutil.py @@ -673,7 +673,7 @@ def links_conv(self, force=False, to_container=True, orig_path=""): return links def match(self): - """Find matching file with wildcard matching expression""" + """Find file with wildcard matching expression""" directory = os.path.dirname(self.filename) matching_expression = os.path.basename(self.filename) matching_files = [] @@ -686,8 +686,8 @@ def match(self): return matching_files - def match_recursively(self, filetype='F'): - """Find matching file with wildcard matching expression""" + def match_recursive(self, filetype='FL'): + """Recursively find file with wildcard matching expression""" directory = os.path.dirname(self.filename) matching_expression = os.path.basename(self.filename) matching_files = [] From 4eecee395577223a3e1f46260816d0d63a8d1d8e Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Wed, 21 Jun 2023 00:27:59 +0100 Subject: [PATCH 47/99] build for fakechroot lib on fedora38 arm64 --- utils/build_tarball.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/utils/build_tarball.sh b/utils/build_tarball.sh index c0fbddfc..7b9eb95b 100755 --- a/utils/build_tarball.sh +++ b/utils/build_tarball.sh @@ -3200,6 +3200,10 @@ fedora38_build_fakechroot() #PROOT="$S_PROOT_DIR/proot-x86_64" #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" PROOT="$S_PROOT_DIR/proot-x86_64" + elif [ "$OS_ARCH" = "aarch64" ]; then + #PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -8238,6 +8242,10 @@ fedora31_setup "aarch64" fedora31_build_proot "aarch64" "${BUILD_DIR}/proot-source-aarch64" #ostree_delete "aarch64" "fedora" "31" # +fedora38_setup "aarch64" +fedora38_build_fakechroot "aarch64" "${BUILD_DIR}/fakechroot-source-glibc-aarch64" +#ostree_delete "aarch64" "fedora" "38" +# centos7_setup "aarch64" centos7_build_fakechroot "aarch64" "${BUILD_DIR}/fakechroot-source-glibc-aarch64" #ostree_delete "x86_64" "centos" "7" From c6e5163b35f93045676af1e62fcf54ebaa4bc3c7 Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Wed, 21 Jun 2023 16:05:18 +0100 Subject: [PATCH 48/99] search first for apptainer then for singularity --- udocker/engine/singularity.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/udocker/engine/singularity.py b/udocker/engine/singularity.py index dd9bd32d..249f1396 100644 --- a/udocker/engine/singularity.py +++ b/udocker/engine/singularity.py @@ -31,19 +31,22 @@ def __init__(self, localrepo, exec_mode): def select_singularity(self): """Set singularity executable and related variables""" self.executable = Config.conf['use_singularity_executable'] - if self.executable != "UDOCKER" and not self.executable: + if not self.executable: + self.executable = FileUtil("apptainer").find_exec() + if not self.executable: self.executable = FileUtil("singularity").find_exec() if self.executable == "UDOCKER" or not self.executable: self.executable = "" arch = HostInfo().arch() - image_list = ["singularity-%s" % (arch), "singularity"] + image_list = ["apptainer-%s" % (arch), "apptainer", + "singularity-%s" % (arch), "singularity"] f_util = FileUtil(self.localrepo.bindir) self.executable = f_util.find_file_in_dir(image_list) if not os.path.exists(self.executable): - Msg().err("Error: singularity executable not found") + Msg().err("Error: apptainer/singularity executable not found") sys.exit(1) def _get_volume_bindings(self): From 0c7a3405420aecece5823f49a2dfc0e416b54b67 Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Wed, 21 Jun 2023 16:06:19 +0100 Subject: [PATCH 49/99] search patterns for fakechroot_libc --- udocker/config.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/udocker/config.py b/udocker/config.py index 5f454b7e..bf06f988 100644 --- a/udocker/config.py +++ b/udocker/config.py @@ -89,9 +89,9 @@ class Config(object): conf['fakechroot_expand_symlinks'] = None # patterns to search for libc.so for bypass in fakechroot - conf['libc_search'] = ("/lib64/libc.so.[0-9]+", "/usr/lib64/libc.so.[0-9]+", - "/lib/libc.so.[0-9]+", "/usr/lib/libc.so.[0-9]+", - "/usr/libc.so.[0-9]+", "/libc.so.[0-9]+", "/libc.so",) + conf['libc_search'] = ("/lib64/libc.so.[0-9]", "/usr/lib64/libc.so.[0-9]", + "/usr/lib/libc.so.[0-9]", "/lib/libc.so.[0-9]", + "/usr/libc.so.[0-9]", "/libc.so.[0-9]", "/libc.so",) # override the above search for libc with a specified relative pathname conf['fakechroot_libc'] = None From 9e6a52943c6bc267f54d8f2138c5a60b6d85b338 Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Wed, 21 Jun 2023 16:37:42 +0100 Subject: [PATCH 50/99] updated CHANGELOG --- CHANGELOG.md | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 43247dee..3de39531 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,9 +2,24 @@ ## udocker (1.3.10) -* improved handling and mapping of architecture information -* added support for qemu on Pn modes enabling execution of - containers with architectures different than the host +* improved handling of container platform information +* added support for QEMU on Pn modes enabling execution of containers + with architectures different than the host +* added support for QEMU on Fn modes enabling execution of containers + with architectures different than the host +* selection of executable for Sn mode now defaults to apptainer and + in second place to singularity +* the new command "manifest inspect" allows display of image manifests + therefore enabling access to the catalogue of platforms supported by + a given image +* the new command "tag" enables changing the name of an existing image +* the udocker tools support for Fn now includes Ubuntu 23:04, Fedora 38, + Alpine 3.17 and 3.18. +* limited Support for native Fn execution on arm64 for Fedora 36, + Fedora 37, Fedora 38, CentOS 7, AlmaLinux 8, AlmaLinux 9 and similar. +* limited Support for native Fn execution on ppc64le for CentOS 7, + AlmaLinux 8, AlmaLinux 9 and similar. +* updated version of Pn engine for x86, x86_64 and arm64. ## udocker (1.3.9) From c943ab189f21cb38144f745da631e269a444a847 Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Wed, 21 Jun 2023 22:41:09 +0100 Subject: [PATCH 51/99] adjust pattern for ppc64le identification --- udocker/helper/archinfo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/udocker/helper/archinfo.py b/udocker/helper/archinfo.py index bfc06888..ff6798cb 100644 --- a/udocker/helper/archinfo.py +++ b/udocker/helper/archinfo.py @@ -19,7 +19,7 @@ class ArchInfo(object): {'docker':['arm'], 'qemu':['arm'], 'UDOCKER':['arm'], 'uname':['arm'], 'file':[' ARM'], 'readelf':[' ARM']}, {'docker':['ppc64le'], 'qemu':['ppc64le'], 'UDOCKER':['ppc64le'], - 'uname':['ppc64le'], 'file':['64-bit PowerPC', 'LSB executable'], + 'uname':['ppc64le'], 'file':['64-bit PowerPC', 'LSB'], 'readelf':['PowerPC64', 'little endian']}, {'docker':['ppc64'], 'qemu':['ppc64'], 'UDOCKER':['ppc64'], 'uname':['ppc64'], 'file':['PowerPC', '64-bit'], From f069e1650e0490ae2efeb666909149c5f32af08d Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Wed, 21 Jun 2023 22:42:11 +0100 Subject: [PATCH 52/99] build_tarball for udocker tools 1.2.10 --- utils/build_tarball.sh | 2071 ++++++++++++++++++++++++---------------- 1 file changed, 1272 insertions(+), 799 deletions(-) diff --git a/utils/build_tarball.sh b/utils/build_tarball.sh index 7b9eb95b..8071fbc4 100755 --- a/utils/build_tarball.sh +++ b/utils/build_tarball.sh @@ -26,7 +26,7 @@ # This script produces the following udocker-englib tarball -DEVEL3=$(realpath "$0" | egrep "devel3|devel4") +DEVEL3=$(realpath "$0" | grep -E "devel3|devel4") TARBALL_VERSION_P3="1.2.10" TARBALL_VERSION_P2="1.1.10" @@ -53,7 +53,7 @@ sanity_check() get_proot_static() { echo "get_proot_static" - cd "$BUILD_DIR" + cd "$BUILD_DIR" || exit 1 if [ -d "$BUILD_DIR/proot-static-build/static" ] ; then echo "proot static already exists: $BUILD_DIR/proot-static-build" @@ -61,15 +61,15 @@ get_proot_static() fi git clone --depth=1 --branch v5.1.1 https://github.com/proot-me/proot-static-build - /bin/rm -Rf $BUILD_DIR/proot-static-build/.git + /bin/rm -Rf "$BUILD_DIR/proot-static-build/.git" } -get_udocker_build() +get_udocker_static() { local BUILD_VERSION="$1" echo "get_udocker_tools" - cd "$BUILD_DIR" + cd "$BUILD_DIR" || exit 1 if [ -d "$BUILD_DIR/proot-static-build/static" ] ; then echo "udocker build directory already exists: $BUILD_DIR/proot-static-build" @@ -110,7 +110,7 @@ prepare_proot_source() { echo "prepare_proot_source : $1" local PROOT_SOURCE_DIR="$1" - cd "$BUILD_DIR" + cd "$BUILD_DIR" || exit 1 if [ -d "$PROOT_SOURCE_DIR" ] ; then echo "proot source already exists: $PROOT_SOURCE_DIR" @@ -140,7 +140,7 @@ prepare_patchelf_source() { echo "prepare_patchelf_source : $1" local PATCHELF_SOURCE_DIR="$1" - cd "$BUILD_DIR" + cd "$BUILD_DIR" || exit 1 if [ -d "$PATCHELF_SOURCE_DIR" ] ; then echo "patchelf source already exists: $PATCHELF_SOURCE_DIR" @@ -149,7 +149,7 @@ prepare_patchelf_source() #git clone --depth=1 --branch=0.9 https://github.com/NixOS/patchelf.git git clone --branch udocker-1 --depth=1 https://github.com/jorge-lip/patchelf-udocker.git - /bin/rm -Rf $BUILD_DIR/patchelf-udocker/.git + /bin/rm -Rf "$BUILD_DIR/patchelf-udocker/.git" /bin/mv patchelf-udocker "$PATCHELF_SOURCE_DIR" } @@ -157,7 +157,7 @@ prepare_fakechroot_glibc_source() { echo "prepare_fakechroot_glibc_source : $1" local FAKECHROOT_SOURCE_DIR="$1" - cd "$BUILD_DIR" + cd "$BUILD_DIR" || exit 1 if [ -d "$FAKECHROOT_SOURCE_DIR" ] ; then echo "fakechroot source already exists: $FAKECHROOT_SOURCE_DIR" @@ -167,7 +167,7 @@ prepare_fakechroot_glibc_source() #git clone --depth=1 --branch 2.18 https://github.com/dex4er/fakechroot.git git clone --branch udocker-3 --depth=1 \ https://github.com/jorge-lip/libfakechroot-glibc-udocker.git - /bin/rm -Rf $BUILD_DIR/libfakechroot-glibc-udocker/.git + /bin/rm -Rf "$BUILD_DIR/libfakechroot-glibc-udocker/.git" /bin/mv libfakechroot-glibc-udocker "$FAKECHROOT_SOURCE_DIR" } @@ -175,7 +175,7 @@ prepare_fakechroot_musl_source() { echo "prepare_fakechroot_musl_source : $1" local FAKECHROOT_SOURCE_DIR="$1" - cd "$BUILD_DIR" + cd "$BUILD_DIR" || exit 1 if [ -d "$FAKECHROOT_SOURCE_DIR" ] ; then echo "fakechroot source already exists: $FAKECHROOT_SOURCE_DIR" @@ -185,7 +185,7 @@ prepare_fakechroot_musl_source() #git clone --depth=1 --branch 2.18 https://github.com/dex4er/fakechroot.git git clone --branch udocker-1 --depth=1 \ https://github.com/jorge-lip/libfakechroot-musl-udocker.git - /bin/rm -Rf $BUILD_DIR/libfakechroot-musl-udocker/.git + /bin/rm -Rf "$BUILD_DIR/libfakechroot-musl-udocker/.git" /bin/mv libfakechroot-musl-udocker "$FAKECHROOT_SOURCE_DIR" } @@ -193,7 +193,7 @@ prepare_runc_source() { echo "prepare_runc_source : $1" local RUNC_SOURCE_DIR="$1" - cd "$BUILD_DIR" + cd "$BUILD_DIR" || exit 1 #/bin/rm -Rf $RUNC_SOURCE_DIR if [ -d "$RUNC_SOURCE_DIR" ] ; then @@ -211,7 +211,7 @@ prepare_crun_source() { echo "prepare_crun_source : $1" local CRUN_SOURCE_DIR="$1" - cd "$BUILD_DIR" + cd "$BUILD_DIR" || exit 1 if [ -d "$CRUN_SOURCE_DIR" ] ; then echo "crun source already exists: $CRUN_SOURCE_DIR" @@ -237,12 +237,12 @@ prepare_crun_source() prepare_package() { echo "prepare_package" - cd "$BUILD_DIR" + cd "$BUILD_DIR" || exit 1 if [ "$1" = "ERASE" ] ; then - /bin/rm -f ${PACKAGE_DIR}/udocker_dir/bin/* - /bin/rm -f ${PACKAGE_DIR}/udocker_dir/lib/* - /bin/rm -f ${PACKAGE_DIR}/udocker_dir/doc/* - /bin/rm -f ${PACKAGE_DIR}/udocker_dir/* + /bin/rm -f "${PACKAGE_DIR}"/udocker_dir/bin/* + /bin/rm -f "${PACKAGE_DIR}"/udocker_dir/lib/* + /bin/rm -f "${PACKAGE_DIR}"/udocker_dir/doc/* + /bin/rm -f "${PACKAGE_DIR}"/udocker_dir/* fi if [ ! -d "${PACKAGE_DIR}" ] ; then /bin/mkdir -p "${PACKAGE_DIR}" @@ -257,7 +257,7 @@ addto_package_udocker() if [ -z "$DEVEL3" ]; then echo "addto_package_udocker: add udocker for Python2" /bin/cp -f -L "${REPO_DIR}/udocker.py" "${PACKAGE_DIR}/udocker" - (cd ${PACKAGE_DIR}; /bin/ln -s udocker udocker.py) + (cd "${PACKAGE_DIR}"; /bin/ln -s udocker udocker.py) else /bin/rm -f "${PACKAGE_DIR}/udocker" /bin/rm -f "${PACKAGE_DIR}/udocker.py" @@ -267,7 +267,7 @@ addto_package_udocker() addto_package_simplejson() { echo "addto_package_simplejson" - cd "${PACKAGE_DIR}/udocker_dir/lib" + cd "${PACKAGE_DIR}/udocker_dir/lib" || exit 1 if [ -d "simplejson" ] ; then echo "simplejson already exists: $PACKAGE_DIR/simplejson" @@ -297,8 +297,8 @@ addto_package_other() #/bin/cp -f "${S_PROOT_DIR}/proot-x86" "${PACKAGE_DIR}/udocker_dir/bin/" #/bin/cp -f "${S_PROOT_DIR}/proot-x86_64" "${PACKAGE_DIR}/udocker_dir/bin/" - /bin/cp -f "${S_PROOT_DIR}/proot-arm" "${PACKAGE_DIR}/udocker_dir/bin/" - /bin/cp -f "${S_PROOT_DIR}/proot-arm64" "${PACKAGE_DIR}/udocker_dir/bin/" + /bin/cp -f "${S_PROOT_DIR}/proot-arm" "${PACKAGE_DIR}/udocker_dir/bin/" + #/bin/cp -f "${S_PROOT_DIR}/proot-arm64" "${PACKAGE_DIR}/udocker_dir/bin/" } # ############################################################################# @@ -355,16 +355,14 @@ fedora25_setup() $SUDO /usr/bin/dnf -y -c "${OS_ROOTDIR}/etc/dnf/dnf.conf" \ install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" \ - --forcearch="$OS_ARCH" \ - gcc kernel-devel make libtalloc libtalloc-devel glibc-static \ - glibc-devel tar python gzip zlib diffutils file dnf which + --forcearch="$OS_ARCH" \ + gcc kernel-devel make libtalloc libtalloc-devel glibc-static \ + glibc-devel tar python gzip zlib diffutils file dnf which - if [ "$OS_ARCH" = "x86_64" -o "$OS_ARCH" = "aarch64" -o "$OS_ARCH" = "arm" ]; then - $SUDO /usr/bin/dnf -y -c "${OS_ROOTDIR}/etc/dnf/dnf.conf" \ - install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" \ - --forcearch="$OS_ARCH" \ - autoconf m4 gcc-c++ libstdc++-static automake gawk libtool - fi + $SUDO /usr/bin/dnf -y -c "${OS_ROOTDIR}/etc/dnf/dnf.conf" \ + install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" \ + --forcearch="$OS_ARCH" \ + autoconf m4 gcc-c++ libstdc++-static automake gawk libtool $SUDO /usr/bin/dnf -y -c "${OS_ROOTDIR}/etc/dnf/dnf.conf" \ clean packages @@ -467,7 +465,7 @@ fedora25_build_patchelf() # compile patchelf set -xv - (cd ${PATCHELF_SOURCE_DIR} ; bash ./bootstrap.sh) + (cd "${PATCHELF_SOURCE_DIR}" ; bash ./bootstrap.sh) $PROOT -r "$OS_ROOTDIR" -b "${PATCHELF_SOURCE_DIR}:/patchelf" -w / -b /dev \ /bin/bash <<'EOF_fedora25_patchelf' cd /patchelf @@ -609,14 +607,13 @@ fedora29_setup() $SUDO /usr/bin/dnf -y -c "${OS_ROOTDIR}/etc/dnf/dnf.conf" \ install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" --forcearch="$OS_ARCH" \ - gcc kernel-devel make libtalloc libtalloc-devel glibc-static glibc-devel tar python \ - python2 gzip zlib diffutils file dnf which + gcc kernel-devel make libtalloc libtalloc-devel glibc-static glibc-devel tar python \ + python2 gzip zlib diffutils file dnf which + + $SUDO /usr/bin/dnf -y -c "${OS_ROOTDIR}/etc/dnf/dnf.conf" \ + install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" --forcearch="$OS_ARCH" \ + autoconf m4 gcc-c++ libstdc++-static automake gawk libtool - if [ "$OS_ARCH" = "x86_64" ]; then - $SUDO /usr/bin/dnf -y -c "${OS_ROOTDIR}/etc/dnf/dnf.conf" \ - install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" --forcearch="$OS_ARCH" \ - autoconf m4 gcc-c++ libstdc++-static automake gawk libtool - fi if [ "$OS_ARCH" = "aarch64" ]; then #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-25.bin -q qemu-aarch64" PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" @@ -727,7 +724,7 @@ fedora29_build_patchelf() # compile patchelf set -xv - (cd ${PATCHELF_SOURCE_DIR} ; bash ./bootstrap.sh) + (cd "${PATCHELF_SOURCE_DIR}" ; bash ./bootstrap.sh) $PROOT -r "$OS_ROOTDIR" -b "${PATCHELF_SOURCE_DIR}:/patchelf" -w / -b /dev \ /bin/bash <<'EOF_fedora29_patchelf' cd /patchelf @@ -868,21 +865,19 @@ fedora30_setup() $SUDO /usr/bin/dnf -y -c "${OS_ROOTDIR}/etc/dnf/dnf.conf" \ install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" \ - --forcearch="$OS_ARCH" \ - gcc kernel-devel make libtalloc libtalloc-devel glibc-static glibc-devel \ - tar python python2 gzip zlib diffutils file dnf which + --forcearch="$OS_ARCH" \ + gcc kernel-devel make libtalloc libtalloc-devel glibc-static glibc-devel \ + tar python python2 gzip zlib diffutils file dnf which $SUDO /usr/bin/dnf -y -c "${OS_ROOTDIR}/etc/dnf/dnf.conf" \ downgrade --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" \ - --forcearch="$OS_ARCH" \ - coreutils-8.31-1.fc30.x86_64 coreutils-common-8.31-1.fc30.x86_64 + --forcearch="$OS_ARCH" \ + coreutils-8.31-1.fc30.x86_64 coreutils-common-8.31-1.fc30.x86_64 - if [ "$OS_ARCH" = "x86_64" -o "$OS_ARCH" = "aarch64" ]; then - $SUDO /usr/bin/dnf -y -c "${OS_ROOTDIR}/etc/dnf/dnf.conf" \ - install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" \ - --forcearch="$OS_ARCH" \ - autoconf m4 gcc-c++ libstdc++-static automake gawk libtool - fi + $SUDO /usr/bin/dnf -y -c "${OS_ROOTDIR}/etc/dnf/dnf.conf" \ + install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" \ + --forcearch="$OS_ARCH" \ + autoconf m4 gcc-c++ libstdc++-static automake gawk libtool $SUDO /usr/bin/dnf -y -c "${OS_ROOTDIR}/etc/dnf/dnf.conf" \ clean packages @@ -989,7 +984,7 @@ fedora30_build_patchelf() # compile patchelf set -xv - (cd ${PATCHELF_SOURCE_DIR} ; bash ./bootstrap.sh) + (cd "${PATCHELF_SOURCE_DIR}" ; bash ./bootstrap.sh) $PROOT -r "$OS_ROOTDIR" -b "${PATCHELF_SOURCE_DIR}:/patchelf" -w / -b /dev \ /bin/bash <<'EOF_fedora30_patchelf' cd /patchelf @@ -1132,23 +1127,21 @@ fedora31_setup() $SUDO /usr/bin/dnf -y -c "${OS_ROOTDIR}/etc/dnf/dnf.conf" \ install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" \ - --forcearch="$OS_ARCH" \ - gcc kernel-devel make libtalloc libtalloc-devel glibc-static glibc-devel tar python \ - python2 gzip zlib diffutils file glibc-headers dnf git which + --forcearch="$OS_ARCH" \ + gcc kernel-devel make libtalloc libtalloc-devel glibc-static glibc-devel tar python \ + python2 gzip zlib diffutils file glibc-headers dnf git which #$SUDO /usr/bin/dnf -y -c "${OS_ROOTDIR}/etc/dnf/dnf.conf" \ # downgrade --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" --forcearch="$OS_ARCH" \ # coreutils-8.31-1.fc31.x86_64 coreutils-common-8.31-1.fc31.x86_64 - if [ "$OS_ARCH" = "x86_64" -o "$OS_ARCH" = "aarch64" ]; then - $SUDO /usr/bin/dnf -y -c "${OS_ROOTDIR}/etc/dnf/dnf.conf" \ - install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" --forcearch="$OS_ARCH" \ - --forcearch="$OS_ARCH" \ - autoconf m4 gcc-c++ libstdc++-static automake gawk libtool xz - fi + $SUDO /usr/bin/dnf -y -c "${OS_ROOTDIR}/etc/dnf/dnf.conf" \ + install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" --forcearch="$OS_ARCH" \ + --forcearch="$OS_ARCH" \ + autoconf m4 gcc-c++ libstdc++-static automake gawk libtool xz if [ "$OS_ARCH" = "aarch64" ]; then - $SUDO chown -R $(id -u):$(id -g) "$OS_ROOTDIR" + $SUDO chown -R "$(id -u):$(id -g)" "$OS_ROOTDIR" #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" export PROOT_NO_SECCOMP=1 @@ -1255,6 +1248,12 @@ fedora31_build_patchelf() #PROOT="$S_PROOT_DIR/proot-x86_64" #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" PROOT="$S_PROOT_DIR/proot-x86_64" + elif [ "$OS_ARCH" = "aarch64" ]; then + #PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + elif [ "$OS_ARCH" = "ppc64le" ]; then + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-ppc64le" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -1269,7 +1268,7 @@ fedora31_build_patchelf() # compile patchelf set -xv - (cd ${PATCHELF_SOURCE_DIR} ; bash ./bootstrap.sh) + (cd "${PATCHELF_SOURCE_DIR}" ; bash ./bootstrap.sh) $PROOT -r "$OS_ROOTDIR" -b "${PATCHELF_SOURCE_DIR}:/patchelf" -w / -b /dev \ /bin/bash <<'EOF_fedora31_patchelf' cd /patchelf @@ -1302,6 +1301,12 @@ fedora31_build_fakechroot() #PROOT="$S_PROOT_DIR/proot-x86_64" #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" PROOT="$S_PROOT_DIR/proot-x86_64" + elif [ "$OS_ARCH" = "aarch64" ]; then + #PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + elif [ "$OS_ARCH" = "ppc64le" ]; then + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-ppc64le" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -1418,14 +1423,12 @@ fedora32_setup() # downgrade --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" --forcearch="$OS_ARCH" \ # coreutils-8.31-1.fc31.x86_64 coreutils-common-8.31-1.fc31.x86_64 - if [ "$OS_ARCH" = "x86_64" ]; then - $SUDO /usr/bin/dnf -y -c "${OS_ROOTDIR}/etc/dnf/dnf.conf" \ - install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" --forcearch="$OS_ARCH" \ - autoconf m4 gcc-c++ libstdc++-static automake gawk libtool - fi + $SUDO /usr/bin/dnf -y -c "${OS_ROOTDIR}/etc/dnf/dnf.conf" \ + install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" --forcearch="$OS_ARCH" \ + autoconf m4 gcc-c++ libstdc++-static automake gawk libtool if [ "$OS_ARCH" = "aarch64" ]; then - $SUDO chown -R $(id -u):$(id -g) "$OS_ROOTDIR" + $SUDO chown -R "$(id -u):$(id -g)" "$OS_ROOTDIR" #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" export PROOT_NO_SECCOMP=1 @@ -1532,6 +1535,12 @@ fedora32_build_patchelf() #PROOT="$S_PROOT_DIR/proot-x86_64" #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" PROOT="$S_PROOT_DIR/proot-x86_64" + elif [ "$OS_ARCH" = "aarch64" ]; then + #PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + elif [ "$OS_ARCH" = "ppc64le" ]; then + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-ppc64le" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -1546,7 +1555,7 @@ fedora32_build_patchelf() # compile patchelf set -xv - (cd ${PATCHELF_SOURCE_DIR} ; bash ./bootstrap.sh) + (cd "${PATCHELF_SOURCE_DIR}" ; bash ./bootstrap.sh) $PROOT -r "$OS_ROOTDIR" -b "${PATCHELF_SOURCE_DIR}:/patchelf" -w / -b /dev \ /bin/bash <<'EOF_fedora32_patchelf' cd /patchelf @@ -1579,6 +1588,12 @@ fedora32_build_fakechroot() #PROOT="$S_PROOT_DIR/proot-x86_64" #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" PROOT="$S_PROOT_DIR/proot-x86_64" + elif [ "$OS_ARCH" = "aarch64" ]; then + #PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + elif [ "$OS_ARCH" = "ppc64le" ]; then + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-ppc64le" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -1695,14 +1710,12 @@ fedora33_setup() # downgrade --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" --forcearch="$OS_ARCH" \ # coreutils-8.31-1.fc31.x86_64 coreutils-common-8.31-1.fc31.x86_64 - if [ "$OS_ARCH" = "x86_64" ]; then - $SUDO /usr/bin/dnf -y -c "${OS_ROOTDIR}/etc/dnf/dnf.conf" \ - install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" --forcearch="$OS_ARCH" \ - autoconf m4 gcc-c++ libstdc++-static automake gawk libtool - fi + $SUDO /usr/bin/dnf -y -c "${OS_ROOTDIR}/etc/dnf/dnf.conf" \ + install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" --forcearch="$OS_ARCH" \ + autoconf m4 gcc-c++ libstdc++-static automake gawk libtool if [ "$OS_ARCH" = "aarch64" ]; then - $SUDO chown -R $(id -u):$(id -g) "$OS_ROOTDIR" + $SUDO chown -R "$(id -u):$(id -g)" "$OS_ROOTDIR" #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" export PROOT_NO_SECCOMP=1 @@ -1809,6 +1822,12 @@ fedora33_build_patchelf() #PROOT="$S_PROOT_DIR/proot-x86_64" #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" PROOT="$S_PROOT_DIR/proot-x86_64" + elif [ "$OS_ARCH" = "aarch64" ]; then + #PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + elif [ "$OS_ARCH" = "ppc64le" ]; then + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-ppc64le" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -1823,7 +1842,7 @@ fedora33_build_patchelf() # compile patchelf set -xv - (cd ${PATCHELF_SOURCE_DIR} ; bash ./bootstrap.sh) + (cd "${PATCHELF_SOURCE_DIR}" ; bash ./bootstrap.sh) $PROOT -r "$OS_ROOTDIR" -b "${PATCHELF_SOURCE_DIR}:/patchelf" -w / -b /dev \ /bin/bash <<'EOF_fedora33_patchelf' cd /patchelf @@ -1856,6 +1875,12 @@ fedora33_build_fakechroot() #PROOT="$S_PROOT_DIR/proot-x86_64" #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" PROOT="$S_PROOT_DIR/proot-x86_64" + elif [ "$OS_ARCH" = "aarch64" ]; then + #PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + elif [ "$OS_ARCH" = "ppc64le" ]; then + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-ppc64le" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -1972,14 +1997,12 @@ fedora34_setup() # downgrade --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" --forcearch="$OS_ARCH" \ # coreutils-8.31-1.fc31.x86_64 coreutils-common-8.31-1.fc31.x86_64 - if [ "$OS_ARCH" = "x86_64" ]; then - $SUDO /usr/bin/dnf -y -c "${OS_ROOTDIR}/etc/dnf/dnf.conf" \ - install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" --forcearch="$OS_ARCH" \ - autoconf m4 gcc-c++ libstdc++-static automake gawk libtool - fi + $SUDO /usr/bin/dnf -y -c "${OS_ROOTDIR}/etc/dnf/dnf.conf" \ + install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" --forcearch="$OS_ARCH" \ + autoconf m4 gcc-c++ libstdc++-static automake gawk libtool if [ "$OS_ARCH" = "aarch64" ]; then - $SUDO chown -R $(id -u):$(id -g) "$OS_ROOTDIR" + $SUDO chown -R "$(id -u):$(id -g)" "$OS_ROOTDIR" #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" export PROOT_NO_SECCOMP=1 @@ -2013,7 +2036,7 @@ fedora34_build_proot_c() $SUDO mount --bind "${PROOT_SOURCE_DIR}" "$OS_ROOTDIR/proot" $SUDO mount --bind "${S_PROOT_PACKAGES_DIR}" "$OS_ROOTDIR/proot-static-packages" # compile proot - $SUDO chroot --userspec=$USER "$OS_ROOTDIR" /bin/bash <<'EOF_fedora34_proot_1' + $SUDO chroot --userspec="$USER" "$OS_ROOTDIR" /bin/bash <<'EOF_fedora34_proot_1' cd /usr/bin rm python ln -s python2 python @@ -2145,6 +2168,12 @@ fedora34_build_patchelf() #PROOT="$S_PROOT_DIR/proot-x86_64" #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" PROOT="$S_PROOT_DIR/proot-x86_64" + elif [ "$OS_ARCH" = "aarch64" ]; then + #PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + elif [ "$OS_ARCH" = "ppc64le" ]; then + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-ppc64le" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -2159,7 +2188,7 @@ fedora34_build_patchelf() # compile patchelf set -xv - (cd ${PATCHELF_SOURCE_DIR} ; bash ./bootstrap.sh) + (cd "${PATCHELF_SOURCE_DIR}" ; bash ./bootstrap.sh) $PROOT -r "$OS_ROOTDIR" -b "${PATCHELF_SOURCE_DIR}:/patchelf" -w / -b /dev \ /bin/bash <<'EOF_fedora34_patchelf' cd /patchelf @@ -2192,6 +2221,12 @@ fedora34_build_fakechroot() #PROOT="$S_PROOT_DIR/proot-x86_64" #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" PROOT="$S_PROOT_DIR/proot-x86_64" + elif [ "$OS_ARCH" = "aarch64" ]; then + #PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + elif [ "$OS_ARCH" = "ppc64le" ]; then + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-ppc64le" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -2308,14 +2343,12 @@ fedora35_setup() # downgrade --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" --forcearch="$OS_ARCH" \ # coreutils-8.31-1.fc31.x86_64 coreutils-common-8.31-1.fc31.x86_64 - if [ "$OS_ARCH" = "x86_64" ]; then - $SUDO /usr/bin/dnf -y -c "${OS_ROOTDIR}/etc/dnf/dnf.conf" \ - install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" --forcearch="$OS_ARCH" \ - autoconf m4 gcc-c++ libstdc++-static automake gawk libtool - fi + $SUDO /usr/bin/dnf -y -c "${OS_ROOTDIR}/etc/dnf/dnf.conf" \ + install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" --forcearch="$OS_ARCH" \ + autoconf m4 gcc-c++ libstdc++-static automake gawk libtool if [ "$OS_ARCH" = "aarch64" ]; then - $SUDO chown -R $(id -u):$(id -g) "$OS_ROOTDIR" + $SUDO chown -R "$(id -u):$(id -g)" "$OS_ROOTDIR" #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" export PROOT_NO_SECCOMP=1 @@ -2349,7 +2382,7 @@ fedora35_build_proot_c() $SUDO mount --bind "${PROOT_SOURCE_DIR}" "$OS_ROOTDIR/proot" $SUDO mount --bind "${S_PROOT_PACKAGES_DIR}" "$OS_ROOTDIR/proot-static-packages" # compile proot - $SUDO chroot --userspec=$USER "$OS_ROOTDIR" /bin/bash <<'EOF_fedora35_proot_1' + $SUDO chroot --userspec="$USER" "$OS_ROOTDIR" /bin/bash <<'EOF_fedora35_proot_1' cd /usr/bin rm python ln -s python2 python @@ -2481,6 +2514,12 @@ fedora35_build_patchelf() #PROOT="$S_PROOT_DIR/proot-x86_64" #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" PROOT="$S_PROOT_DIR/proot-x86_64" + elif [ "$OS_ARCH" = "aarch64" ]; then + #PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + elif [ "$OS_ARCH" = "ppc64le" ]; then + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-ppc64le" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -2495,7 +2534,7 @@ fedora35_build_patchelf() # compile patchelf set -xv - (cd ${PATCHELF_SOURCE_DIR} ; bash ./bootstrap.sh) + (cd "${PATCHELF_SOURCE_DIR}" ; bash ./bootstrap.sh) $PROOT -r "$OS_ROOTDIR" -b "${PATCHELF_SOURCE_DIR}:/patchelf" -w / -b /dev \ /bin/bash <<'EOF_fedora35_patchelf' cd /patchelf @@ -2528,6 +2567,12 @@ fedora35_build_fakechroot() #PROOT="$S_PROOT_DIR/proot-x86_64" #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" PROOT="$S_PROOT_DIR/proot-x86_64" + elif [ "$OS_ARCH" = "aarch64" ]; then + #PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + elif [ "$OS_ARCH" = "ppc64le" ]; then + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-ppc64le" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -2644,14 +2689,12 @@ fedora36_setup() # downgrade --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" --forcearch="$OS_ARCH" \ # coreutils-8.31-1.fc31.x86_64 coreutils-common-8.31-1.fc31.x86_64 - if [ "$OS_ARCH" = "x86_64" ]; then - $SUDO /usr/bin/dnf -y -c "${OS_ROOTDIR}/etc/dnf/dnf.conf" \ - install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" --forcearch="$OS_ARCH" \ - autoconf m4 gcc-c++ libstdc++-static automake gawk libtool - fi + $SUDO /usr/bin/dnf -y -c "${OS_ROOTDIR}/etc/dnf/dnf.conf" \ + install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" --forcearch="$OS_ARCH" \ + autoconf m4 gcc-c++ libstdc++-static automake gawk libtool if [ "$OS_ARCH" = "aarch64" ]; then - $SUDO chown -R $(id -u):$(id -g) "$OS_ROOTDIR" + $SUDO chown -R "$(id -u):$(id -g)" "$OS_ROOTDIR" #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" export PROOT_NO_SECCOMP=1 @@ -2685,7 +2728,7 @@ fedora36_build_proot_c() $SUDO mount --bind "${PROOT_SOURCE_DIR}" "$OS_ROOTDIR/proot" $SUDO mount --bind "${S_PROOT_PACKAGES_DIR}" "$OS_ROOTDIR/proot-static-packages" # compile proot - $SUDO chroot --userspec=$USER "$OS_ROOTDIR" /bin/bash <<'EOF_fedora36_proot_1' + $SUDO chroot --userspec="$USER" "$OS_ROOTDIR" /bin/bash <<'EOF_fedora36_proot_1' cd /usr/bin rm python ln -s python2 python @@ -2817,6 +2860,12 @@ fedora36_build_patchelf() #PROOT="$S_PROOT_DIR/proot-x86_64" #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" PROOT="$S_PROOT_DIR/proot-x86_64" + elif [ "$OS_ARCH" = "aarch64" ]; then + #PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + elif [ "$OS_ARCH" = "ppc64le" ]; then + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-ppc64le" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -2831,7 +2880,7 @@ fedora36_build_patchelf() # compile patchelf set -xv - (cd ${PATCHELF_SOURCE_DIR} ; bash ./bootstrap.sh) + (cd "${PATCHELF_SOURCE_DIR}" ; bash ./bootstrap.sh) $PROOT -r "$OS_ROOTDIR" -b "${PATCHELF_SOURCE_DIR}:/patchelf" -w / -b /dev \ /bin/bash <<'EOF_fedora36_patchelf' cd /patchelf @@ -2864,6 +2913,12 @@ fedora36_build_fakechroot() #PROOT="$S_PROOT_DIR/proot-x86_64" #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" PROOT="$S_PROOT_DIR/proot-x86_64" + elif [ "$OS_ARCH" = "aarch64" ]; then + #PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + elif [ "$OS_ARCH" = "ppc64le" ]; then + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-ppc64le" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -2980,14 +3035,12 @@ fedora38_setup() # downgrade --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" --forcearch="$OS_ARCH" \ # coreutils-8.31-1.fc31.x86_64 coreutils-common-8.31-1.fc31.x86_64 - if [ "$OS_ARCH" = "x86_64" ]; then - $SUDO /usr/bin/dnf -y -c "${OS_ROOTDIR}/etc/dnf/dnf.conf" \ - install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" --forcearch="$OS_ARCH" \ - autoconf m4 gcc-c++ libstdc++-static automake gawk libtool - fi + $SUDO /usr/bin/dnf -y -c "${OS_ROOTDIR}/etc/dnf/dnf.conf" \ + install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" --forcearch="$OS_ARCH" \ + autoconf m4 gcc-c++ libstdc++-static automake gawk libtool if [ "$OS_ARCH" = "aarch64" ]; then - $SUDO chown -R $(id -u):$(id -g) "$OS_ROOTDIR" + $SUDO chown -R "$(id -u):$(id -g)" "$OS_ROOTDIR" #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" export PROOT_NO_SECCOMP=1 @@ -3021,7 +3074,7 @@ fedora38_build_proot_c() $SUDO mount --bind "${PROOT_SOURCE_DIR}" "$OS_ROOTDIR/proot" $SUDO mount --bind "${S_PROOT_PACKAGES_DIR}" "$OS_ROOTDIR/proot-static-packages" # compile proot - $SUDO chroot --userspec=$USER "$OS_ROOTDIR" /bin/bash <<'EOF_fedora38_proot_1' + $SUDO chroot --userspec="$USER" "$OS_ROOTDIR" /bin/bash <<'EOF_fedora38_proot_1' cd /usr/bin rm python ln -s python2 python @@ -3153,6 +3206,12 @@ fedora38_build_patchelf() #PROOT="$S_PROOT_DIR/proot-x86_64" #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" PROOT="$S_PROOT_DIR/proot-x86_64" + elif [ "$OS_ARCH" = "aarch64" ]; then + #PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + elif [ "$OS_ARCH" = "ppc64le" ]; then + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-ppc64le" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -3167,7 +3226,7 @@ fedora38_build_patchelf() # compile patchelf set -xv - (cd ${PATCHELF_SOURCE_DIR} ; bash ./bootstrap.sh) + (cd "${PATCHELF_SOURCE_DIR}" ; bash ./bootstrap.sh) $PROOT -r "$OS_ROOTDIR" -b "${PATCHELF_SOURCE_DIR}:/patchelf" -w / -b /dev \ /bin/bash <<'EOF_fedora38_patchelf' cd /patchelf @@ -3204,6 +3263,8 @@ fedora38_build_fakechroot() #PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + elif [ "$OS_ARCH" = "ppc64le" ]; then + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-ppc64le" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -3233,9 +3294,6 @@ EOF_fedora38_fakechroot } - - - # ############################################################################# # CentOS 6 # ############################################################################# @@ -3362,11 +3420,9 @@ centos6_setup() gcc make libtalloc libtalloc-devel glibc-static glibc-devel \ tar python gzip zlib diffutils file git which - if [ "$OS_ARCH" = "x86_64" ]; then - $SUDO /usr/bin/yum -y -c "${OS_ROOTDIR}/etc/yum.conf" \ - install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" \ - autoconf m4 gcc-c++ automake gawk libtool - fi + $SUDO /usr/bin/yum -y -c "${OS_ROOTDIR}/etc/yum.conf" \ + install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" \ + autoconf m4 gcc-c++ automake gawk libtool $SUDO /usr/bin/yum -y -c "${OS_ROOTDIR}/etc/yum.conf" \ clean packages @@ -3392,6 +3448,12 @@ centos6_build_fakechroot() PROOT="$S_PROOT_DIR/proot-x86" elif [ "$OS_ARCH" = "x86_64" ]; then PROOT="$S_PROOT_DIR/proot-x86_64" + elif [ "$OS_ARCH" = "aarch64" ]; then + #PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + elif [ "$OS_ARCH" = "ppc64le" ]; then + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-ppc64le" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -3532,12 +3594,10 @@ centos7_setup() gcc make libtalloc libtalloc-devel glibc-static glibc-devel \ tar python gzip zlib diffutils file git which - if [ "$OS_ARCH" = "x86_64" -o "$OS_ARCH" = "aarch64" ]; then - $SUDO /usr/bin/yum -y -c "${OS_ROOTDIR}/etc/yum.conf" \ - install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" \ - --forcearch="$OS_ARCH" \ - autoconf m4 gcc-c++ automake gawk libtool - fi + $SUDO /usr/bin/yum -y -c "${OS_ROOTDIR}/etc/yum.conf" \ + install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" \ + --forcearch="$OS_ARCH" \ + autoconf m4 gcc-c++ libstdc++-static automake gawk libtool xz $SUDO /usr/bin/yum -y -c "${OS_ROOTDIR}/etc/yum.conf" \ clean packages @@ -3569,6 +3629,8 @@ centos7_build_fakechroot() #PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + elif [ "$OS_ARCH" = "ppc64le" ]; then + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-ppc64le" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -3616,6 +3678,10 @@ centos7_build_proot() #PROOT="$HOME/.udocker/bin/proot-x86_64" #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" PROOT="$HOME/.udocker/bin/proot-x86_64" + elif [ "$OS_ARCH" = "aarch64" ]; then + #PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -3663,6 +3729,60 @@ EOF_centos7_proot_1 fi } +centos7_build_patchelf() +{ + echo "centos7_build_patchelf : $1" + local OS_ARCH="$1" + local PATCHELF_SOURCE_DIR="$2" + local OS_NAME="centos" + local OS_RELVER="7" + local OS_ROOTDIR="${BUILD_DIR}/${OS_NAME}_${OS_RELVER}_${OS_ARCH}" + local PROOT="" + + if [ "$OS_ARCH" = "i386" ]; then + #PROOT="$S_PROOT_DIR/proot-x86 -q qemu-i386" + #PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86" + elif [ "$OS_ARCH" = "x86_64" ]; then + #PROOT="$S_PROOT_DIR/proot-x86_64" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86_64" + elif [ "$OS_ARCH" = "aarch64" ]; then + #PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + elif [ "$OS_ARCH" = "ppc64le" ]; then + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-ppc64le" + else + echo "unsupported $OS_NAME architecture: $OS_ARCH" + exit 2 + fi + + if [ -x "${PATCHELF_SOURCE_DIR}/patchelf-CentOS-7" ] ; then + echo "patchelf binary already compiled : ${PATCHELF_SOURCE_DIR}/patchelf-CentOS-7" + return + fi + + export PROOT_NO_SECCOMP=1 + + # compile patchelf + set -xv + (cd "${PATCHELF_SOURCE_DIR}" ; bash ./bootstrap.sh) + $PROOT -r "$OS_ROOTDIR" -b "${PATCHELF_SOURCE_DIR}:/patchelf" -w / -b /dev \ + /bin/bash <<'EOF_centos7_patchelf' +cd /patchelf +make clean +# BUILD PATCHELF +#bash bootstrap.sh +bash ./configure +make +cp src/patchelf /patchelf/patchelf-CentOS-7 +make clean +EOF_centos7_patchelf + set +xv +} + + # ############################################################################# # CentOS 8 *** OLD *** @@ -3812,17 +3932,15 @@ centos8_setup() $SUDO /usr/bin/yum -y -c "${OS_ROOTDIR}/etc/yum.conf" \ install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" \ - --setopt=module_platform_id=platform:el$OS_RELVER \ - --forcearch="$OS_ARCH" \ - dnf dnf-data gcc make libtalloc libtalloc-devel glibc-static \ - glibc-devel tar python3 python2 gzip zlib diffutils file git which + --setopt=module_platform_id=platform:el$OS_RELVER \ + --forcearch="$OS_ARCH" \ + dnf dnf-data gcc make libtalloc libtalloc-devel glibc-static \ + glibc-devel tar python3 python2 gzip zlib diffutils file git which - if [ "$OS_ARCH" = "x86_64" -o "$OS_ARCH" = "aarch64" ]; then - $SUDO /usr/bin/yum -y -c "${OS_ROOTDIR}/etc/yum.conf" \ - install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" \ - --forcearch="$OS_ARCH" \ - autoconf m4 gcc-c++ automake gawk libtool - fi + $SUDO /usr/bin/yum -y -c "${OS_ROOTDIR}/etc/yum.conf" \ + install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" \ + --forcearch="$OS_ARCH" \ + autoconf m4 gcc-c++ automake gawk libtool $SUDO /usr/bin/yum -y -c "${OS_ROOTDIR}/etc/yum.conf" \ clean packages @@ -3850,6 +3968,12 @@ centos8_build_fakechroot() #PROOT="$S_PROOT_DIR/proot-x86_64" #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" PROOT="$S_PROOT_DIR/proot-x86_64" + elif [ "$OS_ARCH" = "aarch64" ]; then + #PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + elif [ "$OS_ARCH" = "ppc64le" ]; then + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-ppc64le" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -4046,12 +4170,10 @@ centos_stream8_setup() dnf dnf-data gcc make libtalloc libtalloc-devel glibc-devel tar \ python3 python2 gzip zlib diffutils file git which - if [ "$OS_ARCH" = "x86_64" ]; then - $SUDO /usr/bin/yum -y -c "${OS_ROOTDIR}/etc/yum.conf" \ - install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" \ - --forcearch="$OS_ARCH" \ - autoconf m4 gcc-c++ automake gawk libtool - fi + $SUDO /usr/bin/yum -y -c "${OS_ROOTDIR}/etc/yum.conf" \ + install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" \ + --forcearch="$OS_ARCH" \ + autoconf m4 gcc-c++ automake gawk libtool $SUDO /usr/bin/yum -y -c "${OS_ROOTDIR}/etc/yum.conf" \ clean packages @@ -4079,6 +4201,12 @@ centos_stream8_build_fakechroot() #PROOT="$S_PROOT_DIR/proot-x86_64" #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" PROOT="$S_PROOT_DIR/proot-x86_64" + elif [ "$OS_ARCH" = "aarch64" ]; then + #PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + elif [ "$OS_ARCH" = "ppc64le" ]; then + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-ppc64le" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -4260,17 +4388,15 @@ centos_stream9_setup() $SUDO /usr/bin/yum -y -c "${OS_ROOTDIR}/etc/yum.conf" \ install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" \ - --setopt=module_platform_id=platform:el${OS_RELVER} \ - --forcearch="$OS_ARCH" \ - dnf dnf-data gcc make libtalloc libtalloc-devel glibc-devel tar \ - python3 python2 gzip zlib diffutils file git which + --setopt=module_platform_id=platform:el${OS_RELVER} \ + --forcearch="$OS_ARCH" \ + dnf dnf-data gcc make libtalloc libtalloc-devel glibc-devel tar \ + python3 python2 gzip zlib diffutils file git which - if [ "$OS_ARCH" = "x86_64" -o "$OS_ARCH" = "aarch64" ]; then - $SUDO /usr/bin/yum -y -c "${OS_ROOTDIR}/etc/yum.conf" \ - install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" \ - --forcearch="$OS_ARCH" \ - autoconf m4 gcc-c++ automake gawk libtool - fi + $SUDO /usr/bin/yum -y -c "${OS_ROOTDIR}/etc/yum.conf" \ + install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" \ + --forcearch="$OS_ARCH" \ + autoconf m4 gcc-c++ automake gawk libtool $SUDO /usr/bin/yum -y -c "${OS_ROOTDIR}/etc/yum.conf" \ clean packages @@ -4298,6 +4424,12 @@ centos_stream9_build_fakechroot() #PROOT="$S_PROOT_DIR/proot-x86_64" #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" PROOT="$S_PROOT_DIR/proot-x86_64" + elif [ "$OS_ARCH" = "aarch64" ]; then + #PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + elif [ "$OS_ARCH" = "ppc64le" ]; then + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-ppc64le" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -4500,17 +4632,15 @@ rocky8_setup() $SUDO /usr/bin/yum -y -c "${OS_ROOTDIR}/etc/yum.conf" \ install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" \ - --setopt=module_platform_id=platform:el$OS_RELVER \ - --forcearch="$OS_ARCH" \ - dnf rpm dnf-data gcc make libtalloc libtalloc-devel glibc-devel tar \ - python3 python2 gzip zlib diffutils file git which + --setopt=module_platform_id=platform:el$OS_RELVER \ + --forcearch="$OS_ARCH" \ + dnf rpm dnf-data gcc make libtalloc libtalloc-devel glibc-devel tar \ + python3 python2 gzip zlib diffutils file git which - if [ "$OS_ARCH" = "x86_64" -o "$OS_ARCH" = "aarch64" ]; then - $SUDO /usr/bin/yum -y -c "${OS_ROOTDIR}/etc/yum.conf" \ - install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" \ - --forcearch="$OS_ARCH" \ - autoconf m4 gcc-c++ automake gawk libtool - fi + $SUDO /usr/bin/yum -y -c "${OS_ROOTDIR}/etc/yum.conf" \ + install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" \ + --forcearch="$OS_ARCH" \ + autoconf m4 gcc-c++ automake gawk libtool $SUDO /usr/bin/yum -y -c "${OS_ROOTDIR}/etc/yum.conf" \ clean packages @@ -4542,6 +4672,8 @@ rocky8_build_fakechroot() #PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + elif [ "$OS_ARCH" = "ppc64le" ]; then + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-ppc64le" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -4763,21 +4895,17 @@ rocky9_setup() /bin/mkdir -p "${OS_ROOTDIR}/etc/yum.repos.d" rocky9_create_yum "${OS_ROOTDIR}/etc/yum.conf" "$OS_ARCH" -set -v $SUDO /usr/bin/yum -y -c "${OS_ROOTDIR}/etc/yum.conf" \ install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" \ - --setopt=module_platform_id=platform:el$OS_RELVER \ - --forcearch="$OS_ARCH" \ - dnf rpm dnf-data gcc make libtalloc libtalloc-devel glibc-devel tar \ - python3 python2 gzip zlib diffutils file git which -set +v + --setopt=module_platform_id=platform:el$OS_RELVER \ + --forcearch="$OS_ARCH" \ + dnf rpm dnf-data gcc make libtalloc libtalloc-devel glibc-devel tar \ + python3 python2 gzip zlib diffutils file git which - if [ "$OS_ARCH" = "x86_64" -o "$OS_ARCH" = "aarch64" ]; then - $SUDO /usr/bin/yum -y -c "${OS_ROOTDIR}/etc/yum.conf" \ - install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" \ - --forcearch="$OS_ARCH" \ - autoconf m4 gcc-c++ automake gawk libtool - fi + $SUDO /usr/bin/yum -y -c "${OS_ROOTDIR}/etc/yum.conf" \ + install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" \ + --forcearch="$OS_ARCH" \ + autoconf m4 gcc-c++ automake gawk libtool $SUDO /usr/bin/yum -y -c "${OS_ROOTDIR}/etc/yum.conf" \ clean packages @@ -4809,6 +4937,8 @@ rocky9_build_fakechroot() #PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + elif [ "$OS_ARCH" = "ppc64le" ]; then + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-ppc64le" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -4840,16 +4970,16 @@ EOF_rocky9_fakechroot # ############################################################################# -# Alma 9 +# Alma 8 # ############################################################################# -alma9_create_yum() +alma8_create_yum() { - echo "alma9_create_yum : $1" + echo "alma8_create_yum : $1" local FILENAME="$1" local ARCH="$2" - cat > "${FILENAME}" <<'EOF_alma9_yum_conf' + cat > "${FILENAME}" <<'EOF_alma8_yum_conf' [main] cachedir=/var/cache/yum/$basearch/$releasever keepcache=0 @@ -4871,7 +5001,7 @@ mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/appstream enabled=1 gpgcheck=0 countme=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-8 metadata_expire=86400 enabled_metadata=1 @@ -4882,7 +5012,7 @@ mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/baseos enabled=1 gpgcheck=0 countme=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-8 metadata_expire=86400 enabled_metadata=1 @@ -4893,7 +5023,7 @@ mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/crb enabled=0 gpgcheck=0 countme=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-8 metadata_expire=86400 enabled_metadata=0 @@ -4904,7 +5034,7 @@ mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/extras enabled=1 gpgcheck=0 countme=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-8 metadata_expire=86400 enabled_metadata=0 @@ -4915,7 +5045,7 @@ mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/highavailability enabled=0 gpgcheck=0 countme=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-8 metadata_expire=86400 enabled_metadata=0 @@ -4926,7 +5056,7 @@ mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/nfv enabled=0 gpgcheck=0 countme=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-8 metadata_expire=86400 enabled_metadata=0 @@ -4937,7 +5067,7 @@ mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/plus enabled=0 gpgcheck=0 countme=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-8 metadata_expire=86400 enabled_metadata=0 @@ -4948,7 +5078,7 @@ mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/resilientstorage enabled=0 gpgcheck=0 countme=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-8 metadata_expire=86400 enabled_metadata=0 @@ -4959,7 +5089,7 @@ mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/rt enabled=0 gpgcheck=0 countme=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-8 metadata_expire=86400 enabled_metadata=0 @@ -4970,7 +5100,7 @@ mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/sap enabled=0 gpgcheck=0 countme=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-8 metadata_expire=86400 enabled_metadata=0 @@ -4981,7 +5111,7 @@ mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/saphana enabled=0 gpgcheck=0 countme=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-8 metadata_expire=86400 enabled_metadata=0 @@ -4994,7 +5124,7 @@ metalink=https://mirrors.fedoraproject.org/metalink?repo=playground-epel$release failovermethod=priority enabled=0 gpgcheck=0 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-9 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8 [epel] name=Extra Packages for Enterprise Linux $releasever - $basearch @@ -5003,17 +5133,17 @@ metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-$releasever&arch=$ failovermethod=priority enabled=1 gpgcheck=0 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-9 -EOF_alma9_yum_conf +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8 +EOF_alma8_yum_conf } -alma9_setup() +alma8_setup() { - echo "alma9_setup : $1" + echo "alma8_setup : $1" local OS_ARCH="$1" local OS_NAME="alma" - local OS_RELVER="9" + local OS_RELVER="8" local OS_ROOTDIR="${BUILD_DIR}/${OS_NAME}_${OS_RELVER}_${OS_ARCH}" if [ -x "${OS_ROOTDIR}/bin/gcc" ] ; then @@ -5028,23 +5158,19 @@ alma9_setup() /bin/mkdir -p "${OS_ROOTDIR}/proot-static-packages" /bin/mkdir -p "${OS_ROOTDIR}/etc/yum" /bin/mkdir -p "${OS_ROOTDIR}/etc/yum.repos.d" - alma9_create_yum "${OS_ROOTDIR}/etc/yum.conf" "$OS_ARCH" + alma8_create_yum "${OS_ROOTDIR}/etc/yum.conf" "$OS_ARCH" -set -v $SUDO /usr/bin/yum -y -c "${OS_ROOTDIR}/etc/yum.conf" \ install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" \ - --setopt=module_platform_id=platform:el$OS_RELVER \ - --forcearch="$OS_ARCH" \ - dnf rpm dnf-data gcc make libtalloc libtalloc-devel glibc-devel tar \ - python3 python2 gzip zlib diffutils file git which -set +v + --setopt=module_platform_id=platform:el$OS_RELVER \ + --forcearch="$OS_ARCH" \ + dnf rpm dnf-data gcc make libtalloc libtalloc-devel glibc-devel tar \ + python3 python2 gzip zlib diffutils file git which - if [ "$OS_ARCH" = "x86_64" -o "$OS_ARCH" = "aarch64" ]; then - $SUDO /usr/bin/yum -y -c "${OS_ROOTDIR}/etc/yum.conf" \ - install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" \ - --forcearch="$OS_ARCH" \ - autoconf m4 gcc-c++ automake gawk libtool - fi + $SUDO /usr/bin/yum -y -c "${OS_ROOTDIR}/etc/yum.conf" \ + install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" \ + --forcearch="$OS_ARCH" \ + autoconf m4 gcc-c++ automake gawk libtool $SUDO /usr/bin/yum -y -c "${OS_ROOTDIR}/etc/yum.conf" \ clean packages @@ -5054,13 +5180,13 @@ set +v } -alma9_build_fakechroot() +alma8_build_fakechroot() { - echo "alma9_build_fakechroot : $1" + echo "alma8_build_fakechroot : $1" local OS_ARCH="$1" local FAKECHROOT_SOURCE_DIR="$2" local OS_NAME="alma" - local OS_RELVER="9" + local OS_RELVER="8" local OS_ROOTDIR="${BUILD_DIR}/${OS_NAME}_${OS_RELVER}_${OS_ARCH}" local PROOT="" @@ -5076,13 +5202,15 @@ alma9_build_fakechroot() #PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + elif [ "$OS_ARCH" = "ppc64le" ]; then + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-ppc64le" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 fi - if [ -x "${FAKECHROOT_SOURCE_DIR}/libfakechroot-AlmaLinux-9.so" ] ; then - echo "fakechroot binary already compiled : ${FAKECHROOT_SOURCE_DIR}/libfakechroot-AlmaLinux-9.so" + if [ -x "${FAKECHROOT_SOURCE_DIR}/libfakechroot-AlmaLinux-8.so" ] ; then + echo "fakechroot binary already compiled : ${FAKECHROOT_SOURCE_DIR}/libfakechroot-AlmaLinux-8.so" return fi @@ -5092,41 +5220,306 @@ alma9_build_fakechroot() set -xv SHELL=/bin/bash CONFIG_SHELL=/bin/bash PATH=/bin:/usr/bin:/sbin:/usr/sbin \ $PROOT -r "$OS_ROOTDIR" -b "${FAKECHROOT_SOURCE_DIR}:/fakechroot" -w / -b /dev \ - /bin/bash <<'EOF_alma9_fakechroot' + /bin/bash <<'EOF_alma8_fakechroot' cd /fakechroot # BUILD FAKECHROOT make distclean bash ./configure make -cp src/.libs/libfakechroot.so libfakechroot-AlmaLinux-9.so +cp src/.libs/libfakechroot.so libfakechroot-AlmaLinux-8.so make clean -EOF_alma9_fakechroot +EOF_alma8_fakechroot set +xv } # ############################################################################# -# Ubuntu 12.04 +# Alma 9 # ############################################################################# -ubuntu12_setup() +alma9_create_yum() { - echo "ubuntu12_setup : $1" - local OS_ARCH="$1" - local OS_NAME="ubuntu" - local OS_RELVER="12" - local OS_ROOTDIR="${BUILD_DIR}/${OS_NAME}_${OS_RELVER}_${OS_ARCH}" - - if [ -x "${OS_ROOTDIR}/usr/lib/gcc" ] ; then - echo "os already setup : ${OS_ROOTDIR}" - return - fi - - SUDO=sudo + echo "alma9_create_yum : $1" + local FILENAME="$1" + local ARCH="$2" - $SUDO debootstrap --no-check-gpg --arch=$OS_ARCH --variant=buildd \ - precise $OS_ROOTDIR http://old-releases.ubuntu.com/ubuntu/ + cat > "${FILENAME}" <<'EOF_alma9_yum_conf' +[main] +cachedir=/var/cache/yum/$basearch/$releasever +keepcache=0 +debuglevel=2 +exactarch=1 +obsoletes=1 +gpgcheck=0 +plugins=1 +installonly_limit=5 + +# PUT YOUR REPOS HERE OR IN separate files named file.repo +# in /etc/yum.repos.d +reposdir=NONE + +[appstream] +name=AlmaLinux $releasever - AppStream +mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/appstream +# baseurl=https://repo.almalinux.org/almalinux/$releasever/AppStream/$basearch/os/ +enabled=1 +gpgcheck=0 +countme=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 +metadata_expire=86400 +enabled_metadata=1 + +[baseos] +name=AlmaLinux $releasever - BaseOS +mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/baseos +# baseurl=https://repo.almalinux.org/almalinux/$releasever/BaseOS/$basearch/os/ +enabled=1 +gpgcheck=0 +countme=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 +metadata_expire=86400 +enabled_metadata=1 + +[crb] +name=AlmaLinux $releasever - CRB +mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/crb +# baseurl=https://repo.almalinux.org/almalinux/$releasever/CRB/$basearch/os/ +enabled=0 +gpgcheck=0 +countme=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 +metadata_expire=86400 +enabled_metadata=0 + +[extras] +name=AlmaLinux $releasever - Extras +mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/extras +# baseurl=https://repo.almalinux.org/almalinux/$releasever/extras/$basearch/os/ +enabled=1 +gpgcheck=0 +countme=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 +metadata_expire=86400 +enabled_metadata=0 + +[highavailability] +name=AlmaLinux $releasever - HighAvailability +mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/highavailability +# baseurl=https://repo.almalinux.org/almalinux/$releasever/HighAvailability/$basearch/os/ +enabled=0 +gpgcheck=0 +countme=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 +metadata_expire=86400 +enabled_metadata=0 + +[nfv] +name=AlmaLinux $releasever - NFV +mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/nfv +# baseurl=https://repo.almalinux.org/almalinux/$releasever/NFV/$basearch/os/ +enabled=0 +gpgcheck=0 +countme=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 +metadata_expire=86400 +enabled_metadata=0 + +[plus] +name=AlmaLinux $releasever - Plus +mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/plus +# baseurl=https://repo.almalinux.org/almalinux/$releasever/plus/$basearch/os/ +enabled=0 +gpgcheck=0 +countme=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 +metadata_expire=86400 +enabled_metadata=0 + +[resilientstorage] +name=AlmaLinux $releasever - ResilientStorage +mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/resilientstorage +# baseurl=https://repo.almalinux.org/almalinux/$releasever/ResilientStorage/$basearch/os/ +enabled=0 +gpgcheck=0 +countme=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 +metadata_expire=86400 +enabled_metadata=0 + +[rt] +name=AlmaLinux $releasever - RT +mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/rt +# baseurl=https://repo.almalinux.org/almalinux/$releasever/RT/$basearch/os/ +enabled=0 +gpgcheck=0 +countme=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 +metadata_expire=86400 +enabled_metadata=0 + +[sap] +name=AlmaLinux $releasever - SAP +mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/sap +# baseurl=https://repo.almalinux.org/almalinux/$releasever/SAP/$basearch/os/ +enabled=0 +gpgcheck=0 +countme=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 +metadata_expire=86400 +enabled_metadata=0 + +[saphana] +name=AlmaLinux $releasever - SAPHANA +mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/saphana +# baseurl=https://repo.almalinux.org/almalinux/$releasever/SAPHANA/$basearch/os/ +enabled=0 +gpgcheck=0 +countme=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 +metadata_expire=86400 +enabled_metadata=0 + +############################################################# + +[epel-playground] +name=Extra Packages for Enterprise Linux $releasever - Playground - $basearch +#baseurl=https://download.fedoraproject.org/pub/epel/playground/$releasever/Everything/$basearch/os +metalink=https://mirrors.fedoraproject.org/metalink?repo=playground-epel$releasever&arch=$basearch&infra=$infra&content=$contentdir +failovermethod=priority +enabled=0 +gpgcheck=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-9 + +[epel] +name=Extra Packages for Enterprise Linux $releasever - $basearch +#baseurl=https://download.fedoraproject.org/pub/epel/$releasever/Everything/$basearch +metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-$releasever&arch=$basearch&infra=$infra&content=$contentdir +failovermethod=priority +enabled=1 +gpgcheck=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-9 +EOF_alma9_yum_conf +} + + +alma9_setup() +{ + echo "alma9_setup : $1" + local OS_ARCH="$1" + local OS_NAME="alma" + local OS_RELVER="9" + local OS_ROOTDIR="${BUILD_DIR}/${OS_NAME}_${OS_RELVER}_${OS_ARCH}" + + if [ -x "${OS_ROOTDIR}/bin/gcc" ] ; then + echo "os already setup : ${OS_ROOTDIR}" + return + fi + + SUDO=sudo + + /bin/mkdir -p "${OS_ROOTDIR}/tmp" + /bin/mkdir -p "${OS_ROOTDIR}/proot" + /bin/mkdir -p "${OS_ROOTDIR}/proot-static-packages" + /bin/mkdir -p "${OS_ROOTDIR}/etc/yum" + /bin/mkdir -p "${OS_ROOTDIR}/etc/yum.repos.d" + alma9_create_yum "${OS_ROOTDIR}/etc/yum.conf" "$OS_ARCH" + + $SUDO /usr/bin/yum -y -c "${OS_ROOTDIR}/etc/yum.conf" \ + install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" \ + --setopt=module_platform_id=platform:el$OS_RELVER \ + --forcearch="$OS_ARCH" \ + dnf rpm dnf-data gcc make libtalloc libtalloc-devel glibc-devel tar \ + python3 python2 gzip zlib diffutils file git which + + $SUDO /usr/bin/yum -y -c "${OS_ROOTDIR}/etc/yum.conf" \ + install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" \ + --forcearch="$OS_ARCH" \ + autoconf m4 gcc-c++ automake gawk libtool + + $SUDO /usr/bin/yum -y -c "${OS_ROOTDIR}/etc/yum.conf" \ + clean packages + + $SUDO /bin/chown -R "$(id -u).$(id -g)" "$OS_ROOTDIR" + $SUDO /bin/chmod -R u+rw "$OS_ROOTDIR" +} + + +alma9_build_fakechroot() +{ + echo "alma9_build_fakechroot : $1" + local OS_ARCH="$1" + local FAKECHROOT_SOURCE_DIR="$2" + local OS_NAME="alma" + local OS_RELVER="9" + local OS_ROOTDIR="${BUILD_DIR}/${OS_NAME}_${OS_RELVER}_${OS_ARCH}" + local PROOT="" + + if [ "$OS_ARCH" = "i386" ]; then + #PROOT="$S_PROOT_DIR/proot-x86 -q qemu-i386" + #PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86" + elif [ "$OS_ARCH" = "x86_64" ]; then + #PROOT="$S_PROOT_DIR/proot-x86_64" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + PROOT="$S_PROOT_DIR/proot-x86_64" + elif [ "$OS_ARCH" = "aarch64" ]; then + #PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + elif [ "$OS_ARCH" = "ppc64le" ]; then + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-ppc64le" + else + echo "unsupported $OS_NAME architecture: $OS_ARCH" + exit 2 + fi + + if [ -x "${FAKECHROOT_SOURCE_DIR}/libfakechroot-AlmaLinux-9.so" ] ; then + echo "fakechroot binary already compiled : ${FAKECHROOT_SOURCE_DIR}/libfakechroot-AlmaLinux-9.so" + return + fi + + export PROOT_NO_SECCOMP=1 + + # compile fakechroot + set -xv + SHELL=/bin/bash CONFIG_SHELL=/bin/bash PATH=/bin:/usr/bin:/sbin:/usr/sbin \ + $PROOT -r "$OS_ROOTDIR" -b "${FAKECHROOT_SOURCE_DIR}:/fakechroot" -w / -b /dev \ + /bin/bash <<'EOF_alma9_fakechroot' +cd /fakechroot +# BUILD FAKECHROOT +make distclean +bash ./configure +make +cp src/.libs/libfakechroot.so libfakechroot-AlmaLinux-9.so +make clean +EOF_alma9_fakechroot + set +xv +} + + + +# ############################################################################# +# Ubuntu 12.04 +# ############################################################################# + +ubuntu12_setup() +{ + echo "ubuntu12_setup : $1" + local OS_ARCH="$1" + local OS_NAME="ubuntu" + local OS_RELVER="12" + local OS_ROOTDIR="${BUILD_DIR}/${OS_NAME}_${OS_RELVER}_${OS_ARCH}" + + if [ -x "${OS_ROOTDIR}/usr/lib/gcc" ] ; then + echo "os already setup : ${OS_ROOTDIR}" + return + fi + + SUDO=sudo + + $SUDO debootstrap --no-check-gpg --arch="$OS_ARCH" --variant=buildd \ + precise "$OS_ROOTDIR" http://old-releases.ubuntu.com/ubuntu/ $SUDO /bin/chown -R "$(id -u).$(id -g)" "$OS_ROOTDIR" $SUDO /bin/chmod -R u+rw "$OS_ROOTDIR" @@ -5209,7 +5602,7 @@ ubuntu14_setup() SUDO=sudo - $SUDO debootstrap --arch=$OS_ARCH --variant=buildd trusty $OS_ROOTDIR http://archive.ubuntu.com/ubuntu/ + $SUDO debootstrap --arch="$OS_ARCH" --variant=buildd trusty "$OS_ROOTDIR" http://archive.ubuntu.com/ubuntu/ $SUDO /bin/chown -R "$(id -u).$(id -g)" "$OS_ROOTDIR" $SUDO /bin/chmod -R u+rw "$OS_ROOTDIR" @@ -5293,7 +5686,7 @@ ubuntu16_setup() SUDO=sudo - $SUDO debootstrap --arch=$OS_ARCH --variant=buildd xenial $OS_ROOTDIR http://archive.ubuntu.com/ubuntu/ + $SUDO debootstrap --arch="$OS_ARCH" --variant=buildd xenial "$OS_ROOTDIR" http://archive.ubuntu.com/ubuntu/ $SUDO /bin/chown -R "$(id -u).$(id -g)" "$OS_ROOTDIR" $SUDO /bin/chmod -R u+rw "$OS_ROOTDIR" @@ -5315,6 +5708,10 @@ ubuntu16_build_fakechroot() PROOT="$S_PROOT_DIR/proot-x86" elif [ "$OS_ARCH" = "amd64" ]; then PROOT="$S_PROOT_DIR/proot-x86_64" + elif [ "$OS_ARCH" = "arm64" ]; then + #PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -5373,20 +5770,24 @@ ubuntu16_build_runc() PROOT="$S_PROOT_DIR/proot-x86" elif [ "$OS_ARCH" = "amd64" ]; then PROOT="$S_PROOT_DIR/proot-x86_64" + elif [ "$OS_ARCH" = "arm64" ]; then + #PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 fi - if [ -x "${RUNC_SOURCE_DIR}/runc" ] ; then - echo "runc binary already compiled : ${RUNC_SOURCE_DIR}/runc" + if [ -x "${RUNC_SOURCE_DIR}/runc-Ubuntu-16.bin" ] ; then + echo "runc binary already compiled : ${RUNC_SOURCE_DIR}/runc-Ubuntu-16.bin" return fi export PROOT_NO_SECCOMP=1 # compile runc - mkdir -p ${OS_ROOTDIR}/go/src/github.com/opencontainers + mkdir -p "${OS_ROOTDIR}/go/src/github.com/opencontainers" set -xv SHELL=/bin/bash CONFIG_SHELL=/bin/bash PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/lib \ $PROOT -0 -r "$OS_ROOTDIR" -b "${RUNC_SOURCE_DIR}:/go/src/github.com/opencontainers/runc" -w / -b /dev \ @@ -5395,7 +5796,9 @@ apt-get -y update apt-get -y install golang libseccomp-dev git export GOPATH=/go cd /go/src/github.com/opencontainers/runc +make clean make static +/bin/mv runc runc-Ubuntu-16.bin EOF_ubuntu16_runc set +xv @@ -5420,7 +5823,7 @@ ubuntu18_setup() SUDO=sudo - $SUDO debootstrap --arch=$OS_ARCH --variant=buildd bionic $OS_ROOTDIR http://archive.ubuntu.com/ubuntu/ + $SUDO debootstrap --arch="$OS_ARCH" --variant=buildd bionic "$OS_ROOTDIR" http://archive.ubuntu.com/ubuntu/ $SUDO /bin/chown -R "$(id -u).$(id -g)" "$OS_ROOTDIR" $SUDO /bin/chmod -R u+rw "$OS_ROOTDIR" @@ -5441,6 +5844,10 @@ ubuntu18_build_fakechroot() PROOT="$S_PROOT_DIR/proot-x86" elif [ "$OS_ARCH" = "amd64" ]; then PROOT="$S_PROOT_DIR/proot-x86_64" + elif [ "$OS_ARCH" = "arm64" ]; then + #PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -5502,21 +5909,24 @@ ubuntu18_build_runc() #PROOT="$S_PROOT_DIR/proot-x86_64" #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" PROOT="$S_PROOT_DIR/proot-x86_64" + elif [ "$OS_ARCH" = "arm64" ]; then + #PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 fi - if [ -x "${RUNC_SOURCE_DIR}/runc" ] ; then - echo "runc binary already compiled : ${RUNC_SOURCE_DIR}/runc" + if [ -x "${RUNC_SOURCE_DIR}/runc-Ubuntu-18.bin" ] ; then + echo "runc binary already compiled : ${RUNC_SOURCE_DIR}/runc-Ubuntu-18.bin" return fi export PROOT_NO_SECCOMP=1 # compile runc - mkdir -p ${OS_ROOTDIR}/go/src/github.com/opencontainers - set -xv + mkdir -p "${OS_ROOTDIR}/go/src/github.com/opencontainers" SHELL=/bin/bash CONFIG_SHELL=/bin/bash PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/lib \ $PROOT -0 -r "$OS_ROOTDIR" -b "${RUNC_SOURCE_DIR}:/go/src/github.com/opencontainers/runc" -w / -b /dev \ -b /etc/resolv.conf:/etc/resolv.conf /bin/bash <<'EOF_ubuntu18_runc' @@ -5530,10 +5940,11 @@ export GOPATH=/go export PATH=$GOPATH/bin:$GOROOT/bin:$PATH go get github.com/sirupsen/logrus cd /go/src/github.com/opencontainers/runc +make clean make static +/bin/mv runc runc-Ubuntu-18.bin EOF_ubuntu18_runc - set +xv } @@ -5556,8 +5967,8 @@ ubuntu19_setup() SUDO=sudo - #$SUDO debootstrap --arch=$OS_ARCH --variant=buildd eoan $OS_ROOTDIR http://archive.ubuntu.com/ubuntu/ - $SUDO debootstrap --arch=$OS_ARCH --variant=buildd eoan $OS_ROOTDIR http://old-releases.ubuntu.com/ubuntu/ + #$SUDO debootstrap --arch="$OS_ARCH" --variant=buildd eoan "$OS_ROOTDIR" http://archive.ubuntu.com/ubuntu/ + $SUDO debootstrap --arch="$OS_ARCH" --variant=buildd eoan "$OS_ROOTDIR" http://old-releases.ubuntu.com/ubuntu/ $SUDO /bin/chown -R "$(id -u).$(id -g)" "$OS_ROOTDIR" $SUDO /bin/chmod -R u+rw "$OS_ROOTDIR" @@ -5582,6 +5993,10 @@ ubuntu19_build_fakechroot() #PROOT="$S_PROOT_DIR/proot-x86_64" #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" PROOT="$S_PROOT_DIR/proot-x86_64" + elif [ "$OS_ARCH" = "arm64" ]; then + #PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -5643,20 +6058,24 @@ ubuntu19_build_runc() #PROOT="$S_PROOT_DIR/proot-x86_64" #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" PROOT="$S_PROOT_DIR/proot-x86_64" + elif [ "$OS_ARCH" = "arm64" ]; then + #PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 fi - if [ -x "${RUNC_SOURCE_DIR}/runc" ] ; then - echo "runc binary already compiled : ${RUNC_SOURCE_DIR}/runc" + if [ -x "${RUNC_SOURCE_DIR}/runc-Ubuntu-19.bin" ] ; then + echo "runc binary already compiled : ${RUNC_SOURCE_DIR}/runc-Ubuntu-19.bin" return fi export PROOT_NO_SECCOMP=1 # compile runc - mkdir -p ${OS_ROOTDIR}/go/src/github.com/opencontainers + mkdir -p "${OS_ROOTDIR}/go/src/github.com/opencontainers" set -xv SHELL=/bin/bash CONFIG_SHELL=/bin/bash PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/lib \ $PROOT -0 -r "$OS_ROOTDIR" -b "${RUNC_SOURCE_DIR}:/go/src/github.com/opencontainers/runc" -w / -b /dev \ @@ -5671,7 +6090,9 @@ export GOPATH=/go export PATH=$GOPATH/bin:$GOROOT/bin:$PATH go get github.com/sirupsen/logrus cd /go/src/github.com/opencontainers/runc +make clean make static +/bin/mv runc runc-Ubuntu-19.bin EOF_ubuntu19_runc set +xv @@ -5697,8 +6118,13 @@ ubuntu20_setup() SUDO=sudo - $SUDO debootstrap --arch=$OS_ARCH --variant=buildd focal $OS_ROOTDIR http://archive.ubuntu.com/ubuntu/ - #$SUDO debootstrap --arch=$OS_ARCH --variant=buildd eoan $OS_ROOTDIR http://de.mirrors.clouvider.net/ubuntu/ + if [ "$OS_ARCH" = "amd64" ] || [ "$OS_ARCH" = "i386" ]; then + REPOSITORY_URL="http://archive.ubuntu.com/ubuntu/" + else + REPOSITORY_URL="http://ports.ubuntu.com/ubuntu-ports/" + fi + + $SUDO debootstrap --arch="$OS_ARCH" --variant=buildd focal "$OS_ROOTDIR" "$REPOSITORY_URL" $SUDO /bin/chown -R "$(id -u).$(id -g)" "$OS_ROOTDIR" $SUDO /bin/chmod -R u+rw "$OS_ROOTDIR" @@ -5723,6 +6149,10 @@ ubuntu20_build_fakechroot() #PROOT="$S_PROOT_DIR/proot-x86_64" #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" PROOT="$S_PROOT_DIR/proot-x86_64" + elif [ "$OS_ARCH" = "arm64" ]; then + #PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -5784,20 +6214,24 @@ ubuntu20_build_runc() #PROOT="$S_PROOT_DIR/proot-x86_64" #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" PROOT="$S_PROOT_DIR/proot-x86_64" + elif [ "$OS_ARCH" = "arm64" ]; then + #PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 fi - if [ -x "${RUNC_SOURCE_DIR}/runc" ] ; then - echo "runc binary already compiled : ${RUNC_SOURCE_DIR}/runc" + if [ -x "${RUNC_SOURCE_DIR}/runc-Ubuntu-20.bin" ] ; then + echo "runc binary already compiled : ${RUNC_SOURCE_DIR}/runc-Ubuntu-20.bin" return fi export PROOT_NO_SECCOMP=1 # compile runc - mkdir -p ${OS_ROOTDIR}/go/src/github.com/opencontainers + mkdir -p "${OS_ROOTDIR}/go/src/github.com/opencontainers" set -xv SHELL=/bin/bash CONFIG_SHELL=/bin/bash PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/lib \ $PROOT -0 -r "$OS_ROOTDIR" -b "${RUNC_SOURCE_DIR}:/go/src/github.com/opencontainers/runc" -w / -b /dev \ @@ -5812,7 +6246,9 @@ export GOPATH=/go export PATH=$GOPATH/bin:$GOROOT/bin:$PATH go get github.com/sirupsen/logrus cd /go/src/github.com/opencontainers/runc +make clean make static +/bin/mv runc runc-Ubuntu-20.bin EOF_ubuntu20_runc set +xv @@ -5838,7 +6274,7 @@ ubuntu21_setup() SUDO=sudo - $SUDO debootstrap --arch=$OS_ARCH --variant=buildd hirsute $OS_ROOTDIR http://old-releases.ubuntu.com/ubuntu/ + $SUDO debootstrap --arch="$OS_ARCH" --variant=buildd hirsute "$OS_ROOTDIR" http://old-releases.ubuntu.com/ubuntu/ $SUDO /bin/chown -R "$(id -u).$(id -g)" "$OS_ROOTDIR" $SUDO /bin/chmod -R u+rw "$OS_ROOTDIR" @@ -5863,6 +6299,10 @@ ubuntu21_build_fakechroot() #PROOT="$S_PROOT_DIR/proot-x86_64" #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" PROOT="$S_PROOT_DIR/proot-x86_64" + elif [ "$OS_ARCH" = "arm64" ]; then + #PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -5924,20 +6364,24 @@ ubuntu21_build_runc() #PROOT="$S_PROOT_DIR/proot-x86_64" #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" PROOT="$S_PROOT_DIR/proot-x86_64" + elif [ "$OS_ARCH" = "arm64" ]; then + #PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 fi - if [ -x "${RUNC_SOURCE_DIR}/runc" ] ; then - echo "runc binary already compiled : ${RUNC_SOURCE_DIR}/runc" + if [ -x "${RUNC_SOURCE_DIR}/runc-Ubuntu-21.bin" ] ; then + echo "runc binary already compiled : ${RUNC_SOURCE_DIR}/runc-Ubuntu-21.bin" return fi export PROOT_NO_SECCOMP=1 # compile runc - mkdir -p ${OS_ROOTDIR}/go/src/github.com/opencontainers + mkdir -p "${OS_ROOTDIR}/go/src/github.com/opencontainers" set -xv SHELL=/bin/bash CONFIG_SHELL=/bin/bash PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/lib \ $PROOT -0 -r "$OS_ROOTDIR" -b "${RUNC_SOURCE_DIR}:/go/src/github.com/opencontainers/runc" -w / -b /dev \ @@ -5952,7 +6396,9 @@ export GOPATH=/go export PATH=$GOPATH/bin:$GOROOT/bin:$PATH go get github.com/sirupsen/logrus cd /go/src/github.com/opencontainers/runc +make clean make static +/bin/mv runc runc-Ubuntu-21.bin EOF_ubuntu21_runc set +xv @@ -5978,7 +6424,13 @@ ubuntu22_setup() SUDO=sudo - $SUDO debootstrap --arch=$OS_ARCH --variant=buildd jammy $OS_ROOTDIR http://archive.ubuntu.com/ubuntu/ + if [ "$OS_ARCH" = "amd64" ] || [ "$OS_ARCH" = "i386" ]; then + REPOSITORY_URL="http://archive.ubuntu.com/ubuntu/" + else + REPOSITORY_URL="http://ports.ubuntu.com/ubuntu-ports/" + fi + + $SUDO debootstrap --arch="$OS_ARCH" --variant=buildd jammy "$OS_ROOTDIR" "$REPOSITORY_URL" $SUDO /bin/chown -R "$(id -u).$(id -g)" "$OS_ROOTDIR" $SUDO /bin/chmod -R u+rw "$OS_ROOTDIR" @@ -5995,14 +6447,17 @@ ubuntu22_build_fakechroot() local PROOT="" if [ "$OS_ARCH" = "i386" ]; then - #PROOT="$S_PROOT_DIR/proot-x86 -q qemu-i386" - #PROOT="$S_PROOT_DIR/proot-x86" - #PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" PROOT="$S_PROOT_DIR/proot-x86" elif [ "$OS_ARCH" = "amd64" ]; then - #PROOT="$S_PROOT_DIR/proot-x86_64" - #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" PROOT="$S_PROOT_DIR/proot-x86_64" + elif [ "$OS_ARCH" = "arm64" ]; then + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + elif [ "$OS_ARCH" = "armhf" ]; then + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + elif [ "$OS_ARCH" = "ppc64el" ]; then + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-ppc64le" + elif [ "$OS_ARCH" = "riscv64" ]; then + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-riscv64" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -6057,27 +6512,28 @@ ubuntu22_build_runc() local PROOT="" if [ "$OS_ARCH" = "i386" ]; then - #PROOT="$S_PROOT_DIR/proot-x86 -q qemu-i386" - #PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" PROOT="$S_PROOT_DIR/proot-x86" elif [ "$OS_ARCH" = "amd64" ]; then - #PROOT="$S_PROOT_DIR/proot-x86_64" - #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" PROOT="$S_PROOT_DIR/proot-x86_64" + elif [ "$OS_ARCH" = "arm64" ]; then + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + elif [ "$OS_ARCH" = "ppc64el" ]; then + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-ppc64le" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 fi - if [ -x "${RUNC_SOURCE_DIR}/runc" ] ; then - echo "runc binary already compiled : ${RUNC_SOURCE_DIR}/runc" + if [ -x "${RUNC_SOURCE_DIR}/runc-Ubuntu-22.bin" ] ; then + echo "runc binary already compiled : ${RUNC_SOURCE_DIR}/runc-Ubuntu-22.bin" return fi - export PROOT_NO_SECCOMP=1 + #export PROOT_NO_SECCOMP=1 + unset PROOT_NO_SECCOMP # compile runc - mkdir -p ${OS_ROOTDIR}/go/src/github.com/opencontainers + mkdir -p "${OS_ROOTDIR}/go/src/github.com/opencontainers" set -xv SHELL=/bin/bash CONFIG_SHELL=/bin/bash PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/lib \ $PROOT -0 -r "$OS_ROOTDIR" -b "${RUNC_SOURCE_DIR}:/go/src/github.com/opencontainers/runc" -w / -b /dev \ @@ -6092,12 +6548,84 @@ apt-get -y install golang libseccomp-dev git software-properties-common #export PATH=$GOPATH/bin:$GOROOT/bin:$PATH #go get github.com/sirupsen/logrus cd /go/src/github.com/opencontainers/runc +make clean make static +/bin/mv runc runc-Ubuntu-22.bin EOF_ubuntu22_runc set +xv } +ubuntu22_build_runc_root() +{ + echo "ubuntu22_build_runc : $1" + local OS_ARCH="$1" + local RUNC_SOURCE_DIR="$2" + local OS_NAME="ubuntu" + local OS_RELVER="22" + local OS_ROOTDIR="${BUILD_DIR}/${OS_NAME}_${OS_RELVER}_${OS_ARCH}" + local PROOT="" + + if [ "$OS_ARCH" = "i386" ]; then + QEMU="" + elif [ "$OS_ARCH" = "amd64" ]; then + QEMU="" + elif [ "$OS_ARCH" = "arm64" ]; then + QEMU="/qemu" + /bin/cp -f "$(which qemu-aarch64-static)" "${OS_ROOTDIR}/${QEMU}" + chmod u+rx "${OS_ROOTDIR}/${QEMU}" + elif [ "$OS_ARCH" = "ppc64el" ]; then + QEMU="/qemu" + /bin/cp -f "$(which qemu-ppc64le-static)" "${OS_ROOTDIR}/${QEMU}" + chmod u+rx "${OS_ROOTDIR}/${QEMU}" + else + echo "unsupported $OS_NAME architecture: $OS_ARCH" + exit 2 + fi + + if [ -x "${RUNC_SOURCE_DIR}/runc-Ubuntu-22.bin" ] ; then + echo "runc binary already compiled : ${RUNC_SOURCE_DIR}/runc-Ubuntu-22.bin" + return + fi + + #export PROOT_NO_SECCOMP=1 + unset PROOT_NO_SECCOMP + + # compile runc + mkdir -p "${OS_ROOTDIR}/go/src/github.com/opencontainers" + set -xv + $SUDO mount --bind "${RUNC_SOURCE_DIR}" "$OS_ROOTDIR/go/src/github.com/opencontainers/runc" + $SUDO mount --bind "/etc/resolv.conf" "$OS_ROOTDIR/etc/resolv.conf" + + $SUDO chroot --userspec="root" "$OS_ROOTDIR" /qemu /bin/bash < ${APK_TOOLS}) - (cd ${APK_TOOLS_DIR}; tar xzvf ${APK_TOOLS}) + (cd "${APK_TOOLS_DIR}"; curl "${APK_TOOLS_URL}" > "${APK_TOOLS}") + (cd "${APK_TOOLS_DIR}"; tar xzvf "${APK_TOOLS}") if [ ! -e "${APK_TOOLS_DIR}/sbin" ] ; then echo "apk-tools install failed: ${APK_TOOLS_DIR}" exit @@ -6276,21 +6819,21 @@ alpine36_setup() SUDO=sudo - $SUDO ${APK_TOOLS_DIR}/sbin/apk.static \ - -X ${ALPINE_MIRROR}/${OS_RELVER}/main \ + $SUDO "${APK_TOOLS_DIR}/sbin/apk.static" \ + -X "${ALPINE_MIRROR}/${OS_RELVER}/main" \ -U \ --allow-untrusted \ - --root ${OS_ROOTDIR} \ + --root "${OS_ROOTDIR}" \ --initdb add alpine-base alpine-sdk bash libc-dev make autoconf m4 automake \ libbsd libbsd-dev fts fts-dev libconfig-dev musl-dev bash diffutils \ file $SUDO /bin/chown -R "$(id -u).$(id -g)" "${OS_ROOTDIR}" $SUDO /bin/chmod -R u+rw "${OS_ROOTDIR}" - /bin/mkdir -p ${OS_ROOTDIR}/proc - /bin/mkdir -p ${OS_ROOTDIR}/root - /bin/mkdir -p ${OS_ROOTDIR}/etc/apk - /bin/echo "$ALPINE_MIRROR/$OS_RELVER/main" > ${OS_ROOTDIR}/etc/apk/repositories + /bin/mkdir -p "${OS_ROOTDIR}/proc" + /bin/mkdir -p "${OS_ROOTDIR}/root" + /bin/mkdir -p "${OS_ROOTDIR}/etc/apk" + /bin/echo "$ALPINE_MIRROR/$OS_RELVER/main" > "${OS_ROOTDIR}/etc/apk/repositories" } alpine36_build_fakechroot() @@ -6363,12 +6906,12 @@ alpine38_setup() if [ -e "${APK_TOOLS_DIR}/sbin" ] ; then echo "apk-tools already installed : ${APK_TOOLS_DIR}" else - /bin/rm -f ${APK_TOOLS} - mkdir ${APK_TOOLS_DIR} + /bin/rm -f "${APK_TOOLS}" + mkdir "${APK_TOOLS_DIR}" local APK_TOOLS_URL="${ALPINE_MIRROR}/${OS_RELVER}/main/${OS_ARCH}/${APK_TOOLS}" echo "download apk-tools : ${APK_TOOLS_URL}" - (cd ${APK_TOOLS_DIR}; curl ${APK_TOOLS_URL} > ${APK_TOOLS}) - (cd ${APK_TOOLS_DIR}; tar xzvf ${APK_TOOLS}) + (cd "${APK_TOOLS_DIR}"; curl "${APK_TOOLS_URL}" > "${APK_TOOLS}") + (cd "${APK_TOOLS_DIR}"; tar xzvf "${APK_TOOLS}") if [ ! -e "${APK_TOOLS_DIR}/sbin" ] ; then echo "apk-tools install failed: ${APK_TOOLS_DIR}" exit @@ -6377,20 +6920,20 @@ alpine38_setup() SUDO=sudo - $SUDO ${APK_TOOLS_DIR}/sbin/apk.static \ - -X ${ALPINE_MIRROR}/${OS_RELVER}/main \ + $SUDO "${APK_TOOLS_DIR}/sbin/apk.static" \ + -X "${ALPINE_MIRROR}/${OS_RELVER}/main" \ -U \ --allow-untrusted \ - --root ${OS_ROOTDIR} \ + --root "${OS_ROOTDIR}" \ --initdb add alpine-base alpine-sdk bash libc-dev make autoconf m4 automake \ libbsd libbsd-dev fts fts-dev libconfig-dev musl-dev bash diffutils file $SUDO /bin/chown -R "$(id -u).$(id -g)" "${OS_ROOTDIR}" $SUDO /bin/chmod -R u+rw "${OS_ROOTDIR}" - /bin/mkdir -p ${OS_ROOTDIR}/proc - /bin/mkdir -p ${OS_ROOTDIR}/root - /bin/mkdir -p ${OS_ROOTDIR}/etc/apk - /bin/echo "$ALPINE_MIRROR/$OS_RELVER/main" > ${OS_ROOTDIR}/etc/apk/repositories + /bin/mkdir -p "${OS_ROOTDIR}/proc" + /bin/mkdir -p "${OS_ROOTDIR}/root" + /bin/mkdir -p "${OS_ROOTDIR}/etc/apk" + /bin/echo "$ALPINE_MIRROR/$OS_RELVER/main" > "${OS_ROOTDIR}/etc/apk/repositories" } alpine38_build_fakechroot() @@ -6463,12 +7006,12 @@ alpine39_setup() if [ -e "${APK_TOOLS_DIR}/sbin" ] ; then echo "apk-tools already installed : ${APK_TOOLS_DIR}" else - /bin/rm -f ${APK_TOOLS} - mkdir ${APK_TOOLS_DIR} + /bin/rm -f "${APK_TOOLS}" + mkdir "${APK_TOOLS_DIR}" local APK_TOOLS_URL="${ALPINE_MIRROR}/${OS_RELVER}/main/${OS_ARCH}/${APK_TOOLS}" echo "download apk-tools : ${APK_TOOLS_URL}" - (cd ${APK_TOOLS_DIR}; curl ${APK_TOOLS_URL} > ${APK_TOOLS}) - (cd ${APK_TOOLS_DIR}; tar xzvf ${APK_TOOLS}) + (cd "${APK_TOOLS_DIR}"; curl "${APK_TOOLS_URL}" > "${APK_TOOLS}") + (cd "${APK_TOOLS_DIR}"; tar xzvf "${APK_TOOLS}") if [ ! -e "${APK_TOOLS_DIR}/sbin" ] ; then echo "apk-tools install failed: ${APK_TOOLS_DIR}" exit @@ -6477,20 +7020,20 @@ alpine39_setup() SUDO=sudo - $SUDO ${APK_TOOLS_DIR}/sbin/apk.static \ - -X ${ALPINE_MIRROR}/${OS_RELVER}/main \ + $SUDO "${APK_TOOLS_DIR}/sbin/apk.static" \ + -X "${ALPINE_MIRROR}/${OS_RELVER}/main" \ -U \ --allow-untrusted \ - --root ${OS_ROOTDIR} \ + --root "${OS_ROOTDIR}" \ --initdb add alpine-base alpine-sdk bash libc-dev make autoconf m4 automake \ libbsd libbsd-dev fts fts-dev libconfig-dev musl-dev bash diffutils file $SUDO /bin/chown -R "$(id -u).$(id -g)" "${OS_ROOTDIR}" $SUDO /bin/chmod -R u+rw "${OS_ROOTDIR}" - /bin/mkdir -p ${OS_ROOTDIR}/proc - /bin/mkdir -p ${OS_ROOTDIR}/root - /bin/mkdir -p ${OS_ROOTDIR}/etc/apk - /bin/echo "$ALPINE_MIRROR/$OS_RELVER/main" > ${OS_ROOTDIR}/etc/apk/repositories + /bin/mkdir -p "${OS_ROOTDIR}/proc" + /bin/mkdir -p "${OS_ROOTDIR}/root" + /bin/mkdir -p "${OS_ROOTDIR}/etc/apk" + /bin/echo "$ALPINE_MIRROR/$OS_RELVER/main" > "${OS_ROOTDIR}/etc/apk/repositories" } alpine39_build_fakechroot() @@ -6564,12 +7107,12 @@ alpine310_setup() if [ -e "${APK_TOOLS_DIR}/sbin" ] ; then echo "apk-tools already installed : ${APK_TOOLS_DIR}" else - /bin/rm -f ${APK_TOOLS} - mkdir ${APK_TOOLS_DIR} + /bin/rm -f "${APK_TOOLS}" + mkdir "${APK_TOOLS_DIR}" local APK_TOOLS_URL="${ALPINE_MIRROR}/${OS_RELVER}/main/${OS_ARCH}/${APK_TOOLS}" echo "download apk-tools : ${APK_TOOLS_URL}" - (cd ${APK_TOOLS_DIR}; curl ${APK_TOOLS_URL} > ${APK_TOOLS}) - (cd ${APK_TOOLS_DIR}; tar xzvf ${APK_TOOLS}) + (cd "${APK_TOOLS_DIR}"; curl "${APK_TOOLS_URL}" > "${APK_TOOLS}") + (cd "${APK_TOOLS_DIR}"; tar xzvf "${APK_TOOLS}") if [ ! -e "${APK_TOOLS_DIR}/sbin" ] ; then echo "apk-tools install failed: ${APK_TOOLS_DIR}" exit @@ -6578,20 +7121,20 @@ alpine310_setup() SUDO=sudo - $SUDO ${APK_TOOLS_DIR}/sbin/apk.static \ - -X ${ALPINE_MIRROR}/${OS_RELVER}/main \ + $SUDO "${APK_TOOLS_DIR}/sbin/apk.static" \ + -X "${ALPINE_MIRROR}/${OS_RELVER}/main" \ -U \ --allow-untrusted \ - --root ${OS_ROOTDIR} \ + --root "${OS_ROOTDIR}" \ --initdb add alpine-base alpine-sdk bash libc-dev make autoconf m4 automake \ libbsd libbsd-dev fts fts-dev libconfig-dev musl-dev bash diffutils file $SUDO /bin/chown -R "$(id -u).$(id -g)" "${OS_ROOTDIR}" $SUDO /bin/chmod -R u+rw "${OS_ROOTDIR}" - /bin/mkdir -p ${OS_ROOTDIR}/proc - /bin/mkdir -p ${OS_ROOTDIR}/root - /bin/mkdir -p ${OS_ROOTDIR}/etc/apk - /bin/echo "$ALPINE_MIRROR/$OS_RELVER/main" > ${OS_ROOTDIR}/etc/apk/repositories + /bin/mkdir -p "${OS_ROOTDIR}/proc" + /bin/mkdir -p "${OS_ROOTDIR}/root" + /bin/mkdir -p "${OS_ROOTDIR}/etc/apk" + /bin/echo "$ALPINE_MIRROR/$OS_RELVER/main" > "${OS_ROOTDIR}/etc/apk/repositories" } alpine310_build_fakechroot() @@ -6665,12 +7208,12 @@ alpine311_setup() if [ -e "${APK_TOOLS_DIR}/sbin" ] ; then echo "apk-tools already installed : ${APK_TOOLS_DIR}" else - /bin/rm -f ${APK_TOOLS} - mkdir ${APK_TOOLS_DIR} + /bin/rm -f "${APK_TOOLS}" + mkdir "${APK_TOOLS_DIR}" local APK_TOOLS_URL="${ALPINE_MIRROR}/${OS_RELVER}/main/${OS_ARCH}/${APK_TOOLS}" echo "download apk-tools : ${APK_TOOLS_URL}" - (cd ${APK_TOOLS_DIR}; curl ${APK_TOOLS_URL} > ${APK_TOOLS}) - (cd ${APK_TOOLS_DIR}; tar xzvf ${APK_TOOLS}) + (cd "${APK_TOOLS_DIR}"; curl "${APK_TOOLS_URL}" > "${APK_TOOLS}") + (cd "${APK_TOOLS_DIR}"; tar xzvf "${APK_TOOLS}") if [ ! -e "${APK_TOOLS_DIR}/sbin" ] ; then echo "apk-tools install failed: ${APK_TOOLS_DIR}" exit @@ -6679,20 +7222,20 @@ alpine311_setup() SUDO=sudo - $SUDO ${APK_TOOLS_DIR}/sbin/apk.static \ - -X ${ALPINE_MIRROR}/${OS_RELVER}/main \ + $SUDO "${APK_TOOLS_DIR}/sbin/apk.static" \ + -X "${ALPINE_MIRROR}/${OS_RELVER}/main" \ -U \ --allow-untrusted \ - --root ${OS_ROOTDIR} \ + --root "${OS_ROOTDIR}" \ --initdb add alpine-base alpine-sdk bash libc-dev make autoconf m4 automake \ libbsd libbsd-dev fts fts-dev libconfig-dev musl-dev bash diffutils file $SUDO /bin/chown -R "$(id -u).$(id -g)" "${OS_ROOTDIR}" $SUDO /bin/chmod -R u+rw "${OS_ROOTDIR}" - /bin/mkdir -p ${OS_ROOTDIR}/proc - /bin/mkdir -p ${OS_ROOTDIR}/root - /bin/mkdir -p ${OS_ROOTDIR}/etc/apk - /bin/echo "$ALPINE_MIRROR/$OS_RELVER/main" > ${OS_ROOTDIR}/etc/apk/repositories + /bin/mkdir -p "${OS_ROOTDIR}/proc" + /bin/mkdir -p "${OS_ROOTDIR}/root" + /bin/mkdir -p "${OS_ROOTDIR}/etc/apk" + /bin/echo "$ALPINE_MIRROR/$OS_RELVER/main" > "${OS_ROOTDIR}/etc/apk/repositories" } alpine311_build_fakechroot() @@ -6766,12 +7309,12 @@ alpine312_setup() if [ -e "${APK_TOOLS_DIR}/sbin" ] ; then echo "apk-tools already installed : ${APK_TOOLS_DIR}" else - /bin/rm -f ${APK_TOOLS} - mkdir ${APK_TOOLS_DIR} + /bin/rm -f "${APK_TOOLS}" + mkdir "${APK_TOOLS_DIR}" local APK_TOOLS_URL="${ALPINE_MIRROR}/${OS_RELVER}/main/${OS_ARCH}/${APK_TOOLS}" echo "download apk-tools : ${APK_TOOLS_URL}" - (cd ${APK_TOOLS_DIR}; curl ${APK_TOOLS_URL} > ${APK_TOOLS}) - (cd ${APK_TOOLS_DIR}; tar xzvf ${APK_TOOLS}) + (cd "${APK_TOOLS_DIR}"; curl "${APK_TOOLS_URL}" > "${APK_TOOLS}") + (cd "${APK_TOOLS_DIR}"; tar xzvf "${APK_TOOLS}") if [ ! -e "${APK_TOOLS_DIR}/sbin" ] ; then echo "apk-tools install failed: ${APK_TOOLS_DIR}" exit @@ -6780,21 +7323,21 @@ alpine312_setup() SUDO=sudo - $SUDO ${APK_TOOLS_DIR}/sbin/apk.static \ - -X ${ALPINE_MIRROR}/${OS_RELVER}/main \ + $SUDO "${APK_TOOLS_DIR}/sbin/apk.static" \ + -X "${ALPINE_MIRROR}/${OS_RELVER}/main" \ -U \ --allow-untrusted \ - --root ${OS_ROOTDIR} \ + --root "${OS_ROOTDIR}" \ --initdb add alpine-base alpine-sdk bash libc-dev make autoconf m4 automake \ libbsd libbsd-dev fts fts-dev libconfig-dev musl-dev bash diffutils \ file $SUDO /bin/chown -R "$(id -u).$(id -g)" "${OS_ROOTDIR}" $SUDO /bin/chmod -R u+rw "${OS_ROOTDIR}" - /bin/mkdir -p ${OS_ROOTDIR}/proc - /bin/mkdir -p ${OS_ROOTDIR}/root - /bin/mkdir -p ${OS_ROOTDIR}/etc/apk - /bin/echo "$ALPINE_MIRROR/$OS_RELVER/main" > ${OS_ROOTDIR}/etc/apk/repositories + /bin/mkdir -p "${OS_ROOTDIR}/proc" + /bin/mkdir -p "${OS_ROOTDIR}/root" + /bin/mkdir -p "${OS_ROOTDIR}/etc/apk" + /bin/echo "$ALPINE_MIRROR/$OS_RELVER/main" > "${OS_ROOTDIR}/etc/apk/repositories" } alpine312_build_fakechroot() @@ -6868,12 +7411,12 @@ alpine313_setup() if [ -e "${APK_TOOLS_DIR}/sbin" ] ; then echo "apk-tools already installed : ${APK_TOOLS_DIR}" else - /bin/rm -f ${APK_TOOLS} - mkdir ${APK_TOOLS_DIR} + /bin/rm -f "${APK_TOOLS}" + mkdir "${APK_TOOLS_DIR}" local APK_TOOLS_URL="${ALPINE_MIRROR}/${OS_RELVER}/main/${OS_ARCH}/${APK_TOOLS}" echo "download apk-tools : ${APK_TOOLS_URL}" - (cd ${APK_TOOLS_DIR}; curl ${APK_TOOLS_URL} > ${APK_TOOLS}) - (cd ${APK_TOOLS_DIR}; tar xzvf ${APK_TOOLS}) + (cd "${APK_TOOLS_DIR}"; curl "${APK_TOOLS_URL}" > "${APK_TOOLS}") + (cd "${APK_TOOLS_DIR}"; tar xzvf "${APK_TOOLS}") if [ ! -e "${APK_TOOLS_DIR}/sbin" ] ; then echo "apk-tools install failed: ${APK_TOOLS_DIR}" exit @@ -6882,21 +7425,21 @@ alpine313_setup() SUDO=sudo - $SUDO ${APK_TOOLS_DIR}/sbin/apk.static \ - -X ${ALPINE_MIRROR}/${OS_RELVER}/main \ + $SUDO "${APK_TOOLS_DIR}/sbin/apk.static" \ + -X "${ALPINE_MIRROR}/${OS_RELVER}/main" \ -U \ --allow-untrusted \ - --root ${OS_ROOTDIR} \ + --root "${OS_ROOTDIR}" \ --initdb add alpine-base alpine-sdk bash libc-dev make autoconf m4 automake \ libbsd libbsd-dev fts fts-dev libconfig-dev musl-dev bash diffutils \ file $SUDO /bin/chown -R "$(id -u).$(id -g)" "${OS_ROOTDIR}" $SUDO /bin/chmod -R u+rw "${OS_ROOTDIR}" - /bin/mkdir -p ${OS_ROOTDIR}/proc - /bin/mkdir -p ${OS_ROOTDIR}/root - /bin/mkdir -p ${OS_ROOTDIR}/etc/apk - /bin/echo "$ALPINE_MIRROR/$OS_RELVER/main" > ${OS_ROOTDIR}/etc/apk/repositories + /bin/mkdir -p "${OS_ROOTDIR}/proc" + /bin/mkdir -p "${OS_ROOTDIR}/root" + /bin/mkdir -p "${OS_ROOTDIR}/etc/apk" + /bin/echo "$ALPINE_MIRROR/$OS_RELVER/main" > "${OS_ROOTDIR}/etc/apk/repositories" } alpine313_build_fakechroot() @@ -6970,12 +7513,12 @@ alpine314_setup() if [ -e "${APK_TOOLS_DIR}/sbin" ] ; then echo "apk-tools already installed : ${APK_TOOLS_DIR}" else - /bin/rm -f ${APK_TOOLS} - mkdir ${APK_TOOLS_DIR} + /bin/rm -f "${APK_TOOLS}" + mkdir "${APK_TOOLS_DIR}" local APK_TOOLS_URL="${ALPINE_MIRROR}/${OS_RELVER}/main/${OS_ARCH}/${APK_TOOLS}" echo "download apk-tools : ${APK_TOOLS_URL}" - (cd ${APK_TOOLS_DIR}; curl ${APK_TOOLS_URL} > ${APK_TOOLS}) - (cd ${APK_TOOLS_DIR}; tar xzvf ${APK_TOOLS}) + (cd "${APK_TOOLS_DIR}"; curl "${APK_TOOLS_URL}" > "${APK_TOOLS}") + (cd "${APK_TOOLS_DIR}"; tar xzvf "${APK_TOOLS}") if [ ! -e "${APK_TOOLS_DIR}/sbin" ] ; then echo "apk-tools install failed: ${APK_TOOLS_DIR}" exit @@ -6984,21 +7527,21 @@ alpine314_setup() SUDO=sudo - $SUDO ${APK_TOOLS_DIR}/sbin/apk.static \ - -X ${ALPINE_MIRROR}/${OS_RELVER}/main \ + $SUDO "${APK_TOOLS_DIR}/sbin/apk.static" \ + -X "${ALPINE_MIRROR}/${OS_RELVER}/main" \ -U \ --allow-untrusted \ - --root ${OS_ROOTDIR} \ + --root "${OS_ROOTDIR}" \ --initdb add alpine-base alpine-sdk bash libc-dev make autoconf m4 automake \ libbsd libbsd-dev fts fts-dev libconfig-dev musl-dev bash diffutils \ file $SUDO /bin/chown -R "$(id -u).$(id -g)" "${OS_ROOTDIR}" $SUDO /bin/chmod -R u+rw "${OS_ROOTDIR}" - /bin/mkdir -p ${OS_ROOTDIR}/proc - /bin/mkdir -p ${OS_ROOTDIR}/root - /bin/mkdir -p ${OS_ROOTDIR}/etc/apk - /bin/echo "$ALPINE_MIRROR/$OS_RELVER/main" > ${OS_ROOTDIR}/etc/apk/repositories + /bin/mkdir -p "${OS_ROOTDIR}/proc" + /bin/mkdir -p "${OS_ROOTDIR}/root" + /bin/mkdir -p "${OS_ROOTDIR}/etc/apk" + /bin/echo "$ALPINE_MIRROR/$OS_RELVER/main" > "${OS_ROOTDIR}/etc/apk/repositories" } alpine314_build_fakechroot() @@ -7076,12 +7619,12 @@ alpine315_setup() if [ -e "${APK_TOOLS_DIR}/sbin" ] ; then echo "apk-tools already installed : ${APK_TOOLS_DIR}" else - /bin/rm -f ${APK_TOOLS} - mkdir ${APK_TOOLS_DIR} + /bin/rm -f "${APK_TOOLS}" + mkdir "${APK_TOOLS_DIR}" local APK_TOOLS_URL="${ALPINE_MIRROR}/${OS_RELVER}/main/${OS_ARCH}/${APK_TOOLS}" echo "download apk-tools : ${APK_TOOLS_URL}" - (cd ${APK_TOOLS_DIR}; curl ${APK_TOOLS_URL} > ${APK_TOOLS}) - (cd ${APK_TOOLS_DIR}; tar xzvf ${APK_TOOLS}) + (cd "${APK_TOOLS_DIR}"; curl "${APK_TOOLS_URL}" > "${APK_TOOLS}") + (cd "${APK_TOOLS_DIR}"; tar xzvf "${APK_TOOLS}") if [ ! -e "${APK_TOOLS_DIR}/sbin" ] ; then echo "apk-tools install failed: ${APK_TOOLS_DIR}" exit @@ -7090,21 +7633,21 @@ alpine315_setup() SUDO=sudo - $SUDO ${APK_TOOLS_DIR}/sbin/apk.static \ - -X ${ALPINE_MIRROR}/${OS_RELVER}/main \ + $SUDO "${APK_TOOLS_DIR}/sbin/apk.static" \ + -X "${ALPINE_MIRROR}/${OS_RELVER}/main" \ -U \ --allow-untrusted \ - --root ${OS_ROOTDIR} \ + --root "${OS_ROOTDIR}" \ --initdb add alpine-base alpine-sdk bash libc-dev make autoconf m4 automake \ libbsd libbsd-dev fts fts-dev libconfig-dev musl-dev bash diffutils \ file $SUDO /bin/chown -R "$(id -u).$(id -g)" "${OS_ROOTDIR}" $SUDO /bin/chmod -R u+rw "${OS_ROOTDIR}" - /bin/mkdir -p ${OS_ROOTDIR}/proc - /bin/mkdir -p ${OS_ROOTDIR}/root - /bin/mkdir -p ${OS_ROOTDIR}/etc/apk - /bin/echo "$ALPINE_MIRROR/$OS_RELVER/main" > ${OS_ROOTDIR}/etc/apk/repositories + /bin/mkdir -p "${OS_ROOTDIR}/proc" + /bin/mkdir -p "${OS_ROOTDIR}/root" + /bin/mkdir -p "${OS_ROOTDIR}/etc/apk" + /bin/echo "$ALPINE_MIRROR/$OS_RELVER/main" > "${OS_ROOTDIR}/etc/apk/repositories" } alpine315_build_fakechroot() @@ -7182,12 +7725,12 @@ alpine316_setup() if [ -e "${APK_TOOLS_DIR}/sbin" ] ; then echo "apk-tools already installed : ${APK_TOOLS_DIR}" else - /bin/rm -f ${APK_TOOLS} - mkdir ${APK_TOOLS_DIR} + /bin/rm -f "${APK_TOOLS}" + mkdir "${APK_TOOLS_DIR}" local APK_TOOLS_URL="${ALPINE_MIRROR}/${OS_RELVER}/main/${OS_ARCH}/${APK_TOOLS}" echo "download apk-tools : ${APK_TOOLS_URL}" - (cd ${APK_TOOLS_DIR}; curl ${APK_TOOLS_URL} > ${APK_TOOLS}) - (cd ${APK_TOOLS_DIR}; tar xzvf ${APK_TOOLS}) + (cd "${APK_TOOLS_DIR}"; curl "${APK_TOOLS_URL}" > "${APK_TOOLS}") + (cd "${APK_TOOLS_DIR}"; tar xzvf "${APK_TOOLS}") if [ ! -e "${APK_TOOLS_DIR}/sbin" ] ; then echo "apk-tools install failed: ${APK_TOOLS_DIR}" exit @@ -7196,21 +7739,21 @@ alpine316_setup() SUDO=sudo - $SUDO ${APK_TOOLS_DIR}/sbin/apk.static \ - -X ${ALPINE_MIRROR}/${OS_RELVER}/main \ + $SUDO "${APK_TOOLS_DIR}/sbin/apk.static" \ + -X "${ALPINE_MIRROR}/${OS_RELVER}/main" \ -U \ --allow-untrusted \ - --root ${OS_ROOTDIR} \ + --root "${OS_ROOTDIR}" \ --initdb add alpine-base alpine-sdk bash libc-dev make autoconf m4 automake \ libbsd libbsd-dev fts fts-dev libconfig-dev musl-dev bash diffutils \ file $SUDO /bin/chown -R "$(id -u).$(id -g)" "${OS_ROOTDIR}" $SUDO /bin/chmod -R u+rw "${OS_ROOTDIR}" - /bin/mkdir -p ${OS_ROOTDIR}/proc - /bin/mkdir -p ${OS_ROOTDIR}/root - /bin/mkdir -p ${OS_ROOTDIR}/etc/apk - /bin/echo "$ALPINE_MIRROR/$OS_RELVER/main" > ${OS_ROOTDIR}/etc/apk/repositories + /bin/mkdir -p "${OS_ROOTDIR}/proc" + /bin/mkdir -p "${OS_ROOTDIR}/root" + /bin/mkdir -p "${OS_ROOTDIR}/etc/apk" + /bin/echo "$ALPINE_MIRROR/$OS_RELVER/main" > "${OS_ROOTDIR}/etc/apk/repositories" } alpine316_build_fakechroot() @@ -7288,12 +7831,12 @@ alpine317_setup() if [ -e "${APK_TOOLS_DIR}/sbin" ] ; then echo "apk-tools already installed : ${APK_TOOLS_DIR}" else - /bin/rm -f ${APK_TOOLS} - mkdir ${APK_TOOLS_DIR} + /bin/rm -f "${APK_TOOLS}" + mkdir "${APK_TOOLS_DIR}" local APK_TOOLS_URL="${ALPINE_MIRROR}/${OS_RELVER}/main/${OS_ARCH}/${APK_TOOLS}" echo "download apk-tools : ${APK_TOOLS_URL}" - (cd ${APK_TOOLS_DIR}; curl ${APK_TOOLS_URL} > ${APK_TOOLS}) - (cd ${APK_TOOLS_DIR}; tar xzvf ${APK_TOOLS}) + (cd "${APK_TOOLS_DIR}"; curl "${APK_TOOLS_URL}" > "${APK_TOOLS}") + (cd "${APK_TOOLS_DIR}"; tar xzvf "${APK_TOOLS}") if [ ! -e "${APK_TOOLS_DIR}/sbin" ] ; then echo "apk-tools install failed: ${APK_TOOLS_DIR}" exit @@ -7303,11 +7846,11 @@ alpine317_setup() SUDO=sudo set -x - $SUDO ${APK_TOOLS_DIR}/sbin/apk.static \ - -X ${ALPINE_MIRROR}/${OS_RELVER}/main \ + $SUDO "${APK_TOOLS_DIR}/sbin/apk.static" \ + -X "${ALPINE_MIRROR}/${OS_RELVER}/main" \ -U \ --allow-untrusted \ - --root ${OS_ROOTDIR} \ + --root "${OS_ROOTDIR}" \ --initdb add alpine-base alpine-sdk bash libc-dev make autoconf m4 automake \ libbsd libbsd-dev musl-fts musl-fts-dev libconfig-dev musl-dev bash \ diffutils file @@ -7315,10 +7858,10 @@ alpine317_setup() $SUDO /bin/chown -R "$(id -u).$(id -g)" "${OS_ROOTDIR}" $SUDO /bin/chmod -R u+rw "${OS_ROOTDIR}" - /bin/mkdir -p ${OS_ROOTDIR}/proc - /bin/mkdir -p ${OS_ROOTDIR}/root - /bin/mkdir -p ${OS_ROOTDIR}/etc/apk - /bin/echo "$ALPINE_MIRROR/$OS_RELVER/main" > ${OS_ROOTDIR}/etc/apk/repositories + /bin/mkdir -p "${OS_ROOTDIR}/proc" + /bin/mkdir -p "${OS_ROOTDIR}/root" + /bin/mkdir -p "${OS_ROOTDIR}/etc/apk" + /bin/echo "$ALPINE_MIRROR/$OS_RELVER/main" > "${OS_ROOTDIR}/etc/apk/repositories" } alpine317_build_fakechroot() @@ -7396,12 +7939,12 @@ alpine318_setup() if [ -e "${APK_TOOLS_DIR}/sbin" ] ; then echo "apk-tools already installed : ${APK_TOOLS_DIR}" else - /bin/rm -f ${APK_TOOLS} - mkdir ${APK_TOOLS_DIR} + /bin/rm -f "${APK_TOOLS}" + mkdir "${APK_TOOLS_DIR}" local APK_TOOLS_URL="${ALPINE_MIRROR}/${OS_RELVER}/main/${OS_ARCH}/${APK_TOOLS}" echo "download apk-tools : ${APK_TOOLS_URL}" - (cd ${APK_TOOLS_DIR}; curl ${APK_TOOLS_URL} > ${APK_TOOLS}) - (cd ${APK_TOOLS_DIR}; tar xzvf ${APK_TOOLS}) + (cd "${APK_TOOLS_DIR}"; curl "${APK_TOOLS_URL}" > "${APK_TOOLS}") + (cd "${APK_TOOLS_DIR}"; tar xzvf "${APK_TOOLS}") if [ ! -e "${APK_TOOLS_DIR}/sbin" ] ; then echo "apk-tools install failed: ${APK_TOOLS_DIR}" exit @@ -7411,11 +7954,11 @@ alpine318_setup() SUDO=sudo set -x - $SUDO ${APK_TOOLS_DIR}/sbin/apk.static \ - -X ${ALPINE_MIRROR}/${OS_RELVER}/main \ + $SUDO "${APK_TOOLS_DIR}/sbin/apk.static" \ + -X "${ALPINE_MIRROR}/${OS_RELVER}/main" \ -U \ --allow-untrusted \ - --root ${OS_ROOTDIR} \ + --root "${OS_ROOTDIR}" \ --initdb add alpine-base alpine-sdk bash libc-dev make autoconf m4 automake \ libbsd libbsd-dev musl-fts musl-fts-dev libconfig-dev musl-dev bash \ diffutils file @@ -7423,10 +7966,10 @@ alpine318_setup() $SUDO /bin/chown -R "$(id -u).$(id -g)" "${OS_ROOTDIR}" $SUDO /bin/chmod -R u+rw "${OS_ROOTDIR}" - /bin/mkdir -p ${OS_ROOTDIR}/proc - /bin/mkdir -p ${OS_ROOTDIR}/root - /bin/mkdir -p ${OS_ROOTDIR}/etc/apk - /bin/echo "$ALPINE_MIRROR/$OS_RELVER/main" > ${OS_ROOTDIR}/etc/apk/repositories + /bin/mkdir -p "${OS_ROOTDIR}/proc" + /bin/mkdir -p "${OS_ROOTDIR}/root" + /bin/mkdir -p "${OS_ROOTDIR}/etc/apk" + /bin/echo "$ALPINE_MIRROR/$OS_RELVER/main" > "${OS_ROOTDIR}/etc/apk/repositories" } alpine318_build_fakechroot() @@ -7504,7 +8047,7 @@ nix_setup() /bin/mkdir -p "${OS_ROOTDIR}/crun" #/bin/mkdir -p "${OS_ROOTDIR}/etc" - curl -L https://nixos.org/nix/install > $OS_ROOTDIR/nix_installer.sh + curl -L https://nixos.org/nix/install > "$OS_ROOTDIR/nix_installer.sh" /bin/rm -f "${OS_ROOTDIR}/etc/resolv.conf" /bin/cp -f /etc/resolv.conf "${OS_ROOTDIR}/etc" @@ -7515,7 +8058,7 @@ nix_setup() #$SUDO mount -t devpts none "${OS_ROOTDIR}/dev/pts" -o ptmxmode=0666,newinstance set -xv - $SUDO /usr/sbin/chroot --userspec=$USER ${OS_ROOTDIR} /bin/bash <<'EOF_nix_setup_1' + $SUDO /usr/sbin/chroot --userspec="$USER" "${OS_ROOTDIR}" /bin/bash <<'EOF_nix_setup_1' export HOME=/home/user export USER=user export LOGNAME=user @@ -7557,7 +8100,7 @@ nix_build_crun() $SUDO mount --bind /dev/pts "${OS_ROOTDIR}/dev/pts" #$SUDO mount -t devpts none "${OS_ROOTDIR}/dev/pts" -o ptmxmode=0666,newinstance set -xv - $SUDO /usr/sbin/chroot --userspec=$USER ${OS_ROOTDIR} /bin/bash <<'EOF_nix_crun_1' + $SUDO /usr/sbin/chroot --userspec="$USER" "${OS_ROOTDIR}" /bin/bash <<'EOF_nix_crun_1' export HOME=/home/user export USER=user export LOGNAME=user @@ -7595,190 +8138,47 @@ ostree_delete() # CREATE TARBALL PACKAGE # ############################################################################# -create_package_tarball() +copy_file() { - echo "create_package_tarball : $TARBALL_FILE" - if [ ! -f "${BUILD_DIR}/proot-source-x86/proot-Fedora-30.bin" ] ; then - echo "ERROR: failed to compile : ${BUILD_DIR}/proot-source-x86/proot-Fedora-30.bin" - return - fi - if [ ! -f "${BUILD_DIR}/proot-source-x86_64/proot-Fedora-30.bin" ] ; then - echo "ERROR: failed to compile : ${BUILD_DIR}/proot-source-x86_64/proot-Fedora-30.bin" - return - fi - if [ ! -f "${BUILD_DIR}/proot-source-aarch64/proot-Fedora-31.bin" ] ; then - echo "ERROR: failed to compile : ${BUILD_DIR}/proot-source-aarch64/proot-Fedora-31.bin" - return - fi - if [ ! -f "${BUILD_DIR}/patchelf-source-x86_64/patchelf-Fedora-25" ] ; then - echo "ERROR: failed to compile : ${BUILD_DIR}/patchelf-source-x86_64/patchelf-Fedora-25" - return - fi - if [ ! -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Fedora-25.so" ] ; then - echo "ERROR: failed to compile : ${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Fedora-25.so" - return - fi - if [ ! -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Fedora-29.so" ] ; then - echo "ERROR: failed to compile : ${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Fedora-29.so" - return - fi - if [ ! -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Fedora-30.so" ] ; then - echo "ERROR: failed to compile : ${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Fedora-30.so" - return - fi - if [ ! -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Fedora-31.so" ] ; then - echo "ERROR: failed to compile : ${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Fedora-31.so" - return - fi - if [ ! -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Fedora-32.so" ] ; then - echo "ERROR: failed to compile : ${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Fedora-32.so" - return - fi - if [ ! -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Fedora-33.so" ] ; then - echo "ERROR: failed to compile : ${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Fedora-33.so" - return - fi - if [ ! -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Fedora-34.so" ] ; then - echo "ERROR: failed to compile : ${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Fedora-34.so" - return - fi - if [ ! -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Fedora-35.so" ] ; then - echo "ERROR: failed to compile : ${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Fedora-35.so" - return - fi - if [ ! -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Fedora-36.so" ] ; then - echo "ERROR: failed to compile : ${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Fedora-36.so" - return - fi - if [ ! -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Fedora-38.so" ] ; then - echo "ERROR: failed to compile : ${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Fedora-38.so" - return - fi - if [ ! -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-CentOS-6.so" ] ; then - echo "ERROR: failed to compile : ${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-CentOS-6.so" - return - fi - if [ ! -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-CentOS-7.so" ] ; then - echo "ERROR: failed to compile : ${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-CentOS-7.so" - return - fi - if [ ! -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-CentOS-8.so" ] ; then - echo "ERROR: failed to compile : ${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-CentOS-8.so" - return - fi - if [ ! -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-CentOS-9.so" ] ; then - echo "ERROR: failed to compile : ${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-CentOS-9.so" - return - fi - if [ ! -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Rocky-8.so" ] ; then - echo "ERROR: failed to compile : ${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Rocky-8.so" - return - fi - if [ ! -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Rocky-9.so" ] ; then - echo "ERROR: failed to compile : ${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Rocky-9.so" - return - fi - if [ ! -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-AlmaLinux-9.so" ] ; then - echo "ERROR: failed to compile : ${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-AlmaLinux-9.so" - return - fi - if [ ! -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Ubuntu-12.so" ] ; then - echo "ERROR: failed to compile : ${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Ubuntu-12.so" - return - fi - if [ ! -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Ubuntu-14.so" ] ; then - echo "ERROR: failed to compile : ${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Ubuntu-14.so" - return - fi - if [ ! -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Ubuntu-16.so" ] ; then - echo "ERROR: failed to compile : ${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Ubuntu-16.so" - return - fi - if [ ! -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Ubuntu-18.so" ] ; then - echo "ERROR: failed to compile : ${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Ubuntu-18.so" - return - fi - if [ ! -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Ubuntu-19.so" ] ; then - echo "ERROR: failed to compile : ${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Ubuntu-19.so" - return - fi - if [ ! -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Ubuntu-20.so" ] ; then - echo "ERROR: failed to compile : ${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Ubuntu-20.so" - return - fi - if [ ! -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Ubuntu-21.so" ] ; then - echo "ERROR: failed to compile : ${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Ubuntu-21.so" - return - fi - if [ ! -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Ubuntu-22.so" ] ; then - echo "ERROR: failed to compile : ${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Ubuntu-22.so" - return - fi - if [ ! -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Ubuntu-23.so" ] ; then - echo "ERROR: failed to compile : ${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Ubuntu-23.so" - return - fi - if [ ! -f "${BUILD_DIR}/fakechroot-source-musl-x86_64/libfakechroot-Alpine-3.6.so" ] ; then - echo "ERROR: failed to compile : ${BUILD_DIR}/fakechroot-source-musl-x86_64/libfakechroot-Alpine-3.6.so" - return - fi - if [ ! -f "${BUILD_DIR}/fakechroot-source-musl-x86_64/libfakechroot-Alpine-3.8.so" ] ; then - echo "ERROR: failed to compile : ${BUILD_DIR}/fakechroot-source-musl-x86_64/libfakechroot-Alpine-3.8.so" - return - fi - if [ ! -f "${BUILD_DIR}/fakechroot-source-musl-x86_64/libfakechroot-Alpine-3.9.so" ] ; then - echo "ERROR: failed to compile : ${BUILD_DIR}/fakechroot-source-musl-x86_64/libfakechroot-Alpine-3.9.so" - return - fi - if [ ! -f "${BUILD_DIR}/fakechroot-source-musl-x86_64/libfakechroot-Alpine-3.10.so" ] ; then - echo "ERROR: failed to compile : ${BUILD_DIR}/fakechroot-source-musl-x86_64/libfakechroot-Alpine-3.10.so" - return - fi - if [ ! -f "${BUILD_DIR}/fakechroot-source-musl-x86_64/libfakechroot-Alpine-3.11.so" ] ; then - echo "ERROR: failed to compile : ${BUILD_DIR}/fakechroot-source-musl-x86_64/libfakechroot-Alpine-3.11.so" - return - fi - if [ ! -f "${BUILD_DIR}/fakechroot-source-musl-x86_64/libfakechroot-Alpine-3.12.so" ] ; then - echo "ERROR: failed to compile : ${BUILD_DIR}/fakechroot-source-musl-x86_64/libfakechroot-Alpine-3.12.so" - return - fi - if [ ! -f "${BUILD_DIR}/fakechroot-source-musl-x86_64/libfakechroot-Alpine-3.13.so" ] ; then - echo "ERROR: failed to compile : ${BUILD_DIR}/fakechroot-source-musl-x86_64/libfakechroot-Alpine-3.13.so" - return - fi - if [ ! -f "${BUILD_DIR}/fakechroot-source-musl-x86_64/libfakechroot-Alpine-3.14.so" ] ; then - echo "ERROR: failed to compile : ${BUILD_DIR}/fakechroot-source-musl-x86_64/libfakechroot-Alpine-3.14.so" - return - fi - if [ ! -f "${BUILD_DIR}/fakechroot-source-musl-x86_64/libfakechroot-Alpine-3.15.so" ] ; then - echo "ERROR: failed to compile : ${BUILD_DIR}/fakechroot-source-musl-x86_64/libfakechroot-Alpine-3.15.so" - return - fi - if [ ! -f "${BUILD_DIR}/fakechroot-source-musl-x86_64/libfakechroot-Alpine-3.16.so" ] ; then - echo "ERROR: failed to compile : ${BUILD_DIR}/fakechroot-source-musl-x86_64/libfakechroot-Alpine-3.16.so" - return + local SOURCE_FILE="${BUILD_DIR}/${1}" + local TARGET_FILE="${PACKAGE_DIR}/udocker_dir/${2}" + if [ ! -f "$SOURCE_FILE" ] ; then + echo "ERROR: copy_file file not found : $SOURCE_FILE" + exit 1 fi - if [ ! -f "${BUILD_DIR}/fakechroot-source-musl-x86_64/libfakechroot-Alpine-3.17.so" ] ; then - echo "ERROR: failed to compile : ${BUILD_DIR}/fakechroot-source-musl-x86_64/libfakechroot-Alpine-3.17.so" - return + if [ -e "$TARGET_FILE" ] ; then + echo "ERROR: copy_file target file already exists : $TARGET_FILE" + exit 1 fi - if [ ! -f "${BUILD_DIR}/fakechroot-source-musl-x86_64/libfakechroot-Alpine-3.18.so" ] ; then - echo "ERROR: failed to compile : ${BUILD_DIR}/fakechroot-source-musl-x86_64/libfakechroot-Alpine-3.18.so" - return + /bin/cp -f "$SOURCE_FILE" "$TARGET_FILE" +} + +link_file() +{ + local SOURCE_FILE="${PACKAGE_DIR}/udocker_dir/${1}" + local TARGET_FILE="$2" + if [ ! -f "$SOURCE_FILE" ] ; then + echo "ERROR: link_file file not found : $SOURCE_FILE" + exit 1 fi - if [ ! -f "${BUILD_DIR}/runc-source-x86_64/runc" ] ; then - echo "ERROR: failed to compile : ${BUILD_DIR}/runc-source-x86_64/runc" - return + SOURCE_DIR=$(dirname "$SOURCE_FILE") + SOURCE_BASENAME=$(basename "$SOURCE_FILE") + TARGET_BASENAME=$(basename "$TARGET_FILE") + if [ -z "$SOURCE_DIR" ] || [ -z "$SOURCE_BASENAME" ] ; then + echo "ERROR: link_file directory or filename is empty : $SOURCE_FILE" + exit 1 fi - if [ ! -f "${BUILD_DIR}/crun-source-x86_64/crun-nix-latest" ] ; then - echo "ERROR: failed to compile : ${BUILD_DIR}/crun-source-x86_64/crun-nix-latest" - return + if [ -e "${SOURCE_DIR}/${TARGET_BASENAME}" ]; then + echo "ERROR: link_file target for link already exists : ${SOURCE_DIR}/${TARGET_BASENAME}" + exit 1 fi + ( cd "$SOURCE_DIR"; /bin/ln -s "$SOURCE_BASENAME" "$TARGET_BASENAME" ) +} - if [ ! -f "${BUILD_DIR}/fakechroot-source-glibc-aarch64/libfakechroot-Rocky-8.so" ] ; then - echo "ERROR: failed to compile : ${BUILD_DIR}/fakechroot-source-glibc-aarch/libfakechroot-Rocky-8.so" - return - fi + +create_package_tarball() +{ + echo "create_package_tarball : $TARBALL_FILE" if [ -n "$DEVEL3" ] ; then echo "$TARBALL_VERSION_P3" @@ -7788,196 +8188,220 @@ create_package_tarball() echo "$TARBALL_VERSION_P2" > "${PACKAGE_DIR}/udocker_dir/lib/VERSION" fi - /bin/cp -f "${BUILD_DIR}/proot-source-x86/proot-Fedora-30.bin" \ - "${PACKAGE_DIR}/udocker_dir/bin/proot-x86-4_8_0" - /bin/cp -f "${BUILD_DIR}/proot-source-x86_64/proot-Fedora-30.bin" \ - "${PACKAGE_DIR}/udocker_dir/bin/proot-x86_64-4_8_0" - /bin/cp -f "${BUILD_DIR}/proot-source-aarch64/proot-Fedora-31.bin" \ - "${PACKAGE_DIR}/udocker_dir/bin/proot-arm64-4_8_0" - /bin/cp -f "${BUILD_DIR}/proot-source-x86/proot-Fedora-25.bin" \ - "${PACKAGE_DIR}/udocker_dir/bin/proot-x86" - /bin/cp -f "${BUILD_DIR}/proot-source-x86_64/proot-Fedora-25.bin" \ - "${PACKAGE_DIR}/udocker_dir/bin/proot-x86_64" - /bin/cp -f "${BUILD_DIR}/proot-source-x86_64/COPYING" \ - "${PACKAGE_DIR}/udocker_dir/doc/COPYING.proot" - - /bin/cp -f "${BUILD_DIR}/patchelf-source-x86_64/patchelf-Fedora-25" \ - "${PACKAGE_DIR}/udocker_dir/bin/patchelf-x86_64" - /bin/cp -f "${BUILD_DIR}/patchelf-source-x86_64/COPYING" \ - "${PACKAGE_DIR}/udocker_dir/doc/COPYING.patchelf" - - /bin/cp -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Fedora-25.so" \ - "${PACKAGE_DIR}/udocker_dir/lib/libfakechroot-Fedora-25-x86_64.so" - /bin/cp -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Fedora-29.so" \ - "${PACKAGE_DIR}/udocker_dir/lib/libfakechroot-Fedora-29-x86_64.so" - /bin/cp -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Fedora-30.so" \ - "${PACKAGE_DIR}/udocker_dir/lib/libfakechroot-Fedora-30-x86_64.so" - /bin/cp -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Fedora-31.so" \ - "${PACKAGE_DIR}/udocker_dir/lib/libfakechroot-Fedora-31-x86_64.so" - /bin/cp -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Fedora-32.so" \ - "${PACKAGE_DIR}/udocker_dir/lib/libfakechroot-Fedora-32-x86_64.so" - /bin/cp -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Fedora-33.so" \ - "${PACKAGE_DIR}/udocker_dir/lib/libfakechroot-Fedora-33-x86_64.so" - /bin/cp -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Fedora-34.so" \ - "${PACKAGE_DIR}/udocker_dir/lib/libfakechroot-Fedora-34-x86_64.so" - /bin/cp -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Fedora-35.so" \ - "${PACKAGE_DIR}/udocker_dir/lib/libfakechroot-Fedora-35-x86_64.so" - /bin/cp -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Fedora-36.so" \ - "${PACKAGE_DIR}/udocker_dir/lib/libfakechroot-Fedora-36-x86_64.so" - /bin/cp -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-CentOS-6.so" \ - "${PACKAGE_DIR}/udocker_dir/lib/libfakechroot-Fedora-38-x86_64.so" - /bin/cp -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-CentOS-6.so" \ - "${PACKAGE_DIR}/udocker_dir/lib/libfakechroot-CentOS-6-x86_64.so" - /bin/cp -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-CentOS-7.so" \ - "${PACKAGE_DIR}/udocker_dir/lib/libfakechroot-CentOS-7-x86_64.so" - /bin/cp -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-CentOS-8.so" \ - "${PACKAGE_DIR}/udocker_dir/lib/libfakechroot-CentOS-8-x86_64.so" - /bin/cp -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-CentOS-9.so" \ - "${PACKAGE_DIR}/udocker_dir/lib/libfakechroot-CentOS-9-x86_64.so" - /bin/cp -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Rocky-8.so" \ - "${PACKAGE_DIR}/udocker_dir/lib/libfakechroot-Rocky-8-x86_64.so" - /bin/cp -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Rocky-9.so" \ - "${PACKAGE_DIR}/udocker_dir/lib/libfakechroot-Rocky-9-x86_64.so" - /bin/cp -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-AlmaLinux-9.so" \ - "${PACKAGE_DIR}/udocker_dir/lib/libfakechroot-AlmaLinux-9-x86_64.so" - /bin/cp -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Ubuntu-12.so" \ - "${PACKAGE_DIR}/udocker_dir/lib/libfakechroot-Ubuntu-12-x86_64.so" - /bin/cp -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Ubuntu-14.so" \ - "${PACKAGE_DIR}/udocker_dir/lib/libfakechroot-Ubuntu-14-x86_64.so" - /bin/cp -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Ubuntu-16.so" \ - "${PACKAGE_DIR}/udocker_dir/lib/libfakechroot-Ubuntu-16-x86_64.so" - /bin/cp -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Ubuntu-18.so" \ - "${PACKAGE_DIR}/udocker_dir/lib/libfakechroot-Ubuntu-18-x86_64.so" - /bin/cp -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Ubuntu-19.so" \ - "${PACKAGE_DIR}/udocker_dir/lib/libfakechroot-Ubuntu-19-x86_64.so" - /bin/cp -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Ubuntu-20.so" \ - "${PACKAGE_DIR}/udocker_dir/lib/libfakechroot-Ubuntu-20-x86_64.so" - /bin/cp -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Ubuntu-21.so" \ - "${PACKAGE_DIR}/udocker_dir/lib/libfakechroot-Ubuntu-21-x86_64.so" - /bin/cp -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Ubuntu-22.so" \ - "${PACKAGE_DIR}/udocker_dir/lib/libfakechroot-Ubuntu-22-x86_64.so" - /bin/cp -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-Ubuntu-23.so" \ - "${PACKAGE_DIR}/udocker_dir/lib/libfakechroot-Ubuntu-23-x86_64.so" - /bin/cp -f "${BUILD_DIR}/fakechroot-source-musl-x86_64/libfakechroot-Alpine-3.6.so" \ - "${PACKAGE_DIR}/udocker_dir/lib/libfakechroot-Alpine-3.6-x86_64.so" - /bin/cp -f "${BUILD_DIR}/fakechroot-source-musl-x86_64/libfakechroot-Alpine-3.8.so" \ - "${PACKAGE_DIR}/udocker_dir/lib/libfakechroot-Alpine-3.8-x86_64.so" - /bin/cp -f "${BUILD_DIR}/fakechroot-source-musl-x86_64/libfakechroot-Alpine-3.9.so" \ - "${PACKAGE_DIR}/udocker_dir/lib/libfakechroot-Alpine-3.9-x86_64.so" - /bin/cp -f "${BUILD_DIR}/fakechroot-source-musl-x86_64/libfakechroot-Alpine-3.10.so" \ - "${PACKAGE_DIR}/udocker_dir/lib/libfakechroot-Alpine-3.10-x86_64.so" - /bin/cp -f "${BUILD_DIR}/fakechroot-source-musl-x86_64/libfakechroot-Alpine-3.11.so" \ - "${PACKAGE_DIR}/udocker_dir/lib/libfakechroot-Alpine-3.11-x86_64.so" - /bin/cp -f "${BUILD_DIR}/fakechroot-source-musl-x86_64/libfakechroot-Alpine-3.12.so" \ - "${PACKAGE_DIR}/udocker_dir/lib/libfakechroot-Alpine-3.12-x86_64.so" - /bin/cp -f "${BUILD_DIR}/fakechroot-source-musl-x86_64/libfakechroot-Alpine-3.13.so" \ - "${PACKAGE_DIR}/udocker_dir/lib/libfakechroot-Alpine-3.13-x86_64.so" - /bin/cp -f "${BUILD_DIR}/fakechroot-source-musl-x86_64/libfakechroot-Alpine-3.14.so" \ - "${PACKAGE_DIR}/udocker_dir/lib/libfakechroot-Alpine-3.14-x86_64.so" - /bin/cp -f "${BUILD_DIR}/fakechroot-source-musl-x86_64/libfakechroot-Alpine-3.15.so" \ - "${PACKAGE_DIR}/udocker_dir/lib/libfakechroot-Alpine-3.15-x86_64.so" - /bin/cp -f "${BUILD_DIR}/fakechroot-source-musl-x86_64/libfakechroot-Alpine-3.16.so" \ - "${PACKAGE_DIR}/udocker_dir/lib/libfakechroot-Alpine-3.16-x86_64.so" - /bin/cp -f "${BUILD_DIR}/fakechroot-source-musl-x86_64/libfakechroot-Alpine-3.17.so" \ - "${PACKAGE_DIR}/udocker_dir/lib/libfakechroot-Alpine-3.17-x86_64.so" - /bin/cp -f "${BUILD_DIR}/fakechroot-source-musl-x86_64/libfakechroot-Alpine-3.18.so" \ - "${PACKAGE_DIR}/udocker_dir/lib/libfakechroot-Alpine-3.18-x86_64.so" - /bin/cp -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/LICENSE" \ - "${PACKAGE_DIR}/udocker_dir/doc/LICENSE.fakechroot" - /bin/cp -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/COPYING" \ - "${PACKAGE_DIR}/udocker_dir/doc/COPYING.fakechroot" - - /bin/cp -f "${BUILD_DIR}/fakechroot-source-glibc-aarch64/libfakechroot-Rocky-8.so" \ - "${PACKAGE_DIR}/udocker_dir/lib/libfakechroot-Rocky-8-arm64.so" - - /bin/cp -f "${BUILD_DIR}/runc-source-x86_64/runc" \ - "${PACKAGE_DIR}/udocker_dir/bin/runc-x86_64" - /bin/cp -f "${BUILD_DIR}/runc-source-x86_64/LICENSE" \ - "${PACKAGE_DIR}/udocker_dir/doc/LICENSE.runc" - - /bin/cp -f "${BUILD_DIR}/crun-source-x86_64/crun-nix-latest" \ - "${PACKAGE_DIR}/udocker_dir/bin/crun-x86_64" - /bin/cp -f "${BUILD_DIR}/crun-source-x86_64/COPYING" \ - "${PACKAGE_DIR}/udocker_dir/doc/COPYING.crun" - - ( cd "${PACKAGE_DIR}/udocker_dir/lib"; \ - ln -s libfakechroot-Ubuntu-14-x86_64.so libfakechroot-x86_64.so ; \ - ln -s libfakechroot-Fedora-25-x86_64.so libfakechroot-Fedora-18-x86_64.so ; \ - ln -s libfakechroot-Fedora-25-x86_64.so libfakechroot-Fedora-19-x86_64.so ; \ - ln -s libfakechroot-Fedora-25-x86_64.so libfakechroot-Fedora-20-x86_64.so ; \ - ln -s libfakechroot-Fedora-25-x86_64.so libfakechroot-Fedora-21-x86_64.so ; \ - ln -s libfakechroot-Fedora-25-x86_64.so libfakechroot-Fedora-22-x86_64.so ; \ - ln -s libfakechroot-Fedora-25-x86_64.so libfakechroot-Fedora-23-x86_64.so ; \ - ln -s libfakechroot-Fedora-25-x86_64.so libfakechroot-Fedora-24-x86_64.so ; \ - ln -s libfakechroot-Fedora-25-x86_64.so libfakechroot-Fedora-26-x86_64.so ; \ - ln -s libfakechroot-Fedora-25-x86_64.so libfakechroot-Fedora-27-x86_64.so ; \ - ln -s libfakechroot-Fedora-25-x86_64.so libfakechroot-Fedora-28-x86_64.so ; \ - ln -s libfakechroot-Fedora-36-x86_64.so libfakechroot-Fedora-37-x86_64.so ; \ - ln -s libfakechroot-Fedora-38-x86_64.so libfakechroot-Fedora-x86_64.so ; \ - ln -s libfakechroot-CentOS-6-x86_64.so libfakechroot-Red-4-x86_64.so ; \ - ln -s libfakechroot-CentOS-6-x86_64.so libfakechroot-Red-5-x86_64.so ; \ - ln -s libfakechroot-CentOS-6-x86_64.so libfakechroot-Red-6-x86_64.so ; \ - ln -s libfakechroot-CentOS-7-x86_64.so libfakechroot-Red-7-x86_64.so ; \ - ln -s libfakechroot-Rocky-8-x86_64.so libfakechroot-Red-8-x86_64.so ; \ - ln -s libfakechroot-Rocky-9-x86_64.so libfakechroot-Red-9-x86_64.so ; \ - ln -s libfakechroot-Rocky-9-x86_64.so libfakechroot-Red-x86_64.so ; \ - ln -s libfakechroot-Rocky-9-x86_64.so libfakechroot-Rocky-x86_64.so ; \ - ln -s libfakechroot-Rocky-8-x86_64.so libfakechroot-AlmaLinux-8-x86_64.so ; \ - ln -s libfakechroot-AlmaLinux-9-x86_64.so libfakechroot-AlmaLinux-x86_64.so ; \ - ln -s libfakechroot-CentOS-6-x86_64.so libfakechroot-Scientific-4-x86_64.so ; \ - ln -s libfakechroot-CentOS-6-x86_64.so libfakechroot-Scientific-5-x86_64.so ; \ - ln -s libfakechroot-CentOS-6-x86_64.so libfakechroot-Scientific-6-x86_64.so ; \ - ln -s libfakechroot-CentOS-7-x86_64.so libfakechroot-Scientific-7-x86_64.so ; \ - ln -s libfakechroot-CentOS-8-x86_64.so libfakechroot-Scientific-x86_64.so ; \ - ln -s libfakechroot-Ubuntu-12-x86_64.so libfakechroot-Debian-7-x86_64.so ; \ - ln -s libfakechroot-Ubuntu-14-x86_64.so libfakechroot-Debian-8-x86_64.so ; \ - ln -s libfakechroot-Ubuntu-16-x86_64.so libfakechroot-Debian-9-x86_64.so ; \ - ln -s libfakechroot-Ubuntu-19-x86_64.so libfakechroot-Debian-10-x86_64.so ; \ - ln -s libfakechroot-Ubuntu-21-x86_64.so libfakechroot-Debian-11-x86_64.so ; \ - ln -s libfakechroot-Ubuntu-23-x86_64.so libfakechroot-Debian-x86_64.so ; \ - ln -s libfakechroot-CentOS-6-x86_64.so libfakechroot-CentOS-4-x86_64.so ; \ - ln -s libfakechroot-CentOS-6-x86_64.so libfakechroot-CentOS-5-x86_64.so ; \ - ln -s libfakechroot-CentOS-9-x86_64.so libfakechroot-CentOS-x86_64.so ; \ - ln -s libfakechroot-Ubuntu-12-x86_64.so libfakechroot-LinuxMint-10-x86_64.so ; \ - ln -s libfakechroot-Ubuntu-12-x86_64.so libfakechroot-LinuxMint-11-x86_64.so ; \ - ln -s libfakechroot-Ubuntu-12-x86_64.so libfakechroot-LinuxMint-12-x86_64.so ; \ - ln -s libfakechroot-Ubuntu-14-x86_64.so libfakechroot-LinuxMint-13-x86_64.so ; \ - ln -s libfakechroot-Ubuntu-14-x86_64.so libfakechroot-LinuxMint-14-x86_64.so ; \ - ln -s libfakechroot-Ubuntu-16-x86_64.so libfakechroot-LinuxMint-15-x86_64.so ; \ - ln -s libfakechroot-Ubuntu-16-x86_64.so libfakechroot-LinuxMint-16-x86_64.so ; \ - ln -s libfakechroot-Ubuntu-18-x86_64.so libfakechroot-LinuxMint-17-x86_64.so ; \ - ln -s libfakechroot-Ubuntu-18-x86_64.so libfakechroot-LinuxMint-18-x86_64.so ; \ - ln -s libfakechroot-Ubuntu-19-x86_64.so libfakechroot-LinuxMint-19-x86_64.so ; \ - ln -s libfakechroot-Ubuntu-20-x86_64.so libfakechroot-LinuxMint-20-x86_64.so ; \ - ln -s libfakechroot-Ubuntu-21-x86_64.so libfakechroot-LinuxMint-21-x86_64.so ; \ - ln -s libfakechroot-Ubuntu-22-x86_64.so libfakechroot-LinuxMint-22-x86_64.so ; \ - ln -s libfakechroot-Ubuntu-23-x86_64.so libfakechroot-LinuxMint-23-x86_64.so ; \ - ln -s libfakechroot-Ubuntu-23-x86_64.so libfakechroot-LinuxMint-x86_64.so ; \ - ln -s libfakechroot-Ubuntu-14-x86_64.so libfakechroot-Ubuntu-9-x86_64.so ; \ - ln -s libfakechroot-Ubuntu-14-x86_64.so libfakechroot-Ubuntu-10-x86_64.so ; \ - ln -s libfakechroot-Ubuntu-14-x86_64.so libfakechroot-Ubuntu-11-x86_64.so ; \ - ln -s libfakechroot-Ubuntu-14-x86_64.so libfakechroot-Ubuntu-13-x86_64.so ; \ - ln -s libfakechroot-Ubuntu-16-x86_64.so libfakechroot-Ubuntu-15-x86_64.so ; \ - ln -s libfakechroot-Ubuntu-18-x86_64.so libfakechroot-Ubuntu-17-x86_64.so ; \ - ln -s libfakechroot-Ubuntu-23-x86_64.so libfakechroot-Ubuntu-x86_64.so ; \ - ln -s libfakechroot-Alpine-3.6-x86_64.so libfakechroot-Alpine-3.0-x86_64.so ; \ - ln -s libfakechroot-Alpine-3.6-x86_64.so libfakechroot-Alpine-3.1-x86_64.so ; \ - ln -s libfakechroot-Alpine-3.6-x86_64.so libfakechroot-Alpine-3.2-x86_64.so ; \ - ln -s libfakechroot-Alpine-3.6-x86_64.so libfakechroot-Alpine-3.3-x86_64.so ; \ - ln -s libfakechroot-Alpine-3.6-x86_64.so libfakechroot-Alpine-3.4-x86_64.so ; \ - ln -s libfakechroot-Alpine-3.6-x86_64.so libfakechroot-Alpine-3.5-x86_64.so ; \ - ln -s libfakechroot-Alpine-3.16-x86_64.so libfakechroot-Alpine-x86_64.so ) - + # documents ---------------------------------------------------------------------------------------------- + copy_file proot-source-x86_64/COPYING doc/COPYING.proot + copy_file patchelf-source-x86_64/COPYING doc/COPYING.patchelf + copy_file fakechroot-source-glibc-x86_64/LICENSE doc/LICENSE.fakechroot + copy_file fakechroot-source-glibc-x86_64/COPYING doc/COPYING.fakechroot + copy_file runc-source-x86_64/LICENSE doc/LICENSE.runc + copy_file crun-source-x86_64/COPYING doc/COPYING.crun + + # x86 ---------------------------------------------------------------------------------------------------- + copy_file proot-source-x86/proot-Fedora-25.bin bin/proot-x86 + copy_file proot-source-x86/proot-Fedora-30.bin bin/proot-x86-4_8_0 + + # x86_64 ------------------------------------------------------------------------------------------------- + copy_file proot-source-x86_64/proot-Fedora-25.bin bin/proot-x86_64 + copy_file proot-source-x86_64/proot-Fedora-30.bin bin/proot-x86_64-4_8_0 + + copy_file patchelf-source-x86_64/patchelf-Fedora-25 bin/patchelf-x86_64 + + copy_file runc-source-x86_64/runc-Ubuntu-22.bin bin/runc-x86_64 + copy_file crun-source-x86_64/crun-nix-latest bin/crun-x86_64 + + copy_file fakechroot-source-glibc-x86_64/libfakechroot-Fedora-25.so lib/libfakechroot-Fedora-25-x86_64.so + link_file lib/libfakechroot-Fedora-25-x86_64.so libfakechroot-Fedora-18-x86_64.so + link_file lib/libfakechroot-Fedora-25-x86_64.so libfakechroot-Fedora-19-x86_64.so + link_file lib/libfakechroot-Fedora-25-x86_64.so libfakechroot-Fedora-20-x86_64.so + link_file lib/libfakechroot-Fedora-25-x86_64.so libfakechroot-Fedora-21-x86_64.so + link_file lib/libfakechroot-Fedora-25-x86_64.so libfakechroot-Fedora-22-x86_64.so + link_file lib/libfakechroot-Fedora-25-x86_64.so libfakechroot-Fedora-23-x86_64.so + link_file lib/libfakechroot-Fedora-25-x86_64.so libfakechroot-Fedora-24-x86_64.so + link_file lib/libfakechroot-Fedora-25-x86_64.so libfakechroot-Fedora-26-x86_64.so + link_file lib/libfakechroot-Fedora-25-x86_64.so libfakechroot-Fedora-27-x86_64.so + link_file lib/libfakechroot-Fedora-25-x86_64.so libfakechroot-Fedora-28-x86_64.so + copy_file fakechroot-source-glibc-x86_64/libfakechroot-Fedora-29.so lib/libfakechroot-Fedora-29-x86_64.so + copy_file fakechroot-source-glibc-x86_64/libfakechroot-Fedora-30.so lib/libfakechroot-Fedora-30-x86_64.so + copy_file fakechroot-source-glibc-x86_64/libfakechroot-Fedora-31.so lib/libfakechroot-Fedora-31-x86_64.so + copy_file fakechroot-source-glibc-x86_64/libfakechroot-Fedora-32.so lib/libfakechroot-Fedora-32-x86_64.so + copy_file fakechroot-source-glibc-x86_64/libfakechroot-Fedora-33.so lib/libfakechroot-Fedora-33-x86_64.so + copy_file fakechroot-source-glibc-x86_64/libfakechroot-Fedora-34.so lib/libfakechroot-Fedora-34-x86_64.so + copy_file fakechroot-source-glibc-x86_64/libfakechroot-Fedora-35.so lib/libfakechroot-Fedora-35-x86_64.so + copy_file fakechroot-source-glibc-x86_64/libfakechroot-Fedora-36.so lib/libfakechroot-Fedora-36-x86_64.so + link_file lib/libfakechroot-Fedora-36-x86_64.so libfakechroot-Fedora-37-x86_64.so + copy_file fakechroot-source-glibc-x86_64/libfakechroot-Fedora-38.so lib/libfakechroot-Fedora-38-x86_64.so + link_file lib/libfakechroot-Fedora-38-x86_64.so libfakechroot-Fedora-x86_64.so + + copy_file fakechroot-source-glibc-x86_64/libfakechroot-CentOS-6.so lib/libfakechroot-CentOS-6-x86_64.so + copy_file fakechroot-source-glibc-x86_64/libfakechroot-CentOS-7.so lib/libfakechroot-CentOS-7-x86_64.so + copy_file fakechroot-source-glibc-x86_64/libfakechroot-CentOS-8.so lib/libfakechroot-CentOS-8-x86_64.so + copy_file fakechroot-source-glibc-x86_64/libfakechroot-CentOS-9.so lib/libfakechroot-CentOS-9-x86_64.so + link_file lib/libfakechroot-CentOS-6-x86_64.so libfakechroot-CentOS-4-x86_64.so + link_file lib/libfakechroot-CentOS-6-x86_64.so libfakechroot-CentOS-5-x86_64.so + link_file lib/libfakechroot-CentOS-9-x86_64.so libfakechroot-CentOS-x86_64.so + + #copy_file fakechroot-source-glibc-x86_64/libfakechroot-Rocky-8.so lib/libfakechroot-Rocky-8-x86_64.so + #copy_file fakechroot-source-glibc-x86_64/libfakechroot-Rocky-9.so lib/libfakechroot-Rocky-9-x86_64.so + #link_file fakechroot-source-glibc-x86_64/libfakechroot-Rocky-9.so libfakechroot-Rocky-x86_64.so + + copy_file fakechroot-source-glibc-x86_64/libfakechroot-AlmaLinux-8.so lib/libfakechroot-AlmaLinux-8-x86_64.so + copy_file fakechroot-source-glibc-x86_64/libfakechroot-AlmaLinux-9.so lib/libfakechroot-AlmaLinux-9-x86_64.so + link_file lib/libfakechroot-AlmaLinux-9-x86_64.so libfakechroot-AlmaLinux-x86_64.so + + link_file lib/libfakechroot-CentOS-6-x86_64.so libfakechroot-Red-4-x86_64.so + link_file lib/libfakechroot-CentOS-6-x86_64.so libfakechroot-Red-5-x86_64.so + link_file lib/libfakechroot-CentOS-6-x86_64.so libfakechroot-Red-6-x86_64.so + link_file lib/libfakechroot-CentOS-7-x86_64.so libfakechroot-Red-7-x86_64.so + link_file lib/libfakechroot-AlmaLinux-8-x86_64.so libfakechroot-Red-8-x86_64.so + link_file lib/libfakechroot-AlmaLinux-9-x86_64.so libfakechroot-Red-9-x86_64.so + link_file lib/libfakechroot-AlmaLinux-9-x86_64.so libfakechroot-Red-x86_64.so + + link_file lib/libfakechroot-CentOS-6-x86_64.so libfakechroot-Scientific-4-x86_64.so + link_file lib/libfakechroot-CentOS-6-x86_64.so libfakechroot-Scientific-5-x86_64.so + link_file lib/libfakechroot-CentOS-6-x86_64.so libfakechroot-Scientific-6-x86_64.so + link_file lib/libfakechroot-CentOS-7-x86_64.so libfakechroot-Scientific-7-x86_64.so + link_file lib/libfakechroot-AlmaLinux-8-x86_64.so libfakechroot-Scientific-8-x86_64.so + link_file lib/libfakechroot-AlmaLinux-9-x86_64.so libfakechroot-Scientific-9-x86_64.so + link_file lib/libfakechroot-AlmaLinux-9-x86_64.so libfakechroot-Scientific-x86_64.so + + link_file lib/libfakechroot-AlmaLinux-8-x86_64.so libfakechroot-Rocky-8-x86_64.so + link_file lib/libfakechroot-AlmaLinux-9-x86_64.so libfakechroot-Rocky-9-x86_64.so + link_file lib/libfakechroot-AlmaLinux-9-x86_64.so libfakechroot-Rocky-x86_64.so + + copy_file fakechroot-source-glibc-x86_64/libfakechroot-Ubuntu-12.so lib/libfakechroot-Ubuntu-12-x86_64.so + copy_file fakechroot-source-glibc-x86_64/libfakechroot-Ubuntu-14.so lib/libfakechroot-Ubuntu-14-x86_64.so + link_file lib/libfakechroot-Ubuntu-14-x86_64.so libfakechroot-x86_64.so + copy_file fakechroot-source-glibc-x86_64/libfakechroot-Ubuntu-16.so lib/libfakechroot-Ubuntu-16-x86_64.so + copy_file fakechroot-source-glibc-x86_64/libfakechroot-Ubuntu-18.so lib/libfakechroot-Ubuntu-18-x86_64.so + copy_file fakechroot-source-glibc-x86_64/libfakechroot-Ubuntu-19.so lib/libfakechroot-Ubuntu-19-x86_64.so + copy_file fakechroot-source-glibc-x86_64/libfakechroot-Ubuntu-20.so lib/libfakechroot-Ubuntu-20-x86_64.so + copy_file fakechroot-source-glibc-x86_64/libfakechroot-Ubuntu-21.so lib/libfakechroot-Ubuntu-21-x86_64.so + copy_file fakechroot-source-glibc-x86_64/libfakechroot-Ubuntu-22.so lib/libfakechroot-Ubuntu-22-x86_64.so + copy_file fakechroot-source-glibc-x86_64/libfakechroot-Ubuntu-23.so lib/libfakechroot-Ubuntu-23-x86_64.so + link_file lib/libfakechroot-Ubuntu-14-x86_64.so libfakechroot-Ubuntu-9-x86_64.so + link_file lib/libfakechroot-Ubuntu-14-x86_64.so libfakechroot-Ubuntu-10-x86_64.so + link_file lib/libfakechroot-Ubuntu-14-x86_64.so libfakechroot-Ubuntu-11-x86_64.so + link_file lib/libfakechroot-Ubuntu-14-x86_64.so libfakechroot-Ubuntu-13-x86_64.so + link_file lib/libfakechroot-Ubuntu-16-x86_64.so libfakechroot-Ubuntu-15-x86_64.so + link_file lib/libfakechroot-Ubuntu-18-x86_64.so libfakechroot-Ubuntu-17-x86_64.so + link_file lib/libfakechroot-Ubuntu-23-x86_64.so libfakechroot-Ubuntu-x86_64.so + + link_file lib/libfakechroot-Ubuntu-12-x86_64.so libfakechroot-Debian-7-x86_64.so + link_file lib/libfakechroot-Ubuntu-14-x86_64.so libfakechroot-Debian-8-x86_64.so + link_file lib/libfakechroot-Ubuntu-16-x86_64.so libfakechroot-Debian-9-x86_64.so + link_file lib/libfakechroot-Ubuntu-19-x86_64.so libfakechroot-Debian-10-x86_64.so + link_file lib/libfakechroot-Ubuntu-21-x86_64.so libfakechroot-Debian-11-x86_64.so + link_file lib/libfakechroot-Ubuntu-23-x86_64.so libfakechroot-Debian-x86_64.so + + link_file lib/libfakechroot-Ubuntu-12-x86_64.so libfakechroot-LinuxMint-10-x86_64.so + link_file lib/libfakechroot-Ubuntu-12-x86_64.so libfakechroot-LinuxMint-11-x86_64.so + link_file lib/libfakechroot-Ubuntu-12-x86_64.so libfakechroot-LinuxMint-12-x86_64.so + link_file lib/libfakechroot-Ubuntu-14-x86_64.so libfakechroot-LinuxMint-13-x86_64.so + link_file lib/libfakechroot-Ubuntu-14-x86_64.so libfakechroot-LinuxMint-14-x86_64.so + link_file lib/libfakechroot-Ubuntu-16-x86_64.so libfakechroot-LinuxMint-15-x86_64.so + link_file lib/libfakechroot-Ubuntu-16-x86_64.so libfakechroot-LinuxMint-16-x86_64.so + link_file lib/libfakechroot-Ubuntu-18-x86_64.so libfakechroot-LinuxMint-17-x86_64.so + link_file lib/libfakechroot-Ubuntu-18-x86_64.so libfakechroot-LinuxMint-18-x86_64.so + link_file lib/libfakechroot-Ubuntu-19-x86_64.so libfakechroot-LinuxMint-19-x86_64.so + link_file lib/libfakechroot-Ubuntu-20-x86_64.so libfakechroot-LinuxMint-20-x86_64.so + link_file lib/libfakechroot-Ubuntu-21-x86_64.so libfakechroot-LinuxMint-21-x86_64.so + link_file lib/libfakechroot-Ubuntu-22-x86_64.so libfakechroot-LinuxMint-22-x86_64.so + link_file lib/libfakechroot-Ubuntu-23-x86_64.so libfakechroot-LinuxMint-23-x86_64.so + link_file lib/libfakechroot-Ubuntu-23-x86_64.so libfakechroot-LinuxMint-x86_64.so + + copy_file fakechroot-source-musl-x86_64/libfakechroot-Alpine-3.6.so lib/libfakechroot-Alpine-3.6-x86_64.so + copy_file fakechroot-source-musl-x86_64/libfakechroot-Alpine-3.8.so lib/libfakechroot-Alpine-3.8-x86_64.so + copy_file fakechroot-source-musl-x86_64/libfakechroot-Alpine-3.9.so lib/libfakechroot-Alpine-3.9-x86_64.so + copy_file fakechroot-source-musl-x86_64/libfakechroot-Alpine-3.10.so lib/libfakechroot-Alpine-3.10-x86_64.so + copy_file fakechroot-source-musl-x86_64/libfakechroot-Alpine-3.11.so lib/libfakechroot-Alpine-3.11-x86_64.so + copy_file fakechroot-source-musl-x86_64/libfakechroot-Alpine-3.12.so lib/libfakechroot-Alpine-3.12-x86_64.so + copy_file fakechroot-source-musl-x86_64/libfakechroot-Alpine-3.13.so lib/libfakechroot-Alpine-3.13-x86_64.so + copy_file fakechroot-source-musl-x86_64/libfakechroot-Alpine-3.14.so lib/libfakechroot-Alpine-3.14-x86_64.so + copy_file fakechroot-source-musl-x86_64/libfakechroot-Alpine-3.15.so lib/libfakechroot-Alpine-3.15-x86_64.so + copy_file fakechroot-source-musl-x86_64/libfakechroot-Alpine-3.16.so lib/libfakechroot-Alpine-3.16-x86_64.so + copy_file fakechroot-source-musl-x86_64/libfakechroot-Alpine-3.17.so lib/libfakechroot-Alpine-3.17-x86_64.so + copy_file fakechroot-source-musl-x86_64/libfakechroot-Alpine-3.18.so lib/libfakechroot-Alpine-3.18-x86_64.so + link_file lib/libfakechroot-Alpine-3.6-x86_64.so libfakechroot-Alpine-3.0-x86_64.so + link_file lib/libfakechroot-Alpine-3.6-x86_64.so libfakechroot-Alpine-3.1-x86_64.so + link_file lib/libfakechroot-Alpine-3.6-x86_64.so libfakechroot-Alpine-3.2-x86_64.so + link_file lib/libfakechroot-Alpine-3.6-x86_64.so libfakechroot-Alpine-3.3-x86_64.so + link_file lib/libfakechroot-Alpine-3.6-x86_64.so libfakechroot-Alpine-3.4-x86_64.so + link_file lib/libfakechroot-Alpine-3.6-x86_64.so libfakechroot-Alpine-3.5-x86_64.so + link_file lib/libfakechroot-Alpine-3.18-x86_64.so libfakechroot-Alpine-x86_64.so + + # arch64 / amd64 ----------------------------------------------------------------------------------------- + copy_file proot-source-aarch64/proot-Fedora-31.bin bin/proot-arm64-4_8_0 + link_file bin/proot-arm64-4_8_0 proot-arm64 + copy_file patchelf-source-aarch64/patchelf-Fedora-31 bin/patchelf-arm64 + copy_file runc-source-aarch64/runc-Ubuntu-22.bin bin/runc-arm64 + + copy_file fakechroot-source-glibc-aarch64/libfakechroot-Fedora-36.so lib/libfakechroot-Fedora-36-arm64.so + copy_file fakechroot-source-glibc-aarch64/libfakechroot-Fedora-38.so lib/libfakechroot-Fedora-38-arm64.so + link_file lib/libfakechroot-Fedora-36-arm64.so libfakechroot-Fedora-37-arm64.so + link_file lib/libfakechroot-Fedora-38-arm64.so libfakechroot-Fedora-arm64.so + + copy_file fakechroot-source-glibc-aarch64/libfakechroot-CentOS-7.so lib/libfakechroot-CentOS-7-arm64.so + copy_file fakechroot-source-glibc-aarch64/libfakechroot-AlmaLinux-8.so lib/libfakechroot-AlmaLinux-8-arm64.so + copy_file fakechroot-source-glibc-aarch64/libfakechroot-AlmaLinux-9.so lib/libfakechroot-AlmaLinux-9-arm64.so + + copy_file fakechroot-source-glibc-aarch64/libfakechroot-Ubuntu-22.so lib/libfakechroot-Ubuntu-22-arm64.so + link_file lib/libfakechroot-Ubuntu-22-arm64.so libfakechroot-Ubuntu-arm64.so + link_file lib/libfakechroot-Ubuntu-22-arm64.so libfakechroot-LinuxMint-22-arm64.so + link_file lib/libfakechroot-Ubuntu-22-arm64.so libfakechroot-LinuxMint-arm64.so + link_file lib/libfakechroot-Ubuntu-22-arm64.so libfakechroot-Debian-11-arm64.so + link_file lib/libfakechroot-Ubuntu-22-arm64.so libfakechroot-Debian-arm64.so + + link_file lib/libfakechroot-AlmaLinux-8-arm64.so libfakechroot-CentOS-8-arm64.so + link_file lib/libfakechroot-AlmaLinux-9-arm64.so libfakechroot-CentOS-9-arm64.so + link_file lib/libfakechroot-AlmaLinux-9-arm64.so libfakechroot-CentOS-arm64.so + + link_file lib/libfakechroot-AlmaLinux-8-arm64.so libfakechroot-Rocky-8-arm64.so + link_file lib/libfakechroot-AlmaLinux-9-arm64.so libfakechroot-Rocky-9-arm64.so + link_file lib/libfakechroot-AlmaLinux-9-arm64.so libfakechroot-Rocky-arm64.so + + link_file lib/libfakechroot-AlmaLinux-8-arm64.so libfakechroot-Red-8-arm64.so + link_file lib/libfakechroot-AlmaLinux-9-arm64.so libfakechroot-Red-9-arm64.so + link_file lib/libfakechroot-AlmaLinux-9-arm64.so libfakechroot-Red-arm64.so + + # ppc64le ------------------------------------------------------------------------------------------------ + copy_file patchelf-source-ppc64le/patchelf-CentOS-7 bin/patchelf-ppc64le + copy_file runc-source-ppc64le/runc-Ubuntu-22.bin bin/runc-ppc64le + + copy_file fakechroot-source-glibc-ppc64le/libfakechroot-CentOS-7.so lib/libfakechroot-CentOS-7-ppc64le.so + copy_file fakechroot-source-glibc-ppc64le/libfakechroot-AlmaLinux-8.so lib/libfakechroot-AlmaLinux-8-ppc64le.so + copy_file fakechroot-source-glibc-ppc64le/libfakechroot-AlmaLinux-9.so lib/libfakechroot-AlmaLinux-9-ppc64le.so + copy_file fakechroot-source-glibc-ppc64le/libfakechroot-AlmaLinux-9.so lib/libfakechroot-AlmaLinux-ppc64le.so + + copy_file fakechroot-source-glibc-ppc64le/libfakechroot-Ubuntu-22.so lib/libfakechroot-Ubuntu-22-ppc64le.so + link_file lib/libfakechroot-Ubuntu-22-ppc64le.so libfakechroot-Ubuntu-ppc64le.so + link_file lib/libfakechroot-Ubuntu-22-ppc64le.so libfakechroot-LinuxMint-22-ppc64le.so + link_file lib/libfakechroot-Ubuntu-22-ppc64le.so libfakechroot-LinuxMint-ppc64le.so + link_file lib/libfakechroot-Ubuntu-22-ppc64le.so libfakechroot-Debian-11-ppc64le.so + link_file lib/libfakechroot-Ubuntu-22-ppc64le.so libfakechroot-Debian-ppc64le.so + + link_file lib/libfakechroot-AlmaLinux-8-ppc64le.so libfakechroot-CentOS-8-ppc64le.so + link_file lib/libfakechroot-AlmaLinux-9-ppc64le.so libfakechroot-CentOS-9-ppc64le.so + link_file lib/libfakechroot-AlmaLinux-9-ppc64le.so libfakechroot-CentOS-ppc64le.so + + link_file lib/libfakechroot-AlmaLinux-8-ppc64le.so libfakechroot-Rocky-8-ppc64le.so + link_file lib/libfakechroot-AlmaLinux-9-ppc64le.so libfakechroot-Rocky-9-ppc64le.so + link_file lib/libfakechroot-AlmaLinux-9-ppc64le.so libfakechroot-Rocky-ppc64le.so + + link_file lib/libfakechroot-AlmaLinux-8-ppc64le.so libfakechroot-Red-8-ppc64le.so + link_file lib/libfakechroot-AlmaLinux-9-ppc64le.so libfakechroot-Red-9-ppc64le.so + link_file lib/libfakechroot-AlmaLinux-9-ppc64le.so libfakechroot-Red-ppc64le.so + + # package ------------------------------------------------------------------------------------------------ find "${PACKAGE_DIR}" -type d -exec /bin/chmod u=rwx,og=rx {} \; find "${PACKAGE_DIR}" -type f -exec /bin/chmod u=+r+w,og=r {} \; find "${PACKAGE_DIR}/udocker_dir/bin" -type f -exec /bin/chmod u=rwx,og=rx {} \; - /bin/chmod u=rwx,og=rx ${PACKAGE_DIR}/setup.py + /bin/chmod u=rwx,og=rx "${PACKAGE_DIR}/setup.py" [ -e "${PACKAGE_DIR}/udocker" ] && \ - /bin/chmod u=rwx,og=rx ${PACKAGE_DIR}/udocker + /bin/chmod u=rwx,og=rx "${PACKAGE_DIR}/udocker" [ -e "${PACKAGE_DIR}/setup.py" ] && \ - /bin/chmod u=rwx,og=rx ${PACKAGE_DIR}/setup.py + /bin/chmod u=rwx,og=rx "${PACKAGE_DIR}/setup.py" - /bin/rm -f $TARBALL_FILE 2>&1 > /dev/null + /bin/rm -f "$TARBALL_FILE" > /dev/null 2>&1 cd "$PACKAGE_DIR" /bin/rm -f "$TARBALL_FILE" @@ -7988,7 +8412,7 @@ create_package_tarball() # MAIN # ################################################################## -utils_dir="$(dirname $(readlink -e $0))" +utils_dir="$(dirname $(readlink -e "$0"))" REPO_DIR="$(dirname $utils_dir)" sanity_check @@ -7997,7 +8421,7 @@ BUILD_DIR="${HOME}/udocker-englib-${TARBALL_VERSION_P3}" S_PROOT_DIR="${BUILD_DIR}/proot-static-build/static" S_PROOT_PACKAGES_DIR="${BUILD_DIR}/proot-static-build/packages" PACKAGE_DIR="${BUILD_DIR}/package" -TALLOC_TAR="$BUILD_DIR/libtalloc/talloc.tar.gz" +#TALLOC_TAR="$BUILD_DIR/libtalloc/talloc.tar.gz" if [ -n "$DEVEL3" ]; then TARBALL_FILE="${BUILD_DIR}/udocker-englib-${TARBALL_VERSION_P3}.tar.gz" @@ -8013,7 +8437,7 @@ fi #get_proot_static -get_udocker_build "1.2.10" +get_udocker_static "1.2.10" get_libtalloc @@ -8027,7 +8451,7 @@ prepare_package ERASE # ####### prepare_proot_source "${BUILD_DIR}/proot-source-x86" # -#fedora25_setup "i386" +fedora25_setup "i386" fedora25_build_proot "i386" "${BUILD_DIR}/proot-source-x86" #ostree_delete "i386" "fedora" "25" # @@ -8044,10 +8468,8 @@ prepare_patchelf_source "${BUILD_DIR}/patchelf-source-x86_64" prepare_fakechroot_glibc_source "${BUILD_DIR}/fakechroot-source-glibc-x86_64" prepare_fakechroot_musl_source "${BUILD_DIR}/fakechroot-source-musl-x86_64" prepare_runc_source "${BUILD_DIR}/runc-source-x86_64" -prepare_crun_source "${BUILD_DIR}/crun-source-x86_64" -# fedora25_setup "x86_64" fedora25_build_proot "x86_64" "${BUILD_DIR}/proot-source-x86_64" fedora25_build_patchelf "x86_64" "${BUILD_DIR}/patchelf-source-x86_64" @@ -8100,16 +8522,12 @@ fedora38_setup "x86_64" fedora38_build_fakechroot "x86_64" "${BUILD_DIR}/fakechroot-source-glibc-x86_64" #ostree_delete "x86_64" "fedora" "38" - - -# fedora29_setup "x86_64" #fedora29_build_proot "x86_64" "${BUILD_DIR}/proot-source-x86_64" #fedora29_build_patchelf "x86_64" "${BUILD_DIR}/patchelf-source-x86_64" fedora29_build_fakechroot "x86_64" "${BUILD_DIR}/fakechroot-source-glibc-x86_64" #ostree_delete "x86_64" "fedora" "29" -# alpine36_setup "x86_64" alpine36_build_fakechroot "x86_64" "${BUILD_DIR}/fakechroot-source-musl-x86_64" #ostree_delete "x86_64" "alpine" "3.6" @@ -8158,7 +8576,6 @@ alpine318_setup "x86_64" alpine318_build_fakechroot "x86_64" "${BUILD_DIR}/fakechroot-source-musl-x86_64" #ostree_delete "x86_64" "alpine" "3.18" -# centos6_setup "x86_64" #centos6_build_proot "x86_64" "${BUILD_DIR}/proot-source-x86_64" centos6_build_fakechroot "x86_64" "${BUILD_DIR}/fakechroot-source-glibc-x86_64" @@ -8176,15 +8593,18 @@ centos_stream8_build_fakechroot "x86_64" "${BUILD_DIR}/fakechroot-source-glibc-x centos_stream9_setup "x86_64" centos_stream9_build_fakechroot "x86_64" "${BUILD_DIR}/fakechroot-source-glibc-x86_64" #ostree_delete "x86_64" "centos" "9" -# -rocky8_setup "x86_64" -rocky8_build_fakechroot "x86_64" "${BUILD_DIR}/fakechroot-source-glibc-x86_64" + +#rocky8_setup "x86_64" +#rocky8_build_fakechroot "x86_64" "${BUILD_DIR}/fakechroot-source-glibc-x86_64" #ostree_delete "x86_64" "rocky" "8" # -rocky9_setup "x86_64" -rocky9_build_fakechroot "x86_64" "${BUILD_DIR}/fakechroot-source-glibc-x86_64" +#rocky9_setup "x86_64" +#rocky9_build_fakechroot "x86_64" "${BUILD_DIR}/fakechroot-source-glibc-x86_64" #ostree_delete "x86_64" "rocky" "9" +alma8_setup "x86_64" +alma8_build_fakechroot "x86_64" "${BUILD_DIR}/fakechroot-source-glibc-x86_64" +#ostree_delete "x86_64" "alma" "8" # alma9_setup "x86_64" alma9_build_fakechroot "x86_64" "${BUILD_DIR}/fakechroot-source-glibc-x86_64" @@ -8226,47 +8646,100 @@ ubuntu22_build_runc "amd64" "${BUILD_DIR}/runc-source-x86_64" # ubuntu23_setup "amd64" ubuntu23_build_fakechroot "amd64" "${BUILD_DIR}/fakechroot-source-glibc-x86_64" -ubuntu23_build_runc "amd64" "${BUILD_DIR}/runc-source-x86_64" +#ubuntu23_build_runc "amd64" "${BUILD_DIR}/runc-source-x86_64" #ostree_delete "amd64" "ubuntu" "23" -# # ####### # aarch64 # ####### prepare_proot_source "${BUILD_DIR}/proot-source-aarch64" -#prepare_patchelf_source "${BUILD_DIR}/patchelf-source-aarch64" +prepare_patchelf_source "${BUILD_DIR}/patchelf-source-aarch64" prepare_fakechroot_glibc_source "${BUILD_DIR}/fakechroot-source-glibc-aarch64" +prepare_runc_source "${BUILD_DIR}/runc-source-aarch64" # fedora31_setup "aarch64" fedora31_build_proot "aarch64" "${BUILD_DIR}/proot-source-aarch64" +fedora31_build_patchelf "aarch64" "${BUILD_DIR}/patchelf-source-aarch64" #ostree_delete "aarch64" "fedora" "31" # +fedora36_setup "aarch64" +fedora36_build_fakechroot "aarch64" "${BUILD_DIR}/fakechroot-source-glibc-aarch64" +#ostree_delete "aarch64" "fedora" "36" +# fedora38_setup "aarch64" fedora38_build_fakechroot "aarch64" "${BUILD_DIR}/fakechroot-source-glibc-aarch64" #ostree_delete "aarch64" "fedora" "38" # centos7_setup "aarch64" centos7_build_fakechroot "aarch64" "${BUILD_DIR}/fakechroot-source-glibc-aarch64" -#ostree_delete "x86_64" "centos" "7" -# -rocky8_setup "aarch64" -rocky8_build_fakechroot "aarch64" "${BUILD_DIR}/fakechroot-source-glibc-aarch64" -#ostree_delete "aarch64" "rocky" "8" +#ostree_delete "aarch64" "centos" "7" + +#centos_stream8_setup "aarch64" +#centos_stream8_build_fakechroot "aarch64" "${BUILD_DIR}/fakechroot-source-glibc-aarch64" +#ostree_delete "aarch64" "centos" "8" # -rocky9_setup "aarch64" -rocky9_build_fakechroot "aarch64" "${BUILD_DIR}/fakechroot-source-glibc-aarch64" -#ostree_delete "x86_64" "rocky" "9" +#centos_stream9_setup "aarch64" +#centos_stream9_build_fakechroot "aarch64" "${BUILD_DIR}/fakechroot-source-glibc-aarch64" +#ostree_delete "aarch64" "centos" "9" +alma8_setup "aarch64" +alma8_build_fakechroot "aarch64" "${BUILD_DIR}/fakechroot-source-glibc-aarch64" +#ostree_delete "aarch64" "alma" "8" +# +alma9_setup "aarch64" +alma9_build_fakechroot "aarch64" "${BUILD_DIR}/fakechroot-source-glibc-aarch64" +#ostree_delete "aarch64" "alma" "9" +ubuntu22_setup "arm64" +ubuntu22_build_fakechroot "arm64" "${BUILD_DIR}/fakechroot-source-glibc-aarch64" +#ubuntu22_build_runc "arm64" "${BUILD_DIR}/runc-source-aarch64" +ubuntu22_build_runc_root "arm64" "${BUILD_DIR}/runc-source-aarch64" +#ostree_delete "arm64" "ubuntu" "22" # ####### -# x86_64 +# ppc64le # ####### -nix_setup "x86_64" # Nix build uses Fedora 36 -nix_build_crun "x86_64" "${BUILD_DIR}/crun-source-x86_64" # Nix build uses Fedora 36 +prepare_proot_source "${BUILD_DIR}/proot-source-ppc64le" +prepare_patchelf_source "${BUILD_DIR}/patchelf-source-ppc64le" +prepare_fakechroot_glibc_source "${BUILD_DIR}/fakechroot-source-glibc-ppc64le" +prepare_runc_source "${BUILD_DIR}/runc-source-ppc64le" +# +#fedora38_setup "ppc64le" +#fedora38_build_fakechroot "ppc64le" "${BUILD_DIR}/fakechroot-source-glibc-ppc64le" +#ostree_delete "ppc64le" "fedora" "38" +# +centos7_setup "ppc64le" +centos7_build_fakechroot "ppc64le" "${BUILD_DIR}/fakechroot-source-glibc-ppc64le" +centos7_build_patchelf "ppc64le" "${BUILD_DIR}/patchelf-source-ppc64le" +#ostree_delete "ppc64le" "centos" "7" +# +alma8_setup "ppc64le" +alma8_build_fakechroot "ppc64le" "${BUILD_DIR}/fakechroot-source-glibc-ppc64le" +#ostree_delete "ppc64le" "alma" "8" +# +alma9_setup "ppc64le" +alma9_build_fakechroot "ppc64le" "${BUILD_DIR}/fakechroot-source-glibc-ppc64le" +#ostree_delete "ppc64le" "alma" "9" + +ubuntu22_setup "ppc64el" +ubuntu22_build_fakechroot "ppc64el" "${BUILD_DIR}/fakechroot-source-glibc-ppc64le" +#ubuntu22_build_runc "ppc64el" "${BUILD_DIR}/runc-source-ppc64le" +ubuntu22_build_runc_root "ppc64el" "${BUILD_DIR}/runc-source-ppc64le" +#ostree_delete "ppc64el" "ubuntu" "22" + +# ############################### +# x86_64 Nix build uses Fedora 36 +# ############################### +prepare_crun_source "${BUILD_DIR}/crun-source-x86_64" +nix_setup "x86_64" +nix_build_crun "x86_64" "${BUILD_DIR}/crun-source-x86_64" #ostree_delete "x86_64" "fedora" "36" +#prepare_crun_source "${BUILD_DIR}/crun-source-ppc64le" +#nix_setup "ppc64le" +#nix_build_crun "ppc64le" "${BUILD_DIR}/crun-source-ppc64le" +#ostree_delete "ppc64le" "fedora" "36" # ####### # package From 142e186e2507be8cb2ae47a0a4173e00011a5b32 Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Thu, 22 Jun 2023 13:23:43 +0100 Subject: [PATCH 53/99] improve not found messages --- udocker/engine/fakechroot.py | 12 +++++++++--- udocker/engine/proot.py | 8 +++++++- udocker/engine/runc.py | 10 ++++++++-- udocker/engine/singularity.py | 7 ++++++- 4 files changed, 30 insertions(+), 7 deletions(-) diff --git a/udocker/engine/fakechroot.py b/udocker/engine/fakechroot.py index 22ca9957..e0fa278d 100644 --- a/udocker/engine/fakechroot.py +++ b/udocker/engine/fakechroot.py @@ -33,6 +33,8 @@ def __init__(self, localrepo, exec_mode): def select_fakechroot_so(self): """Select fakechroot sharable object library""" image_list = [] + guest = OSInfo(self.container_root) + arch = guest.arch() if Config.conf['fakechroot_so']: if isinstance(Config.conf['fakechroot_so'], list): image_list = Config.conf['fakechroot_so'] @@ -48,8 +50,6 @@ def select_fakechroot_so(self): lib = "libfakechroot" deflib = "libfakechroot.so" image_list = [deflib, ] - guest = OSInfo(self.container_root) - arch = guest.arch() (distro, version) = guest.osdistribution() if "Alpine" not in distro: version = version.split(".")[0] @@ -61,7 +61,13 @@ def select_fakechroot_so(self): f_util = FileUtil(self.localrepo.libdir) fakechroot_so = f_util.find_file_in_dir(image_list) if not os.path.exists(fakechroot_so): - Msg().err("Error: no libfakechroot found", image_list) + Msg().err("Error: libfakechroot not found", image_list) + Msg().out("Info: Host architecture might not be supported by", + "this execution mode:", arch, + "\n specify path to libfakechroot.so with", + "environment UDOCKER_FAKECHROOT_SO", + "\n or choose other execution mode with: udocker", + "setup --execmode=", l=Msg.INF) sys.exit(1) Msg().out("Debug: fakechroot_so:", fakechroot_so, l=Msg.DBG) diff --git a/udocker/engine/proot.py b/udocker/engine/proot.py index f7f0a6ea..fac6456c 100644 --- a/udocker/engine/proot.py +++ b/udocker/engine/proot.py @@ -36,9 +36,9 @@ def select_proot(self): if self.executable != "UDOCKER" and not self.executable: self.executable = FileUtil("proot").find_exec() + arch = HostInfo().arch() if self.executable == "UDOCKER" or not self.executable: self.executable = "" - arch = HostInfo().arch() if HostInfo().oskernel_isgreater([4, 8, 0]): image_list = ["proot-%s-4_8_0" % (arch), "proot-%s" % (arch), "proot"] else: @@ -48,6 +48,12 @@ def select_proot(self): if not os.path.exists(self.executable): Msg().err("Error: proot executable not found") + Msg().out("Info: Host architecture might not be supported by", + "this execution mode:", arch, + "\n specify path to proot with environment", + "UDOCKER_USE_PROOT_EXECUTABLE", + "\n or choose other execution mode with: udocker", + "setup --execmode=", l=Msg.INF) sys.exit(1) if Config.conf['proot_noseccomp'] is not None: diff --git a/udocker/engine/runc.py b/udocker/engine/runc.py index b098df38..feafedd3 100644 --- a/udocker/engine/runc.py +++ b/udocker/engine/runc.py @@ -47,9 +47,9 @@ def select_runc(self): if self.executable != "UDOCKER" and not self.executable: self.executable = FileUtil("crun").find_exec() + arch = HostInfo().arch() if self.executable == "UDOCKER" or not self.executable: self.executable = "" - arch = HostInfo().arch() image_list = [] eng = ["runc", "crun"] image_list = [eng[0]+"-"+arch, eng[0], eng[1]+"-"+arch, eng[1]] @@ -58,7 +58,13 @@ def select_runc(self): self.executable = f_util.find_file_in_dir(image_list) if not os.path.exists(self.executable): - Msg().err("Error: runc/crun executable not found") + Msg().err("Error: runc or crun executable not found") + Msg().out("Info: Host architecture might not be supported by", + "this execution mode:", arch, + "\n specify path to runc or crun with environment", + "UDOCKER_USE_RUNC_EXECUTABLE", + "\n or choose other execution mode with: udocker", + "setup --execmode=", l=Msg.INF) sys.exit(1) if "crun" in os.path.basename(self.executable): self.engine_type = "crun" diff --git a/udocker/engine/singularity.py b/udocker/engine/singularity.py index 249f1396..db1ad2ac 100644 --- a/udocker/engine/singularity.py +++ b/udocker/engine/singularity.py @@ -46,7 +46,12 @@ def select_singularity(self): self.executable = f_util.find_file_in_dir(image_list) if not os.path.exists(self.executable): - Msg().err("Error: apptainer/singularity executable not found") + Msg().err("Error: apptainer or singularity executable not found") + Msg().out("Info: Host might not be supported this execution mode", + "specify path to\n apptainer/singularity with", + "environment UDOCKER_USE_SINGULARITY_EXECUTABLE", + "\n or choose other execution mode with: udocker", + "setup --execmode=", l=Msg.INF) sys.exit(1) def _get_volume_bindings(self): From 7da0292e61be3f636fcd0d46814f2c9ff58e1787 Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Thu, 22 Jun 2023 13:41:16 +0100 Subject: [PATCH 54/99] improve executable selection --- udocker/config.py | 4 ++++ udocker/engine/proot.py | 2 +- udocker/engine/runc.py | 5 ++--- udocker/helper/elfpatcher.py | 21 ++++++++++++++++----- 4 files changed, 23 insertions(+), 9 deletions(-) diff --git a/udocker/config.py b/udocker/config.py index bf06f988..6d4bba28 100644 --- a/udocker/config.py +++ b/udocker/config.py @@ -117,6 +117,7 @@ class Config(object): # Force the use of specific executables # UDOCKER = use executable from the udocker binary distribution/tarball conf['use_proot_executable'] = "UDOCKER" + conf['use_patchelf_executable'] = "UDOCKER" conf['use_runc_executable'] = "" conf['use_singularity_executable'] = "" @@ -261,6 +262,9 @@ def _env_override(self): Config.conf['use_singularity_executable'] = \ os.getenv("UDOCKER_USE_SINGULARITY_EXECUTABLE", Config.conf['use_singularity_executable']) + Config.conf['use_patchelf_executable'] = \ + os.getenv("UDOCKER_USE_PATCHELF_EXECUTABLE", + Config.conf['use_patchelf_executable']) Config.conf['fakechroot_expand_symlinks'] = \ os.getenv("UDOCKER_FAKECHROOT_EXPAND_SYMLINKS", diff --git a/udocker/engine/proot.py b/udocker/engine/proot.py index fac6456c..318958f6 100644 --- a/udocker/engine/proot.py +++ b/udocker/engine/proot.py @@ -33,7 +33,7 @@ def __init__(self, localrepo, exec_mode): def select_proot(self): """Set proot executable and related variables""" self.executable = Config.conf['use_proot_executable'] - if self.executable != "UDOCKER" and not self.executable: + if not self.executable: self.executable = FileUtil("proot").find_exec() arch = HostInfo().arch() diff --git a/udocker/engine/runc.py b/udocker/engine/runc.py index feafedd3..8db83687 100644 --- a/udocker/engine/runc.py +++ b/udocker/engine/runc.py @@ -41,10 +41,9 @@ def __init__(self, localrepo, exec_mode): def select_runc(self): """Set runc executable and related variables""" self.executable = Config.conf['use_runc_executable'] - if self.executable != "UDOCKER" and not self.executable: + if not self.executable: self.executable = FileUtil("runc").find_exec() - - if self.executable != "UDOCKER" and not self.executable: + if not self.executable: self.executable = FileUtil("crun").find_exec() arch = HostInfo().arch() diff --git a/udocker/helper/elfpatcher.py b/udocker/helper/elfpatcher.py index 02df5222..79b8e311 100644 --- a/udocker/helper/elfpatcher.py +++ b/udocker/helper/elfpatcher.py @@ -42,16 +42,27 @@ def __init__(self, localrepo, container_id): # ARCHNEW def select_patchelf(self): """Set patchelf executable""" + executable = Config.conf['use_patchelf_executable'] + if not executable: + self.executable = FileUtil("patchelf").find_exec() + arch = HostInfo().arch() - image_list = ["patchelf-%s" % (arch), "patchelf"] + if executable == "UDOCKER" or not executable: + image_list = ["patchelf-%s" % (arch), "patchelf"] + f_util = FileUtil(self.localrepo.bindir) + executable = f_util.find_file_in_dir(image_list) - f_util = FileUtil(self.localrepo.bindir) - patchelf_exec = f_util.find_file_in_dir(image_list) - if not os.path.exists(patchelf_exec): + if not os.path.exists(executable): Msg().err("Error: patchelf executable not found") + Msg().out("Info: Host architecture might not be supported by", + "this execution mode:", arch, + "\n specify path to patchelf with environment", + "UDOCKER_USE_PATCHELF_EXECUTABLE", + "\n or choose other execution mode with: udocker", + "setup --execmode=", l=Msg.INF) sys.exit(1) - return patchelf_exec + return executable def _replace(self, cmd, path): """Replace #f in cmd[] by path""" From 46fe2c0ea32ee96b77aa0eac4a17ed4fdb3419a3 Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Thu, 22 Jun 2023 22:48:03 +0100 Subject: [PATCH 55/99] default execution modes per architecture --- udocker/config.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/udocker/config.py b/udocker/config.py index 6d4bba28..2c31061e 100644 --- a/udocker/config.py +++ b/udocker/config.py @@ -71,7 +71,10 @@ class Config(object): # container execution mode if not set via setup # Change it to P2 if execution problems occur - conf['default_execution_mode'] = "P1" + conf['override_default_execution_mode'] = "" + conf['default_execution_modes'] = {'x86_64':"P1", 'x86':"P1", + 'arm64':"P1", 'arm':"P2", + 'ppc64le':"R1", 'DEFAULT':"R1"} # PRoot override seccomp # conf['proot_noseccomp'] = True @@ -240,9 +243,9 @@ def _env_override(self): os.getenv("UDOCKER_REGISTRY", Config.conf['dockerio_registry_url']) Config.conf['tarball'] = \ os.getenv("UDOCKER_TARBALL", Config.conf['tarball']) - Config.conf['default_execution_mode'] = \ + Config.conf['override_default_execution_mode'] = \ os.getenv("UDOCKER_DEFAULT_EXECUTION_MODE", - Config.conf['default_execution_mode']) + Config.conf['override_default_execution_mode']) Config.conf['fakechroot_so'] = \ os.getenv("UDOCKER_FAKECHROOT_SO", Config.conf['fakechroot_so']) Config.conf['fakechroot_libc'] = \ From 721202431e8f8d11bbc8dc9575f4522e7bb5c164 Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Thu, 22 Jun 2023 22:48:26 +0100 Subject: [PATCH 56/99] default execution modes per architecture --- udocker/engine/execmode.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/udocker/engine/execmode.py b/udocker/engine/execmode.py index be2df4d7..b6add264 100644 --- a/udocker/engine/execmode.py +++ b/udocker/engine/execmode.py @@ -12,6 +12,7 @@ from udocker.engine.singularity import SingularityEngine from udocker.utils.fileutil import FileUtil from udocker.utils.filebind import FileBind +from udocker.helper.hostinfo import HostInfo class ExecutionMode(object): @@ -46,7 +47,13 @@ def get_mode(self): futil_xm = FileUtil(self.container_execmode) xmode = futil_xm.getdata('r').strip() if not xmode: - xmode = Config.conf['default_execution_mode'] + xmode = Config.conf['override_default_execution_mode'] + if not xmode: + try: + arch = HostInfo().arch() + xmode = Config.conf['default_execution_modes'][arch] + except KeyError: + xmode = Config.conf['default_execution_modes']["DEFAULT"] return xmode def set_mode(self, xmode, force=False): From a1d11a797b2af84633fc7e37859d58449f4b3f04 Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Thu, 22 Jun 2023 22:50:46 +0100 Subject: [PATCH 57/99] improve get_arch --- udocker/helper/archinfo.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/udocker/helper/archinfo.py b/udocker/helper/archinfo.py index ff6798cb..de8879d5 100644 --- a/udocker/helper/archinfo.py +++ b/udocker/helper/archinfo.py @@ -81,6 +81,8 @@ def get_arch(self, source_type, arch_info, target_type="UDOCKER"): arch_info is data previously produced by uname, file or readelf target_type can be docker, qemu, UDOCKER or ALL """ + if "ASCII" in arch_info or "Error:" in arch_info: + return ([], [], []) found = False try: for arch_dict in self._arch_list: From 8efe5d01cf487245cdf3a666bab5b61f4e0fbdc4 Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Thu, 22 Jun 2023 22:51:47 +0100 Subject: [PATCH 58/99] improve executable selection --- udocker/helper/elfpatcher.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/udocker/helper/elfpatcher.py b/udocker/helper/elfpatcher.py index 79b8e311..918824fb 100644 --- a/udocker/helper/elfpatcher.py +++ b/udocker/helper/elfpatcher.py @@ -42,17 +42,17 @@ def __init__(self, localrepo, container_id): # ARCHNEW def select_patchelf(self): """Set patchelf executable""" - executable = Config.conf['use_patchelf_executable'] - if not executable: - self.executable = FileUtil("patchelf").find_exec() + patchelf_exec = Config.conf['use_patchelf_executable'] + if not patchelf_exec: + patchelf_exec = FileUtil("patchelf").find_exec() arch = HostInfo().arch() - if executable == "UDOCKER" or not executable: + if patchelf_exec == "UDOCKER" or not patchelf_exec: image_list = ["patchelf-%s" % (arch), "patchelf"] f_util = FileUtil(self.localrepo.bindir) - executable = f_util.find_file_in_dir(image_list) + patchelf_exec = f_util.find_file_in_dir(image_list) - if not os.path.exists(executable): + if not os.path.exists(patchelf_exec): Msg().err("Error: patchelf executable not found") Msg().out("Info: Host architecture might not be supported by", "this execution mode:", arch, @@ -62,7 +62,7 @@ def select_patchelf(self): "setup --execmode=", l=Msg.INF) sys.exit(1) - return executable + return patchelf_exec def _replace(self, cmd, path): """Replace #f in cmd[] by path""" From 3aa9b359b0317656a3ff81d18c8b7644718ab194 Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Thu, 22 Jun 2023 22:53:09 +0100 Subject: [PATCH 59/99] udocker/helper/osinfo.py --- udocker/helper/osinfo.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/udocker/helper/osinfo.py b/udocker/helper/osinfo.py index d0ef2edd..255e1323 100644 --- a/udocker/helper/osinfo.py +++ b/udocker/helper/osinfo.py @@ -43,7 +43,13 @@ def arch(self, target="UDOCKER"): continue (arch, dummy, dummy) = self.get_arch(sourcetype, fileinfo, target) - return arch[0] if arch[0] else "" + try: + if arch[0]: + return arch[0] + except IndexError: + continue + return "" + # ARCH NEW def is_same_arch(self, other_root_dir="/" ,target="UDOCKER"): From b41474243fb48d729ca0f9352de21d5a6e02d0f4 Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Thu, 22 Jun 2023 22:54:51 +0100 Subject: [PATCH 60/99] Revert "udocker/helper/osinfo.py" This reverts commit 3aa9b359b0317656a3ff81d18c8b7644718ab194. --- udocker/helper/osinfo.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/udocker/helper/osinfo.py b/udocker/helper/osinfo.py index 255e1323..d0ef2edd 100644 --- a/udocker/helper/osinfo.py +++ b/udocker/helper/osinfo.py @@ -43,13 +43,7 @@ def arch(self, target="UDOCKER"): continue (arch, dummy, dummy) = self.get_arch(sourcetype, fileinfo, target) - try: - if arch[0]: - return arch[0] - except IndexError: - continue - return "" - + return arch[0] if arch[0] else "" # ARCH NEW def is_same_arch(self, other_root_dir="/" ,target="UDOCKER"): From 6e92231764f5a7723cf17aba6b4089b41b2c6c07 Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Thu, 22 Jun 2023 22:58:33 +0100 Subject: [PATCH 61/99] improve osinfo arch() --- udocker/helper/osinfo.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/udocker/helper/osinfo.py b/udocker/helper/osinfo.py index d0ef2edd..94fc6109 100644 --- a/udocker/helper/osinfo.py +++ b/udocker/helper/osinfo.py @@ -43,7 +43,12 @@ def arch(self, target="UDOCKER"): continue (arch, dummy, dummy) = self.get_arch(sourcetype, fileinfo, target) - return arch[0] if arch[0] else "" + try: + if arch[0]: + return arch[0] + except KeyError: + continue + return "" # ARCH NEW def is_same_arch(self, other_root_dir="/" ,target="UDOCKER"): From cd06cdce4591845cdc552f55b42aca7d46e7e8c5 Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Thu, 22 Jun 2023 23:12:33 +0100 Subject: [PATCH 62/99] remove logging on buffer reads --- udocker/utils/fileutil.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/udocker/utils/fileutil.py b/udocker/utils/fileutil.py index 2614f41f..17c0d836 100644 --- a/udocker/utils/fileutil.py +++ b/udocker/utils/fileutil.py @@ -350,7 +350,7 @@ def getdata(self, mode="rb"): try: with open(self.filename, mode) as filep: buf = filep.read() - Msg().out("Debug: read buf", buf, l=Msg.DBG) + #Msg().out("Debug: read buf", buf, l=Msg.DBG) return buf except (IOError, OSError, TypeError): return "" From 36868b1dd65d987cb471f23f179c3c11946561b8 Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Thu, 22 Jun 2023 23:13:08 +0100 Subject: [PATCH 63/99] add debug for execution of commands --- udocker/utils/uprocess.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/udocker/utils/uprocess.py b/udocker/utils/uprocess.py index 0cfd79f1..f9700ea5 100644 --- a/udocker/utils/uprocess.py +++ b/udocker/utils/uprocess.py @@ -50,6 +50,7 @@ def _check_output(self, *popenargs, **kwargs): def check_output(self, *popenargs, **kwargs): """Select check_output implementation""" + Msg().out("Debug: check_output:", *popenargs, l=Msg.DBG) try: # if Python 3 if sys.version_info[0] >= 3: @@ -69,6 +70,7 @@ def check_output(self, *popenargs, **kwargs): def get_output(self, cmd, ignore_error=False): """Execute a shell command and get its output""" + Msg().out("Debug: get_output:", cmd, l=Msg.DBG) if not cmd[0].startswith("/"): path = Config.conf["root_path"] + ":" + os.getenv("PATH", "") cmd_path = self.find_inpath(cmd[0], path) @@ -86,6 +88,7 @@ def get_output(self, cmd, ignore_error=False): def call(self, cmd, **kwargs): """Execute one shell command""" + Msg().out("Debug: call:", cmd, l=Msg.DBG) if not cmd[0].startswith("/"): path = Config.conf["root_path"] + ":" + os.getenv("PATH", "") cmd[0] = self.find_inpath(cmd[0], path) @@ -95,6 +98,7 @@ def call(self, cmd, **kwargs): def pipe(self, cmd1, cmd2, **kwargs): """Pipe two shell commands""" + Msg().out("Debug: pipe:", cmd1, cmd2, l=Msg.DBG) path = Config.conf["root_path"] + ":" + os.getenv("PATH", "") if not cmd1[0].startswith("/"): cmd1[0] = self.find_inpath(cmd1[0], path) From 7b12c246a917ac02bfc0eef83a4784e0737d4229 Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Thu, 22 Jun 2023 23:16:11 +0100 Subject: [PATCH 64/99] fix IndexError in osinfo arch() --- udocker/helper/osinfo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/udocker/helper/osinfo.py b/udocker/helper/osinfo.py index 94fc6109..3ab8014a 100644 --- a/udocker/helper/osinfo.py +++ b/udocker/helper/osinfo.py @@ -46,7 +46,7 @@ def arch(self, target="UDOCKER"): try: if arch[0]: return arch[0] - except KeyError: + except IndexError: continue return "" From 8ee366f5512aea0ec871cbe89501c38abe189896 Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Thu, 22 Jun 2023 23:18:47 +0100 Subject: [PATCH 65/99] build binaries for ppc64le and arm64, new patchelf --- utils/build_tarball.sh | 98 ++++++++++++++++++++++++++++++++---------- 1 file changed, 76 insertions(+), 22 deletions(-) diff --git a/utils/build_tarball.sh b/utils/build_tarball.sh index 8071fbc4..678b9ee5 100755 --- a/utils/build_tarball.sh +++ b/utils/build_tarball.sh @@ -147,10 +147,13 @@ prepare_patchelf_source() return fi - #git clone --depth=1 --branch=0.9 https://github.com/NixOS/patchelf.git - git clone --branch udocker-1 --depth=1 https://github.com/jorge-lip/patchelf-udocker.git - /bin/rm -Rf "$BUILD_DIR/patchelf-udocker/.git" - /bin/mv patchelf-udocker "$PATCHELF_SOURCE_DIR" + #git clone --branch udocker-1 --depth=1 https://github.com/jorge-lip/patchelf-udocker.git + #/bin/rm -Rf "$BUILD_DIR/patchelf-udocker/.git" + #/bin/mv patchelf-udocker "$PATCHELF_SOURCE_DIR" + + git clone --branch udocker-2 --depth=1 https://github.com/jorge-lip/patchelf-udocker-2.git + /bin/rm -Rf "$BUILD_DIR/patchelf-udocker-2/.git" + /bin/mv patchelf-udocker-2 "$PATCHELF_SOURCE_DIR" } prepare_fakechroot_glibc_source() @@ -4639,8 +4642,8 @@ rocky8_setup() $SUDO /usr/bin/yum -y -c "${OS_ROOTDIR}/etc/yum.conf" \ install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" \ - --forcearch="$OS_ARCH" \ - autoconf m4 gcc-c++ automake gawk libtool + --forcearch="$OS_ARCH" --enablerepo=crb \ + autoconf m4 gcc-c++ libstdc++-static glibc-static automake gawk libtool $SUDO /usr/bin/yum -y -c "${OS_ROOTDIR}/etc/yum.conf" \ clean packages @@ -4904,8 +4907,8 @@ rocky9_setup() $SUDO /usr/bin/yum -y -c "${OS_ROOTDIR}/etc/yum.conf" \ install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" \ - --forcearch="$OS_ARCH" \ - autoconf m4 gcc-c++ automake gawk libtool + --forcearch="$OS_ARCH" --enablerepo=crb \ + autoconf m4 gcc-c++ libstdc++-static glibc-static automake gawk libtool $SUDO /usr/bin/yum -y -c "${OS_ROOTDIR}/etc/yum.conf" \ clean packages @@ -5163,14 +5166,14 @@ alma8_setup() $SUDO /usr/bin/yum -y -c "${OS_ROOTDIR}/etc/yum.conf" \ install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" \ --setopt=module_platform_id=platform:el$OS_RELVER \ - --forcearch="$OS_ARCH" \ + --forcearch="$OS_ARCH" --enablerepo=crb \ dnf rpm dnf-data gcc make libtalloc libtalloc-devel glibc-devel tar \ python3 python2 gzip zlib diffutils file git which $SUDO /usr/bin/yum -y -c "${OS_ROOTDIR}/etc/yum.conf" \ install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" \ - --forcearch="$OS_ARCH" \ - autoconf m4 gcc-c++ automake gawk libtool + --forcearch="$OS_ARCH" --enablerepo=crb \ + autoconf m4 gcc-c++ libstdc++-static glibc-static automake gawk libtool $SUDO /usr/bin/yum -y -c "${OS_ROOTDIR}/etc/yum.conf" \ clean packages @@ -5434,8 +5437,8 @@ alma9_setup() $SUDO /usr/bin/yum -y -c "${OS_ROOTDIR}/etc/yum.conf" \ install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" \ - --forcearch="$OS_ARCH" \ - autoconf m4 gcc-c++ automake gawk libtool + --forcearch="$OS_ARCH" --enablerepo=crb \ + autoconf m4 gcc-c++ libstdc++-static glibc-static automake gawk libtool $SUDO /usr/bin/yum -y -c "${OS_ROOTDIR}/etc/yum.conf" \ clean packages @@ -5444,6 +5447,52 @@ alma9_setup() $SUDO /bin/chmod -R u+rw "$OS_ROOTDIR" } +alma9_build_patchelf() +{ + echo "alma9_build_patchelf : $1" + local OS_ARCH="$1" + local PATCHELF_SOURCE_DIR="$2" + local OS_NAME="alma" + local OS_RELVER="9" + local OS_ROOTDIR="${BUILD_DIR}/${OS_NAME}_${OS_RELVER}_${OS_ARCH}" + local PROOT="" + + if [ "$OS_ARCH" = "i386" ]; then + PROOT="$S_PROOT_DIR/proot-x86" + elif [ "$OS_ARCH" = "x86_64" ]; then + PROOT="$S_PROOT_DIR/proot-x86_64" + elif [ "$OS_ARCH" = "aarch64" ]; then + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + elif [ "$OS_ARCH" = "ppc64le" ]; then + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-ppc64le" + else + echo "unsupported $OS_NAME architecture: $OS_ARCH" + exit 2 + fi + + if [ -x "${PATCHELF_SOURCE_DIR}/patchelf-AlmaLinux-9" ] ; then + echo "patchelf binary already compiled : ${PATCHELF_SOURCE_DIR}/patchelf-AlmaLinux-9" + return + fi + + export PROOT_NO_SECCOMP=1 + + # compile patchelf + set -xv + (cd "${PATCHELF_SOURCE_DIR}" ; bash ./bootstrap.sh) + $PROOT -r "$OS_ROOTDIR" -b "${PATCHELF_SOURCE_DIR}:/patchelf" -w / -b /dev \ + /bin/bash <<'EOF_alma9_patchelf' +cd /patchelf +make clean +# BUILD PATCHELF +#bash bootstrap.sh +bash ./configure +make +cp src/patchelf /patchelf/patchelf-AlmaLinux-9 +make clean +EOF_alma9_patchelf + set +xv +} alma9_build_fakechroot() { @@ -8204,7 +8253,7 @@ create_package_tarball() copy_file proot-source-x86_64/proot-Fedora-25.bin bin/proot-x86_64 copy_file proot-source-x86_64/proot-Fedora-30.bin bin/proot-x86_64-4_8_0 - copy_file patchelf-source-x86_64/patchelf-Fedora-25 bin/patchelf-x86_64 + copy_file patchelf-source-x86_64/patchelf-Fedora-38 bin/patchelf-x86_64 copy_file runc-source-x86_64/runc-Ubuntu-22.bin bin/runc-x86_64 copy_file crun-source-x86_64/crun-nix-latest bin/crun-x86_64 @@ -8332,7 +8381,7 @@ create_package_tarball() # arch64 / amd64 ----------------------------------------------------------------------------------------- copy_file proot-source-aarch64/proot-Fedora-31.bin bin/proot-arm64-4_8_0 link_file bin/proot-arm64-4_8_0 proot-arm64 - copy_file patchelf-source-aarch64/patchelf-Fedora-31 bin/patchelf-arm64 + copy_file patchelf-source-aarch64/patchelf-AlmaLinux-9 bin/patchelf-arm64 copy_file runc-source-aarch64/runc-Ubuntu-22.bin bin/runc-arm64 copy_file fakechroot-source-glibc-aarch64/libfakechroot-Fedora-36.so lib/libfakechroot-Fedora-36-arm64.so @@ -8364,7 +8413,7 @@ create_package_tarball() link_file lib/libfakechroot-AlmaLinux-9-arm64.so libfakechroot-Red-arm64.so # ppc64le ------------------------------------------------------------------------------------------------ - copy_file patchelf-source-ppc64le/patchelf-CentOS-7 bin/patchelf-ppc64le + copy_file patchelf-source-ppc64le/patchelf-AlmaLinux-9 bin/patchelf-ppc64le copy_file runc-source-ppc64le/runc-Ubuntu-22.bin bin/runc-ppc64le copy_file fakechroot-source-glibc-ppc64le/libfakechroot-CentOS-7.so lib/libfakechroot-CentOS-7-ppc64le.so @@ -8372,6 +8421,9 @@ create_package_tarball() copy_file fakechroot-source-glibc-ppc64le/libfakechroot-AlmaLinux-9.so lib/libfakechroot-AlmaLinux-9-ppc64le.so copy_file fakechroot-source-glibc-ppc64le/libfakechroot-AlmaLinux-9.so lib/libfakechroot-AlmaLinux-ppc64le.so + copy_file fakechroot-source-glibc-ppc64le/libfakechroot-Fedora-38.so lib/libfakechroot-Fedora-38-ppc64le.so + link_file lib/libfakechroot-Fedora-38-ppc64le.so libfakechroot-Fedora-ppc64le.so + copy_file fakechroot-source-glibc-ppc64le/libfakechroot-Ubuntu-22.so lib/libfakechroot-Ubuntu-22-ppc64le.so link_file lib/libfakechroot-Ubuntu-22-ppc64le.so libfakechroot-Ubuntu-ppc64le.so link_file lib/libfakechroot-Ubuntu-22-ppc64le.so libfakechroot-LinuxMint-22-ppc64le.so @@ -8472,7 +8524,7 @@ prepare_runc_source "${BUILD_DIR}/runc-source-x86_64" fedora25_setup "x86_64" fedora25_build_proot "x86_64" "${BUILD_DIR}/proot-source-x86_64" -fedora25_build_patchelf "x86_64" "${BUILD_DIR}/patchelf-source-x86_64" +#fedora25_build_patchelf "x86_64" "${BUILD_DIR}/patchelf-source-x86_64" fedora25_build_fakechroot "x86_64" "${BUILD_DIR}/fakechroot-source-glibc-x86_64" #ostree_delete "x86_64" "fedora" "25" # @@ -8518,7 +8570,7 @@ fedora36_build_fakechroot "x86_64" "${BUILD_DIR}/fakechroot-source-glibc-x86_64" # fedora38_setup "x86_64" #fedora38_build_proot "x86_64" "${BUILD_DIR}/proot-source-x86_64" -#fedora38_build_patchelf "x86_64" "${BUILD_DIR}/patchelf-source-x86_64" +fedora38_build_patchelf "x86_64" "${BUILD_DIR}/patchelf-source-x86_64" fedora38_build_fakechroot "x86_64" "${BUILD_DIR}/fakechroot-source-glibc-x86_64" #ostree_delete "x86_64" "fedora" "38" @@ -8660,7 +8712,7 @@ prepare_runc_source "${BUILD_DIR}/runc-source-aarch64" # fedora31_setup "aarch64" fedora31_build_proot "aarch64" "${BUILD_DIR}/proot-source-aarch64" -fedora31_build_patchelf "aarch64" "${BUILD_DIR}/patchelf-source-aarch64" +#fedora31_build_patchelf "aarch64" "${BUILD_DIR}/patchelf-source-aarch64" #ostree_delete "aarch64" "fedora" "31" # fedora36_setup "aarch64" @@ -8669,6 +8721,7 @@ fedora36_build_fakechroot "aarch64" "${BUILD_DIR}/fakechroot-source-glibc-aarch6 # fedora38_setup "aarch64" fedora38_build_fakechroot "aarch64" "${BUILD_DIR}/fakechroot-source-glibc-aarch64" +#fedora38_build_patchelf "aarch64" "${BUILD_DIR}/patchelf-source-aarch64" #ostree_delete "aarch64" "fedora" "38" # centos7_setup "aarch64" @@ -8689,6 +8742,7 @@ alma8_build_fakechroot "aarch64" "${BUILD_DIR}/fakechroot-source-glibc-aarch64" # alma9_setup "aarch64" alma9_build_fakechroot "aarch64" "${BUILD_DIR}/fakechroot-source-glibc-aarch64" +alma9_build_patchelf "aarch64" "${BUILD_DIR}/patchelf-source-aarch64" #ostree_delete "aarch64" "alma" "9" ubuntu22_setup "arm64" @@ -8705,13 +8759,12 @@ prepare_patchelf_source "${BUILD_DIR}/patchelf-source-ppc64le" prepare_fakechroot_glibc_source "${BUILD_DIR}/fakechroot-source-glibc-ppc64le" prepare_runc_source "${BUILD_DIR}/runc-source-ppc64le" # -#fedora38_setup "ppc64le" -#fedora38_build_fakechroot "ppc64le" "${BUILD_DIR}/fakechroot-source-glibc-ppc64le" +fedora38_setup "ppc64le" +fedora38_build_fakechroot "ppc64le" "${BUILD_DIR}/fakechroot-source-glibc-ppc64le" #ostree_delete "ppc64le" "fedora" "38" # centos7_setup "ppc64le" centos7_build_fakechroot "ppc64le" "${BUILD_DIR}/fakechroot-source-glibc-ppc64le" -centos7_build_patchelf "ppc64le" "${BUILD_DIR}/patchelf-source-ppc64le" #ostree_delete "ppc64le" "centos" "7" # alma8_setup "ppc64le" @@ -8720,6 +8773,7 @@ alma8_build_fakechroot "ppc64le" "${BUILD_DIR}/fakechroot-source-glibc-ppc64le" # alma9_setup "ppc64le" alma9_build_fakechroot "ppc64le" "${BUILD_DIR}/fakechroot-source-glibc-ppc64le" +alma9_build_patchelf "ppc64le" "${BUILD_DIR}/patchelf-source-ppc64le" #ostree_delete "ppc64le" "alma" "9" ubuntu22_setup "ppc64el" From f86cfeaccbb8e9b70e4e42799933878b5a7ed94f Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Fri, 23 Jun 2023 01:41:35 +0100 Subject: [PATCH 66/99] ps -p and images -p for platform information --- udocker/cli.py | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/udocker/cli.py b/udocker/cli.py index 2b95e82f..86933eb3 100644 --- a/udocker/cli.py +++ b/udocker/cli.py @@ -822,8 +822,10 @@ def do_images(self, cmdp): images: list container images images [options] -l :long format + -p :print platform """ verbose = cmdp.get("-l") + print_platform = cmdp.get("-p") dummy = cmdp.get("--no-trunc") dummy = cmdp.get("--all") if cmdp.missing_options(): # syntax error @@ -833,9 +835,16 @@ def do_images(self, cmdp): for (imagerepo, tag) in images_list: prot = (".", "P")[ self.localrepo.isprotected_imagerepo(imagerepo, tag)] - Msg().out("%s %c" % (imagerepo + ":" + tag, prot)) + imagerepo_dir = self.localrepo.cd_imagerepo(imagerepo, tag) + + if print_platform: + platform = self.localrepo.get_image_platform_fmt() + Msg().out("%-18.18s %c %s" % (platform, prot, imagerepo + ":" + tag)) + else: + Msg().out("%s %c" % (imagerepo + ":" + tag, prot)) + if verbose: - imagerepo_dir = self.localrepo.cd_imagerepo(imagerepo, tag) + #imagerepo_dir = self.localrepo.cd_imagerepo(imagerepo, tag) Msg().out(" %s" % (imagerepo_dir)) layers_list = self.localrepo.get_layers(imagerepo, tag) if layers_list: @@ -853,25 +862,30 @@ def do_ps(self, cmdp): ps: list containers -m :print execution mode -s :print size in MB + -p :print platform """ print_mode = cmdp.get("-m") print_size = cmdp.get("-s") + print_platform = cmdp.get("-p") if cmdp.missing_options(): # syntax error return self.STATUS_ERROR - mod_h = size_h = "" - mod_l = size_l = "%0s" + mod_h = size_h = plat_h = "" + mod_l = size_l = plat_l = "%0s" if print_mode: mod_h = "MOD " mod_l = "%2.2s " if print_size: size_h = "SIZE " size_l = "%5.5s " - fmt = "%-36.36s %c %c " + mod_h + size_h + "%-18s %-20.20s" + if print_platform: + plat_h = "PLATFORM " + plat_l = "%-18.18s " + fmt = "%-36.36s %c %c " + mod_h + size_h + plat_h + "%-18s %-20.20s" Msg().out(fmt % ("CONTAINER ID", 'P', 'M', "NAMES", "IMAGE")) - fmt = "%-36.36s %c %c " + mod_l + size_l + "%-18.100s %-20.100s" - line = [''] * 7 + fmt = "%-36.36s %c %c " + mod_l + size_l + plat_l + "%-18.100s %-20.100s" + line = [''] * 8 containers_list = self.localrepo.get_containers_list(False) - for (line[0], line[6], line[5]) in containers_list: + for (line[0], line[7], line[6]) in containers_list: container_id = line[0] exec_mode = ExecutionMode(self.localrepo, container_id) line[3] = exec_mode.get_mode() if print_mode else "" @@ -880,6 +894,9 @@ def do_ps(self, cmdp): line[2] = ('R', 'W', 'N', 'D')[ self.localrepo.iswriteable_container(container_id)] line[4] = self.localrepo.get_size(container_id) if print_size else "" + platform = ContainerStructure(self.localrepo, + container_id).get_container_platform_fmt() + line[5] = platform if print_platform else "" Msg().out(fmt % tuple(line)) return self.STATUS_OK From 4ac88c466a2221eef0eabe7846a4173632e2ab7e Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Fri, 23 Jun 2023 01:42:44 +0100 Subject: [PATCH 67/99] get platform information from container and images json configs --- udocker/container/localrepo.py | 21 +++++++++++++++++++++ udocker/container/structure.py | 21 +++++++++++++++++++++ udocker/engine/base.py | 9 +++++++++ 3 files changed, 51 insertions(+) diff --git a/udocker/container/localrepo.py b/udocker/container/localrepo.py index 16a39317..8aeb76ae 100644 --- a/udocker/container/localrepo.py +++ b/udocker/container/localrepo.py @@ -588,6 +588,27 @@ def get_image_attributes(self): return (None, None) + def get_image_platform_fmt(self): + """Get the image platform from the metadata""" + (manifest_json, dummy) = self.get_image_attributes() + if not manifest_json: + return "" + try: + architecture = manifest_json["architecture"] + except KeyError: + return "" + try: + os = manifest_json["os"] + except KeyError: + os = "unknown" + try: + variant = manifest_json["variant"] + except KeyError: + variant = "" + if not variant: + return "%s/%s" % (os, architecture) + return "%s/%s/%s" % (os, architecture, variant) + def save_json(self, filename, data): """Save container json to a file in the image TAG directory that has been previously selected via cd_imagerepo() diff --git a/udocker/container/structure.py b/udocker/container/structure.py index ab565f3a..3963a455 100644 --- a/udocker/container/structure.py +++ b/udocker/container/structure.py @@ -44,6 +44,27 @@ def get_container_attr(self): return (container_dir, container_json) + def get_container_platform_fmt(self): + """Get the container platform from the metadata""" + (dummy, container_json) = self.get_container_attr() + if not container_json: + return "" + try: + architecture = container_json["architecture"] + except KeyError: + return "" + try: + os = container_json["os"] + except KeyError: + os = "unknown" + try: + variant = container_json["variant"] + except KeyError: + variant = "" + if not variant: + return "%s/%s" % (os, architecture) + return "%s/%s/%s" % (os, architecture, variant) + def _get_container_meta(self, param, default, cntjson): """Get the metadata configuration from the container""" cidx = "" diff --git a/udocker/engine/base.py b/udocker/engine/base.py index 546d38b9..65ac3802 100644 --- a/udocker/engine/base.py +++ b/udocker/engine/base.py @@ -63,6 +63,9 @@ def __init__(self, localrepo, exec_mode): self.exec_mode = exec_mode # ExecutionMode instance self.mountp = None # MountPoint object self.executable = "" # Executable proot, runc, etc + self.container_os = "" # Container operating system + self.container_architecture = "" # Container architecture + self.container_variant = "" # Container variant def _has_option(self, search_option, arg=None): """Check if executable has a given cli option""" @@ -308,6 +311,12 @@ def _run_load_metadata(self, container_id): container_structure.get_container_meta("ExposedPorts", [], container_json)) self.opt["env"].extendif( container_structure.get_container_meta("Env", [], container_json)) + + self.container_os = cstruc.get_container_meta("os", "", cntjson) + self.container_architecture = cstruc.get_container_meta("architecture", + "", cntjson) + self.container_variant = cstruc.get_container_meta("variant", "", cntjson) + return (container_dir, container_json) def _select_auth_files(self): From 674d22765261530b7f830fe5b422dec49a8ff808 Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Fri, 23 Jun 2023 15:08:56 +0100 Subject: [PATCH 68/99] style fixes --- udocker/container/localrepo.py | 18 +++++++++--------- udocker/container/structure.py | 16 ++++++++-------- udocker/engine/base.py | 16 ++-------------- udocker/engine/runc.py | 2 +- 4 files changed, 20 insertions(+), 32 deletions(-) diff --git a/udocker/container/localrepo.py b/udocker/container/localrepo.py index 8aeb76ae..75b71134 100644 --- a/udocker/container/localrepo.py +++ b/udocker/container/localrepo.py @@ -593,21 +593,21 @@ def get_image_platform_fmt(self): (manifest_json, dummy) = self.get_image_attributes() if not manifest_json: return "" - try: - architecture = manifest_json["architecture"] + try: + p_architecture = manifest_json["architecture"] except KeyError: return "" try: - os = manifest_json["os"] + p_os = manifest_json["os"] except KeyError: - os = "unknown" + p_os = "unknown" try: - variant = manifest_json["variant"] + p_variant = manifest_json["variant"] except KeyError: - variant = "" - if not variant: - return "%s/%s" % (os, architecture) - return "%s/%s/%s" % (os, architecture, variant) + p_variant = "" + if not p_variant: + return "%s/%s" % (p_os, p_architecture) + return "%s/%s/%s" % (p_os, p_architecture, p_variant) def save_json(self, filename, data): """Save container json to a file in the image TAG directory diff --git a/udocker/container/structure.py b/udocker/container/structure.py index 3963a455..6f1333e4 100644 --- a/udocker/container/structure.py +++ b/udocker/container/structure.py @@ -50,20 +50,20 @@ def get_container_platform_fmt(self): if not container_json: return "" try: - architecture = container_json["architecture"] + p_architecture = container_json["architecture"] except KeyError: return "" try: - os = container_json["os"] + p_os = container_json["os"] except KeyError: - os = "unknown" + p_os = "unknown" try: - variant = container_json["variant"] + p_variant = container_json["variant"] except KeyError: - variant = "" - if not variant: - return "%s/%s" % (os, architecture) - return "%s/%s/%s" % (os, architecture, variant) + p_variant = "" + if not p_variant: + return "%s/%s" % (p_os, p_architecture) + return "%s/%s/%s" % (p_os, p_architecture, p_variant) def _get_container_meta(self, param, default, cntjson): """Get the metadata configuration from the container""" diff --git a/udocker/engine/base.py b/udocker/engine/base.py index 65ac3802..ee048d8a 100644 --- a/udocker/engine/base.py +++ b/udocker/engine/base.py @@ -63,9 +63,6 @@ def __init__(self, localrepo, exec_mode): self.exec_mode = exec_mode # ExecutionMode instance self.mountp = None # MountPoint object self.executable = "" # Executable proot, runc, etc - self.container_os = "" # Container operating system - self.container_architecture = "" # Container architecture - self.container_variant = "" # Container variant def _has_option(self, search_option, arg=None): """Check if executable has a given cli option""" @@ -211,7 +208,8 @@ def _set_volume_bindings(self): self.opt["vol"].remove(vol) found = True if not found: - Msg().err("Warning: --novol %s not in volumes list" % novolume, l=Msg.WAR) + Msg().err("Warning: --novol %s not in volumes list" + % novolume, l=Msg.WAR) return self._check_volumes() def _check_paths(self): @@ -312,11 +310,6 @@ def _run_load_metadata(self, container_id): self.opt["env"].extendif( container_structure.get_container_meta("Env", [], container_json)) - self.container_os = cstruc.get_container_meta("os", "", cntjson) - self.container_architecture = cstruc.get_container_meta("architecture", - "", cntjson) - self.container_variant = cstruc.get_container_meta("variant", "", cntjson) - return (container_dir, container_json) def _select_auth_files(self): @@ -636,7 +629,6 @@ def _run_init(self, container_id): return exec_path - # ARCHNEW def _get_saved_osenv(self, filename): """get saved osenv from json file""" try: @@ -644,7 +636,6 @@ def _get_saved_osenv(self, filename): except (IOError, OSError, ValueError, TypeError): return {} - # ARCHNEW def _is_same_osenv(self, filename): """Check if the host has changed""" saved = self._get_saved_osenv(filename) @@ -658,7 +649,6 @@ def _is_same_osenv(self, filename): pass return {} - # ARCHNEW def _save_osenv(self, filename, save=None): """Save host info for is_same_host()""" if save is None: @@ -674,7 +664,6 @@ def _save_osenv(self, filename, save=None): pass return False - # ARCHNEW def _check_arch(self, fail=False): """Check if architecture is the same""" if not OSInfo(self.container_root).is_same_arch(): @@ -685,7 +674,6 @@ def _check_arch(self, fail=False): l=Msg.WAR) return True - # ARCHNEW def _get_qemu(self, return_path=False): """Get the qemu binary name if emulation needed""" container_qemu_arch = OSInfo(self.container_root).arch("qemu") diff --git a/udocker/engine/runc.py b/udocker/engine/runc.py index 8db83687..a1267e97 100644 --- a/udocker/engine/runc.py +++ b/udocker/engine/runc.py @@ -58,7 +58,7 @@ def select_runc(self): if not os.path.exists(self.executable): Msg().err("Error: runc or crun executable not found") - Msg().out("Info: Host architecture might not be supported by", + Msg().out("Info: Host architecture might not be supported by", "this execution mode:", arch, "\n specify path to runc or crun with environment", "UDOCKER_USE_RUNC_EXECUTABLE", From 2c15cc5b7884f8cd2f35c6329f382cb5c030c3a6 Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Fri, 23 Jun 2023 15:09:21 +0100 Subject: [PATCH 69/99] add additional libfakechroot compilations --- utils/build_tarball.sh | 83 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 81 insertions(+), 2 deletions(-) diff --git a/utils/build_tarball.sh b/utils/build_tarball.sh index 678b9ee5..f31025e5 100755 --- a/utils/build_tarball.sh +++ b/utils/build_tarball.sh @@ -5872,7 +5872,15 @@ ubuntu18_setup() SUDO=sudo - $SUDO debootstrap --arch="$OS_ARCH" --variant=buildd bionic "$OS_ROOTDIR" http://archive.ubuntu.com/ubuntu/ + if [ "$OS_ARCH" = "amd64" ] || [ "$OS_ARCH" = "i386" ]; then + REPOSITORY_URL="http://archive.ubuntu.com/ubuntu/" + #REPOSITORY_URL="http://old-releases.ubuntu.com/ubuntu/" + else + REPOSITORY_URL="http://ports.ubuntu.com/ubuntu-ports/" + #REPOSITORY_URL="http://old-releases.ubuntu.com/ubuntu/" + fi + + $SUDO debootstrap --arch="$OS_ARCH" --variant=buildd bionic "$OS_ROOTDIR" "$REPOSITORY_URL" $SUDO /bin/chown -R "$(id -u).$(id -g)" "$OS_ROOTDIR" $SUDO /bin/chmod -R u+rw "$OS_ROOTDIR" @@ -5897,6 +5905,8 @@ ubuntu18_build_fakechroot() #PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + elif [ "$OS_ARCH" = "ppc64el" ]; then + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-ppc64le" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -5962,6 +5972,8 @@ ubuntu18_build_runc() #PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + elif [ "$OS_ARCH" = "ppc64el" ]; then + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-ppc64le" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -6046,6 +6058,8 @@ ubuntu19_build_fakechroot() #PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + elif [ "$OS_ARCH" = "ppc64el" ]; then + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-ppc64le" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -6111,6 +6125,8 @@ ubuntu19_build_runc() #PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + elif [ "$OS_ARCH" = "ppc64el" ]; then + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-ppc64le" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -6202,6 +6218,8 @@ ubuntu20_build_fakechroot() #PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + elif [ "$OS_ARCH" = "ppc64el" ]; then + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-ppc64le" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -6267,6 +6285,8 @@ ubuntu20_build_runc() #PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + elif [ "$OS_ARCH" = "ppc64el" ]; then + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-ppc64le" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -6323,7 +6343,14 @@ ubuntu21_setup() SUDO=sudo - $SUDO debootstrap --arch="$OS_ARCH" --variant=buildd hirsute "$OS_ROOTDIR" http://old-releases.ubuntu.com/ubuntu/ + if [ "$OS_ARCH" = "amd64" ] || [ "$OS_ARCH" = "i386" ]; then + #REPOSITORY_URL="http://archive.ubuntu.com/ubuntu/" + REPOSITORY_URL="http://old-releases.ubuntu.com/ubuntu/" + else + #REPOSITORY_URL="http://ports.ubuntu.com/ubuntu-ports/" + REPOSITORY_URL="http://old-releases.ubuntu.com/ubuntu/" + fi + $SUDO debootstrap --arch="$OS_ARCH" --variant=buildd hirsute "$OS_ROOTDIR" "$REPOSITORY_URL" $SUDO /bin/chown -R "$(id -u).$(id -g)" "$OS_ROOTDIR" $SUDO /bin/chmod -R u+rw "$OS_ROOTDIR" @@ -6352,6 +6379,8 @@ ubuntu21_build_fakechroot() #PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + elif [ "$OS_ARCH" = "ppc64el" ]; then + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-ppc64le" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -6417,6 +6446,8 @@ ubuntu21_build_runc() #PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + elif [ "$OS_ARCH" = "ppc64el" ]; then + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-ppc64le" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -6729,6 +6760,8 @@ ubuntu23_build_fakechroot() #PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + elif [ "$OS_ARCH" = "ppc64el" ]; then + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-ppc64le" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -6794,6 +6827,8 @@ ubuntu23_build_runc() #PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + elif [ "$OS_ARCH" = "ppc64el" ]; then + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-ppc64le" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -8393,10 +8428,24 @@ create_package_tarball() copy_file fakechroot-source-glibc-aarch64/libfakechroot-AlmaLinux-8.so lib/libfakechroot-AlmaLinux-8-arm64.so copy_file fakechroot-source-glibc-aarch64/libfakechroot-AlmaLinux-9.so lib/libfakechroot-AlmaLinux-9-arm64.so + copy_file fakechroot-source-glibc-aarch64/libfakechroot-Ubuntu-22.so lib/libfakechroot-Ubuntu-18-arm64.so + copy_file fakechroot-source-glibc-aarch64/libfakechroot-Ubuntu-22.so lib/libfakechroot-Ubuntu-20-arm64.so copy_file fakechroot-source-glibc-aarch64/libfakechroot-Ubuntu-22.so lib/libfakechroot-Ubuntu-22-arm64.so + link_file lib/libfakechroot-Ubuntu-18-arm64.so libfakechroot-Ubuntu-17-arm64.so + link_file lib/libfakechroot-Ubuntu-20-arm64.so libfakechroot-Ubuntu-19-arm64.so + link_file lib/libfakechroot-Ubuntu-22-arm64.so libfakechroot-Ubuntu-21-arm64.so link_file lib/libfakechroot-Ubuntu-22-arm64.so libfakechroot-Ubuntu-arm64.so + + link_file lib/libfakechroot-Ubuntu-18-arm64.so libfakechroot-LinuxMint-17-arm64.so + link_file lib/libfakechroot-Ubuntu-18-arm64.so libfakechroot-LinuxMint-18-arm64.so + link_file lib/libfakechroot-Ubuntu-20-arm64.so libfakechroot-LinuxMint-19-arm64.so + link_file lib/libfakechroot-Ubuntu-20-arm64.so libfakechroot-LinuxMint-20-arm64.so + link_file lib/libfakechroot-Ubuntu-22-arm64.so libfakechroot-LinuxMint-21-arm64.so link_file lib/libfakechroot-Ubuntu-22-arm64.so libfakechroot-LinuxMint-22-arm64.so link_file lib/libfakechroot-Ubuntu-22-arm64.so libfakechroot-LinuxMint-arm64.so + + link_file lib/libfakechroot-Ubuntu-18-arm64.so libfakechroot-Debian-9-arm64.so + link_file lib/libfakechroot-Ubuntu-20-arm64.so libfakechroot-Debian-10-arm64.so link_file lib/libfakechroot-Ubuntu-22-arm64.so libfakechroot-Debian-11-arm64.so link_file lib/libfakechroot-Ubuntu-22-arm64.so libfakechroot-Debian-arm64.so @@ -8424,10 +8473,24 @@ create_package_tarball() copy_file fakechroot-source-glibc-ppc64le/libfakechroot-Fedora-38.so lib/libfakechroot-Fedora-38-ppc64le.so link_file lib/libfakechroot-Fedora-38-ppc64le.so libfakechroot-Fedora-ppc64le.so + copy_file fakechroot-source-glibc-ppc64le/libfakechroot-Ubuntu-18.so lib/libfakechroot-Ubuntu-18-ppc64le.so + copy_file fakechroot-source-glibc-ppc64le/libfakechroot-Ubuntu-20.so lib/libfakechroot-Ubuntu-20-ppc64le.so copy_file fakechroot-source-glibc-ppc64le/libfakechroot-Ubuntu-22.so lib/libfakechroot-Ubuntu-22-ppc64le.so + link_file lib/libfakechroot-Ubuntu-18-ppc64le.so libfakechroot-Ubuntu-17-ppc64le.so + link_file lib/libfakechroot-Ubuntu-20-ppc64le.so libfakechroot-Ubuntu-19-ppc64le.so + link_file lib/libfakechroot-Ubuntu-22-ppc64le.so libfakechroot-Ubuntu-21-ppc64le.so link_file lib/libfakechroot-Ubuntu-22-ppc64le.so libfakechroot-Ubuntu-ppc64le.so + + link_file lib/libfakechroot-Ubuntu-18-ppc64le.so libfakechroot-LinuxMint-17-ppc64le.so + link_file lib/libfakechroot-Ubuntu-18-ppc64le.so libfakechroot-LinuxMint-18-ppc64le.so + link_file lib/libfakechroot-Ubuntu-20-ppc64le.so libfakechroot-LinuxMint-19-ppc64le.so + link_file lib/libfakechroot-Ubuntu-20-ppc64le.so libfakechroot-LinuxMint-20-ppc64le.so + link_file lib/libfakechroot-Ubuntu-22-ppc64le.so libfakechroot-LinuxMint-21-ppc64le.so link_file lib/libfakechroot-Ubuntu-22-ppc64le.so libfakechroot-LinuxMint-22-ppc64le.so link_file lib/libfakechroot-Ubuntu-22-ppc64le.so libfakechroot-LinuxMint-ppc64le.so + + link_file lib/libfakechroot-Ubuntu-18-ppc64le.so libfakechroot-Debian-9-ppc64le.so + link_file lib/libfakechroot-Ubuntu-20-ppc64le.so libfakechroot-Debian-10-ppc64le.so link_file lib/libfakechroot-Ubuntu-22-ppc64le.so libfakechroot-Debian-11-ppc64le.so link_file lib/libfakechroot-Ubuntu-22-ppc64le.so libfakechroot-Debian-ppc64le.so @@ -8745,6 +8808,14 @@ alma9_build_fakechroot "aarch64" "${BUILD_DIR}/fakechroot-source-glibc-aarch64" alma9_build_patchelf "aarch64" "${BUILD_DIR}/patchelf-source-aarch64" #ostree_delete "aarch64" "alma" "9" +ubuntu18_setup "arm64" +ubuntu18_build_fakechroot "arm64" "${BUILD_DIR}/fakechroot-source-glibc-aarch64" +#ostree_delete "arm64" "ubuntu" "18" + +ubuntu20_setup "arm64" +ubuntu20_build_fakechroot "arm64" "${BUILD_DIR}/fakechroot-source-glibc-aarch64" +#ostree_delete "arm64" "ubuntu" "20" + ubuntu22_setup "arm64" ubuntu22_build_fakechroot "arm64" "${BUILD_DIR}/fakechroot-source-glibc-aarch64" #ubuntu22_build_runc "arm64" "${BUILD_DIR}/runc-source-aarch64" @@ -8776,6 +8847,14 @@ alma9_build_fakechroot "ppc64le" "${BUILD_DIR}/fakechroot-source-glibc-ppc64le" alma9_build_patchelf "ppc64le" "${BUILD_DIR}/patchelf-source-ppc64le" #ostree_delete "ppc64le" "alma" "9" +ubuntu18_setup "ppc64el" +ubuntu18_build_fakechroot "ppc64el" "${BUILD_DIR}/fakechroot-source-glibc-ppc64le" +#ostree_delete "ppc64el" "ubuntu" "18" + +ubuntu20_setup "ppc64el" +ubuntu20_build_fakechroot "ppc64el" "${BUILD_DIR}/fakechroot-source-glibc-ppc64le" +#ostree_delete "ppc64el" "ubuntu" "20" + ubuntu22_setup "ppc64el" ubuntu22_build_fakechroot "ppc64el" "${BUILD_DIR}/fakechroot-source-glibc-ppc64le" #ubuntu22_build_runc "ppc64el" "${BUILD_DIR}/runc-source-ppc64le" From 01c1a613ecb9d88372faec06731fc28a01d3db57 Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Fri, 23 Jun 2023 15:18:18 +0100 Subject: [PATCH 70/99] ps -p and images -p fix empty platforms --- udocker/container/localrepo.py | 4 ++-- udocker/container/structure.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/udocker/container/localrepo.py b/udocker/container/localrepo.py index 75b71134..b096753c 100644 --- a/udocker/container/localrepo.py +++ b/udocker/container/localrepo.py @@ -592,11 +592,11 @@ def get_image_platform_fmt(self): """Get the image platform from the metadata""" (manifest_json, dummy) = self.get_image_attributes() if not manifest_json: - return "" + return "unknown/unknown" try: p_architecture = manifest_json["architecture"] except KeyError: - return "" + p_architecture = "unknown" try: p_os = manifest_json["os"] except KeyError: diff --git a/udocker/container/structure.py b/udocker/container/structure.py index 6f1333e4..a6b11d6f 100644 --- a/udocker/container/structure.py +++ b/udocker/container/structure.py @@ -48,11 +48,11 @@ def get_container_platform_fmt(self): """Get the container platform from the metadata""" (dummy, container_json) = self.get_container_attr() if not container_json: - return "" + return "unknown/unknown" try: p_architecture = container_json["architecture"] except KeyError: - return "" + p_architecture = "unknown" try: p_os = container_json["os"] except KeyError: From 07cd19da8b10def5580abf1394469c1a3b8c41eb Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Fri, 23 Jun 2023 18:11:59 +0100 Subject: [PATCH 71/99] message when fakechroot lib does not match --- udocker/engine/fakechroot.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/udocker/engine/fakechroot.py b/udocker/engine/fakechroot.py index e0fa278d..e3bd209a 100644 --- a/udocker/engine/fakechroot.py +++ b/udocker/engine/fakechroot.py @@ -60,14 +60,15 @@ def select_fakechroot_so(self): f_util = FileUtil(self.localrepo.libdir) fakechroot_so = f_util.find_file_in_dir(image_list) - if not os.path.exists(fakechroot_so): - Msg().err("Error: libfakechroot not found", image_list) - Msg().out("Info: Host architecture might not be supported by", + if fakechroot_so.count('-') != 3: + Msg().out("Info: the OS or architecture might not be supported by", "this execution mode:", arch, "\n specify path to libfakechroot.so with", "environment UDOCKER_FAKECHROOT_SO", "\n or choose other execution mode with: udocker", "setup --execmode=", l=Msg.INF) + if not os.path.exists(fakechroot_so): + Msg().err("Error: libfakechroot not found", image_list) sys.exit(1) Msg().out("Debug: fakechroot_so:", fakechroot_so, l=Msg.DBG) From e250450d982551e0cd1dcf86d7b7d6726f201522 Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Fri, 23 Jun 2023 18:30:44 +0100 Subject: [PATCH 72/99] clean up comments --- udocker/container/localrepo.py | 1 - udocker/engine/fakechroot.py | 6 ++---- udocker/engine/proot.py | 3 --- udocker/engine/runc.py | 1 - udocker/engine/singularity.py | 1 - udocker/helper/elfpatcher.py | 1 - udocker/helper/hostinfo.py | 2 -- udocker/helper/osinfo.py | 3 --- utils/build_tarball.sh | 33 +++++++++++++++++++++++---------- 9 files changed, 25 insertions(+), 26 deletions(-) diff --git a/udocker/container/localrepo.py b/udocker/container/localrepo.py index b096753c..e5426e28 100644 --- a/udocker/container/localrepo.py +++ b/udocker/container/localrepo.py @@ -753,7 +753,6 @@ def _split_layer_id(self, layer_id): return ("", layer_id) - # ARCHNEW def _verify_layer_file(self, structure, layer_id): """Verify layer file in repository""" (layer_algorithm, layer_hash) = self._split_layer_id(layer_id) diff --git a/udocker/engine/fakechroot.py b/udocker/engine/fakechroot.py index e3bd209a..40c352ec 100644 --- a/udocker/engine/fakechroot.py +++ b/udocker/engine/fakechroot.py @@ -29,7 +29,6 @@ def __init__(self, localrepo, exec_mode): self._elfpatcher = None self._recommend_expand_symlinks = False - # ARCHNEW def select_fakechroot_so(self): """Select fakechroot sharable object library""" image_list = [] @@ -61,8 +60,8 @@ def select_fakechroot_so(self): f_util = FileUtil(self.localrepo.libdir) fakechroot_so = f_util.find_file_in_dir(image_list) if fakechroot_so.count('-') != 3: - Msg().out("Info: the OS or architecture might not be supported by", - "this execution mode:", arch, + Msg().out("Info: this OS or architecture might not be supported by", + "this execution mode", "\n specify path to libfakechroot.so with", "environment UDOCKER_FAKECHROOT_SO", "\n or choose other execution mode with: udocker", @@ -227,7 +226,6 @@ def _run_invalid_options(self): Msg().out("Warning: this execution mode does not support " "-P --netcoop --publish-all", l=Msg.WAR) - # ARCHNEW def _run_add_script_support(self, exec_path): """Add an interpreter for non binary executables (scripts)""" (dummy, filetype) = OSInfo(self.container_root).get_filetype(exec_path) diff --git a/udocker/engine/proot.py b/udocker/engine/proot.py index 318958f6..dec9fa6d 100644 --- a/udocker/engine/proot.py +++ b/udocker/engine/proot.py @@ -29,7 +29,6 @@ def __init__(self, localrepo, exec_mode): self.proot_newseccomp = False # New seccomp mode self._kernel = HostInfo().oskernel() # Emulate kernel - # ARCHNEW def select_proot(self): """Set proot executable and related variables""" self.executable = Config.conf['use_proot_executable'] @@ -63,7 +62,6 @@ def select_proot(self): if self._is_seccomp_patched(self.executable): self.proot_newseccomp = True - # ARCHNEW def _is_seccomp_patched(self, executable): """Check if kernel has ptrace/seccomp fixes added on 4.8.0. @@ -126,7 +124,6 @@ def _get_network_map(self): proot_netmap_list.extend(["-n", ]) return proot_netmap_list - # ARCHNEW def _get_qemu_string(self): """Get the qemu string for container run command if emulation needed""" qemu_filename = self._get_qemu() diff --git a/udocker/engine/runc.py b/udocker/engine/runc.py index a1267e97..7f3ffa31 100644 --- a/udocker/engine/runc.py +++ b/udocker/engine/runc.py @@ -37,7 +37,6 @@ def __init__(self, localrepo, exec_mode): self.execution_id = None self.engine_type = "" - # ARCHNEW def select_runc(self): """Set runc executable and related variables""" self.executable = Config.conf['use_runc_executable'] diff --git a/udocker/engine/singularity.py b/udocker/engine/singularity.py index db1ad2ac..010d85fa 100644 --- a/udocker/engine/singularity.py +++ b/udocker/engine/singularity.py @@ -27,7 +27,6 @@ def __init__(self, localrepo, exec_mode): self.executable = None # singularity self.execution_id = None - # ARCHNEW def select_singularity(self): """Set singularity executable and related variables""" self.executable = Config.conf['use_singularity_executable'] diff --git a/udocker/helper/elfpatcher.py b/udocker/helper/elfpatcher.py index 918824fb..2b4be197 100644 --- a/udocker/helper/elfpatcher.py +++ b/udocker/helper/elfpatcher.py @@ -39,7 +39,6 @@ def __init__(self, localrepo, container_id): self._shlib = re.compile(r"^lib\S+\.so(\.\d+)*$") self._uid = HostInfo.uid - # ARCHNEW def select_patchelf(self): """Set patchelf executable""" patchelf_exec = Config.conf['use_patchelf_executable'] diff --git a/udocker/helper/hostinfo.py b/udocker/helper/hostinfo.py index 955d00a1..9352c881 100644 --- a/udocker/helper/hostinfo.py +++ b/udocker/helper/hostinfo.py @@ -23,7 +23,6 @@ def username(self): except KeyError: return "" - # ARCHNEW def arch(self, target="UDOCKER"): """Get the host system architecture""" machine = platform.machine() @@ -99,7 +98,6 @@ def platform_to_str(self, platform_in): return "%s/%s" % parsed_platform[0:2] return parsed_platform[0] - # ARCHNEW def platform(self, return_str=True): """get docker platform os/architecture/variant""" architecture = self.arch("docker") diff --git a/udocker/helper/osinfo.py b/udocker/helper/osinfo.py index 3ab8014a..e4f869c3 100644 --- a/udocker/helper/osinfo.py +++ b/udocker/helper/osinfo.py @@ -14,7 +14,6 @@ class OSInfo(ArchInfo): def __init__(self, root_dir): self._root_dir = root_dir - # ARCH NEW def get_filetype(self, filename): """Get architecture information from binary using file and readelf""" if not filename.startswith(self._root_dir): @@ -33,7 +32,6 @@ def get_filetype(self, filename): return ("readelf", filetype) return ("", "") - # ARCH NEW def arch(self, target="UDOCKER"): """Get OS architecture""" for filename in self.get_binaries_list(): @@ -50,7 +48,6 @@ def arch(self, target="UDOCKER"): continue return "" - # ARCH NEW def is_same_arch(self, other_root_dir="/" ,target="UDOCKER"): """Compare architectures for two system trees""" this_arch = self.arch(target) diff --git a/utils/build_tarball.sh b/utils/build_tarball.sh index f31025e5..b994885e 100755 --- a/utils/build_tarball.sh +++ b/utils/build_tarball.sh @@ -136,7 +136,7 @@ prepare_proot_source() /bin/mv proot-udocker "$PROOT_SOURCE_DIR" } -prepare_patchelf_source() +prepare_patchelf_source_v1() { echo "prepare_patchelf_source : $1" local PATCHELF_SOURCE_DIR="$1" @@ -147,9 +147,21 @@ prepare_patchelf_source() return fi - #git clone --branch udocker-1 --depth=1 https://github.com/jorge-lip/patchelf-udocker.git - #/bin/rm -Rf "$BUILD_DIR/patchelf-udocker/.git" - #/bin/mv patchelf-udocker "$PATCHELF_SOURCE_DIR" + git clone --branch udocker-1 --depth=1 https://github.com/jorge-lip/patchelf-udocker.git + /bin/rm -Rf "$BUILD_DIR/patchelf-udocker/.git" + /bin/mv patchelf-udocker "$PATCHELF_SOURCE_DIR" +} + +prepare_patchelf_source_v2() +{ + echo "prepare_patchelf_source : $1" + local PATCHELF_SOURCE_DIR="$1" + cd "$BUILD_DIR" || exit 1 + + if [ -d "$PATCHELF_SOURCE_DIR" ] ; then + echo "patchelf source already exists: $PATCHELF_SOURCE_DIR" + return + fi git clone --branch udocker-2 --depth=1 https://github.com/jorge-lip/patchelf-udocker-2.git /bin/rm -Rf "$BUILD_DIR/patchelf-udocker-2/.git" @@ -8288,7 +8300,8 @@ create_package_tarball() copy_file proot-source-x86_64/proot-Fedora-25.bin bin/proot-x86_64 copy_file proot-source-x86_64/proot-Fedora-30.bin bin/proot-x86_64-4_8_0 - copy_file patchelf-source-x86_64/patchelf-Fedora-38 bin/patchelf-x86_64 + copy_file patchelf-source-x86_64/patchelf-Fedora-25 bin/patchelf-x86_64 + #copy_file patchelf-source-x86_64/patchelf-Fedora-38 bin/patchelf-x86_64 copy_file runc-source-x86_64/runc-Ubuntu-22.bin bin/runc-x86_64 copy_file crun-source-x86_64/crun-nix-latest bin/crun-x86_64 @@ -8579,7 +8592,7 @@ fedora30_build_proot "i386" "${BUILD_DIR}/proot-source-x86" # x86_64 # ####### prepare_proot_source "${BUILD_DIR}/proot-source-x86_64" -prepare_patchelf_source "${BUILD_DIR}/patchelf-source-x86_64" +prepare_patchelf_source_v1 "${BUILD_DIR}/patchelf-source-x86_64" prepare_fakechroot_glibc_source "${BUILD_DIR}/fakechroot-source-glibc-x86_64" prepare_fakechroot_musl_source "${BUILD_DIR}/fakechroot-source-musl-x86_64" prepare_runc_source "${BUILD_DIR}/runc-source-x86_64" @@ -8587,7 +8600,7 @@ prepare_runc_source "${BUILD_DIR}/runc-source-x86_64" fedora25_setup "x86_64" fedora25_build_proot "x86_64" "${BUILD_DIR}/proot-source-x86_64" -#fedora25_build_patchelf "x86_64" "${BUILD_DIR}/patchelf-source-x86_64" +fedora25_build_patchelf "x86_64" "${BUILD_DIR}/patchelf-source-x86_64" fedora25_build_fakechroot "x86_64" "${BUILD_DIR}/fakechroot-source-glibc-x86_64" #ostree_delete "x86_64" "fedora" "25" # @@ -8633,7 +8646,7 @@ fedora36_build_fakechroot "x86_64" "${BUILD_DIR}/fakechroot-source-glibc-x86_64" # fedora38_setup "x86_64" #fedora38_build_proot "x86_64" "${BUILD_DIR}/proot-source-x86_64" -fedora38_build_patchelf "x86_64" "${BUILD_DIR}/patchelf-source-x86_64" +#fedora38_build_patchelf "x86_64" "${BUILD_DIR}/patchelf-source-x86_64" fedora38_build_fakechroot "x86_64" "${BUILD_DIR}/fakechroot-source-glibc-x86_64" #ostree_delete "x86_64" "fedora" "38" @@ -8769,7 +8782,7 @@ ubuntu23_build_fakechroot "amd64" "${BUILD_DIR}/fakechroot-source-glibc-x86_64" # aarch64 # ####### prepare_proot_source "${BUILD_DIR}/proot-source-aarch64" -prepare_patchelf_source "${BUILD_DIR}/patchelf-source-aarch64" +prepare_patchelf_source_v2 "${BUILD_DIR}/patchelf-source-aarch64" prepare_fakechroot_glibc_source "${BUILD_DIR}/fakechroot-source-glibc-aarch64" prepare_runc_source "${BUILD_DIR}/runc-source-aarch64" # @@ -8826,7 +8839,7 @@ ubuntu22_build_runc_root "arm64" "${BUILD_DIR}/runc-source-aarch64" # ppc64le # ####### prepare_proot_source "${BUILD_DIR}/proot-source-ppc64le" -prepare_patchelf_source "${BUILD_DIR}/patchelf-source-ppc64le" +prepare_patchelf_source_v2 "${BUILD_DIR}/patchelf-source-ppc64le" prepare_fakechroot_glibc_source "${BUILD_DIR}/fakechroot-source-glibc-ppc64le" prepare_runc_source "${BUILD_DIR}/runc-source-ppc64le" # From 3e994b4589757317f601deb6e02a442a3d6db3b1 Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Sun, 25 Jun 2023 03:38:49 +0100 Subject: [PATCH 73/99] host qemu architecture using HostInfo() --- udocker/engine/base.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/udocker/engine/base.py b/udocker/engine/base.py index ee048d8a..f9a3ac55 100644 --- a/udocker/engine/base.py +++ b/udocker/engine/base.py @@ -677,7 +677,8 @@ def _check_arch(self, fail=False): def _get_qemu(self, return_path=False): """Get the qemu binary name if emulation needed""" container_qemu_arch = OSInfo(self.container_root).arch("qemu") - host_qemu_arch = OSInfo("/").arch("qemu") + #host_qemu_arch = OSInfo("/").arch("qemu") + host_qemu_arch = HostInfo().arch("qemu") if not (container_qemu_arch and host_qemu_arch): return "" if container_qemu_arch == host_qemu_arch: From afe28b3688542f5db16612f5feb011991a67e468 Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Sun, 25 Jun 2023 03:39:35 +0100 Subject: [PATCH 74/99] add proot for arm 32bit --- utils/build_tarball.sh | 174 +++++++++++++++++++++++++++++++++++++---- 1 file changed, 160 insertions(+), 14 deletions(-) diff --git a/utils/build_tarball.sh b/utils/build_tarball.sh index b994885e..3b7d5961 100755 --- a/utils/build_tarball.sh +++ b/utils/build_tarball.sh @@ -5622,7 +5622,7 @@ ubuntu12_build_fakechroot() apt-get -y update apt-get -y --no-install-recommends install wget debconf devscripts gnupg nano apt-get -y update -apt-get -y install locales build-essential gcc make autoconf m4 automake gawk libtool bash i +apt-get -y install locales build-essential gcc make autoconf m4 automake gawk libtool bash apt-get -y install diffutils file which EOF_ubuntu12_packages @@ -5747,7 +5747,15 @@ ubuntu16_setup() SUDO=sudo - $SUDO debootstrap --arch="$OS_ARCH" --variant=buildd xenial "$OS_ROOTDIR" http://archive.ubuntu.com/ubuntu/ + if [ "$OS_ARCH" = "amd64" ] || [ "$OS_ARCH" = "i386" ]; then + REPOSITORY_URL="http://archive.ubuntu.com/ubuntu/" + #REPOSITORY_URL="http://old-releases.ubuntu.com/ubuntu/" + else + REPOSITORY_URL="http://ports.ubuntu.com/ubuntu-ports/" + #REPOSITORY_URL="http://old-releases.ubuntu.com/ubuntu/" + fi + + $SUDO debootstrap --arch="$OS_ARCH" --variant=buildd xenial "$OS_ROOTDIR" "$REPOSITORY_URL" $SUDO /bin/chown -R "$(id -u).$(id -g)" "$OS_ROOTDIR" $SUDO /bin/chmod -R u+rw "$OS_ROOTDIR" @@ -5773,6 +5781,8 @@ ubuntu16_build_fakechroot() #PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + elif [ "$OS_ARCH" = "ppc64el" ]; then + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-ppc64le" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -5835,6 +5845,8 @@ ubuntu16_build_runc() #PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + elif [ "$OS_ARCH" = "ppc64el" ]; then + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-ppc64le" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 @@ -6877,6 +6889,109 @@ EOF_ubuntu23_runc } +# ############################################################################# +# Debian 10 +# ############################################################################# + +debian10_setup() +{ + echo "debian10_setup : $1" + local OS_ARCH="$1" + local OS_NAME="debian" + local OS_RELVER="10" + local OS_ROOTDIR="${BUILD_DIR}/${OS_NAME}_${OS_RELVER}_${OS_ARCH}" + + if [ -x "${OS_ROOTDIR}/usr/lib/gcc" ] ; then + echo "os already setup : ${OS_ROOTDIR}" + return + fi + + SUDO=sudo + + if [ "$OS_ARCH" = "amd64" ] || [ "$OS_ARCH" = "i386" ]; then + REPOSITORY_URL="http://ftp.debian.org/debian/" + else + REPOSITORY_URL="http://ftp.debian.org/debian/" + fi + + #$SUDO debootstrap --arch=armhf sid /chroots/sid-armhf http://ftp.debian.org/debian/ + $SUDO debootstrap --arch="$OS_ARCH" buster "$OS_ROOTDIR" "$REPOSITORY_URL" + + $SUDO /bin/chown -R "$(id -u).$(id -g)" "$OS_ROOTDIR" + $SUDO /bin/chmod -R u+rw "$OS_ROOTDIR" +} + + +debian10_build_proot() +{ + echo "debian10_build_proot : $1" + local OS_ARCH="$1" + local PROOT_SOURCE_DIR="$2" + local OS_NAME="debian" + local OS_RELVER="10" + local OS_ROOTDIR="${BUILD_DIR}/${OS_NAME}_${OS_RELVER}_${OS_ARCH}" + local PROOT="" + + if [ "$OS_ARCH" = "i386" ]; then + PROOT="$S_PROOT_DIR/proot-x86" + elif [ "$OS_ARCH" = "x86_64" ]; then + PROOT="$HOME/.udocker/bin/proot-x86_64" + elif [ "$OS_ARCH" = "aarch64" ]; then + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" + elif [ "$OS_ARCH" = "armhf" ]; then + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-arm" + elif [ "$OS_ARCH" = "armel" ]; then + PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-arm" + else + echo "unsupported $OS_NAME architecture: $OS_ARCH" + exit 2 + fi + + export PROOT_NO_SECCOMP=1 + + if [ -x "${PROOT_SOURCE_DIR}/proot-Debian-10.bin" ] ; then + echo "proot binary already compiled : ${PROOT_SOURCE_DIR}/proot-Debian-10.bin" + else + # compile proot + $PROOT -0 -r "$OS_ROOTDIR" -b "${PROOT_SOURCE_DIR}:/proot" -w / -b /dev \ + -b "${S_PROOT_PACKAGES_DIR}:/proot-static-packages" /bin/bash <<'EOF_debian10_proot_1' +apt-get -y update +apt-get -y install locales build-essential gcc make autoconf m4 automake gawk libtool bash +apt-get -y install diffutils file make python3 python3-dev +cd /proot +/bin/rm -f proot-Debian-10.bin src/proot src/libtalloc.a src/talloc.h +/bin/rm -Rf talloc* +# BUILD TALLOC +tar xzvf /proot-static-packages/talloc.tar.gz +cd talloc* +make clean +./configure +make +cp talloc.h /proot/src +cd bin/default +[ -f talloc.c.6.o ] && ar qf libtalloc.a talloc.c.6.o +[ -f talloc.c.5.o -a ! -f libtalloc.a ] && ar qf libtalloc.a talloc.c.5.o +cp libtalloc.a /proot/src && make clean +# BUILD PROOT +cd /proot/src +make clean +make loader.elf +make loader-m32.elf +make build.h +LDFLAGS="-L/proot/usr/src -static" make proot +EOF_debian10_proot_1 + fi + + if [ -e "${PROOT_SOURCE_DIR}/src/proot" ]; then + mv "${PROOT_SOURCE_DIR}/src/proot" "${PROOT_SOURCE_DIR}/proot-Debian-10.bin" + fi + + if [ ! -e "${PROOT_SOURCE_DIR}/proot-Debian-10.bin" ]; then + echo "proot compilation failed ${PROOT_SOURCE_DIR}/proot-Debian-10.bin not found" + exit 1 + fi +} + # ############################################################################# # Alpine 3.6.x @@ -8295,6 +8410,12 @@ create_package_tarball() # x86 ---------------------------------------------------------------------------------------------------- copy_file proot-source-x86/proot-Fedora-25.bin bin/proot-x86 copy_file proot-source-x86/proot-Fedora-30.bin bin/proot-x86-4_8_0 + + # armhf -------------------------------------------------------------------------------------------------- + copy_file proot-source-armhf/proot-Debian-10.bin bin/proot-armhf + + # armel -------------------------------------------------------------------------------------------------- + copy_file proot-source-armel/proot-Debian-10.bin bin/proot-armel # x86_64 ------------------------------------------------------------------------------------------------- copy_file proot-source-x86_64/proot-Fedora-25.bin bin/proot-x86_64 @@ -8375,9 +8496,9 @@ create_package_tarball() copy_file fakechroot-source-glibc-x86_64/libfakechroot-Ubuntu-21.so lib/libfakechroot-Ubuntu-21-x86_64.so copy_file fakechroot-source-glibc-x86_64/libfakechroot-Ubuntu-22.so lib/libfakechroot-Ubuntu-22-x86_64.so copy_file fakechroot-source-glibc-x86_64/libfakechroot-Ubuntu-23.so lib/libfakechroot-Ubuntu-23-x86_64.so - link_file lib/libfakechroot-Ubuntu-14-x86_64.so libfakechroot-Ubuntu-9-x86_64.so - link_file lib/libfakechroot-Ubuntu-14-x86_64.so libfakechroot-Ubuntu-10-x86_64.so - link_file lib/libfakechroot-Ubuntu-14-x86_64.so libfakechroot-Ubuntu-11-x86_64.so + link_file lib/libfakechroot-Ubuntu-12-x86_64.so libfakechroot-Ubuntu-9-x86_64.so + link_file lib/libfakechroot-Ubuntu-12-x86_64.so libfakechroot-Ubuntu-10-x86_64.so + link_file lib/libfakechroot-Ubuntu-12-x86_64.so libfakechroot-Ubuntu-11-x86_64.so link_file lib/libfakechroot-Ubuntu-14-x86_64.so libfakechroot-Ubuntu-13-x86_64.so link_file lib/libfakechroot-Ubuntu-16-x86_64.so libfakechroot-Ubuntu-15-x86_64.so link_file lib/libfakechroot-Ubuntu-18-x86_64.so libfakechroot-Ubuntu-17-x86_64.so @@ -8387,7 +8508,7 @@ create_package_tarball() link_file lib/libfakechroot-Ubuntu-14-x86_64.so libfakechroot-Debian-8-x86_64.so link_file lib/libfakechroot-Ubuntu-16-x86_64.so libfakechroot-Debian-9-x86_64.so link_file lib/libfakechroot-Ubuntu-19-x86_64.so libfakechroot-Debian-10-x86_64.so - link_file lib/libfakechroot-Ubuntu-21-x86_64.so libfakechroot-Debian-11-x86_64.so + link_file lib/libfakechroot-Ubuntu-20-x86_64.so libfakechroot-Debian-11-x86_64.so link_file lib/libfakechroot-Ubuntu-23-x86_64.so libfakechroot-Debian-x86_64.so link_file lib/libfakechroot-Ubuntu-12-x86_64.so libfakechroot-LinuxMint-10-x86_64.so @@ -8441,14 +8562,16 @@ create_package_tarball() copy_file fakechroot-source-glibc-aarch64/libfakechroot-AlmaLinux-8.so lib/libfakechroot-AlmaLinux-8-arm64.so copy_file fakechroot-source-glibc-aarch64/libfakechroot-AlmaLinux-9.so lib/libfakechroot-AlmaLinux-9-arm64.so - copy_file fakechroot-source-glibc-aarch64/libfakechroot-Ubuntu-22.so lib/libfakechroot-Ubuntu-18-arm64.so - copy_file fakechroot-source-glibc-aarch64/libfakechroot-Ubuntu-22.so lib/libfakechroot-Ubuntu-20-arm64.so + copy_file fakechroot-source-glibc-aarch64/libfakechroot-Ubuntu-16.so lib/libfakechroot-Ubuntu-16-arm64.so + copy_file fakechroot-source-glibc-aarch64/libfakechroot-Ubuntu-18.so lib/libfakechroot-Ubuntu-18-arm64.so + copy_file fakechroot-source-glibc-aarch64/libfakechroot-Ubuntu-20.so lib/libfakechroot-Ubuntu-20-arm64.so copy_file fakechroot-source-glibc-aarch64/libfakechroot-Ubuntu-22.so lib/libfakechroot-Ubuntu-22-arm64.so link_file lib/libfakechroot-Ubuntu-18-arm64.so libfakechroot-Ubuntu-17-arm64.so link_file lib/libfakechroot-Ubuntu-20-arm64.so libfakechroot-Ubuntu-19-arm64.so link_file lib/libfakechroot-Ubuntu-22-arm64.so libfakechroot-Ubuntu-21-arm64.so link_file lib/libfakechroot-Ubuntu-22-arm64.so libfakechroot-Ubuntu-arm64.so + link_file lib/libfakechroot-Ubuntu-16-arm64.so libfakechroot-LinuxMint-16-arm64.so link_file lib/libfakechroot-Ubuntu-18-arm64.so libfakechroot-LinuxMint-17-arm64.so link_file lib/libfakechroot-Ubuntu-18-arm64.so libfakechroot-LinuxMint-18-arm64.so link_file lib/libfakechroot-Ubuntu-20-arm64.so libfakechroot-LinuxMint-19-arm64.so @@ -8457,9 +8580,9 @@ create_package_tarball() link_file lib/libfakechroot-Ubuntu-22-arm64.so libfakechroot-LinuxMint-22-arm64.so link_file lib/libfakechroot-Ubuntu-22-arm64.so libfakechroot-LinuxMint-arm64.so - link_file lib/libfakechroot-Ubuntu-18-arm64.so libfakechroot-Debian-9-arm64.so - link_file lib/libfakechroot-Ubuntu-20-arm64.so libfakechroot-Debian-10-arm64.so - link_file lib/libfakechroot-Ubuntu-22-arm64.so libfakechroot-Debian-11-arm64.so + link_file lib/libfakechroot-Ubuntu-16-arm64.so libfakechroot-Debian-9-arm64.so + link_file lib/libfakechroot-Ubuntu-18-arm64.so libfakechroot-Debian-10-arm64.so + link_file lib/libfakechroot-Ubuntu-20-arm64.so libfakechroot-Debian-11-arm64.so link_file lib/libfakechroot-Ubuntu-22-arm64.so libfakechroot-Debian-arm64.so link_file lib/libfakechroot-AlmaLinux-8-arm64.so libfakechroot-CentOS-8-arm64.so @@ -8486,6 +8609,7 @@ create_package_tarball() copy_file fakechroot-source-glibc-ppc64le/libfakechroot-Fedora-38.so lib/libfakechroot-Fedora-38-ppc64le.so link_file lib/libfakechroot-Fedora-38-ppc64le.so libfakechroot-Fedora-ppc64le.so + copy_file fakechroot-source-glibc-ppc64le/libfakechroot-Ubuntu-16.so lib/libfakechroot-Ubuntu-16-ppc64le.so copy_file fakechroot-source-glibc-ppc64le/libfakechroot-Ubuntu-18.so lib/libfakechroot-Ubuntu-18-ppc64le.so copy_file fakechroot-source-glibc-ppc64le/libfakechroot-Ubuntu-20.so lib/libfakechroot-Ubuntu-20-ppc64le.so copy_file fakechroot-source-glibc-ppc64le/libfakechroot-Ubuntu-22.so lib/libfakechroot-Ubuntu-22-ppc64le.so @@ -8494,6 +8618,7 @@ create_package_tarball() link_file lib/libfakechroot-Ubuntu-22-ppc64le.so libfakechroot-Ubuntu-21-ppc64le.so link_file lib/libfakechroot-Ubuntu-22-ppc64le.so libfakechroot-Ubuntu-ppc64le.so + link_file lib/libfakechroot-Ubuntu-16-ppc64le.so libfakechroot-LinuxMint-16-ppc64le.so link_file lib/libfakechroot-Ubuntu-18-ppc64le.so libfakechroot-LinuxMint-17-ppc64le.so link_file lib/libfakechroot-Ubuntu-18-ppc64le.so libfakechroot-LinuxMint-18-ppc64le.so link_file lib/libfakechroot-Ubuntu-20-ppc64le.so libfakechroot-LinuxMint-19-ppc64le.so @@ -8502,9 +8627,9 @@ create_package_tarball() link_file lib/libfakechroot-Ubuntu-22-ppc64le.so libfakechroot-LinuxMint-22-ppc64le.so link_file lib/libfakechroot-Ubuntu-22-ppc64le.so libfakechroot-LinuxMint-ppc64le.so - link_file lib/libfakechroot-Ubuntu-18-ppc64le.so libfakechroot-Debian-9-ppc64le.so - link_file lib/libfakechroot-Ubuntu-20-ppc64le.so libfakechroot-Debian-10-ppc64le.so - link_file lib/libfakechroot-Ubuntu-22-ppc64le.so libfakechroot-Debian-11-ppc64le.so + link_file lib/libfakechroot-Ubuntu-16-ppc64le.so libfakechroot-Debian-9-ppc64le.so + link_file lib/libfakechroot-Ubuntu-18-ppc64le.so libfakechroot-Debian-10-ppc64le.so + link_file lib/libfakechroot-Ubuntu-20-ppc64le.so libfakechroot-Debian-11-ppc64le.so link_file lib/libfakechroot-Ubuntu-22-ppc64le.so libfakechroot-Debian-ppc64le.so link_file lib/libfakechroot-AlmaLinux-8-ppc64le.so libfakechroot-CentOS-8-ppc64le.so @@ -8777,6 +8902,19 @@ ubuntu23_build_fakechroot "amd64" "${BUILD_DIR}/fakechroot-source-glibc-x86_64" #ubuntu23_build_runc "amd64" "${BUILD_DIR}/runc-source-x86_64" #ostree_delete "amd64" "ubuntu" "23" +# ####### +# armhf +# ####### +prepare_proot_source "${BUILD_DIR}/proot-source-armhf" +debian10_setup "armhf" +debian10_build_proot "armhf" "${BUILD_DIR}/proot-source-armhf" + +# ####### +# armel +# ####### +prepare_proot_source "${BUILD_DIR}/proot-source-armel" +debian10_setup "armel" +debian10_build_proot "armel" "${BUILD_DIR}/proot-source-armel" # ####### # aarch64 @@ -8821,6 +8959,10 @@ alma9_build_fakechroot "aarch64" "${BUILD_DIR}/fakechroot-source-glibc-aarch64" alma9_build_patchelf "aarch64" "${BUILD_DIR}/patchelf-source-aarch64" #ostree_delete "aarch64" "alma" "9" +ubuntu16_setup "arm64" +ubuntu16_build_fakechroot "arm64" "${BUILD_DIR}/fakechroot-source-glibc-aarch64" +#ostree_delete "arm64" "ubuntu" "16" + ubuntu18_setup "arm64" ubuntu18_build_fakechroot "arm64" "${BUILD_DIR}/fakechroot-source-glibc-aarch64" #ostree_delete "arm64" "ubuntu" "18" @@ -8860,6 +9002,10 @@ alma9_build_fakechroot "ppc64le" "${BUILD_DIR}/fakechroot-source-glibc-ppc64le" alma9_build_patchelf "ppc64le" "${BUILD_DIR}/patchelf-source-ppc64le" #ostree_delete "ppc64le" "alma" "9" +ubuntu16_setup "ppc64el" +ubuntu16_build_fakechroot "ppc64el" "${BUILD_DIR}/fakechroot-source-glibc-ppc64le" +#ostree_delete "ppc64el" "ubuntu" "16" + ubuntu18_setup "ppc64el" ubuntu18_build_fakechroot "ppc64el" "${BUILD_DIR}/fakechroot-source-glibc-ppc64le" #ostree_delete "ppc64el" "ubuntu" "18" From 12e34d7f337e15c0baac1eb3dcd09bd8b2eb5529 Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Sun, 25 Jun 2023 03:40:20 +0100 Subject: [PATCH 75/99] fix binary file detection --- udocker/engine/fakechroot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/udocker/engine/fakechroot.py b/udocker/engine/fakechroot.py index 40c352ec..0ae2ef97 100644 --- a/udocker/engine/fakechroot.py +++ b/udocker/engine/fakechroot.py @@ -229,7 +229,7 @@ def _run_invalid_options(self): def _run_add_script_support(self, exec_path): """Add an interpreter for non binary executables (scripts)""" (dummy, filetype) = OSInfo(self.container_root).get_filetype(exec_path) - if "ELF" in filetype and ("static" in filetype or "dynamic" in filetype): + if "ELF" in filetype and "rror" not in filetype: self.opt["cmd"][0] = exec_path return [] #env_exec = FileUtil("env").find_exec("/bin:/usr/bin", self.container_root) From 7b3187fe37539e7797d5e39aacafb6004ed4e5e7 Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Sun, 25 Jun 2023 03:41:25 +0100 Subject: [PATCH 76/99] improve architecture detection --- udocker/helper/archinfo.py | 57 +++++++++++++++++---------- udocker/helper/hostinfo.py | 2 +- udocker/helper/osinfo.py | 80 +++++++++++++++++++++++++++++++------- 3 files changed, 105 insertions(+), 34 deletions(-) diff --git a/udocker/helper/archinfo.py b/udocker/helper/archinfo.py index de8879d5..59fe106b 100644 --- a/udocker/helper/archinfo.py +++ b/udocker/helper/archinfo.py @@ -11,40 +11,60 @@ class ArchInfo(object): _arch_list = [ {'docker':['amd64'], 'qemu':['x86_64'], 'UDOCKER':['x86_64'], - 'uname':['x86_64'], 'file':['x86-64'], 'readelf':['X86_64']}, + 'uname':['x86_64'], 'file':['x86-64'], 'readelf':['X86-64'], + 'arch/var':['amd64']}, + {'docker':['x86_64'], 'qemu':['x86_64'], 'UDOCKER':['x86_64'], + 'uname':['x86_64'], 'file':['x86-64'], 'readelf':['X86_64'], + 'arch/var':['amd64']}, {'docker':['386'], 'qemu':['i386'], 'UDOCKER':['x86'], - 'uname':['i386'], 'file':['Intel 80386'], 'readelf':['Intel 80386']}, + 'uname':['i386'], 'file':['Intel 80386'], 'readelf':['Intel 80386'], + 'arch/var':['386']}, {'docker':['arm64'], 'qemu':['aarch64'], 'UDOCKER':['arm64'], - 'uname':['aarch64'], 'file':['aarch64'], 'readelf':['AArch64']}, - {'docker':['arm'], 'qemu':['arm'], 'UDOCKER':['arm'], - 'uname':['arm'], 'file':[' ARM'], 'readelf':[' ARM']}, + 'uname':['aarch64'], 'file':['aarch64'], 'readelf':['AArch64'], + 'arch/var':['arm64']}, + {'docker':['arm'], 'qemu':['arm'], 'UDOCKER':['armhf'], + 'uname':['armv7l'], 'file':[' ARM', '32-bit', 'LSB', 'EABI5'], + 'readelf':[' ARM', 'hard-float', 'little', 'Version5 EABI'], + 'arch/var':['arm/v7']}, + {'docker':['arm/v4'], 'qemu':['arm'], 'UDOCKER':['armel'], + 'uname':['arm'], 'file':[' ARM', '32-bit', 'LSB', 'EABI5'], + 'readelf':[' ARM', 'little', 'Version5 EABI'], 'arch/var':['arm/v4']}, + {'docker':['arm/v5'], 'qemu':['arm'], 'UDOCKER':['armel'], + 'uname':['arm'], 'file':[' ARM', '32-bit', 'LSB', 'EABI5'], + 'readelf':[' ARM', 'little', 'Version5 EABI'], 'arch/var':['arm/v5']}, + {'docker':['arm/v6'], 'qemu':['arm'], 'UDOCKER':['armel'], + 'uname':['arm'], 'file':[' ARM', '32-bit', 'LSB', 'EABI5'], + 'readelf':[' ARM', 'little', 'Version5 EABI'], 'arch/var':['arm/v6']}, + {'docker':['arm'], 'qemu':['arm'], 'UDOCKER':['armel'], + 'uname':['arm'], 'file':[' ARM', '32-bit', 'LSB', 'EABI5'], + 'readelf':[' ARM', 'little', 'Version5 EABI'], 'arch/var':['arm']}, {'docker':['ppc64le'], 'qemu':['ppc64le'], 'UDOCKER':['ppc64le'], 'uname':['ppc64le'], 'file':['64-bit PowerPC', 'LSB'], - 'readelf':['PowerPC64', 'little endian']}, + 'readelf':['PowerPC64', 'little endian'], 'arch/var':['ppc64le']}, {'docker':['ppc64'], 'qemu':['ppc64'], 'UDOCKER':['ppc64'], 'uname':['ppc64'], 'file':['PowerPC', '64-bit'], - 'readelf':['PowerPC', 'ELF64']}, + 'readelf':['PowerPC', 'ELF64'], 'arch/var':['ppc64']}, {'docker':['ppc'], 'qemu':['ppc'], 'UDOCKER':['ppc'], 'uname':['ppc'], 'file':['PowerPC', '32-bit'], - 'readelf':['PowerPC', 'ELF32']}, + 'readelf':['PowerPC', 'ELF32'], 'arch/var':['ppc']}, {'docker':['mipsle'], 'qemu':['mipsel'], 'UDOCKER':['mipsle'], 'uname':['mips'], 'file':['mips', '32-bit', 'LSB executable'], - 'readelf':['mips', 'ELF32', 'little endian']}, + 'readelf':['mips', 'ELF32', 'little endian'], 'arch/var':['mipsle']}, {'docker':['mips'], 'qemu':['mips'], 'UDOCKER':['mips'], 'uname':['mips'], 'file':['mips', '32-bit', 'MSB'], - 'readelf':['mips', 'ELF32', 'big endian']}, + 'readelf':['mips', 'ELF32', 'big endian'], 'arch/var':['mips']}, {'docker':['mips64le'], 'qemu':['mips64el'], 'UDOCKER':['mips64le'], 'uname':['mips64'], 'file':['mips', '64-bit', 'LSB executable'], - 'readelf':['mips', 'ELF64', 'little endian']}, + 'readelf':['mips', 'ELF64', 'little endian'], 'arch/var':['mips64']}, {'docker':['mips64'], 'qemu':['mips64'], 'UDOCKER':['mips64'], 'uname':['mips64'], 'file':['mips', '64-bit', 'MSB'], - 'readelf':['mips', 'ELF64', 'big endian']}, + 'readelf':['mips', 'ELF64', 'big endian'], 'arch/var':['mips64']}, {'docker':['riscv64'], 'qemu':['riscv64'], 'UDOCKER':['riscv64'], 'uname':['riscv64'], 'file':['riscv', '64-bit'], - 'readelf':['riscv', 'ELF64']}, + 'readelf':['riscv', 'ELF64'], 'arch/var':['riscv64']}, {'docker':['s390x'], 'qemu':['s390x'], 'UDOCKER':['s390x'], 'uname':['s390x'], 'file':['IBM S/390', '64-bit', 'MSB'], - 'readelf':['IBM S/390', 'ELF64', 'big endian']} + 'readelf':['IBM S/390', 'ELF64', 'big endian'], 'arch/var':['s390x']} ] # binaries from which to get architecture information using @@ -63,7 +83,7 @@ class ArchInfo(object): "/usr/sbin/ldconfig", "/sbin/ldconfig", "/bin/bash", "/bin/sh", "/bin/zsh", "/bin/csh", "/bin/tcsh", "/bin/ash", - "/bin/ls", "/bin/busybox", + "/bin/dash", "/bin/ls", "/bin/busybox", "/system/bin/sh", "/system/bin/ls", "/lib/ld-linux.so", "/lib/ld-linux.so.1", "/lib/ld-linux.so.2", "/lib/ld-linux.so.3", @@ -92,13 +112,10 @@ def get_arch(self, source_type, arch_info, target_type="UDOCKER"): break found = True if found: - if target_type == "ALL": - return (arch_dict['docker'], arch_dict['qemu'], - arch_dict['UDOCKER']) - return (arch_dict[target_type], [], []) + return arch_dict[target_type] except (KeyError, ValueError, TypeError, AttributeError): pass - return ([], [], []) + return ([]) def translate_arch(self, source_arch, source_type, target_type): """ diff --git a/udocker/helper/hostinfo.py b/udocker/helper/hostinfo.py index 9352c881..e08de038 100644 --- a/udocker/helper/hostinfo.py +++ b/udocker/helper/hostinfo.py @@ -26,7 +26,7 @@ def username(self): def arch(self, target="UDOCKER"): """Get the host system architecture""" machine = platform.machine() - (arch, dummy, dummy) = self.get_arch("uname", machine, target) + arch = self.get_arch("uname", machine, target) return arch[0] if arch[0] else "" def osversion(self): diff --git a/udocker/helper/osinfo.py b/udocker/helper/osinfo.py index e4f869c3..1301df92 100644 --- a/udocker/helper/osinfo.py +++ b/udocker/helper/osinfo.py @@ -3,6 +3,7 @@ import os import re +import json from udocker.utils.uprocess import Uprocess from udocker.utils.fileutil import FileUtil @@ -24,30 +25,73 @@ def get_filetype(self, filename): f_path = os.path.dirname(filename) + '/' + f_path return self.get_filetype(f_path) if os.path.isfile(filename): - filetype = Uprocess().get_output(["file", filename]) - if filetype and ":" in filetype: - return ("file", filetype.split(":", 1)[1]) filetype = Uprocess().get_output(["readelf", "-h", filename]) if filetype: return ("readelf", filetype) + filetype = Uprocess().get_output(["file", filename]) + if filetype and ":" in filetype: + return ("file", filetype.split(":", 1)[1]) return ("", "") - def arch(self, target="UDOCKER"): - """Get OS architecture""" + def arch_from_binaries(self, target="UDOCKER"): + """Get OS architecture from binaries""" for filename in self.get_binaries_list(): f_path = self._root_dir + "/" + filename (sourcetype, fileinfo) = self.get_filetype(f_path) if not sourcetype: continue - (arch, dummy, dummy) = self.get_arch(sourcetype, fileinfo, target) + arch = self.get_arch(sourcetype, fileinfo, target) try: - if arch[0]: - return arch[0] + return arch[0] except IndexError: continue return "" + def _load_config_json(self): + """Load metadata form json config file""" + for filename in ("container.json", "config.json"): + f_path = self._root_dir + "/../" + filename + try: + with open(f_path, 'r') as infile: + json_obj = json.load(infile) + return json_obj + except (IOError, OSError, AttributeError, + ValueError, TypeError): + continue + return None + + def arch_from_metadata(self, target="UDOCKER"): + """Get OS architecture from container metadata""" + config_json = self._load_config_json() + if not config_json: + return "" + try: + architecture = config_json['architecture'] + if not architecture: + return "" + arch_var = architecture + except KeyError: + return "" + try: + variant = config_json['variant'] + if variant: + arch_var = architecture + "/" + variant + except KeyError: + pass + arch = self.get_arch("arch/var", arch_var, target) + try: + return arch[0] + except IndexError: + return "" + + def arch(self, target="UDOCKER"): + """Get container / directory tree arechitecture""" + architecture = self.arch_from_metadata(target) + if not architecture: + architecture = self.arch_from_binaries(target) + return architecture + def is_same_arch(self, other_root_dir="/" ,target="UDOCKER"): """Compare architectures for two system trees""" this_arch = self.arch(target) @@ -56,14 +100,15 @@ def is_same_arch(self, other_root_dir="/" ,target="UDOCKER"): return None return this_arch == other_arch - def osdistribution(self): + def _osdistribution(self): """Get guest operating system distribution""" for f_path in FileUtil(self._root_dir + "/etc/.+-release").match(): if os.path.exists(f_path): osinfo = FileUtil(f_path).getdata('r') match = re.match(r"([^=]+) release (\d+)", osinfo) if match and match.group(1): - return (match.group(1).split(' ')[0], match.group(2).split('.')[0]) + return (match.group(1).split(' ')[0], match.group(2)) + f_path = self._root_dir + "/etc/lsb-release" if os.path.exists(f_path): distribution = "" @@ -75,7 +120,7 @@ def osdistribution(self): match = re.search(r"DISTRIB_RELEASE=(.+)(\n|$)", osinfo, re.MULTILINE) if match: - version = match.group(1).split('.')[0] + version = match.group(1) if distribution and version: return (distribution, version) @@ -89,15 +134,24 @@ def osdistribution(self): if match: distribution = match.group(1).split(' ')[0] - match = re.search(r"VERSION_ID=\"?([^ \n\"\.]+).*\"?(\n|$)", osinfo, re.MULTILINE) + match = re.search(r"VERSION_ID=\"?([^ \n\"]+).*\"?(\n|$)", osinfo, re.MULTILINE) if match: - version = match.group(1).split('.')[0] + version = match.group(1) if distribution and version: return (distribution, version) return ("", "") + def osdistribution(self): + """Get guest operating system distribution""" + (distribution, version) = self._osdistribution() + if version.count(".") >= 2: + version = ".".join(version.split(".")[0:2]) + else: + version = version.split(".")[0] + return(distribution, version) + def osversion(self): """Get guest operating system""" if self.osdistribution()[0]: From 6d4bd11680a36c1f6798405087bd7cd93fff4ac6 Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Sun, 25 Jun 2023 19:21:32 +0100 Subject: [PATCH 77/99] hardening of cd_container --- udocker/container/localrepo.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/udocker/container/localrepo.py b/udocker/container/localrepo.py index e5426e28..bdb6bae0 100644 --- a/udocker/container/localrepo.py +++ b/udocker/container/localrepo.py @@ -147,9 +147,9 @@ def iswriteable_container(self, container_id): container_root = self.cd_container(container_id) + "/ROOT" if not os.path.exists(container_root): return 2 - if not os.path.isdir(container_root): + if not FileUtil(container_root).isdir(): return 3 - if os.access(container_root, os.W_OK): + if FileUtil(container_root).iswriteable(): return 1 return 0 From d2c8783caca6710652c5c66a8776490b9785b4b7 Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Sun, 25 Jun 2023 19:23:44 +0100 Subject: [PATCH 78/99] add iswriteable and isexecutable --- udocker/utils/fileutil.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/udocker/utils/fileutil.py b/udocker/utils/fileutil.py index 17c0d836..d9664c0b 100644 --- a/udocker/utils/fileutil.py +++ b/udocker/utils/fileutil.py @@ -317,6 +317,20 @@ def cleanup(self): for filename in tmptrash_copy: FileUtil(filename).remove(recursive=True) + def isexecutable(self): + """Check if execute bit is set""" + try: + return os.access(self.filename, os.X_OK) + except (IOError, OSError, TypeError): + return False + + def iswriteable(self): + """Check if execute bit is set""" + try: + return os.access(self.filename, os.W_OK) + except (IOError, OSError, TypeError): + return False + def isdir(self): """Is filename a directory""" try: From 921d93ec9f6e0d1b7a63d1cc8363cdad42801ebe Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Sun, 25 Jun 2023 19:24:39 +0100 Subject: [PATCH 79/99] add is_binary_executable() to osinfo --- udocker/engine/fakechroot.py | 7 ++++--- udocker/helper/osinfo.py | 15 +++++++++++++++ 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/udocker/engine/fakechroot.py b/udocker/engine/fakechroot.py index 0ae2ef97..6c6d9da3 100644 --- a/udocker/engine/fakechroot.py +++ b/udocker/engine/fakechroot.py @@ -228,15 +228,16 @@ def _run_invalid_options(self): def _run_add_script_support(self, exec_path): """Add an interpreter for non binary executables (scripts)""" - (dummy, filetype) = OSInfo(self.container_root).get_filetype(exec_path) - if "ELF" in filetype and "rror" not in filetype: + relc_path = exec_path.split(self.container_root, 1)[-1] + if OSInfo(self.container_root).is_binary_executable(relc_path): self.opt["cmd"][0] = exec_path return [] + #env_exec = FileUtil("env").find_exec("/bin:/usr/bin", self.container_root) #if env_exec: # return [self.container_root + '/' + env_exec, ] - relc_path = exec_path.split(self.container_root, 1)[-1] + real_path = FileUtil(self.container_root).cont2host(relc_path, self.opt["vol"]) hashbang = FileUtil(real_path).get1stline() match = re.search("#! *([^ ]+)(.*)", hashbang.decode()) diff --git a/udocker/helper/osinfo.py b/udocker/helper/osinfo.py index 1301df92..2d4d6381 100644 --- a/udocker/helper/osinfo.py +++ b/udocker/helper/osinfo.py @@ -33,6 +33,21 @@ def get_filetype(self, filename): return ("file", filetype.split(":", 1)[1]) return ("", "") + def is_binary_executable(self, filename): + """Check if file is a binary executable""" + filename = self._root_dir + '/' + filename + (sourcetype, filetype) = self.get_filetype(filename) + if sourcetype: + if ("ELF" in filetype and "rror" not in filetype): + return True + else: + elf_pattern = "\x7fELF".encode() + bin_head = FileUtil(filename).get1stline('rb') + if (elf_pattern == bin_head[0:4] and + FileUtil(filename).isexecutable()): + return True + return False + def arch_from_binaries(self, target="UDOCKER"): """Get OS architecture from binaries""" for filename in self.get_binaries_list(): From e04f7cc38b84e6254023dc21ff156f7d3226cbd4 Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Sun, 25 Jun 2023 19:31:59 +0100 Subject: [PATCH 80/99] improve _check_arch() --- udocker/engine/base.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/udocker/engine/base.py b/udocker/engine/base.py index f9a3ac55..180f0ff0 100644 --- a/udocker/engine/base.py +++ b/udocker/engine/base.py @@ -666,7 +666,10 @@ def _save_osenv(self, filename, save=None): def _check_arch(self, fail=False): """Check if architecture is the same""" - if not OSInfo(self.container_root).is_same_arch(): + same_arch = OSInfo(self.container_root).is_same_arch(): + if same_arch is None: + return True + if not same_arch: if fail: Msg().err("Error: host and container architectures mismatch") return False From db0868f2b16b1ab77b8800a010079240d86824f3 Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Sun, 25 Jun 2023 19:34:39 +0100 Subject: [PATCH 81/99] improve _check_arch() --- udocker/engine/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/udocker/engine/base.py b/udocker/engine/base.py index 180f0ff0..4c52573b 100644 --- a/udocker/engine/base.py +++ b/udocker/engine/base.py @@ -666,7 +666,7 @@ def _save_osenv(self, filename, save=None): def _check_arch(self, fail=False): """Check if architecture is the same""" - same_arch = OSInfo(self.container_root).is_same_arch(): + same_arch = OSInfo(self.container_root).is_same_arch() if same_arch is None: return True if not same_arch: From c8d82288c55ee565811744d6073c880fca1c8437 Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Sun, 25 Jun 2023 20:01:30 +0100 Subject: [PATCH 82/99] CHANGELOG for udocker 1.3.10[D --- CHANGELOG.md | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3de39531..b897f8bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,24 +2,30 @@ ## udocker (1.3.10) -* improved handling of container platform information +* improved handling of container platform minformation * added support for QEMU on Pn modes enabling execution of containers with architectures different than the host -* added support for QEMU on Fn modes enabling execution of containers - with architectures different than the host * selection of executable for Sn mode now defaults to apptainer and in second place to singularity -* the new command "manifest inspect" allows display of image manifests +* the new command `manifest inspect` allows display of image manifests therefore enabling access to the catalogue of platforms supported by a given image -* the new command "tag" enables changing the name of an existing image +* the new command `tag` enables changing the name of an existing image +* new option `pull --platform=os/architecture` enables pulling of images + of a given architecture possibly different from the host +* new option run `--platform=os/architecture` enables pull and run of + images of a given architecture possibly different from the host +* new option `ps -p` enables list of the architectures of containers +* new option `images -p` enables list of the architectures of containers * the udocker tools support for Fn now includes Ubuntu 23:04, Fedora 38, Alpine 3.17 and 3.18. -* limited Support for native Fn execution on arm64 for Fedora 36, - Fedora 37, Fedora 38, CentOS 7, AlmaLinux 8, AlmaLinux 9 and similar. -* limited Support for native Fn execution on ppc64le for CentOS 7, - AlmaLinux 8, AlmaLinux 9 and similar. -* updated version of Pn engine for x86, x86_64 and arm64. +* experimental support for native Fn execution on arm64 for Fedora 36, + Fedora 37, Fedora 38, CentOS 7, AlmaLinux 8, AlmaLinux 9 and Ubuntu 22, + Ubuntu 20, Ubuntu 18 and similar. +* experimental support for native Fn execution on ppc64le for CentOS 7, + AlmaLinux 8, AlmaLinux 9, Ubuntu 22, Ubuntu 20, Ubuntu 18 and similar. +* experimental support for runc in arm64 and ppc64le +* updated version of Pn engines for x86, x86_64, arm64. ## udocker (1.3.9) From e67bc199525e352d93a1d3686cb2653b3fc7731f Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Sun, 25 Jun 2023 20:25:02 +0100 Subject: [PATCH 83/99] documentation --- AUTHORS.md | 2 ++ CHANGELOG.md | 6 ++++-- README.md | 9 ++++++--- docs/udocker.1 | 6 +++--- docs/user_manual.md | 3 +++ 5 files changed, 18 insertions(+), 8 deletions(-) diff --git a/AUTHORS.md b/AUTHORS.md index 19673c65..5932b170 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -3,6 +3,7 @@ * Docker * PRoot * Fakechroot +* Patchelf * runC * crun * Singularity @@ -12,6 +13,7 @@ * EOSC-hub * EGI-ACE * EOSC-Synergy +* DT-Geo * LIP [https://www.lip.pt](https://www.lip.pt/?section=home&page=homepage&lang=en) * INCD [https://www.incd.pt](https://www.incd.pt/?lang=en) diff --git a/CHANGELOG.md b/CHANGELOG.md index b897f8bb..7bbaf611 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## udocker (1.3.10) -* improved handling of container platform minformation +* improved handling of container platform information * added support for QEMU on Pn modes enabling execution of containers with architectures different than the host * selection of executable for Sn mode now defaults to apptainer and @@ -13,8 +13,10 @@ * the new command `tag` enables changing the name of an existing image * new option `pull --platform=os/architecture` enables pulling of images of a given architecture possibly different from the host -* new option run `--platform=os/architecture` enables pull and run of +* new option `run --platform=os/architecture` enables pull and run of images of a given architecture possibly different from the host +* new option `import --platform=os/architecture` enables to specify + an architecture for the image * new option `ps -p` enables list of the architectures of containers * new option `images -p` enables list of the architectures of containers * the udocker tools support for Fn now includes Ubuntu 23:04, Fedora 38, diff --git a/README.md b/README.md index 8ef986b9..fa97e8e1 100644 --- a/README.md +++ b/README.md @@ -430,6 +430,7 @@ of the installation manual. * Docker * PRoot * Fakechroot +* Patchelf * runC * crun * Singularity @@ -439,14 +440,16 @@ of the installation manual. * EOSC-hub * EGI-ACE * EOSC-Synergy +* DT-Geo * LIP [https://www.lip.pt](https://www.lip.pt/?section=home&page=homepage&lang=en) * INCD [https://www.incd.pt](https://www.incd.pt/?lang=en) This work was performed in the framework of the H2020 project INDIGO-Datacloud (RIA 653549) and further developed with co-funding by the projects EOSC-hub -(Horizon 2020) under Grant number 777536 and DEEP-Hybrid-DataCloud -(Horizon 2020) under Grant number 777435. Software Quality Assurance is -performed with the support of by the project EOSC-Synergy (Horizon 2020). +(Horizon 2020) under Grant number 777536, DEEP-Hybrid-DataCloud +(Horizon 2020) under Grant number 777435, DT-Geo (Horizon Europe) under Grant +number 101058129. Software Quality Assurance is performed with the support of +by the project EOSC-Synergy (Horizon 2020). The authors wish to acknowleadge the support of INCD-Infraestrutura Nacional de Computação Distribuída (funded by FCT, P2020, Lisboa2020, COMPETE and FEDER under the project number 22153-01/SAICT/2016). diff --git a/docs/udocker.1 b/docs/udocker.1 index 0c1a09eb..1645ee89 100644 --- a/docs/udocker.1 +++ b/docs/udocker.1 @@ -1,7 +1,7 @@ .\" Manpage for udocker .\" Contact udocker@lip.pt to correct errors or typos. .\" To read this man page use: man -l udocker.1 -.TH udocker 1 "9 Jun 2023" "version 1.3.10" "udocker man page" +.TH udocker 1 "25 Jun 2023" "version 1.3.10" "udocker man page" .SH NAME udocker \- execute Docker containers in user space without privileges .SH SYNOPSIS @@ -50,13 +50,13 @@ Search for IMAGES in a Docker registry. Not all registries support searching. Th .BR pull " " [ " " \--httpproxy=PROXY " " | " " \--index=INDEX " " | " " \--registry=REGISTRY " " | " " \--platform=OS/ARCH " " ] " " IMAGE Pull an IMAGE from Docker Hub or from a private repository. A socks4 or socks5 proxy can be specified with \--httpproxy the syntax of PROXY is socks[4|5|4a|5h]://user:pass@host:port. The --registry and --index options enable other repositories (beyond dockerhub) to be selected, it is an URL prefix (ex. https://myrepository.mydomain). If the image is multi-platform the operating system and architecture of the image to be pulled can be specified using \--platform. .TP -.BR images " " [ " " \-l " " ] +.BR images " " [ " " \-l " " ] " " | " " [ " " \-p " " ] Lists IMAGES available in the local udocker repository. The \-l option provides additional image details. .TP .BR create " " [ " " \--name=ALIAS " " | " " \--force " " ] " " IMAGE Creates a container for execution from an IMAGE stored in the local repository. Multiple containers can be extracted from a single image. Each created container is identified by a CONTAINER-ID which is printed upon successful extraction. The option --name allows an ALIAS name to be assigned to the newly created container to facilitate identification. The ALIAS can later be used instead of the CONTAINER-ID. The option --force enables the container creation even if the name already exists. .TP -.BR ps " " [ " " \-m " " ] " " | " " [ " " \-s " " ] +.BR ps " " [ " " \-m " " ] " " | " " [ " " \-s " " ] " " | " " [ " " \-p " " ] List containers in the local repository. These are containers produced with the command "create" and that can be executed with the command "run". The list contains the CONTAINER-ID, the protection flag against deletion, write status, ALIASEs, and the corresponding IMAGE. The command name "ps" has been kept for compatibility with the Docker command line, in udocker the command ps does not show running containers instead shows the created containers extracted to the filesystem that are ready to be executed. The option \-m adds the execution mode. The option \-s adds the size in MB. .TP .BR rm " " [ " " -f " " ] " " CONTAINER\-ID " " | " " ALIAS " " ... diff --git a/docs/user_manual.md b/docs/user_manual.md index 2676b35f..79ea0a45 100644 --- a/docs/user_manual.md +++ b/docs/user_manual.md @@ -289,6 +289,7 @@ form Docker Hub, and/or load or imported from files. Options: * `-l` long format, display more information about the images and related layers +* `-p` display the image platform including os, architecture and variant Examples: @@ -343,6 +344,7 @@ Options: * `-m` show the current execution mode of each container * `-s` show current disk usage (container size in MB), can be very slow +* `-p` display the image platform including os, architecture and variant Examples: @@ -1455,6 +1457,7 @@ container is not being executed. * Docker * PRoot * Fakechroot +* Patchelf * runC * crun * Singularity From 7e16c02e167fe20865c58f6d60498bf57d157161 Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Sun, 25 Jun 2023 20:26:30 +0100 Subject: [PATCH 84/99] change the search message --- udocker/tools.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/udocker/tools.py b/udocker/tools.py index 5440b77d..656598d3 100644 --- a/udocker/tools.py +++ b/udocker/tools.py @@ -290,7 +290,7 @@ def install(self, force=False): return True Msg().out("Info: udocker command line interface", __version__) - Msg().out("Info: searching for udockertools", self._tarball_release, l=Msg.INF) + Msg().out("Info: searching for udockertools >=", self._tarball_release, l=Msg.INF) retry = self._installretry while retry: if self._install_logic(force): From 9733ad9d8aa7c9d9d8313af0f9c1f6dea681412d Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Sun, 25 Jun 2023 20:45:51 +0100 Subject: [PATCH 85/99] udocker tools set to version 1.2.10 --- udocker/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/udocker/config.py b/udocker/config.py index 2c31061e..2d78d578 100644 --- a/udocker/config.py +++ b/udocker/config.py @@ -29,7 +29,7 @@ class Config(object): # udocker installation tarball the release is the minimum requirement # the actual tarball used in the installation can have a higher version - conf['tarball_release'] = "1.2.9" + conf['tarball_release'] = "1.2.10" conf['tarball'] = ( "https://download.ncg.ingrid.pt/" "webdav/udocker/udocker-englib-1.2.10.tar.gz" From 5e350879b02be4688804358fbee7cc2aa1b4ed73 Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Sun, 25 Jun 2023 22:40:12 +0100 Subject: [PATCH 86/99] handling of application/json --- udocker/docker.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/udocker/docker.py b/udocker/docker.py index 6b707a6a..5cde47c4 100644 --- a/udocker/docker.py +++ b/udocker/docker.py @@ -414,6 +414,8 @@ def get_v2_image_manifest(self, imagerepo, tag, platform=""): try: content_type = hdr.data['content-type'] + if "application/json" in content_type: + return (hdr.data, json.loads(buf.getvalue().decode())) if "docker.distribution.manifest.v1" in content_type: return (hdr.data, json.loads(buf.getvalue().decode())) if "docker.distribution.manifest.v2" in content_type: From a17a6c96f5e8a734c6917b9f988cbd1df3450551 Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Mon, 26 Jun 2023 12:15:32 +0100 Subject: [PATCH 87/99] improve checking for binary executable --- udocker/helper/osinfo.py | 2 +- udocker/utils/fileutil.py | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/udocker/helper/osinfo.py b/udocker/helper/osinfo.py index 2d4d6381..704d5653 100644 --- a/udocker/helper/osinfo.py +++ b/udocker/helper/osinfo.py @@ -42,7 +42,7 @@ def is_binary_executable(self, filename): return True else: elf_pattern = "\x7fELF".encode() - bin_head = FileUtil(filename).get1stline('rb') + bin_head = FileUtil(filename).getdata('rb', 4) if (elf_pattern == bin_head[0:4] and FileUtil(filename).isexecutable()): return True diff --git a/udocker/utils/fileutil.py b/udocker/utils/fileutil.py index d9664c0b..a97cb6b6 100644 --- a/udocker/utils/fileutil.py +++ b/udocker/utils/fileutil.py @@ -359,11 +359,14 @@ def size(self): except (IOError, OSError, TypeError): return -1 - def getdata(self, mode="rb"): + def getdata(self, mode="rb", size=-1): """Read file content to a buffer""" try: with open(self.filename, mode) as filep: - buf = filep.read() + if size == -1: + buf = filep.read() + else: + buf = filep.read(size) #Msg().out("Debug: read buf", buf, l=Msg.DBG) return buf except (IOError, OSError, TypeError): From 60f2b3b4f081383104f31dc1df5d228b1e414576 Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Thu, 29 Jun 2023 18:52:47 +0100 Subject: [PATCH 88/99] fix unit tests --- tests/unit/test_commonlocalfile.py | 6 +++-- tests/unit/test_dockerlocalfileapi.py | 9 +++++-- tests/unit/test_fakechroot.py | 39 +++++++++++++++++---------- tests/unit/test_osinfo.py | 37 ++++++++----------------- tests/unit/test_proot.py | 4 ++- 5 files changed, 50 insertions(+), 45 deletions(-) diff --git a/tests/unit/test_commonlocalfile.py b/tests/unit/test_commonlocalfile.py index b4404dc8..6e1a8070 100755 --- a/tests/unit/test_commonlocalfile.py +++ b/tests/unit/test_commonlocalfile.py @@ -117,14 +117,16 @@ def test_05__untar_saved_container(self, mock_ucall): status = clfapi._untar_saved_container(tarfile, destdir) self.assertTrue(status) + @patch('udocker.commonlocalfile.HostInfo.parse_platform') @patch('udocker.commonlocalfile.FileUtil.size') @patch('udocker.commonlocalfile.HostInfo.osversion') @patch('udocker.commonlocalfile.HostInfo.arch') def test_06_create_container_meta(self, mock_arch, mock_version, - mock_size): + mock_size, mock_parseplatform): """Test06 CommonLocalFileApi().create_container_meta().""" layer_id = "12345" - comment = "created by my udocker" + comment = "created by udocker" + mock_parseplatform.return_value = ("", "", "") mock_arch.return_value = "x86_64" mock_version.return_value = "8" mock_size.return_value = 125 diff --git a/tests/unit/test_dockerlocalfileapi.py b/tests/unit/test_dockerlocalfileapi.py index 4d94c29e..6d2a4ad1 100755 --- a/tests/unit/test_dockerlocalfileapi.py +++ b/tests/unit/test_dockerlocalfileapi.py @@ -31,12 +31,13 @@ def test_01_init(self): dlocapi = DockerLocalFileAPI(self.local) self.assertEqual(dlocapi.localrepo, self.local) + @patch('udocker.docker.FileUtil.isfile') @patch('udocker.docker.os.listdir') @patch('udocker.docker.FileUtil.isdir') - def test_02__load_structure(self, mock_isdir, mock_ldir): + def test_02__load_structure(self, mock_isdir, mock_ldir, mock_isfile): """Test02 DockerLocalFileAPI()._load_structure().""" res = {'repoconfigs': {}, 'repolayers': {}} - mock_ldir.return_value = ["xx"] + mock_ldir.return_value = [] dlocapi = DockerLocalFileAPI(self.local) structure = dlocapi._load_structure("/tmp") self.assertEqual(structure, res) @@ -64,6 +65,7 @@ def test_02__load_structure(self, mock_isdir, mock_ldir): "json_f": "/tmp/"+jfname}}} mock_isdir.return_value = False mock_ldir.return_value = [jfname, ] + mock_isfile.return_value = True self.local.load_json.return_value = {"k": "v"} dlocapi = DockerLocalFileAPI(self.local) structure = dlocapi._load_structure("/tmp") @@ -73,6 +75,7 @@ def test_02__load_structure(self, mock_isdir, mock_ldir): res = {"repolayers": {fname: {"VERSION": {"k": "v"}}}, "repoconfigs": dict()} mock_isdir.return_value = True + mock_isfile.return_value = False mock_ldir.side_effect = [[fname, ], ["VERSION", ], ] self.local.load_json.return_value = {"k": "v"} dlocapi = DockerLocalFileAPI(self.local) @@ -85,6 +88,7 @@ def test_02__load_structure(self, mock_isdir, mock_ldir): "json_f": fulllayer}}, "repoconfigs": dict()} mock_isdir.return_value = True + mock_isfile.return_value = False mock_ldir.side_effect = [[fname, ], ["json", ], ] self.local.load_json.return_value = {"k": "v"} dlocapi = DockerLocalFileAPI(self.local) @@ -96,6 +100,7 @@ def test_02__load_structure(self, mock_isdir, mock_ldir): res = {"repolayers": {fname: {"layer_f": fulllayer}}, "repoconfigs": dict()} mock_isdir.return_value = True + mock_isfile.return_value = False mock_ldir.side_effect = [[fname, ], ["layer1", ], ] self.local.load_json.return_value = {"k": "v"} dlocapi = DockerLocalFileAPI(self.local) diff --git a/tests/unit/test_fakechroot.py b/tests/unit/test_fakechroot.py index 1f0c7b82..edcf8e04 100755 --- a/tests/unit/test_fakechroot.py +++ b/tests/unit/test_fakechroot.py @@ -246,35 +246,46 @@ def test_08__run_invalid_options(self, mock_msg): @patch('udocker.engine.fakechroot.FileUtil.get1stline') @patch('udocker.engine.fakechroot.FileUtil.cont2host') @patch('udocker.engine.fakechroot.FileUtil.find_exec') - @patch('udocker.engine.fakechroot.OSInfo.get_filetype') + @patch('udocker.engine.fakechroot.OSInfo.is_binary_executable') @patch('udocker.engine.fakechroot.Msg') - def test_09__run_add_script_support(self, mock_msg, mock_ftype, + def test_09__run_add_script_support(self, mock_msg, mock_isbinary, mock_findexe, mock_cont2host, mock_1stline): """Test09 FakechrootEngine._run_add_script_support()""" mock_msg.level = 3 - mock_ftype.return_value = "/bin/ls: ELF, x86-64, static" + mock_isbinary.return_value = True ufake = FakechrootEngine(self.local, self.xmode) + ufake.container_root = "/ROOT" ufake.opt["cmd"] = [""] - status = ufake._run_add_script_support("/bin/ls") + status = ufake._run_add_script_support("/ROOT/bin/ls") self.assertEqual(status, []) + #mock_msg.level = 3 + #mock_isbinary.return_value = False + #mock_findexe.side_effect = ["ls", ""] + #ufake = FakechrootEngine(self.local, self.xmode) + #status = ufake._run_add_script_support("/bin/ls") + #self.assertEqual(status, ["/ls"]) + mock_msg.level = 3 - mock_ftype.return_value = "/bin/ls: xxx, x86-64, yyy" - mock_findexe.side_effect = ["ls", ""] + mock_isbinary.return_value = False + mock_cont2host.return_value = "/ROOT/bin/ls" + mock_1stline.return_value = b"#!/bin/python" + mock_findexe.side_effect = ["/bin/ls", ""] ufake = FakechrootEngine(self.local, self.xmode) - status = ufake._run_add_script_support("/bin/ls") - self.assertEqual(status, ["/ls"]) + ufake.container_root = "/ROOT" + status = ufake._run_add_script_support("/ROOT/bin/ls") + self.assertEqual(status, ["/ROOT/bin/python"]) mock_msg.level = 3 - mock_ftype.return_value = "/bin/ls: xxx, x86-64, yyy" - mock_findexe.side_effect = ["", "ls"] - mock_cont2host.return_value = "/bin/ls" - mock_1stline.return_value = "" + mock_isbinary.return_value = False + mock_cont2host.return_value = "/ROOT/bin/ls" + mock_1stline.return_value = b"" + mock_findexe.side_effect = ["/bin/ls", ""] ufake = FakechrootEngine(self.local, self.xmode) ufake.container_root = "/ROOT" - status = ufake._run_add_script_support("/bin/ls") - self.assertEqual(status, ["/ROOT/ls"]) + status = ufake._run_add_script_support("/ROOT/bin/ls") + self.assertEqual(status, ["/ROOT/bin/ls"]) @patch('udocker.engine.fakechroot.FileUtil.cont2host') @patch.object(FakechrootEngine, '_run_banner') diff --git a/tests/unit/test_osinfo.py b/tests/unit/test_osinfo.py index 523b53e9..5882f3ab 100755 --- a/tests/unit/test_osinfo.py +++ b/tests/unit/test_osinfo.py @@ -27,7 +27,7 @@ def tearDown(self): def test_01_init(self): """Test01 OSInfo() constructor.""" ginfo = OSInfo(self.rootdir) - self.assertIsInstance(ginfo._binarylist, list) + self.assertEqual(ginfo._root_dir, self.rootdir) @patch('udocker.helper.osinfo.Uprocess.get_output') @patch('udocker.helper.osinfo.os.path.isfile') @@ -49,36 +49,21 @@ def test_02_get_filetype(self, mock_isfile, mock_getout): status = ginfo.get_filetype(nofile) self.assertEqual(status, "") - @patch.object(OSInfo, 'get_filetype') - def test_03_arch(self, mock_getftype): + @patch.object(OSInfo, 'arch_from_binaries') + @patch.object(OSInfo, 'arch_from_metadata') + def test_03_arch(self, mock_frommeta, mock_frombin): """Test03 OSInfo.arch()""" - # arch is x86_64 - ftype = "/bin/ls: yyy, x86-64, xxx" - mock_getftype.return_value = ftype - ginfo = OSInfo(self.rootdir) - status = ginfo.arch() - self.assertEqual(status, "amd64") - - # arch is i386 - ftype = "/bin/ls: yyy, Intel 80386, xxx" - mock_getftype.return_value = ftype + # arch from metadata is amd64 + mock_frommeta.return_value = "amd64" ginfo = OSInfo(self.rootdir) status = ginfo.arch() - self.assertEqual(status, "i386") - # arch is arm 64 - ftype = "/bin/ls: yyy, aarch64" - mock_getftype.return_value = ftype + # arch from metadata is empty from bin is amd64 + mock_frommeta.return_value = "" + mock_frombin.return_value = "amd64" ginfo = OSInfo(self.rootdir) status = ginfo.arch() - self.assertEqual(status, "arm64") - - # arch is arm - ftype = "/bin/ls: yyy, ARM, xxx" - mock_getftype.return_value = ftype - ginfo = OSInfo(self.rootdir) - status = ginfo.arch() - self.assertEqual(status, "arm") + self.assertEqual(status, "amd64") @patch('udocker.helper.osinfo.os.path.exists') @patch('udocker.helper.osinfo.FileUtil.match') @@ -121,7 +106,7 @@ def test_05_osversion(self, mock_osdist): ginfo = OSInfo(self.rootdir) status = ginfo.osversion() self.assertEqual(status, "") - + if __name__ == '__main__': main() diff --git a/tests/unit/test_proot.py b/tests/unit/test_proot.py index c3f0800f..923eddbc 100755 --- a/tests/unit/test_proot.py +++ b/tests/unit/test_proot.py @@ -165,6 +165,7 @@ def test_06__get_network_map(self, mock_pmap): status = prex._get_network_map() self.assertEqual(status, ['-p', '80:8080', '-p', '443:8443', '-n']) + @patch.object(PRootEngine, '_get_qemu_string') @patch('udocker.engine.proot.os.environ.update') @patch.object(PRootEngine, '_get_network_map') @patch('udocker.engine.nvidia.Msg') @@ -183,7 +184,7 @@ def test_07_run(self, mock_run_init, mock_call, mock_getenv, mock_sel_proot, mock_run_env_set, mock_set_cpu_aff, mock_get_vol_bind, mock_set_uid_map, mock_env_cleanup_dict, mock_run_banner, mock_isgreater, - mock_msg, mock_netmap, mock_envupd): + mock_msg, mock_netmap, mock_envupd, mock_getqemu): """Test07 PRootEngine().run().""" mock_run_init.return_value = False prex = PRootEngine(self.local, self.xmode) @@ -205,6 +206,7 @@ def test_07_run(self, mock_run_init, mock_call, mock_getenv, mock_sel_proot, mock_call.return_value = 5 mock_getenv.return_value = False mock_envupd.return_value = None + mock_getqemu.return_value = [] prex = PRootEngine(self.local, self.xmode) prex.opt["kernel"] = "5.4.0" prex.opt["cmd"] = [""] From 66086d4b17001247af656e8e5c4727aed702517a Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Thu, 29 Jun 2023 18:53:04 +0100 Subject: [PATCH 89/99] remove comment --- udocker/commonlocalfile.py | 1 - 1 file changed, 1 deletion(-) diff --git a/udocker/commonlocalfile.py b/udocker/commonlocalfile.py index 356ab809..a0a2f7b4 100644 --- a/udocker/commonlocalfile.py +++ b/udocker/commonlocalfile.py @@ -80,7 +80,6 @@ def _untar_saved_container(self, tarfile, destdir): status = Uprocess().call(cmd, stderr=Msg.chlderr, close_fds=True) return not status - # ARCHNEW def create_container_meta(self, layer_id, platform=""): """Create metadata for a given container layer, used in import. A file for import is a tarball of a directory tree, does not contain From 6d0c90dea14499d93c2508e33f58ddf2c4239c35 Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Fri, 30 Jun 2023 11:17:53 +0100 Subject: [PATCH 90/99] fix unit tests --- tests/unit/test_elfpatcher.py | 43 +++++++++++++++++++++++++----- tests/unit/test_executionmode.py | 14 ++++++++-- tests/unit/test_fakechroot.py | 4 +-- tests/unit/test_hostinfo.py | 24 ++++++++--------- tests/unit/test_localrepository.py | 36 ++++++++++++------------- tests/unit/test_osinfo.py | 25 ++++++++++++----- 6 files changed, 99 insertions(+), 47 deletions(-) diff --git a/tests/unit/test_elfpatcher.py b/tests/unit/test_elfpatcher.py index 9d0e3370..38de7541 100755 --- a/tests/unit/test_elfpatcher.py +++ b/tests/unit/test_elfpatcher.py @@ -37,32 +37,63 @@ def test_01__init(self, mock_path, mock_hinfo): self.assertTrue(mock_path.callled) self.assertEqual(elfp._uid, "1000") + @patch('udocker.helper.elfpatcher.FileUtil.find_exec') @patch('udocker.helper.elfpatcher.Msg') @patch('udocker.helper.elfpatcher.os.path.exists') @patch('udocker.helper.elfpatcher.HostInfo.arch') @patch('udocker.helper.elfpatcher.FileUtil.find_file_in_dir') @patch('udocker.helper.elfpatcher.os.path.realpath') def test_02_select_patchelf(self, mock_path, mock_find, - mock_arch, mock_exists, mock_msg): + mock_arch, mock_exists, mock_msg, + mock_findexec): """Test02 ElfPatcher().select_patchelf().""" mock_msg.level = 0 - mock_path.return_value = "/some_contdir" + Config.conf['use_patchelf_executable'] = "" + mock_findexec.return_value = "/home/user/.udocker/bin/patchelf" + mock_arch.return_value = "arm" + elfp = ElfPatcher(self.local, self.contid) + output = elfp.select_patchelf() + self.assertEqual(output, "/home/user/.udocker/bin/patchelf") + + mock_msg.level = 0 + Config.conf['use_patchelf_executable'] = \ + "/home/user/.udocker/bin/patchelf" mock_arch.return_value = "arm" - mock_find.return_value = "runc-arm" mock_exists.return_value = True elfp = ElfPatcher(self.local, self.contid) output = elfp.select_patchelf() - self.assertEqual(output, "runc-arm") + self.assertEqual(output, "/home/user/.udocker/bin/patchelf") - mock_path.return_value = "/some_contdir" + mock_msg.level = 0 + Config.conf['use_patchelf_executable'] = \ + "/home/user/.udocker/bin/patchelf" mock_arch.return_value = "arm" - mock_find.return_value = "" mock_exists.return_value = False with self.assertRaises(SystemExit) as epexpt: elfp = ElfPatcher(self.local, self.contid) elfp.select_patchelf() + print(epexpt.exception.code) self.assertEqual(epexpt.exception.code, 1) + mock_msg.level = 0 + Config.conf['use_patchelf_executable'] = "UDOCKER" + mock_arch.return_value = "arm" + mock_exists.return_value = True + mock_find.return_value = "/home/user/.udocker/bin/patchelf-arm" + elfp = ElfPatcher(self.local, self.contid) + output = elfp.select_patchelf() + self.assertEqual(output, "/home/user/.udocker/bin/patchelf-arm") + + mock_msg.level = 0 + Config.conf['use_patchelf_executable'] = "" + mock_findexec.return_value = "" + mock_arch.return_value = "arm" + mock_exists.return_value = True + mock_find.return_value = "/home/user/.udocker/bin/patchelf-arm" + elfp = ElfPatcher(self.local, self.contid) + output = elfp.select_patchelf() + self.assertEqual(output, "/home/user/.udocker/bin/patchelf-arm") + @patch('udocker.helper.elfpatcher.os.path.realpath') def test_03__replace(self, mock_path): """Test03 ElfPatcher()._replace.""" diff --git a/tests/unit/test_executionmode.py b/tests/unit/test_executionmode.py index 0c5386f8..0c03edac 100755 --- a/tests/unit/test_executionmode.py +++ b/tests/unit/test_executionmode.py @@ -34,6 +34,7 @@ def setUp(self): Config().conf['osversion'] = "OSVERSION" Config().conf['arch'] = "ARCH" Config().conf['default_execution_mode'] = "P1" + Config().conf['override_default_execution_modes'] = {"arm":"P2", } self.container_id = "CONTAINER_ID" str_local = 'udocker.container.localrepo.LocalRepository' @@ -63,13 +64,22 @@ def test_01_init(self): ("P1", "P2", "F1", "F2", "F3", "F4", "R1", "R2", "R3", "S1")) + @patch('udocker.engine.execmode.HostInfo.arch') @patch('udocker.engine.execmode.FileUtil.getdata') - def test_02_get_mode(self, mock_getdata): + def test_02_get_mode(self, mock_getdata, mock_arch): """Test02 ExecutionMode().get_mode.""" + Config().conf['override_default_execution_mode'] = "P2" mock_getdata.return_value.strip.return_value = None uexm = ExecutionMode(self.local, self.container_id) status = uexm.get_mode() - self.assertEqual(status, "P1") + self.assertEqual(status, "P2") + + Config().conf['override_default_execution_mode'] = "" + mock_getdata.return_value.strip.return_value = None + mock_arch.return_value = "arm" + uexm = ExecutionMode(self.local, self.container_id) + status = uexm.get_mode() + self.assertEqual(status, "P2") mock_getdata.return_value = "F3" uexm = ExecutionMode(self.local, self.container_id) diff --git a/tests/unit/test_fakechroot.py b/tests/unit/test_fakechroot.py index edcf8e04..9cd28ec8 100755 --- a/tests/unit/test_fakechroot.py +++ b/tests/unit/test_fakechroot.py @@ -275,7 +275,7 @@ def test_09__run_add_script_support(self, mock_msg, mock_isbinary, ufake = FakechrootEngine(self.local, self.xmode) ufake.container_root = "/ROOT" status = ufake._run_add_script_support("/ROOT/bin/ls") - self.assertEqual(status, ["/ROOT/bin/python"]) + self.assertEqual(status, ["/ROOT//bin/python"]) mock_msg.level = 3 mock_isbinary.return_value = False @@ -285,7 +285,7 @@ def test_09__run_add_script_support(self, mock_msg, mock_isbinary, ufake = FakechrootEngine(self.local, self.xmode) ufake.container_root = "/ROOT" status = ufake._run_add_script_support("/ROOT/bin/ls") - self.assertEqual(status, ["/ROOT/bin/ls"]) + self.assertEqual(status, ["/ROOT//bin/ls"]) @patch('udocker.engine.fakechroot.FileUtil.cont2host') @patch.object(FakechrootEngine, '_run_banner') diff --git a/tests/unit/test_hostinfo.py b/tests/unit/test_hostinfo.py index d335efd5..5010125a 100755 --- a/tests/unit/test_hostinfo.py +++ b/tests/unit/test_hostinfo.py @@ -30,29 +30,29 @@ def test_01_username(self, mock_getpwuid, mock_uid, mock_gid): name = HostInfo().username() self.assertEqual(name, usr.pw_name) - @patch('udocker.helper.hostinfo.platform.architecture') + #@patch('udocker.helper.hostinfo.get_arch') @patch('udocker.helper.hostinfo.platform.machine') - def test_02_arch(self, mock_mach, mock_arch): + def test_02_arch(self, mock_mach): """Test02 HostInfo().arch.""" mock_mach.return_value = "x86_64" - mock_arch.return_value = ('64bit', '') result = HostInfo().arch() - self.assertEqual(result, "amd64") + self.assertEqual(result, "x86_64") mock_mach.return_value = "x86_64" - mock_arch.return_value = ('32bit', '') + result = HostInfo().arch("docker") + self.assertEqual(result, "amd64") + + mock_mach.return_value = "i386" result = HostInfo().arch() - self.assertEqual(result, "i386") + self.assertEqual(result, "x86") - mock_mach.return_value = "arm" - mock_arch.return_value = ('64bit', '') + mock_mach.return_value = "aarch64" result = HostInfo().arch() self.assertEqual(result, "arm64") - mock_mach.return_value = "arm" - mock_arch.return_value = ('32bit', '') - result = HostInfo().arch() - self.assertEqual(result, "arm") + mock_mach.return_value = "aarch64" + result = HostInfo().arch("docker") + self.assertEqual(result, "arm64") @patch('udocker.helper.hostinfo.platform.system') def test_03_osversion(self, mock_sys): diff --git a/tests/unit/test_localrepository.py b/tests/unit/test_localrepository.py index e7b24c36..5b041e28 100755 --- a/tests/unit/test_localrepository.py +++ b/tests/unit/test_localrepository.py @@ -209,17 +209,16 @@ def test_11__isprotected(self, mock_fu, mock_exists): self.assertTrue(status) self.assertTrue(mock_exists.called) + @patch('udocker.container.localrepo.FileUtil.iswriteable') @patch.object(LocalRepository, 'cd_container') - @patch('udocker.container.localrepo.os.access') - @patch('udocker.container.localrepo.os.path.isdir') + @patch('udocker.container.localrepo.FileUtil.isdir') @patch('udocker.container.localrepo.os.path.exists') - @patch('udocker.container.localrepo.FileUtil') - def test_12_iswriteable_container(self, mock_fu, mock_exists, - mock_isdir, mock_access, - mock_cdcont): + #@patch('udocker.container.localrepo.FileUtil') + def test_12_iswriteable_container(self, mock_exists, + mock_isdir, mock_cdcont, mock_iswrite): """Test12 LocalRepository().iswriteable_container().""" - mock_fu.return_value.register_prefix.side_effect = \ - [None, None, None] + #mock_fu.return_value.register_prefix.side_effect = \ + # [None, None, None] container_id = "d2578feb-acfc-37e0-8561-47335f85e46a" mock_exists.return_value = False mock_cdcont.return_value = "/home/u1/.udocker/containerid" @@ -228,32 +227,33 @@ def test_12_iswriteable_container(self, mock_fu, mock_exists, self.assertEqual(status, 2) self.assertTrue(mock_exists.called) - mock_fu.return_value.register_prefix.side_effect = \ - [None, None, None] + #mock_fu.return_value.register_prefix.side_effect = \ + # [None, None, None] mock_exists.return_value = True mock_isdir.return_value = False + mock_iswrite.return_value = True mock_cdcont.return_value = "/home/u1/.udocker/containerid" lrepo = LocalRepository(UDOCKER_TOPDIR) status = lrepo.iswriteable_container(container_id) - self.assertEqual(status, 3) self.assertTrue(mock_isdir.called) + self.assertEqual(status, 3) - mock_fu.return_value.register_prefix.side_effect = \ - [None, None, None] + #mock_fu.return_value.register_prefix.side_effect = \ + # [None, None, None] mock_exists.return_value = True mock_isdir.return_value = True - mock_access.return_value = True + mock_iswrite.return_value = True mock_cdcont.return_value = "/home/u1/.udocker/containerid" lrepo = LocalRepository(UDOCKER_TOPDIR) status = lrepo.iswriteable_container(container_id) self.assertEqual(status, 1) - self.assertTrue(mock_access.called) + self.assertTrue(mock_iswrite.called) - mock_fu.return_value.register_prefix.side_effect = \ - [None, None, None] + #mock_fu.return_value.register_prefix.side_effect = \ + # [None, None, None] mock_exists.return_value = True mock_isdir.return_value = True - mock_access.return_value = False + mock_iswrite.return_value = False mock_cdcont.return_value = "/home/u1/.udocker/containerid" lrepo = LocalRepository(UDOCKER_TOPDIR) status = lrepo.iswriteable_container(container_id) diff --git a/tests/unit/test_osinfo.py b/tests/unit/test_osinfo.py index 5882f3ab..ff810460 100755 --- a/tests/unit/test_osinfo.py +++ b/tests/unit/test_osinfo.py @@ -29,25 +29,36 @@ def test_01_init(self): ginfo = OSInfo(self.rootdir) self.assertEqual(ginfo._root_dir, self.rootdir) + @patch('udocker.helper.osinfo.os.path.islink') @patch('udocker.helper.osinfo.Uprocess.get_output') @patch('udocker.helper.osinfo.os.path.isfile') - def test_02_get_filetype(self, mock_isfile, mock_getout): + def test_02_get_filetype(self, mock_isfile, mock_getout, mock_islink): """Test02 OSInfo.get_filetype(filename)""" + # file does not exist + ftype = "/bin/ls: yyy, x86-64, xxx" + mock_islink.return_value = False + mock_isfile.return_value = False + mock_getout.return_value = ftype + ginfo = OSInfo(self.rootdir) + status = ginfo.get_filetype(self.file) + self.assertEqual(status, ("", "")) + # full filepath exists ftype = "/bin/ls: yyy, x86-64, xxx" + mock_islink.return_value = False mock_isfile.return_value = True mock_getout.return_value = ftype ginfo = OSInfo(self.rootdir) status = ginfo.get_filetype(self.file) - self.assertEqual(status, ftype) + self.assertEqual(status, ("readelf", ftype)) - # file does not exist - nofile = "ddd: cannot open" + # file type data not returned mock_isfile.return_value = False - mock_getout.return_value = nofile + mock_isfile.return_value = True + mock_getout.return_value = "" ginfo = OSInfo(self.rootdir) - status = ginfo.get_filetype(nofile) - self.assertEqual(status, "") + status = ginfo.get_filetype(self.file) + self.assertEqual(status, ("", "")) @patch.object(OSInfo, 'arch_from_binaries') @patch.object(OSInfo, 'arch_from_metadata') From 6416f510e1388811358a6f70a04ff17580c198a4 Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Fri, 30 Jun 2023 11:35:12 +0100 Subject: [PATCH 91/99] code style fixes --- CHANGELOG.md | 14 +++++++------- README.md | 4 ++-- docs/user_manual.md | 4 ++-- tests/unit/test_localrepository.py | 9 --------- 4 files changed, 11 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7bbaf611..112ce0d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,8 +4,8 @@ * improved handling of container platform information * added support for QEMU on Pn modes enabling execution of containers - with architectures different than the host -* selection of executable for Sn mode now defaults to apptainer and + with architectures different than the host +* selection of executable for Sn mode now defaults to apptainer and in second place to singularity * the new command `manifest inspect` allows display of image manifests therefore enabling access to the catalogue of platforms supported by @@ -13,20 +13,20 @@ * the new command `tag` enables changing the name of an existing image * new option `pull --platform=os/architecture` enables pulling of images of a given architecture possibly different from the host -* new option `run --platform=os/architecture` enables pull and run of +* new option `run --platform=os/architecture` enables pull and run of images of a given architecture possibly different from the host * new option `import --platform=os/architecture` enables to specify - an architecture for the image + an architecture for the image * new option `ps -p` enables list of the architectures of containers * new option `images -p` enables list of the architectures of containers * the udocker tools support for Fn now includes Ubuntu 23:04, Fedora 38, - Alpine 3.17 and 3.18. + Alpine 3.17 and 3.18. * experimental support for native Fn execution on arm64 for Fedora 36, Fedora 37, Fedora 38, CentOS 7, AlmaLinux 8, AlmaLinux 9 and Ubuntu 22, Ubuntu 20, Ubuntu 18 and similar. -* experimental support for native Fn execution on ppc64le for CentOS 7, +* experimental support for native Fn execution on ppc64le for CentOS 7, AlmaLinux 8, AlmaLinux 9, Ubuntu 22, Ubuntu 20, Ubuntu 18 and similar. -* experimental support for runc in arm64 and ppc64le +* experimental support for runc in arm64 and ppc64le * updated version of Pn engines for x86, x86_64, arm64. ## udocker (1.3.9) diff --git a/README.md b/README.md index fa97e8e1..4d36dd0d 100644 --- a/README.md +++ b/README.md @@ -447,8 +447,8 @@ of the installation manual. This work was performed in the framework of the H2020 project INDIGO-Datacloud (RIA 653549) and further developed with co-funding by the projects EOSC-hub (Horizon 2020) under Grant number 777536, DEEP-Hybrid-DataCloud -(Horizon 2020) under Grant number 777435, DT-Geo (Horizon Europe) under Grant -number 101058129. Software Quality Assurance is performed with the support of +(Horizon 2020) under Grant number 777435, DT-Geo (Horizon Europe) under Grant +number 101058129. Software Quality Assurance is performed with the support of by the project EOSC-Synergy (Horizon 2020). The authors wish to acknowleadge the support of INCD-Infraestrutura Nacional de Computação Distribuída (funded by FCT, P2020, Lisboa2020, COMPETE and FEDER diff --git a/docs/user_manual.md b/docs/user_manual.md index 79ea0a45..a895935e 100644 --- a/docs/user_manual.md +++ b/docs/user_manual.md @@ -982,10 +982,10 @@ udocker tag SOURCEREPO/IMAGE:TAG TARGETREPO/IMAGE:TAG Creates a new image tag from an existing source image. The newly created image tag is a replica of the source image. The source image can be removed -or further updated via pull without affecting the newly created tag. A +or further updated via pull without affecting the newly created tag. A new tag does not occupy additional space as the image layers are shared. The image layers are only removed from the local udocker repository when -no other image is referencing them. +no other image is referencing them. Example: diff --git a/tests/unit/test_localrepository.py b/tests/unit/test_localrepository.py index 5b041e28..5bb9e35a 100755 --- a/tests/unit/test_localrepository.py +++ b/tests/unit/test_localrepository.py @@ -213,12 +213,9 @@ def test_11__isprotected(self, mock_fu, mock_exists): @patch.object(LocalRepository, 'cd_container') @patch('udocker.container.localrepo.FileUtil.isdir') @patch('udocker.container.localrepo.os.path.exists') - #@patch('udocker.container.localrepo.FileUtil') def test_12_iswriteable_container(self, mock_exists, mock_isdir, mock_cdcont, mock_iswrite): """Test12 LocalRepository().iswriteable_container().""" - #mock_fu.return_value.register_prefix.side_effect = \ - # [None, None, None] container_id = "d2578feb-acfc-37e0-8561-47335f85e46a" mock_exists.return_value = False mock_cdcont.return_value = "/home/u1/.udocker/containerid" @@ -227,8 +224,6 @@ def test_12_iswriteable_container(self, mock_exists, self.assertEqual(status, 2) self.assertTrue(mock_exists.called) - #mock_fu.return_value.register_prefix.side_effect = \ - # [None, None, None] mock_exists.return_value = True mock_isdir.return_value = False mock_iswrite.return_value = True @@ -238,8 +233,6 @@ def test_12_iswriteable_container(self, mock_exists, self.assertTrue(mock_isdir.called) self.assertEqual(status, 3) - #mock_fu.return_value.register_prefix.side_effect = \ - # [None, None, None] mock_exists.return_value = True mock_isdir.return_value = True mock_iswrite.return_value = True @@ -249,8 +242,6 @@ def test_12_iswriteable_container(self, mock_exists, self.assertEqual(status, 1) self.assertTrue(mock_iswrite.called) - #mock_fu.return_value.register_prefix.side_effect = \ - # [None, None, None] mock_exists.return_value = True mock_isdir.return_value = True mock_iswrite.return_value = False From 3d4daa5b54b591558d93fbcb1333eb20aeb8c434 Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Fri, 30 Jun 2023 12:05:04 +0100 Subject: [PATCH 92/99] style improvements for SQA --- docs/user_manual.md | 2 - tests/unit/test_dockerlocalfileapi.py | 6 +- tests/unit/test_executionmode.py | 2 +- tests/unit/test_fakechroot.py | 7 -- tests/unit/test_hostinfo.py | 1 - tests/unit/test_osinfo.py | 2 +- udocker/cli.py | 1 - udocker/config.py | 6 +- udocker/container/localrepo.py | 2 +- udocker/docker.py | 10 +-- udocker/engine/base.py | 1 - udocker/engine/fakechroot.py | 15 ++-- udocker/engine/proot.py | 11 ++- udocker/engine/runc.py | 8 +- udocker/helper/archinfo.py | 112 +++++++++++++------------- udocker/helper/elfpatcher.py | 8 +- udocker/helper/osinfo.py | 5 +- 17 files changed, 92 insertions(+), 107 deletions(-) diff --git a/docs/user_manual.md b/docs/user_manual.md index a895935e..3024f6fe 100644 --- a/docs/user_manual.md +++ b/docs/user_manual.md @@ -1007,8 +1007,6 @@ Example: udocker manifest inspect centos:centos7 ``` - - ## 4. Running MPI jobs In this section we will use the Lattice QCD simulation software openQCD to diff --git a/tests/unit/test_dockerlocalfileapi.py b/tests/unit/test_dockerlocalfileapi.py index 6d2a4ad1..eadd2496 100755 --- a/tests/unit/test_dockerlocalfileapi.py +++ b/tests/unit/test_dockerlocalfileapi.py @@ -75,7 +75,7 @@ def test_02__load_structure(self, mock_isdir, mock_ldir, mock_isfile): res = {"repolayers": {fname: {"VERSION": {"k": "v"}}}, "repoconfigs": dict()} mock_isdir.return_value = True - mock_isfile.return_value = False + mock_isfile.return_value = False mock_ldir.side_effect = [[fname, ], ["VERSION", ], ] self.local.load_json.return_value = {"k": "v"} dlocapi = DockerLocalFileAPI(self.local) @@ -88,7 +88,7 @@ def test_02__load_structure(self, mock_isdir, mock_ldir, mock_isfile): "json_f": fulllayer}}, "repoconfigs": dict()} mock_isdir.return_value = True - mock_isfile.return_value = False + mock_isfile.return_value = False mock_ldir.side_effect = [[fname, ], ["json", ], ] self.local.load_json.return_value = {"k": "v"} dlocapi = DockerLocalFileAPI(self.local) @@ -100,7 +100,7 @@ def test_02__load_structure(self, mock_isdir, mock_ldir, mock_isfile): res = {"repolayers": {fname: {"layer_f": fulllayer}}, "repoconfigs": dict()} mock_isdir.return_value = True - mock_isfile.return_value = False + mock_isfile.return_value = False mock_ldir.side_effect = [[fname, ], ["layer1", ], ] self.local.load_json.return_value = {"k": "v"} dlocapi = DockerLocalFileAPI(self.local) diff --git a/tests/unit/test_executionmode.py b/tests/unit/test_executionmode.py index 0c03edac..6c595650 100755 --- a/tests/unit/test_executionmode.py +++ b/tests/unit/test_executionmode.py @@ -34,7 +34,7 @@ def setUp(self): Config().conf['osversion'] = "OSVERSION" Config().conf['arch'] = "ARCH" Config().conf['default_execution_mode'] = "P1" - Config().conf['override_default_execution_modes'] = {"arm":"P2", } + Config().conf['override_default_execution_modes'] = {"arm": "P2", } self.container_id = "CONTAINER_ID" str_local = 'udocker.container.localrepo.LocalRepository' diff --git a/tests/unit/test_fakechroot.py b/tests/unit/test_fakechroot.py index 9cd28ec8..c67fa9d0 100755 --- a/tests/unit/test_fakechroot.py +++ b/tests/unit/test_fakechroot.py @@ -260,13 +260,6 @@ def test_09__run_add_script_support(self, mock_msg, mock_isbinary, status = ufake._run_add_script_support("/ROOT/bin/ls") self.assertEqual(status, []) - #mock_msg.level = 3 - #mock_isbinary.return_value = False - #mock_findexe.side_effect = ["ls", ""] - #ufake = FakechrootEngine(self.local, self.xmode) - #status = ufake._run_add_script_support("/bin/ls") - #self.assertEqual(status, ["/ls"]) - mock_msg.level = 3 mock_isbinary.return_value = False mock_cont2host.return_value = "/ROOT/bin/ls" diff --git a/tests/unit/test_hostinfo.py b/tests/unit/test_hostinfo.py index 5010125a..5399adf7 100755 --- a/tests/unit/test_hostinfo.py +++ b/tests/unit/test_hostinfo.py @@ -30,7 +30,6 @@ def test_01_username(self, mock_getpwuid, mock_uid, mock_gid): name = HostInfo().username() self.assertEqual(name, usr.pw_name) - #@patch('udocker.helper.hostinfo.get_arch') @patch('udocker.helper.hostinfo.platform.machine') def test_02_arch(self, mock_mach): """Test02 HostInfo().arch.""" diff --git a/tests/unit/test_osinfo.py b/tests/unit/test_osinfo.py index ff810460..9382fe42 100755 --- a/tests/unit/test_osinfo.py +++ b/tests/unit/test_osinfo.py @@ -117,7 +117,7 @@ def test_05_osversion(self, mock_osdist): ginfo = OSInfo(self.rootdir) status = ginfo.osversion() self.assertEqual(status, "") - + if __name__ == '__main__': main() diff --git a/udocker/cli.py b/udocker/cli.py index 86933eb3..f8c177f4 100644 --- a/udocker/cli.py +++ b/udocker/cli.py @@ -844,7 +844,6 @@ def do_images(self, cmdp): Msg().out("%s %c" % (imagerepo + ":" + tag, prot)) if verbose: - #imagerepo_dir = self.localrepo.cd_imagerepo(imagerepo, tag) Msg().out(" %s" % (imagerepo_dir)) layers_list = self.localrepo.get_layers(imagerepo, tag) if layers_list: diff --git a/udocker/config.py b/udocker/config.py index 2d78d578..62033b89 100644 --- a/udocker/config.py +++ b/udocker/config.py @@ -72,9 +72,9 @@ class Config(object): # container execution mode if not set via setup # Change it to P2 if execution problems occur conf['override_default_execution_mode'] = "" - conf['default_execution_modes'] = {'x86_64':"P1", 'x86':"P1", - 'arm64':"P1", 'arm':"P2", - 'ppc64le':"R1", 'DEFAULT':"R1"} + conf['default_execution_modes'] = {'x86_64': "P1", 'x86': "P1", + 'arm64': "P1", 'arm': "P2", + 'ppc64le': "R1", 'DEFAULT': "R1"} # PRoot override seccomp # conf['proot_noseccomp'] = True diff --git a/udocker/container/localrepo.py b/udocker/container/localrepo.py index bdb6bae0..5e55b4b9 100644 --- a/udocker/container/localrepo.py +++ b/udocker/container/localrepo.py @@ -592,7 +592,7 @@ def get_image_platform_fmt(self): """Get the image platform from the metadata""" (manifest_json, dummy) = self.get_image_attributes() if not manifest_json: - return "unknown/unknown" + return "unknown/unknown" try: p_architecture = manifest_json["architecture"] except KeyError: diff --git a/udocker/docker.py b/udocker/docker.py index 5cde47c4..1ba1a315 100644 --- a/udocker/docker.py +++ b/udocker/docker.py @@ -382,14 +382,13 @@ def _get_v2_digest_from_image_index(self, image_index, platform): try: for manifest in index_list["manifests"]: manifest_p = manifest["platform"] - if (p_os and - (manifest_p["os"]).lower() != p_os): + if (p_os and (manifest_p["os"]).lower() != p_os): continue if (p_architecture and - (manifest_p["architecture"]).lower() != p_architecture): + (manifest_p["architecture"]).lower() != p_architecture): continue if (p_variant and - (manifest_p["variant"]).lower() != p_variant): + (manifest_p["variant"]).lower() != p_variant): continue return manifest["digest"] except (KeyError, AttributeError, ValueError, TypeError): @@ -423,7 +422,7 @@ def get_v2_image_manifest(self, imagerepo, tag, platform=""): if "oci.image.manifest.v1+json" in content_type: return (hdr.data, json.loads(buf.getvalue().decode())) if ("docker.distribution.manifest.list.v2" in content_type - or "oci.image.index.v1+json" in content_type): + or "oci.image.index.v1+json" in content_type): image_index = json.loads(buf.getvalue().decode()) if not platform: return (hdr.data, image_index) @@ -713,7 +712,6 @@ def _load_structure(self, tmp_imagedir): elif fname == "manifest.json": structure["manifest"] = \ self.localrepo.load_json(f_path) - #elif len(fname) >= 69 and fname.endswith(".json"): elif fname.endswith(".json") and FileUtil(f_path).isfile(): structure["repoconfigs"][fname] = {} structure["repoconfigs"][fname]["json"] = self.localrepo.load_json(f_path) diff --git a/udocker/engine/base.py b/udocker/engine/base.py index 4c52573b..9aba6ffc 100644 --- a/udocker/engine/base.py +++ b/udocker/engine/base.py @@ -680,7 +680,6 @@ def _check_arch(self, fail=False): def _get_qemu(self, return_path=False): """Get the qemu binary name if emulation needed""" container_qemu_arch = OSInfo(self.container_root).arch("qemu") - #host_qemu_arch = OSInfo("/").arch("qemu") host_qemu_arch = HostInfo().arch("qemu") if not (container_qemu_arch and host_qemu_arch): return "" diff --git a/udocker/engine/fakechroot.py b/udocker/engine/fakechroot.py index 6c6d9da3..6063295b 100644 --- a/udocker/engine/fakechroot.py +++ b/udocker/engine/fakechroot.py @@ -62,10 +62,10 @@ def select_fakechroot_so(self): if fakechroot_so.count('-') != 3: Msg().out("Info: this OS or architecture might not be supported by", "this execution mode", - "\n specify path to libfakechroot.so with", - "environment UDOCKER_FAKECHROOT_SO", - "\n or choose other execution mode with: udocker", - "setup --execmode=", l=Msg.INF) + "\n specify path to libfakechroot.so with", + "environment UDOCKER_FAKECHROOT_SO", + "\n or choose other execution mode with: udocker", + "setup --execmode=", l=Msg.INF) if not os.path.exists(fakechroot_so): Msg().err("Error: libfakechroot not found", image_list) sys.exit(1) @@ -233,10 +233,9 @@ def _run_add_script_support(self, exec_path): self.opt["cmd"][0] = exec_path return [] - #env_exec = FileUtil("env").find_exec("/bin:/usr/bin", self.container_root) - #if env_exec: - # return [self.container_root + '/' + env_exec, ] - + # env_exec = FileUtil("env").find_exec("/bin:/usr/bin", self.container_root) + # if env_exec: + # return [self.container_root + '/' + env_exec, ] real_path = FileUtil(self.container_root).cont2host(relc_path, self.opt["vol"]) hashbang = FileUtil(real_path).get1stline() diff --git a/udocker/engine/proot.py b/udocker/engine/proot.py index dec9fa6d..b8e9fafd 100644 --- a/udocker/engine/proot.py +++ b/udocker/engine/proot.py @@ -49,10 +49,10 @@ def select_proot(self): Msg().err("Error: proot executable not found") Msg().out("Info: Host architecture might not be supported by", "this execution mode:", arch, - "\n specify path to proot with environment", - "UDOCKER_USE_PROOT_EXECUTABLE", - "\n or choose other execution mode with: udocker", - "setup --execmode=", l=Msg.INF) + "\n specify path to proot with environment", + "UDOCKER_USE_PROOT_EXECUTABLE", + "\n or choose other execution mode with: udocker", + "setup --execmode=", l=Msg.INF) sys.exit(1) if Config.conf['proot_noseccomp'] is not None: @@ -76,7 +76,6 @@ def _is_seccomp_patched(self, executable): return False host_file = self.container_dir + "/osenv.json" - #host_info = self._is_same_osenv(host_file) host_info = self._get_saved_osenv(host_file) if host_info: if "PROOT_NEW_SECCOMP" in host_info: @@ -127,7 +126,7 @@ def _get_network_map(self): def _get_qemu_string(self): """Get the qemu string for container run command if emulation needed""" qemu_filename = self._get_qemu() - return ["-q", qemu_filename ] if qemu_filename else [] + return ["-q", qemu_filename] if qemu_filename else [] def run(self, container_id): """Execute a Docker container using PRoot. This is the main method diff --git a/udocker/engine/runc.py b/udocker/engine/runc.py index 7f3ffa31..7afc7226 100644 --- a/udocker/engine/runc.py +++ b/udocker/engine/runc.py @@ -59,10 +59,10 @@ def select_runc(self): Msg().err("Error: runc or crun executable not found") Msg().out("Info: Host architecture might not be supported by", "this execution mode:", arch, - "\n specify path to runc or crun with environment", - "UDOCKER_USE_RUNC_EXECUTABLE", - "\n or choose other execution mode with: udocker", - "setup --execmode=", l=Msg.INF) + "\n specify path to runc or crun with environment", + "UDOCKER_USE_RUNC_EXECUTABLE", + "\n or choose other execution mode with: udocker", + "setup --execmode=", l=Msg.INF) sys.exit(1) if "crun" in os.path.basename(self.executable): self.engine_type = "crun" diff --git a/udocker/helper/archinfo.py b/udocker/helper/archinfo.py index 59fe106b..363c14fd 100644 --- a/udocker/helper/archinfo.py +++ b/udocker/helper/archinfo.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- """Common architecture info and methods for hostinfo and osinfo""" + class ArchInfo(object): """Common object for architecture information""" @@ -10,61 +11,61 @@ class ArchInfo(object): # } _arch_list = [ - {'docker':['amd64'], 'qemu':['x86_64'], 'UDOCKER':['x86_64'], - 'uname':['x86_64'], 'file':['x86-64'], 'readelf':['X86-64'], - 'arch/var':['amd64']}, - {'docker':['x86_64'], 'qemu':['x86_64'], 'UDOCKER':['x86_64'], - 'uname':['x86_64'], 'file':['x86-64'], 'readelf':['X86_64'], + {'docker': ['amd64'], 'qemu': ['x86_64'], 'UDOCKER': ['x86_64'], + 'uname': ['x86_64'], 'file': ['x86-64'], 'readelf': ['X86-64'], + 'arch/var': ['amd64']}, + {'docker': ['x86_64'], 'qemu':['x86_64'], 'UDOCKER': ['x86_64'], + 'uname': ['x86_64'], 'file':['x86-64'], 'readelf': ['X86_64'], 'arch/var':['amd64']}, - {'docker':['386'], 'qemu':['i386'], 'UDOCKER':['x86'], - 'uname':['i386'], 'file':['Intel 80386'], 'readelf':['Intel 80386'], - 'arch/var':['386']}, - {'docker':['arm64'], 'qemu':['aarch64'], 'UDOCKER':['arm64'], - 'uname':['aarch64'], 'file':['aarch64'], 'readelf':['AArch64'], - 'arch/var':['arm64']}, - {'docker':['arm'], 'qemu':['arm'], 'UDOCKER':['armhf'], - 'uname':['armv7l'], 'file':[' ARM', '32-bit', 'LSB', 'EABI5'], - 'readelf':[' ARM', 'hard-float', 'little', 'Version5 EABI'], - 'arch/var':['arm/v7']}, - {'docker':['arm/v4'], 'qemu':['arm'], 'UDOCKER':['armel'], - 'uname':['arm'], 'file':[' ARM', '32-bit', 'LSB', 'EABI5'], - 'readelf':[' ARM', 'little', 'Version5 EABI'], 'arch/var':['arm/v4']}, - {'docker':['arm/v5'], 'qemu':['arm'], 'UDOCKER':['armel'], - 'uname':['arm'], 'file':[' ARM', '32-bit', 'LSB', 'EABI5'], - 'readelf':[' ARM', 'little', 'Version5 EABI'], 'arch/var':['arm/v5']}, - {'docker':['arm/v6'], 'qemu':['arm'], 'UDOCKER':['armel'], - 'uname':['arm'], 'file':[' ARM', '32-bit', 'LSB', 'EABI5'], - 'readelf':[' ARM', 'little', 'Version5 EABI'], 'arch/var':['arm/v6']}, - {'docker':['arm'], 'qemu':['arm'], 'UDOCKER':['armel'], - 'uname':['arm'], 'file':[' ARM', '32-bit', 'LSB', 'EABI5'], - 'readelf':[' ARM', 'little', 'Version5 EABI'], 'arch/var':['arm']}, - {'docker':['ppc64le'], 'qemu':['ppc64le'], 'UDOCKER':['ppc64le'], - 'uname':['ppc64le'], 'file':['64-bit PowerPC', 'LSB'], - 'readelf':['PowerPC64', 'little endian'], 'arch/var':['ppc64le']}, - {'docker':['ppc64'], 'qemu':['ppc64'], 'UDOCKER':['ppc64'], - 'uname':['ppc64'], 'file':['PowerPC', '64-bit'], - 'readelf':['PowerPC', 'ELF64'], 'arch/var':['ppc64']}, - {'docker':['ppc'], 'qemu':['ppc'], 'UDOCKER':['ppc'], - 'uname':['ppc'], 'file':['PowerPC', '32-bit'], - 'readelf':['PowerPC', 'ELF32'], 'arch/var':['ppc']}, - {'docker':['mipsle'], 'qemu':['mipsel'], 'UDOCKER':['mipsle'], - 'uname':['mips'], 'file':['mips', '32-bit', 'LSB executable'], - 'readelf':['mips', 'ELF32', 'little endian'], 'arch/var':['mipsle']}, - {'docker':['mips'], 'qemu':['mips'], 'UDOCKER':['mips'], - 'uname':['mips'], 'file':['mips', '32-bit', 'MSB'], - 'readelf':['mips', 'ELF32', 'big endian'], 'arch/var':['mips']}, - {'docker':['mips64le'], 'qemu':['mips64el'], 'UDOCKER':['mips64le'], - 'uname':['mips64'], 'file':['mips', '64-bit', 'LSB executable'], - 'readelf':['mips', 'ELF64', 'little endian'], 'arch/var':['mips64']}, - {'docker':['mips64'], 'qemu':['mips64'], 'UDOCKER':['mips64'], - 'uname':['mips64'], 'file':['mips', '64-bit', 'MSB'], - 'readelf':['mips', 'ELF64', 'big endian'], 'arch/var':['mips64']}, - {'docker':['riscv64'], 'qemu':['riscv64'], 'UDOCKER':['riscv64'], - 'uname':['riscv64'], 'file':['riscv', '64-bit'], - 'readelf':['riscv', 'ELF64'], 'arch/var':['riscv64']}, - {'docker':['s390x'], 'qemu':['s390x'], 'UDOCKER':['s390x'], - 'uname':['s390x'], 'file':['IBM S/390', '64-bit', 'MSB'], - 'readelf':['IBM S/390', 'ELF64', 'big endian'], 'arch/var':['s390x']} + {'docker': ['386'], 'qemu': ['i386'], 'UDOCKER': ['x86'], + 'uname': ['i386'], 'file': ['Intel 80386'], 'readelf': ['Intel 80386'], + 'arch/var': ['386']}, + {'docker': ['arm64'], 'qemu': ['aarch64'], 'UDOCKER': ['arm64'], + 'uname': ['aarch64'], 'file': ['aarch64'], 'readelf': ['AArch64'], + 'arch/var': ['arm64']}, + {'docker': ['arm'], 'qemu': ['arm'], 'UDOCKER': ['armhf'], + 'uname': ['armv7l'], 'file': [' ARM', '32-bit', 'LSB', 'EABI5'], + 'readelf': [' ARM', 'hard-float', 'little', 'Version5 EABI'], + 'arch/var': ['arm/v7']}, + {'docker': ['arm/v4'], 'qemu': ['arm'], 'UDOCKER': ['armel'], + 'uname': ['arm'], 'file': [' ARM', '32-bit', 'LSB', 'EABI5'], + 'readelf': [' ARM', 'little', 'Version5 EABI'], 'arch/var': ['arm/v4']}, + {'docker': ['arm/v5'], 'qemu': ['arm'], 'UDOCKER': ['armel'], + 'uname': ['arm'], 'file': [' ARM', '32-bit', 'LSB', 'EABI5'], + 'readelf': [' ARM', 'little', 'Version5 EABI'], 'arch/var': ['arm/v5']}, + {'docker': ['arm/v6'], 'qemu': ['arm'], 'UDOCKER': ['armel'], + 'uname': ['arm'], 'file': [' ARM', '32-bit', 'LSB', 'EABI5'], + 'readelf': [' ARM', 'little', 'Version5 EABI'], 'arch/var': ['arm/v6']}, + {'docker': ['arm'], 'qemu': ['arm'], 'UDOCKER': ['armel'], + 'uname': ['arm'], 'file': [' ARM', '32-bit', 'LSB', 'EABI5'], + 'readelf': [' ARM', 'little', 'Version5 EABI'], 'arch/var': ['arm']}, + {'docker': ['ppc64le'], 'qemu': ['ppc64le'], 'UDOCKER': ['ppc64le'], + 'uname': ['ppc64le'], 'file': ['64-bit PowerPC', 'LSB'], + 'readelf': ['PowerPC64', 'little endian'], 'arch/var': ['ppc64le']}, + {'docker': ['ppc64'], 'qemu': ['ppc64'], 'UDOCKER': ['ppc64'], + 'uname': ['ppc64'], 'file': ['PowerPC', '64-bit'], + 'readelf': ['PowerPC', 'ELF64'], 'arch/var': ['ppc64']}, + {'docker': ['ppc'], 'qemu': ['ppc'], 'UDOCKER': ['ppc'], + 'uname': ['ppc'], 'file': ['PowerPC', '32-bit'], + 'readelf': ['PowerPC', 'ELF32'], 'arch/var': ['ppc']}, + {'docker': ['mipsle'], 'qemu': ['mipsel'], 'UDOCKER': ['mipsle'], + 'uname': ['mips'], 'file': ['mips', '32-bit', 'LSB executable'], + 'readelf': ['mips', 'ELF32', 'little endian'], 'arch/var': ['mipsle']}, + {'docker': ['mips'], 'qemu': ['mips'], 'UDOCKER': ['mips'], + 'uname': ['mips'], 'file': ['mips', '32-bit', 'MSB'], + 'readelf': ['mips', 'ELF32', 'big endian'], 'arch/var': ['mips']}, + {'docker': ['mips64le'], 'qemu': ['mips64el'], 'UDOCKER': ['mips64le'], + 'uname': ['mips64'], 'file': ['mips', '64-bit', 'LSB executable'], + 'readelf': ['mips', 'ELF64', 'little endian'], 'arch/var': ['mips64']}, + {'docker': ['mips64'], 'qemu': ['mips64'], 'UDOCKER': ['mips64'], + 'uname': ['mips64'], 'file': ['mips', '64-bit', 'MSB'], + 'readelf': ['mips', 'ELF64', 'big endian'], 'arch/var': ['mips64']}, + {'docker': ['riscv64'], 'qemu': ['riscv64'], 'UDOCKER': ['riscv64'], + 'uname': ['riscv64'], 'file': ['riscv', '64-bit'], + 'readelf': ['riscv', 'ELF64'], 'arch/var':['riscv64']}, + {'docker': ['s390x'], 'qemu': ['s390x'], 'UDOCKER': ['s390x'], + 'uname': ['s390x'], 'file': ['IBM S/390', '64-bit', 'MSB'], + 'readelf': ['IBM S/390', 'ELF64', 'big endian'], 'arch/var': ['s390x']} ] # binaries from which to get architecture information using @@ -87,8 +88,7 @@ class ArchInfo(object): "/system/bin/sh", "/system/bin/ls", "/lib/ld-linux.so", "/lib/ld-linux.so.1", "/lib/ld-linux.so.2", "/lib/ld-linux.so.3", - "/usr/bin/coreutils", "/bin/coreutils", - ] + "/usr/bin/coreutils", "/bin/coreutils", ] def get_binaries_list(self): """Return list of binary files""" diff --git a/udocker/helper/elfpatcher.py b/udocker/helper/elfpatcher.py index 2b4be197..876a939c 100644 --- a/udocker/helper/elfpatcher.py +++ b/udocker/helper/elfpatcher.py @@ -55,10 +55,10 @@ def select_patchelf(self): Msg().err("Error: patchelf executable not found") Msg().out("Info: Host architecture might not be supported by", "this execution mode:", arch, - "\n specify path to patchelf with environment", - "UDOCKER_USE_PATCHELF_EXECUTABLE", - "\n or choose other execution mode with: udocker", - "setup --execmode=", l=Msg.INF) + "\n specify path to patchelf with environment", + "UDOCKER_USE_PATCHELF_EXECUTABLE", + "\n or choose other execution mode with: udocker", + "setup --execmode=", l=Msg.INF) sys.exit(1) return patchelf_exec diff --git a/udocker/helper/osinfo.py b/udocker/helper/osinfo.py index 704d5653..fea095b6 100644 --- a/udocker/helper/osinfo.py +++ b/udocker/helper/osinfo.py @@ -9,6 +9,7 @@ from udocker.utils.fileutil import FileUtil from udocker.helper.archinfo import ArchInfo + class OSInfo(ArchInfo): """Get os information""" @@ -107,7 +108,7 @@ def arch(self, target="UDOCKER"): architecture = self.arch_from_binaries(target) return architecture - def is_same_arch(self, other_root_dir="/" ,target="UDOCKER"): + def is_same_arch(self, other_root_dir="/", target="UDOCKER"): """Compare architectures for two system trees""" this_arch = self.arch(target) other_arch = OSInfo(other_root_dir).arch(target) @@ -162,7 +163,7 @@ def osdistribution(self): """Get guest operating system distribution""" (distribution, version) = self._osdistribution() if version.count(".") >= 2: - version = ".".join(version.split(".")[0:2]) + version = ".".join(version.split(".")[0:2]) else: version = version.split(".")[0] return(distribution, version) From 3bf2d4f8be9025db48a6f960b8004783c794a3ac Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Fri, 30 Jun 2023 12:50:52 +0100 Subject: [PATCH 93/99] style improvements for SQA --- udocker/cli.py | 4 ++-- udocker/engine/fakechroot.py | 2 +- udocker/engine/singularity.py | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/udocker/cli.py b/udocker/cli.py index f8c177f4..87b6b96c 100644 --- a/udocker/cli.py +++ b/udocker/cli.py @@ -775,9 +775,9 @@ def do_run(self, cmdp): delete = cmdp.get("--rm") name = cmdp.get("--name=") pull = cmdp.get("--pull=") - dummy = cmdp.get("--pull") # if invoked without option + dummy = cmdp.get("--pull") # if invoked without option - if cmdp.missing_options(): # syntax error + if cmdp.missing_options(): # syntax error return self.STATUS_ERROR if Config.conf['location']: diff --git a/udocker/engine/fakechroot.py b/udocker/engine/fakechroot.py index 6063295b..e20835d9 100644 --- a/udocker/engine/fakechroot.py +++ b/udocker/engine/fakechroot.py @@ -59,7 +59,7 @@ def select_fakechroot_so(self): f_util = FileUtil(self.localrepo.libdir) fakechroot_so = f_util.find_file_in_dir(image_list) - if fakechroot_so.count('-') != 3: + if fakechroot_so.count('-') != 3: Msg().out("Info: this OS or architecture might not be supported by", "this execution mode", "\n specify path to libfakechroot.so with", diff --git a/udocker/engine/singularity.py b/udocker/engine/singularity.py index 010d85fa..0c2bf40f 100644 --- a/udocker/engine/singularity.py +++ b/udocker/engine/singularity.py @@ -47,10 +47,10 @@ def select_singularity(self): if not os.path.exists(self.executable): Msg().err("Error: apptainer or singularity executable not found") Msg().out("Info: Host might not be supported this execution mode", - "specify path to\n apptainer/singularity with", - "environment UDOCKER_USE_SINGULARITY_EXECUTABLE", - "\n or choose other execution mode with: udocker", - "setup --execmode=", l=Msg.INF) + "specify path to\n apptainer/singularity with", + "environment UDOCKER_USE_SINGULARITY_EXECUTABLE", + "\n or choose other execution mode with: udocker", + "setup --execmode=", l=Msg.INF) sys.exit(1) def _get_volume_bindings(self): From 4b25a3c6c3ee4f1cf3b7e5b51a8138211c941d57 Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Fri, 30 Jun 2023 13:02:18 +0100 Subject: [PATCH 94/99] Acknowledgements --- udocker/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/udocker/__init__.py b/udocker/__init__.py index 9cd49f5d..3621289f 100644 --- a/udocker/__init__.py +++ b/udocker/__init__.py @@ -28,6 +28,7 @@ "runC https://runc.io", "crun https://github.com/containers/crun", "Fakechroot https://github.com/dex4er/fakechroot", + "Patchelf https://github.com/NixOS/patchelf", "Singularity http://singularity.lbl.gov" ] __license__ = "Licensed under the Apache License, Version 2.0" From f433027362ad9e699b55e13ea186117bcb678bbc Mon Sep 17 00:00:00 2001 From: mariojmdavid Date: Fri, 30 Jun 2023 14:29:30 +0100 Subject: [PATCH 95/99] update version to 1.3.10 --- codemeta.json | 2 +- docs/installation_manual.md | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/codemeta.json b/codemeta.json index 5b83cd6f..20b7bfde 100644 --- a/codemeta.json +++ b/codemeta.json @@ -6,7 +6,7 @@ "@type": "SoftwareSourceCode", "identifier": "udocker", "name": "udocker", - "version": "1.3.9", + "version": "1.3.10", "description": "A basic user tool to execute simple docker containers in batch or interactive systems without root privileges", "license": "Apache Software License 2.0, OSI Approved :: Apache Software License", "author": [ diff --git a/docs/installation_manual.md b/docs/installation_manual.md index 225fce10..a40c3030 100644 --- a/docs/installation_manual.md +++ b/docs/installation_manual.md @@ -32,18 +32,18 @@ udocker requires: Download a release tarball from : ```bash -wget https://github.com/indigo-dc/udocker/releases/download/1.3.9/udocker-1.3.9.tar.gz -tar zxvf udocker-1.3.9.tar.gz -export PATH=`pwd`/udocker-1.3.9/udocker:$PATH +wget https://github.com/indigo-dc/udocker/releases/download/1.3.10/udocker-1.3.10.tar.gz +tar zxvf udocker-1.3.10.tar.gz +export PATH=`pwd`/udocker-1.3.10/udocker:$PATH ``` Alternatively use `curl` instead of `wget` as follows: ```bash -curl -L https://github.com/indigo-dc/udocker/releases/download/1.3.9/udocker-1.3.9.tar.gz \ - > udocker-1.3.9.tar.gz -tar zxvf udocker-1.3.9.tar.gz -export PATH=`pwd`/udocker-1.3.9/udocker:$PATH +curl -L https://github.com/indigo-dc/udocker/releases/download/1.3.10/udocker-1.3.10.tar.gz \ + > udocker-1.3.10.tar.gz +tar zxvf udocker-1.3.10.tar.gz +export PATH=`pwd`/udocker-1.3.10/udocker:$PATH ``` udocker executes containers using external tools and libraries that @@ -345,8 +345,8 @@ The udocker tool should be installed as shown in section 2.1: ```bash cd /sw -wget https://github.com/indigo-dc/udocker/releases/download/1.3.9/udocker-1.3.9.tar.gz -tar zxvf udocker-1.3.9.tar.gz +wget https://github.com/indigo-dc/udocker/releases/download/1.3.10/udocker-1.3.10.tar.gz +tar zxvf udocker-1.3.10.tar.gz ``` Directing users to the central udocker installation can be done using the From b5175572aeba611545c25028060fc894f603a2b6 Mon Sep 17 00:00:00 2001 From: mariojmdavid Date: Fri, 30 Jun 2023 14:44:01 +0100 Subject: [PATCH 96/99] fix version to 1.3.10 --- udocker/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/udocker/__init__.py b/udocker/__init__.py index 3621289f..9d607658 100644 --- a/udocker/__init__.py +++ b/udocker/__init__.py @@ -32,5 +32,5 @@ "Singularity http://singularity.lbl.gov" ] __license__ = "Licensed under the Apache License, Version 2.0" -__version__ = "1.3.10a1" +__version__ = "1.3.10" __date__ = "2023" From 7461b33e8fbd8718919140112aad1554378bc1ef Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Fri, 30 Jun 2023 15:17:11 +0100 Subject: [PATCH 97/99] udocker.1 man page --- docs/udocker.1 | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/udocker.1 b/docs/udocker.1 index 1645ee89..ca690794 100644 --- a/docs/udocker.1 +++ b/docs/udocker.1 @@ -1,7 +1,7 @@ .\" Manpage for udocker .\" Contact udocker@lip.pt to correct errors or typos. .\" To read this man page use: man -l udocker.1 -.TH udocker 1 "25 Jun 2023" "version 1.3.10" "udocker man page" +.TH udocker 1 "30 Jun 2023" "version 1.3.10" "udocker man page" .SH NAME udocker \- execute Docker containers in user space without privileges .SH SYNOPSIS @@ -44,7 +44,7 @@ Supported commands: .BR help Prints a usage summary. Further help for specific udocker commands can be obtained with "udocker COMMAND -h | --help". .TP -.BR search " " [ " " \-a " " ] " " | " " [ " " \--list-tags " " ] " " | " " [ " " --registry=REGISTRY " " ] " " | " " STRING +.BR search " " [ " " \-a " " ] " " | " " [ " " \--list-tags " " ] " " | " " [ " " \--registry=REGISTRY " " ] " " | " " STRING Search for IMAGES in a Docker registry. Not all registries support searching. The \-a option displays all matching entries without pausing. The \--list-tags option lists the tags for a given repository in this case STRING must be a repository name. .TP .BR pull " " [ " " \--httpproxy=PROXY " " | " " \--index=INDEX " " | " " \--registry=REGISTRY " " | " " \--platform=OS/ARCH " " ] " " IMAGE @@ -59,7 +59,7 @@ Creates a container for execution from an IMAGE stored in the local repository. .BR ps " " [ " " \-m " " ] " " | " " [ " " \-s " " ] " " | " " [ " " \-p " " ] List containers in the local repository. These are containers produced with the command "create" and that can be executed with the command "run". The list contains the CONTAINER-ID, the protection flag against deletion, write status, ALIASEs, and the corresponding IMAGE. The command name "ps" has been kept for compatibility with the Docker command line, in udocker the command ps does not show running containers instead shows the created containers extracted to the filesystem that are ready to be executed. The option \-m adds the execution mode. The option \-s adds the size in MB. .TP -.BR rm " " [ " " -f " " ] " " CONTAINER\-ID " " | " " ALIAS " " ... +.BR rm " " [ " " \-f " " ] " " CONTAINER\-ID " " | " " ALIAS " " ... Delete containers using the CONTAINER\-ID or ALIAS. The flag -f forces the removal by changing the file protections. .TP .BR inspect " " IMAGE " " | " " [ " " \-p " " ] " " CONTAINER\-ID " " | " " [ " " \-p " " ] " " ALIAS @@ -74,30 +74,30 @@ Remove an ALIAS. The CONTAINER itself is not affected and can be used via its CO .BR rename " " ALIAS " " NEWALIAS Change a given container ALIAS name. .TP -.BR rmi " " [ " " -f " " ] " " IMAGE +.BR rmi " " [ " " \-f " " ] " " IMAGE Delete an IMAGE in the local repository. Any related CONTAINERS previously extracted are NOT affected by the parent IMAGE removal. The option \-f forces the deletion, and can be used when the IMAGE structure is damaged. .TP -.BR import " " [ " " --mv " " ] " " [ " " --platform=OS/ARCH " " ] " " TARBALL " " IMAGE " " | " " - " " IMAGE +.BR import " " [ " " \--mv " " ] " " [ " " \--platform=OS/ARCH " " ] " " TARBALL " " IMAGE " " | " " - " " IMAGE .TP -.BR import " " --tocontainer " " --name=ALIAS " " [ " " --platform=OS/ARCH " " ] " " TARBALL " " | " " --tocontainer " " --name=ALIAS " " - " " +.BR import " " \--tocontainer " " \--name=ALIAS " " [ " " \--platform=OS/ARCH " " ] " " TARBALL " " | " " \--tocontainer " " \--name=ALIAS " " - " " .TP .BR import " " --clone " " --name=ALIAS " " TARBALL " " | " " --clone " " --name=ALIAS " " - " " Import a tarball from file or stdin. The tarball can be imported into a new image or container. The first form can be used to import a container exported by docker into a new image. The second form uses --tocontainer to import directly into a container without creating an image. The third form uses --clone to import a udocker container (e.g. exported with udocker export --clone) into a new container without creating an image, preserving the container metadata and execution modes. When importing to an image (default) the option --mv will try to move the tarball file into the repository instead of copying the content. When importing to a container the option --name can be used to provide a name alias to the created container. The operating system and architecture of the tarball content can be specified with --platform. .TP .BR load " " - " " .TP -.BR load " " -i " " IMAGE\-TARBALL +.BR load " " \-i " " IMAGE\-TARBALL Load an IMAGE\-TARBALL previously saved by "docker save". The IMAGE\-TARBALL contains the several layers of a Docker layered filesystem plus the associated metadata. The image and its layers are loaded into the local images repository. The load command also supports loading of OCI container images (EXPERIMENTAL). .TP -.BR save " " -o " " - " " IMAGE +.BR save " " \-o " " - " " IMAGE .TP -.BR save " " -o " " IMAGE\-TARBALL " " IMAGE +.BR save " " \-o " " IMAGE\-TARBALL " " IMAGE Save an image stored in the local images repository to a tarball. The IMAGE\-TARBALL contains the several layers of a Docker layered filesystem plus the associated metadata. The tarball will contain the image metadata and all the individual layers that compose it. The saved tarball can be loaded into another repository using the command load. .TP .BR verify " " IMAGE Verify the integrity of an IMAGE in the local repository. .TP -.BR clone " " CONTAINER\-ID " " | " " --name=ALIAS " " CONTAINER\-ID +.BR clone " " CONTAINER\-ID " " | " " \--name=ALIAS " " CONTAINER\-ID Duplicate an existing container creating a complete replica. The replica receives a different CONTAINER\-ID. An ALIAS can be assigned to the newly created container by using --name. .TP .BR protect " " IMAGE " " | " " CONTAINER\-ID " " | " " ALIAS @@ -112,13 +112,13 @@ Obtain and print information about an IMAGE manifest from a remote registry. .BR mkrepo " " DIRECTORY Setup a local repository in the host DIRECTORY. The required directory structure is created. .TP -.BR login " " --username=USERNAME " " | " " --password=PASSWORD " " | " " --registry=REGISTRY +.BR login " " \--username=USERNAME " " | " " \--password=PASSWORD " " | " " \--registry=REGISTRY Setup of authentication information for access to remote Docker registries. Enables "pull" of IMAGES from private registries. The option --registry can be used to access registries other than the default dockerhub. If USERNAME or PASSWORD are not provided in the command line, the user will be prompted to provide them. .TP -.BR logout " " [ " " \-a " " ] " " | " " --registry=REGISTRY +.BR logout " " [ " " \-a " " ] " " | " " \--registry=REGISTRY Remove authentication information created by "login". By default authentication is removed for the default REGISTRY. A specific REGISTRY can be specified with --registry. Alternatively ALL previously entered authentication information can be removed with the -a option. .TP -.BR setup " " --execmode= " " | " " --execmode= " " | " " --execmode= " " | " " --execmode= " " | " " --force " " | " " --nvidia " " | " " --purge " " CONTAINER\-ID +.BR setup " " \--execmode= " " | " " \--execmode= " " | " " \--execmode= " " | " " \--execmode= " " | " " \--force " " | " " \--nvidia " " | " " \--purge " " CONTAINER\-ID Change container execution settings. The option --execmode enables selection of an alternative execution engine. In certain cases when experiencing execution errors changing the execution mode to mode P2 may solve the problem. The option --force can be used with --execmode to force a given execution mode upon a setup error. The option --nvidia enables access to GPGPUs by adding the necessary host libraries to the container (EXPERIMENTAL). The option --force can also be used with --nvidia to force the setup of the nvidia environment. The option --purge cleans mountpoints and auxiliary files created by udocker. .TP .BR tag " " SOURCEIMAGE " " TARGETIMAGE From ab57db1c1ebe93a4e7dbf3879366ae63a5af7881 Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Fri, 30 Jun 2023 19:02:09 +0100 Subject: [PATCH 98/99] document centos 7 issues with user namespaces --- docs/installation_manual.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/docs/installation_manual.md b/docs/installation_manual.md index a40c3030..937b1930 100644 --- a/docs/installation_manual.md +++ b/docs/installation_manual.md @@ -466,7 +466,24 @@ hosts that may share the common location. Therefore if the original location pathname is `/sw/udocker/containers` then all hosts must also mount it at the same exact path `/sw/udocker/containers`. -##### 7.3.1.3. Modes R2 and R3 restrictions +##### 7.3.1.3. Modes R1, R2 and R3 general restrictions + +These modes make use of runc or crun and require that user namespaces +are enabled in the kernel. Older distributions may either not have +support for namespaces (e.g. CentOS 6) or may have the support for +user namespaces disabled at the system level (e.g. CentOS 7). More +recent releases of Linux distributions do have support for user +namespaces (e.g. CentOS 8 and CentOS 9). + +For Centos 7 there are steps that system administrators may perform +to enable user namespaces, such as: + +```bash +sudo grubby --update-kernel=ALL --args='namespace.unpriv_enable=1' +sudo echo "user.max_user_namespaces=15076" >> /etc/sysctl.conf +``` + +##### 7.3.1.4. Modes R2 and R3 specific restrictions Central installation from readonly location using any of the R modes requires udocker above v1.1.7. From 02bb51ad8b915cb1fee2e5904cb7ec93a6bded34 Mon Sep 17 00:00:00 2001 From: Jorge Gomes Date: Fri, 30 Jun 2023 19:14:54 +0100 Subject: [PATCH 99/99] document centos 7 issues with user namespaces --- docs/installation_manual.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/installation_manual.md b/docs/installation_manual.md index 937b1930..b2d0633e 100644 --- a/docs/installation_manual.md +++ b/docs/installation_manual.md @@ -479,8 +479,7 @@ For Centos 7 there are steps that system administrators may perform to enable user namespaces, such as: ```bash -sudo grubby --update-kernel=ALL --args='namespace.unpriv_enable=1' -sudo echo "user.max_user_namespaces=15076" >> /etc/sysctl.conf +sudo echo "user.max_user_namespaces=10000" >> /etc/sysctl.conf ``` ##### 7.3.1.4. Modes R2 and R3 specific restrictions