diff --git a/.sqa/config.yml b/.sqa/config.yml index cd18704b..f4e2da92 100644 --- a/.sqa/config.yml +++ b/.sqa/config.yml @@ -2,7 +2,7 @@ config: credentials: [] project_repos: github.com/indigo-dc/udocker: - branch: devel3 + branch: dev-v1.3.8 repo: https://github.com/indigo-dc/udocker environment: JPL_DOCKERFORCEBUILD: enabled diff --git a/CHANGELOG.md b/CHANGELOG.md index 91d21732..8e9bf895 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## udocker (1.3.8) + +* build udockertools 1.2.9 and set it as default +* add Fn support for Ubuntu:22 +* remove files to be installed +* set Fn preference to use runc + ## udocker (1.3.7) * Remove deprecated unit tests. udocker is the same as version 1.3.6 @@ -12,8 +19,7 @@ ## udocker (1.3.5) -* fix python backwards compatibility issues - * closes: #374 +* fix python backwards compatibility issues - closes: #374 * fix incorrectly reported errors by image verification * fix image search returning empty results * fix issue with logical links in the udocker executable path @@ -24,8 +30,7 @@ * prevent closing of file descriptors upon engine invocation improves PMI process management interface interoperability * fix issues in import and export while using pipes. -* fix image name parsing where "library" component is missing - * closes: #359 +* fix image name parsing where "library" component is missing - closes: #359 ## udocker (1.3.4) @@ -75,18 +80,14 @@ * Cmd and entrypoint metadata and arguments processing changed to mimic docker * Improve removal of files and links in install and filebind restore * Add follow location option to GetURL() -* Implement use of `--entrypoint=` to force execution of command - * closes: #306 -* Implement use of `--entrypoint=""` to bypass entrypoint in metadata - * closes: #306 +* Implement use of `--entrypoint=` to force execution of command - closes: #306 +* Implement use of `--entrypoint=""` to bypass entrypoint in metadata - closes: #306 ## udocker (1.2.9) -* method Unshare.unshare os.strerror() takes one argument, - * closes: #254 +* method Unshare.unshare os.strerror() takes one argument - closes: #254 * Add unit test for #254 -* Method chown udocker.utils.fileutil FileUtil - * closes: #276 +* Method chown udocker.utils.fileutil FileUtil - closes: #276 * Several fixes of unit tests and pylint * Fix confusion between exit code 0 and inferred False * Dereference on `safe_prefixes` @@ -108,16 +109,11 @@ * Fix handling of dockerhub repository names in /v2 * Improve documentation and algn with 1.1.8b2 * Add credits -* Fix delete of paths with symlinks - * closes: #267, #265 -* Fix issues with login credentials - * closes: #310 -* Fix pull images from docker hub in Termux - * closes: #307 -* Fix issues on running udocker in googlecolab - * closes: #286 -* Fix execution with Pn modes in alternate /tmp - * closes: #284 +* Fix delete of paths with symlinks - closes: #267, #265 +* Fix issues with login credentials - closes: #310 +* Fix pull images from docker hub in Termux - closes: #307 +* Fix issues on running udocker in googlecolab - closes: #286 +* Fix execution with Pn modes in alternate /tmp - closes: #284 * Add conditional delay-directory-restore to untar layers * Add exclude of whiteouts on layer untar * Add --nobanner to udocker run @@ -132,19 +128,14 @@ ## udocker (1.1.7) -* Fix P1 when Linux 4.8.0 SECCOMP is backported, affects newer CentOS 7 - * closes: #282 -* Check for file ownership on remove wrongly follows symlinks - * closes: #266, #267 -* udocker unexpectedly uses P1 exec mode instead of P2 - * closes: #274 -* Allow passing of `PROOT_TMP_DIR` environment variable - * closes: #284 +* Fix P1 when Linux 4.8.0 SECCOMP is backported, affects newer CentOS 7 - closes: #282 +* Check for file ownership on remove wrongly follows symlinks - closes: #266, #267 +* udocker unexpectedly uses P1 exec mode instead of P2 - closes: #274 +* Allow passing of `PROOT_TMP_DIR` environment variable - closes: #284 ## udocker (1.1.6) -* Complete fix for of ELF paths in modes Fn for $ORIGIN:$ORIGIN - * closes: #255 +* Complete fix for of ELF paths in modes Fn for $ORIGIN:$ORIGIN - closes: #255 ## udocker (1.1.5) @@ -198,88 +189,58 @@ * Improved fix of SECCOMP accelerated mode for P1 mode * Added loading and handling of container images in OCI format * Fixes for udocker in ARM aarch64 -* Fix processing of --dri in Sn mode - * closes: #241 -* Improve handling of container and host authentication - * partially addresses: #239 -* Fixes to address authentication and redirects in pull - * closes: #225, #230 -* Added minimal support to load OCI images - * closes: #111 -* Added Pn support for newer distributions - * closes: #192 -* Improve the installation of udockertools - * closes: #220, #228 -* Read environment variables from file with --env-file= - * closes: #212 -* Prepare for pypy - * closes: #211 -* Fixes for verification of container images - * closes: #209 -* Fix command line processing for "-" in argument - * closes: #202 -* Fix file protections on extraction making files u+r - * closes: #202, #206 -* Fix comparison of kernel versions having non-integers - * closes: #183 -* Support for both manifest V2 schema 1 and schema 2 - * closes: #218, #225 -* Further improved pathname translation in Fn modes - * closes: #160 -* Implement save images in docker format - * closes: #74 -* useradd and groupadd not working in containers - * closes: #141 -* fix return code when exporting to stdin - * closes: #202 +* Fix processing of --dri in Sn mode - closes: #241 +* Improve handling of container and host authentication - partially addresses: #239 +* Fixes to address authentication and redirects in pull - closes: #225, #230 +* Added minimal support to load OCI images - closes: #111 +* Added Pn support for newer distributions - closes: #192 +* Improve the installation of udockertools - closes: #220, #228 +* Read environment variables from file with --env-file= - closes: #212 +* Prepare for pypy - closes: #211 +* Fixes for verification of container images - closes: #209 +* Fix command line processing for "-" in argument - closes: #202 +* Fix file protections on extraction making files u+r - closes: #202, #206 +* Fix comparison of kernel versions having non-integers - closes: #183 +* Support for both manifest V2 schema 1 and schema 2 - closes: #218, #225 +* Further improved pathname translation in Fn modes - closes: #160 +* Implement save images in docker format - closes: #74 +* useradd and groupadd not working in containers - closes: #141 +* fix return code when exporting to stdin - closes: #202 ## udocker (1.1.3) -* Support for nvidia drivers on ubuntu - * closes: #162 -* Installation improvements - * closes: #166 -* Fix issue on Fn mode symlink convertion - * partially addresses: #160 +* Support for nvidia drivers on ubuntu - closes: #162 +* Installation improvements - closes: #166 +* Fix issue on Fn mode symlink conversion - partially addresses: #160 ## udocker (1.1.2) -* Improve parsing of quotes in the command line - * closes: #98 -* Fix version command to exit with 0 - * closes: #107 +* Improve parsing of quotes in the command line - closes: #98 +* Fix version command to exit with 0 - closes: #107 * Add kill-on-exit to proot on Pn modes * Improve download of udocker utils -* Handle authentication headers when pulling - * closes: #110 +* Handle authentication headers when pulling - closes: #110 * Handle of redirects when pulling * Fix registries table * Support search quay.io * Fix auth header when no standard Docker registry is used * Add registry detection on image name * Add --version option -* Force python2 as interpreter - * closes: #131 +* Force python2 as interpreter - closes: #131 * Fix handling of volumes in metadata * Handle empty metadata -* Fix http proxy functionality - * closes: #115 -* Ignore --no-trunc and --all in the images command - * closes: #108 +* Fix http proxy functionality - closes: #115 +* Ignore --no-trunc and --all in the images command - closes: #108 * Implement verification of layers in manifest * Add --nvidia to support GPUs and related drivers * Send download messages to stderr * Enable override of curl executable -* Fix building on CentOS 6 - * closes: #157 -* Mitigation for upstream limitation in runC without tty - * closes: #132 -* Fix detection of executable with symlinks in container - * closes: #118 +* Fix building on CentOS 6 - closes: #157 +* Mitigation for upstream limitation in runC without tty - closes: #132 +* Fix detection of executable with symlinks in container - closes: #118 * Updated runC to v1.0.0-rc5 * Experimental support for Alpine in Fn modes -* Improve pathname translation in Fn modes for mounted dirs - * partially addresses: #160 +* Improve pathname translation in Fn modes for mounted dirs - partially addresses: #160 ## udocker (1.1.1) @@ -287,8 +248,7 @@ * Updated documentation with OpenMPI information and examples * Additional unit tests * Redirect messages to stderr -* Improved parsing of quotes in the command line - * closes: #87 +* Improved parsing of quotes in the command line - closes: #87 * Allow override of the HOME environment variable * Allow override of libfakechroot.so at the container level * Automatic selection of libfakechroot.so from container info @@ -300,10 +260,8 @@ * Load, import and export to/from stdin/stdout * Clone existing containers * Support for TCP/IP port remap in execution modes Pn -* Fix run with basenames failing - * closes: #89 -* Allow run as root flag - * closes: #91 +* Fix run with basenames failing - closes: #89 +* Allow run as root flag - closes: #91 ## udocker (1.1.0) @@ -314,10 +272,8 @@ * Improve proot tmp files cleanup on non ext filesystems * Improve search returning empty on Docker repositories * Improve runC execution portability -* Add environment variable `UDOCKER_KEYSTORE` - * closes: #75 -* Prevent creation of .udocker when `UDOCKER_KEYSTORE` is used - * closes: #75 +* Add environment variable `UDOCKER_KEYSTORE` - closes: #75 +* Prevent creation of .udocker when `UDOCKER_KEYSTORE` is used - closes: #75 ## udocker (1.0.4) @@ -329,27 +285,19 @@ * Improve the command line parsing * Improve temporary file handling and removal * Support for additional execution engines to be provided in the future -* Improved parsing of entrypoint and cmd metadata - * closes: #53 -* Increase name alias length - * closes: #52 -* Add support for change dir into volume directories - * closes: #51 -* Fix deletion of files upon container import - * closes: #50 -* Fix exporting of host environment variables to the containers - * closes: #48 -* Change misleading behavior of import tarball from move to copy - * closes: #44 -* Fix validation of volumes specification - * closes: #43 +* Improved parsing of entrypoint and cmd metadata - closes: #53 +* Increase name alias length - closes: #52 +* Add support for change dir into volume directories - closes: #51 +* Fix deletion of files upon container import - closes: #50 +* Fix exporting of host environment variables to the containers - closes: #48 +* Change misleading behavior of import tarball from move to copy - closes: #44 +* Fix validation of volumes specification - closes: #43 ## udocker (1.0.2) * Improve download on repositories that fail authentication on /v2 * Improve run verification of binaries with recursive symbolic links -* Improve accelerated seccomp on kernels >= 4.8.0 - * closes: #40 +* Improve accelerated seccomp on kernels >= 4.8.0 - closes: #40 ## udocker (1.0.1) @@ -364,14 +312,10 @@ * Insecure flag fixed * Address seccomp change introduced on kernels >= 4.8.0 * Utilities for packaging -* Improved verbose levels, messaging and output - * closes: #24, #23 -* Fully implement support for registry selection --registry parameter - * closes: #29 -* Provide support for private repositories e.g. gitlab registries - * closes: #30 -* Provide --insecure command line parameter for SSL requests - * closes: #31 +* Improved verbose levels, messaging and output - closes: #24, #23 +* Fully implement support for registry selection --registry parameter - closes: #29 +* Provide support for private repositories e.g. gitlab registries - closes: #30 +* Provide --insecure command line parameter for SSL requests - closes: #31 ## udocker (1.0.0) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index f92a887a..35b51670 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -130,4 +130,3 @@ For answers to common questions about this code of conduct, see the FAQ at [Mozilla CoC]: https://github.com/mozilla/diversity [FAQ]: https://www.contributor-covenant.org/faq [translations]: https://www.contributor-covenant.org/translations - diff --git a/README.md b/README.md index 15b4ad17..feb79aab 100644 --- a/README.md +++ b/README.md @@ -29,9 +29,9 @@ containers with minimal functionality. The full documentation is available at: * [udocker documentation](https://indigo-dc.github.io/udocker/) - * [Installation manual](https://indigo-dc.github.io/udocker/installation_manual.html) - * [User manual](https://indigo-dc.github.io/udocker/user_manual.html) - * [Reference card](https://indigo-dc.github.io/udocker/reference_card.html) +* [Installation manual](https://indigo-dc.github.io/udocker/installation_manual.html) +* [User manual](https://indigo-dc.github.io/udocker/user_manual.html) +* [Reference card](https://indigo-dc.github.io/udocker/reference_card.html) ## How does it work diff --git a/codemeta.json b/codemeta.json index e5c68b17..ff1105a4 100644 --- a/codemeta.json +++ b/codemeta.json @@ -6,7 +6,7 @@ "@type": "SoftwareSourceCode", "identifier": "udocker", "name": "udocker", - "version": "1.3.7", + "version": "1.3.8", "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 ade56283..4be9a7a9 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.7/udocker-1.3.7.tar.gz -tar zxvf udocker-1.3.7.tar.gz -export PATH=`pwd`/udocker-1.3.7/udocker:$PATH +wget https://github.com/indigo-dc/udocker/releases/download/1.3.8/udocker-1.3.8.tar.gz +tar zxvf udocker-1.3.8.tar.gz +export PATH=`pwd`/udocker-1.3.8/udocker:$PATH ``` Alternatively use `curl` instead of `wget` as follows: ```bash -curl -L https://github.com/indigo-dc/udocker/releases/download/1.3.7/udocker-1.3.7.tar.gz \ - > udocker-1.3.7.tar.gz -tar zxvf udocker-1.3.7.tar.gz -export PATH=`pwd`/udocker-1.3.7/udocker:$PATH +curl -L https://github.com/indigo-dc/udocker/releases/download/1.3.8/udocker-1.3.8.tar.gz \ + > udocker-1.3.8.tar.gz +tar zxvf udocker-1.3.8.tar.gz +export PATH=`pwd`/udocker-1.3.8/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.7/udocker-1.3.7.tar.gz -tar zxvf udocker-1.3.7.tar.gz +wget https://github.com/indigo-dc/udocker/releases/download/1.3.8/udocker-1.3.8.tar.gz +tar zxvf udocker-1.3.8.tar.gz ``` Directing users to the central udocker installation can be done using the diff --git a/docs/make_release.md b/docs/make_release.md index 5413d73e..73cd0758 100644 --- a/docs/make_release.md +++ b/docs/make_release.md @@ -2,11 +2,11 @@ * Verify that the version is updated. * Update the `CHANGELOG.md`. -* Prepare a PR and check jenkins pipeline are ok, then approve - * build python binary dist to upload to test pypi: ```bash +python -m build --wheel . + python setup.py sdist bdist_wheel twine upload --repository-url https://test.pypi.org/legacy/ dist/* ``` @@ -25,6 +25,8 @@ pip install udocker udocker version ``` +* Prepare a PR and check jenkins pipeline are ok, then approve + * Make an independent tarball of udocker ```bash diff --git a/docs/udocker_organ.md b/docs/udocker_organ.md index fded39c2..7d8939ac 100644 --- a/docs/udocker_organ.md +++ b/docs/udocker_organ.md @@ -10,14 +10,13 @@ dir = . * udocker.py - class Main(object): * cmdparser.py - class CmdParser(object): -* cli.py - class UdockerCLI(object): - * This is the command line implementation +* cli.py - class UdockerCLI(object): This is the command line implementation * config.py - class Config(object): * tools.py - class UdockerTools(object): * msg.py - class Msg(object): * docker.py: - * class DockerIoAPI(object): - * class DockerLocalFileAPI(object): +* class DockerIoAPI(object): +* class DockerLocalFileAPI(object): ## Directory utils @@ -29,10 +28,10 @@ dir = utils/ * chkcsum.py - class ChkSUM(object): * curl.py: - * class CurlHeader(object): - * class GetURL(object): - * class GetURLpyCurl(GetURL): - * class GetURLexeCurl(GetURL): +* class CurlHeader(object): +* class GetURL(object): +* class GetURLpyCurl(GetURL): +* class GetURLexeCurl(GetURL): ## Directory helper diff --git a/tests/unit/test_tools.py b/tests/unit/test_tools.py index bd862a78..42f13d80 100755 --- a/tests/unit/test_tools.py +++ b/tests/unit/test_tools.py @@ -189,14 +189,15 @@ def test_09__verify_version(self, mock_isfile, mock_fumktmp, self.assertEqual(status, (True, "1.2.7")) self.assertTrue(mock_furm.called) + @patch.object(UdockerTools, '_clean_install') @patch('udocker.tools.os.path.basename') @patch('udocker.tools.FileUtil') @patch('udocker.tools.os.path.isfile') - def test_10__install(self, mock_isfile, mock_futil, - mock_osbase): + def test_10__install(self, mock_isfile, mock_futil, mock_osbase, mock_cleaninstall): """Test10 UdockerTools()._install().""" tfile = "" mock_isfile.return_value = False + mock_cleaninstall.return_value = None utools = UdockerTools(self.local) status = utools._install(tfile) self.assertFalse(status) diff --git a/udocker/__init__.py b/udocker/__init__.py index 9cf7cc3b..22f0d443 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.7" +__version__ = "1.3.8" __date__ = "2023" diff --git a/udocker/config.py b/udocker/config.py index 34c20058..08772987 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.8" + conf['tarball_release'] = "1.2.9" conf['tarball'] = ( "https://download.ncg.ingrid.pt/" - "webdav/udocker/udocker-englib-1.2.8.tar.gz" + "webdav/udocker/udocker-englib-1.2.9.tar.gz" " " "https://raw.githubusercontent.com" - "/jorge-lip/udocker-builds/master/tarballs/udocker-englib-1.2.8.tar.gz" + "/jorge-lip/udocker-builds/master/tarballs/udocker-englib-1.2.9.tar.gz" ) conf['installinfo'] = [ "https://raw.githubusercontent.com/indigo-dc/udocker/master/messages", ] diff --git a/udocker/engine/runc.py b/udocker/engine/runc.py index 16298322..5d55dfe5 100644 --- a/udocker/engine/runc.py +++ b/udocker/engine/runc.py @@ -51,9 +51,6 @@ def select_runc(self): arch = HostInfo().arch() image_list = [] eng = ["runc", "crun"] - if "cgroup2" in FileUtil("/proc/filesystems").getdata('r'): - eng = ["crun", "runc"] - if arch == "amd64": image_list = [eng[0]+"-x86_64", eng[0], eng[1]+"-x86_64", eng[1]] diff --git a/udocker/tools.py b/udocker/tools.py index 5179cac2..707f6d35 100644 --- a/udocker/tools.py +++ b/udocker/tools.py @@ -171,6 +171,23 @@ def _verify_version(self, tarball_file): FileUtil(tmpdir).remove(recursive=True) return (status, tarball_version) + def _clean_install(self, tfile): + """Remove files before install""" + for tar_in in tfile.getmembers(): + basename = os.path.basename(tar_in.name) + if tar_in.name.startswith("udocker_dir/bin/"): + f_path = self.localrepo.bindir + '/' + basename + FileUtil(f_path).register_prefix() + FileUtil(f_path).remove(recursive=True) + if tar_in.name.startswith("udocker_dir/lib/"): + f_path = self.localrepo.libdir + '/' + basename + FileUtil(f_path).register_prefix() + FileUtil(f_path).remove(recursive=True) + if tar_in.name.startswith("udocker_dir/doc/"): + f_path = self.localrepo.docdir + '/' + basename + FileUtil(f_path).register_prefix() + FileUtil(f_path).remove(recursive=True) + def _install(self, tarball_file): """Install the tarball""" if not (tarball_file and os.path.isfile(tarball_file)): @@ -181,6 +198,7 @@ def _install(self, tarball_file): try: tfile = tarfile.open(tarball_file, "r:gz") FileUtil(self.localrepo.bindir).rchmod() + self._clean_install(tfile) for tar_in in tfile.getmembers(): if tar_in.name.startswith("udocker_dir/bin/"): tar_in.name = os.path.basename(tar_in.name) @@ -258,6 +276,7 @@ def _install_logic(self, force=False): def install(self, force=False): """Get the udocker tools tarball and install the binaries""" if self.is_available() and not force: + Msg().out("Info: already installed, installation skipped", l=Msg.INF) return True if not self._autoinstall and not force: diff --git a/utils/build_tarball.sh b/utils/build_tarball.sh index 9bd1a960..b2e34938 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.8" -TARBALL_VERSION_P2="1.1.8" +TARBALL_VERSION_P3="1.2.9" +TARBALL_VERSION_P2="1.1.9" sanity_check() { @@ -159,8 +159,8 @@ prepare_runc_source() return fi + git clone --depth=1 --branch v1.1.4 https://github.com/opencontainers/runc #git clone --depth=1 --branch v1.0.0-rc5 https://github.com/opencontainers/runc - git clone --depth=1 --branch v1.0.0-rc5 https://github.com/opencontainers/runc #/bin/rm -Rf $BUILD_DIR/runc/.git /bin/mv runc "$RUNC_SOURCE_DIR" } @@ -176,26 +176,32 @@ prepare_crun_source() return fi - git clone https://github.com/containers/crun - git clone https://github.com/containers/libocispec.git - git clone https://github.com/opencontainers/image-spec.git - git clone https://github.com/opencontainers/runtime-spec.git - (cd "crun"; git checkout ac41e19) - (cd "libocispec"; git checkout df96ab4041) - /bin/rmdir "crun/libocispec" - /bin/rmdir "libocispec/image-spec" - /bin/rmdir "libocispec/runtime-spec" + git clone --recursive --branch 1.6 https://github.com/containers/crun + #git clone https://github.com/containers/libocispec.git + #git clone https://github.com/opencontainers/image-spec.git + #git clone https://github.com/opencontainers/runtime-spec.git + #(cd "crun"; git checkout ac41e19) + #(cd "libocispec"; git checkout df96ab4041) + #/bin/rmdir "crun/libocispec" + #/bin/rmdir "libocispec/image-spec" + #/bin/rmdir "libocispec/runtime-spec" mv crun "$CRUN_SOURCE_DIR" - mv libocispec "$CRUN_SOURCE_DIR/" - mv image-spec "$CRUN_SOURCE_DIR/libocispec/" - mv runtime-spec "$CRUN_SOURCE_DIR/libocispec/" + #mv libocispec "$CRUN_SOURCE_DIR/" + #mv image-spec "$CRUN_SOURCE_DIR/libocispec/" + #mv runtime-spec "$CRUN_SOURCE_DIR/libocispec/" } prepare_package() { echo "prepare_package" cd "$BUILD_DIR" + 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/* + fi if [ ! -d "${PACKAGE_DIR}" ] ; then /bin/mkdir -p "${PACKAGE_DIR}" /bin/mkdir -p "${PACKAGE_DIR}/udocker_dir/bin" @@ -239,7 +245,7 @@ addto_package_other() /bin/cp -f "${REPO_DIR}/LICENSE" "${PACKAGE_DIR}/udocker_dir/doc/LICENSE.udocker" /bin/cp -f "${REPO_DIR}/README.md" "${PACKAGE_DIR}/udocker_dir/doc/" /bin/cp -f "${REPO_DIR}/CHANGELOG.md" "${PACKAGE_DIR}/udocker_dir/doc/" - /bin/cp -R "${REPO_DIR}/doc/udocker.1" "${PACKAGE_DIR}/udocker_dir/doc/" + /bin/cp -R "${REPO_DIR}/docs/udocker.1" "${PACKAGE_DIR}/udocker_dir/doc/" /bin/cp -R "${REPO_DIR}/docs/installation_manual.md" "${PACKAGE_DIR}/udocker_dir/doc/" /bin/cp -R "${REPO_DIR}/docs/reference_card.md" "${PACKAGE_DIR}/udocker_dir/doc/" /bin/cp -R "${REPO_DIR}/docs/user_manual.md" "${PACKAGE_DIR}/udocker_dir/doc/" @@ -1059,12 +1065,11 @@ fedora31_setup() /bin/mkdir -p "${OS_ROOTDIR}/proot-static-packages" /bin/mkdir -p "${OS_ROOTDIR}/etc/dnf" fedora31_create_dnf "${OS_ROOTDIR}/etc/dnf/dnf.conf" "$OS_ARCH" - echo "INSTALL AT $OS_ROOTDIR" $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 #$SUDO /usr/bin/dnf -y -c "${OS_ROOTDIR}/etc/dnf/dnf.conf" \ # downgrade --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" --forcearch="$OS_ARCH" \ @@ -1080,8 +1085,9 @@ fedora31_setup() $SUDO chown -R $(id -u):$(id -g) "$OS_ROOTDIR" PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -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 $(rpm -qa) + $PROOT -r "$OS_ROOTDIR" -0 -w / -b /dev -b /etc/resolv.conf /bin/bash <<'EOF_fedora31_reinstall' +dnf -y reinstall --releasever=31 $(rpm -qa) +dnf -y install --releasever=31 autoconf m4 gcc-c++ libstdc++-static automake gawk libtool xz EOF_fedora31_reinstall fi @@ -1327,7 +1333,6 @@ fedora32_setup() /bin/mkdir -p "${OS_ROOTDIR}/proot-static-packages" /bin/mkdir -p "${OS_ROOTDIR}/etc/dnf" fedora32_create_dnf "${OS_ROOTDIR}/etc/dnf/dnf.conf" "$OS_ARCH" - echo "INSTALL AT $OS_ROOTDIR" $SUDO /usr/bin/dnf -y -c "${OS_ROOTDIR}/etc/dnf/dnf.conf" \ install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" --forcearch="$OS_ARCH" \ @@ -1348,7 +1353,7 @@ fedora32_setup() $SUDO chown -R $(id -u):$(id -g) "$OS_ROOTDIR" PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -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' + $PROOT -r "$OS_ROOTDIR" -0 -w / -b /dev -b /etc/resolv.conf /bin/bash <<'EOF_fedora32_reinstall' dnf -y reinstall $(rpm -qa) EOF_fedora32_reinstall fi @@ -1595,7 +1600,6 @@ fedora33_setup() /bin/mkdir -p "${OS_ROOTDIR}/proot-static-packages" /bin/mkdir -p "${OS_ROOTDIR}/etc/dnf" fedora33_create_dnf "${OS_ROOTDIR}/etc/dnf/dnf.conf" "$OS_ARCH" - echo "INSTALL AT $OS_ROOTDIR" $SUDO /usr/bin/dnf -y -c "${OS_ROOTDIR}/etc/dnf/dnf.conf" \ install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" --forcearch="$OS_ARCH" \ @@ -1616,7 +1620,7 @@ fedora33_setup() $SUDO chown -R $(id -u):$(id -g) "$OS_ROOTDIR" PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -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' + $PROOT -r "$OS_ROOTDIR" -0 -w / -b /dev -b /etc/resolv.conf /bin/bash <<'EOF_fedora33_reinstall' dnf -y reinstall $(rpm -qa) EOF_fedora33_reinstall fi @@ -1863,7 +1867,6 @@ fedora34_setup() /bin/mkdir -p "${OS_ROOTDIR}/proot-static-packages" /bin/mkdir -p "${OS_ROOTDIR}/etc/dnf" fedora34_create_dnf "${OS_ROOTDIR}/etc/dnf/dnf.conf" "$OS_ARCH" - echo "INSTALL AT $OS_ROOTDIR" $SUDO /usr/bin/dnf -y -c "${OS_ROOTDIR}/etc/dnf/dnf.conf" \ install --installroot="$OS_ROOTDIR" --releasever="$OS_RELVER" --forcearch="$OS_ARCH" \ @@ -1884,7 +1887,7 @@ fedora34_setup() $SUDO chown -R $(id -u):$(id -g) "$OS_ROOTDIR" PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -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' + $PROOT -r "$OS_ROOTDIR" -0 -w / -b /dev -b /etc/resolv.conf /bin/bash <<'EOF_fedora34_reinstall' dnf -y reinstall $(rpm -qa) EOF_fedora34_reinstall fi @@ -2112,113 +2115,71 @@ EOF_fedora34_fakechroot # ############################################################################# -# CentOS 6 +# Fedora 35 # ############################################################################# -centos6_create_yum() +fedora35_create_dnf() { - echo "centos6_create_yum : $1" + echo "fedora35_create_dnf : $1" local FILENAME="$1" local ARCH="$2" - cat > "${FILENAME}" <<'EOF_centos6_yum_conf' + cat > "$FILENAME" < "${FILENAME}" <<'EOF_centos7_yum_conf' -[main] -cachedir=/var/cache/yum/$basearch/$releasever -keepcache=0 -debuglevel=2 -exactarch=1 -obsoletes=1 -gpgcheck=0 -plugins=1 -installonly_limit=5 -#logfile=/var/log/yum.log -#bugtracker_url=http://bugs.centos.org/set_project.php?project_id=19&ref=http://bugs.centos.org/bug_report_page.php?category=yum -distroverpkg=centos-release - -# PUT YOUR REPOS HERE OR IN separate files named file.repo -# in /etc/yum.repos.d -reposdir=NONE - -[base] -name=CentOS-$releasever - Base -mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra -#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/ -gpgcheck=0 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 - -#released updates -[updates] -name=CentOS-$releasever - Updates -mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra -#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/ -gpgcheck=0 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 - -#additional packages that may be useful -[extras] -name=CentOS-$releasever - Extras -mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra -#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/ -gpgcheck=0 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 - -#additional packages that extend functionality of existing packages -[centosplus] -name=CentOS-$releasever - Plus -mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus&infra=$infra -#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/ -gpgcheck=0 -enabled=0 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 - - -# EPEL - -[epel] -name=Extra Packages for Enterprise Linux 7 - $basearch -#baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch -mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch -failovermethod=priority -enabled=1 -gpgcheck=0 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 - -[epel-debuginfo] -name=Extra Packages for Enterprise Linux 7 - $basearch - Debug -#baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch/debug -mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-7&arch=$basearch -failovermethod=priority -enabled=0 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 -gpgcheck=0 -EOF_centos7_yum_conf -} - - -centos7_setup() -{ - echo "centos7_setup : $1" - local OS_ARCH="$1" - local OS_NAME="centos" - local OS_RELVER="7" - 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" - centos7_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" \ - gcc make libtalloc libtalloc-devel glibc-static glibc-devel tar python gzip zlib diffutils file - - 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 + if [ ! -e "${PROOT_SOURCE_DIR}/proot-Fedora-35.bin" ]; then + echo "proot compilation failed ${PROOT_SOURCE_DIR}/proot-Fedora-35.bin not found" + exit 1 fi - - $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" } -centos7_build_fakechroot() +fedora35_build_patchelf() { - echo "centos7_build_fakechroot : $1" + echo "fedora35_build_patchelf : $1" local OS_ARCH="$1" - local FAKECHROOT_SOURCE_DIR="$2" - local OS_NAME="centos" - local OS_RELVER="7" + local PATCHELF_SOURCE_DIR="$2" + local OS_NAME="fedora" + local OS_RELVER="35" local OS_ROOTDIR="${BUILD_DIR}/${OS_NAME}_${OS_RELVER}_${OS_ARCH}" local PROOT="" @@ -2438,313 +2369,2509 @@ centos7_build_fakechroot() exit 2 fi - if [ -x "${FAKECHROOT_SOURCE_DIR}/libfakechroot-CentOS-7.so" ] ; then - echo "fakechroot binary already compiled : ${FAKECHROOT_SOURCE_DIR}/libfakechroot-CentOS-7.so" + if [ -x "${PATCHELF_SOURCE_DIR}/patchelf-Fedora-35" ] ; then + echo "patchelf binary already compiled : ${PATCHELF_SOURCE_DIR}/patchelf-Fedora-35" return fi export PROOT_NO_SECCOMP=1 - # compile fakechroot + # compile patchelf 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_centos7_fakechroot' -cd /fakechroot -# BUILD FAKECHROOT -make distclean + (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 +make clean +# BUILD PATCHELF +#bash bootstrap.sh bash ./configure make -cp src/.libs/libfakechroot.so libfakechroot-CentOS-7.so +cp src/patchelf /patchelf/patchelf-Fedora-35 make clean -EOF_centos7_fakechroot +EOF_fedora35_patchelf set +xv } -centos7_build_proot() +fedora35_build_fakechroot() { - echo "centos7_build_proot : $1" + echo "fedora35_build_fakechroot : $1" local OS_ARCH="$1" - local PROOT_SOURCE_DIR="$2" - local OS_NAME="centos" - local OS_RELVER="7" + local FAKECHROOT_SOURCE_DIR="$2" + local OS_NAME="fedora" + local OS_RELVER="35" 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_64/proot-Fedora-30.bin" + PROOT="$BUILD_DIR/proot-source-x86/proot-Fedora-30.bin" elif [ "$OS_ARCH" = "x86_64" ]; then - #PROOT="$HOME/.udocker/bin/proot-x86_64" + #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-Fedora-35.so" ] ; then + echo "fakechroot binary already compiled : ${FAKECHROOT_SOURCE_DIR}/libfakechroot-Fedora-35.so" + return + fi + export PROOT_NO_SECCOMP=1 - if [ -x "${PROOT_SOURCE_DIR}/proot-CentOS-7.bin" ] ; then - echo "proot binary already compiled : ${PROOT_SOURCE_DIR}/proot-CentOS-7.bin" - else - # compile proot - $PROOT -r "$OS_ROOTDIR" -b "${PROOT_SOURCE_DIR}:/proot" -w / -b /dev \ - -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 -# BUILD TALLOC -tar xzvf /proot-static-packages/talloc-2.1.1.tar.gz -cd talloc-2.1.1 -make clean -./configure + # 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_fedora35_fakechroot' +cd /fakechroot +# BUILD FAKECHROOT +make distclean +bash ./configure make -cp talloc.h /proot/src -cd bin/default -ar qf libtalloc.a talloc_3.o -cp libtalloc.a /proot/src && make clean -# BUILD PROOT -cd /proot/src +cp src/.libs/libfakechroot.so libfakechroot-Fedora-35.so make clean -make loader.elf -make loader-m32.elf -make build.h -make proot -EOF_centos7_proot_1 - fi - - if [ -e "${PROOT_SOURCE_DIR}/src/proot" ]; then - mv "${PROOT_SOURCE_DIR}/src/proot" "${PROOT_SOURCE_DIR}/proot-CentOS-7.bin" - fi - - if [ ! -e "${PROOT_SOURCE_DIR}/proot-CentOS-7.bin" ]; then - echo "proot compilation failed ${PROOT_SOURCE_DIR}/proot-CentOS-7.bin not found" - exit 1 - fi +EOF_fedora35_fakechroot + set +xv } # ############################################################################# -# CentOS 8 +# Fedora 36 # ############################################################################# -centos8_create_yum() +fedora36_create_dnf() { - echo "centos8_create_yum : $1" + echo "fedora36_create_dnf : $1" local FILENAME="$1" local ARCH="$2" - cat > "${FILENAME}" <<'EOF_centos8_yum_conf' + cat > "$FILENAME" < "${FILENAME}" <<'EOF_centos6_yum_conf' +[main] +cachedir=/var/cache/yum/$basearch/$releasever +keepcache=0 +debuglevel=2 +exactarch=1 +obsoletes=1 +gpgcheck=0 +plugins=1 +installonly_limit=5 +#logfile=/var/log/yum.log +distroverpkg=centos-release + +# PUT YOUR REPOS HERE OR IN separate files named file.repo +# in /etc/yum.repos.d +reposdir=NONE + +[base] +name=CentOS-$releasever - Base +#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra +baseurl=http://vault.centos.org/centos/$releasever/os/$basearch/ +gpgcheck=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 + +#released updates +[updates] +name=CentOS-$releasever - Updates +#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra +baseurl=http://vault.centos.org/centos/$releasever/updates/$basearch/ +gpgcheck=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 + +#additional packages that may be useful +[extras] +name=CentOS-$releasever - Extras +#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra +baseurl=http://vault.centos.org/centos/$releasever/extras/$basearch/ +gpgcheck=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 + +#additional packages that extend functionality of existing packages +[centosplus] +name=CentOS-$releasever - Plus +#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus&infra=$infra +baseurl=http://vault.centos.org/centos/$releasever/centosplus/$basearch/ +gpgcheck=0 +enabled=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 + +#contrib - packages by Centos Users +[contrib] +name=CentOS-$releasever - Contrib +#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib&infra=$infra +baseurl=http://vault.centos.org/centos/$releasever/contrib/$basearch/ +gpgcheck=0 +enabled=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 + +#[base-debuginfo] +#name=CentOS-6 - Debuginfo +#baseurl=http://debuginfo.centos.org/6/$basearch/ +#gpgcheck=0 +#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-Debug-6 +#enabled=0 + +# EPEL + +[epel] +name=Extra Packages for Enterprise Linux 6 - $basearch +#baseurl=http://archives.fedoraproject.org/pub/epel/6/$basearch +baseurl=https://archives.fedoraproject.org/pub/archive/epel/6/$basearch +#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch +failovermethod=priority +enabled=1 +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6 + +#[epel-debuginfo] +#name=Extra Packages for Enterprise Linux 6 - $basearch - Debug +##baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch/debug +#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-6&arch=$basearch +#failovermethod=priority +#enabled=0 +#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6 +#gpgcheck=1 +EOF_centos6_yum_conf +} + + +centos6_setup() +{ + echo "centos6_setup : $1" + local OS_ARCH="$1" + local OS_NAME="centos" + local OS_RELVER="6" + local OS_ROOTDIR="${BUILD_DIR}/${OS_NAME}_${OS_RELVER}_${OS_ARCH}" + + if [ -x "${OS_ROOTDIR}/usr/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" + centos6_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" \ + gcc make libtalloc libtalloc-devel glibc-static glibc-devel tar python gzip zlib diffutils file + + 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" \ + clean packages + + $SUDO /bin/chown -R "$(id -u).$(id -g)" "$OS_ROOTDIR" + $SUDO /bin/chmod -R u+rw "$OS_ROOTDIR" +} + + +centos6_build_fakechroot() +{ + echo "centos6_build_fakechroot : $1" + local OS_ARCH="$1" + local FAKECHROOT_SOURCE_DIR="$2" + local OS_NAME="centos" + local OS_RELVER="6" + 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" + elif [ "$OS_ARCH" = "x86_64" ]; then + PROOT="$S_PROOT_DIR/proot-x86_64" + else + echo "unsupported $OS_NAME architecture: $OS_ARCH" + exit 2 + fi + + if [ -x "${FAKECHROOT_SOURCE_DIR}/libfakechroot-CentOS-6.so" ] ; then + echo "fakechroot binary already compiled : ${FAKECHROOT_SOURCE_DIR}/libfakechroot-CentOS-6.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_centos6_fakechroot' +cd /fakechroot +# BUILD FAKECHROOT +make distclean +bash ./configure +make +cp src/.libs/libfakechroot.so libfakechroot-CentOS-6.so +make clean +EOF_centos6_fakechroot + set +xv +} + +# ############################################################################# +# CentOS 7 +# ############################################################################# + +centos7_create_yum() +{ + echo "centos7_create_yum : $1" + local FILENAME="$1" + local ARCH="$2" + + cat > "${FILENAME}" <<'EOF_centos7_yum_conf' +[main] +cachedir=/var/cache/yum/$basearch/$releasever +keepcache=0 +debuglevel=2 +exactarch=1 +obsoletes=1 +gpgcheck=0 +plugins=1 +installonly_limit=5 +#logfile=/var/log/yum.log +#bugtracker_url=http://bugs.centos.org/set_project.php?project_id=19&ref=http://bugs.centos.org/bug_report_page.php?category=yum +distroverpkg=centos-release + +# PUT YOUR REPOS HERE OR IN separate files named file.repo +# in /etc/yum.repos.d +reposdir=NONE + +[base] +name=CentOS-$releasever - Base +mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra +#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/ +gpgcheck=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 + +#released updates +[updates] +name=CentOS-$releasever - Updates +mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra +#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/ +gpgcheck=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 + +#additional packages that may be useful +[extras] +name=CentOS-$releasever - Extras +mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra +#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/ +gpgcheck=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 + +#additional packages that extend functionality of existing packages +[centosplus] +name=CentOS-$releasever - Plus +mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus&infra=$infra +#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/ +gpgcheck=0 +enabled=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 + + +# EPEL + +[epel] +name=Extra Packages for Enterprise Linux 7 - $basearch +#baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch +mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch +failovermethod=priority +enabled=1 +gpgcheck=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 + +[epel-debuginfo] +name=Extra Packages for Enterprise Linux 7 - $basearch - Debug +#baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch/debug +mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-7&arch=$basearch +failovermethod=priority +enabled=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 +gpgcheck=0 +EOF_centos7_yum_conf +} + + +centos7_setup() +{ + echo "centos7_setup : $1" + local OS_ARCH="$1" + local OS_NAME="centos" + local OS_RELVER="7" + 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" + centos7_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" \ + gcc make libtalloc libtalloc-devel glibc-static glibc-devel tar python gzip zlib diffutils file + + 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" \ + clean packages + + $SUDO /bin/chown -R "$(id -u).$(id -g)" "$OS_ROOTDIR" + $SUDO /bin/chmod -R u+rw "$OS_ROOTDIR" +} + + +centos7_build_fakechroot() +{ + echo "centos7_build_fakechroot : $1" + local OS_ARCH="$1" + local FAKECHROOT_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" + 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-CentOS-7.so" ] ; then + echo "fakechroot binary already compiled : ${FAKECHROOT_SOURCE_DIR}/libfakechroot-CentOS-7.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_centos7_fakechroot' +cd /fakechroot +# BUILD FAKECHROOT +make distclean +bash ./configure +make +cp src/.libs/libfakechroot.so libfakechroot-CentOS-7.so +make clean +EOF_centos7_fakechroot + set +xv +} + +centos7_build_proot() +{ + echo "centos7_build_proot : $1" + local OS_ARCH="$1" + local PROOT_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="$S_PROOT_DIR/proot-x86" + PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" + elif [ "$OS_ARCH" = "x86_64" ]; then + #PROOT="$HOME/.udocker/bin/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 + + export PROOT_NO_SECCOMP=1 + + if [ -x "${PROOT_SOURCE_DIR}/proot-CentOS-7.bin" ] ; then + echo "proot binary already compiled : ${PROOT_SOURCE_DIR}/proot-CentOS-7.bin" + else + # compile proot + $PROOT -r "$OS_ROOTDIR" -b "${PROOT_SOURCE_DIR}:/proot" -w / -b /dev \ + -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 +# BUILD TALLOC +tar xzvf /proot-static-packages/talloc-2.1.1.tar.gz +cd talloc-2.1.1 +make clean +./configure +make +cp talloc.h /proot/src +cd bin/default +ar qf libtalloc.a talloc_3.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 +make proot +EOF_centos7_proot_1 + fi + + if [ -e "${PROOT_SOURCE_DIR}/src/proot" ]; then + mv "${PROOT_SOURCE_DIR}/src/proot" "${PROOT_SOURCE_DIR}/proot-CentOS-7.bin" + fi + + if [ ! -e "${PROOT_SOURCE_DIR}/proot-CentOS-7.bin" ]; then + echo "proot compilation failed ${PROOT_SOURCE_DIR}/proot-CentOS-7.bin not found" + exit 1 + fi +} + + +# ############################################################################# +# CentOS 8 *** OLD *** +# ############################################################################# + +centos8_create_yum() +{ + echo "centos8_create_yum : $1" + local FILENAME="$1" + local ARCH="$2" + + cat > "${FILENAME}" <<'EOF_centos8_yum_conf' +[main] +cachedir=/var/cache/yum/$basearch/$releasever +keepcache=0 +debuglevel=2 +exactarch=1 +obsoletes=1 +gpgcheck=0 +plugins=1 +installonly_limit=5 +distroverpkg=centos-release + +# PUT YOUR REPOS HERE OR IN separate files named file.repo +# in /etc/yum.repos.d +reposdir=NONE + + +[AppStream] +name=CentOS-$releasever - AppStream +mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=AppStream&infra=$infra +#baseurl=http://mirror.centos.org/$contentdir/$releasever/AppStream/$basearch/os/ +gpgcheck=0 +enabled=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial + +[BaseOS] +name=CentOS-$releasever - Base +mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=BaseOS&infra=$infra +#baseurl=http://mirror.centos.org/$contentdir/$releasever/BaseOS/$basearch/os/ +gpgcheck=0 +enabled=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial + +[cr] +name=CentOS-$releasever - cr +baseurl=http://mirror.centos.org/$contentdir/$releasever/cr/$basearch/os/ +gpgcheck=0 +enabled=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial + +[extras] +name=CentOS-$releasever - Extras +mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra +#baseurl=http://mirror.centos.org/$contentdir/$releasever/extras/$basearch/os/ +gpgcheck=0 +enabled=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial + +[c8-media-BaseOS] +name=CentOS-BaseOS-$releasever - Media +baseurl=file:///media/CentOS/BaseOS + file:///media/cdrom/BaseOS + file:///media/cdrecorder/BaseOS +gpgcheck=0 +enabled=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial + +[c8-media-AppStream] +name=CentOS-AppStream-$releasever - Media +baseurl=file:///media/CentOS/AppStream + file:///media/cdrom/AppStream + file:///media/cdrecorder/AppStream +gpgcheck=1 +enabled=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial + +[PowerTools] +name=CentOS-$releasever - PowerTools +mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=PowerTools&infra=$infra +#baseurl=http://mirror.centos.org/$contentdir/$releasever/PowerTools/$basearch/os/ +gpgcheck=0 +enabled=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial + +[centosplus] +name=CentOS-$releasever - Plus +mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus&infra=$infra +#baseurl=http://mirror.centos.org/$contentdir/$releasever/centosplus/$basearch/os/ +gpgcheck=0 +enabled=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial + +[fasttrack] +name=CentOS-$releasever - fasttrack +mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=fasttrack&infra=$infra +#baseurl=http://mirror.centos.org/$contentdir/$releasever/fasttrack/$basearch/os/ +gpgcheck=0 +enabled=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial + + +############################################################# + +[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-8 + +[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-8 +EOF_centos8_yum_conf +} + + +centos8_setup() +{ + echo "centos8_setup : $1" + local OS_ARCH="$1" + local OS_NAME="centos" + local OS_RELVER="8" + 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" + 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 + + 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" \ + clean packages + + $SUDO /bin/chown -R "$(id -u).$(id -g)" "$OS_ROOTDIR" + $SUDO /bin/chmod -R u+rw "$OS_ROOTDIR" +} + + +centos8_build_fakechroot() +{ + echo "centos8_build_fakechroot : $1" + local OS_ARCH="$1" + local FAKECHROOT_SOURCE_DIR="$2" + local OS_NAME="centos" + local OS_RELVER="8" + 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" = "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-CentOS-8.so" ] ; then + echo "fakechroot binary already compiled : ${FAKECHROOT_SOURCE_DIR}/libfakechroot-CentOS-8.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_centos8_fakechroot' +cd /fakechroot +# BUILD FAKECHROOT +make distclean +bash ./configure +make +cp src/.libs/libfakechroot.so libfakechroot-CentOS-8.so +make clean +EOF_centos8_fakechroot + set +xv +} + + +# ############################################################################# +# CentOS 8 *** Stream *** +# ############################################################################# + +centos_stream8_create_yum() +{ + echo "centos_stream8_create_yum : $1" + local FILENAME="$1" + local ARCH="$2" + + cat > "${FILENAME}" <<'EOF_centos_stream8_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=CentOS Stream $releasever - AppStream +mirrorlist=http://mirrorlist.centos.org/?release=8-stream&arch=$basearch&repo=AppStream&infra=$infra +#baseurl=http://mirror.centos.org/$contentdir/$stream/AppStream/$basearch/os/ +gpgcheck=0 +enabled=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial + +[baseos] +name=CentOS Stream $releasever - BaseOS +mirrorlist=http://mirrorlist.centos.org/?release=8-stream&arch=$basearch&repo=BaseOS&infra=$infra +#baseurl=http://mirror.centos.org/$contentdir/$stream/BaseOS/$basearch/os/ +gpgcheck=0 +enabled=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial + +[extras-common] +name=CentOS Stream $releasever - Extras common packages +mirrorlist=http://mirrorlist.centos.org/?release=8-stream&arch=$basearch&repo=extras-extras-common +#baseurl=http://mirror.centos.org/$contentdir/$stream/extras/$basearch/extras-common/ +gpgcheck=0 +enabled=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Extras + +[extras] +name=CentOS Stream $releasever - Extras +mirrorlist=http://mirrorlist.centos.org/?release=8-stream&arch=$basearch&repo=extras&infra=$infra +#baseurl=http://mirror.centos.org/$contentdir/$stream/extras/$basearch/os/ +gpgcheck=0 +enabled=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial + +[ha] +name=CentOS Stream $releasever - HighAvailability +mirrorlist=http://mirrorlist.centos.org/?release=8-stream&arch=$basearch&repo=HighAvailability&infra=$infra +#baseurl=http://mirror.centos.org/$contentdir/$stream/HighAvailability/$basearch/os/ +gpgcheck=0 +enabled=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial + +[media-baseos] +name=CentOS Stream $releasever - Media - BaseOS +baseurl=file:///media/CentOS/BaseOS + file:///media/cdrom/BaseOS + file:///media/cdrecorder/BaseOS +gpgcheck=0 +enabled=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial + +[media-appstream] +name=CentOS Stream $releasever - Media - AppStream +baseurl=file:///media/CentOS/AppStream + file:///media/cdrom/AppStream + file:///media/cdrecorder/AppStream +gpgcheck=0 +enabled=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial + +[nfv] +name=CentOS Stream $releasever - NFV +mirrorlist=http://mirrorlist.centos.org/?release=8-stream&arch=$basearch&repo=NFV&infra=$infra +#baseurl=http://mirror.centos.org/$contentdir/$stream/NFV/$basearch/os/ +gpgcheck=0 +enabled=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial + +[powertools] +name=CentOS Stream $releasever - PowerTools +mirrorlist=http://mirrorlist.centos.org/?release=8-stream&arch=$basearch&repo=PowerTools&infra=$infra +#baseurl=http://mirror.centos.org/$contentdir/$stream/PowerTools/$basearch/os/ +gpgcheck=0 +enabled=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial + +[rt] +name=CentOS Stream $releasever - RealTime +mirrorlist=http://mirrorlist.centos.org/?release=8-stream&arch=$basearch&repo=RT&infra=$infra +#baseurl=http://mirror.centos.org/$contentdir/$stream/RT/$basearch/os/ +gpgcheck=0 +enabled=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial + +[resilientstorage] +name=CentOS Stream $releasever - ResilientStorage +mirrorlist=http://mirrorlist.centos.org/?release=8-stream&arch=$basearch&repo=ResilientStorage&infra=$infra +#baseurl=http://mirror.centos.org/$contentdir/$stream/ResilientStorage/$basearch/os/ +gpgcheck=0 +enabled=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial + +############################################################# + +[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-8 + +[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-8 +EOF_centos_stream8_yum_conf +} + + +centos_stream8_setup() +{ + echo "centos_stream8_setup : $1" + local OS_ARCH="$1" + local OS_NAME="centos" + local OS_RELVER="8" + 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" + 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 + + 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" \ + clean packages + + $SUDO /bin/chown -R "$(id -u).$(id -g)" "$OS_ROOTDIR" + $SUDO /bin/chmod -R u+rw "$OS_ROOTDIR" +} + + +centos_stream8_build_fakechroot() +{ + echo "centos_stream8_build_fakechroot : $1" + local OS_ARCH="$1" + local FAKECHROOT_SOURCE_DIR="$2" + local OS_NAME="centos" + local OS_RELVER="8" + 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" = "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-CentOS-8.so" ] ; then + echo "fakechroot binary already compiled : ${FAKECHROOT_SOURCE_DIR}/libfakechroot-CentOS-8.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_centos_stream8_fakechroot' +cd /fakechroot +# BUILD FAKECHROOT +make distclean +bash ./configure +make +cp src/.libs/libfakechroot.so libfakechroot-CentOS-8.so +make clean +EOF_centos_stream8_fakechroot + set +xv +} + + +# ############################################################################# +# CentOS 9 *** Stream *** +# ############################################################################# + +centos_stream9_create_yum() +{ + echo "centos_stream9_create_yum : $1" + local FILENAME="$1" + local ARCH="$2" + + cat > "${FILENAME}" <<'EOF_centos_stream9_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 + +[highavailability] +name=CentOS Stream $releasever - HighAvailability +metalink=https://mirrors.centos.org/metalink?repo=centos-highavailability-9-stream&arch=$basearch&protocol=https,http +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial +gpgcheck=0 +repo_gpgcheck=0 +metadata_expire=6h +countme=1 +enabled=0 + +[nfv] +name=CentOS Stream $releasever - NFV +metalink=https://mirrors.centos.org/metalink?repo=centos-nfv-9-stream&arch=$basearch&protocol=https,http +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial +gpgcheck=0 +repo_gpgcheck=0 +metadata_expire=6h +countme=1 +enabled=0 + +[rt] +name=CentOS Stream $releasever - RT +metalink=https://mirrors.centos.org/metalink?repo=centos-rt-9-stream&arch=$basearch&protocol=https,http +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial +gpgcheck=0 +repo_gpgcheck=0 +metadata_expire=6h +countme=1 +enabled=0 + +[resilientstorage] +name=CentOS Stream $releasever - ResilientStorage +metalink=https://mirrors.centos.org/metalink?repo=centos-resilientstorage-9-stream&arch=$basearch&protocol=https,http +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial +gpgcheck=0 +repo_gpgcheck=0 +metadata_expire=6h +countme=1 +enabled=0 + +[extras-common] +name=CentOS Stream $releasever - Extras packages +metalink=https://mirrors.centos.org/metalink?repo=centos-extras-sig-extras-common-9-stream&arch=$basearch&protocol=https,http +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Extras-SHA512 +gpgcheck=0 +repo_gpgcheck=0 +metadata_expire=6h +countme=1 +enabled=1 + +[baseos] +name=CentOS Stream $releasever - BaseOS +metalink=https://mirrors.centos.org/metalink?repo=centos-baseos-9-stream&arch=$basearch&protocol=https,http +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial +gpgcheck=0 +repo_gpgcheck=0 +metadata_expire=6h +countme=1 +enabled=1 + +[appstream] +name=CentOS Stream $releasever - AppStream +metalink=https://mirrors.centos.org/metalink?repo=centos-appstream-9-stream&arch=$basearch&protocol=https,http +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial +gpgcheck=0 +repo_gpgcheck=0 +metadata_expire=6h +countme=1 +enabled=1 + +[crb] +name=CentOS Stream $releasever - CRB +metalink=https://mirrors.centos.org/metalink?repo=centos-crb-9-stream&arch=$basearch&protocol=https,http +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial +gpgcheck=0 +repo_gpgcheck=0 +metadata_expire=6h +countme=1 +enabled=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_centos_stream9_yum_conf +} + + +centos_stream9_setup() +{ + echo "centos_stream9_setup : $1" + local OS_ARCH="$1" + local OS_NAME="centos" + 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" + 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 + + 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" \ + clean packages + + $SUDO /bin/chown -R "$(id -u).$(id -g)" "$OS_ROOTDIR" + $SUDO /bin/chmod -R u+rw "$OS_ROOTDIR" +} + + +centos_stream9_build_fakechroot() +{ + echo "centos_stream9_build_fakechroot : $1" + local OS_ARCH="$1" + local FAKECHROOT_SOURCE_DIR="$2" + local OS_NAME="centos" + 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" + 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-CentOS-9.so" ] ; then + echo "fakechroot binary already compiled : ${FAKECHROOT_SOURCE_DIR}/libfakechroot-CentOS-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_centos_stream9_fakechroot' +cd /fakechroot +# BUILD FAKECHROOT +make distclean +bash ./configure +make +cp src/.libs/libfakechroot.so libfakechroot-CentOS-9.so +make clean +EOF_centos_stream9_fakechroot + set +xv +} + + +# ############################################################################# +# Rocky 8 +# ############################################################################# + +rocky8_create_yum() +{ + echo "rocky8_create_yum : $1" + local FILENAME="$1" + local ARCH="$2" + + cat > "${FILENAME}" <<'EOF_rocky8_yum_conf' +[main] +cachedir=/var/cache/yum/$basearch/$releasever +keepcache=0 +debuglevel=2 +exactarch=1 +obsoletes=1 +gpgcheck=0 +plugins=1 +installonly_limit=5 +distroverpkg=centos-release + +# PUT YOUR REPOS HERE OR IN separate files named file.repo +# in /etc/yum.repos.d +reposdir=NONE + +[appstream] +name=Rocky Linux $releasever - AppStream +mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=AppStream-$releasever +#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/AppStream/$basearch/os/ +gpgcheck=0 +enabled=1 +countme=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial + +[baseos] +name=Rocky Linux $releasever - BaseOS +mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=BaseOS-$releasever +#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/BaseOS/$basearch/os/ +gpgcheck=0 +enabled=1 +countme=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial + +[extras] +name=Rocky Linux $releasever - Extras +mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=extras-$releasever +#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/extras/$basearch/os/ +gpgcheck=0 +enabled=1 +countme=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial + +[ha] +name=Rocky Linux $releasever - HighAvailability +mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=HighAvailability-$releasever +#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/HighAvailability/$basearch/os/ +gpgcheck=0 +enabled=0 +countme=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial + +[media-baseos] +name=Rocky Linux $releasever - Media - BaseOS +baseurl=file:///media/Rocky/BaseOS + file:///media/cdrom/BaseOS + file:///media/cdrecorder/BaseOS +gpgcheck=0 +enabled=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial + +[media-appstream] +name=Rocky Linux $releasever - Media - AppStream +baseurl=file:///media/Rocky/AppStream + file:///media/cdrom/AppStream + file:///media/cdrecorder/AppStream +gpgcheck=0 +enabled=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial + +[nfv] +name=Rocky Linux $releasever - NFV +mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=NFV-$releasever +#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/nfv/$basearch/os/ +gpgcheck=0 +enabled=0 +countme=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial + +[plus] +name=Rocky Linux $releasever - Plus +mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=rockyplus-$releasever +#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/plus/$basearch/os/ +gpgcheck=0 +enabled=0 +countme=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial + +[powertools] +name=Rocky Linux $releasever - PowerTools +mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=PowerTools-$releasever +#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/PowerTools/$basearch/os/ +gpgcheck=0 +enabled=0 +countme=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial + +[resilient-storage] +name=Rocky Linux $releasever - ResilientStorage +mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=ResilientStorage-$releasever +#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/ResilientStorage/$basearch/os/ +gpgcheck=0 +enabled=0 +countme=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial + +[rt] +name=Rocky Linux $releasever - Realtime +mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=RT-$releasever +#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/RT/$basearch/os/ +gpgcheck=0 +enabled=0 +countme=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial + + +############################################################# + +[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-8 + +[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-8 +EOF_rocky8_yum_conf +} + + +rocky8_setup() +{ + echo "rocky8_setup : $1" + local OS_ARCH="$1" + local OS_NAME="rocky" + local OS_RELVER="8" + 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" + 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 + + 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" \ + clean packages + + $SUDO /bin/chown -R "$(id -u).$(id -g)" "$OS_ROOTDIR" + $SUDO /bin/chmod -R u+rw "$OS_ROOTDIR" +} + + +rocky8_build_fakechroot() +{ + echo "rocky8_build_fakechroot : $1" + local OS_ARCH="$1" + local FAKECHROOT_SOURCE_DIR="$2" + local OS_NAME="rocky" + local OS_RELVER="8" + 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" = "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-Rocky-8.so" ] ; then + echo "fakechroot binary already compiled : ${FAKECHROOT_SOURCE_DIR}/libfakechroot-Rocky-8.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_rocky8_fakechroot' +cd /fakechroot +# BUILD FAKECHROOT +make distclean +bash ./configure +make +cp src/.libs/libfakechroot.so libfakechroot-Rocky-8.so +make clean +EOF_rocky8_fakechroot + set +xv +} + + + +# ############################################################################# +# Rocky 9 +# ############################################################################# + +rocky9_create_yum() +{ + echo "rocky9_create_yum : $1" + local FILENAME="$1" + local ARCH="$2" + + cat > "${FILENAME}" <<'EOF_rocky9_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 + + +[highavailability] +name=Rocky Linux $releasever - High Availability +mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=HighAvailability-$releasever +#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/HighAvailability/$basearch/os/ +gpgcheck=0 +enabled=0 +countme=1 +metadata_expire=6h +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9 + +[resilientstorage] +name=Rocky Linux $releasever - Resilient Storage +mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=ResilientStorage-$releasever +#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/ResilientStorage/$basearch/os/ +gpgcheck=0 +enabled=0 +countme=1 +metadata_expire=6h +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9 + +[nfv] +name=Rocky Linux $releasever - NFV +mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=NFV-$releasever +#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/NFV/$basearch/os/ +gpgcheck=0 +enabled=0 +countme=1 +metadata_expire=6h +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9 + +[rt] +name=Rocky Linux $releasever - Realtime +mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=RT-$releasever +#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/RT/$basearch/os/ +gpgcheck=0 +enabled=0 +countme=1 +metadata_expire=6h +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9 + +[sap] +name=Rocky Linux $releasever - SAP +mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=SAP-$releasever +#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/SAP/$basearch/os/ +gpgcheck=0 +enabled=0 +countme=1 +metadata_expire=6h +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9 + +[saphana] +name=Rocky Linux $releasever - SAPHANA +mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=SAPHANA-$releasever +#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/SAPHANA/$basearch/os/ +gpgcheck=0 +enabled=0 +countme=1 +metadata_expire=6h +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9 + +[devel] +name=Rocky Linux $releasever - Devel WARNING! FOR BUILDROOT ONLY DO NOT LEAVE ENABLED +mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=devel-$releasever +#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/devel/$basearch/os/ +gpgcheck=0 +enabled=0 +countme=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9 + +[extras] +name=Rocky Linux $releasever - Extras +mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=extras-$releasever +#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/extras/$basearch/os/ +gpgcheck=0 +enabled=1 +countme=1 +metadata_expire=6h +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9 + +[plus] +name=Rocky Linux $releasever - Plus +mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=rockyplus-$releasever +#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/plus/$basearch/os/ +gpgcheck=0 +enabled=0 +countme=1 +metadata_expire=6h +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9 + +[baseos] +name=Rocky Linux $releasever - BaseOS +mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=BaseOS-$releasever +#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/BaseOS/$basearch/os/ +gpgcheck=0 +enabled=1 +countme=1 +metadata_expire=6h +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9 + +[appstream] +name=Rocky Linux $releasever - AppStream +mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=AppStream-$releasever +#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/AppStream/$basearch/os/ +gpgcheck=0 +enabled=1 +countme=1 +metadata_expire=6h +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9 + +[crb] +name=Rocky Linux $releasever - CRB +mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=CRB-$releasever +#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/CRB/$basearch/os/ +gpgcheck=0 +enabled=0 +countme=1 +metadata_expire=6h +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9 + + +############################################################# + +[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_rocky9_yum_conf +} + + +rocky9_setup() +{ + echo "rocky9_setup : $1" + local OS_ARCH="$1" + local OS_NAME="rocky" + 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" + 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 \ + dnf rpm dnf-data gcc make libtalloc libtalloc-devel glibc-devel tar python3 python2 gzip zlib diffutils file +set +v + + 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" \ + clean packages + + $SUDO /bin/chown -R "$(id -u).$(id -g)" "$OS_ROOTDIR" + $SUDO /bin/chmod -R u+rw "$OS_ROOTDIR" +} + + +rocky9_build_fakechroot() +{ + echo "rocky9_build_fakechroot : $1" + local OS_ARCH="$1" + local FAKECHROOT_SOURCE_DIR="$2" + local OS_NAME="rocky" + 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" + 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-Rocky-9.so" ] ; then + echo "fakechroot binary already compiled : ${FAKECHROOT_SOURCE_DIR}/libfakechroot-Rocky-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_rocky9_fakechroot' +cd /fakechroot +# BUILD FAKECHROOT +make distclean +bash ./configure +make +cp src/.libs/libfakechroot.so libfakechroot-Rocky-9.so +make clean +EOF_rocky9_fakechroot + set +xv +} + + + +# ############################################################################# +# Alma 9 +# ############################################################################# + +alma9_create_yum() +{ + echo "alma9_create_yum : $1" + local FILENAME="$1" + local ARCH="$2" + + 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=CentOS-$releasever - Extras -mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra -#baseurl=http://mirror.centos.org/$contentdir/$releasever/extras/$basearch/os/ +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 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial +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" + +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 + + 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" \ + 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" + 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-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 -[c8-media-BaseOS] -name=CentOS-BaseOS-$releasever - Media -baseurl=file:///media/CentOS/BaseOS - file:///media/cdrom/BaseOS - file:///media/cdrecorder/BaseOS -gpgcheck=0 -enabled=0 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial + SUDO=sudo -[c8-media-AppStream] -name=CentOS-AppStream-$releasever - Media -baseurl=file:///media/CentOS/AppStream - file:///media/cdrom/AppStream - file:///media/cdrecorder/AppStream -gpgcheck=1 -enabled=0 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial + $SUDO debootstrap --no-check-gpg --arch=$OS_ARCH --variant=buildd \ + precise $OS_ROOTDIR http://old-releases.ubuntu.com/ubuntu/ -[PowerTools] -name=CentOS-$releasever - PowerTools -mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=PowerTools&infra=$infra -#baseurl=http://mirror.centos.org/$contentdir/$releasever/PowerTools/$basearch/os/ -gpgcheck=0 -enabled=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial + $SUDO /bin/chown -R "$(id -u).$(id -g)" "$OS_ROOTDIR" + $SUDO /bin/chmod -R u+rw "$OS_ROOTDIR" +} -[centosplus] -name=CentOS-$releasever - Plus -mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus&infra=$infra -#baseurl=http://mirror.centos.org/$contentdir/$releasever/centosplus/$basearch/os/ -gpgcheck=0 -enabled=0 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial +ubuntu12_build_fakechroot() +{ + echo "ubuntu12_build_fakechroot : $1" + local OS_ARCH="$1" + local FAKECHROOT_SOURCE_DIR="$2" + local OS_NAME="ubuntu" + local OS_RELVER="12" + local OS_ROOTDIR="${BUILD_DIR}/${OS_NAME}_${OS_RELVER}_${OS_ARCH}" + local PROOT="" -[fasttrack] -name=CentOS-$releasever - fasttrack -mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=fasttrack&infra=$infra -#baseurl=http://mirror.centos.org/$contentdir/$releasever/fasttrack/$basearch/os/ -gpgcheck=0 -enabled=0 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial + if [ "$OS_ARCH" = "i386" ]; then + #PROOT="$S_PROOT_DIR/proot-x86 -q qemu-i386" + PROOT="$S_PROOT_DIR/proot-x86" + elif [ "$OS_ARCH" = "amd64" ]; then + PROOT="$S_PROOT_DIR/proot-x86_64" + else + echo "unsupported $OS_NAME architecture: $OS_ARCH" + exit 2 + fi + if [ -x "${FAKECHROOT_SOURCE_DIR}/libfakechroot-Ubuntu-12.so" ] ; then + echo "fakechroot binary already compiled : ${FAKECHROOT_SOURCE_DIR}/libfakechroot-Ubuntu-12.so" + return + fi -############################################################# + export PROOT_NO_SECCOMP=1 -[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-8 + # compile fakechroot + set -xv + 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_ubuntu12_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_ubuntu12_packages -[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-8 -EOF_centos8_yum_conf + 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_ubuntu12_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-12.so +make clean +EOF_ubuntu12_fakechroot + set +xv } -centos8_setup() +# ############################################################################# +# Ubuntu 14.04 +# ############################################################################# + +ubuntu14_setup() { - echo "centos8_setup : $1" + echo "ubuntu14_setup : $1" local OS_ARCH="$1" - local OS_NAME="centos" - local OS_RELVER="8" + local OS_NAME="ubuntu" + local OS_RELVER="14" local OS_ROOTDIR="${BUILD_DIR}/${OS_NAME}_${OS_RELVER}_${OS_ARCH}" - if [ -x "${OS_ROOTDIR}/bin/gcc" ] ; then + if [ -x "${OS_ROOTDIR}/usr/lib/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" - centos8_create_yum "${OS_ROOTDIR}/etc/yum.conf" "$OS_ARCH" + $SUDO debootstrap --arch=$OS_ARCH --variant=buildd trusty $OS_ROOTDIR http://archive.ubuntu.com/ubuntu/ - $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 + $SUDO /bin/chown -R "$(id -u).$(id -g)" "$OS_ROOTDIR" + $SUDO /bin/chmod -R u+rw "$OS_ROOTDIR" +} - 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 +ubuntu14_build_fakechroot() +{ + echo "ubuntu14_build_fakechroot : $1" + local OS_ARCH="$1" + local FAKECHROOT_SOURCE_DIR="$2" + local OS_NAME="ubuntu" + local OS_RELVER="14" + 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" + elif [ "$OS_ARCH" = "amd64" ]; then + PROOT="$S_PROOT_DIR/proot-x86_64" + else + echo "unsupported $OS_NAME architecture: $OS_ARCH" + exit 2 fi - $SUDO /usr/bin/yum -y -c "${OS_ROOTDIR}/etc/yum.conf" \ - clean packages + if [ -x "${FAKECHROOT_SOURCE_DIR}/libfakechroot-Ubuntu-14.so" ] ; then + echo "fakechroot binary already compiled : ${FAKECHROOT_SOURCE_DIR}/libfakechroot-Ubuntu-14.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_ubuntu14_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_ubuntu14_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_ubuntu14_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-14.so +make clean +EOF_ubuntu14_fakechroot + set +xv +} + +# ############################################################################# +# Ubuntu 16.04 +# ############################################################################# + +ubuntu16_setup() +{ + echo "ubuntu16_setup : $1" + local OS_ARCH="$1" + local OS_NAME="ubuntu" + local OS_RELVER="16" + 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 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" } +ubuntu16_build_fakechroot() +{ + echo "ubuntu16_build_fakechroot : $1" + local OS_ARCH="$1" + local FAKECHROOT_SOURCE_DIR="$2" + local OS_NAME="ubuntu" + local OS_RELVER="16" + 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" + elif [ "$OS_ARCH" = "amd64" ]; then + PROOT="$S_PROOT_DIR/proot-x86_64" + else + echo "unsupported $OS_NAME architecture: $OS_ARCH" + exit 2 + fi + + if [ -x "${FAKECHROOT_SOURCE_DIR}/libfakechroot-Ubuntu-16.so" ] ; then + echo "fakechroot binary already compiled : ${FAKECHROOT_SOURCE_DIR}/libfakechroot-Ubuntu-16.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_ubuntu16_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_ubuntu16_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_ubuntu16_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-16.so +make clean +EOF_ubuntu16_fakechroot + set +xv +} -centos8_build_fakechroot() +ubuntu16_build_runc() { - echo "centos8_build_fakechroot : $1" + echo "ubuntu16_build_runc : $1" local OS_ARCH="$1" - local FAKECHROOT_SOURCE_DIR="$2" - local OS_NAME="centos" - local OS_RELVER="8" + local RUNC_SOURCE_DIR="$2" + local OS_NAME="ubuntu" + local OS_RELVER="16" 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" = "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" + elif [ "$OS_ARCH" = "amd64" ]; then + PROOT="$S_PROOT_DIR/proot-x86_64" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 fi - if [ -x "${FAKECHROOT_SOURCE_DIR}/libfakechroot-CentOS-8.so" ] ; then - echo "fakechroot binary already compiled : ${FAKECHROOT_SOURCE_DIR}/libfakechroot-CentOS-8.so" + if [ -x "${RUNC_SOURCE_DIR}/runc" ] ; then + echo "runc binary already compiled : ${RUNC_SOURCE_DIR}/runc" return fi export PROOT_NO_SECCOMP=1 - # compile fakechroot + # 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 \ - $PROOT -r "$OS_ROOTDIR" -b "${FAKECHROOT_SOURCE_DIR}:/fakechroot" -w / -b /dev \ - /bin/bash <<'EOF_centos8_fakechroot' -cd /fakechroot -# BUILD FAKECHROOT -make distclean -bash ./configure -make -cp src/.libs/libfakechroot.so libfakechroot-CentOS-8.so -make clean -EOF_centos8_fakechroot + 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_ubuntu16_runc' +apt-get -y update +apt-get -y install golang libseccomp-dev git +export GOPATH=/go +cd /go/src/github.com/opencontainers/runc +make static +EOF_ubuntu16_runc + set +xv } - # ############################################################################# -# Ubuntu 12.04 +# Ubuntu 18.04 # ############################################################################# -ubuntu12_setup() +ubuntu18_setup() { - echo "ubuntu12_setup : $1" + echo "ubuntu18_setup : $1" local OS_ARCH="$1" local OS_NAME="ubuntu" - local OS_RELVER="12" + local OS_RELVER="18" local OS_ROOTDIR="${BUILD_DIR}/${OS_NAME}_${OS_RELVER}_${OS_ARCH}" if [ -x "${OS_ROOTDIR}/usr/lib/gcc" ] ; then @@ -2754,20 +4881,19 @@ ubuntu12_setup() SUDO=sudo - $SUDO debootstrap --no-check-gpg --arch=$OS_ARCH --variant=buildd \ - precise $OS_ROOTDIR http://old-releases.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" } -ubuntu12_build_fakechroot() +ubuntu18_build_fakechroot() { - echo "ubuntu12_build_fakechroot : $1" + echo "ubuntu18_build_fakechroot : $1" local OS_ARCH="$1" local FAKECHROOT_SOURCE_DIR="$2" local OS_NAME="ubuntu" - local OS_RELVER="12" + local OS_RELVER="18" local OS_ROOTDIR="${BUILD_DIR}/${OS_NAME}_${OS_RELVER}_${OS_ARCH}" local PROOT="" @@ -2781,8 +4907,8 @@ ubuntu12_build_fakechroot() exit 2 fi - if [ -x "${FAKECHROOT_SOURCE_DIR}/libfakechroot-Ubuntu-12.so" ] ; then - echo "fakechroot binary already compiled : ${FAKECHROOT_SOURCE_DIR}/libfakechroot-Ubuntu-12.so" + if [ -x "${FAKECHROOT_SOURCE_DIR}/libfakechroot-Ubuntu-18.so" ] ; then + echo "fakechroot binary already compiled : ${FAKECHROOT_SOURCE_DIR}/libfakechroot-Ubuntu-18.so" return fi @@ -2790,18 +4916,20 @@ ubuntu12_build_fakechroot() # compile fakechroot set -xv - 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_ubuntu12_packages' + 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_ubuntu18_packages' apt-get -y update -apt-get -y --no-install-recommends install wget debconf devscripts gnupg nano +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_ubuntu12_packages +EOF_ubuntu18_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_ubuntu12_fakechroot' + /bin/bash <<'EOF_ubuntu18_fakechroot' # BUILD FAKECHROOT export SHELL=/bin/bash export CONFIG_SHELL=/bin/bash @@ -2810,23 +4938,73 @@ cd /fakechroot make distclean bash ./configure make -cp src/.libs/libfakechroot.so libfakechroot-Ubuntu-12.so +cp src/.libs/libfakechroot.so libfakechroot-Ubuntu-18.so make clean -EOF_ubuntu12_fakechroot +EOF_ubuntu18_fakechroot + set +xv +} + +ubuntu18_build_runc() +{ + echo "ubuntu18_build_runc : $1" + local OS_ARCH="$1" + local RUNC_SOURCE_DIR="$2" + local OS_NAME="ubuntu" + local OS_RELVER="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="$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_ubuntu18_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_ubuntu18_runc + set +xv } # ############################################################################# -# Ubuntu 14.04 +# Ubuntu 19.10 # ############################################################################# -ubuntu14_setup() +ubuntu19_setup() { - echo "ubuntu14_setup : $1" + echo "ubuntu19_setup : $1" local OS_ARCH="$1" local OS_NAME="ubuntu" - local OS_RELVER="14" + local OS_RELVER="19" local OS_ROOTDIR="${BUILD_DIR}/${OS_NAME}_${OS_RELVER}_${OS_ARCH}" if [ -x "${OS_ROOTDIR}/usr/lib/gcc" ] ; then @@ -2836,34 +5014,37 @@ 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 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" } -ubuntu14_build_fakechroot() +ubuntu19_build_fakechroot() { - echo "ubuntu14_build_fakechroot : $1" + echo "ubuntu19_build_fakechroot : $1" local OS_ARCH="$1" local FAKECHROOT_SOURCE_DIR="$2" local OS_NAME="ubuntu" - local OS_RELVER="14" + local OS_RELVER="19" 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="$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="$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-14.so" ] ; then - echo "fakechroot binary already compiled : ${FAKECHROOT_SOURCE_DIR}/libfakechroot-Ubuntu-14.so" + if [ -x "${FAKECHROOT_SOURCE_DIR}/libfakechroot-Ubuntu-19.so" ] ; then + echo "fakechroot binary already compiled : ${FAKECHROOT_SOURCE_DIR}/libfakechroot-Ubuntu-19.so" return fi @@ -2874,17 +5055,17 @@ ubuntu14_build_fakechroot() 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_ubuntu14_packages' + -b /etc/resolv.conf:/etc/resolv.conf /bin/bash <<'EOF_ubuntu19_packages' apt-get -y update -apt-get -y --no-install-recommends install wget debconf devscripts gnupg nano +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_ubuntu14_packages +EOF_ubuntu19_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_ubuntu14_fakechroot' + /bin/bash <<'EOF_ubuntu19_fakechroot' # BUILD FAKECHROOT export SHELL=/bin/bash export CONFIG_SHELL=/bin/bash @@ -2893,22 +5074,73 @@ cd /fakechroot make distclean bash ./configure make -cp src/.libs/libfakechroot.so libfakechroot-Ubuntu-14.so +cp src/.libs/libfakechroot.so libfakechroot-Ubuntu-19.so make clean -EOF_ubuntu14_fakechroot +EOF_ubuntu19_fakechroot + set +xv +} + +ubuntu19_build_runc() +{ + echo "ubuntu19_build_runc : $1" + local OS_ARCH="$1" + local RUNC_SOURCE_DIR="$2" + local OS_NAME="ubuntu" + local OS_RELVER="19" + 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_ubuntu19_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_ubuntu19_runc + set +xv } + # ############################################################################# -# Ubuntu 16.04 +# Ubuntu 20.04 # ############################################################################# -ubuntu16_setup() +ubuntu20_setup() { - echo "ubuntu16_setup : $1" + echo "ubuntu20_setup : $1" local OS_ARCH="$1" local OS_NAME="ubuntu" - local OS_RELVER="16" + local OS_RELVER="20" local OS_ROOTDIR="${BUILD_DIR}/${OS_NAME}_${OS_RELVER}_${OS_ARCH}" if [ -x "${OS_ROOTDIR}/usr/lib/gcc" ] ; then @@ -2918,34 +5150,37 @@ 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 focal $OS_ROOTDIR http://archive.ubuntu.com/ubuntu/ + #$SUDO debootstrap --arch=$OS_ARCH --variant=buildd eoan $OS_ROOTDIR http://de.mirrors.clouvider.net/ubuntu/ $SUDO /bin/chown -R "$(id -u).$(id -g)" "$OS_ROOTDIR" $SUDO /bin/chmod -R u+rw "$OS_ROOTDIR" } -ubuntu16_build_fakechroot() +ubuntu20_build_fakechroot() { - echo "ubuntu16_build_fakechroot : $1" + echo "ubuntu20_build_fakechroot : $1" local OS_ARCH="$1" local FAKECHROOT_SOURCE_DIR="$2" local OS_NAME="ubuntu" - local OS_RELVER="16" + local OS_RELVER="20" 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="$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="$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-16.so" ] ; then - echo "fakechroot binary already compiled : ${FAKECHROOT_SOURCE_DIR}/libfakechroot-Ubuntu-16.so" + if [ -x "${FAKECHROOT_SOURCE_DIR}/libfakechroot-Ubuntu-20.so" ] ; then + echo "fakechroot binary already compiled : ${FAKECHROOT_SOURCE_DIR}/libfakechroot-Ubuntu-20.so" return fi @@ -2956,17 +5191,17 @@ ubuntu16_build_fakechroot() 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_ubuntu16_packages' + -b /etc/resolv.conf:/etc/resolv.conf /bin/bash <<'EOF_ubuntu20_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_ubuntu16_packages +EOF_ubuntu20_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_ubuntu16_fakechroot' + /bin/bash <<'EOF_ubuntu20_fakechroot' # BUILD FAKECHROOT export SHELL=/bin/bash export CONFIG_SHELL=/bin/bash @@ -2975,27 +5210,28 @@ cd /fakechroot make distclean bash ./configure make -cp src/.libs/libfakechroot.so libfakechroot-Ubuntu-16.so +cp src/.libs/libfakechroot.so libfakechroot-Ubuntu-20.so make clean -EOF_ubuntu16_fakechroot +EOF_ubuntu20_fakechroot set +xv } -ubuntu16_build_runc() +ubuntu20_build_runc() { - echo "ubuntu16_build_runc : $1" + echo "ubuntu20_build_runc : $1" local OS_ARCH="$1" local RUNC_SOURCE_DIR="$2" local OS_NAME="ubuntu" - local OS_RELVER="16" + local OS_RELVER="20" 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="$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 @@ -3013,27 +5249,34 @@ ubuntu16_build_runc() 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_ubuntu16_runc' + -b /etc/resolv.conf:/etc/resolv.conf /bin/bash <<'EOF_ubuntu20_runc' apt-get -y update -apt-get -y install golang libseccomp-dev git +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_ubuntu16_runc +EOF_ubuntu20_runc set +xv } + # ############################################################################# -# Ubuntu 18.04 +# Ubuntu 21.04 # ############################################################################# -ubuntu18_setup() +ubuntu21_setup() { - echo "ubuntu18_setup : $1" + echo "ubuntu21_setup : $1" local OS_ARCH="$1" local OS_NAME="ubuntu" - local OS_RELVER="18" + local OS_RELVER="21" local OS_ROOTDIR="${BUILD_DIR}/${OS_NAME}_${OS_RELVER}_${OS_ARCH}" if [ -x "${OS_ROOTDIR}/usr/lib/gcc" ] ; then @@ -3043,34 +5286,36 @@ 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 hirsute $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" } -ubuntu18_build_fakechroot() +ubuntu21_build_fakechroot() { - echo "ubuntu18_build_fakechroot : $1" + echo "ubuntu21_build_fakechroot : $1" local OS_ARCH="$1" local FAKECHROOT_SOURCE_DIR="$2" local OS_NAME="ubuntu" - local OS_RELVER="18" + local OS_RELVER="21" 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="$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="$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-18.so" ] ; then - echo "fakechroot binary already compiled : ${FAKECHROOT_SOURCE_DIR}/libfakechroot-Ubuntu-18.so" + if [ -x "${FAKECHROOT_SOURCE_DIR}/libfakechroot-Ubuntu-21.so" ] ; then + echo "fakechroot binary already compiled : ${FAKECHROOT_SOURCE_DIR}/libfakechroot-Ubuntu-21.so" return fi @@ -3081,17 +5326,17 @@ ubuntu18_build_fakechroot() 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_ubuntu18_packages' + -b /etc/resolv.conf:/etc/resolv.conf /bin/bash <<'EOF_ubuntu21_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_ubuntu18_packages +EOF_ubuntu21_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_ubuntu18_fakechroot' + /bin/bash <<'EOF_ubuntu21_fakechroot' # BUILD FAKECHROOT export SHELL=/bin/bash export CONFIG_SHELL=/bin/bash @@ -3100,19 +5345,19 @@ cd /fakechroot make distclean bash ./configure make -cp src/.libs/libfakechroot.so libfakechroot-Ubuntu-18.so +cp src/.libs/libfakechroot.so libfakechroot-Ubuntu-21.so make clean -EOF_ubuntu18_fakechroot +EOF_ubuntu21_fakechroot set +xv } -ubuntu18_build_runc() +ubuntu21_build_runc() { - echo "ubuntu18_build_runc : $1" + echo "ubuntu21_build_runc : $1" local OS_ARCH="$1" local RUNC_SOURCE_DIR="$2" local OS_NAME="ubuntu" - local OS_RELVER="18" + local OS_RELVER="21" local OS_ROOTDIR="${BUILD_DIR}/${OS_NAME}_${OS_RELVER}_${OS_ARCH}" local PROOT="" @@ -3139,7 +5384,7 @@ ubuntu18_build_runc() 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_ubuntu18_runc' + -b /etc/resolv.conf:/etc/resolv.conf /bin/bash <<'EOF_ubuntu21_runc' apt-get -y update apt-get -y install golang libseccomp-dev git software-properties-common add-apt-repository ppa:gophers/archive @@ -3151,22 +5396,22 @@ export PATH=$GOPATH/bin:$GOROOT/bin:$PATH go get github.com/sirupsen/logrus cd /go/src/github.com/opencontainers/runc make static -EOF_ubuntu18_runc +EOF_ubuntu21_runc set +xv } # ############################################################################# -# Ubuntu 19.10 +# Ubuntu 22.04 # ############################################################################# -ubuntu19_setup() +ubuntu22_setup() { - echo "ubuntu19_setup : $1" + echo "ubuntu22_setup : $1" local OS_ARCH="$1" local OS_NAME="ubuntu" - local OS_RELVER="19" + local OS_RELVER="22" local OS_ROOTDIR="${BUILD_DIR}/${OS_NAME}_${OS_RELVER}_${OS_ARCH}" if [ -x "${OS_ROOTDIR}/usr/lib/gcc" ] ; then @@ -3176,20 +5421,19 @@ 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 jammy $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" } -ubuntu19_build_fakechroot() +ubuntu22_build_fakechroot() { - echo "ubuntu19_build_fakechroot : $1" + echo "ubuntu22_build_fakechroot : $1" local OS_ARCH="$1" local FAKECHROOT_SOURCE_DIR="$2" local OS_NAME="ubuntu" - local OS_RELVER="19" + local OS_RELVER="22" local OS_ROOTDIR="${BUILD_DIR}/${OS_NAME}_${OS_RELVER}_${OS_ARCH}" local PROOT="" @@ -3205,8 +5449,8 @@ ubuntu19_build_fakechroot() exit 2 fi - if [ -x "${FAKECHROOT_SOURCE_DIR}/libfakechroot-Ubuntu-19.so" ] ; then - echo "fakechroot binary already compiled : ${FAKECHROOT_SOURCE_DIR}/libfakechroot-Ubuntu-19.so" + if [ -x "${FAKECHROOT_SOURCE_DIR}/libfakechroot-Ubuntu-22.so" ] ; then + echo "fakechroot binary already compiled : ${FAKECHROOT_SOURCE_DIR}/libfakechroot-Ubuntu-22.so" return fi @@ -3217,17 +5461,17 @@ ubuntu19_build_fakechroot() 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_ubuntu19_packages' + -b /etc/resolv.conf:/etc/resolv.conf /bin/bash <<'EOF_ubuntu22_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_ubuntu19_packages +EOF_ubuntu22_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_ubuntu19_fakechroot' + /bin/bash <<'EOF_ubuntu22_fakechroot' # BUILD FAKECHROOT export SHELL=/bin/bash export CONFIG_SHELL=/bin/bash @@ -3236,19 +5480,19 @@ cd /fakechroot make distclean bash ./configure make -cp src/.libs/libfakechroot.so libfakechroot-Ubuntu-19.so +cp src/.libs/libfakechroot.so libfakechroot-Ubuntu-22.so make clean -EOF_ubuntu19_fakechroot +EOF_ubuntu22_fakechroot set +xv } -ubuntu19_build_runc() +ubuntu22_build_runc() { - echo "ubuntu19_build_runc : $1" + echo "ubuntu22_build_runc : $1" local OS_ARCH="$1" local RUNC_SOURCE_DIR="$2" local OS_NAME="ubuntu" - local OS_RELVER="19" + local OS_RELVER="22" local OS_ROOTDIR="${BUILD_DIR}/${OS_NAME}_${OS_RELVER}_${OS_ARCH}" local PROOT="" @@ -3275,74 +5519,200 @@ ubuntu19_build_runc() 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_ubuntu19_runc' + -b /etc/resolv.conf:/etc/resolv.conf /bin/bash <<'EOF_ubuntu22_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 +#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_ubuntu19_runc +EOF_ubuntu22_runc set +xv } + # ############################################################################# -# Ubuntu 20.04 +# Alpine 3.6.x # ############################################################################# -ubuntu20_setup() +alpine36_setup() { - echo "ubuntu20_setup : $1" + echo "alpine36_setup : $1" + local ALPINE_MIRROR="http://dl-5.alpinelinux.org/alpine" + local APK_TOOLS="apk-tools-static-2.7.6-r0.apk" + local APK_TOOLS_DIR="${BUILD_DIR}/apk-tools-2.7.6-r0" local OS_ARCH="$1" - local OS_NAME="ubuntu" - local OS_RELVER="20" + local OS_NAME="alpine" + local OS_RELVER="v3.6" local OS_ROOTDIR="${BUILD_DIR}/${OS_NAME}_${OS_RELVER}_${OS_ARCH}" - if [ -x "${OS_ROOTDIR}/usr/lib/gcc" ] ; then + 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 - $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/ + $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 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 +} + +alpine36_build_fakechroot() +{ + echo "alpine36_build_fakechroot : $1" + local OS_ARCH="$1" + local FAKECHROOT_SOURCE_DIR="$2" + local OS_NAME="alpine" + local OS_RELVER="v3.6" + 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" + elif [ "$OS_ARCH" = "x86_64" ]; then + PROOT="$S_PROOT_DIR/proot-x86_64" + else + echo "unsupported $OS_NAME architecture: $OS_ARCH" + exit 2 + fi + + if [ -x "${FAKECHROOT_SOURCE_DIR}/libfakechroot-Alpine-3.6.so" ] ; then + echo "fakechroot binary already compiled : ${FAKECHROOT_SOURCE_DIR}/libfakechroot-Alpine-3.6.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_alpine36_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.6.so +make clean +EOF_alpine36_fakechroot + set +xv +} + +# ############################################################################# +# Alpine 3.8.x +# ############################################################################# + +alpine38_setup() +{ + echo "alpine38_setup : $1" + local ALPINE_MIRROR="http://dl-5.alpinelinux.org/alpine" + local APK_TOOLS="apk-tools-static-2.10.6-r0.apk" + local APK_TOOLS_DIR="${BUILD_DIR}/apk-tools-2.10.6-r0" + local OS_ARCH="$1" + local OS_NAME="alpine" + local OS_RELVER="v3.8" + 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 + + $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 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" + $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 } -ubuntu20_build_fakechroot() +alpine38_build_fakechroot() { - echo "ubuntu20_build_fakechroot : $1" + echo "alpine38_build_fakechroot : $1" local OS_ARCH="$1" local FAKECHROOT_SOURCE_DIR="$2" - local OS_NAME="ubuntu" - local OS_RELVER="20" + local OS_NAME="alpine" + local OS_RELVER="v3.8" 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" + PROOT="$S_PROOT_DIR/proot-x86" + elif [ "$OS_ARCH" = "x86_64" ]; then + PROOT="$S_PROOT_DIR/proot-x86_64" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 fi - if [ -x "${FAKECHROOT_SOURCE_DIR}/libfakechroot-Ubuntu-20.so" ] ; then - echo "fakechroot binary already compiled : ${FAKECHROOT_SOURCE_DIR}/libfakechroot-Ubuntu-20.so" + if [ -x "${FAKECHROOT_SOURCE_DIR}/libfakechroot-Alpine-3.8.so" ] ; then + echo "fakechroot binary already compiled : ${FAKECHROOT_SOURCE_DIR}/libfakechroot-Alpine-3.8.so" return fi @@ -3350,20 +5720,10 @@ ubuntu20_build_fakechroot() # 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_ubuntu20_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_ubuntu20_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_ubuntu20_fakechroot' + /bin/bash <<'EOF_alpine38_fakechroot' # BUILD FAKECHROOT export SHELL=/bin/bash export CONFIG_SHELL=/bin/bash @@ -3372,112 +5732,87 @@ cd /fakechroot make distclean bash ./configure make -cp src/.libs/libfakechroot.so libfakechroot-Ubuntu-20.so +cp src/.libs/libfakechroot.so libfakechroot-Alpine-3.8.so make clean -EOF_ubuntu20_fakechroot - set +xv -} - -ubuntu20_build_runc() -{ - echo "ubuntu20_build_runc : $1" - local OS_ARCH="$1" - local RUNC_SOURCE_DIR="$2" - local OS_NAME="ubuntu" - local OS_RELVER="20" - 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_ubuntu20_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_ubuntu20_runc - +EOF_alpine38_fakechroot set +xv } - # ############################################################################# -# Ubuntu 21.04 +# Alpine 3.9.x # ############################################################################# -ubuntu21_setup() +alpine39_setup() { - echo "ubuntu21_setup : $1" + echo "alpine39_setup : $1" + local ALPINE_MIRROR="http://dl-5.alpinelinux.org/alpine" + local APK_TOOLS="apk-tools-static-2.10.6-r0.apk" + local APK_TOOLS_DIR="${BUILD_DIR}/apk-tools-2.10.6-r0" local OS_ARCH="$1" - local OS_NAME="ubuntu" - local OS_RELVER="21" + local OS_NAME="alpine" + local OS_RELVER="v3.9" local OS_ROOTDIR="${BUILD_DIR}/${OS_NAME}_${OS_RELVER}_${OS_ARCH}" - if [ -x "${OS_ROOTDIR}/usr/lib/gcc" ] ; then + 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 - $SUDO debootstrap --arch=$OS_ARCH --variant=buildd hirsute $OS_ROOTDIR http://archive.ubuntu.com/ubuntu/ + $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 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" + $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 } -ubuntu21_build_fakechroot() +alpine39_build_fakechroot() { - echo "ubuntu21_build_fakechroot : $1" + echo "alpine39_build_fakechroot : $1" local OS_ARCH="$1" local FAKECHROOT_SOURCE_DIR="$2" - local OS_NAME="ubuntu" - local OS_RELVER="21" + local OS_NAME="alpine" + local OS_RELVER="v3.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="$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" + PROOT="$S_PROOT_DIR/proot-x86" + elif [ "$OS_ARCH" = "x86_64" ]; then + PROOT="$S_PROOT_DIR/proot-x86_64" else echo "unsupported $OS_NAME architecture: $OS_ARCH" exit 2 fi - if [ -x "${FAKECHROOT_SOURCE_DIR}/libfakechroot-Ubuntu-21.so" ] ; then - echo "fakechroot binary already compiled : ${FAKECHROOT_SOURCE_DIR}/libfakechroot-Ubuntu-21.so" + if [ -x "${FAKECHROOT_SOURCE_DIR}/libfakechroot-Alpine-3.9.so" ] ; then + echo "fakechroot binary already compiled : ${FAKECHROOT_SOURCE_DIR}/libfakechroot-Alpine-3.9.so" return fi @@ -3485,20 +5820,10 @@ ubuntu21_build_fakechroot() # 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_ubuntu21_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_ubuntu21_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_ubuntu21_fakechroot' + /bin/bash <<'EOF_alpine39_fakechroot' # BUILD FAKECHROOT export SHELL=/bin/bash export CONFIG_SHELL=/bin/bash @@ -3507,76 +5832,26 @@ cd /fakechroot make distclean bash ./configure make -cp src/.libs/libfakechroot.so libfakechroot-Ubuntu-21.so +cp src/.libs/libfakechroot.so libfakechroot-Alpine-3.9.so make clean -EOF_ubuntu21_fakechroot - set +xv -} - -ubuntu21_build_runc() -{ - echo "ubuntu21_build_runc : $1" - local OS_ARCH="$1" - local RUNC_SOURCE_DIR="$2" - local OS_NAME="ubuntu" - local OS_RELVER="21" - 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_ubuntu21_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_ubuntu21_runc - +EOF_alpine39_fakechroot set +xv } # ############################################################################# -# Alpine 3.6.x +# Alpine 3.10.x # ############################################################################# -alpine36_setup() +alpine310_setup() { - echo "alpine36_setup : $1" + echo "alpine310_setup : $1" local ALPINE_MIRROR="http://dl-5.alpinelinux.org/alpine" - local APK_TOOLS="apk-tools-static-2.7.6-r0.apk" - local APK_TOOLS_DIR=${BUILD_DIR}/apk-tools + local APK_TOOLS="apk-tools-static-2.10.8-r0.apk" + local APK_TOOLS_DIR="${BUILD_DIR}/apk-tools-2.10.8-r0" local OS_ARCH="$1" local OS_NAME="alpine" - local OS_RELVER="v3.6" + local OS_RELVER="v3.10" local OS_ROOTDIR="${BUILD_DIR}/${OS_NAME}_${OS_RELVER}_${OS_ARCH}" if [ -x "${OS_ROOTDIR}/etc/alpine-release" ] ; then @@ -3617,13 +5892,13 @@ alpine36_setup() /bin/echo "$ALPINE_MIRROR/$OS_RELVER/main" > ${OS_ROOTDIR}/etc/apk/repositories } -alpine36_build_fakechroot() +alpine310_build_fakechroot() { - echo "alpine_build_fakechroot : $1" + echo "alpine310_build_fakechroot : $1" local OS_ARCH="$1" local FAKECHROOT_SOURCE_DIR="$2" local OS_NAME="alpine" - local OS_RELVER="v3.6" + local OS_RELVER="v3.10" local OS_ROOTDIR="${BUILD_DIR}/${OS_NAME}_${OS_RELVER}_${OS_ARCH}" local PROOT="" @@ -3637,8 +5912,8 @@ alpine36_build_fakechroot() exit 2 fi - if [ -x "${FAKECHROOT_SOURCE_DIR}/libfakechroot-Alpine-3.6.so" ] ; then - echo "fakechroot binary already compiled : ${FAKECHROOT_SOURCE_DIR}/libfakechroot-Alpine-3.6.so" + if [ -x "${FAKECHROOT_SOURCE_DIR}/libfakechroot-Alpine-3.10.so" ] ; then + echo "fakechroot binary already compiled : ${FAKECHROOT_SOURCE_DIR}/libfakechroot-Alpine-3.10.so" return fi @@ -3649,7 +5924,7 @@ alpine36_build_fakechroot() 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_alpine36_fakechroot' + /bin/bash <<'EOF_alpine310_fakechroot' # BUILD FAKECHROOT export SHELL=/bin/bash export CONFIG_SHELL=/bin/bash @@ -3658,25 +5933,26 @@ cd /fakechroot make distclean bash ./configure make -cp src/.libs/libfakechroot.so libfakechroot-Alpine-3.6.so +cp src/.libs/libfakechroot.so libfakechroot-Alpine-3.10.so make clean -EOF_alpine36_fakechroot +EOF_alpine310_fakechroot set +xv } + # ############################################################################# -# Alpine 3.8.x +# Alpine 3.11.x # ############################################################################# -alpine38_setup() +alpine311_setup() { - echo "alpine38_setup : $1" + echo "alpine311_setup : $1" local ALPINE_MIRROR="http://dl-5.alpinelinux.org/alpine" - local APK_TOOLS="apk-tools-static-2.10.1-r0.apk" - local APK_TOOLS_DIR=${BUILD_DIR}/apk-tools + local APK_TOOLS="apk-tools-static-2.10.8-r0.apk" + local APK_TOOLS_DIR="${BUILD_DIR}/apk-tools-2.10.8-r0" local OS_ARCH="$1" local OS_NAME="alpine" - local OS_RELVER="v3.8" + local OS_RELVER="v3.11" local OS_ROOTDIR="${BUILD_DIR}/${OS_NAME}_${OS_RELVER}_${OS_ARCH}" if [ -x "${OS_ROOTDIR}/etc/alpine-release" ] ; then @@ -3717,13 +5993,13 @@ alpine38_setup() /bin/echo "$ALPINE_MIRROR/$OS_RELVER/main" > ${OS_ROOTDIR}/etc/apk/repositories } -alpine38_build_fakechroot() +alpine311_build_fakechroot() { - echo "alpine_build_fakechroot : $1" + echo "alpine311_build_fakechroot : $1" local OS_ARCH="$1" local FAKECHROOT_SOURCE_DIR="$2" local OS_NAME="alpine" - local OS_RELVER="v3.8" + local OS_RELVER="v3.11" local OS_ROOTDIR="${BUILD_DIR}/${OS_NAME}_${OS_RELVER}_${OS_ARCH}" local PROOT="" @@ -3737,8 +6013,8 @@ alpine38_build_fakechroot() exit 2 fi - if [ -x "${FAKECHROOT_SOURCE_DIR}/libfakechroot-Alpine-3.8.so" ] ; then - echo "fakechroot binary already compiled : ${FAKECHROOT_SOURCE_DIR}/libfakechroot-Alpine-3.8.so" + if [ -x "${FAKECHROOT_SOURCE_DIR}/libfakechroot-Alpine-3.11.so" ] ; then + echo "fakechroot binary already compiled : ${FAKECHROOT_SOURCE_DIR}/libfakechroot-Alpine-3.11.so" return fi @@ -3749,7 +6025,7 @@ alpine38_build_fakechroot() 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_alpine38_fakechroot' + /bin/bash <<'EOF_alpine311_fakechroot' # BUILD FAKECHROOT export SHELL=/bin/bash export CONFIG_SHELL=/bin/bash @@ -3758,25 +6034,26 @@ cd /fakechroot make distclean bash ./configure make -cp src/.libs/libfakechroot.so libfakechroot-Alpine-3.8.so +cp src/.libs/libfakechroot.so libfakechroot-Alpine-3.11.so make clean -EOF_alpine38_fakechroot +EOF_alpine311_fakechroot set +xv } + # ############################################################################# -# Alpine 3.9.x +# Alpine 3.12.x # ############################################################################# -alpine39_setup() +alpine312_setup() { - echo "alpine39_setup : $1" + echo "alpine312_setup : $1" local ALPINE_MIRROR="http://dl-5.alpinelinux.org/alpine" - local APK_TOOLS="apk-tools-static-2.10.1-r0.apk" - local APK_TOOLS_DIR=${BUILD_DIR}/apk-tools + local APK_TOOLS="apk-tools-static-2.10.8-r0.apk" + local APK_TOOLS_DIR="${BUILD_DIR}/apk-tools-2.10.8-r0" local OS_ARCH="$1" local OS_NAME="alpine" - local OS_RELVER="v3.9" + local OS_RELVER="v3.12" local OS_ROOTDIR="${BUILD_DIR}/${OS_NAME}_${OS_RELVER}_${OS_ARCH}" if [ -x "${OS_ROOTDIR}/etc/alpine-release" ] ; then @@ -3817,13 +6094,13 @@ alpine39_setup() /bin/echo "$ALPINE_MIRROR/$OS_RELVER/main" > ${OS_ROOTDIR}/etc/apk/repositories } -alpine39_build_fakechroot() +alpine312_build_fakechroot() { - echo "alpine_build_fakechroot : $1" + echo "alpine312_build_fakechroot : $1" local OS_ARCH="$1" local FAKECHROOT_SOURCE_DIR="$2" local OS_NAME="alpine" - local OS_RELVER="v3.9" + local OS_RELVER="v3.12" local OS_ROOTDIR="${BUILD_DIR}/${OS_NAME}_${OS_RELVER}_${OS_ARCH}" local PROOT="" @@ -3837,8 +6114,8 @@ alpine39_build_fakechroot() exit 2 fi - if [ -x "${FAKECHROOT_SOURCE_DIR}/libfakechroot-Alpine-3.9.so" ] ; then - echo "fakechroot binary already compiled : ${FAKECHROOT_SOURCE_DIR}/libfakechroot-Alpine-3.9.so" + if [ -x "${FAKECHROOT_SOURCE_DIR}/libfakechroot-Alpine-3.12.so" ] ; then + echo "fakechroot binary already compiled : ${FAKECHROOT_SOURCE_DIR}/libfakechroot-Alpine-3.12.so" return fi @@ -3849,7 +6126,7 @@ alpine39_build_fakechroot() 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_alpine39_fakechroot' + /bin/bash <<'EOF_alpine312_fakechroot' # BUILD FAKECHROOT export SHELL=/bin/bash export CONFIG_SHELL=/bin/bash @@ -3858,26 +6135,26 @@ cd /fakechroot make distclean bash ./configure make -cp src/.libs/libfakechroot.so libfakechroot-Alpine-3.9.so +cp src/.libs/libfakechroot.so libfakechroot-Alpine-3.12.so make clean -EOF_alpine39_fakechroot +EOF_alpine312_fakechroot set +xv } # ############################################################################# -# Alpine 3.10.x +# Alpine 3.13.x # ############################################################################# -alpine310_setup() +alpine313_setup() { - echo "alpine310_setup : $1" + echo "alpine313_setup : $1" local ALPINE_MIRROR="http://dl-5.alpinelinux.org/alpine" - local APK_TOOLS="apk-tools-static-2.10.1-r0.apk" - local APK_TOOLS_DIR=${BUILD_DIR}/apk-tools + local APK_TOOLS="apk-tools-static-2.12.7-r0.apk" + local APK_TOOLS_DIR="${BUILD_DIR}/apk-tools-2.12.7-r0" local OS_ARCH="$1" local OS_NAME="alpine" - local OS_RELVER="v3.10" + local OS_RELVER="v3.13" local OS_ROOTDIR="${BUILD_DIR}/${OS_NAME}_${OS_RELVER}_${OS_ARCH}" if [ -x "${OS_ROOTDIR}/etc/alpine-release" ] ; then @@ -3918,13 +6195,13 @@ alpine310_setup() /bin/echo "$ALPINE_MIRROR/$OS_RELVER/main" > ${OS_ROOTDIR}/etc/apk/repositories } -alpine310_build_fakechroot() +alpine313_build_fakechroot() { - echo "alpine_build_fakechroot : $1" + echo "alpine313_build_fakechroot : $1" local OS_ARCH="$1" local FAKECHROOT_SOURCE_DIR="$2" local OS_NAME="alpine" - local OS_RELVER="v3.10" + local OS_RELVER="v3.13" local OS_ROOTDIR="${BUILD_DIR}/${OS_NAME}_${OS_RELVER}_${OS_ARCH}" local PROOT="" @@ -3938,8 +6215,8 @@ alpine310_build_fakechroot() exit 2 fi - if [ -x "${FAKECHROOT_SOURCE_DIR}/libfakechroot-Alpine-3.10.so" ] ; then - echo "fakechroot binary already compiled : ${FAKECHROOT_SOURCE_DIR}/libfakechroot-Alpine-3.10.so" + if [ -x "${FAKECHROOT_SOURCE_DIR}/libfakechroot-Alpine-3.13.so" ] ; then + echo "fakechroot binary already compiled : ${FAKECHROOT_SOURCE_DIR}/libfakechroot-Alpine-3.13.so" return fi @@ -3950,7 +6227,7 @@ alpine310_build_fakechroot() 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_alpine310_fakechroot' + /bin/bash <<'EOF_alpine313_fakechroot' # BUILD FAKECHROOT export SHELL=/bin/bash export CONFIG_SHELL=/bin/bash @@ -3959,26 +6236,26 @@ cd /fakechroot make distclean bash ./configure make -cp src/.libs/libfakechroot.so libfakechroot-Alpine-3.10.so +cp src/.libs/libfakechroot.so libfakechroot-Alpine-3.13.so make clean -EOF_alpine310_fakechroot +EOF_alpine313_fakechroot set +xv } # ############################################################################# -# Alpine 3.11.x +# Alpine 3.14.x # ############################################################################# -alpine311_setup() +alpine314_setup() { - echo "alpine311_setup : $1" + echo "alpine314_setup : $1" local ALPINE_MIRROR="http://dl-5.alpinelinux.org/alpine" - local APK_TOOLS="apk-tools-static-2.10.1-r0.apk" - local APK_TOOLS_DIR=${BUILD_DIR}/apk-tools + local APK_TOOLS="apk-tools-static-2.12.7-r0.apk" + local APK_TOOLS_DIR="${BUILD_DIR}/apk-tools-2.12.7-r0" local OS_ARCH="$1" local OS_NAME="alpine" - local OS_RELVER="v3.11" + local OS_RELVER="v3.14" local OS_ROOTDIR="${BUILD_DIR}/${OS_NAME}_${OS_RELVER}_${OS_ARCH}" if [ -x "${OS_ROOTDIR}/etc/alpine-release" ] ; then @@ -4019,28 +6296,30 @@ alpine311_setup() /bin/echo "$ALPINE_MIRROR/$OS_RELVER/main" > ${OS_ROOTDIR}/etc/apk/repositories } -alpine311_build_fakechroot() +alpine314_build_fakechroot() { - echo "alpine_build_fakechroot : $1" + echo "alpine314_build_fakechroot : $1" local OS_ARCH="$1" local FAKECHROOT_SOURCE_DIR="$2" local OS_NAME="alpine" - local OS_RELVER="v3.11" + local OS_RELVER="v3.14" 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="$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="$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.11.so" ] ; then - echo "fakechroot binary already compiled : ${FAKECHROOT_SOURCE_DIR}/libfakechroot-Alpine-3.11.so" + if [ -x "${FAKECHROOT_SOURCE_DIR}/libfakechroot-Alpine-3.14.so" ] ; then + echo "fakechroot binary already compiled : ${FAKECHROOT_SOURCE_DIR}/libfakechroot-Alpine-3.14.so" return fi @@ -4051,7 +6330,7 @@ alpine311_build_fakechroot() 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_alpine311_fakechroot' + /bin/bash <<'EOF_alpine314_fakechroot' # BUILD FAKECHROOT export SHELL=/bin/bash export CONFIG_SHELL=/bin/bash @@ -4060,26 +6339,26 @@ cd /fakechroot make distclean bash ./configure make -cp src/.libs/libfakechroot.so libfakechroot-Alpine-3.11.so +cp src/.libs/libfakechroot.so libfakechroot-Alpine-3.14.so make clean -EOF_alpine311_fakechroot +EOF_alpine314_fakechroot set +xv } # ############################################################################# -# Alpine 3.12.x +# Alpine 3.15.x # ############################################################################# -alpine312_setup() +alpine315_setup() { - echo "alpine312_setup : $1" + echo "alpine315_setup : $1" local ALPINE_MIRROR="http://dl-5.alpinelinux.org/alpine" - local APK_TOOLS="apk-tools-static-2.10.1-r0.apk" - local APK_TOOLS_DIR=${BUILD_DIR}/apk-tools + local APK_TOOLS="apk-tools-static-2.12.7-r3.apk" + local APK_TOOLS_DIR="${BUILD_DIR}/apk-tools-2.12.7-r3" local OS_ARCH="$1" local OS_NAME="alpine" - local OS_RELVER="v3.12" + local OS_RELVER="v3.15" local OS_ROOTDIR="${BUILD_DIR}/${OS_NAME}_${OS_RELVER}_${OS_ARCH}" if [ -x "${OS_ROOTDIR}/etc/alpine-release" ] ; then @@ -4120,28 +6399,30 @@ alpine312_setup() /bin/echo "$ALPINE_MIRROR/$OS_RELVER/main" > ${OS_ROOTDIR}/etc/apk/repositories } -alpine312_build_fakechroot() +alpine315_build_fakechroot() { - echo "alpine_build_fakechroot : $1" + echo "alpine315_build_fakechroot : $1" local OS_ARCH="$1" local FAKECHROOT_SOURCE_DIR="$2" local OS_NAME="alpine" - local OS_RELVER="v3.12" + local OS_RELVER="v3.15" 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="$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="$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.12.so" ] ; then - echo "fakechroot binary already compiled : ${FAKECHROOT_SOURCE_DIR}/libfakechroot-Alpine-3.12.so" + if [ -x "${FAKECHROOT_SOURCE_DIR}/libfakechroot-Alpine-3.15.so" ] ; then + echo "fakechroot binary already compiled : ${FAKECHROOT_SOURCE_DIR}/libfakechroot-Alpine-3.15.so" return fi @@ -4152,7 +6433,7 @@ alpine312_build_fakechroot() 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_alpine312_fakechroot' + /bin/bash <<'EOF_alpine315_fakechroot' # BUILD FAKECHROOT export SHELL=/bin/bash export CONFIG_SHELL=/bin/bash @@ -4161,26 +6442,26 @@ cd /fakechroot make distclean bash ./configure make -cp src/.libs/libfakechroot.so libfakechroot-Alpine-3.12.so +cp src/.libs/libfakechroot.so libfakechroot-Alpine-3.15.so make clean -EOF_alpine312_fakechroot +EOF_alpine315_fakechroot set +xv } # ############################################################################# -# Alpine 3.13.x +# Alpine 3.16.x # ############################################################################# -alpine313_setup() +alpine316_setup() { - echo "alpine313_setup : $1" + echo "alpine316_setup : $1" local ALPINE_MIRROR="http://dl-5.alpinelinux.org/alpine" - local APK_TOOLS="apk-tools-static-2.12.5-r0.apk" - local APK_TOOLS_DIR=${BUILD_DIR}/apk-tools-2.12 + 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.13" + local OS_RELVER="v3.16" local OS_ROOTDIR="${BUILD_DIR}/${OS_NAME}_${OS_RELVER}_${OS_ARCH}" if [ -x "${OS_ROOTDIR}/etc/alpine-release" ] ; then @@ -4221,28 +6502,30 @@ alpine313_setup() /bin/echo "$ALPINE_MIRROR/$OS_RELVER/main" > ${OS_ROOTDIR}/etc/apk/repositories } -alpine313_build_fakechroot() +alpine316_build_fakechroot() { - echo "alpine_build_fakechroot : $1" + echo "alpine316_build_fakechroot : $1" local OS_ARCH="$1" local FAKECHROOT_SOURCE_DIR="$2" local OS_NAME="alpine" - local OS_RELVER="v3.13" + local OS_RELVER="v3.16" 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="$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="$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.13.so" ] ; then - echo "fakechroot binary already compiled : ${FAKECHROOT_SOURCE_DIR}/libfakechroot-Alpine-3.13.so" + if [ -x "${FAKECHROOT_SOURCE_DIR}/libfakechroot-Alpine-3.16.so" ] ; then + echo "fakechroot binary already compiled : ${FAKECHROOT_SOURCE_DIR}/libfakechroot-Alpine-3.16.so" return fi @@ -4253,7 +6536,7 @@ alpine313_build_fakechroot() 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_alpine313_fakechroot' + /bin/bash <<'EOF_alpine316_fakechroot' # BUILD FAKECHROOT export SHELL=/bin/bash export CONFIG_SHELL=/bin/bash @@ -4262,123 +6545,13 @@ cd /fakechroot make distclean bash ./configure make -cp src/.libs/libfakechroot.so libfakechroot-Alpine-3.13.so +cp src/.libs/libfakechroot.so libfakechroot-Alpine-3.16.so make clean -EOF_alpine313_fakechroot +EOF_alpine316_fakechroot set +xv } -# ############################################################################# -# Nix using proot -# ############################################################################# - -nix_setup_p() -{ - echo "nix_setup : $1" - local OS_ARCH="$1" - local OS_NAME="fedora" - local OS_RELVER="31" - 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-25.bin" - 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-25.bin" - PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" - elif [ "$OS_ARCH" = "aarch64" ]; then - #PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" - #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-25.bin -q qemu-aarch64" - PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" - else - echo "nix_setup unsupported $OS_NAME architecture: $OS_ARCH" - exit 2 - fi - - export PROOT_NO_SECCOMP=1 - - if [ -x "${OS_ROOTDIR}/nix" ] ; then - echo "nix already setup : ${OS_ROOTDIR}/nix" - return - fi - - /bin/mkdir -p "${OS_ROOTDIR}/nix" - - curl -L https://nixos.org/nix/install > $OS_ROOTDIR/nix_installer.sh - - env -i $PROOT -r "$OS_ROOTDIR" -w / -b /dev -b /etc/resolv.conf -0 \ - /usr/bin/dnf install -y xz - - env -i $PROOT -r "$OS_ROOTDIR" -w / -b /dev -b /proc -b /etc/resolv.conf \ - /bin/bash <<'EOF_nix_setup_1' -export HOME=/home/user -export USER=user -export LOGNAME=user -echo "user:x:$(id -u):$(id -g)::/home/user:/bin/bash" >> /etc/passwd -mkdir -p /home/user/.config/nix -echo "sandbox = false" > /home/user/.config/nix/nix.conf -echo "filter-syscalls = false" >> /home/user/.config/nix/nix.conf -sh nix_installer.sh --no-daemon -EOF_nix_setup_1 -} - -nix_build_crun_p() -{ - echo "nix_build_crun : $1" - local OS_ARCH="$1" - local CRUN_SOURCE_DIR="$2" - local OS_NAME="fedora" - local OS_RELVER="31" - 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-25.bin" - 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-25.bin" - PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin" - elif [ "$OS_ARCH" = "aarch64" ]; then - #PROOT="$S_PROOT_DIR/proot-x86_64 -q qemu-aarch64" - #PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-25.bin -q qemu-aarch64" - PROOT="$BUILD_DIR/proot-source-x86_64/proot-Fedora-30.bin -q qemu-aarch64" - else - echo "nix_build_crun unsupported $OS_NAME architecture: $OS_ARCH" - exit 2 - fi - - export PROOT_NO_SECCOMP=1 - - if [ -x "${CRUN_SOURCE_DIR}/crun-nix-latest" ] ; then - echo "crun binary already compiled : ${CRUN_SOURCE_DIR}/crun-nix-latest" - return - fi - - $PROOT -r "$OS_ROOTDIR" -b "${CRUN_SOURCE_DIR}:/crun" \ - -w / -b /dev -b /proc -b /etc/resolv.conf \ - /bin/bash <<'EOF_nix_crun_1' -export HOME=/home/user -export USER=user -export LOGNAME=user -. /home/user/.nix-profile/etc/profile.d/nix.sh -cd /crun -#nix-build --cores 2 --max-jobs 4 nix -nix-build --cores 1 --max-jobs 1 nix -cp result/bin/crun crun-nix-latest -nix-collect-garbage -d -EOF_nix_crun_1 -} - - - # ############################################################################# # Nix using chroot # ############################################################################# @@ -4388,7 +6561,7 @@ nix_setup() echo "nix_setup : $1" local OS_ARCH="$1" local OS_NAME="fedora" - local OS_RELVER="31" + local OS_RELVER="36" local OS_ROOTDIR="${BUILD_DIR}/${OS_NAME}_${OS_RELVER}_${OS_ARCH}" if [ -x "${OS_ROOTDIR}/nix" ] ; then @@ -4400,16 +6573,19 @@ nix_setup() /bin/mkdir -p "${OS_ROOTDIR}/nix" /bin/mkdir -p "${OS_ROOTDIR}/crun" - /bin/mkdir -p "${OS_ROOTDIR}/etc" + #/bin/mkdir -p "${OS_ROOTDIR}/etc" 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" $SUDO mount --bind /dev "${OS_ROOTDIR}/dev" $SUDO mount --bind /proc "${OS_ROOTDIR}/proc" $SUDO mount --bind /sys "${OS_ROOTDIR}/sys" $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_setup_1' export HOME=/home/user export USER=user @@ -4420,6 +6596,7 @@ echo "sandbox = false" > /home/user/.config/nix/nix.conf echo "filter-syscalls = false" >> /home/user/.config/nix/nix.conf sh nix_installer.sh --no-daemon EOF_nix_setup_1 + set +xv sync $SUDO umount "${OS_ROOTDIR}/dev/pts" $SUDO umount "${OS_ROOTDIR}/dev" @@ -4433,7 +6610,7 @@ nix_build_crun() local OS_ARCH="$1" local CRUN_SOURCE_DIR="$2" local OS_NAME="fedora" - local OS_RELVER="31" + local OS_RELVER="36" local OS_ROOTDIR="${BUILD_DIR}/${OS_NAME}_${OS_RELVER}_${OS_ARCH}" if [ -x "${CRUN_SOURCE_DIR}/crun-nix-latest" ] ; then @@ -4450,6 +6627,7 @@ nix_build_crun() $SUDO mount --bind /sys "${OS_ROOTDIR}/sys" $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' export HOME=/home/user export USER=user @@ -4458,13 +6636,14 @@ export LOGNAME=user cd /crun nix-build --cores 2 --max-jobs 4 nix cp result/bin/crun crun-nix-latest -nix-collect-garbage -d +#nix-collect-garbage -d EOF_nix_crun_1 - $SUDO umount "${OS_ROOTDIR}/dev/pts" - $SUDO umount "${OS_ROOTDIR}/dev" - $SUDO umount "${OS_ROOTDIR}/sys" - $SUDO umount "${OS_ROOTDIR}/proc" - $SUDO umount "${OS_ROOTDIR}/crun" + set +xv + $SUDO umount "${OS_ROOTDIR}/dev/pts" + $SUDO umount "${OS_ROOTDIR}/dev" + $SUDO umount "${OS_ROOTDIR}/sys" + $SUDO umount "${OS_ROOTDIR}/proc" + $SUDO umount "${OS_ROOTDIR}/crun" } @@ -4534,6 +6713,14 @@ create_package_tarball() 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-CentOS-6.so" ] ; then echo "ERROR: failed to compile : ${BUILD_DIR}/fakechroot-source-glibc-x86_64/libfakechroot-CentOS-6.so" return @@ -4546,6 +6733,22 @@ create_package_tarball() 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 @@ -4570,8 +6773,12 @@ 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" + #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-musl-x86_64/libfakechroot-Alpine-3.6.so" ] ; then @@ -4602,6 +6809,18 @@ create_package_tarball() 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 + fi if [ ! -f "${BUILD_DIR}/runc-source-x86_64/runc" ] ; then echo "ERROR: failed to compile : ${BUILD_DIR}/runc-source-x86_64/runc" return @@ -4651,12 +6870,24 @@ create_package_tarball() "${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-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" \ @@ -4669,8 +6900,10 @@ 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-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" \ @@ -4685,6 +6918,12 @@ create_package_tarball() "${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-glibc-x86_64/LICENSE" \ "${PACKAGE_DIR}/udocker_dir/doc/LICENSE.fakechroot" /bin/cp -f "${BUILD_DIR}/fakechroot-source-glibc-x86_64/COPYING" \ @@ -4700,41 +6939,73 @@ create_package_tarball() /bin/cp -f "${BUILD_DIR}/crun-source-x86_64/COPYING" \ "${PACKAGE_DIR}/udocker_dir/doc/COPYING.crun" - (cd "${PACKAGE_DIR}/udocker_dir/lib"; \ + ( cd "${PACKAGE_DIR}/udocker_dir/lib"; \ ln -s libfakechroot-Ubuntu-14-x86_64.so libfakechroot-x86_64.so ; \ - ln -s libfakechroot-Ubuntu-14-x86_64.so libfakechroot-Ubuntu-x86_64.so ; \ - ln -s libfakechroot-Fedora-25-x86_64.so libfakechroot-Fedora-x86_64.so ; \ - ln -s libfakechroot-Fedora-34-x86_64.so libfakechroot-Fedora-35-x86_64.so ; \ - ln -s libfakechroot-CentOS-6-x86_64.so libfakechroot-CentOS-5-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-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-CentOS-8-x86_64.so libfakechroot-Red-8-x86_64.so ; \ - ln -s libfakechroot-CentOS-8-x86_64.so libfakechroot-Red-9-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-8-x86_64.so ; \ - ln -s libfakechroot-CentOS-8-x86_64.so libfakechroot-Scientific-9-x86_64.so ; \ - ln -s libfakechroot-CentOS-8-x86_64.so libfakechroot-CentOS-9-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-16-x86_64.so libfakechroot-CentOS-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-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-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-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-21-x86_64.so libfakechroot-Ubuntu-22-x86_64.so ; \ - ln -s libfakechroot-Alpine-3.6-x86_64.so libfakechroot-Alpine-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-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 ) 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 {} \; @@ -4748,6 +7019,7 @@ create_package_tarball() /bin/rm -f $TARBALL_FILE 2>&1 > /dev/null cd "$PACKAGE_DIR" + /bin/rm -f "$TARBALL_FILE" tar --owner=root --group=root -czvf "$TARBALL_FILE" $(ls -A) } @@ -4781,7 +7053,8 @@ get_proot_static prepare_crun_source "${BUILD_DIR}/crun-source-x86_64" -prepare_package +prepare_package ERASE + # ####### # i386 @@ -4790,10 +7063,11 @@ prepare_proot_source "${BUILD_DIR}/proot-source-x86" # fedora25_setup "i386" fedora25_build_proot "i386" "${BUILD_DIR}/proot-source-x86" +#ostree_delete "i386" "fedora" "25" # fedora30_setup "i386" fedora30_build_proot "i386" "${BUILD_DIR}/proot-source-x86" -#ostree_delete "i386" "fedora" "25" +#ostree_delete "i386" "fedora" "30" # ####### @@ -4805,6 +7079,8 @@ 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" @@ -4823,10 +7099,6 @@ fedora31_setup "x86_64" #fedora31_build_patchelf "x86_64" "${BUILD_DIR}/patchelf-source-x86_64" fedora31_build_fakechroot "x86_64" "${BUILD_DIR}/fakechroot-source-glibc-x86_64" # -nix_setup "x86_64" # Nix build uses Fedora 31 -nix_build_crun "x86_64" "${BUILD_DIR}/crun-source-x86_64" # Nix build uses Fedora 31 -#ostree_delete "x86_64" "fedora" "31" -# fedora32_setup "x86_64" #fedora32_build_proot "x86_64" "${BUILD_DIR}/proot-source-x86_64" #fedora32_build_patchelf "x86_64" "${BUILD_DIR}/patchelf-source-x86_64" @@ -4844,6 +7116,18 @@ fedora34_setup "x86_64" #fedora34_build_patchelf "x86_64" "${BUILD_DIR}/patchelf-source-x86_64" fedora34_build_fakechroot "x86_64" "${BUILD_DIR}/fakechroot-source-glibc-x86_64" #ostree_delete "x86_64" "fedora" "33" +# +fedora35_setup "x86_64" +#fedora35_build_proot "x86_64" "${BUILD_DIR}/proot-source-x86_64" +#fedora35_build_patchelf "x86_64" "${BUILD_DIR}/patchelf-source-x86_64" +fedora35_build_fakechroot "x86_64" "${BUILD_DIR}/fakechroot-source-glibc-x86_64" +# +fedora36_setup "x86_64" +#fedora36_build_proot "x86_64" "${BUILD_DIR}/proot-source-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" + # fedora29_setup "x86_64" @@ -4851,6 +7135,7 @@ fedora29_setup "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" @@ -4879,6 +7164,19 @@ alpine312_build_fakechroot "x86_64" "${BUILD_DIR}/fakechroot-source-musl-x86_64" alpine313_setup "x86_64" alpine313_build_fakechroot "x86_64" "${BUILD_DIR}/fakechroot-source-musl-x86_64" #ostree_delete "x86_64" "alpine" "3.13" +# +alpine314_setup "x86_64" +alpine314_build_fakechroot "x86_64" "${BUILD_DIR}/fakechroot-source-musl-x86_64" +#ostree_delete "x86_64" "alpine" "3.14" +# +alpine315_setup "x86_64" +alpine315_build_fakechroot "x86_64" "${BUILD_DIR}/fakechroot-source-musl-x86_64" +#ostree_delete "x86_64" "alpine" "3.15" +# +alpine316_setup "x86_64" +alpine316_build_fakechroot "x86_64" "${BUILD_DIR}/fakechroot-source-musl-x86_64" +#ostree_delete "x86_64" "alpine" "3.16" + # centos6_setup "x86_64" #centos6_build_proot "x86_64" "${BUILD_DIR}/proot-source-x86_64" @@ -4890,9 +7188,27 @@ centos7_setup "x86_64" centos7_build_fakechroot "x86_64" "${BUILD_DIR}/fakechroot-source-glibc-x86_64" #ostree_delete "x86_64" "centos" "7" # -centos8_setup "x86_64" -centos8_build_fakechroot "x86_64" "${BUILD_DIR}/fakechroot-source-glibc-x86_64" +centos_stream8_setup "x86_64" +centos_stream8_build_fakechroot "x86_64" "${BUILD_DIR}/fakechroot-source-glibc-x86_64" #ostree_delete "x86_64" "centos" "8" +# +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" +#ostree_delete "x86_64" "rocky" "8" +# +rocky9_setup "x86_64" +rocky9_build_fakechroot "x86_64" "${BUILD_DIR}/fakechroot-source-glibc-x86_64" +#ostree_delete "x86_64" "rocky" "9" + +# +alma9_setup "x86_64" +alma9_build_fakechroot "x86_64" "${BUILD_DIR}/fakechroot-source-glibc-x86_64" +#ostree_delete "x86_64" "alma" "9" + # ubuntu12_setup "amd64" ubuntu12_build_fakechroot "amd64" "${BUILD_DIR}/fakechroot-source-glibc-x86_64" @@ -4904,27 +7220,27 @@ ubuntu14_build_fakechroot "amd64" "${BUILD_DIR}/fakechroot-source-glibc-x86_64" # ubuntu16_setup "amd64" ubuntu16_build_fakechroot "amd64" "${BUILD_DIR}/fakechroot-source-glibc-x86_64" -ubuntu16_build_runc "amd64" "${BUILD_DIR}/runc-source-x86_64" #ostree_delete "amd64" "ubuntu" "16" # ubuntu18_setup "amd64" ubuntu18_build_fakechroot "amd64" "${BUILD_DIR}/fakechroot-source-glibc-x86_64" -#ubuntu18_build_runc "amd64" "${BUILD_DIR}/runc-source-x86_64" #ostree_delete "amd64" "ubuntu" "18" # ubuntu19_setup "amd64" ubuntu19_build_fakechroot "amd64" "${BUILD_DIR}/fakechroot-source-glibc-x86_64" -#ubuntu19_build_runc "amd64" "${BUILD_DIR}/runc-source-x86_64" #ostree_delete "amd64" "ubuntu" "19" # ubuntu20_setup "amd64" ubuntu20_build_fakechroot "amd64" "${BUILD_DIR}/fakechroot-source-glibc-x86_64" -#ubuntu20_build_runc "amd64" "${BUILD_DIR}/runc-source-x86_64" #ostree_delete "amd64" "ubuntu" "20" # -ubuntu21_setup "amd64" -ubuntu21_build_fakechroot "amd64" "${BUILD_DIR}/fakechroot-source-glibc-x86_64" -#ubuntu21_build_runc "amd64" "${BUILD_DIR}/runc-source-x86_64" +#ubuntu21_setup "amd64" +#ubuntu21_build_fakechroot "amd64" "${BUILD_DIR}/fakechroot-source-glibc-x86_64" +#ostree_delete "amd64" "ubuntu" "21" +# +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" # @@ -4939,6 +7255,14 @@ fedora31_build_proot "aarch64" "${BUILD_DIR}/proot-source-aarch64" #ostree_delete "aarch64" "fedora" "31" +# ####### +# x86_64 +# ####### +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 +#ostree_delete "x86_64" "fedora" "36" + + # ####### # package # ####### diff --git a/utils/udocker_test-all.sh b/utils/udocker_test-all.sh old mode 100644 new mode 100755