X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=source%2Fsteps%2FWriteModprobeConfig.py;h=9549c080650192f8082e627346272b4576124a86;hb=83aabfdd97b47a41e3d62b91d8aba0ffca617c0b;hp=a50fcc459ebf59efc658032a62abc9c0a3a016e9;hpb=ae73c450bffe036dccf37e8d96a4b655c3cd900e;p=bootmanager.git diff --git a/source/steps/WriteModprobeConfig.py b/source/steps/WriteModprobeConfig.py index a50fcc4..9549c08 100644 --- a/source/steps/WriteModprobeConfig.py +++ b/source/steps/WriteModprobeConfig.py @@ -1,4 +1,4 @@ -#!/usr/bin/python2 -u +#!/usr/bin/python # Copyright (c) 2003 Intel Corporation # All rights reserved. @@ -13,6 +13,7 @@ import utils import systeminfo import BootAPI import ModelOptions +import notify_messages def Run( vars, log, filename = "/etc/modprobe.conf"): """ @@ -50,27 +51,30 @@ def Run( vars, log, filename = "/etc/modprobe.conf"): if sysmods is None: raise BootManagerException, "Unable to get list of system modules." - eth_count= 0 - scsi_count= 0 - modulesconf_file= file("%s/%s" % (SYSIMG_PATH,filename), "w" ) - - for type in sysmods: - if type == systeminfo.MODULE_CLASS_SCSI: - for a_mod in sysmods[type]: - if scsi_count == 0: - modulesconf_file.write( "alias scsi_hostadapter %s\n" % - a_mod ) - else: - modulesconf_file.write( "alias scsi_hostadapter%d %s\n" % - (scsi_count,a_mod) ) - scsi_count= scsi_count + 1 - - elif type == systeminfo.MODULE_CLASS_NETWORK: - for a_mod in sysmods[type]: - modulesconf_file.write( "alias eth%d %s\n" % - (eth_count,a_mod) ) - eth_count= eth_count + 1 + 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 + for a_mod in sysmods[systeminfo.MODULE_CLASS_SCSI]: + line="alias scsi_hostadapter%d %s\n" % (count,a_mod) + modulesconf_file.write(line) + count=count+1 + + # This should involve looking at the NodeNetworks associated with + # this node and matching on their ethernet address. Barring that + # information order the remaining ethX numbering according to PCI + # enumeration order. This should be integrated with + # WriteNetworkConfig and integrate. For now lets just comment out + # the 'alias ethX a_mod' lines in modprobe.conf + count=0 + for a_mod in sysmods[systeminfo.MODULE_CLASS_NETWORK]: + line="# Want to comment this out in the future.\n" + line+="alias eth%d %s\n" % (count,a_mod) + modulesconf_file.write(line) + count=count+1 modulesconf_file.close() modulesconf_file= None @@ -87,10 +91,12 @@ def Run( vars, log, filename = "/etc/modprobe.conf"): # before we do the real kexec, check to see if we had any # network drivers written to modprobe.conf. if not, return -1, # which will cause this node to be switched to a debug state. + scsi_count=len(sysmods[systeminfo.MODULE_CLASS_SCSI]) + eth_count=len(sysmods[systeminfo.MODULE_CLASS_NETWORK]) if eth_count == 0: log.write( "\nIt appears we don't have any network drivers. Aborting.\n" ) - vars['BOOT_STATE']= 'dbg' + vars['BOOT_STATE']= 'failboot' vars['STATE_CHANGE_NOTIFY']= 1 vars['STATE_CHANGE_NOTIFY_MESSAGE']= \ notify_messages.MSG_NO_DETECTED_NETWORK