Unix & Linux Stack Exchange
Q&A for users of Linux, FreeBSD and other Unix-like operating systems
Latest Questions
-1
votes
1
answers
32
views
patch fails on unified diff, but works fine with context diff
I am struggling with understanding how `diff` and `patch` are supposed to work. Here's my use case: I use Betterfox user.js config file for my Firefox profile, but I add some overrides to it. I want to save my overrides to a patch file and apply it every time I download a new user.js. Sounds simple...
I am struggling with understanding how
diff
and patch
are supposed to work. Here's my use case: I use Betterfox user.js config file for my Firefox profile, but I add some overrides to it. I want to save my overrides to a patch file and apply it every time I download a new user.js. Sounds simple enough, so I do the following:
1. Download user.js from GitHub
2. Create a copy of it under user.js.orig
3. Edit user.js to add my overrides
4. Run diff -U6 user.js.orig user.js > user.js.patch
- I've chosen unified diff because it's the format I'm more familiar with from Git
- I've chosen the context size of 6 because it includes a bit more context that is not supposed to change (file section headers)
5. To apply the patch, I run `patch user.js user.js.diff
# some time later...
rm user.js && wget https://github.com/yokoffing/Betterfox/raw/refs/tags/140.0/user.js
PATCH_VERBOSE=1 patch user.js user.js.diff` works just fine. Aren't those supposed to be two ways of conveying the same diff? Why does a context diff work, but a unified one doesn't?
**EDIT:** I forgot to specify what software I'm using. I am on macOS 13.7.6 Ventura, and I am using stock /usr/bin/diff
and /usr/bin/patch
, both claim to be “compliant with the IEEE Std 1003.1-2008 (‘POSIX.1’) specification”
Nikita Karamov
(99 rep)
Jul 26, 2025, 12:58 PM
• Last activity: Jul 26, 2025, 08:16 PM
0
votes
0
answers
22
views
Blackmagic Module Patches for Fedora do not work on Arch Linux
I am trying to get my Blackmagic Quad HDMI Recorder working on Arch Linux. Since rebooting after the first installation, the device was never recognized by Blackmagic Software on Arch, while it continues to work on Windows. I suspect that this has to do with [the latest version of Desktop Video not...
I am trying to get my Blackmagic Quad HDMI Recorder working on Arch Linux. Since rebooting after the first installation, the device was never recognized by Blackmagic Software on Arch, while it continues to work on Windows. I suspect that this has to do with [the latest version of Desktop Video not released for Windows.](https://www.blackmagicdesign.com/support/family/capture-and-playback)
A Fedora user created module patches for the [blackmagic](https://forum.blackmagicdesign.com/viewtopic.php?f=12&t=223633) and [blackmagic-io modules](https://forum.blackmagicdesign.com/viewtopic.php?f=12&t=215626) , but they failed on my PC.
> lspci | grep Blackmagic
05:00.0 Multimedia video controller: Blackmagic Design DeckLink Quad HDMI Recorder
> lsmod | grep blackmagic
blackmagic794624 0
blackmagic_io2424832 4
> dkms status -m blackmagic -k uname -r
blackmagic/14.4.1a4, 6.15.6-arch1-1, x86_64: installed
> dkms status -m blackmagic-io -k uname -r
blackmagic-io/14.4.1a4, 6.15.6-arch1-1, x86_64: installed
> sudo modprobe blackmagic-io
> sudo dkms build -m blackmagic -v 14.4.1a4
Module blackmagic/14.4.1a4 already built for kernel 6.15.6-arch1-1 (x86_64), skip. You may override by specifying --force.
> sudo dkms build -m blackmagic-io -v 14.4.1a4
Module blackmagic-io/14.4.1a4 already built for kernel 6.15.6-arch1-1 (x86_64), skip. You may override by specifying --force.
> cd /usr/src/blackmagic-io-14.4.1a4/
> sudo patch sudo patch cd ../blackmagic-14.4.1a4/
> sudo patch sudo dkms install -m blackmagic-io -v 14.4.1 --all
Error! The action install does not support the --all parameter.
BlackMagic's FAQ in their Linux installer:
>
> * How do I update the firmware on a device?
>
> The device's firmware can be updated with the BlackmagicFirmwareUpdater.
> See the man page for instructions and examples on how to use the utility.
>
> * The driver crashed my system
>
> Look for kernel output messages in dmesg and /var/log/messages.
>
> * The package installed, but the driver was not loaded
>
> Try the following command:
>
> # dkms status -m blackmagic-io -k uname -r
>
> If the status is 'installed', then the module is installed, but probably
> not loaded. It can be loaded with the following command:
>
> # sudo modprobe blackmagic-io
>
> If the status is 'added', then the module failed to build. You can issue
> the following command to manually run the build and use the output to
> determine the problem.
>
> # sudo dkms build -m blackmagic-io -v 14.4.1
>
> The full module version number is in the form 14.4.1aXX. This module number
> can be found by running dkms status.
>
> A common cause is a version mismatch between the installed kernel image,
> and the kernel source/headers. If they do not match, simply bring either
> the source/headers or the image version up to date, and reboot your system.
> Once the system is back up, the driver should be built for you at startup.
> The command to install matching headers for your currently running kernel
> on CentOS is:
>
> # sudo yum install "kernel-devel-uname-r == $(uname -r)"
>
> If the status is 'built', then the module has been built, but not
> installed. You can issue the following command to manually install and use
> the output to determine the problem.
>
> # sudo dkms install -m blackmagic-io -v 14.4.1 --all
>
> Legacy Desktop Video products on x86_64 platforms use an older driver.
> Users should build and install this module with the dkms commands above,
> replacing -m blackmagic-io
option with -m blackmagic
.
>
>
> Known Issues
> ------------
>
> * Kernel module fails to install due to CET/IBT
>
> Intel 11th Generation and later CPUs and Linux kernels from version 5.18
> have included an Indirect Branch Tracking (IBT) feature. Linux
> distributions are gradually enabling this kernel feature. For example
> Fedora 40 has enabled it. The Desktop Video kernel module will fail to
> load if both the CPU and distribution support IBT, this will result in
> "(failed)" messages when installing Desktop Video and lines in dmesg such
> as:
> Missing ENDBR: nothing+0x0/0x10 [blackmagic_io]
> and
> kernel BUG at arch/x86/kernel/cet.c:102!
> To work around this, disable IBT by adding ibt=off to the kernel command
> line.
>
> * Performance of Nvidia embedded platforms
>
> Nvidia devices like Jetson may default to a mid-range power/performance
> mode, eg. 30W / "mode 2". When using higher-end video modes that require
> more processing, you may have to increase this setting. Refer to the
> nvpmodel command or other related method in NVidia's documentation.
>
> * Incompatibility with small memory systems
>
> Sufficient memory must be available to the driver to support the number of
> devices installed and their frame buffering requirements. A 64 bit system
> with adequate memory is strongly recommended. In some configurations,
> reserving more memory at boot for vmalloc may be necessary. More memory
> can be allocated by adding 'vmalloc=' option to the kernel command
> line.
>
> e.g. vmalloc=256M
>
> * Driver fails to build against certain version of linux-rt
>
> Some versions of the linux-rt patchset may be incompatible with the
> driver.
>
> * ASPM with some PCI-e cards
>
> Some PCI-e cards (1x lane cards) do not function properly by default when
> ASPM is enabled. When in this state, the device will be listed in lspci
> and the BlackmagicFirmwareUpdater status will report version ff. To work
> around this please add kernel boot parameter "pcie_aspm=off" to your boot
> loader.
>
> * Settings are not saved on some versions of Fedora
>
> This issue is caused by the SELinux policies being incorrect on the
> preferences file. To fix this issue, ensure the policycoreutils-python-utils
> package is installed and run the following commands:
>
> # sudo rm /etc/blackmagic/BlackmagicPreferences.xml
> # sudo semanage fcontext -a -t etc_runtime_t /etc/blackmagic
> # sudo restorecon /etc/blackmagic
Hyunbin Yoo
(175 rep)
Jul 20, 2025, 04:53 AM
0
votes
1
answers
25
views
Debian DSC patch file format has changed and not recognized by dpkg-source
For a long time I receieved some software as a patched set of files and it includes DSC file which was a text file and I run `dpkg-source -x *.dsc` command to extract sources. But this DSC file now is a compressed archive containing lot of folders and files and the command dpkg-source -x fails with...
For a long time I receieved some software as a patched set of files and it includes DSC file which was a text file and I run
dpkg-source -x *.dsc
command to extract sources. But this DSC file now is a compressed archive containing lot of folders and files and the command dpkg-source -x fails with
> dpkg-source: error: syntax error in {}.dsc at line 1: line with
> unknown format (not field-colon-value)
How to override this error? dpkg version is 1.22.20, all archives type support is included, the distro is not Debian-based (Arch).
Also in old text file the first string is Format: 3.0 (quilt)
and in the new archive debian/source/format has the same 3.0 (quilt)
string.
Almaz
(163 rep)
Jun 22, 2025, 10:45 AM
• Last activity: Jun 22, 2025, 11:20 AM
0
votes
1
answers
2443
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*` updates all glibc packages .. but this is not working in SLES10 SP4 .. can someone tell me 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*
updates all glibc packages .. but this is not working in SLES10 SP4 .. can someone tell me how to update a single package in SLES10 SP4
Aditya Pednekar
(173 rep)
May 8, 2015, 09:25 PM
• Last activity: Apr 17, 2025, 10:05 PM
1
votes
1
answers
187
views
Patch line receives error
I have a script and patch that I took somewhere to compile an image (linux build root) and I added some lines and now I got one error during patch, the error is like that: ``` diff --git a/package/base-files/files/bin/config_generate b/package/base-files/files/bin/config_generate index fecf82fcaa..f...
I have a script and patch that I took somewhere to compile an image (linux build root) and I added some lines and now I got one error during patch, the error is like that:
diff --git a/package/base-files/files/bin/config_generate b/package/base-files/files/bin/config_generate
index fecf82fcaa..fff80d6efc 100755
--- a/package/base-files/files/bin/config_generate
+++ b/package/base-files/files/bin/config_generate
@@ -312,10 +312,10 @@ generate_static_system() {
the problem seems to be with the numbers -312,10 +312,10
idea?
thanks
EDIT: here some more info,
during OpenWrt compilation, I want to add some changes automatically, those changes will be in a script, and it will apply the patch in some files.
Ie: that part
generate_static_system() {
uci -q batch <<-EOF
delete system.@system
add system system
set system.@system[-1].hostname='OpenWrt'
set system.@system[-1].timezone='EST5EDT,M3.2.0,M11.1.0'
set system.@system[-1].zonename='America/New York'
set system.@system[-1].ttylogin='0'
set system.@system[-1].log_size='384'
set system.@system[-1].urandom_seed='0'
to:
generate_static_system() {
uci -q batch <<-EOF
delete system.@system
add system system
set system.@system[-1].hostname='james_router2'
set system.@system[-1].timezone='EST5EDT,M3.2.0,M11.1.0'
set system.@system[-1].zonename='America/Toronto'
set system.@system[-1].ttylogin='0'
set system.@system[-1].log_size='384'
set system.@system[-1].urandom_seed='0'
this is a part into a bigger file, in :
package/base-files/files/bin/config_generate b/package/base-files/files/bin/config_generate

James78
(189 rep)
Feb 6, 2025, 01:02 AM
• Last activity: Feb 7, 2025, 11:33 AM
0
votes
1
answers
33
views
How do I change the Subject/Title of patchwork patch?
I have created a patch for the Linux kernel. It can be found at the following website: https://patchwork.kernel.org/project/bluetooth/patch/20250125165804.11486-1-deaner92@yahoo.com/ Unfortunately, I have submitted a typo. Within the comments and replies, there is an advice to change the subject/tit...
I have created a patch for the Linux kernel. It can be found at the following website: https://patchwork.kernel.org/project/bluetooth/patch/20250125165804.11486-1-deaner92@yahoo.com/
Unfortunately, I have submitted a typo. Within the comments and replies, there is an advice to change the subject/title.
I would simply update the title and move on. I don't know how. I have changed the subject in my reply. I have changed the commit message after running
git commit --amend
and it still does not change the subject/title. How can I change the title to remove the typo?
Jeremy
(185 rep)
Jan 27, 2025, 08:21 AM
• Last activity: Jan 27, 2025, 08:28 AM
0
votes
1
answers
125
views
Difference between security and LTS support in Debian
Total newbie here so please bear with me. I have a laptop on which I have installed Debian 11.6 I want to check if my OS has reached EOL. In the official Debian webpage, I see [the following list][1] (screenshot below). My question is "does 11.6 fall into LTS category"? How can I make sure my OS rec...
Total newbie here so please bear with me.
I have a laptop on which I have installed Debian 11.6
I want to check if my OS has reached EOL.
In the official Debian webpage, I see the following list (screenshot below).
My question is "does 11.6 fall into LTS category"?
How can I make sure my OS receiving security updates?

PhantomMenace
(27 rep)
Jan 14, 2025, 12:13 PM
• Last activity: Jan 14, 2025, 12:27 PM
0
votes
0
answers
32
views
How to successfully patch openSSL?
I have a computer with unix and an old binary version of OpenSSL installed (version 1.0.2h). I came across the link below: https://github.com/cloudflare/sslconfig/tree/master and it suggests I could patch my openSSL so I could have the ChaCha20/Poly1305 cipher enabled. I don't know exactly how to do...
I have a computer with unix and an old binary version of OpenSSL installed (version 1.0.2h). I came across the link below:
https://github.com/cloudflare/sslconfig/tree/master
and it suggests I could patch my openSSL so I could have the ChaCha20/Poly1305 cipher enabled.
I don't know exactly how to do this.
I tried executing:
patch
|Date: Fri, 12 Feb 2016 18:25:11 -0800
|Subject: [PATCH] Implementation of draft and RFC versions of CHACHA20-POLY1305
| ciphers
|
|---
| Configure | 48 +-
| Makefile.org | 4 +-
| apps/speed.c | 30 +-
| crypto/chacha20poly1305/Makefile | 97 +++
| crypto/chacha20poly1305/asm/chacha20_avx.pl | 408 +++++++++++
| crypto/chacha20poly1305/asm/chacha20_avx2.pl | 443 ++++++++++++
| crypto/chacha20poly1305/asm/poly1305_avx.pl | 732 ++++++++++++++++++++
| crypto/chacha20poly1305/asm/poly1305_avx2.pl | 984 +++++++++++++++++++++++++++
| crypto/chacha20poly1305/asm/poly1305_x64.pl | 281 ++++++++
| crypto/chacha20poly1305/chacha20.c | 162 +++++
| crypto/chacha20poly1305/chacha20poly1305.h | 79 +++
| crypto/chacha20poly1305/chapolytest.c | 470 +++++++++++++
| crypto/chacha20poly1305/poly1305.c | 287 ++++++++
| crypto/cryptlib.c | 10 -
| crypto/evp/Makefile | 7 +-
| crypto/evp/e_chacha20poly1305.c | 435 ++++++++++++
| crypto/evp/evp.h | 4 +
| ssl/s3_lib.c | 119 ++++
| ssl/ssl.h | 2 +
| ssl/ssl_ciph.c | 60 +-
| ssl/ssl_locl.h | 2 +
| ssl/tls1.h | 28 +
| test/Makefile | 17 +-
| 23 files changed, 4655 insertions(+), 54 deletions(-)
| create mode 100644 crypto/chacha20poly1305/Makefile
| create mode 100644 crypto/chacha20poly1305/asm/chacha20_avx.pl
| create mode 100644 crypto/chacha20poly1305/asm/chacha20_avx2.pl
| create mode 100644 crypto/chacha20poly1305/asm/poly1305_avx.pl
| create mode 100644 crypto/chacha20poly1305/asm/poly1305_avx2.pl
| create mode 100644 crypto/chacha20poly1305/asm/poly1305_x64.pl
| create mode 100644 crypto/chacha20poly1305/chacha20.c
| create mode 100644 crypto/chacha20poly1305/chacha20poly1305.h
| create mode 100644 crypto/chacha20poly1305/chapolytest.c
| create mode 100644 crypto/chacha20poly1305/poly1305.c
| create mode 100644 crypto/evp/e_chacha20poly1305.c
|
|diff --git a/Configure b/Configure
|index 4a715dc..f3ab6cd 100755
|--- a/Configure
|+++ b/Configure
--------------------------
Then it asks me the file to patch.
What should I type in?
mike_s
(11 rep)
Dec 10, 2024, 11:06 PM
1
votes
0
answers
27
views
dh_auto_test Error (Lubuntu)
I am trying to restore typeahead behavior in my file picker by using this tutorial: https://blobfolio.com/2019/restoring-gtk3-typeahead-in-ubuntu-19-10-eoan-ermine/ I got the patch, and the gtk3 source. Once I get to ```sudo dpkg-buildpackage -b``` in the tuturial, it runs for a while and seems to b...
I am trying to restore typeahead behavior in my file picker by using this tutorial: https://blobfolio.com/2019/restoring-gtk3-typeahead-in-ubuntu-19-10-eoan-ermine/
I got the patch, and the gtk3 source. Once I get to
dpkg-buildpackage -b
in the tuturial, it runs for a while and seems to be doing a lot, but eventually it halts with the following errors (I tried twice, error both attempts):
: Leaving directory '/tmp/gtk3/gtk+3.0-3.24.20/debian/build/deb'
make: *** [Makefile:749: check-recursive] Error 1
make: Target 'check' not remade because of errors.
make: Leaving directory '/tmp/gtk3/gtk+3.0-3.24.20/debian/build/deb'
dh_auto_test: error: cd debian/build/deb && make -j12 check VERBOSE=1 -k check -j1 returned exit code 2
make: *** [debian/rules:209: override_dh_auto_test] Error 2
make: Leaving directory '/tmp/gtk3/gtk+3.0-3.24.20'
make: *** [debian/rules:135: binary] Error 2
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2
This is just the final lines of the output, there are probably thousands of lines from the multiple minutes it spent running. I just pasted the last few lines as they seem to be the only lines relevant to why it halted.
What is causing this and how do I resolve it? I have no experience with applying patches or building anything from source, so if possible please give me a hand-holding dumbed down answer.
Alternatively, is there another way to apply the patch instead of using dpkg-buildpackage?
OS: Lubuntu 20.04
Thanks
Shadow
(11 rep)
Jun 20, 2024, 08:31 PM
29
votes
8
answers
27587
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.
Is it possible to tell
patch
not to generate .orig
and .rej
files?
I find it extremely annoying that patch creates these.
TheLegassis
(321 rep)
Sep 25, 2012, 06:50 AM
• Last activity: Mar 16, 2024, 12:45 PM
8
votes
4
answers
6511
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][1] In patchwork I can get access to individual patches https://patchwork.linuxtv.org/patch/24331/. But downloading 26 patches and then applying them one by one gets tedious. Is there a way to download the complete patch serie...
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 then applying them one by one gets tedious. Is there a way to download the complete patch series with patchwork or by other means?
The question https://unix.stackexchange.com/questions/80519/how-do-i-get-a-linux-kernel-patch-set-from-the-mailing-list suggests marc.info and lkml.org for downloading individual patches but I want the whole series at once. How do I do that?
Daniel Näslund
(1932 rep)
Aug 25, 2015, 10:37 AM
• Last activity: Mar 14, 2024, 01:33 PM
7
votes
1
answers
1046
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 diff)?
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 diff)?
therealneil
(984 rep)
Aug 10, 2020, 09:17 PM
• Last activity: Mar 3, 2024, 09:35 AM
0
votes
1
answers
65
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 there any command or alternative?
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 there any command or alternative?
Ritesh Vishwakarma
(7 rep)
Dec 21, 2023, 10:47 AM
• Last activity: Dec 21, 2023, 05:07 PM
0
votes
1
answers
49
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 englishStrings, the englishStrings and otherLanguageStrings have the same keys and same number of...
----------
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 englishStrings, the englishStrings and otherLanguageStrings have the same keys and same number of lines but values differ.
I am trying to do something like this:
git diff -U0 —-word-diff-regex=. —-word-diff=porcelain englishStrings.json > changes.diff
patch frenchStrings.json changes.diff
@@ -4 +4,3 @@
"
+test": "test",
~
+ "
c": "three"
+,
~
+ "edit": "edit"
~
Expecting after patch:
{
"a": "un",
"b": "deux",
"test": "test",
"c": "trois",
"edit": "edit"
}
But patch is currently telling me that the patch file is malformed. Patch probably wont be able to help since line length can differ between English and French Strings but I would be open to recommendations to change up my solution
Freezer Fridge
(3 rep)
Sep 3, 2023, 02:49 PM
• Last activity: Sep 3, 2023, 04:50 PM
7
votes
1
answers
4302
views
How can I run patch through a heredoc in bash?
I'm trying to patch a file like this in bash: cat --- urancid 2017-12-06 09:56:33.000000000 -0600 patch --dry-run > +++ /tmp/urancid 2017-12-06 15:06:57.000000000 -0600 > @@ -393,7 +393,7 @@ > last if (/^$prompt/); > next if (/-ac\.\s*/); > next if (/-fs\.\s*/); > - next if (/set date\s*/) > + next...
I'm trying to patch a file like this in bash:
cat --- urancid 2017-12-06 09:56:33.000000000 -0600 patch --dry-run
> +++ /tmp/urancid 2017-12-06 15:06:57.000000000 -0600
> @@ -393,7 +393,7 @@
> last if (/^$prompt/);
> next if (/-ac\.\s*/);
> next if (/-fs\.\s*/);
> - next if (/set date\s*/)
> + next if (/set date\s*/);
> next if (/^(\s*|\s*$cmd\s*)$/);
> if ( ! /^$prompt/) {
> if ( ! $skipprocess ) {
> EOF
but all I get is
patching file urancid
Hunk #1 FAILED at 393.
1 out of 1 hunk FAILED -- saving rejects to file urancid.rej
Seems like it should be possible, if I cat the patch file I'm pasting it works.
I want to do this so I can make a patch script without including multiple files.
I'm not too familiar with the what "patch" cares about as far, guessing there's some whitespace problems?
Peter Turner
(1734 rep)
Dec 6, 2017, 09:21 PM
• Last activity: Jul 15, 2023, 08:59 AM
0
votes
1
answers
165
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: https://unix.stackexchange.com/q/722205/572281 and I want to patch and recompile my kernel with: https://lore.kernel.org/lkml/20220811053950.11810-1-faenkhauser@gmail.com/ I know there are a bunch of tutorials how to patch and compile the kernel, but...
I got the exact same problem as the person here:
https://unix.stackexchange.com/q/722205/572281
and I want to patch and recompile my kernel with:
https://lore.kernel.org/lkml/20220811053950.11810-1-faenkhauser@gmail.com/
I know there are a bunch of tutorials how to patch and compile the kernel, but I need this specific change that, as I understand, is not officially included in a kernel version. Correct me if I'm wrong. What do I have to do? I don't know how where start and I don't even know how to get the patch from the link.
I use Arch Linux, btw. But I am a newbie.
My Kernel Version: 6.3.1-arch2-1
Daniel Koch
(1 rep)
May 14, 2023, 09:34 PM
• Last activity: May 15, 2023, 05:36 AM
0
votes
1
answers
293
views
What is the purpose of timestamps in unified diffs?
[An Example of Unified Format][1]: ```lang-none --- 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 that can be named is not the eternal name. The Nameless is the origin of Heaven and E...
An Example of Unified Format :
-none
--- 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 that can be named is not the eternal name.
The Nameless is the origin of Heaven and Earth;
-The Named is the mother of all things.
+The named is the mother of all things.
+
Therefore let there always be non-being,
so we may see their subtlety,
And let there always be being,
@@ -9,3 +8,6 @@
The two are the same,
But after they are produced,
they have different names.
+They both may be called deep and profound.
+Deeper and more profound,
+The door of all subtleties!
What is the purpose of the timestamps (e.g. 2002-02-21 23:30:39.942229878 -0800
) that appear after the file names? Are they mandatory? Can I safely remove them? What are the consequences of faking the time (e.g. using a future time)?
Flux
(3238 rep)
May 2, 2023, 10:46 AM
• Last activity: May 2, 2023, 11:04 AM
2
votes
2
answers
1202
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 prints the result to stdout. However, I still have to provide the original file as `originalfile...
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 prints the result to stdout. However, I still have to provide the original file as originalfile
, not via stdin.
And if I try something like:
patch -i mypatch.diff -o - -u -
Then the patch gets rejected:
patching file -
Hunk #1 FAILED at 1.
1 out of 1 hunk FAILED -- saving rejects to file -.rej
finefoot
(3554 rep)
Feb 27, 2023, 04:32 PM
• Last activity: Mar 3, 2023, 11:26 PM
0
votes
0
answers
369
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 added some lines into it, and now I got always the same error at line 225 but I did not to...
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 added some lines into it, and now I got always the same error at line 225 but I did not touch at this line.
diff --git a/files/etc/Compile_info.txt b/files/etc/Compile_info.txt
new file mode 100644
index 0000000000..39635e5046
--- /dev/null
+++ b/files/etc/Compile_info.txt
@@ -0,0 +1,6 @@
+OpenWrt master r19541-852126680e / 2022-04-30 18:04
+---
+main 2022-04-29 8521266 mediatek: mt7629: disable mtk thermal
+luci 2022-04-30 6b3bba3 luci-app-https-dns-proxy: remove redundan
+packages 2022-04-30 cf81132 rclone: Update to 1.58.1
+routing 2022-04-27 20621cf Merge pull request #856 from stintel/bird
Do you see the error?
James78
(189 rep)
Mar 2, 2023, 04:54 PM
• Last activity: Mar 3, 2023, 10:08 AM
1
votes
1
answers
900
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][1] patch file which enables the ```tcp_collapse_max_bytes``` option in the TCP communication options on an ubuntu server. I followed [this][2] answer and tried to apply the ```.patch``` but got t...
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
option in the TCP communication options on an ubuntu server. I followed this answer and tried to apply the .patch
but got the same error.
Here are my steps:
first, I changed the directory to the kernel source folder:
cd /usr/src/linux-headers-5.15.0-58-generic
Then I run the command -p0 ~/file.patch
But I got the following info and it keeps asking me to enter the file to patch
can't find file to patch at input line 44
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
...
...
File to patch:
I think I am working in wrong directory but I am not sure.
Erfan
(11 rep)
Feb 2, 2023, 10:57 AM
• Last activity: Feb 19, 2023, 08:57 AM
Showing page 1 of 20 total questions