Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doubt about the instalation of a REAL-Time kernel in linux #542

Closed
marioesteban11 opened this issue Nov 22, 2022 · 8 comments
Closed

Doubt about the instalation of a REAL-Time kernel in linux #542

marioesteban11 opened this issue Nov 22, 2022 · 8 comments
Labels
solution proposed A solution has been proposed

Comments

@marioesteban11
Copy link

Hi everyone,

Im trying to install a REAL-Time kernel in my ubuntu 22.04.

Im following the instructions from this readme with the following steps:

`wget https://www.kernel.org/pub/linux/kernel/v5.x/linux-5.14.9.tar.sign
wget https://www.kernel.org/pub/linux/kernel/v5.x/linux-5.14.9.tar.xz
wget https://cdn.kernel.org/pub/linux/kernel/projects/rt/5.15/patch-5.15.79-rt54.patch.xz
wget https://cdn.kernel.org/pub/linux/kernel/projects/rt/5.15/patch-5.15.79-rt54.patch.sign

xz -dk patch-5.15.79-rt54.patch.xz
xz -d linux-5.14.9.tar.xz
tar xf linux-5.14.9.tar
cd linux-5.14.9/
xzcat ../patch-4.14.139-rt66.patch.xz | patch -p1`

This steps above are just the readme mention before, except from different patch linux version.
My doubt comes in this last command

xzcat ../patch-4.14.139-rt66.patch.xz | patch -p1

Because the following message appears:

File to patch:

And I dont really know if i have to skip it or which path I have to introduce.

Thanks in advance

@RobertWilbrandt
Copy link
Contributor

The version of the RT path needs to match the kernel version, i imagine this error coming from the mismatch between 5.14.9 and 5.15.79. I just tried the same procedure with 5.14.2 without any problems. Could you check if this is your problem?

I will document this more clearly in the linked README and update the used version to something more recent.

@marioesteban11
Copy link
Author

Hi @RobertWilbrandt, I don´t know if I misunderstood what you told or, it just failed because my pc doesn't want to work.
When you said that you tried with 5.14.2, you mean changing wget https://www.kernel.org/pub/linux/kernel/v5.x/linux-5.14.9.tar.sign wget https://www.kernel.org/pub/linux/kernel/v5.x/linux-5.14.9.tar.xz this 2 steps, instead of 5.14.9 for 5.14.2 right?

Whe I do that steps I have the same problem. I attach the complete error, if that helps:

patching file Documentation/admin-guide/cgroup-v1/memory.rst
patching file Documentation/dev-tools/kcov.rst
patching file arch/alpha/include/asm/spinlock_types.h
patching file arch/arm/Kconfig
Hunk #2 succeeded at 70 (offset 1 line).
Hunk #4 succeeded at 126 with fuzz 2.
patching file arch/arm/include/asm/spinlock_types.h
patching file arch/arm/include/asm/thread_info.h
Hunk #1 FAILED at 52.
Hunk #2 succeeded at 146 (offset 12 lines).
Hunk #3 succeeded at 161 (offset 12 lines).
Hunk #4 succeeded at 171 (offset 12 lines).
1 out of 4 hunks FAILED -- saving rejects to file arch/arm/include/asm/thread_info.h.rej
patching file arch/arm/kernel/asm-offsets.c
Hunk #1 FAILED at 43.
1 out of 1 hunk FAILED -- saving rejects to file arch/arm/kernel/asm-offsets.c.rej
patching file arch/arm/kernel/entry-armv.S
patching file arch/arm/kernel/signal.c
Hunk #1 succeeded at 649 (offset 42 lines).
patching file arch/arm/mm/fault.c
patching file arch/arm64/Kconfig
Hunk #1 succeeded at 88 with fuzz 2.
Hunk #2 succeeded at 195 (offset 3 lines).
Hunk #3 succeeded at 217 (offset 3 lines).
patching file arch/arm64/include/asm/pgtable.h
Hunk #1 succeeded at 995 (offset -6 lines).
patching file arch/arm64/include/asm/preempt.h
patching file arch/arm64/include/asm/signal.h
patching file arch/arm64/include/asm/spinlock_types.h
patching file arch/arm64/include/asm/thread_info.h
patching file arch/arm64/kernel/asm-offsets.c
patching file arch/arm64/kernel/fpsimd.c
Hunk #1 succeeded at 177 (offset -2 lines).
Hunk #2 succeeded at 210 (offset -2 lines).
patching file arch/arm64/kernel/signal.c
Hunk #1 succeeded at 929 with fuzz 1 (offset 7 lines).
Hunk #2 succeeded at 937 (offset 7 lines).
patching file arch/arm64/kvm/arm.c
Hunk #1 succeeded at 772 (offset -56 lines).
Hunk #2 succeeded at 821 (offset -31 lines).
Hunk #3 succeeded at 893 (offset -28 lines).
patching file arch/csky/include/asm/spinlock_types.h
patching file arch/hexagon/include/asm/spinlock_types.h
patching file arch/ia64/include/asm/spinlock_types.h
patching file arch/powerpc/Kconfig
Hunk #1 FAILED at 151.
Hunk #2 succeeded at 223 with fuzz 2 (offset 5 lines).
Hunk #3 succeeded at 240 (offset 5 lines).
1 out of 3 hunks FAILED -- saving rejects to file arch/powerpc/Kconfig.rej
patching file arch/powerpc/include/asm/simple_spinlock_types.h
patching file arch/powerpc/include/asm/smp.h
Hunk #1 succeeded at 58 (offset -4 lines).
patching file arch/powerpc/include/asm/spinlock_types.h
patching file arch/powerpc/include/asm/stackprotector.h
patching file arch/powerpc/include/asm/thread_info.h
Hunk #1 succeeded at 47 (offset -6 lines).
Hunk #2 succeeded at 95 (offset -6 lines).
Hunk #3 succeeded at 111 (offset -6 lines).
Hunk #4 succeeded at 123 (offset -6 lines).
Hunk #5 succeeded at 137 (offset -6 lines).
patching file arch/powerpc/kernel/interrupt.c
Hunk #1 succeeded at 305 (offset -41 lines).
Hunk #2 succeeded at 515 (offset -37 lines).
patching file arch/powerpc/kernel/irq.c
Hunk #1 succeeded at 684 (offset -6 lines).
Hunk #2 succeeded at 703 (offset -6 lines).
Hunk #3 succeeded at 816 (offset -6 lines).
patching file arch/powerpc/kernel/kgdb.c
patching file arch/powerpc/kernel/smp.c
Hunk #1 succeeded at 582 (offset -8 lines).
patching file arch/powerpc/kernel/traps.c
Hunk #1 succeeded at 261 (offset 1 line).
patching file arch/powerpc/kvm/Kconfig
Hunk #1 succeeded at 179 (offset 1 line).
patching file arch/powerpc/platforms/pseries/iommu.c
Hunk #2 succeeded at 191 (offset -5 lines).
Hunk #3 succeeded at 219 (offset -6 lines).
Hunk #4 FAILED at 237.
Hunk #5 succeeded at 266 (offset -6 lines).
Hunk #6 succeeded at 437 (offset -11 lines).
Hunk #7 succeeded at 490 (offset -11 lines).
1 out of 7 hunks FAILED -- saving rejects to file arch/powerpc/platforms/pseries/iommu.c.rej
patching file arch/riscv/include/asm/spinlock_types.h
patching file arch/s390/include/asm/spinlock_types.h
patching file arch/sh/include/asm/spinlock_types.h
patching file arch/sh/kernel/irq.c
patching file arch/sparc/kernel/irq_64.c
patching file arch/x86/Kconfig
Hunk #2 succeeded at 232 (offset 1 line).
patching file arch/x86/include/asm/irq_stack.h
Hunk #1 succeeded at 188 with fuzz 2 (offset -14 lines).
Hunk #2 succeeded at 202 (offset -14 lines).
patching file arch/x86/include/asm/preempt.h
patching file arch/x86/include/asm/signal.h
Hunk #1 succeeded at 28 with fuzz 2.
patching file arch/x86/include/asm/stackprotector.h
patching file arch/x86/include/asm/thread_info.h
Hunk #3 succeeded at 117 with fuzz 1 (offset -1 lines).
patching file arch/x86/kernel/irq_32.c
patching file arch/x86/kernel/kgdb.c
patching file arch/x86/kvm/x86.c
Hunk #1 succeeded at 8399 (offset -270 lines).
patching file arch/xtensa/include/asm/spinlock_types.h
patching file block/blk-mq.c
Hunk #1 succeeded at 1552 (offset -14 lines).
patching file crypto/testmgr.c
patching file drivers/block/zram/zram_drv.c
patching file drivers/block/zram/zram_drv.h
patching file drivers/char/tpm/tpm_tis.c
patching file drivers/firmware/efi/efi.c
patching file drivers/gpu/drm/i915/display/intel_crtc.c
patching file drivers/gpu/drm/i915/gt/intel_breadcrumbs.c
Hunk #1 succeeded at 318 (offset 7 lines).
patching file drivers/gpu/drm/i915/gt/intel_context.h
Hunk #1 succeeded at 127 (offset -36 lines).
patching file drivers/gpu/drm/i915/gt/intel_context_types.h
Hunk #1 FAILED at 112.
1 out of 1 hunk FAILED -- saving rejects to file drivers/gpu/drm/i915/gt/intel_context_types.h.rej
patching file drivers/gpu/drm/i915/gt/intel_engine_pm.c
patching file drivers/gpu/drm/i915/gt/intel_execlists_submission.c
Hunk #1 FAILED at 1286.
Hunk #2 FAILED at 1386.
Hunk #3 FAILED at 1412.
Hunk #4 FAILED at 1574.
Hunk #5 succeeded at 1578 (offset -22 lines).
Hunk #6 succeeded at 2370 (offset -65 lines).
4 out of 6 hunks FAILED -- saving rejects to file drivers/gpu/drm/i915/gt/intel_execlists_submission.c.rej
patching file drivers/gpu/drm/i915/i915_irq.c
patching file drivers/gpu/drm/i915/i915_request.c
Hunk #1 FAILED at 559.
Hunk #2 FAILED at 668.
2 out of 2 hunks FAILED -- saving rejects to file drivers/gpu/drm/i915/i915_request.c.rej
patching file drivers/gpu/drm/i915/i915_request.h
Hunk #1 succeeded at 594 (offset -15 lines).
patching file drivers/gpu/drm/i915/i915_trace.h
Hunk #2 FAILED at 823.
1 out of 2 hunks FAILED -- saving rejects to file drivers/gpu/drm/i915/i915_trace.h.rej
patching file drivers/gpu/drm/i915/i915_utils.h
patching file drivers/i2c/busses/i2c-cht-wc.c
patching file drivers/i2c/i2c-core-base.c
Hunk #1 succeeded at 1520 (offset 98 lines).
patching file drivers/leds/trigger/Kconfig
patching file drivers/md/raid5.c
Hunk #1 succeeded at 2217 (offset -1 lines).
Hunk #2 succeeded at 2278 (offset -1 lines).
Hunk #3 succeeded at 7104 (offset -8 lines).
patching file drivers/md/raid5.h
patching file drivers/mfd/ezx-pcap.c
can't find file to patch at input line 1896
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:

|diff --git a/drivers/misc/hi6421v600-irq.c b/drivers/misc/hi6421v600-irq.c
|index 08535e97ff43..0585a5821d05 100644
|--- a/drivers/misc/hi6421v600-irq.c
|+++ b/drivers/misc/hi6421v600-irq.c

File to patch:

Thanks in advance

@RobertWilbrandt
Copy link
Contributor

I now also verified this with the rt kernel patch version you used:

wget https://cdn.kernel.org/pub/linux/kernel/projects/rt/5.15/patch-5.15.79-rt54.patch.xz
wget https://cdn.kernel.org/pub/linux/kernel/projects/rt/5.15/patch-5.15.79-rt54.patch.sign
wget https://www.kernel.org/pub/linux/kernel/v5.x/linux-5.15.79.tar.xz
wget https://www.kernel.org/pub/linux/kernel/v5.x/linux-5.15.79.tar.sign

# Verification skipped for brevity

xz -dk patch-5.15.79-rt54.patch.xz
xz -d linux-5.15.79.tar.xz
tar xf linux-5.15.79.tar

cd linux-5.15.79
xzcat ../patch-5.15.79-rt54.patch.xz | patch -p1

This ran through without any problems. If this does not work for you, please also show the exact command you used to arrive at this error.

@marioesteban11
Copy link
Author

Hi @RobertWilbrandt , I've just made the commands until the 'xzcat ../patch-5.15.79-rt54.patch.xz | patch -p1'. But when I continue following the steps, some problems appear.

Next step is 'make oldconfig' that I can choose the Fully Preemptible Kernel as its mention in the kernel, but after that, it shows me several question/options, that I dont really know what to choose. I choose yes in all this questions, but in the following step, which is: make -j getconf _NPROCESSORS_ONLN deb-pkg this error appears:

make[2]: *** [debian/rules:7: build-arch] Error 2
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2
make[1]: *** [scripts/Makefile.package:77: deb-pkg] Error 2
make: *** [Makefile:1608: deb-pkg] Error 2

@RobertWilbrandt
Copy link
Contributor

I could reproduce this error. If you scroll further up in the output you will probably see that this is a problem with trusted keys. To overcome this i did the following:

[ Setup as before]
make oldconfig
scripts/config --set-str SYSTEM_TRUSTED_KEYS ""
scripts/config --set-str SYSTEM_REVOCATION_KEYS ""
make -j `getconf _NPROCESSORS_ONLN` deb-pkg  # Accept defaults for key generation

Make sure to also install

sudo apt install dwarves

before doing this, as this is needed in the final step of the process.

Could you please check if this works for you?

@fmauch fmauch added the solution proposed A solution has been proposed label Nov 30, 2022
@marioesteban11
Copy link
Author

Until, those steps, it seems to work perfectly. But I try to install the deb files:

A fter building, install the `linux-headers` and `linux-image` packages in the parent folder (only
the ones without the `-dbg` in the name)

bash
linux-4.14.139$ sudo apt install ../linux-headers-4.14.139-rt66_*.deb ../linux-image-4.14.139-rt66_*.deb

This error shows up:

Download is performed unsandboxed as root as file '/home/marioest/rt_kernel_build/linux-libc-dev_5.15.79-rt54-1_amd64.deb' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)

@fmauch
Copy link
Contributor

fmauch commented Dec 2, 2022

Could you please try

sudo dpkg -i ../linux-headers-4.14.139-rt66_*.deb ../linux-image-4.14.139-rt66_*.deb

@VinDp
Copy link
Contributor

VinDp commented Feb 12, 2024

Since some time is passed and there are no updates, I will close this issue. Feel free to reopen if relevant.

@VinDp VinDp closed this as completed Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
solution proposed A solution has been proposed
Projects
None yet
Development

No branches or pull requests

4 participants