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 > Redhat > Device-mapper Development

 
 
LinkBack Thread Tools
 
Old 03-08-2011, 05:55 AM
"Brian C. Lane"
 
Default Write /tmp/anaconda.conf (#569883)

So that the modules will remain blacklisted through reboots, write out
a blacklist file for modprobe. This is copied to /etc/modprobe.d/ by
yuminstall.py after the filesystem is formatted

Related: rhbz#569883
---
loader2/loader.c | 3 +++
loader2/modules.c | 23 +++++++++++++++++++++++
loader2/modules.h | 1 +
3 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/loader2/loader.c b/loader2/loader.c
index db22da3..488bb5b 100644
--- a/loader2/loader.c
+++ b/loader2/loader.c
@@ -1819,6 +1819,9 @@ int main(int argc, char ** argv) {
* describing which scsi disks go with which scsi adapters */
writeScsiDisks(modLoaded);

+ /* Write out the module blacklist file */
+ mlWriteBlacklist();
+
/* if we are in rescue mode lets load st.ko for tape support */
if (FL_RESCUE(flags))
scsiTapeInitialize(modLoaded, modDeps, modInfo);
diff --git a/loader2/modules.c b/loader2/modules.c
index b79eb50..28c1851 100644
--- a/loader2/modules.c
+++ b/loader2/modules.c
@@ -1125,3 +1125,26 @@ void loadKickstartModule(struct loaderData_s * loaderData, int argc,
loaderData->modInfo, args);
}

+void mlWriteBlacklist() {
+ int fd;
+ int i;
+ int ret;
+ char *buf;
+
+ /* Write out the blacklist, used by modprobe on bootup */
+ fd = open("/tmp/anaconda.conf", O_WRONLY | O_CREAT, 0666);
+ if (fd == -1) {
+ logMessage(ERROR, "error writing /tmp/anaconda.conf: %s
",
+ strerror(errno));
+ return;
+ }
+ for (i=0; i < cmdline_argc; i++) {
+ if (!strncasecmp(cmdline_argv[i], "blacklist=", 10)) {
+ asprintf( &buf, "blacklist %s
", cmdline_argv[i] + 10 );
+ ret = write(fd, buf, strlen(buf));
+ free(buf);
+ }
+ }
+ close(fd);
+}
+
diff --git a/loader2/modules.h b/loader2/modules.h
index bbcc905..536a199 100644
--- a/loader2/modules.h
+++ b/loader2/modules.h
@@ -41,4 +41,5 @@ void writeScsiDisks(moduleList list);
int removeLoadedModule(const char * modName, moduleList modLoaded);
char * getModuleLocation(int version);

+void mlWriteBlacklist();
#endif
--
1.7.4

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 03-08-2011, 06:57 AM
Ales Kozumplik
 
Default Write /tmp/anaconda.conf (#569883)

On 03/08/2011 07:55 AM, Brian C. Lane wrote:

So that the modules will remain blacklisted through reboots, write out
a blacklist file for modprobe. This is copied to /etc/modprobe.d/ by
yuminstall.py after the filesystem is formatted

Related: rhbz#569883
---
+ /* Write out the blacklist, used by modprobe on bootup */
+ fd = open("/tmp/anaconda.conf", O_WRONLY | O_CREAT, 0666);


Won't this override the file if it already existed?

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 03-08-2011, 03:05 PM
Chris Lumens
 
Default Write /tmp/anaconda.conf (#569883)

> +void mlWriteBlacklist() {
> + int fd;
> + int i;
> + int ret;
> + char *buf;
> +
> + /* Write out the blacklist, used by modprobe on bootup */
> + fd = open("/tmp/anaconda.conf", O_WRONLY | O_CREAT, 0666);

Maybe I'm just paranoid, but I don't see why you'd do 0666 instead of
0644 or 0664.

- Chris

_______________________________________________
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 06:38 PM.

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