Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| docs:guide-developer:toolchain:use-buildsystem [2022/04/27 13:44] – ivanmara | docs:guide-developer:toolchain:use-buildsystem [2024/10/16 18:12] (current) – [Build system usage] jannoke | ||
|---|---|---|---|
| Line 9: | Line 9: | ||
| </ | </ | ||
| - | After [[docs: | + | After [[docs: |
| <code bash> | <code bash> | ||
| Line 20: | Line 20: | ||
| git branch -a | git branch -a | ||
| git tag | git tag | ||
| - | git checkout | + | git checkout |
| # Update the feeds | # Update the feeds | ||
| Line 26: | Line 26: | ||
| ./ | ./ | ||
| - | # Configure the firmware image and the kernel | + | # Configure the firmware image |
| make menuconfig | make menuconfig | ||
| - | make -j $(nproc) kernel_menuconfig | + | |
| + | # Optional: configure the kernel (usually not required) | ||
| + | # Don't, unless have a strong reason to | ||
| + | make -j$(nproc) kernel_menuconfig | ||
| # Build the firmware image | # Build the firmware image | ||
| - | make -j $(nproc) defconfig download clean world | + | make -j$(nproc) defconfig download clean world |
| </ | </ | ||
| Line 97: | Line 100: | ||
| - Create a dir: '' | - Create a dir: '' | ||
| - Write a Makefile or download one '' | - Write a Makefile or download one '' | ||
| - | - Append a line with your custom feed to '' | + | - Append a line with your custom feed to '' |
| - Now run: '' | - Now run: '' | ||
| - | - Build your package.\\ Select it in the menu of '' | + | - Build your package.\\ Select it in the menu of '' |
| ===== Selecting code revision ===== | ===== Selecting code revision ===== | ||
| Line 290: | Line 293: | ||
| :!: Also you won't be able to install kernel packages from the official repositories when you make changes here. | :!: Also you won't be able to install kernel packages from the official repositories when you make changes here. | ||
| - | While you won't typically need to do this, you can do it: | + | While you won't typically need to do this, first define the target, subtarget, and device in a '' |
| + | <code bash> | ||
| + | CONFIG_TARGET_x86=y | ||
| + | CONFIG_TARGET_x86_64=y | ||
| + | CONFIG_TARGET_x86_64_DEVICE_generic=y | ||
| + | </ | ||
| + | Now run the following where subtarget is not a variable, it is a literal and it references the '' | ||
| <code bash> | <code bash> | ||
| make kernel_menuconfig CONFIG_TARGET=subtarget | make kernel_menuconfig CONFIG_TARGET=subtarget | ||
| Line 305: | Line 314: | ||
| </ | </ | ||
| - | === Source mirrors === | + | ==== Source mirrors |
| The 'Build system settings' | The 'Build system settings' | ||
| - Local mirror for source packages | - Local mirror for source packages | ||
| Line 364: | Line 373: | ||
| <code bash> | <code bash> | ||
| make download | make download | ||
| - | ionice -c 3 nice -n19 make -j9 | + | ionice -c 3 chrt --idle 0 nice -n19 make -j9 |
| </ | </ | ||
| Line 380: | Line 389: | ||
| It doesn' | It doesn' | ||
| + | |||
| + | Note: you must have done a full tree build (make, or make world) beforehand for this to work reliably. | ||
| === Spotting build errors === | === Spotting build errors === | ||
| Line 424: | Line 435: | ||
| make -i ... | make -i ... | ||
| </ | </ | ||
| + | |||
| + | |||
| + | === Make a summary information of generated image === | ||
| + | <code bash> | ||
| + | make json_overview_image_info | ||
| + | </ | ||
| + | Generate a summary of the image (including default packages, type of target, etc... ) in JSON format. The output is available in ''< | ||
| + | |||
| + | |||
| + | === Calculate checksum for generated files === | ||
| + | <code bash> | ||
| + | make checksum | ||
| + | </ | ||
| + | The following action will take place: a checksum will be computed and saved for the output files. This checksum will then be stored in the '< | ||
| ===== Locating images ===== | ===== Locating images ===== | ||
| Line 435: | Line 460: | ||
| ===== Cleaning up ===== | ===== Cleaning up ===== | ||
| You might need to clean your //build environment// | You might need to clean your //build environment// | ||
| - | The following '' | ||
| + | The build artefacts, toolchain, build tools and downloaded feeds & sources files can be cleaned selectively.\\ | ||
| + | The following '' | ||
| + | |||
| + | ^ > Cleaned components > \\ v make argument v^ Compiled binaries:\\ firmware, kernel, packages ^ Toolchain\\ (target-specific) | ||
| + | | clean | x | | | | | | | ||
| + | | targetclean | ||
| + | | dirclean | ||
| + | | config-clean | | | | x | | | | ||
| + | | distclean | ||
| ==== Clean ==== | ==== Clean ==== | ||
| <code bash> | <code bash> | ||
| Line 446: | Line 479: | ||
| It is a good practice to do '' | It is a good practice to do '' | ||
| That may not be necessary always, but as a general rule it helps to ensure quality builds. | That may not be necessary always, but as a general rule it helps to ensure quality builds. | ||
| + | |||
| + | ==== Targetclean ==== | ||
| + | <code bash> | ||
| + | make targetclean | ||
| + | </ | ||
| + | |||
| + | This cleans also the target-specific toolchain in addition of doing '' | ||
| + | Does a '' | ||
| + | Note: '' | ||
| ==== Dirclean ==== | ==== Dirclean ==== | ||
| Line 452: | Line 494: | ||
| </ | </ | ||
| - | This is your basic "full clean" operation. | + | This is your basic "full clean" operation. |
| - | Deletes contents of the directories ''/ | + | Deletes contents of the directories ''/ |
| ==== Distclean ==== | ==== Distclean ==== | ||
| Line 463: | Line 506: | ||
| :!: In addition to all else, this will **erase your build configuration ''< | :!: In addition to all else, this will **erase your build configuration ''< | ||
| Use only if you need a " | Use only if you need a " | ||
| + | |||
| ==== Selective cleanup ==== | ==== Selective cleanup ==== | ||