From f75bb07f3cec2d28f07e0dc69a1784763bbfdf0b Mon Sep 17 00:00:00 2001 From: Chris Gianelloni Date: Wed, 21 Jun 2006 22:11:54 +0000 Subject: [PATCH] Added two patches from Joshua Kinard to fix stage1 not having /proc mounted during the preclean stage and also to clean up the netboot2 code. This is 2.0_rc48. git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@1151 d1e1f19c-881f-0410-ab34-b69fee027534 --- ChangeLog | 9 ++++++++- catalyst | 4 ++-- modules/netboot2_target.py | 7 +------ modules/stage1_target.py | 14 ++++++++++++-- targets/netboot2/netboot2-copyfile.sh | 10 +++++++++- targets/support/pre-kmerge.sh | 3 ++- 6 files changed, 34 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4fc7fe7a..6808f538 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ # Copyright 2002-2006 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.635 2006/06/20 19:32:31 wolf31o2 Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.636 2006/06/21 22:11:54 wolf31o2 Exp $ + + 21 Jun 2006; Chris Gianelloni catalyst, + modules/netboot2_target.py, modules/stage1_target.py, + targets/netboot2/netboot2-copyfile.sh, targets/support/pre-kmerge.sh: + Added two patches from Joshua Kinard to fix stage1 not + having /proc mounted during the preclean stage and also to clean up the + netboot2 code. This is 2.0_rc48. 20 Jun 2006; Chris Gianelloni targets/support/unmerge.sh: diff --git a/catalyst b/catalyst index 040db05e..11269a65 100755 --- a/catalyst +++ b/catalyst @@ -1,7 +1,7 @@ #!/usr/bin/python -OO # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/catalyst,v 1.155 2006/06/09 00:31:51 wolf31o2 Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/catalyst,v 1.156 2006/06/21 22:11:54 wolf31o2 Exp $ # Maintained in full by: # Eric Edgar @@ -11,7 +11,7 @@ import os,sys,imp,string,getopt import pdb __maintainer__="Chris Gianelloni " -__version__="2.0_rc47" +__version__="2.0_rc48" conf_values={} diff --git a/modules/netboot2_target.py b/modules/netboot2_target.py index 383af277..88adfcc0 100644 --- a/modules/netboot2_target.py +++ b/modules/netboot2_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/netboot2_target.py,v 1.2 2006/01/20 17:19:42 rocket Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/modules/netboot2_target.py,v 1.3 2006/06/21 22:11:54 wolf31o2 Exp $ """ Builder class for a netboot build, version 2 @@ -15,7 +15,6 @@ class netboot2_target(generic_stage_target): self.required_values=[ "boot/kernel", "netboot2/builddate", - "netboot2/busybox_config", "netboot2/packages", "netboot2/use" ] @@ -44,10 +43,6 @@ class netboot2_target(generic_stage_target): # /tmp/image self.settings["merge_path"]=normpath("/tmp/image") - for envvar in "CFLAGS", "CXXFLAGS": - if not os.environ.has_key(envvar) and not addlargs.has_key(envvar): - self.settings[envvar] = "-Os -pipe" - def set_dest_path(self): if self.settings.has_key("merge_path"): self.settings["destpath"]=normpath(self.settings["chroot_path"]+self.settings["merge_path"]) diff --git a/modules/stage1_target.py b/modules/stage1_target.py index e68990a4..38e6da15 100644 --- a/modules/stage1_target.py +++ b/modules/stage1_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/stage1_target.py,v 1.23 2006/01/29 18:58:03 rocket Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/modules/stage1_target.py,v 1.24 2006/06/21 22:11:54 wolf31o2 Exp $ """ Builder class for a stage1 installation tarball build. @@ -20,7 +20,7 @@ class stage1_target(generic_stage_target): print "stage1 stage path is "+self.settings["stage_path"] def set_root_path(self): - # ROOT= variable for emerges + # sets the root path, relative to 'chroot_path', of the stage1 root self.settings["root_path"]=normpath("/tmp/stage1root") print "stage1 root path is "+self.settings["root_path"] @@ -59,6 +59,16 @@ class stage1_target(generic_stage_target): print "\tIf you break it, you buy it. Don't complain to us about it." print "\tDont say we did not warn you\n" + def set_mounts(self): + # stage_path/proc probably doesn't exist yet, so create it + if not os.path.exists(self.settings["stage_path"]+"/proc"): + os.makedirs(self.settings["stage_path"]+"/proc") + + # alter the mount mappings to bind mount proc onto it + self.mounts.append("/tmp/stage1root/proc") + self.mountmap["/tmp/stage1root/proc"]="/proc" + + def register(foo): foo.update({"stage1":stage1_target}) return foo diff --git a/targets/netboot2/netboot2-copyfile.sh b/targets/netboot2/netboot2-copyfile.sh index 662967f6..a2a9c197 100644 --- a/targets/netboot2/netboot2-copyfile.sh +++ b/targets/netboot2/netboot2-copyfile.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/netboot2/netboot2-copyfile.sh,v 1.1 2006/01/13 15:09:07 rocket Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/targets/netboot2/netboot2-copyfile.sh,v 1.2 2006/06/21 22:11:54 wolf31o2 Exp $ . /tmp/chroot-functions.sh @@ -11,6 +11,14 @@ echo ">>> Copying initramfs files to ${clst_merge_path} (in chroot) ..." [ ! -d "${clst_merge_path}" ] && mkdir -p ${clst_merge_path} for f in ${clst_files} do + # copy it to the merge path cp -af --parents ${f} ${clst_merge_path} + + # if the file is an ELF binary, strip unneeded stuff from it + if [ -x "${f}" ] && [ ! -L "${f}" ]; then + if [ "$(head -c 4 ${f} 2>/dev/null | tail -c 3)" = "ELF" ]; then + strip -R .comment -R .note ${clst_merge_path}${f} + fi + fi done echo "" diff --git a/targets/support/pre-kmerge.sh b/targets/support/pre-kmerge.sh index 1dba443a..94012f1e 100755 --- a/targets/support/pre-kmerge.sh +++ b/targets/support/pre-kmerge.sh @@ -39,6 +39,7 @@ case ${clst_target} in cp -af ${clst_root_path}usr/share/genkernel/netboot/misc/* ${clst_merge_path} echo ">>> Copying busybox config ..." - cp -f ${clst_netboot2_busybox_config} /usr/share/genkernel/${clst_mainarch}/busy-config + cp -f ${clst_root_path}usr/share/genkernel/${clst_mainarch}/nb-busybox.cf \ + ${clst_root_path}usr/share/genkernel/${clst_mainarch}/busy-config ;; esac -- 2.26.2