[sys-kernel/linux-server] new server-oriented kernel
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
AUX linux-server-2.6.31-amd64.config 100571 RMD160 385f369ebe2ef37e4aa542c96420f1324969224e SHA1 8270d0df23a7d41e188deea5b0af24a7a7a6a4cd SHA256 dcaded6b2001e8c03e962cd65a79277a83892511c2464166a7f7627d4e1c280d
|
||||
AUX linux-server-2.6.31-x86.config 100842 RMD160 7c7f5a1350f53763b95dce2e6645402ed780d1c0 SHA1 817f467e4346bb64d33cc96d6cee046b6a3d8628 SHA256 301b169751ea1bba4eba5a3801292776e7f674cc3627dd307470e11a4a33f373
|
||||
DIST 2.6.31-2.tar.bz2 268156 RMD160 6740fef6a150456c67fa0b51f6219edcd3b56253 SHA1 00671dbe2a72b735c2c0c84b30e353915d568233 SHA256 af977768a1aac5f55a84149a9d9bc72fe18b73fbee65b833b6c39109c27626c6
|
||||
DIST linux-2.6.31.tar.bz2 61494822 RMD160 c0d88e63740abf0d4f9d82557260a31643f5a01b SHA1 c6e0e6b473ba2b80d164e37cfabf294e783c03d9 SHA256 0acd83f7b85db7ee18c2b0b7505e1ba6fd722c36f49a8870a831c851660e3512
|
||||
EBUILD linux-server-2.6.31.ebuild 5015 RMD160 f783fc5ebaf54eb792efaed48a0007af9943ac4c SHA1 b89de33a0cb99af27ae27045ba0809059acb6089 SHA256 e6efe8a9ed1d10b5e46a2c945f2ac19db2d4d5a7c0ec9b1201100fc3aa65d313
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,187 @@
|
||||
# Copyright 2004-2009 Sabayon Linux
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
ETYPE="sources"
|
||||
K_WANT_GENPATCHES=""
|
||||
K_GENPATCHES_VER=""
|
||||
K_SABPATCHES_VER="2"
|
||||
K_SABPATCHES_PKG="${PV}-${K_SABPATCHES_VER}.tar.bz2"
|
||||
inherit kernel-2 sabayon-artwork mount-boot linux-mod
|
||||
detect_version
|
||||
detect_arch
|
||||
|
||||
DESCRIPTION="Official Sabayon Linux Server optimized kernel image"
|
||||
RESTRICT="mirror"
|
||||
IUSE="splash dmraid grub"
|
||||
UNIPATCH_STRICTORDER="yes"
|
||||
KEYWORDS="~amd64 ~x86"
|
||||
HOMEPAGE="http://www.sabayon.org"
|
||||
|
||||
SRC_URI="${KERNEL_URI}
|
||||
http://distfiles.sabayonlinux.org/${CATEGORY}/linux-sabayon-patches/${K_SABPATCHES_PKG}"
|
||||
DEPEND="${DEPEND}
|
||||
<sys-kernel/genkernel-3.4.11
|
||||
splash? ( x11-themes/sabayon-artwork-core )"
|
||||
RDEPEND="grub? ( sys-boot/grub sys-boot/grub-handler )"
|
||||
|
||||
KV_FULL=${KV_FULL/linux/server}
|
||||
MY_KERNEL_DIR="/usr/src/linux-${KV_FULL}"
|
||||
KV_OUT_DIR="${MY_KERNEL_DIR}"
|
||||
K_NOSETEXTRAVERSION="1"
|
||||
EXTRAVERSION=${EXTRAVERSION/linux/server}
|
||||
SLOT="${PV}"
|
||||
S="${WORKDIR}/linux-${KV_FULL}"
|
||||
KERN_INITRAMFS_SEARCH_NAME="initramfs-genkernel-${ARCH}-*-server-*"
|
||||
|
||||
# patches
|
||||
UNIPATCH_LIST="${DISTFILES}/${K_SABPATCHES_PKG}"
|
||||
|
||||
src_unpack() {
|
||||
|
||||
kernel-2_src_unpack
|
||||
cd "${S}"
|
||||
|
||||
# manually set extraversion
|
||||
sed -i -e "s:^\(EXTRAVERSION =\).*:\1 ${EXTRAVERSION}:" Makefile
|
||||
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
# disable sandbox
|
||||
export SANDBOX_ON=0
|
||||
export LDFLAGS=""
|
||||
|
||||
# creating workdirs
|
||||
mkdir ${WORKDIR}/lib
|
||||
mkdir ${WORKDIR}/cache
|
||||
mkdir ${S}/temp
|
||||
# needed anyway, even if grub use flag is not used here
|
||||
mkdir -p ${WORKDIR}/boot/grub
|
||||
|
||||
einfo "Starting to compile kernel..."
|
||||
cp ${FILESDIR}/${PF/-r0/}-${ARCH}.config ${WORKDIR}/config || die "cannot copy kernel config"
|
||||
|
||||
# do some cleanup
|
||||
rm -rf "${WORKDIR}"/lib
|
||||
rm -rf "${WORKDIR}"/cache
|
||||
rm -rf "${S}"/temp
|
||||
OLDARCH=${ARCH}
|
||||
unset ARCH
|
||||
cd ${S}
|
||||
GK_ARGS="--disklabel"
|
||||
use splash && GKARGS="${GKARGS} --splash=sabayon"
|
||||
use dmraid && GKARGS="${GKARGS} --dmraid"
|
||||
export DEFAULT_KERNEL_SOURCE="${S}"
|
||||
export CMD_KERNEL_DIR="${S}"
|
||||
DEFAULT_KERNEL_SOURCE="${S}" CMD_KERNEL_DIR="${S}" genkernel ${GKARGS} \
|
||||
--kerneldir=${S} \
|
||||
--kernel-config=${WORKDIR}/config \
|
||||
--cachedir=${WORKDIR}/cache \
|
||||
--makeopts=-j3 \
|
||||
--tempdir=${S}/temp \
|
||||
--logfile=${WORKDIR}/genkernel.log \
|
||||
--bootdir=${WORKDIR}/boot \
|
||||
--mountboot \
|
||||
--lvm \
|
||||
--luks \
|
||||
--disklabel \
|
||||
--module-prefix=${WORKDIR}/lib \
|
||||
all || die "genkernel failed"
|
||||
ARCH=${OLDARCH}
|
||||
}
|
||||
|
||||
src_install() {
|
||||
dodir "${MY_KERNEL_DIR}"
|
||||
insinto "${MY_KERNEL_DIR}"
|
||||
|
||||
cp "${FILESDIR}/${PF/-r0/}-${OLDARCH}.config" .config
|
||||
doins ".config" || die "cannot copy kernel config"
|
||||
doins Module.symvers || die "cannot copy Module.symvers"
|
||||
doins System.map || die "cannot copy System.map"
|
||||
|
||||
insinto "/boot"
|
||||
doins "${WORKDIR}"/boot/*
|
||||
cp -Rp "${WORKDIR}"/lib/* "${D}/"
|
||||
rm "${D}/lib/modules/${KV_FULL}/source"
|
||||
rm "${D}/lib/modules/${KV_FULL}/build"
|
||||
|
||||
dosym "../../..${MY_KERNEL_DIR}" "/lib/modules/${KV_FULL}/source" || die "cannot install source symlink"
|
||||
dosym "../../..${MY_KERNEL_DIR}" "/lib/modules/${KV_FULL}/build" || die "cannot install build symlink"
|
||||
|
||||
addwrite "/lib/firmware"
|
||||
# Workaround kernel issue with colliding
|
||||
# firmwares across different kernel versions
|
||||
for fwfile in `find "${D}/lib/firmware" -type f`; do
|
||||
|
||||
sysfile="${ROOT}/${fwfile/${D}}"
|
||||
if [ -f "${sysfile}" ]; then
|
||||
ewarn "Removing duplicated: ${sysfile}"
|
||||
rm ${sysfile} || die "failed to remove ${sysfile}"
|
||||
fi
|
||||
|
||||
done
|
||||
}
|
||||
|
||||
pkg_setup() {
|
||||
# do not run linux-mod-pkg_setup
|
||||
einfo "Preparing to build the kernel and its modules"
|
||||
}
|
||||
|
||||
pkg_preinst() {
|
||||
mount-boot_mount_boot_partition
|
||||
linux-mod_pkg_preinst
|
||||
UPDATE_MODULEDB=false
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
fstab_file="${ROOT}/etc/fstab"
|
||||
einfo "Removing extents option for ext4 drives from ${fstab_file}"
|
||||
# Remove "extents" from /etc/fstab
|
||||
if [ -f "${fstab_file}" ]; then
|
||||
sed -i '/ext4/ s/extents//g' ${fstab_file}
|
||||
fi
|
||||
|
||||
# Update kernel initramfs to match user customizations
|
||||
update_sabayon_kernel_initramfs_splash
|
||||
|
||||
# Add kernel to grub.conf
|
||||
if use grub; then
|
||||
if use amd64; then
|
||||
local kern_arch="x86_64"
|
||||
else
|
||||
local kern_arch="x86"
|
||||
fi
|
||||
/usr/sbin/grub-handler add \
|
||||
"/boot/kernel-genkernel-${kern_arch}-${KV_FULL}" \
|
||||
"/boot/initramfs-genkernel-${kern_arch}-${KV_FULL}"
|
||||
fi
|
||||
|
||||
kernel-2_pkg_postinst
|
||||
linux-mod_pkg_postinst
|
||||
|
||||
einfo "Please report kernel bugs at:"
|
||||
einfo "http://bugs.sabayonlinux.org"
|
||||
|
||||
ewarn "The Sabayon Linux kernel source code is now located at"
|
||||
ewarn "=sys-kernel/linux-sabayon-sources-${PVR}."
|
||||
ewarn "Sabayon Linux recommends that portage users install"
|
||||
ewarn "sys-kernel/linux-sabayon-sources-${PVR} if you want"
|
||||
ewarn "to build any packages that install kernel modules"
|
||||
ewarn "(such as ati-drivers, nvidia-drivers, virtualbox, etc...)."
|
||||
}
|
||||
|
||||
pkg_postrm() {
|
||||
# Add kernel to grub.conf
|
||||
if use grub; then
|
||||
if use amd64; then
|
||||
local kern_arch="x86_64"
|
||||
else
|
||||
local kern_arch="x86"
|
||||
fi
|
||||
/usr/sbin/grub-handler remove \
|
||||
"/boot/kernel-genkernel-${kern_arch}-${KV_FULL}" \
|
||||
"/boot/initramfs-genkernel-${kern_arch}-${KV_FULL}"
|
||||
fi
|
||||
|
||||
linux-mod_pkg_postrm
|
||||
}
|
||||
Reference in New Issue
Block a user