From 300641c29004abd25d533ae1d4753985bd3ba77c Mon Sep 17 00:00:00 2001 From: saundersp Date: Tue, 27 Jan 2026 18:38:48 +0100 Subject: [PATCH] README.md : Added "Creating a Gentoo's patch" notes --- README.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/README.md b/README.md index 9dae6e3..e4b4393 100644 --- a/README.md +++ b/README.md @@ -225,3 +225,27 @@ e2fsck -f $FS resize2fs $FS $SIZE mount $FS $MOUNT_POINT ``` + +## Creating a Gentoo's patch + +### Using diff + +```sh +tar -xvf /var/cache/distfiles/package.tar.xz +mv package a +cp -r a b +# Make your changes to b. +diff -ur a b > /etc/portage/patches/example-category/example-packagename/my-patch.patch +``` + +### Using git + +```sh +tar -xvf /var/cache/distfiles/package.tar.xz +cd package +git init +git add . +git commit -m "Initial commit" +# Make your changes +git diff > /etc/portage/patches/example-category/example-packagename/my-patch.patch +```