Unverified Commit 024149d7 authored by github-actions[bot]'s avatar github-actions[bot] Committed by GitHub
Browse files

Merge master into staging-next

parents 173041b3 f433c05d
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -238,7 +238,9 @@ in
      # this should not run because /etc is mounted via a systemd mount unit
      # instead. To a large extent this mimics what composefs does. Because
      # it's relatively simple, however, we avoid the composefs dependency.
      if [[ ! $IN_NIXOS_SYSTEMD_STAGE1 ]]; then
      # Since this script is not idempotent, it should not run when etc hasn't
      # changed.
      if [[ ! $IN_NIXOS_SYSTEMD_STAGE1 ]] && [[ "${config.system.build.etc}/etc" != "$(readlink -f /run/current-system/etc)" ]]; then
        echo "remounting /etc..."

        tmpMetadataMount=$(mktemp --directory)
+7 −5
Original line number Diff line number Diff line
@@ -14,7 +14,9 @@

  options = { };

  config = {
  config = let
    initScript = if config.boot.initrd.systemd.enable then "prepare-root" else "init";
  in {
    boot.isContainer = true;
    boot.postBootCommands =
      ''
@@ -41,7 +43,7 @@

      contents = [
        {
          source = config.system.build.toplevel + "/init";
          source = config.system.build.toplevel + "/${initScript}";
          target = "/sbin/init";
        }
        # Technically this is not required for lxc, but having also make this configuration work with systemd-nspawn.
@@ -65,7 +67,7 @@

      pseudoFiles = [
        "/sbin d 0755 0 0"
        "/sbin/init s 0555 0 0 ${config.system.build.toplevel}/init"
        "/sbin/init s 0555 0 0 ${config.system.build.toplevel}/${initScript}"
        "/dev d 0755 0 0"
        "/proc d 0555 0 0"
        "/sys d 0555 0 0"
@@ -74,7 +76,7 @@

    system.build.installBootLoader = pkgs.writeScript "install-lxd-sbin-init.sh" ''
      #!${pkgs.runtimeShell}
      ${pkgs.coreutils}/bin/ln -fs "$1/init" /sbin/init
      ${pkgs.coreutils}/bin/ln -fs "$1/${initScript}" /sbin/init
    '';

    # networkd depends on this, but systemd module disables this for containers
@@ -83,7 +85,7 @@
    systemd.packages = [ pkgs.distrobuilder.generator ];

    system.activationScripts.installInitScript = lib.mkForce ''
      ln -fs $systemConfig/init /sbin/init
      ln -fs $systemConfig/${initScript} /sbin/init
    '';
  };
}
+10 −4
Original line number Diff line number Diff line
@@ -20,7 +20,13 @@
  };

  testScript = ''
    with subtest("/etc is mounted as an overlay"):
      machine.succeed("findmnt --kernel --type overlay /etc")

    with subtest("switching to the same generation"):
      machine.succeed("/run/current-system/bin/switch-to-configuration test")

    with subtest("switching to a new generation"):
      machine.fail("stat /etc/newgen")

      machine.succeed("/run/current-system/specialisation/new-generation/bin/switch-to-configuration switch")
+12 −6
Original line number Diff line number Diff line
@@ -18,7 +18,13 @@
  };

  testScript = ''
    with subtest("/etc is mounted as an overlay"):
      machine.succeed("findmnt --kernel --type overlay /etc")

    with subtest("switching to the same generation"):
      machine.succeed("/run/current-system/bin/switch-to-configuration test")

    with subtest("switching to a new generation"):
      machine.fail("stat /etc/newgen")
      machine.succeed("echo -n 'mutable' > /etc/mutable")

+2 −2
Original line number Diff line number Diff line
import ../make-test-python.nix ({ pkgs, lib, ... } :
import ../make-test-python.nix ({ pkgs, lib, extra ? {}, ... } :

let
  releases = import ../../release.nix {
    configuration = {
      # Building documentation makes the test unnecessarily take a longer time:
      documentation.enable = lib.mkForce false;
    };
    } // extra;
  };

  container-image-metadata = releases.lxdContainerMeta.${pkgs.stdenv.hostPlatform.system};
Loading