blob: 634206de5016a9582f5640b574e70bcf59735a2e [file] [log] [blame]
b.liue9582032025-04-17 19:18:16 +080010, Setup a workstation with 64-bit Linux OS installed (Ubuntu 14.04 and newer recommended)
2
3Make sure the workstation has the ssh key authorized by ASR.
4Make sure the ASR openwrt repositories are already cloned and updated
5
6Works below are all based on above two prerequisites.
7
81, update the repos
9
10$ cd openwrt
11$ ./ugit.sh pull
12
132, install the host prerequisites by openwrt
14
15$ apt-get install build-essential bison flex zlib1g-dev libncurses5-dev subversion quilt intltool ruby fastjar zip unzip gawk git-core
16
173, update the feeds
18
19this is required at the first build, and the build after running 'make distclean'
20
21$ ./scripts/feeds update -a
22$ ./scripts/feeds install -a
23
244, build the image
25
26First of first, let OpenWrt Buildroot check for missing packages on your build-system using
27
28$ make prereq
29
30Now, choose the proper defconfig files from the config directory according to the product profile.
31There are many profiles supported by default based on ASR DKB/EVB designs, i.e.
32 - pxa1826, for type A DKB, called nand profile in documents as well
33 - pxa1826spinand, for type A DKB with SPI flash, called spinand profile in documents as well
34 - pxa1826spinor, for data module, called spinor profile in documents as well
35 - pxa1826p601, for new designed EVB board, called p601 profile in documents as well
36
37Other profiles are not based on ASR DKB/EVB.
38
39Take pxa1826 nand profile for example,
40
41$make defconfig_pxa1826
42
43Then start the build
44$ make -j2 V=99
45
46After build finished, you can find the images at folder bin/pxa1826
47
48In the following development, just a simple build is enough if profile and config file are not changed.
49$ make -j2 V=99
50
515, distclean uasge
52
53After the first build it will generate the toolchain and host tools, creating openwrt/host, openwrt/owtoolchain.
54In case you want to refresh those toolchains when some toolchain related configuration changed.
55
56$ make distclean
57$ ./scripts/feeds update -a
58$ ./scripts/feeds install -a
59$ make defconfig_pxa1826
60$ make -j2 V=99
61
626, dirclean usage
63
64If you want to change the profile, for example, to pxa1826p601
65
66$make dirclean //make preclean is similar to dirclean but keeps the bin folder.
67$make defconfig_pxa1826p601
68$make -j2 V=99
69
707, collect and check the build logs
71
72To save the build logs,
73
74$ make -j2 V=99 2>&1 | tee build.log
75
76To check error when build fails,
77
78$ make -j2 V=99 2>&1 | tee build.log | grep -i Error
79or
80$ grep -i Error build.log
81
828, How to clean?
83
84- To clean the bin folder:
85 $ make clean
86
87- To clean the folders generated during build process:
88 $ make dirclean
89
90- To clean the folders generated during build process except the images:
91 $ make preclean
92
93- To clean everything, downloads, **configurations**, feeds,etc.
94 $ make distclean
95
96Only use distclean when necessary to save build time.
97
989, How to build a specific package?
99
100It depends on where the package is located, following examples,
101
102 $ make package/obm-mmp/clean V=99
103 $ make package/obm-mmp/compile V=99
104 $ make package/obm-mmp/install V=99
105 or
106 $ make package/obm-mmp/{clean,compile,install} V=99
107
108 $ make package/feeds/packages/nginx/{clean, compile, install} V=99
109
110 $ make tools/automake/compile
111
112 $ make toolchain/{clean, compile, install}
113
114You can recompile only the kernel modules by issuing:
115
116 $ make target/linux/compile
117
118To recompile the static part of the kernel, issuing:
119
120 $ make target/linux/install
121
122Usually, you can do this for a complete kernel build,
123
124 $ make target/linux/{clean, compile, install}
125