From a3c3f37e3739a83f878ac3591121558bba25f999 Mon Sep 17 00:00:00 2001 From: Eric Edgar Date: Mon, 17 Oct 2005 19:01:06 +0000 Subject: [PATCH] run pre_kmerge and post_kmerge only once git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@866 d1e1f19c-881f-0410-ab34-b69fee027534 --- ChangeLog | 9 ++++++++- modules/generic_stage_target.py | 9 ++++++++- targets/embedded/embedded-controller.sh | 14 ++++++++++---- targets/livecd-stage2/livecd-stage2-controller.sh | 12 +++++++++--- targets/netboot/netboot-controller.sh | 11 ++++++++++- targets/stage4/stage4-controller.sh | 12 +++++++++--- 6 files changed, 54 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index be89a1f7..5ae9ecc5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ # Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.358 2005/10/17 17:11:33 rocket Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.359 2005/10/17 19:01:06 rocket Exp $ + + 17 Oct 2005; Eric Edgar + modules/generic_stage_target.py, targets/embedded/embedded-controller.sh, + targets/livecd-stage2/livecd-stage2-controller.sh, + targets/netboot/netboot-controller.sh, + targets/stage4/stage4-controller.sh: + run pre_kmerge and post_kmerge only once 17 Oct 2005; Eric Edgar targets/support/bootloader-setup.sh: diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py index e488bdf9..f1348751 100644 --- a/modules/generic_stage_target.py +++ b/modules/generic_stage_target.py @@ -1,6 +1,6 @@ # Copyright 1999-2005 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.66 2005/10/13 17:13:35 rocket Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/modules/generic_stage_target.py,v 1.67 2005/10/17 19:01:06 rocket Exp $ """ This class does all of the chroot setup, copying of files, etc. It is @@ -998,6 +998,9 @@ class generic_stage_target(generic_target): mynames=self.settings["boot/kernel"] if type(mynames)==types.StringType: mynames=[mynames] + # execute the script that sets up the kernel build environment + cmd("/bin/bash "+self.settings["controller_file"]+" pre-kmerge ",\ + "Runscript pre-kmerge failed") for kname in mynames: try: @@ -1054,6 +1057,10 @@ class generic_stage_target(generic_target): print "Cleaning up temporary overlay dir" cmd("rm -R "+self.settings["chroot_path"]+"/tmp/initramfs_overlay/") + # execute the script that cleans up the kernel build environment + cmd("/bin/bash "+self.settings["controller_file"]+" post-kmerge ",\ + "Runscript post-kmerge failed") + touch(self.settings["autoresume_path"]+"build_kernel") except CatalystError: diff --git a/targets/embedded/embedded-controller.sh b/targets/embedded/embedded-controller.sh index 3ea50ca0..10c48acf 100755 --- a/targets/embedded/embedded-controller.sh +++ b/targets/embedded/embedded-controller.sh @@ -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/embedded-controller.sh,v 1.5 2005/08/09 19:02:31 rocket Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/targets/embedded/embedded-controller.sh,v 1.6 2005/10/17 19:01:06 rocket Exp $ . ${clst_sharedir}/targets/support/functions.sh . ${clst_sharedir}/targets/support/filesystem-functions.sh @@ -29,6 +29,15 @@ case $1 in # ;; + pre-kmerge) + # Sets up the build environment before any kernels are compiled + exec_in_chroot ${clst_sharedir}/targets/support/pre-kmerge.sh + ;; + post-kmerge) + # Cleans up the build environment after the kernels are compiled + exec_in_chroot ${clst_sharedir}/targets/support/post-kmerge.sh + ;; + kernel) shift export clst_kname="$1" @@ -37,11 +46,8 @@ case $1 in then cp -a ${clst_linuxrc} ${clst_chroot_path}/tmp/linuxrc fi - exec_in_chroot ${clst_sharedir}/targets/support/pre-kmerge.sh exec_in_chroot ${clst_sharedir}/targets/support/kmerge.sh delete_from_chroot tmp/linuxrc - exec_in_chroot ${clst_sharedir}/targets/support/post-kmerge.sh - ;; target_image_setup) diff --git a/targets/livecd-stage2/livecd-stage2-controller.sh b/targets/livecd-stage2/livecd-stage2-controller.sh index 16ccc28c..2237f74d 100755 --- a/targets/livecd-stage2/livecd-stage2-controller.sh +++ b/targets/livecd-stage2/livecd-stage2-controller.sh @@ -1,10 +1,18 @@ # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/targets/livecd-stage2/livecd-stage2-controller.sh,v 1.13 2005/08/09 19:02:31 rocket Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/targets/livecd-stage2/livecd-stage2-controller.sh,v 1.14 2005/10/17 19:01:06 rocket Exp $ . ${clst_sharedir}/targets/support/functions.sh . ${clst_sharedir}/targets/support/filesystem-functions.sh case $1 in + pre-kmerge) + # Sets up the build environment before any kernels are compiled + exec_in_chroot ${clst_sharedir}/targets/support/pre-kmerge.sh + ;; + post-kmerge) + # Cleans up the build environment after the kernels are compiled + exec_in_chroot ${clst_sharedir}/targets/support/post-kmerge.sh + ;; kernel) shift export clst_kname="$1" @@ -14,10 +22,8 @@ case $1 in then cp -a ${clst_linuxrc} ${clst_chroot_path}/tmp/linuxrc fi - exec_in_chroot ${clst_sharedir}/targets/support/pre-kmerge.sh exec_in_chroot ${clst_sharedir}/targets/support/kmerge.sh delete_from_chroot tmp/linuxrc - exec_in_chroot ${clst_sharedir}/targets/support/post-kmerge.sh extract_modules ${clst_chroot_path} ${clst_kname} #16:12 <@solar> kernel_name=foo diff --git a/targets/netboot/netboot-controller.sh b/targets/netboot/netboot-controller.sh index 87efe279..c7fcc7d5 100755 --- a/targets/netboot/netboot-controller.sh +++ b/targets/netboot/netboot-controller.sh @@ -1,7 +1,7 @@ #!/bin/bash # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/targets/netboot/netboot-controller.sh,v 1.3 2005/07/05 21:53:41 wolf31o2 Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/targets/netboot/netboot-controller.sh,v 1.4 2005/10/17 19:01:06 rocket Exp $ . ${clst_sharedir}/targets/support/functions.sh . ${clst_sharedir}/targets/support/filesystem-functions.sh @@ -34,6 +34,15 @@ case ${1} in exec_in_chroot ${clst_sharedir}/targets/${clst_target}/${clst_target}-chroot.sh ;; + pre-kmerge) + # Sets up the build environment before any kernels are compiled + #exec_in_chroot ${clst_sharedir}/targets/support/pre-kmerge.sh + ;; + post-kmerge) + # Cleans up the build environment after the kernels are compiled + #exec_in_chroot ${clst_sharedir}/targets/support/post-kmerge.sh + ;; + kernel) shift export clst_kname="$1" diff --git a/targets/stage4/stage4-controller.sh b/targets/stage4/stage4-controller.sh index e2f4dd3b..3062f640 100755 --- a/targets/stage4/stage4-controller.sh +++ b/targets/stage4/stage4-controller.sh @@ -1,7 +1,7 @@ #!/bin/bash # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage4/stage4-controller.sh,v 1.8 2005/08/09 19:02:31 rocket Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage4/stage4-controller.sh,v 1.9 2005/10/17 19:01:06 rocket Exp $ . ${clst_sharedir}/targets/support/functions.sh @@ -11,6 +11,14 @@ case $1 in enter) ${clst_CHROOT} ${clst_chroot_path} ;; + pre-kmerge) + # Sets up the build environment before any kernels are compiled + exec_in_chroot ${clst_sharedir}/targets/support/pre-kmerge.sh + ;; + post-kmerge) + # Cleans up the build environment after the kernels are compiled + exec_in_chroot ${clst_sharedir}/targets/support/post-kmerge.sh + ;; kernel) shift export clst_kname="$1" @@ -19,10 +27,8 @@ case $1 in then cp -a ${clst_linuxrc} ${clst_chroot_path}/tmp/linuxrc fi - exec_in_chroot ${clst_sharedir}/targets/support/pre-kmerge.sh exec_in_chroot ${clst_sharedir}/targets/support/kmerge.sh delete_from_chroot tmp/linuxrc - exec_in_chroot ${clst_sharedir}/targets/support/post-kmerge.sh extract_modules ${clst_chroot_path} ${clst_kname} extract_kernel ${clst_chroot_path}/boot ${clst_kname} ;; -- 2.26.2