nixpkgs-suyu/pkgs/os-specific/linux/systemd/0002-Don-t-try-to-unmount-nix-or-nix-store.patch
Artturin 40eff710af Revert "Systemd package rewrite"
Reverts NixOS/nixpkgs#269620

- eab0837b68 caused a mass-rebuild on master

- self-merge on a critical package without review and not waiting for the active owner team

Below are the reverts of the commits from that PR

Revert "systemd: migrate to by-name"

This reverts commit 33d2a40d67.

Revert "systemd: add meta.longDescription"

This reverts commit 7c588d141d.

Revert "systemd: cosmetic rewording of code"

This reverts commit d91b8d9fcb.

Revert "systemd: cosmetic rewording of comments"

This reverts commit bc563998c0.

Revert "systemd: remove some redundancy on mesonFlags"

This reverts commit eab0837b68.

Revert "systemd: use  lib.meson* functions"

This reverts commit 1129756b1a.
2023-11-26 03:12:04 +02:00

45 lines
1.7 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Raito Bezarius <masterancpp@gmail.com>
Date: Mon, 19 Jun 2023 02:11:35 +0200
Subject: [PATCH] Don't try to unmount /nix or /nix/store
They'll still be remounted read-only.
https://github.com/NixOS/nixos/issues/126
Original-Author: Eelco Dolstra <eelco.dolstra@logicblox.com>
---
src/shared/fstab-util.c | 2 ++
src/shutdown/umount.c | 6 ++++--
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/shared/fstab-util.c b/src/shared/fstab-util.c
index 4ffec25c75..b99031c54e 100644
--- a/src/shared/fstab-util.c
+++ b/src/shared/fstab-util.c
@@ -43,6 +43,8 @@ bool fstab_is_extrinsic(const char *mount, const char *opts) {
/* Don't bother with the OS data itself */
if (PATH_IN_SET(mount,
"/",
+ "/nix",
+ "/nix/store",
"/usr",
"/etc"))
return true;
diff --git a/src/shutdown/umount.c b/src/shutdown/umount.c
index 1586c2e214..fcae95f824 100644
--- a/src/shutdown/umount.c
+++ b/src/shutdown/umount.c
@@ -170,8 +170,10 @@ int mount_points_list_get(const char *mountinfo, MountPoint **head) {
static bool nonunmountable_path(const char *path) {
assert(path);
- return PATH_IN_SET(path, "/", "/usr") ||
- path_startswith(path, "/run/initramfs");
+ return PATH_IN_SET(path, "/", "/usr")
+ || path_equal(path, "/nix")
+ || path_equal(path, "/nix/store")
+ || path_startswith(path, "/run/initramfs");
}
static void log_umount_blockers(const char *mnt) {