RT_PREEMPT 적용

RT_PREEMPT 적용

Lubuntu 16.04 배포판에 RT_PREEMPT 패치가 포함된 커널을 설치하려고 하는데 어떻게 처리해야 할지 모르는 몇 가지 문제가 발생했습니다. 커널 v4.4.12(linux-4.4.12.tar.xz)의 소스 코드를 커널에서 다운로드했으며 적합하다고 생각되는 RT_PREEMPT 패치(patches-4.4.12-rt20.tar.xz)를 다운로드했습니다. 정리하다. 나는 tar xf, 'd를 사용하여 커널 소스를 cd디렉토리로 추출한 다음 패치를 적용하려고 했습니다 xzcat ../patches-4.4.12.tar.xz | patch -p1(여기에 제안된 대로:https://rt.wiki.kernel.org/index.php/RT_PREEMPT_HOWTO). 이 명령은 존재하지 않는 파일에 대한 패치, 이전에 적용된 패치, 실패한 패치 등에 대해 불평하는 많은 오류를 생성합니다. 일부 패치 블록은 성공하는 것처럼 보였지만 많은 패치 블록이 실패했습니다.

이것은 이 커널을 패치하는 올바른 방법이 될 수 없습니다. 그렇죠? 내가 어디로 잘못 가고 있는지 아시나요?

편집: 다음은 내가 보고 있는 오류 유형을 다루는 예입니다.

rush@lubuntuvm:~/preempt-rt/linux-4.4.12$ xzcat ../patches-4.4.12-rt20.tar.xz | patch -p1
patching file arch/x86/kernel/nmi.c
Hunk #1 FAILED at 231.
Hunk #2 FAILED at 256.
Hunk #3 FAILED at 305.
3 out of 3 hunks FAILED -- saving rejects to file arch/x86/kernel/nmi.c.rej
patching file arch/x86/kernel/reboot.c
patching file include/linux/kernel.h
Hunk #1 succeeded at 255 (offset -4 lines).
Hunk #2 FAILED at 460.
1 out of 2 hunks FAILED -- saving rejects to file include/linux/kernel.h.rej
patching file kernel/panic.c
Hunk #1 FAILED at 61.
1 out of 1 hunk FAILED -- saving rejects to file kernel/panic.c.rej
patching file kernel/watchdog.c
Hunk #1 FAILED at 361.
1 out of 1 hunk FAILED -- saving rejects to file kernel/watchdog.c.rej
patching file kernel/stop_machine.c
Hunk #12 succeeded at 482 (offset -10 lines).
Hunk #13 succeeded at 544 (offset -10 lines).
Hunk #14 succeeded at 648 (offset -10 lines).
patching file block/blk-mq.c
Reversed (or previously applied) patch detected!  Assume -R? [n] n
Apply anyway? [n] 
Skipping patch.
3 out of 3 hunks ignored -- saving rejects to file block/blk-mq.c.rej
patching file block/blk-mq.h
Reversed (or previously applied) patch detected!  Assume -R? [n] 
Apply anyway? [n] 
Skipping patch.
3 out of 3 hunks ignored -- saving rejects to file block/blk-mq.h.rej
patching file net/core/dev.c
Hunk #1 succeeded at 3542 (offset -3 lines).
Hunk #2 succeeded at 3552 (offset -3 lines).
patching file arch/arm64/Kconfig
patching file arch/arm64/include/asm/thread_info.h
patching file arch/arm64/kernel/asm-offsets.c
patching file arch/arm64/kernel/entry.S
can't find file to patch at input line 794
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|-- 
|2.8.1
|
|patches/0026-hwlat-detector-Use-trace_clock_local-if-available.patch0000644001303100130310000000625512741715155025466 0ustar  rostedtrostedtFrom c184dd4a4a5d88b3223704297a42d1aaab973811 Mon Sep 17 00:00:00 2001
|From: Steven Rostedt <[email protected]>
|Date: Mon, 19 Aug 2013 17:33:26 -0400
|Subject: [PATCH 026/351] hwlat-detector: Use trace_clock_local if available
|
|As ktime_get() calls into the timing code which does a read_seq(), it
|may be affected by other CPUS that touch that lock. To remove this
|dependency, use the trace_clock_local() which is already exported
|for module use. If CONFIG_TRACING is enabled, use that as the clock,
|otherwise use ktime_get().
|
|Signed-off-by: Steven Rostedt <[email protected]>
|Signed-off-by: Sebastian Andrzej Siewior <[email protected]>
|---
| drivers/misc/hwlat_detector.c | 34 +++++++++++++++++++++++++---------
| 1 file changed, 25 insertions(+), 9 deletions(-)
|
|diff --git a/drivers/misc/hwlat_detector.c b/drivers/misc/hwlat_detector.c
|index c07e85932cbf..0fcc0e38df42 100644
|--- a/drivers/misc/hwlat_detector.c
|+++ b/drivers/misc/hwlat_detector.c

답변1

당신은 그것을 가져가고 싶을 수도 있지만 patch-4.4.12-rt20.patch.xz, 그렇지 않습니다 patches-4.4.12-rt20.tar.xz. 확장에서 알 수 있듯이 후자는 단일 패치 파일이 아닌 tar 아카이브입니다. 분명히 단일 파일 버전과 동일한 패치가 포함되어 있지만 커밋 메시지 등이 포함되어 있습니다.

patch쓸모없는 것(당연히 tar 파일 구조와 같은)을 무시할 만큼 똑똑해야 일부 패치가 작동합니다. 하지만 구성 요소 패치가 서로 종속되어 있고 tar 파일의 순서가 잘못되어 완전히 적용되지 않을 수 있다고 생각합니다.

관련 정보