# 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,
# 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
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
"""
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"
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"
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
# 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
"mips" : "mips",
"mips64" : "mips",
"arm" : "arm",
- "arm" : "armv4l"
+ "armv4l" : "arm"
}
mymachine=os.uname()[4]
+++ /dev/null
-#!/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
--- /dev/null
+#!/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
# 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
#!/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
## 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
#!/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
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
#!/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
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}"