4ff185abf86f73cc1ffcbfb9a1153393daca8944
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / build / docs / manual / customize-quick-guide.txt
1 // -*- mode:doc; -*-
2 // vim: set syntax=asciidoc:
3
4 === Quick guide to storing your project-specific customizations
5
6 Earlier in this chapter, the different methods for making
7 project-specific customizations have been described. This section will
8 now summarize all this by providing step-by-step instructions to storing your
9 project-specific customizations. Clearly, the steps that are not relevant to
10 your project can be skipped.
11
12 1. +make menuconfig+ to configure toolchain, packages and kernel.
13 1. +make linux-menuconfig+ to update the kernel config, similar for
14    other configuration like busybox, uclibc, ...
15 1. +mkdir -p board/<manufacturer>/<boardname>+
16 1. Set the following options to +board/<manufacturer>/<boardname>/<package>.config+
17    (as far as they are relevant):
18    * +BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE+
19    * +BR2_PACKAGE_BUSYBOX_CONFIG+
20    * +BR2_UCLIBC_CONFIG+
21    * +BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_CONFIG_FILE+
22    * +BR2_TARGET_BAREBOX_CUSTOM_CONFIG_FILE+
23 1. Write the configuration files:
24    * +make linux-update-defconfig+
25    * +make busybox-update-config+
26    * +make uclibc-update-config+
27    * +cp <output>/build/at91bootstrap3-*/.config
28      board/<manufacturer>/<boardname>/at91bootstrap3.config+
29    * +make barebox-update-defconfig+
30 1. Create +board/<manufacturer>/<boardname>/rootfs-overlay/+ and fill it
31    with additional files you need on your rootfs, e.g.
32    +board/<manufacturer>/<boardname>/rootfs-overlay/etc/inittab+.
33    Set +BR2_ROOTFS_OVERLAY+
34    to +board/<manufacturer>/<boardname>/rootfs-overlay+.
35 1. Create a post-build script
36    +board/<manufacturer>/<boardname>/post_build.sh+. Set
37    +BR2_ROOTFS_POST_BUILD_SCRIPT+ to
38    +board/<manufacturer>/<boardname>/post_build.sh+
39 1. If additional setuid permissions have to be set or device nodes have
40    to be created, create +board/<manufacturer>/<boardname>/device_table.txt+
41    and add that path to +BR2_ROOTFS_DEVICE_TABLE+.
42 1. If additional user accounts have to be created, create
43    +board/<manufacturer>/<boardname>/users_table.txt+ and add that path
44    to +BR2_ROOTFS_USERS_TABLES+.
45 1. To add custom patches to certain packages, set +BR2_GLOBAL_PATCH_DIR+
46    to +board/<manufacturer>/<boardname>/patches/+ and add your patches
47    for each package in a subdirectory named after the package. Each
48    patch should be called +<packagename>-<num>-<description>.patch+.
49 1. Specifically for the Linux kernel, there also exists the option
50    +BR2_LINUX_KERNEL_PATCH+ with as main advantage that it can also
51    download patches from a URL. If you do not need this,
52    +BR2_GLOBAL_PATCH_DIR+ is preferred. U-Boot, Barebox, at91bootstrap
53    and at91bootstrap3 also have separate options, but these do not
54    provide any advantage over +BR2_GLOBAL_PATCH_DIR+ and will likely be
55    removed in the future.
56 1. If you need to add project-specific packages, create
57    +package/<manufacturer>/+ and place your packages in that
58    directory. Create an overall +<manufacturer>.mk+ file that
59    includes the +.mk+ files of all your packages. Create an overall
60    +Config.in+ file that sources the +Config.in+ files of all your
61    packages. Include this +Config.in+ file from Buildroot's
62    +package/Config.in+ file.
63 1. +make savedefconfig+ to save the buildroot configuration.
64 1. +cp defconfig configs/<boardname>_defconfig+