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 +```