Skip to contentSkip to conversation

Patching my kernel.

linux-lvm Rupert Heesom 5 participants 13 messages May 8, 2001 – May 10, 2001

lore
Share & tools
lore
#0 lore raw

I had previously patched the kernel (stock 2.4.3) with the beta 6 patch.

Now I'm trying to update to beta 7. I tried patching the kernel is exactly the same way as before (maybe a mistake). Most of the output is pasted in here (at the end). I'm concerned about the prompts I got -

"Reversed (or previously applied) patch detected! Assume -R? [n]"

As you can see, I decided to reply "Y". Was that a correct assumption?

Afterwards I read the man page on "patch" and am now even less sure that I did the right thing.

I don't want to compile the kernel modules (I have lvm as a module) until I know that the source is in good condition.

patching file drivers/md/Makefile
Reversed (or previously applied) patch detected! Assume -R? [n] y The next patch would delete the file drivers/md/lvm-snap.h, which does not exist! Assume -R? [n] y
patching file drivers/md/lvm-snap.h
patching file Documentation/ioctl-number.txt
Reversed (or previously applied) patch detected! Assume -R? [n] y Hunk #1 succeeded at 187 (offset 1 line).

I've now just tried compiling the kernel modules anyway (not the main kernel file), using make modules, make modules_install.

At the end of the "make modules_install", I got these msgs -

find kernel -path '*/pcmcia/*' -name '*.o' | xargs -i -r ln -sf ../{} pcmcia
if [ -r System.map ]; then /sbin/depmod -ae -F System.map 2.4.3; fi
depmod: *** Unresolved symbols in
/lib/modules/2.4.3/kernel/drivers/md/lvm-mod.odepmod: lvm_init_fs
depmod: lvm_fs_remove_vg
depmod: lvm_fin_fs
depmod: lvm_fs_remove_lv
depmod: lvm_fs_remove_pv
depmod: lvm_fs_create_vg
depmod: lvm_fs_create_lv
depmod: lvm_fs_create_pv

Do I assume that I did the wrong thing if the lvm-mod file is now (I assume) incorrectly built?

How do I patch the kernel correctly???

Signature · 2 lines
regs
rupert
#1 lore raw
Quoted 7 lines · Rupert Heesom

I had previously patched the kernel (stock 2.4.3) with the beta 6 patch.

Now I'm trying to update to beta 7. I tried patching the kernel is exactly the same way as before (maybe a mistake). Most of the output is pasted in here (at the end). I'm concerned about the prompts I got -

"Reversed (or previously applied) patch detected! Assume -R? [n]"

are you starting with a clean kernel or with the kernel you previously patched with b6?
the former is the correvt approach,
the latter....

L.

Signature · 6 lines
Luca Berra -- [email protected]
        Communication Media & Services S.r.l.
 /"\
 \ /     ASCII RIBBON CAMPAIGN
  X        AGAINST HTML MAIL
 / \
#2 lore raw
Quoted 7 lines · Luca Berra
Quoted 6 lines · Rupert Heesom

I had previously patched the kernel (stock 2.4.3) with the beta 6 patch.

Now I'm trying to update to beta 7. I tried patching the kernel is exactly the same way as before (maybe a mistake). Most of the output is pasted in here (at the end). I'm concerned about the prompts I got -

Quoted 5 lines
Quoted 1 line

"Reversed (or previously applied) patch detected! Assume -R? [n]"

are you starting with a clean kernel or with the kernel you previously patched with b6?
the former is the correvt approach,
the latter....

The problem is that the patches mentioned in the fragments file (LVM/PATCHES/fragments-*) for your kernel should only be applied once. So either do as Luca says and go back to a clean kernel. Or just empty the fragments file (do not delete it, and do keep a back up in case you go back to a clean kernel at some point).

- Joe

Quoted 14 lines

L.

Signature · 10 lines
Luca Berra -- [email protected]
        Communication Media & Services S.r.l.
 /"\
 \ /     ASCII RIBBON CAMPAIGN
  X        AGAINST HTML MAIL
 / \
_______________________________________________
linux-lvm mailing list
[email protected]
http://lists.sistina.com/mailman/listinfo/linux-lvm
#3 lore raw
In reply to Luca Berra
Quoted 7 lines · Luca Berra
Quoted 6 lines · Rupert Heesom

I had previously patched the kernel (stock 2.4.3) with the beta 6 patch.

Now I'm trying to update to beta 7. I tried patching the kernel is exactly the same way as before (maybe a mistake). Most of the output is pasted in here (at the end). I'm concerned about the prompts I got -

Quoted 5 lines
Quoted 1 line

"Reversed (or previously applied) patch detected! Assume -R? [n]"

are you starting with a clean kernel or with the kernel you previously patched with b6?
the former is the correvt approach,
the latter....

I was not using a clean kernel. I'll try that.

BTW, I know there's a way to keep the config from the "used kernel", so that I don't have to guess the settings again for my system (I made several config errors last time). Can you remind me how to migrate the
.config file across to a new source tree? I'll try & find some docs on
how to do this, but have forgotten where I last read about it.

Signature · 2 lines
regs
rupert
#4 lore raw
Quoted 14 lines · Rupert Heesom
Quoted 7 lines · Luca Berra
Quoted 6 lines · Rupert Heesom

I had previously patched the kernel (stock 2.4.3) with the beta 6 patch.

Now I'm trying to update to beta 7. I tried patching the kernel is exactly the same way as before (maybe a mistake). Most of the output is pasted in here (at the end). I'm concerned about the prompts I got -

Quoted 5 lines
Quoted 1 line

"Reversed (or previously applied) patch detected! Assume -R? [n]"

are you starting with a clean kernel or with the kernel you previously patched with b6?
the former is the correvt approach,
the latter....

Quoted 7 lines

I was not using a clean kernel. I'll try that.

BTW, I know there's a way to keep the config from the "used kernel", so that I don't have to guess the settings again for my system (I made several config errors last time). Can you remind me how to migrate the
.config file across to a new source tree? I'll try & find some docs on
how to do this, but have forgotten where I last read about it.

Just keep a copy of the .config file, when you untar a new kernel tree copy the .config file back and do a 'make oldconfig', you will be prompted for any new options.

I tend to have a few of these .config's for different setups. eg.

config-2.2-new_raid-lvm-kdb
config-2.2-lvm-kdb
etc.

- Joe

Quoted 9 lines
Signature · 8 lines
-- 
regs
rupert

_______________________________________________
linux-lvm mailing list
[email protected]
http://lists.sistina.com/mailman/listinfo/linux-lvm
#5 lore raw
Quoted 13 lines · Joe Thornber
Quoted 7 lines · Rupert Heesom
Quoted 1 line · Luca Berra

On Tue, May 08, 2001 at 07:11:14PM -0400, Rupert Heesom wrote:

BTW, I know there's a way to keep the config from the "used kernel", so that I don't have to guess the settings again for my system (I made several config errors last time). Can you remind me how to migrate the
.config file across to a new source tree? I'll try & find some docs on
how to do this, but have forgotten where I last read about it.

Just keep a copy of the .config file, when you untar a new kernel tree copy the .config file back and do a 'make oldconfig', you will be prompted for any new options.

Quoted 5 lines

I tend to have a few of these .config's for different setups. eg.

config-2.2-new_raid-lvm-kdb
config-2.2-lvm-kdb
etc.

Joe: I've untarred a new kernel archive & sorted the linux symlink to "kernel-2.4.3", etc. Copied the .config file to the linux directory.

Then ran the patch -p1 < <path to patch file> from the linux directory.

I got a whole lot of errors -

[root@localhost linux]#patch -p1 < /usr/src/patch_gen_7/PATCHES/lvm-0.9.1_beta7-2.4.3.patch patching file include/linux/lvm.h
Hunk #1 FAILED at 67.
Hunk #2 FAILED at 75.
Hunk #3 FAILED at 616.
Hunk #4 FAILED at 639.
4 out of 4 hunks FAILED -- saving rejects to file include/linux/lvm.h.rej
patching file drivers/md/lvm.c
Hunk #1 FAILED at 194.
Hunk #2 FAILED at 359.
Hunk #3 succeeded at 459 with fuzz 2 (offset 11 lines). Hunk #4 FAILED at 1126.
Hunk #5 FAILED at 1166.
Hunk #6 FAILED at 1204.
Hunk #7 FAILED at 1310.
Hunk #8 FAILED at 1350.
Hunk #9 FAILED at 2314.
8 out of 9 hunks FAILED -- saving rejects to file drivers/md/lvm.c.rej can't find file to patch@input line 229
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|--- linux/drivers/md/lvm-fs.c.orig Wed Apr 11 23:49:20 2001
|+++ linux/drivers/md/lvm-fs.c Mon May 7 18:40:26 2001
--------------------------
File to patch:

What am I doing wrong?? I next tried to run the "make oldconfig" from the linux directory. It didn't ask for any input, just did it's thing. Then I reran the patch command, but with the same result.

What a learning curve!! What next?

Signature · 2 lines
regs
rupert
#6 lore raw
Quoted 11 lines · Rupert Heesom

Joe: I've untarred a new kernel archive & sorted the linux symlink to "kernel-2.4.3", etc. Copied the .config file to the linux directory.

Then ran the patch -p1 < <path to patch file> from the linux directory.

I got a whole lot of errors -

[root@localhost linux]#patch -p1 < /usr/src/patch_gen_7/PATCHES/lvm-0.9.1_beta7-2.4.3.patch patching file include/linux/lvm.h
Hunk #1 FAILED at 67.

<snip>

hmmmm... not sure what you've done here. It looks like the patch generation has gone astray. My advice is to start with a fresh LVM dir:

untar clean kernel
untar LVM_beta7
cd LVM
./configure
cd PATCHES
make
cd /usr/src/linux
patch -p1 < <where ever>/LVM/PATCHES/lvm-0.9.1_beta7-2.4.3.patch

If this doesn't work please send me (off list) the LVM patch so I can see what has gone wrong.

Also please be aware that beta7 needs an extra little patch to fix the get_hardblocksize -> hardsectsize name change. Search this mailing list for it, or grab code from CVS.

Quoted 1 line

What a learning curve!! What next?

Please persevere, it gets easy once you've done it a couple of times.

- Joe

#7 lore raw

Well, Joe:

It worked this time. As I write this, the kernel is compiling itself after the patch install.

I think I know what went wrong last time......I'd just finished discussing with someone how to retain the kernel config settings from the previously used source tree. What I did last time was to copy the old .config file into /usr/src/linux. Do the "make oldconfig" command, THEN do the patch install.

Obviously from what I've seen now, I need to to the patch install before
the "make oldconfig". I should have mentioned it in my post to you,
but I probably didn't think of it!

Quoted 14 lines · Joe Thornber

On Wed, May 09, 2001 at 07:43:14AM -0400, Rupert Heesom wrote:

hmmmm... not sure what you've done here. It looks like the patch generation has gone astray. My advice is to start with a fresh LVM dir:

untar clean kernel
untar LVM_beta7
cd LVM
./configure
cd PATCHES
make
cd /usr/src/linux
patch -p1 < <where ever>/LVM/PATCHES/lvm-0.9.1_beta7-2.4.3.patch

Quoted 6 lines

If this doesn't work please send me (off list) the LVM patch so I can see what has gone wrong.

Also please be aware that beta7 needs an extra little patch to fix the get_hardblocksize -> hardsectsize name change. Search this mailing list for it, or grab code from CVS.

I forgot about this.... but looking at the msgs regarding what you mentioned here, looks like it's s/390 code, so not something that will affect my intel processor.

Quoted 4 lines
Quoted 2 lines

What a learning curve!! What next?

Please persevere, it gets easy once you've done it a couple of times.

Yes, I didn't mean that to come across sharply. I *ALWAYS* persevere! When I first started with Linux, it took me 2 WEEKS to get diald working on my PC so that I could use the internet the way I wanted (2 days because of a pw typed into the config file wrong!).

Signature · 2 lines
regs
rupert
#8 lore raw
In reply to Rupert Heesom
Quoted 7 lines · Rupert Heesom

BTW, I know there's a way to keep the config from the "used kernel", so that I don't have to guess the settings again for my system (I made several config errors last time). Can you remind me how to migrate the
.config file across to a new source tree? I'll try & find some docs on
how to do this, but have forgotten where I last read about it.

Copy the .config file from the old kernel tree into the new one and type

make oldconfig

You'll get asked questions about any new options that have appeared in this kernel release.

patrick

#9 lore raw
In reply to Rupert Heesom
Quoted 10 lines

depmod: *** Unresolved symbols in
/lib/modules/2.4.3/kernel/drivers/md/lvm-mod.odepmod: lvm_init_fs

depmod:         lvm_fs_remove_vg
depmod:         lvm_fin_fs
depmod:         lvm_fs_remove_lv
depmod:         lvm_fs_remove_pv
depmod:         lvm_fs_create_vg
depmod:         lvm_fs_create_lv
depmod:         lvm_fs_create_pv

I have the same type of problem (unresolved symbols), but with a _clean_ 2.4.0 kernel and LVM v0.9.1_beta<x>, having blindly followed the steps in the INSTALL file...

--
------------------------------------------------------------------------
David Vidal R. ([email protected])

#10 lore raw
Quoted 11 lines · David Vidal Rodriguez
Quoted 10 lines

depmod: *** Unresolved symbols in
/lib/modules/2.4.3/kernel/drivers/md/lvm-mod.odepmod: lvm_init_fs

depmod:         lvm_fs_remove_vg
depmod:         lvm_fin_fs
depmod:         lvm_fs_remove_lv
depmod:         lvm_fs_remove_pv
depmod:         lvm_fs_create_vg
depmod:         lvm_fs_create_lv
depmod:         lvm_fs_create_pv
Quoted 3 lines

I have the same type of problem (unresolved symbols), but with a _clean_ 2.4.0 kernel and LVM v0.9.1_beta<x>, having blindly followed the steps in the INSTALL file...

The fragments file for 2.4.0 seems to be out of date. Try appending the following lines to LVM/PATCHES/fragments-2.4.0

fragments/add_lvm_fs_2.4.patch
fragments/remove_lvm_snap_h_2.4.patch

Once you've patched your kernel make sure you do a 'make dep' again.

Out of interest, is there any reason that you are sticking with 2.4.0 ?

- Joe

#11 lore raw
Quoted 1 line

Out of interest, is there any reason that you are sticking with 2.4.0 ?

Yes, it's because a clean Linus 2.4.x (where x > 0) doesn't compile correctly. �?�?
--
------------------------------------------------------------------------
David Vidal R. ([email protected])

#12 lore raw
Quoted 4 lines · David Vidal Rodriguez
Quoted 1 line

Out of interest, is there any reason that you are sticking with 2.4.0 ?

Yes, it's because a clean Linus 2.4.x (where x > 0) doesn't compile correctly. �?�?

strange which error are you getting?

L.

Signature · 6 lines
Luca Berra -- [email protected]
        Communication Media & Services S.r.l.
 /"\
 \ /     ASCII RIBBON CAMPAIGN
  X        AGAINST HTML MAIL
 / \