diff options
Diffstat (limited to 'sys-kernel/mips-sources/files')
-rw-r--r-- | sys-kernel/mips-sources/files/eblits/src_unpack-v2.eblit | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/sys-kernel/mips-sources/files/eblits/src_unpack-v2.eblit b/sys-kernel/mips-sources/files/eblits/src_unpack-v2.eblit new file mode 100644 index 000000000000..aa46025cc0ab --- /dev/null +++ b/sys-kernel/mips-sources/files/eblits/src_unpack-v2.eblit @@ -0,0 +1,60 @@ +# Copyright 1999-2009 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-kernel/mips-sources/files/eblits/src_unpack-v2.eblit,v 1.1 2009/03/24 05:33:37 kumba Exp $ + +# Eblit to handle src_unpack. + +eblit-mips-sources-src_unpack() { + # Unpack the kernel sources, update to the latest rev (if needed), + # and apply the latest patch from linux-mips git. + kernel-2_src_unpack + + # Unpack the mips-sources patchset to ${WORKDIR}/mips-patches-${F_KV}. + echo -e "" + cd "${WORKDIR}" + unpack "${PN}-${F_KV}-patches-v${GENPATCHREV}.tar.bz2" + + # Create a new folder, patch-symlinks, and create symlinks to + # mips-patches in there. If we want to exclude a patch, we'll + # just delete the symlink instead of the actual patch. + local psym="patch-symlinks" + mkdir "${psym}" + cd "${psym}" + for x in ../mips-patches-${F_KV}/*.patch; do + ln -s "${x}" "${x##../mips-patches-*/}" + done + + # With symlinks created, setup the variables referencing external + # machine patches and if a machine USE flag is enabled, then unset + # its corresponding variable. + # See 0000_README for the patch numbers and their meanings. + local p_generic="501*" + local p_ip27="502*" p_ip28="503*" p_ip30="504*" p_ip32r10k="6001*" p_impactdebug="6002*" + use ip27 && unset p_generic p_ip27 + use ip28 && unset p_ip28 + use ip30 && unset p_generic p_ip30 + use ip32r10k && unset p_ip32r10k + use impactdebug && unset p_impactdebug + + # Remove symlinks for any patches that we don't want applied. We do + # this by looping through all the above variables, and deleting + # matching symlinks that point to the corresponding patches. + # The remaining symlinks will be applied to the kernel source. + local patchlist="${p_generic} ${p_ip27} ${p_ip28} ${p_ip30} ${p_ip32r10k} ${p_impactdebug}" + for x in $patchlist; do rm -f "./${x}"; done + + # Rename the source tree to match the linux-mips git checkout date and + # machine type. + local v="${F_KV}${EXTRAVERSION}-${GITDATE}" + for x in {ip27,ip28,ip30,cobalt}; do use ${x} && v="${v}.${x}" && break; done + mv "${WORKDIR}/linux-${F_KV}${EXTRAVERSION}" "${WORKDIR}/linux-${v}" + S="${WORKDIR}/linux-${v}" + + # Now go into the kernel source and patch it. + cd "${S}" + epatch "${WORKDIR}/${psym}"/*.patch + + # Set the EXTRAVERSION to linux-VERSION-mipsgit-GITDATE + EXTRAVERSION="${EXTRAVERSION}-mipsgit-${GITDATE}" + unpack_set_extraversion +} |