PDA

View Full Version : Source code despair......



VeeDubb
03-31-2003, 04:08 AM
I have allready read the instructions in several threads on how to build a properly patced kernel for knoppix3.1, and i have fialed miserably over and over again. is there anywhere i can just DL the bloody kernel already patched?

garyng
03-31-2003, 05:28 AM
What is the problem you encountered ? One way to learn Linux(like building kernels) are at http://www.linuxfromscratch.org

VeeDubb
03-31-2003, 07:08 AM
the problem was that I only knew how to do about half of the things that specific commands weren't listed for, and subsiuently only about half the commands that were listed specificaly did anything but retrn an error. Of course, managed to destroy my instalatio everal times and reinstall several times before giving up.

Dave_Bechtel
03-31-2003, 07:11 AM
--You *are* doing all this stuff as root, right? What kind of errmsgs are you getting?


I have allready read the instructions in several threads on how to build a properly patced kernel for knoppix3.1, and i have fialed miserably over and over again. is there anywhere i can just DL the bloody kernel already patched?

VeeDubb
03-31-2003, 09:17 AM
Of course I'mdoing this as root. goes wthout saying.

Here is the first error I get. I'm tryig to follow the instructions posted by infomania in this thread http://www.knoppix.net/forum/viewtopic.php?t=131 after the first patch that is done with apt-get, he says to aply some other patch, but says NOTHING about how to do this. Of course later int he thread someone gives directions saying to apply the patch by entering "patch < knoppix-kernel.patch" whitch returns "bash: knoppix-kernel.patch: No such file or directory" it's all down hill form there.

garyng
03-31-2003, 09:30 AM
Aha, patch.

What 'patch' does is it takes a 'patch file'(a text file) and applies it to the specific source.

Patch < knoppix.kernel.patch

means that it takes the input from 'knoppix.kernel.patch', in this form, it use a relative directory convention meaning it really depends on where the patch files sit and where you are at the time you run the command.

A better way would be to use the absolute path of the patch file you have put.

Assume you have download(I don't know how you did it) the patch files to

/usr/mykernel/knoppix.kernel.patch.gz2(I am assuming it is zipped)

you need to first unzip it through gzip -d

then

patch < /usr/mykernel/knoppix.kernel.patch

That is the best I can help at the moment, without knowing further detail.

PS. Now you know why I said linux is far from user friendly comparing with XP :-)

Of course I'mdoing this as root. goes wthout saying.

Here is the first error I get. I'm tryig to follow the instructions posted by infomania in this thread http://www.knoppix.net/forum/viewtopic.php?t=131 after the first patch that is done with apt-get, he says to aply some other patch, but says NOTHING about how to do this. Of course later int he thread someone gives directions saying to apply the patch by entering "patch < knoppix-kernel.patch" whitch returns "bash: knoppix-kernel.patch: No such file or directory" it's all down hill form there.

VeeDubb
03-31-2003, 09:47 AM
I will try that tommorrow. for tonight my linux partition is once again unusable. I still maintain that once set up, linux is much friendlier, but i think we can all agree that reguardless of what we think about post set-up, the setup processitself is VERY unfriendly, to all but the uberest of linux gods.

VeeDubb
04-01-2003, 06:29 AM
it is actualy knoppix-kernel.patch, not knoppix.kernel.patch

It is located in /usr/src

I entered the command you gave me as follows

patch < /usr/src/knoppix-kernel.patch and recieved the following mesage: can't find file to patch at input line 3
Perhaps you should have used the -p or --strip option?
The text leading up to this was:
--------------------------
|--- 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
--------------------------
File to patch:


the line "File to patch:" is a prompt, but I don't know what to enter.

VeeDubb
04-01-2003, 06:40 AM
If it makes any difference, the entirety of the patch when opened in konquerer 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





If this is all there actualy is, I'm not opposed to applying it manualy if that's possible. Just tell me what toadd it to and where to add it. If not, hopefully you can tell me how to patch it with the patch command.

VeeDubb
04-01-2003, 06:51 AM
I have now successfully applied the patch in question. turns out it's only job is to change one value that can also be changed manualy, so it's done. But I could use some more help. HTe remainder of te instructions are as follows:

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



If you read through that there are several "you might want to" , "you might use" etc. type remarks. Can you clarify these and tell me what I do or do not need to do? I tried the command mv kernel-source-2.4.20 kernel-source-2.4.20-xfs but it did not do anything for me. I got the mesage "mv: cannot stat `kernel-source-2.4.20': No such file or directory
"

Further assistance would be greatly appreciated.

garyng
04-01-2003, 07:46 AM
where have you put the kernel source you downloaded ? you should cd to that directory.

Assuming you put it to /usr/src, then you would

cd /usr/src

doing a 'ls' here, you are expecting to see the 'linux' directory entry. if it read something else, you need the line mentioned

#ln -s 'whatever name the kernel source you download' linux

the patch file expect this linux/.... directory structure.

Better yet, post the 'ls -l' result from /usr/src(assume that is the place you untar the kernel tarball).

VeeDubb
04-01-2003, 07:54 AM
Actualy, I am now all the way through " make-kpkg --added-patches=/usr/src/kernel-patches/all/apply/xfs configure"
no if you could just explain what is meant by linux/.config I will be done, unless that step isn't needed.

Also, a much simpler question, how would I go about re-compiling the kernel once if I edit a kernel driver?

garyng
04-01-2003, 08:10 AM
linux/.config is just a shell script which will ask you questions on what features to include/exclude etc. ? That is my guess as I haven't get to the stage of fixing the kernel yet. The last time I have played with linux kernel was may be 10 years ago.

Just open that file with an text editor. If it is minor fix, may be you can just copy the configure file of KNOPPIX kernel at /boot/

As for recompile the kernel, this page give you a quick intro of steps involved.

http://www.linuxfromscratch.org/view/4.0/chapter08/kernel.html

VeeDubb
04-01-2003, 08:27 AM
You have been amazingly helpful. thank you VERY MUCH

garyng
04-01-2003, 09:07 AM
you are welcome.

Just curious, what features you want to fix in the KNOPPIX kernel ? It is very much up to date with almost all the necessary stuff in it.

VeeDubb
04-01-2003, 06:30 PM
I wanted to add a device to a specific USB driver.

In particular, I have a pocketPC and needed to add a line or two to ipaq.h and ipaq.c so that I could synce them with linux using SynCE because witout patching that driver, the only PocketPC's supported for syncing are the iPaq the cassiopiea and the jornada.