fixes for bugs #49819 and #71033. Partial fix for #67289
authorJohn P. Davis <zhen@gentoo.org>
Tue, 23 Nov 2004 00:02:57 +0000 (00:02 +0000)
committerJohn P. Davis <zhen@gentoo.org>
Tue, 23 Nov 2004 00:02:57 +0000 (00:02 +0000)
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@484 d1e1f19c-881f-0410-ab34-b69fee027534

ChangeLog
modules/embedded_target.py
modules/generic_stage_target.py
targets/embedded/cramfs-runscript.sh [deleted file]
targets/embedded/embedded-fs-runscript.sh [new file with mode: 0644]
targets/livecd-stage2/unmerge.sh
targets/stage1/stage1-chroot.sh
targets/stage2/stage2-chroot.sh
targets/stage3/stage3-chroot.sh

index a973a0faab7888c4f3a7345ae82ba60e1daee3ae..7056fcf483f30da76781d7170ec4c11749c4c661 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,14 @@
 # ChangeLog for gentoo/src/catalyst 
 # Copyright 2002-2004 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.113 2004/11/19 18:19:23 wolf31o2 Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.114 2004/11/23 00:02:56 zhen Exp $
+
+  22 Nov 2004; John Davis <zhen@gentoo.org> modules/embedded_target.py,
+  modules/generic_stage_target.py, -targets/embedded/cramfs-runscript.sh,
+  +targets/embedded/embedded-fs-runscript.sh,
+  targets/livecd-stage2/unmerge.sh, targets/stage1/stage1-chroot.sh,
+  targets/stage2/stage2-chroot.sh, targets/stage3/stage3-chroot.sh:
+  fixes for bugs #49819 and #71033. Partial fix for #67289 - waiting on a patch
+  from mutex@gentoo.org for modules/embedded.py
 
   19 Nov 2004; Chris Gianelloni <wolf31o2@gentoo.org>
   livecd/files/gamecd-xinitrc, livecd/runscript-support/gamecdfs-update.sh,
index 84a5c6d06eb5a5300baa2935b40e94485918c220..68a69245bf5f15ab68487514fb4a31350f8eedef 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2004 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/modules/embedded_target.py,v 1.2 2004/10/15 02:27:58 zhen Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/modules/embedded_target.py,v 1.3 2004/11/23 00:02:57 zhen Exp $
 
 """
 This class works like a 'stage3'.  A stage2 tarball is unpacked, but instead
@@ -8,7 +8,7 @@ of building a stage3, it emerges a 'system' into another directory
 inside the 'stage2' system.  This way we do not have to emerge gcc/portage
 into the staged system.
 
-It sounds real complicated but basically it's a it runs
+It sounds real complicated but basically it runs
 ROOT=/tmp/submerge emerge --blahblah foo bar
 """
 
@@ -22,8 +22,10 @@ class embedded_target(generic_stage_target):
     def __init__(self,spec,addlargs):
         self.required_values=[]
         self.valid_values=[]
-       #self.required_values.extend(["embedded/packages"]);
-        self.valid_values.extend(["embedded/empty","embedded/rm","embedded/unmerge","embedded/runscript","embedded/mergeroot","embedded/packages","embedded/use"])
+        self.valid_values.extend(["embedded/empty","embedded/rm","embedded/unmerge","embedded/runscript","embedded/mergeroot","embedded/packages","embedded/use","embedded/fstype"])
+
+        if addlargs.has_key("embedded/fstype"):
+            self.valid_values.append("embedded/fsops")
 
         generic_stage_target.__init__(self,spec,addlargs)
        self.settings["image_path"]=self.settings["storedir"]+"/builds/"+self.settings["target_subpath"]+"/image"       
@@ -50,6 +52,16 @@ class embedded_target(generic_stage_target):
                    for x in self.settings["embedded/rm"]:
                            print "Removing "+x
                            os.system("rm -rf "+self.settings["chroot_path"]+"/tmp/mergeroot"+x)
+
+    def build_fs(self):
+        try:
+            if self.settings.has_key("embedded/fstype"):
+                cmd("/bin/bash "+self.settings["sharedir"]+"/targets/embedded/embedded.sh package","filesystem packaging failed")
+        except CatalystError:
+                self.unbind()
+                raise CatalystError, "embedded filesystem created aborting due to error."
+
+
     def run_local(self):
            mypackages=list_bashify(self.settings["embedded/packages"])
            print "Merging embedded image"
@@ -60,13 +72,8 @@ class embedded_target(generic_stage_target):
                    raise CatalystError, "Embedded build aborted due to error."
            self.unmerge()
            self.clean()
-           try:
-                   if self.settings.has_key("embedded/runscript"):
-                           cmd("/bin/bash "+self.settings["embedded/runscript"]+" run ","runscript failed")
-           except CatalystError:
-                   self.unbind()
-                   raise CatalystError, "embedded runscript aborting due to error."
+            self.build_fs()
 
 def register(foo):
-       foo.update({"embedded":embedded_target})
-       return foo
+        foo.update({"embedded":embedded_target})
+        return foo
index 57dfdbcd71683d7eac27483e20743b1b8298daac..382fc783c2c105ed0a8d071bf168b0627fc04ae1 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2004 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/modules/generic_stage_target.py,v 1.16 2004/10/15 02:27:58 zhen Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/modules/generic_stage_target.py,v 1.17 2004/11/23 00:02:57 zhen Exp $
 
 """
 This class does all of the chroot setup, copying of files, etc. It is
@@ -57,7 +57,7 @@ class generic_stage_target(generic_target):
                                "mips" : "mips",
                                "mips64" : "mips",
                                "arm" : "arm",
-                               "arm" : "armv4l"
+                               "armv4l" : "arm"
                }
        
                mymachine=os.uname()[4]
diff --git a/targets/embedded/cramfs-runscript.sh b/targets/embedded/cramfs-runscript.sh
deleted file mode 100644 (file)
index 897963b..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/bash
-# Copyright david@futuretel.com
-# puts a the embedded image into a cramfs
-
-root_fs_path="${clst_chroot_path}/tmp/mergeroot"
-
-die() {
-       echo "$1"
-       exit 1
-}
-
-case $1 in
-       run)
-               install -d $clst_image_path
-               mkcramfs $root_fs_path $clst_image_path/root.img
-               imagesize=`du -sk $clst_image_path/root.img | cut -f1`
-               echo "Created cramfs image at ${clst_image_path}/root.img"
-               echo "Image size: ${imagesize}k"
-       ;;
-
-       preclean)
-       ;;
-
-esac
-exit 0
diff --git a/targets/embedded/embedded-fs-runscript.sh b/targets/embedded/embedded-fs-runscript.sh
new file mode 100644 (file)
index 0000000..36c3e13
--- /dev/null
@@ -0,0 +1,42 @@
+#!/bin/bash
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+die() {
+       echo "$1"
+       exit 1
+}
+
+# 1 = mkfs path, 2 = fs name, 3 = pkg name
+fs_check() {
+    if [ ! -e ${1} ]; then
+       die "You must install ${3} in order to produce ${2} images"
+    fi
+}
+
+case $1 in
+    jffs)
+       fs_check /usr/sbin/mkfs.jffs jffs sys-fs/mtd
+       mkfs.jffs -d ${root_fs_path} -o ${clst_image_path}/root.img \
+           ${clst_embedded_fsops} || die "Could not create a jffs filesystem"
+       ;;
+    jffs2)
+       fs_check /usr/sbin/mkfs.jffs2 jffs2 sys-fs/mtd
+       mkfs.jffs2 --root=${root_fs_path} --output=${clst_image_path}/root.img\
+           ${clst_embedded_fsops} || die "Could not create a jffs2 filesystem"
+       ;;
+
+    cramfs)
+       fs_check /sbin/mkcramfs cramfs sys-fs/cramfs
+       mkcramfs ${clst_embedded_fsops} ${root_fs_path} \
+           ${clst_image_path}/root.img || die "Could not create a cramfs filesystem"
+       ;;
+
+    squashfs)
+       fs_check /usr/sbin/mksquashfs squashfs sys-fs/squashfs-tools
+       mksquashfs ${root_fs_path} ${clst_image_path}/root.img \
+           ${clst_embedded_fsops} || die "Could not create a squashfs filesystem"
+       ;;
+    *)
+       ;;
+esac
index 8ef99809e94ec4d1776ef62edb4fcbe638f8115d..748424728c2d09a1edb0bec12bb475c769bc9ada 100644 (file)
@@ -1,8 +1,8 @@
 # Copyright 1999-2004 Gentoo Foundation
 # 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.5 2004/10/22 04:23:16 wolf31o2 Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/livecd-stage2/Attic/unmerge.sh,v 1.6 2004/11/23 00:02:57 zhen Exp $
 
-$clst_CHROOT $clst_chroot_path /bin/bash << EOF
+${clst_CHROOT} ${clst_chroot_path} /bin/bash << EOF
        EMERGE_WARNING_DELAY=0 emerge -C $*
 EOF
 exit 0
index 5f0993081aabeb6c4fcbfe81b9a69de0cd25152b..c756c8ac0705a654e7e00a95194be2521d3e9c8a 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/bash
 # Copyright 1999-2004 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage1/stage1-chroot.sh,v 1.24 2004/10/15 02:46:58 zhen Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage1/stage1-chroot.sh,v 1.25 2004/11/23 00:02:57 zhen Exp $
                
 /usr/sbin/env-update
 source /etc/profile
@@ -34,7 +34,7 @@ install -d ${ROOT}
                
 ## START BUILD
 export clst_buildpkgs="$(/tmp/build.py)"
-STAGE1_USE="$(source /etc/make.profile/make.defaults ; echo ${STAGE1_USE})"
+STAGE1_USE="$(portageq envvar STAGE1_USE)"
 
 # duplicate line to below - why is this here??
 #USE="-* build ${STAGE1_USE}" emerge ${clst_myemergeopts} --noreplace ${clst_buildpkgs} || exit 1
index 89799bd55d3abefce5194e71a0bddaa124feffc1..48b4115cb4885cc59eb6dde157556b9d1d60e7fe 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 # Copyright 1999-2004 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage2/stage2-chroot.sh,v 1.8 2004/10/15 02:46:58 zhen Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage2/stage2-chroot.sh,v 1.9 2004/11/23 00:02:57 zhen Exp $
 
 /usr/sbin/env-update
 source /etc/profile
@@ -27,7 +27,7 @@ then
        export bootstrap_opts="-r"
 fi
 
-GRP_STAGE23_USE="$(source /etc/make.profile/make.defaults ; echo ${GRP_STAGE23_USE})"
+GRP_STAGE23_USE="$(portageq envvar GRP_STAGE23_USE)"
 
 
 ## setup the environment
index d4a26598715f34b26e3eb88dc9f26b8b222cadda..90f9d8e451cb5c4da23bbfafa063bf1aae583667 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/bash
 # Copyright 1999-2004 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage3/stage3-chroot.sh,v 1.12 2004/10/15 02:46:58 zhen Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage3/stage3-chroot.sh,v 1.13 2004/11/23 00:02:57 zhen Exp $
 
 /usr/sbin/env-update
 source /etc/profile
@@ -27,7 +27,7 @@ then
        export clst_myemergeopts="${clst_myemergeopts} --usepkg --buildpkg --newuse"
 fi
 
-GRP_STAGE23_USE="$(source /etc/make.profile/make.defaults ; echo ${GRP_STAGE23_USE})"
+GRP_STAGE23_USE="$(portageq envvar GRP_STAGE23_USE)"
 
 # setup the build environment
 export FEATURES="${clst_myfeatures}"