From 0100a7580176124cc58dae9d713167a85498cef6 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Mon, 21 Feb 2022 12:52:58 +0000 Subject: [PATCH] kmod-blacklist-ubuntu: don't refer to grep/xargs 64b4af52961 ("kmod-blacklist-ubuntu: 22-1.1ubuntu1 -> 28-1ubuntu4") doubled the size of the default initramfs. This happened because the upgrade introduced this configuration: remove iwlwifi \ (/sbin/lsmod | grep -o -e ^iwlmvm -e ^iwldvm -e ^iwlwifi | xargs /sbin/rmmod) \ && /sbin/modprobe -r mac80211 This meant that the grep and xargs substitutions, which had been inactive for years, suddenly became active again and became part of kmod-blacklist-ubuntu's closure. Since we're already using /run/booted-system for the kmod binaries, I think it's okay to use it for grep and xargs as well. Both are required NixOS packages, so they're guaranteed to be there. Large increases in initramfs size are problematic, because it's often not possible for users to do anything about them. It's not always possible to increase the size of /boot, because some filesystems like ZFS don't support being shrunk to make way for a bigger /boot. --- pkgs/os-specific/linux/kmod-blacklist-ubuntu/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/os-specific/linux/kmod-blacklist-ubuntu/default.nix b/pkgs/os-specific/linux/kmod-blacklist-ubuntu/default.nix index 4002657ad69..3964538a409 100644 --- a/pkgs/os-specific/linux/kmod-blacklist-ubuntu/default.nix +++ b/pkgs/os-specific/linux/kmod-blacklist-ubuntu/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, gnugrep, findutils }: +{ lib, stdenv, fetchurl }: let version = "28-1ubuntu4"; # impish 2021-06-24 @@ -26,8 +26,8 @@ in stdenv.mkDerivation { --replace /sbin/lsmod /run/booted-system/sw/bin/lsmod \ --replace /sbin/rmmod /run/booted-system/sw/bin/rmmod \ --replace /sbin/modprobe /run/booted-system/sw/bin/modprobe \ - --replace " grep " " ${gnugrep}/bin/grep " \ - --replace " xargs " " ${findutils}/bin/xargs " + --replace " grep " " /run/booted-system/sw/bin/grep " \ + --replace " xargs " " /run/booted-system/sw/bin/xargs " ''; meta = with lib; {