Package Base Details: linux-rt

Git Clone URL: https://aur.archlinux.org/linux-rt.git (read-only)
Submitter: schivmeister
Maintainer: jhernberg (dvzrv)
Last Packager: dvzrv
Votes: 158
Popularity: 1.979704
First Submitted: 2011-08-09 20:03
Last Updated: 2019-06-04 12:09

Latest Comments

« First ‹ Previous ... 86 87 88 89 90 91

ying commented on 2010-04-22 17:27

Broken. This will work with pkgver=2.6.31.12_rt21:


<quote># Maintainer: Ray Rashif <schivmeister@gmail.com>
# Contributor: timbosa <tinny_tim@dodo.com.au>
# Contributor: Tobias Powalowski <tpowa@archlinux.org>
# Contributor: Thomas Baechler <thomas@archlinux.org>

pkgname=kernel26rt
_kernelname=${pkgname#kernel26}
_basekernel=2.6.31
_realkernel=2.6.31 # actual basekernel eg. for rc builds
_kernelpatch=.12
_rtpatch=-rt21
pkgver=2.6.31.12_rt21
pkgrel=1

# If sources are rc, old rc, old rt, rc & old rt, old rc & old rt:
# rc, rc-old, rt-old, rc-rt-old, all-old or blank for default
_source=

pkgdesc="The Linux Kernel and modules with realtime preemption"
arch=(i686 x86_64)
license=('GPL2')
url="http://rt.wiki.kernel.org"
backup=(etc/mkinitcpio.d/$pkgname.preset)
depends=('kernel26-firmware' 'module-init-tools' 'mkinitcpio>=0.5.20')
optdepends=('crda: to set the correct wireless channels of your country')
install=$pkgname.install

[ "$_source" = "rc" ] && _rc=testing/
[ "$_source" = "rc-old" ] && _rc=testing/v$_realkernel/
[ "$_source" = "rt-old" ] && _rt=older/
[ "$_source" = "rc-rt-old" ] && _rc=testing/ && _rt=older/
[ "$_source" = "all-old" ] && _rc=testing/v$_realkernel/ && _rt=older/
[ -n "$_kernelpatch" ] && \
_kernpatchurl="ftp://ftp.kernel.org/pub/linux/kernel/v2.6/${_rc}patch-$_realkernel$_kernelpatch.bz2"

source=(ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-$_realkernel.tar.bz2
$_kernpatchurl
ftp://ftp.kernel.org/pub/linux/kernel/projects/rt/${_rt}patch-$_realkernel$_kernelpatch$_rtpatch.bz2
catalyst-rt.patch
config
config.x86_64
$pkgname.preset
logo_linux_clut224.ppm
aufs2-base-20090910.patch
aufs2-standalone-20090910.patch)

build() {
KARCH=x86

cd "$srcdir/linux-$_realkernel"

# Add upstream patch
if [ -n "$_kernelpatch" ]; then
patch -Np1 -i ../patch-$_realkernel$_kernelpatch || return 1
fi

# Add support for AUFS2
patch -Np1 -i ../aufs2-base-20090910.patch || return 1
patch -Np1 -i ../aufs2-standalone-20090910.patch || return 1

# Add realtime patch
patch -Np1 -i ../patch-$_realkernel$_kernelpatch$_rtpatch || return 1

# Add proprietary ATI driver compatibility
patch -Np1 -i ../catalyst-rt.patch

# Add MBox-2 unofficial patch
patch -Np1 -i ../mbox2.patch

# Add our custom logo
cp ../logo_linux_clut224.ppm drivers/video/logo/

if [ "$CARCH" = "x86_64" ]; then
cat ../config.x86_64 > ./.config
elif [ "$CARCH" = "i686" ]; then
cat ../config > ./.config
elif [ -e ../../config.save ]; then
msg "Using previously autosaved config"
cat ../../config.save > ./.config
fi

sed -i "s|EXTRAVERSION =.*|EXTRAVERSION =|g" Makefile
sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"-$_kernelname\"|g" ./.config

# load configuration
_kernver=$_basekernel-$_kernelname
yes "" | make config
make menuconfig && cat .config > $startdir/config.save
#make xconfig
#make gconfig
#make oldconfig

# build!
make bzImage modules || return 1
mkdir -p "$pkgdir"/{lib/modules,boot}
make INSTALL_MOD_PATH="$pkgdir" modules_install || return 1
cp System.map "$pkgdir/boot/System.map26$_kernelname"
cp "arch/$KARCH/boot/bzImage" "$pkgdir/boot/vmlinuz26$_kernelname"
install -D -m644 Makefile \
"$pkgdir/usr/src/linux-$_kernver/Makefile"
install -D -m644 kernel/Makefile \
"$pkgdir/usr/src/linux-$_kernver/kernel/Makefile"
install -D -m644 .config \
"$pkgdir/usr/src/linux-$_kernver/.config"
mkdir -p "$pkgdir/usr/src/linux-$_kernver/include"

for i in acpi asm-{generic,x86} config linux math-emu media net pcmcia scsi sound video; do
cp -a include/$i "$pkgdir/usr/src/linux-$_kernver/include/"
done

# copy arch includes for external modules
mkdir -p "$pkgdir/usr/src/linux-$_kernver/arch/x86"
cp -a arch/x86/include "$pkgdir/usr/src/linux-$_kernver/arch/x86/"

# copy files necessary for later builds, like nvidia and vmware
cp Module.symvers "$pkgdir/usr/src/linux-$_kernver"
cp -a scripts "$pkgdir/usr/src/linux-$_kernver"
# fix permissions on scripts dir
chmod og-w -R "$pkgdir/usr/src/linux-$_kernver/scripts"
#mkdir -p "$pkgdir/usr/src/linux-$_kernver/.tmp_versions

mkdir -p "$pkgdir/usr/src/linux-$_kernver/arch/$KARCH/kernel"

cp arch/$KARCH/Makefile "$pkgdir/usr/src/linux-$_kernver/arch/$KARCH/"
if [ "$CARCH" = "i686" ]; then
cp arch/$KARCH/Makefile_32.cpu "$pkgdir/usr/src/linux-$_kernver/arch/$KARCH/"
fi
cp arch/$KARCH/kernel/asm-offsets.s "$pkgdir/usr/src/linux-$_kernver/arch/$KARCH/kernel/"

# add headers for lirc package
mkdir -p "$pkgdir/usr/src/linux-$_kernver/drivers/media/video"
cp drivers/media/video/*.h "$pkgdir/usr/src/linux-$_kernver/drivers/media/video/"
for i in bt8xx cpia2 cx25840 cx88 em28xx et61x251 pwc saa7134 sn9c102 usbvideo zc0301; do
mkdir -p "$pkgdir/usr/src/linux-$_kernver/drivers/media/video/$i"
cp -a drivers/media/video/$i/*.h "$pkgdir/usr/src/linux-$_kernver/drivers/media/video/$i"
done
# add docbook makefile
install -Dm644 Documentation/DocBook/Makefile \
"$pkgdir/usr/src/linux-$_kernver/Documentation/DocBook/Makefile"
# add dm headers
mkdir -p "$pkgdir/usr/src/linux-$_kernver/drivers/md"
cp drivers/md/*.h "$pkgdir/usr/src/linux-$_kernver/drivers/md"
# add inotify.h
mkdir -p "$pkgdir/usr/src/linux-$_kernver/include/linux"
cp include/linux/inotify.h "$pkgdir/usr/src/linux-$_kernver/include/linux/"
# add wireless headers
mkdir -p "$pkgdir/usr/src/linux-$_kernver/net/mac80211/"
cp net/mac80211/*.h "$pkgdir/usr/src/linux-$_kernver/net/mac80211/"
# add dvb headers for external modules
# in reference to:
# http://bugs.archlinux.org/task/9912
mkdir -p "$pkgdir/usr/src/linux-$_kernver/drivers/media/dvb/dvb-core"
cp drivers/media/dvb/dvb-core/*.h "$pkgdir/usr/src/linux-$_kernver/drivers/media/dvb/dvb-core/"
# add dvb headers for external modules
# in reference to:
# http://bugs.archlinux.org/task/11194
mkdir -p "$pkgdir/usr/src/linux-$_kernver/include/config/dvb/"
cp include/config/dvb/*.h "$pkgdir/usr/src/linux-$_kernver/include/config/dvb/"
# add dvb headers for http://mcentral.de/hg/~mrec/em28xx-new
# in reference to:
# http://bugs.archlinux.org/task/13146
mkdir -p "$pkgdir/usr/src/linux-$_kernver/drivers/media/dvb/frontends/"
cp drivers/media/dvb/frontends/lgdt330x.h "$pkgdir/usr/src/linux-$_kernver/drivers/media/dvb/frontends/"
cp drivers/media/video/msp3400-driver.h "$pkgdir/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/"
# add xfs and shmem for aufs building
mkdir -p "$pkgdir/usr/src/linux-$_kernver/fs/xfs"
mkdir -p "$pkgdir/usr/src/linux-$_kernver/mm"
cp fs/xfs/xfs_sb.h "$pkgdir/usr/src/linux-$_kernver/fs/xfs/xfs_sb.h"
# add headers for virtualbox
# in reference to:
# http://bugs.archlinux.org/task/14568
cp -a include/drm "$pkgdir/usr/src/linux-$_kernver/include/"
# add headers for broadcom wl
# in reference to:
# http://bugs.archlinux.org/task/14568
cp -a include/trace "$pkgdir/usr/src/linux-$_kernver/include/"
# add vmlinux
cp vmlinux "$pkgdir/usr/src/linux-$_kernver"
# copy in Kconfig files
for i in `find . -name "Kconfig*"`; do
mkdir -p "$pkgdir"/usr/src/linux-$_kernver/`echo $i | sed 's|/Kconfig.*||'`
cp $i "$pkgdir/usr/src/linux-$_kernver/$i"
done

cd "$pkgdir/usr/src/linux-$_kernver/include" && ln -s asm-$KARCH asm

# add header for aufs2-util
cp -a "$srcdir/linux-$_realkernel/include/asm-generic/bitsperlong.h" "$pkgdir/usr/src/linux-$_kernver/include/asm/"

chown -R root.root "$pkgdir/usr/src/linux-$_kernver"
find "$pkgdir/usr/src/linux-$_kernver" -type d -exec chmod 755 {} \;
cd "$pkgdir/lib/modules/$_kernver" && \
(rm -f source build; ln -sf ../../../usr/src/linux-$_kernver build)
# install fallback mkinitcpio.conf file and preset file for kernel
install -m644 -D "$srcdir/$pkgname.preset" "$pkgdir/etc/mkinitcpio.d/$pkgname.preset" || return 1
# set correct depmod command for install
sed \
-e "s/KERNEL_NAME=.*/KERNEL_NAME=$_kernelname/g" \
-e "s/KERNEL_VERSION=.*/KERNEL_VERSION=$_kernver/g" \
-i "$startdir/$install"
sed \
-e "s|source .*|source /etc/mkinitcpio.d/kernel26$_kernelname.kver|g" \
-e "s|default_image=.*|default_image=\"/boot/$pkgname.img\"|g" \
-e "s|fallback_image=.*|fallback_image=\"/boot/$pkgname-fallback.img\"|g" \
-i "$pkgdir/etc/mkinitcpio.d/$pkgname.preset"

echo -e "# DO NOT EDIT THIS FILE\nALL_kver='$_kernver'" > "$startdir/pkg/etc/mkinitcpio.d/$pkgname.kver"
# remove unneeded architectures
rm -rf "$pkgdir"/usr/src/linux-$_kernver/arch/{alpha,arm,arm26,avr32,blackfin,cris,frv,h8300,ia64,m32r,m68k,m68knommu,mips,mn10300,parisc,powerpc,ppc,s390,sh,sh64,sparc,sparc64,um,v850,xtensa}
# remove the firmware
rm -rf "$pkgdir/lib/firmware"
}
md5sums=('84c077a37684e4cbfa67b18154390d8a'
'ce365b2c72ad0855e1746a80b7abdade'
'f9489cfa299b89f9d74ba0ced1ee803a'
'2a493d1ed820300460abb592b8408ac9'
'18da80ac1d41cba0f74cace471862bba'
'5e777ff68d871106d9bfa203f5e92750'
'a0921a7e563e7ae2d14c3a0603fa16ad'
'6a5a1925501fe20fafd04fdb3cb4f6ed'
'1bc4ac3b07e1aa8ef5ee65156b27aa50'
'79f7c17c3732f4d18a00eafc010396b3')</quote>

ying commented on 2010-04-22 17:27

Broken. This will work with pkgver=2.6.31.12_rt21:


<quote># Maintainer: Ray Rashif <schivmeister@gmail.com>
# Contributor: timbosa <tinny_tim@dodo.com.au>
# Contributor: Tobias Powalowski <tpowa@archlinux.org>
# Contributor: Thomas Baechler <thomas@archlinux.org>

pkgname=kernel26rt
_kernelname=${pkgname#kernel26}
_basekernel=2.6.31
_realkernel=2.6.31 # actual basekernel eg. for rc builds
_kernelpatch=.12
_rtpatch=-rt21
pkgver=2.6.31.12_rt21
pkgrel=1

# If sources are rc, old rc, old rt, rc & old rt, old rc & old rt:
# rc, rc-old, rt-old, rc-rt-old, all-old or blank for default
_source=

pkgdesc="The Linux Kernel and modules with realtime preemption"
arch=(i686 x86_64)
license=('GPL2')
url="http://rt.wiki.kernel.org"
backup=(etc/mkinitcpio.d/$pkgname.preset)
depends=('kernel26-firmware' 'module-init-tools' 'mkinitcpio>=0.5.20')
optdepends=('crda: to set the correct wireless channels of your country')
install=$pkgname.install

[ "$_source" = "rc" ] && _rc=testing/
[ "$_source" = "rc-old" ] && _rc=testing/v$_realkernel/
[ "$_source" = "rt-old" ] && _rt=older/
[ "$_source" = "rc-rt-old" ] && _rc=testing/ && _rt=older/
[ "$_source" = "all-old" ] && _rc=testing/v$_realkernel/ && _rt=older/
[ -n "$_kernelpatch" ] && \
_kernpatchurl="ftp://ftp.kernel.org/pub/linux/kernel/v2.6/${_rc}patch-$_realkernel$_kernelpatch.bz2"

source=(ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-$_realkernel.tar.bz2
$_kernpatchurl
ftp://ftp.kernel.org/pub/linux/kernel/projects/rt/${_rt}patch-$_realkernel$_kernelpatch$_rtpatch.bz2
catalyst-rt.patch
config
config.x86_64
$pkgname.preset
logo_linux_clut224.ppm
aufs2-base-20090910.patch
aufs2-standalone-20090910.patch)

build() {
KARCH=x86

cd "$srcdir/linux-$_realkernel"

# Add upstream patch
if [ -n "$_kernelpatch" ]; then
patch -Np1 -i ../patch-$_realkernel$_kernelpatch || return 1
fi

# Add support for AUFS2
patch -Np1 -i ../aufs2-base-20090910.patch || return 1
patch -Np1 -i ../aufs2-standalone-20090910.patch || return 1

# Add realtime patch
patch -Np1 -i ../patch-$_realkernel$_kernelpatch$_rtpatch || return 1

# Add proprietary ATI driver compatibility
patch -Np1 -i ../catalyst-rt.patch

# Add MBox-2 unofficial patch
patch -Np1 -i ../mbox2.patch

# Add our custom logo
cp ../logo_linux_clut224.ppm drivers/video/logo/

if [ "$CARCH" = "x86_64" ]; then
cat ../config.x86_64 > ./.config
elif [ "$CARCH" = "i686" ]; then
cat ../config > ./.config
elif [ -e ../../config.save ]; then
msg "Using previously autosaved config"
cat ../../config.save > ./.config
fi

sed -i "s|EXTRAVERSION =.*|EXTRAVERSION =|g" Makefile
sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"-$_kernelname\"|g" ./.config

# load configuration
_kernver=$_basekernel-$_kernelname
yes "" | make config
make menuconfig && cat .config > $startdir/config.save
#make xconfig
#make gconfig
#make oldconfig

# build!
make bzImage modules || return 1
mkdir -p "$pkgdir"/{lib/modules,boot}
make INSTALL_MOD_PATH="$pkgdir" modules_install || return 1
cp System.map "$pkgdir/boot/System.map26$_kernelname"
cp "arch/$KARCH/boot/bzImage" "$pkgdir/boot/vmlinuz26$_kernelname"
install -D -m644 Makefile \
"$pkgdir/usr/src/linux-$_kernver/Makefile"
install -D -m644 kernel/Makefile \
"$pkgdir/usr/src/linux-$_kernver/kernel/Makefile"
install -D -m644 .config \
"$pkgdir/usr/src/linux-$_kernver/.config"
mkdir -p "$pkgdir/usr/src/linux-$_kernver/include"

for i in acpi asm-{generic,x86} config linux math-emu media net pcmcia scsi sound video; do
cp -a include/$i "$pkgdir/usr/src/linux-$_kernver/include/"
done

# copy arch includes for external modules
mkdir -p "$pkgdir/usr/src/linux-$_kernver/arch/x86"
cp -a arch/x86/include "$pkgdir/usr/src/linux-$_kernver/arch/x86/"

# copy files necessary for later builds, like nvidia and vmware
cp Module.symvers "$pkgdir/usr/src/linux-$_kernver"
cp -a scripts "$pkgdir/usr/src/linux-$_kernver"
# fix permissions on scripts dir
chmod og-w -R "$pkgdir/usr/src/linux-$_kernver/scripts"
#mkdir -p "$pkgdir/usr/src/linux-$_kernver/.tmp_versions

mkdir -p "$pkgdir/usr/src/linux-$_kernver/arch/$KARCH/kernel"

cp arch/$KARCH/Makefile "$pkgdir/usr/src/linux-$_kernver/arch/$KARCH/"
if [ "$CARCH" = "i686" ]; then
cp arch/$KARCH/Makefile_32.cpu "$pkgdir/usr/src/linux-$_kernver/arch/$KARCH/"
fi
cp arch/$KARCH/kernel/asm-offsets.s "$pkgdir/usr/src/linux-$_kernver/arch/$KARCH/kernel/"

# add headers for lirc package
mkdir -p "$pkgdir/usr/src/linux-$_kernver/drivers/media/video"
cp drivers/media/video/*.h "$pkgdir/usr/src/linux-$_kernver/drivers/media/video/"
for i in bt8xx cpia2 cx25840 cx88 em28xx et61x251 pwc saa7134 sn9c102 usbvideo zc0301; do
mkdir -p "$pkgdir/usr/src/linux-$_kernver/drivers/media/video/$i"
cp -a drivers/media/video/$i/*.h "$pkgdir/usr/src/linux-$_kernver/drivers/media/video/$i"
done
# add docbook makefile
install -Dm644 Documentation/DocBook/Makefile \
"$pkgdir/usr/src/linux-$_kernver/Documentation/DocBook/Makefile"
# add dm headers
mkdir -p "$pkgdir/usr/src/linux-$_kernver/drivers/md"
cp drivers/md/*.h "$pkgdir/usr/src/linux-$_kernver/drivers/md"
# add inotify.h
mkdir -p "$pkgdir/usr/src/linux-$_kernver/include/linux"
cp include/linux/inotify.h "$pkgdir/usr/src/linux-$_kernver/include/linux/"
# add wireless headers
mkdir -p "$pkgdir/usr/src/linux-$_kernver/net/mac80211/"
cp net/mac80211/*.h "$pkgdir/usr/src/linux-$_kernver/net/mac80211/"
# add dvb headers for external modules
# in reference to:
# http://bugs.archlinux.org/task/9912
mkdir -p "$pkgdir/usr/src/linux-$_kernver/drivers/media/dvb/dvb-core"
cp drivers/media/dvb/dvb-core/*.h "$pkgdir/usr/src/linux-$_kernver/drivers/media/dvb/dvb-core/"
# add dvb headers for external modules
# in reference to:
# http://bugs.archlinux.org/task/11194
mkdir -p "$pkgdir/usr/src/linux-$_kernver/include/config/dvb/"
cp include/config/dvb/*.h "$pkgdir/usr/src/linux-$_kernver/include/config/dvb/"
# add dvb headers for http://mcentral.de/hg/~mrec/em28xx-new
# in reference to:
# http://bugs.archlinux.org/task/13146
mkdir -p "$pkgdir/usr/src/linux-$_kernver/drivers/media/dvb/frontends/"
cp drivers/media/dvb/frontends/lgdt330x.h "$pkgdir/usr/src/linux-$_kernver/drivers/media/dvb/frontends/"
cp drivers/media/video/msp3400-driver.h "$pkgdir/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/"
# add xfs and shmem for aufs building
mkdir -p "$pkgdir/usr/src/linux-$_kernver/fs/xfs"
mkdir -p "$pkgdir/usr/src/linux-$_kernver/mm"
cp fs/xfs/xfs_sb.h "$pkgdir/usr/src/linux-$_kernver/fs/xfs/xfs_sb.h"
# add headers for virtualbox
# in reference to:
# http://bugs.archlinux.org/task/14568
cp -a include/drm "$pkgdir/usr/src/linux-$_kernver/include/"
# add headers for broadcom wl
# in reference to:
# http://bugs.archlinux.org/task/14568
cp -a include/trace "$pkgdir/usr/src/linux-$_kernver/include/"
# add vmlinux
cp vmlinux "$pkgdir/usr/src/linux-$_kernver"
# copy in Kconfig files
for i in `find . -name "Kconfig*"`; do
mkdir -p "$pkgdir"/usr/src/linux-$_kernver/`echo $i | sed 's|/Kconfig.*||'`
cp $i "$pkgdir/usr/src/linux-$_kernver/$i"
done

cd "$pkgdir/usr/src/linux-$_kernver/include" && ln -s asm-$KARCH asm

# add header for aufs2-util
cp -a "$srcdir/linux-$_realkernel/include/asm-generic/bitsperlong.h" "$pkgdir/usr/src/linux-$_kernver/include/asm/"

chown -R root.root "$pkgdir/usr/src/linux-$_kernver"
find "$pkgdir/usr/src/linux-$_kernver" -type d -exec chmod 755 {} \;
cd "$pkgdir/lib/modules/$_kernver" && \
(rm -f source build; ln -sf ../../../usr/src/linux-$_kernver build)
# install fallback mkinitcpio.conf file and preset file for kernel
install -m644 -D "$srcdir/$pkgname.preset" "$pkgdir/etc/mkinitcpio.d/$pkgname.preset" || return 1
# set correct depmod command for install
sed \
-e "s/KERNEL_NAME=.*/KERNEL_NAME=$_kernelname/g" \
-e "s/KERNEL_VERSION=.*/KERNEL_VERSION=$_kernver/g" \
-i "$startdir/$install"
sed \
-e "s|source .*|source /etc/mkinitcpio.d/kernel26$_kernelname.kver|g" \
-e "s|default_image=.*|default_image=\"/boot/$pkgname.img\"|g" \
-e "s|fallback_image=.*|fallback_image=\"/boot/$pkgname-fallback.img\"|g" \
-i "$pkgdir/etc/mkinitcpio.d/$pkgname.preset"

echo -e "# DO NOT EDIT THIS FILE\nALL_kver='$_kernver'" > "$startdir/pkg/etc/mkinitcpio.d/$pkgname.kver"
# remove unneeded architectures
rm -rf "$pkgdir"/usr/src/linux-$_kernver/arch/{alpha,arm,arm26,avr32,blackfin,cris,frv,h8300,ia64,m32r,m68k,m68knommu,mips,mn10300,parisc,powerpc,ppc,s390,sh,sh64,sparc,sparc64,um,v850,xtensa}
# remove the firmware
rm -rf "$pkgdir/lib/firmware"
}
md5sums=('84c077a37684e4cbfa67b18154390d8a'
'ce365b2c72ad0855e1746a80b7abdade'
'f9489cfa299b89f9d74ba0ced1ee803a'
'2a493d1ed820300460abb592b8408ac9'
'18da80ac1d41cba0f74cace471862bba'
'5e777ff68d871106d9bfa203f5e92750'
'a0921a7e563e7ae2d14c3a0603fa16ad'
'6a5a1925501fe20fafd04fdb3cb4f6ed'
'1bc4ac3b07e1aa8ef5ee65156b27aa50'
'79f7c17c3732f4d18a00eafc010396b3')</quote>

ying commented on 2010-04-22 17:27

Broken. This will work with pkgver=2.6.31.12_rt21:


<quote># Maintainer: Ray Rashif <schivmeister@gmail.com>
# Contributor: timbosa <tinny_tim@dodo.com.au>
# Contributor: Tobias Powalowski <tpowa@archlinux.org>
# Contributor: Thomas Baechler <thomas@archlinux.org>

pkgname=kernel26rt
_kernelname=${pkgname#kernel26}
_basekernel=2.6.31
_realkernel=2.6.31 # actual basekernel eg. for rc builds
_kernelpatch=.12
_rtpatch=-rt21
pkgver=2.6.31.12_rt21
pkgrel=1

# If sources are rc, old rc, old rt, rc & old rt, old rc & old rt:
# rc, rc-old, rt-old, rc-rt-old, all-old or blank for default
_source=

pkgdesc="The Linux Kernel and modules with realtime preemption"
arch=(i686 x86_64)
license=('GPL2')
url="http://rt.wiki.kernel.org"
backup=(etc/mkinitcpio.d/$pkgname.preset)
depends=('kernel26-firmware' 'module-init-tools' 'mkinitcpio>=0.5.20')
optdepends=('crda: to set the correct wireless channels of your country')
install=$pkgname.install

[ "$_source" = "rc" ] && _rc=testing/
[ "$_source" = "rc-old" ] && _rc=testing/v$_realkernel/
[ "$_source" = "rt-old" ] && _rt=older/
[ "$_source" = "rc-rt-old" ] && _rc=testing/ && _rt=older/
[ "$_source" = "all-old" ] && _rc=testing/v$_realkernel/ && _rt=older/
[ -n "$_kernelpatch" ] && \
_kernpatchurl="ftp://ftp.kernel.org/pub/linux/kernel/v2.6/${_rc}patch-$_realkernel$_kernelpatch.bz2"

source=(ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-$_realkernel.tar.bz2
$_kernpatchurl
ftp://ftp.kernel.org/pub/linux/kernel/projects/rt/${_rt}patch-$_realkernel$_kernelpatch$_rtpatch.bz2
catalyst-rt.patch
config
config.x86_64
$pkgname.preset
logo_linux_clut224.ppm
aufs2-base-20090910.patch
aufs2-standalone-20090910.patch)

build() {
KARCH=x86

cd "$srcdir/linux-$_realkernel"

# Add upstream patch
if [ -n "$_kernelpatch" ]; then
patch -Np1 -i ../patch-$_realkernel$_kernelpatch || return 1
fi

# Add support for AUFS2
patch -Np1 -i ../aufs2-base-20090910.patch || return 1
patch -Np1 -i ../aufs2-standalone-20090910.patch || return 1

# Add realtime patch
patch -Np1 -i ../patch-$_realkernel$_kernelpatch$_rtpatch || return 1

# Add proprietary ATI driver compatibility
patch -Np1 -i ../catalyst-rt.patch

# Add MBox-2 unofficial patch
patch -Np1 -i ../mbox2.patch

# Add our custom logo
cp ../logo_linux_clut224.ppm drivers/video/logo/

if [ "$CARCH" = "x86_64" ]; then
cat ../config.x86_64 > ./.config
elif [ "$CARCH" = "i686" ]; then
cat ../config > ./.config
elif [ -e ../../config.save ]; then
msg "Using previously autosaved config"
cat ../../config.save > ./.config
fi

sed -i "s|EXTRAVERSION =.*|EXTRAVERSION =|g" Makefile
sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"-$_kernelname\"|g" ./.config

# load configuration
_kernver=$_basekernel-$_kernelname
yes "" | make config
make menuconfig && cat .config > $startdir/config.save
#make xconfig
#make gconfig
#make oldconfig

# build!
make bzImage modules || return 1
mkdir -p "$pkgdir"/{lib/modules,boot}
make INSTALL_MOD_PATH="$pkgdir" modules_install || return 1
cp System.map "$pkgdir/boot/System.map26$_kernelname"
cp "arch/$KARCH/boot/bzImage" "$pkgdir/boot/vmlinuz26$_kernelname"
install -D -m644 Makefile \
"$pkgdir/usr/src/linux-$_kernver/Makefile"
install -D -m644 kernel/Makefile \
"$pkgdir/usr/src/linux-$_kernver/kernel/Makefile"
install -D -m644 .config \
"$pkgdir/usr/src/linux-$_kernver/.config"
mkdir -p "$pkgdir/usr/src/linux-$_kernver/include"

for i in acpi asm-{generic,x86} config linux math-emu media net pcmcia scsi sound video; do
cp -a include/$i "$pkgdir/usr/src/linux-$_kernver/include/"
done

# copy arch includes for external modules
mkdir -p "$pkgdir/usr/src/linux-$_kernver/arch/x86"
cp -a arch/x86/include "$pkgdir/usr/src/linux-$_kernver/arch/x86/"

# copy files necessary for later builds, like nvidia and vmware
cp Module.symvers "$pkgdir/usr/src/linux-$_kernver"
cp -a scripts "$pkgdir/usr/src/linux-$_kernver"
# fix permissions on scripts dir
chmod og-w -R "$pkgdir/usr/src/linux-$_kernver/scripts"
#mkdir -p "$pkgdir/usr/src/linux-$_kernver/.tmp_versions

mkdir -p "$pkgdir/usr/src/linux-$_kernver/arch/$KARCH/kernel"

cp arch/$KARCH/Makefile "$pkgdir/usr/src/linux-$_kernver/arch/$KARCH/"
if [ "$CARCH" = "i686" ]; then
cp arch/$KARCH/Makefile_32.cpu "$pkgdir/usr/src/linux-$_kernver/arch/$KARCH/"
fi
cp arch/$KARCH/kernel/asm-offsets.s "$pkgdir/usr/src/linux-$_kernver/arch/$KARCH/kernel/"

# add headers for lirc package
mkdir -p "$pkgdir/usr/src/linux-$_kernver/drivers/media/video"
cp drivers/media/video/*.h "$pkgdir/usr/src/linux-$_kernver/drivers/media/video/"
for i in bt8xx cpia2 cx25840 cx88 em28xx et61x251 pwc saa7134 sn9c102 usbvideo zc0301; do
mkdir -p "$pkgdir/usr/src/linux-$_kernver/drivers/media/video/$i"
cp -a drivers/media/video/$i/*.h "$pkgdir/usr/src/linux-$_kernver/drivers/media/video/$i"
done
# add docbook makefile
install -Dm644 Documentation/DocBook/Makefile \
"$pkgdir/usr/src/linux-$_kernver/Documentation/DocBook/Makefile"
# add dm headers
mkdir -p "$pkgdir/usr/src/linux-$_kernver/drivers/md"
cp drivers/md/*.h "$pkgdir/usr/src/linux-$_kernver/drivers/md"
# add inotify.h
mkdir -p "$pkgdir/usr/src/linux-$_kernver/include/linux"
cp include/linux/inotify.h "$pkgdir/usr/src/linux-$_kernver/include/linux/"
# add wireless headers
mkdir -p "$pkgdir/usr/src/linux-$_kernver/net/mac80211/"
cp net/mac80211/*.h "$pkgdir/usr/src/linux-$_kernver/net/mac80211/"
# add dvb headers for external modules
# in reference to:
# http://bugs.archlinux.org/task/9912
mkdir -p "$pkgdir/usr/src/linux-$_kernver/drivers/media/dvb/dvb-core"
cp drivers/media/dvb/dvb-core/*.h "$pkgdir/usr/src/linux-$_kernver/drivers/media/dvb/dvb-core/"
# add dvb headers for external modules
# in reference to:
# http://bugs.archlinux.org/task/11194
mkdir -p "$pkgdir/usr/src/linux-$_kernver/include/config/dvb/"
cp include/config/dvb/*.h "$pkgdir/usr/src/linux-$_kernver/include/config/dvb/"
# add dvb headers for http://mcentral.de/hg/~mrec/em28xx-new
# in reference to:
# http://bugs.archlinux.org/task/13146
mkdir -p "$pkgdir/usr/src/linux-$_kernver/drivers/media/dvb/frontends/"
cp drivers/media/dvb/frontends/lgdt330x.h "$pkgdir/usr/src/linux-$_kernver/drivers/media/dvb/frontends/"
cp drivers/media/video/msp3400-driver.h "$pkgdir/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/"
# add xfs and shmem for aufs building
mkdir -p "$pkgdir/usr/src/linux-$_kernver/fs/xfs"
mkdir -p "$pkgdir/usr/src/linux-$_kernver/mm"
cp fs/xfs/xfs_sb.h "$pkgdir/usr/src/linux-$_kernver/fs/xfs/xfs_sb.h"
# add headers for virtualbox
# in reference to:
# http://bugs.archlinux.org/task/14568
cp -a include/drm "$pkgdir/usr/src/linux-$_kernver/include/"
# add headers for broadcom wl
# in reference to:
# http://bugs.archlinux.org/task/14568
cp -a include/trace "$pkgdir/usr/src/linux-$_kernver/include/"
# add vmlinux
cp vmlinux "$pkgdir/usr/src/linux-$_kernver"
# copy in Kconfig files
for i in `find . -name "Kconfig*"`; do
mkdir -p "$pkgdir"/usr/src/linux-$_kernver/`echo $i | sed 's|/Kconfig.*||'`
cp $i "$pkgdir/usr/src/linux-$_kernver/$i"
done

cd "$pkgdir/usr/src/linux-$_kernver/include" && ln -s asm-$KARCH asm

# add header for aufs2-util
cp -a "$srcdir/linux-$_realkernel/include/asm-generic/bitsperlong.h" "$pkgdir/usr/src/linux-$_kernver/include/asm/"

chown -R root.root "$pkgdir/usr/src/linux-$_kernver"
find "$pkgdir/usr/src/linux-$_kernver" -type d -exec chmod 755 {} \;
cd "$pkgdir/lib/modules/$_kernver" && \
(rm -f source build; ln -sf ../../../usr/src/linux-$_kernver build)
# install fallback mkinitcpio.conf file and preset file for kernel
install -m644 -D "$srcdir/$pkgname.preset" "$pkgdir/etc/mkinitcpio.d/$pkgname.preset" || return 1
# set correct depmod command for install
sed \
-e "s/KERNEL_NAME=.*/KERNEL_NAME=$_kernelname/g" \
-e "s/KERNEL_VERSION=.*/KERNEL_VERSION=$_kernver/g" \
-i "$startdir/$install"
sed \
-e "s|source .*|source /etc/mkinitcpio.d/kernel26$_kernelname.kver|g" \
-e "s|default_image=.*|default_image=\"/boot/$pkgname.img\"|g" \
-e "s|fallback_image=.*|fallback_image=\"/boot/$pkgname-fallback.img\"|g" \
-i "$pkgdir/etc/mkinitcpio.d/$pkgname.preset"

echo -e "# DO NOT EDIT THIS FILE\nALL_kver='$_kernver'" > "$startdir/pkg/etc/mkinitcpio.d/$pkgname.kver"
# remove unneeded architectures
rm -rf "$pkgdir"/usr/src/linux-$_kernver/arch/{alpha,arm,arm26,avr32,blackfin,cris,frv,h8300,ia64,m32r,m68k,m68knommu,mips,mn10300,parisc,powerpc,ppc,s390,sh,sh64,sparc,sparc64,um,v850,xtensa}
# remove the firmware
rm -rf "$pkgdir/lib/firmware"
}
md5sums=('84c077a37684e4cbfa67b18154390d8a'
'ce365b2c72ad0855e1746a80b7abdade'
'f9489cfa299b89f9d74ba0ced1ee803a'
'2a493d1ed820300460abb592b8408ac9'
'18da80ac1d41cba0f74cace471862bba'
'5e777ff68d871106d9bfa203f5e92750'
'a0921a7e563e7ae2d14c3a0603fa16ad'
'6a5a1925501fe20fafd04fdb3cb4f6ed'
'1bc4ac3b07e1aa8ef5ee65156b27aa50'
'79f7c17c3732f4d18a00eafc010396b3')</quote>