From: John P. Davis Date: Fri, 21 May 2004 15:28:05 +0000 (+0000) Subject: small fixup to the modblacklist code X-Git-Tag: CATALYST_2_0_6_916~993 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=243c5948447304456ef82b1407274401f2b71ed5;p=catalyst.git small fixup to the modblacklist code git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@380 d1e1f19c-881f-0410-ab34-b69fee027534 --- diff --git a/modules/livecd_stage2_target.py b/modules/livecd_stage2_target.py index 3076af33..8d00a7ba 100644 --- a/modules/livecd_stage2_target.py +++ b/modules/livecd_stage2_target.py @@ -1,6 +1,6 @@ # Distributed under the GNU General Public License version 2 # Copyright 2003-2004 Gentoo Technologies, Inc. -# $Header: /var/cvsroot/gentoo/src/catalyst/modules/livecd_stage2_target.py,v 1.5 2004/05/20 21:16:56 zhen Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/modules/livecd_stage2_target.py,v 1.6 2004/05/21 15:28:05 zhen Exp $ """ Builder class for a LiveCD stage2 build. @@ -156,8 +156,8 @@ class livecd_stage2_target(generic_stage_target): self.unbind() raise CatalystError, "Couldn't copy kernel config: "+self.settings["boot/kernel/"+kname+"/config"] - # If we need to pass special options to the bootloader for this kernel - # put them into the environment. + # If we need to pass special options to the bootloader + # for this kernel put them into the environment. if self.settings.has_key("boot/kernel/"+kname+"/kernelopts"): myopts=self.settings["boot/kernel/"+kname+"/kernelopts"] if type(myopts) != types.StringType: @@ -175,17 +175,15 @@ class livecd_stage2_target(generic_stage_target): # what modules do we want to blacklist? if self.settings.has_key("livecd/modblacklist"): - mylist=self.settings["livecd/modblacklist"] - if type(mylist)==types.StringType: - mylist=[mylist] - try: - myf=open(self.settings["chroot_path"]+"/etc/hotplug/blacklist","a") - except: - self.unbind() - raise CatalystError,"Couldn't open "+self.settings["chroot_path"]+"/etc/hotplug/blacklist." - myf.write("\n#Added by Catalyst:") - for x in mylist: - myf.write("\n"+x+"\n") + try: + myf=open(self.settings["chroot_path"]+"/etc/hotplug/blacklist","a") + except: + self.unbind() + raise CatalystError,"Couldn't open "+self.settings["chroot_path"]+"/etc/hotplug/blacklist." + myf.write("\n#Added by Catalyst:") + for x in self.settings["livecd/modblacklist"]: + myf.write("\n"+x) + myf.close() def register(foo): foo.update({"livecd-stage2":livecd_stage2_target})