Welcome to Linux Forums! With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.
Write an article for LinuxForums Today! Win Great Prizes!
I'm trying to compile my own debian kernel package.
I was doing this originally out of boredom, and now out of necessity .
Thing is, I'm using linux-source-2.6.15 (or 2.6.16, I've been experimenting with both). I untar the source, then I do the highly recommended copy of the /boot/config-<kernel version> to /usr/src/<source>/.config since I'm compiling a variation of the exact same version I have installed. I then changed the one thing I wanted, and the on thing I needed: Compiled it optimised for K6/k6II/k6III and added off-board IDE first=y.
make-kpkg kernel_image
invariably a NIC driver of some sort, lately the realtek?8139?cp drivers, kill the compile with error 2. The odd thing is that I have a computer running this exact version of the kernel supplied by debian using a NIC that needs that driver. So if it compiled for the debian maintainers... why won't it compile for me?
It's a debian etch system I'm compiling from. I've successfully compiled 2.6.8 kernels, but nothing beyond that point has ever worked. I'd just have it not compile the rt driver, but 1) I do have a card with that chipset 2) all that does is cause a different NIC (sometimes one that didn't error with the rt being allowed) to error.
I'm confused. Could someone please explain this? Could someone please tell me WTF I can do to fix it?
Oh, and yeah, I tried to start with the default .config. Turns out that 2.6.15+ uses /boot/config-<kernel> as the default .config so that didn't work.
Log out and log in so the "group" change takes effect, and then:
Code:
cd
wget ftp://kernel.org/pub/linux/kernel/v2.6/linux-2.6.16.19.tar.bz2
cd /usr/src
tar jxf ~/linux-2.6.16.19.tar.bz2
cd linux-2.6.16.19/
make mrproper
cp /boot/config-$(uname -r) .config
make menuconfig
fakeroot make-kpkg clean
fakeroot make-kpkg --append-to-version "-my-kernel" --revision "01062006" --us --uc --initrd kernel_image
cd ..
su
dpkg -i linux-image-2.6.16.19-my-kernel_01062006_i386.deb
Something like that usualy works. Plus make sure your /etc/modules file is OK and the modules are in the right order before doing the compilation.
__________________
"To express yourself in freedom, you must die to everything of yesterday. From the 'old', you derive security; from the 'new', you gain the flow."
I'm lazy, I just do the whole compilation as root.
I should like to think so, I had aptitude install everything require and suggested by both the source and make-kpkg.
I didn't grab the source code from kernel.org. Don't know why. I think because... well.. again I'm lazy. simpler to type apt-get install linux-source-2.6.<whichever I want>.
I'm lazy, I just do the whole compilation as root.
To compile as root is pure evil, try not too
Quote:
Originally Posted by dravenloft
I didn't grab the source code from kernel.org. Don't know why. I think because... well.. again I'm lazy. simpler to type apt-get install linux-source-2.6.<whichever I want>.
I just like better the vanilla sources, as the Debian ones are simply being cleaned up of too many drivers (because of licencing issues): http://wiki.debian.org/KernelFirmwareLicensing
__________________
"To express yourself in freedom, you must die to everything of yesterday. From the 'old', you derive security; from the 'new', you gain the flow."
Ok, not doing some things as root I understand. I mean, it's easy for attacks, etc. But why not compile a kernel? And other forms of compiling?
Quote:
I just like better the vanilla sources, as the Debian ones are simply being cleaned up of too many drivers (because of licencing issues): http://wiki.debian.org/KernelFirmwareLicensing
Ah. Well... still might give it a try. Maybe cleaning out the drivers that have licencing issues destabilised something.
Ok, not doing some things as root I understand. I mean, it's easy for attacks, etc. But why not compile a kernel? And other forms of compiling?
I just like to make an habit of not doing things as root whenever possible. A mistake happens so fast, you never know.
__________________
"To express yourself in freedom, you must die to everything of yesterday. From the 'old', you derive security; from the 'new', you gain the flow."
Good point. I guess I never think of it that way because I only use root to compile kernels, edit txt configs and to run those lovely GUI configs that require Admin access. Basically I just su, do what I need exit instead of fakeroot or sudo the same things.
CC [M] drivers/net/3c515.o
CC [M] drivers/net/eexpress.o
In file included from drivers/net/eexpress.c:116:
include/linux/mca-legacy.h:12:2: warning: #warning "MCA legacy - please move your driver to the new sysfs api"
CC [M] drivers/net/eepro.o
CC [M] drivers/net/8139cp.o
drivers/net/8139cp.c: In function 'read_eeprom':
drivers/net/8139cp.c:1659: error: unable to find a register to spill in class 'CREG'
drivers/net/8139cp.c:1659: error: this is the insn:
(insn:HI 15 14 16 0 (parallel [
(set (reg:SI 1 dx [97])
(ashift:SI (reg:SI 1 dx [97])
(subreg:QI (reg/v:SI 3 bx [orig:95 addr_len ] [95]) 0)))
(clobber (reg:CC 17 flags))
]) 398 {*ashlsi3_1} (insn_list:REG_DEP_TRUE 6 (insn_list:REG_DEP_TRUE 14 (nil)))
(expr_list:REG_UNUSED (reg:CC 17 flags)
(expr_list:REG_UNUSED (reg:CC 17 flags)
(expr_list:REG_EQUAL (ashift:SI (const_int 6 [0x6])
(subreg:QI (reg/v:SI 3 bx [orig:95 addr_len ] [95]) 0))
(nil)))))
drivers/net/8139cp.c:1659: confused by earlier errors, bailing out
make[3]: *** [drivers/net/8139cp.o] Error 1
make[2]: *** [drivers/net] Error 2
make[1]: *** [drivers] Error 2
make[1]: Leaving directory `/usr/src/linux-2.6.16'
make: *** [debian/stamp-build-kernel] Error 2
Ok... I've tried the source from apt, this one I just downloaded yesterday from kernel.org. Why do they all do that? Every version from 2.6.11 to present that I've tried to compile do this. I think this is the majority point of failure, although I do know that I've failed before and after it at various points (no particular version just sometimes happens)... thing is ... well... there're kernels compiled with this driver as either =y or =m I'm running one from apt as I type this. I'm confused.
Why not just disable the "8139cp" module in "make menuconfig" before compiling?
You can find it like that:
Quote:
Originally Posted by make menuconfig
Device Drivers --->
Network device support --->
Ethernet (10 or 100Mbit) --->[*] EISA, VLB, PCI and on board controllers
<M> RealTek RTL-8139 C+ PCI Fast Ethernet Adapter support (EXPERIMENTAL)
You can even disable the whole [*] EISA, VLB, PCI and on board controllers thing if you don't need any card in it.
You probably having this error with all kernel because you are using the same config file to compile all of them.
__________________
"To express yourself in freedom, you must die to everything of yesterday. From the 'old', you derive security; from the 'new', you gain the flow."
Why not just disable the "8139cp" module in "make menuconfig" before compiling?
because I have an rt8139cp card
Quote:
You can even disable the whole [*] EISA, VLB, PCI and on board controllers thing if you don't need any card in it.
I leave them because I have cards I sometimes use there.
Quote:
You probably having this error with all kernel because you are using the same config file to compile all of them.
actually no. I use either the most up to date /boot/config-<kernel> or I let it use the default. Sometimes I take one or the other and go through making changes to it to remove devices I don't have and never will. Admittedly that one itme is always there... but I need it to be.
Open Source Security Myths Dispelled Dispel the five major myths surrounding Open Source Security and gain the tools necessary to make a truly informed decision for your IT organization subscribe
InformationWeek InformationWeek is the only newsweekly you'll need to stay on top of the latest developments in information technology. subscribe