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

learn more… | top users | synonyms

0
votes
1answer
39 views

How do I add to a unified patch file?

If I have a patch file in the unified patch format like the example below, how do I add lines to it so that those lines are then added by the (applied) patch? --- lao 2002-02-21 23:30:39.942229878 -...
8
votes
3answers
6k views

When patching what's the difference between arguments -p0 and -p1?

What's the difference between patch -p0 and patch -p1? Is there any difference at all?
8
votes
4answers
5k views

Running “patch” without generating *.orig and *.rej files

Is it possible to tell patch not to generate .orig and .rej files? I find it extremely annoying that patch creates these.
0
votes
1answer
14 views

Applying RT_PREEMPT

I'm trying to install a kernel with the RT_PREEMPT patch on a Lubuntu 16.04 distro and running into some issues I'm not sure how to deal with. I've downloaded the sources for kernel v4.4.12 (linux-4.4....
0
votes
1answer
54 views

After updating the Red Hat server kernel to latest version it still shows as old version

I have updated the kernel on my Red Hat Enterprise Linux Server release 6.7 (Santiago) from 2.6.32-573.22.1.el6.x86_64 to 2.6.32-642.1.1.el6.x86_64 and as per Red Hat documentation https://access....
4
votes
1answer
7k views

Can’t find file to patch at input line 3 [duplicate]

I generated a patch using the diff command with the number of context lines as 1 (-c option). My patch file contents: *** /home/sk/abc/def/src/klm/a.py 2015-05-18 16:25:50.348398554 +0530 --- /opt/...
2
votes
1answer
18 views

How to find a specific patch for a kernel file

I've been debugging an issue in my linux kernel and have found a fix for the issue. Checking cross reference, I can see that the fix was applied to that file between kernel version A and kernel ...
0
votes
1answer
56 views

Linux red-hat + kernel patch update

I need to run the yum update on my Linux redHat machine during the yum update , I sow that yum perform some patch kernel update therefore I little worry to perform a reboot , because the patches of ...
1
vote
0answers
46 views

A patch that doesn't contain line numbers, is it possible?

I would add two lines of text to a file if they don't exist there yet. The lines can be in various positions in that file. So a regular patch will rather not work. Can there be a simplified patch, ...
0
votes
0answers
32 views

Identifying cumulative patch version in Jboss

We are trying to identify the patch level that is applied to our Jboss servers. For Jboss 4, the information is available in boot.log as follows 09:44:51,674 INFO [Server] Release ID: JBoss [EAP] ...
5
votes
2answers
451 views

How to create a patch ignoring indentation differences in the code?

I'm trying to create patch a file using diff tool.But facing an issues.The way I am doing is below. I've created one Directory named a and put original file in to it. a/original_file.c Now I have ...
0
votes
1answer
21 views

Applying a single patch to files in multiple directories

Directory structures looks like this: orig/l1/l2/file2patch orig/l1-2/file2patch Diff'd with new/l1/l2/file2patch new/l1-2/file2patch I get the correct diff between these files and save it in a ...
3
votes
1answer
3k views

How to fix “Hunk #1 FAILED at 1 (different line endings)” message?

I am trying to create a patch with the command git diff sourcefile >/var/lib/laymab/overlay/category/ebuild/files/thepatch.patch when I apply the patch, it gives me $ patch -v GNU patch 2.7.5 ...
10
votes
1answer
151 views

Display only relevant hunks of a diff/patch based on a regexp

git log -G<regex> -p is a wonderful tool to search a codebase's history for changes that match the specified pattern. However, it can be overwhelming to locate the relevant hunk in the diff/...
2
votes
3answers
3k views

How can I know if patch command is working?

I am trying to apply a patch that is provided by the seek-for-android project to code I downloaded from Cyanogenmod. The code compiled successfully with make, so I know all the files are there. I just ...
1
vote
1answer
139 views

patch: “bad file descriptor” in combination with pipe and LD_PRELOAD/ libtrash

Very short summary: cat "$file" | patch produces a Bad file descriptor-error, but patch < "$file" works, when libtrash is preloaded with LD_PRELOAD, and only on bigger projects. Description: For ...
1
vote
3answers
36 views

diff without including removed content

I'm using diff and patch to patch some files. In my situation, I am not permitted to distribute any of the original file. Right now, the diffs look something like this: 1c1 < Hello, this is the ...
2
votes
3answers
109 views

Patch a shell script prior to running

I have a shell script (arch-chroot from the Arch Linux arch-install-scripts package) that handles the mounting and unmounting of devices (with error checking) prior to starting a chroot. It starts the ...
0
votes
2answers
34 views

Patching diff-files

I've downloaded a tarballed version of 0.85 "MTR" -> http://www.bitwizard.nl/mtr/ and installed it. I later saw that a 0.86 diff file exists. I downloaded this in order to patch it, but am confused ...
-3
votes
1answer
66 views

What does root directory mean? [closed]

What does it means when they say "Move into the root directory of the kernel you wish to patch" please explain me in detail cause I'm new to this environment.
9
votes
3answers
8k views

Check if a file or folder has been patched already

Is it possible to know if a file has been patched already, before apply the patch? I need to do this in a script, any thoughts?
2
votes
1answer
49 views

Using dkms to patch kernel

I need to apply a kernel patch(https://lkml.org/lkml/2015/3/31/929) to get my touch-pad working properly. I am thinking that I should be using dkms, to do this. Most of the stuff I am reading is about ...
4
votes
3answers
359 views

How to make and apply (patch) one side diff?

I want to make a shell script that updates a config file. The file present on the server has information, like various IP addresses. The new file has more code, from new configs added to the system, ...
1
vote
2answers
112 views

Packaging a directory and its contents as a diff patch?

I have a small project folder with text files, which I'd like to post somewhere in order to ask a question on a forum. Let's take, in the simplest case, that I have something like this: mkdir aaa cd ...
0
votes
1answer
138 views

How to write a Patch for VyOS kernel

I am new to VyOS development. I have written a patch which will fetch info from the VyOS kernel module and write it on a netlink socket. But the problem is I am not sure if I should edit the kernel ...
2
votes
0answers
42 views

Patching using multiple independent patch files?

I'm naïve vis-à-vis patch and unified diffs. I have a C source file that needs two independent patch files applied. In other words, file Frodo.patch contains Frodo-specific patches; file Bilbo.patch ...
1
vote
0answers
22 views

How to make patch not so strict?

To give you the background, I'm trying to "port" "commit only parts of hunks" workflow from git to svn. In git there is interactive staging, and you can even edit hunks to be committed (chose which ...
0
votes
1answer
44 views

changed df -h output format after yum update in rhel6.5

changed df -h output after yum update (after patching). Anybpdy help on this ? Anybody knows the reason behind this ? df -h output before yum update (rhel patching) : Filesystem ...
0
votes
0answers
15 views

How To Patch Bugs Manually in Software [duplicate]

We have been experiencing issues with winbind on our servers and I found a thread on Bugzilla regarding a bug which sounds much like the issue we are experiencing. Throughout the discussion, the ...
2
votes
2answers
38 views

How can I get FreeBSD `patch` to tolerate null bytes?

The patch of the final line fails on FreeBSD 10.2, but works on GNU: #!/bin/sh echo a > f1 printf '\0' >> f1 echo c >> f1 cp f1 f2 echo d >> f2 diff -au f1 f2 > diff patch <...
2
votes
1answer
337 views

How to apply simple patch (reverse detected)

I'm trying to create and apply a simple patch to fix a bug with gradle. I copy the file (/usr/bin/gradle) to my working directory, then make the change. I then create the patch: diff -u /usr/bin/...
0
votes
2answers
46 views

A question about patch

I did a patch file with diff -Naur src/bacula.h src/bacula.h.old and give me a file like this --- src/bacula.h 2015-08-13 15:52:24 +0200 +++ src/bacula.h 2015-10-05 19:21:09 +0200 @@...
2
votes
2answers
319 views

Applying a diff patch

I've never patched anything in Linux, and I can't exactly figure out what the guy who wrote this post (second paragraph) means. That target source is qemu from github and the changes to apply are: ...
11
votes
3answers
6k views

How do I get a linux kernel patch set from the mailing list?

I don't subscribe to the linux-kernel mailing list, but I want to get a set of patches that were posted a few weeks ago and apply them to my kernel for testing. I'm very familiar with patching, ...
17
votes
5answers
2k views

Why use diff/patch when it is easier to just use cp

diff -u file1.txt file2.txt > patchfile creates a patch file which consists of instruction for patch to convert file1.txt to be exactly like file2.txt As the title says, Can't this be done using ...
1
vote
1answer
167 views

How download complete patch series from patchwork?

I want to download the patch series RFC PATCH 00/26 i.MX5/6 IPUv3 CSI/IC In patchwork I can get access to individual patches https://patchwork.linuxtv.org/patch/24331/. But downloading 26 patches and ...
0
votes
0answers
138 views

scripts/checkpatch.pl: Warning: consider using a completion

I'm currently writing a kernel driver that involves moving large amounts data from userspace to or from a peripheral, via a ring of bounce buffers. The buffer completion callback ups a semaphore, and ...
3
votes
0answers
69 views

Patching X11 to remove SELECTION clipboard

How would I patch the X11 source to disable or remove the SELECTION clipboard?
3
votes
0answers
43 views

Kernel config diffs - better way to maintain

I maintain one Linux distro (LEAF) with multiple kernel targets, so it needs to have multiple kernel configs (one reference config + usual patch files for other targets). But this adds headache on ...
26
votes
2answers
3k views

Patching a binary with dd

I have read this quote (below) several times, most recently here, and am continually puzzled at how dd can be used to patch anything let alone a compiler: The Unix system I used at school, 30 ...
0
votes
1answer
241 views

Suse: How to update a single package in SLES10 SP4

I am in the middle of an activity and have never worked with SLES10 SP4 In SLES11 zypper update glibc* update all glibc packages .. but this is not working in SLES10 SP4 .. can someone tell me how to ...
2
votes
0answers
232 views

Fetch patches from mailing list with mutt and vim

How can I fetch patches from a subscribed development mailinglist with mutt and vim so that they can be applied with "git am" or "git apply" command easily? Is it either possible to save it ...
2
votes
1answer
245 views

Linux kernel patches: can I skip some?

I have the source of Linux 3.4.0 to which I added some modifications. I know that here (ftp://ftp.kernel.org/pub/linux/kernel/v3.x/) I can find all the 107 patches that need to be applied to my source ...
2
votes
1answer
270 views

How do I apply a patch?

I need to apply the following patch, and I don't want to mess up what I have so far. Below I have posted the complete content I found online, which was someone's response to a question similar to mine....
0
votes
1answer
946 views

Linux Kernel Live Patching - WHATIS and HOWTO? [closed]

I am trying to understand a new concept I got to know recently as the Linux 4.0 makes it way to the mainline - "Live Patching". Supposedly this is a new feature enhancement of the Linux kernel. It ...
1
vote
1answer
445 views

Using filterdiff to exclude a diff

I have a big patch (foo), consisting of diffs from many files. I want to exclude a specific diff (corresponding to a single file) from this patch. The beginning of this diff looks like this: diff --...
1
vote
0answers
154 views

Source code of the patches for Shellshock

I have a project for my grad level OS class, and I have decided to choose the Shellshock vulnerability bugs as my topic. There is a lot of great information out there, but I was curious if it is ...
0
votes
1answer
77 views

Unified Patch: only use diff file

Is it possible to create a diff file that would work without having the actual files in the diff file? e.g.: I have a folder /a and a copy of a: /b. In /b I edit multiple files and create a .diff ...
2
votes
1answer
4k views

How to apply a patch correctly?

I am trying to patch a linux 3.13.7 source tree to 3.13.8 using the patch-3.13.8.xz file. Since the patch file is in xz format, I used the following command to apply it while in the source tree: unxz ...
0
votes
1answer
99 views

Patch: auto answer no

Suppose patch tell me Assume -R? [n] in already patched source Is there a way to say n no automatically? I can use yes n|patch but i prefer a more clean solution