module-init-tools: 3.16

svn path=/nixpkgs/trunk/; revision=29556
This commit is contained in:
Shea Levy 2011-10-02 04:03:02 +00:00
parent 72f41379be
commit 4b795e225b
3 changed files with 174 additions and 168 deletions

View File

@ -1,23 +1,16 @@
{stdenv, fetchurl}: {stdenv, fetchurl, docbook2x}:
stdenv.mkDerivation { stdenv.mkDerivation rec {
name = "module-init-tools-3.4"; name = "module-init-tools-3.16";
src = [ src = fetchurl {
(fetchurl { url = "mirror://kernel/linux/utils/kernel/module-init-tools/${name}.tar.bz2";
url = mirror://kernel/linux/utils/kernel/module-init-tools/module-init-tools-3.4.tar.bz2; sha256 = "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1";
sha256 = "11rxcdr915skc1m6dcavavw8dhcsy24wpi56sw1m4akj2frs3iwn"; };
})
# Upstream forgot to include the generated manpages. Thankfully buildInputs = [ docbook2x ];
# the Gentoo people fixed this for us :-)
(fetchurl {
url = mirror://gentoo/distfiles/module-init-tools-3.4-manpages.tar.bz2;
sha256 = "0jid24girjhr30mrdckylkcz11v4in46nshhrqv18yaxm6506v6j";
})
];
patches = [./module-dir.patch]; patches = [ ./module-dir.patch ./docbook2man.patch ];
postInstall = "rm $out/sbin/insmod.static"; # don't need it postInstall = "rm $out/sbin/insmod.static"; # don't need it

View File

@ -0,0 +1,12 @@
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,152 +1,153 @@
diff -rc module-init-tools-3.4-orig/depmod.c module-init-tools-3.4/depmod.c diff -Naur module-init-tools-3.16-orig/depmod.c module-init-tools-3.16/depmod.c
*** module-init-tools-3.4-orig/depmod.c 2007-10-07 23:51:46.000000000 +0200 --- module-init-tools-3.16-orig/depmod.c 2011-06-02 13:55:01.000000000 -0400
--- module-init-tools-3.4/depmod.c 2008-08-11 12:03:14.000000000 +0200 +++ module-init-tools-3.16/depmod.c 2011-10-01 23:30:14.947293695 -0400
*************** @@ -48,10 +48,6 @@
*** 1066,1071 ****
--- 1066,1072 ---- #include "testing.h"
*system_map = NULL;
struct module *list = NULL; -#ifndef MODULE_DIR
int i; -#define MODULE_DIR "/lib/modules/"
+ char *module_dir; -#endif
const char *config = NULL; -
struct module_search *search = NULL; #ifndef MODULE_BUILTIN_KEY
struct module_overrides *overrides = NULL; #define MODULE_BUILTIN_KEY "built-in"
*************** #endif
*** 1148,1157 **** @@ -1514,6 +1510,7 @@
if (optind == argc) struct module_overrides **overrides)
all = 1; {
char *line;
dirname = NOFAIL(malloc(strlen(basedir) + char *module_dir;
! + strlen(MODULE_DIR) unsigned int linenum = 0;
+ strlen(version) + 1)); FILE *cfile;
! sprintf(dirname, "%s%s%s", basedir, MODULE_DIR, version);
@@ -1536,6 +1533,9 @@
if (maybe_all) { continue;
if (!doing_stdout && !depfile_out_of_date(dirname)) }
--- 1149,1162 ----
if (optind == argc) + if((module_dir = getenv("MODULE_DIR")) == NULL)
all = 1; + module_dir = "/lib/modules/";
+
+ if((module_dir = getenv("MODULE_DIR")) == NULL) { if (streq(cmd, "search")) {
+ module_dir = "/lib/modules/"; char *search_path;
+ }
+ @@ -1550,7 +1550,7 @@
dirname = NOFAIL(malloc(strlen(basedir) continue;
! + strlen(module_dir) }
+ strlen(version) + 1)); nofail_asprintf(&dirname, "%s%s%s/%s", basedir,
! sprintf(dirname, "%s%s%s", basedir, module_dir, version); - MODULE_DIR, kernelversion, search_path);
+ module_dir, kernelversion, search_path);
if (maybe_all) { len = strlen(dirname);
if (!doing_stdout && !depfile_out_of_date(dirname)) *search = add_search(dirname, len, *search);
Only in module-init-tools-3.4/: depmod.c~ free(dirname);
Only in module-init-tools-3.4/: depmod.c.rej @@ -1565,7 +1565,7 @@
diff -rc module-init-tools-3.4-orig/modinfo.c module-init-tools-3.4/modinfo.c continue;
*** module-init-tools-3.4-orig/modinfo.c 2007-10-07 23:51:46.000000000 +0200
--- module-init-tools-3.4/modinfo.c 2008-08-11 12:07:55.000000000 +0200 nofail_asprintf(&pathname, "%s%s%s/%s/%s.ko", basedir,
*************** - MODULE_DIR, kernelversion, subdir, modname);
*** 18,27 **** + module_dir, kernelversion, subdir, modname);
#define streq(a,b) (strcmp((a),(b)) == 0)
#define strstarts(a,start) (strncmp((a),(start), strlen(start)) == 0) *overrides = add_override(pathname, *overrides);
free(pathname);
- #ifndef MODULE_DIR @@ -1737,6 +1737,7 @@
- #define MODULE_DIR "/lib/modules" char *basedir = "", *dirname, *version;
- #endif char *system_map = NULL, *module_symvers = NULL;
- int i;
static int elf_endian; + char *module_dir;
static int my_endian; const char *config = NULL;
--- 18,23 ---- if (native_endianness() == 0)
*************** @@ -1832,7 +1833,10 @@
*** 278,283 **** if (optind == argc)
--- 274,280 ---- all = 1;
char *data;
struct utsname buf; - nofail_asprintf(&dirname, "%s%s%s", basedir, MODULE_DIR, version);
char *depname, *p; + if((module_dir = getenv("MODULE_DIR")) == NULL)
+ char *module_dir; + module_dir = "/lib/modules/";
+
data = grab_file(name, size); + nofail_asprintf(&dirname, "%s%s%s", basedir, module_dir, version);
if (data) {
*************** if (maybe_all) {
*** 290,301 **** if (!doing_stdout && !depfile_out_of_date(dirname))
return NULL; @@ -1850,7 +1854,7 @@
} size_t len;
/* Search for it in modules.dep. */ nofail_asprintf(&dirname, "%s%s%s/updates", basedir,
if (kernel) { - MODULE_DIR, version);
! asprintf(&depname, "%s/%s/modules.dep", MODULE_DIR, kernel); + module_dir, version);
} else { len = strlen(dirname);
uname(&buf); search = add_search(dirname, len, search);
! asprintf(&depname, "%s/%s/modules.dep", MODULE_DIR, }
buf.release); diff -Naur module-init-tools-3.16-orig/modinfo.c module-init-tools-3.16/modinfo.c
} --- module-init-tools-3.16-orig/modinfo.c 2011-06-02 13:55:01.000000000 -0400
data = grab_file(depname, size); +++ module-init-tools-3.16/modinfo.c 2011-10-01 23:32:15.335093548 -0400
--- 287,302 ---- @@ -19,10 +19,6 @@
return NULL; #include "zlibsupport.h"
} #include "testing.h"
+ if((module_dir = getenv("MODULE_DIR")) == NULL) { -#ifndef MODULE_DIR
+ module_dir = "/lib/modules"; -#define MODULE_DIR "/lib/modules"
+ } -#endif
+ -
/* Search for it in modules.dep. */ struct param
if (kernel) { {
! asprintf(&depname, "%s/%s/modules.dep", module_dir, kernel); struct param *next;
} else { @@ -192,6 +188,7 @@
uname(&buf); unsigned long size;
! asprintf(&depname, "%s/%s/modules.dep", module_dir, struct utsname buf;
buf.release); char *depname, *p, *moddir;
} + char *module_dir;
data = grab_file(depname, size); struct elf_file *module;
Only in module-init-tools-3.4/: modinfo.c~
Only in module-init-tools-3.4/: modinfo.c.rej if (strchr(name, '.') || strchr(name, '/')) {
diff -rc module-init-tools-3.4-orig/modprobe.c module-init-tools-3.4/modprobe.c @@ -206,10 +203,14 @@
*** module-init-tools-3.4-orig/modprobe.c 2007-10-07 23:57:23.000000000 +0200 uname(&buf);
--- module-init-tools-3.4/modprobe.c 2008-08-11 12:06:54.000000000 +0200 kernel = buf.release;
*************** }
*** 55,64 **** +
char filename[0]; + if((module_dir = getenv("MODULE_DIR")) == NULL)
}; + module_dir = "/lib/modules/";
+
- #ifndef MODULE_DIR if (strlen(basedir))
- #define MODULE_DIR "/lib/modules" - nofail_asprintf(&moddir, "%s/%s/%s", basedir, MODULE_DIR, kernel);
- #endif + nofail_asprintf(&moddir, "%s/%s/%s", basedir, module_dir, kernel);
- else
typedef void (*errfn_t)(const char *fmt, ...); - nofail_asprintf(&moddir, "%s/%s", MODULE_DIR, kernel);
+ nofail_asprintf(&moddir, "%s/%s", module_dir, kernel);
/* Do we use syslog or stderr for messages? */
--- 55,60 ---- /* Search for it in modules.dep. */
*************** nofail_asprintf(&depname, "%s/%s", moddir, "modules.dep");
*** 1433,1438 **** diff -Naur module-init-tools-3.16-orig/modprobe.c module-init-tools-3.16/modprobe.c
--- 1429,1435 ---- --- module-init-tools-3.16-orig/modprobe.c 2011-06-02 13:55:01.000000000 -0400
char *newname = NULL; +++ module-init-tools-3.16/modprobe.c 2011-10-01 23:34:04.111913368 -0400
char *aliasfilename, *symfilename; @@ -86,10 +86,6 @@
errfn_t error = fatal;
+ char *module_dir = NULL; } modprobe_flags_t;
int flags = O_NONBLOCK|O_EXCL;
-#ifndef MODULE_DIR
/* Prepend options from environment. */ -#define MODULE_DIR "/lib/modules"
*************** -#endif
*** 1559,1566 **** -
if (argc < optind + 1 && !dump_only && !list_only && !remove) /**
print_usage(argv[0]); * print_usage - output the prefered program usage
*
! dirname = NOFAIL(malloc(strlen(buf.release) + sizeof(MODULE_DIR) + 1)); @@ -2131,6 +2127,7 @@
! sprintf(dirname, "%s/%s", MODULE_DIR, buf.release); char *cmdline_opts = NULL;
aliasfilename = NOFAIL(malloc(strlen(dirname) char *dirname;
+ sizeof("/modules.alias"))); errfn_t error = fatal;
sprintf(aliasfilename, "%s/modules.alias", dirname); + char *module_dir;
--- 1556,1567 ---- int failed = 0;
if (argc < optind + 1 && !dump_only && !list_only && !remove) modprobe_flags_t flags = 0;
print_usage(argv[0]); struct modprobe_conf conf = {};
@@ -2233,7 +2230,10 @@
! if((module_dir = getenv("MODULE_DIR")) == NULL) { if (argc < optind + 1 && !dump_config && !list_only)
! module_dir = "/lib/modules"; print_usage(argv[0]);
! }
! - nofail_asprintf(&dirname, "%s%s/%s", basedir, MODULE_DIR, buf.release);
! dirname = NOFAIL(malloc(strlen(buf.release) + strlen(module_dir) + 2)); + if((module_dir = getenv("MODULE_DIR")) == NULL)
! sprintf(dirname, "%s/%s", module_dir, buf.release); + module_dir = "/lib/modules/";
aliasfilename = NOFAIL(malloc(strlen(dirname) +
+ sizeof("/modules.alias"))); + nofail_asprintf(&dirname, "%s%s/%s", basedir, module_dir, buf.release);
sprintf(aliasfilename, "%s/modules.alias", dirname);
Only in module-init-tools-3.4/: modprobe.c~ /* Old-style -t xxx wildcard? Only with -l. */
Only in module-init-tools-3.4/: modprobe.c.rej if (list_only) {