# ChangeLog for gentoo/src/catalyst
# Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.140 2005/01/10 01:05:59 zhen Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.141 2005/01/10 01:16:07 zhen Exp $
+
+ 09 Jan 2005; John Davis <zhen@gentoo.org> targets/embedded/embedded.sh,
+ +targets/embedded/kmerge.sh:
+ partial fix for #76542, waiting for the necessary patch to modules/embedded.py
+ from mutex@gentoo.org
09 Jan 2005; John Davis <zhen@gentoo.org> modules/generic_stage_target.py,
modules/livecd_stage2_target.py:
#!/bin/bash
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/targets/embedded/Attic/embedded.sh,v 1.6 2004/12/16 20:01:38 wolf31o2 Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/embedded/Attic/embedded.sh,v 1.7 2005/01/10 01:16:07 zhen Exp $
case $1 in
enter)
${clst_CHROOT} ${clst_chroot_path} /tmp/embedded-chroot.sh || exit 1
rm -f ${clst_chroot_path}/tmp/embedded-chroot.sh
;;
+
+ preclean)
+ # currently this doesn't do much
+ cp ${clst_sharedir}/targets/embedded/embedded-preclean-chroot.sh ${clst_chroot_path}
+ ${clst_CHROOT} ${clst_chroot_path} /tmp/embedded-preclean-chroot.sh || exit 1
+ rm -rf ${clst_chroot_path}/tmp/embedded-preclean-chroot.sh
+ ;;
package)
export root_fs_path="${clst_chroot_path}/tmp/mergeroot"
install -d ${clst_image_path}
echo "Created ${clst_embedded_fs_type} image at ${clst_image_path}/root_fs"
echo "Image size: ${imagesize}k"
;;
+
+ # almost the same code as livecd-stage2
+ kernel)
+ shift
+ numkernels="$1"
+ cp -a ${clst_sharedir}/livecd/runscript-support/pre-kmerge.sh ${clst_chroot_path}/tmp
+ ${clst_CHROOT} ${clst_chroot_path} /tmp/pre-kmerge.sh || exit 1
+ rm -f ${clst_chroot_path}/tmp/pre-kmerge.sh
+ cp -a ${clst_sharedir}/targets/embedded/kmerge.sh ${clst_chroot_path}/tmp
+ count=0
+ while [ ${count} -lt ${numkernels} ]
+ do
+ sleep 30
+
+ shift
+ export clst_kname="$1"
+ shift
+ export clst_ksource="$1"
+ shift
+ export clst_kextversion="$1"
+ shift
+ export clst_gk_action="$1"
+ echo "exporting clst_gk_action as:${1}"
+ shift
+ ${clst_CHROOT} ${clst_chroot_path} /tmp/kmerge.sh || exit 1
+ count=$(( ${count} + 1 ))
+ done
+ rm -f ${clst_chroot_path}/tmp/pre-kmerge.sh
+ cp -a ${clst_sharedir}/livecd/runscript-support/post-kmerge.sh ${clst_chroot_path}/tmp
+ ${clst_CHROOT} ${clst_chroot_path} /tmp/post-kmerge.sh || exit 1
+ ;;
*)
exit 1
;;
--- /dev/null
+#!/bin/bash
+# Copyright 1999-2004 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/embedded/Attic/kmerge.sh,v 1.1 2005/01/10 01:16:07 zhen Exp $
+
+die() {
+ echo "$1"
+ exit 1
+}
+
+# Script to build each kernel, kernel-related packages
+/usr/sbin/env-update
+source /etc/profile
+
+[ -n "${clst_ENVSCRIPT}" ] && source /tmp/envscript
+export CONFIG_PROTECT="-*"
+rm -f /usr/src/linux
+
+#set the timezone for the kernel build
+rm /etc/localtime
+ln -s /usr/share/zoneinfo/UTC /etc/localtime
+
+[ -e "/var/tmp/${clst_kname}.use" ] && export USE="$( cat /var/tmp/${clst_kname}.use )" || unset USE
+[ -e "/var/tmp/${clst_kname}.gk_kernargs" ] && source /var/tmp/${clst_kname}.gk_kernargs
+# Don't use pkgcache here, as the kernel source may get emerge with different USE variables
+# (and thus different patches enabled/disabled.) Also, there's no real benefit in using the
+# pkgcache for kernel source ebuilds.
+
+emerge "${clst_ksource}" || exit 1
+[ ! -e /usr/src/linux ] && die "Can't find required directory /usr/src/linux"
+
+#if catalyst has set NULL_VALUE, extraversion wasn't specified so we skip this part
+if [ "${clst_kextversion}" != "NULL_VALUE" ]
+then
+ sed -i -e "s:EXTRAVERSION \(=.*\):EXTRAVERSION \1-${clst_kextversion}:" /usr/src/linux/Makefile
+fi
+
+if [ -n "${clst_CCACHE}" ]
+then
+ #enable ccache for genkernel
+ export PATH="/usr/lib/ccache/bin:${PATH}"
+fi
+
+# grep out the kernel version so that we can do our modules magic
+VER=`grep ^VERSION\ \= /usr/src/linux/Makefile | awk '{ print $3 };'`
+PAT=`grep ^PATCHLEVEL\ \= /usr/src/linux/Makefile | awk '{ print $3 };'`
+SUB=`grep ^SUBLEVEL\ \= /usr/src/linux/Makefile | awk '{ print $3 };'`
+EXV=`grep ^EXTRAVERSION\ \= /usr/src/linux/Makefile | sed -e "s/EXTRAVERSION =//" -e "s/ //g"`
+clst_fudgeuname=${VER}.${PAT}.${SUB}${EXV}
+
+# now we merge any kernel-dependent packages
+if [ -e "/var/tmp/${clst_kname}.packages" ]
+then
+ for x in $( cat /var/tmp/${clst_kname}.packages )
+ do
+ # we don't want to use the pkgcache for these since the results
+ # are kernel-dependent.
+ clst_kernel_merge="${clst_kernel_merge} ${x}"
+ done
+fi
+
+echo "genkernel action is set to: ${clst_gk_action}"
+
+if [ -n "${clst_livecd_bootsplash}" ]
+then
+ genkernel --debuglevel=4 --bootsplash=${clst_livecd_bootsplash} \
+ --callback="emerge ${clst_kernel_merge}" ${clst_livecd_gk_mainargs} \
+ ${clst_embedded_gk_kernargs} --kerneldir=/usr/src/linux \
+ --kernel-config=/var/tmp/${clst_kname}.config \
+ --minkernpackage=/tmp/binaries/${clst_kname}.tar.bz2 \
+ ${clst_gk_action} || exit 1
+else
+ genkernel --debuglevel=4 --callback="emerge ${clst_kernel_merge}" \
+ ${clst_embedded_gk_mainargs} ${clst_embedded_gk_kernargs} \
+ --kerneldir=/usr/src/linux --kernel-config=/var/tmp/${clst_kname}.config \
+ --minkernpackage=/tmp/binaries/${clst_kname}.tar.bz2 \
+ ${clst_gk_action} || exit 1
+fi
+
+/sbin/modules-update --assume-kernel=${clst_fudgeuname}
+
+#now the unmerge... (wipe db entry)
+emerge -C "${clst_ksource}"
+unset USE