PDA

View Full Version : Kernel Source for Knoppix CD's



pau1knopp
03-21-2003, 12:25 AM
I am really loving the Knoppix distro(s) after they are installed on my local drive. I was always a little fearful of trying a debian install, but with Knoppix, there's no fear of flying :-)

I am now trying to compile a piece of software and ./configure states that it needs the kernel sources. A unname -a shows that I have the 2.4.20-xfs version of the kernel. If I do an apt-get install for kernel-source-2.4.20-xfs, it says no such package. I installed kernel-source-2.4.20 (close enough, right:-) but now it says it can't continue without the complete kernel source.

I am currently downloading 3.2, so if you could tell me a method of obtaining this for 3.1 as well as 3.2, it would be greatly appreciated.

Regards,

~paul

Dave_Bechtel
03-21-2003, 05:02 AM
--You will 1) need enough space for the entire kernel source (100 Meg or so), and 2) have to DL and decompress the source for 2.4.20 from here:
http://www.kernel.org/pub/linux/kernel/v2.4/linux-2.4.20.tar.bz2


I am really loving the Knoppix distro(s) after they are installed on my local drive. I was always a little fearful of trying a debian install, but with Knoppix, there's no fear of flying :-)

I am now trying to compile a piece of software and ./configure states that it needs the kernel sources. A unname -a shows that I have the 2.4.20-xfs version of the kernel. If I do an apt-get install for kernel-source-2.4.20-xfs, it says no such package. I installed kernel-source-2.4.20 (close enough, right:-) but now it says it can't continue without the complete kernel source.

I am currently downloading 3.2, so if you could tell me a method of obtaining this for 3.1 as well as 3.2, it would be greatly appreciated.

Regards,

~paul

pau1knopp
03-21-2003, 10:24 AM
Thanks for the prompt response to my question.

I am currently downloading the file you mentioned. After I untar it, I am not quite sure what I need to do to get the right stuff into the /usr/src/linux-2.4.20-xfs subdirectory...

pau1knopp
03-21-2003, 12:59 PM
Okay, I have made some progress, but have not met with success yet. Per the suggestion in the forum, the kernel source I am using is linux-2.4.20.tar.bz2. Although, I'm not sure if I'm missing something, because when I type uname -a the system reports

Linux wally 2.4.20-xfs #1 SMP Mit Jan 29 18:47:59 CET 2003 i686 VIA Samuel 2 CentaurHauls GNU/Linux

I see that Knoppix 3.1/2 is 2.4.20-xfs and my kernel source is 2.4.20.

Next I untarred the contents into /usr/src/ and recreated the symlink /usr/src/linux to point to this directory. I also had to recreate the symlink /lib/modules/2.4.20-xfs/build to point
to this new directory to proceed without errors (can't find module XXX).

Next, I ran makemenuconfig and compiled the kernel and did the requisite make "dep" afterwards to allow the system to recognize the new kernel source.

I was then able start compiling without bombing out right away. I ran autoconf with no errors, but when I when to run ./configure, it appear to run and compiled, but noted the following:

checking for kernel includes directory... yes
(/lib/modules/2.4.20-xfs/build/include)checking that running and kernel source
versions match... noconfigure: WARNING: Kernel source version 2.4.20 does not
match running version. This kernel module may not work correctly...

Any suggestions on where I may have gone wrong?

Thanks for all the help so far...

~paul

Chello
03-22-2003, 12:07 AM
Same probs here :(

cu

Dave_Bechtel
03-22-2003, 02:33 AM
--If it's only a warning, proceed. See if it works.

--Knoppix is a one-off kernel with XFS filesystem support. When you compile Linus source, xfs is gone unless you apply the patches for it. Since the kernel version is otherwise the same, alsa should still work. But, you may have to compile the entire kernel (with the 2.4.20-xfs config file from Klaus) and boot with that instead of 2.4.20-xfs.

--Personally I wish Klaus would just go with standard Linus source, but that's just me.


Okay, I have made some progress, but have not met with success yet. Per the suggestion in the forum, the kernel source I am using is linux-2.4.20.tar.bz2. Although, I'm not sure if I'm missing something, because when I type uname -a the system reports

Linux wally 2.4.20-xfs #1 SMP Mit Jan 29 18:47:59 CET 2003 i686 VIA Samuel 2 CentaurHauls GNU/Linux

I see that Knoppix 3.1/2 is 2.4.20-xfs and my kernel source is 2.4.20.

Next I untarred the contents into /usr/src/ and recreated the symlink /usr/src/linux to point to this directory. I also had to recreate the symlink /lib/modules/2.4.20-xfs/build to point
to this new directory to proceed without errors (can't find module XXX).

Next, I ran makemenuconfig and compiled the kernel and did the requisite make "dep" afterwards to allow the system to recognize the new kernel source.

I was then able start compiling without bombing out right away. I ran autoconf with no errors, but when I when to run ./configure, it appear to run and compiled, but noted the following:

checking for kernel includes directory... yes
(/lib/modules/2.4.20-xfs/build/include)checking that running and kernel source
versions match... noconfigure: WARNING: Kernel source version 2.4.20 does not
match running version. This kernel module may not work correctly...

Any suggestions on where I may have gone wrong?

Thanks for all the help so far...

~paul

oscar
03-22-2003, 02:41 AM
...kernel-2.4.20-xfs is a custom kernel...kernel-2.4.20 is no the same thing

There is in synaptic (apt-get gui frontend) the option to download kernel-2.4.20-xfs -image only, not the kernel source
żany ideas to get kernel-2.4.20-xfs-source? żany debian repository?

thanks

infoMafia
03-22-2003, 04:14 AM
Hi ALL,

How to patch and build the original kernel-source-2.4.20 for XFS;

Get and tar extract the original kernel-source-2.4.20.tar.bz2 in /usr/src.
Get a "kernel-patch-xfs" as below;
# apt-get install kernel-patch-xfs

Above will creat the directory tree /usr/src/kernel-patches/.
Then apply "knoppix-kernel.patch" which is located in /usr/src Knoppix distro.

Perhaps you want below too;
# mv kernel-source-2.4.20 kernel-source-2.4.20-xfs
# ln -s kernel-source-2.4.20-xfs linux
Then you might want to edit the fourth line of Makefile adding;
EXTRAVERSION =-xfs

# cd linux
# export PATCH_THE_KERNEL=YES
# make-kpkg --added-patches=/usr/src/kernel-patches/all/apply/xfs configure
(you might use the configuration file from /boot/config-2.4.20 Knoppix)
Confirm the following lines in linux/.config
CONFIG_XFS_FS=m
CONFIG_XFS_RT=y
CONFIG_XFS_QUOTA=y
CONFIG_XFS_DMAPI=y
# CONFIG_XFS_DEBUG is not set

# fakeroot make-kpkg kernel-image

That's all!

oscar
03-22-2003, 05:50 AM
thanks,

apt-get dont find the knoppix-kernel.patch but it is already at /usr/src/
Here it is

--- linux/arch/i386/kernel/setup.c.orig 2002-10-04 01:02:25.000000000 +0200
+++ linux/arch/i386/kernel/setup.c 2002-10-04 01:03:24.000000000 +0200
@@ -195,7 +195,7 @@
#define INITRD_START (*(unsigned long *) (PARAM+0x218))
#define INITRD_SIZE (*(unsigned long *) (PARAM+0x21c))
#define COMMAND_LINE ((char *) (PARAM+2048))
-#define COMMAND_LINE_SIZE 256
+#define COMMAND_LINE_SIZE 512 /* The boot commandline in Knoppix can get quite long -KK Oct. 2002 */

#define RAMDISK_IMAGE_START_MASK 0x07FF
#define RAMDISK_PROMPT_FLAG 0x8000

infoMafia
03-22-2003, 06:17 AM
Hi oscar,

Please remember that you need two patches,
knoppix-kernel.patch and kernel-patch-xfs.

The first one is located in Knoppix /usr/src/ as you and I wrote but the second one can be obtained by apt-get from Debian package.

Good luck!

pau1knopp
03-22-2003, 06:35 AM
I like the suggestions just made to patch the kernel and make my own kernel source, and I may still try that. However, I did find a solution to my problem... I "downgraded" my kernel version to 2.4.20 (without xfs) and was able to boot and successfully compile... woo hoo!

Here are the steps...



You will need enough space for the entire kernel source (100 Meg or so), and 2) have to DL and decompress the source for 2.4.20 from here:
http://www.kernel.org/pub/linux/kernel/v2.4/linux-2.4.20.tar.bz2

As root:

Unpack the sources into /usr/src/

Optional - You can copy the .config file from your old linux kernel source tree
to new kernel tree (may save time, if you want to reuse the old settings).

cp /usr/src/linux/.config /usr/src/newdirectory/.config

Delete the old symlink /usr/src/linux and create a new one
cd /usr/src/
rm linux
ln -s newdirectory linux

cd /usr/src/linux

make clean;
make mrproper

Note: before running "make menuconfig" you should have obtained a copy of your current config file from
/usr/src/linux/.config and read this into menuconfig rather than creating a
kernel from scratch.

If you opted NOT to do that, bless you, and... the following * are VERY
IMPORTANT and minimal requirements!!! :

*Select proper CPU type - Pentium 3, AMD K6, Cyrix, Pentium
4, Intel 386, DEC Alpha, PowerPC otherwise kernel compile will fail and even if
it compiles will not boot!!
*Select SMP support - whether single CPU or multiple
CPUs
*Filesystems - Select Windows95 Vfat, MSDOS, NTFS as part of kernel and not as
loadable modules. (My personal preference but you are free to pick your own
option).
*Enable the Loadable kernel modules support! With this option you can
load/unload the device drivers dynamically on running linux system on the fly.

Regardless of whether you used the previous .config file (highly recommended) or create your own, the next step you will do will be:

make menuconfig
make dep

Note: LOADABLE MODULES: next two steps required ONLY if you had enabled Loadable
module support in step 3 above. Loadable module are located in /lib/modules. You
MUST do this step if you enabled or disabled any modules, otherwise you will get
'unresolved symbols' errors during or after kernel boot. Check for insmod
command which is extensively used for loading the modules. You probably want to run them, but they are time intensive...

make modules
make modules_install (go balance checkbook)

make bzImage

Note: you can also create bzImage as follows:
bash# cd /usr/src/linux
bash# man nohup
bash# nohup make bzImage &
bash# man tail
bash# tail -f nohup.out (.... to monitor the progress)


This will put the kernel in /usr/src/linux/arch/i386/boot/bzImage
After bzImage is successful, copy the kernel image to /boot directory.
You must copy the new kernel image to /boot directory, otherwise the new kernel
MAY NOT boot.

cp /usr/src/linux/arch/i386/boot/bzImage /boot/2.4.20mar2103

make modules_install (go throw in a load of laundry)
make install

configure LILO or GRUB
vi /etc/lilo.conf and insert the following (or similar for your pc)
image=/boot/2.4.20mar2103
label=mykernel
root=/dev/hda5
read-only

run lilo command to read/write the new partion information

reboot and pray

Optional - run "make clean" (If you want to free up disk space)

Not a perfect or beautiful solution, but one in which I can say afterwards "I compiled my own custom kernel!" Hope this information is helpful,

Paul Knopp
with a name like Knoppix, it's got to be good...

pau1knopp
03-22-2003, 05:09 PM
Hi ALL,

How to patch and build the original kernel-source-2.4.20 for XFS;

Get and tar extract the original kernel-source-2.4.20.tar.bz2 in /usr/src.
Get a "kernel-patch-xfs" as below;
# apt-get install kernel-patch-xfs

Above will creat the directory tree /usr/src/kernel-patches/.
Then apply "knoppix-kernel.patch" which is located in /usr/src Knoppix distro.

Perhaps you want below too;
# mv kernel-source-2.4.20 kernel-source-2.4.20-xfs
# ln -s kernel-source-2.4.20-xfs linux
Then you might want to edit the fourth line of Makefile adding;
EXTRAVERSION =-xfs

# cd linux
# export PATCH_THE_KERNEL=YES
# make-kpkg --added-patches=/usr/src/kernel-patches/all/apply/xfs configure
(you might use the configuration file from /boot/config-2.4.20 Knoppix)
Confirm the following lines in linux/.config
CONFIG_XFS_FS=m
CONFIG_XFS_RT=y
CONFIG_XFS_QUOTA=y
CONFIG_XFS_DMAPI=y
# CONFIG_XFS_DEBUG is not set

# fakeroot make-kpkg kernel-image

That's all!

Wow, that sounds a LOT better than what I came up with. Read through the instructions and will try them but one question. Not sure of what to do for the step that says..."Then apply "knoppix-kernel.patch" which is located in /usr/src Knoppix distro." Is that done by the subsequent commands, or am I missing it? Thanks for the thorough recipe' :-)

oscar
03-22-2003, 07:00 PM
it is possible recompiling the kernel with kernel-source-2.4.20 (without xfs) with the standard debian method

with
cd /usr/src/kernel-source-2.4.20
make xconfig
load config file /boot/config-2-4-20-xfs
(make your changes)
save
make-kpkg kernel_image
...wait...
cd /usr/src (there is new 8mb files there)
instal l (2click) on kernel-image-2.4.20. deb

edit /etc/lilo.conf to point to your new /boot/kernel... and to your old /boot/kernel... in case somehing goes wrong
then

lilo -v (to save new lilo menu)

reboot

infoMafia
03-23-2003, 03:57 AM
Paul,

You write;
[Wow, that sounds a LOT better than what I came up with. Read through the instructions and will try them but one question. Not sure of what to do for the step that says..."Then apply "knoppix-kernel.patch" which is located in /usr/src Knoppix distro." Is that done by the subsequent commands, or am I missing it? Thanks for the thorough recipe']

You can apply patch by the command:
`patch < knoppix-kernel.patch`

Or you can do it by simply edit - changing one line in
linux/arch/i386/kernel/setup.c from COMMAND_LINE_SIZE 256 to
COMMAND_LINE_SIZE 512

Above patch is really easy and VERY required for Knoppix kernel.

If you need further XFS file system feature then you must learn how to do. It's not that easy for newbie but I'm sure you can do after learning.

VeeDubb
03-31-2003, 09:30 AM
Your directions look great for people who know what they are doing, but in my attempts to follow them I have now rendered my computer unbootable and been forced to reinstall linux SEVERAL times. Would it be possible for you or anyone to post a straight forward, plain english, "script" (I mean the kind used in theater, not a shell script) for how to do this. No, "you might want" no vague instructions like "apply the patch". No options period. Just a list of the correct commands to enter in the correct order to patch the kernel for the most common options that would apply to those new to linux.

If you or some one could do this I I can't tell you how much I would appreciate it. Thank you in advance.

Henk Poley
03-31-2003, 02:19 PM
it is possible recompiling the kernel with kernel-source-2.4.20 (without xfs) with the standard debian method with
cd /usr/src/kernel-source-2.4.20
make xconfig
load config file /boot/config-2-4-20-xfs
<snip>
That should be /boot/config-2.4.20-xfs

VeeDubb
04-01-2003, 06:09 AM
Anybody?

Nikonian
04-10-2003, 06:51 PM
Your directions look great for people who know what they are doing, but in my attempts to follow them I have now rendered my computer unbootable and been forced to reinstall linux SEVERAL times.

when you try building your own kernel, make sure to give it an unique name before you copy it to /boot and than add a new line for the new kernel if it doesn't work just switch back to the old! And try again....

davros4269
05-06-2003, 11:16 PM
Hi all,

Like the original poster, all I want to do is to compile something which needs the kernel source.
I've tried every method described above, with limited success...

I used both the "Debian" method and the "long" method. Both produced the kernel, neither would load. I compiled without XFS support. Booting fails citing modules compiled against the old kernel *2.4.20-xfs". I seem to have modules (.o files) under both xfs and plain 2.4.20...

Rather, what seems to be happening, is that modules aren't being loaded, and therefore, the booting process stops, because needed parts of the system are missing...the reason given for failure to load is the version conflict.

I then tried to apt-get install kernel-image-2.4.20-1-686 (or something quite similar). It seemed to install, yet lilo won't boot it, citing "crampfs wrong magic" or something similar. I tried using the initrd image file that I had, and one that came with it, each yielding slightly different error messages...I tried both having the post-install script rewrite lilo completly and adding it into the current lilo by hand...

I've also tried to cheat, by renaming the xfs source and linking the 2.4.20 source to try and fool the compile process; it allowed it to begin, but then aborted out realizing that version conflict.

All I want is a running kernel matching a kernel source, so that I can compile this damn thing! I don't care about xfs support...

I'm trying to compile the Zoran video decoder card drivers for an Iomega Buz, btw...

Any help would be appreciated!

Dave_Bechtel
05-08-2003, 04:29 AM
--Since installing the latest KPX 2003-0503 to my HD, I haven't gotten LILO to work at *all*. I'm still booting with a floppy, and planning on switching to GRUB. Had to redo the entire hdinstall due to a bad floppy disk, and the system would NOT boot. :(

--Anyway, access my linuxtips site and read the instructions on how to compile a kernel there. Make sure you changed the "preferred" link in /lib/modules, and try using a non-lilo method of booting the system. (man grub) or (man rdev)+ DD the bzImage directly to a floppy and boot from there. Only drawback to that is you can't specify kernel parms, but perhaps the system will boot.

--I'll be working on getting my sys to boot w/ a recompiled kernel myself, so best of luck and keep us informed.


Hi all,

Like the original poster, all I want to do is to compile something which needs the kernel source.
I've tried every method described above, with limited success...

I used both the "Debian" method and the "long" method. Both produced the kernel, neither would load. I compiled without XFS support. Booting fails citing modules compiled against the old kernel *2.4.20-xfs". I seem to have modules (.o files) under both xfs and plain 2.4.20...

Rather, what seems to be happening, is that modules aren't being loaded, and therefore, the booting process stops, because needed parts of the system are missing...the reason given for failure to load is the version conflict.

I then tried to apt-get install kernel-image-2.4.20-1-686 (or something quite similar). It seemed to install, yet lilo won't boot it, citing "crampfs wrong magic" or something similar. I tried using the initrd image file that I had, and one that came with it, each yielding slightly different error messages...I tried both having the post-install script rewrite lilo completly and adding it into the current lilo by hand...

I've also tried to cheat, by renaming the xfs source and linking the 2.4.20 source to try and fool the compile process; it allowed it to begin, but then aborted out realizing that version conflict.

All I want is a running kernel matching a kernel source, so that I can compile this damn thing! I don't care about xfs support...

I'm trying to compile the Zoran video decoder card drivers for an Iomega Buz, btw...

Any help would be appreciated!

garyng
05-08-2003, 04:40 AM
I don't know too much dtail about linux kernel and loadable module but it seems that unlike Windows DLL which resolved with function name only meaning that so long the function behave the same with the same function name they are freely replacable, linux kernel and its loadable modules must come as a whole(a new kernel means a recompile of all modules). So if it is a hard disk install, custom kernel should be relatively safe(as the installation is complete) but if it is non-hd install, one cannot expect it to work by just replacing the vmlinuz and use the modules on the CD.

davros4269
05-08-2003, 06:33 AM
--Since installing the latest KPX 2003-0503 to my HD, I haven't gotten LILO to work at *all*. I'm still booting with a floppy, and planning on switching to GRUB. Had to redo the entire hdinstall due to a bad floppy disk, and the system would NOT boot. :(

--Anyway, access my linuxtips site and read the instructions on how to compile a kernel there. Make sure you changed the "preferred" link in /lib/modules, and try using a non-lilo method of booting the system. (man grub) or (man rdev)+ DD the bzImage directly to a floppy and boot from there. Only drawback to that is you can't specify kernel parms, but perhaps the system will boot.

--I'll be working on getting my sys to boot w/ a recompiled kernel myself, so best of luck and keep us informed.


Hi all,

Like the original poster, all I want to do is to compile something which needs the kernel source.
I've tried every method described above, with limited success...

I used both the "Debian" method and the "long" method. Both produced the kernel, neither would load. I compiled without XFS support. Booting fails citing modules compiled against the old kernel *2.4.20-xfs". I seem to have modules (.o files) under both xfs and plain 2.4.20...

Rather, what seems to be happening, is that modules aren't being loaded, and therefore, the booting process stops, because needed parts of the system are missing...the reason given for failure to load is the version conflict.

I then tried to apt-get install kernel-image-2.4.20-1-686 (or something quite similar). It seemed to install, yet lilo won't boot it, citing "crampfs wrong magic" or something similar. I tried using the initrd image file that I had, and one that came with it, each yielding slightly different error messages...I tried both having the post-install script rewrite lilo completly and adding it into the current lilo by hand...

I've also tried to cheat, by renaming the xfs source and linking the 2.4.20 source to try and fool the compile process; it allowed it to begin, but then aborted out realizing that version conflict.

All I want is a running kernel matching a kernel source, so that I can compile this damn thing! I don't care about xfs support...

I'm trying to compile the Zoran video decoder card drivers for an Iomega Buz, btw...

Any help would be appreciated!

It does seem to be module related. It will start to boot my custom kernel - I don't think my problem is lilo - but it complains about the modules being compiled for 2.4.20-xfs and refuses to load them - the boot process then stops because, I assume, it needs them to complete the loading of the system correctly.

I can find no one link to "modules". in /lib/modules there are various folders representing various modules for various kernels that I've compiled - each contain modules! i cannot seem to get the system to recognize the modules that go with any other kernel besides 2.4.20-xfs!! I thought there must be a link someplace pointing to THEE modules, the ones meant to be used...perhaps the initrd image hard codes the path to the -xfs modules...don't know enough about the process...

I'm working with a hard dive install of course - not sure how moduels relate to dlls - i thought that libraries were similar to dlls, while modules were basicaly drivers of one sort or another...

I've never used grub, never had a reason to. Once, during my many attempts, I did it the debian way, asking it to install 2.4.20-1-686 using apt and allowed the post install script to rewrite lilo. This rendered the system unbootable, but I then simply used the knoppix cd as a rescue disk, chrooted in and reconstructed a working lilo with the old kernel in no time...

I've been using linux for a few years now and have never needed to compile a kernel - I guess my lazyness has caught up with me ;)

garyng
05-08-2003, 07:33 AM
the module directory it looks for is :

/lib/modules/kernel/`uname -r`

So you need a `uname -r` to see what kernel you are booting with then you can trace further. As for the initrd, I don't know how the hd-install handle initrd but it is in general not needed and even if there is one, no modules should be in there.

davros4269
05-09-2003, 06:33 PM
After i removed the initrd line from it's lilo stanza, the new kernel boot like a charm!

Now to compile the 686 kernel for those few extra performance percentage points!

Baby Peanut
07-02-2003, 03:37 AM
Your directions look great for people who know what they are doing, but in my attempts to follow them I have now rendered my computer unbootable and been forced to reinstall linux SEVERAL times. Would it be possible for you or anyone to post a straight forward, plain english, "script" (I mean the kind used in theater, not a shell script) for how to do this. No, "you might want" no vague instructions like "apply the patch". No options period. Just a list of the correct commands to enter in the correct order to patch the kernel for the most common options that would apply to those new to linux.

If you or some one could do this I I can't tell you how much I would appreciate it. Thank you in advance.

How to rebuild the knoppix 2.4.20-xfs kernel.

# cd /usr/src
# wget http://kernel.org/pub/linux/kernel/v2.4/linux-2.4.20.tar.bz2
# tar xvfj linux-2.4.20.tar.bz2
# apt-get install kernel-patch-xfs

apt-get will creat the directory tree /usr/src/kernel-patches

# rm -f linux
# ln -s linux-2.4.20 linux
# patch -sp0 < knoppix-kernel.patch
# patch -sp0 < linux-2.4.20-ptrace.patch
# zcat kernel-patches/all/xfs/xfs-snapshot-2.4.20-all.patch.gz | patch -sp0
1 out of 13 hunks FAILED -- saving rejects to file linux/fs/buffer.c.rej
[ignore that message, after all it's Linux what did you expect?]
# cd linux

Then edit the fourth line of Makefile changing

EXTRAVERSION =

to

EXTRAVERSION = -xfs

# cp ../linux-2.4.20-xfs/.config .
# make-kpkg configure
[...typical linux "verbal diarrhea"-style output...]
Intel I810 (CONFIG_DRM_I810) [M/n/?]
Enabled XFree 4.1 ioctl interface by default (CONFIG_DRM_I810_XFREE_41) [N/y/?] (NEW) y
[...]
SiS (CONFIG_DRM_SIS) [N/m/?] (NEW) m
[...]
ACL support (CONFIG_XFS_POSIX_ACL) [N/y/?] (NEW) y

# fakeroot make-kpkg kernel-image

[...wait a lot...]

Baby Peanut
07-02-2003, 03:50 AM
Your directions look great for people who know what they are doing, but in my attempts to follow them I have now rendered my computer unbootable and been forced to reinstall linux SEVERAL times. Would it be possible for you or anyone to post a straight forward, plain english, "script" (I mean the kind used in theater, not a shell script) for how to do this. No, "you might want" no vague instructions like "apply the patch". No options period. Just a list of the correct commands to enter in the correct order to patch the kernel for the most common options that would apply to those new to linux.

If you or some one could do this I I can't tell you how much I would appreciate it. Thank you in advance.

How to rebuild the knoppix 2.4.20-xfs kernel.

# cd /usr/src
# wget http://kernel.org/pub/linux/kernel/v2.4/linux-2.4.20.tar.bz2
# tar xvfj linux-2.4.20.tar.bz2
# apt-get install kernel-patch-xfs

apt-get will creat the directory tree /usr/src/kernel-patches

# rm -f linux
# ln -s linux-2.4.20 linux
# patch -sp0 < knoppix-kernel.patch
# patch -sp0 < linux-2.4.20-ptrace.patch
# zcat kernel-patches/all/xfs/xfs-snapshot-2.4.20-all.patch.gz | patch -sp0
1 out of 13 hunks FAILED -- saving rejects to file linux/fs/buffer.c.rej
[ignore that message, after all it's Linux what did you expect?]
# cd linux

Then edit the fourth line of Makefile changing

EXTRAVERSION =

to

EXTRAVERSION = -xfs

# cp ../linux-2.4.20-xfs/.config .
# make-kpkg configure
[...typical linux "verbal diarrhea"-style output...]
Intel I810 (CONFIG_DRM_I810) [M/n/?]
Enabled XFree 4.1 ioctl interface by default (CONFIG_DRM_I810_XFREE_41) [N/y/?] (NEW) y
[...]
SiS (CONFIG_DRM_SIS) [N/m/?] (NEW) m
[...]
ACL support (CONFIG_XFS_POSIX_ACL) [N/y/?] (NEW) y

# fakeroot make-kpkg kernel-image

[...wait a lot...]

Fail on undefined reference to 'DQUOT_SYNC'

Rip Knoppix off box and install FreeBSD.

Sigh with relief as the kernel can now be build with just "make kernel".

eadz
07-02-2003, 04:03 AM
Remember to use GCC 2.95 not 3.2

By defalt in recent Knoppixes the default gcc compiler is version 3.2 or 3.3. This doesn't not compile the default knoppix kernel.

To use gcc 2.95 to compile the kernel,
change they symlink /usr/bin/gcc to point to /usr/bin/gcc-2.95 :


rm /usr/bin/gcc
ln -s /usr/bin/gcc-2.95 /usr/bin/gcc


( or edit the kernel Makefile )

Dave_Bechtel
07-02-2003, 04:36 AM
--Umm, I compiled my kernel with 3.2:


$ cat /proc/version
Linux version 2.4.21 (root@knopperbox32) (gcc version 3.2.3 20030415 (Debian prerelease)) #2 Sat Jun 28 20:44:02 CDT 2003

--Only problem is sound doesn't work at all (trident driver) - either with stock kernel drivers OR alsa. :( Knoppix DVD beta kernel 2.4.21 was compiled with gcc 2.95 and trident doesn't work with that either.

--Different method to change compiler without changing the symlink:

' export CC=/usr/bin/gcc-2.95 ' == This changes the compiler only for your current shell and is not permanent.


Remember to use GCC 2.95 not 3.2

By defalt in recent Knoppixes the default gcc compiler is version 3.2 or 3.3. This doesn't not compile the default knoppix kernel.

To use gcc 2.95 to compile the kernel,
change they symlink /usr/bin/gcc to point to /usr/bin/gcc-2.95 :


rm /usr/bin/gcc
ln -s /usr/bin/gcc-2.95 /usr/bin/gcc


( or edit the kernel Makefile )

eadz
07-02-2003, 06:48 AM
Sure 3.2 _might_ work in some cases.

Things to remember :
The official Knoppix Kernel is compiled with 2.95 so if you want it to be like that use that compiler.

The default compiler on the DVD is 3.3. Using the default knoppix .config it didn't compile.