FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu Kernel Team

 
 
LinkBack Thread Tools
 
Old 01-15-2010, 08:23 PM
Peter Jones
 
Default Load all scsi_dh_* modules, since they can't be modprobe by aliases...

Load all scsi_dh_* modules. These know how to bind to scsi targets, and
which devices to bind to, so this will really only effect people with those
targets.
---
loader/loader.c | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++ +
1 files changed, 51 insertions(+), 0 deletions(-)

diff --git a/loader/loader.c b/loader/loader.c
index 645e7cf..9605b69 100644
--- a/loader/loader.c
+++ b/loader/loader.c
@@ -49,6 +49,7 @@
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/wait.h>
+#include <sys/utsname.h>

#include <linux/fb.h>
#include <linux/serial.h>
@@ -1767,6 +1768,54 @@ static void add_to_path_env(const char *env, const char *val)
setenv(env, newenv, 1);
}

+static void loadScsiDhModules(void)
+{
+ struct utsname utsname;
+ char *modules = NULL;
+ char *tmp = NULL;
+ struct dirent *ent = NULL;
+
+ uname(&utsname);
+ checked_asprintf(&tmp,
+ "/lib/modules/%s/kernel/drivers/scsi/device_handler", utsname.release);
+
+ DIR *dir = opendir(tmp);
+ free(tmp);
+ if (!dir)
+ return;
+
+ int fd = dirfd(dir);
+ while ((ent = readdir(dir)) != NULL) {
+ struct stat sb;
+
+ if (fstatat(fd, ent->d_name, &sb, 0) < 0)
+ continue;
+
+ size_t len = strlen(ent->d_name) - 3;
+ if (strcmp(ent->d_name+len, ".ko"))
+ continue;
+
+ if (S_ISREG(sb.st_mode)) {
+ char modname[len+1];
+ strncpy(modname, ent->d_name, len);
+ modname[len] = '';
+
+ if (modules && modules[0]) {
+ checked_asprintf(&tmp, "%s:%s", modules, modname);
+ } else {
+ checked_asprintf(&tmp, "%s", modname);
+ }
+
+ free(modules);
+ modules = tmp;
+ }
+ }
+ closedir(dir);
+
+ mlLoadModuleSet(modules);
+ free(modules);
+}
+
int main(int argc, char ** argv) {
int rc, ret, pid, status;

@@ -1930,6 +1979,8 @@ int main(int argc, char ** argv) {

mlLoadModuleSet("cramfs:squashfs:iscsi_tcp");

+ loadScsiDhModules();
+
#if !defined(__s390__) && !defined(__s390x__)
mlLoadModuleSet("floppy:eddcspkr:iscsi_ibft");
#endif
--
1.6.5.2

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 09:07 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org