add arch runscript
authorBrad House <brad_mssw@gentoo.org>
Sat, 17 Jan 2004 18:43:40 +0000 (18:43 +0000)
committerBrad House <brad_mssw@gentoo.org>
Sat, 17 Jan 2004 18:43:40 +0000 (18:43 +0000)
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@170 d1e1f19c-881f-0410-ab34-b69fee027534

catalyst-runscript.diff
modules/targets.py

index 8fc49b56ec80155fd3ef9cf80fcda85df5ccc57a..8c89c6d9572ed9c24bc2f2d8b404c86a967ff5ed 100644 (file)
@@ -19,7 +19,7 @@ diff -u -r1.60 targets.py
  class livecd_stage2_target(generic_stage_target):
        def __init__(self,spec,addlargs):
 -              self.required_values=["boot/kernel","livecd/runscript"]
-+              self.required_values=["boot/kernel","livecd/archrunscript","livecd/runscript"]
++              self.required_values=["boot/kernel","livecd/archscript","livecd/runscript"]
                if not addlargs.has_key("boot/kernel"):
                        raise CatalystError, "Required value boot/kernel not specified."
                if type(addlargs["boot/kernel"]) == types.StringType:
@@ -28,7 +28,7 @@ diff -u -r1.60 targets.py
                                raise CatalystError, "Couldn't copy kernel config: "+self.settings["boot/kernel/"+x+"/config"]
                try:
 -                      cmd("/bin/bash "+self.settings["livecd/runscript"]+" run "+list_bashify(args),"runscript failed")
-+                      cmd("env ARCH_RUNSCRIPT="+self.settings["livecd/archrunscript"]+" "+self.settings["livecd/runscript"]+" kernbuild "+list_bashify(args),"runscript kernbuild failed")
++                      cmd("env ARCH_RUNSCRIPT="+self.settings["livecd/archscript"]+" "+self.settings["livecd/runscript"]+" kernbuild "+list_bashify(args),"runscript kernbuild failed")
                except CatalystError:
                        self.unbind()
                        raise CatalystError,"livecd-stage2 build aborting due to error."
@@ -36,7 +36,7 @@ diff -u -r1.60 targets.py
  class livecd_stage3_target(generic_stage_target):
        def __init__(self,spec,addlargs):
 -              self.required_values=["boot/kernel","livecd/runscript"]
-+              self.required_values=["boot/kernel","livecd/archrunscript","livecd/runscript"]
++              self.required_values=["boot/kernel","livecd/archscript","livecd/runscript"]
                self.valid_values=self.required_values[:]
                self.valid_values.extend(["livecd/cdtar","livecd/empty","livecd/rm","livecd/unmerge"])
                generic_stage_target.__init__(self,spec,addlargs)
@@ -44,8 +44,8 @@ diff -u -r1.60 targets.py
                                raise CatalystError, "Cannot locate specified livecd/cdtar: "+self.settings["livecd/cdtar"]
                if not os.path.exists(self.settings["livecd/runscript"]):
                                raise CatalystError, "Cannot locate specified livecd/runscript: "+self.settings["livecd/runscript"]
-+              if not os.path.exists(self.settings["livecd/archrunscript"]):
-+                              raise CatalystError, "Cannot locate specified livecd/archrunscript: "+self.settings["livecd/archrunscript"]
++              if not os.path.exists(self.settings["livecd/archscript"]):
++                              raise CatalystError, "Cannot locate specified livecd/archscript: "+self.settings["livecd/archscript"]
  
        def unmerge(self):
                if self.settings["target"]=="livecd-stage3" and self.settings.has_key("livecd/unmerge"):
@@ -55,7 +55,7 @@ diff -u -r1.60 targets.py
  
 +      def setupfs(self):
 +              try:
-+                      cmd("env ARCH_RUNSCRIPT="+self.settings["livecd/archrunscript"]+" "+self.settings["livecd/runscript"]+" setupfs","setupfs runscript failed.")
++                      cmd("env ARCH_RUNSCRIPT="+self.settings["livecd/archscript"]+" "+self.settings["livecd/runscript"]+" setupfs","setupfs runscript failed.")
 +              except:
 +                      self.unbind()
 +                      raise
@@ -63,14 +63,14 @@ diff -u -r1.60 targets.py
        def preclean(self):
                try:
 -                      cmd("/bin/bash "+self.settings["livecd/runscript"]+" preclean","preclean runscript failed.")
-+                      cmd("env ARCH_RUNSCRIPT="+self.settings["livecd/archrunscript"]+" "+self.settings["livecd/runscript"]+" preclean","preclean runscript failed.")
++                      cmd("env ARCH_RUNSCRIPT="+self.settings["livecd/archscript"]+" "+self.settings["livecd/runscript"]+" preclean","preclean runscript failed.")
                except:
                        self.unbind()
                        raise
  
 +#     def clean(self):
 +#             try:
-+#                     cmd("env ARCH_RUNSCRIPT="+self.settings["livecd/archrunscript"]+" "+self.settings["livecd/runscript"]+" clean","clean runscript failed.")
++#                     cmd("env ARCH_RUNSCRIPT="+self.settings["livecd/archscript"]+" "+self.settings["livecd/runscript"]+" clean","clean runscript failed.")
 +#             except:
 +#                     self.unbind()
 +#                     raise
@@ -79,8 +79,8 @@ diff -u -r1.60 targets.py
                if not os.path.exists(self.settings["cdroot_path"]):
                        os.makedirs(self.settings["cdroot_path"])
 -              cmd("/bin/bash "+self.settings["livecd/runscript"]+" cdroot_setup","preclean runscript failed.")
-+              cmd("env ARCH_RUNSCRIPT="+self.settings["livecd/archrunscript"]+" "+self.settings["livecd/runscript"]+" setup_bootloader","setup_bootloader runscript failed.")
-+              cmd("env ARCH_RUNSCRIPT="+self.settings["livecd/archrunscript"]+" "+self.settings["livecd/runscript"]+" loop","loop runscript failed.")
++              cmd("env ARCH_RUNSCRIPT="+self.settings["livecd/archscript"]+" "+self.settings["livecd/runscript"]+" setup_bootloader","setup_bootloader runscript failed.")
++              cmd("env ARCH_RUNSCRIPT="+self.settings["livecd/archscript"]+" "+self.settings["livecd/runscript"]+" loop","loop runscript failed.")
                print "livecd-stage3: complete!"
  
  def register(foo):
index 9228e299c36dea8dbaa40a0510e015d9b2ae17d2..24da4623763bf189eb660a08ad366c1be220b156 100644 (file)
@@ -309,6 +309,8 @@ class generic_stage_target(generic_target):
                                os.environ[varname]=string.join(self.settings[x])
                        
                self.run_local()
+               if self.settings["target"] in ["livecd-stage3"]:
+                       self.setupfs()
                if self.settings["target"] in ["stage1","stage2","stage3","livecd-stage3"]:
                        self.preclean()
                if self.settings["target"] in ["livecd-stage3"]:
@@ -426,7 +428,7 @@ class livecd_stage1_target(generic_stage_target):
 
 class livecd_stage2_target(generic_stage_target):
        def __init__(self,spec,addlargs):
-               self.required_values=["boot/kernel","livecd/runscript"]
+               self.required_values=["boot/kernel","livecd/archscript","livecd/runscript"]
                if not addlargs.has_key("boot/kernel"):
                        raise CatalystError, "Required value boot/kernel not specified."
                if type(addlargs["boot/kernel"]) == types.StringType:
@@ -456,14 +458,14 @@ class livecd_stage2_target(generic_stage_target):
                                self.unbind()
                                raise CatalystError, "Couldn't copy kernel config: "+self.settings["boot/kernel/"+x+"/config"]
                try:
-                       cmd("/bin/bash "+self.settings["livecd/runscript"]+" run "+list_bashify(args),"runscript failed")
+                       cmd("env ARCH_RUNSCRIPT="+self.settings["livecd/archscript"]+" "+self.settings["livecd/runscript"]+" kernbuild "+list_bashify(args),"runscript kernbuild failed")
                except CatalystError:
                        self.unbind()
                        raise CatalystError,"livecd-stage2 build aborting due to error."
 
 class livecd_stage3_target(generic_stage_target):
        def __init__(self,spec,addlargs):
-               self.required_values=["boot/kernel","livecd/runscript"]
+               self.required_values=["boot/kernel","livecd/archscript","livecd/runscript"]
                self.valid_values=self.required_values[:]
                self.valid_values.extend(["livecd/cdtar","livecd/empty","livecd/rm","livecd/unmerge"])
                generic_stage_target.__init__(self,spec,addlargs)
@@ -472,6 +474,8 @@ class livecd_stage3_target(generic_stage_target):
                                raise CatalystError, "Cannot locate specified livecd/cdtar: "+self.settings["livecd/cdtar"]
                if not os.path.exists(self.settings["livecd/runscript"]):
                                raise CatalystError, "Cannot locate specified livecd/runscript: "+self.settings["livecd/runscript"]
+               if not os.path.exists(self.settings["livecd/archscript"]):
+                               raise CatalystError, "Cannot locate specified livecd/archscript: "+self.settings["livecd/archscript"]
 
        def unmerge(self):
                if self.settings["target"]=="livecd-stage3" and self.settings.has_key("livecd/unmerge"):
@@ -488,17 +492,32 @@ class livecd_stage3_target(generic_stage_target):
        def run_local(self):
                pass
 
+       def setupfs(self):
+               try:
+                       cmd("env ARCH_RUNSCRIPT="+self.settings["livecd/archscript"]+" "+self.settings["livecd/runscript"]+" setupfs","setupfs runscript failed.")
+               except:
+                       self.unbind()
+                       raise
+
        def preclean(self):
                try:
-                       cmd("/bin/bash "+self.settings["livecd/runscript"]+" preclean","preclean runscript failed.")
+                       cmd("env ARCH_RUNSCRIPT="+self.settings["livecd/archscript"]+" "+self.settings["livecd/runscript"]+" preclean","preclean runscript failed.")
                except:
                        self.unbind()
                        raise
 
+#      def clean(self):
+#              try:
+#                      cmd("env ARCH_RUNSCRIPT="+self.settings["livecd/archscript"]+" "+self.settings["livecd/runscript"]+" clean","clean runscript failed.")
+#              except:
+#                      self.unbind()
+#                      raise
+
        def cdroot_setup(self):
                if not os.path.exists(self.settings["cdroot_path"]):
                        os.makedirs(self.settings["cdroot_path"])
-               cmd("/bin/bash "+self.settings["livecd/runscript"]+" cdroot_setup","preclean runscript failed.")
+               cmd("env ARCH_RUNSCRIPT="+self.settings["livecd/archscript"]+" "+self.settings["livecd/runscript"]+" setup_bootloader","setup_bootloader runscript failed.")
+               cmd("env ARCH_RUNSCRIPT="+self.settings["livecd/archscript"]+" "+self.settings["livecd/runscript"]+" loop","loop runscript failed.")
                print "livecd-stage3: complete!"
 
 def register(foo):