Skip to content

Commit

Permalink
debian-sources-3.2.15 update
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleg Vinichenko committed Apr 16, 2012
1 parent 31ac9f3 commit c409670
Show file tree
Hide file tree
Showing 2 changed files with 160 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sys-kernel/debian-sources/Manifest
Expand Up @@ -2,3 +2,5 @@ DIST linux-2.6_3.2.12-1.diff.gz 5776093 RMD160 b527c5d2b9952ae9b17ca30bc6c8247c0
DIST linux-2.6_3.2.12.orig.tar.gz 98460274 RMD160 b733ccc17eb507a80e44707138351d8ec143f039 SHA1 1e992bb2522c2ef3ee56318b0ecd32062fed9c1a SHA256 49759e95876a8dfc9334fbacd3c5b88d481fe172eae54bb69300e4ec4bce091a
DIST linux-2.6_3.2.14-1.diff.gz 5756357 RMD160 379ca0c91881e9d627efa1e891ea7f374a59786a SHA1 26454096689b14c1a85325c4a984605b5b28ed0e SHA256 4896969152d1ebc57112bfd01a5fa5db5809fafb1c50cda9076604471dfcca80
DIST linux-2.6_3.2.14.orig.tar.gz 98469236 RMD160 0684288ec76d555314bf3d8c07c3c86d44e34ce2 SHA1 d290b26c48354a78c65882fd7bd4e9d4f7d8236e SHA256 fc40acd185c0b4a2455c7bb3a05c994f040ae07eb80aae0b4dd0897b9df406a1
DIST linux-2.6_3.2.15-1.diff.gz 5903422 RMD160 da4fe33ad34c59557408585ab046388076151884 SHA1 14b1ae458bcaab16ad1330400fdf39889f1c3e72 SHA256 ae56dae6da4e0aa7cf27ba6328f6270410cebb6ae684d43f63a732c6ce9ff2c4
DIST linux-2.6_3.2.15.orig.tar.gz 98466631 RMD160 d67eae5a4fe1ddf2d0d1bba7ef0f2a6650cc123a SHA1 887114c6f5329120ff69271c650e739dccacba6e SHA256 4832fca824dbd0da212eadf622ddc58e301e47776dd4dd821a301184e6f0e22f
158 changes: 158 additions & 0 deletions sys-kernel/debian-sources/debian-sources-3.2.15.ebuild
@@ -0,0 +1,158 @@
# Copyright 2011 Funtoo Technologies
# Distributed under the terms of the GNU General Public License v2

EAPI=2

inherit mount-boot

SLOT=$PVR
CKV=3.2.15
KV_FULL=${PN}-${PVR}
EXTRAVERSION=-1
KERNEL_ARCHIVE="linux-2.6_${PV}.orig.tar.gz"
RESTRICT="binchecks strip"
# based on : http://packages.ubuntu.com/maverick/linux-image-2.6.35-22-server
LICENSE="GPL-2"
KEYWORDS="*"
IUSE="openvz binary"
DEPEND="binary? ( >=sys-kernel/genkernel-3.4.12.6-r4 )"
RDEPEND="binary? ( >=sys-fs/udev-160 )"
DESCRIPTION="Debian Sources (and optional binary kernel)"
HOMEPAGE="http://www.debian.org"
MAINPATCH="linux-2.6_${PV}${EXTRAVERSION}.diff.gz"
SRC_URI="http://ftp.bg.debian.org/debian/pool/main/l/linux-2.6/${KERNEL_ARCHIVE}
http://ftp.bg.debian.org/debian/pool/main/l/linux-2.6/${MAINPATCH}"
S="$WORKDIR/linux-${CKV}"

apply() {
p=$1; shift
case "${p##*.}" in
gz)
ca="gzip -dc"
;;
bz2)
ca="bzip2 -dc"
;;
xz)
ca="xz -dc"
;;
*)
ca="cat"
;;
esac
[ ! -e $p ] && die "patch $p not found"
echo "Applying patch $p"; $ca $p | patch $* || die "patch $p failed"
}

pkg_setup() {
unset ARCH; unset LDFLAGS #will interfere with Makefile if set
}

src_unpack() {
cd ${WORKDIR}
unpack ${KERNEL_ARCHIVE}
}

src_prepare() {
cd ${WORKDIR}
apply $DISTDIR/$MAINPATCH -p1

# debian-specific stuff....

mv linux-* ${S##*/} || die
mv debian ${S##*/}/ || die
cd ${S}
sed -i \
-e 's/^sys.path.append.*$/sys.path.append(".\/debian\/lib\/python")/' \
-e 's/^_default_home =.*$/_default_home = ".\/debian\/patches"/' \
debian/bin/patch.apply || die
python2 debian/bin/patch.apply $KV_DEB || die
if use openvz
then
python2 debian/bin/patch.apply -a $ARCH -f openvz || die
fi

# end of debian-specific stuff...

sed -i -e "s:^\(EXTRAVERSION =\).*:\1 ${EXTRAVERSION}:" Makefile || die
sed -i -e 's:#export\tINSTALL_PATH:export\tINSTALL_PATH:' Makefile || die
rm -f .config >/dev/null
cp -a debian ${T} || die "couldn't back up debian dir (will be wiped by mrproper)"
make -s mrproper || die "make mrproper failed"
cp -a ${T}/debian . || die "couldn't restore debian directory"
make -s include/linux/version.h || die "make include/linux/version.h failed"
#mv "${TEMP}/configs" "${S}" || die
cd ${S}
local opts
use openvz && opts="openvz"
local myarch="amd64"
[ "$ARCH" = "x86" ] && myarch="i386"
cp ${FILESDIR}/config-extract . || die
chmod +x config-extract || die
./config-extract ${myarch} ${opts} || die
cp .config ${T}/config || die
make -s mrproper || die "make mrproper failed"
make -s include/linux/version.h || die "make include/linux/version.h failed"
}

src_compile() {
! use binary && return
install -d ${WORKDIR}/out/{lib,boot}
install -d ${T}/{cache,twork}
install -d $WORKDIR/build $WORKDIR/out/lib/firmware
genkernel \
--no-save-config \
--kernel-config="$T/config" \
--kernname="${PN}" \
--build-src="$S" \
--build-dst=${WORKDIR}/build \
--makeopts="${MAKEOPTS}" \
--firmware-dst=${WORKDIR}/out/lib/firmware \
--cachedir="${T}/cache" \
--tempdir="${T}/twork" \
--logfile="${WORKDIR}/genkernel.log" \
--bootdir="${WORKDIR}/out/boot" \
--lvm \
--luks \
--iscsi \
--module-prefix="${WORKDIR}/out" \
all || die "genkernel failed"
}

src_install() {
# copy sources into place:
dodir /usr/src
cp -a ${S} ${D}/usr/src/linux-${P} || die
cd ${D}/usr/src/linux-${P}
# prepare for real-world use and 3rd-party module building:
make mrproper || die
cp ${T}/config .config || die
cp -a ${T}/debian debian || die
yes "" | make oldconfig || die
# if we didn't use genkernel, we're done. The kernel source tree is left in
# an unconfigured state - you can't compile 3rd-party modules against it yet.
use binary || return
make prepare || die
make scripts || die
# OK, now the source tree is configured to allow 3rd-party modules to be
# built against it, since we want that to work since we have a binary kernel
# built.
cp -a ${WORKDIR}/out/* ${D}/ || die "couldn't copy output files into place"
# module symlink fixup:
rm -f ${D}/lib/modules/*/source || die
rm -f ${D}/lib/modules/*/build || die
cd ${D}/lib/modules
# module strip:
find -iname *.ko -exec strip --strip-debug {} \;
# back to the symlink fixup:
local moddir="$(ls -d [23]*)"
ln -s /usr/src/linux-${P} ${D}/lib/modules/${moddir}/source || die
ln -s /usr/src/linux-${P} ${D}/lib/modules/${moddir}/build || die
}

pkg_postinst() {
if [ ! -e ${ROOT}usr/src/linux ]
then
ln -s linux-${P} ${ROOT}usr/src/linux
fi
}

0 comments on commit c409670

Please sign in to comment.