partial fix for #76542
authorJohn P. Davis <zhen@gentoo.org>
Mon, 10 Jan 2005 01:16:07 +0000 (01:16 +0000)
committerJohn P. Davis <zhen@gentoo.org>
Mon, 10 Jan 2005 01:16:07 +0000 (01:16 +0000)
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@513 d1e1f19c-881f-0410-ab34-b69fee027534

ChangeLog
targets/embedded/embedded.sh
targets/embedded/kmerge.sh [new file with mode: 0644]

index 75f4c129d5cdb53d73406cf34f353de6d9d6ca63..62482ba9ef425069504fbb3bb886671002e003dc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,11 @@
 # 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:
index b27433e5fb2b67c23b52b0f282582c744c158c27..7c098c15b833be295c917e2757c2a7364a54c1ea 100644 (file)
@@ -1,7 +1,7 @@
 #!/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)
@@ -13,6 +13,13 @@ case $1 in
                ${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}
@@ -21,6 +28,37 @@ case $1 in
        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
        ;;
diff --git a/targets/embedded/kmerge.sh b/targets/embedded/kmerge.sh
new file mode 100644 (file)
index 0000000..7f4ffa2
--- /dev/null
@@ -0,0 +1,84 @@
+#!/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