- modulesconf_file= file("%s/%s" % (SYSIMG_PATH,filename), "w" )
- modulesconf_file.write("options ata_generic all_generic_ide=1\n")
-
- # MEF: I am not sure this is the proper thing to do if there are
- # two completely different scsi_hostadapter. I think its ok, but
- # it seems rather arbitrary.
- count=0
+ # parse the existing modprobe.conf file, if one exists
+ mfile = "%s/%s" % (SYSIMG_PATH,filename)
+ m = modprobe.Modprobe()
+ if os.path.exists(mfile):
+ m.input(mfile)
+
+ blacklist = modprobe.Modprobe()
+ blacklistfiles = ("blacklist","blacklist-compat","blacklist-firewire")
+ for blf in blacklistfiles:
+ if os.path.exists("/etc/modprobe.d/%s"%blf):
+ blacklist.input("/etc/modprobe.d/%s"%blf)
+
+ # storage devices
+ m.optionsset("ata_generic","all_generic_ide=1")
+ scsi_count= 0