summary refs log tree commit diff
path: root/pkgs/os-specific/linux/module-init-tools/module-dir.patch
blob: cda28c14527dd41bd8d979970c3744a588a8813e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
diff -rc module-init-tools-3.4-orig/depmod.c module-init-tools-3.4/depmod.c
*** module-init-tools-3.4-orig/depmod.c	2007-10-07 23:51:46.000000000 +0200
--- module-init-tools-3.4/depmod.c	2008-08-11 12:03:14.000000000 +0200
***************
*** 1066,1071 ****
--- 1066,1072 ----
  		*system_map = NULL;
  	struct module *list = NULL;
  	int i;
+  	char *module_dir;
  	const char *config = NULL;
  	struct module_search *search = NULL;
  	struct module_overrides *overrides = NULL;
***************
*** 1148,1157 ****
  	if (optind == argc)
  		all = 1;
  
  	dirname = NOFAIL(malloc(strlen(basedir)
! 			 + strlen(MODULE_DIR)
  			 + strlen(version) + 1));
! 	sprintf(dirname, "%s%s%s", basedir, MODULE_DIR, version);
  
  	if (maybe_all) {
  		if (!doing_stdout && !depfile_out_of_date(dirname))
--- 1149,1162 ----
  	if (optind == argc)
  		all = 1;
  
+         if((module_dir = getenv("MODULE_DIR")) == NULL) {
+                 module_dir = "/lib/modules/";
+         }
+ 
  	dirname = NOFAIL(malloc(strlen(basedir)
! 			 + strlen(module_dir)
  			 + strlen(version) + 1));
! 	sprintf(dirname, "%s%s%s", basedir, module_dir, version);
  
  	if (maybe_all) {
  		if (!doing_stdout && !depfile_out_of_date(dirname))
Only in module-init-tools-3.4/: depmod.c~
Only in module-init-tools-3.4/: depmod.c.rej
diff -rc module-init-tools-3.4-orig/modinfo.c module-init-tools-3.4/modinfo.c
*** 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
***************
*** 18,27 ****
  #define streq(a,b) (strcmp((a),(b)) == 0)
  #define strstarts(a,start) (strncmp((a),(start), strlen(start)) == 0)
  
- #ifndef MODULE_DIR
- #define MODULE_DIR "/lib/modules"
- #endif
- 
  static int elf_endian;
  static int my_endian;
  
--- 18,23 ----
***************
*** 278,283 ****
--- 274,280 ----
  	char *data;
  	struct utsname buf;
  	char *depname, *p;
+ 	char *module_dir;
  
  	data = grab_file(name, size);
  	if (data) {
***************
*** 290,301 ****
  		return NULL;
  	}
  
  	/* Search for it in modules.dep. */
  	if (kernel) {
! 		asprintf(&depname, "%s/%s/modules.dep", MODULE_DIR, kernel);
  	} else {
  		uname(&buf);
! 		asprintf(&depname, "%s/%s/modules.dep", MODULE_DIR,
  			 buf.release);
  	}
  	data = grab_file(depname, size);
--- 287,302 ----
  		return NULL;
  	}
  
+ 	if((module_dir = getenv("MODULE_DIR")) == NULL) {
+ 		module_dir = "/lib/modules";
+ 	}
+  
  	/* Search for it in modules.dep. */
  	if (kernel) {
! 		asprintf(&depname, "%s/%s/modules.dep", module_dir, kernel);
  	} else {
  		uname(&buf);
! 		asprintf(&depname, "%s/%s/modules.dep", module_dir,
  			 buf.release);
  	}
  	data = grab_file(depname, size);
Only in module-init-tools-3.4/: modinfo.c~
Only in module-init-tools-3.4/: modinfo.c.rej
diff -rc module-init-tools-3.4-orig/modprobe.c module-init-tools-3.4/modprobe.c
*** module-init-tools-3.4-orig/modprobe.c	2007-10-07 23:57:23.000000000 +0200
--- module-init-tools-3.4/modprobe.c	2008-08-11 12:06:54.000000000 +0200
***************
*** 55,64 ****
  	char filename[0];
  };
  
- #ifndef MODULE_DIR
- #define MODULE_DIR "/lib/modules"
- #endif
- 
  typedef void (*errfn_t)(const char *fmt, ...);
  
  /* Do we use syslog or stderr for messages? */
--- 55,60 ----
***************
*** 1433,1438 ****
--- 1429,1435 ----
  	char *newname = NULL;
  	char *aliasfilename, *symfilename;
  	errfn_t error = fatal;
+  	char *module_dir = NULL;
  	int flags = O_NONBLOCK|O_EXCL;
  
  	/* Prepend options from environment. */
***************
*** 1559,1566 ****
  	if (argc < optind + 1 && !dump_only && !list_only && !remove)
  		print_usage(argv[0]);
  
! 	dirname = NOFAIL(malloc(strlen(buf.release) + sizeof(MODULE_DIR) + 1));
! 	sprintf(dirname, "%s/%s", MODULE_DIR, buf.release);
  	aliasfilename = NOFAIL(malloc(strlen(dirname)
  				      + sizeof("/modules.alias")));
  	sprintf(aliasfilename, "%s/modules.alias", dirname);
--- 1556,1567 ----
  	if (argc < optind + 1 && !dump_only && !list_only && !remove)
  		print_usage(argv[0]);
  
! 	if((module_dir = getenv("MODULE_DIR")) == NULL) {
! 		module_dir = "/lib/modules";
! 	}
! 
! 	dirname = NOFAIL(malloc(strlen(buf.release) + strlen(module_dir) + 2));
! 	sprintf(dirname, "%s/%s", module_dir, buf.release);
  	aliasfilename = NOFAIL(malloc(strlen(dirname)
  				      + sizeof("/modules.alias")));
  	sprintf(aliasfilename, "%s/modules.alias", dirname);
Only in module-init-tools-3.4/: modprobe.c~
Only in module-init-tools-3.4/: modprobe.c.rej