Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [patch]

A patch is file used to alter a source code package, e.g. in order to correct a bug or add a feature.

Filter by
Sorted by
Tagged with
0 votes
0 answers
46 views

Yocto, bitbake - how to remove unwanted hunks in the patch file

I am trying to bitbake system for seedStudio odyssey board. I got into problems applying patches CmdError('quilt --quiltrc /home/seed-studio/STM/Distribution-Package/build-openstlinuxweston-stm32mp1/...
gulpr's user avatar
  • 101
0 votes
1 answer
34 views

Getting SLES RMT Server IP or hostname from client

We have multiple RMT Servers for patching SLES servers in our environment, how can we check which rmt server is the client currently registered to. Currently we check the baseurl of repo file. Is ...
Ritesh Vishwakarma's user avatar
0 votes
0 answers
21 views

Using dkms's PATCH_MATCH to patch module code for kernels newer than 5.15

DMKS has the option to patch module code for kernels matching a particular regex. The manpage isn't very clear but digging around a bit confirms that the general syntax is: PATCH[0]="patch-foo....
RJVB's user avatar
  • 254
0 votes
1 answer
34 views

Force Patch character differences to a file

Hello, I have an englishStrings.json file and when I make new edits/ additions to it, I need to copy the new changes to all the other language string.json files. Before making any changes to ...
Freezer Fridge's user avatar
0 votes
1 answer
133 views

How to Patch and Compile Linux Kernel for a specific issue? (No sound in HP ENVY x360 2-in-1 Laptop 15-ey0xxx)

I got the exact same problem as the person here: HP Envy x360 2022 Ryzen edition speakers not working and I want to patch and recompile my kernel with: https://lore.kernel.org/lkml/20220811053950....
Daniel Koch's user avatar
0 votes
1 answer
139 views

What is the purpose of timestamps in unified diffs?

An Example of Unified Format: --- lao 2002-02-21 23:30:39.942229878 -0800 +++ tzu 2002-02-21 23:30:50.442260588 -0800 @@ -1,7 +1,6 @@ -The Way that can be told of is not the eternal Way; -The name ...
Flux's user avatar
  • 2,958
0 votes
0 answers
225 views

Patch malformed error

patch: **** malformed patch at line 225: diff --git the line 225 is this one : diff --git a/files/etc/Compile_info.txt b/files/etc/Compile_info.txt I have a many patches in one file patch and I ...
James78's user avatar
  • 145
2 votes
2 answers
625 views

How to apply a patch as part of a pipe? In other words, how to patch stdin?

I want to apply a unified diff from mypatch.diff to stdin and output the result to stdout. So far, I have tried: patch -i mypatch.diff -o - -u originalfile Which successfully applies mypatch.diff and ...
finefoot's user avatar
  • 3,102
1 vote
1 answer
606 views

Applying patch file to ubuntu server

Can someone please explain how to apply a patch file to ubuntu server kernel? I'm trying to apply this patch file which enables the tcp_collapse_max_bytes option in the TCP communication options on an ...
Erfan's user avatar
  • 11
1 vote
0 answers
132 views

Patch compressed file

is there any way to patch a file, that is compressed via gzip without decompressing it first? I tried patch -n <(gzip -d file.gz) patch_to_file.diff > new_file but I only got patch: **** Can't ...
ninjulian's user avatar
1 vote
1 answer
127 views

Automated patching of packages on upstream updates

Is there a way to automatically merge custom patches to upstream packages when they update? From what I gathered so far modifying source code requires you to maintain a separate fork of packages that ...
Daniel Krajnik's user avatar
0 votes
1 answer
319 views

patch command output `patch unexpectedly ends in middle of line`

I am attempting to script diff and patch commands. Facing some warning like this if bzcat is used # bzcat consolidated.patch.tar.bz2 | patch -d dev -p1 patch unexpectedly ends in middle of line ...
Kamath's user avatar
  • 615
0 votes
1 answer
371 views

How to apply a patch containing with absolute file path names?

I'd like to apply this generated patch but the patch command is asking me for a file path name : administrator@server:~$ diff -Nau /etc/php/8.1/fpm/pool.d/www.conf /etc/php/8.1/fpm/pool.d/www.NEW.conf ...
SebMa's user avatar
  • 2,189
0 votes
1 answer
397 views

How do I prevent "patch" from creating backup files with a tilde at the end?

I am running diff and patch like this: diff --unified --ignore-space-change old.txt new.txt > changed.patch patch --version-control=none third.txt changed.patch The --version-control=none is ...
opticyclic's user avatar
0 votes
0 answers
81 views

Extracting from patch lists only those possibly relevant (with regards to a given install)

I am used to downloading very dense changelogs like this one (linux-5.4.211 log), this in order to carefully decide for each change if it is pertinent on some system of mine or not. (*1) Of course, ...
MC68020's user avatar
  • 8,211
0 votes
0 answers
26 views

How to patch source code tree from within the dir to be modified?

A source code tree contains a modified dnsmasq-2.80test4 source (and git files). Now I'd like to apply the newest 2.86 dnsmasq source code to that modified 2.80test4 using diff and patch, while ...
Pro Backup's user avatar
  • 4,944
0 votes
1 answer
258 views

patch without reject

This might be answered already but it is hard to search for -- basically, When patch find a block/hunk unable to apply, it will reject the changed hunk into reject file. How not to put the conflicts ...
xpt's user avatar
  • 1,614
1 vote
0 answers
42 views

Live kernel patching in ubuntu

I am trying to see the advantages & disadvantages of live kernel patching over a newly built kernel with intended patches. I read live kernel patching uses ftrace's framework. Since ftrace keep ...
Franc's user avatar
  • 299
0 votes
1 answer
159 views

Patch 2nd Linux kernel: "module is in use"

how to patch kernel with a DKMS module if the module is 'in use'? The Kernel which should be used to get patched is not the one which is actual running on this machine. (uname -r) It is about hpsa ...
bime3's user avatar
  • 1
2 votes
0 answers
138 views

How to use the output of wdiff (per word diff) to patch a file?

Is it possible to use the output of wdiff (per word diff) to patch a file? I have a file with not only word changes but also added/removed newlines. I can use wdiff to view the word changes. But can I ...
tinlyx's user avatar
  • 788
1 vote
1 answer
252 views

removing last patching kernel

I build openwrt firmware and I just used a pr (patch kernel update) with patch -p1 < filename.patch and I want to remove to reapply a new one, what would be the best? thank you
James78's user avatar
  • 145
1 vote
1 answer
13k views

How to resolve error about patching, hunk failed

I try to add a patch about last kernel and don't know why is not working.. idea? thanks openwrtt$ patch -p1 < kernel.patch patching file include/kernel-version.mk Hunk #1 FAILED at 7. 1 out of 1 ...
James78's user avatar
  • 145
-1 votes
1 answer
69 views

Makefile: 1037: recipe for target '../src/ap/beacon.o' failed

I am installing hosatpd-wpe as on kali linux rolling 2017.2 follows: wget https://raw.githubusercontent.com/aircrack-ng/aircrack-ng/master/patches/wpe/hostapd-wpe/hostapd-wpe.patch wget https://w1.fi/...
Zac's user avatar
  • 27
1 vote
3 answers
2k views

How to create a patch for renaming a file

Suppose I have a file (myfile.txt) containing this text: The quick brown fox jumps over the lazy dog. I rename this file from myfile.txt to mystory.txt. How do I create a diff that represents this ...
Flux's user avatar
  • 2,958
2 votes
1 answer
15k views

how to show when last time RHEL system was "patched"?

At work we are tasked with (i.e during and inspection or audit) showing when the system was last patched. This is all that is asked. Of course I asked the inspector how do you want me to show you ...
ron's user avatar
  • 6,817
1 vote
1 answer
6k views

How can I apply a patch file to the kernel of my current Linux installation?

I want to apply a patch file to my current Ubuntu install (patch file example). What is the process to properly apply a patch file to my Linux kernel? Do I need to go through the whole process of ...
Jo Sprague's user avatar
0 votes
1 answer
275 views

How can I get a set of patch files that can be applied to increase a Linux version?

I need a method to get a set of patches, that when applied in succession, can take Linux 5.x to Linux 5.y. Here's what I've tried (I would greatly appreciate feedback on why this doesn't work): (...
JBraha's user avatar
  • 173
2 votes
0 answers
62 views

Supplying RDiff Base File Using Pipe Results in Illegal Seek Error

If I run the following rdiff command rdiff patch basefile patchfile outputfile everything works as expected, however, if I try to use stdin to provide the base file like this xz -d -c basefile.xz | ...
Harry Muscle's user avatar
  • 2,537
1 vote
1 answer
10k views

Installing PREEMPT_RT kernel on Ubuntu 20.04

I am trying to install a PREEMPT_RT kernel for my ubuntu distribution as this is a requirement for a robot I am working on. But no matter what I do I get errors when compiling the kernel. I've ...
lutzlook's user avatar
1 vote
2 answers
3k views

Yocto - patch has not been applied

I am working with Linux built with Yocto. I need to add some changes to /etc/ssh/sshd_config file. I created the following patch file using meld: --- a/sshd_config +++ b/sshd_config @@ -116,3 +116,8 @@...
tomi7654's user avatar
3 votes
1 answer
9k views

Kernel patching prompts “Reversed (or previously applied) patch detected! Assume -R? [n]”

I am trying kernel patching for the first time. I am not sure the following is encountered with an error and if I am doing it correctly. But in all tutorials and videos shows, .patch extension files, ...
vjwilson's user avatar
  • 133
2 votes
2 answers
1k views

Ignore certain lines when creating/applying a patch with diff/patch?

File A Apples Bananas Clementines Dates File B Apples Blueberries Cherries Dates I want to diff A and B to generate a patch that when applied to C will change the line Clementines > Cherries but ...
Benjamin Higgins's user avatar
0 votes
1 answer
188 views

how to diff automatically between file.txt.orig and file.txt

Currently, I am editing files on vim by setting patchmode=.orig and then, having two files: file.txt.orig <- backup without changes file.txt <- update file However, I would like to generate a ...
zanona's user avatar
  • 311
1 vote
0 answers
825 views

Patch unable to find file

I am currently in directory - /usr/lib/llvm-9/build The include/ directory is a symlink - reikdas@reikdas-VirtualBox:/usr/lib/llvm-9/build$ ls -l lrwxrwxrwx 1 root root 10 Jan 31 2020 include -> ../...
Pratyush Das's user avatar
0 votes
1 answer
1k views

Remove window border in dwm monocle layout

I was wondering whether there is some patch to remove the window border in dwm monocle layout, because I really don't want to use "real" fullscreen, but just want to hide the top bar and ...
weisbrja's user avatar
  • 231
0 votes
1 answer
437 views

Rebasing a patch without using git?

I've never used maintained files created with patch and diff. But what is the work flow when the patch drifts? As in this case. I can see the the failures when I do -m in the same format git would ...
Evan Carroll's user avatar
  • 31.3k
1 vote
1 answer
2k views

Using the patch -p option when the new and old contain a different number of subdirectories

I have received a patch that I need to apply, however the filenames make it difficult to predict what -p option to use: --- /home/user/foo/bar/baz.c +++ /data/myproj/project/version/foo/bar/baz.c I'm ...
Brydon Gibson's user avatar
2 votes
1 answer
1k views

Is there a way to hotpatch a kernel in Debian

Is there any equivalent in Debian for hotpatching kernels, similar to kpatch in Red Hat Linux?
john doe's user avatar
  • 846
3 votes
2 answers
1k views

How to patch a debian package?

I have Debian stable and I have found some weird bug which was already fix. The fix were merged into the stable branch which version was gnome-settings-daemon 3.32.1 but I have gnome-settings-daemon 3....
emek's user avatar
  • 53
1 vote
0 answers
144 views

Why does the dd program not work as expecting when patching a binary?

I'm trying to patch a binary using the instructions provided at this answer. Initial setup: wget https://f000.backblazeb2.com/file/altstore/altserver/1_4_1.zip unzip 1_4_1.zip This program basically ...
Saifur Rahman Mohsin's user avatar
5 votes
2 answers
4k views

Can I write comments inside a "normal" diff/patch file?

I used diff to produce a patch file. diff old.txt new.txt: 1c1 < Lorem ipsum dolor sit amet, consectetur adipiscing --- > The quick brown fox jumps over the lazy dog. The output is in the ...
Flux's user avatar
  • 2,958
1 vote
1 answer
577 views

Patch Multiple Strings in a Binary file

I have a binary file type (many instances of these files) where I would like to replace the string "DC-GX850" with "DMC-GX95". Fortunately the two strings are of equal length. The ...
Eric Valk's user avatar
0 votes
2 answers
710 views

DWM Gaps not aligned

is there a way I can fix this? If you check it a little closely, you can see that firefox actually goes a little bit under the terminal and I really don't like it. I am using DWM with vanity-gaps. ...
deomanu01's user avatar
7 votes
1 answer
798 views

Can `patch` be idempotent?

Can patch be invoked with idempotency; i.e., is there some combination of options that will cause repeated invocations of patch to have the same effect as a single invocation of patch (for a non-empty ...
therealneil's user avatar
0 votes
1 answer
66 views

Submitting Linux kernel code

As a semester project I have modified a file of Linux kernel source code (related to memory management), to improve the existing structure. It includes addition of some new functions. But I couldn't ...
BishalKNath's user avatar
0 votes
2 answers
929 views

What RT patch to use for a specific linux kernel version

Running the $uname -r command on my embedded device reveals my kernel to be 4.14.73-ltsi (it is a custom Linux kernel built for an embedded device). Now I intend to install the real time (RT) patch ...
bobbydev's user avatar
  • 101
0 votes
1 answer
399 views

Can patches on different files be a part of a single patch series?

Do patches on different files qualify as a patch series? I made 5 patches in total, 3 of which are changes to 3 different files, and 2 of which are changes to another single file. I assume that the 2 ...
thatbangaloreanguy's user avatar
3 votes
1 answer
4k views

Error 24 : Write error : cannot write compressed block

I'm using Ubuntu 20.04 LTS Server and re-complied whole kernel with my patches. Now at the stage of installing it, but when I runs sudo make install I'm seeing following error, root@localhost:/home/...
sqlbie's user avatar
  • 49
-1 votes
1 answer
3k views

Patch CentOS 8 with Microsoft exFAT source Code, Linux Kernel 5.x,

I'm interested on extract original code of Microsoft exFAT File System, and Compile it into my CentOS 8 (I know its the Kernel is very delayed to 5.4 or 5.7 version). I know the existence of https://...
joseluisbz's user avatar
3 votes
0 answers
187 views

Patch apply at wrong location

I'm attempting to create a set of patch files that i can quickly apply on demand to add or remove alias to .bashrc. To arcive this i added a section for alias in .bashrc after the line # alias and ...
jNull's user avatar
  • 339

1
2 3 4 5