QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 5375|回复: 24

如何应用“.rej”文件?

[复制链接]
发表于 2003-8-8 16:38:33 | 显示全部楼层 |阅读模式
我给linux-2.4.21-ac4打了个preempt-kernel-rml-2.4.21-1.patch,结果他意外地送给我两个“.rej”文件作为“特别礼物”,不知道这两个“.rej”文件应该怎样应用到代码里?
发表于 2003-8-8 21:37:52 | 显示全部楼层
here is the reason.

Step #4
-------

Check for errors that occured while patching.  Either you have seen
the message from patch or you should search for rejected patches:

        $ find ./ -name '*.rej'

Whenever patch failed to apply a patch completely it will save the
rejected hunks in "<file>.rej".  Your original version will be
saved as "<file>.orig".

Refer to the next section (Troubleshooting) for how to solve these
problems.  After you have fixed everything you should remove the
unnecessary .orig and .rej files, so that you are sure that all
such files are new when you apply another patch.

Troubleshooting
===============

If patch failed to apply a patch completely it will save the rejected
hunks in a file called "<file>.rej" where "<file>" denotes the filename
that couldn't be patched.  The most likely reason for that is that
you have modified "<file>" in a way that conflicts with the changes
made between the different releases.

However, not everything is lost now.  You can inspect "<file>.rej" and
try to apply the patch manually. The .rej files are regular patches
and look like this (MiNTLib patches are always in unified format):

        #######################       
        ### FROMLINE,TOLINE ###

         context line
         context line
        - line to remove
        - another line to remove
         context line
         context line
        - line to remove
        + line to add
         context line
         context line
         ...

[The hash signs `###' are really asterisks `***' but I cannot write
this here.  Otherwise patch gets confused.]

Every hunk is preceded by line number information.  This line number
information gives patch a basic idea on where to look for the lines
to change.  Around the lines in questions you always have some (usually
2) lines of context and then lines beginning with '-' that should
be removed and lines beginning with '+' that should be added.

Normally you can guess from the .rej file what should be done.
回复

使用道具 举报

 楼主| 发表于 2003-8-8 21:50:32 | 显示全部楼层
现在最要命的是我翻遍了整个"<file>.orig"都没有发现可以和"<file>.rej"匹配的上下文。我的内核是linux-2.4.21-ac4的,preempt-kernel-rml-2.4.21-1.patch是给linux-2.4.21的。难道ac4补丁真的改得那么离谱?
回复

使用道具 举报

发表于 2003-8-8 21:55:23 | 显示全部楼层
u should have 3 code.
2.4.21, 2.4.21-ac4, preempt-2.4.21-1.
compare ith .rej file with 2.4.21 instead of 2.4.21-ac4 to see which are changed. good luck.

ac4 change many, yes, many.
回复

使用道具 举报

 楼主| 发表于 2003-8-8 22:02:48 | 显示全部楼层
把ac4或preempt-2.4.21-1打进2.4.21都没有任何"<file>.rej",但两个就是不能打到一起,不管哪个先打都一样,后打的那个总是要产生两个"<file>.rej",真是难搞。
回复

使用道具 举报

发表于 2003-8-8 22:08:03 | 显示全部楼层
because either of them change many on original code. so the latter one can not find where to  patch.

ac4, u use
http://kernel.org/pub/linux/kernel/people/alan/linux-2.4/2.4.21/patch-2.4.21-ac4.gz?

and where is u preempt patch?

i have some time now. i may try.
回复

使用道具 举报

 楼主| 发表于 2003-8-8 22:11:42 | 显示全部楼层
呵呵,是http://kernel.org/pub/linux/kernel/people/alan/linux-2.4/2.4.21/patch-2.4.21-ac4.bz2 (纯属胡搅蛮缠

preempt 的:http://www.kernel.org/pub/linux/kernel/people/rml/preempt-kernel/v2.4/preempt-kernel-rml-2.4.21-1.patch
回复

使用道具 举报

发表于 2003-8-8 22:24:03 | 显示全部楼层
ok, i got them. wait a while.
回复

使用道具 举报

发表于 2003-8-9 00:09:47 | 显示全部楼层
yes, the ac4 patch change too much. so after several hours try, i get a patch. but i do not take any responsibilty, you had better try it on a test system without important data. at least i can boot up my laptop with this patch.

try this
1) get a vanilla 2.4.21 kernel
2) patch ac4 patch, should be succ
3) patch the patch i give to u instead of that preempt.
4) config, compile, and boot

i get this patch by doing these
1) the problems are in ldt.c and sched.c. the ldt.c is easy to solve since the down_write changed to down. so modify it manually
2) diff the preempt patch  
preempt-kernel-rml-2.4.19-2.patch     09-Sep-2002 17:06    74k  
preempt-kernel-rml-2.4.20-3.patch     13-Apr-2003 16:08    96k  
preempt-kernel-rml-2.4.20-ac1-1.patch 10-Dec-2002 23:55    83k  
preempt-kernel-rml-2.4.21-1.patch     17-Jun-2003 17:42    98k
find that there are little change in sched.c
3) diff the patched sched.c in 2.4.20-ac2 and 2.4.20-ac4. they are exactly the same. so ac does not change the sched.c file from 2.4.20 to 2.4.21.
4) from 2) and 3) so we can safely borrow the sched.c file from preempt-kernel-rml-2.4.20-ac1-1.patch.
5) modify an error in sched.c about spin_unlock_no_resched.
6) comppile and boot succ
7) make distclean and manually delete the lib/generatecrctable file(sth like thsi name, i forget the exact name)
diff it with a 2.4.21-ac4 kernel. get the patch.

if u really need this patch, do a test on it thoroughly.
回复

使用道具 举报

发表于 2003-8-9 02:06:41 | 显示全部楼层
    
i tried several times but i still can not upload the patch.

give me u email address, i will send to you. or u can grab it from
http://crab.ele.uri.edu/patch-2.4.21-ac4-pre.bz2

try it when u have time and post u feedback here. thx


    
回复

使用道具 举报

 楼主| 发表于 2003-8-9 09:28:24 | 显示全部楼层
这个补丁什么时候打?第一个打?打完ac4再打?打过preempt-kernel-rml-2.4.21-1.patch再打?还是打了这个就不用打preempt-kernel-rml-2.4.21-1.patch了?
回复

使用道具 举报

发表于 2003-8-9 23:34:53 | 显示全部楼层
i already give u the instruction!

try this
1) get a vanilla 2.4.21 kernel
2) patch ac4 patch, should be succ
3) patch the patch i give to u instead of that preempt.
4) config, compile, and boot
回复

使用道具 举报

 楼主| 发表于 2003-8-10 07:13:35 | 显示全部楼层
sorry,sorry,一时眼花,没看到。
回复

使用道具 举报

发表于 2003-8-10 08:31:45 | 显示全部楼层
never mind  
回复

使用道具 举报

 楼主| 发表于 2003-8-15 21:48:03 | 显示全部楼层
Dragonfly,你的补丁不行啊,启动的时候出现:
[code:1]sh [“不停变化的数字”] exited with preempt_count 1
modprobe [“不停变化的数字”] exited with preempt_count 1
insmod [“不停变化的数字”] exited with preempt_count 1[/code:1]
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-12-4 17:49 , Processed in 0.053371 second(s), 16 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表