void-packages/templates/kernel/template

65 lines
1.8 KiB
Plaintext
Raw Normal View History

# Template file for 'kernel'
pkgname=kernel
version=2.6.29
# Vanilla kernel + UnionFS patch.
#patch_files="unionfs-2.5.1_for_2.6.29-rc2.diff.gz"
#patch_args="-p1"
wrksrc="linux-$version"
distfiles="http://www.kernel.org/pub/linux/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=58a5ea16d499fe06f90fcbf1d687d1235d2cb9bc28bf979867bd3faadf38fc3f
long_desc="
This package provides the linux kernel image, kernel modules
and firmware files."
triggers="initramfs-tools"
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
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
}
post_install()
{
install -d ${DESTDIR}/lib ${DESTDIR}/boot
cd $wrksrc || exit 1
install -m 644 arch/x86/boot/bzImage ${DESTDIR}/boot/vmlinuz-$version
install -m 644 System.map ${DESTDIR}/boot/System.map-$version
install -m 644 .config ${DESTDIR}/boot/config-$version
cd ${DESTDIR}/lib/modules/${version} && \
rm -f source build && \
ln -sf ../../../usr/src/kernel-headers-${version} build && \
ln -sf build source
}