diff options
Diffstat (limited to 'pkgs/os-specific')
-rw-r--r-- | pkgs/os-specific/linux/alsa-plugins/default.nix | 3 | ||||
-rw-r--r-- | pkgs/os-specific/linux/hwdata/default.nix | 10 | ||||
-rw-r--r-- | pkgs/os-specific/linux/kernel-headers/default.nix | 4 | ||||
-rw-r--r-- | pkgs/os-specific/linux/kernel/common-config.nix | 10 | ||||
-rw-r--r-- | pkgs/os-specific/linux/musl/default.nix | 22 | ||||
-rw-r--r-- | pkgs/os-specific/linux/systemd/0005-Add-some-NixOS-specific-unit-directories.patch | 42 | ||||
-rw-r--r-- | pkgs/os-specific/linux/systemd/default.nix | 164 |
7 files changed, 139 insertions, 116 deletions
diff --git a/pkgs/os-specific/linux/alsa-plugins/default.nix b/pkgs/os-specific/linux/alsa-plugins/default.nix index 602d4278183..09dbdbc9b6f 100644 --- a/pkgs/os-specific/linux/alsa-plugins/default.nix +++ b/pkgs/os-specific/linux/alsa-plugins/default.nix @@ -15,8 +15,7 @@ stdenv.mkDerivation rec { buildInputs = [ alsaLib libogg ] ++ lib.optional (libpulseaudio != null) libpulseaudio - # https://github.com/NixOS/nixpkgs/issues/96548 - ++ lib.optional (libjack2 != null && (stdenv.buildPlatform == stdenv.hostPlatform)) libjack2; + ++ lib.optional (libjack2 != null) libjack2; meta = with lib; { description = "Various plugins for ALSA"; diff --git a/pkgs/os-specific/linux/hwdata/default.nix b/pkgs/os-specific/linux/hwdata/default.nix index 6cee603664d..bd52f37e62f 100644 --- a/pkgs/os-specific/linux/hwdata/default.nix +++ b/pkgs/os-specific/linux/hwdata/default.nix @@ -2,13 +2,13 @@ stdenv.mkDerivation rec { pname = "hwdata"; - version = "0.335"; + version = "0.344"; src = fetchFromGitHub { owner = "vcrhonek"; repo = "hwdata"; rev = "v${version}"; - sha256 = "0f8ikwfrs6xd5sywypd9rq9cln8a0rf3vj6nm0adwzn1p8mgmrb2"; + sha256 = "0rsnm94r814shr86jk6f2323i1n4p58inkgkx7362yz9k4a8ir7a"; }; preConfigure = "patchShebangs ./configure"; @@ -19,12 +19,12 @@ stdenv.mkDerivation rec { outputHashMode = "recursive"; outputHashAlgo = "sha256"; - outputHash = "101lppd1805drwd038b4njr5czzjnqqxf3xlf6v3l22wfwr2cn3l"; + outputHash = "011lyldzskfb4sfn4i7qyyq3i4gaf1v9yfbc82889cabka0n4nfz"; meta = { homepage = "https://github.com/vcrhonek/hwdata"; description = "Hardware Database, including Monitors, pci.ids, usb.ids, and video cards"; - license = lib.licenses.gpl2; - platforms = lib.platforms.linux; + license = lib.licenses.gpl2Plus; + platforms = lib.platforms.all; }; } diff --git a/pkgs/os-specific/linux/kernel-headers/default.nix b/pkgs/os-specific/linux/kernel-headers/default.nix index 7a81d9434e3..a2a63e2bcab 100644 --- a/pkgs/os-specific/linux/kernel-headers/default.nix +++ b/pkgs/os-specific/linux/kernel-headers/default.nix @@ -69,12 +69,12 @@ let in { inherit makeLinuxHeaders; - linuxHeaders = let version = "5.10.9"; in + linuxHeaders = let version = "5.11"; in makeLinuxHeaders { inherit version; src = fetchurl { url = "mirror://kernel/linux/kernel/v5.x/linux-${version}.tar.xz"; - sha256 = "0la7dklpy6xd79fkzavpmlfyrc60kmmwz491msd95dmvv06kwwvz"; + sha256 = "1d37w0zvmf8c1l99xvy1hy6p55icjhmbsv7f0amxy2nly1a7pw04"; }; patches = [ ./no-relocs.patch # for building x86 kernel headers on non-ELF platforms diff --git a/pkgs/os-specific/linux/kernel/common-config.nix b/pkgs/os-specific/linux/kernel/common-config.nix index d108a24e0ce..11e318bd140 100644 --- a/pkgs/os-specific/linux/kernel/common-config.nix +++ b/pkgs/os-specific/linux/kernel/common-config.nix @@ -250,10 +250,16 @@ let DRM_AMDGPU_SI = whenAtLeast "4.9" yes; # (stable) amdgpu support for bonaire and newer chipsets DRM_AMDGPU_CIK = whenAtLeast "4.9" yes; - # amdgpu support for RX6000 series - DRM_AMD_DC_DCN3_0 = whenAtLeast "5.9.12" yes; # Allow device firmware updates DRM_DP_AUX_CHARDEV = whenAtLeast "4.6" yes; + # amdgpu display core (DC) support + DRM_AMD_DC_DCN1_0 = whenBetween "4.15" "5.6" yes; + DRM_AMD_DC_PRE_VEGA = whenBetween "4.15" "4.18" yes; + DRM_AMD_DC_DCN2_0 = whenBetween "5.3" "5.6" yes; + DRM_AMD_DC_DCN2_1 = whenBetween "5.4" "5.6" yes; + DRM_AMD_DC_DCN3_0 = whenBetween "5.9" "5.11" yes; + DRM_AMD_DC_HDCP = whenAtLeast "5.5" yes; + DRM_AMD_DC_SI = whenAtLeast "5.10" yes; } // optionalAttrs (stdenv.hostPlatform.system == "x86_64-linux") { # Intel GVT-g graphics virtualization supports 64-bit only DRM_I915_GVT = whenAtLeast "4.16" yes; diff --git a/pkgs/os-specific/linux/musl/default.nix b/pkgs/os-specific/linux/musl/default.nix index 63d8114ac77..3310692b31d 100644 --- a/pkgs/os-specific/linux/musl/default.nix +++ b/pkgs/os-specific/linux/musl/default.nix @@ -16,6 +16,11 @@ let sha256 = "14igk6k00bnpfw660qhswagyhvr0gfqg4q55dxvaaq7ikfkrir71"; }; + stack_chk_fail_local_c = fetchurl { + url = "https://git.alpinelinux.org/aports/plain/main/musl/__stack_chk_fail_local.c?h=3.10-stable"; + sha256 = "1nhkzzy9pklgjcq2yg89d3l18jif331srd3z3vhy5qwxl1spv6i9"; + }; + # iconv tool, implemented by musl author. # Original: http://git.etalabs.net/cgit/noxcuse/plain/src/iconv.c?id=02d288d89683e99fd18fe9f54d4e731a6c474a4f # We use copy from Alpine which fixes error messages, see: @@ -87,6 +92,16 @@ stdenv.mkDerivation rec { NIX_DONT_SET_RPATH = true; + preBuild = '' + ${if (stdenv.targetPlatform.libc == "musl" && stdenv.targetPlatform.isx86_32) then + "# the -x c flag is required since the file extension confuses gcc + # that detect the file as a linker script. + $CC -x c -c ${stack_chk_fail_local_c} -o __stack_chk_fail_local.o + $AR r libssp_nonshared.a __stack_chk_fail_local.o" + else "" + } + ''; + postInstall = '' # Not sure why, but link in all but scsi directory as that's what uclibc/glibc do. # Apparently glibc provides scsi itself? @@ -96,6 +111,13 @@ stdenv.mkDerivation rec { $STRIP -S $out/lib/libc.a mkdir -p $out/bin + + ${if (stdenv.targetPlatform.libc == "musl" && stdenv.targetPlatform.isx86_32) then + "install -D libssp_nonshared.a $out/lib/libssp_nonshared.a + $STRIP -S $out/lib/libssp_nonshared.a" + else "" + } + # Create 'ldd' symlink, builtin ln -rs $out/lib/libc.so $out/bin/ldd diff --git a/pkgs/os-specific/linux/systemd/0005-Add-some-NixOS-specific-unit-directories.patch b/pkgs/os-specific/linux/systemd/0005-Add-some-NixOS-specific-unit-directories.patch index 476ebe06e70..3e40385c3bb 100644 --- a/pkgs/os-specific/linux/systemd/0005-Add-some-NixOS-specific-unit-directories.patch +++ b/pkgs/os-specific/linux/systemd/0005-Add-some-NixOS-specific-unit-directories.patch @@ -1,24 +1,23 @@ -From 6ede8baac88aba769030f5bc5f5b2070098c7428 Mon Sep 17 00:00:00 2001 +From 95e4533f1eeb6e0d509f9129d0133f0b849cc3c5 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Fri, 19 Dec 2014 14:46:17 +0100 Subject: [PATCH 05/18] Add some NixOS-specific unit directories -Look in `/nix/var/nix/profiles/default/lib/systemd` for units provided -by packages installed into the default profile via -`nix-env -iA nixos.$package`, and into `/etc/systemd-mutable/system` for -persistent, mutable units (used for Dysnomia). +Look in `/nix/var/nix/profiles/default/lib/systemd/{system,user}` for +units provided by packages installed into the default profile via +`nix-env -iA nixos.$package`. Also, remove /usr and /lib as these don't exist on NixOS. --- - src/basic/path-lookup.c | 20 +++++--------------- + src/basic/path-lookup.c | 17 ++--------------- src/core/systemd.pc.in | 5 +++-- - 2 files changed, 8 insertions(+), 17 deletions(-) + 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/src/basic/path-lookup.c b/src/basic/path-lookup.c -index 96b82170d0..b9fbed5c61 100644 +index 96b82170d0..bf66bd6b77 100644 --- a/src/basic/path-lookup.c +++ b/src/basic/path-lookup.c -@@ -94,17 +94,14 @@ int xdg_user_data_dir(char **ret, const char *suffix) { +@@ -94,11 +94,7 @@ int xdg_user_data_dir(char **ret, const char *suffix) { } static const char* const user_data_unit_paths[] = { @@ -30,18 +29,10 @@ index 96b82170d0..b9fbed5c61 100644 NULL }; - static const char* const user_config_unit_paths[] = { - USER_CONFIG_UNIT_DIR, - "/etc/systemd/user", -+ "/etc/systemd-mutable/user", - NULL - }; - -@@ -616,15 +613,14 @@ int lookup_paths_init( +@@ -616,15 +612,13 @@ int lookup_paths_init( persistent_config, SYSTEM_CONFIG_UNIT_DIR, "/etc/systemd/system", -+ "/etc/systemd-mutable/system", + "/nix/var/nix/profiles/default/lib/systemd/system", STRV_IFNOTNULL(persistent_attached), runtime_config, @@ -55,11 +46,10 @@ index 96b82170d0..b9fbed5c61 100644 STRV_IFNOTNULL(generator_late)); break; -@@ -640,14 +636,12 @@ int lookup_paths_init( +@@ -640,14 +634,11 @@ int lookup_paths_init( persistent_config, USER_CONFIG_UNIT_DIR, "/etc/systemd/user", -+ "/etc/systemd-mutable/user", + "/nix/var/nix/profiles/default/lib/systemd/user", runtime_config, "/run/systemd/user", @@ -72,7 +62,7 @@ index 96b82170d0..b9fbed5c61 100644 STRV_IFNOTNULL(generator_late)); break; -@@ -797,7 +791,6 @@ char **generator_binary_paths(UnitFileScope scope) { +@@ -797,7 +788,6 @@ char **generator_binary_paths(UnitFileScope scope) { case UNIT_FILE_SYSTEM: add = strv_new("/run/systemd/system-generators", "/etc/systemd/system-generators", @@ -80,7 +70,7 @@ index 96b82170d0..b9fbed5c61 100644 SYSTEM_GENERATOR_DIR); break; -@@ -805,7 +798,6 @@ char **generator_binary_paths(UnitFileScope scope) { +@@ -805,7 +795,6 @@ char **generator_binary_paths(UnitFileScope scope) { case UNIT_FILE_USER: add = strv_new("/run/systemd/user-generators", "/etc/systemd/user-generators", @@ -88,7 +78,7 @@ index 96b82170d0..b9fbed5c61 100644 USER_GENERATOR_DIR); break; -@@ -844,12 +836,10 @@ char **env_generator_binary_paths(bool is_system) { +@@ -844,12 +833,10 @@ char **env_generator_binary_paths(bool is_system) { if (is_system) add = strv_new("/run/systemd/system-environment-generators", "/etc/systemd/system-environment-generators", @@ -102,7 +92,7 @@ index 96b82170d0..b9fbed5c61 100644 if (!add) diff --git a/src/core/systemd.pc.in b/src/core/systemd.pc.in -index f2c045511d..ccb382e421 100644 +index f2c045511d..d38a3a0302 100644 --- a/src/core/systemd.pc.in +++ b/src/core/systemd.pc.in @@ -38,10 +38,11 @@ systemdsystemconfdir=${systemd_system_conf_dir} @@ -110,11 +100,11 @@ index f2c045511d..ccb382e421 100644 systemduserconfdir=${systemd_user_conf_dir} -systemd_system_unit_path=${systemd_system_conf_dir}:/etc/systemd/system:/run/systemd/system:/usr/local/lib/systemd/system:${systemd_system_unit_dir}:/usr/lib/systemd/system:/lib/systemd/system -+systemd_system_unit_path=${systemd_system_conf_dir}:/etc/systemd/system:/etc/systemd-mutable/system:/nix/var/nix/profiles/default/lib/systemd/system:/run/systemd/system:${systemdsystemunitdir} ++systemd_system_unit_path=${systemd_system_conf_dir}:/etc/systemd/system:/nix/var/nix/profiles/default/lib/systemd/system:/run/systemd/system:${systemdsystemunitdir} systemdsystemunitpath=${systemd_system_unit_path} -systemd_user_unit_path=${systemd_user_conf_dir}:/etc/systemd/user:/run/systemd/user:/usr/local/lib/systemd/user:/usr/local/share/systemd/user:${systemd_user_unit_dir}:/usr/lib/systemd/user:/usr/share/systemd/user -+systemd_user_unit_path=${systemd_user_conf_dir}:/etc/systemd/user:/etc/systemd-mutable/user:/nix/var/nix/profiles/default/lib/systemd/user:/run/systemd/user:${systemduserunitdir} ++systemd_user_unit_path=${systemd_user_conf_dir}:/etc/systemd/user:/nix/var/nix/profiles/default/lib/systemd/user:/run/systemd/user:${systemduserunitdir} + systemduserunitpath=${systemd_user_unit_path} diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix index 421fc5986af..7e3c6d1fe51 100644 --- a/pkgs/os-specific/linux/systemd/default.nix +++ b/pkgs/os-specific/linux/systemd/default.nix @@ -1,3 +1,5 @@ +# NOTE: Make sure to (re-)format this file on changes with `nixpkgs-fmt`! + { stdenv , lib , fetchFromGitHub @@ -111,7 +113,7 @@ assert withCryptsetup -> let wantCurl = withRemote || withImportd; - version = "247.2"; + version = "247.3"; in stdenv.mkDerivation { inherit version pname; @@ -122,7 +124,7 @@ stdenv.mkDerivation { owner = "systemd"; repo = "systemd-stable"; rev = "v${version}"; - sha256 = "091pwrvxz3gcf80shlp28d6l4gvjzc6pb61v4mwxmk9d71qaq7ry"; + sha256 = "0zn0b74iwz3vxabqsk4yydwpgky3c5z4dl83wxbs1qi5d2dnbqa7"; }; # If these need to be regenerated, `git am path/to/00*.patch` them into a @@ -160,83 +162,87 @@ stdenv.mkDerivation { --replace \ "find_program('objcopy'" \ "find_program('${stdenv.cc.bintools.targetPrefix}objcopy'" - '' + (let - - # The folllowing dlopen patches ensure that all the features that are - # implemented via dlopen(3) are available (or explicitly deactivated) by - # pointing dlopen to the absolute store path instead of relying on the - # linkers runtime lookup code. - # - # All of the dlopen calls have to be handled. When new ones are introduced - # by upstream (or one of our patches) they must be explicitly declared, - # otherwise the build will fail. - # - # As of systemd version 247 we've seen a few errors like `libpcre2.… not - # found` when using e.g. --grep with journalctl. Those errors should - # become less unexpected now. - # - # There are generally two classes of dlopen(3) calls. Those that we want to - # support and those that should be deactivated / unsupported. This change - # enforces that we handle all dlopen calls explicitly. Meaning: There is - # not a single dlopen call in the source code tree that we did not - # explicitly handle. - # - # In order to do this we introduced a list of attributes that maps from - # shared object name to the package that contains them. The package can be - # null meaning the reference should be nuked and the shared object will - # never be loadable during runtime (because it points at an invalid store - # path location). - # - # To get a list of dynamically loaded libraries issue something like - # `grep -ri 'dlopen("lib' $src` and update the below list. - dlopenLibs = [ - # We did never provide support for libxkbcommon & qrencode - { name = "libxkbcommon.so.0"; pkg = null; } - { name = "libqrencode.so.4"; pkg = null; } - - # We did not provide libpwquality before so it is safe to disable it for - # now. - { name = "libpwquality.so.1"; pkg = null; } - - # Only include cryptsetup if it is enabled. We might not be able to - # provide it during "bootstrap" in e.g. the minimal systemd build as - # cryptsetup has udev (aka systemd) in it's dependencies. - { name = "libcryptsetup.so.12"; pkg = if withCryptsetup then cryptsetup else null; } - - # We are using libidn2 so we only provide that and ignore the others. - # Systemd does this decision during configure time and uses ifdef's to - # enable specific branches. We can safely ignore (nuke) the libidn "v1" - # libraries. - { name = "libidn2.so.0"; pkg = libidn2; } - { name = "libidn.so.12"; pkg = null; } - { name = "libidn.so.11"; pkg = null; } - - # journalctl --grep requires libpcre so lets provide it - { name = "libpcre2-8.so.0"; pkg = pcre2; } - ]; - - patchDlOpen = dl: let - library = "${lib.makeLibraryPath [dl.pkg]}/${dl.name}"; - in if dl.pkg == null then '' - # remove the dependency on the library by replacing it with an invalid path - for file in $(grep -lr 'dlopen("${dl.name}"' src); do - echo "patching dlopen(\"${dl.name}\", …) in $file to an invalid store path ("/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-not-implemented/${dl.name}")…" - substituteInPlace "$file" --replace 'dlopen("${dl.name}"' 'dlopen("/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-not-implemented/${dl.name}"' - done - '' else '' - # ensure that the library we provide actually exists - if ! [ -e ${library} ]; then - echo 'The shared library `${library}` does not exist but was given as subtitute for `${dl.name}`' - exit 1 - fi - # make the path to the dependency explicit - for file in $(grep -lr 'dlopen("${dl.name}"' src); do - echo "patching dlopen(\"${dl.name}\", …) in $file to ${library}…" - substituteInPlace "$file" --replace 'dlopen("${dl.name}"' 'dlopen("${library}"' - done - ''; - in # patch all the dlopen calls to contain absolute paths to the libraries - lib.concatMapStringsSep "\n" patchDlOpen dlopenLibs) + '' + ( + let + # The folllowing dlopen patches ensure that all the features that are + # implemented via dlopen(3) are available (or explicitly deactivated) by + # pointing dlopen to the absolute store path instead of relying on the + # linkers runtime lookup code. + # + # All of the dlopen calls have to be handled. When new ones are introduced + # by upstream (or one of our patches) they must be explicitly declared, + # otherwise the build will fail. + # + # As of systemd version 247 we've seen a few errors like `libpcre2.… not + # found` when using e.g. --grep with journalctl. Those errors should + # become less unexpected now. + # + # There are generally two classes of dlopen(3) calls. Those that we want to + # support and those that should be deactivated / unsupported. This change + # enforces that we handle all dlopen calls explicitly. Meaning: There is + # not a single dlopen call in the source code tree that we did not + # explicitly handle. + # + # In order to do this we introduced a list of attributes that maps from + # shared object name to the package that contains them. The package can be + # null meaning the reference should be nuked and the shared object will + # never be loadable during runtime (because it points at an invalid store + # path location). + # + # To get a list of dynamically loaded libraries issue something like + # `grep -ri 'dlopen("lib' $src` and update the below list. + dlopenLibs = [ + # We did never provide support for libxkbcommon & qrencode + { name = "libxkbcommon.so.0"; pkg = null; } + { name = "libqrencode.so.4"; pkg = null; } + + # We did not provide libpwquality before so it is safe to disable it for + # now. + { name = "libpwquality.so.1"; pkg = null; } + + # Only include cryptsetup if it is enabled. We might not be able to + # provide it during "bootstrap" in e.g. the minimal systemd build as + # cryptsetup has udev (aka systemd) in it's dependencies. + { name = "libcryptsetup.so.12"; pkg = if withCryptsetup then cryptsetup else null; } + + # We are using libidn2 so we only provide that and ignore the others. + # Systemd does this decision during configure time and uses ifdef's to + # enable specific branches. We can safely ignore (nuke) the libidn "v1" + # libraries. + { name = "libidn2.so.0"; pkg = libidn2; } + { name = "libidn.so.12"; pkg = null; } + { name = "libidn.so.11"; pkg = null; } + + # journalctl --grep requires libpcre so lets provide it + { name = "libpcre2-8.so.0"; pkg = pcre2; } + ]; + + patchDlOpen = dl: + let + library = "${lib.makeLibraryPath [ dl.pkg ]}/${dl.name}"; + in + if dl.pkg == null then '' + # remove the dependency on the library by replacing it with an invalid path + for file in $(grep -lr 'dlopen("${dl.name}"' src); do + echo "patching dlopen(\"${dl.name}\", …) in $file to an invalid store path ("/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-not-implemented/${dl.name}")…" + substituteInPlace "$file" --replace 'dlopen("${dl.name}"' 'dlopen("/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-not-implemented/${dl.name}"' + done + '' else '' + # ensure that the library we provide actually exists + if ! [ -e ${library} ]; then + echo 'The shared library `${library}` does not exist but was given as subtitute for `${dl.name}`' + exit 1 + fi + # make the path to the dependency explicit + for file in $(grep -lr 'dlopen("${dl.name}"' src); do + echo "patching dlopen(\"${dl.name}\", …) in $file to ${library}…" + substituteInPlace "$file" --replace 'dlopen("${dl.name}"' 'dlopen("${library}"' + done + ''; + in + # patch all the dlopen calls to contain absolute paths to the libraries + lib.concatMapStringsSep "\n" patchDlOpen dlopenLibs + ) # finally ensure that there are no left-over dlopen calls that we didn't handle + '' if grep -qr 'dlopen("[^/]' src; then |