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