You are not logged in.
Pages: 1
I'm trying to compile latest nvidia drivers (169.09) against my custom kernel (no patches added, simply vanilla with customized config) but everytime makepkg exits with
If you are using a Linux 2.4 kernel, please make sure
you either have configured kernel sources matching your
kernel or the correct set of kernel headers installed
on your system.
If you are using a Linux 2.6 kernel, please make sure
you have configured kernel sources matching your kernel
installed on your system. If you specified a separate
output directory using either the "KBUILD_OUTPUT" or
the "O" KBUILD parameter, make sure to specify this
directory with the SYSOUT environment variable or with
the equivalent nvidia-installer command line option.
Depending on where and how the kernel sources (or the
kernel headers) were installed, you may need to specify
their location with the SYSSRC environment variable or
the equivalent nvidia-installer command line option.
*** Unable to determine the target kernel version. ***
make: *** [select_makefile] Error 1
this is the pkgbuild I'm using and that has been working for all the previous drivers' releases (Mandos is the name I use for my custom kernel)
pkgname=nvidia-mandos
pkgver=169.09
_kernver='2.6.24-mandos'
_pkgnum=pkg1
pkgrel=1
pkgdesc="NVIDIA drivers for the Mandos kernel."
arch=(i686 x86_64)
[ "$CARCH" = "i686" ] && ARCH=x86
[ "$CARCH" = "x86_64" ] && ARCH=x86_64
url="http://www.nvidia.com/"
depends=('kernel26mandos' 'nvidia-utils')
install=nvidia.install
source=(http://us.download.nvidia.com/XFree86/Linux-$ARCH/${pkgver}/NVIDIA-Linux-$ARCH-${pkgver}-${_pkgnum}.run )
[ "$CARCH" = "x86_64" ] && md5sums=('f5340e4bbce811add994b1685cdea03b')
md5sums=('26a7f94908bbe07a1110fd78cfa81320')
build()
{
# Extract
cd $startdir/src/
sh NVIDIA-Linux-$ARCH-${pkgver}-${_pkgnum}.run --extract-only \
-k ${_kernvar}
cd NVIDIA-Linux-$ARCH-${pkgver}-${_pkgnum}
# Any extra patches are applied in here...
cd usr/src/nv/
ln -s Makefile.kbuild Makefile
make SYSSRC=/lib/modules/${_kernver}/build module
# install kernel module
mkdir -p $startdir/pkg/lib/modules/${_kernver}/kernel/drivers/video/
install -m644 nvidia.ko $startdir/pkg/lib/modules/${_kernver}/kernel/drivers/video/
sed -i -e "s/KERNEL_VERSION='.*'/KERNEL_VERSION='${_kernver}'/" $startdir/*.install
}
I'm sure it must be something very simple because I know that these drivers work with the 2.6.24 kernel but for the life of me I can't figure what's wrong.
Obviously the same pkgbuild works flawlessly with the 2.6.23 kernel (it's what I'm using right now) and the kernel configuration is pratically the same (I have added a couple of new netfilter options as modules, that's all)
To get something done, a committee should consist of no more than three persons, two of them absent.
--
My Github
Offline
i had this problem and took me long time to find out whats the problem
look
you removed the custom kernel compilation folder
when you do make modules_install the "/lib/modules/*your_kernel_name/build" folder connect to the folder which you compiled from
get ur kernel source code folder and put it in the direction it was before
Offline
See thread. Debug nvidia's conftest.sh
Last edited by brebs (2008-01-28 12:56:58)
Offline
@wavenator: no it wasn't the problem. And, btw, I'm pretty sure of having compiled previous nvidia drivers without having the src directory of the kernel
@brebs: could you please elaborate a bit about the debugging? It's a huge script and I'm not that good at shell scripting. Anyway, running directly nvidia-installer works in the sense that it doesn't give me any errors but I don't see any modules installed anywhere.
To get something done, a committee should consist of no more than three persons, two of them absent.
--
My Github
Offline
I have a feeling that it's do to with the new(ish) and ongoing x86 merges in the kernel source (at least that's what happened to me with the same error given).
Are you using one of the (kernel) PKGBUILDS from the wiki or your own custom one? They (wiki; if custom, have they?) haven't yet been update to reflect the x86 merges in 2.6.24 and therefore are not copying the appropriate files into /usr/src/`uname -r` that the nvidia installer requires.
Easiest fix is to just grab the kernel source for 2.6.24 and direct the installer to that location. A better approach would be to update the kernel PKGBUILD to reflect the new directory changes in 2.6.24.
Though it could be something else entirely...
HTH
cheers,
Last edited by somedrew (2008-01-29 08:53:52)
Offline
Just look in the script for "Unable to determine the target kernel version", and see what could cause that.
Offline
This is the relevant part of conftest.sh (it's part of a case statement):
select_makefile)
#
# Select which Makefile to use based on the version of the
# kernel we are building against: use the kbuild Makefile for
# 2.6 and newer kernels, and the old Makefile for kernels older
# than 2.6.
#
rm -f Makefile
RET=1
VERBOSE=$6
FILE="linux/version.h"
SELECTED_MAKEFILE=
if [ -f $HEADERS/$FILE -o -f $OUTPUT/include/$FILE ]; then
#
# We are either looking at a configured kernel source
# tree or at headers shipped for a specific kernel.
# Determine the kernel version using a compile check.
#
echo "#include <linux/autoconf.h>
#include <linux/version.h>
#include <linux/utsname.h>
int main() {
if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)) {
return 0;
} else {
return 1;
}
}" > conftest$$.c
$HOSTCC $CFLAGS -o conftest$$ conftest$$.c > /dev/null 2>&1
rm -f conftest$$.c
if [ -f conftest$$ ]; then
./conftest$$ > /dev/null 2>&1
if [ $? = "0" ]; then
SELECTED_MFILE=Makefile.kbuild
else
SELECTED_MFILE=Makefile.nvidia
fi
rm -f conftest$$
RET=0
fi
else
MAKEFILE=$HEADERS/../Makefile
CONFIG=$HEADERS/../.config
if [ -f $MAKEFILE -a -f $CONFIG ]; then
#
# This source tree is not configured, but includes
# a Makefile and a .config file. If this is a 2.6
# kernel older than 2.6.6, that's all we require to
# build the module.
#
PATCHLEVEL=$(grep "^PATCHLEVEL =" $MAKEFILE | cut -d " " -f 3)
SUBLEVEL=$(grep "^SUBLEVEL =" $MAKEFILE | cut -d " " -f 3)
if [ -n "$PATCHLEVEL" -a $PATCHLEVEL -ge 6 \
-a -n "$SUBLEVEL" -a $SUBLEVEL -le 5 ]; then
SELECTED_MFILE=Makefile.kbuild
RET=0
fi
fi
fi
if [ "$RET" = "0" ]; then
# Use rmlite Makefile instead of .kbuild if available
if [ "$SELECTED_MFILE" = "Makefile.kbuild" -a -f Makefile.rmlite ]; then
SELECTED_MFILE=Makefile.rmlite
fi
ln -s $SELECTED_MFILE Makefile
else
echo "If you are using a Linux 2.4 kernel, please make sure";
echo "you either have configured kernel sources matching your";
echo "kernel or the correct set of kernel headers installed";
echo "on your system.";
echo "";
echo "If you are using a Linux 2.6 kernel, please make sure";
echo "you have configured kernel sources matching your kernel";
echo "installed on your system. If you specified a separate";
echo "output directory using either the \"KBUILD_OUTPUT\" or";
echo "the \"O\" KBUILD parameter, make sure to specify this";
echo "directory with the SYSOUT environment variable or with";
echo "the equivalent nvidia-installer command line option.";
echo "";
echo "Depending on where and how the kernel sources (or the";
echo "kernel headers) were installed, you may need to specify";
echo "their location with the SYSSRC environment variable or";
echo "the equivalent nvidia-installer command line option.";
echo "";
if [ "$VERBOSE" = "full_output" ]; then
echo "*** Unable to determine the target kernel version. ***";
echo "";
fi
fi
exit $RET
;;
The references to Makefile and kbuild has made me think that it has something to do with, has somedrew said, the changes in the directory tree of the 2.6.24 kernel. For example, comparing the kernel sources, the Kconfig and Makefile files under arch/i386/ in the 2.6.23 are different from the same files under arch/x86/ in the newer 2.6.24 because the latters are meant to serve both x86 and x86_64 archs.
Indeed, as somedrew suggested, building the nvidia module using the kernel 2.6.24 source directory directly, without using a pkgbuild, works.
I'm going to recompile the kernel after trying to modify the pkgbuild (I'm not a pkgbuild guru so it'd hardly work).
To get something done, a committee should consist of no more than three persons, two of them absent.
--
My Github
Offline
Ok, I've made some changes to the 2.6.24 but as I feared they weren't enough to compile correctly the nvidia drivers. Kernel works fine, but now when trying to compile the nvidia module against it, it exits with:
NVIDIA: calling KBUILD...
make CC=cc KBUILD_VERBOSE=1 -C /lib/modules/2.6.24-mandos/build SUBDIRS=/var/abs/local/nvidia-mandos/src/NVIDIA-Linux-x86-169.09-pkg1/usr/src/nv modules
/usr/src/linux-2.6.24-mandos/arch/x86/Makefile:15: /usr/src/linux-2.6.24-mandos/arch/x86/Makefile_32: No such file or directory
test -e include/linux/autoconf.h -a -e include/config/auto.conf || ( \
echo; \
echo " ERROR: Kernel configuration is invalid."; \
echo " include/linux/autoconf.h or include/config/auto.conf are missing."; \
echo " Run 'make oldconfig && make prepare' on kernel src to fix it."; \
echo; \
/bin/false)
mkdir -p /var/abs/local/nvidia-mandos/src/NVIDIA-Linux-x86-169.09-pkg1/usr/src/nv/.tmp_versions ; rm -f /var/abs/local/nvidia-mandos/src/NVIDIA-Linux-x86-169.09-pkg1/usr/src/nv/.tmp_versions/*
make -f scripts/Makefile.build obj=/var/abs/local/nvidia-mandos/src/NVIDIA-Linux-x86-169.09-pkg1/usr/src/nv
cc -Wp,-MD,/var/abs/local/nvidia-mandos/src/NVIDIA-Linux-x86-169.09-pkg1/usr/src/nv/.nv.o.d -nostdinc -isystem /usr/lib/gcc/i686-pc-linux-gnu/4.2.2/include -D__KERNEL__ -Iinclude -include include/linux/autoconf.h -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -O2 -fomit-frame-pointer -fno-stack-protector -Wdeclaration-after-statement -Wno-pointer-sign -I/var/abs/local/nvidia-mandos/src/NVIDIA-Linux-x86-169.09-pkg1/usr/src/nv -Wall -Wimplicit -Wreturn-type -Wswitch -Wformat -Wchar-subscripts -Wparentheses -Wpointer-arith -Wno-multichar -Werror -MD -Wsign-compare -Wno-cast-qual -Wno-error -D__KERNEL__ -DMODULE -DNVRM -DNV_VERSION_STRING=\"169.09\" -UDEBUG -U_DEBUG -DNDEBUG -DMODULE -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(nv)" -D"KBUILD_MODNAME=KBUILD_STR(nvidia)" -c -o /var/abs/local/nvidia-mandos/src/NVIDIA-Linux-x86-169.09-pkg1/usr/src/nv/.tmp_nv.o /var/abs/local/nvidia-mandos/src/NVIDIA-Linux-x86-169.09-pkg1/usr/src/nv/nv.c
In file included from include/linux/list.h:8,
from include/linux/preempt.h:11,
from include/linux/spinlock.h:49,
from include/linux/seqlock.h:29,
from include/linux/time.h:8,
from include/linux/timex.h:57,
from include/linux/sched.h:53,
from include/linux/utsname.h:35,
from /var/abs/local/nvidia-mandos/src/NVIDIA-Linux-x86-169.09-pkg1/usr/src/nv/nv-linux.h:19,
from /var/abs/local/nvidia-mandos/src/NVIDIA-Linux-x86-169.09-pkg1/usr/src/nv/nv.c:14:
include/linux/prefetch.h: In function 'prefetch_range':
include/linux/prefetch.h:57: warning: pointer of type 'void *' used in arithmetic
In file included from include/asm/mpspec.h:2,
from include/asm/smp_32.h:15,
from include/asm/smp.h:2,
from include/linux/smp.h:19,
from include/linux/sched.h:68,
from include/linux/utsname.h:35,
from /var/abs/local/nvidia-mandos/src/NVIDIA-Linux-x86-169.09-pkg1/usr/src/nv/nv-linux.h:19,
from /var/abs/local/nvidia-mandos/src/NVIDIA-Linux-x86-169.09-pkg1/usr/src/nv/nv.c:14:
include/asm/mpspec_32.h:6:25: error: mach_mpspec.h: No such file or directory
In file included from include/asm/mpspec.h:2,
from include/asm/smp_32.h:15,
from include/asm/smp.h:2,
from include/linux/smp.h:19,
from include/linux/sched.h:68,
from include/linux/utsname.h:35,
from /var/abs/local/nvidia-mandos/src/NVIDIA-Linux-x86-169.09-pkg1/usr/src/nv/nv-linux.h:19,
from /var/abs/local/nvidia-mandos/src/NVIDIA-Linux-x86-169.09-pkg1/usr/src/nv/nv.c:14:
include/asm/mpspec_32.h: At top level:
include/asm/mpspec_32.h:8: error: 'MAX_MP_BUSSES' undeclared here (not in a function)
include/asm/mpspec_32.h:22: error: 'MAX_IRQ_SOURCES' undeclared here (not in a function)
In file included from include/asm/smp.h:2,
from include/linux/smp.h:19,
from include/linux/sched.h:68,
from include/linux/utsname.h:35,
from /var/abs/local/nvidia-mandos/src/NVIDIA-Linux-x86-169.09-pkg1/usr/src/nv/nv-linux.h:19,
from /var/abs/local/nvidia-mandos/src/NVIDIA-Linux-x86-169.09-pkg1/usr/src/nv/nv.c:14:
include/asm/smp_32.h:157:26: error: mach_apicdef.h: No such file or directory
In file included from include/asm/smp.h:2,
from include/linux/smp.h:19,
from include/linux/sched.h:68,
from include/linux/utsname.h:35,
from /var/abs/local/nvidia-mandos/src/NVIDIA-Linux-x86-169.09-pkg1/usr/src/nv/nv-linux.h:19,
from /var/abs/local/nvidia-mandos/src/NVIDIA-Linux-x86-169.09-pkg1/usr/src/nv/nv.c:14:
include/asm/smp_32.h: In function 'hard_smp_processor_id':
include/asm/smp_32.h:161: error: implicit declaration of function 'GET_APIC_ID'
In file included from include/asm/dma-mapping_32.h:5,
from include/asm/dma-mapping.h:2,
from include/linux/dma-mapping.h:52,
from include/asm-generic/pci-dma-compat.h:7,
from include/asm/pci.h:88,
from include/linux/pci.h:796,
from /var/abs/local/nvidia-mandos/src/NVIDIA-Linux-x86-169.09-pkg1/usr/src/nv/nv-linux.h:86,
from /var/abs/local/nvidia-mandos/src/NVIDIA-Linux-x86-169.09-pkg1/usr/src/nv/nv.c:14:
include/linux/scatterlist.h: In function 'sg_virt':
include/linux/scatterlist.h:293: warning: pointer of type 'void *' used in arithmetic
In file included from include/asm/irq.h:2,
from include/linux/irq.h:23,
from include/asm/hardirq_32.h:5,
from include/asm/hardirq.h:2,
from include/linux/hardirq.h:7,
from include/linux/interrupt.h:11,
from /var/abs/local/nvidia-mandos/src/NVIDIA-Linux-x86-169.09-pkg1/usr/src/nv/nv-linux.h:87,
from /var/abs/local/nvidia-mandos/src/NVIDIA-Linux-x86-169.09-pkg1/usr/src/nv/nv.c:14:
include/asm/irq_32.h:15:25: error: irq_vectors.h: No such file or directory
In file included from include/asm/irq.h:2,
from include/linux/irq.h:23,
from include/asm/hardirq_32.h:5,
from include/asm/hardirq.h:2,
from include/linux/hardirq.h:7,
from include/linux/interrupt.h:11,
from /var/abs/local/nvidia-mandos/src/NVIDIA-Linux-x86-169.09-pkg1/usr/src/nv/nv-linux.h:87,
from /var/abs/local/nvidia-mandos/src/NVIDIA-Linux-x86-169.09-pkg1/usr/src/nv/nv.c:14:
include/asm/irq_32.h: At top level:
include/asm/irq_32.h:49: error: 'NR_VECTORS' undeclared here (not in a function)
In file included from include/asm/hardirq_32.h:5,
from include/asm/hardirq.h:2,
from include/linux/hardirq.h:7,
from include/linux/interrupt.h:11,
from /var/abs/local/nvidia-mandos/src/NVIDIA-Linux-x86-169.09-pkg1/usr/src/nv/nv-linux.h:87,
from /var/abs/local/nvidia-mandos/src/NVIDIA-Linux-x86-169.09-pkg1/usr/src/nv/nv.c:14:
include/linux/irq.h:180: error: 'NR_IRQS' undeclared here (not in a function)
In file included from include/linux/interrupt.h:11,
from /var/abs/local/nvidia-mandos/src/NVIDIA-Linux-x86-169.09-pkg1/usr/src/nv/nv-linux.h:87,
from /var/abs/local/nvidia-mandos/src/NVIDIA-Linux-x86-169.09-pkg1/usr/src/nv/nv.c:14:
include/linux/hardirq.h:40:27: warning: "NR_IRQS" is not defined
make[3]: *** [/var/abs/local/nvidia-mandos/src/NVIDIA-Linux-x86-169.09-pkg1/usr/src/nv/nv.o] Error 1
make[2]: *** [_module_/var/abs/local/nvidia-mandos/src/NVIDIA-Linux-x86-169.09-pkg1/usr/src/nv] Error 2
NVIDIA: left KBUILD.
nvidia.ko failed to build!
make[1]: *** [module] Error 1
make: *** [module] Error 2
which is the same error as here but both solutions, the patch and the symlink+sysrc change in the pkgbuild, don't work (same message as above).
To get something done, a committee should consist of no more than three persons, two of them absent.
--
My Github
Offline
Guess what? nVidia released at January 29 a new driver:
http://us.download.nvidia.com/XFree86/L … 5-pkg1.run
The PKGBUILD failed somehow (No devices were created), but manually installing has worked. FINALLY TRANSPARENT URXVTS AGAIN!
I have no idea what was fixed, but it's working. Eventually you may know this already, but i just had to post this.
(AFAIK there's for the 100-series a new one out, too)
Last edited by CuleX (2008-02-01 17:58:23)
Offline
Download the vanilla kernel 2.6.24 from kernel.org and use the pkgbuild from /var/abs/extra/x11/nvidia/ - works fine for me, never seen the error mentioned in this thread. With nvidia 169.09 and (today) 171.05
Offline
Yes, manually installing the drivers works but I hate to leave files not managed by pacman in /
Any pkgbuilds combinations (standard nvidia one, my custom nvidia pkgbuild etc) don't work so I'd say that is somewhat solved.
To get something done, a committee should consist of no more than three persons, two of them absent.
--
My Github
Offline
Download the vanilla kernel 2.6.24 from kernel.org and use the pkgbuild from /var/abs/extra/x11/nvidia/ - works fine for me, never seen the error mentioned in this thread. With nvidia 169.09 and (today) 171.05
The 171.05 driver release is intended for use with Tesla S870 GPU Computing Systems, only.
Offline
i did not have any issues with nvidia and vanilla 2.6.24
created symlink and nvidia installed without any more problems.
Offline
maybe I should explain this
error:
If you are using a Linux 2.4 kernel, please make sure
you either have configured kernel sources matching your
kernel or the correct set of kernel headers installed
on your system.
means missing asm-i386
create symlink in
/usr/src/linux-2.6.24/include
ln -s asm-x86 asm-i386
next install nvidia driver
however nvidia will not install on the latest git (2.6.24.-git13). This is know issue and confirmed by nVidia:
http://www.nvnews.net/vbulletin/showthr … 7&t=107144
read post #5
this is not related to your error though
Last edited by broch (2008-02-06 20:11:06)
Offline
Nope, it doesn't make any difference. I'm still stuck at the "NVIDIA: left KBUILD" phase. As I said, installing the drivers manually works and this makes me think that it's a pkgbuild-related problem after the 2.6.24 merging of x86 with x86_64 in the source.
I'm modifying the kernel pkgbuild to death without getting anywhere; what is weird is that even with an unmodified vanilla kernel pkgbuild the nvidia drivers fail to build. But I'm not savy enough to find the culprit.
To get something done, a committee should consist of no more than three persons, two of them absent.
--
My Github
Offline
well, hmm..
I don't use pkgbuild neither for nvidia nor for kernels
Mainly because I want to have all my kernels to have at the same time nvidia module installed so when i switch from one kernel to another I always have nvidia running without further deinstallation from one and installation to another.
Offline
That's why you haven't had any problems
Anyway, I'm not too fond of installing things manually outside the package manager's reach so I'm sticking with the pkgbuild "method". Given that I'm out of further ideas at the moment, does anyone have a working 2.6.24 pkgbuild with a working as well nvidia drivers one (169.* series) so I can test what's actually wrong with my system? Thanks in advance
To get something done, a committee should consist of no more than three persons, two of them absent.
--
My Github
Offline
I also still get that error mentioned in the first post
Last edited by Eradest (2008-02-09 14:13:12)
Offline
The default package build copies files from arch/i386, that needs to be changed to arch/x86. It also only tries to copy Makefile and Makefile.cpu, it needs to copy Makefile, Makefile_32 and Makefile_32.cpu (all assuming your on 32 bit build of course). And of course the KARCH variable needs to be x86 not i386.
I made those changes to my package build and it all just works using the default nvidia PKGBUILD.
Heres some snippets of my package build.
[ "${CARCH}" = "i686" ] && KARCH=x86
for i in acpi asm-{generic,x86} config linux math-emu media net pcmcia scsi s$
cp -a include/$i $startdir/pkg/usr/src/linux-${_kernver}/include/
done
# 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}/.tmp_versions
mkdir -p $startdir/pkg/usr/src/linux-${_kernver}/arch/$KARCH/kernel
cp arch/$KARCH/Makefile $startdir/pkg/usr/src/linux-${_kernver}/arch/$KARCH/
cp arch/$KARCH/Makefile_32 $startdir/pkg/usr/src/linux-${_kernver}/arch/$KARC$
cp arch/$KARCH/Makefile_32.cpu $startdir/pkg/usr/src/linux-${_kernver}/arch/$$
cp arch/$KARCH/kernel/asm-offsets.s $startdir/pkg/usr/src/linux-${_kernver}/a$
Offline
has this already been included in the official kernel26 2.6.24 PKGBUILD in testing?
Offline
Thank you shazeal for your input, I had made those changes myself but I didn't have this line in my pkgbuild:
cp arch/$KARCH/Makefile_32 $startdir/pkg/usr/src/linux-${_kernver}/arch/$KARCH
and now nvidia drivers 169.09 compile perfectly with any kernel
@eradest: looking briefly at the kernel26 pkgbuild it seems yes.
To get something done, a committee should consist of no more than three persons, two of them absent.
--
My Github
Offline
Hi,
sorry for digging out this older thread.
I have the same problem.
Could you repost your full PKGBUILD, please?
The lines you posted had been cut off after the 78th character.
regards
Offline
Sure, that's my current pkgbuild:
# Maintainer: onearm <forod.g@gmail.com>
#
pkgname=kernel26mandos
basekernel=2.6.25
basemandos=mandos
pkgver=${basekernel}
_menu_method='menuconfig'
pkgrel=1
pkgdesc="The Linux Kernel and modules, with the Mandos patchset."
arch=(i686)
license=('GPL')
backup=('boot/kconfig26mandos' 'etc/mkinitcpio.d/kernel26mandos.preset')
depends=('module-init-tools' 'mkinitcpio>=0.5.9')
provides=('kernel26')
install=kernel26mandos.install
source=(ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-$basekernel.tar.bz2 \
#http://www.tuxonice.net/downloads/all/tuxonice-3.0-rc5-for-$basekernel.patch.bz2 \
#http://www.tuxonice.net/downloads/all/tuxonice-3.0-rc5-for-$basekernel-rc8-git4.patch.bz2 \
#http://dev.gentoo.org/~spock/projects/uvesafb/archive/uvesafb-0.1-rc3-2.6.23-rc3.patch \
#http://gaugusch.at/acpi-dsdt-initrd-patches/acpi-dsdt-initrd-v0.8.4-$basekernel.patch \
#http://dev.gentoo.org/~dsd/genpatches/trunk/$basekernel/4300_squashfs-3.3.patch \
mandos-version.patch \
config config.x86_64 mkinitcpio-kernel26mandos.conf kernel26mandos.preset )
md5sums=('db95a49a656a3247d4995a797d333153'
'034e56f1a71a70b9a9409ef943845253'
'62a4a19a867efb4fd1b7bca286157111'
'58d6e6977ad5dc3d6ae3738641861c82'
'44c5e1c6ad916224e136c268893f2fac'
'ef97361e79eecd21e35ccf926249c040')
# Function to grab var from src
getvar() {
old=$(cat Makefile | grep "^$1")
echo $(echo ${old/"$1 ="/} | sed -e "s/[ ]*\(.*\)[ ]*/\1/g")
return 0
}
build() {
[ "${CARCH}" == "i686" ] && KARCH=x86
[ "${CARCH}" == "x86_64" ] && KARCH=x86
cd $startdir/src/linux-$basekernel
# Patches galore!
#patch -Np1 -i ../mandos-version.patch || return 1
#patch -Np1 -i ../uvesafb-0.1-rc3-2.6.23-rc3.patch || return 1
#patch -Np1 -i ../tuxonice-3.0-rc5-for-$basekernel-rc8-git4.patch || return 1
# Remove the extraversion from Makefile
sed -i 's|^EXTRAVERSION =.*$|EXTRAVERSION = -mandos|g' Makefile
if [ "${CARCH}" = "x86_64" ]; then
mv ../config.x86_64 ./.config
else
mv ../config ./.config
fi
# save the current pkgname
old_pkgname=$pkgname
# set pkgname for build purposes - DO NOT alter!
pkgname=kernel26
# save the updated config to build with today's date
#cp ./.config $startdir/config-$(date +%b%d\-%Hh)
# get EXTRAVERSION from Makefile to create a unique pkgname and /usr/src directory
_kernextra=$(getvar "EXTRAVERSION")
# grab the 2.6.x.y version suffix from pkgver
_y="`echo $pkgver | cut --delim "." --fields 4`"
# remove .y version suffix from _kernextra
_kernextra="`echo $_kernextra | sed "s|\.$_y||g"`"
# Read the full kernel version info from new config to use in pathnames and pkgname
. ./.config
# Kernel custom - to create a unique pkgname (see below)
_kerncust="${_kernextra}${CONFIG_LOCALVERSION}"
# Kernel release - will be the same as Makefile
_kernrel="${pkgver}${_kerncust}"
#_kernrel="${pkgver}"
# Get the pkgver suffix for unique pkgname and /boot file suffices
_pkgversuf="`echo $pkgver | sed "s|2.6.||g" | sed "s|\.||g"`"
# Set /boot file suffices from kernel release and pkgver suffix
#_kernboot="${_pkgversuf}${_kerncust}"
_kernboot="${basemandos}"
# Set a new pkgname from kernel release and pkgver suffix
#pkgname="${pkgname}${_pkgversuf}${_kerncust}"
#pkgname="${pkgname}${_kerncust}"
pkgname="${pkgname}${basemandos}"
# build the full kernel version to use in pathnames
. ./.config
_kernver="${basekernel}-${basemandos}${CONFIG_LOCALVERSION}"
echo
echo "Package Info"
echo " Package name: $pkgname"
echo " Package ver: $pkgver"
echo " Package desc: $pkgdesc"
echo
echo " Kernel EXTRAVERSION: $_kernextra"
echo " Kernel LOCALVERSION: ${CONFIG_LOCALVERSION}"
echo " Kernel RELEASE: $_kernrel"
echo
echo "Outputs"
echo " /boot/vmlinuz26${_kernboot}"
echo " /usr/src/linux-${_kernrel}"
echo " /lib/modules/${pkgver}${_kernextra}${CONFIG_LOCALVERSION}"
echo " _kernver is: ${_kernver}"
echo
echo -n "Press any key to start make or CTRL+C to quit"
read anykey
# Configuration
#yes "" | make config
case "$_menu_method" in
menuconfig|xconfig|gconfig|oldconfig)
make $_menu_method
;;
esac
# Build
make bzImage modules || return 1
# Install
mkdir -p $startdir/pkg/{lib/modules,boot}
make INSTALL_MOD_PATH=$startdir/pkg modules_install || return 1
cp System.map $startdir/pkg/boot/System.map26mandos
cp arch/$KARCH/boot/bzImage $startdir/pkg/boot/vmlinuz26mandos
install -D -m644 Makefile \
$startdir/pkg/usr/src/linux-${_kernver}/Makefile
#install -D m644 Kbuild \
# $startdir/pkg/usr/src/linux-${_kernver}/Kbuild
cp Kbuild $startdir/pkg/usr/src/linux-${_kernver}/
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/kconfig26mandos
mkdir -p $startdir/pkg/usr/src/linux-${_kernver}/include
mkdir -p $startdir/pkg/usr/src/linux-${_kernver}/arch/$KARCH/kernel
for i in acpi asm-{generic,x86} asm-$KARCH config linux math-emu media net pcmcia scsi sound video xen; do cp -a include/$i $startdir/pkg/usr/src/linux-${_kernver}/include/
done
# 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}/.tmp_versions
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
cp arch/$KARCH/Makefile_32 $startdir/pkg/usr/src/linux-${_kernver}/arch/$KARCH
fi
if [ "$CARCH" = "x86_64" ]; then
cp arch/$KARCH/Makefile_64 $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/
cp arch/$KARCH/kernel/asm-offsets.c $startdir/pkg/usr/src/linux-${_kernver}/arch/$KARCH/kernel/
#cp arch/$KARCH/kernel/sigframe.h $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 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}
cd $startdir/pkg/lib/modules/${_kernver} && \
(rm -f source build; ln -sf ../../../usr/src/linux-${_kernver} build)
# prepare source for binary modules
#cd $startdir/pkg/lib/modules/${_kernver}/build
#make prepare
# 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
echo -e "# DO NEVER 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,mn10300,parisc,powerpc,ppc,s390,sh,sh64,sparc,sparc64,um,v850,xtensa}
}
obviously I have called it mandos when it was a collection of patches but now is more like a vanilla one, just customized.
To get something done, a committee should consist of no more than three persons, two of them absent.
--
My Github
Offline
Thanks.
Well, it did not work, your file seems to be extremely customized.
No problem, I am just experimentalising on beginners grade
regards
Offline
Pages: 1