Difference between revisions of "Quilt"
(New page: == Introduction == Quilt is a little tool used to manage patches. The project is hosted on [http://savannah.nongnu.org/projects/quilt savannah forge] and can be found in debian package rep...) |
|||
(8 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
Quilt is a little tool used to manage patches. The project is hosted on [http://savannah.nongnu.org/projects/quilt savannah forge] and can be found in debian package repository. | Quilt is a little tool used to manage patches. The project is hosted on [http://savannah.nongnu.org/projects/quilt savannah forge] and can be found in debian package repository. | ||
− | == Using quilt in | + | == Using quilt in Armadeus project == |
− | Quilt is useful when linux kernel or buildroot modification must be done. Because | + | Quilt is useful when linux kernel or buildroot modification must be done. Because Armadeus use official linux/buildroot sources, each specific modification for our platform must be done with a patch. And patches are versionned on Armadeus gitlab repository in directory buildroot/target/device/armadeus/linux/kernel-patches/ for Linux kernel and in patches/buildroot for buildroot. |
− | To use it under | + | === quiltify.sh === |
+ | |||
+ | To use it under Armadeus Project, a simple script was written to simplify it : ''quiltify.sh''. Launch it from the root project : | ||
<pre class="host"> | <pre class="host"> | ||
Line 13: | Line 15: | ||
Then answer questions (defaults are recommended). For linux kernel, quiltify will rename your source directory and download/patch/compile again the sources. | Then answer questions (defaults are recommended). For linux kernel, quiltify will rename your source directory and download/patch/compile again the sources. | ||
+ | |||
+ | === By Hand === | ||
+ | |||
+ | quiltify is used when patch are stored in Armadeus standard directory. For specific projects, where patches are stored elsewhere it doesn't work. To do this, you can follow this procedure: | ||
+ | |||
+ | * linux-dirclean: linux kernel should be rebuild from ''scratch'' then first we have to cut the branch (in bsp root directory do): | ||
+ | <pre class="host"> | ||
+ | $ make linux-dirclean | ||
+ | </pre> | ||
+ | * linux-extract: We have to just extract virgin linux source (don't compile yet): | ||
+ | <pre class="host"> | ||
+ | $ make linux-extract | ||
+ | </pre> | ||
+ | * Once extract done, go to linux source directory and add patch one by one : | ||
+ | <pre class="host"> | ||
+ | $ cd buildroot/output/build/linux-5.3-rc4/ | ||
+ | # Import patches one by one: | ||
+ | $ quilt import /Path/to/personnal/kernel/patches/my_wonderful_patch.patch | ||
+ | # All patches from a directory: | ||
+ | $ quilt import /Path/to/personnal/kernel/patches/*.patch | ||
+ | </pre> | ||
+ | |||
+ | === Play with quilt === | ||
Once you done it, you can go to linux sources directory ''buildroot/project_build_armv5te/apf27/linux-2.6.29.6'' then list all patches applied to with quilt command : | Once you done it, you can go to linux sources directory ''buildroot/project_build_armv5te/apf27/linux-2.6.29.6'' then list all patches applied to with quilt command : | ||
Line 27: | Line 52: | ||
</pre> | </pre> | ||
− | If you want to create a new | + | If you want to create a new patch, just use ''new'' quilt command. Then '''before''' modifying Linux file, add it to quilt with ''add'' command. |
The file can be modified according to your wish. | The file can be modified according to your wish. | ||
Line 36: | Line 61: | ||
</pre> | </pre> | ||
− | Your patch is now ready to be committed on | + | Your patch is now ready to be committed on Armadeus gitlab. |
+ | |||
+ | == Documentation == | ||
+ | |||
+ | The [http://linux.die.net/man/1/quilt man page] of quilt is a good documentation, it's strongly recommended to read it before using it. |
Latest revision as of 12:44, 30 June 2022
Contents
Introduction
Quilt is a little tool used to manage patches. The project is hosted on savannah forge and can be found in debian package repository.
Using quilt in Armadeus project
Quilt is useful when linux kernel or buildroot modification must be done. Because Armadeus use official linux/buildroot sources, each specific modification for our platform must be done with a patch. And patches are versionned on Armadeus gitlab repository in directory buildroot/target/device/armadeus/linux/kernel-patches/ for Linux kernel and in patches/buildroot for buildroot.
quiltify.sh
To use it under Armadeus Project, a simple script was written to simplify it : quiltify.sh. Launch it from the root project :
[ ] $ ./scripts/quiltify.sh
Then answer questions (defaults are recommended). For linux kernel, quiltify will rename your source directory and download/patch/compile again the sources.
By Hand
quiltify is used when patch are stored in Armadeus standard directory. For specific projects, where patches are stored elsewhere it doesn't work. To do this, you can follow this procedure:
- linux-dirclean: linux kernel should be rebuild from scratch then first we have to cut the branch (in bsp root directory do):
$ make linux-dirclean
- linux-extract: We have to just extract virgin linux source (don't compile yet):
$ make linux-extract
- Once extract done, go to linux source directory and add patch one by one :
$ cd buildroot/output/build/linux-5.3-rc4/ # Import patches one by one: $ quilt import /Path/to/personnal/kernel/patches/my_wonderful_patch.patch # All patches from a directory: $ quilt import /Path/to/personnal/kernel/patches/*.patch
Play with quilt
Once you done it, you can go to linux sources directory buildroot/project_build_armv5te/apf27/linux-2.6.29.6 then list all patches applied to with quilt command :
[ ] $ quilt applied 015-armadeus-logo-add_armadeus-project_tux.patch 016-armadeus-imxfb-add_platform_specific_init_exit_functions.patch 018-armadeus-i2c-imx-add_driver_to_linux_build_system.patch … 336-armadeus-imxfb-makes_it_compatible_with_arch_imx.patch 337-armadeus-imxfb-add_lcd_clock_def_for_imx_platform.patch 338-denx-mxcgpio-emulates_interrupt_on_both_edges.patch 339-apf27-armadeus-spidev.patch
If you want to create a new patch, just use new quilt command. Then before modifying Linux file, add it to quilt with add command.
The file can be modified according to your wish.
Once modification done, you can generate the patch using refresh command. To add yours patches in the right directory, go to your project root then launch the script with export command :
[ ] $ ./scripts/quiltify.sh export
Your patch is now ready to be committed on Armadeus gitlab.
Documentation
The man page of quilt is a good documentation, it's strongly recommended to read it before using it.