# Copyright 2002-2006 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.528 2006/01/26 15:36:46 wolf31o2 Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.529 2006/01/26 19:56:32 rocket Exp $
+
+ 26 Jan 2006; Eric Edgar <rocket@gentoo.org>
+ examples/generic_stage_template.spec, examples/grp_template.spec,
+ examples/livecd-stage1_template.spec,
+ examples/livecd-stage2_template.spec, examples/netboot2_template.spec,
+ examples/netboot_template.spec, examples/stage4_template.spec,
+ examples/tinderbox_template.spec, modules/generic_stage_target.py,
+ targets/support/kmerge.sh:
+ Separation of kerncache from snapcache
26 Jan 2006; Chris Gianelloni <wolf31o2@gentoo.org> catalyst:
It helps if I actually increment the version number.
# example:
# ldflags: -Wl,-O1 -Wl,-z,now
ldflags:
+
+# Setting the option overrides the location of the pkgcache
+pkgcache_path:
+
+# Setting the option overrides the location of the kerncache
+kerncache_path:
# example:
# grp/cd2/packages: dante tsocks sys-apps/eject minicom links acpid apmd parted whois tcpdump cvs zip unzip netcat partimage app-admin/sudo app-cdr/cdrtools gnome emacs dev-lang/ruby enlightenment kde mozilla-firefox mozilla-thunderbird xfce4 openbox fluxbox sylpheed openoffice-bin gimp xemacs xmms abiword gaim xchat pan tetex xcdroast k3b samba nmap gradm ettercap ethereal mplayer
grp/cd2/packages:
+
+# Setting the option overrides the location of the pkgcache
+pkgcache_path:
+
+# Setting the option overrides the location of the kerncache
+kerncache_path:
+
# example:
# livecd/packages: livecd-tools dhcpcd acpid apmd gentoo-sources coldplug fxload irssi gpm syslog-ng parted links raidtools dosfstools nfs-utils jfsutils xfsprogs e2fsprogs reiserfsprogs ntfsprogs pwgen rp-pppoe screen mirrorselect penggy iputils hwdata-knoppix hwsetup lvm2 evms vim pptpclient mdadm ethtool wireless-tools prism54-firmware wpa_supplicant
livecd/packages:
+
+# Setting the option overrides the location of the pkgcache
+pkgcache_path:
+
+
# example:
# livecd/rm: /lib/*.a /usr/lib/*.a /usr/lib/gcc-lib/*/*/libgcj* /etc/dispatch-conf.conf /etc/etc-update.conf /etc/*- /etc/issue* /etc/make.conf /etc/man.conf /etc/*.old /root/.viminfo /usr/sbin/bootsplash* /usr/sbin/fb* /usr/sbin/fsck.cramfs /usr/sbin/fsck.minix /usr/sbin/mkfs.minix /usr/sbin/mkfs.bfs /usr/sbin/mkfs.cramfs /lib/security/pam_access.so /lib/security/pam_chroot.so /lib/security/pam_debug.so /lib/security/pam_ftp.so /lib/security/pam_issue.so /lib/security/pam_mail.so /lib/security/pam_motd.so /lib/security/pam_mkhomedir.so /lib/security/pam_postgresok.so /lib/security/pam_rhosts_auth.so /lib/security/pam_userdb.so /usr/share/consolefonts/1* /usr/share/consolefonts/7* /usr/share/consolefonts/8* /usr/share/consolefonts/9* /usr/share/consolefonts/A* /usr/share/consolefonts/C* /usr/share/consolefonts/E* /usr/share/consolefonts/G* /usr/share/consolefonts/L* /usr/share/consolefonts/M* /usr/share/consolefonts/R* /usr/share/consolefonts/a* /usr/share/consolefonts/c* /usr/share/consolefonts/dr* /usr/share/consolefonts/g* /usr/share/consolefonts/i* /usr/share/consolefonts/k* /usr/share/consolefonts/l* /usr/share/consolefonts/r* /usr/share/consolefonts/s* /usr/share/consolefonts/t* /usr/share/consolefonts/v* /etc/splash/livecd-2005.0/16* /etc/splash/livecd-2005.0/12* /etc/splash/livecd-2005.0/6* /etc/splash/livecd-2005.0/8* /etc/splash/livecd-2005.0/images/silent-16* /etc/splash/livecd-2005.0/images/silent-12* /etc/splash/livecd-2005.0/images/silent-6* /etc/splash/livecd-2005.0/images/silent-8* /etc/splash/livecd-2005.0/images/verbose-16* /etc/splash/livecd-2005.0/images/verbose-12* /etc/splash/livecd-2005.0/images/verbose-6* /etc/splash/livecd-2005.0/images/verbose-8* /etc/make.conf.example /etc/make.globals /etc/resolv.conf
livecd/rm:
+
+# Setting the option overrides the location of the pkgcache
+pkgcache_path:
+
+# Setting the option overrides the location of the kerncache
+kerncache_path:
+
/sbin/fsck.xfs
/sbin/mkfs.xfs
/sbin/xfs_repair
+
+# Setting the option overrides the location of the pkgcache
+pkgcache_path:
+
+# Setting the option overrides the location of the kerncache
+kerncache_path:
+
# example:
# netboot/extra_files: /lib/libresolv.so.2 /lib/libnss_compat.so.2 /lib/libnss_dns.so.2 /lib/libnss_files.so.2 /sbin/consoletype
netboot/extra_files:
+
+# Setting the option overrides the location of the pkgcache
+pkgcache_path:
+
+# Setting the option overrides the location of the kerncache
+kerncache_path:
+
# example:
# stage4/rm: /lib/*.a /usr/lib/*.a /usr/lib/gcc-lib/*/*/libgcj* /etc/dispatch-conf.conf /etc/etc-update.conf /etc/*- /etc/issue* /etc/make.conf /etc/man.conf /etc/*.old /root/.viminfo /usr/sbin/bootsplash* /usr/sbin/fb* /usr/sbin/fsck.cramfs /usr/sbin/fsck.minix /usr/sbin/mkfs.minix /usr/sbin/mkfs.bfs /usr/sbin/mkfs.cramfs /lib/security/pam_access.so /lib/security/pam_chroot.so /lib/security/pam_debug.so /lib/security/pam_ftp.so /lib/security/pam_issue.so /lib/security/pam_mail.so /lib/security/pam_motd.so /lib/security/pam_mkhomedir.so /lib/security/pam_postgresok.so /lib/security/pam_rhosts_auth.so /lib/security/pam_userdb.so /usr/share/consolefonts/1* /usr/share/consolefonts/7* /usr/share/consolefonts/8* /usr/share/consolefonts/9* /usr/share/consolefonts/A* /usr/share/consolefonts/C* /usr/share/consolefonts/E* /usr/share/consolefonts/G* /usr/share/consolefonts/L* /usr/share/consolefonts/M* /usr/share/consolefonts/R* /usr/share/consolefonts/a* /usr/share/consolefonts/c* /usr/share/consolefonts/dr* /usr/share/consolefonts/g* /usr/share/consolefonts/i* /usr/share/consolefonts/k* /usr/share/consolefonts/l* /usr/share/consolefonts/r* /usr/share/consolefonts/s* /usr/share/consolefonts/t* /usr/share/consolefonts/v* /etc/splash/livecd-2005.0/16* /etc/splash/livecd-2005.0/12* /etc/splash/livecd-2005.0/6* /etc/splash/livecd-2005.0/8* /etc/splash/livecd-2005.0/images/silent-16* /etc/splash/livecd-2005.0/images/silent-12* /etc/splash/livecd-2005.0/images/silent-6* /etc/splash/livecd-2005.0/images/silent-8* /etc/splash/livecd-2005.0/images/verbose-16* /etc/splash/livecd-2005.0/images/verbose-12* /etc/splash/livecd-2005.0/images/verbose-6* /etc/splash/livecd-2005.0/images/verbose-8* /etc/make.conf.example /etc/make.globals /etc/resolv.conf
stage4/rm:
+
+# Setting the option overrides the location of the pkgcache
+pkgcache_path:
+
+# Setting the option overrides the location of the kerncache
+kerncache_path:
+
# exampleL
# tinderbox/packages: dante tsocks sys-apps/eject minicom links acpid apmd parted whois tcpdump cvs zip unzip netcat partimage app-admin/sudo app-cdr/cdrtools gnome emacs dev-lang/ruby enlightenment kde mozilla-firefox mozilla-thunderbird xfce4 openbox fluxbox sylpheed openoffice-bin gimp xemacs xmms abiword gaim xchat pan tetex xcdroast k3b samba nmap gradm ettercap ethereal mplayer
tinderbox/packages:
+
+# Setting the option overrides the location of the pkgcache
+pkgcache_path:
+
+# Setting the option overrides the location of the kerncache
+kerncache_path:
+
# 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.122 2006/01/25 16:07:35 rocket Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/modules/generic_stage_target.py,v 1.123 2006/01/26 19:56:32 rocket Exp $
"""
This class does all of the chroot setup, copying of files, etc. It is
self.valid_values.extend(["version_stamp","target","subarch","rel_type","profile",\
"snapshot","source_subpath","portage_confdir","cflags","cxxflags",\
- "ldflags","chost","hostuse","portage_overlay","distcc_hosts","makeopts"])
+ "ldflags","chost","hostuse","portage_overlay","distcc_hosts","makeopts",\
+ "pkgcache_path","kerncache_path"])
self.set_valid_build_kernel_vars(addlargs)
generic_target.__init__(self,myspec,addlargs)
print "Location of the package cache is " + self.settings["pkgcache_path"]
self.mounts.append("/usr/portage/packages")
self.mountmap["/usr/portage/packages"]=self.settings["pkgcache_path"]
+
+ if self.settings.has_key("KERNCACHE"):
+ self.set_kerncache_path()
+ print "Location of the kerncache is " + self.settings["kerncache_path"]
+ self.mounts.append("/tmp/kerncache")
+ self.mountmap["/tmp/kerncache"]=self.settings["kerncache_path"]
if self.settings.has_key("CCACHE"):
if os.environ.has_key("CCACHE_DIR"):
if self.settings.has_key("pkgcache_path"):
if type(self.settings["pkgcache_path"]) != types.StringType:
self.settings["pkgcache_path"]=normpath(string.join(self.settings["pkgcache_path"]))
+ else:
+ self.settings["pkgcache_path"]=normpath(self.settings["storedir"]+"/packages/"+\
+ self.settings["target_subpath"]+"/")
- self.settings["pkgcache_path"]=normpath(self.settings["storedir"]+"/packages/"+\
- self.settings["target_subpath"]+"/")
+ def set_kerncache_path(self):
+ if self.settings.has_key("kerncache_path"):
+ if type(self.settings["kerncache_path"]) != types.StringType:
+ self.settings["kerncache_path"]=normpath(string.join(self.settings["kerncache_path"]))
+ else:
+ self.settings["kerncache_path"]=normpath(self.settings["storedir"]+"/kerncache/"+\
+ self.settings["target_subpath"]+"/")
def set_target_path(self):
self.settings["target_path"]=normpath(self.settings["storedir"]+"/builds/"+\
if not os.path.exists(self.settings["pkgcache_path"]):
os.makedirs(self.settings["pkgcache_path"],0755)
+ if self.settings.has_key("KERNCACHE"):
+ if not os.path.exists(self.settings["kerncache_path"]):
+ os.makedirs(self.settings["kerncache_path"],0755)
+
print display_msg
cmd(unpack_cmd,error_msg,env=self.env)
os.chown(myemp,mystat[ST_UID],mystat[ST_GID])
os.chmod(myemp,mystat[ST_MODE])
+ def clear_kerncache(self):
+ if self.settings.has_key("KERNCACHE"):
+ print "purging the kerncache ..."
+
+ myemp=self.settings["kerncache_path"]
+ if os.path.isdir(myemp):
+ print "Emptying directory",myemp
+ # stat the dir, delete the dir, recreate the dir and set
+ # the proper perms and ownership
+ mystat=os.stat(myemp)
+ #cmd("rm -rf "+myemp, "Could not remove existing file: "+myemp,env=self.env)
+ shutil.rmtree(myemp)
+ os.makedirs(myemp,0755)
+ os.chown(myemp,mystat[ST_UID],mystat[ST_GID])
+ os.chmod(myemp,mystat[ST_MODE])
+
def clear_autoresume(self):
# clean resume points since they are no longer needed
if self.settings.has_key("AUTORESUME"):
print "clearing package cache ..."
self.clear_packages()
+
+ print "clearing kerncache ..."
+ self.clear_kerncache()
#vim: ts=4 sw=4 sta et sts=4 ai
source /tmp/chroot-functions.sh
+mkdir -p /tmp/kerncache
+
check_genkernel_version
-PKGDIR=/usr/portage/packages/gk_binaries/${clst_kname}/ebuilds
+PKGDIR=/tmp/kerncache/${clst_kname}/ebuilds
setup_gk_args() {
# default genkernel args
GK_ARGS="${clst_gk_mainargs} \
${clst_kernel_gk_kernargs} \
- --cachedir=/usr/portage/packages/gk_binaries/${clst_kname}-genkernel_cache-${clst_version_stamp} \
+ --cachedir=/tmp/kerncache/${clst_kname}-genkernel_cache-${clst_version_stamp} \
--no-mountboot \
--kerneldir=/usr/src/linux \
--kernel-config=/var/tmp/${clst_kname}.config \
- --modulespackage=/usr/portage/packages/gk_binaries/${clst_kname}-modules-${clst_version_stamp}.tar.bz2 \
- --minkernpackage=/usr/portage/packages/gk_binaries/${clst_kname}-kernel-initrd-${clst_version_stamp}.tar.bz2 \
- --kerncache=/usr/portage/packages/gk_binaries/${clst_kname}-kerncache-${clst_version_stamp}.tar.bz2 all"
+ --modulespackage=/tmp/kerncache/${clst_kname}-modules-${clst_version_stamp}.tar.bz2 \
+ --minkernpackage=/tmp/kerncache/${clst_kname}-kernel-initrd-${clst_version_stamp}.tar.bz2 \
+ --kerncache=/tmp/kerncache/${clst_kname}-kerncache-${clst_version_stamp}.tar.bz2 all"
# extra genkernel options that we have to test for
if [ "${clst_splash_type}" == "bootsplash" -a -n "${clst_splash_theme}" ]
then
genkernel ${GK_ARGS} || exit 1
fi
fi
- md5sum /var/tmp/${clst_kname}.config|awk '{print $1}' > /usr/portage/packages/gk_binaries/${clst_kname}/${clst_kname}-${clst_version_stamp}.CONFIG
+ md5sum /var/tmp/${clst_kname}.config|awk '{print $1}' > /tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.CONFIG
}
build_kernel() {
# real benefit in using the pkgcache for kernel source ebuilds.
USE_MATCH=0
-if [ -e /usr/portage/packages/gk_binaries/${clst_kname}/${clst_kname}-${clst_version_stamp}.USE ]
+if [ -e /tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.USE ]
then
- STR1=$(for i in `cat /usr/portage/packages/gk_binaries/${clst_kname}/${clst_kname}-${clst_version_stamp}.USE`; do echo $i; done|sort)
+ STR1=$(for i in `cat /tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.USE`; do echo $i; done|sort)
STR2=$(for i in ${clst_kernel_use}; do echo $i; done|sort)
if [ "${STR1}" = "${STR2}" ]
then
else
if [ -n "${clst_KERNCACHE}" ]
then
- [ -d /usr/portage/packages/gk_binaries/${clst_kname}/ebuilds ] && \
- rm -r /usr/portage/packages/gk_binaries/${clst_kname}/ebuilds
- [ -e /usr/portage/packages/gk_binaries/${clst_kname}/usr/src/linux/.config ] && \
- rm /usr/portage/packages/gk_binaries/${clst_kname}/usr/src/linux/.config
+ [ -d /tmp/kerncache/${clst_kname}/ebuilds ] && \
+ rm -r /tmp/kerncache/${clst_kname}/ebuilds
+ [ -e /tmp/kerncache/${clst_kname}/usr/src/linux/.config ] && \
+ rm /tmp/kerncache/${clst_kname}/usr/src/linux/.config
fi
fi
fi
EXTRAVERSION_MATCH=0
-if [ -e /usr/portage/packages/gk_binaries/${clst_kname}/${clst_kname}-${clst_version_stamp}.EXTRAVERSION ]
+if [ -e /tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.EXTRAVERSION ]
then
- STR1=`cat /usr/portage/packages/gk_binaries/${clst_kname}/${clst_kname}-${clst_version_stamp}.EXTRAVERSION`
+ STR1=`cat /tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.EXTRAVERSION`
STR2=${clst_kextraversion}
if [ "${STR1}" = "${STR2}" ]
then
fi
CONFIG_MATCH=0
-if [ -e /usr/portage/packages/gk_binaries/${clst_kname}/${clst_kname}-${clst_version_stamp}.CONFIG ]
+if [ -e /tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.CONFIG ]
then
- STR1=`cat /usr/portage/packages/gk_binaries/${clst_kname}/${clst_kname}-${clst_version_stamp}.CONFIG`
+ STR1=`cat /tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.CONFIG`
STR2=`md5sum /var/tmp/${clst_kname}.config|awk '{print $1}'`
if [ "${STR1}" = "${STR2}" ]
then
then
echo "Cleaning up ${clst_kname} kernel install ..."
echo "This may take some time ..."
- if [ -d /usr/portage/packages/gk_binaries/${clst_kname}/ ]
+ if [ -d /tmp/kerncache/${clst_kname}/ ]
then
- rm -r /usr/portage/packages/gk_binaries/${clst_kname}/ || exit 1
+ rm -r /tmp/kerncache/${clst_kname}/ || exit 1
fi
fi
-mkdir -p /usr/portage/packages/gk_binaries/${clst_kname}
+mkdir -p /tmp/kerncache/${clst_kname}
if [ -n "${clst_KERNCACHE}" ]
then
- ROOT=/usr/portage/packages/gk_binaries/${clst_kname} PKGDIR=${PKGDIR} USE="${USE} symlink build" emerge --nodeps -ukb "${clst_ksource}" || exit 1
+ ROOT=/tmp/kerncache/${clst_kname} PKGDIR=${PKGDIR} USE="${USE} symlink build" emerge --nodeps -ukb "${clst_ksource}" || exit 1
KERNELVERSION=`/usr/lib/portage/bin/portageq best_visible / "${clst_ksource}"`
if [ ! -e /etc/portage/profile/package.provided ]
then
fi
fi
[ -d /usr/src/linux ] && rm /usr/src/linux
- ln -s /usr/portage/packages/gk_binaries/${clst_kname}/usr/src/linux /usr/src/linux
+ ln -s /tmp/kerncache/${clst_kname}/usr/src/linux /usr/src/linux
else
USE="${USE} symlink build" emerge "${clst_ksource}" || exit 1
fi
then
echo "Setting extraversion to ${clst_kextraversion}"
sed -i -e "s:EXTRAVERSION \(=.*\):EXTRAVERSION \1-${clst_kextraversion}:" /usr/src/linux/Makefile
- echo ${clst_kextraversion} > /usr/portage/packages/gk_binaries/${clst_kname}/${clst_kname}-${clst_version_stamp}.EXTRAVERSION
+ echo ${clst_kextraversion} > /tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.EXTRAVERSION
else
- touch /usr/portage/packages/gk_binaries/${clst_kname}/${clst_kname}-${clst_version_stamp}.EXTRAVERSION
+ touch /tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.EXTRAVERSION
fi
fi
/sbin/modules-update --assume-kernel=${clst_fudgeuname}
unset USE
-echo ${clst_kernel_use} > /usr/portage/packages/gk_binaries/${clst_kname}/${clst_kname}-${clst_version_stamp}.USE
+echo ${clst_kernel_use} > /tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.USE