Merge pull request #14888 from dezgeg/pr-kill-module-init-tools

Delete all usages of module_init_tools and remove the package
This commit is contained in:
Tuomas Tynkkynen 2016-04-23 14:29:41 +03:00
commit bd18cc3cdc
17 changed files with 40 additions and 253 deletions

View File

@ -31,13 +31,13 @@ in
# unload module during suspend/hibernate as it crashes the whole system
powerManagement.powerDownCommands = ''
${pkgs.module_init_tools}/bin/rmmod -f facetimehd
${pkgs.kmod}/bin/rmmod -f facetimehd
'';
# and load it back on resume
powerManagement.resumeCommands = ''
export MODULE_DIR=/run/current-system/kernel-modules/lib/modules
${pkgs.module_init_tools}/bin/modprobe -v facetimehd
${pkgs.kmod}/bin/modprobe -v facetimehd
'';
};

View File

@ -80,7 +80,7 @@ in
preStart = ''
mkdir -p -m 0755 /afs
mkdir -m 0700 -p ${cfg.cacheDirectory}
${pkgs.module_init_tools}/sbin/insmod ${openafsPkgs}/lib/openafs/libafs-*.ko || true
${pkgs.kmod}/sbin/insmod ${openafsPkgs}/lib/openafs/libafs-*.ko || true
${openafsPkgs}/sbin/afsd -confdir ${afsConfig} -cachedir ${cfg.cacheDirectory} ${if cfg.sparse then "-dynroot-sparse" else "-dynroot"} -fakestat -afsdb
${openafsPkgs}/bin/fs setcrypt ${if cfg.crypt then "on" else "off"}
'';
@ -92,7 +92,7 @@ in
preStop = ''
${pkgs.utillinux}/bin/umount /afs
${openafsPkgs}/sbin/afsd -shutdown
${pkgs.module_init_tools}/sbin/rmmod libafs
${pkgs.kmod}/sbin/rmmod libafs
'';
};
};

View File

@ -149,11 +149,11 @@ let
${pkgs.mtools}/bin/mlabel -i /dev/vda2 ::boot
# Mount /boot; load necessary modules first.
${pkgs.module_init_tools}/sbin/insmod ${pkgs.linux}/lib/modules/*/kernel/fs/nls/nls_cp437.ko || true
${pkgs.module_init_tools}/sbin/insmod ${pkgs.linux}/lib/modules/*/kernel/fs/nls/nls_iso8859-1.ko || true
${pkgs.module_init_tools}/sbin/insmod ${pkgs.linux}/lib/modules/*/kernel/fs/fat/fat.ko || true
${pkgs.module_init_tools}/sbin/insmod ${pkgs.linux}/lib/modules/*/kernel/fs/fat/vfat.ko || true
${pkgs.module_init_tools}/sbin/insmod ${pkgs.linux}/lib/modules/*/kernel/fs/efivarfs/efivarfs.ko || true
${pkgs.kmod}/sbin/insmod ${pkgs.linux}/lib/modules/*/kernel/fs/nls/nls_cp437.ko.xz || true
${pkgs.kmod}/sbin/insmod ${pkgs.linux}/lib/modules/*/kernel/fs/nls/nls_iso8859-1.ko.xz || true
${pkgs.kmod}/sbin/insmod ${pkgs.linux}/lib/modules/*/kernel/fs/fat/fat.ko.xz || true
${pkgs.kmod}/sbin/insmod ${pkgs.linux}/lib/modules/*/kernel/fs/fat/vfat.ko.xz || true
${pkgs.kmod}/sbin/insmod ${pkgs.linux}/lib/modules/*/kernel/fs/efivarfs/efivarfs.ko.xz || true
mkdir /boot
mount /dev/vda2 /boot

View File

@ -329,14 +329,14 @@ rec {
buildInputs = [ utillinux ];
buildCommand = ''
ln -s ${linux}/lib /lib
${module_init_tools}/bin/modprobe loop
${module_init_tools}/bin/modprobe ext4
${module_init_tools}/bin/modprobe hfs
${module_init_tools}/bin/modprobe hfsplus
${module_init_tools}/bin/modprobe squashfs
${module_init_tools}/bin/modprobe iso9660
${module_init_tools}/bin/modprobe ufs
${module_init_tools}/bin/modprobe cramfs
${kmod}/bin/modprobe loop
${kmod}/bin/modprobe ext4
${kmod}/bin/modprobe hfs
${kmod}/bin/modprobe hfsplus
${kmod}/bin/modprobe squashfs
${kmod}/bin/modprobe iso9660
${kmod}/bin/modprobe ufs
${kmod}/bin/modprobe cramfs
mknod /dev/loop0 b 7 0
mkdir -p $out
@ -355,12 +355,12 @@ rec {
buildInputs = [ utillinux mtdutils ];
buildCommand = ''
ln -s ${linux}/lib /lib
${module_init_tools}/bin/modprobe mtd
${module_init_tools}/bin/modprobe mtdram total_size=131072
${module_init_tools}/bin/modprobe mtdchar
${module_init_tools}/bin/modprobe mtdblock
${module_init_tools}/bin/modprobe jffs2
${module_init_tools}/bin/modprobe zlib
${kmod}/bin/modprobe mtd
${kmod}/bin/modprobe mtdram total_size=131072
${kmod}/bin/modprobe mtdchar
${kmod}/bin/modprobe mtdblock
${kmod}/bin/modprobe jffs2
${kmod}/bin/modprobe zlib
mknod /dev/mtd0 c 90 0
mknod /dev/mtdblock0 b 31 0

View File

@ -1,38 +0,0 @@
{ stdenv, fetchurl, docbook2x, docbook_sgml_dtd_41 }:
assert (stdenv.lib.elem stdenv.system stdenv.lib.platforms.linux);
stdenv.mkDerivation {
name = "module-init-tools-3.16";
src = [
(fetchurl {
url = http://ftp.be.debian.org/pub/linux/utils/kernel/module-init-tools/module-init-tools-3.16.tar.bz2;
sha256 = "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1";
})
# Upstream forgot to include the generated manpages. Thankfully
# the Gentoo people fixed this for us :-)
(fetchurl {
urls = [
mirror://gentoo/distfiles/module-init-tools-3.16-man.tar.bz2
http://mirror.meleeweb.net/pub/linux/gentoo/distfiles/module-init-tools-3.16-man.tar.bz2
];
sha256 = "1j1nzi87kgsh4scl645fhwhjvljxj83cmdasa4n4p5krhasgw358";
})
];
buildInputs = [ stdenv.glibc.dev stdenv.glibc.static ];
SGML_CATALOG_FILES = "${docbook_sgml_dtd_41}/sgml/dtd/docbook-4.1/docbook.cat";
patches = [ ./module-dir.patch ./docbook2man.patch ];
postInstall = "rm $out/sbin/insmod.static"; # don't need it
meta = {
homepage = http://www.kernel.org/pub/linux/utils/kernel/module-init-tools/;
description = "Tools for loading and managing Linux kernel modules";
platforms = stdenv.lib.platforms.linux;
};
}

View File

@ -1,12 +0,0 @@
diff -Naur module-init-tools-3.16-orig/Makefile.in module-init-tools-3.16/Makefile.in
--- module-init-tools-3.16-orig/Makefile.in 2011-06-02 13:56:45.000000000 -0400
+++ module-init-tools-3.16/Makefile.in 2011-10-01 23:59:30.584443193 -0400
@@ -174,7 +174,7 @@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
-DOCBOOKTOMAN = @DOCBOOKTOMAN@
+DOCBOOKTOMAN = @DOCBOOKTOMAN@ --sgml
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@

View File

@ -1,161 +0,0 @@
commit cf2c95edb7918bc658f6cae93793c1949fc9cb6e
Author: David Guibert <david.guibert@gmail.com>
Date: Fri Aug 5 14:20:12 2011 +0200
introduce module-dir
diff --git a/depmod.c b/depmod.c
index a1d2f8c..9362a35 100644
--- a/depmod.c
+++ b/depmod.c
@@ -48,9 +48,6 @@
#include "testing.h"
-#ifndef MODULE_DIR
-#define MODULE_DIR "/lib/modules/"
-#endif
#ifndef MODULE_BUILTIN_KEY
#define MODULE_BUILTIN_KEY "built-in"
@@ -1516,6 +1513,7 @@ static int parse_config_file(const char *filename,
char *line;
unsigned int linenum = 0;
FILE *cfile;
+ char *module_dir;
cfile = fopen(filename, "r");
if (!cfile) {
@@ -1525,6 +1523,10 @@ static int parse_config_file(const char *filename,
return 0;
}
+ if((module_dir = getenv("MODULE_DIR")) == NULL) {
+ module_dir = "/lib/modules/";
+ }
+
while ((line = getline_wrapped(cfile, &linenum)) != NULL) {
char *ptr = line;
char *cmd, *modname;
@@ -1550,7 +1552,7 @@ static int parse_config_file(const char *filename,
continue;
}
nofail_asprintf(&dirname, "%s%s%s/%s", basedir,
- MODULE_DIR, kernelversion, search_path);
+ module_dir, kernelversion, search_path);
len = strlen(dirname);
*search = add_search(dirname, len, *search);
free(dirname);
@@ -1565,7 +1567,7 @@ static int parse_config_file(const char *filename,
continue;
nofail_asprintf(&pathname, "%s%s%s/%s/%s.ko", basedir,
- MODULE_DIR, kernelversion, subdir, modname);
+ module_dir, kernelversion, subdir, modname);
*overrides = add_override(pathname, *overrides);
free(pathname);
@@ -1737,6 +1739,7 @@ int main(int argc, char *argv[])
char *basedir = "", *dirname, *version;
char *system_map = NULL, *module_symvers = NULL;
int i;
+ char *module_dir;
const char *config = NULL;
if (native_endianness() == 0)
@@ -1832,7 +1835,11 @@ int main(int argc, char *argv[])
if (optind == argc)
all = 1;
- nofail_asprintf(&dirname, "%s%s%s", basedir, MODULE_DIR, version);
+ if((module_dir = getenv("MODULE_DIR")) == NULL) {
+ module_dir = "/lib/modules/";
+ }
+
+ nofail_asprintf(&dirname, "%s%s%s", basedir, module_dir, version);
if (maybe_all) {
if (!doing_stdout && !depfile_out_of_date(dirname))
@@ -1850,7 +1857,7 @@ int main(int argc, char *argv[])
size_t len;
nofail_asprintf(&dirname, "%s%s%s/updates", basedir,
- MODULE_DIR, version);
+ module_dir, version);
len = strlen(dirname);
search = add_search(dirname, len, search);
}
diff --git a/modinfo.c b/modinfo.c
index 1dd8469..67b1041 100644
--- a/modinfo.c
+++ b/modinfo.c
@@ -19,9 +19,6 @@
#include "zlibsupport.h"
#include "testing.h"
-#ifndef MODULE_DIR
-#define MODULE_DIR "/lib/modules"
-#endif
struct param
{
@@ -193,6 +190,11 @@ static struct elf_file *grab_module(const char *name,
struct utsname buf;
char *depname, *p, *moddir;
struct elf_file *module;
+ char *module_dir;
+
+ if((module_dir = getenv("MODULE_DIR")) == NULL) {
+ module_dir = "/lib/modules/";
+ }
if (strchr(name, '.') || strchr(name, '/')) {
module = grab_elf_file(name);
@@ -207,9 +209,9 @@ static struct elf_file *grab_module(const char *name,
kernel = buf.release;
}
if (strlen(basedir))
- nofail_asprintf(&moddir, "%s/%s/%s", basedir, MODULE_DIR, kernel);
+ nofail_asprintf(&moddir, "%s/%s/%s", basedir, module_dir, kernel);
else
- nofail_asprintf(&moddir, "%s/%s", MODULE_DIR, kernel);
+ nofail_asprintf(&moddir, "%s/%s", module_dir, kernel);
/* Search for it in modules.dep. */
nofail_asprintf(&depname, "%s/%s", moddir, "modules.dep");
diff --git a/modprobe.c b/modprobe.c
index 5464f45..d9fbf9d 100644
--- a/modprobe.c
+++ b/modprobe.c
@@ -86,10 +86,6 @@ typedef enum
} modprobe_flags_t;
-#ifndef MODULE_DIR
-#define MODULE_DIR "/lib/modules"
-#endif
-
/**
* print_usage - output the prefered program usage
*
@@ -2136,6 +2132,7 @@ int main(int argc, char *argv[])
struct modprobe_conf conf = {};
recursion_depth = 0;
+ char *module_dir = NULL;
/* Prepend options from environment. */
argv = merge_args(getenv("MODPROBE_OPTIONS"), argv, &argc);
@@ -2233,7 +2230,11 @@ int main(int argc, char *argv[])
if (argc < optind + 1 && !dump_config && !list_only)
print_usage(argv[0]);
- nofail_asprintf(&dirname, "%s%s/%s", basedir, MODULE_DIR, buf.release);
+ if((module_dir = getenv("MODULE_DIR")) == NULL) {
+ module_dir = "/lib/modules";
+ }
+
+ nofail_asprintf(&dirname, "%s%s/%s", basedir, module_dir, buf.release);
/* Old-style -t xxx wildcard? Only with -l. */
if (list_only) {

View File

@ -1,6 +1,6 @@
{ stdenv, fetchurl
, yacc, flex
, sysfsutils, module_init_tools, udev
, sysfsutils, kmod, udev
, firmware # Special pcmcia cards.
, config # Special hardware (map memory & port & irq)
, lib # used to generate postInstall script.
@ -15,11 +15,11 @@ stdenv.mkDerivation rec {
sha256 = "5d8e2efad8a7f692129610603da232f2144851753d8d49a70eeb8eb1be6f6bc3";
};
buildInputs = [udev yacc sysfsutils module_init_tools flex];
buildInputs = [udev yacc sysfsutils kmod flex];
patchPhase = ''
sed -i "
s,/sbin/modprobe,${module_init_tools}&,;
s,/sbin/modprobe,${kmod}&,;
s,/lib/udev/,$out/sbin/,;
" udev/* # fix-color */
sed -i "

View File

@ -1,10 +1,10 @@
{ stdenv, fetchurl, coreutils, gnugrep, utillinux, module_init_tools
{ stdenv, fetchurl, coreutils, gnugrep, utillinux, kmod
, procps, kbd, dbus_tools }:
let
binPath = stdenv.lib.makeBinPath
[ coreutils gnugrep utillinux module_init_tools procps kbd dbus_tools ];
[ coreutils gnugrep utillinux kmod procps kbd dbus_tools ];
sbinPath = stdenv.lib.makeSearchPathOutputs "sbin" ["bin"]
[ procps ];

View File

@ -18,7 +18,7 @@
{ stdenv, lib, fetchurl, pkgconfig, help2man, makeWrapper
, glib, libbsd
, libX11, libXext, xorgserver, xkbcomp, module_init_tools, xkeyboard_config, xf86videonouveau
, libX11, libXext, xorgserver, xkbcomp, kmod, xkeyboard_config, xf86videonouveau
, nvidia_x11, virtualgl, primusLib
# The below should only be non-null in a x86_64 system. On a i686
# system the above nvidia_x11 and virtualgl will be the i686 packages.
@ -43,7 +43,7 @@ let
nvidiaLibs = lib.makeLibraryPath nvidia_x11s;
bbdPath = lib.makeBinPath [ module_init_tools xorgserver ];
bbdPath = lib.makeBinPath [ kmod xorgserver ];
bbdLibs = lib.makeLibraryPath [ libX11 libXext ];
xmodules = lib.concatStringsSep "," (map (x: "${x}/lib/xorg/modules") ([ xorgserver ] ++ lib.optional (!useNvidia) xf86videonouveau));
@ -80,7 +80,7 @@ in stdenv.mkDerivation rec {
# be in PATH, and thus no action for them is required.
substituteInPlace src/module.c \
--replace "/sbin/modinfo" "${module_init_tools}/sbin/modinfo"
--replace "/sbin/modinfo" "${kmod}/sbin/modinfo"
# Don't use a special group, just reuse wheel.
substituteInPlace configure \

View File

@ -1,5 +1,5 @@
{ stdenv, lib, fetchFromGitHub, makeWrapper, perl, systemd, iw, rfkill, hdparm, ethtool, inetutils
, module_init_tools, pciutils, smartmontools, x86_energy_perf_policy, gawk, gnugrep, coreutils
, kmod, pciutils, smartmontools, x86_energy_perf_policy, gawk, gnugrep, coreutils
, enableRDW ? false, networkmanager
}:
@ -27,7 +27,7 @@ in stdenv.mkDerivation {
buildInputs = [ perl ];
paths = lib.makeBinPath
([ iw rfkill hdparm ethtool inetutils systemd module_init_tools pciutils smartmontools
([ iw rfkill hdparm ethtool inetutils systemd kmod pciutils smartmontools
x86_energy_perf_policy gawk gnugrep coreutils
]
++ lib.optional enableRDW networkmanager

View File

@ -1,5 +1,5 @@
{ stdenv, fetchurl, openconnect, intltool, pkgconfig, networkmanager, libsecret
, withGnome ? true, gnome3, procps, module_init_tools }:
, withGnome ? true, gnome3, procps, kmod }:
stdenv.mkDerivation rec {
name = "${pname}${if withGnome then "-gnome" else ""}-${version}";
@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
--replace "/sbin/sysctl" "${procps}/sbin/sysctl"
substituteInPlace "src/nm-openconnect-service.c" \
--replace "/usr/sbin/openconnect" "${openconnect}/sbin/openconnect" \
--replace "/sbin/modprobe" "${module_init_tools}/sbin/modprobe"
--replace "/sbin/modprobe" "${kmod}/sbin/modprobe"
'';
postConfigure = ''

View File

@ -1,5 +1,5 @@
{ stdenv, fetchurl, openvpn, intltool, pkgconfig, networkmanager, libsecret
, withGnome ? true, gnome3, procps, module_init_tools }:
, withGnome ? true, gnome3, procps, kmod }:
stdenv.mkDerivation rec {
name = "${pname}${if withGnome then "-gnome" else ""}-${version}";
@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
--replace "/sbin/sysctl" "${procps}/sbin/sysctl"
substituteInPlace "src/nm-openvpn-service.c" \
--replace "/sbin/openvpn" "${openvpn}/sbin/openvpn" \
--replace "/sbin/modprobe" "${module_init_tools}/sbin/modprobe"
--replace "/sbin/modprobe" "${kmod}/sbin/modprobe"
substituteInPlace "properties/auth-helpers.c" \
--replace "/sbin/openvpn" "${openvpn}/sbin/openvpn"
'';

View File

@ -1,5 +1,5 @@
{ stdenv, fetchurl, vpnc, intltool, pkgconfig, networkmanager, libsecret
, withGnome ? true, gnome3, procps, module_init_tools }:
, withGnome ? true, gnome3, procps, kmod }:
stdenv.mkDerivation rec {
name = "${pname}${if withGnome then "-gnome" else ""}-${version}";
@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
--replace "/sbin/sysctl" "${procps}/sbin/sysctl"
substituteInPlace "src/nm-vpnc-service.c" \
--replace "/sbin/vpnc" "${vpnc}/sbin/vpnc" \
--replace "/sbin/modprobe" "${module_init_tools}/sbin/modprobe"
--replace "/sbin/modprobe" "${kmod}/sbin/modprobe"
'';
postConfigure = ''

View File

@ -59,6 +59,7 @@ doNotDisplayTwice rec {
manpages = man-pages; # added 2015-12-06
midoriWrapper = midori; # added 2015-01
mlt-qt5 = qt5.mlt; # added 2015-12-19
module_init_tools = kmod; # added 2016-04-22
mssys = ms-sys; # added 2015-12-13
multipath_tools = multipath-tools; # added 2016-01-21
mupen64plus1_5 = mupen64plus; # added 2016-02-12

View File

@ -10885,8 +10885,6 @@ in
mmc-utils = callPackage ../os-specific/linux/mmc-utils { };
module_init_tools = callPackage ../os-specific/linux/module-init-tools { };
aggregateModules = modules:
callPackage ../os-specific/linux/kmod/aggregator.nix {
inherit modules;

View File

@ -105,7 +105,6 @@ with import ./release-lib.nix { inherit supportedSystems; };
mingetty = linux;
mk = linux;
mktemp = all;
module_init_tools = linux;
mono = linux;
monotone = linux;
mpg321 = linux;