Skip to content

Commit

Permalink
FL-453: move linux-2.6.32 tarball to Funtoo osuosl mirror, add latest…
Browse files Browse the repository at this point in the history
… 75.2 kernel, hardmasked
  • Loading branch information
Oleg Vinichenko committed Mar 15, 2013
1 parent 8e55d44 commit 51d7cc9
Show file tree
Hide file tree
Showing 4 changed files with 362 additions and 1 deletion.
2 changes: 1 addition & 1 deletion profiles/package.mask/funtoo-staging
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

# Oleg Vinichenko (29 Jan 2012)
# add newest openvz kernel, masked fo testing, FL-379
=sys-kernel/openvz-rhel6-stable-2.6.32.042.072.10
>=sys-kernel/openvz-rhel6-stable-2.6.32.042.075

# Oleg Vinichenko (5 Nov 2012)
# FL-213: avx fixes to glibc, test mask
Expand Down
3 changes: 3 additions & 0 deletions sys-kernel/openvz-rhel6-stable/Manifest
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ DIST config-2.6.32-042stab059.7.i686 106894 SHA256 fcd5495706e799baedd60fdd401d1
DIST config-2.6.32-042stab059.7.x86_64 102219 SHA256 136137dd423c9849f21132d8abd99952c3e389947e810cc1583cdd0dbd6f300a SHA512 cd0e2948680366675e664130719206726f1bf9431d967ea59bc81f64a8b2f4113d99a71888a7cf7f70648caeeb1861bada43a0f39ba42cc0569ed26aaa75793a WHIRLPOOL 9474d6d3cefb40cf955a1b8547fe44b22d581ee96276945747e8de6be040f3d61953403cb25d927900846f8b44da096a0814227838cac68f9c0aa531fbe1d52e
DIST config-2.6.32-042stab072.10.i686 107096 SHA256 4e685c2e68fa57a49224b3dcffc4de6fb20f5a07ee6dc96a5b045c4cbc1ebc9e SHA512 8f035b3a5e63753cd25019d45681a910de0033fd4e1c9f83639b1150787da25c28b84c9d1e3b59c8032af2853bc3ba0ce6c0307b24624d030cf770df5f0225e1 WHIRLPOOL 7e076c9319d64e25b7924243db5c813820113d5b0eae527005122df33101643968fbd92d8ce1fd7955b9f827905a8e6edd9a83debc2f468283bd5af4fdcbca67
DIST config-2.6.32-042stab072.10.x86_64 102421 SHA256 a44106b0f1d74761f5cc2d698b94d123dda0c2c362d0b76463264c994174de84 SHA512 093426073d02b6910988b863c3d1812014363770a42650bacfdbba7bff009a8b477e309fcf4ddb53180bf54e872f2c5d2401e03aa4b56de610a2ff2e21219994 WHIRLPOOL eed68f29736de3c86b310e74eba4c0194db3e105c1d2379db35c617580c8da7994a3d818571eee66e04b8d044cd2aa25598e5d3a50722e7ad72c3b6c63bc8fe8
DIST config-2.6.32-042stab075.2.i686 107095 SHA256 440c991681a6b4652c90bd3ad64f86df2df112933b65469a447d82cc81a03ea3 SHA512 51d6831f6d95cfc105a3faff1b1f004124b4287b83e5201999c35b870e27d1eaddf6fc89b9744eb17fa059128860d5992574462fd1108b15a9d1853525987f1e WHIRLPOOL 07aec484a0e9d4b7b19bcb42a1de3b72f5a9cb332480bfd877f379da7a71fbe9de4ebef0163efd9e6d5053dcef3cc539816a05d33ce591fa289a160985bb7e3a
DIST config-2.6.32-042stab075.2.x86_64 102444 SHA256 97268f1f38f5bd317c1465e07b8c00cd19daa59705f186b377eb17d9ab9ac34e SHA512 3c2a04e8246282881194ad4f15fe95b8858f0eb73423dfa085f48e112e952e3c06ad3c6fb20016af17ff04313b9dd97152bb4aa564414590feaead33a25b5652 WHIRLPOOL fefb7cdd8e9d1c2095e1f011322760b4e6e14bbc3ec927f94bbb102b9f210e1817f68ea20ec29073064beda5c72aae9d7f6328e0ffbc2638455fd3cf75433557
DIST linux-2.6.32.tar.bz2 64424138 SHA256 5099786d80b8407d98a619df00209c2353517f22d804fdd9533b362adcb4504e SHA512 739c67875dcb1a80412a034e7d3dddfb6aea4d7a77f12b572fb5afbb827e6ab5a682df7501c0982966e85948ddf7251b8dc5eeb064b2d264025160d8a903bc82 WHIRLPOOL 762dfd7f4c062fdcda00b7fc45ead0f8cb4e321027769a12d92640012f5768c2033da95f24491adfcd6eb453c2658978d4f170e73e4f8a5ccd263efcbe00429d
DIST patch-042stab039.10-combined.gz 15807030 SHA256 be0b5239baac4b371012d23b295414729fb3d8f68fa1765308c1e3f6f67651a5
DIST patch-042stab044.11-combined.gz 15840950 SHA256 43f3c1a83631b867d04141b00edb05a720eb1d23ce732f4b2feaf37a84ede40f
Expand All @@ -26,3 +28,4 @@ DIST patch-042stab055.10-combined.gz 24609560 SHA256 f6260bbde201257e7e53d805421
DIST patch-042stab055.12-combined.gz 24627778 SHA256 d40f6d89d4c8b6eb3b15203b4528927b899562a6982cfc2e1169bd64d1137253 SHA512 da5d15cd81f003d4f94a8a7df3f29efb618fe74019601b0c0a61293c00a53e592e8afd60ffa010b723553a47ba7dc46985289003ff5d9617723e5bdaff7d6d7c WHIRLPOOL 505a25bb4d14222470236abfca274748313b35576d95cc5b39bd8fb839c0ed28f4ba0dee849e1780e981667eeaf9a85c50169540b174d337571e111eb6b11301
DIST patch-042stab059.7-combined.gz 35337546 SHA256 46de5953c17bf62337eb42ee7520e39c4a1d9b99b9775c86c8fd13d1d6077e05 SHA512 9255a651b9c32d835f5942549916d752e8bd9b530894eaf7f047fd0709dd38897778cafeebd69d45bd03b86f753c3fb667f3f7656999dec368f634b6faac2608 WHIRLPOOL eb2eaa2d58b7ec31c87904c934155c1cff8c52d373d009a7276fe706ac0aacd5f66cc20e65b5d658a962781c8dc03d9ca91c20d618dd3f8036bb9c060375d64d
DIST patch-042stab072.10-combined.gz 35494090 SHA256 aa3bad74c37dd69f3b55f45e4017838cfb4f3bfd3488a9e25fe1ab5caac7be9f SHA512 f9facd3b655443d79f9417558d5befe255a51cf33f3e224dbd7c90c0c97ccb7c66638bf1def47bdfc27f261db5c0f92a3677f6e0bf381f95ac9d35bcfcf5824a WHIRLPOOL 925d048b8fc6f1a6e14c78a880d363b2abebdf63e0cc8a3b4f9c5a841c59377902c18b0e35ae73c8c758f05f0df5e72c625c81012fa49c92b75cc696198bc62a
DIST patch-042stab075.2-combined.gz 35532089 SHA256 01ea0c38f0f3aa8da5380efd5b00f916e89e0024ba38342de6ade2106fd83053 SHA512 85b632d3cbcbeddcb0689631f6920558b895202539f1b58c13e643a8ba2af7ef08c24fde1b48354607e7fbc1db48a9b33924f1d44999f03abc9f51a2929608fa WHIRLPOOL da77aae2273c1d5d76f0562300880fbf243e45ce2eeeb0e85702df766ac234b21b8c29d9fb5da886fc983b28a77acd81666c00ef0a7176a3585fe4bf655dea39
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
# Distributed under the terms of the GNU General Public License v2

EAPI=2

inherit mount-boot

SLOT=$PVR
CKV=2.6.32
OKV=$CKV
OVZ_KERNEL="042stab072"
OVZ_REV="10"
OVZ_KV=${OVZ_KERNEL}.${OVZ_REV}
KV_FULL=${PN}-${PVR}
EXTRAVERSION=-${OVZ_KV}
KERNEL_ARCHIVE="linux-${CKV}.tar.bz2"
KERNEL_URI="http://ftp.osuosl.org/pub/funtoo/distfiles/${KERNEL_ARCHIVE}"
RESTRICT="binchecks strip mirror"

LICENSE="GPL-2"
KEYWORDS="*"
IUSE="binary"
DEPEND="binary? ( >=sys-kernel/genkernel-3.4.40.1 )"
RDEPEND="binary? ( >=sys-fs/udev-160 )"
DESCRIPTION="Full Linux kernel sources - RHEL6 kernel with OpenVZ patchset"
HOMEPAGE="http://www.openvz.org"
MAINPATCH="patch-${OVZ_KV}-combined.gz"
SRC_URI="${KERNEL_URI}
http://download.openvz.org/kernel/branches/rhel6-${CKV}/${OVZ_KV}/configs/config-${CKV}-${OVZ_KV}.i686
http://download.openvz.org/kernel/branches/rhel6-${CKV}/${OVZ_KV}/configs/config-${CKV}-${OVZ_KV}.x86_64
http://download.openvz.org/kernel/branches/rhel6-${CKV}/${OVZ_KV}/patches/$MAINPATCH"
S="$WORKDIR/linux-${CKV}"

K_EXTRAEINFO="
This OpenVZ kernel uses RHEL6 (Red Hat Enterprise Linux 6) patch set.
This patch set is maintained by Red Hat for enterprise use, and contains
further modifications by the OpenVZ development team and the Funtoo
Linux project.
Red Hat typically only ensures that their kernels build using their
own official kernel configurations. Significant variations from these
configurations can result in build failures.
For best results, always start with a .config provided by the OpenVZ
team from:
http://wiki.openvz.org/Download/kernel/rhel6/${OVZ_KERNEL}.
On amd64 and x86 arches, one of these configurations has automatically been
enabled in the kernel source tree that was just installed for you.
Slight modifications to the kernel configuration necessary for booting
are usually fine. If you are using genkernel, the default configuration
should be sufficient for your needs."

src_unpack() {
unpack ${KERNEL_ARCHIVE}
}

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 -s $* || die "patch $p failed"
}

pkg_setup() {
case $ARCH in
x86)
defconfig_src=i686
;;
amd64)
defconfig_src=x86_64
;;
*)
die "unsupported ARCH: $ARCH"
;;
esac
defconfig_src="${DISTDIR}/config-${CKV}-${OVZ_KV}.${defconfig_src}"
unset ARCH; unset LDFLAGS #will interfere with Makefile if set
}

src_prepare() {
apply $DISTDIR/$MAINPATCH -p1
apply ${FILESDIR}/rhel5-openvz-sources-2.6.18.028.064.7-bridgemac.patch -p1
# disable video4linux version 1 - deprecated as of linux-headers-2.6.38:
# http://forums.gentoo.org/viewtopic-t-872167.html?sid=60f2e6e08cf1f2e99b3e61772a1dc276
sed -i -e "s:video4linux/::g" Documentation/Makefile || die
sed -i -e "s:^\(EXTRAVERSION =\).*:\1 ${EXTRAVERSION}:" Makefile || die
sed -i -e 's:#export\tINSTALL_PATH:export\tINSTALL_PATH:' Makefile || die
cp $DISTDIR/config-${CKV}-${OVZ_KV}.i686 arch/x86/configs/i386_defconfig || die
cp $DISTDIR/config-${CKV}-${OVZ_KV}.x86_64 arch/x86/configs/x86_64_defconfig || die
rm -f .config >/dev/null
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
DEFAULT_KERNEL_SOURCE="${S}" INSTALL_FW_PATH=${WORKDIR}/out/lib/firmware CMD_KERNEL_DIR="${S}" genkernel ${GKARGS} \
--no-save-config \
--kernel-config="$defconfig_src" \
--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 \
--mdadm \
--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 $defconfig_src .config || 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 2*)"
ln -s /usr/src/linux-${P} ${D}/lib/modules/${moddir}/source || die
ln -s /usr/src/linux-${P} ${D}/lib/modules/${moddir}/build || die

# Fixes FL-14
cp "${WORKDIR}/build/System.map" "${D}/usr/src/linux-${P}/" || die
cp "${WORKDIR}/build/Module.symvers" "${D}/usr/src/linux-${P}/" || die
}

pkg_postinst() {
# if K_EXTRAEINFO is set then lets display it now
if [[ -n ${K_EXTRAEINFO} ]]; then
echo ${K_EXTRAEINFO} | fmt |
while read -s ELINE; do einfo "${ELINE}"; done
fi
if [ ! -e ${ROOT}usr/src/linux ]
then
ln -s linux-${P} ${ROOT}usr/src/linux
fi
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
# Distributed under the terms of the GNU General Public License v2

EAPI=2

inherit mount-boot

SLOT=$PVR
CKV=2.6.32
OKV=$CKV
OVZ_KERNEL="042stab075"
OVZ_REV="2"
OVZ_KV=${OVZ_KERNEL}.${OVZ_REV}
KV_FULL=${PN}-${PVR}
EXTRAVERSION=-${OVZ_KV}
KERNEL_ARCHIVE="linux-${CKV}.tar.bz2"
KERNEL_URI="http://ftp.osuosl.org/pub/funtoo/distfiles/${KERNEL_ARCHIVE}"
RESTRICT="binchecks strip mirror"

LICENSE="GPL-2"
KEYWORDS="*"
IUSE="binary"
DEPEND="binary? ( >=sys-kernel/genkernel-3.4.40.1 )"
RDEPEND="binary? ( >=sys-fs/udev-160 )"
DESCRIPTION="Full Linux kernel sources - RHEL6 kernel with OpenVZ patchset"
HOMEPAGE="http://www.openvz.org"
MAINPATCH="patch-${OVZ_KV}-combined.gz"
SRC_URI="${KERNEL_URI}
http://download.openvz.org/kernel/branches/rhel6-${CKV}/${OVZ_KV}/configs/config-${CKV}-${OVZ_KV}.i686
http://download.openvz.org/kernel/branches/rhel6-${CKV}/${OVZ_KV}/configs/config-${CKV}-${OVZ_KV}.x86_64
http://download.openvz.org/kernel/branches/rhel6-${CKV}/${OVZ_KV}/patches/$MAINPATCH"
S="$WORKDIR/linux-${CKV}"

K_EXTRAEINFO="
This OpenVZ kernel uses RHEL6 (Red Hat Enterprise Linux 6) patch set.
This patch set is maintained by Red Hat for enterprise use, and contains
further modifications by the OpenVZ development team and the Funtoo
Linux project.
Red Hat typically only ensures that their kernels build using their
own official kernel configurations. Significant variations from these
configurations can result in build failures.
For best results, always start with a .config provided by the OpenVZ
team from:
http://wiki.openvz.org/Download/kernel/rhel6/${OVZ_KERNEL}.
On amd64 and x86 arches, one of these configurations has automatically been
enabled in the kernel source tree that was just installed for you.
Slight modifications to the kernel configuration necessary for booting
are usually fine. If you are using genkernel, the default configuration
should be sufficient for your needs."

src_unpack() {
unpack ${KERNEL_ARCHIVE}
}

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 -s $* || die "patch $p failed"
}

pkg_setup() {
case $ARCH in
x86)
defconfig_src=i686
;;
amd64)
defconfig_src=x86_64
;;
*)
die "unsupported ARCH: $ARCH"
;;
esac
defconfig_src="${DISTDIR}/config-${CKV}-${OVZ_KV}.${defconfig_src}"
unset ARCH; unset LDFLAGS #will interfere with Makefile if set
}

src_prepare() {
apply $DISTDIR/$MAINPATCH -p1
apply ${FILESDIR}/rhel5-openvz-sources-2.6.18.028.064.7-bridgemac.patch -p1
# disable video4linux version 1 - deprecated as of linux-headers-2.6.38:
# http://forums.gentoo.org/viewtopic-t-872167.html?sid=60f2e6e08cf1f2e99b3e61772a1dc276
sed -i -e "s:video4linux/::g" Documentation/Makefile || die
sed -i -e "s:^\(EXTRAVERSION =\).*:\1 ${EXTRAVERSION}:" Makefile || die
sed -i -e 's:#export\tINSTALL_PATH:export\tINSTALL_PATH:' Makefile || die
cp $DISTDIR/config-${CKV}-${OVZ_KV}.i686 arch/x86/configs/i386_defconfig || die
cp $DISTDIR/config-${CKV}-${OVZ_KV}.x86_64 arch/x86/configs/x86_64_defconfig || die
rm -f .config >/dev/null
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
DEFAULT_KERNEL_SOURCE="${S}" INSTALL_FW_PATH=${WORKDIR}/out/lib/firmware CMD_KERNEL_DIR="${S}" genkernel ${GKARGS} \
--no-save-config \
--kernel-config="$defconfig_src" \
--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 \
--mdadm \
--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 $defconfig_src .config || 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 2*)"
ln -s /usr/src/linux-${P} ${D}/lib/modules/${moddir}/source || die
ln -s /usr/src/linux-${P} ${D}/lib/modules/${moddir}/build || die

# Fixes FL-14
cp "${WORKDIR}/build/System.map" "${D}/usr/src/linux-${P}/" || die
cp "${WORKDIR}/build/Module.symvers" "${D}/usr/src/linux-${P}/" || die
}

pkg_postinst() {
# if K_EXTRAEINFO is set then lets display it now
if [[ -n ${K_EXTRAEINFO} ]]; then
echo ${K_EXTRAEINFO} | fmt |
while read -s ELINE; do einfo "${ELINE}"; done
fi
if [ ! -e ${ROOT}usr/src/linux ]
then
ln -s linux-${P} ${ROOT}usr/src/linux
fi
}

0 comments on commit 51d7cc9

Please sign in to comment.