livecd polish
authorDaniel Robbins <drobbins@gentoo.org>
Tue, 20 Jan 2004 23:56:43 +0000 (23:56 +0000)
committerDaniel Robbins <drobbins@gentoo.org>
Tue, 20 Jan 2004 23:56:43 +0000 (23:56 +0000)
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@187 d1e1f19c-881f-0410-ab34-b69fee027534

examples/livecd/x86/x86-livecd-stage2-20040120.spec [moved from examples/livecd/x86/x86-livecd-stage2-20040114.spec with 86% similarity]
modules/targets.py
targets/livecd-stage1/livecd-stage1.sh
targets/livecd-stage2/unmerge.sh [new file with mode: 0644]

similarity index 86%
rename from examples/livecd/x86/x86-livecd-stage2-20040114.spec
rename to examples/livecd/x86/x86-livecd-stage2-20040120.spec
index f0051a16161da591d7e52e575c10aa50827385c7..ad23ebad1496a543ec33aa38f99371cb98b488fb 100644 (file)
@@ -1,12 +1,12 @@
 subarch: x86
-version_stamp: 20040114
+version_stamp: 20040120
 target: livecd-stage2
 rel_type: default
 rel_version: 1.4
-snapshot: 20040114
-source_subpath: default-x86-1.4/livecd-stage1-x86-20040114
-livecd/looptype: normal
-livecd/archscript: examples/livecd/runscript/x86-archcript.sh
+snapshot: 20040120
+source_subpath: default-x86-1.4/livecd-stage1-x86-20040120
+livecd/cdfstype: normal
+livecd/archscript: examples/livecd/runscript/x86-archscript.sh
 livecd/runscript: examples/livecd/runscript/default-runscript.sh
 livecd/cdtar: examples/livecd/cdtar/isolinux-2.08-cdtar.tar.bz2
 boot/kernel: gentoo
index 4b4ca1d89383225279a942f32f5a5e4899be344d..412b1643cc0a53161af5ddcf3b417a47cb1bc5dd 100644 (file)
@@ -411,13 +411,6 @@ 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/cdfstype","livecd/archscript","livecd/runscript"]
-               if self.settings.has_key("livecd/cdtar"):
-                       if not os.path.exists(self.settings["livecd/cdtar"]):
-                               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"]
                if not addlargs.has_key("boot/kernel"):
                        raise CatalystError, "Required value boot/kernel not specified."
                if type(addlargs["boot/kernel"]) == types.StringType:
@@ -430,7 +423,19 @@ class livecd_stage2_target(generic_stage_target):
                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)
-                       
+               if self.settings.has_key("livecd/cdtar"):
+                       if not os.path.exists(self.settings["livecd/cdtar"]):
+                               raise CatalystError, "Cannot locate specified livecd/cdtar: "+self.settings["livecd/cdtar"]
+               for myscript in ["livecd/archscript","livecd/runscript"]:
+                       if self.settings[myscript][0]=="/":
+                               if not os.path.exists(self.settings[myscript]):
+                                       raise CatalystError, "Cannot locate specified "+myscript+": "+self.settings[myscript]
+                       elif os.path.exists(os.getcwd()+"/"+self.settings[myscript]):
+                               self.settings[myscript]=os.getcwd()+"/"+self.settings[myscript]
+                       else:
+                               print os.getcwd()+"/"+self.settings[myscript]
+                               raise CatalystError, "Cannot locate specified "+myscript+": "+self.settings[myscript]+" (2nd try)"
+               
        def unmerge(self):
                if self.settings.has_key("livecd/unmerge"):
                        if type(self.settings["livecd/unmerge"])==types.StringType:
@@ -441,8 +446,11 @@ class livecd_stage2_target(generic_stage_target):
                                myunmerge[x]="'"+myunmerge[x]+"'"
                        myunmerge=string.join(myunmerge)
                        #before cleaning, unmerge stuff:
-                       cmd("/bin/bash "+self.settings["sharedir"]+"/targets/"+self.settings["target"]+"/unmerge.sh "+myunmerge,"unmerge script failed.")
-
+                       try:
+                               cmd("/bin/bash "+self.settings["sharedir"]+"/targets/"+self.settings["target"]+"/unmerge.sh "+myunmerge,"unmerge script failed.")
+                       except CatalystError:
+                               self.unbind()
+                               raise
        def setupfs(self):
                try:
                        cmd("/bin/bash "+self.settings["livecd/runscript"]+" cdfs","cdfs runscript failed.")
@@ -476,6 +484,9 @@ class livecd_stage2_target(generic_stage_target):
                cmd("/bin/bash "+self.settings["livecd/runscript"]+" cdfs","cdfs runscript failed.")
                print "livecd-stage3: complete!"
 
+       def run_local(self):
+               pass
+
 def run_local(self):
                mynames=self.settings["boot/kernel"]
                if type(mynames)==types.StringType:
index 9f54048795cd74c13708ea1507ed82e714138f5c..84f09ed759e0298b34a151d6015996eac1dd5e2a 100755 (executable)
@@ -1,6 +1,6 @@
 # Copyright 1999-2003 Gentoo Technologies, Inc.
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/targets/livecd-stage1/Attic/livecd-stage1.sh,v 1.5 2004/01/12 06:46:55 drobbins Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/livecd-stage1/Attic/livecd-stage1.sh,v 1.6 2004/01/20 23:56:43 drobbins Exp $
 
 case $1 in
 enter)
@@ -20,12 +20,25 @@ run)
        USE="build" emerge portage
        #turn off auto-use:
        export USE_ORDER="env:conf:defaults"    
-       if [ -n "${clst_PKGCACHE}" ]
-       then
-               emerge --usepkg --buildpkg --noreplace $* || exit 1
-       else
-               emerge --noreplace $* || exit 1
-       fi
+       for x in $*
+       do
+               if [ -n "${clst_PKGCACHE}" ]
+               then
+                       emerge --usepkg --buildpkg "\$x" || exit 1
+                       if [ "\$?" -ne 0 ]
+                       then
+                               echo "\$x failed to build."
+                               exit 1
+                       fi
+               else
+                       emerge "\$x"
+                       if [ "\$?" -ne 0 ]
+                       then
+                               echo "\$x failed to build."
+                               exit 1
+                       fi
+               fi
+       done
 EOF
        [ $? -ne 0 ] && exit 1
        ;;
diff --git a/targets/livecd-stage2/unmerge.sh b/targets/livecd-stage2/unmerge.sh
new file mode 100644 (file)
index 0000000..68cce18
--- /dev/null
@@ -0,0 +1,8 @@
+# Copyright 1999-2004 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/livecd-stage2/Attic/unmerge.sh,v 1.1 2004/01/20 23:56:43 drobbins Exp $
+
+$clst_CHROOT $clst_chroot_path /bin/bash << EOF
+       emerge -C $*
+EOF
+exit 0