2008-12-17 10:03:42 +01:00
|
|
|
# Template file for 'kernel'
|
|
|
|
pkgname=kernel
|
2009-08-11 18:58:08 +02:00
|
|
|
_kernel_ver=2.6.30
|
2009-09-18 13:17:17 +02:00
|
|
|
_kernel_patch_ver=7
|
2009-09-11 19:08:06 +02:00
|
|
|
#revision=1
|
2009-08-11 18:58:08 +02:00
|
|
|
version=${_kernel_ver}.${_kernel_patch_ver}
|
2009-08-25 16:56:06 +02:00
|
|
|
patch_files="unionfs-2.5.2_for_2.6.30.diff.gz"
|
|
|
|
patch_args="-Np1"
|
2008-10-27 14:13:10 +01:00
|
|
|
wrksrc="linux-$version"
|
2009-04-19 00:31:39 +02:00
|
|
|
distfiles="${KERNEL_SITE}/kernel/v2.6/linux-$version.tar.bz2"
|
2008-10-27 14:13:10 +01:00
|
|
|
build_style=gnu_makefile
|
|
|
|
make_build_target="bzImage modules"
|
|
|
|
make_install_target="modules_install
|
2009-03-28 08:25:57 +01:00
|
|
|
INSTALL_MOD_PATH=${XBPS_DESTDIR}/${pkgname}-${version}"
|
2008-12-17 10:03:42 +01:00
|
|
|
short_desc="The Linux kernel and associated stuff (2.6 branch)"
|
2008-10-27 14:13:10 +01:00
|
|
|
maintainer="Juan RP <xtraeme@gmail.com>"
|
2009-09-18 13:17:17 +02:00
|
|
|
checksum=5b03125615d1a1230aa54aec922f00b61732cd502137a5fd7f5deb2a6e584044
|
2008-10-27 14:13:10 +01:00
|
|
|
long_desc="
|
2009-08-11 18:58:08 +02:00
|
|
|
This package provides the linux kernel image and the
|
|
|
|
kernel modules."
|
2008-10-27 14:13:10 +01:00
|
|
|
|
2009-08-11 18:58:08 +02:00
|
|
|
subpackages="firmware"
|
2009-03-12 11:50:46 +01:00
|
|
|
triggers="initramfs-tools"
|
2009-09-11 19:08:06 +02:00
|
|
|
essential=yes
|
2009-03-12 11:50:46 +01:00
|
|
|
|
2009-02-25 06:15:20 +01:00
|
|
|
Add_dependency full glibc
|
|
|
|
Add_dependency full dash
|
|
|
|
Add_dependency full coreutils
|
2009-03-11 06:31:56 +01:00
|
|
|
Add_dependency full module-init-tools
|
2009-02-25 06:15:20 +01:00
|
|
|
Add_dependency full initramfs-tools
|
|
|
|
Add_dependency build perl
|
2009-08-11 18:58:08 +02:00
|
|
|
Add_dependency run kernel-firmware ${_kernel_ver}
|
2008-10-27 14:13:10 +01:00
|
|
|
|
|
|
|
pre_build()
|
|
|
|
{
|
2008-12-17 10:03:42 +01:00
|
|
|
# If there's a file called kernel-<arch>-dotconfig, use it to
|
2008-10-27 14:13:10 +01:00
|
|
|
# configure the kernel; otherwise run the menuconfig target.
|
2008-11-22 17:38:27 +01:00
|
|
|
local arch=
|
2008-10-27 14:13:10 +01:00
|
|
|
|
2008-11-22 17:38:27 +01:00
|
|
|
if [ "$xbps_machine" != "x86_64" ]; then
|
|
|
|
arch=i386
|
|
|
|
else
|
|
|
|
arch=x86_64
|
|
|
|
fi
|
|
|
|
|
2009-02-03 21:35:57 +01:00
|
|
|
if [ -f $XBPS_TEMPLATESDIR/$pkgname/$arch-dotconfig ]; then
|
2008-12-16 20:55:14 +01:00
|
|
|
msg_normal "Detected a .config file for your arch, using it."
|
2009-02-03 21:35:57 +01:00
|
|
|
cp -f $XBPS_TEMPLATESDIR/$pkgname/$arch-dotconfig \
|
|
|
|
$wrksrc/.config
|
2008-10-27 14:13:10 +01:00
|
|
|
make oldconfig
|
|
|
|
else
|
|
|
|
make menuconfig
|
|
|
|
fi
|
2009-03-28 08:25:57 +01:00
|
|
|
if [ -n "${revision}" ]; then
|
|
|
|
sed -i -e "s|LOCALVERSION=\"\"|LOCALVERSION=\"_${revision}\"|" \
|
|
|
|
${wrksrc}/.config
|
|
|
|
fi
|
2008-10-27 14:13:10 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
post_install()
|
|
|
|
{
|
2009-03-28 08:25:57 +01:00
|
|
|
local lver
|
|
|
|
|
2009-03-11 06:31:56 +01:00
|
|
|
install -d ${DESTDIR}/lib ${DESTDIR}/boot
|
2008-10-27 14:13:10 +01:00
|
|
|
cd $wrksrc || exit 1
|
2009-02-25 06:15:20 +01:00
|
|
|
|
2009-03-28 08:25:57 +01:00
|
|
|
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}
|
2009-03-11 06:31:56 +01:00
|
|
|
|
2009-03-28 08:25:57 +01:00
|
|
|
cd ${DESTDIR}/lib/modules/${lver} && \
|
2009-03-11 06:31:56 +01:00
|
|
|
rm -f source build && \
|
2009-03-28 08:25:57 +01:00
|
|
|
ln -sf ../../../usr/src/kernel-headers-${lver} build && \
|
2009-03-11 06:31:56 +01:00
|
|
|
ln -sf build source
|
2008-10-27 14:13:10 +01:00
|
|
|
}
|