summary refs log tree commit diff
path: root/pkgs/os-specific/linux
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2020-01-26 16:15:19 +0100
committerFlorian Klink <flokli@flokli.de>2020-04-17 00:27:29 +0200
commita16ebf856126bb93bc0a2aa091eb4403e781cd33 (patch)
tree9d0a42b720f4591b0116132fb8948420470a6075 /pkgs/os-specific/linux
parent1ad4accdafd29bd998f121dbda8f9c4e3df090b0 (diff)
downloadnixpkgs-a16ebf856126bb93bc0a2aa091eb4403e781cd33.tar
nixpkgs-a16ebf856126bb93bc0a2aa091eb4403e781cd33.tar.gz
nixpkgs-a16ebf856126bb93bc0a2aa091eb4403e781cd33.tar.bz2
nixpkgs-a16ebf856126bb93bc0a2aa091eb4403e781cd33.tar.lz
nixpkgs-a16ebf856126bb93bc0a2aa091eb4403e781cd33.tar.xz
nixpkgs-a16ebf856126bb93bc0a2aa091eb4403e781cd33.tar.zst
nixpkgs-a16ebf856126bb93bc0a2aa091eb4403e781cd33.zip
systemd: drop 001{4,5}-{catalog,hwdb}-don-t-update-on-install.patch
These patches removed logic in the meson install phase invoking
`journalctl --update-catalog` and `systemd-hwdb update`, which would
mutate the running system, and obviously fails in the sandbox.

Upstream also knows this is a bad thing if you're not on the machine you
want to deploy to, so there's logic in there to not execute it when
DESTDIR isn't empty. In our case, it is - as we set --prefix instead for
other reasons, but by just setting DESTIDIR to "/", we can still trigger
these things to be skipped.

The patches removed some context from
0018-Install-default-configuration-into-out-share-factory.patch, which
we need to introduce there to make that patch still apply.
Diffstat (limited to 'pkgs/os-specific/linux')
-rw-r--r--pkgs/os-specific/linux/systemd/0014-catalog-don-t-update-on-install.patch24
-rw-r--r--pkgs/os-specific/linux/systemd/0015-hwdb-don-t-run-update-on-install.patch27
-rw-r--r--pkgs/os-specific/linux/systemd/0018-Install-default-configuration-into-out-share-factory.patch4
-rw-r--r--pkgs/os-specific/linux/systemd/default.nix7
4 files changed, 9 insertions, 53 deletions
diff --git a/pkgs/os-specific/linux/systemd/0014-catalog-don-t-update-on-install.patch b/pkgs/os-specific/linux/systemd/0014-catalog-don-t-update-on-install.patch
deleted file mode 100644
index 4f9f08413e2..00000000000
--- a/pkgs/os-specific/linux/systemd/0014-catalog-don-t-update-on-install.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-From 8e7aec49a387d8229b85cfc3ea2f2c1c9a45f6d0 Mon Sep 17 00:00:00 2001
-From: Franz Pletz <fpletz@fnordicwalking.de>
-Date: Wed, 17 Jan 2018 05:10:36 +0100
-Subject: [PATCH 14/27] catalog: don't update on install
-
----
- catalog/meson.build | 4 ----
- 1 file changed, 4 deletions(-)
-
-diff --git a/catalog/meson.build b/catalog/meson.build
-index 3db8e390f2..7004618750 100644
---- a/catalog/meson.build
-+++ b/catalog/meson.build
-@@ -28,7 +28,3 @@ foreach file : in_files
-                 install : true,
-                 install_dir : catalogdir)
- endforeach
--
--meson.add_install_script('sh', '-c',
--                         'test -n "$DESTDIR" || @0@/journalctl --update-catalog'
--                         .format(rootbindir))
--- 
-2.24.1
-
diff --git a/pkgs/os-specific/linux/systemd/0015-hwdb-don-t-run-update-on-install.patch b/pkgs/os-specific/linux/systemd/0015-hwdb-don-t-run-update-on-install.patch
deleted file mode 100644
index bf416d90d86..00000000000
--- a/pkgs/os-specific/linux/systemd/0015-hwdb-don-t-run-update-on-install.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From 8a383521425d7a59e9b1850d1547d47fa5e8a952 Mon Sep 17 00:00:00 2001
-From: Franz Pletz <fpletz@fnordicwalking.de>
-Date: Sun, 11 Feb 2018 04:01:35 +0100
-Subject: [PATCH 15/27] hwdb: don't run update on install
-
----
- hwdb/meson.build | 4 ----
- 1 file changed, 4 deletions(-)
-
-diff --git a/hwdb/meson.build b/hwdb/meson.build
-index 31ee3e7409..badf39f555 100644
---- a/hwdb/meson.build
-+++ b/hwdb/meson.build
-@@ -27,10 +27,6 @@ if conf.get('ENABLE_HWDB') == 1
- 
-         meson.add_install_script('sh', '-c',
-                                  mkdir_p.format(join_paths(sysconfdir, 'udev/hwdb.d')))
--
--        meson.add_install_script('sh', '-c',
--                                 'test -n "$DESTDIR" || @0@/systemd-hwdb update'
--                                 .format(rootbindir))
- endif
- 
- ############################################################
--- 
-2.24.1
-
diff --git a/pkgs/os-specific/linux/systemd/0018-Install-default-configuration-into-out-share-factory.patch b/pkgs/os-specific/linux/systemd/0018-Install-default-configuration-into-out-share-factory.patch
index 980d9f35461..1793f5d1818 100644
--- a/pkgs/os-specific/linux/systemd/0018-Install-default-configuration-into-out-share-factory.patch
+++ b/pkgs/os-specific/linux/systemd/0018-Install-default-configuration-into-out-share-factory.patch
@@ -40,6 +40,10 @@ index badf39f555..8fd9c7639f 100644
          meson.add_install_script('sh', '-c',
 -                                 mkdir_p.format(join_paths(sysconfdir, 'udev/hwdb.d')))
 +                                 mkdir_p.format(join_paths(factoryconfdir, 'udev/hwdb.d')))
+ 
+         meson.add_install_script('sh', '-c',
+                                  'test -n "$DESTDIR" || @0@/systemd-hwdb update'
+                                  .format(rootbindir))
  endif
  
  ############################################################
diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix
index b8693678566..82c8af30359 100644
--- a/pkgs/os-specific/linux/systemd/default.nix
+++ b/pkgs/os-specific/linux/systemd/default.nix
@@ -55,8 +55,6 @@ in stdenv.mkDerivation {
     ./0011-Fix-hwdb-paths.patch
     ./0012-Change-usr-share-zoneinfo-to-etc-zoneinfo.patch
     ./0013-localectl-use-etc-X11-xkb-for-list-x11.patch
-    ./0014-catalog-don-t-update-on-install.patch
-    ./0015-hwdb-don-t-run-update-on-install.patch
     ./0016-build-don-t-create-statedir-and-don-t-touch-prefixdi.patch
     ./0017-Fix-mount-option-x-initrd.mount-handling-35268-16.patch
     ./0018-Install-default-configuration-into-out-share-factory.patch
@@ -220,6 +218,11 @@ in stdenv.mkDerivation {
 
   doCheck = false; # fails a bunch of tests
 
+  # trigger the test -n "$DESTDIR" || mutate in upstreams build system
+  preInstall = ''
+    export DESTDIR=/
+  '';
+
   postInstall = ''
     # sysinit.target: Don't depend on
     # systemd-tmpfiles-setup.service. This interferes with NixOps's