void-packages/templates/kernel/template
Juan RP 7ecdfe2176 kernel: update to 2.6.31.1.
--HG--
extra : convert_revision : 0f52d3252ac2b8ba1da61f88a6438272b4d1310a
2009-09-28 15:52:01 +02:00

81 lines
2.1 KiB
Text

# Template file for 'kernel'
pkgname=kernel
_kernel_ver=2.6.31
_kernel_patch_ver=1
#revision=1
version=${_kernel_ver}.${_kernel_patch_ver}
patch_files="unionfs-2.5.3_for_2.6.31.diff.gz"
patch_args="-Np1"
wrksrc="linux-$version"
distfiles="${KERNEL_SITE}/kernel/v2.6/linux-$version.tar.bz2"
build_style=gnu_makefile
make_build_target="bzImage modules"
make_install_target="modules_install
INSTALL_MOD_PATH=${XBPS_DESTDIR}/${pkgname}-${version}"
short_desc="The Linux kernel and associated stuff (2.6 branch)"
maintainer="Juan RP <xtraeme@gmail.com>"
checksum=090af01804323c29e07f0a550f192468eb96cdba9a13d643b03e648a04af6872
long_desc="
This package provides the linux kernel image and the
kernel modules."
subpackages="firmware"
triggers="initramfs-tools"
essential=yes
Add_dependency full glibc
Add_dependency full dash
Add_dependency full coreutils
Add_dependency full module-init-tools
Add_dependency full initramfs-tools
Add_dependency build perl
Add_dependency run kernel-firmware ${_kernel_ver}
pre_build()
{
# If there's a file called kernel-<arch>-dotconfig, use it to
# configure the kernel; otherwise run the menuconfig target.
local arch=
if [ "$xbps_machine" != "x86_64" ]; then
arch=i386
else
arch=x86_64
fi
if [ -f $XBPS_TEMPLATESDIR/$pkgname/$arch-dotconfig ]; then
msg_normal "Detected a .config file for your arch, using it."
cp -f $XBPS_TEMPLATESDIR/$pkgname/$arch-dotconfig \
$wrksrc/.config
make oldconfig
else
make menuconfig
fi
if [ -n "${revision}" ]; then
sed -i -e "s|LOCALVERSION=\"\"|LOCALVERSION=\"_${revision}\"|" \
${wrksrc}/.config
fi
}
post_install()
{
local lver
install -d ${DESTDIR}/lib ${DESTDIR}/boot
cd $wrksrc || exit 1
if [ -n "$revision" ]; then
lver="${version}_${revision}"
else
lver="${version}"
fi
install -m 644 arch/x86/boot/bzImage ${DESTDIR}/boot/vmlinuz-${lver}
install -m 644 System.map ${DESTDIR}/boot/System.map-${lver}
install -m 644 .config ${DESTDIR}/boot/config-${lver}
cd ${DESTDIR}/lib/modules/${lver} && \
rm -f source build && \
ln -sf ../../../usr/src/kernel-headers-${lver} build && \
ln -sf build source
}