# Copyright 2002-2007 Gentoo Foundation; Distributed under the GPL v2
# $Id: $
+ 12 Apr 2007; Chris Gianelloni <wolf31o2@gentoo.org>
+ modules/netboot2_target.py, targets/netboot2/netboot2-controller.sh,
+ targets/netboot2/netboot2-copyfile.sh, targets/support/functions.sh,
+ targets/support/netboot2-final.sh, targets/support/pre-kmerge.sh:
+ Added a patch from Andrew Gaffney <agaffney@gentoo.org> from bug #173826 to
+ improve the netboot2 target.
+
10 Apr 2007; Chris Gianelloni <wolf31o2@gentoo.org>
modules/generic_stage_target.py:
Added a patch from Mike Frysinger <vapier@gentoo.org> for bug #173740 to
Made sure bindist was used for all emerges in GRP.
07 Jul 2005; Eric Edgar <rocket@gentoo.org> targets/grp/grp-chroot.sh:
- Fix USE flags for grp build
+ Fix USE flags for GRP build
07 Jul 2005; Eric Edgar <rocket@gentoo.org> targets/grp/grp-chroot.sh,
targets/stage4/stage4-chroot.sh:
- let grp use the users environment variables and removed extra
- grp_stage23_use from stage4
+ let GRP use the users environment variables and removed extra
+ GRP_STAGE23_USE from stage4
07 Jul 2005; Eric Edgar <rocket@gentoo.org>
targets/stage2/stage2-chroot.sh, targets/stage3/stage3-chroot.sh:
07 Jul 2005; Eric Edgar <rocket@gentoo.org> targets/support/rc-update.sh:
fix bug 98165. Change the separator on rcadd/rcdel from : to | This will
- impact all previous spec files that use this option. Its beejays fault
+ impact all previous spec files that use this option. It's beejay's fault.
06 Jul 2005; Chris Gianelloni <wolf31o2@gentoo.org> arch/ppc.py:
Changed to use linux32 for ppc32 support when build host is ppc64.
20 May 2005; Chris Gianelloni <wolf31o2@gentoo.org> AUTHORS, catalyst,
files/catalyst.conf:
- Retired zhen and added storedir to default catalyst.conf.
+ Retired John Davis <zhen@gentoo.org> and added storedir to default
+ catalyst.conf.
20 May 2005; Chris Gianelloni <wolf31o2@gentoo.org>
targets/support/livecdfs-update.sh:
targets/support/create-iso.sh, targets/support/kmerge.sh,
targets/support/target_image_setup.sh,
targets/tinderbox/tinderbox-controller.sh:
- Fix some exception handling in catalyst_support.py
- remove intermediate destination folder of iso and tarball
- Add additional tests for folders not found on host but defined
- in spec file. Keep catalyst from erroring in this case.
- Change exit code on shell scripts so that errors are reported to catalyst
- and causes catalyst to die on errors
- Fix bug in livecd-stage1-chroot.sh so that it uses USE flags properly
- Added additional check for mkisofs. Informs user of where to get the program.
- Removed autoresume code from ccache and distcc installation until I can figure
- out a way to have the autoresume flag go someplace outside the chroot.
+ Fix some exception handling in catalyst_support.py, remove intermediate
+ destination folder of iso and tarball, add additional tests for folders not
+ found on host but defined in spec file, keep catalyst from erroring in this
+ case, change exit code on shell scripts so that errors are reported to
+ catalyst and causes catalyst to die on errors, fix bug in
+ livecd-stage1-chroot.sh so that it uses USE flags properly, added additional
+ check for mkisofs that informs the user of where to get the program, and
+ removed the autoresume code from ccache and distcc installation until I can
+ figure out a way to have the autoresume flag go someplace outside the chroot.
26 Apr 2005; Eric Edgar <rocket@gentoo.org> catalyst:
Remove bind mounts before rm operations happen at startup
targets/support/pre-kmerge.sh:
Fix ctrl-c error if pre-kmerge.sh is running by sourcing
/tmp/chroot-functions.sh and removed extra equal sign to fix a genkernel
- caching bug; Also adding preliminary support for initramfs_overlay from genkernel
+ caching bug; Also adding preliminary support for initramfs_overlay from
+ genkernel
14 Apr 2005; Eric Edgar <rocket@gentoo.org>
modules/generic_stage_target.py, targets/support/kmerge.sh:
added envscripts support (fixes bug #39832) massive cleanup of tree to prepare
it for ebuild - added headers to everything and removed deprecated dirs
- 14 Jan 2004; zhen <zhen@gentoo.org> arch/mips.py, modules/targets.py:
+ 14 Jan 2004; John Davis <zhen@gentoo.org> arch/mips.py, modules/targets.py:
adding Kumba's patches for MIPS
16 Dec 2003; Guy Martin <gmsoft@gentoo.org> : arch/hppa.py,modules/targets.py:
24 Oct 2003; Daniel Robbins <drobbins@gentoo.org>: major code rework in
progress on the python parts.
- 17 Oct 2003; zhen <zhen@gentoo.org> files/grp/x86/x86.conf,
+ 17 Oct 2003; John Davis <zhen@gentoo.org> files/grp/x86/x86.conf,
files/grp/x86/x86.pkg.cd1, files/grp/x86/x86.pkg.cd2, files/grp/x86/x86.src,
files/livecd/x86-basic/base.pkg, files/livecd/x86-basic/kern.pkg:
for organiation's sake, I have moved the files, such as livecd foundations,
into catalyst/files. It will make it easier for us when ebuild time comes
around.
- 15 Oct 2003; zhen <zhen@gentoo.org> targets/stage3/stage3.sh:
+ 15 Oct 2003; John Davis <zhen@gentoo.org> targets/stage3/stage3.sh:
All preliminary target build scripts are now added and coded to near as spec
that we can have at this point.
class netboot2_target(generic_stage_target):
def __init__(self,spec,addlargs):
self.required_values=[
- "boot/kernel",
- "netboot2/builddate",
- "netboot2/packages",
- "netboot2/use"
+ "boot/kernel"
]
self.valid_values=self.required_values[:]
- self.valid_values.extend(self.required_values)
- self.valid_values.extend(["netboot2/extra_files"])
-
+ self.valid_values.extend([
+ "netboot2/packages",
+ "netboot2/use",
+ "netboot2/extra_files",
+ "netboot2/overlay",
+ "netboot2/busybox_config"
+ ])
+
try:
if addlargs.has_key("netboot2/packages"):
if type(addlargs["netboot2/packages"]) == types.StringType:
except:
raise CatalystError,"configuration error in netboot2/packages."
-
-
generic_stage_target.__init__(self,spec,addlargs)
self.set_build_kernel_vars()
-
- # Merge packages into the buildroot, and pick out certain files to place in
- # /tmp/image
- self.settings["merge_path"]=normpath("/tmp/image")
-
- def set_dest_path(self):
- if self.settings.has_key("merge_path"):
- self.settings["destpath"]=normpath(self.settings["chroot_path"]+self.settings["merge_path"])
- else:
- self.settings["destpath"]=normpath(self.settings["chroot_path"])
+ self.settings["merge_path"]=normpath("/tmp/image/")
def set_target_path(self):
self.settings["target_path"]=normpath(self.settings["storedir"]+"/builds/"+\
touch(self.settings["autoresume_path"]+"copy_files_to_image")
+ def setup_overlay(self):
+ if self.settings.has_key("AUTORESUME") \
+ and os.path.exists(self.settings["autoresume_path"]+"setup_overlay"):
+ print "Resume point detected, skipping setup_overlay operation..."
+ else:
+ if self.settings.has_key("netboot2/overlay"):
+ for x in self.settings["netboot2/overlay"]:
+ if os.path.exists(x):
+ cmd("rsync -a "+x+"/ "+\
+ self.settings["chroot_path"], "netboot2/overlay: "+x+" copy failed.",env=self.env)
+ touch(self.settings["autoresume_path"]+"setup_overlay")
def move_kernels(self):
# we're done, move the kernels to builds/*
self.unbind()
raise CatalystError,"Failed to move kernel images!"
+ def remove(self):
+ if self.settings.has_key("AUTORESUME") \
+ and os.path.exists(self.settings["autoresume_path"]+"remove"):
+ print "Resume point detected, skipping remove operation..."
+ else:
+ if self.settings.has_key(self.settings["spec_prefix"]+"/rm"):
+ for x in self.settings[self.settings["spec_prefix"]+"/rm"]:
+ # we're going to shell out for all these cleaning operations,
+ # so we get easy glob handling
+ print "netboot2: removing " + x
+ os.system("rm -rf " + self.settings["chroot_path"] + self.settings["merge_path"] + x)
+
+ def empty(self):
+ if self.settings.has_key("AUTORESUME") \
+ and os.path.exists(self.settings["autoresume_path"]+"empty"):
+ print "Resume point detected, skipping empty operation..."
+ else:
+ if self.settings.has_key("netboot2/empty"):
+ if type(self.settings["netboot2/empty"])==types.StringType:
+ self.settings["netboot2/empty"]=self.settings["netboot2/empty"].split()
+ for x in self.settings["netboot2/empty"]:
+ myemp=self.settings["chroot_path"] + self.settings["merge_path"] + x
+ if not os.path.isdir(myemp):
+ print x,"not a directory or does not exist, skipping 'empty' operation."
+ continue
+ print "Emptying directory", x
+ # stat the dir, delete the dir, recreate the dir and set
+ # the proper perms and ownership
+ mystat=os.stat(myemp)
+ shutil.rmtree(myemp)
+ os.makedirs(myemp,0755)
+ os.chown(myemp,mystat[ST_UID],mystat[ST_GID])
+ os.chmod(myemp,mystat[ST_MODE])
+ touch(self.settings["autoresume_path"]+"empty")
def set_action_sequence(self):
self.settings["action_sequence"]=["unpack","unpack_snapshot","config_profile_link",
"setup_confdir","bind","chroot_setup",\
"setup_environment","build_packages","root_overlay",\
- "copy_files_to_image","build_kernel","move_kernels",\
- "unbind","clean","clear_autoresume"]
+ "copy_files_to_image","setup_overlay","build_kernel","move_kernels",\
+ "remove","empty","unbind","clean","clear_autoresume"]
def register(foo):
foo.update({"netboot2":netboot2_target})
;;
pre-kmerge)
# Sets up the build environment before any kernels are compiled
+ if [ -z "${clst_netboot2_busybox_config}" ]; then
+ cp ${clst_sharedir}/targets/netboot2/nb-busybox.cf ${clst_chroot_path}/tmp/busy-config
+ else
+ cp ${clst_netboot2_busybox_config} ${clst_chroot_path}/tmp/busy-config
+ fi
exec_in_chroot ${clst_sharedir}/targets/support/pre-kmerge.sh
;;
post-kmerge)
then
mv ${1}/initramfs-* ${1}/${x}.igz
fi
+
+ if [ -e ${1}/System.map-* ];
+ then
+ mv ${1}/System.map-* ${1}/System.map-${x}
+ fi
done
}
for x in ${clst_boot_kernel}; do
mv ${clst_target_path}boot/${x} ${clst_target_path}kernels
mv ${clst_target_path}boot/${x}.igz ${clst_target_path}kernels/misc
+ mv ${clst_target_path}boot/System.map-${x} ${clst_target_path}kernels/misc
done
rmdir ${clst_target_path}boot
sleep 0
;;
sparc*)
- sleep 0
+ if [ "${clst_hostarch}" == "sparc" ]; then
+ piggyback=piggyback
+ else
+ piggyback=piggyback64
+ fi
+ for x in ${clst_boot_kernel}; do
+ elftoaout ${clst_target_path}/kernels/${x} -o ${clst_target_path}${x}-a.out
+ ${piggyback} ${clst_target_path}/${x}-a.out ${clst_target_path}kernels/misc/System.map-${x} ${clst_target_path}kernels/misc/${x}.igz
+ done
;;
ia64)
sleep 0
# Set the netboot builddate/hostname in linuxrc and copy to proper arch
# directory in genkernel
- sed -e "s/@@MYDATE@@/${clst_netboot2_builddate}/g" \
+ sed -e "s/@@MYDATE@@/$(date '+%Y%m%d')/g" \
-e "s/@@RELVER@@/${clst_version_stamp}/g" \
- ${clst_root_path}usr/share/genkernel/netboot/linuxrc.x \
- > ${clst_root_path}usr/share/genkernel/${clst_hostarch}/linuxrc
+ /usr/share/genkernel/netboot/linuxrc.x \
+ > /usr/share/genkernel/${clst_hostarch}/linuxrc
echo ">>> Copying support files to ${clst_root_path} ..."
- cp -pPRf ${clst_root_path}usr/share/genkernel/netboot/misc/* \
+ cp -pPRf /usr/share/genkernel/netboot/misc/* \
${clst_merge_path}
echo ">>> Copying busybox config ..."
- cp -f ${clst_root_path}usr/share/genkernel/${clst_hostarch}/nb-busybox.cf \
- ${clst_root_path}usr/share/genkernel/${clst_hostarch}/busy-config
+ cp -f /tmp/busy-config \
+ /usr/share/genkernel/${clst_hostarch}/busy-config
;;
esac