Merge pull request #114821 from erosennin/catatonit

catatonit: init at 0.1.5, fix podman --init

authored by

adisbladis and committed by
GitHub
04a37553 2af47fc8

+52 -1
+2 -1
nixos/modules/virtualisation/containers.nix
··· 118 118 [network] 119 119 cni_plugin_dirs = ["${pkgs.cni-plugins}/bin/"] 120 120 121 - ${lib.optionalString (cfg.ociSeccompBpfHook.enable == true) '' 122 121 [engine] 122 + init_path = "${pkgs.catatonit}/bin/catatonit" 123 + ${lib.optionalString (cfg.ociSeccompBpfHook.enable) '' 123 124 hooks_dir = [ 124 125 "${config.boot.kernelPackages.oci-seccomp-bpf-hook}", 125 126 ]
+9
nixos/tests/podman.nix
··· 96 96 podman.succeed(su_cmd("podman ps | grep sleeping")) 97 97 podman.succeed(su_cmd("podman stop sleeping")) 98 98 podman.succeed(su_cmd("podman rm sleeping")) 99 + 100 + with subtest("Run container with init"): 101 + podman.succeed( 102 + "tar cv -C ${pkgs.pkgsStatic.busybox} . | podman import - busybox" 103 + ) 104 + pid = podman.succeed("podman run --rm busybox readlink /proc/self").strip() 105 + assert pid == "1" 106 + pid = podman.succeed("podman run --rm --init busybox readlink /proc/self").strip() 107 + assert pid == "2" 99 108 ''; 100 109 } 101 110 )
+39
pkgs/applications/virtualization/catatonit/default.nix
··· 1 + { lib, stdenv, fetchFromGitHub, fetchpatch, autoreconfHook, glibc, nixosTests }: 2 + 3 + stdenv.mkDerivation rec { 4 + pname = "catatonit"; 5 + version = "0.1.5"; 6 + 7 + src = fetchFromGitHub { 8 + owner = "openSUSE"; 9 + repo = pname; 10 + rev = "v${version}"; 11 + sha256 = "ciJ1MI7jr5P2PgxIykQ+BiwNUO8lQHGt0+U8CNbc5bI="; 12 + }; 13 + 14 + patches = [ 15 + # Fix compilation with musl 16 + (fetchpatch { 17 + url = "https://github.com/openSUSE/catatonit/commit/75014b1c3099245b7d0f44f24d7f6dc4888a45fd.patch"; 18 + sha256 = "sha256-9VMNUT1U90ocjvE7EXYfLxuodDwTXXHYg89qqa5Jq0g="; 19 + }) 20 + ]; 21 + 22 + nativeBuildInputs = [ autoreconfHook ]; 23 + buildInputs = lib.optionals (!stdenv.hostPlatform.isMusl) [ glibc glibc.static ]; 24 + 25 + doInstallCheck = true; 26 + installCheckPhase = '' 27 + readelf -d $out/bin/catatonit | grep 'There is no dynamic section in this file.' 28 + ''; 29 + 30 + passthru.tests = { inherit (nixosTests) podman; }; 31 + 32 + meta = with lib; { 33 + description = "A container init that is so simple it's effectively brain-dead"; 34 + homepage = "https://github.com/openSUSE/catatonit"; 35 + license = licenses.gpl3Plus; 36 + maintainers = with maintainers; [ erosennin ] ++ teams.podman.members; 37 + platforms = platforms.linux; 38 + }; 39 + }
+2
pkgs/top-level/all-packages.nix
··· 197 197 inherit (python3Packages) sphinx; 198 198 }; 199 199 200 + catatonit = callPackage ../applications/virtualization/catatonit { }; 201 + 200 202 cen64 = callPackage ../misc/emulators/cen64 { }; 201 203 202 204 cereal = callPackage ../development/libraries/cereal { };