roboforum.ruТехнический форум по робототехнике. |
|
|
_kernver=2.6.28-ARCH
pkgname=microdia-git
pkgver=20090131
pkgrel=1
pkgdesc="Microdia kernel driver for USB webcams with vendor id 0c45"
arch=('i686' 'x86_64')
url="http://groups.google.com/group/microdia"
license=('GPL2')
depends=('kernel26>=2.6.28' 'kernel26<2.6.29')
makedepends=('git' 'ctags')
install=microdia-git.install
source=()
md5sums=()
_gitroot="git://repo.or.cz/microdia.git"
_gitname="microdia"
vovan@vovan-laptop:~$ cat build/altlinux-kernel/PKGBUILD
# Contributor: Giuseppe Calderaro <giuseppecalderaro@gmail.com>
pkgname=kernel26-alt
pkgver=2.6.25
_pkgver=2.6.25-alt8.M41.4
pkgrel=1
pkgdesc="The Linux Kernel and modules with gentoo-sources patchset and tuxonice support"
arch=('i686' 'x86_64')
license=('GPL2')
url="http://www.kernel.org"
backup=('boot/kconfig26-alt' etc/mkinitcpio.d/${pkgname}.preset etc/mkinitcpio.d/${pkgname}-fallback.conf)
depends=('coreutils' 'module-init-tools' 'mkinitcpio>=0.5.15')
install=kernel26-alt.install
source=(ftp://ftp.altlinux.org/pub/distributions/ALTLinux/4.1/Desktop/current/i586/SRPMS.main/kernel-image-std-def-2.6.25-alt8.M41.4.src.rpm
ftp://ftp.altlinux.org/pub/distributions/ALTLinux/4.1/Desktop/current/i586/SRPMS.main/kernel-source-2.6.25-1.0.0-alt1.src.rpm
$pkgname.preset
mkinitcpio-$pkgname.conf)
build() {
[ "${CARCH}" = "i686" ] && KARCH=x86
[ "${CARCH}" = "x86_64" ] && KARCH=x86
cd $startdir/src/
for f in *.rpm
do
rpmextract.sh $f
done
for f in *.bz2
do
bsdtar -xf $f
done
cd $startdir/src/linux-$pkgver || return 1
patch -Np1 < ../kernel-image-std-def-2.6.25-alt8.M41.4.patch
# remove extraversion
sed -i 's|^EXTRAVERSION = .*$|EXTRAVERSION =|g' Makefile
# load configuration for i686 or x86_64
if [ "$CARCH" = "x86_64" ]; then
cat ./config-x86_64 >./.config
else
cat ./config-i586 >./.config
fi
sed -i -e "s/\(CONFIG_LOCALVERSION\)=.*/\1='-alt'" ./.config
source ./.config
_kernver="$pkgver${CONFIG_LOCALVERSION}"
# configure kernel
# use menuconfig, if you want to change the configuration
# make menuconfig
yes "" | make config
# build kernel
make bzImage modules || return 1
mkdir -p $startdir/pkg/{lib/modules,boot}
make INSTALL_MOD_PATH=$startdir/pkg modules_install || return 1
install -D -m644 System.map $startdir/pkg/boot/System.map26-alt
install -D -m644 arch/$KARCH/boot/bzImage $startdir/pkg/boot/vmlinuz26-alt
install -D -m644 Makefile $startdir/pkg/usr/src/linux-$_kernver/Makefile
install -D -m644 kernel/Makefile $startdir/pkg/usr/src/linux-$_kernver/kernel/Makefile
install -D -m644 .config $startdir/pkg/usr/src/linux-$_kernver/.config
install -D -m644 .config $startdir/pkg/boot/kconfig26-alt
mkdir -p $startdir/pkg/usr/src/linux-$_kernver/include
for i in acpi asm-{generic,$KARCH} config linux math-emu media net pcmcia scsi sound video; do
cp -a include/$i $startdir/pkg/usr/src/linux-$_kernver/include/
done
# copy arch includes for external modules
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH
cp -a arch/$KARCH/include ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/
# copy files necessary for later builds, like nvidia and vmware
cp Module.symvers $startdir/pkg/usr/src/linux-$_kernver
cp -a scripts $startdir/pkg/usr/src/linux-$_kernver
# fix permissions on scripts dir
chmod og-w -R $startdir/pkg/usr/src/linux-$_kernver/scripts
mkdir -p $startdir/pkg/usr/src/linux-$_kernver/arch/$KARCH/kernel
cp arch/$KARCH/Makefile $startdir/pkg/usr/src/linux-$_kernver/arch/$KARCH/
if [ "${CARCH}" = "i686" ]; then
cp arch/$KARCH/Makefile_32.cpu $startdir/pkg/usr/src/linux-$_kernver/arch/$KARCH/
fi
cp arch/$KARCH/kernel/asm-offsets.s $startdir/pkg/usr/src/linux-$_kernver/arch/$KARCH/kernel/
# add headers for lirc package
mkdir -p $startdir/pkg/usr/src/linux-$_kernver/drivers/media/video
cp drivers/media/video/*.h $startdir/pkg/usr/src/linux-$_kernver/drivers/media/video/
for i in bt8xx cpia2 cx25840 cx88 em28xx et61x251 pwc saa7134 sn9c102 usbvideo zc0301
do
mkdir -p $startdir/pkg/usr/src/linux-$_kernver/drivers/media/video/$i
cp -a drivers/media/video/$i/*.h $startdir/pkg/usr/src/linux-$_kernver/drivers/media/video/$i
done
# add dm headers
mkdir -p $startdir/pkg/usr/src/linux-$_kernver/drivers/md
cp drivers/md/*.h $startdir/pkg/usr/src/linux-$_kernver/drivers/md
# add inotify.h
mkdir -p $startdir/pkg/usr/src/linux-$_kernver/include/linux
cp include/linux/inotify.h $startdir/pkg/usr/src/linux-$_kernver/include/linux/
# add CLUSTERIP file for iptables
mkdir -p $startdir/pkg/usr/src/linux-$_kernver/net/ipv4/netfilter/
cp net/ipv4/netfilter/ipt_CLUSTERIP.c $startdir/pkg/usr/src/linux-$_kernver/net/ipv4/netfilter/
# add wireless headers
mkdir -p $startdir/pkg/usr/src/linux-$_kernver/net/mac80211/
cp net/mac80211/*.h $startdir/pkg/usr/src/linux-$_kernver/net/mac80211/
# add xfs and shmem for aufs building
mkdir -p $startdir/pkg/usr/src/linux-$_kernver/fs/xfs
mkdir -p $startdir/pkg/usr/src/linux-$_kernver/mm
cp fs/xfs/xfs_sb.h $startdir/pkg/usr/src/linux-$_kernver/fs/xfs/xfs_sb.h
cp mm/shmem.c $startdir/pkg/usr/src/linux-$_kernver/mm/shmem.c
# add vmlinux
cp vmlinux $startdir/pkg/usr/src/linux-$_kernver
# copy in Kconfig files
for i in $(find . -name "Kconfig*")
do
mkdir -p $startdir/pkg/usr/src/linux-$_kernver/$(echo $i | sed 's|/Kconfig.*||')
cp $i $startdir/pkg/usr/src/linux-$_kernver/$i
done
cd $startdir/pkg/usr/src/linux-$_kernver/include && ln -s asm-$KARCH asm
chown -R root.root $startdir/pkg/usr/src/linux-$_kernver
find $startdir/pkg/usr/src/linux-$_kernver -type d -exec chmod 755 {} \;
cd $startdir/pkg/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 $startdir/src/$pkgname.preset $startdir/pkg/etc/mkinitcpio.d/$pkgname.preset || return 1
install -m644 -D $startdir/src/mkinitcpio-$pkgname.conf $startdir/pkg/etc/mkinitcpio.d/$pkgname-fallback.conf || return 1
# set correct depmod command for install
sed -i -e "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/g" $startdir/$pkgname.install
echo -e "# DO NOT EDIT THIS FILE\nALL_kver='${_kernver}'" > $startdir/pkg/etc/mkinitcpio.d/$pkgname.kver
# remove unneeded architectures
rm -rf $startdir/pkg/usr/src/linux-$_kernver/arch/{alpha,arm,arm26,avr32,blackfin,cris,frv,h8300,ia64,m32r,m68k,m68knommu,mips,parisc,powerpc,ppc,s390,sh,sh64,sparc,sparc64,um,v850,xtensa}
}
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 8