Compare commits
311 Commits
v24.10.0-r
...
v21.02.0-r
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3e09cc4969 | ||
|
|
c2139eef27 | ||
|
|
0bc3f51aa6 | ||
|
|
16ccf888ee | ||
|
|
77d96e925f | ||
|
|
fc605c01f6 | ||
|
|
0d90023633 | ||
|
|
892fc7caa9 | ||
|
|
4b691077e0 | ||
|
|
6b6bcca1a0 | ||
|
|
0b0bec56ea | ||
|
|
c4926a4255 | ||
|
|
3f5109f538 | ||
|
|
bb8fd58a23 | ||
|
|
4419c3dcd3 | ||
|
|
bab7a1120c | ||
|
|
83d07db2f2 | ||
|
|
e78ef58431 | ||
|
|
834167b42e | ||
|
|
ef14916947 | ||
|
|
f3a0f906b5 | ||
|
|
252660bf3b | ||
|
|
5b16484b0d | ||
|
|
21a3599a9a | ||
|
|
d9603bbd3e | ||
|
|
abc2fff80f | ||
|
|
a162fe9a96 | ||
|
|
0b0e97853a | ||
|
|
d5ea756c3e | ||
|
|
a52842a8d0 | ||
|
|
1a2ebb88f5 | ||
|
|
4dcddedfd2 | ||
|
|
7a39781403 | ||
|
|
bbbc01ede5 | ||
|
|
bc2225fe73 | ||
|
|
b62fa7453a | ||
|
|
003fbfbf94 | ||
|
|
f9b0215e28 | ||
|
|
dee89d42ed | ||
|
|
43e4ba5863 | ||
|
|
5869423d21 | ||
|
|
9d21eccc6b | ||
|
|
c287500a65 | ||
|
|
0e49178f93 | ||
|
|
f49d4aebe2 | ||
|
|
c99f037493 | ||
|
|
25d81e9c76 | ||
|
|
ceeaf0b63d | ||
|
|
f001bd226c | ||
|
|
930e9c0621 | ||
|
|
f25dc53723 | ||
|
|
c6ce0411e1 | ||
|
|
faf9528a23 | ||
|
|
2f0ab93799 | ||
|
|
4d9f3ae2bb | ||
|
|
4b89b90d9f | ||
|
|
567ad2d434 | ||
|
|
04579a527a | ||
|
|
10a535a90c | ||
|
|
d1a056f620 | ||
|
|
08cfc7a0d3 | ||
|
|
ce41fc38ba | ||
|
|
a641502849 | ||
|
|
701d25b551 | ||
|
|
3ce7f1e477 | ||
|
|
d7fd690b8c | ||
|
|
62099d98e4 | ||
|
|
438718b5fb | ||
|
|
d57e480394 | ||
|
|
a524a0dff8 | ||
|
|
f066ee2ad5 | ||
|
|
6f053e5b4f | ||
|
|
15cd9a5d5c | ||
|
|
dd43fae67b | ||
|
|
51a5053300 | ||
|
|
1d5aa4bde7 | ||
|
|
2ce89a3578 | ||
|
|
59980f7aaf | ||
|
|
41a8bea72e | ||
|
|
81c1e0ab00 | ||
|
|
37920d6ee1 | ||
|
|
037dc6b251 | ||
|
|
66e470594a | ||
|
|
ec7cd3808d | ||
|
|
d9b3edef4d | ||
|
|
209f2386a5 | ||
|
|
0fc789b724 | ||
|
|
71131cb9c5 | ||
|
|
ddd0176255 | ||
|
|
f1ba3a8d91 | ||
|
|
eaf19220b6 | ||
|
|
ab610f5af3 | ||
|
|
8bbf5bc4b0 | ||
|
|
1a0afbd6f2 | ||
|
|
36ee555c5f | ||
|
|
6552f31acd | ||
|
|
cc6ad94fb9 | ||
|
|
8437c24f09 | ||
|
|
f33139c4d5 | ||
|
|
75d0a0da15 | ||
|
|
09a23b9261 | ||
|
|
d33f4f8565 | ||
|
|
d530ff37bf | ||
|
|
f965235bb5 | ||
|
|
f2b7e66759 | ||
|
|
76d7405720 | ||
|
|
80acc9b737 | ||
|
|
580748fd47 | ||
|
|
beab1bf163 | ||
|
|
2748b36eff | ||
|
|
50f2f25d58 | ||
|
|
48262735d9 | ||
|
|
6fd65c6573 | ||
|
|
46362c48c8 | ||
|
|
121f2461e5 | ||
|
|
04b22754d7 | ||
|
|
4ad1957eee | ||
|
|
de00033bbb | ||
|
|
3da861ccca | ||
|
|
1663dc7e82 | ||
|
|
226d22dcd3 | ||
|
|
dc31191ec3 | ||
|
|
f1158fbcf6 | ||
|
|
86213141fb | ||
|
|
40143873d6 | ||
|
|
879cbd9e97 | ||
|
|
f88459de25 | ||
|
|
3e9d639e8f | ||
|
|
0d5e308664 | ||
|
|
e07105303f | ||
|
|
0ffc498ddd | ||
|
|
272a9e1975 | ||
|
|
7114416fbe | ||
|
|
ff6d629d32 | ||
|
|
a701d4b841 | ||
|
|
c0cb86e1d5 | ||
|
|
aebfc2f6f3 | ||
|
|
cc51d97200 | ||
|
|
541db110bb | ||
|
|
91e0865ff5 | ||
|
|
7b3bde801b | ||
|
|
d4ca7f6dca | ||
|
|
a5d457a0f4 | ||
|
|
b7ffeef924 | ||
|
|
2e2b583393 | ||
|
|
fe302010d3 | ||
|
|
e708c5ef08 | ||
|
|
cbf8ac82c6 | ||
|
|
d91054a521 | ||
|
|
6d6fd7f13a | ||
|
|
f1f1ecfab4 | ||
|
|
0b333eb093 | ||
|
|
c1fb10feba | ||
|
|
e9a7c22d3c | ||
|
|
6f6da65a8d | ||
|
|
c251ec739f | ||
|
|
9db0cc5787 | ||
|
|
052708ce78 | ||
|
|
636b8bfac0 | ||
|
|
76423e2364 | ||
|
|
cb16581df5 | ||
|
|
23cb83c209 | ||
|
|
aae855d332 | ||
|
|
9aaa20d8ba | ||
|
|
ca6a1d0dc8 | ||
|
|
741164fdac | ||
|
|
50a25d4394 | ||
|
|
0a98a33e09 | ||
|
|
64ddac2c1c | ||
|
|
69794908b6 | ||
|
|
95b838f75b | ||
|
|
6090337679 | ||
|
|
6f42758000 | ||
|
|
b8eb602934 | ||
|
|
b2c9a8741f | ||
|
|
da7ef7f414 | ||
|
|
6b2bcd2597 | ||
|
|
f0ab4b17e6 | ||
|
|
c61d4eeedb | ||
|
|
eb1509a938 | ||
|
|
b89accdfbc | ||
|
|
290b28664d | ||
|
|
eb98c88f66 | ||
|
|
7bb8aded10 | ||
|
|
9ce0f2b90c | ||
|
|
5a3b1e5b57 | ||
|
|
8458ebe18b | ||
|
|
7939d4a1b1 | ||
|
|
2db7fe792e | ||
|
|
112d1052ac | ||
|
|
2464a9a8a4 | ||
|
|
e8cbdbbe97 | ||
|
|
8e8fe69a8e | ||
|
|
b526fbb1ce | ||
|
|
e7a9ee0580 | ||
|
|
22149da1f4 | ||
|
|
aacf378608 | ||
|
|
fdc0342704 | ||
|
|
5a11ca3cf3 | ||
|
|
0444a93bdf | ||
|
|
c459d5a710 | ||
|
|
db6ff390b0 | ||
|
|
cd48473bb8 | ||
|
|
bdfd7f68d0 | ||
|
|
741260d281 | ||
|
|
97a4d27fb5 | ||
|
|
69b4a11aed | ||
|
|
d52c5c081e | ||
|
|
31bca5f256 | ||
|
|
d148fb1603 | ||
|
|
192486ac74 | ||
|
|
761df5c4cf | ||
|
|
20fe0e66f3 | ||
|
|
946bfd59a6 | ||
|
|
3ce0d62b39 | ||
|
|
d523f61135 | ||
|
|
7d03fdb004 | ||
|
|
15d142262a | ||
|
|
86eb3de66e | ||
|
|
763f0bab3e | ||
|
|
b18fe2ecc4 | ||
|
|
6a217d6d72 | ||
|
|
c8b415035c | ||
|
|
bc2c3d99c8 | ||
|
|
058e4c57aa | ||
|
|
217687c7ec | ||
|
|
543007917a | ||
|
|
67df3a829b | ||
|
|
08bbe361e0 | ||
|
|
69b77dc3b4 | ||
|
|
f82e7e96a0 | ||
|
|
60275454fb | ||
|
|
55a43e1ab0 | ||
|
|
67166fabda | ||
|
|
9a5f385732 | ||
|
|
8a317fbb9a | ||
|
|
22cc999731 | ||
|
|
0526d5bb17 | ||
|
|
c47b8c0568 | ||
|
|
5cc1af92b2 | ||
|
|
51159bcfd1 | ||
|
|
94077a2f12 | ||
|
|
1eb1d5e0bb | ||
|
|
e17e212b51 | ||
|
|
3b6c93298c | ||
|
|
8b3d879861 | ||
|
|
7e1ab3b746 | ||
|
|
5601da24a8 | ||
|
|
bdb18e0f84 | ||
|
|
ceb6869cd9 | ||
|
|
27c5db998c | ||
|
|
a29b398324 | ||
|
|
ff6b36b954 | ||
|
|
e4d061cd1a | ||
|
|
e9e2310c6a | ||
|
|
59ba79d675 | ||
|
|
7b6ee74ee9 | ||
|
|
17a627ec82 | ||
|
|
2638c9801f | ||
|
|
adc3a75d48 | ||
|
|
3feef9c555 | ||
|
|
7054721cf9 | ||
|
|
f6b175a9bf | ||
|
|
a75520c678 | ||
|
|
86801bd3d8 | ||
|
|
f647d9e6bb | ||
|
|
0e8d67023b | ||
|
|
c53a86806d | ||
|
|
0a19f77f32 | ||
|
|
75abdc4b46 | ||
|
|
8f7a905ffb | ||
|
|
e3e6ec3cda | ||
|
|
eb8726f9f4 | ||
|
|
3c1aabd445 | ||
|
|
64ca28a881 | ||
|
|
4b3958da39 | ||
|
|
cb5c93f12a | ||
|
|
1b46554895 | ||
|
|
8cb50639c7 | ||
|
|
b7c5924f1f | ||
|
|
906c87814d | ||
|
|
5808c8c6ba | ||
|
|
60823c67cb | ||
|
|
7a0cd1ede4 | ||
|
|
ef47bc424c | ||
|
|
2e1ad2473e | ||
|
|
7272793330 | ||
|
|
7f933db108 | ||
|
|
9f8bf18c7f | ||
|
|
800a568df5 | ||
|
|
a7c0c9bb7e | ||
|
|
425c4c89b0 | ||
|
|
c74df745fd | ||
|
|
6a4dcb4719 | ||
|
|
a7c4d94342 | ||
|
|
9e2acdbccd | ||
|
|
1c22b7a1f2 | ||
|
|
2e3983e387 | ||
|
|
be423be931 | ||
|
|
62b7f5931c | ||
|
|
76d1168d0d | ||
|
|
cbe4beb442 | ||
|
|
194e85e7db | ||
|
|
ee6349fbe5 | ||
|
|
0011c7ad12 | ||
|
|
c6319239d8 | ||
|
|
865cab8c6e | ||
|
|
b95f3caaa1 | ||
|
|
268381cc5a | ||
|
|
3e807f0305 | ||
|
|
1cd121dd11 |
@@ -1,12 +0,0 @@
|
||||
{
|
||||
"name": "CI build container",
|
||||
"image": "ghcr.io/openwrt/buildbot/buildworker-v3.8.0:v9",
|
||||
"features": {
|
||||
},
|
||||
"remoteUser": "buildbot",
|
||||
"customizations": {
|
||||
"vscode": {
|
||||
"extensions": ["ms-vscode.cpptools", "plorefice.devicetree"]
|
||||
}
|
||||
}
|
||||
}
|
||||
1
.github/FUNDING.yml
vendored
1
.github/FUNDING.yml
vendored
@@ -1 +0,0 @@
|
||||
custom: [ 'https://openwrt.org/donate' ]
|
||||
95
.github/ISSUE_TEMPLATE/bug-report.yml
vendored
95
.github/ISSUE_TEMPLATE/bug-report.yml
vendored
@@ -1,95 +0,0 @@
|
||||
name: Bug report
|
||||
description: Create a bug report to help us improve
|
||||
labels:
|
||||
- bug
|
||||
- bug-report
|
||||
- to-triage
|
||||
body:
|
||||
- type: textarea
|
||||
id: description
|
||||
attributes:
|
||||
label: Describe the bug
|
||||
description: A clear and concise description of the bug.
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
id: version
|
||||
attributes:
|
||||
label: OpenWrt version
|
||||
description: |
|
||||
The OpenWrt release or commit hash where this bug occurs (use command below).
|
||||
```. /etc/openwrt_release && echo $DISTRIB_REVISION```
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
id: release
|
||||
attributes:
|
||||
label: OpenWrt release
|
||||
description: |
|
||||
The OpenWrt release or commit hash where this bug occurs (use command below).
|
||||
```. /etc/openwrt_release && echo $DISTRIB_RELEASE```
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
id: target
|
||||
attributes:
|
||||
label: OpenWrt target/subtarget
|
||||
description: |
|
||||
The OpenWrt target and subtarget where this bug is observed (use command below).
|
||||
```. /etc/openwrt_release && echo $DISTRIB_TARGET```
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
id: device
|
||||
attributes:
|
||||
label: Device
|
||||
description: |
|
||||
The device exhibiting this bug (if unsure, use command below).
|
||||
```cat /tmp/sysinfo/model```
|
||||
validations:
|
||||
required: true
|
||||
- type: dropdown
|
||||
id: image_kind
|
||||
attributes:
|
||||
label: Image kind
|
||||
options:
|
||||
- Official downloaded image
|
||||
- Self-built image
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: reproduce
|
||||
attributes:
|
||||
label: Steps to reproduce
|
||||
description: Steps to reproduce the reported behaviour.
|
||||
- type: textarea
|
||||
id: behaviour
|
||||
attributes:
|
||||
label: Actual behaviour
|
||||
description: A clear and concise description of what actually happens.
|
||||
- type: textarea
|
||||
id: expected
|
||||
attributes:
|
||||
label: Expected behaviour
|
||||
description: A clear and concise description of what you expected to happen.
|
||||
- type: textarea
|
||||
id: additional
|
||||
attributes:
|
||||
label: Additional info
|
||||
description: Add any additional info you think might be helfpul.
|
||||
- type: textarea
|
||||
id: diffconfig
|
||||
attributes:
|
||||
label: Diffconfig
|
||||
description: |
|
||||
In case of a self-built image, please attach diffconfig.
|
||||
```./scripts/diffconfig.sh```
|
||||
render: text
|
||||
- type: checkboxes
|
||||
id: terms
|
||||
attributes:
|
||||
label: Terms
|
||||
description: By submitting this issue, you agree to the terms below.
|
||||
options:
|
||||
- label: I am reporting an issue for OpenWrt, not an unsupported fork.
|
||||
required: true
|
||||
12
.github/ISSUE_TEMPLATE/config.yml
vendored
12
.github/ISSUE_TEMPLATE/config.yml
vendored
@@ -1,12 +0,0 @@
|
||||
---
|
||||
blank_issues_enabled: true
|
||||
contact_links:
|
||||
- name: Feature request
|
||||
url: https://forum.openwrt.org/c/feature-requests
|
||||
about: The OpenWrt project relies on volunteers. While we appreciate feature requests, we might lack the manpower to handle them. Ideally, you get familiar with the codebase and attempt to contribute the feature yourself. We recommend to post in the forum, as this is the most likely place to receive feedback on feature requests.
|
||||
- name: OpenWrt community
|
||||
url: https://openwrt.org/contact
|
||||
about: Consider reaching out to our community to get help. OpenWrt is a complex software project with many pitfalls; there is a good chance someone can help you solve your issue in no time.
|
||||
- name: OpenWrt documentation
|
||||
url: https://openwrt.org/docs/start
|
||||
about: The OpenWrt documentation contains a lot of valuable information.
|
||||
13
.github/issue_template
vendored
Normal file
13
.github/issue_template
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
This repository is a mirror of our main repo at https://git.openwrt.org/openwrt/openwrt.git
|
||||
It is for reference only and is not active for checkins or for reporting issues.
|
||||
|
||||
All issues should be reported at: https://bugs.openwrt.org
|
||||
|
||||
Please do not open any NEW issue here - we will be closing the Github issues
|
||||
capability in the near future.
|
||||
|
||||
We will continue to accept Pull Requests here as described in the repo description.
|
||||
|
||||
Close this now and click here: https://bugs.openwrt.org
|
||||
|
||||
Thankyou for your co-operation.
|
||||
249
.github/labeler.yml
vendored
249
.github/labeler.yml
vendored
@@ -1,249 +0,0 @@
|
||||
# target/*
|
||||
"target/airoha":
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- "target/linux/airoha/**"
|
||||
"target/apm821xx":
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- "target/linux/apm821xx/**"
|
||||
"target/archs38":
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- "target/linux/archs38/**"
|
||||
"target/armsr":
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- "target/linux/armsr/**"
|
||||
"target/at91":
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- "target/linux/at91/**"
|
||||
- "package/boot/at91bootstrap/**"
|
||||
- "package/boot/uboot-at91/**"
|
||||
"target/ath79":
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- "target/linux/ath79/**"
|
||||
"target/bcm27xx":
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- "target/linux/bcm27xx/**"
|
||||
- "package/kernel/bcm27xx-gpu-fw/**"
|
||||
- "package/utils/bcm27xx-utils/**"
|
||||
"target/bcm47xx":
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- "target/linux/bcm47xx/**"
|
||||
"target/bcm4908":
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- "target/linux/bcm4908/**"
|
||||
- "package/boot/uboot-bcm4908/**"
|
||||
- "package/boot/arm-trusted-firmware-bcm63xx/**"
|
||||
"target/bcm53xx":
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- "target/linux/bcm53xx/**"
|
||||
- "package/boot/uboot-bcm53xx/**"
|
||||
"target/bmips":
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- "target/linux/bmips/**"
|
||||
- "package/boot/uboot-bmips/**"
|
||||
- "package/kernel/bcm63xx-cfe/**"
|
||||
"target/d1":
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- "target/linux/d1/**"
|
||||
- "package/boot/uboot-d1/**"
|
||||
- "package/boot/opensbi/**"
|
||||
"target/gemini":
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- "target/linux/gemini/**"
|
||||
"target/imx":
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- "target/linux/imx/**"
|
||||
- "package/boot/imx-bootlets/**"
|
||||
- "package/boot/uboot-imx/**"
|
||||
"target/ipq40xx":
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- "target/linux/ipq40xx/**"
|
||||
"target/ipq806x":
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- "target/linux/ipq806x/**"
|
||||
"target/qualcommax":
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- "target/linux/qualcommax/**"
|
||||
"target/ixp4xx":
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- "target/linux/ixp4xx/**"
|
||||
- "package/boot/apex/Makefile/**"
|
||||
- "package/firmware/ixp4xx-microcode/**"
|
||||
"target/kirkwood":
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- "target/linux/kirkwood/**"
|
||||
- "package/boot/uboot-kirkwood/**"
|
||||
"target/lantiq":
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- "target/linux/lantiq/**"
|
||||
- "package/kernel/lantiq/**"
|
||||
- "package/firmware/lantiq/**"
|
||||
- "package/boot/uboot-lantiq/**"
|
||||
"target/layerscape":
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- "target/linux/layerscape/**"
|
||||
- "package/firmware/layerscape/**"
|
||||
- "package/boot/tfa-layerscape/**"
|
||||
- "package/boot/uboot-layerscape/**"
|
||||
- "package/network/utils/layerscape/**"
|
||||
"target/loongarch64":
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- "target/linux/loongarch64/**"
|
||||
"target/malta":
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- "target/linux/malta/**"
|
||||
"target/mediatek":
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- "target/linux/mediatek/**"
|
||||
- "package/boot/arm-trusted-firmware-mediatek/**"
|
||||
- "package/boot/uboot-mediatek/**"
|
||||
"target/mpc85xx":
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- "target/linux/mpc85xx/**"
|
||||
"target/mvebu":
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- "target/linux/mvebu/**"
|
||||
- "package/boot/arm-trusted-firmware-mvebu/**"
|
||||
- "package/boot/uboot-mvebu/**"
|
||||
"target/mxs":
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- "target/linux/mxs/**"
|
||||
- "package/boot/uboot-mxs/**"
|
||||
"target/octeon":
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- "target/linux/octeon/**"
|
||||
"target/omap":
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- "target/linux/omap/**"
|
||||
- "package/boot/uboot-omap/**"
|
||||
"target/pistachio":
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- "target/linux/pistachio/**"
|
||||
"target/qoriq":
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- "target/linux/qoriq/**"
|
||||
"target/ramips":
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- "target/linux/ramips/**"
|
||||
"target/realtek":
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- "target/linux/realtek/**"
|
||||
"target/rockchip":
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- "target/linux/rockchip/**"
|
||||
- "package/boot/arm-trusted-firmware-rockchip/**"
|
||||
- "package/boot/uboot-rockchip/**"
|
||||
"target/sifiveu":
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- "target/linux/sifiveu/**"
|
||||
- "package/boot/uboot-sifiveu/**"
|
||||
- "package/boot/opensbi/**"
|
||||
"target/siflower":
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- "target/linux/siflower/**"
|
||||
"target/starfive":
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- "target/linux/starfive/**"
|
||||
"target/stm32":
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- "target/linux/stm32/**"
|
||||
- "package/boot/arm-trusted-firmware-stm32/**"
|
||||
- "package/boot/optee-os-stm32/**"
|
||||
- "package/boot/uboot-stm32/**"
|
||||
"target/sunxi":
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- "target/linux/sunxi/**"
|
||||
- "package/boot/arm-trusted-firmware-sunxi/**"
|
||||
- "package/boot/uboot-sunxi/**"
|
||||
"target/tegra":
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- "target/linux/tegra/**"
|
||||
- "package/boot/uboot-tegra/**"
|
||||
"target/uml":
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- "target/linux/uml/**"
|
||||
"target/x86":
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- "target/linux/x86/**"
|
||||
"target/zynq":
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- "target/linux/zynq/**"
|
||||
- "package/boot/uboot-zynq/**"
|
||||
# target/imagebuilder
|
||||
"target/imagebuilder":
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- "target/imagebuilder/**"
|
||||
# kernel
|
||||
"kernel":
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- "target/linux/generic/**"
|
||||
- "target/linux/**/config-*"
|
||||
- "target/linux/**/patches-*"
|
||||
- "target/linux/**/files/**"
|
||||
- "package/kernel/linux/**"
|
||||
# core packages
|
||||
"core packages":
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- "package/**"
|
||||
# build/scripts/tools
|
||||
"build/scripts/tools":
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- "include/**"
|
||||
- "scripts/**"
|
||||
- "tools/**"
|
||||
# toolchain
|
||||
"toolchain":
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- "toolchain/**"
|
||||
# GitHub/CI
|
||||
"GitHub/CI":
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- ".github/**"
|
||||
19
.github/workflows/coverity.yml
vendored
19
.github/workflows/coverity.yml
vendored
@@ -1,19 +0,0 @@
|
||||
name: Coverity scan build
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '30 2 * * 6'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
|
||||
jobs:
|
||||
coverity_build:
|
||||
name: Coverity x86/64 build
|
||||
secrets:
|
||||
coverity_api_token: ${{ secrets.COVERITY_API_TOKEN }}
|
||||
permissions:
|
||||
contents: read
|
||||
packages: read
|
||||
actions: write
|
||||
uses: openwrt/actions-shared-workflows/.github/workflows/coverity.yml@main
|
||||
12
.github/workflows/formal.yml
vendored
12
.github/workflows/formal.yml
vendored
@@ -1,12 +0,0 @@
|
||||
name: Test Formalities
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Test Formalities
|
||||
uses: openwrt/actions-shared-workflows/.github/workflows/formal.yml@main
|
||||
24
.github/workflows/github-release.yml
vendored
24
.github/workflows/github-release.yml
vendored
@@ -1,24 +0,0 @@
|
||||
name: Create GitHub release
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "v*"
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
draft: true
|
||||
prerelease: true
|
||||
11
.github/workflows/issue-labeller.yml
vendored
11
.github/workflows/issue-labeller.yml
vendored
@@ -1,11 +0,0 @@
|
||||
name: Issue Labeller
|
||||
on:
|
||||
issues:
|
||||
types: [ opened ]
|
||||
|
||||
jobs:
|
||||
label-component:
|
||||
name: Validate and Tag Bug Report
|
||||
permissions:
|
||||
issues: write
|
||||
uses: openwrt/actions-shared-workflows/.github/workflows/issue-labeller.yml@main
|
||||
42
.github/workflows/kernel.yml
vendored
42
.github/workflows/kernel.yml
vendored
@@ -1,42 +0,0 @@
|
||||
name: Build Kernel
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- '.github/workflows/check-kernel-patches.yml'
|
||||
- '.github/workflows/build.yml'
|
||||
- '.github/workflows/kernel.yml'
|
||||
- 'include/kernel*'
|
||||
- 'package/kernel/**'
|
||||
- 'target/linux/**'
|
||||
push:
|
||||
paths:
|
||||
- '.github/workflows/check-kernel-patches.yml'
|
||||
- '.github/workflows/build.yml'
|
||||
- '.github/workflows/kernel.yml'
|
||||
- 'include/kernel*'
|
||||
- 'package/kernel/**'
|
||||
- 'target/linux/**'
|
||||
branches-ignore:
|
||||
- master
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
||||
|
||||
jobs:
|
||||
build-kernels:
|
||||
name: Build all affected Kernels
|
||||
permissions:
|
||||
contents: read
|
||||
packages: read
|
||||
actions: write
|
||||
secrets:
|
||||
ccache_s3_endpoint: ${{ secrets.CCACHE_S3_ENDPOINT }}
|
||||
ccache_s3_bucket: ${{ secrets.CCACHE_S3_BUCKET }}
|
||||
ccache_s3_access_key: ${{ secrets.CCACHE_S3_ACCESS_KEY }}
|
||||
ccache_s3_secret_key: ${{ secrets.CCACHE_S3_SECRET_KEY }}
|
||||
uses: openwrt/actions-shared-workflows/.github/workflows/kernel.yml@main
|
||||
16
.github/workflows/label-kernel.yml
vendored
16
.github/workflows/label-kernel.yml
vendored
@@ -1,16 +0,0 @@
|
||||
# ci:kernel:x86:64 is going to trigger CI kernel check jobs for x86/64 target
|
||||
|
||||
name: Build kernel and check patches for target specified in labels
|
||||
on:
|
||||
pull_request:
|
||||
types:
|
||||
- labeled
|
||||
|
||||
jobs:
|
||||
build-kernels-label:
|
||||
name: Build all affected Kernels from defined label
|
||||
permissions:
|
||||
contents: read
|
||||
packages: read
|
||||
actions: write
|
||||
uses: openwrt/actions-shared-workflows/.github/workflows/label-kernel.yml@main
|
||||
16
.github/workflows/label-target.yml
vendored
16
.github/workflows/label-target.yml
vendored
@@ -1,16 +0,0 @@
|
||||
# ci:target:x86:64 is going to trigger CI target check jobs for x86/64 target
|
||||
|
||||
name: Build check target specified in labels
|
||||
on:
|
||||
pull_request:
|
||||
types:
|
||||
- labeled
|
||||
|
||||
jobs:
|
||||
build-target-label:
|
||||
name: Build target from defined label
|
||||
permissions:
|
||||
contents: read
|
||||
packages: read
|
||||
actions: write
|
||||
uses: openwrt/actions-shared-workflows/.github/workflows/label-target.yml@main
|
||||
33
.github/workflows/labeler.yml
vendored
33
.github/workflows/labeler.yml
vendored
@@ -1,33 +0,0 @@
|
||||
name: 'Pull Request Labeler'
|
||||
on:
|
||||
- pull_request_target
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
labeler:
|
||||
permissions:
|
||||
contents: read # to determine modified files (actions/labeler)
|
||||
pull-requests: write # to add labels to PRs (actions/labeler)
|
||||
|
||||
name: Pull Request Labeler
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/labeler@v5
|
||||
with:
|
||||
repo-token: '${{ secrets.GITHUB_TOKEN }}'
|
||||
|
||||
- name: Check Branch
|
||||
id: check-branch
|
||||
run: |
|
||||
if echo "${{ github.base_ref }}" | grep -q -E 'openwrt-[0-9][0-9]\.[0-9][0-9]'; then
|
||||
echo "release-tag=$(echo ${{ github.base_ref }} | sed 's/openwrt-/release\//')" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- uses: buildsville/add-remove-label@v2.0.1
|
||||
if: ${{ steps.check-branch.outputs.release-tag }}
|
||||
with:
|
||||
token: ${{secrets.GITHUB_TOKEN}}
|
||||
labels: ${{ steps.check-branch.outputs.release-tag }}
|
||||
type: add
|
||||
42
.github/workflows/packages.yml
vendored
42
.github/workflows/packages.yml
vendored
@@ -1,42 +0,0 @@
|
||||
name: Build all core packages
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- '.github/workflows/packages.yml'
|
||||
- 'config/**'
|
||||
- 'include/**'
|
||||
- 'package/**'
|
||||
- 'target/linux/generic/**'
|
||||
- 'toolchain/**'
|
||||
push:
|
||||
paths:
|
||||
- '.github/workflows/packages.yml'
|
||||
- 'config/**'
|
||||
- 'include/**'
|
||||
- 'package/**'
|
||||
- 'target/linux/generic/**'
|
||||
- 'toolchain/**'
|
||||
branches-ignore:
|
||||
- master
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
||||
|
||||
jobs:
|
||||
build-packages:
|
||||
name: Build all core packages for selected target
|
||||
permissions:
|
||||
contents: read
|
||||
packages: read
|
||||
actions: write
|
||||
secrets:
|
||||
ccache_s3_endpoint: ${{ secrets.CCACHE_S3_ENDPOINT }}
|
||||
ccache_s3_bucket: ${{ secrets.CCACHE_S3_BUCKET }}
|
||||
ccache_s3_access_key: ${{ secrets.CCACHE_S3_ACCESS_KEY }}
|
||||
ccache_s3_secret_key: ${{ secrets.CCACHE_S3_SECRET_KEY }}
|
||||
uses: openwrt/actions-shared-workflows/.github/workflows/packages.yml@main
|
||||
28
.github/workflows/push-containers.yml
vendored
28
.github/workflows/push-containers.yml
vendored
@@ -1,28 +0,0 @@
|
||||
name: Build and Push prebuilt tools container
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- 'include/version.mk'
|
||||
- 'include/cmake.mk'
|
||||
- 'tools/**'
|
||||
- '.github/workflows/push-containers.yml'
|
||||
- 'toolchain/**'
|
||||
branches-ignore:
|
||||
- master
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build-push-containers:
|
||||
name: Build and Push all prebuilt containers
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
actions: write
|
||||
uses: openwrt/actions-shared-workflows/.github/workflows/push-containers.yml@main
|
||||
26
.github/workflows/scripts/ci_helpers.sh
vendored
26
.github/workflows/scripts/ci_helpers.sh
vendored
@@ -1,26 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
color_out() {
|
||||
printf "\e[0;$1m%s\e[0;0m\n" "$2"
|
||||
}
|
||||
|
||||
success() {
|
||||
color_out 32 "$1"
|
||||
}
|
||||
|
||||
info() {
|
||||
color_out 36 "$1"
|
||||
}
|
||||
|
||||
err() {
|
||||
color_out 31 "$1"
|
||||
}
|
||||
|
||||
warn() {
|
||||
color_out 33 "$1"
|
||||
}
|
||||
|
||||
err_die() {
|
||||
err "$1"
|
||||
exit 1
|
||||
}
|
||||
15
.github/workflows/scripts/show_build_failures.sh
vendored
15
.github/workflows/scripts/show_build_failures.sh
vendored
@@ -1,15 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
original_exit_code="${ret:-1}"
|
||||
log_dir_path="${1:-logs}"
|
||||
context="${2:-10}"
|
||||
|
||||
show_make_build_errors() {
|
||||
grep -slr 'make\[[[:digit:]]\+\].*Error [[:digit:]]\+$' "$log_dir_path" | while IFS= read -r log_file; do
|
||||
printf "====== Make errors from %s ======\n" "$log_file";
|
||||
grep -r -C"$context" 'make\[[[:digit:]]\+\].*Error [[:digit:]]\+$' "$log_file" ;
|
||||
done
|
||||
}
|
||||
|
||||
show_make_build_errors
|
||||
exit "$original_exit_code"
|
||||
29
.github/workflows/toolchain.yml
vendored
29
.github/workflows/toolchain.yml
vendored
@@ -1,29 +0,0 @@
|
||||
name: Build Toolchains
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- '.github/workflows/toolchain.yml'
|
||||
- 'toolchain/**'
|
||||
push:
|
||||
paths:
|
||||
- '.github/workflows/toolchain.yml'
|
||||
- 'toolchain/**'
|
||||
branches-ignore:
|
||||
- master
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
||||
|
||||
jobs:
|
||||
build-toolchains:
|
||||
name: Build Toolchains for each target
|
||||
permissions:
|
||||
contents: read
|
||||
packages: read
|
||||
actions: write
|
||||
uses: openwrt/actions-shared-workflows/.github/workflows/toolchain.yml@main
|
||||
27
.github/workflows/tools.yml
vendored
27
.github/workflows/tools.yml
vendored
@@ -1,27 +0,0 @@
|
||||
name: Build host tools
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- 'include/**'
|
||||
- 'tools/**'
|
||||
- '.github/workflows/tools.yml'
|
||||
push:
|
||||
paths:
|
||||
- 'include/**'
|
||||
- 'tools/**'
|
||||
- '.github/workflows/tools.yml'
|
||||
branches-ignore:
|
||||
- master
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
||||
|
||||
jobs:
|
||||
build-tools:
|
||||
name: Build host tools for linux and macos based systems
|
||||
uses: openwrt/actions-shared-workflows/.github/workflows/tools.yml@main
|
||||
7
.gitignore
vendored
7
.gitignore
vendored
@@ -5,7 +5,6 @@
|
||||
/dl
|
||||
/.config
|
||||
/.config.old
|
||||
/.toolchain_build_ver
|
||||
/bin
|
||||
/build_dir
|
||||
/staging_dir
|
||||
@@ -14,15 +13,11 @@
|
||||
/feeds
|
||||
/feeds.conf
|
||||
/files
|
||||
/target/linux/feeds
|
||||
/overlay
|
||||
/package/feeds
|
||||
/package/openwrt-packages
|
||||
/*.patch
|
||||
/llvm-bpf*
|
||||
key-build*
|
||||
private-key.pem
|
||||
public-key.pem
|
||||
*.orig
|
||||
*.rej
|
||||
*~
|
||||
@@ -34,4 +29,4 @@ git-src
|
||||
.project
|
||||
.cproject
|
||||
.ccache
|
||||
.vscode*
|
||||
.vscode
|
||||
|
||||
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"git.alwaysSignOff": true
|
||||
}
|
||||
10
Config.in
10
Config.in
@@ -5,7 +5,7 @@
|
||||
mainmenu "OpenWrt Configuration"
|
||||
|
||||
config MODULES
|
||||
modules
|
||||
option modules
|
||||
bool
|
||||
default y
|
||||
|
||||
@@ -13,14 +13,6 @@ config HAVE_DOT_CONFIG
|
||||
bool
|
||||
default y
|
||||
|
||||
HOST_OS := $(shell, uname)
|
||||
|
||||
config HOST_OS_LINUX
|
||||
def_bool $(shell, ./config/check-uname.sh Linux)
|
||||
|
||||
config HOST_OS_MACOS
|
||||
def_bool $(shell, ./config/check-uname.sh Darwin)
|
||||
|
||||
source "target/Config.in"
|
||||
|
||||
source "config/Config-images.in"
|
||||
|
||||
28
Makefile
28
Makefile
@@ -14,10 +14,8 @@ $(if $(findstring $(space),$(TOPDIR)),$(error ERROR: The path to the OpenWrt dir
|
||||
|
||||
world:
|
||||
|
||||
DISTRO_PKG_CONFIG:=$(shell $(TOPDIR)/scripts/command_all.sh pkg-config | grep -e '/usr' -e '/nix/store' -m 1)
|
||||
|
||||
export ORIG_PATH:=$(if $(ORIG_PATH),$(ORIG_PATH),$(PATH))
|
||||
export PATH:=$(if $(STAGING_DIR),$(abspath $(STAGING_DIR)/../host/bin),$(TOPDIR)/staging_dir/host/bin):$(PATH)
|
||||
DISTRO_PKG_CONFIG:=$(shell which -a pkg-config | grep -E '\/usr' | head -n 1)
|
||||
export PATH:=$(TOPDIR)/staging_dir/host/bin:$(PATH)
|
||||
|
||||
ifneq ($(OPENWRT_BUILD),1)
|
||||
_SINGLE=export MAKEFLAGS=$(space);
|
||||
@@ -40,10 +38,7 @@ else
|
||||
include tools/Makefile
|
||||
include toolchain/Makefile
|
||||
|
||||
# Include the test suite Makefile if it exists
|
||||
-include tests/Makefile
|
||||
|
||||
$(toolchain/stamp-compile): $(tools/stamp-compile) $(if $(CONFIG_BUILDBOT),toolchain_rebuild_check)
|
||||
$(toolchain/stamp-compile): $(tools/stamp-compile)
|
||||
$(target/stamp-compile): $(toolchain/stamp-compile) $(tools/stamp-compile) $(BUILD_DIR)/.prepared
|
||||
$(package/stamp-compile): $(target/stamp-compile) $(package/stamp-cleanup)
|
||||
$(package/stamp-install): $(package/stamp-compile)
|
||||
@@ -55,23 +50,14 @@ printdb:
|
||||
|
||||
prepare: $(target/stamp-compile)
|
||||
|
||||
_clean: FORCE
|
||||
rm -rf $(BUILD_DIR) $(STAGING_DIR) $(BIN_DIR) $(OUTPUT_DIR)/packages/$(ARCH_PACKAGES) $(TOPDIR)/staging_dir/packages
|
||||
clean: FORCE
|
||||
rm -rf $(BUILD_DIR) $(STAGING_DIR) $(BIN_DIR) $(OUTPUT_DIR)/packages/$(ARCH_PACKAGES) $(BUILD_LOG_DIR) $(TOPDIR)/staging_dir/packages
|
||||
|
||||
clean: _clean
|
||||
rm -rf $(BUILD_LOG_DIR)
|
||||
|
||||
targetclean: _clean
|
||||
rm -rf $(TOOLCHAIN_DIR) $(BUILD_DIR_BASE)/hostpkg $(BUILD_DIR_TOOLCHAIN)
|
||||
|
||||
dirclean: targetclean clean
|
||||
rm -rf $(STAGING_DIR_HOST) $(STAGING_DIR_HOSTPKG) $(BUILD_DIR_BASE)/host
|
||||
dirclean: clean
|
||||
rm -rf $(STAGING_DIR_HOST) $(STAGING_DIR_HOSTPKG) $(TOOLCHAIN_DIR) $(BUILD_DIR_BASE)/host $(BUILD_DIR_BASE)/hostpkg $(BUILD_DIR_TOOLCHAIN)
|
||||
rm -rf $(TMP_DIR)
|
||||
$(MAKE) -C $(TOPDIR)/scripts/config clean
|
||||
|
||||
toolchain_rebuild_check:
|
||||
$(SCRIPT_DIR)/check-toolchain-clean.sh
|
||||
|
||||
cacheclean:
|
||||
ifneq ($(CONFIG_CCACHE),)
|
||||
$(STAGING_DIR_HOST)/bin/ccache -C
|
||||
|
||||
35
README.md
35
README.md
@@ -11,27 +11,9 @@ full customization, to use the device in ways never envisioned.
|
||||
|
||||
Sunshine!
|
||||
|
||||
## Download
|
||||
|
||||
Built firmware images are available for many architectures and come with a
|
||||
package selection to be used as WiFi home router. To quickly find a factory
|
||||
image usable to migrate from a vendor stock firmware to OpenWrt, try the
|
||||
*Firmware Selector*.
|
||||
|
||||
* [OpenWrt Firmware Selector](https://firmware-selector.openwrt.org/)
|
||||
|
||||
If your device is supported, please follow the **Info** link to see install
|
||||
instructions or consult the support resources listed below.
|
||||
|
||||
##
|
||||
|
||||
An advanced user may require additional or specific package. (Toolchain, SDK, ...) For everything else than simple firmware download, try the wiki download page:
|
||||
|
||||
* [OpenWrt Wiki Download](https://openwrt.org/downloads)
|
||||
|
||||
## Development
|
||||
|
||||
To build your own firmware you need a GNU/Linux, BSD or macOS system (case
|
||||
To build your own firmware you need a GNU/Linux, BSD or MacOSX system (case
|
||||
sensitive filesystem required). Cygwin is unsupported because of the lack of a
|
||||
case sensitive file system.
|
||||
|
||||
@@ -43,8 +25,8 @@ the [Build System Setup](https://openwrt.org/docs/guide-developer/build-system/i
|
||||
documentation.
|
||||
|
||||
```
|
||||
binutils bzip2 diff find flex gawk gcc-6+ getopt grep install libc-dev libz-dev
|
||||
make4.1+ perl python3.7+ rsync subversion unzip which
|
||||
gcc binutils bzip2 flex python3 perl make find grep diff unzip gawk getopt
|
||||
subversion libz-dev libc-dev rsync which
|
||||
```
|
||||
|
||||
### Quickstart
|
||||
@@ -75,11 +57,8 @@ packages to OpenWrt, please find the fitting repository below.
|
||||
* [OpenWrt Packages](https://github.com/openwrt/packages): Community repository
|
||||
of ported packages.
|
||||
|
||||
* [OpenWrt Routing](https://github.com/openwrt/routing): Packages specifically
|
||||
focused on (mesh) routing.
|
||||
|
||||
* [OpenWrt Video](https://github.com/openwrt/video): Packages specifically
|
||||
focused on display servers and clients (Xorg and Wayland).
|
||||
* [OpenWrt Routing](https://github.com/openwrt-routing/packages): Packages
|
||||
specifically focused on (mesh) routing.
|
||||
|
||||
## Support Information
|
||||
|
||||
@@ -95,13 +74,13 @@ For a list of supported devices see the [OpenWrt Hardware Database](https://open
|
||||
### Support Community
|
||||
|
||||
* [Forum](https://forum.openwrt.org): For usage, projects, discussions and hardware advise.
|
||||
* [Support Chat](https://webchat.oftc.net/#openwrt): Channel `#openwrt` on **oftc.net**.
|
||||
* [Support Chat](https://webchat.freenode.net/#openwrt): Channel `#openwrt` on freenode.net.
|
||||
|
||||
### Developer Community
|
||||
|
||||
* [Bug Reports](https://bugs.openwrt.org): Report bugs in OpenWrt
|
||||
* [Dev Mailing List](https://lists.openwrt.org/mailman/listinfo/openwrt-devel): Send patches
|
||||
* [Dev Chat](https://webchat.oftc.net/#openwrt-devel): Channel `#openwrt-devel` on **oftc.net**.
|
||||
* [Dev Chat](https://webchat.freenode.net/#openwrt-devel): Channel `#openwrt-devel` on freenode.net.
|
||||
|
||||
## License
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
config EXPERIMENTAL
|
||||
bool "Enable experimental features by default"
|
||||
default n
|
||||
help
|
||||
Set this option to build with latest bleeding edge features
|
||||
which may or may not work as expected.
|
||||
@@ -13,27 +14,19 @@ config EXPERIMENTAL
|
||||
positive and negative). But do so only if you know how to
|
||||
recover your device in case of flashing potentially non-working
|
||||
firmware.
|
||||
|
||||
|
||||
If you plan to use this build in production, say NO!
|
||||
|
||||
menu "Global build settings"
|
||||
|
||||
config JSON_OVERVIEW_IMAGE_INFO
|
||||
bool "Create JSON info file overview per target"
|
||||
default y
|
||||
default BUILDBOT
|
||||
help
|
||||
Create a JSON info file called profiles.json in the target
|
||||
directory containing machine readable list of built profiles
|
||||
and resulting images.
|
||||
|
||||
config JSON_CYCLONEDX_SBOM
|
||||
bool "Create CycloneDX SBOM JSON"
|
||||
default BUILDBOT
|
||||
help
|
||||
Create a JSON files *.bom.cdx.json in the build
|
||||
directory containing Software Bill Of Materials in CycloneDX
|
||||
format.
|
||||
|
||||
config ALL_NONSHARED
|
||||
bool "Select all target specific packages by default"
|
||||
select ALL_KMODS
|
||||
@@ -49,6 +42,7 @@ menu "Global build settings"
|
||||
|
||||
config BUILDBOT
|
||||
bool "Set build defaults for automatic builds (e.g. via buildbot)"
|
||||
default n
|
||||
help
|
||||
This option changes several defaults to be more suitable for
|
||||
automatic builds. This includes the following changes:
|
||||
@@ -64,15 +58,6 @@ menu "Global build settings"
|
||||
bool "Enable signature checking in opkg"
|
||||
default SIGNED_PACKAGES
|
||||
|
||||
config DOWNLOAD_CHECK_CERTIFICATE
|
||||
bool "Enable TLS certificate verification during package download"
|
||||
default y
|
||||
|
||||
config USE_APK
|
||||
imply PACKAGE_apk-mbedtls
|
||||
bool "Use APK instead of OPKG to build distribution (BROKEN)"
|
||||
depends on BROKEN
|
||||
|
||||
comment "General build options"
|
||||
|
||||
config TESTING_KERNEL
|
||||
@@ -86,8 +71,10 @@ menu "Global build settings"
|
||||
|
||||
config DISPLAY_SUPPORT
|
||||
bool "Show packages that require graphics support (local or remote)"
|
||||
default n
|
||||
|
||||
config BUILD_PATENTED
|
||||
default n
|
||||
bool "Compile with support for patented functionality"
|
||||
help
|
||||
When this option is disabled, software which provides patented functionality
|
||||
@@ -95,6 +82,7 @@ menu "Global build settings"
|
||||
functionality, this optional support will get disabled for this package.
|
||||
|
||||
config BUILD_NLS
|
||||
default n
|
||||
bool "Compile with full language support"
|
||||
help
|
||||
When this option is enabled, packages are built with the full versions of
|
||||
@@ -108,6 +96,7 @@ menu "Global build settings"
|
||||
config CLEAN_IPKG
|
||||
bool
|
||||
prompt "Remove ipkg/opkg status data files in final images"
|
||||
default n
|
||||
help
|
||||
This removes all ipkg/opkg status data files from the target directory
|
||||
before building the root filesystem.
|
||||
@@ -115,13 +104,14 @@ menu "Global build settings"
|
||||
config IPK_FILES_CHECKSUMS
|
||||
bool
|
||||
prompt "Record files checksums in package metadata"
|
||||
depends on !USE_APK
|
||||
default n
|
||||
help
|
||||
This makes file checksums part of package metadata. It increases size
|
||||
but provides you with pkg_check command to check for flash corruptions.
|
||||
but provides you with pkg_check command to check for flash coruptions.
|
||||
|
||||
config INCLUDE_CONFIG
|
||||
bool "Include build configuration in firmware" if DEVEL
|
||||
default n
|
||||
help
|
||||
If enabled, buildinfo files will be stored in /etc/build.* of firmware.
|
||||
|
||||
@@ -155,44 +145,22 @@ menu "Global build settings"
|
||||
config DEBUG
|
||||
bool
|
||||
prompt "Compile packages with debugging info"
|
||||
default n
|
||||
help
|
||||
Adds -g3 to the CFLAGS.
|
||||
|
||||
config USE_GC_SECTIONS
|
||||
bool
|
||||
prompt "Dead code and data elimination for all packages (EXPERIMENTAL)"
|
||||
help
|
||||
Places functions and data items into its own sections to use the linker's
|
||||
garbage collection capabilites.
|
||||
Packages can choose to opt-out via setting PKG_BUILD_FLAGS:=no-gc-sections
|
||||
|
||||
config USE_LTO
|
||||
bool
|
||||
prompt "Use the link-time optimizer for all packages (EXPERIMENTAL)"
|
||||
help
|
||||
Adds LTO flags to the CFLAGS and LDFLAGS.
|
||||
Packages can choose to opt-out via setting PKG_BUILD_FLAGS:=no-lto
|
||||
|
||||
config MOLD
|
||||
depends on (aarch64 || arm || i386 || i686 || m68k || powerpc || powerpc64 || sh4 || x86_64)
|
||||
depends on !GCC_USE_VERSION_11
|
||||
def_bool $(shell, ./config/check-hostcxx.sh 10 2 12)
|
||||
|
||||
config USE_MOLD
|
||||
bool
|
||||
prompt "Use the mold linker for all packages"
|
||||
depends on MOLD
|
||||
help
|
||||
Link packages with mold, a modern linker
|
||||
Packages can opt-out via setting PKG_BUILD_FLAGS:=no-mold
|
||||
|
||||
config IPV6
|
||||
def_bool y
|
||||
bool
|
||||
prompt "Enable IPv6 support in packages"
|
||||
default y
|
||||
help
|
||||
Enables IPv6 support in kernel (builtin) and packages.
|
||||
|
||||
comment "Stripping options"
|
||||
|
||||
choice
|
||||
prompt "Binary stripping method"
|
||||
default USE_STRIP if EXTERNAL_TOOLCHAIN
|
||||
default USE_STRIP if USE_GLIBC
|
||||
default USE_SSTRIP
|
||||
help
|
||||
@@ -209,6 +177,7 @@ menu "Global build settings"
|
||||
help
|
||||
This will install binaries stripped using strip from binutils.
|
||||
|
||||
|
||||
config USE_SSTRIP
|
||||
bool "sstrip"
|
||||
depends on !USE_GLIBC
|
||||
@@ -225,16 +194,16 @@ menu "Global build settings"
|
||||
help
|
||||
Specifies arguments passed to the strip command when stripping binaries.
|
||||
|
||||
config SSTRIP_DISCARD_TRAILING_ZEROES
|
||||
bool "Strip trailing zero bytes"
|
||||
depends on USE_SSTRIP && !USE_MOLD
|
||||
default y
|
||||
config SSTRIP_ARGS
|
||||
string
|
||||
prompt "Sstrip arguments"
|
||||
depends on USE_SSTRIP
|
||||
default "-z"
|
||||
help
|
||||
Use sstrip's -z option to discard trailing zero bytes
|
||||
Specifies arguments passed to the sstrip command when stripping binaries.
|
||||
|
||||
config STRIP_KERNEL_EXPORTS
|
||||
bool "Strip unnecessary exports from the kernel image"
|
||||
depends on BROKEN
|
||||
help
|
||||
Reduces kernel size by stripping unused kernel exports from the kernel
|
||||
image. Note that this might make the kernel incompatible with any kernel
|
||||
@@ -248,6 +217,20 @@ menu "Global build settings"
|
||||
make the system libraries incompatible with most of the packages that are
|
||||
not selected during the build process.
|
||||
|
||||
choice
|
||||
prompt "Preferred standard C++ library"
|
||||
default USE_LIBSTDCXX if USE_GLIBC
|
||||
default USE_UCLIBCXX
|
||||
help
|
||||
Select the preferred standard C++ library for all packages that support this.
|
||||
|
||||
config USE_UCLIBCXX
|
||||
bool "uClibc++"
|
||||
|
||||
config USE_LIBSTDCXX
|
||||
bool "libstdc++"
|
||||
endchoice
|
||||
|
||||
comment "Hardening build options"
|
||||
|
||||
config PKG_CHECK_FORMAT_SECURITY
|
||||
@@ -296,22 +279,10 @@ menu "Global build settings"
|
||||
Enable GCC Stack Smashing Protection (SSP) for userspace applications
|
||||
config PKG_CC_STACKPROTECTOR_NONE
|
||||
bool "None"
|
||||
help
|
||||
No stack smashing protection.
|
||||
config PKG_CC_STACKPROTECTOR_REGULAR
|
||||
bool "Regular"
|
||||
help
|
||||
Protects functions with vulnerable objects.
|
||||
This includes functions with buffers larger than 8 bytes or calls to alloca.
|
||||
config PKG_CC_STACKPROTECTOR_STRONG
|
||||
bool "Strong"
|
||||
help
|
||||
Like Regular, but also protects functions with
|
||||
local arrays or references to local frame addresses.
|
||||
config PKG_CC_STACKPROTECTOR_ALL
|
||||
bool "All"
|
||||
help
|
||||
Protects all functions.
|
||||
endchoice
|
||||
|
||||
choice
|
||||
@@ -321,18 +292,10 @@ menu "Global build settings"
|
||||
Enable GCC Stack-Smashing Protection (SSP) for the kernel
|
||||
config KERNEL_CC_STACKPROTECTOR_NONE
|
||||
bool "None"
|
||||
help
|
||||
No stack smashing protection.
|
||||
config KERNEL_CC_STACKPROTECTOR_REGULAR
|
||||
bool "Regular"
|
||||
help
|
||||
Protects functions with vulnerable objects.
|
||||
This includes functions with buffers larger than 8 bytes or calls to alloca.
|
||||
config KERNEL_CC_STACKPROTECTOR_STRONG
|
||||
bool "Strong"
|
||||
help
|
||||
Like Regular, but also protects functions with
|
||||
local arrays or references to local frame addresses.
|
||||
endchoice
|
||||
|
||||
config KERNEL_STACKPROTECTOR
|
||||
@@ -423,16 +386,4 @@ menu "Global build settings"
|
||||
|
||||
endchoice
|
||||
|
||||
config SECCOMP
|
||||
bool "Enable SECCOMP"
|
||||
select KERNEL_SECCOMP
|
||||
select PACKAGE_procd-seccomp
|
||||
depends on (aarch64 || arm || armeb || mips || mipsel || mips64 || mips64el || i386 || powerpc || x86_64)
|
||||
depends on !TARGET_uml
|
||||
default y
|
||||
help
|
||||
This option enables seccomp kernel features to safely
|
||||
execute untrusted bytecode and selects the seccomp-variants
|
||||
of procd
|
||||
|
||||
endmenu
|
||||
|
||||
@@ -4,9 +4,11 @@
|
||||
|
||||
menuconfig DEVEL
|
||||
bool "Advanced configuration options (for developers)"
|
||||
default n
|
||||
|
||||
config BROKEN
|
||||
bool "Show broken platforms / packages / devices" if DEVEL
|
||||
default n
|
||||
|
||||
config BINARY_FOLDER
|
||||
string "Binary folder" if DEVEL
|
||||
@@ -15,20 +17,6 @@ menuconfig DEVEL
|
||||
Store built firmware images and filesystem images in this directory.
|
||||
If not set, uses './bin/$(BOARD)'
|
||||
|
||||
config DOWNLOAD_TOOL_CUSTOM
|
||||
string "Use custom download tool" if DEVEL
|
||||
default ""
|
||||
help
|
||||
Use and force custom download tool instead of relying on autoselection
|
||||
between curl if available and wget as a fallback.
|
||||
|
||||
download.pl supports 3 tools officially aria2c, curl and wget.
|
||||
If one of the tool is used in this config, download.pl will use the
|
||||
default args to make use of them.
|
||||
|
||||
If the provided string is different than aria2c, curl or wget, the command
|
||||
is used as is and the download url will be appended at the end of such command.
|
||||
|
||||
config DOWNLOAD_FOLDER
|
||||
string "Download folder" if DEVEL
|
||||
default ""
|
||||
@@ -51,17 +39,12 @@ menuconfig DEVEL
|
||||
|
||||
config AUTOREMOVE
|
||||
bool "Automatic removal of build directories" if DEVEL
|
||||
default n
|
||||
help
|
||||
Automatically delete build directories after make target completed.
|
||||
This allows you to symlink build_dir into a scratch location, e.g. a ramdisk,
|
||||
which does not have enough space to keep a complete build_dir.
|
||||
|
||||
config BUILD_ALL_HOST_TOOLS
|
||||
bool "Compile all host tools" if DEVEL
|
||||
help
|
||||
Compile all host host tools even if not needed. This is needed to prepare a
|
||||
universal precompiled host tools archive to use in another buildroot.
|
||||
|
||||
config BUILD_SUFFIX
|
||||
string "Build suffix to append to the target BUILD_DIR variable" if DEVEL
|
||||
default ""
|
||||
@@ -80,6 +63,7 @@ menuconfig DEVEL
|
||||
|
||||
config CCACHE
|
||||
bool "Use ccache" if DEVEL
|
||||
default n
|
||||
help
|
||||
Compiler cache; see https://ccache.samba.org/
|
||||
|
||||
@@ -90,11 +74,6 @@ menuconfig DEVEL
|
||||
Store ccache in this directory.
|
||||
If not set, uses './.ccache'
|
||||
|
||||
config KERNEL_CFLAGS
|
||||
string "Kernel extra CFLAGS" if DEVEL
|
||||
default "-falign-functions=32" if TARGET_bcm53xx
|
||||
default ""
|
||||
|
||||
config EXTERNAL_KERNEL_TREE
|
||||
string "Use external kernel tree" if DEVEL
|
||||
default ""
|
||||
|
||||
@@ -17,8 +17,6 @@ menu "Target Images"
|
||||
default TARGET_INITRAMFS_COMPRESSION_LZMA if TARGET_lantiq
|
||||
default TARGET_INITRAMFS_COMPRESSION_LZMA if TARGET_mpc85xx
|
||||
default TARGET_INITRAMFS_COMPRESSION_LZMA if TARGET_ramips
|
||||
default TARGET_INITRAMFS_COMPRESSION_ZSTD if TARGET_qualcommax
|
||||
default TARGET_INITRAMFS_COMPRESSION_XZ if USES_SEPARATE_INITRAMFS
|
||||
default TARGET_INITRAMFS_COMPRESSION_NONE
|
||||
depends on TARGET_ROOTFS_INITRAMFS
|
||||
help
|
||||
@@ -44,9 +42,6 @@ menu "Target Images"
|
||||
|
||||
config TARGET_INITRAMFS_COMPRESSION_XZ
|
||||
bool "xz"
|
||||
|
||||
config TARGET_INITRAMFS_COMPRESSION_ZSTD
|
||||
bool "zstd"
|
||||
endchoice
|
||||
|
||||
config EXTERNAL_CPIO
|
||||
@@ -57,19 +52,11 @@ menu "Target Images"
|
||||
Kernel uses specified external cpio as INITRAMFS_SOURCE.
|
||||
|
||||
config TARGET_INITRAMFS_FORCE
|
||||
bool "Force"
|
||||
depends on TARGET_ROOTFS_INITRAMFS
|
||||
help
|
||||
Ignore the initramfs passed by the bootloader.
|
||||
|
||||
config TARGET_ROOTFS_INITRAMFS_SEPARATE
|
||||
bool "separate ramdisk"
|
||||
depends on USES_SEPARATE_INITRAMFS && TARGET_ROOTFS_INITRAMFS && !TARGET_INITRAMFS_FORCE
|
||||
default y if USES_SEPARATE_INITRAMFS
|
||||
help
|
||||
Generate separate initrd.cpio instead of embedding it.
|
||||
This is useful for generating images with a dedicated
|
||||
ramdisk e.g. in U-Boot's uImage and uImage.FIT formats.
|
||||
bool "Force"
|
||||
depends on TARGET_ROOTFS_INITRAMFS
|
||||
default n
|
||||
help
|
||||
Ignore the initramfs passed by the bootloader.
|
||||
|
||||
comment "Root filesystem archives"
|
||||
|
||||
@@ -127,7 +114,7 @@ menu "Target Images"
|
||||
config TARGET_EXT4_JOURNAL
|
||||
bool "Create a journaling filesystem"
|
||||
depends on TARGET_ROOTFS_EXT4FS
|
||||
default y
|
||||
default n
|
||||
help
|
||||
Create an ext4 filesystem with a journal.
|
||||
|
||||
@@ -148,7 +135,7 @@ menu "Target Images"
|
||||
bool "squashfs"
|
||||
default y if USES_SQUASHFS
|
||||
help
|
||||
Build a squashfs root filesystem.
|
||||
Build a squashfs-lzma root filesystem.
|
||||
|
||||
config TARGET_SQUASHFS_BLOCK_SIZE
|
||||
int "Block size (in KiB)"
|
||||
@@ -156,9 +143,6 @@ menu "Target Images"
|
||||
default 64 if LOW_MEMORY_FOOTPRINT
|
||||
default 1024 if (SMALL_FLASH && !LOW_MEMORY_FOOTPRINT)
|
||||
default 256
|
||||
help
|
||||
Select squashfs block size, must be one of:
|
||||
4, 8, 16, 32, 64, 128, 256, 512, 1024
|
||||
|
||||
menuconfig TARGET_ROOTFS_UBIFS
|
||||
bool "ubifs"
|
||||
@@ -200,18 +184,14 @@ menu "Target Images"
|
||||
depends on TARGET_x86
|
||||
depends on TARGET_ROOTFS_EXT4FS || TARGET_ROOTFS_JFFS2 || TARGET_ROOTFS_SQUASHFS
|
||||
select PACKAGE_grub2
|
||||
select PACKAGE_grub2-bios-setup
|
||||
default y
|
||||
|
||||
config GRUB_EFI_IMAGES
|
||||
bool "Build GRUB EFI images"
|
||||
depends on TARGET_x86 || TARGET_armsr || TARGET_loongarch64
|
||||
bool "Build GRUB EFI images (Linux x86 or x86_64 host only)"
|
||||
depends on TARGET_x86
|
||||
depends on TARGET_ROOTFS_EXT4FS || TARGET_ROOTFS_JFFS2 || TARGET_ROOTFS_SQUASHFS
|
||||
select PACKAGE_grub2 if TARGET_x86
|
||||
select PACKAGE_grub2-efi if TARGET_x86
|
||||
select PACKAGE_grub2-bios-setup if TARGET_x86
|
||||
select PACKAGE_grub2-efi-arm if TARGET_armsr
|
||||
select PACKAGE_grub2-efi-loongarch64 if TARGET_loongarch64
|
||||
select PACKAGE_grub2
|
||||
select PACKAGE_grub2-efi
|
||||
select PACKAGE_kmod-fs-vfat
|
||||
default y
|
||||
|
||||
@@ -220,6 +200,11 @@ menu "Target Images"
|
||||
depends on GRUB_IMAGES || GRUB_EFI_IMAGES
|
||||
default y
|
||||
|
||||
config GRUB_SERIAL
|
||||
string "Serial port device"
|
||||
depends on GRUB_IMAGES || GRUB_EFI_IMAGES
|
||||
default "ttyS0"
|
||||
|
||||
config GRUB_BAUDRATE
|
||||
int "Serial port baud rate"
|
||||
depends on GRUB_IMAGES || GRUB_EFI_IMAGES
|
||||
@@ -228,8 +213,8 @@ menu "Target Images"
|
||||
|
||||
config GRUB_FLOWCONTROL
|
||||
bool "Use RTE/CTS on serial console"
|
||||
depends on GRUB_IMAGES || GRUB_EFI_IMAGES
|
||||
depends on TARGET_SERIAL != ""
|
||||
depends on GRUB_SERIAL != ""
|
||||
default n
|
||||
|
||||
config GRUB_BOOTOPTS
|
||||
string "Extra kernel boot options"
|
||||
@@ -265,44 +250,29 @@ menu "Target Images"
|
||||
|
||||
config VMDK_IMAGES
|
||||
bool "Build VMware image files (VMDK)"
|
||||
depends on TARGET_x86 || TARGET_armsr
|
||||
depends on GRUB_IMAGES || GRUB_EFI_IMAGES
|
||||
select PACKAGE_kmod-e1000
|
||||
|
||||
config VHDX_IMAGES
|
||||
bool "Build Hyper-V image files (VHDX)"
|
||||
depends on TARGET_x86
|
||||
depends on GRUB_IMAGES || GRUB_EFI_IMAGES
|
||||
select PACKAGE_kmod-e1000
|
||||
|
||||
config TARGET_SERIAL
|
||||
string "Serial port device"
|
||||
depends on TARGET_x86 || TARGET_armsr || TARGET_loongarch64
|
||||
default "ttyS0"
|
||||
|
||||
config TARGET_IMAGES_GZIP
|
||||
bool "GZip images"
|
||||
depends on TARGET_ROOTFS_EXT4FS || TARGET_x86 || TARGET_armsr || TARGET_malta || TARGET_loongarch64
|
||||
depends on TARGET_ROOTFS_EXT4FS || TARGET_x86 || TARGET_armvirt || TARGET_malta
|
||||
default y
|
||||
|
||||
comment "Image Options"
|
||||
|
||||
source "target/linux/*/image/Config.in"
|
||||
source "target/linux/*/*/image/Config.in"
|
||||
|
||||
config TARGET_KERNEL_PARTSIZE
|
||||
int "Kernel partition size (in MiB)"
|
||||
int "Kernel partition size (in MB)"
|
||||
depends on USES_BOOT_PART
|
||||
default 8 if TARGET_apm821xx_sata
|
||||
default 64 if TARGET_bcm27xx
|
||||
default 128 if TARGET_armsr
|
||||
default 16
|
||||
|
||||
config TARGET_ROOTFS_PARTSIZE
|
||||
int "Root filesystem partition size (in MiB)"
|
||||
depends on USES_ROOTFS_PART || TARGET_ROOTFS_EXT4FS
|
||||
default 232 if TARGET_loongarch64
|
||||
default 448 if TARGET_mediatek
|
||||
int "Root filesystem partition size (in MB)"
|
||||
depends on USES_ROOTFS_PART || TARGET_ROOTFS_EXT4FS || TARGET_omap || TARGET_sunxi || TARGET_uml
|
||||
default 104
|
||||
help
|
||||
Select the root filesystem partition size.
|
||||
@@ -315,11 +285,4 @@ menu "Target Images"
|
||||
it will be mounted by PARTUUID which makes the kernel find the
|
||||
appropriate disk automatically.
|
||||
|
||||
config TARGET_ROOTFS_PERSIST_VAR
|
||||
bool "Make /var persistent"
|
||||
help
|
||||
Do not symlink /var to /tmp, so that its content will persist
|
||||
across reboots. When enabled, /var/run will still be linked
|
||||
to /tmp/run.
|
||||
|
||||
endmenu
|
||||
|
||||
@@ -24,6 +24,11 @@ config KERNEL_PRINTK
|
||||
bool "Enable support for printk"
|
||||
default y
|
||||
|
||||
config KERNEL_CRASHLOG
|
||||
bool "Crash logging"
|
||||
depends on !(arm || powerpc || sparc || TARGET_uml || i386 || x86_64)
|
||||
default y
|
||||
|
||||
config KERNEL_SWAP
|
||||
bool "Support for paging of anonymous memory (swap)"
|
||||
default y if !SMALL_FLASH
|
||||
@@ -47,25 +52,12 @@ config KERNEL_MIPS_FP_SUPPORT
|
||||
|
||||
config KERNEL_ARM_PMU
|
||||
bool
|
||||
default y if TARGET_armsr_armv8
|
||||
default n
|
||||
depends on (arm || aarch64)
|
||||
|
||||
config KERNEL_ARM_PMUV3
|
||||
bool
|
||||
default y if TARGET_armsr_armv8
|
||||
depends on (arm_v7 || aarch64) && LINUX_6_6
|
||||
|
||||
config KERNEL_RISCV_PMU
|
||||
bool
|
||||
select KERNEL_RISCV_PMU_SBI
|
||||
depends on riscv64
|
||||
|
||||
config KERNEL_RISCV_PMU_SBI
|
||||
bool
|
||||
depends on riscv64
|
||||
|
||||
config KERNEL_X86_VSYSCALL_EMULATION
|
||||
bool "Enable vsyscall emulation"
|
||||
default n
|
||||
depends on x86_64
|
||||
help
|
||||
This enables emulation of the legacy vsyscall page. Disabling
|
||||
@@ -83,22 +75,17 @@ config KERNEL_X86_VSYSCALL_EMULATION
|
||||
|
||||
config KERNEL_PERF_EVENTS
|
||||
bool "Compile the kernel with performance events and counters"
|
||||
default n
|
||||
select KERNEL_ARM_PMU if (arm || aarch64)
|
||||
select KERNEL_ARM_PMUV3 if (arm_v7 || aarch64) && LINUX_6_6
|
||||
select KERNEL_RISCV_PMU if riscv64
|
||||
|
||||
config KERNEL_PROFILING
|
||||
bool "Compile the kernel with profiling enabled"
|
||||
default n
|
||||
select KERNEL_PERF_EVENTS
|
||||
help
|
||||
Enable the extended profiling support mechanisms used by profilers such
|
||||
as OProfile.
|
||||
|
||||
config KERNEL_RPI_AXIPERF
|
||||
bool "Compile the kernel with RaspberryPi AXI Performance monitors"
|
||||
default y
|
||||
depends on KERNEL_PERF_EVENTS && TARGET_bcm27xx
|
||||
|
||||
config KERNEL_UBSAN
|
||||
bool "Compile the kernel with undefined behaviour sanity checker"
|
||||
help
|
||||
@@ -127,16 +114,6 @@ config KERNEL_UBSAN_ALIGNMENT
|
||||
Enabling this option on architectures that support unaligned
|
||||
accesses may produce a lot of false positives.
|
||||
|
||||
config KERNEL_UBSAN_BOUNDS
|
||||
bool "Perform array index bounds checking"
|
||||
depends on KERNEL_UBSAN
|
||||
help
|
||||
This option enables detection of directly indexed out of bounds array
|
||||
accesses, where the array size is known at compile time. Note that
|
||||
this does not protect array overflows via bad calls to the
|
||||
{str,mem}*cpy() family of functions (that is addressed by
|
||||
FORTIFY_SOURCE).
|
||||
|
||||
config KERNEL_UBSAN_NULL
|
||||
bool "Enable checking of null pointers"
|
||||
depends on KERNEL_UBSAN
|
||||
@@ -144,23 +121,10 @@ config KERNEL_UBSAN_NULL
|
||||
This option enables detection of memory accesses via a
|
||||
null pointer.
|
||||
|
||||
config KERNEL_UBSAN_TRAP
|
||||
bool "On Sanitizer warnings, abort the running kernel code"
|
||||
depends on KERNEL_UBSAN
|
||||
help
|
||||
Building kernels with Sanitizer features enabled tends to grow the
|
||||
kernel size by around 5%, due to adding all the debugging text on
|
||||
failure paths. To avoid this, Sanitizer instrumentation can just
|
||||
issue a trap. This reduces the kernel size overhead but turns all
|
||||
warnings (including potentially harmless conditions) into full
|
||||
exceptions that abort the running kernel code (regardless of context,
|
||||
locks held, etc), which may destabilize the system. For some system
|
||||
builders this is an acceptable trade-off.
|
||||
|
||||
config KERNEL_KASAN
|
||||
bool "Compile the kernel with KASan: runtime memory debugger"
|
||||
select KERNEL_SLUB_DEBUG
|
||||
depends on (x86_64 || aarch64 || arm || powerpc || riscv64)
|
||||
depends on (x86_64 || aarch64)
|
||||
help
|
||||
Enables kernel address sanitizer - runtime memory debugger,
|
||||
designed to find out-of-bounds accesses and use-after-free bugs.
|
||||
@@ -173,91 +137,20 @@ config KERNEL_KASAN
|
||||
Currently CONFIG_KASAN doesn't work with CONFIG_DEBUG_SLAB
|
||||
(the resulting kernel does not boot).
|
||||
|
||||
config KERNEL_KASAN_VMALLOC
|
||||
bool "Back mappings in vmalloc space with real shadow memory"
|
||||
depends on KERNEL_KASAN
|
||||
config KERNEL_KASAN_EXTRA
|
||||
bool "KAsan: extra checks"
|
||||
depends on KERNEL_KASAN && KERNEL_DEBUG_KERNEL
|
||||
help
|
||||
By default, the shadow region for vmalloc space is the read-only
|
||||
zero page. This means that KASAN cannot detect errors involving
|
||||
vmalloc space.
|
||||
This enables further checks in the kernel address sanitizer, for now
|
||||
it only includes the address-use-after-scope check that can lead
|
||||
to excessive kernel stack usage, frame size warnings and longer
|
||||
compile time.
|
||||
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81715 has more
|
||||
|
||||
Enabling this option will hook in to vmap/vmalloc and back those
|
||||
mappings with real shadow memory allocated on demand. This allows
|
||||
for KASAN to detect more sorts of errors (and to support vmapped
|
||||
stacks), but at the cost of higher memory usage.
|
||||
|
||||
This option depends on HAVE_ARCH_KASAN_VMALLOC, but we can't
|
||||
depend on that in here, so it is possible that enabling this
|
||||
will have no effect.
|
||||
|
||||
if KERNEL_KASAN
|
||||
choice
|
||||
prompt "KASAN mode"
|
||||
depends on KERNEL_KASAN
|
||||
default KERNEL_KASAN_GENERIC
|
||||
help
|
||||
KASAN has three modes:
|
||||
|
||||
1. Generic KASAN (supported by many architectures, enabled with
|
||||
CONFIG_KASAN_GENERIC, similar to userspace ASan),
|
||||
2. Software Tag-Based KASAN (arm64 only, based on software memory
|
||||
tagging, enabled with CONFIG_KASAN_SW_TAGS, similar to userspace
|
||||
HWASan), and
|
||||
3. Hardware Tag-Based KASAN (arm64 only, based on hardware memory
|
||||
tagging, enabled with CONFIG_KASAN_HW_TAGS).
|
||||
|
||||
config KERNEL_KASAN_GENERIC
|
||||
bool "Generic KASAN"
|
||||
select KERNEL_SLUB_DEBUG
|
||||
help
|
||||
Enables Generic KASAN.
|
||||
|
||||
Consumes about 1/8th of available memory at kernel start and adds an
|
||||
overhead of ~50% for dynamic allocations.
|
||||
The performance slowdown is ~x3.
|
||||
|
||||
config KERNEL_KASAN_SW_TAGS
|
||||
bool "Software Tag-Based KASAN"
|
||||
depends on aarch64
|
||||
select KERNEL_SLUB_DEBUG
|
||||
help
|
||||
Enables Software Tag-Based KASAN.
|
||||
|
||||
Supported only on arm64 CPUs and relies on Top Byte Ignore.
|
||||
|
||||
Consumes about 1/16th of available memory at kernel start and
|
||||
add an overhead of ~20% for dynamic allocations.
|
||||
|
||||
May potentially introduce problems related to pointer casting and
|
||||
comparison, as it embeds a tag into the top byte of each pointer.
|
||||
|
||||
config KERNEL_KASAN_HW_TAGS
|
||||
bool "Hardware Tag-Based KASAN"
|
||||
depends on aarch64
|
||||
select KERNEL_SLUB_DEBUG
|
||||
select KERNEL_ARM64_MTE
|
||||
help
|
||||
Enables Hardware Tag-Based KASAN.
|
||||
|
||||
Supported only on arm64 CPUs starting from ARMv8.5 and relies on
|
||||
Memory Tagging Extension and Top Byte Ignore.
|
||||
|
||||
Consumes about 1/32nd of available memory.
|
||||
|
||||
May potentially introduce problems related to pointer casting and
|
||||
comparison, as it embeds a tag into the top byte of each pointer.
|
||||
|
||||
endchoice
|
||||
|
||||
config KERNEL_ARM64_MTE
|
||||
def_bool n
|
||||
|
||||
endif
|
||||
|
||||
choice
|
||||
prompt "Instrumentation type"
|
||||
depends on KERNEL_KASAN
|
||||
depends on !KERNEL_KASAN_HW_TAGS
|
||||
default KERNEL_KASAN_OUTLINE
|
||||
|
||||
config KERNEL_KASAN_OUTLINE
|
||||
@@ -315,6 +208,7 @@ config KERNEL_KCOV_INSTRUMENT_ALL
|
||||
|
||||
config KERNEL_TASKSTATS
|
||||
bool "Compile the kernel with task resource/io statistics and accounting"
|
||||
default n
|
||||
help
|
||||
Enable the collection and publishing of task/io statistics and
|
||||
accounting. Enable this option to enable i/o monitoring in system
|
||||
@@ -333,25 +227,6 @@ if KERNEL_TASKSTATS
|
||||
|
||||
endif
|
||||
|
||||
config KERNEL_PSI
|
||||
bool "Compile the kernel with pressure stall information tracking"
|
||||
help
|
||||
Collect metrics that indicate how overcommitted the CPU, memory,
|
||||
and IO capacity are in the system.
|
||||
|
||||
If you say Y here, the kernel will create /proc/pressure/ with the
|
||||
pressure statistics files cpu, memory, and io. These will indicate
|
||||
the share of walltime in which some or all tasks in the system are
|
||||
delayed due to contention of the respective resource.
|
||||
|
||||
In kernels with cgroup support, cgroups (cgroup2 only) will
|
||||
have cpu.pressure, memory.pressure, and io.pressure files,
|
||||
which aggregate pressure stalls for the grouped tasks only.
|
||||
|
||||
For more details see Documentation/accounting/psi.rst.
|
||||
|
||||
Say N if unsure.
|
||||
|
||||
config KERNEL_KALLSYMS
|
||||
bool "Compile the kernel with symbol table information"
|
||||
default y if !SMALL_FLASH
|
||||
@@ -361,30 +236,37 @@ config KERNEL_KALLSYMS
|
||||
config KERNEL_FTRACE
|
||||
bool "Compile the kernel with tracing support"
|
||||
depends on !TARGET_uml
|
||||
default n
|
||||
|
||||
config KERNEL_FTRACE_SYSCALLS
|
||||
bool "Trace system calls"
|
||||
depends on KERNEL_FTRACE
|
||||
default n
|
||||
|
||||
config KERNEL_ENABLE_DEFAULT_TRACERS
|
||||
bool "Trace process context switches and events"
|
||||
depends on KERNEL_FTRACE
|
||||
default n
|
||||
|
||||
config KERNEL_FUNCTION_TRACER
|
||||
bool "Function tracer"
|
||||
depends on KERNEL_FTRACE
|
||||
default n
|
||||
|
||||
config KERNEL_FUNCTION_GRAPH_TRACER
|
||||
bool "Function graph tracer"
|
||||
depends on KERNEL_FUNCTION_TRACER
|
||||
default n
|
||||
|
||||
config KERNEL_DYNAMIC_FTRACE
|
||||
bool "Enable/disable function tracing dynamically"
|
||||
depends on KERNEL_FUNCTION_TRACER
|
||||
default n
|
||||
|
||||
config KERNEL_FUNCTION_PROFILER
|
||||
bool "Function profiler"
|
||||
depends on KERNEL_FUNCTION_TRACER
|
||||
default n
|
||||
|
||||
config KERNEL_IRQSOFF_TRACER
|
||||
bool "Interrupts-off Latency Tracer"
|
||||
@@ -420,21 +302,9 @@ config KERNEL_PREEMPT_TRACER
|
||||
enabled. This option and the irqs-off timing option can be
|
||||
used together or separately.)
|
||||
|
||||
config KERNEL_HIST_TRIGGERS
|
||||
bool "Histogram triggers"
|
||||
depends on KERNEL_FTRACE
|
||||
help
|
||||
Hist triggers allow one or more arbitrary trace event fields to be
|
||||
aggregated into hash tables and dumped to stdout by reading a
|
||||
debugfs/tracefs file. They're useful for gathering quick and dirty
|
||||
(though precise) summaries of event activity as an initial guide for
|
||||
further investigation using more advanced tools.
|
||||
|
||||
Inter-event tracing of quantities such as latencies is also
|
||||
supported using hist triggers under this option.
|
||||
|
||||
config KERNEL_DEBUG_KERNEL
|
||||
bool
|
||||
default n
|
||||
|
||||
config KERNEL_DEBUG_INFO
|
||||
bool "Compile the kernel with debug information"
|
||||
@@ -443,61 +313,6 @@ config KERNEL_DEBUG_INFO
|
||||
help
|
||||
This will compile your kernel and modules with debug information.
|
||||
|
||||
config KERNEL_DEBUG_INFO_BTF
|
||||
bool "Enable additional BTF type information"
|
||||
depends on !HOST_OS_MACOS
|
||||
depends on KERNEL_DEBUG_INFO && !KERNEL_DEBUG_INFO_REDUCED
|
||||
select DWARVES
|
||||
help
|
||||
Generate BPF Type Format (BTF) information from DWARF debug info.
|
||||
Turning this on expects presence of pahole tool, which will convert
|
||||
DWARF type info into equivalent deduplicated BTF type info.
|
||||
|
||||
Required to run BPF CO-RE applications.
|
||||
|
||||
config KERNEL_DEBUG_INFO_BTF_MODULES
|
||||
def_bool y
|
||||
depends on KERNEL_DEBUG_INFO_BTF
|
||||
|
||||
config KERNEL_MODULE_ALLOW_BTF_MISMATCH
|
||||
bool "Allow loading modules with non-matching BTF type info"
|
||||
depends on KERNEL_DEBUG_INFO_BTF_MODULES
|
||||
help
|
||||
For modules whose split BTF does not match vmlinux, load without
|
||||
BTF rather than refusing to load. The default behavior with
|
||||
module BTF enabled is to reject modules with such mismatches;
|
||||
this option will still load module BTF where possible but ignore
|
||||
it when a mismatch is found.
|
||||
|
||||
config KERNEL_DEBUG_INFO_REDUCED
|
||||
bool "Reduce debugging information"
|
||||
default y
|
||||
depends on KERNEL_DEBUG_INFO
|
||||
help
|
||||
If you say Y here gcc is instructed to generate less debugging
|
||||
information for structure types. This means that tools that
|
||||
need full debugging information (like kgdb or systemtap) won't
|
||||
be happy. But if you merely need debugging information to
|
||||
resolve line numbers there is no loss. Advantage is that
|
||||
build directory object sizes shrink dramatically over a full
|
||||
DEBUG_INFO build and compile times are reduced too.
|
||||
Only works with newer gcc versions.
|
||||
|
||||
config KERNEL_FRAME_WARN
|
||||
int
|
||||
range 0 8192
|
||||
default 1280 if KERNEL_KASAN && !ARCH_64BIT
|
||||
default 1024 if !ARCH_64BIT
|
||||
default 2048 if ARCH_64BIT
|
||||
help
|
||||
Tell the compiler to warn at build time for stack frames larger than this.
|
||||
Setting this too low will cause a lot of warnings.
|
||||
Setting it to 0 disables the warning.
|
||||
|
||||
# KERNEL_DEBUG_LL symbols must have the default value set as otherwise
|
||||
# KConfig wont evaluate them unless KERNEL_EARLY_PRINTK is selected
|
||||
# which means that buildroot wont override the DEBUG_LL symbols in target
|
||||
# kernel configurations and lead to devices that dont have working console
|
||||
config KERNEL_DEBUG_LL_UART_NONE
|
||||
bool
|
||||
default n
|
||||
@@ -511,16 +326,10 @@ config KERNEL_DEBUG_LL
|
||||
help
|
||||
ARM low level debugging.
|
||||
|
||||
config KERNEL_DEBUG_VIRTUAL
|
||||
bool "Compile the kernel with VM translations debugging"
|
||||
select KERNEL_DEBUG_KERNEL
|
||||
help
|
||||
Enable checks sanity checks to catch invalid uses of
|
||||
virt_to_phys()/phys_to_virt() against the non-linear address space.
|
||||
|
||||
config KERNEL_DYNAMIC_DEBUG
|
||||
bool "Compile the kernel with dynamic printk"
|
||||
select KERNEL_DEBUG_FS
|
||||
default n
|
||||
help
|
||||
Compiles debug level messages into the kernel, which would not
|
||||
otherwise be available at runtime. These messages can then be
|
||||
@@ -532,6 +341,7 @@ config KERNEL_DYNAMIC_DEBUG
|
||||
config KERNEL_EARLY_PRINTK
|
||||
bool "Compile the kernel with early printk"
|
||||
default y if TARGET_bcm53xx
|
||||
default n
|
||||
depends on arm
|
||||
select KERNEL_DEBUG_KERNEL
|
||||
select KERNEL_DEBUG_LL if arm
|
||||
@@ -542,6 +352,7 @@ config KERNEL_EARLY_PRINTK
|
||||
|
||||
config KERNEL_KPROBES
|
||||
bool "Compile the kernel with kprobes support"
|
||||
default n
|
||||
select KERNEL_FTRACE
|
||||
select KERNEL_PERF_EVENTS
|
||||
help
|
||||
@@ -556,32 +367,13 @@ config KERNEL_KPROBE_EVENTS
|
||||
bool
|
||||
default y if KERNEL_KPROBES
|
||||
|
||||
config KERNEL_BPF_EVENTS
|
||||
bool "Compile the kernel with BPF event support"
|
||||
select KERNEL_KPROBES
|
||||
help
|
||||
Allows to attach BPF programs to kprobe, uprobe and tracepoint events.
|
||||
This is required to use BPF maps of type BPF_MAP_TYPE_PERF_EVENT_ARRAY
|
||||
for sending data from BPF programs to user-space for post-processing
|
||||
or logging.
|
||||
|
||||
config KERNEL_PROBE_EVENTS_BTF_ARGS
|
||||
bool "Support BTF function arguments for probe events"
|
||||
depends on KERNEL_DEBUG_INFO_BTF && KERNEL_KPROBE_EVENTS && LINUX_6_6
|
||||
|
||||
config KERNEL_BPF_KPROBE_OVERRIDE
|
||||
bool
|
||||
depends on KERNEL_KPROBES
|
||||
default n
|
||||
|
||||
config KERNEL_AIO
|
||||
bool "Compile the kernel with asynchronous IO support"
|
||||
default y if !SMALL_FLASH
|
||||
|
||||
config KERNEL_IO_URING
|
||||
bool "Compile the kernel with io_uring support"
|
||||
depends on !SMALL_FLASH
|
||||
default y if (x86_64 || aarch64)
|
||||
default y if !SMALL_FLASH
|
||||
|
||||
config KERNEL_FHANDLE
|
||||
bool "Compile the kernel with support for fhandle syscalls"
|
||||
@@ -593,6 +385,7 @@ config KERNEL_FANOTIFY
|
||||
|
||||
config KERNEL_BLK_DEV_BSG
|
||||
bool "Compile the kernel with SCSI generic v4 support for any block device"
|
||||
default n
|
||||
|
||||
config KERNEL_TRANSPARENT_HUGEPAGE
|
||||
bool
|
||||
@@ -616,6 +409,7 @@ config KERNEL_HUGETLB_PAGE
|
||||
bool "Compile the kernel with HugeTLB support"
|
||||
select KERNEL_TRANSPARENT_HUGEPAGE
|
||||
select KERNEL_HUGETLBFS
|
||||
default n
|
||||
|
||||
config KERNEL_MAGIC_SYSRQ
|
||||
bool "Compile the kernel with SysRq support"
|
||||
@@ -640,35 +434,36 @@ config KERNEL_ELF_CORE
|
||||
config KERNEL_PROVE_LOCKING
|
||||
bool "Enable kernel lock checking"
|
||||
select KERNEL_DEBUG_KERNEL
|
||||
default n
|
||||
|
||||
config KERNEL_SOFTLOCKUP_DETECTOR
|
||||
bool "Compile the kernel with detect Soft Lockups"
|
||||
config KERNEL_LOCKUP_DETECTOR
|
||||
bool "Compile the kernel with detect Hard and Soft Lockups"
|
||||
depends on KERNEL_DEBUG_KERNEL
|
||||
help
|
||||
Say Y here to enable the kernel to act as a watchdog to detect
|
||||
soft lockups.
|
||||
hard and soft lockups.
|
||||
|
||||
Softlockups are bugs that cause the kernel to loop in kernel
|
||||
mode for more than 20 seconds, without giving other tasks a
|
||||
chance to run. The current stack trace is displayed upon
|
||||
detection and the system will stay locked up.
|
||||
|
||||
config KERNEL_HARDLOCKUP_DETECTOR
|
||||
bool "Compile the kernel with detect Hard Lockups"
|
||||
depends on KERNEL_DEBUG_KERNEL
|
||||
help
|
||||
Say Y here to enable the kernel to act as a watchdog to detect
|
||||
hard lockups.
|
||||
|
||||
Hardlockups are bugs that cause the CPU to loop in kernel mode
|
||||
for more than 10 seconds, without letting other interrupts have a
|
||||
chance to run. The current stack trace is displayed upon detection
|
||||
and the system will stay locked up.
|
||||
|
||||
The overhead should be minimal. A periodic hrtimer runs to
|
||||
generate interrupts and kick the watchdog task every 4 seconds.
|
||||
An NMI is generated every 10 seconds or so to check for hardlockups.
|
||||
|
||||
The frequency of hrtimer and NMI events and the soft and hard lockup
|
||||
thresholds can be controlled through the sysctl watchdog_thresh.
|
||||
|
||||
config KERNEL_DETECT_HUNG_TASK
|
||||
bool "Compile the kernel with detect Hung Tasks"
|
||||
depends on KERNEL_DEBUG_KERNEL
|
||||
default KERNEL_SOFTLOCKUP_DETECTOR
|
||||
default KERNEL_LOCKUP_DETECTOR
|
||||
help
|
||||
Say Y here to enable the kernel to detect "hung tasks",
|
||||
which are bugs that cause the task to be stuck in
|
||||
@@ -714,23 +509,10 @@ config KERNEL_PRINTK_TIME
|
||||
default y
|
||||
|
||||
config KERNEL_SLUB_DEBUG
|
||||
bool "Enable SLUB debugging support"
|
||||
help
|
||||
This enables various debugging features:
|
||||
- Accepts "slub_debug" kernel parameter
|
||||
- Provides caches debugging options (e.g. tracing, validating)
|
||||
- Adds /sys/kernel/slab/ attrs for reading amounts of *objects*
|
||||
- Enables /proc/slabinfo support
|
||||
- Prints info when running out of memory
|
||||
|
||||
Enabling this can result in a significant increase of code size.
|
||||
bool
|
||||
|
||||
config KERNEL_SLUB_DEBUG_ON
|
||||
depends on KERNEL_SLUB_DEBUG
|
||||
bool "Boot kernel with basic caches debugging enabled"
|
||||
help
|
||||
This enables by default sanity_checks, red_zone, poison and store_user
|
||||
debugging options for all caches.
|
||||
bool
|
||||
|
||||
config KERNEL_SLABINFO
|
||||
select KERNEL_SLUB_DEBUG
|
||||
@@ -766,9 +548,11 @@ config USE_RFKILL
|
||||
|
||||
config USE_SPARSE
|
||||
bool "Enable sparse check during kernel build"
|
||||
default n
|
||||
|
||||
config KERNEL_DEVTMPFS
|
||||
bool "Compile the kernel with device tmpfs enabled"
|
||||
default n
|
||||
help
|
||||
devtmpfs is a simple, kernel-managed /dev filesystem. The kernel creates
|
||||
devices nodes for all registered devices to simplify boot, but leaves more
|
||||
@@ -778,6 +562,7 @@ if KERNEL_DEVTMPFS
|
||||
|
||||
config KERNEL_DEVTMPFS_MOUNT
|
||||
bool "Automatically mount devtmpfs after root filesystem is mounted"
|
||||
default n
|
||||
|
||||
endif
|
||||
|
||||
@@ -788,14 +573,17 @@ config KERNEL_KEYS
|
||||
config KERNEL_PERSISTENT_KEYRINGS
|
||||
bool "Enable kernel persistent keyrings"
|
||||
depends on KERNEL_KEYS
|
||||
default n
|
||||
|
||||
config KERNEL_KEYS_REQUEST_CACHE
|
||||
bool "Enable temporary caching of the last request_key() result"
|
||||
depends on KERNEL_KEYS
|
||||
default n
|
||||
|
||||
config KERNEL_BIG_KEYS
|
||||
bool "Enable large payload keys on kernel keyrings"
|
||||
depends on KERNEL_KEYS
|
||||
default n
|
||||
|
||||
#
|
||||
# CGROUP support symbols
|
||||
@@ -809,6 +597,7 @@ if KERNEL_CGROUPS
|
||||
|
||||
config KERNEL_CGROUP_DEBUG
|
||||
bool "Example debug cgroup subsystem"
|
||||
default n
|
||||
help
|
||||
This option enables a simple cgroup subsystem that
|
||||
exports useful debugging information about the cgroups
|
||||
@@ -819,6 +608,7 @@ if KERNEL_CGROUPS
|
||||
|
||||
config KERNEL_CGROUP_FREEZER
|
||||
bool "legacy Freezer cgroup subsystem"
|
||||
default n
|
||||
select KERNEL_FREEZER
|
||||
help
|
||||
Provides a way to freeze and unfreeze all tasks in a
|
||||
@@ -828,6 +618,7 @@ if KERNEL_CGROUPS
|
||||
|
||||
config KERNEL_CGROUP_DEVICE
|
||||
bool "legacy Device controller for cgroups"
|
||||
default n
|
||||
help
|
||||
Provides a cgroup implementing whitelists for devices which
|
||||
a process in the cgroup can mknod or open.
|
||||
@@ -835,6 +626,7 @@ if KERNEL_CGROUPS
|
||||
|
||||
config KERNEL_CGROUP_HUGETLB
|
||||
bool "HugeTLB controller"
|
||||
default n
|
||||
select KERNEL_HUGETLB_PAGE
|
||||
|
||||
config KERNEL_CGROUP_PIDS
|
||||
@@ -863,6 +655,7 @@ if KERNEL_CGROUPS
|
||||
|
||||
config KERNEL_PROC_PID_CPUSET
|
||||
bool "Include legacy /proc/<pid>/cpuset file"
|
||||
default n
|
||||
depends on KERNEL_CPUSETS
|
||||
|
||||
config KERNEL_CGROUP_CPUACCT
|
||||
@@ -887,7 +680,7 @@ if KERNEL_CGROUPS
|
||||
bool "Memory Resource Controller for Control Groups"
|
||||
default y
|
||||
select KERNEL_FREEZER
|
||||
depends on KERNEL_RESOURCE_COUNTERS
|
||||
depends on KERNEL_RESOURCE_COUNTERS || !LINUX_3_18
|
||||
help
|
||||
Provides a memory resource controller that manages both anonymous
|
||||
memory and page cache. (See Documentation/cgroups/memory.txt)
|
||||
@@ -928,6 +721,7 @@ if KERNEL_CGROUPS
|
||||
|
||||
config KERNEL_MEMCG_SWAP_ENABLED
|
||||
bool "Memory Resource Controller Swap Extension enabled by default"
|
||||
default n
|
||||
depends on KERNEL_MEMCG_SWAP
|
||||
help
|
||||
Memory Resource Controller Swap Extension comes with its price in
|
||||
@@ -956,6 +750,7 @@ if KERNEL_CGROUPS
|
||||
config KERNEL_CGROUP_PERF
|
||||
bool "Enable perf_event per-cpu per-container group (cgroup) monitoring"
|
||||
select KERNEL_PERF_EVENTS
|
||||
default n
|
||||
help
|
||||
This option extends the per-cpu mode to restrict monitoring to
|
||||
threads which belong to the cgroup specified and run on the
|
||||
@@ -1032,6 +827,7 @@ if KERNEL_CGROUPS
|
||||
|
||||
config KERNEL_DEBUG_BLK_CGROUP
|
||||
bool "Enable Block IO controller debugging"
|
||||
default n
|
||||
depends on KERNEL_BLK_CGROUP
|
||||
help
|
||||
Enable some debugging help. Currently it exports additional stat
|
||||
@@ -1039,12 +835,15 @@ if KERNEL_CGROUPS
|
||||
|
||||
config KERNEL_NET_CLS_CGROUP
|
||||
bool "legacy Control Group Classifier"
|
||||
default n
|
||||
|
||||
config KERNEL_CGROUP_NET_CLASSID
|
||||
bool "legacy Network classid cgroup"
|
||||
default n
|
||||
|
||||
config KERNEL_CGROUP_NET_PRIO
|
||||
bool "legacy Network priority cgroup"
|
||||
default n
|
||||
|
||||
endif
|
||||
|
||||
@@ -1144,19 +943,6 @@ config KERNEL_IP_MROUTE
|
||||
Multicast routing requires a multicast routing daemon in
|
||||
addition to kernel support.
|
||||
|
||||
if KERNEL_IP_MROUTE
|
||||
|
||||
config KERNEL_IP_MROUTE_MULTIPLE_TABLES
|
||||
def_bool y
|
||||
|
||||
config KERNEL_IP_PIMSM_V1
|
||||
def_bool y
|
||||
|
||||
config KERNEL_IP_PIMSM_V2
|
||||
def_bool y
|
||||
|
||||
endif
|
||||
|
||||
#
|
||||
# IPv6 configuration
|
||||
#
|
||||
@@ -1179,15 +965,8 @@ if KERNEL_IPV6
|
||||
Multicast routing requires a multicast routing daemon in
|
||||
addition to kernel support.
|
||||
|
||||
if KERNEL_IPV6_MROUTE
|
||||
|
||||
config KERNEL_IPV6_MROUTE_MULTIPLE_TABLES
|
||||
def_bool y
|
||||
|
||||
config KERNEL_IPV6_PIMSM_V2
|
||||
def_bool y
|
||||
|
||||
endif
|
||||
config KERNEL_IPV6_PIMSM_V2
|
||||
def_bool n
|
||||
|
||||
config KERNEL_IPV6_SEG6_LWTUNNEL
|
||||
bool "Enable support for lightweight tunnels"
|
||||
@@ -1200,45 +979,6 @@ if KERNEL_IPV6
|
||||
|
||||
endif
|
||||
|
||||
#
|
||||
# Miscellaneous network configuration
|
||||
#
|
||||
|
||||
config KERNEL_NET_L3_MASTER_DEV
|
||||
bool "L3 Master device support"
|
||||
default y if !SMALL_FLASH
|
||||
help
|
||||
This module provides glue between core networking code and device
|
||||
drivers to support L3 master devices like VRF.
|
||||
Increases the compressed kernel size by ~4kB (as of Linux 6.6).
|
||||
|
||||
config KERNEL_XDP_SOCKETS
|
||||
bool "XDP sockets support"
|
||||
help
|
||||
XDP sockets allows a channel between XDP programs and
|
||||
userspace applications.
|
||||
|
||||
config KERNEL_PAGE_POOL
|
||||
def_bool n
|
||||
|
||||
config KERNEL_PAGE_POOL_STATS
|
||||
bool "Page pool stats support"
|
||||
depends on KERNEL_PAGE_POOL
|
||||
|
||||
config KERNEL_MPTCP
|
||||
bool "Multi-Path TCP support"
|
||||
default y if !SMALL_FLASH
|
||||
help
|
||||
Select this option to enable support for Multi-Path TCP.
|
||||
Increases the compressed kernel size by ~214kB (as of Linux 6.6).
|
||||
|
||||
if KERNEL_IPV6
|
||||
config KERNEL_MPTCP_IPV6
|
||||
bool "IPv6 support for Multipath TCP"
|
||||
depends on KERNEL_MPTCP
|
||||
default KERNEL_MPTCP
|
||||
endif
|
||||
|
||||
#
|
||||
# NFS related symbols
|
||||
#
|
||||
@@ -1273,20 +1013,14 @@ if KERNEL_IP_PNP
|
||||
|
||||
endif
|
||||
|
||||
config KERNEL_BTRFS_FS
|
||||
bool "Compile the kernel with built-in BTRFS support"
|
||||
help
|
||||
Say Y here if you want to make the kernel to be able to boot off a
|
||||
BTRFS partition.
|
||||
|
||||
menu "Filesystem ACL and attr support options"
|
||||
config USE_FS_ACL_ATTR
|
||||
bool "Use filesystem ACL and attr support by default"
|
||||
default y if !SMALL_FLASH
|
||||
default n
|
||||
help
|
||||
Make using ACLs (e.g. POSIX ACL, NFSv4 ACL) the default
|
||||
for kernel and packages, except old NFS.
|
||||
Also enable userspace extended attribute support
|
||||
for kernel and packages, except tmpfs, flash filesystems,
|
||||
and old NFS. Also enable userspace extended attribute support
|
||||
by default. (OpenWrt already has an expection it will be
|
||||
present in the kernel).
|
||||
|
||||
@@ -1307,17 +1041,17 @@ menu "Filesystem ACL and attr support options"
|
||||
config KERNEL_F2FS_FS_POSIX_ACL
|
||||
bool "Enable POSIX ACL for F2FS Filesystems"
|
||||
select KERNEL_FS_POSIX_ACL
|
||||
default y if USE_FS_ACL_ATTR
|
||||
default n
|
||||
|
||||
config KERNEL_JFFS2_FS_POSIX_ACL
|
||||
bool "Enable POSIX ACL for JFFS2 Filesystems"
|
||||
select KERNEL_FS_POSIX_ACL
|
||||
default y if USE_FS_ACL_ATTR
|
||||
default n
|
||||
|
||||
config KERNEL_TMPFS_POSIX_ACL
|
||||
bool "Enable POSIX ACL for TMPFS Filesystems"
|
||||
select KERNEL_FS_POSIX_ACL
|
||||
default y if USE_FS_ACL_ATTR
|
||||
default n
|
||||
|
||||
config KERNEL_CIFS_ACL
|
||||
bool "Enable CIFS ACLs"
|
||||
@@ -1340,12 +1074,15 @@ menu "Filesystem ACL and attr support options"
|
||||
|
||||
config KERNEL_NFS_V3_ACL_SUPPORT
|
||||
bool "Enable ACLs for NFSv3"
|
||||
default n
|
||||
|
||||
config KERNEL_NFSD_V2_ACL_SUPPORT
|
||||
bool "Enable ACLs for NFSDv2"
|
||||
default n
|
||||
|
||||
config KERNEL_NFSD_V3_ACL_SUPPORT
|
||||
bool "Enable ACLs for NFSDv3"
|
||||
default n
|
||||
|
||||
config KERNEL_REISER_FS_POSIX_ACL
|
||||
bool "Enable POSIX ACLs for ReiserFS"
|
||||
@@ -1387,7 +1124,7 @@ config KERNEL_SQUASHFS_XATTR
|
||||
bool "Squashfs XATTR support"
|
||||
|
||||
#
|
||||
# compile optimization setting
|
||||
# compile optimiziation setting
|
||||
#
|
||||
choice
|
||||
prompt "Compiler optimization level"
|
||||
@@ -1454,30 +1191,12 @@ config KERNEL_LSM
|
||||
|
||||
config KERNEL_EXT4_FS_SECURITY
|
||||
bool "Ext4 Security Labels"
|
||||
default y if !SMALL_FLASH
|
||||
|
||||
config KERNEL_F2FS_FS_SECURITY
|
||||
bool "F2FS Security Labels"
|
||||
default y if !SMALL_FLASH
|
||||
|
||||
config KERNEL_UBIFS_FS_SECURITY
|
||||
bool "UBIFS Security Labels"
|
||||
default y if !SMALL_FLASH
|
||||
|
||||
config KERNEL_JFFS2_FS_SECURITY
|
||||
bool "JFFS2 Security Labels"
|
||||
default y if !SMALL_FLASH
|
||||
|
||||
config KERNEL_WERROR
|
||||
bool "Compile the kernel with warnings as errors"
|
||||
help
|
||||
A kernel build should not cause any compiler warnings, and this
|
||||
enables the '-Werror' (for C) and '-Dwarnings' (for Rust) flags
|
||||
to enforce that rule by default. Certain warnings from other tools
|
||||
such as the linker may be upgraded to errors with this option as
|
||||
well.
|
||||
|
||||
However, if you have a new (or very old) compiler or linker with odd
|
||||
and unusual warnings, or you have some architecture with problems,
|
||||
you may need to disable this config option in order to
|
||||
successfully build the kernel.
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
cat << EOF | "$STAGING_DIR_HOST/bin/g++" -c -x c++ -o /dev/null - >/dev/null 2>&1
|
||||
#if __clang__
|
||||
#if __clang_major__ < $3
|
||||
#error "clang too old"
|
||||
#endif
|
||||
#else
|
||||
#if __GNUC__ < $1 || (__GNUC__ == $1 && (__GNUC_MINOR__ < $2))
|
||||
#error "gcc too old"
|
||||
#endif
|
||||
#endif
|
||||
EOF
|
||||
[ $? -eq 0 ] && echo y || echo n
|
||||
@@ -1 +0,0 @@
|
||||
[ "$(uname)" = "$1" ] && echo y || echo n
|
||||
@@ -1,4 +1,4 @@
|
||||
src-git packages https://git.openwrt.org/feed/packages.git^b5f11b79d2b0538d57103a8da05e7a7a87981ff3
|
||||
src-git luci https://git.openwrt.org/project/luci.git^e76155d09484602e2b02e84bb8ffafa4848798f0
|
||||
src-git routing https://git.openwrt.org/feed/routing.git^3f15699240c076d5ee9ed697fa5ef45355423f6f
|
||||
src-git telephony https://git.openwrt.org/feed/telephony.git^fd605af7143165a2490681ec1752f259873b9147
|
||||
src-git packages https://git.openwrt.org/feed/packages.git^920c4f29c55d26d8d602c1357ffd6b23a0df5914
|
||||
src-git luci https://git.openwrt.org/project/luci.git^09329fe7bb6571032570b21541c1991a3443cc07
|
||||
src-git routing https://git.openwrt.org/feed/routing.git^57533a25e84932a7e50b8483843c840f0924bc0c
|
||||
src-git telephony https://git.openwrt.org/feed/telephony.git^04e1378baf2b720395d284f661240e6f7f9cab35
|
||||
|
||||
@@ -2,9 +2,6 @@
|
||||
#
|
||||
# Copyright (C) 2007-2020 OpenWrt.org
|
||||
|
||||
ifneq ($(__autotools_inc),1)
|
||||
__autotools_inc=1
|
||||
|
||||
autoconf_bool = $(patsubst %,$(if $($(1)),--enable,--disable)-%,$(2))
|
||||
|
||||
# delete *.la-files from staging_dir - we can not yet remove respective lines within all package
|
||||
@@ -23,10 +20,7 @@ AM_TOOL_PATHS:= \
|
||||
LIBTOOLIZE=$(STAGING_DIR_HOST)/bin/libtoolize \
|
||||
LIBTOOL=$(STAGING_DIR_HOST)/bin/libtool \
|
||||
M4=$(STAGING_DIR_HOST)/bin/m4 \
|
||||
AUTOPOINT=true \
|
||||
GTKDOCIZE=true
|
||||
|
||||
AM_TOOL_PATHS_FAKE:=$(subst = ,=,$(patsubst "%,"$(TRUE)",$(subst =,= ",$(AM_TOOL_PATHS))))
|
||||
AUTOPOINT=true
|
||||
|
||||
# 1: build dir
|
||||
# 2: remove files
|
||||
@@ -38,13 +32,13 @@ define autoreconf
|
||||
$(patsubst %,rm -f %;,$(2)) \
|
||||
$(foreach p,$(3), \
|
||||
if [ -f $(p)/configure.ac ] || [ -f $(p)/configure.in ]; then \
|
||||
[ -d $(p)/autom4te.cache ] && rm -rf $(p)/autom4te.cache; \
|
||||
[ -d $(p)/autom4te.cache ] && rm -rf autom4te.cache; \
|
||||
[ -e $(p)/config.rpath ] || \
|
||||
ln -s $(SCRIPT_DIR)/config.rpath $(p)/config.rpath; \
|
||||
touch NEWS AUTHORS COPYING ABOUT-NLS ChangeLog; \
|
||||
$(AM_TOOL_PATHS) \
|
||||
LIBTOOLIZE='$(STAGING_DIR_HOST)/bin/libtoolize --install' \
|
||||
$(STAGING_DIR_HOST)/bin/autoreconf -v -f -i \
|
||||
$(STAGING_DIR_HOST)/bin/autoreconf -v -f -i -s \
|
||||
$(if $(word 2,$(3)),--no-recursive) \
|
||||
-B $(STAGING_DIR_HOST)/share/aclocal \
|
||||
$(patsubst %,-I %,$(5)) \
|
||||
@@ -96,7 +90,7 @@ endef
|
||||
|
||||
define gettext_version_target
|
||||
(cd $(PKG_BUILD_DIR) && \
|
||||
GETTEXT_VERSION=$(shell $(STAGING_DIR_HOSTPKG)/bin/gettext -V | $(STAGING_DIR_HOST)/bin/sed -rne '1s/.*\b([0-9]\.[0-9]+(\.[0-9]+)?)\b.*/\1/p' ) && \
|
||||
GETTEXT_VERSION=$(shell $(STAGING_DIR_HOSTPKG)/bin/gettext -V | $(STAGING_DIR_HOST)/bin/sed -ne '1s/.*\([0-9]\.[0-9]\{2\}\.[0-9]\).*/\1/p' ) && \
|
||||
$(STAGING_DIR_HOST)/bin/sed \
|
||||
-i $(PKG_BUILD_DIR)/configure.ac \
|
||||
-e "s/AM_GNU_GETTEXT_VERSION(.*)/AM_GNU_GETTEXT_VERSION(\[$$$$GETTEXT_VERSION\])/g" && \
|
||||
@@ -116,7 +110,7 @@ ifneq ($(filter patch-libtool,$(PKG_FIXUP)),)
|
||||
endif
|
||||
|
||||
ifneq ($(filter libtool,$(PKG_FIXUP)),)
|
||||
PKG_BUILD_DEPENDS += libtool
|
||||
PKG_BUILD_DEPENDS += libtool gettext libiconv
|
||||
ifeq ($(filter no-autoreconf,$(PKG_FIXUP)),)
|
||||
Hooks/Configure/Pre += autoreconf_target
|
||||
endif
|
||||
@@ -126,6 +120,13 @@ ifneq ($(filter libtool-abiver,$(PKG_FIXUP)),)
|
||||
Hooks/Configure/Post += set_libtool_abiver
|
||||
endif
|
||||
|
||||
ifneq ($(filter libtool-ucxx,$(PKG_FIXUP)),)
|
||||
PKG_BUILD_DEPENDS += libtool gettext libiconv
|
||||
ifeq ($(filter no-autoreconf,$(PKG_FIXUP)),)
|
||||
Hooks/Configure/Pre += autoreconf_target
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(filter autoreconf,$(PKG_FIXUP)),)
|
||||
ifeq ($(filter autoreconf,$(Hooks/Configure/Pre)),)
|
||||
Hooks/Configure/Pre += autoreconf_target
|
||||
@@ -151,20 +152,28 @@ define patch_libtool_host
|
||||
$(HOST_BUILD_DIR)))
|
||||
endef
|
||||
|
||||
ifneq ($(filter patch-libtool,$(HOST_FIXUP)),)
|
||||
ifneq ($(filter patch-libtool,$(PKG_FIXUP)),)
|
||||
Hooks/HostConfigure/Pre += patch_libtool_host
|
||||
endif
|
||||
|
||||
ifneq ($(filter patch-libtool,$(HOST_FIXUP)),)
|
||||
Hooks/HostConfigure/Pre += $(strip $(call patch_libtool,$(HOST_BUILD_DIR)))
|
||||
endif
|
||||
|
||||
ifneq ($(filter libtool,$(HOST_FIXUP)),)
|
||||
ifeq ($(filter no-autoreconf,$(HOST_FIXUP)),)
|
||||
Hooks/HostConfigure/Pre += autoreconf_host
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(filter libtool-ucxx,$(HOST_FIXUP)),)
|
||||
ifeq ($(filter no-autoreconf,$(HOST_FIXUP)),)
|
||||
Hooks/HostConfigure/Pre += autoreconf_host
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(filter autoreconf,$(HOST_FIXUP)),)
|
||||
ifeq ($(filter autoreconf,$(Hooks/HostConfigure/Pre)),)
|
||||
Hooks/HostConfigure/Pre += autoreconf_host
|
||||
endif
|
||||
endif
|
||||
|
||||
endif #__autotools_inc
|
||||
|
||||
@@ -1,86 +0,0 @@
|
||||
BPF_DEPENDS := @HAS_BPF_TOOLCHAIN
|
||||
LLVM_VER:=
|
||||
|
||||
CLANG_MIN_VER:=12
|
||||
|
||||
ifneq ($(CONFIG_USE_LLVM_HOST),)
|
||||
BPF_TOOLCHAIN_HOST_PATH:=$(call qstrip,$(CONFIG_BPF_TOOLCHAIN_HOST_PATH))
|
||||
ifneq ($(BPF_TOOLCHAIN_HOST_PATH),)
|
||||
BPF_PATH:=$(BPF_TOOLCHAIN_HOST_PATH)/bin:$(PATH)
|
||||
else
|
||||
BPF_PATH:=$(PATH)
|
||||
endif
|
||||
CLANG:=$(firstword $(shell PATH='$(BPF_PATH)' command -v clang clang-13 clang-12 clang-11))
|
||||
LLVM_VER:=$(subst clang,,$(notdir $(CLANG)))
|
||||
endif
|
||||
ifneq ($(CONFIG_USE_LLVM_PREBUILT),)
|
||||
CLANG:=$(TOPDIR)/llvm-bpf/bin/clang
|
||||
endif
|
||||
ifneq ($(CONFIG_USE_LLVM_BUILD),)
|
||||
CLANG:=$(STAGING_DIR_HOST)/llvm-bpf/bin/clang
|
||||
endif
|
||||
|
||||
LLVM_PATH:=$(dir $(CLANG))
|
||||
LLVM_LLC:=$(LLVM_PATH)/llc$(LLVM_VER)
|
||||
LLVM_DIS:=$(LLVM_PATH)/llvm-dis$(LLVM_VER)
|
||||
LLVM_OPT:=$(LLVM_PATH)/opt$(LLVM_VER)
|
||||
LLVM_STRIP:=$(LLVM_PATH)/llvm-strip$(LLVM_VER)
|
||||
|
||||
BPF_KARCH:=mips
|
||||
BPF_ARCH:=mips$(if $(CONFIG_ARCH_64BIT),64)$(if $(CONFIG_BIG_ENDIAN),,el)
|
||||
BPF_TARGET:=bpf$(if $(CONFIG_BIG_ENDIAN),eb,el)
|
||||
|
||||
BPF_HEADERS_DIR:=$(STAGING_DIR)/bpf-headers
|
||||
|
||||
BPF_KERNEL_INCLUDE := \
|
||||
-nostdinc -isystem $(TOOLCHAIN_ROOT_DIR)/lib/gcc/*/*/include \
|
||||
$(patsubst %,-isystem%,$(TOOLCHAIN_INC_DIRS)) \
|
||||
-I$(BPF_HEADERS_DIR)/arch/$(BPF_KARCH)/include \
|
||||
-I$(BPF_HEADERS_DIR)/arch/$(BPF_KARCH)/include/asm/mach-generic \
|
||||
-I$(BPF_HEADERS_DIR)/arch/$(BPF_KARCH)/include/generated \
|
||||
-I$(BPF_HEADERS_DIR)/include \
|
||||
-I$(BPF_HEADERS_DIR)/arch/$(BPF_KARCH)/include/uapi \
|
||||
-I$(BPF_HEADERS_DIR)/arch/$(BPF_KARCH)/include/generated/uapi \
|
||||
-I$(BPF_HEADERS_DIR)/include/uapi \
|
||||
-I$(BPF_HEADERS_DIR)/include/generated/uapi \
|
||||
-I$(BPF_HEADERS_DIR)/tools/lib \
|
||||
-I$(BPF_HEADERS_DIR)/tools/testing/selftests \
|
||||
-I$(BPF_HEADERS_DIR)/samples/bpf \
|
||||
-include linux/kconfig.h -include asm_goto_workaround.h
|
||||
|
||||
BPF_CFLAGS := \
|
||||
$(BPF_KERNEL_INCLUDE) -I$(PKG_BUILD_DIR) \
|
||||
-D__KERNEL__ -D__BPF_TRACING__ -DCONFIG_GENERIC_CSUM \
|
||||
-D__TARGET_ARCH_${BPF_KARCH} \
|
||||
-m$(if $(CONFIG_BIG_ENDIAN),big,little)-endian \
|
||||
-fno-stack-protector -Wall \
|
||||
-Wno-unused-value -Wno-pointer-sign \
|
||||
-Wno-compare-distinct-pointer-types \
|
||||
-Wno-gnu-variable-sized-type-not-at-end \
|
||||
-Wno-address-of-packed-member -Wno-tautological-compare \
|
||||
-Wno-unknown-warning-option \
|
||||
-fno-asynchronous-unwind-tables \
|
||||
-Wno-uninitialized -Wno-unused-variable \
|
||||
-Wno-unused-label \
|
||||
-O2 -emit-llvm -Xclang -disable-llvm-passes
|
||||
|
||||
ifneq ($(CONFIG_HAS_BPF_TOOLCHAIN),)
|
||||
ifeq ($(DUMP)$(filter download refresh,$(MAKECMDGOALS)),)
|
||||
CLANG_VER:=$(shell $(CLANG) --target=$(BPF_TARGET) -dM -E - < /dev/null | grep __clang_major__ | cut -d' ' -f3)
|
||||
CLANG_VER_VALID:=$(shell [ "$(CLANG_VER)" -ge "$(CLANG_MIN_VER)" ] && echo 1 )
|
||||
ifeq ($(CLANG_VER_VALID),)
|
||||
$(error ERROR: LLVM/clang version too old. Minimum required: $(CLANG_MIN_VER), found: $(CLANG_VER))
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
define CompileBPF
|
||||
$(CLANG) -g -target $(BPF_ARCH)-linux-gnu $(BPF_CFLAGS) $(2) \
|
||||
-c $(1) -o $(patsubst %.c,%.bc,$(1))
|
||||
$(LLVM_OPT) -O2 -mtriple=$(BPF_TARGET) < $(patsubst %.c,%.bc,$(1)) > $(patsubst %.c,%.opt,$(1))
|
||||
$(LLVM_DIS) < $(patsubst %.c,%.opt,$(1)) > $(patsubst %.c,%.S,$(1))
|
||||
$(LLVM_LLC) -march=$(BPF_TARGET) -mcpu=v3 -filetype=obj -o $(patsubst %.c,%.o,$(1)) < $(patsubst %.c,%.S,$(1))
|
||||
$(CP) $(patsubst %.c,%.o,$(1)) $(patsubst %.c,%.debug.o,$(1))
|
||||
$(LLVM_STRIP) --strip-debug $(patsubst %.c,%.o,$(1))
|
||||
endef
|
||||
|
||||
@@ -1,13 +1,5 @@
|
||||
cmake_bool = $(patsubst %,-D%:BOOL=$(if $($(1)),ON,OFF),$(2))
|
||||
|
||||
PKG_USE_NINJA ?= 1
|
||||
HOST_USE_NINJA ?= 1
|
||||
ifeq ($(PKG_USE_NINJA),1)
|
||||
PKG_BUILD_PARALLEL ?= 1
|
||||
endif
|
||||
ifeq ($(HOST_USE_NINJA),1)
|
||||
HOST_BUILD_PARALLEL ?= 1
|
||||
endif
|
||||
PKG_INSTALL:=1
|
||||
|
||||
ifneq ($(findstring c,$(OPENWRT_VERBOSE)),)
|
||||
@@ -18,13 +10,12 @@ endif
|
||||
CMAKE_BINARY_DIR = $(PKG_BUILD_DIR)$(if $(CMAKE_BINARY_SUBDIR),/$(CMAKE_BINARY_SUBDIR))
|
||||
CMAKE_SOURCE_DIR = $(PKG_BUILD_DIR)$(if $(CMAKE_SOURCE_SUBDIR),/$(CMAKE_SOURCE_SUBDIR))
|
||||
HOST_CMAKE_SOURCE_DIR = $(HOST_BUILD_DIR)$(if $(CMAKE_SOURCE_SUBDIR),/$(CMAKE_SOURCE_SUBDIR))
|
||||
HOST_CMAKE_BINARY_DIR = $(HOST_BUILD_DIR)$(if $(CMAKE_BINARY_SUBDIR),/$(CMAKE_BINARY_SUBDIR))
|
||||
MAKE_PATH = $(firstword $(CMAKE_BINARY_SUBDIR) .)
|
||||
|
||||
ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),)
|
||||
cmake_tool=$(firstword $(TOOLCHAIN_BIN_DIRS))/$(1)
|
||||
cmake_tool=$(TOOLCHAIN_DIR)/bin/$(1)
|
||||
else
|
||||
cmake_tool=$(shell command -v $(1))
|
||||
cmake_tool=$(shell which $(1))
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_CCACHE),)
|
||||
@@ -49,42 +40,9 @@ CMAKE_AR:=$(call cmake_tool,$(TARGET_AR))
|
||||
CMAKE_NM:=$(call cmake_tool,$(TARGET_NM))
|
||||
CMAKE_RANLIB:=$(call cmake_tool,$(TARGET_RANLIB))
|
||||
|
||||
CMAKE_FIND_ROOT_PATH:=$(STAGING_DIR)/usr;$(TOOLCHAIN_ROOT_DIR)
|
||||
CMAKE_FIND_ROOT_PATH:=$(STAGING_DIR)/usr;$(TOOLCHAIN_DIR)$(if $(CONFIG_EXTERNAL_TOOLCHAIN),;$(CONFIG_TOOLCHAIN_ROOT))
|
||||
CMAKE_HOST_FIND_ROOT_PATH:=$(STAGING_DIR)/host;$(STAGING_DIR_HOSTPKG);$(STAGING_DIR_HOST)
|
||||
CMAKE_SHARED_LDFLAGS:=-Wl,-Bsymbolic-functions
|
||||
CMAKE_HOST_INSTALL_PREFIX = $(HOST_BUILD_PREFIX)
|
||||
|
||||
ifeq ($(HOST_USE_NINJA),1)
|
||||
CMAKE_HOST_OPTIONS += -DCMAKE_GENERATOR="Ninja"
|
||||
|
||||
define Host/Compile/Default
|
||||
+$(NINJA) -C $(HOST_CMAKE_BINARY_DIR) $(1)
|
||||
endef
|
||||
|
||||
define Host/Install/Default
|
||||
+$(NINJA) -C $(HOST_CMAKE_BINARY_DIR) install
|
||||
endef
|
||||
|
||||
define Host/Uninstall/Default
|
||||
+$(NINJA) -C $(HOST_CMAKE_BINARY_DIR) uninstall
|
||||
endef
|
||||
else
|
||||
CMAKE_HOST_OPTIONS += -DCMAKE_GENERATOR="Unix Makefiles"
|
||||
endif
|
||||
|
||||
ifeq ($(PKG_USE_NINJA),1)
|
||||
CMAKE_OPTIONS += -DCMAKE_GENERATOR="Ninja"
|
||||
|
||||
define Build/Compile/Default
|
||||
+$(NINJA) -C $(CMAKE_BINARY_DIR) $(1)
|
||||
endef
|
||||
|
||||
define Build/Install/Default
|
||||
+DESTDIR="$(PKG_INSTALL_DIR)" $(NINJA) -C $(CMAKE_BINARY_DIR) install
|
||||
endef
|
||||
else
|
||||
CMAKE_OPTIONS += -DCMAKE_GENERATOR="Unix Makefiles"
|
||||
endif
|
||||
|
||||
define Build/Configure/Default
|
||||
mkdir -p $(CMAKE_BINARY_DIR)
|
||||
@@ -93,11 +51,10 @@ define Build/Configure/Default
|
||||
CXXFLAGS="$(TARGET_CXXFLAGS) $(EXTRA_CXXFLAGS)" \
|
||||
LDFLAGS="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)" \
|
||||
cmake \
|
||||
--no-warn-unused-cli \
|
||||
-DCMAKE_SYSTEM_NAME=Linux \
|
||||
-DCMAKE_SYSTEM_VERSION=1 \
|
||||
-DCMAKE_SYSTEM_PROCESSOR=$(ARCH) \
|
||||
-DCMAKE_BUILD_TYPE=$(if $(CONFIG_DEBUG),Debug,Release) \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_C_FLAGS_RELEASE="-DNDEBUG" \
|
||||
-DCMAKE_CXX_FLAGS_RELEASE="-DNDEBUG" \
|
||||
-DCMAKE_C_COMPILER_LAUNCHER="$(CMAKE_C_COMPILER_LAUNCHER)" \
|
||||
@@ -140,13 +97,11 @@ endef
|
||||
Build/InstallDev = $(if $(CMAKE_INSTALL),$(Build/InstallDev/cmake))
|
||||
|
||||
define Host/Configure/Default
|
||||
mkdir -p "$(HOST_CMAKE_BINARY_DIR)"
|
||||
(cd $(HOST_CMAKE_BINARY_DIR); \
|
||||
(cd $(HOST_BUILD_DIR); \
|
||||
CFLAGS="$(HOST_CFLAGS)" \
|
||||
CXXFLAGS="$(HOST_CFLAGS)" \
|
||||
LDFLAGS="$(HOST_LDFLAGS)" \
|
||||
cmake \
|
||||
--no-warn-unused-cli \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_C_COMPILER_LAUNCHER="$(CMAKE_C_COMPILER_LAUNCHER)" \
|
||||
-DCMAKE_C_COMPILER="$(CMAKE_HOST_C_COMPILER)" \
|
||||
@@ -164,7 +119,7 @@ define Host/Configure/Default
|
||||
-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \
|
||||
-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY \
|
||||
-DCMAKE_STRIP=: \
|
||||
-DCMAKE_INSTALL_PREFIX=$(CMAKE_HOST_INSTALL_PREFIX) \
|
||||
-DCMAKE_INSTALL_PREFIX=$(HOST_BUILD_PREFIX) \
|
||||
-DCMAKE_PREFIX_PATH=$(HOST_BUILD_PREFIX) \
|
||||
-DCMAKE_SKIP_RPATH=TRUE \
|
||||
-DCMAKE_INSTALL_LIBDIR=lib \
|
||||
@@ -174,7 +129,6 @@ define Host/Configure/Default
|
||||
-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=TRUE \
|
||||
-DCMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY=FALSE \
|
||||
-DCMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY=TRUE \
|
||||
-DBUILD_SHARED_LIBS=OFF \
|
||||
$(CMAKE_HOST_OPTIONS) \
|
||||
$(HOST_CMAKE_SOURCE_DIR) \
|
||||
)
|
||||
|
||||
@@ -11,8 +11,7 @@
|
||||
|
||||
DEP_FINDPARAMS := -x "*/.svn*" -x ".*" -x "*:*" -x "*\!*" -x "* *" -x "*\\\#*" -x "*/.*_check" -x "*/.*.swp" -x "*/.pkgdir*"
|
||||
|
||||
find_md5=find $(wildcard $(1)) -type f $(patsubst -x,-and -not -path,$(DEP_FINDPARAMS) $(2)) -printf "%p%T@\n" | sort | $(MKHASH) md5
|
||||
find_md5_reproducible=find $(wildcard $(1)) -type f $(patsubst -x,-and -not -path,$(DEP_FINDPARAMS) $(2)) -print0 | xargs -0 $(MKHASH) md5 | sort | $(MKHASH) md5
|
||||
find_md5=find $(wildcard $(1)) -type f $(patsubst -x,-and -not -path,$(DEP_FINDPARAMS) $(2)) -printf "%p%T@\n" | sort | mkhash md5
|
||||
|
||||
define rdep
|
||||
.PRECIOUS: $(2)
|
||||
@@ -28,7 +27,7 @@ ifneq ($(wildcard $(2)),)
|
||||
{ [ \! -f "$(3)" ] || diff $(3) $(3).1 >/dev/null; } && \
|
||||
) \
|
||||
{ \
|
||||
[ -f "$(2)_check.1" ] && mv "$(2)_check.1" "$(2)_check"; \
|
||||
[ -f "$(2)_check.1" ] && mv "$(2)_check.1"; \
|
||||
$(TOPDIR)/scripts/timestamp.pl $(DEP_FINDPARAMS) $(4) -n $(2) $(1) && { \
|
||||
$(call debug_eval,$(SUBDIR),r,echo "No need to rebuild $(2)";) \
|
||||
touch -r "$(2)" "$(2)_check"; \
|
||||
|
||||
@@ -10,18 +10,14 @@ LEDE_GIT = $(PROJECT_GIT)
|
||||
|
||||
ifdef PKG_SOURCE_VERSION
|
||||
ifndef PKG_VERSION
|
||||
PKG_VERSION := $(if $(PKG_SOURCE_DATE),$(subst -,.,$(PKG_SOURCE_DATE)),0)~$(call version_abbrev,$(PKG_SOURCE_VERSION))
|
||||
PKG_VERSION := $(if $(PKG_SOURCE_DATE),$(PKG_SOURCE_DATE)-)$(call version_abbrev,$(PKG_SOURCE_VERSION))
|
||||
endif
|
||||
PKG_SOURCE_SUBDIR ?= $(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE ?= $(PKG_SOURCE_SUBDIR).tar.zst
|
||||
PKG_SOURCE ?= $(PKG_SOURCE_SUBDIR).tar.xz
|
||||
endif
|
||||
|
||||
DOWNLOAD_RDEP=$(STAMP_PREPARED) $(HOST_STAMP_PREPARED)
|
||||
|
||||
# Export options for download.pl
|
||||
export DOWNLOAD_CHECK_CERTIFICATE:=$(CONFIG_DOWNLOAD_CHECK_CERTIFICATE)
|
||||
export DOWNLOAD_TOOL_CUSTOM:=$(CONFIG_DOWNLOAD_TOOL_CUSTOM)
|
||||
|
||||
define dl_method_git
|
||||
$(if $(filter https://github.com/% git://github.com/%,$(1)),github_archive,git)
|
||||
endef
|
||||
@@ -31,7 +27,7 @@ define dl_method
|
||||
$(strip \
|
||||
$(if $(filter git,$(2)),$(call dl_method_git,$(1),$(2)),
|
||||
$(if $(2),$(2), \
|
||||
$(if $(filter @OPENWRT @APACHE/% @DEBIAN/% @GITHUB/% @GNOME/% @GNU/% @KERNEL/% @SF/% @SAVANNAH/% ftp://% http://% https://% file://%,$(1)),default, \
|
||||
$(if $(filter @OPENWRT @APACHE/% @GITHUB/% @GNOME/% @GNU/% @KERNEL/% @SF/% @SAVANNAH/% ftp://% http://% https://% file://%,$(1)),default, \
|
||||
$(if $(filter git://%,$(1)),$(call dl_method_git,$(1),$(2)), \
|
||||
$(if $(filter svn://%,$(1)),svn, \
|
||||
$(if $(filter cvs://%,$(1)),cvs, \
|
||||
@@ -63,21 +59,6 @@ define dl_tar_pack
|
||||
$$$${TAR_TIMESTAMP:+--mtime="$$$$TAR_TIMESTAMP"} -c $(2) | $(call dl_pack,$(1))
|
||||
endef
|
||||
|
||||
gen_sha256sum = $(shell $(MKHASH) sha256 $(DL_DIR)/$(1))
|
||||
|
||||
# Used in Build/CoreTargets and HostBuild/Core as an integrity check for
|
||||
# downloaded files. It will add a FORCE rule if the sha256 hash does not
|
||||
# match, so that the download can be more thoroughly handled by download.pl.
|
||||
define check_download_integrity
|
||||
expected_hash:=$(strip $(if $(filter-out x,$(HASH)),$(HASH),$(MIRROR_HASH)))
|
||||
$$(if $$(and $(FILE),$$(wildcard $(DL_DIR)/$(FILE)), \
|
||||
$$(filter undefined,$$(flavor DownloadChecked/$(FILE)))), \
|
||||
$$(eval DownloadChecked/$(FILE):=1) \
|
||||
$$(if $$(filter-out $$(call gen_sha256sum,$(FILE)),$$(expected_hash)), \
|
||||
$(DL_DIR)/$(FILE): FORCE) \
|
||||
)
|
||||
endef
|
||||
|
||||
ifdef CHECK
|
||||
check_escape=$(subst ','\'',$(1))
|
||||
#')
|
||||
@@ -93,6 +74,8 @@ else
|
||||
check_warn = $(if $(filter-out undefined,$(origin F_$(1))),$(filter ,$(shell $(call F_$(1),$(2),$(3),$(4)) >&2)),$(check_warn_nofix))
|
||||
endif
|
||||
|
||||
gen_sha256sum = $(shell mkhash sha256 $(DL_DIR)/$(1))
|
||||
|
||||
ifdef FIXUP
|
||||
F_hash_deprecated = $(SCRIPT_DIR)/fixup-makefile.pl $(CURDIR)/Makefile fix-hash $(3) $(call gen_sha256sum,$(1)) $(2)
|
||||
F_hash_mismatch = $(F_hash_deprecated)
|
||||
@@ -168,7 +151,7 @@ define DownloadMethod/cvs
|
||||
cd $(TMP_DIR)/dl && \
|
||||
rm -rf $(SUBDIR) && \
|
||||
[ \! -d $(SUBDIR) ] && \
|
||||
cvs -d $(URL) export $(SOURCE_VERSION) $(SUBDIR) && \
|
||||
cvs -d $(URL) export $(VERSION) $(SUBDIR) && \
|
||||
echo "Packing checkout..." && \
|
||||
$(call dl_tar_pack,$(TMP_DIR)/dl/$(FILE),$(SUBDIR)) && \
|
||||
mv $(TMP_DIR)/dl/$(FILE) $(DL_DIR)/ && \
|
||||
@@ -184,10 +167,10 @@ define DownloadMethod/svn
|
||||
rm -rf $(SUBDIR) && \
|
||||
[ \! -d $(SUBDIR) ] && \
|
||||
( svn help export | grep -q trust-server-cert && \
|
||||
svn export --non-interactive --trust-server-cert -r$(SOURCE_VERSION) $(URL) $(SUBDIR) || \
|
||||
svn export --non-interactive -r$(SOURCE_VERSION) $(URL) $(SUBDIR) ) && \
|
||||
svn export --non-interactive --trust-server-cert -r$(VERSION) $(URL) $(SUBDIR) || \
|
||||
svn export --non-interactive -r$(VERSION) $(URL) $(SUBDIR) ) && \
|
||||
echo "Packing checkout..." && \
|
||||
export TAR_TIMESTAMP="`svn info -r$(SOURCE_VERSION) --show-item last-changed-date $(URL)`" && \
|
||||
export TAR_TIMESTAMP="" && \
|
||||
$(call dl_tar_pack,$(TMP_DIR)/dl/$(FILE),$(SUBDIR)) && \
|
||||
mv $(TMP_DIR)/dl/$(FILE) $(DL_DIR)/ && \
|
||||
rm -rf $(SUBDIR); \
|
||||
@@ -205,21 +188,15 @@ define DownloadMethod/github_archive
|
||||
$(SCRIPT_DIR)/dl_github_archive.py \
|
||||
--dl-dir="$(DL_DIR)" \
|
||||
--url="$(URL)" \
|
||||
--version="$(SOURCE_VERSION)" \
|
||||
--version="$(VERSION)" \
|
||||
--subdir="$(SUBDIR)" \
|
||||
--source="$(FILE)" \
|
||||
--hash="$(MIRROR_HASH)" \
|
||||
--submodules $(SUBMODULES) \
|
||||
|| ( $(call DownloadMethod/rawgit) ); \
|
||||
)
|
||||
endef
|
||||
|
||||
# Only intends to be called as a submethod from other DownloadMethod
|
||||
#
|
||||
# We first clone, checkout and then we generate a tar using the
|
||||
# git archive command to apply any rules of .gitattributes
|
||||
# To keep consistency with github generated tar archive, we default
|
||||
# the short hash to 8 (default is 7). (for git log related usage)
|
||||
define DownloadMethod/rawgit
|
||||
echo "Checking out files from the git repository..."; \
|
||||
mkdir -p $(TMP_DIR)/dl && \
|
||||
@@ -227,17 +204,11 @@ define DownloadMethod/rawgit
|
||||
rm -rf $(SUBDIR) && \
|
||||
[ \! -d $(SUBDIR) ] && \
|
||||
git clone $(OPTS) $(URL) $(SUBDIR) && \
|
||||
(cd $(SUBDIR) && git checkout $(SOURCE_VERSION)) && \
|
||||
export TAR_TIMESTAMP=`cd $(SUBDIR) && git log -1 --format='@%ct'` && \
|
||||
echo "Generating formal git archive (apply .gitattributes rules)" && \
|
||||
(cd $(SUBDIR) && git config core.abbrev 8 && \
|
||||
git archive --format=tar HEAD --output=../$(SUBDIR).tar.git) && \
|
||||
$(if $(filter skip,$(SUBMODULES)),true,$(TAR) --ignore-failed-read -C $(SUBDIR) -f $(SUBDIR).tar.git -r .git .gitmodules 2>/dev/null) && \
|
||||
rm -rf $(SUBDIR) && mkdir $(SUBDIR) && \
|
||||
$(TAR) -C $(SUBDIR) -xf $(SUBDIR).tar.git && \
|
||||
(cd $(SUBDIR) && $(if $(filter skip,$(SUBMODULES)),true,git submodule update --init --recursive -- $(SUBMODULES) && \
|
||||
rm -rf .git .gitmodules)) && \
|
||||
(cd $(SUBDIR) && git checkout $(VERSION) && \
|
||||
git submodule update --init --recursive) && \
|
||||
echo "Packing checkout..." && \
|
||||
export TAR_TIMESTAMP=`cd $(SUBDIR) && git log -1 --format='@%ct'` && \
|
||||
rm -rf $(SUBDIR)/.git && \
|
||||
$(call dl_tar_pack,$(TMP_DIR)/dl/$(FILE),$(SUBDIR)) && \
|
||||
mv $(TMP_DIR)/dl/$(FILE) $(DL_DIR)/ && \
|
||||
rm -rf $(SUBDIR);
|
||||
@@ -250,7 +221,7 @@ define DownloadMethod/bzr
|
||||
cd $(TMP_DIR)/dl && \
|
||||
rm -rf $(SUBDIR) && \
|
||||
[ \! -d $(SUBDIR) ] && \
|
||||
bzr export --per-file-timestamps -r$(SOURCE_VERSION) $(SUBDIR) $(URL) && \
|
||||
bzr export --per-file-timestamps -r$(VERSION) $(SUBDIR) $(URL) && \
|
||||
echo "Packing checkout..." && \
|
||||
export TAR_TIMESTAMP="" && \
|
||||
$(call dl_tar_pack,$(TMP_DIR)/dl/$(FILE),$(SUBDIR)) && \
|
||||
@@ -266,7 +237,7 @@ define DownloadMethod/hg
|
||||
cd $(TMP_DIR)/dl && \
|
||||
rm -rf $(SUBDIR) && \
|
||||
[ \! -d $(SUBDIR) ] && \
|
||||
hg clone -r $(SOURCE_VERSION) $(URL) $(SUBDIR) && \
|
||||
hg clone -r $(VERSION) $(URL) $(SUBDIR) && \
|
||||
export TAR_TIMESTAMP=`cd $(SUBDIR) && hg log --template '@{date}' -l 1` && \
|
||||
find $(SUBDIR) -name .hg | xargs rm -rf && \
|
||||
echo "Packing checkout..." && \
|
||||
@@ -283,7 +254,7 @@ define DownloadMethod/darcs
|
||||
cd $(TMP_DIR)/dl && \
|
||||
rm -rf $(SUBDIR) && \
|
||||
[ \! -d $(SUBDIR) ] && \
|
||||
darcs get -t $(SOURCE_VERSION) $(URL) $(SUBDIR) && \
|
||||
darcs get -t $(VERSION) $(URL) $(SUBDIR) && \
|
||||
export TAR_TIMESTAMP=`cd $(SUBDIR) && LC_ALL=C darcs log --last 1 | sed -ne 's!^Date: \+!!p'` && \
|
||||
find $(SUBDIR) -name _darcs | xargs rm -rf && \
|
||||
echo "Packing checkout..." && \
|
||||
@@ -293,12 +264,12 @@ define DownloadMethod/darcs
|
||||
)
|
||||
endef
|
||||
|
||||
Validate/cvs=SOURCE_VERSION SUBDIR
|
||||
Validate/svn=SOURCE_VERSION SUBDIR
|
||||
Validate/git=SOURCE_VERSION SUBDIR
|
||||
Validate/bzr=SOURCE_VERSION SUBDIR
|
||||
Validate/hg=SOURCE_VERSION SUBDIR
|
||||
Validate/darcs=SOURCE_VERSION SUBDIR
|
||||
Validate/cvs=VERSION SUBDIR
|
||||
Validate/svn=VERSION SUBDIR
|
||||
Validate/git=VERSION SUBDIR
|
||||
Validate/bzr=VERSION SUBDIR
|
||||
Validate/hg=VERSION SUBDIR
|
||||
Validate/darcs=VERSION SUBDIR
|
||||
|
||||
define Download/Defaults
|
||||
URL:=
|
||||
@@ -311,9 +282,8 @@ define Download/Defaults
|
||||
MIRROR:=1
|
||||
MIRROR_HASH=$$(MIRROR_MD5SUM)
|
||||
MIRROR_MD5SUM:=x
|
||||
SOURCE_VERSION:=
|
||||
VERSION:=
|
||||
OPTS:=
|
||||
SUBMODULES:=
|
||||
endef
|
||||
|
||||
define Download/default
|
||||
@@ -322,11 +292,10 @@ define Download/default
|
||||
URL_FILE:=$(PKG_SOURCE_URL_FILE)
|
||||
SUBDIR:=$(PKG_SOURCE_SUBDIR)
|
||||
PROTO:=$(PKG_SOURCE_PROTO)
|
||||
SUBMODULES:=$(PKG_SOURCE_SUBMODULES)
|
||||
$(if $(PKG_SOURCE_MIRROR),MIRROR:=$(filter 1,$(PKG_MIRROR)))
|
||||
$(if $(PKG_MIRROR_MD5SUM),MIRROR_MD5SUM:=$(PKG_MIRROR_MD5SUM))
|
||||
$(if $(PKG_MIRROR_HASH),MIRROR_HASH:=$(PKG_MIRROR_HASH))
|
||||
SOURCE_VERSION:=$(PKG_SOURCE_VERSION)
|
||||
VERSION:=$(PKG_SOURCE_VERSION)
|
||||
$(if $(PKG_MD5SUM),MD5SUM:=$(PKG_MD5SUM))
|
||||
$(if $(PKG_HASH),HASH:=$(PKG_HASH))
|
||||
endef
|
||||
|
||||
@@ -18,10 +18,6 @@ opkg_package_files = $(wildcard \
|
||||
$(foreach dir,$(PACKAGE_SUBDIRS), \
|
||||
$(foreach pkg,$(1), $(dir)/$(pkg)_*.ipk)))
|
||||
|
||||
apk_package_files = $(wildcard \
|
||||
$(foreach dir,$(PACKAGE_SUBDIRS), \
|
||||
$(foreach pkg,$(1), $(dir)/$(pkg)_*.apk)))
|
||||
|
||||
# 1: package name
|
||||
define FeedPackageDir
|
||||
$(strip $(if $(CONFIG_PER_FEED_REPO), \
|
||||
@@ -32,12 +28,12 @@ $(strip $(if $(CONFIG_PER_FEED_REPO), \
|
||||
endef
|
||||
|
||||
# 1: destination file
|
||||
define FeedSourcesAppendOPKG
|
||||
define FeedSourcesAppend
|
||||
( \
|
||||
echo 'src/gz %d_core %U/targets/%S/packages'; \
|
||||
$(strip $(if $(CONFIG_PER_FEED_REPO), \
|
||||
echo 'src/gz %d_base %U/packages/%A/base'; \
|
||||
$(if $(CONFIG_BUILDBOT), \
|
||||
$(if $(filter %SNAPSHOT-y,$(VERSION_NUMBER)-$(CONFIG_BUILDBOT)), \
|
||||
echo 'src/gz %d_kmods %U/targets/%S/kmods/$(LINUX_VERSION)-$(LINUX_RELEASE)-$(LINUX_VERMAGIC)';) \
|
||||
$(foreach feed,$(FEEDS_AVAILABLE), \
|
||||
$(if $(CONFIG_FEED_$(feed)), \
|
||||
@@ -45,27 +41,7 @@ define FeedSourcesAppendOPKG
|
||||
) >> $(1)
|
||||
endef
|
||||
|
||||
# 1: destination file
|
||||
define FeedSourcesAppendAPK
|
||||
( \
|
||||
echo '%U/targets/%S/packages/packages.adb'; \
|
||||
$(strip $(if $(CONFIG_PER_FEED_REPO), \
|
||||
echo '%U/packages/%A/base/packages.adb'; \
|
||||
$(if $(CONFIG_BUILDBOT), \
|
||||
echo '%U/targets/%S/kmods/$(LINUX_VERSION)-$(LINUX_RELEASE)-$(LINUX_VERMAGIC)/packages.adb';) \
|
||||
$(foreach feed,$(FEEDS_AVAILABLE), \
|
||||
$(if $(CONFIG_FEED_$(feed)), \
|
||||
echo '$(if $(filter m,$(CONFIG_FEED_$(feed))),# )%U/packages/%A/$(feed)/packages.adb';)))) \
|
||||
) >> $(1)
|
||||
endef
|
||||
|
||||
# 1: package name
|
||||
define GetABISuffix
|
||||
$(if $(ABIV_$(1)),$(ABIV_$(1)),$(call FormatABISuffix,$(1),$(foreach v,$(wildcard $(STAGING_DIR)/pkginfo/$(1).version),$(shell cat $(v)))))
|
||||
endef
|
||||
|
||||
# 1: package name
|
||||
# 2: abi version
|
||||
define FormatABISuffix
|
||||
$(if $(filter-out kmod-%,$(1)),$(if $(2),$(if $(filter %0 %1 %2 %3 %4 %5 %6 %7 %8 %9,$(1)),-)$(2)))
|
||||
$(if $(filter-out kmod-%,$(1)),$(if $(ABIV_$(1)),$(ABIV_$(1)),$(foreach v,$(wildcard $(STAGING_DIR)/pkginfo/$(1).version),$(shell cat $(v)))))
|
||||
endef
|
||||
|
||||
@@ -36,11 +36,6 @@ ifdef CONFIG_PKG_CC_STACKPROTECTOR_STRONG
|
||||
TARGET_CFLAGS += -fstack-protector-strong
|
||||
endif
|
||||
endif
|
||||
ifdef CONFIG_PKG_CC_STACKPROTECTOR_ALL
|
||||
ifeq ($(strip $(PKG_SSP)),1)
|
||||
TARGET_CFLAGS += -fstack-protector-all
|
||||
endif
|
||||
endif
|
||||
ifdef CONFIG_PKG_FORTIFY_SOURCE_1
|
||||
ifeq ($(strip $(PKG_FORTIFY_SOURCE)),1)
|
||||
TARGET_CFLAGS += -D_FORTIFY_SOURCE=1
|
||||
|
||||
@@ -21,12 +21,11 @@ include $(INCLUDE_DIR)/depends.mk
|
||||
include $(INCLUDE_DIR)/quilt.mk
|
||||
|
||||
BUILD_TYPES += host
|
||||
HOST_STAMP_PREPARED=$(HOST_BUILD_DIR)/.prepared$(if $(HOST_QUILT)$(DUMP),,$(shell $(call $(if $(CONFIG_AUTOREMOVE),find_md5_reproducible,find_md5),${CURDIR} $(PKG_FILE_DEPENDS),))_$(call confvar,CONFIG_AUTOREMOVE $(HOST_PREPARED_DEPENDS)))
|
||||
HOST_STAMP_PREPARED=$(HOST_BUILD_DIR)/.prepared$(if $(HOST_QUILT)$(DUMP),,$(shell $(call find_md5,${CURDIR} $(PKG_FILE_DEPENDS),))_$(call confvar,CONFIG_AUTOREMOVE $(HOST_PREPARED_DEPENDS)))
|
||||
HOST_STAMP_CONFIGURED:=$(HOST_BUILD_DIR)/.configured
|
||||
HOST_STAMP_BUILT:=$(HOST_BUILD_DIR)/.built
|
||||
HOST_BUILD_PREFIX?=$(if $(IS_PACKAGE_BUILD),$(STAGING_DIR_HOSTPKG),$(STAGING_DIR_HOST))
|
||||
HOST_STAMP_INSTALLED:=$(HOST_BUILD_PREFIX)/stamp/.$(PKG_NAME)_installed
|
||||
HOST_STAMP_PROGRAMS:=$(foreach program,$(PKG_PROGRAMS),$(dir $(HOST_STAMP_INSTALLED))$(subst $(PKG_NAME),$(program),$(notdir $(HOST_STAMP_INSTALLED))) )
|
||||
|
||||
override MAKEFLAGS=
|
||||
|
||||
@@ -35,31 +34,23 @@ include $(INCLUDE_DIR)/autotools.mk
|
||||
_host_target:=$(if $(HOST_QUILT),,.)
|
||||
|
||||
Host/Patch:=$(Host/Patch/Default)
|
||||
define Host/Prepare/Default
|
||||
$(if $(strip $(HOST_UNPACK)),$(HOST_UNPACK))
|
||||
ifneq ($(strip $(HOST_UNPACK)),)
|
||||
define Host/Prepare/Default
|
||||
$(HOST_UNPACK)
|
||||
[ ! -d ./src/ ] || $(CP) ./src/* $(HOST_BUILD_DIR)
|
||||
$(Host/Patch)
|
||||
endef
|
||||
endef
|
||||
endif
|
||||
|
||||
define Host/Prepare
|
||||
$(call Host/Prepare/Default)
|
||||
endef
|
||||
|
||||
define Host/Gnulib/Prepare
|
||||
$(STAGING_DIR_HOST)/bin/gnulib-tool \
|
||||
--local-dir=$(STAGING_DIR_HOST)/share/gnulib \
|
||||
--source-base=$(PKG_GNULIB_BASE) \
|
||||
$(PKG_GNULIB_ARGS) \
|
||||
$(PKG_GNULIB_MODS) \
|
||||
;
|
||||
endef
|
||||
|
||||
HOST_CONFIGURE_VARS = \
|
||||
CC="$(HOSTCC)" \
|
||||
CFLAGS="$(HOST_CFLAGS)" \
|
||||
CXX="$(HOSTCXX)" \
|
||||
CPPFLAGS="$(HOST_CPPFLAGS)" \
|
||||
CXXFLAGS="$(HOST_CXXFLAGS)" \
|
||||
LDFLAGS="$(HOST_LDFLAGS)" \
|
||||
CONFIG_SHELL="$(SHELL)"
|
||||
|
||||
@@ -67,7 +58,6 @@ HOST_CONFIGURE_ARGS = \
|
||||
--target=$(GNU_HOST_NAME) \
|
||||
--host=$(GNU_HOST_NAME) \
|
||||
--build=$(GNU_HOST_NAME) \
|
||||
--disable-dependency-tracking \
|
||||
--program-prefix="" \
|
||||
--program-suffix="" \
|
||||
--prefix=$(HOST_BUILD_PREFIX) \
|
||||
@@ -76,10 +66,6 @@ HOST_CONFIGURE_ARGS = \
|
||||
--localstatedir=$(HOST_BUILD_PREFIX)/var \
|
||||
--sbindir=$(HOST_BUILD_PREFIX)/bin
|
||||
|
||||
ifneq ($(YEAR_2038),y)
|
||||
HOST_CONFIGURE_ARGS += --disable-year2038
|
||||
endif
|
||||
|
||||
HOST_MAKE_VARS = \
|
||||
CFLAGS="$(HOST_CFLAGS)" \
|
||||
CPPFLAGS="$(HOST_CPPFLAGS)" \
|
||||
@@ -111,25 +97,19 @@ define Host/Configure
|
||||
$(call Host/Configure/Default)
|
||||
endef
|
||||
|
||||
HOST_MAKE_PATH ?= .
|
||||
|
||||
define Host/Compile/Default
|
||||
+$(HOST_MAKE_VARS) \
|
||||
$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR)/$(HOST_MAKE_PATH) \
|
||||
$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) \
|
||||
$(HOST_MAKE_FLAGS) \
|
||||
$(1)
|
||||
endef
|
||||
|
||||
define Host/Compile
|
||||
$(call Host/Compile/Default,$(if $(PKG_SUBDIRS),SUBDIRS='$$$$(wildcard $(PKG_SUBDIRS))'))
|
||||
endef
|
||||
|
||||
define Host/Gnulib/Compile
|
||||
$(call Host/Compile/Default,SUBDIRS='$$$$(wildcard $(PKG_GNULIB_BASE))')
|
||||
$(call Host/Compile/Default)
|
||||
endef
|
||||
|
||||
define Host/Install/Default
|
||||
$(call Host/Compile/Default,$(if $(PKG_SUBDIRS),SUBDIRS='$$$$(wildcard $(PKG_SUBDIRS))') install)
|
||||
$(call Host/Compile/Default,install)
|
||||
endef
|
||||
|
||||
define Host/Install
|
||||
@@ -149,7 +129,6 @@ define Host/Exports/Default
|
||||
$(1) : export STAGING_PREFIX=$$(HOST_BUILD_PREFIX)
|
||||
$(1) : export PKG_CONFIG_PATH=$$(STAGING_DIR_HOST)/lib/pkgconfig:$$(HOST_BUILD_PREFIX)/lib/pkgconfig
|
||||
$(1) : export PKG_CONFIG_LIBDIR=$$(HOST_BUILD_PREFIX)/lib/pkgconfig
|
||||
$(1) : export GIT_CEILING_DIRECTORIES=$$(BUILD_DIR_HOST)
|
||||
$(if $(HOST_CONFIG_SITE),$(1) : export CONFIG_SITE:=$(HOST_CONFIG_SITE))
|
||||
$(if $(IS_PACKAGE_BUILD),$(1) : export PATH=$$(TARGET_PATH_PKG))
|
||||
endef
|
||||
@@ -190,7 +169,7 @@ ifndef DUMP
|
||||
$(foreach hook,$(Hooks/HostInstall/Post),$(call $(hook))$(sep))
|
||||
mkdir -p $$(shell dirname $$@)
|
||||
touch $(HOST_STAMP_BUILT)
|
||||
touch $$@ $(HOST_STAMP_PROGRAMS)
|
||||
touch $$@
|
||||
|
||||
$(call DefaultTargets,$(patsubst %,host-%,$(DEFAULT_SUBDIR_TARGETS)))
|
||||
ifndef STAMP_BUILT
|
||||
@@ -201,11 +180,11 @@ ifndef DUMP
|
||||
clean-build: host-clean-build
|
||||
endif
|
||||
|
||||
$(call check_download_integrity)
|
||||
$(DL_DIR)/$(FILE): FORCE
|
||||
|
||||
$(_host_target)host-prepare: $(HOST_STAMP_PREPARED)
|
||||
$(_host_target)host-configure: $(HOST_STAMP_CONFIGURED)
|
||||
$(_host_target)host-compile: $(HOST_STAMP_BUILT) $(HOST_STAMP_INSTALLED) $(HOST_STAMP_PROGRAMS)
|
||||
$(_host_target)host-compile: $(HOST_STAMP_BUILT) $(HOST_STAMP_INSTALLED)
|
||||
host-install: host-compile
|
||||
|
||||
host-clean-build: FORCE
|
||||
@@ -214,21 +193,17 @@ ifndef DUMP
|
||||
|
||||
host-clean: host-clean-build
|
||||
$(call Host/Clean)
|
||||
rm -rf $(HOST_STAMP_INSTALLED) $(HOST_STAMP_PROGRAMS)
|
||||
rm -rf $(HOST_STAMP_INSTALLED)
|
||||
|
||||
ifneq ($(CONFIG_AUTOREMOVE),)
|
||||
host-compile:
|
||||
$(FIND) $(HOST_BUILD_DIR) -mindepth 1 -maxdepth 1 -not '(' -type f -and -name '.*' -and -size 0 ')' -print0 | \
|
||||
$(XARGS) -0 rm -rf
|
||||
$(FIND) $(HOST_BUILD_DIR) -mindepth 1 -maxdepth 1 -not '(' -type f -and -name '.*' -and -size 0 ')' | \
|
||||
$(XARGS) rm -rf
|
||||
endif
|
||||
endef
|
||||
endif
|
||||
|
||||
define HostBuild
|
||||
$(HostBuild/Core)
|
||||
$(if $(if $(PKG_HOST_ONLY),,$(if $(and $(filter host-%,$(MAKECMDGOALS)),$(PKG_SKIP_DOWNLOAD)),,$(STAMP_PREPARED))),,
|
||||
$(if $(and $(CONFIG_AUTOREMOVE), $(wildcard $(HOST_STAMP_INSTALLED), $(wildcard $(HOST_STAMP_BUILT)))),,
|
||||
$(if $(strip $(PKG_SOURCE_URL)),$(call Download,default))
|
||||
)
|
||||
)
|
||||
$(if $(if $(PKG_HOST_ONLY),,$(STAMP_PREPARED)),,$(if $(strip $(PKG_SOURCE_URL)),$(call Download,default)))
|
||||
endef
|
||||
|
||||
@@ -4,7 +4,7 @@ IMAGE_KERNEL = $(word 1,$^)
|
||||
IMAGE_ROOTFS = $(word 2,$^)
|
||||
|
||||
define ModelNameLimit16
|
||||
$(shell printf %.16s "$(word 2, $(subst _, ,$(1)))")
|
||||
$(shell expr substr "$(word 2, $(subst _, ,$(1)))" 1 16)
|
||||
endef
|
||||
|
||||
define rootfs_align
|
||||
@@ -27,40 +27,6 @@ define Build/append-kernel
|
||||
dd if=$(IMAGE_KERNEL) >> $@
|
||||
endef
|
||||
|
||||
define Build/package-kernel-ubifs
|
||||
mkdir $@.kernelubifs
|
||||
cp $@ $@.kernelubifs/kernel
|
||||
$(STAGING_DIR_HOST)/bin/mkfs.ubifs \
|
||||
$(KERNEL_UBIFS_OPTS) \
|
||||
-r $@.kernelubifs $@
|
||||
rm -r $@.kernelubifs
|
||||
endef
|
||||
|
||||
define Build/append-image
|
||||
cp "$(BIN_DIR)/$(DEVICE_IMG_PREFIX)-$(1)" "$@.stripmeta"
|
||||
fwtool -s /dev/null -t "$@.stripmeta" || :
|
||||
fwtool -i /dev/null -t "$@.stripmeta" || :
|
||||
dd if="$@.stripmeta" >> "$@"
|
||||
rm "$@.stripmeta"
|
||||
endef
|
||||
|
||||
ifdef IB
|
||||
define Build/append-image-stage
|
||||
dd if=$(STAGING_DIR_IMAGE)/$(BOARD)-$(SUBTARGET)-$(DEVICE_NAME)-$(1) >> $@
|
||||
endef
|
||||
else
|
||||
define Build/append-image-stage
|
||||
cp "$(BIN_DIR)/$(DEVICE_IMG_PREFIX)-$(1)" "$@.stripmeta"
|
||||
fwtool -s /dev/null -t "$@.stripmeta" || :
|
||||
fwtool -i /dev/null -t "$@.stripmeta" || :
|
||||
mkdir -p "$(STAGING_DIR_IMAGE)"
|
||||
dd if="$@.stripmeta" of="$(STAGING_DIR_IMAGE)/$(BOARD)-$(SUBTARGET)-$(DEVICE_NAME)-$(1)"
|
||||
dd if="$@.stripmeta" >> "$@"
|
||||
rm "$@.stripmeta"
|
||||
endef
|
||||
endif
|
||||
|
||||
|
||||
compat_version=$(if $(DEVICE_COMPAT_VERSION),$(DEVICE_COMPAT_VERSION),1.0)
|
||||
json_quote=$(subst ','\'',$(subst ",\",$(1)))
|
||||
#")')
|
||||
@@ -90,7 +56,6 @@ metadata_json = \
|
||||
|
||||
define Build/append-metadata
|
||||
$(if $(SUPPORTED_DEVICES),-echo $(call metadata_json) | fwtool -I - $@)
|
||||
sha256sum "$@" | cut -d" " -f1 > "$@.sha256sum"
|
||||
[ ! -s "$(BUILD_KEY)" -o ! -s "$(BUILD_KEY).ucert" -o ! -s "$@" ] || { \
|
||||
cp "$(BUILD_KEY).ucert" "$@.ucert" ;\
|
||||
usign -S -m "$@" -s "$(BUILD_KEY)" -x "$@.sig" ;\
|
||||
@@ -106,41 +71,23 @@ endef
|
||||
define Build/append-squashfs-fakeroot-be
|
||||
rm -rf $@.fakefs $@.fakesquashfs
|
||||
mkdir $@.fakefs
|
||||
$(STAGING_DIR_HOST)/bin/mksquashfs3-lzma \
|
||||
$(STAGING_DIR_HOST)/bin/mksquashfs-lzma \
|
||||
$@.fakefs $@.fakesquashfs \
|
||||
-noappend -root-owned -be -nopad -b 65536 \
|
||||
$(if $(SOURCE_DATE_EPOCH),-fixed-time $(SOURCE_DATE_EPOCH))
|
||||
cat $@.fakesquashfs >> $@
|
||||
endef
|
||||
|
||||
define Build/append-squashfs4-fakeroot
|
||||
rm -rf $@.fakefs $@.fakesquashfs
|
||||
mkdir $@.fakefs
|
||||
$(STAGING_DIR_HOST)/bin/mksquashfs4 \
|
||||
$@.fakefs $@.fakesquashfs \
|
||||
-nopad -noappend -root-owned
|
||||
cat $@.fakesquashfs >> $@
|
||||
endef
|
||||
|
||||
define Build/append-string
|
||||
echo -n $(1) >> $@
|
||||
endef
|
||||
|
||||
define Build/append-md5sum-ascii-salted
|
||||
cp $@ $@.salted
|
||||
echo -ne $(1) >> $@.salted
|
||||
$(STAGING_DIR_HOST)/bin/mkhash md5 $@.salted | head -c32 >> $@
|
||||
rm $@.salted
|
||||
endef
|
||||
|
||||
UBI_NAND_SIZE_LIMIT = $(IMAGE_SIZE) - ($(NAND_SIZE)*20/1024 + 4*$(BLOCKSIZE))
|
||||
|
||||
define Build/append-ubi
|
||||
sh $(TOPDIR)/scripts/ubinize-image.sh \
|
||||
$(if $(UBOOTENV_IN_UBI),--uboot-env) \
|
||||
$(if $(KERNEL_IN_UBI),--kernel $(IMAGE_KERNEL)) \
|
||||
$(foreach part,$(UBINIZE_PARTS),--part $(part)) \
|
||||
--rootfs $(IMAGE_ROOTFS) \
|
||||
$(IMAGE_ROOTFS) \
|
||||
$@.tmp \
|
||||
-p $(BLOCKSIZE:%k=%KiB) -m $(PAGESIZE) \
|
||||
$(if $(SUBPAGESIZE),-s $(SUBPAGESIZE)) \
|
||||
@@ -148,34 +95,6 @@ define Build/append-ubi
|
||||
$(UBINIZE_OPTS)
|
||||
cat $@.tmp >> $@
|
||||
rm $@.tmp
|
||||
$(if $(and $(IMAGE_SIZE),$(NAND_SIZE)),\
|
||||
$(call Build/check-size,$(UBI_NAND_SIZE_LIMIT)))
|
||||
endef
|
||||
|
||||
define Build/ubinize-image
|
||||
sh $(TOPDIR)/scripts/ubinize-image.sh \
|
||||
$(if $(UBOOTENV_IN_UBI),--uboot-env) \
|
||||
$(foreach part,$(UBINIZE_PARTS),--part $(part)) \
|
||||
--part $(word 1,$(1))="$(BIN_DIR)/$(DEVICE_IMG_PREFIX)-$(word 2,$(1))" \
|
||||
$@.tmp \
|
||||
-p $(BLOCKSIZE:%k=%KiB) -m $(PAGESIZE) \
|
||||
$(if $(SUBPAGESIZE),-s $(SUBPAGESIZE)) \
|
||||
$(if $(VID_HDR_OFFSET),-O $(VID_HDR_OFFSET)) \
|
||||
$(UBINIZE_OPTS)
|
||||
cat $@.tmp >> $@
|
||||
rm $@.tmp
|
||||
endef
|
||||
|
||||
define Build/ubinize-kernel
|
||||
cp $@ $@.tmp
|
||||
sh $(TOPDIR)/scripts/ubinize-image.sh \
|
||||
--kernel $@.tmp \
|
||||
$@ \
|
||||
-p $(BLOCKSIZE:%k=%KiB) -m $(PAGESIZE) \
|
||||
$(if $(SUBPAGESIZE),-s $(SUBPAGESIZE)) \
|
||||
$(if $(VID_HDR_OFFSET),-O $(VID_HDR_OFFSET)) \
|
||||
$(UBINIZE_OPTS)
|
||||
rm $@.tmp
|
||||
endef
|
||||
|
||||
define Build/append-uboot
|
||||
@@ -231,110 +150,25 @@ define Build/buffalo-tag-dhp
|
||||
mv $@.new $@
|
||||
endef
|
||||
|
||||
define Build/buffalo-trx
|
||||
$(eval magic=$(word 1,$(1)))
|
||||
$(eval kern_bin=$(if $(1),$(IMAGE_KERNEL),$@))
|
||||
$(eval rtfs_bin=$(word 2,$(1)))
|
||||
$(eval apnd_bin=$(word 3,$(1)))
|
||||
$(eval kern_size=$(if $(KERNEL_SIZE),$(KERNEL_SIZE),0x400000))
|
||||
|
||||
$(if $(rtfs_bin),touch $(rtfs_bin))
|
||||
$(STAGING_DIR_HOST)/bin/otrx create $@.new \
|
||||
$(if $(magic),-M $(magic),) \
|
||||
-f $(kern_bin) \
|
||||
$(if $(rtfs_bin),\
|
||||
-a 0x20000 \
|
||||
-b $$(( $(call exp_units,$(kern_size)) )) \
|
||||
-f $(rtfs_bin),) \
|
||||
$(if $(apnd_bin),\
|
||||
-A $(apnd_bin) \
|
||||
-a 0x20000)
|
||||
mv $@.new $@
|
||||
endef
|
||||
|
||||
define Build/check-size
|
||||
@imagesize="$$(stat -c%s $@)"; \
|
||||
limitsize="$$(($(call exp_units,$(if $(1),$(1),$(IMAGE_SIZE)))))"; \
|
||||
limitsize="$$(($(subst k,* 1024,$(subst m, * 1024k,$(if $(1),$(1),$(IMAGE_SIZE))))))"; \
|
||||
[ $$limitsize -ge $$imagesize ] || { \
|
||||
$(call ERROR_MESSAGE, WARNING: Image file $@ is too big: $$imagesize > $$limitsize); \
|
||||
echo "WARNING: Image file $@ is too big: $$imagesize > $$limitsize" >&2; \
|
||||
rm -f $@; \
|
||||
}
|
||||
endef
|
||||
|
||||
define Build/copy-file
|
||||
cat "$(1)" > "$@"
|
||||
endef
|
||||
|
||||
# Create a header for a D-Link AI series recovery image and add it at the beginning of the image
|
||||
# Currently supported: AQUILA M30, EAGLE M32 and R32
|
||||
# Arguments:
|
||||
# 1: Start string of the header
|
||||
# 2: Firmware version
|
||||
# 3: Block start address
|
||||
# 4: Block length
|
||||
# 5: Device FMID
|
||||
define Build/dlink-ai-recovery-header
|
||||
$(eval header_start=$(word 1,$(1)))
|
||||
$(eval firmware_version=$(word 2,$(1)))
|
||||
$(eval block_start=$(word 3,$(1)))
|
||||
$(eval block_length=$(word 4,$(1)))
|
||||
$(eval device_fmid=$(word 5,$(1)))
|
||||
# create $@.header without the checksum
|
||||
echo -en "$(header_start)\x00\x00" > "$@.header"
|
||||
# Calculate checksum over data area ($@) and append it to the header.
|
||||
# The checksum is the 2byte-sum over the whole data area.
|
||||
# Every overflow during the checksum calculation must increment the current checksum value by 1.
|
||||
od -v -w2 -tu2 -An --endian little "$@" | awk '{ s+=$$1; } END { s%=65535; printf "%c%c",s%256,s/256; }' >> "$@.header"
|
||||
echo -en "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00" >> "$@.header"
|
||||
echo -en "$(firmware_version)" >> "$@.header"
|
||||
# Only one block supported: Erase start/length is identical to data start/length
|
||||
echo -en "$(block_start)$(block_length)$(block_start)$(block_length)" >> "$@.header"
|
||||
# Only zeros
|
||||
echo -en "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" >> "$@.header"
|
||||
# Last 16 bytes, but without checksum
|
||||
echo -en "\x42\x48\x02\x00\x00\x00\x08\x00\x00\x00\x00\x00" >> "$@.header"
|
||||
echo -en "$(device_fmid)" >> "$@.header"
|
||||
# Calculate and append checksum: The checksum must be set so that the 2byte-sum of the whole header is 0.
|
||||
# Every overflow during the checksum calculation must increment the current checksum value by 1.
|
||||
od -v -w2 -tu2 -An --endian little "$@.header" | awk '{s+=65535-$$1;}END{s%=65535;printf "%c%c",s%256,s/256;}' >> "$@.header"
|
||||
cat "$@.header" "$@" > "$@.new"
|
||||
mv "$@.new" "$@"
|
||||
rm "$@.header"
|
||||
endef
|
||||
|
||||
define Build/dlink-sge-image
|
||||
$(STAGING_DIR_HOST)/bin/dlink-sge-image $(1) $@ $@.enc
|
||||
mv $@.enc $@
|
||||
endef
|
||||
|
||||
define Build/edimax-header
|
||||
$(STAGING_DIR_HOST)/bin/mkedimaximg -i $@ -o $@.new $(1)
|
||||
@mv $@.new $@
|
||||
endef
|
||||
|
||||
define Build/elecom-product-header
|
||||
$(eval product=$(word 1,$(1)))
|
||||
$(eval fw=$(if $(word 2,$(1)),$(word 2,$(1)),$@))
|
||||
|
||||
-( \
|
||||
( \
|
||||
echo -n -e "ELECOM\x00\x00$(product)" | dd bs=40 count=1 conv=sync; \
|
||||
echo -n "0.00" | dd bs=16 count=1 conv=sync; \
|
||||
dd if=$(fw); \
|
||||
) > $(fw).new \
|
||||
&& mv $(fw).new $(fw) || rm -f $(fw)
|
||||
endef
|
||||
|
||||
define Build/elecom-wrc-gs-factory
|
||||
$(eval product=$(word 1,$(1)))
|
||||
$(eval version=$(word 2,$(1)))
|
||||
$(eval hash_opt=$(word 3,$(1)))
|
||||
$(MKHASH) md5 $(hash_opt) $@ >> $@
|
||||
( \
|
||||
echo -n "ELECOM $(product) v$(version)" | \
|
||||
dd bs=32 count=1 conv=sync; \
|
||||
dd if=$@; \
|
||||
) > $@.new
|
||||
mv $@.new $@
|
||||
) > $(fw).new
|
||||
mv $(fw).new $(fw)
|
||||
endef
|
||||
|
||||
define Build/elx-header
|
||||
@@ -348,13 +182,13 @@ define Build/elx-header
|
||||
dd bs=20 count=1 conv=sync; \
|
||||
echo -ne "$$(printf '%08x' $$(stat -c%s $@) | fold -s2 | xargs -I {} echo \\x{} | tr -d '\n')" | \
|
||||
dd bs=8 count=1 conv=sync; \
|
||||
echo -ne "$$($(MKHASH) md5 $@ | fold -s2 | xargs -I {} echo \\x{} | tr -d '\n')" | \
|
||||
echo -ne "$$($(STAGING_DIR_HOST)/bin/mkhash md5 $@ | fold -s2 | xargs -I {} echo \\x{} | tr -d '\n')" | \
|
||||
dd bs=58 count=1 conv=sync; \
|
||||
) > $(KDIR)/tmp/$(DEVICE_NAME).header
|
||||
-$(call Build/xor-image,-p $(xor_pattern) -x) \
|
||||
&& cat $(KDIR)/tmp/$(DEVICE_NAME).header $@ > $@.new \
|
||||
&& mv $@.new $@ \
|
||||
&& rm -rf $(KDIR)/tmp/$(DEVICE_NAME).header
|
||||
$(call Build/xor-image,-p $(xor_pattern) -x)
|
||||
cat $(KDIR)/tmp/$(DEVICE_NAME).header $@ > $@.new
|
||||
mv $@.new $@
|
||||
rm -rf $(KDIR)/tmp/$(DEVICE_NAME).header
|
||||
endef
|
||||
|
||||
define Build/eva-image
|
||||
@@ -362,59 +196,23 @@ define Build/eva-image
|
||||
mv $@.new $@
|
||||
endef
|
||||
|
||||
define Build/initrd_compression
|
||||
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_BZIP2),.bzip2) \
|
||||
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_GZIP),.gzip) \
|
||||
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_LZ4),.lz4) \
|
||||
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_LZMA),.lzma) \
|
||||
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_LZO),.lzo) \
|
||||
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_XZ),.xz) \
|
||||
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_ZSTD),.zstd)
|
||||
endef
|
||||
|
||||
define Build/fit
|
||||
$(call locked,$(TOPDIR)/scripts/mkits.sh \
|
||||
$(TOPDIR)/scripts/mkits.sh \
|
||||
-D $(DEVICE_NAME) -o $@.its -k $@ \
|
||||
-C $(word 1,$(1)) \
|
||||
$(if $(word 2,$(1)),\
|
||||
$(if $(findstring 11,$(if $(DEVICE_DTS_OVERLAY),1)$(if $(findstring $(KERNEL_BUILD_DIR)/image-,$(word 2,$(1))),,1)), \
|
||||
-d $(KERNEL_BUILD_DIR)/image-$$(basename $(word 2,$(1))), \
|
||||
-d $(word 2,$(1)))) \
|
||||
$(if $(findstring with-rootfs,$(word 3,$(1))),-r $(IMAGE_ROOTFS)) \
|
||||
$(if $(findstring with-initrd,$(word 3,$(1))), \
|
||||
$(if $(CONFIG_TARGET_ROOTFS_INITRAMFS_SEPARATE), \
|
||||
-i $(KERNEL_BUILD_DIR)/initrd$(if $(TARGET_PER_DEVICE_ROOTFS),.$(ROOTFS_ID/$(DEVICE_NAME))).cpio$(strip $(call Build/initrd_compression)))) \
|
||||
$(if $(word 2,$(1)),-d $(word 2,$(1))) -C $(word 1,$(1)) \
|
||||
-a $(KERNEL_LOADADDR) -e $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \
|
||||
$(if $(DEVICE_FDT_NUM),-n $(DEVICE_FDT_NUM)) \
|
||||
$(if $(DEVICE_DTS_DELIMITER),-l $(DEVICE_DTS_DELIMITER)) \
|
||||
$(if $(DEVICE_DTS_LOADADDR),-s $(DEVICE_DTS_LOADADDR)) \
|
||||
$(if $(DEVICE_DTS_OVERLAY),$(foreach dtso,$(DEVICE_DTS_OVERLAY), -O $(dtso):$(KERNEL_BUILD_DIR)/image-$(dtso).dtbo)) \
|
||||
-c $(if $(DEVICE_DTS_CONFIG),$(DEVICE_DTS_CONFIG),"config-1") \
|
||||
-A $(LINUX_KARCH) -v $(LINUX_VERSION), gen-cpio$(if $(TARGET_PER_DEVICE_ROOTFS),.$(ROOTFS_ID/$(DEVICE_NAME))))
|
||||
PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage $(if $(findstring external,$(word 3,$(1))),\
|
||||
-E -B 0x1000 $(if $(findstring static,$(word 3,$(1))),-p 0x1000)) -f $@.its $@.new
|
||||
@mv $@.new $@
|
||||
endef
|
||||
|
||||
define Build/libdeflate-gzip
|
||||
$(STAGING_DIR_HOST)/bin/libdeflate-gzip -f -12 -c $@ $(1) > $@.new
|
||||
-c $(if $(DEVICE_DTS_CONFIG),$(DEVICE_DTS_CONFIG),"config@1") \
|
||||
-A $(LINUX_KARCH) -v $(LINUX_VERSION)
|
||||
PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $@.its $@.new
|
||||
@mv $@.new $@
|
||||
endef
|
||||
|
||||
define Build/gzip
|
||||
$(STAGING_DIR_HOST)/bin/gzip -f -9n -c $@ $(1) > $@.new
|
||||
gzip -f -9n -c $@ $(1) > $@.new
|
||||
@mv $@.new $@
|
||||
endef
|
||||
|
||||
define Build/gzip-filename
|
||||
@mkdir -p $@.tmp
|
||||
@cp $@ $@.tmp/$(word 1,$(1))
|
||||
$(if $(SOURCE_DATE_EPOCH),touch -hcd "@$(SOURCE_DATE_EPOCH)" $@.tmp/$(word 1,$(1)) $(word 2,$(1)))
|
||||
$(STAGING_DIR_HOST)/bin/gzip -f -9 -N -c $@.tmp/$(word 1,$(1)) $(word 2,$(1)) > $@.new
|
||||
@mv $@.new $@
|
||||
@rm -rf $@.tmp
|
||||
endef
|
||||
|
||||
define Build/install-dtb
|
||||
$(call locked, \
|
||||
$(foreach dts,$(DEVICE_DTS), \
|
||||
@@ -426,16 +224,6 @@ define Build/install-dtb
|
||||
)
|
||||
endef
|
||||
|
||||
define Build/iptime-crc32
|
||||
$(STAGING_DIR_HOST)/bin/iptime-crc32 $(1) $@ $@.new
|
||||
mv $@.new $@
|
||||
endef
|
||||
|
||||
define Build/iptime-naspkg
|
||||
$(STAGING_DIR_HOST)/bin/iptime-naspkg $(1) $@ $@.new
|
||||
mv $@.new $@
|
||||
endef
|
||||
|
||||
define Build/jffs2
|
||||
rm -rf $(KDIR_TMP)/$(DEVICE_NAME)/jffs2 && \
|
||||
mkdir -p $(KDIR_TMP)/$(DEVICE_NAME)/jffs2/$$(dirname $(1)) && \
|
||||
@@ -451,18 +239,9 @@ define Build/jffs2
|
||||
@mv $@.new $@
|
||||
endef
|
||||
|
||||
define Build/yaffs-filesystem
|
||||
let \
|
||||
kernel_size="$$(stat -c%s $@)" \
|
||||
kernel_chunks="(kernel_size / 1024) + 1" \
|
||||
filesystem_chunks="kernel_chunks + 3" \
|
||||
filesystem_blocks="(filesystem_chunks / 63) + 1" \
|
||||
filesystem_size="filesystem_blocks * 64 * 1024" \
|
||||
filesystem_size_with_reserve="(filesystem_blocks + 2) * 64 * 1024"; \
|
||||
head -c $$filesystem_size_with_reserve /dev/zero | tr "\000" "\377" > $@.img \
|
||||
&& yafut -d $@.img -w -i $@ -o kernel -C 1040 -B 64k -E -P -S $(1) \
|
||||
&& truncate -s $$filesystem_size $@.img \
|
||||
&& mv $@.img $@
|
||||
define Build/kernel2minor
|
||||
kernel2minor -k $@ -r $@.new $(1)
|
||||
mv $@.new $@
|
||||
endef
|
||||
|
||||
define Build/kernel-bin
|
||||
@@ -471,17 +250,10 @@ define Build/kernel-bin
|
||||
endef
|
||||
|
||||
define Build/linksys-image
|
||||
let \
|
||||
size="$$(stat -c%s $@)" \
|
||||
pad="$(call exp_units,$(PAGESIZE))" \
|
||||
offset="256" \
|
||||
pad="(pad - ((size + offset) % pad)) % pad"; \
|
||||
dd if=/dev/zero bs=$$pad count=1 | tr '\000' '\377' >> $@
|
||||
printf ".LINKSYS.01000409%-15s%08X%-8s%-16s" \
|
||||
$(TOPDIR)/scripts/linksys-image.sh \
|
||||
"$(call param_get_default,type,$(1),$(DEVICE_NAME))" \
|
||||
"$$(cksum $@ | cut -d ' ' -f1)" \
|
||||
"0" "K0000000F0246434" >> $@
|
||||
dd if=/dev/zero bs=192 count=1 >> $@
|
||||
$@ $@.new
|
||||
mv $@.new $@
|
||||
endef
|
||||
|
||||
define Build/lzma
|
||||
@@ -493,15 +265,6 @@ define Build/lzma-no-dict
|
||||
@mv $@.new $@
|
||||
endef
|
||||
|
||||
define Build/moxa-encode-fw
|
||||
$(TOPDIR)/scripts/moxa-encode-fw.py \
|
||||
--input $@ \
|
||||
--output $@ \
|
||||
--magic $(MOXA_MAGIC) \
|
||||
--hwid $(MOXA_HWID) \
|
||||
--buildid 00000000
|
||||
endef
|
||||
|
||||
define Build/netgear-chk
|
||||
$(STAGING_DIR_HOST)/bin/mkchkimg \
|
||||
-o $@.new \
|
||||
@@ -513,28 +276,13 @@ endef
|
||||
|
||||
define Build/netgear-dni
|
||||
$(STAGING_DIR_HOST)/bin/mkdniimg \
|
||||
-B $(NETGEAR_BOARD_ID) -v $(shell cat $(VERSION_DIST)| sed -e 's/[[:space:]]/-/g').$(firstword $(subst -, ,$(REVISION))) \
|
||||
-B $(NETGEAR_BOARD_ID) -v $(VERSION_DIST).$(firstword $(subst -, ,$(REVISION))) \
|
||||
$(if $(NETGEAR_HW_ID),-H $(NETGEAR_HW_ID)) \
|
||||
-r "$(1)" \
|
||||
-i $@ -o $@.new
|
||||
mv $@.new $@
|
||||
endef
|
||||
|
||||
define Build/netgear-encrypted-factory
|
||||
$(TOPDIR)/scripts/netgear-encrypted-factory.py \
|
||||
--input-file $@ \
|
||||
--output-file $@ \
|
||||
--model $(NETGEAR_ENC_MODEL) \
|
||||
--region $(NETGEAR_ENC_REGION) \
|
||||
$(if $(NETGEAR_ENC_HW_ID_LIST),--hw-id-list "$(NETGEAR_ENC_HW_ID_LIST)") \
|
||||
$(if $(NETGEAR_ENC_MODEL_LIST),--model-list "$(NETGEAR_ENC_MODEL_LIST)") \
|
||||
--version V1.0.0.0.$(shell cat $(VERSION_DIST)| sed -e 's/[[:space:]]/-/g').$(firstword $(subst -, ,$(REVISION))) \
|
||||
--encryption-block-size 0x20000 \
|
||||
--openssl-bin "$(STAGING_DIR_HOST)/bin/openssl" \
|
||||
--key 6865392d342b4d212964363d6d7e7765312c7132613364316e26322a5a5e2538 \
|
||||
--iv 4a253169516c38243d6c6d2d3b384145
|
||||
endef
|
||||
|
||||
define Build/openmesh-image
|
||||
$(TOPDIR)/scripts/om-fwupgradecfg-gen.sh \
|
||||
"$(call param_get_default,ce_type,$(1),$(DEVICE_NAME))" \
|
||||
@@ -555,8 +303,8 @@ endef
|
||||
define Build/pad-offset
|
||||
let \
|
||||
size="$$(stat -c%s $@)" \
|
||||
pad="$(call exp_units,$(word 1, $(1)))" \
|
||||
offset="$(call exp_units,$(word 2, $(1)))" \
|
||||
pad="$(subst k,* 1024,$(word 1, $(1)))" \
|
||||
offset="$(subst k,* 1024,$(word 2, $(1)))" \
|
||||
pad="(pad - ((size + offset) % pad)) % pad" \
|
||||
newsize='size + pad'; \
|
||||
dd if=$@ of=$@.new bs=$$newsize count=1 conv=sync
|
||||
@@ -577,7 +325,7 @@ define Build/patch-cmdline
|
||||
endef
|
||||
|
||||
# Convert a raw image into a $1 type image.
|
||||
# E.g. | qemu-image vdi <optional extra arguments to qemu-img binary>
|
||||
# E.g. | qemu-image vdi
|
||||
define Build/qemu-image
|
||||
if command -v qemu-img; then \
|
||||
qemu-img convert -f raw -O $1 $@ $@.new; \
|
||||
@@ -614,8 +362,8 @@ define Build/seama-seal
|
||||
endef
|
||||
|
||||
define Build/senao-header
|
||||
-$(STAGING_DIR_HOST)/bin/mksenaofw $(1) -e $@ -o $@.new \
|
||||
&& mv $@.new $@ || rm -f $@
|
||||
$(STAGING_DIR_HOST)/bin/mksenaofw $(1) -e $@ -o $@.new
|
||||
mv $@.new $@
|
||||
endef
|
||||
|
||||
define Build/sysupgrade-tar
|
||||
@@ -666,26 +414,26 @@ define Build/tplink-v1-image
|
||||
endef
|
||||
|
||||
define Build/tplink-v2-header
|
||||
-$(STAGING_DIR_HOST)/bin/mktplinkfw2 \
|
||||
$(STAGING_DIR_HOST)/bin/mktplinkfw2 \
|
||||
-c -H $(TPLINK_HWID) -W $(TPLINK_HWREV) -L $(KERNEL_LOADADDR) \
|
||||
-E $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \
|
||||
-w $(TPLINK_HWREVADD) -F "$(TPLINK_FLASHLAYOUT)" \
|
||||
-T $(TPLINK_HVERSION) -V "ver. 2.0" \
|
||||
-k $@ -o $@.new $(1) \
|
||||
&& mv $@.new $@ || rm -f $@
|
||||
-k $@ -o $@.new $(1)
|
||||
@mv $@.new $@
|
||||
endef
|
||||
|
||||
define Build/tplink-v2-image
|
||||
-$(STAGING_DIR_HOST)/bin/mktplinkfw2 \
|
||||
$(STAGING_DIR_HOST)/bin/mktplinkfw2 \
|
||||
-H $(TPLINK_HWID) -W $(TPLINK_HWREV) \
|
||||
-w $(TPLINK_HWREVADD) -F "$(TPLINK_FLASHLAYOUT)" \
|
||||
-T $(TPLINK_HVERSION) -V "ver. 2.0" -a 0x4 -j \
|
||||
-k $(IMAGE_KERNEL) -r $(IMAGE_ROOTFS) -o $@.new $(1) \
|
||||
&& cat $@.new >> $@ && rm -rf $@.new || rm -f $@
|
||||
-k $(IMAGE_KERNEL) -r $(IMAGE_ROOTFS) -o $@.new $(1)
|
||||
cat $@.new >> $@
|
||||
rm -rf $@.new
|
||||
endef
|
||||
|
||||
define Build/uImage
|
||||
$(if $(UIMAGE_TIME),SOURCE_DATE_EPOCH="$(UIMAGE_TIME)") \
|
||||
mkimage \
|
||||
-A $(LINUX_KARCH) \
|
||||
-O linux \
|
||||
@@ -700,41 +448,24 @@ define Build/uImage
|
||||
mv $@.new $@
|
||||
endef
|
||||
|
||||
define Build/multiImage
|
||||
$(if $(UIMAGE_TIME),SOURCE_DATE_EPOCH="$(UIMAGE_TIME)") \
|
||||
mkimage \
|
||||
-A $(LINUX_KARCH) \
|
||||
-O linux \
|
||||
-T multi \
|
||||
-C $(word 1,$(1)) \
|
||||
-a $(KERNEL_LOADADDR) \
|
||||
-e $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \
|
||||
-n '$(if $(UIMAGE_NAME),$(UIMAGE_NAME),$(call toupper,$(LINUX_KARCH)) $(VERSION_DIST) Linux-$(LINUX_VERSION))' \
|
||||
$(if $(UIMAGE_MAGIC),-M $(UIMAGE_MAGIC)) \
|
||||
-d $@:$(word 2,$(1)):$(word 3,$(1)) \
|
||||
$(wordlist 4,$(words $(1)),$(1)) \
|
||||
$@.new
|
||||
mv $@.new $@
|
||||
endef
|
||||
|
||||
define Build/xor-image
|
||||
-$(STAGING_DIR_HOST)/bin/xorimage -i $@ -o $@.xor $(1) \
|
||||
&& mv $@.xor $@ || rm -f $@
|
||||
$(STAGING_DIR_HOST)/bin/xorimage -i $@ -o $@.xor $(1)
|
||||
mv $@.xor $@
|
||||
endef
|
||||
|
||||
define Build/zip
|
||||
rm -rf $@.tmp
|
||||
mkdir $@.tmp
|
||||
mv $@ $@.tmp/$(word 1,$(1))
|
||||
TZ=UTC $(STAGING_DIR_HOST)/bin/zip -j -X \
|
||||
$(wordlist 2,$(words $(1)),$(1)) \
|
||||
$@ $@.tmp/$(if $(word 1,$(1)),$(word 1,$(1)),$$(basename $@))
|
||||
mv $@ $@.tmp/$(1)
|
||||
|
||||
zip -j -X \
|
||||
$(if $(SOURCE_DATE_EPOCH),--mtime="$(SOURCE_DATE_EPOCH)") \
|
||||
$@ $@.tmp/$(if $(1),$(1),$@)
|
||||
rm -rf $@.tmp
|
||||
endef
|
||||
|
||||
define Build/zyxel-ras-image
|
||||
let \
|
||||
newsize="$(call exp_units,$(RAS_ROOTFS_SIZE))"; \
|
||||
newsize="$(subst k,* 1024,$(RAS_ROOTFS_SIZE))"; \
|
||||
$(STAGING_DIR_HOST)/bin/mkrasimage \
|
||||
-b $(RAS_BOARD) \
|
||||
-v $(RAS_VERSION) \
|
||||
|
||||
368
include/image.mk
368
include/image.mk
@@ -5,7 +5,6 @@
|
||||
override TARGET_BUILD=
|
||||
include $(INCLUDE_DIR)/prereq.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
include $(INCLUDE_DIR)/kernel-defaults.mk
|
||||
include $(INCLUDE_DIR)/version.mk
|
||||
include $(INCLUDE_DIR)/image-commands.mk
|
||||
|
||||
@@ -21,20 +20,13 @@ include $(INCLUDE_DIR)/rootfs.mk
|
||||
override MAKE:=$(_SINGLE)$(SUBMAKE)
|
||||
override NO_TRACE_MAKE:=$(_SINGLE)$(NO_TRACE_MAKE)
|
||||
|
||||
##@
|
||||
# @brief Convert size with unit postfix to unitless expression in bytes.
|
||||
#
|
||||
# @param 1: Size with unit. Possible unit postfix are `g`, `m`, `k`.
|
||||
##
|
||||
exp_units = $(subst k, * 1024,$(subst m, * 1024k,$(subst g, * 1024m,$(1))))
|
||||
|
||||
target_params = $(subst +,$(space),$*)
|
||||
param_get = $(patsubst $(1)=%,%,$(filter $(1)=%,$(2)))
|
||||
param_get_default = $(firstword $(call param_get,$(1),$(2)) $(3))
|
||||
param_mangle = $(subst $(space),_,$(strip $(1)))
|
||||
param_unmangle = $(subst _,$(space),$(1))
|
||||
|
||||
mkfs_packages_id = $(shell echo $(sort $(1)) | $(MKHASH) md5 | cut -b1-8)
|
||||
mkfs_packages_id = $(shell echo $(sort $(1)) | mkhash md5 | cut -b1-8)
|
||||
mkfs_target_dir = $(if $(call param_get,pkg,$(1)),$(KDIR)/target-dir-$(call param_get,pkg,$(1)),$(TARGET_DIR))
|
||||
|
||||
KDIR=$(KERNEL_BUILD_DIR)
|
||||
@@ -45,13 +37,11 @@ IMG_PREFIX_EXTRA:=$(if $(EXTRA_IMAGE_NAME),$(call sanitize,$(EXTRA_IMAGE_NAME))-
|
||||
IMG_PREFIX_VERNUM:=$(if $(CONFIG_VERSION_FILENAMES),$(call sanitize,$(VERSION_NUMBER))-)
|
||||
IMG_PREFIX_VERCODE:=$(if $(CONFIG_VERSION_CODE_FILENAMES),$(call sanitize,$(VERSION_CODE))-)
|
||||
|
||||
IMG_PREFIX:=$(VERSION_DIST_SANITIZED)-$(IMG_PREFIX_VERNUM)$(IMG_PREFIX_VERCODE)$(IMG_PREFIX_EXTRA)$(BOARD)-$(SUBTARGET)
|
||||
IMG_PREFIX:=$(VERSION_DIST_SANITIZED)-$(IMG_PREFIX_VERNUM)$(IMG_PREFIX_VERCODE)$(IMG_PREFIX_EXTRA)$(BOARD)$(if $(SUBTARGET),-$(SUBTARGET))
|
||||
IMG_ROOTFS:=$(IMG_PREFIX)-rootfs
|
||||
IMG_COMBINED:=$(IMG_PREFIX)-combined
|
||||
ifeq ($(DUMP),)
|
||||
IMG_PART_SIGNATURE:=$(shell echo $(SOURCE_DATE_EPOCH)$(LINUX_VERMAGIC) | $(MKHASH) md5 | cut -b1-8)
|
||||
IMG_PART_DISKGUID:=$(shell echo $(SOURCE_DATE_EPOCH)$(LINUX_VERMAGIC) | $(MKHASH) md5 | sed -E 's/(.{8})(.{4})(.{4})(.{4})(.{10})../\1-\2-\3-\4-\500/')
|
||||
endif
|
||||
IMG_PART_SIGNATURE:=$(shell echo $(SOURCE_DATE_EPOCH)$(LINUX_VERMAGIC) | mkhash md5 | cut -b1-8)
|
||||
IMG_PART_DISKGUID:=$(shell echo $(SOURCE_DATE_EPOCH)$(LINUX_VERMAGIC) | mkhash md5 | sed -E 's/(.{8})(.{4})(.{4})(.{4})(.{10})../\1-\2-\3-\4-\500/')
|
||||
|
||||
MKFS_DEVTABLE_OPT := -D $(INCLUDE_DIR)/device_table.txt
|
||||
|
||||
@@ -85,7 +75,6 @@ JFFS2OPTS += $(MKFS_DEVTABLE_OPT)
|
||||
SQUASHFS_BLOCKSIZE := $(CONFIG_TARGET_SQUASHFS_BLOCK_SIZE)k
|
||||
SQUASHFSOPT := -b $(SQUASHFS_BLOCKSIZE)
|
||||
SQUASHFSOPT += -p '/dev d 755 0 0' -p '/dev/console c 600 0 0 5 1'
|
||||
SQUASHFSOPT += $(if $(CONFIG_SELINUX),-xattrs,-no-xattrs)
|
||||
SQUASHFSCOMP := gzip
|
||||
LZMA_XZ_OPTIONS := -Xpreset 9 -Xe -Xlc 0 -Xlp 2 -Xpb 2
|
||||
ifeq ($(CONFIG_SQUASHFS_XZ),y)
|
||||
@@ -116,12 +105,6 @@ endef
|
||||
|
||||
PROFILE_SANITIZED := $(call tolower,$(subst DEVICE_,,$(subst $(space),-,$(PROFILE))))
|
||||
|
||||
##@
|
||||
# @brief Call function for each group of arguments.
|
||||
#
|
||||
# @param 1: List of lists of arguments. Lists are separated by `|`.
|
||||
# @param 2: Function to call for list of arguments.
|
||||
##
|
||||
define split_args
|
||||
$(foreach data, \
|
||||
$(subst |,$(space),\
|
||||
@@ -129,24 +112,12 @@ $(foreach data, \
|
||||
$(call $(2),$(strip $(subst ^,$(space),$(data)))))
|
||||
endef
|
||||
|
||||
##@
|
||||
# @brief Call build function with arguments.
|
||||
#
|
||||
# @param 1: Function to call. Function name is prepended with `Build/`.
|
||||
# @param 2...: Function arguments.
|
||||
##
|
||||
define build_cmd
|
||||
$(if $(Build/$(word 1,$(1))),,$(error Missing Build/$(word 1,$(1))))
|
||||
$(call Build/$(word 1,$(1)),$(wordlist 2,$(words $(1)),$(1)))
|
||||
|
||||
endef
|
||||
|
||||
##@
|
||||
# @brief Call build functions from the list.
|
||||
#
|
||||
# @param 1: List of build functions with arguments, separated by `|`.
|
||||
# First word in each group is a build command without `Build/` prefix.
|
||||
##
|
||||
define concat_cmd
|
||||
$(call split_args,$(1),build_cmd)
|
||||
endef
|
||||
@@ -165,6 +136,14 @@ define Image/BuildKernel/MkuImage
|
||||
-n '$(call toupper,$(ARCH)) $(VERSION_DIST) Linux-$(LINUX_VERSION)' -d $(4) $(5)
|
||||
endef
|
||||
|
||||
define Image/BuildKernel/MkFIT
|
||||
$(TOPDIR)/scripts/mkits.sh \
|
||||
-D $(1) -o $(KDIR)/fit-$(1).its -k $(2) $(if $(3),-d $(3)) -C $(4) -a $(5) -e $(6) \
|
||||
-c $(if $(DEVICE_DTS_CONFIG),$(DEVICE_DTS_CONFIG),"config@1") \
|
||||
-A $(LINUX_KARCH) -v $(LINUX_VERSION)
|
||||
PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $(KDIR)/fit-$(1).its $(KDIR)/fit-$(1)$(7).itb
|
||||
endef
|
||||
|
||||
ifdef CONFIG_TARGET_IMAGES_GZIP
|
||||
define Image/Gzip
|
||||
rm -f $(1).gz
|
||||
@@ -174,32 +153,25 @@ endif
|
||||
|
||||
|
||||
# Disable noisy checks by default as in upstream
|
||||
DTC_WARN_FLAGS := \
|
||||
-Wno-interrupt_provider \
|
||||
-Wno-unique_unit_address \
|
||||
DTC_FLAGS += \
|
||||
-Wno-unit_address_vs_reg \
|
||||
-Wno-simple_bus_reg \
|
||||
-Wno-unit_address_format \
|
||||
-Wno-pci_bridge \
|
||||
-Wno-pci_device_bus_num \
|
||||
-Wno-pci_device_reg \
|
||||
-Wno-avoid_unnecessary_addr_size \
|
||||
-Wno-alias_paths \
|
||||
-Wno-graph_child_address \
|
||||
-Wno-simple_bus_reg
|
||||
-Wno-graph_port \
|
||||
-Wno-unique_unit_address
|
||||
|
||||
DTC_FLAGS += $(DTC_WARN_FLAGS)
|
||||
DTCO_FLAGS += $(DTC_WARN_FLAGS)
|
||||
|
||||
##@
|
||||
# @brief Pad file to specified size.
|
||||
#
|
||||
# @param 1: File.
|
||||
# @param 2: Padding.
|
||||
##
|
||||
define Image/pad-to
|
||||
dd if=$(1) of=$(1).new bs=$(2) conv=sync
|
||||
mv $(1).new $(1)
|
||||
endef
|
||||
|
||||
ifeq ($(DUMP),)
|
||||
ROOTFS_PARTSIZE=$(shell echo $$(($(CONFIG_TARGET_ROOTFS_PARTSIZE)*1024*1024)))
|
||||
endif
|
||||
|
||||
define Image/pad-root-squashfs
|
||||
$(call Image/pad-to,$(KDIR)/root.squashfs,$(if $(1),$(1),$(ROOTFS_PARTSIZE)))
|
||||
@@ -209,30 +181,19 @@ endef
|
||||
# $(2) target dtb file
|
||||
# $(3) extra CPP flags
|
||||
# $(4) extra DTC flags
|
||||
define Image/BuildDTB/sub
|
||||
define Image/BuildDTB
|
||||
$(TARGET_CROSS)cpp -nostdinc -x assembler-with-cpp \
|
||||
$(DTS_CPPFLAGS) \
|
||||
-I$(DTS_DIR) \
|
||||
-I$(DTS_DIR)/include \
|
||||
-I$(LINUX_DIR)/include/ \
|
||||
-I$(LINUX_DIR)/scripts/dtc/include-prefixes \
|
||||
-undef -D__DTS__ $(3) \
|
||||
-o $(2).tmp $(1)
|
||||
$(LINUX_DIR)/scripts/dtc/dtc -O dtb \
|
||||
-i$(dir $(1)) $(4) \
|
||||
$(if $(CONFIG_HAS_DT_OVERLAY_SUPPORT),-@) \
|
||||
-i$(dir $(1)) $(DTC_FLAGS) $(4) \
|
||||
-o $(2) $(2).tmp
|
||||
$(RM) $(2).tmp
|
||||
endef
|
||||
|
||||
define Image/BuildDTB
|
||||
$(call Image/BuildDTB/sub,$(1),$(2),$(3),$(DTC_FLAGS) $(DEVICE_DTC_FLAGS) $(4))
|
||||
endef
|
||||
|
||||
define Image/BuildDTBO
|
||||
$(call Image/BuildDTB/sub,$(1),$(2),$(3),$(DTCO_FLAGS) $(DEVICE_DTCO_FLAGS) $(4))
|
||||
endef
|
||||
|
||||
define Image/mkfs/jffs2/sub-raw
|
||||
$(STAGING_DIR_HOST)/bin/mkfs.jffs2 \
|
||||
$(2) \
|
||||
@@ -266,7 +227,8 @@ $(eval $(foreach S,$(NAND_BLOCKSIZE),$(call Image/mkfs/jffs2-nand/template,$(S))
|
||||
define Image/mkfs/squashfs-common
|
||||
$(STAGING_DIR_HOST)/bin/mksquashfs4 $(call mkfs_target_dir,$(1)) $@ \
|
||||
-nopad -noappend -root-owned \
|
||||
-comp $(SQUASHFSCOMP) $(SQUASHFSOPT)
|
||||
-comp $(SQUASHFSCOMP) $(SQUASHFSOPT) \
|
||||
-processors 1
|
||||
endef
|
||||
|
||||
ifeq ($(CONFIG_TARGET_ROOTFS_SECURITY_LABELS),y)
|
||||
@@ -308,19 +270,8 @@ define Image/mkfs/ext4
|
||||
endef
|
||||
|
||||
define Image/Manifest
|
||||
$(if $(CONFIG_USE_APK), \
|
||||
$(call apk,$(TARGET_DIR_ORIG)) list --quiet --manifest --no-network \
|
||||
--repositories-file /dev/zero | sort | sed 's/ / - /' > \
|
||||
$(BIN_DIR)/$(IMG_PREFIX)$(if $(PROFILE_SANITIZED),-$(PROFILE_SANITIZED)).manifest, \
|
||||
$(call opkg,$(TARGET_DIR_ORIG)) list-installed > \
|
||||
$(BIN_DIR)/$(IMG_PREFIX)$(if $(PROFILE_SANITIZED),-$(PROFILE_SANITIZED)).manifest \
|
||||
)
|
||||
ifneq ($(CONFIG_JSON_CYCLONEDX_SBOM),)
|
||||
$(SCRIPT_DIR)/package-metadata.pl imgcyclonedxsbom \
|
||||
$(if $(IB),$(TOPDIR)/.packageinfo, $(TMP_DIR)/.packageinfo) \
|
||||
$(BIN_DIR)/$(IMG_PREFIX)$(if $(PROFILE_SANITIZED),-$(PROFILE_SANITIZED)).manifest > \
|
||||
$(BIN_DIR)/$(IMG_PREFIX)$(if $(PROFILE_SANITIZED),-$(PROFILE_SANITIZED)).bom.cdx.json
|
||||
endif
|
||||
$(call opkg,$(TARGET_DIR_ORIG)) list-installed > \
|
||||
$(BIN_DIR)/$(IMG_PREFIX)$(if $(PROFILE_SANITIZED),-$(PROFILE_SANITIZED)).manifest
|
||||
endef
|
||||
|
||||
define Image/gzip-ext4-padded-squashfs
|
||||
@@ -350,12 +301,12 @@ endif
|
||||
|
||||
ifdef CONFIG_TARGET_ROOTFS_CPIOGZ
|
||||
define Image/Build/cpiogz
|
||||
( cd $(TARGET_DIR); find . | $(STAGING_DIR_HOST)/bin/cpio -o -H newc -R 0:0 | gzip -9n >$(BIN_DIR)/$(IMG_ROOTFS).cpio.gz )
|
||||
( cd $(TARGET_DIR); find . | cpio -o -H newc -R root:root | gzip -9n >$(BIN_DIR)/$(IMG_ROOTFS).cpio.gz )
|
||||
endef
|
||||
endif
|
||||
|
||||
mkfs_packages = $(filter-out @%,$(PACKAGES_$(call param_get,pkg,pkg=$(target_params))))
|
||||
mkfs_packages_add = $(foreach pkg,$(filter-out -% ~%,$(mkfs_packages)),$(pkg)$(call GetABISuffix,$(pkg)))
|
||||
mkfs_packages_add = $(foreach pkg,$(filter-out -%,$(mkfs_packages)),$(pkg)$(call GetABISuffix,$(pkg)))
|
||||
mkfs_packages_remove = $(foreach pkg,$(patsubst -%,%,$(filter -%,$(mkfs_packages))),$(pkg)$(call GetABISuffix,$(pkg)))
|
||||
mkfs_cur_target_dir = $(call mkfs_target_dir,pkg=$(target_params))
|
||||
|
||||
@@ -363,22 +314,7 @@ opkg_target = \
|
||||
$(call opkg,$(mkfs_cur_target_dir)) \
|
||||
-f $(mkfs_cur_target_dir).conf
|
||||
|
||||
apk_target = \
|
||||
$(call apk,$(mkfs_cur_target_dir)) --no-scripts \
|
||||
--repositories-file /dev/zero --repository file://$(PACKAGE_DIR_ALL)/packages.adb
|
||||
|
||||
|
||||
target-dir-%: FORCE
|
||||
ifneq ($(CONFIG_USE_APK),)
|
||||
rm -rf $(mkfs_cur_target_dir)
|
||||
$(CP) $(TARGET_DIR_ORIG) $(mkfs_cur_target_dir)
|
||||
mv $(mkfs_cur_target_dir)/etc/apk/repositories $(mkfs_cur_target_dir).repositories
|
||||
$(if $(mkfs_packages_remove), \
|
||||
$(apk_target) del $(mkfs_packages_remove))
|
||||
$(if $(mkfs_packages_add), \
|
||||
$(apk_target) add $(mkfs_packages_add))
|
||||
mv $(mkfs_cur_target_dir).repositories $(mkfs_cur_target_dir)/etc/apk/repositories
|
||||
else
|
||||
rm -rf $(mkfs_cur_target_dir) $(mkfs_cur_target_dir).opkg
|
||||
$(CP) $(TARGET_DIR_ORIG) $(mkfs_cur_target_dir)
|
||||
-mv $(mkfs_cur_target_dir)/etc/opkg $(mkfs_cur_target_dir).opkg
|
||||
@@ -392,7 +328,6 @@ else
|
||||
$(call opkg_package_files,$(mkfs_packages_add)))
|
||||
-$(CP) -T $(mkfs_cur_target_dir).opkg/ $(mkfs_cur_target_dir)/etc/opkg/
|
||||
rm -rf $(mkfs_cur_target_dir).opkg $(mkfs_cur_target_dir).conf
|
||||
endif
|
||||
$(call prepare_rootfs,$(mkfs_cur_target_dir),$(TOPDIR)/files)
|
||||
|
||||
$(KDIR)/root.%: kernel_prepare
|
||||
@@ -404,9 +339,6 @@ define Device/InitProfile
|
||||
DEVICE_ALT0_TITLE = $$(DEVICE_ALT0_VENDOR) $$(DEVICE_ALT0_MODEL)$$(if $$(DEVICE_ALT0_VARIANT), $$(DEVICE_ALT0_VARIANT))
|
||||
DEVICE_ALT1_TITLE = $$(DEVICE_ALT1_VENDOR) $$(DEVICE_ALT1_MODEL)$$(if $$(DEVICE_ALT1_VARIANT), $$(DEVICE_ALT1_VARIANT))
|
||||
DEVICE_ALT2_TITLE = $$(DEVICE_ALT2_VENDOR) $$(DEVICE_ALT2_MODEL)$$(if $$(DEVICE_ALT2_VARIANT), $$(DEVICE_ALT2_VARIANT))
|
||||
DEVICE_ALT3_TITLE = $$(DEVICE_ALT3_VENDOR) $$(DEVICE_ALT3_MODEL)$$(if $$(DEVICE_ALT3_VARIANT), $$(DEVICE_ALT3_VARIANT))
|
||||
DEVICE_ALT4_TITLE = $$(DEVICE_ALT4_VENDOR) $$(DEVICE_ALT4_MODEL)$$(if $$(DEVICE_ALT4_VARIANT), $$(DEVICE_ALT4_VARIANT))
|
||||
DEVICE_ALT5_TITLE = $$(DEVICE_ALT5_VENDOR) $$(DEVICE_ALT5_MODEL)$$(if $$(DEVICE_ALT5_VARIANT), $$(DEVICE_ALT5_VARIANT))
|
||||
DEVICE_VENDOR :=
|
||||
DEVICE_MODEL :=
|
||||
DEVICE_VARIANT :=
|
||||
@@ -419,66 +351,28 @@ define Device/InitProfile
|
||||
DEVICE_ALT2_VENDOR :=
|
||||
DEVICE_ALT2_MODEL :=
|
||||
DEVICE_ALT2_VARIANT :=
|
||||
DEVICE_ALT3_VENDOR :=
|
||||
DEVICE_ALT3_MODEL :=
|
||||
DEVICE_ALT3_VARIANT :=
|
||||
DEVICE_ALT4_VENDOR :=
|
||||
DEVICE_ALT4_MODEL :=
|
||||
DEVICE_ALT4_VARIANT :=
|
||||
DEVICE_ALT5_VENDOR :=
|
||||
DEVICE_ALT5_MODEL :=
|
||||
DEVICE_ALT5_VARIANT :=
|
||||
DEVICE_PACKAGES :=
|
||||
DEVICE_DESCRIPTION = Build firmware images for $$(DEVICE_TITLE)
|
||||
endef
|
||||
|
||||
##@
|
||||
# @brief Image configuration variables.
|
||||
#
|
||||
# @param 1: Device name.
|
||||
##
|
||||
define Device/Init
|
||||
##@ Device name.
|
||||
DEVICE_NAME := $(1)
|
||||
##@ Commands to build kernel.
|
||||
# Commands with arguments are separated by `|`.
|
||||
##
|
||||
KERNEL:=
|
||||
##@ Commands to build initramfs.
|
||||
# Commands with arguments are separated by `|`.
|
||||
##
|
||||
KERNEL_INITRAMFS = $$(KERNEL)
|
||||
##@ Kernel command line.
|
||||
CMDLINE:=
|
||||
|
||||
##@ Images to build.
|
||||
IMAGES :=
|
||||
##@ Artifacts to build.
|
||||
ARTIFACTS :=
|
||||
##@ Device image prefix.
|
||||
DEVICE_IMG_PREFIX := $(IMG_PREFIX)-$(1)
|
||||
##@ Device image name.
|
||||
DEVICE_IMG_NAME = $$(DEVICE_IMG_PREFIX)-$$(1)-$$(2)
|
||||
##@ Factory image name.
|
||||
FACTORY_IMG_NAME :=
|
||||
##@ Maximum image size. Optional.
|
||||
IMAGE_PREFIX := $(IMG_PREFIX)-$(1)
|
||||
IMAGE_NAME = $$(IMAGE_PREFIX)-$$(1)-$$(2)
|
||||
IMAGE_SIZE :=
|
||||
##@ Maximum image size. Optional.
|
||||
NAND_SIZE :=
|
||||
##@ Kernel image prefix.
|
||||
KERNEL_PREFIX = $$(DEVICE_IMG_PREFIX)
|
||||
##@ Kernel image suffix.
|
||||
KERNEL_PREFIX = $$(IMAGE_PREFIX)
|
||||
KERNEL_SUFFIX := -kernel.bin
|
||||
##@ Initramfs image suffix.
|
||||
KERNEL_INITRAMFS_SUFFIX = $$(KERNEL_SUFFIX)
|
||||
##@ Kernel image name.
|
||||
KERNEL_IMAGE = $$(KERNEL_PREFIX)$$(KERNEL_SUFFIX)
|
||||
##@ Initramfs image prefix.
|
||||
KERNEL_INITRAMFS_PREFIX = $$(DEVICE_IMG_PREFIX)-initramfs
|
||||
KERNEL_INITRAMFS_PREFIX = $$(IMAGE_PREFIX)-initramfs
|
||||
KERNEL_INITRAMFS_IMAGE = $$(KERNEL_INITRAMFS_PREFIX)$$(KERNEL_INITRAMFS_SUFFIX)
|
||||
##@ Initramfs image name.
|
||||
KERNEL_INITRAMFS_NAME = $$(KERNEL_NAME)-initramfs
|
||||
##@ Kernel install flag.
|
||||
KERNEL_INSTALL :=
|
||||
KERNEL_NAME := vmlinux
|
||||
KERNEL_DEPENDS :=
|
||||
@@ -498,19 +392,13 @@ define Device/Init
|
||||
|
||||
DEVICE_DTS :=
|
||||
DEVICE_DTS_CONFIG :=
|
||||
DEVICE_DTS_DELIMITER :=
|
||||
DEVICE_DTS_DIR :=
|
||||
DEVICE_DTS_LOADADDR :=
|
||||
DEVICE_DTS_OVERLAY :=
|
||||
DEVICE_FDT_NUM :=
|
||||
DEVICE_DTC_FLAGS :=
|
||||
DEVICE_DTCO_FLAGS :=
|
||||
SOC :=
|
||||
|
||||
BOARD_NAME :=
|
||||
UIMAGE_MAGIC :=
|
||||
UIMAGE_NAME :=
|
||||
UIMAGE_TIME :=
|
||||
DEVICE_COMPAT_VERSION := 1.0
|
||||
DEVICE_COMPAT_MESSAGE :=
|
||||
SUPPORTED_DEVICES := $(subst _,$(comma),$(1))
|
||||
@@ -527,21 +415,16 @@ endef
|
||||
DEFAULT_DEVICE_VARS := \
|
||||
DEVICE_NAME KERNEL KERNEL_INITRAMFS KERNEL_INITRAMFS_IMAGE KERNEL_SIZE \
|
||||
CMDLINE UBOOTENV_IN_UBI KERNEL_IN_UBI BLOCKSIZE PAGESIZE SUBPAGESIZE \
|
||||
VID_HDR_OFFSET UBINIZE_OPTS UBINIZE_PARTS MKUBIFS_OPTS DEVICE_DTC_FLAGS \
|
||||
DEVICE_DTCO_FLAGS DEVICE_DTS DEVICE_DTS_CONFIG DEVICE_DTS_DELIMITER \
|
||||
DEVICE_DTS_DIR DEVICE_DTS_OVERLAY DEVICE_DTS_LOADADDR \
|
||||
DEVICE_FDT_NUM DEVICE_IMG_PREFIX SOC BOARD_NAME UIMAGE_MAGIC UIMAGE_NAME \
|
||||
UIMAGE_TIME SUPPORTED_DEVICES IMAGE_METADATA KERNEL_ENTRY KERNEL_LOADADDR \
|
||||
UBOOT_PATH IMAGE_SIZE NAND_SIZE \
|
||||
FACTORY_IMG_NAME FACTORY_SIZE \
|
||||
DEVICE_PACKAGES DEVICE_COMPAT_VERSION DEVICE_COMPAT_MESSAGE \
|
||||
VID_HDR_OFFSET UBINIZE_OPTS UBINIZE_PARTS MKUBIFS_OPTS DEVICE_DTS \
|
||||
DEVICE_DTS_CONFIG DEVICE_DTS_DIR DEVICE_FDT_NUM SOC BOARD_NAME \
|
||||
UIMAGE_MAGIC UIMAGE_NAME \
|
||||
SUPPORTED_DEVICES IMAGE_METADATA KERNEL_ENTRY KERNEL_LOADADDR \
|
||||
UBOOT_PATH IMAGE_SIZE \
|
||||
DEVICE_COMPAT_VERSION DEVICE_COMPAT_MESSAGE \
|
||||
DEVICE_VENDOR DEVICE_MODEL DEVICE_VARIANT \
|
||||
DEVICE_ALT0_VENDOR DEVICE_ALT0_MODEL DEVICE_ALT0_VARIANT \
|
||||
DEVICE_ALT1_VENDOR DEVICE_ALT1_MODEL DEVICE_ALT1_VARIANT \
|
||||
DEVICE_ALT2_VENDOR DEVICE_ALT2_MODEL DEVICE_ALT2_VARIANT \
|
||||
DEVICE_ALT3_VENDOR DEVICE_ALT3_MODEL DEVICE_ALT3_VARIANT \
|
||||
DEVICE_ALT4_VENDOR DEVICE_ALT4_MODEL DEVICE_ALT4_VARIANT \
|
||||
DEVICE_ALT5_VENDOR DEVICE_ALT5_MODEL DEVICE_ALT5_VARIANT
|
||||
DEVICE_ALT2_VENDOR DEVICE_ALT2_MODEL DEVICE_ALT2_VARIANT
|
||||
|
||||
define Device/ExportVar
|
||||
$(1) : $(2):=$$($(2))
|
||||
@@ -555,10 +438,10 @@ endef
|
||||
ifdef IB
|
||||
DEVICE_CHECK_PROFILE = $(filter $(1),DEVICE_$(PROFILE) $(PROFILE))
|
||||
else
|
||||
DEVICE_CHECK_PROFILE = $(CONFIG_TARGET_$(if $(CONFIG_TARGET_MULTI_PROFILE),DEVICE_)$(call target_conf,$(BOARD)_$(SUBTARGET))_$(1))
|
||||
DEVICE_CHECK_PROFILE = $(CONFIG_TARGET_$(if $(CONFIG_TARGET_MULTI_PROFILE),DEVICE_)$(call target_conf,$(BOARD)$(if $(SUBTARGET),_$(SUBTARGET)))_$(1))
|
||||
endif
|
||||
|
||||
DEVICE_EXTRA_PACKAGES = $(call qstrip,$(CONFIG_TARGET_DEVICE_PACKAGES_$(call target_conf,$(BOARD)_$(SUBTARGET))_DEVICE_$(1)))
|
||||
DEVICE_EXTRA_PACKAGES = $(call qstrip,$(CONFIG_TARGET_DEVICE_PACKAGES_$(call target_conf,$(BOARD)$(if $(SUBTARGET),_$(SUBTARGET)))_DEVICE_$(1)))
|
||||
|
||||
define merge_packages
|
||||
$(1) :=
|
||||
@@ -593,20 +476,10 @@ define Device/Build/initramfs
|
||||
$$(if $$(CONFIG_JSON_OVERVIEW_IMAGE_INFO), $(BUILD_DIR)/json_info_files/$$(KERNEL_INITRAMFS_IMAGE).json,))
|
||||
|
||||
$(KDIR)/$$(KERNEL_INITRAMFS_NAME):: image_prepare
|
||||
ifdef TARGET_PER_DEVICE_ROOTFS
|
||||
$(KDIR)/$$(KERNEL_INITRAMFS_NAME).$$(ROOTFS_ID/$(1)):: image_prepare target-dir-$$(ROOTFS_ID/$(1))
|
||||
$(call Kernel/CompileImage/Initramfs,$(KDIR)/target-dir-$$(ROOTFS_ID/$(1)),.$$(ROOTFS_ID/$(1)))
|
||||
endif
|
||||
$(1)-initramfs-images: $$(if $$(KERNEL_INITRAMFS),$(BIN_DIR)/$$(KERNEL_INITRAMFS_IMAGE))
|
||||
|
||||
.IGNORE: $(BIN_DIR)/$$(KERNEL_INITRAMFS_IMAGE)
|
||||
|
||||
$(BIN_DIR)/$$(KERNEL_INITRAMFS_IMAGE): $(KDIR)/tmp/$$(KERNEL_INITRAMFS_IMAGE)
|
||||
cp $$^ $$@
|
||||
|
||||
$(KDIR)/tmp/$$(KERNEL_INITRAMFS_IMAGE): $(KDIR)/$$(KERNEL_INITRAMFS_NAME)$$(strip \
|
||||
$(if $(TARGET_PER_DEVICE_ROOTFS),.$$(ROOTFS_ID/$(1))) \
|
||||
) $(CURDIR)/Makefile $$(KERNEL_DEPENDS) image_prepare
|
||||
$(KDIR)/tmp/$$(KERNEL_INITRAMFS_IMAGE): $(KDIR)/$$(KERNEL_INITRAMFS_NAME) $(CURDIR)/Makefile $$(KERNEL_DEPENDS) image_prepare
|
||||
@rm -f $$@
|
||||
$$(call concat_cmd,$$(KERNEL_INITRAMFS))
|
||||
|
||||
@@ -615,12 +488,12 @@ define Device/Build/initramfs
|
||||
$(BUILD_DIR)/json_info_files/$$(KERNEL_INITRAMFS_IMAGE).json: $(BIN_DIR)/$$(KERNEL_INITRAMFS_IMAGE)
|
||||
@mkdir -p $$(shell dirname $$@)
|
||||
DEVICE_ID="$(1)" \
|
||||
BIN_DIR="$(BIN_DIR)" \
|
||||
SOURCE_DATE_EPOCH=$(SOURCE_DATE_EPOCH) \
|
||||
FILE_NAME="$$(notdir $$^)" \
|
||||
FILE_DIR="$(KDIR)/tmp" \
|
||||
FILE_TYPE="kernel" \
|
||||
FILE_FILESYSTEM="initramfs" \
|
||||
DEVICE_IMG_PREFIX="$$(DEVICE_IMG_PREFIX)" \
|
||||
IMAGE_NAME="$$(notdir $$^)" \
|
||||
IMAGE_TYPE="kernel" \
|
||||
IMAGE_FILESYSTEM="initramfs" \
|
||||
IMAGE_PREFIX="$$(IMAGE_PREFIX)" \
|
||||
DEVICE_VENDOR="$$(DEVICE_VENDOR)" \
|
||||
DEVICE_MODEL="$$(DEVICE_MODEL)" \
|
||||
DEVICE_VARIANT="$$(DEVICE_VARIANT)" \
|
||||
@@ -633,19 +506,10 @@ define Device/Build/initramfs
|
||||
DEVICE_ALT2_VENDOR="$$(DEVICE_ALT2_VENDOR)" \
|
||||
DEVICE_ALT2_MODEL="$$(DEVICE_ALT2_MODEL)" \
|
||||
DEVICE_ALT2_VARIANT="$$(DEVICE_ALT2_VARIANT)" \
|
||||
DEVICE_ALT3_VENDOR="$$(DEVICE_ALT3_VENDOR)" \
|
||||
DEVICE_ALT3_MODEL="$$(DEVICE_ALT3_MODEL)" \
|
||||
DEVICE_ALT3_VARIANT="$$(DEVICE_ALT3_VARIANT)" \
|
||||
DEVICE_ALT4_VENDOR="$$(DEVICE_ALT4_VENDOR)" \
|
||||
DEVICE_ALT4_MODEL="$$(DEVICE_ALT4_MODEL)" \
|
||||
DEVICE_ALT4_VARIANT="$$(DEVICE_ALT4_VARIANT)" \
|
||||
DEVICE_ALT5_VENDOR="$$(DEVICE_ALT5_VENDOR)" \
|
||||
DEVICE_ALT5_MODEL="$$(DEVICE_ALT5_MODEL)" \
|
||||
DEVICE_ALT5_VARIANT="$$(DEVICE_ALT5_VARIANT)" \
|
||||
DEVICE_TITLE="$$(DEVICE_TITLE)" \
|
||||
DEVICE_PACKAGES="$$(DEVICE_PACKAGES)" \
|
||||
TARGET="$(BOARD)" \
|
||||
SUBTARGET="$(SUBTARGET)" \
|
||||
SUBTARGET="$(if $(SUBTARGET),$(SUBTARGET),generic)" \
|
||||
VERSION_NUMBER="$(VERSION_NUMBER)" \
|
||||
VERSION_CODE="$(VERSION_CODE)" \
|
||||
SUPPORTED_DEVICES="$$(SUPPORTED_DEVICES)" \
|
||||
@@ -656,8 +520,7 @@ endif
|
||||
define Device/Build/compile
|
||||
$$(_COMPILE_TARGET): $(KDIR)/$(1)
|
||||
$(eval $(call Device/Export,$(KDIR)/$(1)))
|
||||
$(KDIR)/$(1): FORCE
|
||||
rm -f $(KDIR)/$(1)
|
||||
$(KDIR)/$(1):
|
||||
$$(call concat_cmd,$(COMPILE/$(1)))
|
||||
|
||||
endef
|
||||
@@ -669,18 +532,7 @@ define Device/Build/dtb
|
||||
$(KDIR)/image-$(1).dtb: FORCE
|
||||
$(call Image/BuildDTB,$(strip $(2))/$(strip $(3)).dts,$$@)
|
||||
|
||||
compile-dtb: $(KDIR)/image-$(1).dtb
|
||||
endif
|
||||
|
||||
endef
|
||||
|
||||
define Device/Build/dtbo
|
||||
ifndef BUILD_DTSO_$(1)
|
||||
BUILD_DTSO_$(1) := 1
|
||||
$(KDIR)/image-$(1).dtbo: FORCE
|
||||
$(call Image/BuildDTBO,$(strip $(2))/$(strip $(3)).dtso,$$@)
|
||||
|
||||
compile-dtb: $(KDIR)/image-$(1).dtbo
|
||||
image_prepare: $(KDIR)/image-$(1).dtb
|
||||
endif
|
||||
|
||||
endef
|
||||
@@ -693,12 +545,6 @@ define Device/Build/kernel
|
||||
$$(dts) \
|
||||
) \
|
||||
))
|
||||
$$(eval $$(foreach dtso,$$(DEVICE_DTS_OVERLAY), \
|
||||
$$(call Device/Build/dtbo,$$(notdir $$(dtso)), \
|
||||
$$(if $$(DEVICE_DTS_DIR),$$(DEVICE_DTS_DIR),$$(DTS_DIR)), \
|
||||
$$(dtso) \
|
||||
) \
|
||||
))
|
||||
|
||||
$(KDIR)/$$(KERNEL_NAME):: image_prepare
|
||||
$$(_TARGET): $$(if $$(KERNEL_INSTALL),$(BIN_DIR)/$$(KERNEL_IMAGE))
|
||||
@@ -719,10 +565,9 @@ endef
|
||||
define Device/Build/image
|
||||
GZ_SUFFIX := $(if $(filter %dtb %gz,$(2)),,$(if $(and $(findstring ext4,$(1)),$(CONFIG_TARGET_IMAGES_GZIP)),.gz))
|
||||
$$(_TARGET): $(if $(CONFIG_JSON_OVERVIEW_IMAGE_INFO), \
|
||||
$(BUILD_DIR)/json_info_files/$(call DEVICE_IMG_NAME,$(1),$(2)).json, \
|
||||
$(BIN_DIR)/$(call DEVICE_IMG_NAME,$(1),$(2))$$(GZ_SUFFIX))
|
||||
$(eval $(call Device/Export,$(KDIR)/tmp/$(call DEVICE_IMG_NAME,$(1),$(2)),$(1)))
|
||||
$(3)-images: $(BIN_DIR)/$(call DEVICE_IMG_NAME,$(1),$(2))$$(GZ_SUFFIX)
|
||||
$(BUILD_DIR)/json_info_files/$(call IMAGE_NAME,$(1),$(2)).json, \
|
||||
$(BIN_DIR)/$(call IMAGE_NAME,$(1),$(2))$$(GZ_SUFFIX))
|
||||
$(eval $(call Device/Export,$(KDIR)/tmp/$(call IMAGE_NAME,$(1),$(2)),$(1)))
|
||||
|
||||
ROOTFS/$(1)/$(3) := \
|
||||
$(KDIR)/root.$(1)$$(strip \
|
||||
@@ -733,28 +578,28 @@ define Device/Build/image
|
||||
ifndef IB
|
||||
$$(ROOTFS/$(1)/$(3)): $(if $(TARGET_PER_DEVICE_ROOTFS),target-dir-$$(ROOTFS_ID/$(3)))
|
||||
endif
|
||||
$(KDIR)/tmp/$(call DEVICE_IMG_NAME,$(1),$(2)): $$(KDIR_KERNEL_IMAGE) $$(ROOTFS/$(1)/$(3)) $(if $(CONFIG_TARGET_ROOTFS_INITRAMFS),$(if $(IB),,$(3)-initramfs-images))
|
||||
$(KDIR)/tmp/$(call IMAGE_NAME,$(1),$(2)): $$(KDIR_KERNEL_IMAGE) $$(ROOTFS/$(1)/$(3))
|
||||
@rm -f $$@
|
||||
[ -f $$(word 1,$$^) -a -f $$(word 2,$$^) ]
|
||||
$$(call concat_cmd,$(if $(IMAGE/$(2)/$(1)),$(IMAGE/$(2)/$(1)),$(IMAGE/$(2))))
|
||||
|
||||
.IGNORE: $(BIN_DIR)/$(call DEVICE_IMG_NAME,$(1),$(2))
|
||||
.IGNORE: $(BIN_DIR)/$(call IMAGE_NAME,$(1),$(2))
|
||||
|
||||
$(BIN_DIR)/$(call DEVICE_IMG_NAME,$(1),$(2)).gz: $(KDIR)/tmp/$(call DEVICE_IMG_NAME,$(1),$(2))
|
||||
$(BIN_DIR)/$(call IMAGE_NAME,$(1),$(2)).gz: $(KDIR)/tmp/$(call IMAGE_NAME,$(1),$(2))
|
||||
gzip -c -9n $$^ > $$@
|
||||
|
||||
$(BIN_DIR)/$(call DEVICE_IMG_NAME,$(1),$(2)): $(KDIR)/tmp/$(call DEVICE_IMG_NAME,$(1),$(2))
|
||||
$(BIN_DIR)/$(call IMAGE_NAME,$(1),$(2)): $(KDIR)/tmp/$(call IMAGE_NAME,$(1),$(2))
|
||||
cp $$^ $$@
|
||||
|
||||
$(BUILD_DIR)/json_info_files/$(call DEVICE_IMG_NAME,$(1),$(2)).json: $(BIN_DIR)/$(call DEVICE_IMG_NAME,$(1),$(2))$$(GZ_SUFFIX)
|
||||
$(BUILD_DIR)/json_info_files/$(call IMAGE_NAME,$(1),$(2)).json: $(BIN_DIR)/$(call IMAGE_NAME,$(1),$(2))$$(GZ_SUFFIX)
|
||||
@mkdir -p $$(shell dirname $$@)
|
||||
DEVICE_ID="$(DEVICE_NAME)" \
|
||||
BIN_DIR="$(BIN_DIR)" \
|
||||
SOURCE_DATE_EPOCH=$(SOURCE_DATE_EPOCH) \
|
||||
FILE_NAME="$(DEVICE_IMG_NAME)" \
|
||||
FILE_DIR="$(KDIR)/tmp" \
|
||||
FILE_TYPE=$(word 1,$(subst ., ,$(2))) \
|
||||
FILE_FILESYSTEM="$(1)" \
|
||||
DEVICE_IMG_PREFIX="$(DEVICE_IMG_PREFIX)" \
|
||||
IMAGE_NAME="$(IMAGE_NAME)" \
|
||||
IMAGE_TYPE=$(word 1,$(subst ., ,$(2))) \
|
||||
IMAGE_FILESYSTEM="$(1)" \
|
||||
IMAGE_PREFIX="$(IMAGE_PREFIX)" \
|
||||
DEVICE_VENDOR="$(DEVICE_VENDOR)" \
|
||||
DEVICE_MODEL="$(DEVICE_MODEL)" \
|
||||
DEVICE_VARIANT="$(DEVICE_VARIANT)" \
|
||||
@@ -767,19 +612,10 @@ define Device/Build/image
|
||||
DEVICE_ALT2_VENDOR="$(DEVICE_ALT2_VENDOR)" \
|
||||
DEVICE_ALT2_MODEL="$(DEVICE_ALT2_MODEL)" \
|
||||
DEVICE_ALT2_VARIANT="$(DEVICE_ALT2_VARIANT)" \
|
||||
DEVICE_ALT3_VENDOR="$(DEVICE_ALT3_VENDOR)" \
|
||||
DEVICE_ALT3_MODEL="$(DEVICE_ALT3_MODEL)" \
|
||||
DEVICE_ALT3_VARIANT="$(DEVICE_ALT3_VARIANT)" \
|
||||
DEVICE_ALT4_VENDOR="$(DEVICE_ALT4_VENDOR)" \
|
||||
DEVICE_ALT4_MODEL="$(DEVICE_ALT4_MODEL)" \
|
||||
DEVICE_ALT4_VARIANT="$(DEVICE_ALT4_VARIANT)" \
|
||||
DEVICE_ALT5_VENDOR="$(DEVICE_ALT5_VENDOR)" \
|
||||
DEVICE_ALT5_MODEL="$(DEVICE_ALT5_MODEL)" \
|
||||
DEVICE_ALT5_VARIANT="$(DEVICE_ALT5_VARIANT)" \
|
||||
DEVICE_TITLE="$(DEVICE_TITLE)" \
|
||||
DEVICE_PACKAGES="$(DEVICE_PACKAGES)" \
|
||||
TARGET="$(BOARD)" \
|
||||
SUBTARGET="$(SUBTARGET)" \
|
||||
SUBTARGET="$(if $(SUBTARGET),$(SUBTARGET),generic)" \
|
||||
VERSION_NUMBER="$(VERSION_NUMBER)" \
|
||||
VERSION_CODE="$(VERSION_CODE)" \
|
||||
SUPPORTED_DEVICES="$(SUPPORTED_DEVICES)" \
|
||||
@@ -788,61 +624,21 @@ define Device/Build/image
|
||||
endef
|
||||
|
||||
define Device/Build/artifact
|
||||
$$(_TARGET): $(if $(CONFIG_JSON_OVERVIEW_IMAGE_INFO), \
|
||||
$(BUILD_DIR)/json_info_files/$(DEVICE_IMG_PREFIX)-$(1).json, \
|
||||
$(BIN_DIR)/$(DEVICE_IMG_PREFIX)-$(1))
|
||||
$(eval $(call Device/Export,$(KDIR)/tmp/$(DEVICE_IMG_PREFIX)-$(1)))
|
||||
$(KDIR)/tmp/$(DEVICE_IMG_PREFIX)-$(1): $$(KDIR_KERNEL_IMAGE) $(if $(CONFIG_TARGET_ROOTFS_INITRAMFS),$(if $(IB),,$(2)-initramfs-images)) $(2)-images
|
||||
$$(_TARGET): $(BIN_DIR)/$(IMAGE_PREFIX)-$(1)
|
||||
$(eval $(call Device/Export,$(KDIR)/tmp/$(IMAGE_PREFIX)-$(1)))
|
||||
$(KDIR)/tmp/$(IMAGE_PREFIX)-$(1): $$(KDIR_KERNEL_IMAGE)
|
||||
@rm -f $$@
|
||||
$$(call concat_cmd,$(ARTIFACT/$(1)))
|
||||
|
||||
.IGNORE: $(BIN_DIR)/$(DEVICE_IMG_PREFIX)-$(1)
|
||||
.IGNORE: $(BIN_DIR)/$(IMAGE_PREFIX)-$(1)
|
||||
|
||||
$(BIN_DIR)/$(DEVICE_IMG_PREFIX)-$(1): $(KDIR)/tmp/$(DEVICE_IMG_PREFIX)-$(1)
|
||||
$(BIN_DIR)/$(IMAGE_PREFIX)-$(1): $(KDIR)/tmp/$(IMAGE_PREFIX)-$(1)
|
||||
cp $$^ $$@
|
||||
|
||||
$(BUILD_DIR)/json_info_files/$(DEVICE_IMG_PREFIX)-$(1).json: $(BIN_DIR)/$(DEVICE_IMG_PREFIX)-$(1)
|
||||
@mkdir -p $$(shell dirname $$@)
|
||||
DEVICE_ID="$(DEVICE_NAME)" \
|
||||
SOURCE_DATE_EPOCH=$(SOURCE_DATE_EPOCH) \
|
||||
FILE_NAME="$(DEVICE_IMG_PREFIX)-$(1)" \
|
||||
FILE_DIR="$(KDIR)/tmp" \
|
||||
FILE_TYPE="$(1)" \
|
||||
DEVICE_IMG_PREFIX="$(DEVICE_IMG_PREFIX)" \
|
||||
DEVICE_VENDOR="$(DEVICE_VENDOR)" \
|
||||
DEVICE_MODEL="$(DEVICE_MODEL)" \
|
||||
DEVICE_VARIANT="$(DEVICE_VARIANT)" \
|
||||
DEVICE_ALT0_VENDOR="$(DEVICE_ALT0_VENDOR)" \
|
||||
DEVICE_ALT0_MODEL="$(DEVICE_ALT0_MODEL)" \
|
||||
DEVICE_ALT0_VARIANT="$(DEVICE_ALT0_VARIANT)" \
|
||||
DEVICE_ALT1_VENDOR="$(DEVICE_ALT1_VENDOR)" \
|
||||
DEVICE_ALT1_MODEL="$(DEVICE_ALT1_MODEL)" \
|
||||
DEVICE_ALT1_VARIANT="$(DEVICE_ALT1_VARIANT)" \
|
||||
DEVICE_ALT2_VENDOR="$(DEVICE_ALT2_VENDOR)" \
|
||||
DEVICE_ALT2_MODEL="$(DEVICE_ALT2_MODEL)" \
|
||||
DEVICE_ALT2_VARIANT="$(DEVICE_ALT2_VARIANT)" \
|
||||
DEVICE_ALT3_VENDOR="$(DEVICE_ALT3_VENDOR)" \
|
||||
DEVICE_ALT3_MODEL="$(DEVICE_ALT3_MODEL)" \
|
||||
DEVICE_ALT3_VARIANT="$(DEVICE_ALT3_VARIANT)" \
|
||||
DEVICE_ALT4_VENDOR="$(DEVICE_ALT4_VENDOR)" \
|
||||
DEVICE_ALT4_MODEL="$(DEVICE_ALT4_MODEL)" \
|
||||
DEVICE_ALT4_VARIANT="$(DEVICE_ALT4_VARIANT)" \
|
||||
DEVICE_ALT5_VENDOR="$(DEVICE_ALT5_VENDOR)" \
|
||||
DEVICE_ALT5_MODEL="$(DEVICE_ALT5_MODEL)" \
|
||||
DEVICE_ALT5_VARIANT="$(DEVICE_ALT5_VARIANT)" \
|
||||
DEVICE_TITLE="$(DEVICE_TITLE)" \
|
||||
DEVICE_PACKAGES="$(DEVICE_PACKAGES)" \
|
||||
TARGET="$(BOARD)" \
|
||||
SUBTARGET="$(SUBTARGET)" \
|
||||
VERSION_NUMBER="$(VERSION_NUMBER)" \
|
||||
VERSION_CODE="$(VERSION_CODE)" \
|
||||
SUPPORTED_DEVICES="$(SUPPORTED_DEVICES)" \
|
||||
$(TOPDIR)/scripts/json_add_image_info.py $$@
|
||||
|
||||
endef
|
||||
|
||||
define Device/Build
|
||||
$(if $(CONFIG_TARGET_ROOTFS_INITRAMFS),$$(eval $$(call Device/Build/initramfs,$(1))))
|
||||
$(if $(CONFIG_TARGET_ROOTFS_INITRAMFS),$(call Device/Build/initramfs,$(1)))
|
||||
$(call Device/Build/kernel,$(1))
|
||||
|
||||
$$(eval $$(foreach compile,$$(COMPILE), \
|
||||
@@ -853,7 +649,7 @@ define Device/Build
|
||||
$$(call Device/Build/image,$$(fs),$$(image),$(1)))))
|
||||
|
||||
$$(eval $$(foreach artifact,$$(ARTIFACTS), \
|
||||
$$(call Device/Build/artifact,$$(artifact),$(1))))
|
||||
$$(call Device/Build/artifact,$$(artifact))))
|
||||
|
||||
endef
|
||||
|
||||
@@ -871,9 +667,6 @@ $(if $(strip $(DEVICE_ALT0_TITLE)),Alternative device titles:
|
||||
- $(DEVICE_ALT0_TITLE))
|
||||
$(if $(strip $(DEVICE_ALT1_TITLE)),- $(DEVICE_ALT1_TITLE))
|
||||
$(if $(strip $(DEVICE_ALT2_TITLE)),- $(DEVICE_ALT2_TITLE))
|
||||
$(if $(strip $(DEVICE_ALT3_TITLE)),- $(DEVICE_ALT3_TITLE))
|
||||
$(if $(strip $(DEVICE_ALT4_TITLE)),- $(DEVICE_ALT4_TITLE))
|
||||
$(if $(strip $(DEVICE_ALT5_TITLE)),- $(DEVICE_ALT5_TITLE))
|
||||
@@
|
||||
|
||||
endef
|
||||
@@ -891,18 +684,6 @@ ifneq ($$(strip $$(DEVICE_ALT2_TITLE)),)
|
||||
DEVICE_DISPLAY = $$(DEVICE_ALT2_TITLE) ($$(DEVICE_TITLE))
|
||||
$$(info $$(call Device/DumpInfo,$(1)))
|
||||
endif
|
||||
ifneq ($$(strip $$(DEVICE_ALT3_TITLE)),)
|
||||
DEVICE_DISPLAY = $$(DEVICE_ALT3_TITLE) ($$(DEVICE_TITLE))
|
||||
$$(info $$(call Device/DumpInfo,$(1)))
|
||||
endif
|
||||
ifneq ($$(strip $$(DEVICE_ALT4_TITLE)),)
|
||||
DEVICE_DISPLAY = $$(DEVICE_ALT4_TITLE) ($$(DEVICE_TITLE))
|
||||
$$(info $$(call Device/DumpInfo,$(1)))
|
||||
endif
|
||||
ifneq ($$(strip $$(DEVICE_ALT5_TITLE)),)
|
||||
DEVICE_DISPLAY = $$(DEVICE_ALT5_TITLE) ($$(DEVICE_TITLE))
|
||||
$$(info $$(call Device/DumpInfo,$(1)))
|
||||
endif
|
||||
DEVICE_DISPLAY = $$(DEVICE_TITLE)
|
||||
$$(eval $$(if $$(DEVICE_TITLE),$$(info $$(call Device/DumpInfo,$(1)))))
|
||||
endef
|
||||
@@ -928,27 +709,24 @@ define BuildImage
|
||||
download:
|
||||
prepare:
|
||||
compile:
|
||||
compile-dtb:
|
||||
clean:
|
||||
image_prepare:
|
||||
|
||||
ifeq ($(IB),)
|
||||
.PHONY: download prepare compile compile-dtb clean image_prepare kernel_prepare install install-images
|
||||
.PHONY: download prepare compile clean image_prepare kernel_prepare install install-images
|
||||
compile:
|
||||
$(call Build/Compile)
|
||||
|
||||
clean:
|
||||
$(call Build/Clean)
|
||||
|
||||
compile-dtb:
|
||||
image_prepare: compile compile-dtb
|
||||
image_prepare: compile
|
||||
mkdir -p $(BIN_DIR) $(KDIR)/tmp
|
||||
rm -rf $(BUILD_DIR)/json_info_files
|
||||
$(call Image/Prepare)
|
||||
|
||||
else
|
||||
image_prepare:
|
||||
rm -rf $(KDIR)/tmp
|
||||
mkdir -p $(BIN_DIR) $(KDIR)/tmp
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
LINUX_VERSION-6.6 = .63
|
||||
LINUX_KERNEL_HASH-6.6.63 = d1054ab4803413efe2850f50f1a84349c091631ec50a1cf9e891d1b1f9061835
|
||||
@@ -10,7 +10,7 @@ ifneq ($(DUMP),1)
|
||||
endif
|
||||
|
||||
KERNEL_FILE_DEPENDS=$(GENERIC_BACKPORT_DIR) $(GENERIC_PATCH_DIR) $(GENERIC_HACK_DIR) $(PATCH_DIR) $(GENERIC_FILES_DIR) $(FILES_DIR)
|
||||
STAMP_PREPARED=$(LINUX_DIR)/.prepared$(if $(QUILT)$(DUMP),,_$(shell $(call $(if $(CONFIG_AUTOREMOVE),find_md5_reproducible,find_md5),$(KERNEL_FILE_DEPENDS),)))
|
||||
STAMP_PREPARED=$(LINUX_DIR)/.prepared$(if $(QUILT)$(DUMP),,_$(shell $(call find_md5,$(KERNEL_FILE_DEPENDS),)))
|
||||
STAMP_CONFIGURED:=$(LINUX_DIR)/.configured
|
||||
include $(INCLUDE_DIR)/download.mk
|
||||
include $(INCLUDE_DIR)/quilt.mk
|
||||
@@ -51,7 +51,7 @@ endif
|
||||
define Download/git-kernel
|
||||
URL:=$(call qstrip,$(CONFIG_KERNEL_GIT_CLONE_URI))
|
||||
PROTO:=git
|
||||
SOURCE_VERSION:=$(CONFIG_KERNEL_GIT_REF)
|
||||
VERSION:=$(CONFIG_KERNEL_GIT_REF)
|
||||
FILE:=$(LINUX_SOURCE)
|
||||
SUBDIR:=linux-$(LINUX_VERSION)
|
||||
OPTS:=$(KERNEL_GIT_OPTS)
|
||||
@@ -63,7 +63,7 @@ ifdef CONFIG_COLLECT_KERNEL_DEBUG
|
||||
mkdir -p $(KERNEL_BUILD_DIR)/debug/modules
|
||||
$(CP) $(LINUX_DIR)/vmlinux $(KERNEL_BUILD_DIR)/debug/
|
||||
-$(CP) \
|
||||
$(STAGING_DIR_ROOT)/lib/modules/$(LINUX_VERSION)/*.ko \
|
||||
$(STAGING_DIR_ROOT)/lib/modules/$(LINUX_VERSION)/* \
|
||||
$(KERNEL_BUILD_DIR)/debug/modules/
|
||||
$(FIND) $(KERNEL_BUILD_DIR)/debug -type f | $(XARGS) $(KERNEL_CROSS)strip --only-keep-debug
|
||||
$(TAR) c -C $(KERNEL_BUILD_DIR) debug \
|
||||
@@ -132,7 +132,6 @@ define BuildKernel
|
||||
$(LINUX_DIR)/.modules: export STAGING_PREFIX=$$(STAGING_DIR_HOST)
|
||||
$(LINUX_DIR)/.modules: export PKG_CONFIG_PATH=$$(STAGING_DIR_HOST)/lib/pkgconfig
|
||||
$(LINUX_DIR)/.modules: export PKG_CONFIG_LIBDIR=$$(STAGING_DIR_HOST)/lib/pkgconfig
|
||||
$(LINUX_DIR)/.modules: export FAIL_ON_UNCONFIGURED=1
|
||||
$(LINUX_DIR)/.modules: $(STAMP_CONFIGURED) $(LINUX_DIR)/.config FORCE
|
||||
$(Kernel/CompileModules)
|
||||
touch $$@
|
||||
@@ -154,11 +153,7 @@ define BuildKernel
|
||||
download: $(if $(LINUX_SITE),$(DL_DIR)/$(LINUX_SOURCE))
|
||||
prepare: $(STAMP_PREPARED)
|
||||
compile: $(LINUX_DIR)/.modules
|
||||
+$(MAKE) -C image compile TARGET_BUILD=
|
||||
|
||||
dtb: $(STAMP_CONFIGURED)
|
||||
$(_SINGLE)$(KERNEL_MAKE) scripts_dtc
|
||||
$(MAKE) -C image compile-dtb TARGET_BUILD=
|
||||
$(MAKE) -C image compile TARGET_BUILD=
|
||||
|
||||
oldconfig menuconfig nconfig xconfig: $(STAMP_PREPARED) $(STAMP_CHECKED) FORCE
|
||||
rm -f $(LINUX_DIR)/.config.prev
|
||||
@@ -166,6 +161,7 @@ define BuildKernel
|
||||
$(LINUX_RECONF_CMD) > $(LINUX_DIR)/.config
|
||||
$(_SINGLE)$(KERNEL_MAKE) \
|
||||
$(if $(findstring Darwin,$(HOST_OS)), \
|
||||
HOST_LOADLIBES="-L$(STAGING_DIR_HOST)/lib -lncurses" \
|
||||
HOSTLDLIBS_mconf="-L$(STAGING_DIR_HOST)/lib -lncurses" \
|
||||
filechk_conf_cfg=" :" \
|
||||
) \
|
||||
|
||||
@@ -3,12 +3,16 @@
|
||||
# Copyright (C) 2006-2020 OpenWrt.org
|
||||
|
||||
ifdef CONFIG_STRIP_KERNEL_EXPORTS
|
||||
KERNEL_MAKEOPTS_IMAGE += \
|
||||
KERNEL_MAKEOPTS += \
|
||||
EXTRA_LDSFLAGS="-I$(KERNEL_BUILD_DIR) -include symtab.h"
|
||||
endif
|
||||
|
||||
INITRAMFS_EXTRA_FILES ?= $(GENERIC_PLATFORM_DIR)/image/initramfs-base-files.txt
|
||||
|
||||
ifneq (,$(KERNEL_CC))
|
||||
KERNEL_MAKEOPTS += CC="$(KERNEL_CC)"
|
||||
endif
|
||||
|
||||
export HOST_EXTRACFLAGS=-I$(STAGING_DIR_HOST)/include
|
||||
|
||||
# defined in quilt.mk
|
||||
@@ -17,7 +21,7 @@ Kernel/Patch:=$(Kernel/Patch/Default)
|
||||
ifneq (,$(findstring .xz,$(LINUX_SOURCE)))
|
||||
LINUX_CAT:=xzcat
|
||||
else
|
||||
LINUX_CAT:=$(STAGING_DIR_HOST)/bin/libdeflate-gzip -dc
|
||||
LINUX_CAT:=gzip -dc
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(CONFIG_EXTERNAL_KERNEL_TREE)),"")
|
||||
@@ -46,58 +50,34 @@ else
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y)
|
||||
ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS_SEPARATE),y)
|
||||
ifeq ($(strip $(CONFIG_EXTERNAL_CPIO)),"")
|
||||
define Kernel/SetInitramfs/PreConfigure
|
||||
{ \
|
||||
grep -v -e CONFIG_BLK_DEV_INITRD $(2)/.config.old > $(2)/.config; \
|
||||
echo 'CONFIG_BLK_DEV_INITRD=y' >> $(2)/.config; \
|
||||
echo 'CONFIG_INITRAMFS_SOURCE=""' >> $(2)/.config; \
|
||||
}
|
||||
grep -v -e INITRAMFS -e CONFIG_RD_ -e CONFIG_BLK_DEV_INITRD $(LINUX_DIR)/.config.old > $(LINUX_DIR)/.config
|
||||
echo 'CONFIG_BLK_DEV_INITRD=y' >> $(LINUX_DIR)/.config
|
||||
echo 'CONFIG_INITRAMFS_SOURCE="$(strip $(TARGET_DIR) $(INITRAMFS_EXTRA_FILES))"' >> $(LINUX_DIR)/.config
|
||||
endef
|
||||
else
|
||||
ifeq ($(strip $(CONFIG_EXTERNAL_CPIO)),"")
|
||||
define Kernel/SetInitramfs/PreConfigure
|
||||
{ \
|
||||
grep -v -e INITRAMFS -e CONFIG_RD_ -e CONFIG_BLK_DEV_INITRD $(2)/.config.old > $(2)/.config; \
|
||||
echo 'CONFIG_BLK_DEV_INITRD=y' >> $(2)/.config; \
|
||||
echo 'CONFIG_INITRAMFS_SOURCE="$(strip $(1) $(INITRAMFS_EXTRA_FILES))"' >> $(2)/.config; \
|
||||
}
|
||||
endef
|
||||
else
|
||||
define Kernel/SetInitramfs/PreConfigure
|
||||
{ \
|
||||
grep -v INITRAMFS $(2)/.config.old > $(2)/.config; \
|
||||
echo 'CONFIG_INITRAMFS_SOURCE="$(call qstrip,$(CONFIG_EXTERNAL_CPIO))"' >> $(2)/.config; \
|
||||
}
|
||||
endef
|
||||
endif
|
||||
define Kernel/SetInitramfs/PreConfigure
|
||||
grep -v INITRAMFS $(LINUX_DIR)/.config.old > $(LINUX_DIR)/.config
|
||||
echo 'CONFIG_INITRAMFS_SOURCE="$(call qstrip,$(CONFIG_EXTERNAL_CPIO))"' >> $(LINUX_DIR)/.config
|
||||
endef
|
||||
endif
|
||||
|
||||
define Kernel/SetInitramfs
|
||||
{ \
|
||||
rm -f $(2)/.config.prev; \
|
||||
mv $(2)/.config $(2)/.config.old; \
|
||||
$(call Kernel/SetInitramfs/PreConfigure,$(1),$(2)); \
|
||||
echo "# CONFIG_INITRAMFS_PRESERVE_MTIME is not set" >> $(2)/.config; \
|
||||
$(if $(CONFIG_TARGET_ROOTFS_INITRAMFS_SEPARATE),,echo "CONFIG_INITRAMFS_ROOT_UID=$(shell id -u)" >> $(2)/.config;) \
|
||||
$(if $(CONFIG_TARGET_ROOTFS_INITRAMFS_SEPARATE),,echo "CONFIG_INITRAMFS_ROOT_GID=$(shell id -g)" >> $(2)/.config;) \
|
||||
$(if $(CONFIG_TARGET_ROOTFS_INITRAMFS_SEPARATE), \
|
||||
echo "# CONFIG_INITRAMFS_FORCE is not set" >> $(2)/.config;, \
|
||||
$(if $(CONFIG_TARGET_INITRAMFS_FORCE), \
|
||||
echo "CONFIG_INITRAMFS_FORCE=y" >> $(2)/.config;, \
|
||||
echo "# CONFIG_INITRAMFS_FORCE is not set" >> $(2)/.config;)) \
|
||||
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_NONE), \
|
||||
echo "CONFIG_INITRAMFS_COMPRESSION_NONE=y" >> $(2)/.config;, \
|
||||
echo "# CONFIG_INITRAMFS_COMPRESSION_NONE is not set" >> $(2)/.config; ) \
|
||||
$(foreach ALGO,GZIP BZIP2 LZMA LZO XZ LZ4 ZSTD, \
|
||||
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_$(ALGO)), \
|
||||
echo "CONFIG_INITRAMFS_COMPRESSION_$(ALGO)=y" >> $(2)/.config; $\, \
|
||||
echo "# CONFIG_INITRAMFS_COMPRESSION_$(ALGO) is not set" >> $(2)/.config; $\) \
|
||||
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_$(ALGO)), \
|
||||
echo "CONFIG_RD_$(ALGO)=y" >> $(2)/.config; $\, \
|
||||
echo "# CONFIG_RD_$(ALGO) is not set" >> $(2)/.config; $\) \
|
||||
) \
|
||||
}
|
||||
rm -f $(LINUX_DIR)/.config.prev
|
||||
mv $(LINUX_DIR)/.config $(LINUX_DIR)/.config.old
|
||||
$(call Kernel/SetInitramfs/PreConfigure)
|
||||
echo 'CONFIG_INITRAMFS_ROOT_UID=$(shell id -u)' >> $(LINUX_DIR)/.config
|
||||
echo 'CONFIG_INITRAMFS_ROOT_GID=$(shell id -g)' >> $(LINUX_DIR)/.config
|
||||
echo "$(if $(CONFIG_TARGET_INITRAMFS_FORCE),CONFIG_INITRAMFS_FORCE=y,# CONFIG_INITRAMFS_FORCE is not set)" >> $(LINUX_DIR)/.config
|
||||
echo "$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_NONE),CONFIG_INITRAMFS_COMPRESSION_NONE=y,# CONFIG_INITRAMFS_COMPRESSION_NONE is not set)" >> $(LINUX_DIR)/.config
|
||||
echo -e "$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_GZIP),CONFIG_INITRAMFS_COMPRESSION_GZIP=y\nCONFIG_RD_GZIP=y,# CONFIG_INITRAMFS_COMPRESSION_GZIP is not set\n# CONFIG_RD_GZIP is not set)" >> $(LINUX_DIR)/.config
|
||||
echo -e "$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_BZIP2),CONFIG_INITRAMFS_COMPRESSION_BZIP2=y\nCONFIG_RD_BZIP2=y,# CONFIG_INITRAMFS_COMPRESSION_BZIP2 is not set\n# CONFIG_RD_BZIP2 is not set)" >> $(LINUX_DIR)/.config
|
||||
echo -e "$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_LZMA),CONFIG_INITRAMFS_COMPRESSION_LZMA=y\nCONFIG_RD_LZMA=y,# CONFIG_INITRAMFS_COMPRESSION_LZMA is not set\n# CONFIG_RD_LZMA is not set)" >> $(LINUX_DIR)/.config
|
||||
echo -e "$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_LZO),CONFIG_INITRAMFS_COMPRESSION_LZO=y\nCONFIG_RD_LZO=y,# CONFIG_INITRAMFS_COMPRESSION_LZO is not set\n# CONFIG_RD_LZO is not set)" >> $(LINUX_DIR)/.config
|
||||
echo -e "$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_XZ),CONFIG_INITRAMFS_COMPRESSION_XZ=y\nCONFIG_RD_XZ=y,# CONFIG_INITRAMFS_COMPRESSION_XZ is not set\n# CONFIG_RD_XZ is not set)" >> $(LINUX_DIR)/.config
|
||||
echo -e "$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_LZ4),CONFIG_INITRAMFS_COMPRESSION_LZ4=y\nCONFIG_RD_LZ4=y,# CONFIG_INITRAMFS_COMPRESSION_LZ4 is not set\n# CONFIG_RD_LZ4 is not set)" >> $(LINUX_DIR)/.config
|
||||
echo -e "$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_ZSTD),CONFIG_INITRAMFS_COMPRESSION_ZSTD=y\nCONFIG_RD_STD=y,# CONFIG_INITRAMFS_COMPRESSION_ZSTD is not set\n# CONFIG_RD_ZSTD is not set)" >> $(LINUX_DIR)/.config
|
||||
endef
|
||||
else
|
||||
endif
|
||||
@@ -107,7 +87,6 @@ define Kernel/SetNoInitramfs
|
||||
grep -v INITRAMFS $(LINUX_DIR)/.config.old > $(LINUX_DIR)/.config.set
|
||||
echo 'CONFIG_INITRAMFS_SOURCE=""' >> $(LINUX_DIR)/.config.set
|
||||
echo '# CONFIG_INITRAMFS_FORCE is not set' >> $(LINUX_DIR)/.config.set
|
||||
echo "# CONFIG_INITRAMFS_PRESERVE_MTIME is not set" >> $(LINUX_DIR)/.config.set
|
||||
endef
|
||||
|
||||
define Kernel/Configure/Default
|
||||
@@ -126,21 +105,17 @@ define Kernel/Configure/Default
|
||||
cp $(LINUX_DIR)/.config.set $(LINUX_DIR)/.config; \
|
||||
cp $(LINUX_DIR)/.config.set $(LINUX_DIR)/.config.prev; \
|
||||
}
|
||||
$(_SINGLE) [ -d $(LINUX_DIR)/user_headers ] || $(KERNEL_MAKE) $(if $(findstring uml,$(BOARD)),ARCH=$(ARCH)) INSTALL_HDR_PATH=$(LINUX_DIR)/user_headers headers_install
|
||||
grep '=[ym]' $(LINUX_DIR)/.config.set | LC_ALL=C sort | $(MKHASH) md5 > $(LINUX_DIR)/.vermagic
|
||||
$(_SINGLE) [ -d $(LINUX_DIR)/user_headers ] || $(KERNEL_MAKE) INSTALL_HDR_PATH=$(LINUX_DIR)/user_headers headers_install
|
||||
grep '=[ym]' $(LINUX_DIR)/.config.set | LC_ALL=C sort | mkhash md5 > $(LINUX_DIR)/.vermagic
|
||||
endef
|
||||
|
||||
define Kernel/Configure/Initramfs
|
||||
$(call Kernel/SetInitramfs,$(1),$(2))
|
||||
$(call Kernel/SetInitramfs)
|
||||
endef
|
||||
|
||||
define Kernel/CompileModules/Default
|
||||
rm -f $(LINUX_DIR)/vmlinux $(LINUX_DIR)/System.map
|
||||
+$(KERNEL_MAKE) $(if $(KERNELNAME),$(KERNELNAME),all) modules
|
||||
# If .config did not change, use the previous timestamp to avoid package rebuilds
|
||||
cmp -s $(LINUX_DIR)/.config $(LINUX_DIR)/.config.modules.save && \
|
||||
mv $(LINUX_DIR)/.config.modules.save $(LINUX_DIR)/.config; \
|
||||
$(CP) $(LINUX_DIR)/.config $(LINUX_DIR)/.config.modules.save
|
||||
+$(KERNEL_MAKE) modules
|
||||
endef
|
||||
|
||||
OBJCOPY_STRIP = -R .reginfo -R .notes -R .note -R .comment -R .mdebug -R .note.gnu.build-id
|
||||
@@ -150,73 +125,32 @@ ifeq ($(LINUX_KARCH),x86_64)
|
||||
IMAGES_DIR:=../../x86/boot
|
||||
endif
|
||||
|
||||
# $1: image suffix
|
||||
# $2: Per Device Rootfs ID
|
||||
define Kernel/CopyImage
|
||||
cmp -s $(LINUX_DIR)$(2)/vmlinux $(KERNEL_BUILD_DIR)/vmlinux$(1).debug$(2) || { \
|
||||
$(KERNEL_CROSS)objcopy -O binary $(OBJCOPY_STRIP) -S $(LINUX_DIR)$(2)/vmlinux $(LINUX_KERNEL)$(1)$(2); \
|
||||
$(KERNEL_CROSS)objcopy $(OBJCOPY_STRIP) -S $(LINUX_DIR)$(2)/vmlinux $(KERNEL_BUILD_DIR)/vmlinux$(1).elf$(2); \
|
||||
$(CP) $(LINUX_DIR)$(2)/vmlinux $(KERNEL_BUILD_DIR)/vmlinux$(1).debug$(2); \
|
||||
cmp -s $(LINUX_DIR)/vmlinux $(KERNEL_BUILD_DIR)/vmlinux$(1).debug || { \
|
||||
$(KERNEL_CROSS)objcopy -O binary $(OBJCOPY_STRIP) -S $(LINUX_DIR)/vmlinux $(LINUX_KERNEL)$(1); \
|
||||
$(KERNEL_CROSS)objcopy $(OBJCOPY_STRIP) -S $(LINUX_DIR)/vmlinux $(KERNEL_BUILD_DIR)/vmlinux$(1).elf; \
|
||||
$(CP) $(LINUX_DIR)/vmlinux $(KERNEL_BUILD_DIR)/vmlinux$(1).debug; \
|
||||
$(foreach k, \
|
||||
$(if $(KERNEL_IMAGES),$(KERNEL_IMAGES),$(filter-out vmlinux dtbs,$(KERNELNAME))), \
|
||||
$(CP) $(LINUX_DIR)$(2)/arch/$(LINUX_KARCH)/boot/$(IMAGES_DIR)/$(k) $(KERNEL_BUILD_DIR)/$(k)$(1)$(2); \
|
||||
$(CP) $(LINUX_DIR)/arch/$(LINUX_KARCH)/boot/$(IMAGES_DIR)/$(k) $(KERNEL_BUILD_DIR)/$(k)$(1); \
|
||||
) \
|
||||
}
|
||||
endef
|
||||
|
||||
define Kernel/CompileImage/Default
|
||||
rm -f $(TARGET_DIR)/init
|
||||
+$(KERNEL_MAKE) $(KERNEL_MAKEOPTS_IMAGE) $(if $(KERNELNAME),$(KERNELNAME),all)
|
||||
+$(KERNEL_MAKE) $(if $(KERNELNAME),$(KERNELNAME),all) modules
|
||||
$(call Kernel/CopyImage)
|
||||
endef
|
||||
|
||||
define Kernel/PrepareConfigPerRootfs
|
||||
{ \
|
||||
[ ! -d "$(1)" ] || rm -rf $(1); \
|
||||
mkdir $(1) && $(CP) -T $(LINUX_DIR) $(1); \
|
||||
touch $(1)/.config; \
|
||||
rm -rf $(1)/usr/initramfs_data.cpio*; \
|
||||
}
|
||||
endef
|
||||
|
||||
ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
|
||||
# $1: Custom TARGET_DIR. If omitted TARGET_DIR is used.
|
||||
# $2: If defined Generate Per Rootfs Kernel Directory and use it
|
||||
# For Separate Initramf with $2 declared, skip kernel compile, it has
|
||||
# already been done previously on generic image build
|
||||
define Kernel/CompileImage/Initramfs
|
||||
$(call locked,{ \
|
||||
$(if $(2),$(call Kernel/PrepareConfigPerRootfs,$(LINUX_DIR)$(2));) \
|
||||
$(call Kernel/Configure/Initramfs,$(if $(1),$(1),$(TARGET_DIR)),$(LINUX_DIR)$(2)); \
|
||||
$(CP) $(GENERIC_PLATFORM_DIR)/other-files/init $(if $(1),$(1),$(TARGET_DIR))/init; \
|
||||
$(if $(SOURCE_DATE_EPOCH),touch -hcd "@$(SOURCE_DATE_EPOCH)" $(if $(1),$(1),$(TARGET_DIR)) $(if $(1),$(1),$(TARGET_DIR))/init;) \
|
||||
$(if $(CONFIG_TARGET_ROOTFS_INITRAMFS_SEPARATE), \
|
||||
$(call locked,{ \
|
||||
$(if $(call qstrip,$(CONFIG_EXTERNAL_CPIO)), \
|
||||
$(CP) $(CONFIG_EXTERNAL_CPIO) $(KERNEL_BUILD_DIR)/initrd$(2).cpio;,\
|
||||
( cd $(if $(1),$(1),$(TARGET_DIR)); find . | LC_ALL=C sort | $(STAGING_DIR_HOST)/bin/cpio --reproducible -o -H newc -R 0:0 > $(KERNEL_BUILD_DIR)/initrd$(2).cpio );) \
|
||||
$(if $(SOURCE_DATE_EPOCH), \
|
||||
touch -hcd "@$(SOURCE_DATE_EPOCH)" $(KERNEL_BUILD_DIR)/initrd$(2).cpio;) \
|
||||
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_BZIP2), \
|
||||
$(STAGING_DIR_HOST)/bin/bzip2 -9 -c < $(KERNEL_BUILD_DIR)/initrd$(2).cpio > $(KERNEL_BUILD_DIR)/initrd$(2).cpio.bzip2;) \
|
||||
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_GZIP), \
|
||||
$(STAGING_DIR_HOST)/bin/libdeflate-gzip -n -f -S .gzip -12 $(KERNEL_BUILD_DIR)/initrd$(2).cpio;) \
|
||||
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_LZ4), \
|
||||
$(STAGING_DIR_HOST)/bin/lz4c -l -c1 -fz --favor-decSpeed $(KERNEL_BUILD_DIR)/initrd$(2).cpio;) \
|
||||
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_LZMA), \
|
||||
$(STAGING_DIR_HOST)/bin/lzma e -lc1 -lp2 -pb2 $(KERNEL_BUILD_DIR)/initrd$(2).cpio $(KERNEL_BUILD_DIR)/initrd$(2).cpio.lzma;) \
|
||||
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_LZO), \
|
||||
$(STAGING_DIR_HOST)/bin/lzop -9 -f $(KERNEL_BUILD_DIR)/initrd$(2).cpio;) \
|
||||
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_XZ), \
|
||||
$(STAGING_DIR_HOST)/bin/xz -T$(if $(filter 1,$(NPROC)),2,0) -9 -fz --check=crc32 $(KERNEL_BUILD_DIR)/initrd$(2).cpio;) \
|
||||
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_ZSTD), \
|
||||
$(STAGING_DIR_HOST)/bin/zstd -T0 -f -o $(KERNEL_BUILD_DIR)/initrd$(2).cpio.zstd $(KERNEL_BUILD_DIR)/initrd$(2).cpio;) \
|
||||
}, gen-cpio$(2)); \
|
||||
$(if $(2),,$(KERNEL_MAKE) $(KERNEL_MAKEOPTS_IMAGE) $(if $(KERNELNAME),$(KERNELNAME),all);),\
|
||||
$(KERNEL_MAKE) $(if $(2),-C $(LINUX_DIR)$(2)) $(KERNEL_MAKEOPTS_IMAGE) $(if $(KERNELNAME),$(KERNELNAME),all);) \
|
||||
$(call Kernel/CopyImage,-initramfs,$(2)); \
|
||||
$(if $(2),rm -rf $(LINUX_DIR)$(2);) \
|
||||
}, gen-initramfs$(2));
|
||||
$(call Kernel/Configure/Initramfs)
|
||||
$(CP) $(GENERIC_PLATFORM_DIR)/other-files/init $(TARGET_DIR)/init
|
||||
$(if $(SOURCE_DATE_EPOCH),touch -hcd "@$(SOURCE_DATE_EPOCH)" $(TARGET_DIR)/init)
|
||||
rm -rf $(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION)/usr/initramfs_data.cpio*
|
||||
+$(KERNEL_MAKE) $(if $(KERNELNAME),$(KERNELNAME),all) modules
|
||||
$(call Kernel/CopyImage,-initramfs)
|
||||
endef
|
||||
else
|
||||
define Kernel/CompileImage/Initramfs
|
||||
@@ -228,3 +162,5 @@ define Kernel/Clean/Default
|
||||
rm -f $(LINUX_KERNEL)
|
||||
$(_SINGLE)$(MAKE) -C $(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION) clean
|
||||
endef
|
||||
|
||||
|
||||
|
||||
@@ -6,21 +6,9 @@ ifdef CONFIG_TESTING_KERNEL
|
||||
KERNEL_PATCHVER:=$(KERNEL_TESTING_PATCHVER)
|
||||
endif
|
||||
|
||||
KERNEL_DETAILS_FILE=$(INCLUDE_DIR)/kernel-$(KERNEL_PATCHVER)
|
||||
ifeq ($(wildcard $(KERNEL_DETAILS_FILE)),)
|
||||
$(error Missing kernel version/hash file for $(KERNEL_PATCHVER). Please create $(KERNEL_DETAILS_FILE))
|
||||
endif
|
||||
LINUX_VERSION-5.4 = .119
|
||||
|
||||
include $(KERNEL_DETAILS_FILE)
|
||||
|
||||
ifdef KERNEL_TESTING_PATCHVER
|
||||
KERNEL_TESTING_DETAILS_FILE=$(INCLUDE_DIR)/kernel-$(KERNEL_TESTING_PATCHVER)
|
||||
ifeq ($(wildcard $(KERNEL_TESTING_DETAILS_FILE)),)
|
||||
$(error Missing kernel version/hash file for $(KERNEL_TESTING_PATCHVER). Please create $(KERNEL_TESTING_DETAILS_FILE))
|
||||
endif
|
||||
|
||||
include $(KERNEL_TESTING_DETAILS_FILE)
|
||||
endif
|
||||
LINUX_KERNEL_HASH-5.4.119 = 71e7decf1e8149a8aed88d30df4f2a62a6c6b168111de6b261685ac7c0ecb2a0
|
||||
|
||||
remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1))))
|
||||
sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1)))))))
|
||||
|
||||
@@ -43,7 +43,7 @@ else
|
||||
PATCH_DIR ?= $(CURDIR)/patches$(if $(wildcard ./patches-$(KERNEL_PATCHVER)),-$(KERNEL_PATCHVER))
|
||||
FILES_DIR ?= $(foreach dir,$(wildcard $(CURDIR)/files $(CURDIR)/files-$(KERNEL_PATCHVER)),"$(dir)")
|
||||
endif
|
||||
KERNEL_BUILD_DIR ?= $(BUILD_DIR)/linux-$(BOARD)_$(SUBTARGET)
|
||||
KERNEL_BUILD_DIR ?= $(BUILD_DIR)/linux-$(BOARD)$(if $(SUBTARGET),_$(SUBTARGET))
|
||||
LINUX_DIR ?= $(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION)
|
||||
LINUX_UAPI_DIR=uapi/
|
||||
LINUX_VERMAGIC:=$(strip $(shell cat $(LINUX_DIR)/.vermagic 2>/dev/null))
|
||||
@@ -86,14 +86,10 @@ else ifneq (,$(findstring $(ARCH) , arceb ))
|
||||
LINUX_KARCH := arc
|
||||
else ifneq (,$(findstring $(ARCH) , armeb ))
|
||||
LINUX_KARCH := arm
|
||||
else ifneq (,$(findstring $(ARCH) , loongarch64 ))
|
||||
LINUX_KARCH := loongarch
|
||||
else ifneq (,$(findstring $(ARCH) , mipsel mips64 mips64el ))
|
||||
LINUX_KARCH := mips
|
||||
else ifneq (,$(findstring $(ARCH) , powerpc64 ))
|
||||
LINUX_KARCH := powerpc
|
||||
else ifneq (,$(findstring $(ARCH) , riscv64 ))
|
||||
LINUX_KARCH := riscv
|
||||
else ifneq (,$(findstring $(ARCH) , sh2 sh3 sh4 ))
|
||||
LINUX_KARCH := sh
|
||||
else ifneq (,$(findstring $(ARCH) , i386 x86_64 ))
|
||||
@@ -105,7 +101,7 @@ endif
|
||||
KERNEL_MAKE = $(MAKE) $(KERNEL_MAKEOPTS)
|
||||
|
||||
KERNEL_MAKE_FLAGS = \
|
||||
KCFLAGS="$(call iremap,$(BUILD_DIR),$(notdir $(BUILD_DIR))) $(filter-out -fno-plt,$(call qstrip,$(CONFIG_EXTRA_OPTIMIZATION))) $(call qstrip,$(CONFIG_KERNEL_CFLAGS))" \
|
||||
KCFLAGS="$(call iremap,$(BUILD_DIR),$(notdir $(BUILD_DIR)))" \
|
||||
HOSTCFLAGS="$(HOST_CFLAGS) -Wall -Wmissing-prototypes -Wstrict-prototypes" \
|
||||
CROSS_COMPILE="$(KERNEL_CROSS)" \
|
||||
ARCH="$(LINUX_KARCH)" \
|
||||
@@ -114,17 +110,14 @@ KERNEL_MAKE_FLAGS = \
|
||||
KBUILD_BUILD_HOST="$(call qstrip,$(CONFIG_KERNEL_BUILD_DOMAIN))" \
|
||||
KBUILD_BUILD_TIMESTAMP="$(KBUILD_BUILD_TIMESTAMP)" \
|
||||
KBUILD_BUILD_VERSION="0" \
|
||||
KBUILD_HOSTLDFLAGS="-L$(STAGING_DIR_HOST)/lib" \
|
||||
HOST_LOADLIBES="-L$(STAGING_DIR_HOST)/lib" \
|
||||
KBUILD_HOSTLDLIBS="-L$(STAGING_DIR_HOST)/lib" \
|
||||
CONFIG_SHELL="$(BASH)" \
|
||||
$(if $(findstring c,$(OPENWRT_VERBOSE)),V=1,V='') \
|
||||
$(if $(PKG_BUILD_ID),LDFLAGS_MODULE=--build-id=0x$(PKG_BUILD_ID)) \
|
||||
cmd_syscalls= \
|
||||
$(if $(__package_mk),KBUILD_EXTRA_SYMBOLS="$(wildcard $(PKG_SYMVERS_DIR)/*.symvers)")
|
||||
|
||||
ifneq (,$(KERNEL_CC))
|
||||
KERNEL_MAKE_FLAGS += CC="$(KERNEL_CC)"
|
||||
endif
|
||||
|
||||
KERNEL_NOSTDINC_FLAGS = \
|
||||
-nostdinc $(if $(DUMP),, -isystem $(shell $(TARGET_CC) -print-file-name=include))
|
||||
|
||||
@@ -133,17 +126,17 @@ ifeq ($(call qstrip,$(CONFIG_EXTERNAL_KERNEL_TREE))$(call qstrip,$(CONFIG_KERNEL
|
||||
KERNELRELEASE=$(LINUX_VERSION)
|
||||
endif
|
||||
|
||||
ifneq ($(HOST_OS),Linux)
|
||||
KERNEL_MAKE_FLAGS += CONFIG_STACK_VALIDATION=
|
||||
export SKIP_STACK_VALIDATION:=1
|
||||
endif
|
||||
|
||||
KERNEL_MAKEOPTS = -C $(LINUX_DIR) $(KERNEL_MAKE_FLAGS)
|
||||
KERNEL_MAKEOPTS := -C $(LINUX_DIR) $(KERNEL_MAKE_FLAGS)
|
||||
|
||||
ifdef CONFIG_USE_SPARSE
|
||||
KERNEL_MAKEOPTS += C=1 CHECK=$(STAGING_DIR_HOST)/bin/sparse
|
||||
endif
|
||||
|
||||
ifneq ($(HOST_OS),Linux)
|
||||
KERNEL_MAKEOPTS += CONFIG_STACK_VALIDATION=
|
||||
export SKIP_STACK_VALIDATION:=1
|
||||
endif
|
||||
|
||||
PKG_EXTMOD_SUBDIRS ?= .
|
||||
|
||||
PKG_SYMVERS_DIR = $(KERNEL_BUILD_DIR)/symvers
|
||||
@@ -206,19 +199,19 @@ define KernelPackage
|
||||
$(eval $(call KernelPackage/Defaults))
|
||||
$(eval $(call KernelPackage/$(1)))
|
||||
$(eval $(call KernelPackage/$(1)/$(BOARD)))
|
||||
$(eval $(call KernelPackage/$(1)/$(BOARD)/$(SUBTARGET)))
|
||||
$(eval $(call KernelPackage/$(1)/$(BOARD)/$(if $(SUBTARGET),$(SUBTARGET),generic)))
|
||||
|
||||
define Package/kmod-$(1)
|
||||
TITLE:=$(TITLE)
|
||||
SECTION:=kernel
|
||||
CATEGORY:=Kernel modules
|
||||
DESCRIPTION:=$(DESCRIPTION)
|
||||
EXTRA_DEPENDS:=kernel (=$(LINUX_VERSION)~$(LINUX_VERMAGIC)-r$(LINUX_RELEASE))
|
||||
VERSION:=$(LINUX_VERSION)$(if $(PKG_VERSION),.$(PKG_VERSION))-r$(if $(PKG_RELEASE),$(PKG_RELEASE),$(LINUX_RELEASE))
|
||||
EXTRA_DEPENDS:=kernel (=$(LINUX_VERSION)-$(LINUX_RELEASE)-$(LINUX_VERMAGIC))
|
||||
VERSION:=$(LINUX_VERSION)$(if $(PKG_VERSION),+$(PKG_VERSION))-$(if $(PKG_RELEASE),$(PKG_RELEASE),$(LINUX_RELEASE))
|
||||
PKGFLAGS:=$(PKGFLAGS)
|
||||
$(call KernelPackage/$(1))
|
||||
$(call KernelPackage/$(1)/$(BOARD))
|
||||
$(call KernelPackage/$(1)/$(BOARD)/$(SUBTARGET))
|
||||
$(call KernelPackage/$(1)/$(BOARD)/$(if $(SUBTARGET),$(SUBTARGET),generic))
|
||||
endef
|
||||
|
||||
ifdef KernelPackage/$(1)/conffiles
|
||||
@@ -242,7 +235,7 @@ $(call KernelPackage/$(1)/config)
|
||||
$(call KernelPackage/depends)
|
||||
$(call KernelPackage/hooks)
|
||||
|
||||
ifneq ($(if $(filter-out %=y %=n %=m,$(KCONFIG)),$(filter m y,$(foreach c,$(call version_filter,$(filter-out %=y %=n %=m,$(KCONFIG))),$($(c)))),.),)
|
||||
ifneq ($(if $(filter-out %=y %=n %=m,$(KCONFIG)),$(filter m y,$(foreach c,$(filter-out %=y %=n %=m,$(KCONFIG)),$($(c)))),.),)
|
||||
define Package/kmod-$(1)/install
|
||||
@for mod in $$(call version_filter,$$(FILES)); do \
|
||||
if grep -q "$$$$$$$${mod##$(LINUX_DIR)/}" "$(LINUX_DIR)/modules.builtin"; then \
|
||||
|
||||
151
include/meson.mk
151
include/meson.mk
@@ -1,151 +0,0 @@
|
||||
# To build your package using meson:
|
||||
#
|
||||
# include $(INCLUDE_DIR)/meson.mk
|
||||
# MESON_ARGS+=-Dfoo -Dbar=baz
|
||||
#
|
||||
# To pass additional environment variables to meson:
|
||||
#
|
||||
# MESON_VARS+=FOO=bar
|
||||
#
|
||||
# Default configure/compile/install targets are provided, but can be
|
||||
# overwritten if required:
|
||||
#
|
||||
# define Build/Configure
|
||||
# $(call Build/Configure/Meson)
|
||||
# ...
|
||||
# endef
|
||||
#
|
||||
# same for Build/Compile and Build/Install
|
||||
#
|
||||
# Host packages are built in the same fashion, just use these vars instead:
|
||||
#
|
||||
# MESON_HOST_ARGS+=-Dfoo -Dbar=baz
|
||||
# MESON_HOST_VARS+=FOO=bar
|
||||
|
||||
MESON_DIR:=$(STAGING_DIR_HOST)/lib/meson
|
||||
|
||||
MESON_HOST_BUILD_DIR:=$(HOST_BUILD_DIR)/openwrt-build
|
||||
MESON_HOST_VARS:=
|
||||
MESON_HOST_ARGS:=
|
||||
|
||||
MESON_BUILD_DIR:=$(PKG_BUILD_DIR)/openwrt-build
|
||||
MESON_VARS:=
|
||||
MESON_ARGS:=
|
||||
|
||||
ifneq ($(findstring i386,$(CONFIG_ARCH)),)
|
||||
MESON_ARCH:="x86"
|
||||
else ifneq ($(findstring powerpc64,$(CONFIG_ARCH)),)
|
||||
MESON_ARCH:="ppc64"
|
||||
else ifneq ($(findstring powerpc,$(CONFIG_ARCH)),)
|
||||
MESON_ARCH:="ppc"
|
||||
else ifneq ($(findstring mips64el,$(CONFIG_ARCH)),)
|
||||
MESON_ARCH:="mips64"
|
||||
else ifneq ($(findstring mipsel,$(CONFIG_ARCH)),)
|
||||
MESON_ARCH:="mips"
|
||||
else ifneq ($(findstring armeb,$(CONFIG_ARCH)),)
|
||||
MESON_ARCH:="arm"
|
||||
else
|
||||
MESON_ARCH:=$(CONFIG_ARCH)
|
||||
endif
|
||||
|
||||
# this is undefined for just x64_64
|
||||
ifeq ($(origin CPU_TYPE),undefined)
|
||||
MESON_CPU:="generic"
|
||||
else
|
||||
MESON_CPU:="$(CPU_TYPE)$(if $(CPU_SUBTYPE),+$(CPU_SUBTYPE))"
|
||||
endif
|
||||
|
||||
define Meson
|
||||
$(2) $(STAGING_DIR_HOST)/bin/$(PYTHON) $(STAGING_DIR_HOST)/bin/meson.py $(1)
|
||||
endef
|
||||
|
||||
define Meson/CreateNativeFile
|
||||
$(STAGING_DIR_HOST)/bin/sed \
|
||||
-e "s|@CC@|$(foreach BIN,$(HOSTCC),'$(BIN)',)|" \
|
||||
-e "s|@CXX@|$(foreach BIN,$(HOSTCXX),'$(BIN)',)|" \
|
||||
-e "s|@PKGCONFIG@|$(PKG_CONFIG)|" \
|
||||
-e "s|@CMAKE@|$(STAGING_DIR_HOST)/bin/cmake|" \
|
||||
-e "s|@PYTHON@|$(STAGING_DIR_HOST)/bin/python3|" \
|
||||
-e "s|@CFLAGS@|$(foreach FLAG,$(HOST_CFLAGS) $(HOST_CPPFLAGS),'$(FLAG)',)|" \
|
||||
-e "s|@CXXFLAGS@|$(foreach FLAG,$(HOST_CXXFLAGS) $(HOST_CPPFLAGS),'$(FLAG)',)|" \
|
||||
-e "s|@LDFLAGS@|$(foreach FLAG,$(HOST_LDFLAGS),'$(FLAG)',)|" \
|
||||
-e "s|@PREFIX@|$(HOST_BUILD_PREFIX)|" \
|
||||
< $(MESON_DIR)/openwrt-native.txt.in \
|
||||
> $(1)
|
||||
endef
|
||||
|
||||
define Meson/CreateCrossFile
|
||||
$(STAGING_DIR_HOST)/bin/sed \
|
||||
-e "s|@CC@|$(foreach BIN,$(TARGET_CC),'$(BIN)',)|" \
|
||||
-e "s|@CXX@|$(foreach BIN,$(TARGET_CXX),'$(BIN)',)|" \
|
||||
-e "s|@LD@|$(foreach FLAG,$(TARGET_LINKER),'$(FLAG)',)|" \
|
||||
-e "s|@AR@|$(TARGET_AR)|" \
|
||||
-e "s|@STRIP@|$(TARGET_CROSS)strip|" \
|
||||
-e "s|@NM@|$(TARGET_NM)|" \
|
||||
-e "s|@PKGCONFIG@|$(PKG_CONFIG)|" \
|
||||
-e "s|@CMAKE@|$(STAGING_DIR_HOST)/bin/cmake|" \
|
||||
-e "s|@PYTHON@|$(STAGING_DIR_HOST)/bin/python3|" \
|
||||
-e "s|@CFLAGS@|$(foreach FLAG,$(TARGET_CFLAGS) $(EXTRA_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS),'$(FLAG)',)|" \
|
||||
-e "s|@CXXFLAGS@|$(foreach FLAG,$(TARGET_CXXFLAGS) $(EXTRA_CXXFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS),'$(FLAG)',)|" \
|
||||
-e "s|@LDFLAGS@|$(foreach FLAG,$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS),'$(FLAG)',)|" \
|
||||
-e "s|@ARCH@|$(MESON_ARCH)|" \
|
||||
-e "s|@CPU@|$(MESON_CPU)|" \
|
||||
-e "s|@ENDIAN@|$(if $(CONFIG_BIG_ENDIAN),big,little)|" \
|
||||
< $(MESON_DIR)/openwrt-cross.txt.in \
|
||||
> $(1)
|
||||
endef
|
||||
|
||||
define Host/Configure/Meson
|
||||
$(call Meson/CreateNativeFile,$(HOST_BUILD_DIR)/openwrt-native.txt)
|
||||
$(call Meson, \
|
||||
setup \
|
||||
--native-file $(HOST_BUILD_DIR)/openwrt-native.txt \
|
||||
-Ddefault_library=static \
|
||||
$(MESON_HOST_ARGS) \
|
||||
$(MESON_HOST_BUILD_DIR) \
|
||||
$(MESON_HOST_BUILD_DIR)/.., \
|
||||
$(MESON_HOST_VARS))
|
||||
endef
|
||||
|
||||
define Host/Compile/Meson
|
||||
+$(NINJA) -C $(MESON_HOST_BUILD_DIR) $(1)
|
||||
endef
|
||||
|
||||
define Host/Install/Meson
|
||||
+$(NINJA) -C $(MESON_HOST_BUILD_DIR) install
|
||||
endef
|
||||
|
||||
define Host/Uninstall/Meson
|
||||
+$(NINJA) -C $(MESON_HOST_BUILD_DIR) uninstall || true
|
||||
endef
|
||||
|
||||
define Build/Configure/Meson
|
||||
$(call Meson/CreateNativeFile,$(PKG_BUILD_DIR)/openwrt-native.txt)
|
||||
$(call Meson/CreateCrossFile,$(PKG_BUILD_DIR)/openwrt-cross.txt)
|
||||
$(call Meson, \
|
||||
setup \
|
||||
--buildtype $(if $(CONFIG_DEBUG),debug,plain) \
|
||||
--native-file $(PKG_BUILD_DIR)/openwrt-native.txt \
|
||||
--cross-file $(PKG_BUILD_DIR)/openwrt-cross.txt \
|
||||
-Ddefault_library=both \
|
||||
$(MESON_ARGS) \
|
||||
$(MESON_BUILD_DIR) \
|
||||
$(MESON_BUILD_DIR)/.., \
|
||||
$(MESON_VARS))
|
||||
endef
|
||||
|
||||
define Build/Compile/Meson
|
||||
+$(NINJA) -C $(MESON_BUILD_DIR) $(1)
|
||||
endef
|
||||
|
||||
define Build/Install/Meson
|
||||
+DESTDIR="$(PKG_INSTALL_DIR)" $(NINJA) -C $(MESON_BUILD_DIR) install
|
||||
endef
|
||||
|
||||
Host/Configure=$(call Host/Configure/Meson)
|
||||
Host/Compile=$(call Host/Compile/Meson)
|
||||
Host/Install=$(call Host/Install/Meson)
|
||||
Host/Uninstall=$(call Host/Uninstall/Meson)
|
||||
Build/Configure=$(call Build/Configure/Meson)
|
||||
Build/Compile=$(call Build/Compile/Meson)
|
||||
Build/Install=$(call Build/Install/Meson)
|
||||
@@ -48,6 +48,8 @@ $(eval $(call nf_add,IPT_CORE,CONFIG_NETFILTER_XT_MATCH_COMMENT, $(P_XT)xt_comme
|
||||
$(eval $(call nf_add,IPT_CLUSTER,CONFIG_NETFILTER_XT_MATCH_CLUSTER, $(P_XT)xt_cluster))
|
||||
|
||||
$(eval $(call nf_add,IPT_CORE,CONFIG_NETFILTER_XT_TARGET_LOG, $(P_XT)xt_LOG))
|
||||
$(eval $(call nf_add,IPT_CORE,CONFIG_NETFILTER_XT_TARGET_LOG, $(P_XT)nf_log_common))
|
||||
$(eval $(call nf_add,IPT_CORE,CONFIG_NETFILTER_XT_TARGET_LOG, $(P_V4)nf_log_ipv4))
|
||||
$(eval $(call nf_add,IPT_CORE,CONFIG_NETFILTER_XT_TARGET_TCPMSS, $(P_XT)xt_TCPMSS))
|
||||
$(eval $(call nf_add,IPT_CORE,CONFIG_IP_NF_TARGET_REJECT, $(P_V4)ipt_REJECT))
|
||||
$(eval $(call nf_add,IPT_CORE,CONFIG_NETFILTER_XT_MATCH_TIME, $(P_XT)xt_time))
|
||||
@@ -62,7 +64,9 @@ $(eval $(if $(NF_KMOD),,$(call nf_add,IPT_CORE,CONFIG_NETFILTER_XT_MARK, $(P_XT)
|
||||
|
||||
# kernel only
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NF_CONNTRACK,CONFIG_NF_CONNTRACK, $(P_XT)nf_conntrack),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NF_CONNTRACK,CONFIG_NF_CONNTRACK_RTCACHE, $(P_XT)nf_conntrack_rtcache),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NF_CONNTRACK,CONFIG_NF_DEFRAG_IPV4, $(P_V4)nf_defrag_ipv4),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NF_CONNTRACK,CONFIG_NF_CONNTRACK_IPV4, $(P_V4)nf_conntrack_ipv4),))
|
||||
|
||||
$(eval $(call nf_add,IPT_CONNTRACK,CONFIG_NETFILTER_XT_MATCH_STATE, $(P_XT)xt_state))
|
||||
$(eval $(call nf_add,IPT_CONNTRACK,CONFIG_NETFILTER_XT_TARGET_CT, $(P_XT)xt_CT))
|
||||
@@ -73,6 +77,7 @@ $(eval $(call nf_add,IPT_CONNTRACK,CONFIG_NETFILTER_XT_MATCH_CONNTRACK, $(P_XT)x
|
||||
|
||||
$(eval $(call nf_add,IPT_CONNTRACK_EXTRA,CONFIG_NETFILTER_XT_MATCH_CONNBYTES, $(P_XT)xt_connbytes))
|
||||
$(eval $(call nf_add,IPT_CONNTRACK_EXTRA,CONFIG_NETFILTER_XT_MATCH_CONNLIMIT, $(P_XT)xt_connlimit))
|
||||
$(eval $(call nf_add,IPT_CONNTRACK_EXTRA,CONFIG_NETFILTER_CONNCOUNT, $(P_XT)nf_conncount))
|
||||
$(eval $(call nf_add,IPT_CONNTRACK_EXTRA,CONFIG_NETFILTER_XT_CONNMARK, $(P_XT)xt_connmark))
|
||||
$(eval $(call nf_add,IPT_CONNTRACK_EXTRA,CONFIG_NETFILTER_XT_MATCH_HELPER, $(P_XT)xt_helper))
|
||||
$(eval $(call nf_add,IPT_CONNTRACK_EXTRA,CONFIG_NETFILTER_XT_MATCH_RECENT, $(P_XT)xt_recent))
|
||||
@@ -89,7 +94,6 @@ $(eval $(call nf_add,IPT_EXTRA,CONFIG_NETFILTER_XT_MATCH_ADDRTYPE, $(if $(NF_KMO
|
||||
$(eval $(call nf_add,IPT_EXTRA,CONFIG_NETFILTER_XT_MATCH_OWNER, $(P_XT)xt_owner))
|
||||
$(eval $(call nf_add,IPT_EXTRA,CONFIG_NETFILTER_XT_MATCH_PKTTYPE, $(P_XT)xt_pkttype))
|
||||
$(eval $(call nf_add,IPT_EXTRA,CONFIG_NETFILTER_XT_MATCH_QUOTA, $(P_XT)xt_quota))
|
||||
$(eval $(call nf_add,IPT_EXTRA,CONFIG_NETFILTER_XT_MATCH_CGROUP, $(P_XT)xt_cgroup))
|
||||
|
||||
#$(eval $(call nf_add,IPT_EXTRA,CONFIG_IP_NF_TARGET_ROUTE, $(P_V4)ipt_ROUTE))
|
||||
|
||||
@@ -115,6 +119,7 @@ $(eval $(call nf_add,IPT_IPOPT,CONFIG_NETFILTER_XT_MATCH_STATISTIC, $(P_XT)xt_st
|
||||
$(eval $(call nf_add,IPT_IPOPT,CONFIG_NETFILTER_XT_MATCH_TCPMSS, $(P_XT)xt_tcpmss))
|
||||
|
||||
$(eval $(call nf_add,IPT_IPOPT,CONFIG_NETFILTER_XT_TARGET_CLASSIFY, $(P_XT)xt_CLASSIFY))
|
||||
$(eval $(call nf_add,IPT_IPOPT,CONFIG_IP_NF_MATCH_DSCP, $(P_V4)ipt_dscp))
|
||||
$(eval $(call nf_add,IPT_IPOPT,CONFIG_IP_NF_TARGET_ECN, $(P_V4)ipt_ECN))
|
||||
|
||||
$(eval $(call nf_add,IPT_IPOPT,CONFIG_NETFILTER_XT_MATCH_ECN, $(P_XT)xt_ecn))
|
||||
@@ -131,6 +136,9 @@ $(eval $(call nf_add,IPT_IPOPT,CONFIG_NETFILTER_XT_TARGET_HL, $(P_XT)xt_HL))
|
||||
# iprange
|
||||
$(eval $(call nf_add,IPT_IPRANGE,CONFIG_NETFILTER_XT_MATCH_IPRANGE, $(P_XT)xt_iprange))
|
||||
|
||||
#clusterip
|
||||
$(eval $(call nf_add,IPT_CLUSTERIP,CONFIG_IP_NF_TARGET_CLUSTERIP, $(P_V4)ipt_CLUSTERIP))
|
||||
|
||||
# ipsec
|
||||
$(eval $(call nf_add,IPT_IPSEC,CONFIG_IP_NF_MATCH_AH, $(P_V4)ipt_ah))
|
||||
$(eval $(call nf_add,IPT_IPSEC,CONFIG_NETFILTER_XT_MATCH_ESP, $(P_XT)xt_esp))
|
||||
@@ -147,13 +155,17 @@ $(eval $(if $(NF_KMOD),$(call nf_add,NF_REJECT6,CONFIG_NF_REJECT_IPV6, $(P_V6)nf
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NF_IPT6,CONFIG_IP6_NF_IPTABLES, $(P_V6)ip6_tables),))
|
||||
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NF_CONNTRACK,CONFIG_NF_DEFRAG_IPV6, $(P_V6)nf_defrag_ipv6),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NF_CONNTRACK6,CONFIG_NF_CONNTRACK_IPV6, $(P_V6)nf_conntrack_ipv6),))
|
||||
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,IPT_IPV6,CONFIG_IP6_NF_FILTER, $(P_V6)ip6table_filter),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,IPT_IPV6,CONFIG_IP6_NF_MANGLE, $(P_V6)ip6table_mangle),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,IPT_IPV6,CONFIG_IP6_NF_QUEUE, $(P_V6)ip6_queue),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,IPT_IPV6,CONFIG_NF_LOG_IPV6, $(P_V6)nf_log_ipv6),))
|
||||
|
||||
$(eval $(if $(NF_KMOD),,$(call nf_add,IPT_IPV6,CONFIG_IP6_NF_IPTABLES, ip6t_icmp6)))
|
||||
|
||||
|
||||
$(eval $(call nf_add,IPT_IPV6,CONFIG_IP6_NF_TARGET_LOG, $(P_V6)ip6t_LOG))
|
||||
$(eval $(call nf_add,IPT_IPV6,CONFIG_IP6_NF_TARGET_REJECT, $(P_V6)ip6t_REJECT))
|
||||
|
||||
# ipv6 extra
|
||||
@@ -165,13 +177,6 @@ $(eval $(call nf_add,IPT_IPV6_EXTRA,CONFIG_IP6_NF_MATCH_OPTS, $(P_V6)ip6t_hbh))
|
||||
$(eval $(call nf_add,IPT_IPV6_EXTRA,CONFIG_IP6_NF_MATCH_FRAG, $(P_V6)ip6t_frag))
|
||||
$(eval $(call nf_add,IPT_IPV6_EXTRA,CONFIG_IP6_NF_MATCH_RT, $(P_V6)ip6t_rt))
|
||||
|
||||
# log
|
||||
|
||||
$(eval $(call nf_add,NF_LOG,CONFIG_NF_LOG_COMMON, $(P_XT)nf_log_common, lt 5.13))
|
||||
$(eval $(call nf_add,NF_LOG,CONFIG_NF_LOG_IPV4, $(P_V4)nf_log_ipv4, lt 5.13))
|
||||
$(eval $(call nf_add,NF_LOG,CONFIG_NF_LOG_SYSLOG, $(P_XT)nf_log_syslog, ge 5.13))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NF_LOG6,CONFIG_NF_LOG_IPV6, $(P_V6)nf_log_ipv6,lt 5.13),))
|
||||
|
||||
# nat
|
||||
|
||||
# kernel only
|
||||
@@ -183,7 +188,7 @@ $(eval $(if $(NF_KMOD),$(call nf_add,IPT_NAT6,CONFIG_IP6_NF_NAT, $(P_V6)ip6table
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,IPT_NAT6,CONFIG_IP6_NF_TARGET_NPT, $(P_V6)ip6t_NPT),))
|
||||
|
||||
# userland only
|
||||
$(eval $(if $(NF_KMOD),,$(call nf_add,IPT_NAT,CONFIG_NF_NAT, ipt_NAT)))
|
||||
$(eval $(if $(NF_KMOD),,$(call nf_add,IPT_NAT,CONFIG_NF_NAT, ipt_SNAT ipt_DNAT)))
|
||||
$(eval $(if $(NF_KMOD),,$(call nf_add,IPT_NAT6,CONFIG_IP6_NF_TARGET_NPT, ip6t_DNPT ip6t_SNPT)))
|
||||
|
||||
$(eval $(call nf_add,IPT_NAT,CONFIG_NETFILTER_XT_TARGET_MASQUERADE, $(P_XT)xt_MASQUERADE))
|
||||
@@ -204,8 +209,6 @@ $(eval $(call nf_add,NF_NATHELPER,CONFIG_NF_NAT_FTP, $(P_XT)nf_nat_ftp))
|
||||
# nathelper-extra
|
||||
|
||||
$(eval $(call nf_add,NF_NATHELPER_EXTRA,CONFIG_NF_CONNTRACK_BROADCAST, $(P_XT)nf_conntrack_broadcast))
|
||||
$(eval $(call nf_add,NF_NATHELPER_EXTRA,CONFIG_NF_CONNTRACK_NETBIOS_NS, $(P_XT)nf_conntrack_netbios_ns))
|
||||
$(eval $(call nf_add,NF_NATHELPER_EXTRA,CONFIG_NF_CONNTRACK_SANE, $(P_XT)nf_conntrack_sane))
|
||||
$(eval $(call nf_add,NF_NATHELPER_EXTRA,CONFIG_NF_CONNTRACK_AMANDA, $(P_XT)nf_conntrack_amanda))
|
||||
$(eval $(call nf_add,NF_NATHELPER_EXTRA,CONFIG_NF_NAT_AMANDA, $(P_XT)nf_nat_amanda))
|
||||
$(eval $(call nf_add,NF_NATHELPER_EXTRA,CONFIG_NF_CONNTRACK_H323, $(P_XT)nf_conntrack_h323))
|
||||
@@ -222,6 +225,11 @@ $(eval $(call nf_add,NF_NATHELPER_EXTRA,CONFIG_NF_CONNTRACK_IRC, $(P_XT)nf_connt
|
||||
$(eval $(call nf_add,NF_NATHELPER_EXTRA,CONFIG_NF_NAT_IRC, $(P_XT)nf_nat_irc))
|
||||
|
||||
|
||||
# ulog
|
||||
|
||||
$(eval $(call nf_add,IPT_ULOG,CONFIG_IP_NF_TARGET_ULOG, $(P_V4)ipt_ULOG))
|
||||
|
||||
|
||||
# nflog
|
||||
|
||||
$(eval $(call nf_add,IPT_NFLOG,CONFIG_NETFILTER_XT_TARGET_NFLOG, $(P_XT)xt_NFLOG))
|
||||
@@ -236,15 +244,14 @@ $(eval $(call nf_add,IPT_NFQUEUE,CONFIG_NETFILTER_XT_TARGET_NFQUEUE, $(P_XT)xt_N
|
||||
|
||||
$(eval $(call nf_add,IPT_DEBUG,CONFIG_NETFILTER_XT_TARGET_TRACE, $(P_XT)xt_TRACE))
|
||||
|
||||
# socket
|
||||
$(eval $(call nf_add,NF_SOCKET,CONFIG_NF_SOCKET_IPV4, $(P_V4)nf_socket_ipv4))
|
||||
$(eval $(call nf_add,NF_SOCKET,CONFIG_NF_SOCKET_IPV6, $(P_V6)nf_socket_ipv6))
|
||||
$(eval $(call nf_add,IPT_SOCKET,CONFIG_NETFILTER_XT_MATCH_SOCKET, $(P_XT)xt_socket))
|
||||
|
||||
# tproxy
|
||||
$(eval $(call nf_add,NF_TPROXY,CONFIG_NF_TPROXY_IPV4, $(P_V4)nf_tproxy_ipv4))
|
||||
$(eval $(call nf_add,NF_TPROXY,CONFIG_NF_TPROXY_IPV6, $(P_V6)nf_tproxy_ipv6))
|
||||
|
||||
$(eval $(call nf_add,IPT_TPROXY,CONFIG_NETFILTER_XT_MATCH_SOCKET, $(P_XT)xt_socket))
|
||||
$(eval $(call nf_add,IPT_TPROXY,CONFIG_NF_SOCKET_IPV4, $(P_V4)nf_socket_ipv4))
|
||||
$(eval $(call nf_add,IPT_TPROXY,CONFIG_NF_SOCKET_IPV6, $(P_V6)nf_socket_ipv6))
|
||||
$(eval $(call nf_add,IPT_TPROXY,CONFIG_NETFILTER_XT_TARGET_TPROXY, $(P_XT)xt_TPROXY))
|
||||
$(eval $(call nf_add,IPT_TPROXY,CONFIG_NF_TPROXY_IPV4, $(P_V4)nf_tproxy_ipv4))
|
||||
$(eval $(call nf_add,IPT_TPROXY,CONFIG_NF_TPROXY_IPV6, $(P_V6)nf_tproxy_ipv6))
|
||||
|
||||
# led
|
||||
$(eval $(call nf_add,IPT_LED,CONFIG_NETFILTER_XT_TARGET_LED, $(P_XT)xt_LED))
|
||||
@@ -252,6 +259,8 @@ $(eval $(call nf_add,IPT_LED,CONFIG_NETFILTER_XT_TARGET_LED, $(P_XT)xt_LED))
|
||||
# tee
|
||||
|
||||
$(eval $(call nf_add,IPT_TEE,CONFIG_NETFILTER_XT_TARGET_TEE, $(P_XT)xt_TEE))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,IPT_TEE,CONFIG_NF_DUP_IPV4, $(P_V4)nf_dup_ipv4),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,IPT_TEE,CONFIG_NF_DUP_IPV6, $(P_V6)nf_dup_ipv6),))
|
||||
|
||||
# u32
|
||||
|
||||
@@ -274,10 +283,6 @@ $(eval $(call nf_add,NFNETLINK_LOG,CONFIG_NETFILTER_NETLINK_LOG, $(P_XT)nfnetlin
|
||||
|
||||
$(eval $(call nf_add,NFNETLINK_QUEUE,CONFIG_NETFILTER_NETLINK_QUEUE, $(P_XT)nfnetlink_queue))
|
||||
|
||||
# conncount
|
||||
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NF_CONNCOUNT,CONFIG_NETFILTER_CONNCOUNT, $(P_XT)nf_conncount),))
|
||||
|
||||
#
|
||||
# ebtables
|
||||
#
|
||||
@@ -310,6 +315,7 @@ $(eval $(call nf_add,EBTABLES_IP4,CONFIG_BRIDGE_EBT_SNAT, $(P_EBT)ebt_snat))
|
||||
|
||||
# watchers
|
||||
$(eval $(call nf_add,EBTABLES_WATCHERS,CONFIG_BRIDGE_EBT_LOG, $(P_EBT)ebt_log))
|
||||
$(eval $(call nf_add,EBTABLES_WATCHERS,CONFIG_BRIDGE_EBT_ULOG, $(P_EBT)ebt_ulog))
|
||||
$(eval $(call nf_add,EBTABLES_WATCHERS,CONFIG_BRIDGE_EBT_NFLOG, $(P_EBT)ebt_nflog))
|
||||
$(eval $(call nf_add,EBTABLES_WATCHERS,CONFIG_BRIDGE_EBT_NFQUEUE, $(P_EBT)ebt_nfqueue))
|
||||
|
||||
@@ -331,11 +337,15 @@ $(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NFT_REJECT_INET, $(P_XT)nft
|
||||
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_BRIDGE,CONFIG_NFT_BRIDGE_META, $(P_EBT)nft_meta_bridge),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_BRIDGE,CONFIG_NFT_BRIDGE_REJECT, $(P_EBT)nft_reject_bridge),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_BRIDGE,CONFIG_NF_CONNTRACK_BRIDGE, $(P_EBT)nf_conntrack_bridge),))
|
||||
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_NAT,CONFIG_NFT_NAT, $(P_XT)nft_nat),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_NAT,CONFIG_NFT_NAT, $(P_XT)nft_chain_nat),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_NAT,CONFIG_NFT_REDIR_IPV4, $(P_V4)nft_redir_ipv4),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_NAT,CONFIG_NFT_MASQ, $(P_XT)nft_masq),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_NAT,CONFIG_NFT_MASQ_IPV4, $(P_V4)nft_masq_ipv4),))
|
||||
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_NAT6,CONFIG_NFT_REDIR_IPV6, $(P_V6)nft_redir_ipv6),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_NAT6,CONFIG_NFT_MASQ_IPV6, $(P_V6)nft_masq_ipv6),))
|
||||
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_FIB,CONFIG_NFT_FIB, $(P_XT)nft_fib),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_FIB,CONFIG_NFT_FIB_INET, $(P_XT)nft_fib_inet),))
|
||||
@@ -344,16 +354,6 @@ $(eval $(if $(NF_KMOD),$(call nf_add,NFT_FIB,CONFIG_NFT_FIB_IPV6, $(P_V6)nft_fib
|
||||
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_QUEUE,CONFIG_NFT_QUEUE, $(P_XT)nft_queue),))
|
||||
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_SOCKET,CONFIG_NFT_SOCKET, $(P_XT)nft_socket),))
|
||||
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_TPROXY,CONFIG_NFT_TPROXY, $(P_XT)nft_tproxy),))
|
||||
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_COMPAT,CONFIG_NFT_COMPAT, $(P_XT)nft_compat),))
|
||||
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_XFRM,CONFIG_NFT_XFRM, $(P_XT)nft_xfrm),))
|
||||
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_CONNLIMIT,CONFIG_NFT_CONNLIMIT, $(P_XT)nft_connlimit),))
|
||||
|
||||
# userland only
|
||||
IPT_BUILTIN += $(NF_IPT-y) $(NF_IPT-m)
|
||||
IPT_BUILTIN += $(IPT_CORE-y) $(IPT_CORE-m)
|
||||
@@ -368,6 +368,7 @@ IPT_BUILTIN += $(IPT_FLOW-y) $(IPT_FLOW-m)
|
||||
IPT_BUILTIN += $(IPT_IPOPT-y)
|
||||
IPT_BUILTIN += $(IPT_IPRANGE-y)
|
||||
IPT_BUILTIN += $(IPT_CLUSTER-y)
|
||||
IPT_BUILTIN += $(IPT_CLUSTERIP-y)
|
||||
IPT_BUILTIN += $(IPT_IPSEC-y)
|
||||
IPT_BUILTIN += $(IPT_IPV6-y) $(IPT_IPV6-m)
|
||||
IPT_BUILTIN += $(NF_NAT-y)
|
||||
@@ -377,6 +378,7 @@ IPT_BUILTIN += $(IPT_NAT6-y)
|
||||
IPT_BUILTIN += $(IPT_NAT_EXTRA-y)
|
||||
IPT_BUILTIN += $(NF_NATHELPER-y)
|
||||
IPT_BUILTIN += $(NF_NATHELPER_EXTRA-y)
|
||||
IPT_BUILTIN += $(IPT_ULOG-y)
|
||||
IPT_BUILTIN += $(IPT_TPROXY-y)
|
||||
IPT_BUILTIN += $(NFNETLINK-y)
|
||||
IPT_BUILTIN += $(NFNETLINK_LOG-y)
|
||||
|
||||
@@ -10,38 +10,27 @@ ifeq ($(CONFIG_BUILD_NLS),y)
|
||||
INTL_PREFIX:=$(STAGING_DIR)/usr/lib/libintl-full
|
||||
INTL_FULL:=1
|
||||
|
||||
CMAKE_OPTIONS += -DCMAKE_PREFIX_PATH="$(ICONV_PREFIX);$(INTL_PREFIX)"
|
||||
# iconv stub
|
||||
else
|
||||
ICONV_PREFIX:=
|
||||
ICONV_PREFIX:=$(STAGING_DIR)/usr/lib/libiconv-stub
|
||||
ICONV_FULL:=
|
||||
|
||||
INTL_PREFIX:=
|
||||
INTL_PREFIX:=$(STAGING_DIR)/usr/lib/libintl-stub
|
||||
INTL_FULL:=
|
||||
endif
|
||||
|
||||
PKG_CONFIG_DEPENDS += CONFIG_BUILD_NLS
|
||||
PKG_BUILD_DEPENDS += !BUILD_NLS:libiconv !BUILD_NLS:gettext
|
||||
|
||||
ICONV_DEPENDS:=+BUILD_NLS:libiconv-full
|
||||
ifeq ($(CONFIG_BUILD_NLS),y)
|
||||
ICONV_CFLAGS:=-I$(ICONV_PREFIX)/include
|
||||
ICONV_CPPFLAGS:=-I$(ICONV_PREFIX)/include
|
||||
ICONV_LDFLAGS:=-L$(ICONV_PREFIX)/lib -Wl,-rpath-link=$(ICONV_PREFIX)/lib
|
||||
else
|
||||
ICONV_CFLAGS:=
|
||||
ICONV_CPPFLAGS:=
|
||||
ICONV_LDFLAGS:=
|
||||
endif
|
||||
ICONV_CFLAGS:=-I$(ICONV_PREFIX)/include
|
||||
ICONV_CPPFLAGS:=-I$(ICONV_PREFIX)/include
|
||||
ICONV_LDFLAGS:=-L$(ICONV_PREFIX)/lib -Wl,-rpath-link=$(ICONV_PREFIX)/lib
|
||||
|
||||
INTL_DEPENDS:=+BUILD_NLS:libintl-full
|
||||
ifeq ($(CONFIG_BUILD_NLS),y)
|
||||
INTL_CFLAGS:=-I$(INTL_PREFIX)/include
|
||||
INTL_CPPFLAGS:=-I$(INTL_PREFIX)/include
|
||||
INTL_LDFLAGS:=-L$(INTL_PREFIX)/lib -Wl,-rpath-link=$(INTL_PREFIX)/lib
|
||||
else
|
||||
INTL_CFLAGS:=
|
||||
INTL_CPPFLAGS:=
|
||||
INTL_LDFLAGS:=
|
||||
endif
|
||||
INTL_CFLAGS:=-I$(INTL_PREFIX)/include
|
||||
INTL_CPPFLAGS:=-I$(INTL_PREFIX)/include
|
||||
INTL_LDFLAGS:=-L$(INTL_PREFIX)/lib -Wl,-rpath-link=$(INTL_PREFIX)/lib
|
||||
|
||||
TARGET_CFLAGS += $(ICONV_CFLAGS) $(INTL_CFLAGS)
|
||||
TARGET_CPPFLAGS += $(ICONV_CPPFLAGS) $(INTL_CPPFLAGS)
|
||||
|
||||
@@ -1,79 +0,0 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
#
|
||||
# Copyright (C) 2022-2023 Enéas Ulir de Queiroz
|
||||
|
||||
ENGINES_DIR=engines-3
|
||||
|
||||
define Package/openssl/module/Default
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
SUBMENU:=SSL
|
||||
DEPENDS:=libopenssl +libopenssl-conf
|
||||
endef
|
||||
|
||||
define Package/openssl/engine/Default
|
||||
$(Package/openssl/module/Default)
|
||||
DEPENDS+=@OPENSSL_ENGINE
|
||||
endef
|
||||
|
||||
|
||||
# 1 = moudule type (engine|provider)
|
||||
# 2 = module name
|
||||
# 3 = directory to save .so file
|
||||
# 4 = [ package name, defaults to libopenssl-$(2) ]
|
||||
define Package/openssl/add-module
|
||||
$(eval MOD_TYPE:=$(1))
|
||||
$(eval MOD_NAME:=$(2))
|
||||
$(eval MOD_DIR:=$(3))
|
||||
$(eval OSSL_PKG:=$(if $(4),$(4),libopenssl-$(MOD_NAME)))
|
||||
$(info Package/openssl/add-module 1='$(1)'; 2='$(2)'; 3='$(3)' 4='$(4)')
|
||||
$(info MOD_TYPE='$(MOD_TYPE)'; MOD_NAME='$(MOD_NAME)'; MOD_DIR='$(MOD_DIR)' OSSL_PKG='$(OSSL_PKG)')
|
||||
Package/$(OSSL_PKG)/conffiles:=/etc/ssl/modules.cnf.d/$(MOD_NAME).cnf
|
||||
|
||||
define Package/$(OSSL_PKG)/install
|
||||
$$(INSTALL_DIR) $$(1)/$(MOD_DIR)
|
||||
$$(INSTALL_BIN) $$(PKG_INSTALL_DIR)/$(MOD_DIR)/$(MOD_NAME).so \
|
||||
$$(1)/$(MOD_DIR)
|
||||
$$(INSTALL_DIR) $$(1)/etc/ssl/modules.cnf.d
|
||||
$$(INSTALL_DATA) ./files/$(MOD_NAME).cnf $$(1)/etc/ssl/modules.cnf.d/
|
||||
endef
|
||||
|
||||
define Package/$(OSSL_PKG)/postinst
|
||||
#!/bin/sh
|
||||
OPENSSL_UCI="$$$${IPKG_INSTROOT}/etc/config/openssl"
|
||||
|
||||
[ -z "$$$${IPKG_INSTROOT}" ] \
|
||||
&& uci -q get openssl.$(MOD_NAME) >/dev/null \
|
||||
&& exit 0
|
||||
|
||||
cat << EOF >> "$$$${OPENSSL_UCI}"
|
||||
|
||||
config $(MOD_TYPE) '$(MOD_NAME)'
|
||||
option enabled '1'
|
||||
EOF
|
||||
|
||||
[ -n "$$$${IPKG_INSTROOT}" ] || /etc/init.d/openssl reload
|
||||
exit 0
|
||||
endef
|
||||
|
||||
define Package/$(OSSL_PKG)/postrm
|
||||
#!/bin/sh
|
||||
[ -n "$$$${IPKG_INSTROOT}" ] && exit 0
|
||||
uci -q delete openssl.$(MOD_NAME) && uci commit openssl
|
||||
/etc/init.d/openssl reload
|
||||
exit 0
|
||||
endef
|
||||
endef
|
||||
|
||||
# 1 = engine name
|
||||
# 2 - package name, defaults to libopenssl-$(1)
|
||||
define Package/openssl/add-engine
|
||||
$(call Package/openssl/add-module,engine,$(1),/usr/lib/$(ENGINES_DIR),$(2))
|
||||
endef
|
||||
|
||||
# 1 = provider name
|
||||
# 2 = [ package name, defaults to libopenssl-$(1) ]
|
||||
define Package/openssl/add-provider
|
||||
$(call Package/openssl/add-module,provider,$(1),/usr/lib/ossl-modules,$(2))
|
||||
endef
|
||||
|
||||
@@ -1,113 +0,0 @@
|
||||
include $(INCLUDE_DIR)/prereq.mk
|
||||
|
||||
PKG_NAME ?= optee-os
|
||||
|
||||
ifndef PKG_SOURCE_PROTO
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL_FILE:=$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL = https://github.com/OP-TEE/optee_os/archive/refs/tags/
|
||||
TAR_OPTIONS+= --transform 's/optee_os/$(PKG_NAME)/'
|
||||
endif
|
||||
|
||||
PKG_BUILD_DIR = $(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_TARGETS := bin
|
||||
PKG_FLAGS:=nonshared
|
||||
|
||||
PKG_LICENSE:=BSD 2-Clause
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
PKG_BUILD_PARALLEL ?= 1
|
||||
|
||||
$(eval $(call TestHostCommand,python3-cryptography, \
|
||||
Please install the Python3 cryptography module, \
|
||||
$(STAGING_DIR_HOST)/bin/python3 -c 'import cryptography'))
|
||||
|
||||
$(eval $(call TestHostCommand,python3-pyelftools, \
|
||||
Please install the Python3 pyelftools module, \
|
||||
$(STAGING_DIR_HOST)/bin/python3 -c 'import elftools'))
|
||||
|
||||
export GCC_HONOUR_COPTS=s
|
||||
|
||||
define Package/optee-os/install/default
|
||||
$(CP) $(patsubst %,$(PKG_BUILD_DIR)/out/arm-plat-$(PLAT)/core/%,$(OPTEE_IMAGE)) $(1)/
|
||||
endef
|
||||
|
||||
Package/optee-os/install = $(Package/optee-os/install/default)
|
||||
|
||||
define Optee-os/Init
|
||||
BUILD_TARGET:=
|
||||
BUILD_SUBTARGET:=
|
||||
BUILD_DEVICES:=
|
||||
NAME:=
|
||||
DEPENDS:=
|
||||
HIDDEN:=
|
||||
DEFAULT:=
|
||||
VARIANT:=$(1)
|
||||
PLAT:=$(1)
|
||||
PLAT_FLAVOR:=
|
||||
OPTEE_IMAGE:=tee-header_v2.bin tee-pager_v2.bin tee-pageable_v2.bin
|
||||
endef
|
||||
|
||||
TARGET_DEP = TARGET_$(BUILD_TARGET)$(if $(BUILD_SUBTARGET),_$(BUILD_SUBTARGET))
|
||||
|
||||
define Build/Optee-os/Target
|
||||
$(eval $(call Optee-os/Init,$(1)))
|
||||
$(eval $(call Optee-os/Default,$(1)))
|
||||
$(eval $(call Optee-os/$(1),$(1)))
|
||||
|
||||
define Package/optee-os-$(1)
|
||||
SECTION:=boot
|
||||
CATEGORY:=Boot Loaders
|
||||
TITLE:=OPTEE-OS for $(NAME)
|
||||
VARIANT:=$(VARIANT)
|
||||
DEPENDS:=@!IN_SDK $(DEPENDS)
|
||||
HIDDEN:=$(HIDDEN)
|
||||
ifneq ($(BUILD_TARGET),)
|
||||
DEPENDS += @$(TARGET_DEP)
|
||||
ifneq ($(BUILD_DEVICES),)
|
||||
DEFAULT := y if ($(TARGET_DEP)_Default \
|
||||
$(patsubst %,|| $(TARGET_DEP)_DEVICE_%,$(BUILD_DEVICES)) \
|
||||
$(patsubst %,|| $(patsubst TARGET_%,TARGET_DEVICE_%,$(TARGET_DEP))_DEVICE_%,$(BUILD_DEVICES)))
|
||||
endif
|
||||
endif
|
||||
$(if $(DEFAULT),DEFAULT:=$(DEFAULT))
|
||||
URL:=https://optee.readthedocs.io
|
||||
endef
|
||||
|
||||
define Package/optee-os-$(1)/install
|
||||
$$(Package/optee-os/install)
|
||||
endef
|
||||
endef
|
||||
|
||||
define Build/Configure/Optee-os
|
||||
endef
|
||||
|
||||
define Build/Compile/Optee-os
|
||||
+$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
|
||||
PATH=$(LINUX_DIR)/scripts/dtc/:$(PATH) \
|
||||
CROSS_COMPILE=$(TARGET_CROSS) \
|
||||
CROSS_COMPILE_core="$(TARGET_CROSS)" \
|
||||
CROSS_COMPILE_ta_arm64="$(TARGET_CROSS)" \
|
||||
CROSS_COMPILE_ta_arm32="$(TARGET_CROSS)" \
|
||||
$(if $(CONFIG_ARCH_64BIT), CFG_ARM64_core=y CFG_USER_TA_TARGETS=ta_arm64, CFG_ARM32_core=y) \
|
||||
PLATFORM="$(PLAT)" \
|
||||
PLATFORM_FLAVOR="$(call qstrip,$(PLAT_FLAVOR))" \
|
||||
$(OPTEE_MAKE_FLAGS)
|
||||
endef
|
||||
|
||||
define BuildPackage/Optee-os/Defaults
|
||||
Build/Configure/Default = $$$$(Build/Configure/Optee-os)
|
||||
Build/Compile/Default = $$$$(Build/Compile/Optee-os)
|
||||
endef
|
||||
|
||||
define BuildPackage/Optee-os
|
||||
$(eval $(call BuildPackage/Optee-os/Defaults))
|
||||
$(foreach type,$(if $(DUMP),$(OPTEE_TARGETS),$(BUILD_VARIANT)), \
|
||||
$(eval $(call Build/Optee-os/Target,$(type)))
|
||||
)
|
||||
$(eval $(call Build/DefaultTargets))
|
||||
$(foreach type,$(if $(DUMP),$(OPTEE_TARGETS),$(BUILD_VARIANT)), \
|
||||
$(call BuildPackage,optee-os-$(type))
|
||||
)
|
||||
endef
|
||||
@@ -4,8 +4,7 @@
|
||||
|
||||
ifeq ($(DUMP),)
|
||||
define BuildTarget/bin
|
||||
TARGET_VARIANT=$(if $(ALL_VARIANTS),$(if $(VARIANT),$(filter-out *,$(VARIANT)),$(firstword $(ALL_VARIANTS))))
|
||||
ifeq ($(if $(TARGET_VARIANT),$(BUILD_VARIANT)),$(TARGET_VARIANT))
|
||||
ifeq ($(if $(VARIANT),$(BUILD_VARIANT)),$(VARIANT))
|
||||
ifdef Package/$(1)/install
|
||||
ifneq ($(CONFIG_PACKAGE_$(1))$(DEVELOPER),)
|
||||
$(_pkg_target)compile: $(PKG_BUILD_DIR)/.pkgdir/$(1).installed
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# Copyright (C) 2006-2020 OpenWrt.org
|
||||
|
||||
PKG_DEFAULT_DEPENDS = +libc
|
||||
PKG_DEFAULT_DEPENDS = +libc +USE_GLIBC:librt +USE_GLIBC:libpthread
|
||||
|
||||
ifneq ($(PKG_NAME),toolchain)
|
||||
PKG_FIXUP_DEPENDS = $(if $(filter kmod-%,$(1)),$(2),$(PKG_DEFAULT_DEPENDS) $(filter-out $(PKG_DEFAULT_DEPENDS),$(2)))
|
||||
@@ -20,10 +20,10 @@ define Package/Default
|
||||
PROVIDES:=
|
||||
EXTRA_DEPENDS:=
|
||||
MAINTAINER:=$(PKG_MAINTAINER)
|
||||
SOURCE:=$(patsubst $(TOPDIR)/%,%,$(patsubst $(TOPDIR)/package/%,feeds/base/%,$(CURDIR)))
|
||||
SOURCE:=$(patsubst $(TOPDIR)/%,%,$(CURDIR))
|
||||
ifneq ($(PKG_VERSION),)
|
||||
ifneq ($(PKG_RELEASE),)
|
||||
VERSION:=$(PKG_VERSION)-r$(PKG_RELEASE)
|
||||
VERSION:=$(PKG_VERSION)-$(PKG_RELEASE)
|
||||
else
|
||||
VERSION:=$(PKG_VERSION)
|
||||
endif
|
||||
@@ -49,7 +49,7 @@ define Package/Default
|
||||
KCONFIG:=
|
||||
BUILDONLY:=
|
||||
HIDDEN:=
|
||||
URL:=$(PKG_URL)
|
||||
URL:=
|
||||
VARIANT:=
|
||||
DEFAULT_VARIANT:=
|
||||
USERID:=
|
||||
@@ -80,7 +80,6 @@ CONFIGURE_ARGS = \
|
||||
--target=$(GNU_TARGET_NAME) \
|
||||
--host=$(GNU_TARGET_NAME) \
|
||||
--build=$(GNU_HOST_NAME) \
|
||||
--disable-dependency-tracking \
|
||||
--program-prefix="" \
|
||||
--program-suffix="" \
|
||||
--prefix=$(CONFIGURE_PREFIX) \
|
||||
@@ -151,7 +150,6 @@ define Build/Install/Default
|
||||
$(MAKE_VARS) \
|
||||
$(MAKE) -C $(PKG_BUILD_DIR)/$(MAKE_PATH) \
|
||||
$(MAKE_INSTALL_FLAGS) \
|
||||
$(if $(PKG_SUBDIRS),SUBDIRS='$$$$(wildcard $(PKG_SUBDIRS))') \
|
||||
$(if $(1), $(1), install);
|
||||
endef
|
||||
|
||||
|
||||
@@ -36,14 +36,13 @@ $(if $(USERID),Require-User: $(USERID)
|
||||
)Source: $(PKG_SOURCE)
|
||||
$(if $(LICENSE),License: $(LICENSE)
|
||||
)$(if $(LICENSE_FILES),LicenseFiles: $(LICENSE_FILES)
|
||||
)$(if $(PKG_CPE_ID),CPE-ID: $(PKG_CPE_ID)
|
||||
)$(if $(URL),URL: $(URL)
|
||||
)$(if $(ABI_VERSION),ABI-Version: $(ABI_VERSION)
|
||||
)Type: $(if $(Package/$(1)/targets),$(Package/$(1)/targets),$(if $(PKG_TARGETS),$(PKG_TARGETS),ipkg))
|
||||
$(if $(KCONFIG),Kernel-Config: $(KCONFIG)
|
||||
)$(if $(BUILDONLY),Build-Only: $(BUILDONLY)
|
||||
)$(if $(HIDDEN),Hidden: $(HIDDEN)
|
||||
)Description: $(if $(Package/$(1)/description),$(Package/$(1)/description),$(TITLE))
|
||||
$(if $(URL),$(URL)
|
||||
)$(MAINTAINER)
|
||||
@@
|
||||
$(if $(Package/$(1)/config),Config:
|
||||
$(Package/$(1)/config)
|
||||
|
||||
275
include/package-ipkg.mk
Normal file
275
include/package-ipkg.mk
Normal file
@@ -0,0 +1,275 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
#
|
||||
# Copyright (C) 2006-2020 OpenWrt.org
|
||||
|
||||
ifndef DUMP
|
||||
include $(INCLUDE_DIR)/feeds.mk
|
||||
endif
|
||||
|
||||
IPKG_REMOVE:= \
|
||||
$(SCRIPT_DIR)/ipkg-remove
|
||||
|
||||
IPKG_STATE_DIR:=$(TARGET_DIR)/usr/lib/opkg
|
||||
|
||||
# Generates a make statement to return a wildcard for candidate ipkg files
|
||||
# 1: package name
|
||||
define gen_ipkg_wildcard
|
||||
$(1)$$(if $$(filter -%,$$(ABIV_$(1))),,[^a-z-])*
|
||||
endef
|
||||
|
||||
# 1: package name
|
||||
# 2: candidate ipk files
|
||||
define remove_ipkg_files
|
||||
$(if $(strip $(2)),$(IPKG_REMOVE) $(1) $(2))
|
||||
endef
|
||||
|
||||
# 1: package name
|
||||
# 2: variable name
|
||||
# 3: variable suffix
|
||||
# 4: file is a script
|
||||
define BuildIPKGVariable
|
||||
ifdef Package/$(1)/$(2)
|
||||
$$(IPKG_$(1)) : VAR_$(2)$(3)=$$(Package/$(1)/$(2))
|
||||
$(call shexport,Package/$(1)/$(2))
|
||||
$(1)_COMMANDS += echo "$$$$$$$$$(call shvar,Package/$(1)/$(2))" > $(2)$(3); $(if $(4),chmod 0755 $(2)$(3);)
|
||||
endif
|
||||
endef
|
||||
|
||||
PARENL :=(
|
||||
PARENR :=)
|
||||
|
||||
dep_split=$(subst :,$(space),$(1))
|
||||
dep_rem=$(subst !,,$(subst $(strip $(PARENL)),,$(subst $(strip $(PARENR)),,$(word 1,$(call dep_split,$(1))))))
|
||||
dep_and=dep_and_res:=$$(and $(subst $(space),$(comma),$(foreach cond,$(subst &&, ,$(1)),$$(CONFIG_$(cond)))))
|
||||
dep_confvar=$(strip $(foreach cond,$(subst ||, ,$(call dep_rem,$(1))),$(eval $(call dep_and,$(cond)))$(dep_and_res)))
|
||||
dep_pos=$(if $(call dep_confvar,$(1)),$(call dep_val,$(1)))
|
||||
dep_neg=$(if $(call dep_confvar,$(1)),,$(call dep_val,$(1)))
|
||||
dep_if=$(if $(findstring !,$(1)),$(call dep_neg,$(1)),$(call dep_pos,$(1)))
|
||||
dep_val=$(word 2,$(call dep_split,$(1)))
|
||||
strip_deps=$(strip $(subst +,,$(filter-out @%,$(1))))
|
||||
filter_deps=$(foreach dep,$(call strip_deps,$(1)),$(if $(findstring :,$(dep)),$(call dep_if,$(dep)),$(dep)))
|
||||
|
||||
define AddDependency
|
||||
$$(if $(1),$$(if $(2),$$(foreach pkg,$(1),$$(IPKG_$$(pkg))): $$(foreach pkg,$(2),$$(IPKG_$$(pkg)))))
|
||||
endef
|
||||
|
||||
define FixupReverseDependencies
|
||||
DEPS := $$(filter %:$(1),$$(IDEPEND))
|
||||
DEPS := $$(patsubst %:$(1),%,$$(DEPS))
|
||||
DEPS := $$(filter $$(DEPS),$$(IPKGS))
|
||||
$(call AddDependency,$$(DEPS),$(1))
|
||||
endef
|
||||
|
||||
define FixupDependencies
|
||||
DEPS := $$(filter $(1):%,$$(IDEPEND))
|
||||
DEPS := $$(patsubst $(1):%,%,$$(DEPS))
|
||||
DEPS := $$(filter $$(DEPS),$$(IPKGS))
|
||||
$(call AddDependency,$(1),$$(DEPS))
|
||||
endef
|
||||
|
||||
ifneq ($(PKG_NAME),toolchain)
|
||||
define CheckDependencies
|
||||
@( \
|
||||
rm -f $(PKG_INFO_DIR)/$(1).missing; \
|
||||
( \
|
||||
export \
|
||||
READELF=$(TARGET_CROSS)readelf \
|
||||
OBJCOPY=$(TARGET_CROSS)objcopy \
|
||||
XARGS="$(XARGS)"; \
|
||||
$(SCRIPT_DIR)/gen-dependencies.sh "$$(IDIR_$(1))"; \
|
||||
) | while read FILE; do \
|
||||
grep -qxF "$$$$FILE" $(PKG_INFO_DIR)/$(1).provides || \
|
||||
echo "$$$$FILE" >> $(PKG_INFO_DIR)/$(1).missing; \
|
||||
done; \
|
||||
if [ -f "$(PKG_INFO_DIR)/$(1).missing" ]; then \
|
||||
echo "Package $(1) is missing dependencies for the following libraries:" >&2; \
|
||||
cat "$(PKG_INFO_DIR)/$(1).missing" >&2; \
|
||||
false; \
|
||||
fi; \
|
||||
)
|
||||
endef
|
||||
endif
|
||||
|
||||
_addsep=$(word 1,$(1))$(foreach w,$(wordlist 2,$(words $(1)),$(1)),$(strip $(2) $(w)))
|
||||
_cleansep=$(subst $(space)$(2)$(space),$(2)$(space),$(1))
|
||||
mergelist=$(call _cleansep,$(call _addsep,$(1),$(comma)),$(comma))
|
||||
addfield=$(if $(strip $(2)),$(1): $(2))
|
||||
_define=define
|
||||
_endef=endef
|
||||
|
||||
ifeq ($(DUMP),)
|
||||
define BuildTarget/ipkg
|
||||
ABIV_$(1):=$(if $(filter-out kmod-%,$(1)),$(ABI_VERSION))
|
||||
PDIR_$(1):=$(call FeedPackageDir,$(1))
|
||||
IPKG_$(1):=$$(PDIR_$(1))/$(1)$$(ABIV_$(1))_$(VERSION)_$(PKGARCH).ipk
|
||||
IDIR_$(1):=$(PKG_BUILD_DIR)/ipkg-$(PKGARCH)/$(1)
|
||||
KEEP_$(1):=$(strip $(call Package/$(1)/conffiles))
|
||||
|
||||
ifeq ($(BUILD_VARIANT),$$(if $$(VARIANT),$$(VARIANT),$(BUILD_VARIANT)))
|
||||
do_install=
|
||||
ifdef Package/$(1)/install
|
||||
do_install=yes
|
||||
endif
|
||||
ifdef Package/$(1)/install-overlay
|
||||
do_install=yes
|
||||
endif
|
||||
ifdef do_install
|
||||
ifneq ($(CONFIG_PACKAGE_$(1))$(DEVELOPER),)
|
||||
IPKGS += $(1)
|
||||
$(_pkg_target)compile: $$(IPKG_$(1)) $(PKG_INFO_DIR)/$(1).provides $(PKG_BUILD_DIR)/.pkgdir/$(1).installed
|
||||
prepare-package-install: $$(IPKG_$(1))
|
||||
compile: $(STAGING_DIR_ROOT)/stamp/.$(1)_installed
|
||||
else
|
||||
$(if $(CONFIG_PACKAGE_$(1)),$$(info WARNING: skipping $(1) -- package not selected))
|
||||
endif
|
||||
|
||||
.PHONY: $(PKG_INSTALL_STAMP).$(1)
|
||||
ifeq ($(CONFIG_PACKAGE_$(1)),y)
|
||||
compile: $(PKG_INSTALL_STAMP).$(1)
|
||||
endif
|
||||
$(PKG_INSTALL_STAMP).$(1): prepare-package-install
|
||||
echo "$(1)" >> $(PKG_INSTALL_STAMP)
|
||||
else
|
||||
$(if $(CONFIG_PACKAGE_$(1)),$$(warning WARNING: skipping $(1) -- package has no install section))
|
||||
endif
|
||||
endif
|
||||
|
||||
DEPENDS:=$(call PKG_FIXUP_DEPENDS,$(1),$(DEPENDS))
|
||||
IDEPEND_$(1):=$$(call filter_deps,$$(DEPENDS))
|
||||
IDEPEND += $$(patsubst %,$(1):%,$$(IDEPEND_$(1)))
|
||||
$(FixupDependencies)
|
||||
$(FixupReverseDependencies)
|
||||
|
||||
$(eval $(call BuildIPKGVariable,$(1),conffiles))
|
||||
$(eval $(call BuildIPKGVariable,$(1),preinst,,1))
|
||||
$(eval $(call BuildIPKGVariable,$(1),postinst,-pkg,1))
|
||||
$(eval $(call BuildIPKGVariable,$(1),prerm,-pkg,1))
|
||||
$(eval $(call BuildIPKGVariable,$(1),postrm,,1))
|
||||
|
||||
$(PKG_BUILD_DIR)/.pkgdir/$(1).installed : export PATH=$$(TARGET_PATH_PKG)
|
||||
$(PKG_BUILD_DIR)/.pkgdir/$(1).installed: $(STAMP_BUILT)
|
||||
rm -rf $$@ $(PKG_BUILD_DIR)/.pkgdir/$(1)
|
||||
mkdir -p $(PKG_BUILD_DIR)/.pkgdir/$(1)
|
||||
$(call Package/$(1)/install,$(PKG_BUILD_DIR)/.pkgdir/$(1))
|
||||
$(call Package/$(1)/install_lib,$(PKG_BUILD_DIR)/.pkgdir/$(1))
|
||||
touch $$@
|
||||
|
||||
$(STAGING_DIR_ROOT)/stamp/.$(1)_installed: $(PKG_BUILD_DIR)/.pkgdir/$(1).installed
|
||||
mkdir -p $(STAGING_DIR_ROOT)/stamp
|
||||
$(if $(ABI_VERSION),echo '$(ABI_VERSION)' | cmp -s - $(PKG_INFO_DIR)/$(1).version || { \
|
||||
echo '$(ABI_VERSION)' > $(PKG_INFO_DIR)/$(1).version; \
|
||||
$(foreach pkg,$(filter-out $(1),$(PROVIDES)), \
|
||||
cp $(PKG_INFO_DIR)/$(1).version $(PKG_INFO_DIR)/$(pkg).version; \
|
||||
) \
|
||||
} )
|
||||
$(call locked,$(CP) $(PKG_BUILD_DIR)/.pkgdir/$(1)/. $(STAGING_DIR_ROOT)/,root-copy)
|
||||
touch $$@
|
||||
|
||||
Package/$(1)/DEPENDS := $$(call mergelist,$$(foreach dep,$$(filter-out @%,$$(IDEPEND_$(1))),$$(dep)$$(call GetABISuffix,$$(dep))))
|
||||
ifneq ($$(EXTRA_DEPENDS),)
|
||||
Package/$(1)/DEPENDS := $$(EXTRA_DEPENDS)$$(if $$(Package/$(1)/DEPENDS),$$(comma) $$(Package/$(1)/DEPENDS))
|
||||
endif
|
||||
|
||||
$(_define) Package/$(1)/CONTROL
|
||||
Package: $(1)$$(ABIV_$(1))
|
||||
Version: $(VERSION)
|
||||
$$(call addfield,Depends,$$(Package/$(1)/DEPENDS)
|
||||
)$$(call addfield,Conflicts,$$(call mergelist,$(CONFLICTS))
|
||||
)$$(call addfield,Provides,$$(call mergelist,$$(filter-out $(1)$$(ABIV_$(1)),$(PROVIDES)$$(if $$(ABIV_$(1)), $(1) $(foreach provide,$(PROVIDES),$(provide)$$(ABIV_$(1))))))
|
||||
)$$(call addfield,Alternatives,$$(call mergelist,$(ALTERNATIVES))
|
||||
)$$(call addfield,Source,$(SOURCE)
|
||||
)$$(call addfield,SourceName,$(1)
|
||||
)$$(call addfield,License,$(LICENSE)
|
||||
)$$(call addfield,LicenseFiles,$(LICENSE_FILES)
|
||||
)$$(call addfield,Section,$(SECTION)
|
||||
)$$(call addfield,Require-User,$(USERID)
|
||||
)$$(call addfield,SourceDateEpoch,$(PKG_SOURCE_DATE_EPOCH)
|
||||
)$$(if $$(ABIV_$(1)),ABIVersion: $$(ABIV_$(1))
|
||||
)$(if $(PKG_CPE_ID),CPE-ID: $(PKG_CPE_ID)
|
||||
)$(if $(filter hold,$(PKG_FLAGS)),Status: unknown hold not-installed
|
||||
)$(if $(filter essential,$(PKG_FLAGS)),Essential: yes
|
||||
)$(if $(MAINTAINER),Maintainer: $(MAINTAINER)
|
||||
)Architecture: $(PKGARCH)
|
||||
Installed-Size: 0
|
||||
$(_endef)
|
||||
|
||||
$$(IPKG_$(1)) : export CONTROL=$$(Package/$(1)/CONTROL)
|
||||
$$(IPKG_$(1)) : export DESCRIPTION=$$(Package/$(1)/description)
|
||||
$$(IPKG_$(1)) : export PATH=$$(TARGET_PATH_PKG)
|
||||
$$(IPKG_$(1)) : export PKG_SOURCE_DATE_EPOCH:=$(PKG_SOURCE_DATE_EPOCH)
|
||||
$(PKG_INFO_DIR)/$(1).provides $$(IPKG_$(1)): $(STAMP_BUILT) $(INCLUDE_DIR)/package-ipkg.mk
|
||||
@rm -rf $$(IDIR_$(1)); \
|
||||
$$(call remove_ipkg_files,$(1),$$(call opkg_package_files,$(call gen_ipkg_wildcard,$(1))))
|
||||
mkdir -p $(PACKAGE_DIR) $$(IDIR_$(1))/CONTROL $(PKG_INFO_DIR)
|
||||
$(call Package/$(1)/install,$$(IDIR_$(1)))
|
||||
$(if $(Package/$(1)/install-overlay),mkdir -p $(PACKAGE_DIR) $$(IDIR_$(1))/rootfs-overlay)
|
||||
$(call Package/$(1)/install-overlay,$$(IDIR_$(1))/rootfs-overlay)
|
||||
-find $$(IDIR_$(1)) -name 'CVS' -o -name '.svn' -o -name '.#*' -o -name '*~'| $(XARGS) rm -rf
|
||||
@( \
|
||||
find $$(IDIR_$(1)) -name lib\*.so\* -or -name \*.ko | awk -F/ '{ print $$$$NF }'; \
|
||||
for file in $$(patsubst %,$(PKG_INFO_DIR)/%.provides,$$(IDEPEND_$(1))); do \
|
||||
if [ -f "$$$$file" ]; then \
|
||||
cat $$$$file; \
|
||||
fi; \
|
||||
done; $(Package/$(1)/extra_provides) \
|
||||
) | sort -u > $(PKG_INFO_DIR)/$(1).provides
|
||||
$(if $(PROVIDES),@for pkg in $(filter-out $(1),$(PROVIDES)); do cp $(PKG_INFO_DIR)/$(1).provides $(PKG_INFO_DIR)/$$$$pkg.provides; done)
|
||||
$(CheckDependencies)
|
||||
|
||||
$(RSTRIP) $$(IDIR_$(1))
|
||||
|
||||
ifneq ($$(CONFIG_IPK_FILES_CHECKSUMS),)
|
||||
(cd $$(IDIR_$(1)); \
|
||||
( \
|
||||
find . -type f \! -path ./CONTROL/\* -exec mkhash sha256 -n \{\} \; 2> /dev/null | \
|
||||
sed 's|\([[:blank:]]\)\./| \1/|' > $$(IDIR_$(1))/CONTROL/files-sha256sum \
|
||||
) || true \
|
||||
)
|
||||
endif
|
||||
(cd $$(IDIR_$(1))/CONTROL; \
|
||||
( \
|
||||
echo "$$$$CONTROL"; \
|
||||
printf "Description: "; echo "$$$$DESCRIPTION" | sed -e 's,^[[:space:]]*, ,g'; \
|
||||
) > control; \
|
||||
chmod 644 control; \
|
||||
( \
|
||||
echo "#!/bin/sh"; \
|
||||
echo "[ \"\$$$${IPKG_NO_SCRIPT}\" = \"1\" ] && exit 0"; \
|
||||
echo "[ -s "\$$$${IPKG_INSTROOT}/lib/functions.sh" ] || exit 0"; \
|
||||
echo ". \$$$${IPKG_INSTROOT}/lib/functions.sh"; \
|
||||
echo "default_postinst \$$$$0 \$$$$@"; \
|
||||
) > postinst; \
|
||||
( \
|
||||
echo "#!/bin/sh"; \
|
||||
echo "[ -s "\$$$${IPKG_INSTROOT}/lib/functions.sh" ] || exit 0"; \
|
||||
echo ". \$$$${IPKG_INSTROOT}/lib/functions.sh"; \
|
||||
echo "default_prerm \$$$$0 \$$$$@"; \
|
||||
) > prerm; \
|
||||
chmod 0755 postinst prerm; \
|
||||
$($(1)_COMMANDS) \
|
||||
)
|
||||
|
||||
ifneq ($$(KEEP_$(1)),)
|
||||
@( \
|
||||
keepfiles=""; \
|
||||
for x in $$(KEEP_$(1)); do \
|
||||
[ -f "$$(IDIR_$(1))/$$$$x" ] || keepfiles="$$$${keepfiles:+$$$$keepfiles }$$$$x"; \
|
||||
done; \
|
||||
[ -z "$$$$keepfiles" ] || { \
|
||||
mkdir -p $$(IDIR_$(1))/lib/upgrade/keep.d; \
|
||||
for x in $$$$keepfiles; do echo $$$$x >> $$(IDIR_$(1))/lib/upgrade/keep.d/$(1); done; \
|
||||
}; \
|
||||
)
|
||||
endif
|
||||
|
||||
$(INSTALL_DIR) $$(PDIR_$(1))
|
||||
$(FAKEROOT) $(SCRIPT_DIR)/ipkg-build -m "$(FILE_MODES)" $$(IDIR_$(1)) $$(PDIR_$(1))
|
||||
@[ -f $$(IPKG_$(1)) ]
|
||||
|
||||
$(1)-clean:
|
||||
$$(call remove_ipkg_files,$(1),$$(call opkg_package_files,$(call gen_ipkg_wildcard,$(1))))
|
||||
|
||||
clean: $(1)-clean
|
||||
|
||||
endef
|
||||
endif
|
||||
@@ -1,380 +0,0 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
#
|
||||
# Copyright (C) 2006-2022 OpenWrt.org
|
||||
|
||||
ifndef DUMP
|
||||
include $(INCLUDE_DIR)/feeds.mk
|
||||
endif
|
||||
|
||||
IPKG_STATE_DIR:=$(TARGET_DIR)/usr/lib/opkg
|
||||
|
||||
# Generates a make statement to return a wildcard for candidate ipkg files
|
||||
# 1: package name
|
||||
define gen_package_wildcard
|
||||
$(1)$$(if $$(filter -%,$$(ABIV_$(1))),,[^a-z-])*
|
||||
endef
|
||||
|
||||
# 1: package name
|
||||
# 2: candidate ipk files
|
||||
define remove_ipkg_files
|
||||
$(if $(strip $(2)),$(SCRIPT_DIR)/ipkg-remove $(1) $(2))
|
||||
endef
|
||||
|
||||
# 1: package name
|
||||
# 2: variable name
|
||||
# 3: variable suffix
|
||||
# 4: file is a script
|
||||
define BuildPackVariable
|
||||
ifdef Package/$(1)/$(2)
|
||||
$$(PACK_$(1)) : VAR_$(2)$(3)=$$(Package/$(1)/$(2))
|
||||
$(call shexport,Package/$(1)/$(2))
|
||||
$(1)_COMMANDS += echo "$$$$$$$$$(call shvar,Package/$(1)/$(2))" > $(2)$(3); $(if $(4),chmod 0755 $(2)$(3);)
|
||||
endif
|
||||
endef
|
||||
|
||||
PARENL :=(
|
||||
PARENR :=)
|
||||
|
||||
dep_split=$(subst :,$(space),$(1))
|
||||
dep_rem=$(subst !,,$(subst $(strip $(PARENL)),,$(subst $(strip $(PARENR)),,$(word 1,$(call dep_split,$(1))))))
|
||||
dep_and=dep_and_res:=$$(and $(subst $(space),$(comma),$(foreach cond,$(subst &&, ,$(1)),$$(CONFIG_$(cond)))))
|
||||
dep_confvar=$(strip $(foreach cond,$(subst ||, ,$(call dep_rem,$(1))),$(eval $(call dep_and,$(cond)))$(dep_and_res)))
|
||||
dep_pos=$(if $(call dep_confvar,$(1)),$(call dep_val,$(1)))
|
||||
dep_neg=$(if $(call dep_confvar,$(1)),,$(call dep_val,$(1)))
|
||||
dep_if=$(if $(findstring !,$(1)),$(call dep_neg,$(1)),$(call dep_pos,$(1)))
|
||||
dep_val=$(word 2,$(call dep_split,$(1)))
|
||||
strip_deps=$(strip $(subst +,,$(filter-out @%,$(1))))
|
||||
filter_deps=$(foreach dep,$(call strip_deps,$(1)),$(if $(findstring :,$(dep)),$(call dep_if,$(dep)),$(dep)))
|
||||
|
||||
define AddDependency
|
||||
$$(if $(1),$$(if $(2),$$(foreach pkg,$(1),$$(PACK_$$(pkg))): $$(foreach pkg,$(2),$$(PACK_$$(pkg)))))
|
||||
endef
|
||||
|
||||
define FixupReverseDependencies
|
||||
DEPS := $$(filter %:$(1),$$(IDEPEND))
|
||||
DEPS := $$(patsubst %:$(1),%,$$(DEPS))
|
||||
DEPS := $$(filter $$(DEPS),$$(IPKGS))
|
||||
$(call AddDependency,$$(DEPS),$(1))
|
||||
endef
|
||||
|
||||
define FixupDependencies
|
||||
DEPS := $$(filter $(1):%,$$(IDEPEND))
|
||||
DEPS := $$(patsubst $(1):%,%,$$(DEPS))
|
||||
DEPS := $$(filter $$(DEPS),$$(IPKGS))
|
||||
$(call AddDependency,$(1),$$(DEPS))
|
||||
endef
|
||||
|
||||
ifneq ($(PKG_NAME),toolchain)
|
||||
define CheckDependencies
|
||||
@( \
|
||||
rm -f $(PKG_INFO_DIR)/$(1).missing; \
|
||||
( \
|
||||
export \
|
||||
READELF=$(TARGET_CROSS)readelf \
|
||||
OBJCOPY=$(TARGET_CROSS)objcopy \
|
||||
XARGS="$(XARGS)"; \
|
||||
$(SCRIPT_DIR)/gen-dependencies.sh "$$(IDIR_$(1))"; \
|
||||
) | while read FILE; do \
|
||||
grep -qxF "$$$$FILE" $(PKG_INFO_DIR)/$(1).provides || \
|
||||
echo "$$$$FILE" >> $(PKG_INFO_DIR)/$(1).missing; \
|
||||
done; \
|
||||
if [ -f "$(PKG_INFO_DIR)/$(1).missing" ]; then \
|
||||
echo "Package $(1) is missing dependencies for the following libraries:" >&2; \
|
||||
cat "$(PKG_INFO_DIR)/$(1).missing" >&2; \
|
||||
false; \
|
||||
fi; \
|
||||
)
|
||||
endef
|
||||
endif
|
||||
|
||||
_addsep=$(word 1,$(1))$(foreach w,$(wordlist 2,$(words $(1)),$(1)),$(strip $(2) $(w)))
|
||||
_cleansep=$(subst $(space)$(2)$(space),$(2)$(space),$(1))
|
||||
mergelist=$(call _cleansep,$(call _addsep,$(1),$(comma)),$(comma))
|
||||
addfield=$(if $(strip $(2)),$(1): $(2))
|
||||
_define=define
|
||||
_endef=endef
|
||||
|
||||
ifeq ($(DUMP),)
|
||||
define BuildTarget/ipkg
|
||||
ABIV_$(1):=$(call FormatABISuffix,$(1),$(ABI_VERSION))
|
||||
PDIR_$(1):=$(call FeedPackageDir,$(1))
|
||||
ifeq ($(CONFIG_USE_APK),)
|
||||
PACK_$(1):=$$(PDIR_$(1))/$(1)$$(ABIV_$(1))_$(VERSION)_$(PKGARCH).ipk
|
||||
else
|
||||
PACK_$(1):=$$(PDIR_$(1))/$(1)$$(ABIV_$(1))-$(VERSION).apk
|
||||
endif
|
||||
IDIR_$(1):=$(PKG_BUILD_DIR)/ipkg-$(PKGARCH)/$(1)
|
||||
ADIR_$(1):=$(PKG_BUILD_DIR)/apk-$(PKGARCH)/$(1)
|
||||
KEEP_$(1):=$(strip $(call Package/$(1)/conffiles))
|
||||
|
||||
TARGET_VARIANT:=$$(if $(ALL_VARIANTS),$$(if $$(VARIANT),$$(filter-out *,$$(VARIANT)),$(firstword $(ALL_VARIANTS))))
|
||||
ifeq ($(BUILD_VARIANT),$$(if $$(TARGET_VARIANT),$$(TARGET_VARIANT),$(BUILD_VARIANT)))
|
||||
do_install=
|
||||
ifdef Package/$(1)/install
|
||||
do_install=yes
|
||||
endif
|
||||
ifdef Package/$(1)/install-overlay
|
||||
do_install=yes
|
||||
endif
|
||||
ifdef do_install
|
||||
ifneq ($(CONFIG_PACKAGE_$(1))$(DEVELOPER),)
|
||||
IPKGS += $(1)
|
||||
$(_pkg_target)compile: $$(PACK_$(1)) $(PKG_INFO_DIR)/$(1).provides $(PKG_BUILD_DIR)/.pkgdir/$(1).installed
|
||||
prepare-package-install: $$(PACK_$(1))
|
||||
compile: $(STAGING_DIR_ROOT)/stamp/.$(1)_installed
|
||||
else
|
||||
$(if $(CONFIG_PACKAGE_$(1)),$$(info WARNING: skipping $(1) -- package not selected))
|
||||
endif
|
||||
|
||||
.PHONY: $(PKG_INSTALL_STAMP).$(1)
|
||||
ifeq ($(CONFIG_PACKAGE_$(1)),y)
|
||||
compile: $(PKG_INSTALL_STAMP).$(1)
|
||||
endif
|
||||
$(PKG_INSTALL_STAMP).$(1): prepare-package-install
|
||||
echo "$(1)" >> $(PKG_INSTALL_STAMP)
|
||||
else
|
||||
$(if $(CONFIG_PACKAGE_$(1)),$$(warning WARNING: skipping $(1) -- package has no install section))
|
||||
endif
|
||||
endif
|
||||
|
||||
DEPENDS:=$(call PKG_FIXUP_DEPENDS,$(1),$(DEPENDS))
|
||||
IDEPEND_$(1):=$$(call filter_deps,$$(DEPENDS))
|
||||
IDEPEND += $$(patsubst %,$(1):%,$$(IDEPEND_$(1)))
|
||||
$(FixupDependencies)
|
||||
$(FixupReverseDependencies)
|
||||
|
||||
$(eval $(call BuildPackVariable,$(1),conffiles))
|
||||
$(eval $(call BuildPackVariable,$(1),preinst,,1))
|
||||
$(eval $(call BuildPackVariable,$(1),postinst,-pkg,1))
|
||||
$(eval $(call BuildPackVariable,$(1),prerm,-pkg,1))
|
||||
$(eval $(call BuildPackVariable,$(1),postrm,,1))
|
||||
|
||||
$(PKG_BUILD_DIR)/.pkgdir/$(1).installed : export PATH=$$(TARGET_PATH_PKG)
|
||||
$(PKG_BUILD_DIR)/.pkgdir/$(1).installed: $(STAMP_BUILT)
|
||||
rm -rf $$@ $(PKG_BUILD_DIR)/.pkgdir/$(1)
|
||||
mkdir -p $(PKG_BUILD_DIR)/.pkgdir/$(1)
|
||||
$(call Package/$(1)/install,$(PKG_BUILD_DIR)/.pkgdir/$(1))
|
||||
$(call Package/$(1)/install_lib,$(PKG_BUILD_DIR)/.pkgdir/$(1))
|
||||
touch $$@
|
||||
|
||||
$(STAGING_DIR_ROOT)/stamp/.$(1)_installed: $(PKG_BUILD_DIR)/.pkgdir/$(1).installed
|
||||
mkdir -p $(STAGING_DIR_ROOT)/stamp
|
||||
$(if $(ABI_VERSION),echo '$(ABI_VERSION)' | cmp -s - $(PKG_INFO_DIR)/$(1).version || { \
|
||||
echo '$(ABI_VERSION)' > $(PKG_INFO_DIR)/$(1).version; \
|
||||
$(foreach pkg,$(filter-out $(1),$(PROVIDES)), \
|
||||
cp $(PKG_INFO_DIR)/$(1).version $(PKG_INFO_DIR)/$(pkg).version; \
|
||||
) \
|
||||
} )
|
||||
$(call locked,$(CP) $(PKG_BUILD_DIR)/.pkgdir/$(1)/. $(STAGING_DIR_ROOT)/,root-copy)
|
||||
touch $$@
|
||||
|
||||
Package/$(1)/DEPENDS := $$(call mergelist,$$(foreach dep,$$(filter-out @%,$$(IDEPEND_$(1))),$$(dep)$$(call GetABISuffix,$$(dep))))
|
||||
ifneq ($$(EXTRA_DEPENDS),)
|
||||
Package/$(1)/DEPENDS := $$(EXTRA_DEPENDS)$$(if $$(Package/$(1)/DEPENDS),$$(comma) $$(Package/$(1)/DEPENDS))
|
||||
endif
|
||||
|
||||
$(_define) Package/$(1)/CONTROL
|
||||
Package: $(1)$$(ABIV_$(1))
|
||||
Version: $(VERSION)
|
||||
$$(call addfield,Depends,$$(Package/$(1)/DEPENDS)
|
||||
)$$(call addfield,Conflicts,$$(call mergelist,$(CONFLICTS))
|
||||
)$$(call addfield,Provides,$$(call mergelist,$$(filter-out $(1)$$(ABIV_$(1)),$(PROVIDES)$$(if $$(ABIV_$(1)), $(1) $(foreach provide,$(PROVIDES),$(provide)$$(ABIV_$(1))))))
|
||||
)$$(call addfield,Alternatives,$$(call mergelist,$(ALTERNATIVES))
|
||||
)$$(call addfield,Source,$(SOURCE)
|
||||
)$$(call addfield,SourceName,$(PKG_NAME)
|
||||
)$$(call addfield,License,$(LICENSE)
|
||||
)$$(call addfield,LicenseFiles,$(LICENSE_FILES)
|
||||
)$$(call addfield,Section,$(SECTION)
|
||||
)$$(call addfield,Require-User,$(USERID)
|
||||
)$$(call addfield,SourceDateEpoch,$(PKG_SOURCE_DATE_EPOCH)
|
||||
)$$(call addfield,URL,$(URL)
|
||||
)$$(if $$(ABIV_$(1)),ABIVersion: $$(ABIV_$(1))
|
||||
)$(if $(PKG_CPE_ID),CPE-ID: $(PKG_CPE_ID)
|
||||
)$(if $(filter hold,$(PKG_FLAGS)),Status: unknown hold not-installed
|
||||
)$(if $(filter essential,$(PKG_FLAGS)),Essential: yes
|
||||
)$(if $(MAINTAINER),Maintainer: $(MAINTAINER)
|
||||
)Architecture: $(PKGARCH)
|
||||
Installed-Size: 0
|
||||
$(_endef)
|
||||
|
||||
$$(PACK_$(1)) : export CONTROL=$$(Package/$(1)/CONTROL)
|
||||
$$(PACK_$(1)) : export DESCRIPTION=$$(Package/$(1)/description)
|
||||
$$(PACK_$(1)) : export PATH=$$(TARGET_PATH_PKG)
|
||||
$$(PACK_$(1)) : export PKG_SOURCE_DATE_EPOCH:=$(PKG_SOURCE_DATE_EPOCH)
|
||||
$(PKG_INFO_DIR)/$(1).provides $$(PACK_$(1)): $(STAMP_BUILT) $(INCLUDE_DIR)/package-pack.mk
|
||||
rm -rf $$(IDIR_$(1))
|
||||
ifeq ($$(CONFIG_USE_APK),)
|
||||
$$(call remove_ipkg_files,$(1),$$(call opkg_package_files,$(call gen_package_wildcard,$(1))))
|
||||
else
|
||||
$$(call remove_ipkg_files,$(1),$$(call apk_package_files,$(call gen_package_wildcard,$(1))))
|
||||
endif
|
||||
mkdir -p $(PACKAGE_DIR) $$(IDIR_$(1)) $(PKG_INFO_DIR)
|
||||
$(call Package/$(1)/install,$$(IDIR_$(1)))
|
||||
$(if $(Package/$(1)/install-overlay),mkdir -p $(PACKAGE_DIR) $$(IDIR_$(1))/rootfs-overlay)
|
||||
$(call Package/$(1)/install-overlay,$$(IDIR_$(1))/rootfs-overlay)
|
||||
-find $$(IDIR_$(1)) -name 'CVS' -o -name '.svn' -o -name '.#*' -o -name '*~'| $(XARGS) rm -rf
|
||||
@( \
|
||||
find $$(IDIR_$(1)) -name lib\*.so\* -or -name \*.ko | awk -F/ '{ print $$$$NF }'; \
|
||||
for file in $$(patsubst %,$(PKG_INFO_DIR)/%.provides,$$(IDEPEND_$(1))); do \
|
||||
if [ -f "$$$$file" ]; then \
|
||||
cat $$$$file; \
|
||||
fi; \
|
||||
done; $(Package/$(1)/extra_provides) \
|
||||
) | sort -u > $(PKG_INFO_DIR)/$(1).provides
|
||||
$(if $(PROVIDES),@for pkg in $(filter-out $(1),$(PROVIDES)); do cp $(PKG_INFO_DIR)/$(1).provides $(PKG_INFO_DIR)/$$$$pkg.provides; done)
|
||||
$(CheckDependencies)
|
||||
|
||||
$(RSTRIP) $$(IDIR_$(1))
|
||||
|
||||
ifneq ($$(CONFIG_IPK_FILES_CHECKSUMS),)
|
||||
(cd $$(IDIR_$(1)); \
|
||||
( \
|
||||
find . -type f \! -path ./CONTROL/\* -exec $(MKHASH) sha256 -n \{\} \; 2> /dev/null | \
|
||||
sed 's|\([[:blank:]]\)\./| \1/|' > $$(IDIR_$(1))/CONTROL/files-sha256sum \
|
||||
) || true \
|
||||
)
|
||||
endif
|
||||
|
||||
ifneq ($$(KEEP_$(1)),)
|
||||
@( \
|
||||
keepfiles=""; \
|
||||
for x in $$(KEEP_$(1)); do \
|
||||
[ -f "$$(IDIR_$(1))/$$$$x" ] || keepfiles="$$$${keepfiles:+$$$$keepfiles }$$$$x"; \
|
||||
done; \
|
||||
[ -z "$$$$keepfiles" ] || { \
|
||||
mkdir -p $$(IDIR_$(1))/lib/upgrade/keep.d; \
|
||||
for x in $$$$keepfiles; do echo $$$$x >> $$(IDIR_$(1))/lib/upgrade/keep.d/$(1); done; \
|
||||
}; \
|
||||
)
|
||||
endif
|
||||
|
||||
$(INSTALL_DIR) $$(PDIR_$(1))/tmp
|
||||
|
||||
ifeq ($(CONFIG_USE_APK),)
|
||||
mkdir -p $$(IDIR_$(1))/CONTROL
|
||||
(cd $$(IDIR_$(1))/CONTROL; \
|
||||
( \
|
||||
echo "$$$$CONTROL"; \
|
||||
printf "Description: "; echo "$$$$DESCRIPTION" | sed -e 's,^[[:space:]]*, ,g'; \
|
||||
) > control; \
|
||||
chmod 644 control; \
|
||||
( \
|
||||
echo "#!/bin/sh"; \
|
||||
echo "[ \"\$$$${IPKG_NO_SCRIPT}\" = \"1\" ] && exit 0"; \
|
||||
echo "[ -s "\$$$${IPKG_INSTROOT}/lib/functions.sh" ] || exit 0"; \
|
||||
echo ". \$$$${IPKG_INSTROOT}/lib/functions.sh"; \
|
||||
echo "default_postinst \$$$$0 \$$$$@"; \
|
||||
) > postinst; \
|
||||
( \
|
||||
echo "#!/bin/sh"; \
|
||||
echo "[ -s "\$$$${IPKG_INSTROOT}/lib/functions.sh" ] || exit 0"; \
|
||||
echo ". \$$$${IPKG_INSTROOT}/lib/functions.sh"; \
|
||||
echo "default_prerm \$$$$0 \$$$$@"; \
|
||||
) > prerm; \
|
||||
chmod 0755 postinst prerm; \
|
||||
$($(1)_COMMANDS) \
|
||||
)
|
||||
|
||||
$(FAKEROOT) $(STAGING_DIR_HOST)/bin/bash $(SCRIPT_DIR)/ipkg-build -m "$(FILE_MODES)" $$(IDIR_$(1)) $$(PDIR_$(1))
|
||||
else
|
||||
mkdir -p $$(ADIR_$(1))/
|
||||
mkdir -p $$(IDIR_$(1))/lib/apk/packages/
|
||||
|
||||
(cd $$(ADIR_$(1)); $($(1)_COMMANDS))
|
||||
|
||||
( \
|
||||
echo "#!/bin/sh"; \
|
||||
echo "[ \"\$$$${IPKG_NO_SCRIPT}\" = \"1\" ] && exit 0"; \
|
||||
echo "[ -s "\$$$${IPKG_INSTROOT}/lib/functions.sh" ] || exit 0"; \
|
||||
echo ". \$$$${IPKG_INSTROOT}/lib/functions.sh"; \
|
||||
echo 'export root="$$$${IPKG_INSTROOT}"'; \
|
||||
echo 'export pkgname="$(1)"'; \
|
||||
echo "add_group_and_user"; \
|
||||
[ ! -f $$(ADIR_$(1))/postinst-pkg ] || cat "$$(ADIR_$(1))/postinst-pkg"; \
|
||||
echo "default_postinst"; \
|
||||
) > $$(ADIR_$(1))/post-install;
|
||||
|
||||
( \
|
||||
echo "#!/bin/sh"; \
|
||||
echo "[ -s "\$$$${IPKG_INSTROOT}/lib/functions.sh" ] || exit 0"; \
|
||||
echo ". \$$$${IPKG_INSTROOT}/lib/functions.sh"; \
|
||||
echo 'export root="$$$${IPKG_INSTROOT}"'; \
|
||||
echo 'export pkgname="$(1)"'; \
|
||||
[ ! -f $$(ADIR_$(1))/prerm-pkg ] || cat "$$(ADIR_$(1))/prerm-pkg"; \
|
||||
echo "default_prerm"; \
|
||||
) > $$(ADIR_$(1))/pre-deinstall;
|
||||
|
||||
if [ -n "$(USERID)" ]; then echo $(USERID) > $$(IDIR_$(1))/lib/apk/packages/$(1).rusers; fi;
|
||||
if [ -n "$(ALTERNATIVES)" ]; then echo $(ALTERNATIVES) > $$(IDIR_$(1))/lib/apk/packages/$(1).alternatives; fi;
|
||||
(cd $$(IDIR_$(1)) && find . -type f,l -printf "/%P\n" > $$(IDIR_$(1))/lib/apk/packages/$(1).list)
|
||||
# Move conffiles to IDIR and build conffiles_static with csums
|
||||
if [ -f $$(ADIR_$(1))/conffiles ]; then \
|
||||
mv -f $$(ADIR_$(1))/conffiles $$(IDIR_$(1))/lib/apk/packages/$(1).conffiles; \
|
||||
for file in $$$$(cat $$(IDIR_$(1))/lib/apk/packages/$(1).conffiles); do \
|
||||
[ -f $$(IDIR_$(1))/$$$$file ] || continue; \
|
||||
csum=$$$$($(MKHASH) sha256 $$(IDIR_$(1))/$$$$file); \
|
||||
echo $$$$file $$$$csum >> $$(IDIR_$(1))/lib/apk/packages/$(1).conffiles_static; \
|
||||
done; \
|
||||
fi
|
||||
|
||||
# Some package (base-files) manually append stuff to conffiles
|
||||
# Append stuff from it and delete the CONTROL directory since everything else should be migrated
|
||||
if [ -f $$(IDIR_$(1))/CONTROL/conffiles ]; then \
|
||||
echo $$$$(IDIR_$(1))/CONTROL/conffiles >> $$(IDIR_$(1))/lib/apk/packages/$(1).conffiles; \
|
||||
for file in $$$$(cat $$(IDIR_$(1))/CONTROL/conffiles); do \
|
||||
[ -f $$(IDIR_$(1))/$$$$file ] || continue; \
|
||||
csum=$$$$($(MKHASH) sha256 $$(IDIR_$(1))/$$$$file); \
|
||||
echo $$$$file $$$$csum >> $$(IDIR_$(1))/lib/apk/packages/$(1).conffiles_static; \
|
||||
done; \
|
||||
rm -rf $$(IDIR_$(1))/CONTROL/conffiles; \
|
||||
fi
|
||||
|
||||
if [ -z "$$$$(ls -A $$(IDIR_$(1))/CONTROL 2>/dev/null)" ]; then \
|
||||
rm -rf $$(IDIR_$(1))/CONTROL; \
|
||||
else \
|
||||
echo "CONTROL directory $$(IDIR_$(1))/CONTROL is not empty! This is not right and should be checked!" >&2; \
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
$(FAKEROOT) $(STAGING_DIR_HOST)/bin/apk mkpkg \
|
||||
--info "name:$(1)$$(ABIV_$(1))" \
|
||||
--info "version:$(VERSION)" \
|
||||
--info "description:$$(strip $$(Package/$(1)/description))" \
|
||||
--info "arch:$(PKGARCH)" \
|
||||
--info "license:$(LICENSE)" \
|
||||
--info "origin:$(SOURCE)" \
|
||||
--info "url:$(URL)" \
|
||||
--info "maintainer:$(MAINTAINER)" \
|
||||
--info "provides:$$(foreach prov,\
|
||||
$$(filter-out $(1)$$(ABIV_$(1)), \
|
||||
$(PROVIDES)$$(if $$(ABIV_$(1)), \
|
||||
$(1)=$(VERSION) $(foreach provide, \
|
||||
$(PROVIDES), \
|
||||
$(provide)$$(ABIV_$(1))=$(VERSION) \
|
||||
) \
|
||||
) \
|
||||
), \
|
||||
$$(prov) )" \
|
||||
$(if $(DEFAULT_VARIANT),--info "provider-priority:100") \
|
||||
--script "post-install:$$(ADIR_$(1))/post-install" \
|
||||
--script "pre-deinstall:$$(ADIR_$(1))/pre-deinstall" \
|
||||
--info "depends:$$(foreach depends,$$(subst $$(comma),$$(space),$$(subst $$(space),,$$(subst $$(paren_right),,$$(subst $$(paren_left),,$$(Package/$(1)/DEPENDS))))),$$(depends))" \
|
||||
--files "$$(IDIR_$(1))" \
|
||||
--output "$$(PACK_$(1))" \
|
||||
--sign "$(BUILD_KEY_APK_SEC)"
|
||||
endif
|
||||
|
||||
@[ -f $$(PACK_$(1)) ]
|
||||
|
||||
$(1)-clean:
|
||||
ifeq ($(CONFIG_USE_APK),)
|
||||
$$(call remove_ipkg_files,$(1),$$(call opkg_package_files,$(call gen_package_wildcard,$(1))))
|
||||
else
|
||||
$$(call remove_ipkg_files,$(1),$$(call apk_package_files,$(call gen_package_wildcard,$(1))))
|
||||
endif
|
||||
|
||||
|
||||
clean: $(1)-clean
|
||||
|
||||
endef
|
||||
endif
|
||||
@@ -11,7 +11,8 @@ include $(INCLUDE_DIR)/download.mk
|
||||
PKG_BUILD_DIR ?= $(BUILD_DIR)/$(if $(BUILD_VARIANT),$(PKG_NAME)-$(BUILD_VARIANT)/)$(PKG_NAME)$(if $(PKG_VERSION),-$(PKG_VERSION))
|
||||
PKG_INSTALL_DIR ?= $(PKG_BUILD_DIR)/ipkg-install
|
||||
PKG_BUILD_PARALLEL ?=
|
||||
PKG_SKIP_DOWNLOAD=$(USE_SOURCE_DIR)$(USE_GIT_TREE)$(USE_GIT_SRC_CHECKOUT)
|
||||
PKG_USE_MIPS16 ?= 1
|
||||
PKG_IREMAP ?= 1
|
||||
|
||||
MAKE_J:=$(if $(MAKE_JOBSERVER),$(MAKE_JOBSERVER) $(if $(filter 3.% 4.0 4.1,$(MAKE_VERSION)),-j))
|
||||
|
||||
@@ -22,43 +23,15 @@ PKG_JOBS?=-j1
|
||||
else
|
||||
PKG_JOBS?=$(if $(PKG_BUILD_PARALLEL),$(MAKE_J),-j1)
|
||||
endif
|
||||
|
||||
PKG_BUILD_FLAGS?=
|
||||
__unknown_flags=$(filter-out no-iremap no-mips16 gc-sections no-gc-sections lto no-lto no-mold,$(PKG_BUILD_FLAGS))
|
||||
ifneq ($(__unknown_flags),)
|
||||
$(error unknown PKG_BUILD_FLAGS: $(__unknown_flags))
|
||||
endif
|
||||
|
||||
# $1=flagname, $2=default (0/1)
|
||||
define pkg_build_flag
|
||||
$(if $(filter no-$(1),$(PKG_BUILD_FLAGS)),0,$(if $(filter $(1),$(PKG_BUILD_FLAGS)),1,$(2)))
|
||||
endef
|
||||
|
||||
ifeq ($(call pkg_build_flag,iremap,1),1)
|
||||
IREMAP_CFLAGS = $(call iremap,$(PKG_BUILD_DIR),$(notdir $(PKG_BUILD_DIR)))
|
||||
TARGET_CFLAGS += $(IREMAP_CFLAGS)
|
||||
endif
|
||||
ifdef CONFIG_USE_MIPS16
|
||||
ifeq ($(call pkg_build_flag,mips16,1),1)
|
||||
ifeq ($(strip $(PKG_USE_MIPS16)),1)
|
||||
TARGET_ASFLAGS_DEFAULT = $(filter-out -mips16 -minterlink-mips16,$(TARGET_CFLAGS))
|
||||
TARGET_CFLAGS += -mips16 -minterlink-mips16
|
||||
TARGET_CXXFLAGS += -mips16 -minterlink-mips16
|
||||
endif
|
||||
endif
|
||||
ifeq ($(call pkg_build_flag,gc-sections,$(if $(CONFIG_USE_GC_SECTIONS),1,0)),1)
|
||||
TARGET_CFLAGS+= -ffunction-sections -fdata-sections
|
||||
TARGET_CXXFLAGS+= -ffunction-sections -fdata-sections
|
||||
TARGET_LDFLAGS+= -Wl,--gc-sections
|
||||
endif
|
||||
ifeq ($(call pkg_build_flag,lto,$(if $(CONFIG_USE_LTO),1,0)),1)
|
||||
TARGET_CFLAGS+= -flto=auto -fno-fat-lto-objects
|
||||
TARGET_CXXFLAGS+= -flto=auto -fno-fat-lto-objects
|
||||
TARGET_LDFLAGS+= -flto=auto -fuse-linker-plugin
|
||||
endif
|
||||
ifdef CONFIG_USE_MOLD
|
||||
ifeq ($(call pkg_build_flag,mold,1),1)
|
||||
TARGET_LINKER:=mold
|
||||
endif
|
||||
ifeq ($(strip $(PKG_IREMAP)),1)
|
||||
IREMAP_CFLAGS = $(call iremap,$(PKG_BUILD_DIR),$(notdir $(PKG_BUILD_DIR)))
|
||||
TARGET_CFLAGS += $(IREMAP_CFLAGS)
|
||||
endif
|
||||
|
||||
include $(INCLUDE_DIR)/hardening.mk
|
||||
@@ -111,7 +84,7 @@ ifneq ($(PREV_STAMP_PREPARED),)
|
||||
STAMP_PREPARED:=$(PREV_STAMP_PREPARED)
|
||||
CONFIG_AUTOREBUILD:=
|
||||
else
|
||||
STAMP_PREPARED=$(PKG_BUILD_DIR)/.prepared$(if $(QUILT)$(DUMP),,_$(shell $(call $(if $(CONFIG_AUTOREMOVE),find_md5_reproducible,find_md5),${CURDIR} $(PKG_FILE_DEPENDS),))_$(call confvar,CONFIG_AUTOREMOVE $(PKG_PREPARED_DEPENDS)))
|
||||
STAMP_PREPARED=$(PKG_BUILD_DIR)/.prepared$(if $(QUILT)$(DUMP),,_$(shell $(call find_md5,${CURDIR} $(PKG_FILE_DEPENDS),))_$(call confvar,CONFIG_AUTOREMOVE $(PKG_PREPARED_DEPENDS)))
|
||||
endif
|
||||
STAMP_CONFIGURED=$(PKG_BUILD_DIR)/.configured$(if $(DUMP),,_$(call confvar,$(PKG_CONFIG_DEPENDS)))
|
||||
STAMP_CONFIGURED_WILDCARD=$(PKG_BUILD_DIR)/.configured_*
|
||||
@@ -136,7 +109,7 @@ PKG_INSTALL_STAMP:=$(PKG_INFO_DIR)/$(PKG_DIR_NAME).$(if $(BUILD_VARIANT),$(BUILD
|
||||
|
||||
include $(INCLUDE_DIR)/package-defaults.mk
|
||||
include $(INCLUDE_DIR)/package-dumpinfo.mk
|
||||
include $(INCLUDE_DIR)/package-pack.mk
|
||||
include $(INCLUDE_DIR)/package-ipkg.mk
|
||||
include $(INCLUDE_DIR)/package-bin.mk
|
||||
include $(INCLUDE_DIR)/autotools.mk
|
||||
|
||||
@@ -199,7 +172,6 @@ define Build/Exports/Default
|
||||
$(1) : export CONFIG_SITE:=$$(CONFIG_SITE)
|
||||
$(1) : export PKG_CONFIG_PATH:=$$(PKG_CONFIG_PATH)
|
||||
$(1) : export PKG_CONFIG_LIBDIR:=$$(PKG_CONFIG_PATH)
|
||||
$(1) : export GIT_CEILING_DIRECTORIES:=$$(BUILD_DIR)
|
||||
endef
|
||||
Build/Exports=$(Build/Exports/Default)
|
||||
|
||||
@@ -211,7 +183,7 @@ define Build/CoreTargets
|
||||
$(call Build/Autoclean)
|
||||
$(call DefaultTargets)
|
||||
|
||||
$(call check_download_integrity)
|
||||
$(DL_DIR)/$(FILE): FORCE
|
||||
|
||||
download:
|
||||
$(foreach hook,$(Hooks/Download),
|
||||
@@ -286,13 +258,13 @@ define Build/CoreTargets
|
||||
ifneq ($(CONFIG_AUTOREMOVE),)
|
||||
compile:
|
||||
-touch -r $(PKG_BUILD_DIR)/.built $(PKG_BUILD_DIR)/.autoremove 2>/dev/null >/dev/null
|
||||
$(FIND) $(PKG_BUILD_DIR) -mindepth 1 -maxdepth 1 -not '(' -type f -and -name '.*' -and -size 0 ')' -and -not -name '.pkgdir' -print0 | \
|
||||
$(XARGS) -0 rm -rf
|
||||
$(FIND) $(PKG_BUILD_DIR) -mindepth 1 -maxdepth 1 -not '(' -type f -and -name '.*' -and -size 0 ')' -and -not -name '.pkgdir' | \
|
||||
$(XARGS) rm -rf
|
||||
endif
|
||||
endef
|
||||
|
||||
define Build/DefaultTargets
|
||||
$(if $(PKG_SKIP_DOWNLOAD),,$(if $(strip $(PKG_SOURCE_URL)),$(call Download,default)))
|
||||
$(if $(USE_SOURCE_DIR)$(USE_GIT_TREE)$(USE_GIT_SRC_CHECKOUT),,$(if $(strip $(PKG_SOURCE_URL)),$(call Download,default)))
|
||||
$(if $(DUMP),,$(Build/CoreTargets))
|
||||
|
||||
define Build/DefaultTargets
|
||||
@@ -343,7 +315,7 @@ endef
|
||||
|
||||
Build/Prepare=$(call Build/Prepare/Default,)
|
||||
Build/Configure=$(call Build/Configure/Default,)
|
||||
Build/Compile=$(call Build/Compile/Default,$(if $(PKG_SUBDIRS),SUBDIRS='$$$$(wildcard $(PKG_SUBDIRS))'))
|
||||
Build/Compile=$(call Build/Compile/Default,)
|
||||
Build/Install=$(if $(PKG_INSTALL),$(call Build/Install/Default,))
|
||||
Build/Dist=$(call Build/Dist/Default,)
|
||||
Build/DistCheck=$(call Build/DistCheck/Default,)
|
||||
|
||||
@@ -8,18 +8,11 @@ include $(INCLUDE_DIR)/prereq.mk
|
||||
SHELL:=sh
|
||||
PKG_NAME:=Build dependency
|
||||
|
||||
$(eval $(call TestHostCommand,true, \
|
||||
Please install GNU 'coreutils', \
|
||||
$(TRUE)))
|
||||
|
||||
$(eval $(call TestHostCommand,false, \
|
||||
Please install GNU 'coreutils', \
|
||||
$(FALSE); [ $$$$$$$$? = 1 ] && $(TRUE)))
|
||||
|
||||
# Required for the toolchain
|
||||
$(eval $(call TestHostCommand,working-make, \
|
||||
Please install GNU make v4.1 or later., \
|
||||
$(MAKE) -v | grep -E 'Make (4\.[1-9]|[5-9]\.)'))
|
||||
Please install GNU make v3.82 or later. (This version has bugs), \
|
||||
$(MAKE) -v | grep -E 'Make (3\.8[2-9]|3\.9[0-9]|[4-9]\.)'))
|
||||
|
||||
$(eval $(call TestHostCommand,case-sensitive-fs, \
|
||||
OpenWrt can only be built on a case-sensitive filesystem, \
|
||||
@@ -32,42 +25,34 @@ $(eval $(call TestHostCommand,proper-umask, \
|
||||
|
||||
ifndef IB
|
||||
$(eval $(call SetupHostCommand,gcc, \
|
||||
Please install the GNU C Compiler (gcc) 8 or later, \
|
||||
$(CC) -dumpversion | grep -E '^([8-9]\.?|1[0-9]\.?)', \
|
||||
gcc -dumpversion | grep -E '^([8-9]\.?|1[0-9]\.?)', \
|
||||
gcc-8 -dumpversion | grep -E '^([8-9]\.?|1[0-9]\.?)', \
|
||||
Please install the GNU C Compiler (gcc) 4.8 or later, \
|
||||
$(CC) -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?|1[0-9]\.?)', \
|
||||
gcc -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?|1[0-9]\.?)', \
|
||||
gcc --version | grep -E 'Apple.(LLVM|clang)' ))
|
||||
|
||||
$(eval $(call TestHostCommand,working-gcc, \
|
||||
Please reinstall the GNU C Compiler (8 or later) - \
|
||||
\nPlease reinstall the GNU C Compiler (4.8 or later) - \
|
||||
it appears to be broken, \
|
||||
echo 'int main(int argc, char **argv) { return 0; }' | \
|
||||
$(STAGING_DIR_HOST)/bin/gcc -x c -o $(TMP_DIR)/a.out -))
|
||||
gcc -x c -o $(TMP_DIR)/a.out -))
|
||||
|
||||
$(eval $(call SetupHostCommand,g++, \
|
||||
Please install the GNU C++ Compiler (g++) 8 or later, \
|
||||
$(CXX) -dumpversion | grep -E '^([8-9]\.?|1[0-9]\.?)', \
|
||||
g++ -dumpversion | grep -E '^([8-9]\.?|1[0-9]\.?)', \
|
||||
g++-8 -dumpversion | grep -E '^([8-9]\.?|1[0-9]\.?)', \
|
||||
Please install the GNU C++ Compiler (g++) 4.8 or later, \
|
||||
$(CXX) -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?|1[0-9]\.?)', \
|
||||
g++ -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?|1[0-9]\.?)', \
|
||||
g++ --version | grep -E 'Apple.(LLVM|clang)' ))
|
||||
|
||||
$(eval $(call TestHostCommand,working-g++, \
|
||||
Please reinstall the GNU C++ Compiler (8 or later) - \
|
||||
\nPlease reinstall the GNU C++ Compiler (4.8 or later) - \
|
||||
it appears to be broken, \
|
||||
echo 'int main(int argc, char **argv) { return 0; }' | \
|
||||
$(STAGING_DIR_HOST)/bin/g++ -x c++ -o $(TMP_DIR)/a.out - -lstdc++ && \
|
||||
g++ -x c++ -o $(TMP_DIR)/a.out - -lstdc++ && \
|
||||
$(TMP_DIR)/a.out))
|
||||
|
||||
$(eval $(call RequireCHeader,ncurses.h, \
|
||||
$(eval $(call TestHostCommand,ncurses, \
|
||||
Please install ncurses. (Missing libncurses.so or ncurses.h), \
|
||||
initscr(), -lncurses))
|
||||
|
||||
$(eval $(call SetupHostCommand,git,Please install Git (git-core) >= 1.7.12.2, \
|
||||
git --exec-path | xargs -I % -- grep -q -- --recursive %/git-submodule, \
|
||||
git submodule --help | grep -- --recursive))
|
||||
|
||||
$(eval $(call SetupHostCommand,rsync,Please install 'rsync', \
|
||||
rsync --version </dev/null))
|
||||
echo 'int main(int argc, char **argv) { initscr(); return 0; }' | \
|
||||
gcc -include ncurses.h -x c -o $(TMP_DIR)/a.out - -lncurses))
|
||||
endif # IB
|
||||
|
||||
ifeq ($(HOST_OS),Linux)
|
||||
@@ -96,10 +81,6 @@ $(eval $(call TestHostCommand,perl-thread-queue, \
|
||||
Please install the Perl Thread::Queue module, \
|
||||
perl -MThread::Queue -e 1))
|
||||
|
||||
$(eval $(call TestHostCommand,perl-ipc-cmd, \
|
||||
Please install the Perl IPC:Cmd module, \
|
||||
perl -MIPC::Cmd -e 1))
|
||||
|
||||
$(eval $(call SetupHostCommand,tar,Please install GNU 'tar', \
|
||||
gtar --version 2>&1 | grep GNU, \
|
||||
gnutar --version 2>&1 | grep GNU, \
|
||||
@@ -121,9 +102,9 @@ $(eval $(call SetupHostCommand,patch,Please install GNU 'patch', \
|
||||
gpatch --version 2>&1 | grep 'Free Software Foundation', \
|
||||
patch --version 2>&1 | grep 'Free Software Foundation'))
|
||||
|
||||
$(eval $(call SetupHostCommand,diff,Please install GNU diffutils, \
|
||||
gdiff --version 2>&1 | grep GNU, \
|
||||
diff --version 2>&1 | grep GNU))
|
||||
$(eval $(call SetupHostCommand,diff,Please install diffutils, \
|
||||
gdiff --version 2>&1 | grep diff, \
|
||||
diff --version 2>&1 | grep diff))
|
||||
|
||||
$(eval $(call SetupHostCommand,cp,Please install GNU fileutils, \
|
||||
gcp --help 2>&1 | grep 'Copy SOURCE', \
|
||||
@@ -149,21 +130,13 @@ $(eval $(call SetupHostCommand,getopt, \
|
||||
Please install an extended getopt version that supports --long, \
|
||||
gnugetopt -o t --long test -- --test | grep '^ *--test *--', \
|
||||
getopt -o t --long test -- --test | grep '^ *--test *--', \
|
||||
/usr/local/opt/gnu-getopt/bin/getopt -o t --long test -- --test | grep '^ *--test *--', \
|
||||
/opt/local/bin/getopt -o t --long test -- --test | grep '^ *--test *--'))
|
||||
|
||||
$(eval $(call SetupHostCommand,realpath,Please install a 'realpath' utility, \
|
||||
grealpath /, \
|
||||
realpath /))
|
||||
/usr/local/opt/gnu-getopt/bin/getopt -o t --long test -- --test | grep '^ *--test *--'))
|
||||
|
||||
$(eval $(call SetupHostCommand,stat,Cannot find a file stat utility, \
|
||||
gnustat -c%s $(TOPDIR)/Makefile, \
|
||||
gstat -c%s $(TOPDIR)/Makefile, \
|
||||
stat -c%s $(TOPDIR)/Makefile))
|
||||
|
||||
$(eval $(call SetupHostCommand,gzip,Please install 'gzip', \
|
||||
gzip --version </dev/null))
|
||||
|
||||
$(eval $(call SetupHostCommand,unzip,Please install 'unzip', \
|
||||
unzip 2>&1 | grep zipfile, \
|
||||
unzip))
|
||||
@@ -174,71 +147,46 @@ $(eval $(call SetupHostCommand,bzip2,Please install 'bzip2', \
|
||||
$(eval $(call SetupHostCommand,wget,Please install GNU 'wget', \
|
||||
wget --version | grep GNU))
|
||||
|
||||
$(eval $(call SetupHostCommand,install,Please install GNU 'install', \
|
||||
install --version | grep GNU, \
|
||||
ginstall --version | grep GNU))
|
||||
|
||||
$(eval $(call SetupHostCommand,perl,Please install Perl 5.x, \
|
||||
perl --version | grep "perl.*v5"))
|
||||
|
||||
$(eval $(call SetupHostCommand,python,Please install Python >= 3.7, \
|
||||
python3.12 -V 2>&1 | grep 'Python 3', \
|
||||
python3.11 -V 2>&1 | grep 'Python 3', \
|
||||
python3.10 -V 2>&1 | grep 'Python 3', \
|
||||
$(eval $(call CleanupPython2))
|
||||
|
||||
$(eval $(call SetupHostCommand,python,Please install Python >= 3.5, \
|
||||
python3.9 -V 2>&1 | grep 'Python 3', \
|
||||
python3.8 -V 2>&1 | grep 'Python 3', \
|
||||
python3.7 -V 2>&1 | grep 'Python 3', \
|
||||
python3 -V 2>&1 | grep -E 'Python 3\.([7-9]|[0-9][0-9])\.?'))
|
||||
python3.6 -V 2>&1 | grep 'Python 3', \
|
||||
python3.5 -V 2>&1 | grep 'Python 3', \
|
||||
python3 -V 2>&1 | grep -E 'Python 3\.[5-9]\.?'))
|
||||
|
||||
$(eval $(call SetupHostCommand,python3,Please install Python >= 3.7, \
|
||||
python3.12 -V 2>&1 | grep 'Python 3', \
|
||||
python3.11 -V 2>&1 | grep 'Python 3', \
|
||||
python3.10 -V 2>&1 | grep 'Python 3', \
|
||||
$(eval $(call SetupHostCommand,python3,Please install Python >= 3.5, \
|
||||
python3.9 -V 2>&1 | grep 'Python 3', \
|
||||
python3.8 -V 2>&1 | grep 'Python 3', \
|
||||
python3.7 -V 2>&1 | grep 'Python 3', \
|
||||
python3 -V 2>&1 | grep -E 'Python 3\.([7-9]|[0-9][0-9])\.?'))
|
||||
python3.6 -V 2>&1 | grep 'Python 3', \
|
||||
python3.5 -V 2>&1 | grep 'Python 3', \
|
||||
python3 -V 2>&1 | grep -E 'Python 3\.[5-9]\.?'))
|
||||
|
||||
$(eval $(call TestHostCommand,python3-distutils, \
|
||||
Please install the Python3 distutils module, \
|
||||
printf 'from sys import version_info\nif version_info < (3, 12):\n\tfrom distutils import util' | \
|
||||
$(STAGING_DIR_HOST)/bin/python3 -))
|
||||
|
||||
$(eval $(call TestHostCommand,python3-stdlib, \
|
||||
Please install the Python3 stdlib module, \
|
||||
$(STAGING_DIR_HOST)/bin/python3 -c 'import ntpath'))
|
||||
$(eval $(call SetupHostCommand,git,Please install Git (git-core) >= 1.7.12.2, \
|
||||
git --exec-path | xargs -I % -- grep -q -- --recursive %/git-submodule))
|
||||
|
||||
$(eval $(call SetupHostCommand,file,Please install the 'file' package, \
|
||||
file --version 2>&1 | grep file))
|
||||
|
||||
$(eval $(call SetupHostCommand,rsync,Please install 'rsync', \
|
||||
rsync --version </dev/null))
|
||||
|
||||
$(eval $(call SetupHostCommand,which,Please install 'which', \
|
||||
/usr/bin/which which, \
|
||||
/bin/which which, \
|
||||
which which))
|
||||
|
||||
ifeq ($(HOST_OS),Linux)
|
||||
$(eval $(call RequireCHeader,argp.h, \
|
||||
Missing argp.h Please install the argp-standalone package if musl libc))
|
||||
|
||||
$(eval $(call RequireCHeader,fts.h, \
|
||||
Missing fts.h Please install the musl-fts-dev package if musl libc))
|
||||
|
||||
$(eval $(call RequireCHeader,obstack.h, \
|
||||
Missing obstack.h Please install the musl-obstack-dev package if musl libc))
|
||||
|
||||
$(eval $(call RequireCHeader,libintl.h, \
|
||||
Missing libintl.h Please install the musl-libintl package if musl libc))
|
||||
endif
|
||||
which which | grep which))
|
||||
|
||||
$(STAGING_DIR_HOST)/bin/mkhash: $(SCRIPT_DIR)/mkhash.c
|
||||
mkdir -p $(dir $@)
|
||||
$(CC) -O2 -I$(TOPDIR)/tools/include -o $@ $<
|
||||
|
||||
$(STAGING_DIR_HOST)/bin/xxd: $(SCRIPT_DIR)/xxdi.pl
|
||||
$(LN) $< $@
|
||||
|
||||
prereq: $(STAGING_DIR_HOST)/bin/mkhash $(STAGING_DIR_HOST)/bin/xxd
|
||||
prereq: $(STAGING_DIR_HOST)/bin/mkhash
|
||||
|
||||
# Install ldconfig stub
|
||||
$(eval $(call TestHostCommand,ldconfig-stub,Failed to install stub, \
|
||||
$(LN) $(SCRIPT_DIR)/noop.sh $(STAGING_DIR_HOST)/bin/ldconfig))
|
||||
touch $(STAGING_DIR_HOST)/bin/ldconfig && \
|
||||
chmod +x $(STAGING_DIR_HOST)/bin/ldconfig))
|
||||
|
||||
@@ -28,10 +28,8 @@ define Require
|
||||
|
||||
prereq-$(1): $(if $(PREREQ_PREV),prereq-$(PREREQ_PREV)) FORCE
|
||||
printf "Checking '$(1)'... "
|
||||
if $(NO_TRACE_MAKE) -f $(firstword $(MAKEFILE_LIST)) check-$(1) PATH="$(ORIG_PATH)" >/dev/null 2>/dev/null; then \
|
||||
if $(NO_TRACE_MAKE) -f $(firstword $(MAKEFILE_LIST)) check-$(1) >/dev/null 2>/dev/null; then \
|
||||
echo 'ok.'; \
|
||||
elif $(NO_TRACE_MAKE) -f $(firstword $(MAKEFILE_LIST)) check-$(1) PATH="$(ORIG_PATH)" >/dev/null 2>/dev/null; then \
|
||||
echo 'updated.'; \
|
||||
else \
|
||||
echo 'failed.'; \
|
||||
echo "$(PKG_NAME): $(strip $(2))" >> $(TMP_DIR)/.prereq-error; \
|
||||
@@ -51,7 +49,7 @@ endef
|
||||
|
||||
define RequireCommand
|
||||
define Require/$(1)
|
||||
command -v $(1)
|
||||
which $(1)
|
||||
endef
|
||||
|
||||
$$(eval $$(call Require,$(1),$(2)))
|
||||
@@ -65,16 +63,16 @@ define RequireHeader
|
||||
$$(eval $$(call Require,$(1),$(2)))
|
||||
endef
|
||||
|
||||
# 1: header to test
|
||||
# 2: failure message
|
||||
# 3: optional compile time test
|
||||
# 4: optional link library test (example -lncurses)
|
||||
define RequireCHeader
|
||||
define Require/$(1)
|
||||
echo 'int main(int argc, char **argv) { $(3); return 0; }' | gcc -include $(1) -x c -o $(TMP_DIR)/a.out - $(4)
|
||||
define CleanupPython2
|
||||
define Require/python2-cleanup
|
||||
if [ -f "$(STAGING_DIR_HOST)/bin/python" ] && \
|
||||
$(STAGING_DIR_HOST)/bin/python -V 2>&1 | \
|
||||
grep -q 'Python 2'; then \
|
||||
rm $(STAGING_DIR_HOST)/bin/python; \
|
||||
fi
|
||||
endef
|
||||
|
||||
$$(eval $$(call Require,$(1),$(2)))
|
||||
$$(eval $$(call Require,python2-cleanup))
|
||||
endef
|
||||
|
||||
define QuoteHostCommand
|
||||
@@ -97,24 +95,19 @@ endef
|
||||
# 3+: candidates
|
||||
define SetupHostCommand
|
||||
define Require/$(1)
|
||||
mkdir -p "$(STAGING_DIR_HOST)/bin"; \
|
||||
[ -f "$(STAGING_DIR_HOST)/bin/$(strip $(1))" ] && exit 0; \
|
||||
for cmd in $(call QuoteHostCommand,$(3)) $(call QuoteHostCommand,$(4)) \
|
||||
$(call QuoteHostCommand,$(5)) $(call QuoteHostCommand,$(6)) \
|
||||
$(call QuoteHostCommand,$(7)) $(call QuoteHostCommand,$(8)) \
|
||||
$(call QuoteHostCommand,$(9)) $(call QuoteHostCommand,$(10)) \
|
||||
$(call QuoteHostCommand,$(11)) $(call QuoteHostCommand,$(12)); do \
|
||||
if [ -n "$$$$$$$$cmd" ]; then \
|
||||
bin="$$$$$$$$(command -v "$$$$$$$${cmd%% *}")"; \
|
||||
bin="$$$$$$$$(PATH="$(subst $(space),:,$(filter-out $(STAGING_DIR_HOST)/%,$(subst :,$(space),$(PATH))))" \
|
||||
which "$$$$$$$${cmd%% *}")"; \
|
||||
if [ -x "$$$$$$$$bin" ] && eval "$$$$$$$$cmd" >/dev/null 2>/dev/null; then \
|
||||
case "$$$$$$$$(ls -dl -- $(STAGING_DIR_HOST)/bin/$(strip $(1)))" in \
|
||||
"-"* | \
|
||||
*" -> $$$$$$$$bin"* | \
|
||||
*" -> "[!/]*) \
|
||||
[ -x "$(STAGING_DIR_HOST)/bin/$(strip $(1))" ] && exit 0 \
|
||||
;; \
|
||||
esac; \
|
||||
mkdir -p "$(STAGING_DIR_HOST)/bin"; \
|
||||
ln -sf "$$$$$$$$bin" "$(STAGING_DIR_HOST)/bin/$(strip $(1))"; \
|
||||
exit 1; \
|
||||
exit 0; \
|
||||
fi; \
|
||||
fi; \
|
||||
done; \
|
||||
|
||||
@@ -34,8 +34,8 @@ endif
|
||||
ifneq ($(if $(DUMP),1,$(__quilt_inc)),1)
|
||||
__quilt_inc:=1
|
||||
|
||||
PATCH_DIR?=$(CURDIR)/patches
|
||||
FILES_DIR?=$(CURDIR)/files
|
||||
PATCH_DIR?=./patches
|
||||
FILES_DIR?=./files
|
||||
HOST_PATCH_DIR?=$(PATCH_DIR)
|
||||
HOST_FILES_DIR?=$(FILES_DIR)
|
||||
|
||||
@@ -106,18 +106,17 @@ define Kernel/Patch/Default
|
||||
endef
|
||||
|
||||
define Quilt/RefreshDir
|
||||
-rm -rf $(2) 2>/dev/null >/dev/null
|
||||
[ -f $(1)/.quilt_no_patch ] || mkdir -p $(2)
|
||||
@[ -f $(1)/.quilt_no_patch ] || { \
|
||||
mkdir -p $(2)
|
||||
-rm -f $(2)/* 2>/dev/null >/dev/null
|
||||
@( \
|
||||
for patch in $$$$($(if $(3),grep "^$(3)",cat) $(1)/patches/series | awk '{print $$$$1}'); do \
|
||||
$(CP) -v "$(1)/patches/$$$$patch" $(2); \
|
||||
done; \
|
||||
}
|
||||
@-rm -f $(1)/.quilt_no_patch 2>/dev/null >/dev/null;
|
||||
)
|
||||
endef
|
||||
|
||||
define Quilt/Refresh/Host
|
||||
$(call Quilt/RefreshDir,$(HOST_BUILD_DIR),$(HOST_PATCH_DIR))
|
||||
$(call Quilt/RefreshDir,$(HOST_BUILD_DIR),$(PATCH_DIR))
|
||||
endef
|
||||
|
||||
define Quilt/Refresh/Package
|
||||
@@ -157,21 +156,19 @@ define Quilt/Template
|
||||
}
|
||||
@[ -f "$(1)/patches/series" ] || { \
|
||||
echo "The source directory contains no quilt patches."; \
|
||||
touch $(1)/patches/series $(1)/.quilt_no_patch; \
|
||||
false; \
|
||||
}
|
||||
@[ -n "$$$$(ls $(1)/patches/series)" -o \
|
||||
"$$$$(cat $(1)/patches/series | $(MKHASH) md5)" = "$$(sort $(1)/patches/series | $(MKHASH) md5)" ] || { \
|
||||
"$$$$(cat $(1)/patches/series | mkhash md5)" = "$$(sort $(1)/patches/series | mkhash md5)" ] || { \
|
||||
echo "The patches are not sorted in the right order. Please fix."; \
|
||||
false; \
|
||||
}
|
||||
|
||||
$(3)refresh: $(3)quilt-check
|
||||
@[ -f $(1)/.quilt_no_patch ] || { \
|
||||
cd "$(1)"; $(QUILT_CMD) pop -a -f >/dev/null 2>/dev/null; \
|
||||
while $(QUILT_CMD) next 2>/dev/null >/dev/null && $(QUILT_CMD) push; do \
|
||||
QUILT_DIFF_OPTS="-p" $(QUILT_CMD) refresh -p ab --no-index --no-timestamps; \
|
||||
done; ! $(QUILT_CMD) next 2>/dev/null >/dev/null; \
|
||||
}
|
||||
@cd "$(1)"; $(QUILT_CMD) pop -a -f >/dev/null 2>/dev/null
|
||||
@cd "$(1)"; while $(QUILT_CMD) next 2>/dev/null >/dev/null && $(QUILT_CMD) push; do \
|
||||
QUILT_DIFF_OPTS="-p" $(QUILT_CMD) refresh -p ab --no-index --no-timestamps; \
|
||||
done; ! $(QUILT_CMD) next 2>/dev/null >/dev/null
|
||||
$(Quilt/Refresh/$(4))
|
||||
|
||||
$(3)update: $(3)quilt-check
|
||||
|
||||
@@ -43,15 +43,6 @@ opkg = \
|
||||
--add-arch all:100 \
|
||||
--add-arch $(if $(ARCH_PACKAGES),$(ARCH_PACKAGES),$(BOARD)):200
|
||||
|
||||
apk = \
|
||||
IPKG_INSTROOT=$(1) \
|
||||
$(FAKEROOT) $(STAGING_DIR_HOST)/bin/apk \
|
||||
--root $(1) \
|
||||
--keys-dir $(if $(APK_KEYS),$(APK_KEYS),$(TOPDIR)) \
|
||||
--no-cache \
|
||||
--no-logfile \
|
||||
--preserve-env
|
||||
|
||||
TARGET_DIR_ORIG := $(TARGET_ROOTFS_DIR)/root.orig-$(BOARD)
|
||||
|
||||
ifdef CONFIG_CLEAN_IPKG
|
||||
@@ -77,29 +68,14 @@ define prepare_rootfs
|
||||
@mkdir -p $(1)/var/lock
|
||||
@( \
|
||||
cd $(1); \
|
||||
if [ -n "$(CONFIG_USE_APK)" ]; then \
|
||||
IPKG_POSTINST_PATH=./lib/apk/db/*.post-install; \
|
||||
$(STAGING_DIR_HOST)/bin/tar -C ./lib/apk/db/ -xf ./lib/apk/db/scripts.tar --wildcards "*.post-install"; \
|
||||
else \
|
||||
IPKG_POSTINST_PATH=./usr/lib/opkg/info/*.postinst; \
|
||||
fi; \
|
||||
for script in $$IPKG_POSTINST_PATH; do \
|
||||
for script in ./usr/lib/opkg/info/*.postinst; do \
|
||||
IPKG_INSTROOT=$(1) $$(command -v bash) $$script; \
|
||||
ret=$$?; \
|
||||
if [ $$ret -ne 0 ]; then \
|
||||
echo "postinst script $$script has failed with exit code $$ret" >&2; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
[ -n "$(CONFIG_USE_APK)" ] && $(STAGING_DIR_HOST)/bin/tar --delete -f ./lib/apk/db/scripts.tar $$(basename $$script); \
|
||||
done; \
|
||||
if [ -z "$(CONFIG_USE_APK)" ]; then \
|
||||
$(if $(IB),,awk -i inplace \
|
||||
'/^Status:/ { \
|
||||
if ($$3 == "user") { $$3 = "ok" } \
|
||||
else { sub(/,\<user\>|\<user\>,/, "", $$3) } \
|
||||
}1' $(1)/usr/lib/opkg/status) ; \
|
||||
$(if $(SOURCE_DATE_EPOCH),sed -i "s/Installed-Time: .*/Installed-Time: $(SOURCE_DATE_EPOCH)/" $(1)/usr/lib/opkg/status ;) \
|
||||
fi; \
|
||||
for script in ./etc/init.d/*; do \
|
||||
grep '#!/bin/sh /etc/rc.common' $$script >/dev/null || continue; \
|
||||
if ! echo " $(3) " | grep -q " $$(basename $$script) "; then \
|
||||
@@ -111,12 +87,11 @@ define prepare_rootfs
|
||||
fi; \
|
||||
done || true \
|
||||
)
|
||||
|
||||
$(if $(SOURCE_DATE_EPOCH),sed -i "s/Installed-Time: .*/Installed-Time: $(SOURCE_DATE_EPOCH)/" $(1)/usr/lib/opkg/status)
|
||||
@-find $(1) -name CVS -o -name .svn -o -name .git -o -name '.#*' | $(XARGS) rm -rf
|
||||
rm -rf \
|
||||
$(1)/boot \
|
||||
$(1)/tmp/* \
|
||||
$(1)/lib/apk/db/*.post-install* \
|
||||
$(1)/usr/lib/opkg/info/*.postinst* \
|
||||
$(1)/usr/lib/opkg/lists/* \
|
||||
$(1)/var/lock/*.lock
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
include $(TOPDIR)/include/verbose.mk
|
||||
include $(TOPDIR)/rules.mk
|
||||
TMP_DIR:=$(TOPDIR)/tmp
|
||||
|
||||
all: $(TMP_DIR)/.$(SCAN_TARGET)
|
||||
@@ -11,8 +10,7 @@ TARGET_STAMP:=$(TMP_DIR)/info/.files-$(SCAN_TARGET).stamp
|
||||
FILELIST:=$(TMP_DIR)/info/.files-$(SCAN_TARGET)-$(SCAN_COOKIE)
|
||||
OVERRIDELIST:=$(TMP_DIR)/info/.overrides-$(SCAN_TARGET)-$(SCAN_COOKIE)
|
||||
|
||||
export ORIG_PATH:=$(if $(ORIG_PATH),$(ORIG_PATH),$(PATH))
|
||||
export PATH:=$(STAGING_DIR_HOST)/bin:$(PATH)
|
||||
export PATH:=$(TOPDIR)/staging_dir/host/bin:$(PATH)
|
||||
|
||||
define feedname
|
||||
$(if $(patsubst feeds/%,,$(1)),,$(word 2,$(subst /, ,$(1))))
|
||||
@@ -50,8 +48,7 @@ define PackageDir
|
||||
$$(call progress,Collecting $(SCAN_NAME) info: $(SCAN_DIR)/$(2)) \
|
||||
echo Source-Makefile: $(SCAN_DIR)/$(2)/Makefile; \
|
||||
$(if $(3),echo Override: $(3),true); \
|
||||
$(if $(findstring c,$(OPENWRT_VERBOSE)),$(MAKE),$(NO_TRACE_MAKE) --no-print-dir) -r DUMP=1 FEED="$(call feedname,$(2))" -C $(SCAN_DIR)/$(2) $(SCAN_MAKEOPTS) \
|
||||
$(if $(findstring c,$(OPENWRT_VERBOSE)),,2>/dev/null) || { \
|
||||
$(NO_TRACE_MAKE) --no-print-dir -r DUMP=1 FEED="$(call feedname,$(2))" -C $(SCAN_DIR)/$(2) $(SCAN_MAKEOPTS) 2>/dev/null || { \
|
||||
mkdir -p "$(TOPDIR)/logs/$(SCAN_DIR)/$(2)"; \
|
||||
$(NO_TRACE_MAKE) --no-print-dir -r DUMP=1 FEED="$(call feedname,$(2))" -C $(SCAN_DIR)/$(2) $(SCAN_MAKEOPTS) > $(TOPDIR)/logs/$(SCAN_DIR)/$(2)/dump.txt 2>&1; \
|
||||
$$(call progress,ERROR: please fix $(SCAN_DIR)/$(2)/Makefile - see logs/$(SCAN_DIR)/$(2)/dump.txt for details\n) \
|
||||
@@ -74,7 +71,7 @@ endif
|
||||
|
||||
$(FILELIST): $(OVERRIDELIST)
|
||||
rm -f $(TMP_DIR)/info/.files-$(SCAN_TARGET)-*
|
||||
find -L $(SCAN_DIR) -mindepth 1 $(if $(SCAN_DEPTH),-maxdepth $(SCAN_DEPTH)) $(SCAN_EXTRA) -name Makefile | xargs grep -aHE 'call $(GREP_STRING)' | sed -e 's#^$(SCAN_DIR)/##' -e 's#/Makefile:.*##' | uniq | awk -v of=$(OVERRIDELIST) -f include/scan.awk > $@
|
||||
find -L $(SCAN_DIR) $(SCAN_EXTRA) -mindepth 1 $(if $(SCAN_DEPTH),-maxdepth $(SCAN_DEPTH)) -name Makefile | xargs grep -aHE 'call $(GREP_STRING)' | sed -e 's#^$(SCAN_DIR)/##' -e 's#/Makefile:.*##' | uniq | awk -v of=$(OVERRIDELIST) -f include/scan.awk > $@
|
||||
|
||||
$(TMP_DIR)/info/.files-$(SCAN_TARGET).mk: $(FILELIST)
|
||||
( \
|
||||
@@ -103,7 +100,7 @@ $(TMP_DIR)/info/.files-$(SCAN_TARGET).mk: $(FILELIST)
|
||||
$(TARGET_STAMP)::
|
||||
+( \
|
||||
$(NO_TRACE_MAKE) $(FILELIST); \
|
||||
MD5SUM=$$(cat $(FILELIST) $(OVERRIDELIST) | $(MKHASH) md5 | awk '{print $$1}'); \
|
||||
MD5SUM=$$(cat $(FILELIST) $(OVERRIDELIST) | mkhash md5 | awk '{print $$1}'); \
|
||||
[ -f "$@.$$MD5SUM" ] || { \
|
||||
rm -f $@.*; \
|
||||
touch $@.$$MD5SUM; \
|
||||
|
||||
@@ -37,7 +37,7 @@ ac_cv_func_rindex=yes
|
||||
ac_cv_func_setlocale=yes
|
||||
ac_cv_func_setgrent_void=yes
|
||||
ac_cv_func_setpgrp_void=yes
|
||||
ac_cv_func_setresuid=yes
|
||||
ac_cv_func_setresuid=no
|
||||
ac_cv_func_setvbuf_reversed=no
|
||||
ac_cv_func_stat_empty_string_bug=no
|
||||
ac_cv_func_stat_ignores_trailing_slash=no
|
||||
@@ -53,6 +53,7 @@ ac_cv_have_control_in_msghdr=yes
|
||||
ac_cv_have_decl_sys_siglist=no
|
||||
ac_cv_have_openpty_ctty_bug=yes
|
||||
ac_cv_have_space_d_name_in_struct_dirent=yes
|
||||
ac_cv_header_netinet_sctp_h=no
|
||||
ac_cv_header_netinet_sctp_uio_h=no
|
||||
ac_cv_int64_t=yes
|
||||
ac_cv_lbl_unaligned_fail=no
|
||||
@@ -65,12 +66,9 @@ ac_cv_sctp=no
|
||||
ac_cv_sys_restartable_syscalls=yes
|
||||
ac_cv_time_r_type=POSIX
|
||||
ac_cv_type_suseconds_t=yes
|
||||
ac_cv_size_t=yes
|
||||
ac_cv_ssize_t=yes
|
||||
ac_cv_uchar=no
|
||||
ac_cv_uint=yes
|
||||
ac_cv_uint64_t=yes
|
||||
ac_cv_uintptr_t=yes
|
||||
ac_cv_ulong=yes
|
||||
ac_cv_ushort=yes
|
||||
ac_cv_va_copy=C99
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
#!/bin/sh
|
||||
. $TOPDIR/include/site/linux
|
||||
ac_cv_c_littleendian=${ac_cv_c_littleendian=yes}
|
||||
ac_cv_c_bigendian=${ac_cv_c_bigendian=no}
|
||||
|
||||
ac_cv_sizeof___int64=0
|
||||
ac_cv_sizeof_char=1
|
||||
ac_cv_sizeof_int=4
|
||||
ac_cv_sizeof_int16_t=2
|
||||
ac_cv_sizeof_int32_t=4
|
||||
ac_cv_sizeof_int64_t=8
|
||||
ac_cv_sizeof_long_int=8
|
||||
ac_cv_sizeof_long_long=8
|
||||
ac_cv_sizeof_long=8
|
||||
ac_cv_sizeof_off_t=8
|
||||
ac_cv_sizeof_short_int=2
|
||||
ac_cv_sizeof_short=2
|
||||
ac_cv_sizeof_size_t=8
|
||||
ac_cv_sizeof_ssize_t=8
|
||||
ac_cv_sizeof_u_int16_t=2
|
||||
ac_cv_sizeof_u_int32_t=4
|
||||
ac_cv_sizeof_u_int64_t=8
|
||||
ac_cv_sizeof_uint16_t=2
|
||||
ac_cv_sizeof_uint32_t=4
|
||||
ac_cv_sizeof_uint64_t=8
|
||||
ac_cv_sizeof_unsigned_int=4
|
||||
ac_cv_sizeof_unsigned_long=8
|
||||
ac_cv_sizeof_unsigned_long_long=8
|
||||
ac_cv_sizeof_unsigned_short=2
|
||||
ac_cv_sizeof_void_p=8
|
||||
@@ -1,30 +0,0 @@
|
||||
#!/bin/sh
|
||||
. $TOPDIR/include/site/linux
|
||||
ac_cv_c_littleendian=${ac_cv_c_littleendian=yes}
|
||||
ac_cv_c_bigendian=${ac_cv_c_bigendian=no}
|
||||
|
||||
ac_cv_sizeof___int64=8
|
||||
ac_cv_sizeof_char=1
|
||||
ac_cv_sizeof_int=4
|
||||
ac_cv_sizeof_int16_t=2
|
||||
ac_cv_sizeof_int32_t=4
|
||||
ac_cv_sizeof_int64_t=8
|
||||
ac_cv_sizeof_long_int=8
|
||||
ac_cv_sizeof_long_long=8
|
||||
ac_cv_sizeof_long=8
|
||||
ac_cv_sizeof_off_t=8
|
||||
ac_cv_sizeof_short_int=2
|
||||
ac_cv_sizeof_short=2
|
||||
ac_cv_sizeof_size_t=8
|
||||
ac_cv_sizeof_ssize_t=8
|
||||
ac_cv_sizeof_u_int16_t=2
|
||||
ac_cv_sizeof_u_int32_t=4
|
||||
ac_cv_sizeof_u_int64_t=8
|
||||
ac_cv_sizeof_uint16_t=2
|
||||
ac_cv_sizeof_uint32_t=4
|
||||
ac_cv_sizeof_uint64_t=8
|
||||
ac_cv_sizeof_unsigned_int=4
|
||||
ac_cv_sizeof_unsigned_long=8
|
||||
ac_cv_sizeof_unsigned_long_long=8
|
||||
ac_cv_sizeof_unsigned_short=2
|
||||
ac_cv_sizeof_void_p=8
|
||||
@@ -5,9 +5,6 @@
|
||||
ifeq ($(MAKECMDGOALS),prereq)
|
||||
SUBTARGETS:=prereq
|
||||
PREREQ_ONLY:=1
|
||||
# For target/linux related target add dtb to selectively compile dtbs
|
||||
else ifneq ($(filter target/linux/%,$(MAKECMDGOALS)),)
|
||||
SUBTARGETS:=$(DEFAULT_SUBDIR_TARGETS) dtb
|
||||
else
|
||||
SUBTARGETS:=$(DEFAULT_SUBDIR_TARGETS)
|
||||
endif
|
||||
@@ -30,16 +27,14 @@ lastdir=$(word $(words $(subst /, ,$(1))),$(subst /, ,$(1)))
|
||||
diralias=$(if $(findstring $(1),$(call lastdir,$(1))),,$(call lastdir,$(1)))
|
||||
|
||||
subdir_make_opts = \
|
||||
$(if $(SUBDIR_MAKE_DEBUG),-d) -r -C $(1) \
|
||||
-r -C $(1) \
|
||||
BUILD_SUBDIR="$(1)" \
|
||||
BUILD_VARIANT="$(4)" \
|
||||
ALL_VARIANTS="$(5)"
|
||||
BUILD_VARIANT="$(4)"
|
||||
|
||||
# 1: subdir
|
||||
# 2: target
|
||||
# 3: build type
|
||||
# 4: build variant
|
||||
# 5: all variants
|
||||
log_make = \
|
||||
$(if $(call debug,$(1),v),,@)+ \
|
||||
$(if $(BUILD_LOG), \
|
||||
@@ -67,15 +62,15 @@ define subdir
|
||||
$(foreach target,$(SUBTARGETS) $($(1)/subtargets),
|
||||
$(foreach btype,$(buildtypes-$(bd)),
|
||||
$(call warn_eval,$(1)/$(bd),t,T,$(1)/$(bd)/$(btype)/$(target): $(if $(NO_DEPS)$(QUILT),,$($(1)/$(bd)/$(btype)/$(target)) $(call $(1)//$(btype)/$(target),$(1)/$(bd)/$(btype))))
|
||||
$(call log_make,$(1)/$(bd),$(target),$(btype),$(filter-out __default,$(variant)),$($(1)/$(bd)/variants)) \
|
||||
$(call log_make,$(1)/$(bd),$(target),$(btype),$(filter-out __default,$(variant))) \
|
||||
|| $(call ERROR,$(2), ERROR: $(1)/$(bd) [$(btype)] failed to build.,$(findstring $(bd),$($(1)/builddirs-ignore-$(btype)-$(target))))
|
||||
$(if $(call diralias,$(bd)),$(call warn_eval,$(1)/$(bd),l,T,$(1)/$(call diralias,$(bd))/$(btype)/$(target): $(1)/$(bd)/$(btype)/$(target)))
|
||||
)
|
||||
$(call warn_eval,$(1)/$(bd),t,T,$(1)/$(bd)/$(target): $(if $(NO_DEPS)$(QUILT),,$($(1)/$(bd)/$(target)) $(call $(1)//$(target),$(1)/$(bd))))
|
||||
$(foreach variant,$(filter-out *,$(if $(BUILD_VARIANT),$(BUILD_VARIANT),$(if $(strip $($(1)/$(bd)/variants)),$($(1)/$(bd)/variants),$(if $($(1)/$(bd)/default-variant),$($(1)/$(bd)/default-variant),__default)))),
|
||||
$(foreach variant,$(if $(BUILD_VARIANT),$(BUILD_VARIANT),$(if $(strip $($(1)/$(bd)/variants)),$($(1)/$(bd)/variants),$(if $($(1)/$(bd)/default-variant),$($(1)/$(bd)/default-variant),__default))),
|
||||
$(if $(BUILD_LOG),@mkdir -p $(BUILD_LOG_DIR)/$(1)/$(bd)/$(filter-out __default,$(variant)))
|
||||
$(if $($(1)/autoremove),$(call rebuild_check,$(1)/$(bd),$(target),,$(filter-out __default,$(variant)),$($(1)/$(bd)/variants)))
|
||||
$(call log_make,$(1)/$(bd),$(target),,$(filter-out __default,$(variant)),$($(1)/$(bd)/variants)) \
|
||||
$(if $($(1)/autoremove),$(call rebuild_check,$(1)/$(bd),$(target),,$(filter-out __default,$(variant))))
|
||||
$(call log_make,$(1)/$(bd),$(target),,$(filter-out __default,$(variant))) \
|
||||
|| $(call ERROR,$(1), ERROR: $(1)/$(bd) failed to build$(if $(filter-out __default,$(variant)), (build variant: $(variant))).,$(findstring $(bd),$($(1)/builddirs-ignore-$(target))))
|
||||
)
|
||||
$(if $(PREREQ_ONLY)$(DUMP_TARGET_DB),,
|
||||
|
||||
@@ -6,18 +6,10 @@
|
||||
ifneq ($(__target_inc),1)
|
||||
__target_inc=1
|
||||
|
||||
|
||||
##@
|
||||
# @brief Default device type ( basic | nas | router ).
|
||||
##
|
||||
# default device type
|
||||
DEVICE_TYPE?=router
|
||||
|
||||
##@
|
||||
# @brief Default packages.
|
||||
#
|
||||
# The really basic set. Additional packages are added based on @DEVICE_TYPE and
|
||||
# @CONFIG_* values.
|
||||
##
|
||||
# Default packages - the really basic set
|
||||
DEFAULT_PACKAGES:=\
|
||||
base-files \
|
||||
ca-bundle \
|
||||
@@ -25,35 +17,37 @@ DEFAULT_PACKAGES:=\
|
||||
fstools \
|
||||
libc \
|
||||
libgcc \
|
||||
libustream-mbedtls \
|
||||
libustream-wolfssl \
|
||||
logd \
|
||||
mtd \
|
||||
netifd \
|
||||
opkg \
|
||||
uci \
|
||||
uclient-fetch \
|
||||
urandom-seed \
|
||||
urngd
|
||||
|
||||
##@
|
||||
# @brief Default packages for @DEVICE_TYPE basic.
|
||||
##
|
||||
ifneq ($(CONFIG_SELINUX),)
|
||||
DEFAULT_PACKAGES+=busybox-selinux procd-selinux
|
||||
else
|
||||
DEFAULT_PACKAGES+=busybox procd
|
||||
endif
|
||||
|
||||
# For the basic set
|
||||
DEFAULT_PACKAGES.basic:=
|
||||
##@
|
||||
# @brief Default packages for @DEVICE_TYPE nas.
|
||||
##
|
||||
# For nas targets
|
||||
DEFAULT_PACKAGES.nas:=\
|
||||
block-mount \
|
||||
fdisk \
|
||||
lsblk \
|
||||
mdadm
|
||||
##@
|
||||
# @brief Default packages for @DEVICE_TYPE router.
|
||||
##
|
||||
# For router targets
|
||||
DEFAULT_PACKAGES.router:=\
|
||||
dnsmasq \
|
||||
firewall4 \
|
||||
nftables \
|
||||
kmod-nft-offload \
|
||||
firewall \
|
||||
ip6tables \
|
||||
iptables \
|
||||
kmod-ipt-offload \
|
||||
odhcp6c \
|
||||
odhcpd-ipv6only \
|
||||
ppp \
|
||||
@@ -65,7 +59,7 @@ endif
|
||||
|
||||
target_conf=$(subst .,_,$(subst -,_,$(subst /,_,$(1))))
|
||||
ifeq ($(DUMP),)
|
||||
PLATFORM_DIR:=$(firstword $(wildcard $(TOPDIR)/target/linux/feeds/$(BOARD) $(TOPDIR)/target/linux/$(BOARD)))
|
||||
PLATFORM_DIR:=$(TOPDIR)/target/linux/$(BOARD)
|
||||
SUBTARGET:=$(strip $(foreach subdir,$(patsubst $(PLATFORM_DIR)/%/target.mk,%,$(wildcard $(PLATFORM_DIR)/*/target.mk)),$(if $(CONFIG_TARGET_$(call target_conf,$(BOARD)_$(subdir))),$(subdir))))
|
||||
else
|
||||
PLATFORM_DIR:=${CURDIR}
|
||||
@@ -90,62 +84,10 @@ else
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(DUMP),)
|
||||
# Parse generic config that might be set before a .config is generated to modify the
|
||||
# default package configuration
|
||||
# Keep DYNAMIC_DEF_PKG_CONF in sync with toplevel.mk to reflect the same configs
|
||||
DYNAMIC_DEF_PKG_CONF := CONFIG_USE_APK CONFIG_SELINUX CONFIG_SMALL_FLASH CONFIG_SECCOMP
|
||||
$(foreach config, $(DYNAMIC_DEF_PKG_CONF), \
|
||||
$(eval $(config) := $(shell grep "$(config)=y" $(TOPDIR)/.config 2>/dev/null)) \
|
||||
)
|
||||
# The config options that are enabled by default and where other default
|
||||
# packages depends on needs to be set if they are missing in the .config.
|
||||
ifeq ($(shell grep "CONFIG_SECCOMP" $(TOPDIR)/.config 2>/dev/null),)
|
||||
ifeq ($(filter $(BOARD), uml),)
|
||||
ifneq ($(filter $(ARCH), aarch64 arm armeb mips mipsel mips64 mips64el i386 powerpc x86_64),)
|
||||
CONFIG_SECCOMP := y
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_USE_APK),)
|
||||
DEFAULT_PACKAGES+=apk-mbedtls
|
||||
else
|
||||
DEFAULT_PACKAGES+=opkg
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_SELINUX),)
|
||||
DEFAULT_PACKAGES+=busybox-selinux procd-selinux
|
||||
else
|
||||
DEFAULT_PACKAGES+=busybox procd
|
||||
endif
|
||||
|
||||
# include ujail on systems with enough storage
|
||||
ifeq ($(CONFIG_SMALL_FLASH),)
|
||||
DEFAULT_PACKAGES+=procd-ujail
|
||||
endif
|
||||
|
||||
# include seccomp ld-preload hooks if kernel supports it
|
||||
ifneq ($(CONFIG_SECCOMP),)
|
||||
DEFAULT_PACKAGES+=procd-seccomp
|
||||
endif
|
||||
|
||||
# Add device specific packages (here below to allow device type set from subtarget)
|
||||
DEFAULT_PACKAGES += $(DEFAULT_PACKAGES.$(DEVICE_TYPE))
|
||||
|
||||
##@
|
||||
# @brief Filter out packages, prepended with `-`.
|
||||
#
|
||||
# @param 1: Package list.
|
||||
##
|
||||
filter_packages = $(filter-out -% $(patsubst -%,%,$(filter -%,$(1))),$(1))
|
||||
|
||||
##@
|
||||
# @brief Append extra package dependencies.
|
||||
#
|
||||
# @param 1: Package list.
|
||||
##
|
||||
extra_packages = $(if $(filter wpad wpad-% nas,$(1)),iwinfo)
|
||||
|
||||
define ProfileDefault
|
||||
@@ -222,30 +164,22 @@ USE_SUBTARGET_CONFIG = $(if $(wildcard $(LINUX_TARGET_CONFIG)),,$(if $(LINUX_SUB
|
||||
LINUX_RECONFIG_LIST = $(wildcard $(GENERIC_LINUX_CONFIG) $(LINUX_TARGET_CONFIG) $(if $(USE_SUBTARGET_CONFIG),$(LINUX_SUBTARGET_CONFIG)))
|
||||
LINUX_RECONFIG_TARGET = $(if $(USE_SUBTARGET_CONFIG),$(LINUX_SUBTARGET_CONFIG),$(LINUX_TARGET_CONFIG))
|
||||
|
||||
CFG_TARGET = $(CONFIG_TARGET)
|
||||
ifeq ($(CFG_TARGET),platform)
|
||||
CFG_TARGET = target
|
||||
$(warning Deprecation warning: use CONFIG_TARGET=target instead.)
|
||||
else ifeq ($(CFG_TARGET),subtarget_platform)
|
||||
CFG_TARGET = subtarget_target
|
||||
$(warning Deprecation warning: use CONFIG_TARGET=subtarget_target instead.)
|
||||
endif
|
||||
|
||||
# select the config file to be changed by kernel_menuconfig/kernel_oldconfig
|
||||
ifeq ($(CFG_TARGET),target)
|
||||
ifeq ($(CONFIG_TARGET),platform)
|
||||
LINUX_RECONFIG_LIST = $(wildcard $(GENERIC_LINUX_CONFIG) $(LINUX_TARGET_CONFIG))
|
||||
LINUX_RECONFIG_TARGET = $(LINUX_TARGET_CONFIG)
|
||||
else ifeq ($(CFG_TARGET),subtarget)
|
||||
endif
|
||||
ifeq ($(CONFIG_TARGET),subtarget)
|
||||
LINUX_RECONFIG_LIST = $(wildcard $(GENERIC_LINUX_CONFIG) $(LINUX_TARGET_CONFIG) $(LINUX_SUBTARGET_CONFIG))
|
||||
LINUX_RECONFIG_TARGET = $(LINUX_SUBTARGET_CONFIG)
|
||||
else ifeq ($(CFG_TARGET),subtarget_target)
|
||||
endif
|
||||
ifeq ($(CONFIG_TARGET),subtarget_platform)
|
||||
LINUX_RECONFIG_LIST = $(wildcard $(GENERIC_LINUX_CONFIG) $(LINUX_SUBTARGET_CONFIG) $(LINUX_TARGET_CONFIG))
|
||||
LINUX_RECONFIG_TARGET = $(LINUX_TARGET_CONFIG)
|
||||
else ifeq ($(CFG_TARGET),env)
|
||||
endif
|
||||
ifeq ($(CONFIG_TARGET),env)
|
||||
LINUX_RECONFIG_LIST = $(LINUX_KCONFIG_LIST)
|
||||
LINUX_RECONFIG_TARGET = $(TOPDIR)/env/kernel-config
|
||||
else ifneq ($(strip $(CFG_TARGET)),)
|
||||
$(error CONFIG_TARGET=$(CFG_TARGET) is invalid. Valid: target|subtarget|subtarget_target|env)
|
||||
endif
|
||||
|
||||
__linux_confcmd = $(2) $(patsubst %,+,$(wordlist 2,9999,$(1))) $(1)
|
||||
@@ -284,14 +218,12 @@ ifeq ($(DUMP),1)
|
||||
ifeq ($(ARCH),powerpc)
|
||||
CPU_CFLAGS_603e:=-mcpu=603e
|
||||
CPU_CFLAGS_8540:=-mcpu=8540
|
||||
CPU_CFLAGS_8548:=-mcpu=8548
|
||||
CPU_CFLAGS_405:=-mcpu=405
|
||||
CPU_CFLAGS_440:=-mcpu=440
|
||||
CPU_CFLAGS_464fp:=-mcpu=464fp
|
||||
endif
|
||||
ifeq ($(ARCH),powerpc64)
|
||||
CPU_TYPE ?= powerpc64
|
||||
CPU_CFLAGS_e5500:=-mcpu=e5500
|
||||
CPU_CFLAGS_powerpc64:=-mcpu=powerpc64
|
||||
endif
|
||||
ifeq ($(ARCH),sparc)
|
||||
@@ -309,15 +241,6 @@ ifeq ($(DUMP),1)
|
||||
CPU_CFLAGS_arc700 = -mcpu=arc700
|
||||
CPU_CFLAGS_archs = -mcpu=archs
|
||||
endif
|
||||
ifeq ($(ARCH),riscv64)
|
||||
CPU_TYPE ?= riscv64
|
||||
CPU_CFLAGS_riscv64:=-mabi=lp64d -march=rv64imafdc
|
||||
endif
|
||||
ifeq ($(ARCH),loongarch64)
|
||||
CPU_TYPE ?= generic
|
||||
CPU_CFLAGS := -O2 -pipe
|
||||
CPU_CFLAGS_generic:=-march=loongarch64
|
||||
endif
|
||||
ifneq ($(CPU_TYPE),)
|
||||
ifndef CPU_CFLAGS_$(CPU_TYPE)
|
||||
$(warning CPU_TYPE "$(CPU_TYPE)" doesn't correspond to a known type)
|
||||
@@ -370,15 +293,7 @@ ifeq ($(DUMP),1)
|
||||
ifneq ($(CONFIG_CPU_MIPS32_R2),)
|
||||
FEATURES += mips16
|
||||
endif
|
||||
ifneq ($(CONFIG_CPU_V6),)
|
||||
FEATURES += arm_v6
|
||||
endif
|
||||
ifneq ($(CONFIG_CPU_V6K),)
|
||||
FEATURES += arm_v6
|
||||
endif
|
||||
ifneq ($(CONFIG_CPU_V7),)
|
||||
FEATURES += arm_v7
|
||||
endif
|
||||
FEATURES += $(foreach v,6 7,$(if $(CONFIG_CPU_V$(v)),arm_v$(v)))
|
||||
|
||||
# remove duplicates
|
||||
FEATURES:=$(sort $(FEATURES))
|
||||
|
||||
@@ -18,6 +18,6 @@ define FixupLibdir
|
||||
mkdir -p $(1)/lib; \
|
||||
mv $(1)/lib64/* $(1)/lib/; \
|
||||
rm -rf $(1)/lib64; \
|
||||
ln -sf lib $(1)/lib64; \
|
||||
fi
|
||||
ln -sf lib $(1)/lib64
|
||||
endef
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
PREP_MK= OPENWRT_BUILD= QUIET=0
|
||||
|
||||
export IS_TTY=$(if $(MAKE_TERMOUT),1,0)
|
||||
export IS_TTY=$(shell tty -s && echo 1 || echo 0)
|
||||
|
||||
include $(TOPDIR)/include/verbose.mk
|
||||
|
||||
@@ -50,14 +50,12 @@ space:= $(empty) $(empty)
|
||||
path:=$(subst :,$(space),$(PATH))
|
||||
path:=$(filter-out .%,$(path))
|
||||
path:=$(subst $(space),:,$(path))
|
||||
export ORIG_PATH:=$(if $(ORIG_PATH),$(ORIG_PATH),$(PATH))
|
||||
export PATH:=$(path)
|
||||
export STAGING_DIR_HOST:=$(if $(STAGING_DIR),$(abspath $(STAGING_DIR)/../host),$(TOPDIR)/staging_dir/host)
|
||||
|
||||
unexport TAR_OPTIONS
|
||||
|
||||
ifeq ($(FORCE),)
|
||||
.config scripts/config/conf scripts/config/mconf: $(STAGING_DIR_HOST)/.prereq-build
|
||||
.config scripts/config/conf scripts/config/mconf: staging_dir/host/.prereq-build
|
||||
endif
|
||||
|
||||
SCAN_COOKIE?=$(shell echo $$$$)
|
||||
@@ -67,7 +65,7 @@ SUBMAKE:=umask 022; $(SUBMAKE)
|
||||
|
||||
ULIMIT_FIX=_limit=`ulimit -n`; [ "$$_limit" = "unlimited" -o "$$_limit" -ge 1024 ] || ulimit -n 1024;
|
||||
|
||||
prepare-mk: $(STAGING_DIR_HOST)/.prereq-build FORCE ;
|
||||
prepare-mk: staging_dir/host/.prereq-build FORCE ;
|
||||
|
||||
ifdef SDK
|
||||
IGNORE_PACKAGES = linux
|
||||
@@ -75,27 +73,11 @@ endif
|
||||
|
||||
_ignore = $(foreach p,$(IGNORE_PACKAGES),--ignore $(p))
|
||||
|
||||
# Config that will invalidate the .targetinfo as they will affect
|
||||
# DEFAULT_PACKAGES.
|
||||
# Keep DYNAMIC_DEF_PKG_CONF in sync with target.mk to reflect the same configs
|
||||
DYNAMIC_DEF_PKG_CONF := CONFIG_USE_APK CONFIG_SELINUX CONFIG_SMALL_FLASH CONFIG_SECCOMP
|
||||
check-dynamic-def-pkg: FORCE
|
||||
@+DEF_PKG_CONFS=""; \
|
||||
if [ -f $(TOPDIR)/.config ]; then \
|
||||
for config in $(DYNAMIC_DEF_PKG_CONF); do \
|
||||
DEF_PKG_CONFS="$$DEF_PKG_CONFS "$$(grep "$$config"=y $(TOPDIR)/.config); \
|
||||
done; \
|
||||
fi; \
|
||||
[ ! -f tmp/.packagedynamicdefault ] || OLD_DEF_PKG_CONFS=$$(cat tmp/.packagedynamicdefault); \
|
||||
[ "$$DEF_PKG_CONFS" = "$$OLD_DEF_PKG_CONFS" ] || rm -rf tmp/info/.targetinfo*; \
|
||||
mkdir -p tmp && echo "$$DEF_PKG_CONFS" > tmp/.packagedynamicdefault;
|
||||
|
||||
prepare-tmpinfo: check-dynamic-def-pkg FORCE
|
||||
@+$(MAKE) -r -s $(STAGING_DIR_HOST)/.prereq-build $(PREP_MK)
|
||||
mkdir -p tmp/info feeds
|
||||
[ -e $(TOPDIR)/feeds/base ] || ln -sf $(TOPDIR)/package $(TOPDIR)/feeds/base
|
||||
prepare-tmpinfo: FORCE
|
||||
@+$(MAKE) -r -s staging_dir/host/.prereq-build $(PREP_MK)
|
||||
mkdir -p tmp/info
|
||||
$(_SINGLE)$(NO_TRACE_MAKE) -j1 -r -s -f include/scan.mk SCAN_TARGET="packageinfo" SCAN_DIR="package" SCAN_NAME="package" SCAN_DEPTH=5 SCAN_EXTRA=""
|
||||
$(_SINGLE)$(NO_TRACE_MAKE) -j1 -r -s -f include/scan.mk SCAN_TARGET="targetinfo" SCAN_DIR="target/linux" SCAN_NAME="target" SCAN_DEPTH=3 SCAN_EXTRA="" SCAN_MAKEOPTS="TARGET_BUILD=1"
|
||||
$(_SINGLE)$(NO_TRACE_MAKE) -j1 -r -s -f include/scan.mk SCAN_TARGET="targetinfo" SCAN_DIR="target/linux" SCAN_NAME="target" SCAN_DEPTH=2 SCAN_EXTRA="" SCAN_MAKEOPTS="TARGET_BUILD=1"
|
||||
for type in package target; do \
|
||||
f=tmp/.$${type}info; t=tmp/.config-$${type}.in; \
|
||||
[ "$$t" -nt "$$f" ] || ./scripts/$${type}-metadata.pl $(_ignore) config "$$f" > "$$t" || { rm -f "$$t"; echo "Failed to build $$t"; false; break; }; \
|
||||
@@ -119,7 +101,7 @@ ifneq ($(DISTRO_PKG_CONFIG),)
|
||||
scripts/config/%onf: export PATH:=$(dir $(DISTRO_PKG_CONFIG)):$(PATH)
|
||||
endif
|
||||
scripts/config/%onf: CFLAGS+= -O2
|
||||
scripts/config/%onf: FORCE
|
||||
scripts/config/%onf:
|
||||
@$(_SINGLE)$(SUBMAKE) $(if $(findstring s,$(OPENWRT_VERBOSE)),,-s) \
|
||||
-C scripts/config $(notdir $@)
|
||||
|
||||
@@ -169,7 +151,7 @@ xconfig: scripts/config/qconf prepare-tmpinfo FORCE
|
||||
|
||||
prepare_kernel_conf: .config toolchain/install FORCE
|
||||
|
||||
ifeq ($(wildcard $(STAGING_DIR_HOST)/bin/quilt),)
|
||||
ifeq ($(wildcard staging_dir/host/bin/quilt),)
|
||||
prepare_kernel_conf:
|
||||
@+$(SUBMAKE) -r tools/quilt/compile
|
||||
else
|
||||
@@ -193,7 +175,7 @@ kernel_nconfig: prepare_kernel_conf
|
||||
kernel_xconfig: prepare_kernel_conf
|
||||
$(_SINGLE)$(NO_TRACE_MAKE) -C target/linux xconfig
|
||||
|
||||
$(STAGING_DIR_HOST)/.prereq-build: include/prereq-build.mk
|
||||
staging_dir/host/.prereq-build: include/prereq-build.mk
|
||||
mkdir -p tmp
|
||||
@$(_SINGLE)$(NO_TRACE_MAKE) -j1 -r -s -f $(TOPDIR)/include/prereq-build.mk prereq 2>/dev/null || { \
|
||||
echo "Prerequisite check failed. Use FORCE=1 to override."; \
|
||||
@@ -216,7 +198,7 @@ else
|
||||
DOWNLOAD_DIRS = package/download
|
||||
endif
|
||||
|
||||
download: .config FORCE $(if $(wildcard $(STAGING_DIR_HOST)/bin/flock),,tools/flock/compile)
|
||||
download: .config FORCE $(if $(wildcard $(TOPDIR)/staging_dir/host/bin/flock),,tools/flock/compile)
|
||||
@+$(foreach dir,$(DOWNLOAD_DIRS),$(SUBMAKE) $(dir);)
|
||||
|
||||
clean dirclean: .config
|
||||
@@ -228,7 +210,7 @@ prereq:: prepare-tmpinfo .config
|
||||
check: .config FORCE
|
||||
@+$(NO_TRACE_MAKE) -r -s $@ QUIET= V=s
|
||||
|
||||
val.% var.%: FORCE
|
||||
val.%: FORCE
|
||||
@+$(NO_TRACE_MAKE) -r -s $@ QUIET= V=s
|
||||
|
||||
WARN_PARALLEL_ERROR = $(if $(BUILD_LOG),,$(and $(filter -j,$(MAKEFLAGS)),$(findstring s,$(OPENWRT_VERBOSE))))
|
||||
@@ -276,11 +258,11 @@ help:
|
||||
cat README.md
|
||||
|
||||
distclean:
|
||||
rm -rf bin build_dir .ccache .config* dl feeds key-build* logs package/feeds target/linux/feeds staging_dir tmp
|
||||
rm -rf bin build_dir .ccache .config* dl feeds key-build* logs package/feeds package/openwrt-packages staging_dir tmp
|
||||
@$(_SINGLE)$(SUBMAKE) -C scripts/config clean
|
||||
|
||||
ifeq ($(findstring v,$(DEBUG)),)
|
||||
.SILENT: symlinkclean clean dirclean distclean config-clean download help tmpinfo-clean .config scripts/config/mconf scripts/config/conf menuconfig $(STAGING_DIR_HOST)/.prereq-build tmp/.prereq-package prepare-tmpinfo
|
||||
.SILENT: symlinkclean clean dirclean distclean config-clean download help tmpinfo-clean .config scripts/config/mconf scripts/config/conf menuconfig staging_dir/host/.prereq-build tmp/.prereq-package prepare-tmpinfo
|
||||
endif
|
||||
.PHONY: help FORCE
|
||||
.NOTPARALLEL:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
PKG_NAME ?= trusted-firmware-a
|
||||
PKG_CPE_ID ?= cpe:/a:arm:trusted_firmware-a
|
||||
PKG_CPE_ID ?= cpe:/a:arm:arm_trusted_firmware
|
||||
|
||||
ifndef PKG_SOURCE_PROTO
|
||||
PKG_SOURCE = trusted-firmware-a-$(PKG_VERSION).tar.gz
|
||||
@@ -63,27 +63,18 @@ define Build/Trusted-Firmware-A/Target
|
||||
URL:=https://www.trustedfirmware.org/projects/tf-a/
|
||||
endef
|
||||
|
||||
ifndef Package/trusted-firmware-a-$(1)/install
|
||||
define Package/trusted-firmware-a-$(1)/install
|
||||
define Package/trusted-firmware-a-$(1)/install
|
||||
$$(Package/trusted-firmware-a/install)
|
||||
endef
|
||||
endif
|
||||
endef
|
||||
endef
|
||||
|
||||
define Build/Configure/Trusted-Firmware-A
|
||||
$(INSTALL_DIR) $(STAGING_DIR)/usr/include
|
||||
endef
|
||||
|
||||
DTC=$(wildcard $(LINUX_DIR)/scripts/dtc/dtc)
|
||||
|
||||
define Build/Compile/Trusted-Firmware-A
|
||||
+$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
|
||||
CROSS_COMPILE=$(TARGET_CROSS) \
|
||||
OPENSSL_DIR=$(STAGING_DIR_HOST) \
|
||||
$(if $(DTC),DTC="$(DTC)") \
|
||||
PLAT=$(PLAT) \
|
||||
BUILD_STRING="OpenWrt v$(PKG_VERSION)-$(PKG_RELEASE) ($(VARIANT))" \
|
||||
$(if $(CONFIG_BINUTILS_VERSION_2_37)$(CONFIG_BINUTILS_VERSION_2_38),,LDFLAGS="-no-warn-rwx-segments") \
|
||||
$(TFA_MAKE_FLAGS)
|
||||
endef
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
include $(INCLUDE_DIR)/prereq.mk
|
||||
|
||||
PKG_NAME ?= u-boot
|
||||
|
||||
ifndef PKG_SOURCE_PROTO
|
||||
@@ -18,32 +16,7 @@ PKG_FLAGS:=nonshared
|
||||
PKG_LICENSE:=GPL-2.0 GPL-2.0+
|
||||
PKG_LICENSE_FILES:=Licenses/README
|
||||
|
||||
PKG_BUILD_PARALLEL ?= 1
|
||||
|
||||
ifdef UBOOT_USE_BINMAN
|
||||
$(eval $(call TestHostCommand,python3-pyelftools, \
|
||||
Please install the Python3 elftools module, \
|
||||
$(STAGING_DIR_HOST)/bin/python3 -c 'import elftools'))
|
||||
endif
|
||||
|
||||
ifdef UBOOT_USE_INTREE_DTC
|
||||
$(eval $(call TestHostCommand,python3-dev, \
|
||||
Please install the python3-dev package, \
|
||||
python3.11-config --includes 2>&1 | grep 'python3', \
|
||||
python3.10-config --includes 2>&1 | grep 'python3', \
|
||||
python3.9-config --includes 2>&1 | grep 'python3', \
|
||||
python3.8-config --includes 2>&1 | grep 'python3', \
|
||||
python3.7-config --includes 2>&1 | grep 'python3', \
|
||||
python3-config --includes 2>&1 | grep -E 'python3\.([7-9]|[0-9][0-9])\.?'))
|
||||
|
||||
$(eval $(call TestHostCommand,python3-setuptools, \
|
||||
Please install the Python3 setuptools module, \
|
||||
$(STAGING_DIR_HOST)/bin/python3 -c 'import setuptools'))
|
||||
|
||||
$(eval $(call TestHostCommand,swig, \
|
||||
Please install the swig package, \
|
||||
swig -version))
|
||||
endif
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
export GCC_HONOUR_COPTS=s
|
||||
|
||||
@@ -69,16 +42,9 @@ endef
|
||||
TARGET_DEP = TARGET_$(BUILD_TARGET)$(if $(BUILD_SUBTARGET),_$(BUILD_SUBTARGET))
|
||||
|
||||
UBOOT_MAKE_FLAGS = \
|
||||
PATH=$(STAGING_DIR_HOST)/bin:$(PATH) \
|
||||
HOSTCC="$(HOSTCC)" \
|
||||
HOSTCFLAGS="$(HOST_CFLAGS) $(HOST_CPPFLAGS) -std=gnu11" \
|
||||
HOSTLDFLAGS="$(HOST_LDFLAGS)" \
|
||||
LOCALVERSION="-OpenWrt-$(REVISION)" \
|
||||
STAGING_PREFIX="$(STAGING_DIR_HOST)" \
|
||||
PKG_CONFIG_PATH="$(STAGING_DIR_HOST)/lib/pkgconfig" \
|
||||
PKG_CONFIG_LIBDIR="$(STAGING_DIR_HOST)/lib/pkgconfig" \
|
||||
PKG_CONFIG_EXTRAARGS="--static" \
|
||||
$(if $(findstring c,$(OPENWRT_VERBOSE)),V=1,V='')
|
||||
HOSTLDFLAGS="$(HOST_LDFLAGS)"
|
||||
|
||||
define Build/U-Boot/Target
|
||||
$(eval $(call U-Boot/Init,$(1)))
|
||||
@@ -110,15 +76,10 @@ define Build/U-Boot/Target
|
||||
endef
|
||||
|
||||
define Build/Configure/U-Boot
|
||||
+$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) CROSS_COMPILE=$(TARGET_CROSS) $(UBOOT_CONFIGURE_VARS) $(UBOOT_CONFIG)_config
|
||||
$(if $(strip $(UBOOT_CUSTOMIZE_CONFIG)),
|
||||
$(PKG_BUILD_DIR)/scripts/config --file $(PKG_BUILD_DIR)/.config $(UBOOT_CUSTOMIZE_CONFIG)
|
||||
+$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) CROSS_COMPILE=$(TARGET_CROSS) $(UBOOT_CONFIGURE_VARS) oldconfig)
|
||||
+$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) $(UBOOT_CONFIGURE_VARS) $(UBOOT_CONFIG)_config
|
||||
endef
|
||||
|
||||
ifndef UBOOT_USE_INTREE_DTC
|
||||
DTC=$(wildcard $(LINUX_DIR)/scripts/dtc/dtc)
|
||||
endif
|
||||
DTC=$(wildcard $(LINUX_DIR)/scripts/dtc/dtc)
|
||||
|
||||
define Build/Compile/U-Boot
|
||||
+$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
|
||||
|
||||
@@ -1,2 +1,16 @@
|
||||
$(warn uclibc++.mk is deprecated. Please remove it and CXX_DEPENDS)
|
||||
CXX_DEPENDS = +libstdcpp
|
||||
ifndef DUMP
|
||||
ifdef __package_mk
|
||||
$(error uclibc++.mk must be included before package.mk)
|
||||
endif
|
||||
endif
|
||||
|
||||
PKG_PREPARED_DEPENDS += CONFIG_USE_UCLIBCXX
|
||||
CXX_DEPENDS = +USE_UCLIBCXX:uclibcxx +USE_LIBSTDCXX:libstdcpp
|
||||
|
||||
ifneq ($(CONFIG_USE_UCLIBCXX),)
|
||||
ifneq ($(CONFIG_CCACHE),)
|
||||
TARGET_CXX_NOCACHE=g++-uc
|
||||
else
|
||||
TARGET_CXX=g++-uc
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -18,7 +18,7 @@ ifeq ($(strip $(UNPACK_CMD)),)
|
||||
|
||||
ifeq ($(filter gz tgz,$(EXT)),$(EXT))
|
||||
EXT:=$(call ext,$(PKG_SOURCE:.$(EXT)=))
|
||||
DECOMPRESS_CMD:=$(STAGING_DIR_HOST)/bin/libdeflate-gzip -dc $(DL_DIR)/$(PKG_SOURCE) |
|
||||
DECOMPRESS_CMD:=gzip -dc $(DL_DIR)/$(PKG_SOURCE) |
|
||||
endif
|
||||
ifeq ($(filter bzip2 bz2 bz tbz2 tbz,$(EXT)),$(EXT))
|
||||
EXT:=$(call ext,$(PKG_SOURCE:.$(EXT)=))
|
||||
@@ -40,7 +40,7 @@ ifeq ($(strip $(UNPACK_CMD)),)
|
||||
UNPACK_CMD=$(DECOMPRESS_CMD) $(TAR_CMD)
|
||||
endif
|
||||
ifeq ($(EXT),cpio)
|
||||
UNPACK_CMD=$(DECOMPRESS_CMD) (cd $(1)/..; $(STAGING_DIR_HOST)/bin/cpio -i -d)
|
||||
UNPACK_CMD=$(DECOMPRESS_CMD) (cd $(1)/..; cpio -i -d)
|
||||
endif
|
||||
ifeq ($(EXT),zip)
|
||||
UNPACK_CMD=$(UNZIP_CMD)
|
||||
@@ -56,7 +56,7 @@ ifeq ($(strip $(UNPACK_CMD)),)
|
||||
endif
|
||||
# replace zcat with $(ZCAT), because some system don't support it properly
|
||||
ifeq ($(PKG_CAT),zcat)
|
||||
UNPACK_CMD=$(STAGING_DIR_HOST)/bin/libdeflate-gzip -dc $(DL_DIR)/$(PKG_SOURCE) | $(TAR_CMD)
|
||||
UNPACK_CMD=gzip -dc $(DL_DIR)/$(PKG_SOURCE) | $(TAR_CMD)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -29,19 +29,13 @@ ifeq ($(IS_TTY),1)
|
||||
endif
|
||||
endif
|
||||
|
||||
define ERROR_MESSAGE
|
||||
{ \
|
||||
printf "$(_R)%s$(_N)\n" "$(1)" >&9 || \
|
||||
printf "$(_R)%s$(_N)\n" "$(1)"; \
|
||||
} >&2 2>/dev/null
|
||||
endef
|
||||
|
||||
ifeq ($(findstring s,$(OPENWRT_VERBOSE)),)
|
||||
define MESSAGE
|
||||
{ \
|
||||
printf "$(_Y)%s$(_N)\n" "$(1)" >&8 || \
|
||||
printf "$(_Y)%s$(_N)\n" "$(1)"; \
|
||||
} 2>/dev/null
|
||||
printf "$(_Y)%s$(_N)\n" "$(1)" >&8
|
||||
endef
|
||||
|
||||
define ERROR_MESSAGE
|
||||
printf "$(_R)%s$(_N)\n" "$(1)" >&8
|
||||
endef
|
||||
|
||||
ifeq ($(QUIET),1)
|
||||
@@ -50,12 +44,9 @@ ifeq ($(findstring s,$(OPENWRT_VERBOSE)),)
|
||||
else
|
||||
_DIR:=
|
||||
endif
|
||||
_MESSAGE:=$(if $(MAKECMDGOALS),$(shell \
|
||||
_NULL:=$(if $(MAKECMDGOALS),$(shell \
|
||||
$(call MESSAGE, make[$(MAKELEVEL)]$(if $(_DIR), -C $(_DIR)) $(MAKECMDGOALS)); \
|
||||
))
|
||||
ifneq ($(strip $(_MESSAGE)),)
|
||||
$(info $(_MESSAGE))
|
||||
endif
|
||||
SUBMAKE=$(MAKE)
|
||||
else
|
||||
SILENT:=>/dev/null $(if $(findstring w,$(OPENWRT_VERBOSE)),,2>&1)
|
||||
@@ -69,4 +60,5 @@ else
|
||||
define MESSAGE
|
||||
printf "%s\n" "$(1)"
|
||||
endef
|
||||
ERROR_MESSAGE=$(MESSAGE)
|
||||
endif
|
||||
|
||||
@@ -23,13 +23,13 @@ PKG_CONFIG_DEPENDS += \
|
||||
sanitize = $(call tolower,$(subst _,-,$(subst $(space),-,$(1))))
|
||||
|
||||
VERSION_NUMBER:=$(call qstrip,$(CONFIG_VERSION_NUMBER))
|
||||
VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),24.10.0-rc2)
|
||||
VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),21.02.0-rc2)
|
||||
|
||||
VERSION_CODE:=$(call qstrip,$(CONFIG_VERSION_CODE))
|
||||
VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),r28161-ea17e958b9)
|
||||
VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),r16122-c2139eef27)
|
||||
|
||||
VERSION_REPO:=$(call qstrip,$(CONFIG_VERSION_REPO))
|
||||
VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),https://downloads.openwrt.org/releases/24.10.0-rc2)
|
||||
VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),https://downloads.openwrt.org/releases/21.02.0-rc2)
|
||||
|
||||
VERSION_DIST:=$(call qstrip,$(CONFIG_VERSION_DIST))
|
||||
VERSION_DIST:=$(if $(VERSION_DIST),$(VERSION_DIST),OpenWrt)
|
||||
@@ -95,7 +95,7 @@ VERSION_SED_SCRIPT:=$(SED) 's,%U,$(call sed_escape,$(VERSION_REPO)),g' \
|
||||
-e 's,%d,\L$(call sed_escape,$(subst $(space),_,$(VERSION_DIST))),g' \
|
||||
-e 's,%R,$(call sed_escape,$(REVISION)),g' \
|
||||
-e 's,%T,$(call sed_escape,$(BOARD)),g' \
|
||||
-e 's,%S,$(call sed_escape,$(BOARD)/$(SUBTARGET)),g' \
|
||||
-e 's,%S,$(call sed_escape,$(BOARD)/$(if $(SUBTARGET),$(SUBTARGET),generic)),g' \
|
||||
-e 's,%A,$(call sed_escape,$(ARCH_PACKAGES)),g' \
|
||||
-e 's,%t,$(call sed_escape,$(VERSION_TAINTS)),g' \
|
||||
-e 's,%M,$(call sed_escape,$(VERSION_MANUFACTURER)),g' \
|
||||
@@ -104,6 +104,5 @@ VERSION_SED_SCRIPT:=$(SED) 's,%U,$(call sed_escape,$(VERSION_REPO)),g' \
|
||||
-e 's,%u,$(call sed_escape,$(VERSION_HOME_URL)),g' \
|
||||
-e 's,%s,$(call sed_escape,$(VERSION_SUPPORT_URL)),g' \
|
||||
-e 's,%P,$(call sed_escape,$(VERSION_PRODUCT)),g' \
|
||||
-e 's,%h,$(call sed_escape,$(VERSION_HWREV)),g' \
|
||||
-e 's,%B,$(call sed_escape,$(SOURCE_DATE_EPOCH)),g'
|
||||
-e 's,%h,$(call sed_escape,$(VERSION_HWREV)),g'
|
||||
|
||||
|
||||
@@ -53,66 +53,27 @@ $(curdir)/cleanup: $(TMP_DIR)/.build
|
||||
$(curdir)/merge:
|
||||
rm -rf $(PACKAGE_DIR_ALL)
|
||||
mkdir -p $(PACKAGE_DIR_ALL)
|
||||
ifneq ($(CONFIG_USE_APK),)
|
||||
-$(foreach pdir,$(PACKAGE_SUBDIRS),$(if $(wildcard $(pdir)/*.apk),ln -s $(pdir)/*.apk $(PACKAGE_DIR_ALL);))
|
||||
else
|
||||
-$(foreach pdir,$(PACKAGE_SUBDIRS),$(if $(wildcard $(pdir)/*.ipk),ln -s $(pdir)/*.ipk $(PACKAGE_DIR_ALL);))
|
||||
endif
|
||||
|
||||
$(BUILD_KEY_APK_SEC):
|
||||
$(STAGING_DIR_HOST)/bin/openssl ecparam -name prime256v1 -genkey -noout -out $(BUILD_KEY_APK_SEC)
|
||||
|
||||
$(BUILD_KEY_APK_PUB): $(BUILD_KEY_APK_SEC)
|
||||
$(STAGING_DIR_HOST)/bin/openssl ec -in $(BUILD_KEY_APK_SEC) -pubout > $(BUILD_KEY_APK_PUB)
|
||||
|
||||
$(curdir)/merge-index: $(curdir)/merge
|
||||
ifneq ($(CONFIG_USE_APK),)
|
||||
(cd $(PACKAGE_DIR_ALL) && $(STAGING_DIR_HOST)/bin/apk mkndx \
|
||||
--root $(TOPDIR) \
|
||||
--keys-dir $(TOPDIR) \
|
||||
--sign $(BUILD_KEY_APK_SEC) \
|
||||
--output packages.adb \
|
||||
*.apk; \
|
||||
)
|
||||
else
|
||||
(cd $(PACKAGE_DIR_ALL) && $(SCRIPT_DIR)/ipkg-make-index.sh . 2>&1 > Packages; )
|
||||
endif
|
||||
|
||||
ifndef SDK
|
||||
$(curdir)//compile = $(STAGING_DIR)/.prepared $(BIN_DIR)
|
||||
ifneq ($(CONFIG_USE_APK),)
|
||||
$(curdir)//compile += $(curdir)/system/apk/host/compile $(BUILD_KEY_APK_SEC) $(BUILD_KEY_APK_PUB)
|
||||
else
|
||||
$(curdir)/compile: $(curdir)/system/opkg/host/compile
|
||||
endif
|
||||
else
|
||||
ifneq ($(CONFIG_USE_APK),)
|
||||
$(curdir)//compile += $(BUILD_KEY_APK_SEC) $(BUILD_KEY_APK_PUB)
|
||||
endif
|
||||
endif
|
||||
|
||||
$(curdir)/install: $(TMP_DIR)/.build $(curdir)/merge $(curdir)/merge-index
|
||||
$(curdir)/install: $(TMP_DIR)/.build $(curdir)/merge $(if $(CONFIG_TARGET_PER_DEVICE_ROOTFS),$(curdir)/merge-index)
|
||||
- find $(STAGING_DIR_ROOT) -type d | $(XARGS) chmod 0755
|
||||
rm -rf $(TARGET_DIR) $(TARGET_DIR_ORIG)
|
||||
mkdir -p $(TARGET_DIR)/tmp
|
||||
ifneq ($(CONFIG_USE_APK),)
|
||||
$(file >$(TMP_DIR)/apk_install_list,\
|
||||
$(foreach pkg,$(shell cat $(PACKAGE_INSTALL_FILES) 2>/dev/null),$(pkg)$(call GetABISuffix,$(pkg))))
|
||||
$(call apk,$(TARGET_DIR)) add --initdb --no-scripts --arch $(ARCH_PACKAGES) \
|
||||
--repositories-file /dev/zero --repository file://$(PACKAGE_DIR_ALL)/packages.adb \
|
||||
$$(cat $(TMP_DIR)/apk_install_list)
|
||||
else
|
||||
$(file >$(TMP_DIR)/opkg_install_list,\
|
||||
$(call opkg_package_files,\
|
||||
$(foreach pkg,$(shell cat $(PACKAGE_INSTALL_FILES) 2>/dev/null),$(pkg)$(call GetABISuffix,$(pkg)))))
|
||||
$(call opkg,$(TARGET_DIR)) install $$(cat $(TMP_DIR)/opkg_install_list)
|
||||
$(call opkg,$(TARGET_DIR)) install \
|
||||
$(call opkg_package_files,$(foreach pkg,$(shell cat $(PACKAGE_INSTALL_FILES) 2>/dev/null),$(pkg)$(call GetABISuffix,$(pkg))))
|
||||
@for file in $(PACKAGE_INSTALL_FILES); do \
|
||||
[ -s $$file.flags ] || continue; \
|
||||
for flag in `cat $$file.flags`; do \
|
||||
$(call opkg,$(TARGET_DIR)) flag $$flag `cat $$file`; \
|
||||
done; \
|
||||
done || true
|
||||
endif
|
||||
|
||||
$(CP) $(TARGET_DIR) $(TARGET_DIR_ORIG)
|
||||
|
||||
@@ -120,19 +81,6 @@ endif
|
||||
|
||||
$(curdir)/index: FORCE
|
||||
@echo Generating package index...
|
||||
ifneq ($(CONFIG_USE_APK),)
|
||||
@for d in $(PACKAGE_SUBDIRS); do \
|
||||
mkdir -p $$d; \
|
||||
cd $$d || continue; \
|
||||
ls *.apk >/dev/null 2>&1 || continue; \
|
||||
$(STAGING_DIR_HOST)/bin/apk mkndx \
|
||||
--root $(TOPDIR) \
|
||||
--keys-dir $(TOPDIR) \
|
||||
--sign $(BUILD_KEY_APK_SEC) \
|
||||
--output packages.adb \
|
||||
$$(ls *.apk | grep -v 'kernel\|libc'); \
|
||||
done
|
||||
else
|
||||
@for d in $(PACKAGE_SUBDIRS); do ( \
|
||||
mkdir -p $$d; \
|
||||
cd $$d || continue; \
|
||||
@@ -142,10 +90,6 @@ else
|
||||
$(call ERROR_MESSAGE,WARNING: Applying padding in $$d/Packages to workaround usign SHA-512 bug!); \
|
||||
{ echo ""; echo ""; } >> Packages;; \
|
||||
esac; \
|
||||
echo -n '{"architecture": "$(ARCH_PACKAGES)", "packages":{' > index.json; \
|
||||
sed -n -e 's/^Package: \(.*\)$$/"\1":/p' -e 's/^Version: \(.*\)$$/"\1",/p' Packages | tr '\n' ' ' >> index.json; \
|
||||
echo '}}' >> index.json; \
|
||||
sed -i 's/, }}/}}/' index.json; \
|
||||
gzip -9nc Packages > Packages.gz; \
|
||||
); done
|
||||
ifdef CONFIG_SIGNED_PACKAGES
|
||||
@@ -156,15 +100,6 @@ ifdef CONFIG_SIGNED_PACKAGES
|
||||
$(STAGING_DIR_HOST)/bin/usign -S -m Packages -s $(BUILD_KEY); \
|
||||
); done
|
||||
endif
|
||||
ifdef CONFIG_JSON_CYCLONEDX_SBOM
|
||||
@echo Creating CycloneDX package SBOMs...
|
||||
@for d in $(PACKAGE_SUBDIRS); do ( \
|
||||
[ -d $$d ] && \
|
||||
cd $$d || continue; \
|
||||
$(SCRIPT_DIR)/package-metadata.pl pkgcyclonedxsbom Packages.manifest > Packages.bom.cdx.json || true; \
|
||||
); done
|
||||
endif
|
||||
endif
|
||||
|
||||
$(curdir)/flags-install:= -j1
|
||||
|
||||
|
||||
@@ -23,8 +23,6 @@ PKG_LICENSE:=GPL-2.0
|
||||
PKG_CONFIG_DEPENDS += \
|
||||
CONFIG_SIGNED_PACKAGES CONFIG_TARGET_INIT_PATH CONFIG_TARGET_PREINIT_DISABLE_FAILSAFE \
|
||||
CONFIG_NAND_SUPPORT \
|
||||
CONFIG_LEGACY_SDCARD_SUPPORT \
|
||||
CONFIG_EMMC_SUPPORT \
|
||||
CONFIG_CLEAN_IPKG \
|
||||
CONFIG_PER_FEED_REPO \
|
||||
$(foreach feed,$(FEEDS_AVAILABLE),CONFIG_FEED_$(feed))
|
||||
@@ -32,7 +30,7 @@ PKG_CONFIG_DEPENDS += \
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
ifneq ($(DUMP),1)
|
||||
STAMP_CONFIGURED:=$(strip $(STAMP_CONFIGURED))_$(shell echo $(CONFIG_TARGET_INIT_PATH) | $(MKHASH) md5)
|
||||
STAMP_CONFIGURED:=$(strip $(STAMP_CONFIGURED))_$(shell echo $(CONFIG_TARGET_INIT_PATH) | mkhash md5)
|
||||
TARGET:=-$(BOARD)
|
||||
endif
|
||||
|
||||
@@ -42,13 +40,14 @@ define Package/base-files
|
||||
DEPENDS:=+netifd +libc +jsonfilter +SIGNED_PACKAGES:usign +SIGNED_PACKAGES:openwrt-keyring +NAND_SUPPORT:ubi-utils +fstools +fwtool
|
||||
TITLE:=Base filesystem for OpenWrt
|
||||
URL:=http://openwrt.org/
|
||||
VERSION:=$(PKG_RELEASE)~$(lastword $(subst -, ,$(REVISION)))
|
||||
VERSION:=$(PKG_RELEASE)-$(REVISION)
|
||||
endef
|
||||
|
||||
define Package/base-files/conffiles
|
||||
/etc/config/
|
||||
/etc/config/network
|
||||
/etc/config/system
|
||||
/etc/crontabs/
|
||||
/etc/dropbear/
|
||||
/etc/ethers
|
||||
/etc/group
|
||||
@@ -77,7 +76,7 @@ endef
|
||||
define ImageConfigOptions
|
||||
mkdir -p $(1)/lib/preinit
|
||||
echo 'pi_suppress_stderr="$(CONFIG_TARGET_PREINIT_SUPPRESS_STDERR)"' >$(1)/lib/preinit/00_preinit.conf
|
||||
echo 'fs_failsafe_wait_timeout=$(if $(CONFIG_TARGET_PREINIT_TIMEOUT),$(CONFIG_TARGET_PREINIT_TIMEOUT),4)' >>$(1)/lib/preinit/00_preinit.conf
|
||||
echo 'fs_failsafe_wait_timeout=$(if $(CONFIG_TARGET_PREINIT_TIMEOUT),$(CONFIG_TARGET_PREINIT_TIMEOUT),2)' >>$(1)/lib/preinit/00_preinit.conf
|
||||
echo 'pi_init_path="$(TARGET_INIT_PATH)"' >>$(1)/lib/preinit/00_preinit.conf
|
||||
echo 'pi_init_env=$(if $(CONFIG_TARGET_INIT_ENV),$(CONFIG_TARGET_INIT_ENV),"")' >>$(1)/lib/preinit/00_preinit.conf
|
||||
echo 'pi_init_cmd=$(if $(CONFIG_TARGET_INIT_CMD),$(CONFIG_TARGET_INIT_CMD),"/sbin/init")' >>$(1)/lib/preinit/00_preinit.conf
|
||||
@@ -89,41 +88,17 @@ define ImageConfigOptions
|
||||
echo 'pi_preinit_net_messages="$(CONFIG_TARGET_PREINIT_SHOW_NETMSG)"' >>$(1)/lib/preinit/00_preinit.conf
|
||||
echo 'pi_preinit_no_failsafe_netmsg="$(CONFIG_TARGET_PREINIT_SUPPRESS_FAILSAFE_NETMSG)"' >>$(1)/lib/preinit/00_preinit.conf
|
||||
echo 'pi_preinit_no_failsafe="$(CONFIG_TARGET_PREINIT_DISABLE_FAILSAFE)"' >>$(1)/lib/preinit/00_preinit.conf
|
||||
ifeq ($(CONFIG_TARGET_DEFAULT_LAN_IP_FROM_PREINIT),y)
|
||||
mkdir -p $(1)/etc/board.d
|
||||
echo '. /lib/functions/uci-defaults.sh' >$(1)/etc/board.d/99-lan-ip
|
||||
echo 'logger -t 99-lan-ip "setting custom default LAN IP"' >>$(1)/etc/board.d/99-lan-ip
|
||||
echo 'board_config_update' >>$(1)/etc/board.d/99-lan-ip
|
||||
echo 'json_select network' >>$(1)/etc/board.d/99-lan-ip
|
||||
echo 'json_select lan' >>$(1)/etc/board.d/99-lan-ip
|
||||
echo 'json_add_string ipaddr $(if $(CONFIG_TARGET_PREINIT_IP),$(CONFIG_TARGET_PREINIT_IP),"192.168.1.1")' >>$(1)/etc/board.d/99-lan-ip
|
||||
echo 'json_add_string netmask $(if $(CONFIG_TARGET_PREINIT_NETMASK),$(CONFIG_TARGET_PREINIT_NETMASK),"255.255.255.0")' >>$(1)/etc/board.d/99-lan-ip
|
||||
echo 'json_select ..' >>$(1)/etc/board.d/99-lan-ip
|
||||
echo 'json_select ..' >>$(1)/etc/board.d/99-lan-ip
|
||||
echo 'board_config_flush' >>$(1)/etc/board.d/99-lan-ip
|
||||
endif
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
mkdir -p $(PKG_BUILD_DIR)
|
||||
endef
|
||||
|
||||
define Build/Quilt
|
||||
endef
|
||||
|
||||
define Build/Compile/Default
|
||||
|
||||
endef
|
||||
Build/Compile = $(Build/Compile/Default)
|
||||
|
||||
ifneq ($(CONFIG_USE_APK),)
|
||||
ifndef CONFIG_BUILDBOT
|
||||
define Package/base-files/install-key
|
||||
mkdir -p $(1)/etc/apk/keys
|
||||
$(CP) $(BUILD_KEY_APK_PUB) $(1)/etc/apk/keys/
|
||||
endef
|
||||
endif
|
||||
else
|
||||
ifdef CONFIG_SIGNED_PACKAGES
|
||||
define Build/Configure
|
||||
[ -s $(BUILD_KEY) -a -s $(BUILD_KEY).pub ] || \
|
||||
@@ -138,10 +113,10 @@ ifndef CONFIG_BUILDBOT
|
||||
define Package/base-files/install-key
|
||||
mkdir -p $(1)/etc/opkg/keys
|
||||
$(CP) $(BUILD_KEY).pub $(1)/etc/opkg/keys/`$(STAGING_DIR_HOST)/bin/usign -F -p $(BUILD_KEY).pub`
|
||||
|
||||
endef
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_NAND_SUPPORT),)
|
||||
define Package/base-files/nand-support
|
||||
@@ -149,25 +124,10 @@ ifeq ($(CONFIG_NAND_SUPPORT),)
|
||||
endef
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_EMMC_SUPPORT),)
|
||||
define Package/base-files/emmc-support
|
||||
rm -f $(1)/lib/upgrade/emmc.sh
|
||||
endef
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_LEGACY_SDCARD_SUPPORT),)
|
||||
define Package/base-files/legacy-sdcard-support
|
||||
rm -f $(1)/lib/upgrade/legacy-sdcard.sh
|
||||
endef
|
||||
endif
|
||||
|
||||
|
||||
define Package/base-files/install
|
||||
$(CP) ./files/* $(1)/
|
||||
$(Package/base-files/install-key)
|
||||
$(Package/base-files/nand-support)
|
||||
$(Package/base-files/legacy-sdcard-support)
|
||||
$(Package/base-files/emmc-support)
|
||||
if [ -d $(GENERIC_PLATFORM_DIR)/base-files/. ]; then \
|
||||
$(CP) $(GENERIC_PLATFORM_DIR)/base-files/* $(1)/; \
|
||||
fi
|
||||
@@ -182,46 +142,40 @@ define Package/base-files/install
|
||||
|
||||
$(VERSION_SED_SCRIPT) \
|
||||
$(1)/etc/banner \
|
||||
$(1)/etc/device_info \
|
||||
$(1)/etc/openwrt_release \
|
||||
$(1)/etc/openwrt_version \
|
||||
$(1)/usr/lib/os-release
|
||||
|
||||
$(VERSION_SED_SCRIPT) \
|
||||
$(1)/etc/openwrt_release \
|
||||
$(1)/etc/device_info \
|
||||
$(1)/usr/lib/os-release
|
||||
|
||||
$(SED) "s#%PATH%#$(TARGET_INIT_PATH)#g" \
|
||||
$(1)/sbin/hotplug-call \
|
||||
$(1)/etc/preinit \
|
||||
$(1)/etc/profile
|
||||
|
||||
mkdir -p \
|
||||
$(1)/CONTROL \
|
||||
$(1)/dev \
|
||||
$(1)/etc/config \
|
||||
$(1)/etc/crontabs \
|
||||
$(1)/etc/rc.d \
|
||||
$(1)/overlay \
|
||||
$(1)/lib/firmware \
|
||||
$(1)/mnt \
|
||||
$(1)/proc \
|
||||
$(1)/tmp \
|
||||
$(1)/usr/lib \
|
||||
$(1)/usr/bin \
|
||||
$(1)/sys \
|
||||
$(1)/www
|
||||
mkdir -p -m 750 \
|
||||
$(1)/root
|
||||
|
||||
$(LN) /proc/mounts $(1)/etc/mtab
|
||||
mkdir -p $(1)/CONTROL
|
||||
mkdir -p $(1)/dev
|
||||
mkdir -p $(1)/etc/config
|
||||
mkdir -p $(1)/etc/crontabs
|
||||
mkdir -p $(1)/etc/rc.d
|
||||
mkdir -p $(1)/overlay
|
||||
mkdir -p $(1)/lib/firmware
|
||||
$(if $(LIB_SUFFIX),-$(LN) lib $(1)/lib$(LIB_SUFFIX))
|
||||
mkdir -p $(1)/mnt
|
||||
mkdir -p $(1)/proc
|
||||
mkdir -p $(1)/tmp
|
||||
mkdir -p $(1)/usr/lib
|
||||
$(if $(LIB_SUFFIX),-$(LN) lib $(1)/usr/lib$(LIB_SUFFIX))
|
||||
|
||||
ifneq ($(CONFIG_TARGET_ROOTFS_PERSIST_VAR),y)
|
||||
mkdir -p $(1)/usr/bin
|
||||
mkdir -p $(1)/sys
|
||||
mkdir -p $(1)/www
|
||||
mkdir -p $(1)/root
|
||||
$(LN) /proc/mounts $(1)/etc/mtab
|
||||
rm -f $(1)/var
|
||||
$(LN) tmp $(1)/var
|
||||
else
|
||||
mkdir -p $(1)/var
|
||||
$(LN) /tmp/run $(1)/var/run
|
||||
endif
|
||||
mkdir -p $(1)/etc
|
||||
$(LN) /tmp/resolv.conf /tmp/TZ /tmp/localtime $(1)/etc/
|
||||
|
||||
chmod 0600 $(1)/etc/shadow
|
||||
@@ -242,24 +196,15 @@ endif
|
||||
cat $(BIN_DIR)/feeds.buildinfo >>$(1)/etc/build.feeds; \
|
||||
cat $(BIN_DIR)/version.buildinfo >>$(1)/etc/build.version)
|
||||
|
||||
$(if $(CONFIG_TARGET_PREINIT_DISABLE_FAILSAFE), \
|
||||
rm -f $(1)/etc/banner.failsafe,)
|
||||
|
||||
ifneq ($(CONFIG_USE_APK),)
|
||||
mkdir -p $(1)/etc/apk/
|
||||
$(call FeedSourcesAppendAPK,$(1)/etc/apk/repositories)
|
||||
$(VERSION_SED_SCRIPT) $(1)/etc/apk/repositories
|
||||
|
||||
rm -f $(1)/etc/uci-defaults/13_fix-group-user
|
||||
rm -f $(1)/sbin/pkg_check
|
||||
else
|
||||
$(if $(CONFIG_CLEAN_IPKG),, \
|
||||
mkdir -p $(1)/etc/opkg; \
|
||||
$(call FeedSourcesAppendOPKG,$(1)/etc/opkg/distfeeds.conf); \
|
||||
$(call FeedSourcesAppend,$(1)/etc/opkg/distfeeds.conf); \
|
||||
$(VERSION_SED_SCRIPT) $(1)/etc/opkg/distfeeds.conf)
|
||||
$(if $(CONFIG_IPK_FILES_CHECKSUMS),, \
|
||||
rm -f $(1)/sbin/pkg_check)
|
||||
endif
|
||||
|
||||
$(if $(CONFIG_TARGET_PREINIT_DISABLE_FAILSAFE), \
|
||||
rm -f $(1)/etc/banner.failsafe,)
|
||||
endef
|
||||
|
||||
ifneq ($(DUMP),1)
|
||||
|
||||
@@ -6,7 +6,7 @@ CFG=$1
|
||||
|
||||
[ -d "/etc/board.d/" -a ! -s "$CFG" ] && {
|
||||
for a in $(ls /etc/board.d/*); do
|
||||
[ -s $a ] || continue;
|
||||
[ -x $a ] || continue;
|
||||
$(. $a)
|
||||
done
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ generate_network() {
|
||||
|
||||
json_select network
|
||||
json_select "$1"
|
||||
json_get_vars device macaddr metric protocol ipaddr netmask vlan
|
||||
json_get_vars device macaddr protocol ipaddr netmask vlan
|
||||
json_get_values ports ports
|
||||
json_select ..
|
||||
json_select ..
|
||||
@@ -114,17 +114,9 @@ generate_network() {
|
||||
add network device
|
||||
set network.@device[-1].name='br-$1'
|
||||
set network.@device[-1].type='bridge'
|
||||
set network.@device[-1].macaddr='$macaddr'
|
||||
EOF
|
||||
for port in $ports; do uci add_list network.@device[-1].ports="$port"; done
|
||||
[ -n "$macaddr" ] && {
|
||||
for port in $ports; do
|
||||
uci -q batch <<-EOF
|
||||
add network device
|
||||
set network.@device[-1].name='$port'
|
||||
set network.@device[-1].macaddr='$macaddr'
|
||||
EOF
|
||||
done
|
||||
}
|
||||
device=br-$1
|
||||
type=
|
||||
macaddr=""
|
||||
@@ -154,7 +146,6 @@ generate_network() {
|
||||
set network.$1='interface'
|
||||
set network.$1.type='$type'
|
||||
set network.$1.device='$device'
|
||||
set network.$1.metric='$metric'
|
||||
set network.$1.proto='none'
|
||||
EOF
|
||||
|
||||
@@ -207,15 +198,6 @@ generate_network() {
|
||||
EOF
|
||||
}
|
||||
;;
|
||||
|
||||
ncm|\
|
||||
qmi|\
|
||||
mbim)
|
||||
uci -q batch <<-EOF
|
||||
set network.$1.proto='${protocol}'
|
||||
set network.$1.pdptype='ipv4'
|
||||
EOF
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
@@ -314,7 +296,7 @@ generate_static_system() {
|
||||
set system.@system[-1].hostname='OpenWrt'
|
||||
set system.@system[-1].timezone='UTC'
|
||||
set system.@system[-1].ttylogin='0'
|
||||
set system.@system[-1].log_size='128'
|
||||
set system.@system[-1].log_size='64'
|
||||
set system.@system[-1].urandom_seed='0'
|
||||
|
||||
delete system.ntp
|
||||
@@ -341,11 +323,6 @@ generate_static_system() {
|
||||
uci -q set "system.@system[-1].compat_version=1.0"
|
||||
fi
|
||||
|
||||
local timezone
|
||||
if json_get_var timezone timezone; then
|
||||
uci -q set "system.@system[-1].timezone=$timezone"
|
||||
fi
|
||||
|
||||
if json_is_a ntpserver array; then
|
||||
local keys key
|
||||
json_get_keys keys ntpserver
|
||||
|
||||
@@ -1,143 +1,71 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions/ipv4.sh
|
||||
|
||||
PROG="$(basename "$0")"
|
||||
|
||||
# wrapper to convert an integer to an address, unless we're using
|
||||
# decimal output format.
|
||||
# hook for library function
|
||||
_ip2str() {
|
||||
local var="$1" n="$2"
|
||||
assert_uint32 "$n" || exit 1
|
||||
|
||||
if [ "$decimal" -ne 0 ]; then
|
||||
export -- "$var=$n"
|
||||
elif [ "$hexadecimal" -ne 0 ]; then
|
||||
export -- "$var=$(printf "%x" "$n")"
|
||||
else
|
||||
ip2str "$@"
|
||||
fi
|
||||
awk -f - $* <<EOF
|
||||
function bitcount(c) {
|
||||
c=and(rshift(c, 1),0x55555555)+and(c,0x55555555)
|
||||
c=and(rshift(c, 2),0x33333333)+and(c,0x33333333)
|
||||
c=and(rshift(c, 4),0x0f0f0f0f)+and(c,0x0f0f0f0f)
|
||||
c=and(rshift(c, 8),0x00ff00ff)+and(c,0x00ff00ff)
|
||||
c=and(rshift(c,16),0x0000ffff)+and(c,0x0000ffff)
|
||||
return c
|
||||
}
|
||||
|
||||
usage() {
|
||||
echo "Usage: $PROG [ -d | -x ] address/prefix [ start limit ]" >&2
|
||||
exit 1
|
||||
function ip2int(ip) {
|
||||
for (ret=0,n=split(ip,a,"\."),x=1;x<=n;x++) ret=or(lshift(ret,8),a[x])
|
||||
return ret
|
||||
}
|
||||
|
||||
decimal=0
|
||||
hexadecimal=0
|
||||
if [ "$1" = "-d" ]; then
|
||||
decimal=1
|
||||
shift
|
||||
elif [ "$1" = "-x" ]; then
|
||||
hexadecimal=1
|
||||
shift
|
||||
fi
|
||||
function int2ip(ip,ret,x) {
|
||||
ret=and(ip,255)
|
||||
ip=rshift(ip,8)
|
||||
for(;x<3;ret=and(ip,255)"."ret,ip=rshift(ip,8),x++);
|
||||
return ret
|
||||
}
|
||||
|
||||
if [ $# -eq 0 ]; then
|
||||
usage
|
||||
fi
|
||||
function compl32(v) {
|
||||
ret=xor(v, 0xffffffff)
|
||||
return ret
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
*/*.*)
|
||||
# data is n.n.n.n/m.m.m.m format, like on a Cisco router
|
||||
str2ip ipaddr "${1%/*}" || exit 1
|
||||
str2ip netmask "${1#*/}" || exit 1
|
||||
netmask2prefix prefix "$netmask" || exit 1
|
||||
shift
|
||||
;;
|
||||
*/*)
|
||||
# more modern prefix notation of n.n.n.n/p
|
||||
str2ip ipaddr "${1%/*}" || exit 1
|
||||
prefix="${1#*/}"
|
||||
assert_uint32 "$prefix" || exit 1
|
||||
if [ "$prefix" -gt 32 ]; then
|
||||
printf "Prefix out of range (%s)\n" "$prefix" >&2
|
||||
exit 1
|
||||
fi
|
||||
prefix2netmask netmask "$prefix" || exit 1
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
# address and netmask as two separate arguments
|
||||
str2ip ipaddr "$1" || exit 1
|
||||
str2ip netmask "$2" || exit 1
|
||||
netmask2prefix prefix "$netmask" || exit 1
|
||||
shift 2
|
||||
;;
|
||||
esac
|
||||
BEGIN {
|
||||
slpos=index(ARGV[1],"/")
|
||||
if (slpos == 0) {
|
||||
ipaddr=ip2int(ARGV[1])
|
||||
dotpos=index(ARGV[2],".")
|
||||
if (dotpos == 0)
|
||||
netmask=compl32(2**(32-int(ARGV[2]))-1)
|
||||
else
|
||||
netmask=ip2int(ARGV[2])
|
||||
} else {
|
||||
ipaddr=ip2int(substr(ARGV[1],0,slpos-1))
|
||||
netmask=compl32(2**(32-int(substr(ARGV[1],slpos+1)))-1)
|
||||
ARGV[4]=ARGV[3]
|
||||
ARGV[3]=ARGV[2]
|
||||
}
|
||||
|
||||
# we either have no arguments left, or we have a range start and length
|
||||
if [ $# -ne 0 ] && [ $# -ne 2 ]; then
|
||||
usage
|
||||
fi
|
||||
network=and(ipaddr,netmask)
|
||||
broadcast=or(network,compl32(netmask))
|
||||
|
||||
# complement of the netmask, i.e. the hostmask
|
||||
hostmask=$((netmask ^ 0xffffffff))
|
||||
network=$((ipaddr & netmask))
|
||||
broadcast=$((network | hostmask))
|
||||
count=$((hostmask + 1))
|
||||
start=or(network,and(ip2int(ARGV[3]),compl32(netmask)))
|
||||
limit=network+1
|
||||
if (start<limit) start=limit
|
||||
|
||||
_ip2str IP "$ipaddr"
|
||||
_ip2str NETMASK "$netmask"
|
||||
_ip2str NETWORK "$network"
|
||||
end=start+ARGV[4]
|
||||
limit=or(network,compl32(netmask))-1
|
||||
if (end>limit) end=limit
|
||||
|
||||
echo "IP=$IP"
|
||||
echo "NETMASK=$NETMASK"
|
||||
# don't include this-network or broadcast addresses
|
||||
if [ "$prefix" -le 30 ]; then
|
||||
_ip2str BROADCAST "$broadcast"
|
||||
echo "BROADCAST=$BROADCAST"
|
||||
fi
|
||||
echo "NETWORK=$NETWORK"
|
||||
echo "PREFIX=$prefix"
|
||||
echo "COUNT=$count"
|
||||
print "IP="int2ip(ipaddr)
|
||||
print "NETMASK="int2ip(netmask)
|
||||
print "BROADCAST="int2ip(broadcast)
|
||||
print "NETWORK="int2ip(network)
|
||||
print "PREFIX="32-bitcount(compl32(netmask))
|
||||
|
||||
# if there's no range, we're done
|
||||
[ $# -eq 0 ] && exit 0
|
||||
[ -z "$1$2" ] && exit 0
|
||||
# range calculations:
|
||||
# ipcalc <ip> <netmask> <start> <num>
|
||||
|
||||
if [ "$prefix" -le 30 ]; then
|
||||
lower=$((network + 1))
|
||||
else
|
||||
lower="$network"
|
||||
fi
|
||||
|
||||
start="$1"
|
||||
assert_uint32 "$start" || exit 1
|
||||
start=$((network | (start & hostmask)))
|
||||
[ "$start" -lt "$lower" ] && start="$lower"
|
||||
[ "$start" -eq "$ipaddr" ] && start=$((start + 1))
|
||||
|
||||
if [ "$prefix" -le 30 ]; then
|
||||
upper=$(((network | hostmask) - 1))
|
||||
elif [ "$prefix" -eq 31 ]; then
|
||||
upper=$((network | hostmask))
|
||||
else
|
||||
upper="$network"
|
||||
fi
|
||||
|
||||
range="$2"
|
||||
assert_uint32 "$range" || exit 1
|
||||
end=$((start + range - 1))
|
||||
[ "$end" -gt "$upper" ] && end="$upper"
|
||||
[ "$end" -eq "$ipaddr" ] && end=$((end - 1))
|
||||
|
||||
if [ "$start" -gt "$end" ]; then
|
||||
echo "network ($NETWORK/$prefix) too small" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
_ip2str START "$start"
|
||||
_ip2str END "$end"
|
||||
|
||||
if [ "$start" -le "$ipaddr" ] && [ "$ipaddr" -le "$end" ]; then
|
||||
echo "error: address $IP inside range $START..$END" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "START=$START"
|
||||
echo "END=$END"
|
||||
|
||||
exit 0
|
||||
if (ARGC > 3) {
|
||||
print "START="int2ip(start)
|
||||
print "END="int2ip(end)
|
||||
}
|
||||
}
|
||||
EOF
|
||||
|
||||
1
package/base-files/files/etc/board.d/99-default_network
Normal file → Executable file
1
package/base-files/files/etc/board.d/99-default_network
Normal file → Executable file
@@ -1,3 +1,4 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (C) 2013-2015 OpenWrt.org
|
||||
#
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
[ "$ACTION" = "add" ] && /etc/init.d/led start "$DEVICENAME"
|
||||
@@ -10,6 +10,7 @@ uci_apply_defaults() {
|
||||
cd /etc/uci-defaults || return 0
|
||||
files="$(ls)"
|
||||
[ -z "$files" ] && return 0
|
||||
mkdir -p /tmp/.uci
|
||||
for file in $files; do
|
||||
( . "./$(basename $file)" ) && rm -f "$file"
|
||||
done
|
||||
@@ -20,12 +21,9 @@ boot() {
|
||||
[ -f /proc/mounts ] || /sbin/mount_root
|
||||
[ -f /proc/jffs2_bbc ] && echo "S" > /proc/jffs2_bbc
|
||||
|
||||
mkdir -p /var/lock
|
||||
chmod 1777 /var/lock
|
||||
mkdir -p /var/log
|
||||
mkdir -p /var/run
|
||||
ln -s /var/run /run
|
||||
ln -s /var/lock /run/lock
|
||||
mkdir -p /var/log
|
||||
mkdir -p /var/lock
|
||||
mkdir -p /var/state
|
||||
mkdir -p /var/tmp
|
||||
mkdir -p /tmp/.uci
|
||||
@@ -35,12 +33,11 @@ boot() {
|
||||
mkdir -p /tmp/resolv.conf.d
|
||||
touch /tmp/resolv.conf.d/resolv.conf.auto
|
||||
ln -sf /tmp/resolv.conf.d/resolv.conf.auto /tmp/resolv.conf
|
||||
grep -q debugfs /proc/filesystems && /bin/mount -o nosuid,nodev,noexec,noatime -t debugfs debugfs /sys/kernel/debug
|
||||
grep -q debugfs /proc/filesystems && /bin/mount -o noatime -t debugfs debugfs /sys/kernel/debug
|
||||
grep -q bpf /proc/filesystems && /bin/mount -o nosuid,nodev,noexec,noatime,mode=0700 -t bpf bpffs /sys/fs/bpf
|
||||
grep -q pstore /proc/filesystems && /bin/mount -o nosuid,nodev,noexec,noatime -t pstore pstore /sys/fs/pstore
|
||||
grep -q pstore /proc/filesystems && /bin/mount -o noatime -t pstore pstore /sys/fs/pstore
|
||||
[ "$FAILSAFE" = "true" ] && touch /tmp/.failsafe
|
||||
|
||||
touch /tmp/.config_pending
|
||||
/sbin/kmodloader
|
||||
|
||||
[ ! -f /etc/config/wireless ] && {
|
||||
@@ -48,13 +45,8 @@ boot() {
|
||||
sleep 1
|
||||
}
|
||||
|
||||
mkdir -p /tmp/.uci
|
||||
[ -f /etc/uci-defaults/30_uboot-envtools ] && (. /etc/uci-defaults/30_uboot-envtools)
|
||||
/bin/config_generate
|
||||
rm -f /tmp/.config_pending
|
||||
/sbin/wifi config
|
||||
uci_apply_defaults
|
||||
sync
|
||||
|
||||
# temporary hack until configd exists
|
||||
/sbin/reload_config
|
||||
|
||||
@@ -3,39 +3,6 @@
|
||||
|
||||
START=96
|
||||
|
||||
led_color_set() {
|
||||
local cfg="$1"
|
||||
local sysfs="$2"
|
||||
|
||||
local max_b
|
||||
local colors
|
||||
local color
|
||||
local multi_intensity
|
||||
local value
|
||||
local write
|
||||
|
||||
[ -e /sys/class/leds/${sysfs}/multi_intensity ] || return
|
||||
[ -e /sys/class/leds/${sysfs}/multi_index ] || return
|
||||
|
||||
max_b="$(cat /sys/class/leds/${sysfs}/max_brightness)"
|
||||
colors="$(cat /sys/class/leds/${sysfs}/multi_index | tr " " "\n")"
|
||||
multi_intensity=""
|
||||
for color in $colors; do
|
||||
config_get value $1 "color_${color}" "0"
|
||||
[ "$value" -gt 0 ] && write=1
|
||||
[ "$value" -gt "$max_b" ] && value="$max_b"
|
||||
multi_intensity="${multi_intensity}${value} "
|
||||
done
|
||||
|
||||
# Check if any color is configured
|
||||
[ "$write" = 1 ] || return
|
||||
# Remove last whitespace
|
||||
multi_intensity="${multi_intensity:0:-1}"
|
||||
|
||||
echo "setting '${name}' led color to '${multi_intensity}'"
|
||||
echo "${multi_intensity}" > /sys/class/leds/${sysfs}/multi_intensity
|
||||
}
|
||||
|
||||
load_led() {
|
||||
local name
|
||||
local sysfs
|
||||
@@ -62,15 +29,12 @@ load_led() {
|
||||
config_get delay $1 delay "150"
|
||||
config_get message $1 message ""
|
||||
config_get gpio $1 gpio "0"
|
||||
config_get_bool inverted $1 inverted "0"
|
||||
config_get inverted $1 inverted "0"
|
||||
|
||||
[ "$2" ] && [ "$sysfs" != "$2" ] && return
|
||||
|
||||
# execute application led trigger
|
||||
[ -f "/usr/libexec/led-trigger/${trigger}" ] && {
|
||||
. "/usr/libexec/led-trigger/${trigger}"
|
||||
return 0
|
||||
}
|
||||
if [ "$trigger" = "rssi" ]; then
|
||||
# handled by rssileds userspace process
|
||||
return
|
||||
fi
|
||||
|
||||
[ "$trigger" = "usbdev" ] && {
|
||||
# Backward compatibility: translate to the new trigger
|
||||
@@ -84,38 +48,26 @@ load_led() {
|
||||
[ -e /sys/class/leds/${sysfs}/brightness ] && {
|
||||
echo "setting up led ${name}"
|
||||
|
||||
printf "%s %s %d" \
|
||||
printf "%s %s %d\n" \
|
||||
"$sysfs" \
|
||||
"$(sed -ne 's/^.*\[\(.*\)\].*$/\1/p' /sys/class/leds/${sysfs}/trigger)" \
|
||||
"$(cat /sys/class/leds/${sysfs}/brightness)" \
|
||||
>> /var/run/led.state
|
||||
# Save default color if supported
|
||||
[ -e /sys/class/leds/${sysfs}/multi_intensity ] && {
|
||||
printf " %s" \
|
||||
"$(sed 's/\ /:/g' /sys/class/leds/${sysfs}/multi_intensity)" \
|
||||
>> /var/run/led.state
|
||||
}
|
||||
printf "\n" >> /var/run/led.state
|
||||
|
||||
[ "$default" = 0 ] &&
|
||||
echo 0 >/sys/class/leds/${sysfs}/brightness
|
||||
|
||||
echo $trigger > /sys/class/leds/${sysfs}/trigger 2> /dev/null
|
||||
ret="$?"
|
||||
|
||||
[ $default = 1 ] &&
|
||||
cat /sys/class/leds/${sysfs}/max_brightness > /sys/class/leds/${sysfs}/brightness
|
||||
|
||||
led_color_set "$1" "$sysfs"
|
||||
|
||||
echo $trigger > /sys/class/leds/${sysfs}/trigger 2> /dev/null
|
||||
ret="$?"
|
||||
[ $ret = 0 ] || {
|
||||
echo >&2 "Skipping trigger '$trigger' for led '$name' due to missing kernel module"
|
||||
return 1
|
||||
}
|
||||
case "$trigger" in
|
||||
"heartbeat")
|
||||
echo "${inverted}" > "/sys/class/leds/${sysfs}/invert"
|
||||
;;
|
||||
|
||||
"netdev")
|
||||
[ -n "$dev" ] && {
|
||||
echo $dev > /sys/class/leds/${sysfs}/device_name
|
||||
@@ -123,7 +75,7 @@ load_led() {
|
||||
[ -e "/sys/class/leds/${sysfs}/$m" ] && \
|
||||
echo 1 > /sys/class/leds/${sysfs}/$m
|
||||
done
|
||||
echo $interval > /sys/class/leds/${sysfs}/interval 2>/dev/null
|
||||
echo $interval > /sys/class/leds/${sysfs}/interval
|
||||
}
|
||||
;;
|
||||
|
||||
@@ -171,28 +123,18 @@ load_led() {
|
||||
start() {
|
||||
[ -e /sys/class/leds/ ] && {
|
||||
[ -s /var/run/led.state ] && {
|
||||
local led trigger brightness color
|
||||
while read led trigger brightness color; do
|
||||
[ "$1" ] && [ "$1" != "$led" ] && continue
|
||||
local led trigger brightness
|
||||
while read led trigger brightness; do
|
||||
[ -e "/sys/class/leds/$led/trigger" ] && \
|
||||
echo "$trigger" > "/sys/class/leds/$led/trigger"
|
||||
|
||||
[ -e "/sys/class/leds/$led/brightness" ] && \
|
||||
echo "$brightness" > "/sys/class/leds/$led/brightness"
|
||||
|
||||
[ -e "/sys/class/leds/$led/multi_intensity" ] && \
|
||||
echo "$color" | sed 's/:/\ /g' > \
|
||||
"/sys/class/leds/$led/multi_intensity"
|
||||
done < /var/run/led.state
|
||||
if [ "$1" ]; then
|
||||
grep -v "^$1 " /var/run/led.state > /var/run/led.state.new
|
||||
mv /var/run/led.state.new /var/run/led.state
|
||||
else
|
||||
rm /var/run/led.state
|
||||
fi
|
||||
rm /var/run/led.state
|
||||
}
|
||||
|
||||
config_load system
|
||||
config_foreach load_led led "$1"
|
||||
config_foreach load_led led
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,33 +8,23 @@ RTC_DEV=/dev/rtc0
|
||||
HWCLOCK=/sbin/hwclock
|
||||
|
||||
boot() {
|
||||
hwclock_load
|
||||
local maxtime="$(find_max_time)"
|
||||
start && exit 0
|
||||
|
||||
local maxtime="$(maxtime)"
|
||||
local curtime="$(date +%s)"
|
||||
if [ $curtime -lt $maxtime ]; then
|
||||
date -s @$maxtime
|
||||
hwclock_save
|
||||
fi
|
||||
[ $curtime -lt $maxtime ] && date -s @$maxtime
|
||||
}
|
||||
|
||||
start() {
|
||||
hwclock_load
|
||||
}
|
||||
|
||||
stop() {
|
||||
hwclock_save
|
||||
}
|
||||
|
||||
hwclock_load() {
|
||||
[ -e "$RTC_DEV" ] && [ -e "$HWCLOCK" ] && $HWCLOCK -s -u -f $RTC_DEV
|
||||
}
|
||||
|
||||
hwclock_save(){
|
||||
stop() {
|
||||
[ -e "$RTC_DEV" ] && [ -e "$HWCLOCK" ] && $HWCLOCK -w -u -f $RTC_DEV && \
|
||||
logger -t sysfixtime "saved '$(date)' to $RTC_DEV"
|
||||
}
|
||||
|
||||
find_max_time() {
|
||||
maxtime() {
|
||||
local file newest
|
||||
|
||||
for file in $( find /etc -type f ) ; do
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
START=10
|
||||
USE_PROCD=1
|
||||
|
||||
validate_system_section() {
|
||||
validate_system_section()
|
||||
{
|
||||
uci_load_validate system system "$1" "$2" \
|
||||
'hostname:string:OpenWrt' \
|
||||
'conloglevel:uinteger' \
|
||||
@@ -22,9 +23,8 @@ system_config() {
|
||||
echo "$hostname" > /proc/sys/kernel/hostname
|
||||
[ -z "$conloglevel" -a -z "$buffersize" ] || dmesg ${conloglevel:+-n $conloglevel} ${buffersize:+-s $buffersize}
|
||||
echo "$timezone" > /tmp/TZ
|
||||
[ -n "$zonename" ] && [ -f "/usr/share/zoneinfo/${zonename// /_}" ] \
|
||||
&& ln -sf "/usr/share/zoneinfo/${zonename// /_}" /tmp/localtime \
|
||||
&& rm -f /tmp/TZ
|
||||
[ -n "$zonename" ] && [ -f "/usr/share/zoneinfo/$zonename" ] && \
|
||||
ln -sf "/usr/share/zoneinfo/$zonename" /tmp/localtime && rm -f /tmp/TZ
|
||||
|
||||
# apply timezone to kernel
|
||||
hwclock -u --systz
|
||||
@@ -35,7 +35,8 @@ reload_service() {
|
||||
config_foreach validate_system_section system system_config
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
service_triggers()
|
||||
{
|
||||
procd_add_reload_trigger "system"
|
||||
procd_add_validation validate_system_section
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
[ -f /etc/banner ] && cat /etc/banner
|
||||
[ -n "$FAILSAFE" ] && cat /etc/banner.failsafe
|
||||
|
||||
grep -Fsq '/ overlay ro,' /proc/mounts && {
|
||||
fgrep -sq '/ overlay ro,' /proc/mounts && {
|
||||
echo 'Your JFFS2-partition seems full and overlayfs is mounted read-only.'
|
||||
echo 'Please try to remove files from /overlay/upper/... and reboot!'
|
||||
}
|
||||
|
||||
@@ -55,12 +55,7 @@ enable() {
|
||||
|
||||
enabled() {
|
||||
name="$(basename "${initscript}")"
|
||||
name="${name##[SK][0-9][0-9]}"
|
||||
{
|
||||
[ -z "${START:-}" ] || [ -L "$IPKG_INSTROOT/etc/rc.d/S${START}$name" ]
|
||||
} && {
|
||||
[ -z "${STOP:-}" ] || [ -L "$IPKG_INSTROOT/etc/rc.d/K${STOP}$name" ]
|
||||
}
|
||||
[ -x "$IPKG_INSTROOT/etc/rc.d/S${START}${name##S[0-9][0-9]}" ]
|
||||
}
|
||||
|
||||
depends() {
|
||||
@@ -105,9 +100,9 @@ service_data() {
|
||||
}
|
||||
|
||||
service_running() {
|
||||
local instance="${1:-*}"
|
||||
|
||||
procd_running "$(basename $initscript)" "$instance"
|
||||
local service="${1:-$(basename $initscript)}"
|
||||
local instance="${2:-*}"
|
||||
procd_running "$service" "$instance" "$@"
|
||||
}
|
||||
|
||||
${INIT_TRACE:+set -x}
|
||||
@@ -126,7 +121,6 @@ extra_command "enabled" "Check if service is started on boot"
|
||||
extra_command "running" "Check if service is running"
|
||||
extra_command "status" "Service status"
|
||||
extra_command "trace" "Start with syscall trace"
|
||||
extra_command "info" "Dump procd service info"
|
||||
|
||||
. $IPKG_INSTROOT/lib/functions/procd.sh
|
||||
basescript=$(readlink "$initscript")
|
||||
@@ -150,13 +144,6 @@ extra_command "enabled" "Check if service is started on boot"
|
||||
start "$@"
|
||||
}
|
||||
|
||||
info() {
|
||||
json_init
|
||||
json_add_string name "$(basename ${basescript:-$initscript})"
|
||||
json_add_boolean verbose "1"
|
||||
_procd_ubus_call list
|
||||
}
|
||||
|
||||
stop() {
|
||||
procd_lock
|
||||
stop_service "$@"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
root:::0:99999:7:::
|
||||
root::0:0:99999:7:::
|
||||
daemon:*:0:0:99999:7:::
|
||||
ftp:*:0:0:99999:7:::
|
||||
network:*:0:0:99999:7:::
|
||||
|
||||
@@ -8,5 +8,26 @@ alias ll='ls -alF --color=auto'
|
||||
[ -x /usr/bin/arp -o -x /sbin/arp ] || arp() { cat /proc/net/arp; }
|
||||
[ -x /usr/bin/ldd ] || ldd() { LD_TRACE_LOADED_OBJECTS=1 $*; }
|
||||
|
||||
service() {
|
||||
if [ -f "/etc/init.d/$1" ]; then
|
||||
/etc/init.d/$@
|
||||
else
|
||||
echo "Usage: service <service> [command]"
|
||||
if [ -n "$1" ]; then
|
||||
echo "Service "'"'"$1"'"'" not found, the following services are available:"
|
||||
else
|
||||
echo "The following services are available:"
|
||||
fi
|
||||
for F in /etc/init.d/* ; do
|
||||
printf "%-30s\t%10s\t%10s\n" "$F" \
|
||||
$( $($F enabled) && echo "enabled" || echo "disabled" ) \
|
||||
$( [ "$(ubus call service list "{ 'verbose': true, 'name': '$(basename $F)' }" \
|
||||
| jsonfilter -q -e "@['$(basename $F)'].instances[*].running" | uniq)" = "true" ] \
|
||||
&& echo "running" || echo "stopped" )
|
||||
done;
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
[ -n "$KSH_VERSION" -o \! -s "$HOME/.shinit" ] || . "$HOME/.shinit"
|
||||
[ -z "$KSH_VERSION" -o \! -s "$HOME/.mkshrc" ] || . "$HOME/.mkshrc"
|
||||
|
||||
@@ -1,2 +1 @@
|
||||
# User defined entries should be added to this file not to /etc/sysctl.d/* as
|
||||
# that directory is not backed-up by default and will not survive a reimage
|
||||
# Defaults are configured in /etc/sysctl.d/* and can be customized in this file
|
||||
|
||||
@@ -9,7 +9,6 @@ fs.protected_hardlinks=1
|
||||
fs.protected_symlinks=1
|
||||
|
||||
net.core.bpf_jit_enable=1
|
||||
net.core.bpf_jit_kallsyms=1
|
||||
|
||||
net.ipv4.conf.default.arp_ignore=1
|
||||
net.ipv4.conf.all.arp_ignore=1
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
. /lib/functions.sh
|
||||
|
||||
migrate_ports() {
|
||||
local config="$1"
|
||||
local type ports ifname
|
||||
|
||||
config_get type "$config" type
|
||||
[ "$type" != "bridge" ] && return
|
||||
|
||||
config_get ports "$config" ports
|
||||
[ -n "$ports" ] && return
|
||||
|
||||
config_get ifname "$config" ifname
|
||||
[ -z "$ifname" ] && return
|
||||
|
||||
for port in $ifname; do
|
||||
uci add_list network.$config.ports="$port"
|
||||
done
|
||||
uci delete network.$config.ifname
|
||||
}
|
||||
|
||||
migrate_bridge() {
|
||||
local config="$1"
|
||||
local type ifname
|
||||
|
||||
config_get type "$config" type
|
||||
[ "$type" != "bridge" ] && return
|
||||
|
||||
config_get ifname "$config" ifname
|
||||
|
||||
uci -q batch <<-EOF
|
||||
add network device
|
||||
set network.@device[-1].name='br-$config'
|
||||
set network.@device[-1].type='bridge'
|
||||
EOF
|
||||
for port in $ifname; do
|
||||
uci add_list network.@device[-1].ports="$port"
|
||||
done
|
||||
|
||||
uci -q batch <<-EOF
|
||||
delete network.$config.type
|
||||
delete network.$config.ifname
|
||||
set network.$config.device='br-$config'
|
||||
EOF
|
||||
}
|
||||
|
||||
config_load network
|
||||
config_foreach migrate_ports device
|
||||
config_foreach migrate_bridge interface
|
||||
@@ -1,7 +1,11 @@
|
||||
[ "$(uci -q get network.globals.ula_prefix)" != "auto" ] && exit 0
|
||||
|
||||
r1=$(dd if=/dev/urandom bs=1 count=1 |hexdump -e '1/1 "%02x"')
|
||||
r2=$(dd if=/dev/urandom bs=2 count=1 |hexdump -e '2/1 "%02x"')
|
||||
r3=$(dd if=/dev/urandom bs=2 count=1 |hexdump -e '2/1 "%02x"')
|
||||
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
set network.globals.ula_prefix="$(hexdump -vn 5 -e '"fd" 1/1 "%02x:" 2/2 "%x:"' /dev/urandom):/48"
|
||||
set network.globals.ula_prefix=fd$r1:$r2:$r3::/48
|
||||
commit network
|
||||
EOF
|
||||
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
. /lib/functions.sh
|
||||
|
||||
# Skip if we don't have /usr/lib/opkg/info (APK installation)
|
||||
[ -d /usr/lib/opkg/info ] || exit 0
|
||||
|
||||
for file in $(grep -sl Require-User /usr/lib/opkg/info/*.control); do
|
||||
file="${file##*/}"
|
||||
file="${file%.control}"
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
json_init
|
||||
json_load "$(cat /etc/board.json)"
|
||||
|
||||
if json_is_a credentials object; then
|
||||
json_select credentials
|
||||
json_get_vars root_password_hash root_password_hash
|
||||
if [ -n "$root_password_hash" ]; then
|
||||
sed -i "s|^root:[^:]*|root:$root_password_hash|g" /etc/shadow
|
||||
fi
|
||||
|
||||
json_get_vars root_password_plain root_password_plain
|
||||
if [ -n "$root_password_plain" ]; then
|
||||
(echo "$root_password_plain"; sleep 1; echo "$root_password_plain") | passwd root
|
||||
fi
|
||||
json_select ..
|
||||
fi
|
||||
@@ -32,30 +32,6 @@ xor() {
|
||||
printf "%0${retlen}x" "$ret"
|
||||
}
|
||||
|
||||
data_2bin() {
|
||||
local data=$1
|
||||
local len=${#1}
|
||||
local bin_data
|
||||
|
||||
for i in $(seq 0 2 $(($len - 1))); do
|
||||
bin_data="${bin_data}\x${data:i:2}"
|
||||
done
|
||||
|
||||
echo -ne $bin_data
|
||||
}
|
||||
|
||||
data_2xor_val() {
|
||||
local data=$1
|
||||
local len=${#1}
|
||||
local xor_data
|
||||
|
||||
for i in $(seq 0 4 $(($len - 1))); do
|
||||
xor_data="${xor_data}${data:i:4} "
|
||||
done
|
||||
|
||||
echo -n ${xor_data:0:-1}
|
||||
}
|
||||
|
||||
append() {
|
||||
local var="$1"
|
||||
local value="$2"
|
||||
@@ -64,14 +40,6 @@ append() {
|
||||
eval "export ${NO_EXPORT:+-n} -- \"$var=\${$var:+\${$var}\${value:+\$sep}}\$value\""
|
||||
}
|
||||
|
||||
prepend() {
|
||||
local var="$1"
|
||||
local value="$2"
|
||||
local sep="${3:- }"
|
||||
|
||||
eval "export ${NO_EXPORT:+-n} -- \"$var=\$value\${$var:+\${sep}\${$var}}\""
|
||||
}
|
||||
|
||||
list_contains() {
|
||||
local var="$1"
|
||||
local str="$2"
|
||||
@@ -211,10 +179,8 @@ config_list_foreach() {
|
||||
|
||||
default_prerm() {
|
||||
local root="${IPKG_INSTROOT}"
|
||||
[ -z "$pkgname" ] && local pkgname="$(basename ${1%.*})"
|
||||
local pkgname="$(basename ${1%.*})"
|
||||
local ret=0
|
||||
local filelist="${root}/usr/lib/opkg/info/${pkgname}.list"
|
||||
[ -f "$root/lib/apk/packages/${pkgname}.list" ] && filelist="$root/lib/apk/packages/${pkgname}.list"
|
||||
|
||||
if [ -f "$root/usr/lib/opkg/info/${pkgname}.prerm-pkg" ]; then
|
||||
( . "$root/usr/lib/opkg/info/${pkgname}.prerm-pkg" )
|
||||
@@ -222,7 +188,7 @@ default_prerm() {
|
||||
fi
|
||||
|
||||
local shell="$(command -v bash)"
|
||||
for i in $(grep -s "^/etc/init.d/" "$filelist"); do
|
||||
for i in $(grep -s "^/etc/init.d/" "$root/usr/lib/opkg/info/${pkgname}.list"); do
|
||||
if [ -n "$root" ]; then
|
||||
${shell:-/bin/sh} "$root/etc/rc.common" "$root$i" disable
|
||||
else
|
||||
@@ -237,19 +203,16 @@ default_prerm() {
|
||||
}
|
||||
|
||||
add_group_and_user() {
|
||||
[ -z "$pkgname" ] && local pkgname="$(basename ${1%.*})"
|
||||
local pkgname="$1"
|
||||
local rusers="$(sed -ne 's/^Require-User: *//p' $root/usr/lib/opkg/info/${pkgname}.control 2>/dev/null)"
|
||||
if [ -f "$root/lib/apk/packages/${pkgname}.rusers" ]; then
|
||||
local rusers="$(cat $root/lib/apk/packages/${pkgname}.rusers)"
|
||||
fi
|
||||
|
||||
if [ -n "$rusers" ]; then
|
||||
local tuple oIFS="$IFS"
|
||||
for tuple in $rusers; do
|
||||
local uid gid uname gname addngroups addngroup addngname addngid
|
||||
local uid gid uname gname
|
||||
|
||||
IFS=":"
|
||||
set -- $tuple; uname="$1"; gname="$2"; addngroups="$3"
|
||||
set -- $tuple; uname="$1"; gname="$2"
|
||||
IFS="="
|
||||
set -- $uname; uname="$1"; uid="$2"
|
||||
set -- $gname; gname="$1"; gid="$2"
|
||||
@@ -269,92 +232,22 @@ add_group_and_user() {
|
||||
group_add_user "$gname" "$uname"
|
||||
fi
|
||||
|
||||
if [ -n "$uname" ] && [ -n "$addngroups" ]; then
|
||||
oIFS="$IFS"
|
||||
IFS=","
|
||||
for addngroup in $addngroups ; do
|
||||
IFS="="
|
||||
set -- $addngroup; addngname="$1"; addngid="$2"
|
||||
if [ -n "$addngid" ]; then
|
||||
group_exists "$addngname" || group_add "$addngname" "$addngid"
|
||||
else
|
||||
group_add_next "$addngname"
|
||||
fi
|
||||
|
||||
group_add_user "$addngname" "$uname"
|
||||
done
|
||||
IFS="$oIFS"
|
||||
fi
|
||||
|
||||
unset uid gid uname gname addngroups addngroup addngname addngid
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
update_alternatives() {
|
||||
local root="${IPKG_INSTROOT}"
|
||||
local action="$1"
|
||||
local pkgname="$2"
|
||||
|
||||
if [ -f "$root/lib/apk/packages/${pkgname}.alternatives" ]; then
|
||||
for pkg_alt in $(cat $root/lib/apk/packages/${pkgname}.alternatives); do
|
||||
local best_prio=0;
|
||||
local best_src="/bin/busybox";
|
||||
pkg_prio=${pkg_alt%%:*};
|
||||
pkg_target=${pkg_alt#*:};
|
||||
pkg_target=${pkg_target%:*};
|
||||
pkg_src=${pkg_alt##*:};
|
||||
|
||||
if [ -e "$root/$target" ]; then
|
||||
for alts in $root/lib/apk/packages/*.alternatives; do
|
||||
for alt in $(cat $alts); do
|
||||
prio=${alt%%:*};
|
||||
target=${alt#*:};
|
||||
target=${target%:*};
|
||||
src=${alt##*:};
|
||||
|
||||
if [ "$target" = "$pkg_target" ] &&
|
||||
[ "$src" != "$pkg_src" ] &&
|
||||
[ "$best_prio" -lt "$prio" ]; then
|
||||
best_prio=$prio;
|
||||
best_src=$src;
|
||||
fi
|
||||
done
|
||||
done
|
||||
fi
|
||||
case "$action" in
|
||||
install)
|
||||
if [ "$best_prio" -lt "$pkg_prio" ]; then
|
||||
ln -sf "$pkg_src" "$root/$pkg_target"
|
||||
echo "add alternative: $pkg_target -> $pkg_src"
|
||||
fi
|
||||
;;
|
||||
remove)
|
||||
if [ "$best_prio" -lt "$pkg_prio" ]; then
|
||||
ln -sf "$best_src" "$root/$pkg_target"
|
||||
echo "add alternative: $pkg_target -> $best_src"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
unset uid gid uname gname
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
default_postinst() {
|
||||
local root="${IPKG_INSTROOT}"
|
||||
[ -z "$pkgname" ] && local pkgname="$(basename ${1%.*})"
|
||||
local filelist="${root}/usr/lib/opkg/info/${pkgname}.list"
|
||||
[ -f "$root/lib/apk/packages/${pkgname}.list" ] && filelist="$root/lib/apk/packages/${pkgname}.list"
|
||||
local pkgname="$(basename ${1%.*})"
|
||||
local filelist="/usr/lib/opkg/info/${pkgname}.list"
|
||||
local ret=0
|
||||
|
||||
if [ -e "${root}/usr/lib/opkg/info/${pkgname}.list" ]; then
|
||||
filelist="${root}/usr/lib/opkg/info/${pkgname}.list"
|
||||
add_group_and_user "${pkgname}"
|
||||
fi
|
||||
add_group_and_user "${pkgname}"
|
||||
|
||||
if [ -e "${root}/lib/apk/packages/${pkgname}.list" ]; then
|
||||
filelist="${root}/lib/apk/packages/${pkgname}.list"
|
||||
update_alternatives install "${pkgname}"
|
||||
if [ -f "$root/usr/lib/opkg/info/${pkgname}.postinst-pkg" ]; then
|
||||
( . "$root/usr/lib/opkg/info/${pkgname}.postinst-pkg" )
|
||||
ret=$?
|
||||
fi
|
||||
|
||||
if [ -d "$root/rootfs-overlay" ]; then
|
||||
@@ -382,13 +275,8 @@ default_postinst() {
|
||||
rm -f /tmp/luci-indexcache
|
||||
fi
|
||||
|
||||
if [ -f "$root/usr/lib/opkg/info/${pkgname}.postinst-pkg" ]; then
|
||||
( . "$root/usr/lib/opkg/info/${pkgname}.postinst-pkg" )
|
||||
ret=$?
|
||||
fi
|
||||
|
||||
local shell="$(command -v bash)"
|
||||
for i in $(grep -s "^/etc/init.d/" "$filelist"); do
|
||||
for i in $(grep -s "^/etc/init.d/" "$root$filelist"); do
|
||||
if [ -n "$root" ]; then
|
||||
${shell:-/bin/sh} "$root/etc/rc.common" "$root$i" enable
|
||||
else
|
||||
@@ -410,11 +298,6 @@ include() {
|
||||
done
|
||||
}
|
||||
|
||||
ipcalc() {
|
||||
set -- $(ipcalc.sh "$@")
|
||||
[ $? -eq 0 ] && export -- "$@"
|
||||
}
|
||||
|
||||
find_mtd_index() {
|
||||
local PART="$(grep "\"$1\"" /proc/mtd | awk -F: '{print $1}')"
|
||||
local INDEX="${PART##mtd}"
|
||||
@@ -430,25 +313,6 @@ find_mtd_part() {
|
||||
echo "${INDEX:+$PREFIX$INDEX}"
|
||||
}
|
||||
|
||||
find_mmc_part() {
|
||||
local DEVNAME PARTNAME ROOTDEV
|
||||
|
||||
if grep -q "$1" /proc/mtd; then
|
||||
echo "" && return 0
|
||||
fi
|
||||
|
||||
if [ -n "$2" ]; then
|
||||
ROOTDEV="$2"
|
||||
else
|
||||
ROOTDEV="mmcblk*"
|
||||
fi
|
||||
|
||||
for DEVNAME in /sys/block/$ROOTDEV/mmcblk*p*; do
|
||||
PARTNAME="$(grep PARTNAME ${DEVNAME}/uevent | cut -f2 -d'=')"
|
||||
[ "$PARTNAME" = "$1" ] && echo "/dev/$(basename $DEVNAME)" && return 0
|
||||
done
|
||||
}
|
||||
|
||||
group_add() {
|
||||
local name="$1"
|
||||
local gid="$2"
|
||||
@@ -471,7 +335,7 @@ group_add_next() {
|
||||
return
|
||||
fi
|
||||
gids=$(cut -d: -f3 ${IPKG_INSTROOT}/etc/group)
|
||||
gid=32768
|
||||
gid=65536
|
||||
while echo "$gids" | grep -q "^$gid$"; do
|
||||
gid=$((gid + 1))
|
||||
done
|
||||
@@ -486,9 +350,6 @@ group_add_user() {
|
||||
echo "$grp" | grep -q ":$" && delim=""
|
||||
[ -n "$IPKG_INSTROOT" ] || lock /var/lock/passwd
|
||||
sed -i "s/$grp/$grp$delim$2/g" ${IPKG_INSTROOT}/etc/group
|
||||
if [ -z "$IPKG_INSTROOT" ] && [ -x /usr/sbin/selinuxenabled ] && selinuxenabled; then
|
||||
restorecon /etc/group
|
||||
fi
|
||||
[ -n "$IPKG_INSTROOT" ] || lock -u /var/lock/passwd
|
||||
}
|
||||
|
||||
@@ -502,7 +363,7 @@ user_add() {
|
||||
local rc
|
||||
[ -z "$uid" ] && {
|
||||
uids=$(cut -d: -f3 ${IPKG_INSTROOT}/etc/passwd)
|
||||
uid=32768
|
||||
uid=65536
|
||||
while echo "$uids" | grep -q "^$uid$"; do
|
||||
uid=$((uid + 1))
|
||||
done
|
||||
@@ -523,14 +384,4 @@ board_name() {
|
||||
[ -e /tmp/sysinfo/board_name ] && cat /tmp/sysinfo/board_name || echo "generic"
|
||||
}
|
||||
|
||||
cmdline_get_var() {
|
||||
local var=$1
|
||||
local cmdlinevar tmp
|
||||
|
||||
for cmdlinevar in $(cat /proc/cmdline); do
|
||||
tmp=${cmdlinevar##${var}}
|
||||
[ "=" = "${tmp:0:1}" ] && echo ${tmp:1}
|
||||
done
|
||||
}
|
||||
|
||||
[ -z "$IPKG_INSTROOT" ] && [ -f /lib/config/uci.sh ] && . /lib/config/uci.sh || true
|
||||
[ -z "$IPKG_INSTROOT" ] && [ -f /lib/config/uci.sh ] && . /lib/config/uci.sh
|
||||
|
||||
@@ -48,19 +48,6 @@ caldata_extract_ubi() {
|
||||
caldata_die "failed to extract calibration data from $ubi"
|
||||
}
|
||||
|
||||
caldata_extract_mmc() {
|
||||
local part=$1
|
||||
local offset=$(($2))
|
||||
local count=$(($3))
|
||||
local mmc_part
|
||||
|
||||
mmc_part=$(find_mmc_part $part)
|
||||
[ -n "$mmc_part" ] || caldata_die "no mmc partition found for partition $part"
|
||||
|
||||
caldata_dd $mmc_part /lib/firmware/$FIRMWARE $count $offset || \
|
||||
caldata_die "failed to extract calibration data from $mmc_part"
|
||||
}
|
||||
|
||||
caldata_extract_reverse() {
|
||||
local part=$1
|
||||
local offset=$2
|
||||
@@ -70,7 +57,7 @@ caldata_extract_reverse() {
|
||||
local caldata
|
||||
|
||||
mtd=$(find_mtd_chardev "$part")
|
||||
reversed=$(hexdump -v -s $offset -n $count -e '1/1 "%02x "' $mtd)
|
||||
reversed=$(hexdump -v -s $offset -n $count -e '/1 "%02x "' $mtd)
|
||||
|
||||
for byte in $reversed; do
|
||||
caldata="\x${byte}${caldata}"
|
||||
@@ -122,43 +109,49 @@ caldata_valid() {
|
||||
return $?
|
||||
}
|
||||
|
||||
caldata_patch_data() {
|
||||
local data=$1
|
||||
local data_count=$((${#1} / 2))
|
||||
local data_offset=$(($2))
|
||||
caldata_patch_chksum() {
|
||||
local mac=$1
|
||||
local mac_offset=$(($2))
|
||||
local chksum_offset=$(($3))
|
||||
local target=$4
|
||||
local fw_data
|
||||
local fw_chksum
|
||||
local xor_mac
|
||||
local xor_fw_mac
|
||||
local xor_fw_chksum
|
||||
|
||||
[ -z "$data" -o -z "$data_offset" ] && return
|
||||
xor_mac=${mac//:/}
|
||||
xor_mac="${xor_mac:0:4} ${xor_mac:4:4} ${xor_mac:8:4}"
|
||||
|
||||
xor_fw_mac=$(hexdump -v -n 6 -s $mac_offset -e '/1 "%02x"' /lib/firmware/$FIRMWARE)
|
||||
xor_fw_mac="${xor_fw_mac:0:4} ${xor_fw_mac:4:4} ${xor_fw_mac:8:4}"
|
||||
|
||||
xor_fw_chksum=$(hexdump -v -n 2 -s $chksum_offset -e '/1 "%02x"' /lib/firmware/$FIRMWARE)
|
||||
xor_fw_chksum=$(xor $xor_fw_chksum $xor_fw_mac $xor_mac)
|
||||
|
||||
printf "%b" "\x${xor_fw_chksum:0:2}\x${xor_fw_chksum:2:2}" | \
|
||||
dd of=$target conv=notrunc bs=1 seek=$chksum_offset count=2
|
||||
}
|
||||
|
||||
caldata_patch_mac() {
|
||||
local mac=$1
|
||||
local mac_offset=$(($2))
|
||||
local chksum_offset=$3
|
||||
local target=$4
|
||||
|
||||
[ -z "$mac" -o -z "$mac_offset" ] && return
|
||||
|
||||
[ -n "$target" ] || target=/lib/firmware/$FIRMWARE
|
||||
|
||||
fw_data=$(hexdump -v -n $data_count -s $data_offset -e '1/1 "%02x"' $target)
|
||||
[ -n "$chksum_offset" ] && caldata_patch_chksum "$mac" "$mac_offset" "$chksum_offset" "$target"
|
||||
|
||||
if [ "$data" != "$fw_data" ]; then
|
||||
|
||||
if [ -n "$chksum_offset" ]; then
|
||||
fw_chksum=$(hexdump -v -n 2 -s $chksum_offset -e '1/1 "%02x"' $target)
|
||||
fw_chksum=$(xor $fw_chksum $(data_2xor_val $fw_data) $(data_2xor_val $data))
|
||||
|
||||
data_2bin $fw_chksum | \
|
||||
dd of=$target conv=notrunc bs=1 seek=$chksum_offset count=2 || \
|
||||
caldata_die "failed to write chksum to eeprom file"
|
||||
fi
|
||||
|
||||
data_2bin $data | \
|
||||
dd of=$target conv=notrunc bs=1 seek=$data_offset count=$data_count || \
|
||||
caldata_die "failed to write data to eeprom file"
|
||||
fi
|
||||
macaddr_2bin $mac | dd of=$target conv=notrunc oflag=seek_bytes bs=6 seek=$mac_offset count=1 || \
|
||||
caldata_die "failed to write MAC address to eeprom file"
|
||||
}
|
||||
|
||||
ath9k_patch_mac() {
|
||||
local mac=$1
|
||||
local target=$2
|
||||
|
||||
caldata_patch_data "${mac//:/}" 0x2 "" "$target"
|
||||
caldata_patch_mac "$mac" 0x2 "" "$target"
|
||||
}
|
||||
|
||||
ath9k_patch_mac_crc() {
|
||||
@@ -167,52 +160,12 @@ ath9k_patch_mac_crc() {
|
||||
local chksum_offset=$((mac_offset - 10))
|
||||
local target=$4
|
||||
|
||||
caldata_patch_data "${mac//:/}" "$mac_offset" "$chksum_offset" "$target"
|
||||
caldata_patch_mac "$mac" "$mac_offset" "$chksum_offset" "$target"
|
||||
}
|
||||
|
||||
ath10k_patch_mac() {
|
||||
local mac=$1
|
||||
local target=$2
|
||||
|
||||
caldata_patch_data "${mac//:/}" 0x6 0x2 "$target"
|
||||
}
|
||||
|
||||
ath11k_patch_mac() {
|
||||
local mac=$1
|
||||
# mac_id from 0 to 5
|
||||
local mac_id=$2
|
||||
local target=$3
|
||||
|
||||
[ -z "$mac_id" ] && return
|
||||
|
||||
caldata_patch_data "${mac//:/}" $(printf "0x%x" $(($mac_id * 0x6 + 0xe))) 0xa "$target"
|
||||
}
|
||||
|
||||
ath10k_remove_regdomain() {
|
||||
local target=$1
|
||||
|
||||
caldata_patch_data "0000" 0xc 0x2 "$target"
|
||||
}
|
||||
|
||||
ath11k_remove_regdomain() {
|
||||
local target=$1
|
||||
local regdomain
|
||||
local regdomain_data
|
||||
|
||||
regdomain=$(hexdump -v -n 2 -s 0x34 -e '1/1 "%02x"' $target)
|
||||
caldata_patch_data "0000" 0x34 0xa "$target"
|
||||
|
||||
for offset in 0x450 0x458 0x500 0x5a8; do
|
||||
regdomain_data=$(hexdump -v -n 2 -s $offset -e '1/1 "%02x"' $target)
|
||||
|
||||
if [ "$regdomain" == "$regdomain_data" ]; then
|
||||
caldata_patch_data "0000" $offset 0xa "$target"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
ath11k_set_macflag() {
|
||||
local target=$1
|
||||
|
||||
caldata_patch_data "0100" 0x3e 0xa "$target"
|
||||
caldata_patch_mac "$mac" 0x6 0x2 "$target"
|
||||
}
|
||||
|
||||
@@ -1,268 +0,0 @@
|
||||
uint_max=4294967295
|
||||
|
||||
d_10_0_0_0=167772160
|
||||
d_10_255_255_255=184549375
|
||||
|
||||
d_172_16_0_0=2886729728
|
||||
d_172_31_255_255=2887778303
|
||||
|
||||
d_192_168_0_0=3232235520
|
||||
d_192_168_255_255=3232301055
|
||||
|
||||
d_169_254_0_0=2851995648
|
||||
d_169_254_255_255=2852061183
|
||||
|
||||
d_127_0_0_0=2130706432
|
||||
d_127_255_255_255=2147483647
|
||||
|
||||
d_224_0_0_0=3758096384
|
||||
d_239_255_255_255=4026531839
|
||||
|
||||
# check that $1 is only base 10 digits, and that it doesn't
|
||||
# exceed 2^32-1
|
||||
assert_uint32() {
|
||||
local __n="$1"
|
||||
|
||||
if [ -z "$__n" -o -n "${__n//[0-9]/}" ]; then
|
||||
printf "Not a decimal integer (%s)\n" "$__n ">&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [ "$__n" -gt $uint_max ]; then
|
||||
printf "Out of range (%s)\n" "$__n" >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [ "$((__n + 0))" != "$__n" ]; then
|
||||
printf "Not normalized notation (%s)\n" "$__n" >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
# return a count of the number of bits set in $1
|
||||
bitcount() {
|
||||
local __var="$1" __c="$2"
|
||||
assert_uint32 "$__c" || return 1
|
||||
|
||||
__c=$((((__c >> 1) & 0x55555555) + (__c & 0x55555555)))
|
||||
__c=$((((__c >> 2) & 0x33333333) + (__c & 0x33333333)))
|
||||
__c=$((((__c >> 4) & 0x0f0f0f0f) + (__c & 0x0f0f0f0f)))
|
||||
__c=$((((__c >> 8) & 0x00ff00ff) + (__c & 0x00ff00ff)))
|
||||
__c=$((((__c >> 16) & 0x0000ffff) + (__c & 0x0000ffff)))
|
||||
|
||||
export -- "$__var=$__c"
|
||||
}
|
||||
|
||||
# tedious but portable with busybox's limited shell
|
||||
# we check each octet to be in the range of 0..255,
|
||||
# and also make sure there's no extaneous characters.
|
||||
str2ip() {
|
||||
local __var="$1" __ip="$2" __n __val=0
|
||||
|
||||
case "$__ip" in
|
||||
[0-9].*)
|
||||
__n="${__ip:0:1}"
|
||||
__ip="${__ip:2}"
|
||||
;;
|
||||
[1-9][0-9].*)
|
||||
__n="${__ip:0:2}"
|
||||
__ip="${__ip:3}"
|
||||
;;
|
||||
1[0-9][0-9].*|2[0-4][0-9].*|25[0-5].*)
|
||||
__n="${__ip:0:3}"
|
||||
__ip="${__ip:4}"
|
||||
;;
|
||||
*)
|
||||
printf "Not a dotted quad (%s)\n" "$2" >&2
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
|
||||
__val=$((__n << 24))
|
||||
|
||||
case "$__ip" in
|
||||
[0-9].*)
|
||||
__n="${__ip:0:1}"
|
||||
__ip="${__ip:2}"
|
||||
;;
|
||||
[1-9][0-9].*)
|
||||
__n="${__ip:0:2}"
|
||||
__ip="${__ip:3}"
|
||||
;;
|
||||
1[0-9][0-9].*|2[0-4][0-9].*|25[0-5].*)
|
||||
__n="${__ip:0:3}"
|
||||
__ip="${__ip:4}"
|
||||
;;
|
||||
*)
|
||||
printf "Not a dotted quad (%s)\n" "$2" >&2
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
|
||||
__val=$((__val + (__n << 16)))
|
||||
|
||||
case "$__ip" in
|
||||
[0-9].*)
|
||||
__n="${__ip:0:1}"
|
||||
__ip="${__ip:2}"
|
||||
;;
|
||||
[1-9][0-9].*)
|
||||
__n="${__ip:0:2}"
|
||||
__ip="${__ip:3}"
|
||||
;;
|
||||
1[0-9][0-9].*|2[0-4][0-9].*|25[0-5].*)
|
||||
__n="${__ip:0:3}"
|
||||
__ip="${__ip:4}"
|
||||
;;
|
||||
*)
|
||||
printf "Not a dotted quad (%s)\n" "$2" >&2
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
|
||||
__val=$((__val + (__n << 8)))
|
||||
|
||||
case "$__ip" in
|
||||
[0-9])
|
||||
__n="${__ip:0:1}"
|
||||
__ip="${__ip:1}"
|
||||
;;
|
||||
[1-9][0-9])
|
||||
__n="${__ip:0:2}"
|
||||
__ip="${__ip:2}"
|
||||
;;
|
||||
1[0-9][0-9]|2[0-4][0-9]|25[0-5])
|
||||
__n="${__ip:0:3}"
|
||||
__ip="${__ip:3}"
|
||||
;;
|
||||
*)
|
||||
printf "Not a dotted quad (%s)\n" "$2" >&2
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
|
||||
__val=$((__val + __n))
|
||||
|
||||
if [ -n "$__ip" ]; then
|
||||
printf "Not a dotted quad (%s)\n" "$2" >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
export -- "$__var=$__val"
|
||||
return 0
|
||||
}
|
||||
|
||||
# convert back from an integer to dotted-quad.
|
||||
ip2str() {
|
||||
local __var="$1" __n="$2"
|
||||
assert_uint32 "$__n" || return 1
|
||||
|
||||
export -- "$__var=$((__n >> 24)).$(((__n >> 16) & 255)).$(((__n >> 8) & 255)).$((__n & 255))"
|
||||
}
|
||||
|
||||
# convert prefix into an integer bitmask
|
||||
prefix2netmask() {
|
||||
local __var="$1" __n="$2"
|
||||
assert_uint32 "$__n" || return 1
|
||||
|
||||
if [ "$__n" -gt 32 ]; then
|
||||
printf "Prefix out-of-range (%s)" "$__n" >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
export -- "$__var=$(((~(uint_max >> __n)) & uint_max))"
|
||||
}
|
||||
|
||||
_is_contiguous() {
|
||||
local __x="$1" # no checking done
|
||||
local __y=$((~__x & uint_max))
|
||||
local __z=$(((__y + 1) & uint_max))
|
||||
|
||||
[ $((__z & __y)) -eq 0 ]
|
||||
}
|
||||
|
||||
# check argument as being contiguous upper bits (and yes,
|
||||
# 0 doesn't have any discontiguous bits).
|
||||
is_contiguous() {
|
||||
local __var="$1" __x="$2" __val=0
|
||||
assert_uint32 "$__x" || return 1
|
||||
|
||||
local __y=$((~__x & uint_max))
|
||||
local __z=$(((__y + 1) & uint_max))
|
||||
|
||||
[ $((__z & __y)) -eq 0 ] && __val=1
|
||||
|
||||
export -- "$__var=$__val"
|
||||
}
|
||||
|
||||
# convert mask to prefix, validating that it's a conventional
|
||||
# (contiguous) netmask.
|
||||
netmask2prefix() {
|
||||
local __var="$1" __n="$2" __cont __bits
|
||||
assert_uint32 "$__n" || return 1
|
||||
|
||||
is_contiguous __cont "$__n" || return 1
|
||||
if [ $__cont -eq 0 ]; then
|
||||
printf "Not a contiguous netmask (%08x)\n" "$__n" >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
bitcount __bits "$__n" # already checked
|
||||
|
||||
export -- "$__var=$__bits"
|
||||
}
|
||||
|
||||
# check the argument as being an rfc-1918 address
|
||||
is_rfc1918() {
|
||||
local __var="$1" __x="$2" __val=0
|
||||
assert_uint32 "$__x" || return 1
|
||||
|
||||
if [ $d_10_0_0_0 -le $__x ] && [ $__x -le $d_10_255_255_255 ]; then
|
||||
__val=1
|
||||
elif [ $d_172_16_0_0 -le $__x ] && [ $__x -le $d_172_31_255_255 ]; then
|
||||
__val=1
|
||||
elif [ $d_192_168_0_0 -le $__x ] && [ $__x -le $d_192_168_255_255 ]; then
|
||||
__val=1
|
||||
fi
|
||||
|
||||
export -- "$__var=$__val"
|
||||
}
|
||||
|
||||
# check the argument as being an rfc-3927 address
|
||||
is_rfc3927() {
|
||||
local __var="$1" __x="$2" __val=0
|
||||
assert_uint32 "$__x" || return 1
|
||||
|
||||
if [ $d_169_254_0_0 -le $__x ] && [ $__x -le $d_169_254_255_255 ]; then
|
||||
__val=1
|
||||
fi
|
||||
|
||||
export -- "$__var=$__val"
|
||||
}
|
||||
|
||||
# check the argument as being an rfc-1122 loopback address
|
||||
is_loopback() {
|
||||
local __var="$1" __x="$2" __val=0
|
||||
assert_uint32 "$__x" || return 1
|
||||
|
||||
if [ $d_127_0_0_0 -le $__x ] && [ $__x -le $d_127_255_255_255 ]; then
|
||||
__val=1
|
||||
fi
|
||||
|
||||
export -- "$__var=$__val"
|
||||
}
|
||||
|
||||
# check the argument as being a multicast address
|
||||
is_multicast() {
|
||||
local __var="$1" __x="$2" __val=0
|
||||
assert_uint32 "$__x" || return 1
|
||||
|
||||
if [ $d_224_0_0_0 -le $__x ] && [ $__x -le $d_239_255_255_255 ]; then
|
||||
__val=1
|
||||
fi
|
||||
|
||||
export -- "$__var=$__val"
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user