Skip to main content
SigmaPrime
Associate III
December 4, 2020
Solved

How To apply patches when installing the kernel? (Developer Package)

  • December 4, 2020
  • 1 reply
  • 3992 views

Hello Everyone

I am using the README.HOW_TO.txt file to install the kernel. IN section 3 it is stated that I must apply some patches:

1-Section 3 patch application

if there is some patch, please apply it on source code
 $> for p in `ls -1 *.patch`; sudo do patch -p1 < $p; done
 
mehdi@LAPTOP-CP6QP7G9:~/DevPack/stm32mp1-openstlinux-5-4-dunfell-mp1-20-11-12/sources/arm-ostl-linux-gnueabi/linux-stm32mp-5.4.56-r0$ for p in *.patch; do sudo patch --strip=1 < $p; done
can't find file to patch at input line 16
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|From 4556074b66971918536ed27d52f5f4f6337f0646 Mon Sep 17 00:00:00 2001
|From: Lionel VITTE <lionel.vitte@st.com>
|Date: Mon, 5 Oct 2020 13:19:40 +0200
|Subject: [PATCH 01/22] ARM-stm32mp1-r2-rc8-MACHINE
|
|---
| arch/arm/kernel/time.c | 2 ++
| arch/arm/mach-stm32/Kconfig | 1 +
| arch/arm/mach-stm32/board-dt.c | 2 ++
| 3 files changed, 5 insertions(+)
|
|diff --git a/arch/arm/kernel/time.c b/arch/arm/kernel/time.c
|index b996b2cf07038..dddc7ebf4db44 100644
|--- a/arch/arm/kernel/time.c
|+++ b/arch/arm/kernel/time.c
--------------------------
File to patch: 0018-ARM-stm32mp1-r2-SOUND.patch
patching file 0018-ARM-stm32mp1-r2-SOUND.patch
Hunk #1 FAILED at 9.
Hunk #2 FAILED at 107.
2 out of 2 hunks FAILED -- saving rejects to file 0018-ARM-stm32mp1-r2-SOUND.patch.rej
can't find file to patch at input line 35
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/arch/arm/mach-stm32/Kconfig b/arch/arm/mach-stm32/Kconfig
|index 57699bd8f1075..8f9fd1da9ea05 100644
|--- a/arch/arm/mach-stm32/Kconfig
|+++ b/arch/arm/mach-stm32/Kconfig
--------------------------

How do I do that ? Can you give me an example?

I am working in the following directory which contains patches that I will link in a picture.

Directory :

~/DevPack/stm32mp1-openstlinux-5-4-dunfell-mp1-20-11-12/sources/arm-ostl-linux-gnueabi/linux-stm32mp-5.4.56-r0

0693W000006EdLjQAK.png----------------------------------------------------------------------------------------------------------------------------------

2- section 4: have a better management of the kernel

Now coming to section 4 of the .txt file. It is written that I have to:

test -d .git || git init . && git add . && git commit -m "new kernel" && git gc

But I get the following error even with sudo:

/home/mehdi/DevPack/stm32mp1-openstlinux-5-4-dunfell-mp1-20-11-12/sources/arm-ostl-linux-gnueabi/linux-stm32mp-5.4.56-r0/.git: Permission denied

Best regards :grinning_face:

This topic has been closed for replies.
Best answer by Olivier GALLIEN

Hi @SigmaPrime​ ,

Are you using a git repository now ?

You have to choose one way of working : either from web source package using patch -p1 or either using git repository and git am $p

Can you please clarify ?

Olivier

1 reply

Olivier GALLIEN
Technical Moderator
December 4, 2020

Hi @SigmaPrime​ ,

You need to be in subdirectory linux-5.4.56 ( where are located source on which patch applied and call following command :

$>for p in `ls -1 ../*.patch`; do patch -p1 < $p; done

Olivier

Olivier GALLIEN In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
SigmaPrime
Associate III
December 4, 2020

What an error of mine... I was confused when I read directory to kernel source code.

Works fine thanks