Compare commits
324 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
48461b5abc | ||
|
|
7eb58cf109 | ||
|
|
1d76542cca | ||
|
|
6ca5ccc620 | ||
|
|
c2999ef592 | ||
|
|
a532aaa2aa | ||
|
|
425c6d0462 | ||
|
|
f2f672c32c | ||
|
|
f3dc2ffdd4 | ||
|
|
caaa214eae | ||
|
|
0faf921a01 | ||
|
|
f2a3653882 | ||
|
|
c6e79980b8 | ||
|
|
5866ff8be8 | ||
|
|
293c54c567 | ||
|
|
5aa97e35de | ||
|
|
7099bb19b5 | ||
|
|
53fcaed1f7 | ||
|
|
638ca50f3b | ||
|
|
47bf110cbb | ||
|
|
a49503bbc7 | ||
|
|
1bdd23231b | ||
|
|
0cb669b469 | ||
|
|
0dcc4d239d | ||
|
|
1adc6db036 | ||
|
|
298c40fd34 | ||
|
|
910a9430a0 | ||
|
|
1b94737824 | ||
|
|
0d304d4228 | ||
|
|
474c31a20d | ||
|
|
ba076ebbc5 | ||
|
|
0f23e80c27 | ||
|
|
111cf1b9f3 | ||
|
|
c4ed92ae7d | ||
|
|
7d70ad66ac | ||
|
|
7ae68124a4 | ||
|
|
fc90e87b65 | ||
|
|
c03083339a | ||
|
|
9d84accea1 | ||
|
|
1bba5789af | ||
|
|
0eed4a61b9 | ||
|
|
4a405ac8f9 | ||
|
|
e091e8951d | ||
|
|
8b52a8906b | ||
|
|
b3ba3764d0 | ||
|
|
f8e08ffd94 | ||
|
|
20a2db83de | ||
|
|
09a8183ce8 | ||
|
|
514854d636 | ||
|
|
0c05cadeb7 | ||
|
|
f4fc12f023 | ||
|
|
21903d056e | ||
|
|
f0e8470aa9 | ||
|
|
1b2a54b5cd | ||
|
|
3d52251df4 | ||
|
|
df041b6520 | ||
|
|
87e021e6e3 | ||
|
|
2e67e8c90f | ||
|
|
657e3ce8a2 | ||
|
|
0f2757dce4 | ||
|
|
2e8545333a | ||
|
|
e3021e0308 | ||
|
|
b036a22fcc | ||
|
|
fffabd3c44 | ||
|
|
2d5f8eb067 | ||
|
|
db7f80c587 | ||
|
|
00e4f6fd36 | ||
|
|
8aa92deaf6 | ||
|
|
2856c7e320 | ||
|
|
3983b4ad0f | ||
|
|
352f92fe08 | ||
|
|
31c2461e3f | ||
|
|
8bb839e85a | ||
|
|
cff47cacd1 | ||
|
|
e1e9d27655 | ||
|
|
e19fbd3297 | ||
|
|
23fd4e65ba | ||
|
|
37b0d547db | ||
|
|
e591831430 | ||
|
|
8a3ac15a47 | ||
|
|
4bd0edc8fd | ||
|
|
9451cd7c5b | ||
|
|
65b05463d7 | ||
|
|
2b122a6750 | ||
|
|
bc443b1052 | ||
|
|
c5d8d8fd64 | ||
|
|
83d3e393bf | ||
|
|
ee1cd31d2b | ||
|
|
bc61c1328d | ||
|
|
709c326461 | ||
|
|
ef5cb964b1 | ||
|
|
77fb98ee41 | ||
|
|
b24273fe71 | ||
|
|
5f5fae27b5 | ||
|
|
2b22e1d5c3 | ||
|
|
6cb46adbc9 | ||
|
|
fdc22b616c | ||
|
|
4c9b45966e | ||
|
|
67c2a176ce | ||
|
|
bf53a8327f | ||
|
|
f1336d2a70 | ||
|
|
703515f889 | ||
|
|
d27dd6298b | ||
|
|
0ce2d5b6bf | ||
|
|
09620c0825 | ||
|
|
0a3088cb4b | ||
|
|
39d03d9959 | ||
|
|
5fed9ef842 | ||
|
|
5c1758d468 | ||
|
|
349577adbf | ||
|
|
7fd494d4b2 | ||
|
|
f6d94b0dd6 | ||
|
|
59508e309e | ||
|
|
06f3b91902 | ||
|
|
5612114090 | ||
|
|
4d1ab84f1e | ||
|
|
cdeb2322ea | ||
|
|
f79926cb94 | ||
|
|
0a26490fe4 | ||
|
|
6a6e3a4928 | ||
|
|
c5879b0676 | ||
|
|
c835c9ebe5 | ||
|
|
6ebb8723a6 | ||
|
|
f527436364 | ||
|
|
f88bd7cd0f | ||
|
|
828a024c81 | ||
|
|
63a8424702 | ||
|
|
808f6a500c | ||
|
|
6d6db65d82 | ||
|
|
bd5b5c749a | ||
|
|
06e0c30336 | ||
|
|
982dd01ac3 | ||
|
|
25b7295617 | ||
|
|
71ea3b4814 | ||
|
|
44aec27112 | ||
|
|
7efe538ac1 | ||
|
|
be007c580e | ||
|
|
dbb8e04472 | ||
|
|
853bad5af2 | ||
|
|
df49e49bc7 | ||
|
|
72d045b2a6 | ||
|
|
b8c9ded999 | ||
|
|
eea6df8255 | ||
|
|
30a4966053 | ||
|
|
152f57f509 | ||
|
|
fcba5ee47a | ||
|
|
f30f25c33e | ||
|
|
d6d9f256ff | ||
|
|
e6057ed207 | ||
|
|
4a36180970 | ||
|
|
552bc355d1 | ||
|
|
14add3f724 | ||
|
|
b194b3d97f | ||
|
|
facbdec0b5 | ||
|
|
8785ebc471 | ||
|
|
eb383710e2 | ||
|
|
b7361c5b35 | ||
|
|
72c65c6213 | ||
|
|
5ad9164b9c | ||
|
|
72d8d8c6f3 | ||
|
|
a3061e57e8 | ||
|
|
8a35c489ad | ||
|
|
d536c1d04f | ||
|
|
b2f3d9b05c | ||
|
|
9f0f4c1494 | ||
|
|
68ba0525a0 | ||
|
|
cbd69f7e4e | ||
|
|
367a3bb36f | ||
|
|
4817e61f45 | ||
|
|
034a80009c | ||
|
|
e5060b32e5 | ||
|
|
b72dcd5457 | ||
|
|
57dfbac6ff | ||
|
|
32c9d467e3 | ||
|
|
e967f4dd27 | ||
|
|
eac4851bfd | ||
|
|
02515f0187 | ||
|
|
f49efcd325 | ||
|
|
921cecbdf8 | ||
|
|
b8567cb44e | ||
|
|
03ff2d7359 | ||
|
|
f25d9cbe48 | ||
|
|
bd64568d27 | ||
|
|
4e2c2b51f5 | ||
|
|
86bd886697 | ||
|
|
083854f06f | ||
|
|
42f3c1fe1c | ||
|
|
2ad4383b74 | ||
|
|
f2b885d82e | ||
|
|
054ce1624c | ||
|
|
b786a5ffc3 | ||
|
|
c656cbc56b | ||
|
|
ee3067c588 | ||
|
|
518bb7ae5a | ||
|
|
8ff8e51cda | ||
|
|
81f9cd56a2 | ||
|
|
29c0b575ee | ||
|
|
5c4b2eb3dd | ||
|
|
52add1988c | ||
|
|
c578da6198 | ||
|
|
4b9bdb48d9 | ||
|
|
85d128f145 | ||
|
|
e48b1c2c07 | ||
|
|
e8f42223be | ||
|
|
41dc50fc27 | ||
|
|
aec04e1deb | ||
|
|
f61044a9b0 | ||
|
|
36288db2fd | ||
|
|
bc49d7902c | ||
|
|
a0bc62fe08 | ||
|
|
3f9a194e04 | ||
|
|
c53bb974b2 | ||
|
|
5ed23223fd | ||
|
|
41de9a2e12 | ||
|
|
1b51a49a9d | ||
|
|
0224e32cd0 | ||
|
|
bce140ebb9 | ||
|
|
b313f0d189 | ||
|
|
581285c6dc | ||
|
|
0880105144 | ||
|
|
2a14335d95 | ||
|
|
faea9bea44 | ||
|
|
e9b60b587b | ||
|
|
af3ae4b37c | ||
|
|
d6a830ac7e | ||
|
|
9c915d1e7b | ||
|
|
4d561b3a30 | ||
|
|
f8d8b60f1b | ||
|
|
4cd9625dd4 | ||
|
|
4f5ff0041a | ||
|
|
d1d970e235 | ||
|
|
e5bc7bff85 | ||
|
|
83c9bfad1e | ||
|
|
82009d4e30 | ||
|
|
786160cd76 | ||
|
|
4d9106afa6 | ||
|
|
02d511818f | ||
|
|
036cf93edf | ||
|
|
cd99f3c744 | ||
|
|
ef170bff32 | ||
|
|
fe253bcb99 | ||
|
|
718c201b82 | ||
|
|
754f474568 | ||
|
|
be7480cb5a | ||
|
|
7c5bc827b7 | ||
|
|
acebb4a990 | ||
|
|
06fca0c48b | ||
|
|
ff813588fd | ||
|
|
2f9568ac2a | ||
|
|
f9519636f5 | ||
|
|
d7cae5f0b4 | ||
|
|
b2cd9b80ef | ||
|
|
977eb2c019 | ||
|
|
ea43d60c18 | ||
|
|
d5b5339540 | ||
|
|
01888f90a0 | ||
|
|
198d73b26f | ||
|
|
0780fd5ee6 | ||
|
|
2cf64afd4e | ||
|
|
51b6dd1aed | ||
|
|
3e4b00e6fa | ||
|
|
ca2a03d1f6 | ||
|
|
0656bee36b | ||
|
|
e53e44a0ad | ||
|
|
47fa00a3d4 | ||
|
|
b2437a02a4 | ||
|
|
f4162bf3ca | ||
|
|
e3849823e0 | ||
|
|
5f2a1ac59a | ||
|
|
406f85a328 | ||
|
|
76f1b9457d | ||
|
|
bda982b97f | ||
|
|
e038c60049 | ||
|
|
4fa8f2a7a1 | ||
|
|
31b0640906 | ||
|
|
ec095b5bf3 | ||
|
|
b8fcbbf31d | ||
|
|
70a6bbd53d | ||
|
|
f5e8c908bd | ||
|
|
69f773daa3 | ||
|
|
d46ce9498c | ||
|
|
c170848254 | ||
|
|
2ee7bc0a5e | ||
|
|
f5ab082243 | ||
|
|
66211d0781 | ||
|
|
36db143690 | ||
|
|
ecc362ed04 | ||
|
|
a1f918cd92 | ||
|
|
04a5085127 | ||
|
|
dfe77be01f | ||
|
|
f9022964cf | ||
|
|
acd1795a60 | ||
|
|
a6f3ea5e84 | ||
|
|
6b68635047 | ||
|
|
e9ecb228c9 | ||
|
|
e9d2173921 | ||
|
|
81f2196bb1 | ||
|
|
86b4b027cf | ||
|
|
806d3cc2c3 | ||
|
|
f6de4a5025 | ||
|
|
fc366fde07 | ||
|
|
b630d525c8 | ||
|
|
c2ecf9c37a | ||
|
|
4d73b6b8d0 | ||
|
|
0a4d20fa9c | ||
|
|
392cccb7f4 | ||
|
|
e775adead8 | ||
|
|
6193e3cdee | ||
|
|
b36e24f39e | ||
|
|
296772f939 | ||
|
|
b850218584 | ||
|
|
ef08595c3f | ||
|
|
3a9926e40f | ||
|
|
12392e5600 | ||
|
|
cfb3ef3a97 | ||
|
|
2c4d158d80 | ||
|
|
cf5f7aa0b6 | ||
|
|
4039b3eba1 | ||
|
|
6538961d6a | ||
|
|
c76da77573 | ||
|
|
29a4a17f55 | ||
|
|
c71e13a81a | ||
|
|
2ac776ac76 | ||
|
|
1e1e3ef2fb |
6
.github/issue_template
vendored
6
.github/issue_template
vendored
@@ -1,13 +1,13 @@
|
|||||||
This repository is a mirror of our main repo at https://git.openwrt.org/openwrt/openwrt.git
|
This repository is a mirror of our main repo at https://git.lede-project.org/sources.git
|
||||||
It is for reference only and is not active for checkins or for reporting issues.
|
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
|
All issues should be reported at: https://bugs.lede-project.org
|
||||||
|
|
||||||
Please do not open any NEW issue here - we will be closing the Github issues
|
Please do not open any NEW issue here - we will be closing the Github issues
|
||||||
capability in the near future.
|
capability in the near future.
|
||||||
|
|
||||||
We will continue to accept Pull Requests here as described in the repo description.
|
We will continue to accept Pull Requests here as described in the repo description.
|
||||||
|
|
||||||
Close this now and click here: https://bugs.openwrt.org
|
Close this now and click here: https://bugs.lede-project.org
|
||||||
|
|
||||||
Thankyou for your co-operation.
|
Thankyou for your co-operation.
|
||||||
|
|||||||
8
.github/pull_request_template
vendored
8
.github/pull_request_template
vendored
@@ -1,8 +0,0 @@
|
|||||||
Thanks for your contribution to OpenWrt!
|
|
||||||
|
|
||||||
To help keep the codebase consistent and readable,
|
|
||||||
and to help people review your contribution,
|
|
||||||
we ask you to follow the rules you find in the wiki at this link
|
|
||||||
https://openwrt.org/submitting-patches
|
|
||||||
|
|
||||||
Please remove this message before posting the pull request.
|
|
||||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -25,5 +25,3 @@ key-build*
|
|||||||
.emacs.desktop*
|
.emacs.desktop*
|
||||||
TAGS*~
|
TAGS*~
|
||||||
git-src
|
git-src
|
||||||
.project
|
|
||||||
.cproject
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
# See /LICENSE for more information.
|
# See /LICENSE for more information.
|
||||||
#
|
#
|
||||||
|
|
||||||
mainmenu "OpenWrt Configuration"
|
mainmenu "LEDE Configuration"
|
||||||
|
|
||||||
config MODULES
|
config MODULES
|
||||||
option modules
|
option modules
|
||||||
|
|||||||
19
Makefile
19
Makefile
@@ -14,11 +14,11 @@ export TOPDIR LC_ALL LANG TZ
|
|||||||
|
|
||||||
empty:=
|
empty:=
|
||||||
space:= $(empty) $(empty)
|
space:= $(empty) $(empty)
|
||||||
$(if $(findstring $(space),$(TOPDIR)),$(error ERROR: The path to the OpenWrt directory must not include any spaces))
|
$(if $(findstring $(space),$(TOPDIR)),$(error ERROR: The path to the LEDE directory must not include any spaces))
|
||||||
|
|
||||||
world:
|
world:
|
||||||
|
|
||||||
export PATH:=$(TOPDIR)/staging_dir/host/bin:$(PATH)
|
include $(TOPDIR)/include/host.mk
|
||||||
|
|
||||||
ifneq ($(OPENWRT_BUILD),1)
|
ifneq ($(OPENWRT_BUILD),1)
|
||||||
_SINGLE=export MAKEFLAGS=$(space);
|
_SINGLE=export MAKEFLAGS=$(space);
|
||||||
@@ -27,8 +27,6 @@ ifneq ($(OPENWRT_BUILD),1)
|
|||||||
export OPENWRT_BUILD
|
export OPENWRT_BUILD
|
||||||
GREP_OPTIONS=
|
GREP_OPTIONS=
|
||||||
export GREP_OPTIONS
|
export GREP_OPTIONS
|
||||||
CDPATH=
|
|
||||||
export CDPATH
|
|
||||||
include $(TOPDIR)/include/debug.mk
|
include $(TOPDIR)/include/debug.mk
|
||||||
include $(TOPDIR)/include/depends.mk
|
include $(TOPDIR)/include/depends.mk
|
||||||
include $(TOPDIR)/include/toplevel.mk
|
include $(TOPDIR)/include/toplevel.mk
|
||||||
@@ -41,8 +39,8 @@ else
|
|||||||
include tools/Makefile
|
include tools/Makefile
|
||||||
include toolchain/Makefile
|
include toolchain/Makefile
|
||||||
|
|
||||||
$(toolchain/stamp-compile): $(tools/stamp-compile)
|
$(toolchain/stamp-install): $(tools/stamp-install)
|
||||||
$(target/stamp-compile): $(toolchain/stamp-compile) $(tools/stamp-compile) $(BUILD_DIR)/.prepared
|
$(target/stamp-compile): $(toolchain/stamp-install) $(tools/stamp-install) $(BUILD_DIR)/.prepared
|
||||||
$(package/stamp-compile): $(target/stamp-compile) $(package/stamp-cleanup)
|
$(package/stamp-compile): $(target/stamp-compile) $(package/stamp-cleanup)
|
||||||
$(package/stamp-install): $(package/stamp-compile)
|
$(package/stamp-install): $(package/stamp-compile)
|
||||||
$(target/stamp-install): $(package/stamp-compile) $(package/stamp-install)
|
$(target/stamp-install): $(package/stamp-compile) $(package/stamp-install)
|
||||||
@@ -57,7 +55,7 @@ clean: FORCE
|
|||||||
rm -rf $(BUILD_DIR) $(STAGING_DIR) $(BIN_DIR) $(OUTPUT_DIR)/packages/$(ARCH_PACKAGES) $(BUILD_LOG_DIR) $(TOPDIR)/staging_dir/packages
|
rm -rf $(BUILD_DIR) $(STAGING_DIR) $(BIN_DIR) $(OUTPUT_DIR)/packages/$(ARCH_PACKAGES) $(BUILD_LOG_DIR) $(TOPDIR)/staging_dir/packages
|
||||||
|
|
||||||
dirclean: clean
|
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 $(STAGING_DIR_HOST) $(TOOLCHAIN_DIR) $(BUILD_DIR_HOST) $(BUILD_DIR_TOOLCHAIN)
|
||||||
rm -rf $(TMP_DIR)
|
rm -rf $(TMP_DIR)
|
||||||
|
|
||||||
ifndef DUMP_TARGET_DB
|
ifndef DUMP_TARGET_DB
|
||||||
@@ -87,17 +85,16 @@ prereq: $(target/stamp-prereq) tmp/.prereq_packages
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
checksum: FORCE
|
checksum: FORCE
|
||||||
$(call sha256sums,$(BIN_DIR),$(CONFIG_BUILDBOT))
|
$(call sha256sums,$(BIN_DIR))
|
||||||
|
|
||||||
diffconfig: FORCE
|
diffconfig: FORCE
|
||||||
mkdir -p $(BIN_DIR)
|
mkdir -p $(BIN_DIR)
|
||||||
$(SCRIPT_DIR)/diffconfig.sh > $(BIN_DIR)/config.seed
|
$(SCRIPT_DIR)/diffconfig.sh > $(BIN_DIR)/config.seed
|
||||||
|
|
||||||
prepare: .config $(tools/stamp-compile) $(toolchain/stamp-compile)
|
prepare: .config $(tools/stamp-install) $(toolchain/stamp-install)
|
||||||
$(_SINGLE)$(SUBMAKE) -r diffconfig
|
|
||||||
|
|
||||||
world: prepare $(target/stamp-compile) $(package/stamp-compile) $(package/stamp-install) $(target/stamp-install) FORCE
|
world: prepare $(target/stamp-compile) $(package/stamp-compile) $(package/stamp-install) $(target/stamp-install) FORCE
|
||||||
$(_SINGLE)$(SUBMAKE) -r package/index
|
$(_SINGLE)$(SUBMAKE) -r package/index
|
||||||
|
$(_SINGLE)$(SUBMAKE) -r diffconfig
|
||||||
$(_SINGLE)$(SUBMAKE) -r checksum
|
$(_SINGLE)$(SUBMAKE) -r checksum
|
||||||
|
|
||||||
.PHONY: clean dirclean prereq prepare world package/symlinks package/symlinks-install package/symlinks-clean
|
.PHONY: clean dirclean prereq prepare world package/symlinks package/symlinks-install package/symlinks-clean
|
||||||
|
|||||||
41
README
41
README
@@ -1,34 +1,29 @@
|
|||||||
_______ ________ __
|
This is the buildsystem for the LEDE Linux distribution.
|
||||||
| |.-----.-----.-----.| | | |.----.| |_
|
|
||||||
| - || _ | -__| || | | || _|| _|
|
|
||||||
|_______|| __|_____|__|__||________||__| |____|
|
|
||||||
|__| W I R E L E S S F R E E D O M
|
|
||||||
-----------------------------------------------------
|
|
||||||
|
|
||||||
This is the buildsystem for the OpenWrt Linux distribution.
|
Please use "make menuconfig" to choose your preferred
|
||||||
|
configuration for the toolchain and firmware.
|
||||||
|
|
||||||
To build your own firmware you need a Linux, BSD or MacOSX system (case
|
You need to have installed gcc, binutils, bzip2, flex, python, perl, make,
|
||||||
sensitive filesystem required). Cygwin is unsupported because of the lack
|
find, grep, diff, unzip, gawk, getopt, subversion, libz-dev and libc headers.
|
||||||
of a case sensitive file system.
|
|
||||||
|
|
||||||
You need gcc, binutils, bzip2, flex, python, perl, make, find, grep, diff,
|
Run "./scripts/feeds update -a" to get all the latest package definitions
|
||||||
unzip, gawk, getopt, subversion, libz-dev and libc headers installed.
|
defined in feeds.conf / feeds.conf.default respectively
|
||||||
|
and "./scripts/feeds install -a" to install symlinks of all of them into
|
||||||
|
package/feeds/.
|
||||||
|
|
||||||
1. Run "./scripts/feeds update -a" to obtain all the latest package definitions
|
Use "make menuconfig" to configure your image.
|
||||||
defined in feeds.conf / feeds.conf.default
|
|
||||||
|
|
||||||
2. Run "./scripts/feeds install -a" to install symlinks for all obtained
|
Simply running "make" will build your firmware.
|
||||||
packages into package/feeds/
|
It will download all sources, build the cross-compile toolchain,
|
||||||
|
the kernel and all choosen applications.
|
||||||
|
|
||||||
3. Run "make menuconfig" to select your preferred configuration for the
|
To build your own firmware you need to have access to a Linux, BSD or MacOSX system
|
||||||
toolchain, target system & firmware packages.
|
(case-sensitive filesystem required). Cygwin will not be supported because of
|
||||||
|
the lack of case sensitiveness in the file system.
|
||||||
|
|
||||||
4. Run "make" to build your firmware. This will download all sources, build
|
|
||||||
the cross-compile toolchain and then cross-compile the Linux kernel & all
|
|
||||||
chosen applications for your target system.
|
|
||||||
|
|
||||||
Sunshine!
|
Sunshine!
|
||||||
Your OpenWrt Community
|
Your LEDE Community
|
||||||
http://www.openwrt.org
|
http://www.lede-project.org
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -9,16 +9,15 @@ menu "Global build settings"
|
|||||||
|
|
||||||
config ALL_NONSHARED
|
config ALL_NONSHARED
|
||||||
bool "Select all target specific packages by default"
|
bool "Select all target specific packages by default"
|
||||||
select ALL_KMODS
|
default ALL || BUILDBOT
|
||||||
default BUILDBOT
|
|
||||||
|
|
||||||
config ALL_KMODS
|
config ALL_KMODS
|
||||||
bool "Select all kernel module packages by default"
|
bool "Select all kernel module packages by default"
|
||||||
|
default ALL
|
||||||
|
|
||||||
config ALL
|
config ALL
|
||||||
bool "Select all userspace packages by default"
|
bool "Select all userspace packages by default"
|
||||||
select ALL_KMODS
|
default n
|
||||||
select ALL_NONSHARED
|
|
||||||
|
|
||||||
config BUILDBOT
|
config BUILDBOT
|
||||||
bool "Set build defaults for automatic builds (e.g. via buildbot)"
|
bool "Set build defaults for automatic builds (e.g. via buildbot)"
|
||||||
@@ -41,7 +40,7 @@ menu "Global build settings"
|
|||||||
default n
|
default n
|
||||||
|
|
||||||
config BUILD_PATENTED
|
config BUILD_PATENTED
|
||||||
default n
|
default y
|
||||||
bool "Compile with support for patented functionality"
|
bool "Compile with support for patented functionality"
|
||||||
help
|
help
|
||||||
When this option is disabled, software which provides patented functionality
|
When this option is disabled, software which provides patented functionality
|
||||||
@@ -68,12 +67,6 @@ menu "Global build settings"
|
|||||||
This removes all ipkg/opkg status data files from the target directory
|
This removes all ipkg/opkg status data files from the target directory
|
||||||
before building the root filesystem.
|
before building the root filesystem.
|
||||||
|
|
||||||
config INCLUDE_CONFIG
|
|
||||||
bool "Include build configuration in firmware" if DEVEL
|
|
||||||
default n
|
|
||||||
help
|
|
||||||
If enabled, config.seed will be stored in /etc/build.config of firmware.
|
|
||||||
|
|
||||||
config COLLECT_KERNEL_DEBUG
|
config COLLECT_KERNEL_DEBUG
|
||||||
bool
|
bool
|
||||||
prompt "Collect kernel debug information"
|
prompt "Collect kernel debug information"
|
||||||
@@ -84,12 +77,10 @@ menu "Global build settings"
|
|||||||
Useful for release builds, so that kernel issues can be debugged offline
|
Useful for release builds, so that kernel issues can be debugged offline
|
||||||
later.
|
later.
|
||||||
|
|
||||||
menu "Kernel build options"
|
comment "Kernel build options"
|
||||||
|
|
||||||
source "config/Config-kernel.in"
|
source "config/Config-kernel.in"
|
||||||
|
|
||||||
endmenu
|
|
||||||
|
|
||||||
comment "Package build options"
|
comment "Package build options"
|
||||||
|
|
||||||
config DEBUG
|
config DEBUG
|
||||||
@@ -184,22 +175,6 @@ menu "Global build settings"
|
|||||||
this per package by adding PKG_CHECK_FORMAT_SECURITY:=0 in the package
|
this per package by adding PKG_CHECK_FORMAT_SECURITY:=0 in the package
|
||||||
Makefile.
|
Makefile.
|
||||||
|
|
||||||
config PKG_ASLR_PIE
|
|
||||||
bool
|
|
||||||
prompt "User space ASLR PIE compilation"
|
|
||||||
select BUSYBOX_DEFAULT_PIE
|
|
||||||
default n
|
|
||||||
help
|
|
||||||
Add -fPIC to CFLAGS and -specs=hardened-build-ld to LDFLAGS.
|
|
||||||
This enables package build as Position Independent Executables (PIE)
|
|
||||||
to protect against "return-to-text" attacks. This belongs to the
|
|
||||||
feature of Address Space Layout Randomisation (ASLR), which is
|
|
||||||
implemented by the kernel and the ELF loader by randomising the
|
|
||||||
location of memory allocations. This makes memory addresses harder
|
|
||||||
to predict when an attacker is attempting a memory-corruption exploit.
|
|
||||||
You can disable this per package by adding PKG_ASLR_PIE:=0 in the package
|
|
||||||
Makefile.
|
|
||||||
|
|
||||||
choice
|
choice
|
||||||
prompt "User space Stack-Smashing Protection"
|
prompt "User space Stack-Smashing Protection"
|
||||||
depends on USE_MUSL
|
depends on USE_MUSL
|
||||||
@@ -210,11 +185,11 @@ menu "Global build settings"
|
|||||||
bool "None"
|
bool "None"
|
||||||
config PKG_CC_STACKPROTECTOR_REGULAR
|
config PKG_CC_STACKPROTECTOR_REGULAR
|
||||||
bool "Regular"
|
bool "Regular"
|
||||||
select GCC_LIBSSP if !USE_MUSL
|
select SSP_SUPPORT if !USE_MUSL
|
||||||
depends on KERNEL_CC_STACKPROTECTOR_REGULAR
|
depends on KERNEL_CC_STACKPROTECTOR_REGULAR
|
||||||
config PKG_CC_STACKPROTECTOR_STRONG
|
config PKG_CC_STACKPROTECTOR_STRONG
|
||||||
bool "Strong"
|
bool "Strong"
|
||||||
select GCC_LIBSSP if !USE_MUSL
|
select SSP_SUPPORT if !USE_MUSL
|
||||||
depends on !GCC_VERSION_4_8
|
depends on !GCC_VERSION_4_8
|
||||||
depends on KERNEL_CC_STACKPROTECTOR_STRONG
|
depends on KERNEL_CC_STACKPROTECTOR_STRONG
|
||||||
endchoice
|
endchoice
|
||||||
|
|||||||
@@ -39,14 +39,6 @@ menuconfig DEVEL
|
|||||||
help
|
help
|
||||||
Automatically rebuild packages when their files change.
|
Automatically rebuild packages when their files change.
|
||||||
|
|
||||||
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_SUFFIX
|
config BUILD_SUFFIX
|
||||||
string "Build suffix to append to the target BUILD_DIR variable" if DEVEL
|
string "Build suffix to append to the target BUILD_DIR variable" if DEVEL
|
||||||
default ""
|
default ""
|
||||||
@@ -90,14 +82,13 @@ menuconfig DEVEL
|
|||||||
In this instance, the --reference option of git clone will
|
In this instance, the --reference option of git clone will
|
||||||
be used thus creating a quick local clone of your repo.
|
be used thus creating a quick local clone of your repo.
|
||||||
|
|
||||||
config KERNEL_GIT_REF
|
config KERNEL_GIT_BRANCH
|
||||||
string "Enter git ref at which to checkout" if DEVEL
|
string "Enter git branch to clone" if DEVEL
|
||||||
depends on (KERNEL_GIT_CLONE_URI != "")
|
depends on (KERNEL_GIT_CLONE_URI != "")
|
||||||
default ""
|
default ""
|
||||||
help
|
help
|
||||||
Enter the git ref at which to checkout the git repository
|
Enter the branch name to checkout after cloning the git repository.
|
||||||
after it is cloned, and before making it a tar-ball.
|
In this instance, the --branch option of git clone will be used.
|
||||||
It can be a git hash or a branch name.
|
|
||||||
If unused, the clone's repository HEAD will be checked-out.
|
If unused, the clone's repository HEAD will be checked-out.
|
||||||
|
|
||||||
config BUILD_LOG
|
config BUILD_LOG
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ menu "Target Images"
|
|||||||
default TARGET_INITRAMFS_COMPRESSION_LZMA if TARGET_ar71xx
|
default TARGET_INITRAMFS_COMPRESSION_LZMA if TARGET_ar71xx
|
||||||
default TARGET_INITRAMFS_COMPRESSION_LZMA if TARGET_ramips
|
default TARGET_INITRAMFS_COMPRESSION_LZMA if TARGET_ramips
|
||||||
default TARGET_INITRAMFS_COMPRESSION_LZMA if TARGET_apm821xx
|
default TARGET_INITRAMFS_COMPRESSION_LZMA if TARGET_apm821xx
|
||||||
default TARGET_INITRAMFS_COMPRESSION_LZMA if TARGET_mpc85xx
|
|
||||||
default TARGET_INITRAMFS_COMPRESSION_NONE
|
default TARGET_INITRAMFS_COMPRESSION_NONE
|
||||||
depends on TARGET_ROOTFS_INITRAMFS
|
depends on TARGET_ROOTFS_INITRAMFS
|
||||||
help
|
help
|
||||||
@@ -52,13 +51,6 @@ menu "Target Images"
|
|||||||
help
|
help
|
||||||
Kernel uses specified external cpio as INITRAMFS_SOURCE.
|
Kernel uses specified external cpio as INITRAMFS_SOURCE.
|
||||||
|
|
||||||
config TARGET_INITRAMFS_FORCE
|
|
||||||
bool "Force"
|
|
||||||
depends on TARGET_ROOTFS_INITRAMFS
|
|
||||||
default n
|
|
||||||
help
|
|
||||||
Ignore the initramfs passed by the bootloader.
|
|
||||||
|
|
||||||
comment "Root filesystem archives"
|
comment "Root filesystem archives"
|
||||||
|
|
||||||
config TARGET_ROOTFS_CPIOGZ
|
config TARGET_ROOTFS_CPIOGZ
|
||||||
@@ -211,11 +203,6 @@ menu "Target Images"
|
|||||||
default 38400 if TARGET_x86_generic
|
default 38400 if TARGET_x86_generic
|
||||||
default 115200
|
default 115200
|
||||||
|
|
||||||
config GRUB_FLOWCONTROL
|
|
||||||
bool "Use RTE/CTS on serial console"
|
|
||||||
depends on GRUB_SERIAL != ""
|
|
||||||
default n
|
|
||||||
|
|
||||||
config GRUB_BOOTOPTS
|
config GRUB_BOOTOPTS
|
||||||
string "Extra kernel boot options"
|
string "Extra kernel boot options"
|
||||||
depends on GRUB_IMAGES
|
depends on GRUB_IMAGES
|
||||||
@@ -250,7 +237,7 @@ menu "Target Images"
|
|||||||
|
|
||||||
config TARGET_IMAGES_GZIP
|
config TARGET_IMAGES_GZIP
|
||||||
bool "GZip images"
|
bool "GZip images"
|
||||||
depends on TARGET_IMAGES_PAD || TARGET_ROOTFS_EXT4FS || TARGET_x86
|
depends on TARGET_IMAGES_PAD || TARGET_ROOTFS_EXT4FS
|
||||||
default y
|
default y
|
||||||
|
|
||||||
comment "Image Options"
|
comment "Image Options"
|
||||||
@@ -259,12 +246,12 @@ menu "Target Images"
|
|||||||
|
|
||||||
config TARGET_KERNEL_PARTSIZE
|
config TARGET_KERNEL_PARTSIZE
|
||||||
int "Kernel partition size (in MB)"
|
int "Kernel partition size (in MB)"
|
||||||
depends on GRUB_IMAGES || USES_BOOT_PART
|
depends on GRUB_IMAGES
|
||||||
default 16
|
default 16
|
||||||
|
|
||||||
config TARGET_ROOTFS_PARTSIZE
|
config TARGET_ROOTFS_PARTSIZE
|
||||||
int "Root filesystem partition size (in MB)"
|
int "Root filesystem partition size (in MB)"
|
||||||
depends on GRUB_IMAGES || USES_ROOTFS_PART || TARGET_ROOTFS_EXT4FS || TARGET_rb532 || TARGET_mvebu || TARGET_uml
|
depends on GRUB_IMAGES || TARGET_ROOTFS_EXT4FS || TARGET_rb532 || TARGET_mvebu || TARGET_uml
|
||||||
default 256
|
default 256
|
||||||
help
|
help
|
||||||
Select the root filesystem partition size.
|
Select the root filesystem partition size.
|
||||||
|
|||||||
@@ -42,20 +42,15 @@ config KERNEL_DEBUG_FS
|
|||||||
write to these files. Many common debugging facilities, such as
|
write to these files. Many common debugging facilities, such as
|
||||||
ftrace, require the existence of debugfs.
|
ftrace, require the existence of debugfs.
|
||||||
|
|
||||||
config KERNEL_MIPS_FPU_EMULATOR
|
|
||||||
bool "Compile the kernel with MIPS FPU Emulator"
|
|
||||||
default y if TARGET_pistachio
|
|
||||||
depends on (mips || mipsel || mips64 || mips64el)
|
|
||||||
|
|
||||||
config KERNEL_ARM_PMU
|
config KERNEL_ARM_PMU
|
||||||
bool
|
bool
|
||||||
default n
|
default n
|
||||||
depends on (arm || aarch64)
|
depends on (arm || arm64)
|
||||||
|
|
||||||
config KERNEL_PERF_EVENTS
|
config KERNEL_PERF_EVENTS
|
||||||
bool "Compile the kernel with performance events and counters"
|
bool
|
||||||
default n
|
default n
|
||||||
select KERNEL_ARM_PMU if (arm || aarch64)
|
select KERNEL_ARM_PMU if (arm || arm64)
|
||||||
|
|
||||||
config KERNEL_PROFILING
|
config KERNEL_PROFILING
|
||||||
bool "Compile the kernel with profiling enabled"
|
bool "Compile the kernel with profiling enabled"
|
||||||
@@ -175,6 +170,10 @@ config KERNEL_AIO
|
|||||||
bool "Compile the kernel with asynchronous IO support"
|
bool "Compile the kernel with asynchronous IO support"
|
||||||
default n
|
default n
|
||||||
|
|
||||||
|
config KERNEL_DIRECT_IO
|
||||||
|
bool "Compile the kernel with direct IO support"
|
||||||
|
default n
|
||||||
|
|
||||||
config KERNEL_FHANDLE
|
config KERNEL_FHANDLE
|
||||||
bool "Compile the kernel with support for fhandle syscalls"
|
bool "Compile the kernel with support for fhandle syscalls"
|
||||||
default n
|
default n
|
||||||
@@ -236,16 +235,6 @@ config KERNEL_RELAY
|
|||||||
config KERNEL_KEXEC
|
config KERNEL_KEXEC
|
||||||
bool "Enable kexec support"
|
bool "Enable kexec support"
|
||||||
|
|
||||||
config KERNEL_PROC_VMCORE
|
|
||||||
bool
|
|
||||||
|
|
||||||
config KERNEL_CRASH_DUMP
|
|
||||||
depends on i386 || x86_64 || arm || armeb
|
|
||||||
select KERNEL_KEXEC
|
|
||||||
select KERNEL_PROC_VMCORE
|
|
||||||
bool "Enable support for kexec crashdump"
|
|
||||||
default y
|
|
||||||
|
|
||||||
config USE_RFKILL
|
config USE_RFKILL
|
||||||
bool "Enable rfkill support"
|
bool "Enable rfkill support"
|
||||||
default RFKILL_SUPPORT
|
default RFKILL_SUPPORT
|
||||||
@@ -259,7 +248,7 @@ config KERNEL_DEVTMPFS
|
|||||||
default n
|
default n
|
||||||
help
|
help
|
||||||
devtmpfs is a simple, kernel-managed /dev filesystem. The kernel creates
|
devtmpfs is a simple, kernel-managed /dev filesystem. The kernel creates
|
||||||
devices nodes for all registered devices to simplify boot, but leaves more
|
devices nodes for all registered devices ti simplify boot, but leaves more
|
||||||
complex tasks to userspace (e.g. udev).
|
complex tasks to userspace (e.g. udev).
|
||||||
|
|
||||||
if KERNEL_DEVTMPFS
|
if KERNEL_DEVTMPFS
|
||||||
@@ -612,17 +601,6 @@ config KERNEL_SECCOMP
|
|||||||
help
|
help
|
||||||
Build kernel with support for seccomp.
|
Build kernel with support for seccomp.
|
||||||
|
|
||||||
#
|
|
||||||
# IPv4 configuration
|
|
||||||
#
|
|
||||||
|
|
||||||
config KERNEL_IP_MROUTE
|
|
||||||
bool "Enable IPv4 multicast routing"
|
|
||||||
default y
|
|
||||||
help
|
|
||||||
Multicast routing requires a multicast routing daemon in
|
|
||||||
addition to kernel support.
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# IPv6 configuration
|
# IPv6 configuration
|
||||||
#
|
#
|
||||||
@@ -639,11 +617,7 @@ if KERNEL_IPV6
|
|||||||
def_bool y
|
def_bool y
|
||||||
|
|
||||||
config KERNEL_IPV6_MROUTE
|
config KERNEL_IPV6_MROUTE
|
||||||
bool "Enable IPv6 multicast routing"
|
def_bool y
|
||||||
default y
|
|
||||||
help
|
|
||||||
Multicast routing requires a multicast routing daemon in
|
|
||||||
addition to kernel support.
|
|
||||||
|
|
||||||
config KERNEL_IPV6_PIMSM_V2
|
config KERNEL_IPV6_PIMSM_V2
|
||||||
def_bool n
|
def_bool n
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
src-git packages https://git.openwrt.org/feed/packages.git^911bbd6bb4856f1e28ae00af37df62e4fa3529e5
|
src-git packages https://git.lede-project.org/feed/packages.git^f9e99848182fc7bc554e541ca133c22079d4041b
|
||||||
src-git luci https://git.openwrt.org/project/luci.git^6f6641d97de2c85ee5d87beda92ae8437d1dbdf5
|
src-git luci https://git.lede-project.org/project/luci.git^29fabe26399fbaecf9231e24f9ac1ee5773cafa6
|
||||||
src-git routing https://git.openwrt.org/feed/routing.git^ea345d16a6e27c2a8fdf67bf543cc36a5f189131
|
src-git routing https://git.lede-project.org/feed/routing.git^04a37ef4309c2b67c64901eb8fbf3800b4c7bb35
|
||||||
src-git telephony https://git.openwrt.org/feed/telephony.git^cb939d9677d6e38c428f9f297641d07611edeb04
|
src-git telephony https://git.lede-project.org/feed/telephony.git^1f0fb2538ba6fc306198fe2a9a4b976d63adb304
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ define autoreconf_target
|
|||||||
$(strip $(call autoreconf, \
|
$(strip $(call autoreconf, \
|
||||||
$(PKG_BUILD_DIR), $(PKG_REMOVE_FILES), \
|
$(PKG_BUILD_DIR), $(PKG_REMOVE_FILES), \
|
||||||
$(PKG_AUTOMAKE_PATHS), $(PKG_LIBTOOL_PATHS), \
|
$(PKG_AUTOMAKE_PATHS), $(PKG_LIBTOOL_PATHS), \
|
||||||
$(STAGING_DIR)/host/share/aclocal $(STAGING_DIR_HOSTPKG)/share/aclocal $(STAGING_DIR)/usr/share/aclocal $(PKG_MACRO_PATHS)))
|
$(STAGING_DIR)/host/share/aclocal $(STAGING_DIR)/usr/share/aclocal $(PKG_MACRO_PATHS)))
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define patch_libtool_target
|
define patch_libtool_target
|
||||||
@@ -105,14 +105,14 @@ ifneq ($(filter patch-libtool,$(PKG_FIXUP)),)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq ($(filter libtool,$(PKG_FIXUP)),)
|
ifneq ($(filter libtool,$(PKG_FIXUP)),)
|
||||||
PKG_BUILD_DEPENDS += libtool gettext libiconv
|
PKG_BUILD_DEPENDS += libtool libintl libiconv
|
||||||
ifeq ($(filter no-autoreconf,$(PKG_FIXUP)),)
|
ifeq ($(filter no-autoreconf,$(PKG_FIXUP)),)
|
||||||
Hooks/Configure/Pre += autoreconf_target
|
Hooks/Configure/Pre += autoreconf_target
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq ($(filter libtool-ucxx,$(PKG_FIXUP)),)
|
ifneq ($(filter libtool-ucxx,$(PKG_FIXUP)),)
|
||||||
PKG_BUILD_DEPENDS += libtool gettext libiconv
|
PKG_BUILD_DEPENDS += libtool libintl libiconv
|
||||||
ifeq ($(filter no-autoreconf,$(PKG_FIXUP)),)
|
ifeq ($(filter no-autoreconf,$(PKG_FIXUP)),)
|
||||||
Hooks/Configure/Pre += autoreconf_target
|
Hooks/Configure/Pre += autoreconf_target
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ ifneq ($(findstring c,$(OPENWRT_VERBOSE)),)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
CMAKE_BINARY_DIR = $(PKG_BUILD_DIR)$(if $(CMAKE_BINARY_SUBDIR),/$(CMAKE_BINARY_SUBDIR))
|
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))
|
CMAKE_SOURCE_DIR = $(PKG_BUILD_DIR)
|
||||||
HOST_CMAKE_SOURCE_DIR = $(HOST_BUILD_DIR)$(if $(CMAKE_SOURCE_SUBDIR),/$(CMAKE_SOURCE_SUBDIR))
|
HOST_CMAKE_SOURCE_DIR = $(HOST_BUILD_DIR)
|
||||||
MAKE_PATH = $(firstword $(CMAKE_BINARY_SUBDIR) .)
|
MAKE_PATH = $(firstword $(CMAKE_BINARY_SUBDIR) .)
|
||||||
|
|
||||||
ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),)
|
ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),)
|
||||||
@@ -34,7 +34,7 @@ CMAKE_NM:=$(call cmake_tool,$(TARGET_NM))
|
|||||||
CMAKE_RANLIB:=$(call cmake_tool,$(TARGET_RANLIB))
|
CMAKE_RANLIB:=$(call cmake_tool,$(TARGET_RANLIB))
|
||||||
|
|
||||||
CMAKE_FIND_ROOT_PATH:=$(STAGING_DIR)/usr;$(TOOLCHAIN_DIR)$(if $(CONFIG_EXTERNAL_TOOLCHAIN),;$(CONFIG_TOOLCHAIN_ROOT))
|
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_HOST_FIND_ROOT_PATH:=$(STAGING_DIR)/host;$(STAGING_DIR_HOST)
|
||||||
CMAKE_SHARED_LDFLAGS:=-Wl,-Bsymbolic-functions
|
CMAKE_SHARED_LDFLAGS:=-Wl,-Bsymbolic-functions
|
||||||
|
|
||||||
define Build/Configure/Default
|
define Build/Configure/Default
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
# 3: tempfile for file listings
|
# 3: tempfile for file listings
|
||||||
# 4: find options
|
# 4: find options
|
||||||
|
|
||||||
DEP_FINDPARAMS := -x "*/.svn*" -x ".*" -x "*:*" -x "*\!*" -x "* *" -x "*\\\#*" -x "*/.*_check" -x "*/.*.swp" -x "*/.pkgdir*"
|
DEP_FINDPARAMS := -x "*/.svn*" -x ".*" -x "*:*" -x "*\!*" -x "* *" -x "*\\\#*" -x "*/.*_check" -x "*/.*.swp"
|
||||||
|
|
||||||
find_md5=find $(wildcard $(1)) -type f $(patsubst -x,-and -not -path,$(DEP_FINDPARAMS) $(2)) | mkhash md5
|
find_md5=find $(wildcard $(1)) -type f $(patsubst -x,-and -not -path,$(DEP_FINDPARAMS) $(2)) | mkhash md5
|
||||||
|
|
||||||
@@ -20,7 +20,6 @@ define rdep
|
|||||||
.SILENT: $(2)_check
|
.SILENT: $(2)_check
|
||||||
|
|
||||||
$(2): $(2)_check
|
$(2): $(2)_check
|
||||||
check-depends: $(2)_check
|
|
||||||
|
|
||||||
ifneq ($(wildcard $(2)),)
|
ifneq ($(wildcard $(2)),)
|
||||||
$(2)_check::
|
$(2)_check::
|
||||||
@@ -47,8 +46,3 @@ endif
|
|||||||
|
|
||||||
endef
|
endef
|
||||||
|
|
||||||
ifeq ($(filter .%,$(MAKECMDGOALS)),$(if $(MAKECMDGOALS),$(MAKECMDGOALS),x))
|
|
||||||
define rdep
|
|
||||||
$(2): $(2)_check
|
|
||||||
endef
|
|
||||||
endif
|
|
||||||
|
|||||||
@@ -6,10 +6,8 @@
|
|||||||
# See /LICENSE for more information.
|
# See /LICENSE for more information.
|
||||||
#
|
#
|
||||||
|
|
||||||
PROJECT_GIT = https://git.openwrt.org
|
OPENWRT_GIT = http://git.openwrt.org
|
||||||
|
LEDE_GIT = https://git.lede-project.org
|
||||||
OPENWRT_GIT = $(PROJECT_GIT)
|
|
||||||
LEDE_GIT = $(PROJECT_GIT)
|
|
||||||
|
|
||||||
ifdef PKG_SOURCE_VERSION
|
ifdef PKG_SOURCE_VERSION
|
||||||
PKG_VERSION ?= $(if $(PKG_SOURCE_DATE),$(PKG_SOURCE_DATE)-)$(call version_abbrev,$(PKG_SOURCE_VERSION))
|
PKG_VERSION ?= $(if $(PKG_SOURCE_DATE),$(PKG_SOURCE_DATE)-)$(call version_abbrev,$(PKG_SOURCE_VERSION))
|
||||||
@@ -105,7 +103,7 @@ hash_var = $(if $(filter-out x,$(1)),MD5SUM,HASH)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
define DownloadMethod/unknown
|
define DownloadMethod/unknown
|
||||||
echo "ERROR: No download method available"; false
|
@echo "ERROR: No download method available"; false
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define DownloadMethod/default
|
define DownloadMethod/default
|
||||||
|
|||||||
@@ -10,17 +10,31 @@
|
|||||||
|
|
||||||
FEEDS_INSTALLED:=$(notdir $(wildcard $(TOPDIR)/package/feeds/*))
|
FEEDS_INSTALLED:=$(notdir $(wildcard $(TOPDIR)/package/feeds/*))
|
||||||
FEEDS_AVAILABLE:=$(sort $(FEEDS_INSTALLED) $(shell $(SCRIPT_DIR)/feeds list -n))
|
FEEDS_AVAILABLE:=$(sort $(FEEDS_INSTALLED) $(shell $(SCRIPT_DIR)/feeds list -n))
|
||||||
|
FEEDS_ENABLED:=$(foreach feed,$(FEEDS_AVAILABLE),$(if $(CONFIG_FEED_$(feed)),$(feed)))
|
||||||
|
FEEDS_DISABLED:=$(filter-out $(FEEDS_ENABLED),$(FEEDS_AVAILABLE))
|
||||||
|
|
||||||
PACKAGE_SUBDIRS=$(PACKAGE_DIR)
|
PACKAGE_SUBDIRS=$(PACKAGE_DIR)
|
||||||
ifneq ($(CONFIG_PER_FEED_REPO),)
|
ifneq ($(CONFIG_PER_FEED_REPO),)
|
||||||
PACKAGE_SUBDIRS += $(OUTPUT_DIR)/packages/$(ARCH_PACKAGES)/base
|
PACKAGE_SUBDIRS += $(OUTPUT_DIR)/packages/$(ARCH_PACKAGES)/base
|
||||||
PACKAGE_SUBDIRS += $(foreach FEED,$(FEEDS_AVAILABLE),$(OUTPUT_DIR)/packages/$(ARCH_PACKAGES)/$(FEED))
|
ifneq ($(CONFIG_PER_FEED_REPO_ADD_DISABLED),)
|
||||||
|
PACKAGE_SUBDIRS += $(foreach FEED,$(FEEDS_AVAILABLE),$(OUTPUT_DIR)/packages/$(ARCH_PACKAGES)/$(FEED))
|
||||||
|
else
|
||||||
|
PACKAGE_SUBDIRS += $(foreach FEED,$(FEEDS_ENABLED),$(OUTPUT_DIR)/packages/$(ARCH_PACKAGES)/$(FEED))
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
PACKAGE_DIR_ALL := $(TOPDIR)/staging_dir/packages/$(BOARD)
|
||||||
|
|
||||||
opkg_package_files = $(wildcard \
|
opkg_package_files = $(wildcard \
|
||||||
$(foreach dir,$(PACKAGE_SUBDIRS), \
|
$(foreach dir,$(PACKAGE_SUBDIRS), \
|
||||||
$(foreach pkg,$(1), $(dir)/$(pkg)_*.ipk)))
|
$(foreach pkg,$(1), $(dir)/$(pkg)_*.ipk)))
|
||||||
|
|
||||||
|
PKG_CONFIG_DEPENDS += \
|
||||||
|
CONFIG_PER_FEED_REPO \
|
||||||
|
CONFIG_PER_FEED_REPO_ADD_DISABLED \
|
||||||
|
CONFIG_PER_FEED_REPO_ADD_COMMENTED \
|
||||||
|
$(foreach feed,$(FEEDS_INSTALLED),CONFIG_FEED_$(feed))
|
||||||
|
|
||||||
# 1: package name
|
# 1: package name
|
||||||
define FeedPackageDir
|
define FeedPackageDir
|
||||||
$(strip $(if $(CONFIG_PER_FEED_REPO), \
|
$(strip $(if $(CONFIG_PER_FEED_REPO), \
|
||||||
@@ -33,11 +47,10 @@ endef
|
|||||||
# 1: destination file
|
# 1: destination file
|
||||||
define FeedSourcesAppend
|
define FeedSourcesAppend
|
||||||
( \
|
( \
|
||||||
echo 'src/gz %d_core %U/targets/%S/packages'; \
|
echo "src/gz %n_core %U/targets/%S/packages"; \
|
||||||
$(strip $(if $(CONFIG_PER_FEED_REPO), \
|
$(strip $(if $(CONFIG_PER_FEED_REPO), \
|
||||||
echo 'src/gz %d_base %U/packages/%A/base'; \
|
$(foreach feed,base $(FEEDS_ENABLED),echo "src/gz %n_$(feed) %U/packages/%A/$(feed)";) \
|
||||||
$(foreach feed,$(FEEDS_AVAILABLE), \
|
$(if $(CONFIG_PER_FEED_REPO_ADD_DISABLED), \
|
||||||
$(if $(CONFIG_FEED_$(feed)), \
|
$(foreach feed,$(FEEDS_DISABLED),echo "$(if $(CONFIG_PER_FEED_REPO_ADD_COMMENTED),# )src/gz %n_$(feed) %U/packages/%A/$(feed)";)))) \
|
||||||
echo '$(if $(filter m,$(CONFIG_FEED_$(feed))),# )src/gz %d_$(feed) %U/packages/%A/$(feed)';)))) \
|
|
||||||
) >> $(1)
|
) >> $(1)
|
||||||
endef
|
endef
|
||||||
|
|||||||
@@ -1,2 +0,0 @@
|
|||||||
*self_spec:
|
|
||||||
+ %{no-pie|static|r|shared:;:-pie}
|
|
||||||
@@ -6,7 +6,6 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
PKG_CHECK_FORMAT_SECURITY ?= 1
|
PKG_CHECK_FORMAT_SECURITY ?= 1
|
||||||
PKG_ASLR_PIE ?= 1
|
|
||||||
PKG_SSP ?= 1
|
PKG_SSP ?= 1
|
||||||
PKG_FORTIFY_SOURCE ?= 1
|
PKG_FORTIFY_SOURCE ?= 1
|
||||||
PKG_RELRO ?= 1
|
PKG_RELRO ?= 1
|
||||||
@@ -16,12 +15,6 @@ ifdef CONFIG_PKG_CHECK_FORMAT_SECURITY
|
|||||||
TARGET_CFLAGS += -Wformat -Werror=format-security
|
TARGET_CFLAGS += -Wformat -Werror=format-security
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
ifdef CONFIG_PKG_ASLR_PIE
|
|
||||||
ifeq ($(strip $(PKG_ASLR_PIE)),1)
|
|
||||||
TARGET_CFLAGS += $(FPIC)
|
|
||||||
TARGET_LDFLAGS += -specs=$(INCLUDE_DIR)/hardened-ld-pie.specs
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
ifdef CONFIG_PKG_CC_STACKPROTECTOR_REGULAR
|
ifdef CONFIG_PKG_CC_STACKPROTECTOR_REGULAR
|
||||||
ifeq ($(strip $(PKG_SSP)),1)
|
ifeq ($(strip $(PKG_SSP)),1)
|
||||||
TARGET_CFLAGS += -fstack-protector
|
TARGET_CFLAGS += -fstack-protector
|
||||||
|
|||||||
@@ -19,23 +19,22 @@ else
|
|||||||
HOST_JOBS?=$(if $(HOST_BUILD_PARALLEL),$(HOST_MAKE_J),-j1)
|
HOST_JOBS?=$(if $(HOST_BUILD_PARALLEL),$(HOST_MAKE_J),-j1)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
include $(INCLUDE_DIR)/host.mk
|
||||||
include $(INCLUDE_DIR)/unpack.mk
|
include $(INCLUDE_DIR)/unpack.mk
|
||||||
include $(INCLUDE_DIR)/depends.mk
|
include $(INCLUDE_DIR)/depends.mk
|
||||||
include $(INCLUDE_DIR)/quilt.mk
|
|
||||||
|
|
||||||
BUILD_TYPES += host
|
BUILD_TYPES += host
|
||||||
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_PREPARED=$(HOST_BUILD_DIR)/.prepared$(if $(HOST_QUILT)$(DUMP),,$(shell $(call find_md5,${CURDIR} $(PKG_FILE_DEPENDS),)))
|
||||||
HOST_STAMP_CONFIGURED:=$(HOST_BUILD_DIR)/.configured
|
HOST_STAMP_CONFIGURED:=$(HOST_BUILD_DIR)/.configured
|
||||||
HOST_STAMP_BUILT:=$(HOST_BUILD_DIR)/.built
|
HOST_STAMP_BUILT:=$(HOST_BUILD_DIR)/.built
|
||||||
HOST_BUILD_PREFIX?=$(if $(IS_PACKAGE_BUILD),$(STAGING_DIR_HOSTPKG),$(STAGING_DIR_HOST))
|
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_INSTALLED:=$(HOST_BUILD_PREFIX)/stamp/.$(PKG_NAME)_installed
|
||||||
|
|
||||||
override MAKEFLAGS=
|
override MAKEFLAGS=
|
||||||
|
|
||||||
|
include $(INCLUDE_DIR)/quilt.mk
|
||||||
include $(INCLUDE_DIR)/autotools.mk
|
include $(INCLUDE_DIR)/autotools.mk
|
||||||
|
|
||||||
_host_target:=$(if $(HOST_QUILT),,.)
|
|
||||||
|
|
||||||
Host/Patch:=$(Host/Patch/Default)
|
Host/Patch:=$(Host/Patch/Default)
|
||||||
ifneq ($(strip $(HOST_UNPACK)),)
|
ifneq ($(strip $(HOST_UNPACK)),)
|
||||||
define Host/Prepare/Default
|
define Host/Prepare/Default
|
||||||
@@ -52,7 +51,6 @@ endef
|
|||||||
HOST_CONFIGURE_VARS = \
|
HOST_CONFIGURE_VARS = \
|
||||||
CC="$(HOSTCC)" \
|
CC="$(HOSTCC)" \
|
||||||
CFLAGS="$(HOST_CFLAGS)" \
|
CFLAGS="$(HOST_CFLAGS)" \
|
||||||
CXX="$(HOSTCXX)" \
|
|
||||||
CPPFLAGS="$(HOST_CPPFLAGS)" \
|
CPPFLAGS="$(HOST_CPPFLAGS)" \
|
||||||
LDFLAGS="$(HOST_LDFLAGS)" \
|
LDFLAGS="$(HOST_LDFLAGS)" \
|
||||||
CONFIG_SHELL="$(SHELL)"
|
CONFIG_SHELL="$(SHELL)"
|
||||||
@@ -79,10 +77,6 @@ HOST_MAKE_FLAGS =
|
|||||||
|
|
||||||
HOST_CONFIGURE_CMD = $(BASH) ./configure
|
HOST_CONFIGURE_CMD = $(BASH) ./configure
|
||||||
|
|
||||||
ifeq ($(HOST_OS),Darwin)
|
|
||||||
HOST_CONFIG_SITE:=$(INCLUDE_DIR)/site/darwin
|
|
||||||
endif
|
|
||||||
|
|
||||||
define Host/Configure/Default
|
define Host/Configure/Default
|
||||||
$(if $(HOST_CONFIGURE_PARALLEL),+)(cd $(HOST_BUILD_DIR)/$(3); \
|
$(if $(HOST_CONFIGURE_PARALLEL),+)(cd $(HOST_BUILD_DIR)/$(3); \
|
||||||
if [ -x configure ]; then \
|
if [ -x configure ]; then \
|
||||||
@@ -112,7 +106,7 @@ define Host/Compile
|
|||||||
endef
|
endef
|
||||||
|
|
||||||
define Host/Install/Default
|
define Host/Install/Default
|
||||||
$(call Host/Compile/Default,install)
|
$(_SINGLE)$(MAKE) -C $(HOST_BUILD_DIR) install
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Host/Install
|
define Host/Install
|
||||||
@@ -128,12 +122,11 @@ ifneq ($(if $(HOST_QUILT),,$(CONFIG_AUTOREBUILD)),)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
define Host/Exports/Default
|
define Host/Exports/Default
|
||||||
$(1) : export ACLOCAL_INCLUDE=$$(foreach p,$$(wildcard $$(STAGING_DIR_HOST)/share/aclocal $$(STAGING_DIR_HOST)/share/aclocal-* $(if $(IS_PACKAGE_BUILD),$$(STAGING_DIR)/host/share/aclocal $$(STAGING_DIR_HOSTPKG)/share/aclocal $$(STAGING_DIR)/host/share/aclocal-*)),-I $$(p))
|
$(1) : export ACLOCAL_INCLUDE=$$(foreach p,$$(wildcard $$(STAGING_DIR_HOST)/share/aclocal $$(STAGING_DIR_HOST)/share/aclocal-* $(if $(IS_PACKAGE_BUILD),$$(STAGING_DIR)/host/share/aclocal $$(STAGING_DIR)/host/share/aclocal-*)),-I $$(p))
|
||||||
$(1) : export STAGING_PREFIX=$$(HOST_BUILD_PREFIX)
|
$(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_PATH=$$(STAGING_DIR_HOST)/lib/pkgconfig:$$(HOST_BUILD_PREFIX)/lib/pkgconfig
|
||||||
$(1) : export PKG_CONFIG_LIBDIR=$$(HOST_BUILD_PREFIX)/lib/pkgconfig
|
$(1) : export PKG_CONFIG_LIBDIR=$$(HOST_BUILD_PREFIX)/lib/pkgconfig
|
||||||
$(if $(CONFIG_CCACHE),$(1) : export CCACHE_DIR:=$(STAGING_DIR_HOST)/ccache)
|
$(1) : export CCACHE_DIR:=$(STAGING_DIR_HOST)/ccache
|
||||||
$(if $(HOST_CONFIG_SITE),$(1) : export CONFIG_SITE:=$(HOST_CONFIG_SITE))
|
|
||||||
$(if $(IS_PACKAGE_BUILD),$(1) : export PATH=$$(TARGET_PATH_PKG))
|
$(if $(IS_PACKAGE_BUILD),$(1) : export PATH=$$(TARGET_PATH_PKG))
|
||||||
endef
|
endef
|
||||||
Host/Exports=$(Host/Exports/Default)
|
Host/Exports=$(Host/Exports/Default)
|
||||||
@@ -175,34 +168,32 @@ ifndef DUMP
|
|||||||
touch $(HOST_STAMP_BUILT)
|
touch $(HOST_STAMP_BUILT)
|
||||||
touch $$@
|
touch $$@
|
||||||
|
|
||||||
$(call DefaultTargets,$(patsubst %,host-%,$(DEFAULT_SUBDIR_TARGETS)))
|
|
||||||
ifndef STAMP_BUILT
|
ifndef STAMP_BUILT
|
||||||
$(foreach t,$(DEFAULT_SUBDIR_TARGETS),
|
prepare: host-prepare
|
||||||
$(t): host-$(t)
|
compile: host-compile
|
||||||
.$(t): .host-$(t)
|
install: host-install
|
||||||
)
|
clean: host-clean
|
||||||
clean-build: host-clean-build
|
update: host-update
|
||||||
|
refresh: host-refresh
|
||||||
endif
|
endif
|
||||||
|
|
||||||
$(_host_target)host-prepare: $(HOST_STAMP_PREPARED)
|
host-prepare: $(HOST_STAMP_PREPARED)
|
||||||
$(_host_target)host-configure: $(HOST_STAMP_CONFIGURED)
|
host-configure: $(HOST_STAMP_CONFIGURED)
|
||||||
$(_host_target)host-compile: $(HOST_STAMP_BUILT) $(HOST_STAMP_INSTALLED)
|
host-compile: $(HOST_STAMP_BUILT) $(if $(STAMP_BUILT),$(HOST_STAMP_INSTALLED))
|
||||||
host-install: host-compile
|
host-install: $(HOST_STAMP_INSTALLED)
|
||||||
|
host-clean: FORCE
|
||||||
host-clean-build: FORCE
|
|
||||||
rm -rf $(HOST_BUILD_DIR) $(HOST_STAMP_BUILT)
|
|
||||||
|
|
||||||
host-clean: host-clean-build
|
|
||||||
$(call Host/Clean)
|
$(call Host/Clean)
|
||||||
$(call Host/Uninstall)
|
$(call Host/Uninstall)
|
||||||
rm -rf $(HOST_STAMP_INSTALLED)
|
rm -rf $(HOST_BUILD_DIR) $(HOST_STAMP_INSTALLED) $(HOST_STAMP_BUILT)
|
||||||
|
|
||||||
ifneq ($(CONFIG_AUTOREMOVE),)
|
|
||||||
host-compile:
|
|
||||||
$(FIND) $(HOST_BUILD_DIR) -mindepth 1 -maxdepth 1 -not '(' -type f -and -name '.*' -and -size 0 ')' | \
|
|
||||||
$(XARGS) rm -rf
|
|
||||||
endif
|
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
download:
|
||||||
|
prepare:
|
||||||
|
compile:
|
||||||
|
install:
|
||||||
|
clean:
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
define HostBuild
|
define HostBuild
|
||||||
|
|||||||
51
include/host.mk
Normal file
51
include/host.mk
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
#
|
||||||
|
# Copyright (C) 2007-2015 OpenWrt.org
|
||||||
|
#
|
||||||
|
# This is free software, licensed under the GNU General Public License v2.
|
||||||
|
# See /LICENSE for more information.
|
||||||
|
#
|
||||||
|
|
||||||
|
TMP_DIR ?= $(TOPDIR)/tmp
|
||||||
|
ifeq ($(if $(TARGET_BUILD),,$(DUMP)),)
|
||||||
|
-include $(TMP_DIR)/.host.mk
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifneq ($(__host_inc),1)
|
||||||
|
__host_inc:=1
|
||||||
|
|
||||||
|
export PATH:=$(TOPDIR)/staging_dir/host/bin:$(PATH)
|
||||||
|
|
||||||
|
try-run = $(shell set -e; \
|
||||||
|
TMP_F="$(TMP_DIR)/try-run.$$$$.tmp"; \
|
||||||
|
if ($(1)) >/dev/null 2>&1; then echo "$(2)"; else echo "$(3)"; fi; \
|
||||||
|
rm -f "$$TMP_F"; \
|
||||||
|
)
|
||||||
|
|
||||||
|
host-cc-option = $(call try-run, \
|
||||||
|
$(HOSTCC) $(HOST_CFLAGS) $(1) -c -xc /dev/null -o "$$TMP_F",$(1),$(2) \
|
||||||
|
)
|
||||||
|
|
||||||
|
.PRECIOUS: $(TMP_DIR)/.host.mk
|
||||||
|
$(TMP_DIR)/.host.mk: $(TOPDIR)/include/host.mk
|
||||||
|
@mkdir -p $(TMP_DIR)
|
||||||
|
@( \
|
||||||
|
HOST_OS=`uname`; \
|
||||||
|
case "$$HOST_OS" in \
|
||||||
|
Linux) HOST_ARCH=`uname -m`;; \
|
||||||
|
Darwin) HOST_ARCH=`uname -m`;; \
|
||||||
|
*) HOST_ARCH=`uname -p`;; \
|
||||||
|
esac; \
|
||||||
|
GNU_HOST_NAME=`gcc -dumpmachine`; \
|
||||||
|
[ -z "$$GNU_HOST_NAME" -o "$$HOST_OS" = "Darwin" ] && \
|
||||||
|
GNU_HOST_NAME=`$(TOPDIR)/scripts/config.guess`; \
|
||||||
|
echo "HOST_OS:=$$HOST_OS" > $@; \
|
||||||
|
echo "HOST_ARCH:=$$HOST_ARCH" >> $@; \
|
||||||
|
echo "GNU_HOST_NAME:=$$GNU_HOST_NAME" >> $@; \
|
||||||
|
if gfind -L /dev/null || find -L /dev/null; then \
|
||||||
|
echo "FIND_L=find -L \$$(1)" >> $@; \
|
||||||
|
else \
|
||||||
|
echo "FIND_L=find \$$(1) -follow" >> $@; \
|
||||||
|
fi \
|
||||||
|
) >/dev/null 2>/dev/null
|
||||||
|
|
||||||
|
endif
|
||||||
@@ -7,46 +7,8 @@ define Build/uImage
|
|||||||
mkimage -A $(LINUX_KARCH) \
|
mkimage -A $(LINUX_KARCH) \
|
||||||
-O linux -T kernel \
|
-O linux -T kernel \
|
||||||
-C $(1) -a $(KERNEL_LOADADDR) -e $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \
|
-C $(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))' -d $@ $@.new
|
-n '$(if $(UIMAGE_NAME),$(UIMAGE_NAME),$(call toupper,$(LINUX_KARCH)) LEDE Linux-$(LINUX_VERSION))' -d $@ $@.new
|
||||||
mv $@.new $@
|
@mv $@.new $@
|
||||||
endef
|
|
||||||
|
|
||||||
define Build/buffalo-enc
|
|
||||||
$(eval product=$(word 1,$(1)))
|
|
||||||
$(eval version=$(word 2,$(1)))
|
|
||||||
$(eval args=$(wordlist 3,$(words $(1)),$(1)))
|
|
||||||
$(STAGING_DIR_HOST)/bin/buffalo-enc \
|
|
||||||
-p $(product) -v $(version) $(args) \
|
|
||||||
-i $@ -o $@.new
|
|
||||||
mv $@.new $@
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Build/buffalo-enc-tag
|
|
||||||
$(call Build/buffalo-enc,'' '' -S 152 $(1))
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Build/buffalo-tag-dhp
|
|
||||||
$(eval product=$(word 1,$(1)))
|
|
||||||
$(eval region=$(word 2,$(1)))
|
|
||||||
$(eval language=$(word 3,$(1)))
|
|
||||||
$(STAGING_DIR_HOST)/bin/buffalo-tag \
|
|
||||||
-d 0x01000000 -w 1 \
|
|
||||||
-a $(BUFFALO_TAG_PLATFORM) \
|
|
||||||
-v $(BUFFALO_TAG_VERSION) -m $(BUFFALO_TAG_MINOR) \
|
|
||||||
-b $(product) -p $(product) \
|
|
||||||
-r $(region) -r $(region) -l $(language) \
|
|
||||||
-I $@ -o $@.new
|
|
||||||
mv $@.new $@
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Build/buffalo-dhp-image
|
|
||||||
$(STAGING_DIR_HOST)/bin/mkdhpimg $@ $@.new
|
|
||||||
mv $@.new $@
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Build/eva-image
|
|
||||||
$(STAGING_DIR_HOST)/bin/lzma2eva $(KERNEL_LOADADDR) $(KERNEL_LOADADDR) $@ $@.new
|
|
||||||
mv $@.new $@
|
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Build/netgear-chk
|
define Build/netgear-chk
|
||||||
@@ -54,45 +16,22 @@ define Build/netgear-chk
|
|||||||
-o $@.new \
|
-o $@.new \
|
||||||
-k $@ \
|
-k $@ \
|
||||||
-b $(NETGEAR_BOARD_ID) \
|
-b $(NETGEAR_BOARD_ID) \
|
||||||
$(if $(NETGEAR_REGION),-r $(NETGEAR_REGION),)
|
-r $(NETGEAR_REGION)
|
||||||
mv $@.new $@
|
mv $@.new $@
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Build/netgear-dni
|
define Build/netgear-dni
|
||||||
$(STAGING_DIR_HOST)/bin/mkdniimg \
|
$(STAGING_DIR_HOST)/bin/mkdniimg \
|
||||||
-B $(NETGEAR_BOARD_ID) -v $(VERSION_DIST).$(firstword $(subst -, ,$(REVISION))) \
|
-B $(NETGEAR_BOARD_ID) -v LEDE.$(REVISION) \
|
||||||
$(if $(NETGEAR_HW_ID),-H $(NETGEAR_HW_ID)) \
|
$(if $(NETGEAR_HW_ID),-H $(NETGEAR_HW_ID)) \
|
||||||
-r "$(1)" \
|
-r "$(1)" \
|
||||||
-i $@ -o $@.new
|
-i $@ -o $@.new
|
||||||
mv $@.new $@
|
mv $@.new $@
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Build/append-squashfs-fakeroot-be
|
|
||||||
rm -rf $@.fakefs $@.fakesquashfs
|
|
||||||
mkdir $@.fakefs
|
|
||||||
$(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
|
|
||||||
|
|
||||||
# append a fake/empty uImage header, to fool bootloaders rootfs integrity check
|
|
||||||
# for example
|
|
||||||
define Build/append-uImage-fakehdr
|
|
||||||
touch $@.fakehdr
|
|
||||||
$(STAGING_DIR_HOST)/bin/mkimage \
|
|
||||||
-A $(LINUX_KARCH) -O linux -T $(1) -C none \
|
|
||||||
-n '$(VERSION_DIST) fake $(1)' \
|
|
||||||
-d $@.fakehdr \
|
|
||||||
-s \
|
|
||||||
$@.fakehdr
|
|
||||||
cat $@.fakehdr >> $@
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Build/tplink-safeloader
|
define Build/tplink-safeloader
|
||||||
-$(STAGING_DIR_HOST)/bin/tplink-safeloader \
|
-$(STAGING_DIR_HOST)/bin/tplink-safeloader \
|
||||||
-B $(TPLINK_BOARD_ID) \
|
-B $(TPLINK_BOARD_NAME) \
|
||||||
-V $(REVISION) \
|
-V $(REVISION) \
|
||||||
-k $(IMAGE_KERNEL) \
|
-k $(IMAGE_KERNEL) \
|
||||||
-r $@ \
|
-r $@ \
|
||||||
@@ -103,7 +42,8 @@ define Build/tplink-safeloader
|
|||||||
endef
|
endef
|
||||||
|
|
||||||
define Build/append-dtb
|
define Build/append-dtb
|
||||||
cat $(KDIR)/image-$(firstword $(DEVICE_DTS)).dtb >> $@
|
$(call Image/BuildDTB,$(if $(DEVICE_DTS_DIR),$(DEVICE_DTS_DIR),$(DTS_DIR))/$(DEVICE_DTS).dts,$@.dtb)
|
||||||
|
cat $@.dtb >> $@
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Build/install-dtb
|
define Build/install-dtb
|
||||||
@@ -119,7 +59,6 @@ define Build/fit
|
|||||||
-D $(DEVICE_NAME) -o $@.its -k $@ \
|
-D $(DEVICE_NAME) -o $@.its -k $@ \
|
||||||
$(if $(word 2,$(1)),-d $(word 2,$(1))) -C $(word 1,$(1)) \
|
$(if $(word 2,$(1)),-d $(word 2,$(1))) -C $(word 1,$(1)) \
|
||||||
-a $(KERNEL_LOADADDR) -e $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \
|
-a $(KERNEL_LOADADDR) -e $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \
|
||||||
-c $(if $(DEVICE_DTS_CONFIG),$(DEVICE_DTS_CONFIG),"config@1") \
|
|
||||||
-A $(LINUX_KARCH) -v $(LINUX_VERSION)
|
-A $(LINUX_KARCH) -v $(LINUX_VERSION)
|
||||||
PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $@.its $@.new
|
PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $@.its $@.new
|
||||||
@mv $@.new $@
|
@mv $@.new $@
|
||||||
@@ -135,7 +74,7 @@ define Build/lzma-no-dict
|
|||||||
endef
|
endef
|
||||||
|
|
||||||
define Build/gzip
|
define Build/gzip
|
||||||
gzip -f -9n -c $@ $(1) > $@.new
|
gzip -9n -c $@ $(1) > $@.new
|
||||||
@mv $@.new $@
|
@mv $@.new $@
|
||||||
endef
|
endef
|
||||||
|
|
||||||
@@ -186,10 +125,6 @@ define Build/append-ubi
|
|||||||
rm $@.tmp
|
rm $@.tmp
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Build/append-uboot
|
|
||||||
dd if=$(UBOOT_PATH) >> $@
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Build/pad-to
|
define Build/pad-to
|
||||||
dd if=$@ of=$@.new bs=$(1) conv=sync
|
dd if=$@ of=$@.new bs=$(1) conv=sync
|
||||||
mv $@.new $@
|
mv $@.new $@
|
||||||
@@ -230,19 +165,6 @@ define Build/combined-image
|
|||||||
@mv $@.new $@
|
@mv $@.new $@
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Build/openmesh-image
|
|
||||||
$(TOPDIR)/scripts/om-fwupgradecfg-gen.sh \
|
|
||||||
"$(call param_get_default,ce_type,$(1),$(DEVICE_NAME))" \
|
|
||||||
"$@-fwupgrade.cfg" \
|
|
||||||
"$(call param_get_default,kernel,$(1),$(IMAGE_KERNEL))" \
|
|
||||||
"$(call param_get_default,rootfs,$(1),$@)"
|
|
||||||
$(TOPDIR)/scripts/combined-ext-image.sh \
|
|
||||||
"$(call param_get_default,ce_type,$(1),$(DEVICE_NAME))" "$@" \
|
|
||||||
"$@-fwupgrade.cfg" "fwupgrade.cfg" \
|
|
||||||
"$(call param_get_default,kernel,$(1),$(IMAGE_KERNEL))" "kernel" \
|
|
||||||
"$(call param_get_default,rootfs,$(1),$@)" "rootfs"
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Build/sysupgrade-tar
|
define Build/sysupgrade-tar
|
||||||
sh $(TOPDIR)/scripts/sysupgrade-tar.sh \
|
sh $(TOPDIR)/scripts/sysupgrade-tar.sh \
|
||||||
--board $(if $(BOARD_NAME),$(BOARD_NAME),$(DEVICE_NAME)) \
|
--board $(if $(BOARD_NAME),$(BOARD_NAME),$(DEVICE_NAME)) \
|
||||||
@@ -251,35 +173,6 @@ define Build/sysupgrade-tar
|
|||||||
$@
|
$@
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Build/tplink-v1-header
|
|
||||||
$(STAGING_DIR_HOST)/bin/mktplinkfw \
|
|
||||||
-c -H $(TPLINK_HWID) -W $(TPLINK_HWREV) -L $(KERNEL_LOADADDR) \
|
|
||||||
-E $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \
|
|
||||||
-m $(TPLINK_HEADER_VERSION) -N "$(VERSION_DIST)" -V $(REVISION) \
|
|
||||||
-k $@ -o $@.new $(1)
|
|
||||||
@mv $@.new $@
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Build/tplink-v2-header
|
|
||||||
$(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 $@
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Build/tplink-v2-image
|
|
||||||
$(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
|
|
||||||
endef
|
|
||||||
|
|
||||||
json_quote=$(subst ','\'',$(subst ",\",$(1)))
|
json_quote=$(subst ','\'',$(subst ",\",$(1)))
|
||||||
#")')
|
#")')
|
||||||
metadata_devices=$(if $(1),$(subst "$(space)","$(comma)",$(strip $(foreach v,$(1),"$(call json_quote,$(v))"))))
|
metadata_devices=$(if $(1),$(subst "$(space)","$(comma)",$(strip $(foreach v,$(1),"$(call json_quote,$(v))"))))
|
||||||
@@ -295,7 +188,7 @@ metadata_json = \
|
|||||||
}'
|
}'
|
||||||
|
|
||||||
define Build/append-metadata
|
define Build/append-metadata
|
||||||
$(if $(SUPPORTED_DEVICES),-echo $(call metadata_json,$(SUPPORTED_DEVICES)) | fwtool -I - $@)
|
$(if $(SUPPORTED_DEVICES),echo $(call metadata_json,$(SUPPORTED_DEVICES)) | fwtool -I - $@)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Build/kernel2minor
|
define Build/kernel2minor
|
||||||
|
|||||||
@@ -48,7 +48,6 @@ endef
|
|||||||
ifdef TARGET_PER_DEVICE_ROOTFS
|
ifdef TARGET_PER_DEVICE_ROOTFS
|
||||||
define Image/Build/Profile/Filesystem
|
define Image/Build/Profile/Filesystem
|
||||||
cp $(KDIR)/root.$(2)+pkg=$(3) $(KDIR)/root.$(2)
|
cp $(KDIR)/root.$(2)+pkg=$(3) $(KDIR)/root.$(2)
|
||||||
$(call Image/Build/$(2),$(2))
|
|
||||||
$(call Image/Build/Profile,$(1),$(2))
|
$(call Image/Build/Profile,$(1),$(2))
|
||||||
endef
|
endef
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
override TARGET_BUILD=
|
override TARGET_BUILD=
|
||||||
include $(INCLUDE_DIR)/prereq.mk
|
include $(INCLUDE_DIR)/prereq.mk
|
||||||
include $(INCLUDE_DIR)/kernel.mk
|
include $(INCLUDE_DIR)/kernel.mk
|
||||||
|
include $(INCLUDE_DIR)/host.mk
|
||||||
include $(INCLUDE_DIR)/version.mk
|
include $(INCLUDE_DIR)/version.mk
|
||||||
include $(INCLUDE_DIR)/image-commands.mk
|
include $(INCLUDE_DIR)/image-commands.mk
|
||||||
|
|
||||||
@@ -18,8 +19,10 @@ ifndef IB
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
include $(INCLUDE_DIR)/image-legacy.mk
|
include $(INCLUDE_DIR)/image-legacy.mk
|
||||||
include $(INCLUDE_DIR)/feeds.mk
|
|
||||||
include $(INCLUDE_DIR)/rootfs.mk
|
ifdef TARGET_PER_DEVICE_ROOTFS
|
||||||
|
include $(INCLUDE_DIR)/rootfs.mk
|
||||||
|
endif
|
||||||
|
|
||||||
override MAKE:=$(_SINGLE)$(SUBMAKE)
|
override MAKE:=$(_SINGLE)$(SUBMAKE)
|
||||||
override NO_TRACE_MAKE:=$(_SINGLE)$(NO_TRACE_MAKE)
|
override NO_TRACE_MAKE:=$(_SINGLE)$(NO_TRACE_MAKE)
|
||||||
@@ -134,13 +137,12 @@ endef
|
|||||||
|
|
||||||
define Image/BuildKernel/MkuImage
|
define Image/BuildKernel/MkuImage
|
||||||
mkimage -A $(ARCH) -O linux -T kernel -C $(1) -a $(2) -e $(3) \
|
mkimage -A $(ARCH) -O linux -T kernel -C $(1) -a $(2) -e $(3) \
|
||||||
-n '$(call toupper,$(ARCH)) $(VERSION_DIST) Linux-$(LINUX_VERSION)' -d $(4) $(5)
|
-n '$(call toupper,$(ARCH)) LEDE Linux-$(LINUX_VERSION)' -d $(4) $(5)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Image/BuildKernel/MkFIT
|
define Image/BuildKernel/MkFIT
|
||||||
$(TOPDIR)/scripts/mkits.sh \
|
$(TOPDIR)/scripts/mkits.sh \
|
||||||
-D $(1) -o $(KDIR)/fit-$(1).its -k $(2) $(if $(3),-d $(3)) -C $(4) -a $(5) -e $(6) \
|
-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)
|
-A $(LINUX_KARCH) -v $(LINUX_VERSION)
|
||||||
PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $(KDIR)/fit-$(1).its $(KDIR)/fit-$(1)$(7).itb
|
PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $(KDIR)/fit-$(1).its $(KDIR)/fit-$(1)$(7).itb
|
||||||
endef
|
endef
|
||||||
@@ -160,7 +162,6 @@ define Image/BuildDTB
|
|||||||
$(TARGET_CROSS)cpp -nostdinc -x assembler-with-cpp \
|
$(TARGET_CROSS)cpp -nostdinc -x assembler-with-cpp \
|
||||||
-I$(DTS_DIR) \
|
-I$(DTS_DIR) \
|
||||||
-I$(DTS_DIR)/include \
|
-I$(DTS_DIR)/include \
|
||||||
-I$(LINUX_DIR)/include/ \
|
|
||||||
-undef -D__DTS__ $(3) \
|
-undef -D__DTS__ $(3) \
|
||||||
-o $(2).tmp $(1)
|
-o $(2).tmp $(1)
|
||||||
$(LINUX_DIR)/scripts/dtc/dtc -O dtb \
|
$(LINUX_DIR)/scripts/dtc/dtc -O dtb \
|
||||||
@@ -210,15 +211,14 @@ endef
|
|||||||
# $(1): board name
|
# $(1): board name
|
||||||
# $(2): rootfs type
|
# $(2): rootfs type
|
||||||
# $(3): kernel image
|
# $(3): kernel image
|
||||||
# $(4): compat string
|
|
||||||
ifneq ($(CONFIG_NAND_SUPPORT),)
|
ifneq ($(CONFIG_NAND_SUPPORT),)
|
||||||
define Image/Build/SysupgradeNAND
|
define Image/Build/SysupgradeNAND
|
||||||
mkdir -p "$(KDIR_TMP)/sysupgrade-$(if $(4),$(4),$(1))/"
|
mkdir -p "$(KDIR_TMP)/sysupgrade-$(1)/"
|
||||||
echo "BOARD=$(if $(4),$(4),$(1))" > "$(KDIR_TMP)/sysupgrade-$(if $(4),$(4),$(1))/CONTROL"
|
echo "BOARD=$(1)" > "$(KDIR_TMP)/sysupgrade-$(1)/CONTROL"
|
||||||
[ -z "$(2)" ] || $(CP) "$(KDIR)/root.$(2)" "$(KDIR_TMP)/sysupgrade-$(if $(4),$(4),$(1))/root"
|
[ -z "$(2)" ] || $(CP) "$(KDIR)/root.$(2)" "$(KDIR_TMP)/sysupgrade-$(1)/root"
|
||||||
[ -z "$(3)" ] || $(CP) "$(3)" "$(KDIR_TMP)/sysupgrade-$(if $(4),$(4),$(1))/kernel"
|
[ -z "$(3)" ] || $(CP) "$(3)" "$(KDIR_TMP)/sysupgrade-$(1)/kernel"
|
||||||
(cd "$(KDIR_TMP)"; $(TAR) cvf \
|
(cd "$(KDIR_TMP)"; $(TAR) cvf \
|
||||||
"$(BIN_DIR)/$(IMG_PREFIX)-$(1)-$(2)-sysupgrade.tar" sysupgrade-$(if $(4),$(4),$(1)) \
|
"$(BIN_DIR)/$(IMG_PREFIX)-$(1)-$(2)-sysupgrade.tar" sysupgrade-$(1) \
|
||||||
$(if $(SOURCE_DATE_EPOCH),--mtime="@$(SOURCE_DATE_EPOCH)") \
|
$(if $(SOURCE_DATE_EPOCH),--mtime="@$(SOURCE_DATE_EPOCH)") \
|
||||||
)
|
)
|
||||||
endef
|
endef
|
||||||
@@ -260,7 +260,10 @@ define Image/mkfs/ext4
|
|||||||
endef
|
endef
|
||||||
|
|
||||||
define Image/Manifest
|
define Image/Manifest
|
||||||
$(call opkg,$(TARGET_DIR_ORIG)) list-installed > \
|
$(STAGING_DIR_HOST)/bin/opkg \
|
||||||
|
--offline-root $(TARGET_DIR) \
|
||||||
|
--add-arch all:100 \
|
||||||
|
--add-arch $(if $(ARCH_PACKAGES),$(ARCH_PACKAGES),$(BOARD)):200 list-installed > \
|
||||||
$(BIN_DIR)/$(IMG_PREFIX)$(if $(PROFILE_SANITIZED),-$(PROFILE_SANITIZED)).manifest
|
$(BIN_DIR)/$(IMG_PREFIX)$(if $(PROFILE_SANITIZED),-$(PROFILE_SANITIZED)).manifest
|
||||||
endef
|
endef
|
||||||
|
|
||||||
@@ -274,7 +277,7 @@ endif
|
|||||||
|
|
||||||
ifdef CONFIG_TARGET_ROOTFS_CPIOGZ
|
ifdef CONFIG_TARGET_ROOTFS_CPIOGZ
|
||||||
define Image/Build/cpiogz
|
define Image/Build/cpiogz
|
||||||
( cd $(TARGET_DIR); find . | cpio -o -H newc -R root:root | gzip -9n >$(BIN_DIR)/$(IMG_PREFIX)-rootfs.cpio.gz )
|
( cd $(TARGET_DIR); find . | cpio -o -H newc | gzip -9n >$(BIN_DIR)/$(IMG_PREFIX)-rootfs.cpio.gz )
|
||||||
endef
|
endef
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -299,9 +302,9 @@ target-dir-%: FORCE
|
|||||||
$(opkg_target) update && \
|
$(opkg_target) update && \
|
||||||
$(opkg_target) install \
|
$(opkg_target) install \
|
||||||
$(call opkg_package_files,$(mkfs_packages_add)))
|
$(call opkg_package_files,$(mkfs_packages_add)))
|
||||||
-$(CP) -T $(mkfs_cur_target_dir).opkg/ $(mkfs_cur_target_dir)/etc/opkg/
|
$(call prepare_rootfs,$(mkfs_cur_target_dir))
|
||||||
rm -rf $(mkfs_cur_target_dir).opkg $(mkfs_cur_target_dir).conf
|
-mv $(mkfs_cur_target_dir).opkg $(mkfs_cur_target_dir)/etc/opkg
|
||||||
$(call prepare_rootfs,$(mkfs_cur_target_dir),$(TOPDIR)/files)
|
rm -f $(mkfs_cur_target_dir).conf
|
||||||
|
|
||||||
$(KDIR)/root.%: kernel_prepare
|
$(KDIR)/root.%: kernel_prepare
|
||||||
$(call Image/mkfs/$(word 1,$(target_params)),$(target_params))
|
$(call Image/mkfs/$(word 1,$(target_params)),$(target_params))
|
||||||
@@ -321,7 +324,6 @@ define Device/Init
|
|||||||
CMDLINE:=
|
CMDLINE:=
|
||||||
|
|
||||||
IMAGES :=
|
IMAGES :=
|
||||||
ARTIFACTS :=
|
|
||||||
IMAGE_PREFIX := $(IMG_PREFIX)-$(1)
|
IMAGE_PREFIX := $(IMG_PREFIX)-$(1)
|
||||||
IMAGE_NAME = $$(IMAGE_PREFIX)-$$(1)-$$(2)
|
IMAGE_NAME = $$(IMAGE_PREFIX)-$$(1)-$$(2)
|
||||||
KERNEL_PREFIX = $$(IMAGE_PREFIX)
|
KERNEL_PREFIX = $$(IMAGE_PREFIX)
|
||||||
@@ -349,7 +351,6 @@ define Device/Init
|
|||||||
FS_OPTIONS/ubifs = $$(MKUBIFS_OPTS)
|
FS_OPTIONS/ubifs = $$(MKUBIFS_OPTS)
|
||||||
|
|
||||||
DEVICE_DTS :=
|
DEVICE_DTS :=
|
||||||
DEVICE_DTS_CONFIG :=
|
|
||||||
DEVICE_DTS_DIR :=
|
DEVICE_DTS_DIR :=
|
||||||
|
|
||||||
BOARD_NAME :=
|
BOARD_NAME :=
|
||||||
@@ -362,8 +363,8 @@ endef
|
|||||||
|
|
||||||
DEFAULT_DEVICE_VARS := \
|
DEFAULT_DEVICE_VARS := \
|
||||||
DEVICE_NAME KERNEL KERNEL_INITRAMFS KERNEL_SIZE KERNEL_INITRAMFS_IMAGE \
|
DEVICE_NAME KERNEL KERNEL_INITRAMFS KERNEL_SIZE KERNEL_INITRAMFS_IMAGE \
|
||||||
KERNEL_LOADADDR DEVICE_DTS DEVICE_DTS_CONFIG DEVICE_DTS_DIR BOARD_NAME \
|
DEVICE_DTS DEVICE_DTS_DIR BOARD_NAME CMDLINE \
|
||||||
CMDLINE UBOOTENV_IN_UBI KERNEL_IN_UBI \
|
UBOOTENV_IN_UBI KERNEL_IN_UBI \
|
||||||
BLOCKSIZE PAGESIZE SUBPAGESIZE VID_HDR_OFFSET \
|
BLOCKSIZE PAGESIZE SUBPAGESIZE VID_HDR_OFFSET \
|
||||||
UBINIZE_OPTS UIMAGE_NAME UBINIZE_PARTS \
|
UBINIZE_OPTS UIMAGE_NAME UBINIZE_PARTS \
|
||||||
SUPPORTED_DEVICES IMAGE_METADATA
|
SUPPORTED_DEVICES IMAGE_METADATA
|
||||||
@@ -394,7 +395,6 @@ endef
|
|||||||
|
|
||||||
define Device/Check/Common
|
define Device/Check/Common
|
||||||
_PROFILE_SET = $$(strip $$(foreach profile,$$(PROFILES) DEVICE_$(1),$$(call DEVICE_CHECK_PROFILE,$$(profile))))
|
_PROFILE_SET = $$(strip $$(foreach profile,$$(PROFILES) DEVICE_$(1),$$(call DEVICE_CHECK_PROFILE,$$(profile))))
|
||||||
DEVICE_PACKAGES += $$(call extra_packages,$$(DEVICE_PACKAGES))
|
|
||||||
ifdef TARGET_PER_DEVICE_ROOTFS
|
ifdef TARGET_PER_DEVICE_ROOTFS
|
||||||
$$(eval $$(call merge_packages,_PACKAGES,$$(DEVICE_PACKAGES) $$(call DEVICE_EXTRA_PACKAGES,$(1))))
|
$$(eval $$(call merge_packages,_PACKAGES,$$(DEVICE_PACKAGES) $$(call DEVICE_EXTRA_PACKAGES,$(1))))
|
||||||
ROOTFS_ID/$(1) := $$(if $$(_PROFILE_SET),$$(call mkfs_packages_id,$$(_PACKAGES)))
|
ROOTFS_ID/$(1) := $$(if $$(_PROFILE_SET),$$(call mkfs_packages_id,$$(_PACKAGES)))
|
||||||
@@ -434,27 +434,7 @@ define Device/Build/compile
|
|||||||
|
|
||||||
endef
|
endef
|
||||||
|
|
||||||
ifndef IB
|
|
||||||
define Device/Build/dtb
|
|
||||||
ifndef BUILD_DTS_$(1)
|
|
||||||
BUILD_DTS_$(1) := 1
|
|
||||||
$(KDIR)/image-$(1).dtb: FORCE
|
|
||||||
$(call Image/BuildDTB,$(strip $(2))/$(strip $(3)).dts,$$@)
|
|
||||||
|
|
||||||
image_prepare: $(KDIR)/image-$(1).dtb
|
|
||||||
endif
|
|
||||||
|
|
||||||
endef
|
|
||||||
endif
|
|
||||||
|
|
||||||
define Device/Build/kernel
|
define Device/Build/kernel
|
||||||
$$(eval $$(foreach dts,$$(DEVICE_DTS), \
|
|
||||||
$$(call Device/Build/dtb,$$(notdir $$(dts)), \
|
|
||||||
$$(if $$(DEVICE_DTS_DIR),$$(DEVICE_DTS_DIR),$$(DTS_DIR)), \
|
|
||||||
$$(dts) \
|
|
||||||
) \
|
|
||||||
))
|
|
||||||
|
|
||||||
$(KDIR)/$$(KERNEL_NAME):: image_prepare
|
$(KDIR)/$$(KERNEL_NAME):: image_prepare
|
||||||
$$(_TARGET): $$(if $$(KERNEL_INSTALL),$(BIN_DIR)/$$(KERNEL_IMAGE))
|
$$(_TARGET): $$(if $$(KERNEL_INSTALL),$(BIN_DIR)/$$(KERNEL_IMAGE))
|
||||||
$(call Device/Export,$$(KDIR_KERNEL_IMAGE),$(1))
|
$(call Device/Export,$$(KDIR_KERNEL_IMAGE),$(1))
|
||||||
@@ -499,19 +479,6 @@ define Device/Build/image
|
|||||||
|
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Device/Build/artifact
|
|
||||||
$$(_TARGET): $(BIN_DIR)/$(IMAGE_PREFIX)-$(1)
|
|
||||||
$(KDIR)/tmp/$(IMAGE_PREFIX)-$(1): $$(KDIR_KERNEL_IMAGE)
|
|
||||||
@rm -f $$@
|
|
||||||
$$(call concat_cmd,$(ARTIFACT/$(1)))
|
|
||||||
|
|
||||||
.IGNORE: $(BIN_DIR)/$(IMAGE_PREFIX)-$(1)
|
|
||||||
|
|
||||||
$(BIN_DIR)/$(IMAGE_PREFIX)-$(1): $(KDIR)/tmp/$(IMAGE_PREFIX)-$(1)
|
|
||||||
cp $$^ $$@
|
|
||||||
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Device/Build
|
define Device/Build
|
||||||
$(if $(CONFIG_TARGET_ROOTFS_INITRAMFS),$(call Device/Build/initramfs,$(1)))
|
$(if $(CONFIG_TARGET_ROOTFS_INITRAMFS),$(call Device/Build/initramfs,$(1)))
|
||||||
$(call Device/Build/kernel,$(1))
|
$(call Device/Build/kernel,$(1))
|
||||||
@@ -522,10 +489,6 @@ define Device/Build
|
|||||||
$$(eval $$(foreach image,$$(IMAGES), \
|
$$(eval $$(foreach image,$$(IMAGES), \
|
||||||
$$(foreach fs,$$(filter $(TARGET_FILESYSTEMS),$$(FILESYSTEMS)), \
|
$$(foreach fs,$$(filter $(TARGET_FILESYSTEMS),$$(FILESYSTEMS)), \
|
||||||
$$(call Device/Build/image,$$(fs),$$(image),$(1)))))
|
$$(call Device/Build/image,$$(fs),$$(image),$(1)))))
|
||||||
|
|
||||||
$$(eval $$(foreach artifact,$$(ARTIFACTS), \
|
|
||||||
$$(call Device/Build/artifact,$$(artifact))))
|
|
||||||
|
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Device/DumpInfo
|
define Device/DumpInfo
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
# This is free software, licensed under the GNU General Public License v2.
|
# This is free software, licensed under the GNU General Public License v2.
|
||||||
# See /LICENSE for more information.
|
# See /LICENSE for more information.
|
||||||
#
|
#
|
||||||
|
include $(INCLUDE_DIR)/host.mk
|
||||||
include $(INCLUDE_DIR)/prereq.mk
|
include $(INCLUDE_DIR)/prereq.mk
|
||||||
include $(INCLUDE_DIR)/depends.mk
|
include $(INCLUDE_DIR)/depends.mk
|
||||||
|
|
||||||
@@ -11,7 +12,7 @@ ifneq ($(DUMP),1)
|
|||||||
all: compile
|
all: compile
|
||||||
endif
|
endif
|
||||||
|
|
||||||
KERNEL_FILE_DEPENDS=$(GENERIC_BACKPORT_DIR) $(GENERIC_PATCH_DIR) $(GENERIC_HACK_DIR) $(PATCH_DIR) $(GENERIC_FILES_DIR) $(FILES_DIR)
|
KERNEL_FILE_DEPENDS=$(GENERIC_PATCH_DIR) $(PATCH_DIR) $(GENERIC_FILES_DIR) $(FILES_DIR)
|
||||||
STAMP_PREPARED=$(LINUX_DIR)/.prepared$(if $(QUILT)$(DUMP),,_$(shell $(call 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
|
STAMP_CONFIGURED:=$(LINUX_DIR)/.configured
|
||||||
include $(INCLUDE_DIR)/download.mk
|
include $(INCLUDE_DIR)/download.mk
|
||||||
@@ -50,10 +51,14 @@ ifneq ($(strip $(CONFIG_KERNEL_GIT_LOCAL_REPOSITORY)),"")
|
|||||||
KERNEL_GIT_OPTS+=--reference $(CONFIG_KERNEL_GIT_LOCAL_REPOSITORY)
|
KERNEL_GIT_OPTS+=--reference $(CONFIG_KERNEL_GIT_LOCAL_REPOSITORY)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifneq ($(strip $(CONFIG_KERNEL_GIT_BRANCH)),"")
|
||||||
|
KERNEL_GIT_OPTS+=--branch $(CONFIG_KERNEL_GIT_BRANCH)
|
||||||
|
endif
|
||||||
|
|
||||||
define Download/git-kernel
|
define Download/git-kernel
|
||||||
URL:=$(call qstrip,$(CONFIG_KERNEL_GIT_CLONE_URI))
|
URL:=$(call qstrip,$(CONFIG_KERNEL_GIT_CLONE_URI))
|
||||||
PROTO:=git
|
PROTO:=git
|
||||||
VERSION:=$(CONFIG_KERNEL_GIT_REF)
|
VERSION:=$(CONFIG_KERNEL_GIT_BRANCH)
|
||||||
FILE:=$(LINUX_SOURCE)
|
FILE:=$(LINUX_SOURCE)
|
||||||
SUBDIR:=linux-$(LINUX_VERSION)
|
SUBDIR:=linux-$(LINUX_VERSION)
|
||||||
OPTS:=$(KERNEL_GIT_OPTS)
|
OPTS:=$(KERNEL_GIT_OPTS)
|
||||||
@@ -100,7 +105,7 @@ define BuildKernel
|
|||||||
$(KERNEL_BUILD_DIR)/symtab.h: FORCE
|
$(KERNEL_BUILD_DIR)/symtab.h: FORCE
|
||||||
rm -f $(KERNEL_BUILD_DIR)/symtab.h
|
rm -f $(KERNEL_BUILD_DIR)/symtab.h
|
||||||
touch $(KERNEL_BUILD_DIR)/symtab.h
|
touch $(KERNEL_BUILD_DIR)/symtab.h
|
||||||
+$(KERNEL_MAKE) vmlinux
|
+$(MAKE) $(KERNEL_MAKEOPTS) vmlinux
|
||||||
find $(LINUX_DIR) $(STAGING_DIR_ROOT)/lib/modules -name \*.ko | \
|
find $(LINUX_DIR) $(STAGING_DIR_ROOT)/lib/modules -name \*.ko | \
|
||||||
xargs $(TARGET_CROSS)nm | \
|
xargs $(TARGET_CROSS)nm | \
|
||||||
awk '$$$$1 == "U" { print $$$$2 } ' | \
|
awk '$$$$1 == "U" { print $$$$2 } ' | \
|
||||||
@@ -147,7 +152,7 @@ define BuildKernel
|
|||||||
endef
|
endef
|
||||||
|
|
||||||
download: $(if $(LINUX_SITE),$(DL_DIR)/$(LINUX_SOURCE))
|
download: $(if $(LINUX_SITE),$(DL_DIR)/$(LINUX_SOURCE))
|
||||||
prepare: $(STAMP_PREPARED)
|
prepare: $(STAMP_CONFIGURED)
|
||||||
compile: $(LINUX_DIR)/.modules
|
compile: $(LINUX_DIR)/.modules
|
||||||
$(MAKE) -C image compile TARGET_BUILD=
|
$(MAKE) -C image compile TARGET_BUILD=
|
||||||
|
|
||||||
@@ -155,9 +160,7 @@ define BuildKernel
|
|||||||
rm -f $(LINUX_DIR)/.config.prev
|
rm -f $(LINUX_DIR)/.config.prev
|
||||||
rm -f $(STAMP_CONFIGURED)
|
rm -f $(STAMP_CONFIGURED)
|
||||||
$(LINUX_RECONF_CMD) > $(LINUX_DIR)/.config
|
$(LINUX_RECONF_CMD) > $(LINUX_DIR)/.config
|
||||||
$(_SINGLE)$(KERNEL_MAKE) \
|
$(_SINGLE)$(MAKE) -C $(LINUX_DIR) $(KERNEL_MAKEOPTS) HOST_LOADLIBES="-L$(STAGING_DIR_HOST)/lib -lncurses" $$@
|
||||||
$(if $(findstring Darwin,$(HOST_OS)),HOST_LOADLIBES="-L$(STAGING_DIR_HOST)/lib -lncurses") \
|
|
||||||
$$@
|
|
||||||
$(LINUX_RECONF_DIFF) $(LINUX_DIR)/.config > $(LINUX_RECONFIG_TARGET)
|
$(LINUX_RECONF_DIFF) $(LINUX_DIR)/.config > $(LINUX_RECONFIG_TARGET)
|
||||||
|
|
||||||
install: $(LINUX_DIR)/.image
|
install: $(LINUX_DIR)/.image
|
||||||
|
|||||||
@@ -5,6 +5,26 @@
|
|||||||
# See /LICENSE for more information.
|
# See /LICENSE for more information.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
ifneq ($(SOURCE_DATE_EPOCH),)
|
||||||
|
ifndef DUMP
|
||||||
|
KBUILD_BUILD_TIMESTAMP:=$(shell perl -e 'print scalar gmtime($(SOURCE_DATE_EPOCH))')
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
KERNEL_MAKEOPTS := -C $(LINUX_DIR) \
|
||||||
|
HOSTCFLAGS="$(HOST_CFLAGS) -Wall -Wmissing-prototypes -Wstrict-prototypes" \
|
||||||
|
CROSS_COMPILE="$(KERNEL_CROSS)" \
|
||||||
|
ARCH="$(LINUX_KARCH)" \
|
||||||
|
KBUILD_HAVE_NLS=no \
|
||||||
|
KBUILD_BUILD_USER="$(call qstrip,$(CONFIG_KERNEL_BUILD_USER))" \
|
||||||
|
KBUILD_BUILD_HOST="$(call qstrip,$(CONFIG_KERNEL_BUILD_DOMAIN))" \
|
||||||
|
KBUILD_BUILD_TIMESTAMP="$(KBUILD_BUILD_TIMESTAMP)" \
|
||||||
|
KBUILD_BUILD_VERSION="0" \
|
||||||
|
HOST_LOADLIBES="-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))
|
||||||
|
|
||||||
ifdef CONFIG_STRIP_KERNEL_EXPORTS
|
ifdef CONFIG_STRIP_KERNEL_EXPORTS
|
||||||
KERNEL_MAKEOPTS += \
|
KERNEL_MAKEOPTS += \
|
||||||
EXTRA_LDSFLAGS="-I$(KERNEL_BUILD_DIR) -include symtab.h"
|
EXTRA_LDSFLAGS="-I$(KERNEL_BUILD_DIR) -include symtab.h"
|
||||||
@@ -16,6 +36,14 @@ ifneq (,$(KERNEL_CC))
|
|||||||
KERNEL_MAKEOPTS += CC="$(KERNEL_CC)"
|
KERNEL_MAKEOPTS += CC="$(KERNEL_CC)"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifdef CONFIG_USE_SPARSE
|
||||||
|
KERNEL_MAKEOPTS += C=1 CHECK=$(STAGING_DIR_HOST)/bin/sparse
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifneq ($(strip $(CONFIG_KERNEL_GIT_CLONE_URI)),"")
|
||||||
|
KERNEL_MAKEOPTS += LOCALVERSION=
|
||||||
|
endif
|
||||||
|
|
||||||
export HOST_EXTRACFLAGS=-I$(STAGING_DIR_HOST)/include
|
export HOST_EXTRACFLAGS=-I$(STAGING_DIR_HOST)/include
|
||||||
|
|
||||||
# defined in quilt.mk
|
# defined in quilt.mk
|
||||||
@@ -63,7 +91,6 @@ ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y)
|
|||||||
$(call Kernel/SetInitramfs/PreConfigure)
|
$(call Kernel/SetInitramfs/PreConfigure)
|
||||||
echo 'CONFIG_INITRAMFS_ROOT_UID=$(shell id -u)' >> $(LINUX_DIR)/.config
|
echo 'CONFIG_INITRAMFS_ROOT_UID=$(shell id -u)' >> $(LINUX_DIR)/.config
|
||||||
echo 'CONFIG_INITRAMFS_ROOT_GID=$(shell id -g)' >> $(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 "$(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_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_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
|
||||||
@@ -79,7 +106,6 @@ define Kernel/SetNoInitramfs
|
|||||||
mv $(LINUX_DIR)/.config.set $(LINUX_DIR)/.config.old
|
mv $(LINUX_DIR)/.config.set $(LINUX_DIR)/.config.old
|
||||||
grep -v INITRAMFS $(LINUX_DIR)/.config.old > $(LINUX_DIR)/.config.set
|
grep -v INITRAMFS $(LINUX_DIR)/.config.old > $(LINUX_DIR)/.config.set
|
||||||
echo 'CONFIG_INITRAMFS_SOURCE=""' >> $(LINUX_DIR)/.config.set
|
echo 'CONFIG_INITRAMFS_SOURCE=""' >> $(LINUX_DIR)/.config.set
|
||||||
echo '# CONFIG_INITRAMFS_FORCE is not set' >> $(LINUX_DIR)/.config.set
|
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Kernel/Configure/Default
|
define Kernel/Configure/Default
|
||||||
@@ -98,7 +124,7 @@ define Kernel/Configure/Default
|
|||||||
cp $(LINUX_DIR)/.config.set $(LINUX_DIR)/.config; \
|
cp $(LINUX_DIR)/.config.set $(LINUX_DIR)/.config; \
|
||||||
cp $(LINUX_DIR)/.config.set $(LINUX_DIR)/.config.prev; \
|
cp $(LINUX_DIR)/.config.set $(LINUX_DIR)/.config.prev; \
|
||||||
}
|
}
|
||||||
$(_SINGLE) [ -d $(LINUX_DIR)/user_headers ] || $(KERNEL_MAKE) INSTALL_HDR_PATH=$(LINUX_DIR)/user_headers headers_install
|
$(_SINGLE) [ -d $(LINUX_DIR)/user_headers ] || $(MAKE) $(KERNEL_MAKEOPTS) INSTALL_HDR_PATH=$(LINUX_DIR)/user_headers headers_install
|
||||||
grep '=[ym]' $(LINUX_DIR)/.config.set | LC_ALL=C sort | mkhash md5 > $(LINUX_DIR)/.vermagic
|
grep '=[ym]' $(LINUX_DIR)/.config.set | LC_ALL=C sort | mkhash md5 > $(LINUX_DIR)/.vermagic
|
||||||
endef
|
endef
|
||||||
|
|
||||||
@@ -108,7 +134,7 @@ endef
|
|||||||
|
|
||||||
define Kernel/CompileModules/Default
|
define Kernel/CompileModules/Default
|
||||||
rm -f $(LINUX_DIR)/vmlinux $(LINUX_DIR)/System.map
|
rm -f $(LINUX_DIR)/vmlinux $(LINUX_DIR)/System.map
|
||||||
+$(KERNEL_MAKE) modules
|
+$(MAKE) $(KERNEL_MAKEOPTS) modules
|
||||||
endef
|
endef
|
||||||
|
|
||||||
OBJCOPY_STRIP = -R .reginfo -R .notes -R .note -R .comment -R .mdebug -R .note.gnu.build-id
|
OBJCOPY_STRIP = -R .reginfo -R .notes -R .note -R .comment -R .mdebug -R .note.gnu.build-id
|
||||||
@@ -124,7 +150,7 @@ define Kernel/CopyImage
|
|||||||
$(KERNEL_CROSS)objcopy $(OBJCOPY_STRIP) -S $(LINUX_DIR)/vmlinux $(KERNEL_BUILD_DIR)/vmlinux$(1).elf; \
|
$(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; \
|
$(CP) $(LINUX_DIR)/vmlinux $(KERNEL_BUILD_DIR)/vmlinux$(1).debug; \
|
||||||
$(foreach k, \
|
$(foreach k, \
|
||||||
$(if $(KERNEL_IMAGES),$(KERNEL_IMAGES),$(filter-out vmlinux dtbs,$(KERNELNAME))), \
|
$(if $(KERNEL_IMAGES),$(KERNEL_IMAGES),$(filter-out dtbs,$(KERNELNAME))), \
|
||||||
$(CP) $(LINUX_DIR)/arch/$(LINUX_KARCH)/boot/$(IMAGES_DIR)/$(k) $(KERNEL_BUILD_DIR)/$(k)$(1); \
|
$(CP) $(LINUX_DIR)/arch/$(LINUX_KARCH)/boot/$(IMAGES_DIR)/$(k) $(KERNEL_BUILD_DIR)/$(k)$(1); \
|
||||||
) \
|
) \
|
||||||
}
|
}
|
||||||
@@ -132,16 +158,16 @@ endef
|
|||||||
|
|
||||||
define Kernel/CompileImage/Default
|
define Kernel/CompileImage/Default
|
||||||
rm -f $(TARGET_DIR)/init
|
rm -f $(TARGET_DIR)/init
|
||||||
+$(KERNEL_MAKE) $(if $(KERNELNAME),$(KERNELNAME),all) modules
|
+$(MAKE) $(KERNEL_MAKEOPTS) $(if $(KERNELNAME),$(KERNELNAME),all) modules
|
||||||
$(call Kernel/CopyImage)
|
$(call Kernel/CopyImage)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
|
ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
|
||||||
define Kernel/CompileImage/Initramfs
|
define Kernel/CompileImage/Initramfs
|
||||||
$(call Kernel/Configure/Initramfs)
|
$(call Kernel/Configure/Initramfs)
|
||||||
$(CP) $(GENERIC_PLATFORM_DIR)/other-files/init $(TARGET_DIR)/init
|
$(CP) $(GENERIC_PLATFORM_DIR)/base-files/init $(TARGET_DIR)/init
|
||||||
rm -rf $(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION)/usr/initramfs_data.cpio*
|
rm -rf $(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION)/usr/initramfs_data.cpio*
|
||||||
+$(KERNEL_MAKE) $(if $(KERNELNAME),$(KERNELNAME),all) modules
|
+$(MAKE) $(KERNEL_MAKEOPTS) $(if $(KERNELNAME),$(KERNELNAME),all) modules
|
||||||
$(call Kernel/CopyImage,-initramfs)
|
$(call Kernel/CopyImage,-initramfs)
|
||||||
endef
|
endef
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -2,26 +2,15 @@
|
|||||||
|
|
||||||
LINUX_RELEASE?=1
|
LINUX_RELEASE?=1
|
||||||
|
|
||||||
LINUX_VERSION-4.9 = .152
|
LINUX_VERSION-3.18 = .43
|
||||||
LINUX_VERSION-4.14 = .95
|
LINUX_VERSION-4.4 = .61
|
||||||
|
|
||||||
LINUX_KERNEL_HASH-4.9.152 = 90e47b85c09af47eefafe851685ee731538f640b0650a6a9cfa0234436708e39
|
LINUX_KERNEL_HASH-3.18.43 = 1236e8123a6ce537d5029232560966feed054ae31776fe8481dd7d18cdd5492c
|
||||||
LINUX_KERNEL_HASH-4.14.95 = ce6729e3fca312520e3cb4f27993852dbb019d94c59c0b35cedab571f9cb58e4
|
LINUX_KERNEL_HASH-4.4.61 = 30dee7164615ad8184eba4ea6f4906b3ceb2fe462a8a4a929c8e9aab8d4a31da
|
||||||
|
|
||||||
remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1))))
|
|
||||||
sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1)))))))
|
|
||||||
|
|
||||||
ifneq ($(call qstrip,$(CONFIG_KERNEL_GIT_CLONE_URI)),)
|
|
||||||
LINUX_VERSION:=$(call sanitize_uri,$(call remove_uri_prefix,$(CONFIG_KERNEL_GIT_CLONE_URI)))
|
|
||||||
ifeq ($(call qstrip,$(CONFIG_KERNEL_GIT_REF)),)
|
|
||||||
CONFIG_KERNEL_GIT_REF:=HEAD
|
|
||||||
endif
|
|
||||||
LINUX_VERSION:=$(LINUX_VERSION)-$(call sanitize_uri,$(CONFIG_KERNEL_GIT_REF))
|
|
||||||
else
|
|
||||||
ifdef KERNEL_PATCHVER
|
ifdef KERNEL_PATCHVER
|
||||||
LINUX_VERSION:=$(KERNEL_PATCHVER)$(strip $(LINUX_VERSION-$(KERNEL_PATCHVER)))
|
LINUX_VERSION:=$(KERNEL_PATCHVER)$(strip $(LINUX_VERSION-$(KERNEL_PATCHVER)))
|
||||||
endif
|
endif
|
||||||
endif
|
|
||||||
|
|
||||||
split_version=$(subst ., ,$(1))
|
split_version=$(subst ., ,$(1))
|
||||||
merge_version=$(subst $(space),.,$(1))
|
merge_version=$(subst $(space),.,$(1))
|
||||||
|
|||||||
@@ -10,12 +10,6 @@ CHECK:=1
|
|||||||
DUMP:=1
|
DUMP:=1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq ($(SOURCE_DATE_EPOCH),)
|
|
||||||
ifndef DUMP
|
|
||||||
KBUILD_BUILD_TIMESTAMP:=$(shell perl -e 'print scalar gmtime($(SOURCE_DATE_EPOCH))')
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(__target_inc),)
|
ifeq ($(__target_inc),)
|
||||||
ifndef CHECK
|
ifndef CHECK
|
||||||
include $(INCLUDE_DIR)/target.mk
|
include $(INCLUDE_DIR)/target.mk
|
||||||
@@ -52,23 +46,22 @@ else
|
|||||||
LINUX_VERMAGIC:=$(strip $(shell cat $(LINUX_DIR)/.vermagic 2>/dev/null))
|
LINUX_VERMAGIC:=$(strip $(shell cat $(LINUX_DIR)/.vermagic 2>/dev/null))
|
||||||
LINUX_VERMAGIC:=$(if $(LINUX_VERMAGIC),$(LINUX_VERMAGIC),unknown)
|
LINUX_VERMAGIC:=$(if $(LINUX_VERMAGIC),$(LINUX_VERMAGIC),unknown)
|
||||||
|
|
||||||
LINUX_UNAME_VERSION:=$(KERNEL_BASE)
|
LINUX_UNAME_VERSION:=$(if $(word 3,$(subst ., ,$(KERNEL_BASE))),$(KERNEL_BASE),$(KERNEL_BASE).0)
|
||||||
ifneq ($(findstring -rc,$(LINUX_VERSION)),)
|
ifneq ($(findstring -rc,$(LINUX_VERSION)),)
|
||||||
LINUX_UNAME_VERSION:=$(LINUX_UNAME_VERSION)-$(strip $(lastword $(subst -, ,$(LINUX_VERSION))))
|
LINUX_UNAME_VERSION:=$(LINUX_UNAME_VERSION)-$(strip $(lastword $(subst -, ,$(LINUX_VERSION))))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
MODULES_SUBDIR:=lib/modules/$(LINUX_UNAME_VERSION)
|
||||||
|
TARGET_MODULES_DIR := $(LINUX_TARGET_DIR)/$(MODULES_SUBDIR)
|
||||||
|
|
||||||
LINUX_KERNEL:=$(KERNEL_BUILD_DIR)/vmlinux
|
LINUX_KERNEL:=$(KERNEL_BUILD_DIR)/vmlinux
|
||||||
|
|
||||||
LINUX_SOURCE:=linux-$(LINUX_VERSION).tar.xz
|
LINUX_SOURCE:=linux-$(LINUX_VERSION).tar.xz
|
||||||
|
TESTING:=$(if $(findstring -rc,$(LINUX_VERSION)),/testing,)
|
||||||
ifeq ($(call qstrip,$(CONFIG_EXTERNAL_KERNEL_TREE))$(call qstrip,$(CONFIG_KERNEL_GIT_CLONE_URI)),)
|
ifeq ($(call qstrip,$(CONFIG_EXTERNAL_KERNEL_TREE))$(call qstrip,$(CONFIG_KERNEL_GIT_CLONE_URI)),)
|
||||||
LINUX_SITE:=@KERNEL/linux/kernel/v$(word 1,$(subst ., ,$(KERNEL_BASE))).x
|
LINUX_SITE:=@KERNEL/linux/kernel/v$(word 1,$(subst ., ,$(KERNEL_BASE))).x$(TESTING)
|
||||||
else
|
|
||||||
LINUX_UNAME_VERSION:=$(strip $(shell cat $(LINUX_DIR)/include/config/kernel.release 2>/dev/null))
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
MODULES_SUBDIR:=lib/modules/$(LINUX_UNAME_VERSION)
|
|
||||||
TARGET_MODULES_DIR:=$(LINUX_TARGET_DIR)/$(MODULES_SUBDIR)
|
|
||||||
|
|
||||||
ifneq ($(TARGET_BUILD),1)
|
ifneq ($(TARGET_BUILD),1)
|
||||||
PKG_BUILD_DIR ?= $(KERNEL_BUILD_DIR)/$(PKG_NAME)$(if $(PKG_VERSION),-$(PKG_VERSION))
|
PKG_BUILD_DIR ?= $(KERNEL_BUILD_DIR)/$(PKG_NAME)$(if $(PKG_VERSION),-$(PKG_VERSION))
|
||||||
endif
|
endif
|
||||||
@@ -84,8 +77,6 @@ else ifneq (,$(findstring $(ARCH) , armeb ))
|
|||||||
LINUX_KARCH := arm
|
LINUX_KARCH := arm
|
||||||
else ifneq (,$(findstring $(ARCH) , mipsel mips64 mips64el ))
|
else ifneq (,$(findstring $(ARCH) , mipsel mips64 mips64el ))
|
||||||
LINUX_KARCH := mips
|
LINUX_KARCH := mips
|
||||||
else ifneq (,$(findstring $(ARCH) , powerpc64 ))
|
|
||||||
LINUX_KARCH := powerpc
|
|
||||||
else ifneq (,$(findstring $(ARCH) , sh2 sh3 sh4 ))
|
else ifneq (,$(findstring $(ARCH) , sh2 sh3 sh4 ))
|
||||||
LINUX_KARCH := sh
|
LINUX_KARCH := sh
|
||||||
else ifneq (,$(findstring $(ARCH) , i386 x86_64 ))
|
else ifneq (,$(findstring $(ARCH) , i386 x86_64 ))
|
||||||
@@ -94,81 +85,58 @@ else
|
|||||||
LINUX_KARCH := $(ARCH)
|
LINUX_KARCH := $(ARCH)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
KERNEL_MAKE = $(MAKE) $(KERNEL_MAKEOPTS)
|
|
||||||
|
|
||||||
KERNEL_MAKE_FLAGS = \
|
|
||||||
HOSTCFLAGS="$(HOST_CFLAGS) -Wall -Wmissing-prototypes -Wstrict-prototypes" \
|
|
||||||
CROSS_COMPILE="$(KERNEL_CROSS)" \
|
|
||||||
ARCH="$(LINUX_KARCH)" \
|
|
||||||
KBUILD_HAVE_NLS=no \
|
|
||||||
KBUILD_BUILD_USER="$(call qstrip,$(CONFIG_KERNEL_BUILD_USER))" \
|
|
||||||
KBUILD_BUILD_HOST="$(call qstrip,$(CONFIG_KERNEL_BUILD_DOMAIN))" \
|
|
||||||
KBUILD_BUILD_TIMESTAMP="$(KBUILD_BUILD_TIMESTAMP)" \
|
|
||||||
KBUILD_BUILD_VERSION="0" \
|
|
||||||
HOST_LOADLIBES="-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=
|
|
||||||
|
|
||||||
ifeq ($(call qstrip,$(CONFIG_EXTERNAL_KERNEL_TREE))$(call qstrip,$(CONFIG_KERNEL_GIT_CLONE_URI)),)
|
|
||||||
KERNEL_MAKE_FLAGS += \
|
|
||||||
KERNELRELEASE=$(LINUX_VERSION)
|
|
||||||
endif
|
|
||||||
|
|
||||||
KERNEL_MAKEOPTS := -C $(LINUX_DIR) $(KERNEL_MAKE_FLAGS)
|
|
||||||
|
|
||||||
ifdef CONFIG_USE_SPARSE
|
|
||||||
KERNEL_MAKEOPTS += C=1 CHECK=$(STAGING_DIR_HOST)/bin/sparse
|
|
||||||
endif
|
|
||||||
|
|
||||||
PKG_EXTMOD_SUBDIRS ?= .
|
|
||||||
|
|
||||||
define populate_module_symvers
|
|
||||||
@mkdir -p $(PKG_INFO_DIR)
|
|
||||||
cat /dev/null > $(PKG_INFO_DIR)/$(PKG_NAME).symvers; \
|
|
||||||
for subdir in $(PKG_EXTMOD_SUBDIRS); do \
|
|
||||||
cat $(PKG_INFO_DIR)/*.symvers 2>/dev/null > $(PKG_BUILD_DIR)/$$$$subdir/Module.symvers; \
|
|
||||||
done
|
|
||||||
endef
|
|
||||||
|
|
||||||
define collect_module_symvers
|
|
||||||
for subdir in $(PKG_EXTMOD_SUBDIRS); do \
|
|
||||||
grep -F $$$$(readlink -f $(PKG_BUILD_DIR)) $(PKG_BUILD_DIR)/$$$$subdir/Module.symvers >> $(PKG_BUILD_DIR)/Module.symvers.tmp; \
|
|
||||||
done; \
|
|
||||||
sort -u $(PKG_BUILD_DIR)/Module.symvers.tmp > $(PKG_BUILD_DIR)/Module.symvers; \
|
|
||||||
mv $(PKG_BUILD_DIR)/Module.symvers $(PKG_INFO_DIR)/$(PKG_NAME).symvers
|
|
||||||
endef
|
|
||||||
|
|
||||||
define KernelPackage/hooks
|
|
||||||
ifneq ($(PKG_NAME),kernel)
|
|
||||||
Hooks/Compile/Pre += populate_module_symvers
|
|
||||||
Hooks/Compile/Post += collect_module_symvers
|
|
||||||
endif
|
|
||||||
define KernelPackage/hooks
|
|
||||||
endef
|
|
||||||
endef
|
|
||||||
|
|
||||||
define KernelPackage/Defaults
|
define KernelPackage/Defaults
|
||||||
FILES:=
|
FILES:=
|
||||||
AUTOLOAD:=
|
AUTOLOAD:=
|
||||||
MODPARAMS:=
|
|
||||||
PKGFLAGS+=nonshared
|
PKGFLAGS+=nonshared
|
||||||
endef
|
endef
|
||||||
|
|
||||||
# 1: name
|
|
||||||
# 2: install prefix
|
|
||||||
# 3: module priority prefix
|
|
||||||
# 4: required for boot
|
|
||||||
# 5: module list
|
|
||||||
define ModuleAutoLoad
|
define ModuleAutoLoad
|
||||||
$(if $(5), \
|
$(SH_FUNC) \
|
||||||
mkdir -p $(2)/etc/modules.d; \
|
export modules=; \
|
||||||
($(foreach mod,$(5), \
|
probe_module() { \
|
||||||
echo "$(mod)$(if $(MODPARAMS.$(mod)), $(MODPARAMS.$(mod)),$(if $(MODPARAMS), $(MODPARAMS)))"; )) > $(2)/etc/modules.d/$(3)$(1); \
|
mods="$$$$$$$$1"; \
|
||||||
$(if $(4), \
|
boot="$$$$$$$$2"; \
|
||||||
mkdir -p $(2)/etc/modules-boot.d; \
|
shift 2; \
|
||||||
ln -sf ../modules.d/$(3)$(1) $(2)/etc/modules-boot.d/;))
|
for mod in $(sort $$$$$$$$mods); do \
|
||||||
|
mkdir -p $(2)/etc/modules.d; \
|
||||||
|
echo "$$$$$$$$mod" >> $(2)/etc/modules.d/$(1); \
|
||||||
|
done; \
|
||||||
|
if [ -e $(2)/etc/modules.d/$(1) ]; then \
|
||||||
|
if [ "$$$$$$$$boot" = "1" ]; then \
|
||||||
|
mkdir -p $(2)/etc/modules-boot.d; \
|
||||||
|
ln -s ../modules.d/$(1) $(2)/etc/modules-boot.d/; \
|
||||||
|
fi; \
|
||||||
|
modules="$$$$$$$${modules:+$$$$$$$$modules }$$$$$$$$mods"; \
|
||||||
|
fi; \
|
||||||
|
}; \
|
||||||
|
add_module() { \
|
||||||
|
priority="$$$$$$$$1"; \
|
||||||
|
mods="$$$$$$$$2"; \
|
||||||
|
boot="$$$$$$$$3"; \
|
||||||
|
shift 3; \
|
||||||
|
for mod in $(sort $$$$$$$$mods); do \
|
||||||
|
mkdir -p $(2)/etc/modules.d; \
|
||||||
|
echo "$$$$$$$$mod" >> $(2)/etc/modules.d/$$$$$$$$priority-$(1); \
|
||||||
|
done; \
|
||||||
|
if [ -e $(2)/etc/modules.d/$$$$$$$$priority-$(1) ]; then \
|
||||||
|
if [ "$$$$$$$$boot" = "1" ]; then \
|
||||||
|
mkdir -p $(2)/etc/modules-boot.d; \
|
||||||
|
ln -s ../modules.d/$$$$$$$$priority-$(1) $(2)/etc/modules-boot.d/; \
|
||||||
|
fi; \
|
||||||
|
modules="$$$$$$$${modules:+$$$$$$$$modules }$$$$$$$$priority-$(1)"; \
|
||||||
|
fi; \
|
||||||
|
}; \
|
||||||
|
$(3) \
|
||||||
|
if [ -n "$$$$$$$$modules" ]; then \
|
||||||
|
mkdir -p $(2)/etc/modules.d; \
|
||||||
|
mkdir -p $(2)/CONTROL; \
|
||||||
|
echo "#!/bin/sh" > $(2)/CONTROL/postinst-pkg; \
|
||||||
|
echo "[ -z \"\$$$$$$$$IPKG_INSTROOT\" ] || exit 0" >> $(2)/CONTROL/postinst-pkg; \
|
||||||
|
echo ". /lib/functions.sh" >> $(2)/CONTROL/postinst-pkg; \
|
||||||
|
echo "insert_modules $$$$$$$$modules" >> $(2)/CONTROL/postinst-pkg; \
|
||||||
|
chmod 0755 $(2)/CONTROL/postinst-pkg; \
|
||||||
|
fi
|
||||||
endef
|
endef
|
||||||
|
|
||||||
ifeq ($(DUMP)$(TARGET_BUILD),)
|
ifeq ($(DUMP)$(TARGET_BUILD),)
|
||||||
@@ -221,10 +189,10 @@ $(call KernelPackage/$(1)/config)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
$(call KernelPackage/depends)
|
$(call KernelPackage/depends)
|
||||||
$(call KernelPackage/hooks)
|
|
||||||
|
|
||||||
ifneq ($(if $(filter-out %=y %=n %=m,$(KCONFIG)),$(filter m y,$(foreach c,$(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
|
ifneq ($(strip $(FILES)),)
|
||||||
|
define Package/kmod-$(1)/install
|
||||||
@for mod in $$(call version_filter,$$(FILES)); do \
|
@for mod in $$(call version_filter,$$(FILES)); do \
|
||||||
if grep -q "$$$$$$$${mod##$(LINUX_DIR)/}" "$(LINUX_DIR)/modules.builtin"; then \
|
if grep -q "$$$$$$$${mod##$(LINUX_DIR)/}" "$(LINUX_DIR)/modules.builtin"; then \
|
||||||
echo "NOTICE: module '$$$$$$$$mod' is built-in."; \
|
echo "NOTICE: module '$$$$$$$$mod' is built-in."; \
|
||||||
@@ -236,9 +204,10 @@ $(call KernelPackage/$(1)/config)
|
|||||||
exit 1; \
|
exit 1; \
|
||||||
fi; \
|
fi; \
|
||||||
done;
|
done;
|
||||||
$(call ModuleAutoLoad,$(1),$$(1),$(filter-out 0-,$(word 1,$(AUTOLOAD))-),$(filter-out 0,$(word 2,$(AUTOLOAD))),$(wordlist 3,99,$(AUTOLOAD)))
|
$(call ModuleAutoLoad,$(1),$$(1),$(AUTOLOAD))
|
||||||
$(call KernelPackage/$(1)/install,$$(1))
|
$(call KernelPackage/$(1)/install,$$(1))
|
||||||
endef
|
endef
|
||||||
|
endif
|
||||||
$(if $(CONFIG_PACKAGE_kmod-$(1)),
|
$(if $(CONFIG_PACKAGE_kmod-$(1)),
|
||||||
else
|
else
|
||||||
compile: $(1)-disabled
|
compile: $(1)-disabled
|
||||||
@@ -253,22 +222,16 @@ $(call KernelPackage/$(1)/config)
|
|||||||
$$(eval $$(call BuildPackage,kmod-$(1)))
|
$$(eval $$(call BuildPackage,kmod-$(1)))
|
||||||
|
|
||||||
$$(IPKG_kmod-$(1)): $$(wildcard $$(FILES))
|
$$(IPKG_kmod-$(1)): $$(wildcard $$(FILES))
|
||||||
|
|
||||||
endef
|
endef
|
||||||
|
|
||||||
version_filter=$(if $(findstring @,$(1)),$(shell $(SCRIPT_DIR)/package-metadata.pl version_filter $(KERNEL_PATCHVER) $(1)),$(1))
|
version_filter=$(if $(findstring @,$(1)),$(shell $(SCRIPT_DIR)/package-metadata.pl version_filter $(KERNEL_PATCHVER) $(1)),$(1))
|
||||||
|
|
||||||
# 1: priority (optional)
|
|
||||||
# 2: module list
|
|
||||||
# 3: boot flag
|
|
||||||
define AutoLoad
|
define AutoLoad
|
||||||
$(if $(1),$(1),0) $(if $(3),1,0) $(call version_filter,$(2))
|
add_module "$(1)" "$(call version_filter,$(2))" "$(3)";
|
||||||
endef
|
endef
|
||||||
|
|
||||||
# 1: module list
|
|
||||||
# 2: boot flag
|
|
||||||
define AutoProbe
|
define AutoProbe
|
||||||
$(call AutoLoad,,$(1),$(2))
|
probe_module "$(call version_filter,$(1))" "$(2)";
|
||||||
endef
|
endef
|
||||||
|
|
||||||
version_field=$(if $(word $(1),$(2)),$(word $(1),$(2)),0)
|
version_field=$(if $(word $(1),$(2)),$(word $(1),$(2)),0)
|
||||||
|
|||||||
@@ -30,10 +30,9 @@ endef
|
|||||||
# core
|
# core
|
||||||
|
|
||||||
# kernel only
|
# kernel only
|
||||||
$(eval $(if $(NF_KMOD),$(call nf_add,NF_REJECT,CONFIG_NF_REJECT_IPV4, $(P_V4)nf_reject_ipv4),))
|
|
||||||
|
|
||||||
$(eval $(if $(NF_KMOD),$(call nf_add,NF_IPT,CONFIG_IP_NF_IPTABLES, $(P_V4)ip_tables),))
|
$(eval $(if $(NF_KMOD),$(call nf_add,NF_IPT,CONFIG_IP_NF_IPTABLES, $(P_V4)ip_tables),))
|
||||||
$(eval $(if $(NF_KMOD),$(call nf_add,NF_IPT,CONFIG_NETFILTER_XTABLES, $(P_XT)x_tables),))
|
$(eval $(if $(NF_KMOD),$(call nf_add,NF_IPT,CONFIG_NETFILTER_XTABLES, $(P_XT)x_tables),))
|
||||||
|
$(eval $(if $(NF_KMOD),$(call nf_add,NF_IPT,CONFIG_NF_REJECT_IPV4, $(P_V4)nf_reject_ipv4),))
|
||||||
|
|
||||||
$(eval $(if $(NF_KMOD),$(call nf_add,IPT_CORE,CONFIG_NETFILTER_XTABLES, $(P_XT)xt_tcpudp),))
|
$(eval $(if $(NF_KMOD),$(call nf_add,IPT_CORE,CONFIG_NETFILTER_XTABLES, $(P_XT)xt_tcpudp),))
|
||||||
$(eval $(if $(NF_KMOD),$(call nf_add,IPT_CORE,CONFIG_IP_NF_FILTER, $(P_V4)iptable_filter),))
|
$(eval $(if $(NF_KMOD),$(call nf_add,IPT_CORE,CONFIG_IP_NF_FILTER, $(P_V4)iptable_filter),))
|
||||||
@@ -86,27 +85,20 @@ $(eval $(call nf_add,IPT_CONNTRACK_EXTRA,CONFIG_NETFILTER_XT_MATCH_RECENT, $(P_X
|
|||||||
|
|
||||||
$(eval $(if $(NF_KMOD),,$(call nf_add,IPT_CONNTRACK_EXTRA,CONFIG_NETFILTER_XT_CONNMARK, $(P_XT)xt_CONNMARK)))
|
$(eval $(if $(NF_KMOD),,$(call nf_add,IPT_CONNTRACK_EXTRA,CONFIG_NETFILTER_XT_CONNMARK, $(P_XT)xt_CONNMARK)))
|
||||||
|
|
||||||
#conntrack-label
|
|
||||||
|
|
||||||
$(eval $(call nf_add,IPT_CONNTRACK_LABEL,CONFIG_NETFILTER_XT_MATCH_CONNLABEL, $(P_XT)xt_connlabel))
|
|
||||||
|
|
||||||
# extra
|
# extra
|
||||||
|
|
||||||
$(eval $(call nf_add,IPT_EXTRA,CONFIG_NETFILTER_XT_MATCH_ADDRTYPE, $(if $(NF_KMOD),$(P_XT)xt_addrtype,$(P_XT)ipt_addrtype)))
|
$(eval $(call nf_add,IPT_EXTRA,CONFIG_NETFILTER_XT_MATCH_ADDRTYPE, $(if $(NF_KMOD),$(P_XT)xt_addrtype,$(P_XT)ipt_addrtype)))
|
||||||
$(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_OWNER, $(P_XT)xt_owner))
|
||||||
|
$(eval $(call nf_add,IPT_EXTRA,CONFIG_NETFILTER_XT_MATCH_PHYSDEV, $(P_XT)xt_physdev))
|
||||||
$(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_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_QUOTA, $(P_XT)xt_quota))
|
||||||
|
|
||||||
#$(eval $(call nf_add,IPT_EXTRA,CONFIG_IP_NF_TARGET_ROUTE, $(P_V4)ipt_ROUTE))
|
#$(eval $(call nf_add,IPT_EXTRA,CONFIG_IP_NF_TARGET_ROUTE, $(P_V4)ipt_ROUTE))
|
||||||
|
|
||||||
# physdev
|
|
||||||
|
|
||||||
$(eval $(call nf_add,IPT_PHYSDEV,CONFIG_NETFILTER_XT_MATCH_PHYSDEV, $(P_XT)xt_physdev))
|
|
||||||
|
|
||||||
# filter
|
# filter
|
||||||
|
|
||||||
$(eval $(call nf_add,IPT_FILTER,CONFIG_NETFILTER_XT_MATCH_STRING, $(P_XT)xt_string))
|
$(eval $(call nf_add,IPT_FILTER,CONFIG_NETFILTER_XT_MATCH_STRING, $(P_XT)xt_string))
|
||||||
$(eval $(call nf_add,IPT_FILTER,CONFIG_NETFILTER_XT_MATCH_BPF, $(P_XT)xt_bpf))
|
|
||||||
|
|
||||||
|
|
||||||
# ipopt
|
# ipopt
|
||||||
@@ -114,8 +106,6 @@ $(eval $(call nf_add,IPT_FILTER,CONFIG_NETFILTER_XT_MATCH_BPF, $(P_XT)xt_bpf))
|
|||||||
$(eval $(call nf_add,IPT_IPOPT,CONFIG_NETFILTER_XT_MATCH_DSCP, $(P_XT)xt_dscp))
|
$(eval $(call nf_add,IPT_IPOPT,CONFIG_NETFILTER_XT_MATCH_DSCP, $(P_XT)xt_dscp))
|
||||||
$(eval $(call nf_add,IPT_IPOPT,CONFIG_NETFILTER_XT_TARGET_DSCP, $(P_XT)xt_DSCP))
|
$(eval $(call nf_add,IPT_IPOPT,CONFIG_NETFILTER_XT_TARGET_DSCP, $(P_XT)xt_DSCP))
|
||||||
$(eval $(call nf_add,IPT_HASHLIMIT,CONFIG_NETFILTER_XT_MATCH_HASHLIMIT, $(P_XT)xt_hashlimit))
|
$(eval $(call nf_add,IPT_HASHLIMIT,CONFIG_NETFILTER_XT_MATCH_HASHLIMIT, $(P_XT)xt_hashlimit))
|
||||||
$(eval $(call nf_add,IPT_RPFILTER,CONFIG_IP_NF_MATCH_RPFILTER, $(P_V4)ipt_rpfilter))
|
|
||||||
$(eval $(call nf_add,IPT_RPFILTER,CONFIG_IP6_NF_MATCH_RPFILTER, $(P_V6)ip6t_rpfilter))
|
|
||||||
$(eval $(call nf_add,IPT_IPOPT,CONFIG_NETFILTER_XT_MATCH_LENGTH, $(P_XT)xt_length))
|
$(eval $(call nf_add,IPT_IPOPT,CONFIG_NETFILTER_XT_MATCH_LENGTH, $(P_XT)xt_length))
|
||||||
$(eval $(call nf_add,IPT_IPOPT,CONFIG_NETFILTER_XT_MATCH_STATISTIC, $(P_XT)xt_statistic))
|
$(eval $(call nf_add,IPT_IPOPT,CONFIG_NETFILTER_XT_MATCH_STATISTIC, $(P_XT)xt_statistic))
|
||||||
$(eval $(call nf_add,IPT_IPOPT,CONFIG_NETFILTER_XT_MATCH_TCPMSS, $(P_XT)xt_tcpmss))
|
$(eval $(call nf_add,IPT_IPOPT,CONFIG_NETFILTER_XT_MATCH_TCPMSS, $(P_XT)xt_tcpmss))
|
||||||
@@ -146,15 +136,12 @@ $(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))
|
$(eval $(call nf_add,IPT_IPSEC,CONFIG_NETFILTER_XT_MATCH_ESP, $(P_XT)xt_esp))
|
||||||
$(eval $(call nf_add,IPT_IPSEC,CONFIG_NETFILTER_XT_MATCH_POLICY, $(P_XT)xt_policy))
|
$(eval $(call nf_add,IPT_IPSEC,CONFIG_NETFILTER_XT_MATCH_POLICY, $(P_XT)xt_policy))
|
||||||
|
|
||||||
# flow offload support
|
|
||||||
$(eval $(call nf_add,IPT_FLOW,CONFIG_NETFILTER_XT_TARGET_FLOWOFFLOAD, $(P_XT)xt_FLOWOFFLOAD))
|
|
||||||
|
|
||||||
# IPv6
|
# IPv6
|
||||||
|
|
||||||
# kernel only
|
# kernel only
|
||||||
$(eval $(if $(NF_KMOD),$(call nf_add,NF_REJECT6,CONFIG_NF_REJECT_IPV6, $(P_V6)nf_reject_ipv6),))
|
|
||||||
|
|
||||||
$(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_IPT6,CONFIG_IP6_NF_IPTABLES, $(P_V6)ip6_tables),))
|
||||||
|
$(eval $(if $(NF_KMOD),$(call nf_add,NF_IPT6,CONFIG_NF_REJECT_IPV6, $(P_V6)nf_reject_ipv6),))
|
||||||
|
|
||||||
$(eval $(if $(NF_KMOD),$(call nf_add,NF_CONNTRACK6,CONFIG_NF_DEFRAG_IPV6, $(P_V6)nf_defrag_ipv6),))
|
$(eval $(if $(NF_KMOD),$(call nf_add,NF_CONNTRACK6,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,NF_CONNTRACK6,CONFIG_NF_CONNTRACK_IPV6, $(P_V6)nf_conntrack_ipv6),))
|
||||||
@@ -273,10 +260,6 @@ $(eval $(if $(NF_KMOD),$(call nf_add,IPT_TEE,CONFIG_NF_DUP_IPV6, $(P_V6)nf_dup_i
|
|||||||
|
|
||||||
$(eval $(call nf_add,IPT_U32,CONFIG_NETFILTER_XT_MATCH_U32, $(P_XT)xt_u32))
|
$(eval $(call nf_add,IPT_U32,CONFIG_NETFILTER_XT_MATCH_U32, $(P_XT)xt_u32))
|
||||||
|
|
||||||
# checksum
|
|
||||||
|
|
||||||
$(eval $(call nf_add,IPT_CHECKSUM,CONFIG_NETFILTER_XT_TARGET_CHECKSUM, $(P_XT)xt_CHECKSUM))
|
|
||||||
|
|
||||||
|
|
||||||
# netlink
|
# netlink
|
||||||
|
|
||||||
@@ -331,12 +314,9 @@ $(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NF_TABLES, $(P_XT)nf_tables
|
|||||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NF_TABLES_INET, $(P_XT)nf_tables_inet),))
|
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NF_TABLES_INET, $(P_XT)nf_tables_inet),))
|
||||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NFT_EXTHDR, $(P_XT)nft_exthdr),))
|
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NFT_EXTHDR, $(P_XT)nft_exthdr),))
|
||||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NFT_META, $(P_XT)nft_meta),))
|
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NFT_META, $(P_XT)nft_meta),))
|
||||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NFT_NUMGEN, $(P_XT)nft_numgen, ge 4.9.0),))
|
|
||||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NFT_CT, $(P_XT)nft_ct),))
|
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NFT_CT, $(P_XT)nft_ct),))
|
||||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NFT_SET_RBTREE, $(P_XT)nft_set_rbtree, ge 4.9.0),))
|
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NFT_RBTREE, $(P_XT)nft_rbtree),))
|
||||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NFT_RBTREE, $(P_XT)nft_rbtree, lt 4.9.0),))
|
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NFT_HASH, $(P_XT)nft_hash),))
|
||||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NFT_SET_HASH, $(P_XT)nft_set_hash, ge 4.9.0),))
|
|
||||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NFT_HASH, $(P_XT)nft_hash, lt 4.9.0),))
|
|
||||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NFT_COUNTER, $(P_XT)nft_counter),))
|
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NFT_COUNTER, $(P_XT)nft_counter),))
|
||||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NFT_LOG, $(P_XT)nft_log),))
|
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NFT_LOG, $(P_XT)nft_log),))
|
||||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NFT_LIMIT, $(P_XT)nft_limit),))
|
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NFT_LIMIT, $(P_XT)nft_limit),))
|
||||||
@@ -347,24 +327,15 @@ $(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NFT_CHAIN_ROUTE_IPV4, $(P_V
|
|||||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NF_TABLES_IPV6, $(P_V6)nf_tables_ipv6),))
|
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NF_TABLES_IPV6, $(P_V6)nf_tables_ipv6),))
|
||||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NFT_CHAIN_ROUTE_IPV6, $(P_V6)nft_chain_route_ipv6),))
|
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NFT_CHAIN_ROUTE_IPV6, $(P_V6)nft_chain_route_ipv6),))
|
||||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NFT_REDIR, $(P_XT)nft_redir, ge 3.19.0),))
|
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NFT_REDIR, $(P_XT)nft_redir, ge 3.19.0),))
|
||||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NFT_QUOTA, $(P_XT)nft_quota, ge 4.9.0),))
|
|
||||||
|
|
||||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_ARP,CONFIG_NF_TABLES_ARP, $(P_V4)nf_tables_arp),))
|
|
||||||
|
|
||||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_BRIDGE,CONFIG_NF_TABLES_BRIDGE, $(P_EBT)nf_tables_bridge),))
|
|
||||||
$(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_NAT,CONFIG_NFT_NAT, $(P_XT)nft_nat),))
|
$(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_CHAIN_NAT_IPV4, $(P_V4)nft_chain_nat_ipv4),))
|
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_NAT,CONFIG_NFT_CHAIN_NAT_IPV4, $(P_V4)nft_chain_nat_ipv4),))
|
||||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_NAT,CONFIG_NFT_REDIR_IPV4, $(P_V4)nft_redir_ipv4, ge 3.19.0),))
|
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_NAT,CONFIG_NFT_REDIR_IPV4, $(P_V4)nft_redir_ipv4, ge 3.19.0),))
|
||||||
$(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, ge 3.19.0),))
|
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_NAT6,CONFIG_NFT_REDIR_IPV6, $(P_V6)nft_redir_ipv6, ge 3.19.0),))
|
||||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_NAT6,CONFIG_NFT_CHAIN_NAT_IPV6, $(P_V6)nft_chain_nat_ipv6),))
|
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_NAT6,CONFIG_NFT_CHAIN_NAT_IPV6, $(P_V6)nft_chain_nat_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_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_NAT,CONFIG_NFT_MASQ_IPV6, $(P_V6)nft_masq_ipv6),))
|
||||||
|
|
||||||
# userland only
|
# userland only
|
||||||
IPT_BUILTIN += $(NF_IPT-y) $(NF_IPT-m)
|
IPT_BUILTIN += $(NF_IPT-y) $(NF_IPT-m)
|
||||||
@@ -374,9 +345,7 @@ IPT_BUILTIN += $(NF_CONNTRACK6-y)
|
|||||||
IPT_BUILTIN += $(IPT_CONNTRACK-y)
|
IPT_BUILTIN += $(IPT_CONNTRACK-y)
|
||||||
IPT_BUILTIN += $(IPT_CONNTRACK_EXTRA-y)
|
IPT_BUILTIN += $(IPT_CONNTRACK_EXTRA-y)
|
||||||
IPT_BUILTIN += $(IPT_EXTRA-y)
|
IPT_BUILTIN += $(IPT_EXTRA-y)
|
||||||
IPT_BUILTIN += $(IPT_PHYSDEV-y)
|
|
||||||
IPT_BUILTIN += $(IPT_FILTER-y)
|
IPT_BUILTIN += $(IPT_FILTER-y)
|
||||||
IPT_BUILTIN += $(IPT_FLOW-y) $(IPT_FLOW-m)
|
|
||||||
IPT_BUILTIN += $(IPT_IPOPT-y)
|
IPT_BUILTIN += $(IPT_IPOPT-y)
|
||||||
IPT_BUILTIN += $(IPT_IPRANGE-y)
|
IPT_BUILTIN += $(IPT_IPRANGE-y)
|
||||||
IPT_BUILTIN += $(IPT_CLUSTER-y)
|
IPT_BUILTIN += $(IPT_CLUSTER-y)
|
||||||
@@ -391,6 +360,7 @@ IPT_BUILTIN += $(IPT_NAT_EXTRA-y)
|
|||||||
IPT_BUILTIN += $(NF_NATHELPER-y)
|
IPT_BUILTIN += $(NF_NATHELPER-y)
|
||||||
IPT_BUILTIN += $(NF_NATHELPER_EXTRA-y)
|
IPT_BUILTIN += $(NF_NATHELPER_EXTRA-y)
|
||||||
IPT_BUILTIN += $(IPT_ULOG-y)
|
IPT_BUILTIN += $(IPT_ULOG-y)
|
||||||
|
IPT_BUILTIN += $(IPT_DEBUG-y)
|
||||||
IPT_BUILTIN += $(IPT_TPROXY-y)
|
IPT_BUILTIN += $(IPT_TPROXY-y)
|
||||||
IPT_BUILTIN += $(NFNETLINK-y)
|
IPT_BUILTIN += $(NFNETLINK-y)
|
||||||
IPT_BUILTIN += $(NFNETLINK_LOG-y)
|
IPT_BUILTIN += $(NFNETLINK_LOG-y)
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ else
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
PKG_CONFIG_DEPENDS += CONFIG_BUILD_NLS
|
PKG_CONFIG_DEPENDS += CONFIG_BUILD_NLS
|
||||||
PKG_BUILD_DEPENDS += !BUILD_NLS:libiconv !BUILD_NLS:gettext
|
PKG_BUILD_DEPENDS += !BUILD_NLS:libiconv !BUILD_NLS:libintl
|
||||||
|
|
||||||
ICONV_DEPENDS:=+BUILD_NLS:libiconv-full
|
ICONV_DEPENDS:=+BUILD_NLS:libiconv-full
|
||||||
ICONV_CFLAGS:=-I$(ICONV_PREFIX)/include
|
ICONV_CFLAGS:=-I$(ICONV_PREFIX)/include
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ ifeq ($(DUMP),)
|
|||||||
ifeq ($(if $(VARIANT),$(BUILD_VARIANT)),$(VARIANT))
|
ifeq ($(if $(VARIANT),$(BUILD_VARIANT)),$(VARIANT))
|
||||||
ifdef Package/$(1)/install
|
ifdef Package/$(1)/install
|
||||||
ifneq ($(CONFIG_PACKAGE_$(1))$(DEVELOPER),)
|
ifneq ($(CONFIG_PACKAGE_$(1))$(DEVELOPER),)
|
||||||
$(_pkg_target)compile: $(PKG_BUILD_DIR)/.pkgdir/$(1).installed
|
|
||||||
compile: install-bin-$(1)
|
compile: install-bin-$(1)
|
||||||
else
|
else
|
||||||
compile: $(1)-disabled
|
compile: $(1)-disabled
|
||||||
@@ -20,19 +19,10 @@ ifeq ($(DUMP),)
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
$(PKG_BUILD_DIR)/.pkgdir/$(1).installed: $(STAMP_BUILT)
|
install-bin-$(1): $(STAMP_BUILT)
|
||||||
rm -rf $(PKG_BUILD_DIR)/.pkgdir/$(1) $$@
|
rm -rf $(BIN_DIR)/$(1)
|
||||||
mkdir -p $(PKG_BUILD_DIR)/.pkgdir/$(1)
|
$(INSTALL_DIR) $(BIN_DIR)/$(1)
|
||||||
$(call Package/$(1)/install,$(PKG_BUILD_DIR)/.pkgdir/$(1))
|
$(call Package/$(1)/install,$(BIN_DIR)/$(1))
|
||||||
touch $$@
|
|
||||||
|
|
||||||
install-bin-$(1): $(PKG_BUILD_DIR)/.pkgdir/$(1).installed
|
|
||||||
rm -rf $(BIN_DIR)/$(1)
|
|
||||||
-rmdir $(PKG_BUILD_DIR)/.pkgdir/$(1) >/dev/null 2>/dev/null
|
|
||||||
if [ -d $(PKG_BUILD_DIR)/.pkgdir/$(1) ]; then \
|
|
||||||
$(INSTALL_DIR) $(BIN_DIR)/$(1) && \
|
|
||||||
$(CP) $(PKG_BUILD_DIR)/.pkgdir/$(1)/. $(BIN_DIR)/$(1)/; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
clean-$(1):
|
clean-$(1):
|
||||||
rm -rf $(BIN_DIR)/$(1)
|
rm -rf $(BIN_DIR)/$(1)
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
# See /LICENSE for more information.
|
# See /LICENSE for more information.
|
||||||
#
|
#
|
||||||
|
|
||||||
PKG_DEFAULT_DEPENDS = +libc +GCC_LIBSSP:libssp +USE_GLIBC:librt +USE_GLIBC:libpthread
|
PKG_DEFAULT_DEPENDS = +libc +SSP_SUPPORT:libssp +USE_GLIBC:librt +USE_GLIBC:libpthread
|
||||||
|
|
||||||
ifneq ($(PKG_NAME),toolchain)
|
ifneq ($(PKG_NAME),toolchain)
|
||||||
PKG_FIXUP_DEPENDS = $(if $(filter kmod-%,$(1)),$(2),$(PKG_DEFAULT_DEPENDS) $(filter-out $(PKG_DEFAULT_DEPENDS),$(2)))
|
PKG_FIXUP_DEPENDS = $(if $(filter kmod-%,$(1)),$(2),$(PKG_DEFAULT_DEPENDS) $(filter-out $(PKG_DEFAULT_DEPENDS),$(2)))
|
||||||
@@ -56,16 +56,13 @@ define Package/Default
|
|||||||
VARIANT:=
|
VARIANT:=
|
||||||
DEFAULT_VARIANT:=
|
DEFAULT_VARIANT:=
|
||||||
USERID:=
|
USERID:=
|
||||||
ALTERNATIVES:=
|
|
||||||
LICENSE:=$(PKG_LICENSE)
|
|
||||||
LICENSE_FILES:=$(PKG_LICENSE_FILES)
|
|
||||||
endef
|
endef
|
||||||
|
|
||||||
Build/Patch:=$(Build/Patch/Default)
|
Build/Patch:=$(Build/Patch/Default)
|
||||||
ifneq ($(strip $(PKG_UNPACK)),)
|
ifneq ($(strip $(PKG_UNPACK)),)
|
||||||
define Build/Prepare/Default
|
define Build/Prepare/Default
|
||||||
$(PKG_UNPACK)
|
$(PKG_UNPACK)
|
||||||
[ ! -d ./src/ ] || $(CP) ./src/. $(PKG_BUILD_DIR)
|
[ ! -d ./src/ ] || $(CP) ./src/* $(PKG_BUILD_DIR)
|
||||||
$(Build/Patch)
|
$(Build/Patch)
|
||||||
endef
|
endef
|
||||||
endif
|
endif
|
||||||
@@ -95,6 +92,7 @@ CONFIGURE_ARGS = \
|
|||||||
--mandir=$(CONFIGURE_PREFIX)/man \
|
--mandir=$(CONFIGURE_PREFIX)/man \
|
||||||
--infodir=$(CONFIGURE_PREFIX)/info \
|
--infodir=$(CONFIGURE_PREFIX)/info \
|
||||||
$(DISABLE_NLS) \
|
$(DISABLE_NLS) \
|
||||||
|
$(DISABLE_LARGEFILE) \
|
||||||
$(DISABLE_IPV6)
|
$(DISABLE_IPV6)
|
||||||
|
|
||||||
CONFIGURE_VARS = \
|
CONFIGURE_VARS = \
|
||||||
|
|||||||
@@ -7,17 +7,23 @@
|
|||||||
|
|
||||||
ifneq ($(DUMP),)
|
ifneq ($(DUMP),)
|
||||||
|
|
||||||
|
dumpinfo: FORCE
|
||||||
|
|
||||||
define SOURCE_INFO
|
define Config/template
|
||||||
$(if $(PKG_BUILD_DEPENDS),Build-Depends: $(PKG_BUILD_DEPENDS)
|
Preconfig: $(1)
|
||||||
)$(if $(HOST_BUILD_DEPENDS),Build-Depends/host: $(HOST_BUILD_DEPENDS)
|
Preconfig-Type: $(2)
|
||||||
)$(if $(BUILD_TYPES),Build-Types: $(BUILD_TYPES)
|
Preconfig-Default: $(3)
|
||||||
)
|
Preconfig-Label: $(4)
|
||||||
|
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
define Config
|
||||||
|
Preconfig/$(1) = $$(call Config/template,$(1),$(2),$(3),$(4))
|
||||||
|
preconfig_$$(1) += $(1)
|
||||||
|
endef
|
||||||
|
|
||||||
define Dumpinfo/Package
|
define Dumpinfo/Package
|
||||||
$(info $(SOURCE_INFO)Package: $(1)
|
$(info Package: $(1)
|
||||||
$(if $(MENU),Menu: $(MENU)
|
$(if $(MENU),Menu: $(MENU)
|
||||||
)$(if $(SUBMENU),Submenu: $(SUBMENU)
|
)$(if $(SUBMENU),Submenu: $(SUBMENU)
|
||||||
)$(if $(SUBMENUDEP),Submenu-Depends: $(SUBMENUDEP)
|
)$(if $(SUBMENUDEP),Submenu-Depends: $(SUBMENUDEP)
|
||||||
@@ -30,15 +36,18 @@ Menu-Depends: $(MDEPENDS)
|
|||||||
Provides: $(PROVIDES)
|
Provides: $(PROVIDES)
|
||||||
$(if $(VARIANT),Build-Variant: $(VARIANT)
|
$(if $(VARIANT),Build-Variant: $(VARIANT)
|
||||||
$(if $(DEFAULT_VARIANT),Default-Variant: $(VARIANT)
|
$(if $(DEFAULT_VARIANT),Default-Variant: $(VARIANT)
|
||||||
))Section: $(SECTION)
|
))$(if $(PKG_BUILD_DEPENDS),Build-Depends: $(PKG_BUILD_DEPENDS)
|
||||||
|
)$(if $(HOST_BUILD_DEPENDS),Build-Depends/host: $(HOST_BUILD_DEPENDS)
|
||||||
|
)$(if $(BUILD_TYPES),Build-Types: $(BUILD_TYPES)
|
||||||
|
)Section: $(SECTION)
|
||||||
Category: $(CATEGORY)
|
Category: $(CATEGORY)
|
||||||
$(if $(filter nonshared,$(PKGFLAGS)),,Repository: $(if $(FEED),$(FEED),base)
|
$(if $(filter nonshared,$(PKGFLAGS)),,Repository: $(if $(FEED),$(FEED),base)
|
||||||
)Title: $(TITLE)
|
)Title: $(TITLE)
|
||||||
Maintainer: $(MAINTAINER)
|
Maintainer: $(MAINTAINER)
|
||||||
$(if $(USERID),Require-User: $(USERID)
|
$(if $(USERID),Require-User: $(USERID)
|
||||||
)Source: $(PKG_SOURCE)
|
)Source: $(PKG_SOURCE)
|
||||||
$(if $(LICENSE),License: $(LICENSE)
|
$(if $(PKG_LICENSE),License: $(PKG_LICENSE)
|
||||||
)$(if $(LICENSE_FILES),LicenseFiles: $(LICENSE_FILES)
|
)$(if $(PKG_LICENSE_FILES),LicenseFiles: $(PKG_LICENSE_FILES)
|
||||||
)Type: $(if $(Package/$(1)/targets),$(Package/$(1)/targets),$(if $(PKG_TARGETS),$(PKG_TARGETS),ipkg))
|
)Type: $(if $(Package/$(1)/targets),$(Package/$(1)/targets),$(if $(PKG_TARGETS),$(PKG_TARGETS),ipkg))
|
||||||
$(if $(KCONFIG),Kernel-Config: $(KCONFIG)
|
$(if $(KCONFIG),Kernel-Config: $(KCONFIG)
|
||||||
)$(if $(BUILDONLY),Build-Only: $(BUILDONLY)
|
)$(if $(BUILDONLY),Build-Only: $(BUILDONLY)
|
||||||
@@ -50,11 +59,33 @@ $(if $(URL),$(URL)
|
|||||||
$(if $(Package/$(1)/config),Config:
|
$(if $(Package/$(1)/config),Config:
|
||||||
$(Package/$(1)/config)
|
$(Package/$(1)/config)
|
||||||
@@
|
@@
|
||||||
))
|
)$(foreach pc,$(preconfig_$(1)),
|
||||||
SOURCE_INFO :=
|
$(Preconfig/$(pc))))
|
||||||
endef
|
endef
|
||||||
|
|
||||||
dumpinfo: FORCE
|
define Feature/Default
|
||||||
$(if $(SOURCE_INFO),$(info $(SOURCE_INFO)))
|
TARGET_NAME:=
|
||||||
|
TARGET_TITLE:=
|
||||||
|
PRIORITY:=
|
||||||
|
NAME:=
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Feature
|
||||||
|
$(eval $(Feature/Default))
|
||||||
|
$(eval $(Feature/$(1)))
|
||||||
|
$(if $(DUMP),$(call Dumpinfo/Feature,$(1)))
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Dumpinfo/Feature
|
||||||
|
$(info Feature: $(TARGET_NAME)_$(1)
|
||||||
|
Target-Name: $(TARGET_NAME)
|
||||||
|
Target-Title: $(TARGET_TITLE)
|
||||||
|
Feature-Name: $(NAME)
|
||||||
|
$(if $(PRIORITY),Feature-Priority: $(PRIORITY)
|
||||||
|
)Feature-Description:
|
||||||
|
$(Feature/$(1)/description)
|
||||||
|
@@
|
||||||
|
)
|
||||||
|
endef
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -106,19 +106,25 @@ ifeq ($(DUMP),)
|
|||||||
ifdef do_install
|
ifdef do_install
|
||||||
ifneq ($(CONFIG_PACKAGE_$(1))$(DEVELOPER),)
|
ifneq ($(CONFIG_PACKAGE_$(1))$(DEVELOPER),)
|
||||||
IPKGS += $(1)
|
IPKGS += $(1)
|
||||||
$(_pkg_target)compile: $$(IPKG_$(1)) $(PKG_INFO_DIR)/$(1).provides $(PKG_BUILD_DIR)/.pkgdir/$(1).installed
|
compile: $$(IPKG_$(1)) $(PKG_INFO_DIR)/$(1).provides $(STAGING_DIR_ROOT)/stamp/.$(1)_installed
|
||||||
prepare-package-install: $$(IPKG_$(1))
|
ifneq ($(ABI_VERSION),)
|
||||||
compile: $(STAGING_DIR_ROOT)/stamp/.$(1)_installed
|
compile: $(PKG_INFO_DIR)/$(1).version
|
||||||
|
endif
|
||||||
else
|
else
|
||||||
$(if $(CONFIG_PACKAGE_$(1)),$$(info WARNING: skipping $(1) -- package not selected))
|
$(if $(CONFIG_PACKAGE_$(1)),$$(info WARNING: skipping $(1) -- package not selected))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
.PHONY: $(PKG_INSTALL_STAMP).$(1)
|
.PHONY: $(PKG_INSTALL_STAMP).$(1)
|
||||||
|
compile: $(PKG_INSTALL_STAMP).$(1)
|
||||||
|
$(PKG_INSTALL_STAMP).$(1):
|
||||||
|
if [ -f $(PKG_INSTALL_STAMP).clean ]; then \
|
||||||
|
rm -f \
|
||||||
|
$(PKG_INSTALL_STAMP) \
|
||||||
|
$(PKG_INSTALL_STAMP).clean; \
|
||||||
|
fi
|
||||||
ifeq ($(CONFIG_PACKAGE_$(1)),y)
|
ifeq ($(CONFIG_PACKAGE_$(1)),y)
|
||||||
compile: $(PKG_INSTALL_STAMP).$(1)
|
echo "$(1)" >> $(PKG_INSTALL_STAMP)
|
||||||
endif
|
endif
|
||||||
$(PKG_INSTALL_STAMP).$(1): prepare-package-install
|
|
||||||
echo "$(1)" >> $(PKG_INSTALL_STAMP)
|
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -134,19 +140,19 @@ ifeq ($(DUMP),)
|
|||||||
$(eval $(call BuildIPKGVariable,$(1),prerm,-pkg,1))
|
$(eval $(call BuildIPKGVariable,$(1),prerm,-pkg,1))
|
||||||
$(eval $(call BuildIPKGVariable,$(1),postrm,,1))
|
$(eval $(call BuildIPKGVariable,$(1),postrm,,1))
|
||||||
|
|
||||||
$(PKG_BUILD_DIR)/.pkgdir/$(1).installed : export PATH=$$(TARGET_PATH_PKG)
|
$(STAGING_DIR_ROOT)/stamp/.$(1)_installed : export PATH=$$(TARGET_PATH_PKG)
|
||||||
$(PKG_BUILD_DIR)/.pkgdir/$(1).installed: $(STAMP_BUILT)
|
$(STAGING_DIR_ROOT)/stamp/.$(1)_installed: $(STAMP_BUILT)
|
||||||
rm -rf $$@ $(PKG_BUILD_DIR)/.pkgdir/$(1)
|
rm -rf $(STAGING_DIR_ROOT)/tmp-$(1)
|
||||||
mkdir -p $(PKG_BUILD_DIR)/.pkgdir/$(1)
|
mkdir -p $(STAGING_DIR_ROOT)/stamp $(STAGING_DIR_ROOT)/tmp-$(1)
|
||||||
$(call Package/$(1)/install,$(PKG_BUILD_DIR)/.pkgdir/$(1))
|
$(call Package/$(1)/install,$(STAGING_DIR_ROOT)/tmp-$(1))
|
||||||
$(call Package/$(1)/install_lib,$(PKG_BUILD_DIR)/.pkgdir/$(1))
|
$(call Package/$(1)/install_lib,$(STAGING_DIR_ROOT)/tmp-$(1))
|
||||||
|
$(call locked,$(CP) $(STAGING_DIR_ROOT)/tmp-$(1)/. $(STAGING_DIR_ROOT)/,root-copy)
|
||||||
|
rm -rf $(STAGING_DIR_ROOT)/tmp-$(1)
|
||||||
touch $$@
|
touch $$@
|
||||||
|
|
||||||
$(STAGING_DIR_ROOT)/stamp/.$(1)_installed: $(PKG_BUILD_DIR)/.pkgdir/$(1).installed
|
$(PKG_INFO_DIR)/$(1).version: $$(IPKG_$(1))
|
||||||
mkdir -p $(STAGING_DIR_ROOT)/stamp
|
echo '$(ABI_VERSION)' | cmp -s - $$@ || \
|
||||||
$(if $(ABI_VERSION),echo '$(ABI_VERSION)' | cmp -s - $(PKG_INFO_DIR)/$(1).version || echo '$(ABI_VERSION)' > $(PKG_INFO_DIR)/$(1).version)
|
echo '$(ABI_VERSION)' > $$@
|
||||||
$(call locked,$(CP) $(PKG_BUILD_DIR)/.pkgdir/$(1)/. $(STAGING_DIR_ROOT)/,root-copy)
|
|
||||||
touch $$@
|
|
||||||
|
|
||||||
Package/$(1)/DEPENDS := $$(call mergelist,$$(filter-out @%,$$(IDEPEND_$(1))))
|
Package/$(1)/DEPENDS := $$(call mergelist,$$(filter-out @%,$$(IDEPEND_$(1))))
|
||||||
ifneq ($$(EXTRA_DEPENDS),)
|
ifneq ($$(EXTRA_DEPENDS),)
|
||||||
@@ -159,10 +165,9 @@ Version: $(VERSION)
|
|||||||
$$(call addfield,Depends,$$(Package/$(1)/DEPENDS)
|
$$(call addfield,Depends,$$(Package/$(1)/DEPENDS)
|
||||||
)$$(call addfield,Conflicts,$$(call mergelist,$(CONFLICTS))
|
)$$(call addfield,Conflicts,$$(call mergelist,$(CONFLICTS))
|
||||||
)$$(call addfield,Provides,$$(call mergelist,$(PROVIDES))
|
)$$(call addfield,Provides,$$(call mergelist,$(PROVIDES))
|
||||||
)$$(call addfield,Alternatives,$$(call mergelist,$(ALTERNATIVES))
|
|
||||||
)$$(call addfield,Source,$(SOURCE)
|
)$$(call addfield,Source,$(SOURCE)
|
||||||
)$$(call addfield,License,$(LICENSE)
|
)$$(call addfield,License,$$(PKG_LICENSE)
|
||||||
)$$(call addfield,LicenseFiles,$(LICENSE_FILES)
|
)$$(call addfield,LicenseFiles,$$(PKG_LICENSE_FILES)
|
||||||
)$$(call addfield,Section,$(SECTION)
|
)$$(call addfield,Section,$(SECTION)
|
||||||
)$$(call addfield,Require-User,$(USERID)
|
)$$(call addfield,Require-User,$(USERID)
|
||||||
)$(if $(filter hold,$(PKG_FLAGS)),Status: unknown hold not-installed
|
)$(if $(filter hold,$(PKG_FLAGS)),Status: unknown hold not-installed
|
||||||
@@ -172,10 +177,11 @@ $$(call addfield,Depends,$$(Package/$(1)/DEPENDS)
|
|||||||
Installed-Size: 0
|
Installed-Size: 0
|
||||||
$(_endef)
|
$(_endef)
|
||||||
|
|
||||||
|
$(PKG_INFO_DIR)/$(1).provides: $$(IPKG_$(1))
|
||||||
$$(IPKG_$(1)) : export CONTROL=$$(Package/$(1)/CONTROL)
|
$$(IPKG_$(1)) : export CONTROL=$$(Package/$(1)/CONTROL)
|
||||||
$$(IPKG_$(1)) : export DESCRIPTION=$$(Package/$(1)/description)
|
$$(IPKG_$(1)) : export DESCRIPTION=$$(Package/$(1)/description)
|
||||||
$$(IPKG_$(1)) : export PATH=$$(TARGET_PATH_PKG)
|
$$(IPKG_$(1)) : export PATH=$$(TARGET_PATH_PKG)
|
||||||
$(PKG_INFO_DIR)/$(1).provides $$(IPKG_$(1)): $(STAMP_BUILT) $(INCLUDE_DIR)/package-ipkg.mk
|
$$(IPKG_$(1)): $(STAMP_BUILT) $(INCLUDE_DIR)/package-ipkg.mk
|
||||||
@rm -rf $$(IDIR_$(1)) $$(call opkg_package_files,$(1))
|
@rm -rf $$(IDIR_$(1)) $$(call opkg_package_files,$(1))
|
||||||
mkdir -p $(PACKAGE_DIR) $$(IDIR_$(1))/CONTROL $(PKG_INFO_DIR)
|
mkdir -p $(PACKAGE_DIR) $$(IDIR_$(1))/CONTROL $(PKG_INFO_DIR)
|
||||||
$(call Package/$(1)/install,$$(IDIR_$(1)))
|
$(call Package/$(1)/install,$$(IDIR_$(1)))
|
||||||
@@ -190,7 +196,7 @@ $(_endef)
|
|||||||
fi; \
|
fi; \
|
||||||
done; $(Package/$(1)/extra_provides) \
|
done; $(Package/$(1)/extra_provides) \
|
||||||
) | sort -u > $(PKG_INFO_DIR)/$(1).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)
|
$(if $(PROVIDES),@for pkg in $(PROVIDES); do cp $(PKG_INFO_DIR)/$(1).provides $(PKG_INFO_DIR)/$$$$pkg.provides; done)
|
||||||
$(CheckDependencies)
|
$(CheckDependencies)
|
||||||
|
|
||||||
$(RSTRIP) $$(IDIR_$(1))
|
$(RSTRIP) $$(IDIR_$(1))
|
||||||
|
|||||||
@@ -37,22 +37,10 @@ endif
|
|||||||
|
|
||||||
include $(INCLUDE_DIR)/hardening.mk
|
include $(INCLUDE_DIR)/hardening.mk
|
||||||
include $(INCLUDE_DIR)/prereq.mk
|
include $(INCLUDE_DIR)/prereq.mk
|
||||||
|
include $(INCLUDE_DIR)/host.mk
|
||||||
include $(INCLUDE_DIR)/unpack.mk
|
include $(INCLUDE_DIR)/unpack.mk
|
||||||
include $(INCLUDE_DIR)/depends.mk
|
include $(INCLUDE_DIR)/depends.mk
|
||||||
|
|
||||||
ifneq ($(if $(CONFIG_SRC_TREE_OVERRIDE),$(wildcard ./git-src)),)
|
|
||||||
USE_GIT_TREE:=1
|
|
||||||
QUILT:=1
|
|
||||||
endif
|
|
||||||
ifdef USE_SOURCE_DIR
|
|
||||||
QUILT:=1
|
|
||||||
endif
|
|
||||||
ifneq ($(wildcard $(PKG_BUILD_DIR)/.source_dir),)
|
|
||||||
QUILT:=1
|
|
||||||
endif
|
|
||||||
|
|
||||||
include $(INCLUDE_DIR)/quilt.mk
|
|
||||||
|
|
||||||
find_library_dependencies = $(wildcard $(patsubst %,$(STAGING_DIR)/pkginfo/%.version, \
|
find_library_dependencies = $(wildcard $(patsubst %,$(STAGING_DIR)/pkginfo/%.version, \
|
||||||
$(filter-out $(BUILD_PACKAGES),$(foreach dep, \
|
$(filter-out $(BUILD_PACKAGES),$(foreach dep, \
|
||||||
$(filter-out @%, $(patsubst +%,%,$(1))), \
|
$(filter-out @%, $(patsubst +%,%,$(1))), \
|
||||||
@@ -69,7 +57,7 @@ ifneq ($(PREV_STAMP_PREPARED),)
|
|||||||
STAMP_PREPARED:=$(PREV_STAMP_PREPARED)
|
STAMP_PREPARED:=$(PREV_STAMP_PREPARED)
|
||||||
CONFIG_AUTOREBUILD:=
|
CONFIG_AUTOREBUILD:=
|
||||||
else
|
else
|
||||||
STAMP_PREPARED=$(PKG_BUILD_DIR)/.prepared$(if $(QUILT)$(DUMP),,_$(shell $(call 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,$(PKG_PREPARED_DEPENDS)))
|
||||||
endif
|
endif
|
||||||
STAMP_CONFIGURED=$(PKG_BUILD_DIR)/.configured$(if $(DUMP),,_$(call confvar,$(PKG_CONFIG_DEPENDS)))
|
STAMP_CONFIGURED=$(PKG_BUILD_DIR)/.configured$(if $(DUMP),,_$(call confvar,$(PKG_CONFIG_DEPENDS)))
|
||||||
STAMP_CONFIGURED_WILDCARD=$(PKG_BUILD_DIR)/.configured_*
|
STAMP_CONFIGURED_WILDCARD=$(PKG_BUILD_DIR)/.configured_*
|
||||||
@@ -81,25 +69,33 @@ STAGING_FILES_LIST:=$(PKG_DIR_NAME)$(if $(BUILD_VARIANT),.$(BUILD_VARIANT),).lis
|
|||||||
define CleanStaging
|
define CleanStaging
|
||||||
rm -f $(STAMP_INSTALLED)
|
rm -f $(STAMP_INSTALLED)
|
||||||
@-(\
|
@-(\
|
||||||
if [ -f $(STAGING_DIR)/packages/$(STAGING_FILES_LIST) ]; then \
|
cd "$(STAGING_DIR)"; \
|
||||||
$(SCRIPT_DIR)/clean-package.sh \
|
if [ -f packages/$(STAGING_FILES_LIST) ]; then \
|
||||||
"$(STAGING_DIR)/packages/$(STAGING_FILES_LIST)" \
|
cat packages/$(STAGING_FILES_LIST) | xargs -r rm -f 2>/dev/null; \
|
||||||
"$(STAGING_DIR)"; \
|
|
||||||
fi; \
|
fi; \
|
||||||
)
|
)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
ifneq ($(if $(CONFIG_SRC_TREE_OVERRIDE),$(wildcard ./git-src)),)
|
||||||
|
USE_GIT_TREE:=1
|
||||||
|
QUILT:=1
|
||||||
|
endif
|
||||||
|
ifdef USE_SOURCE_DIR
|
||||||
|
QUILT:=1
|
||||||
|
endif
|
||||||
|
ifneq ($(wildcard $(PKG_BUILD_DIR)/.source_dir),)
|
||||||
|
QUILT:=1
|
||||||
|
endif
|
||||||
|
|
||||||
PKG_INSTALL_STAMP:=$(PKG_INFO_DIR)/$(PKG_DIR_NAME).$(if $(BUILD_VARIANT),$(BUILD_VARIANT),default).install
|
PKG_INSTALL_STAMP:=$(PKG_INFO_DIR)/$(PKG_DIR_NAME).$(if $(BUILD_VARIANT),$(BUILD_VARIANT),default).install
|
||||||
|
|
||||||
|
include $(INCLUDE_DIR)/quilt.mk
|
||||||
include $(INCLUDE_DIR)/package-defaults.mk
|
include $(INCLUDE_DIR)/package-defaults.mk
|
||||||
include $(INCLUDE_DIR)/package-dumpinfo.mk
|
include $(INCLUDE_DIR)/package-dumpinfo.mk
|
||||||
include $(INCLUDE_DIR)/package-ipkg.mk
|
include $(INCLUDE_DIR)/package-ipkg.mk
|
||||||
include $(INCLUDE_DIR)/package-bin.mk
|
include $(INCLUDE_DIR)/package-bin.mk
|
||||||
include $(INCLUDE_DIR)/autotools.mk
|
include $(INCLUDE_DIR)/autotools.mk
|
||||||
|
|
||||||
_pkg_target:=$(if $(QUILT),,.)
|
|
||||||
|
|
||||||
override MAKEFLAGS=
|
override MAKEFLAGS=
|
||||||
CONFIG_SITE:=$(INCLUDE_DIR)/site/$(ARCH)
|
CONFIG_SITE:=$(INCLUDE_DIR)/site/$(ARCH)
|
||||||
CUR_MAKEFILE:=$(filter-out Makefile,$(firstword $(MAKEFILE_LIST)))
|
CUR_MAKEFILE:=$(filter-out Makefile,$(firstword $(MAKEFILE_LIST)))
|
||||||
@@ -121,12 +117,7 @@ ifdef USE_GIT_TREE
|
|||||||
define Build/Prepare/Default
|
define Build/Prepare/Default
|
||||||
mkdir -p $(PKG_BUILD_DIR)
|
mkdir -p $(PKG_BUILD_DIR)
|
||||||
ln -s $(CURDIR)/git-src $(PKG_BUILD_DIR)/.git
|
ln -s $(CURDIR)/git-src $(PKG_BUILD_DIR)/.git
|
||||||
( cd $(PKG_BUILD_DIR); \
|
( cd $(PKG_BUILD_DIR); git checkout .)
|
||||||
git checkout .; \
|
|
||||||
git submodule update --recursive; \
|
|
||||||
git submodule foreach git config --unset core.worktree; \
|
|
||||||
git submodule foreach git checkout .; \
|
|
||||||
)
|
|
||||||
endef
|
endef
|
||||||
endif
|
endif
|
||||||
ifdef USE_SOURCE_DIR
|
ifdef USE_SOURCE_DIR
|
||||||
@@ -139,23 +130,19 @@ ifdef USE_SOURCE_DIR
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
define Build/Exports/Default
|
define Build/Exports/Default
|
||||||
$(1) : export ACLOCAL_INCLUDE=$$(foreach p,$$(wildcard $$(STAGING_DIR)/usr/share/aclocal $$(STAGING_DIR)/usr/share/aclocal-* $$(STAGING_DIR_HOSTPKG)/share/aclocal $$(STAGING_DIR_HOSTPKG)/share/aclocal-* $$(STAGING_DIR)/host/share/aclocal $$(STAGING_DIR)/host/share/aclocal-*),-I $$(p))
|
$(1) : export ACLOCAL_INCLUDE=$$(foreach p,$$(wildcard $$(STAGING_DIR)/usr/share/aclocal $$(STAGING_DIR)/usr/share/aclocal-* $$(STAGING_DIR)/host/share/aclocal $$(STAGING_DIR)/host/share/aclocal-*),-I $$(p))
|
||||||
$(1) : export STAGING_PREFIX=$$(STAGING_DIR)/usr
|
$(1) : export STAGING_PREFIX=$$(STAGING_DIR)/usr
|
||||||
$(1) : export PATH=$$(TARGET_PATH_PKG)
|
$(1) : export PATH=$$(TARGET_PATH_PKG)
|
||||||
$(1) : export CONFIG_SITE:=$$(CONFIG_SITE)
|
$(1) : export CONFIG_SITE:=$$(CONFIG_SITE)
|
||||||
$(1) : export PKG_CONFIG_PATH:=$$(PKG_CONFIG_PATH)
|
$(1) : export PKG_CONFIG_PATH:=$$(PKG_CONFIG_PATH)
|
||||||
$(1) : export PKG_CONFIG_LIBDIR:=$$(PKG_CONFIG_PATH)
|
$(1) : export PKG_CONFIG_LIBDIR:=$$(PKG_CONFIG_PATH)
|
||||||
$(if $(CONFIG_CCACHE),$(1) : export CCACHE_DIR:=$(STAGING_DIR)/ccache)
|
$(1) : export CCACHE_DIR:=$(STAGING_DIR)/ccache
|
||||||
endef
|
endef
|
||||||
Build/Exports=$(Build/Exports/Default)
|
Build/Exports=$(Build/Exports/Default)
|
||||||
|
|
||||||
define Build/CoreTargets
|
define Build/CoreTargets
|
||||||
STAMP_PREPARED:=$$(STAMP_PREPARED)
|
|
||||||
STAMP_CONFIGURED:=$$(STAMP_CONFIGURED)
|
|
||||||
|
|
||||||
$(if $(QUILT),$(Build/Quilt))
|
$(if $(QUILT),$(Build/Quilt))
|
||||||
$(call Build/Autoclean)
|
$(call Build/Autoclean)
|
||||||
$(call DefaultTargets)
|
|
||||||
|
|
||||||
download:
|
download:
|
||||||
$(foreach hook,$(Hooks/Download),
|
$(foreach hook,$(Hooks/Download),
|
||||||
@@ -166,7 +153,6 @@ define Build/CoreTargets
|
|||||||
$(STAMP_PREPARED): $(STAMP_PREPARED_DEPENDS)
|
$(STAMP_PREPARED): $(STAMP_PREPARED_DEPENDS)
|
||||||
@-rm -rf $(PKG_BUILD_DIR)
|
@-rm -rf $(PKG_BUILD_DIR)
|
||||||
@mkdir -p $(PKG_BUILD_DIR)
|
@mkdir -p $(PKG_BUILD_DIR)
|
||||||
touch $$@_check
|
|
||||||
$(foreach hook,$(Hooks/Prepare/Pre),$(call $(hook))$(sep))
|
$(foreach hook,$(Hooks/Prepare/Pre),$(call $(hook))$(sep))
|
||||||
$(Build/Prepare)
|
$(Build/Prepare)
|
||||||
$(foreach hook,$(Hooks/Prepare/Post),$(call $(hook))$(sep))
|
$(foreach hook,$(Hooks/Prepare/Post),$(call $(hook))$(sep))
|
||||||
@@ -174,17 +160,15 @@ define Build/CoreTargets
|
|||||||
|
|
||||||
$(call Build/Exports,$(STAMP_CONFIGURED))
|
$(call Build/Exports,$(STAMP_CONFIGURED))
|
||||||
$(STAMP_CONFIGURED): $(STAMP_PREPARED) $(STAMP_CONFIGURED_DEPENDS)
|
$(STAMP_CONFIGURED): $(STAMP_PREPARED) $(STAMP_CONFIGURED_DEPENDS)
|
||||||
rm -f $(STAMP_CONFIGURED_WILDCARD)
|
|
||||||
$(CleanStaging)
|
$(CleanStaging)
|
||||||
$(foreach hook,$(Hooks/Configure/Pre),$(call $(hook))$(sep))
|
$(foreach hook,$(Hooks/Configure/Pre),$(call $(hook))$(sep))
|
||||||
$(Build/Configure)
|
$(Build/Configure)
|
||||||
$(foreach hook,$(Hooks/Configure/Post),$(call $(hook))$(sep))
|
$(foreach hook,$(Hooks/Configure/Post),$(call $(hook))$(sep))
|
||||||
|
rm -f $(STAMP_CONFIGURED_WILDCARD)
|
||||||
touch $$@
|
touch $$@
|
||||||
|
|
||||||
$(call Build/Exports,$(STAMP_BUILT))
|
$(call Build/Exports,$(STAMP_BUILT))
|
||||||
$(STAMP_BUILT): $(STAMP_CONFIGURED) $(STAMP_BUILT_DEPENDS)
|
$(STAMP_BUILT): $(STAMP_CONFIGURED) $(STAMP_BUILT_DEPENDS)
|
||||||
rm -f $$@
|
|
||||||
touch $$@_check
|
|
||||||
$(foreach hook,$(Hooks/Compile/Pre),$(call $(hook))$(sep))
|
$(foreach hook,$(Hooks/Compile/Pre),$(call $(hook))$(sep))
|
||||||
$(Build/Compile)
|
$(Build/Compile)
|
||||||
$(foreach hook,$(Hooks/Compile/Post),$(call $(hook))$(sep))
|
$(foreach hook,$(Hooks/Compile/Post),$(call $(hook))$(sep))
|
||||||
@@ -219,20 +203,13 @@ define Build/CoreTargets
|
|||||||
touch $$@
|
touch $$@
|
||||||
|
|
||||||
ifdef Build/InstallDev
|
ifdef Build/InstallDev
|
||||||
$(_pkg_target)compile: $(STAMP_INSTALLED)
|
compile: $(STAMP_INSTALLED)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
$(_pkg_target)prepare: $(STAMP_PREPARED)
|
prepare: $(STAMP_PREPARED)
|
||||||
$(_pkg_target)configure: $(STAMP_CONFIGURED)
|
configure: $(STAMP_CONFIGURED)
|
||||||
$(_pkg_target)dist: $(STAMP_CONFIGURED)
|
dist: $(STAMP_CONFIGURED)
|
||||||
$(_pkg_target)distcheck: $(STAMP_CONFIGURED)
|
distcheck: $(STAMP_CONFIGURED)
|
||||||
|
|
||||||
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' | \
|
|
||||||
$(XARGS) rm -rf
|
|
||||||
endif
|
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Build/DefaultTargets
|
define Build/DefaultTargets
|
||||||
@@ -243,7 +220,14 @@ define Build/DefaultTargets
|
|||||||
endef
|
endef
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
define Build/IncludeOverlay
|
||||||
|
$(eval -include $(wildcard $(TOPDIR)/overlay/*/$(PKG_DIR_NAME).mk))
|
||||||
|
define Build/IncludeOverlay
|
||||||
|
endef
|
||||||
|
endef
|
||||||
|
|
||||||
define BuildPackage
|
define BuildPackage
|
||||||
|
$(Build/IncludeOverlay)
|
||||||
$(eval $(Package/Default))
|
$(eval $(Package/Default))
|
||||||
$(eval $(Package/$(1)))
|
$(eval $(Package/$(1)))
|
||||||
|
|
||||||
@@ -297,26 +281,25 @@ Build/DistCheck=$(call Build/DistCheck/Default,)
|
|||||||
.PHONY: prepare-package-install
|
.PHONY: prepare-package-install
|
||||||
prepare-package-install:
|
prepare-package-install:
|
||||||
@mkdir -p $(PKG_INFO_DIR)
|
@mkdir -p $(PKG_INFO_DIR)
|
||||||
@rm -f $(PKG_INSTALL_STAMP)
|
@touch $(PKG_INSTALL_STAMP).clean
|
||||||
@echo "$(filter-out essential nonshared,$(PKG_FLAGS))" > $(PKG_INSTALL_STAMP).flags
|
@echo "$(filter-out essential nonshared,$(PKG_FLAGS))" > $(PKG_INSTALL_STAMP).flags
|
||||||
|
|
||||||
$(PACKAGE_DIR):
|
$(PACKAGE_DIR):
|
||||||
mkdir -p $@
|
mkdir -p $@
|
||||||
|
|
||||||
compile:
|
dumpinfo:
|
||||||
.install: .compile
|
download:
|
||||||
|
prepare:
|
||||||
|
configure:
|
||||||
|
compile: prepare-package-install
|
||||||
install: compile
|
install: compile
|
||||||
|
|
||||||
force-clean-build: FORCE
|
clean: FORCE
|
||||||
rm -rf $(PKG_BUILD_DIR)
|
|
||||||
|
|
||||||
clean-build: $(if $(wildcard $(PKG_BUILD_DIR)/.autoremove),force-clean-build)
|
|
||||||
|
|
||||||
clean: force-clean-build
|
|
||||||
$(CleanStaging)
|
$(CleanStaging)
|
||||||
$(call Build/UninstallDev,$(STAGING_DIR),$(STAGING_DIR_HOST))
|
$(call Build/UninstallDev,$(STAGING_DIR),$(STAGING_DIR_HOST))
|
||||||
$(Build/Clean)
|
$(Build/Clean)
|
||||||
rm -f $(STAGING_DIR)/packages/$(STAGING_FILES_LIST) $(STAGING_DIR_HOST)/packages/$(STAGING_FILES_LIST)
|
rm -f $(STAGING_DIR)/packages/$(STAGING_FILES_LIST) $(STAGING_DIR_HOST)/packages/$(STAGING_FILES_LIST)
|
||||||
|
rm -rf $(PKG_BUILD_DIR)
|
||||||
|
|
||||||
dist:
|
dist:
|
||||||
$(Build/Dist)
|
$(Build/Dist)
|
||||||
|
|||||||
@@ -7,6 +7,8 @@
|
|||||||
|
|
||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
include $(INCLUDE_DIR)/prereq.mk
|
include $(INCLUDE_DIR)/prereq.mk
|
||||||
|
include $(INCLUDE_DIR)/host.mk
|
||||||
|
include $(INCLUDE_DIR)/host-build.mk
|
||||||
|
|
||||||
SHELL:=sh
|
SHELL:=sh
|
||||||
PKG_NAME:=Build dependency
|
PKG_NAME:=Build dependency
|
||||||
@@ -18,49 +20,41 @@ $(eval $(call TestHostCommand,working-make, \
|
|||||||
$(MAKE) -v | grep -E 'Make (3\.8[1-9]|3\.9[0-9]|[4-9]\.)'))
|
$(MAKE) -v | grep -E 'Make (3\.8[1-9]|3\.9[0-9]|[4-9]\.)'))
|
||||||
|
|
||||||
$(eval $(call TestHostCommand,case-sensitive-fs, \
|
$(eval $(call TestHostCommand,case-sensitive-fs, \
|
||||||
OpenWrt can only be built on a case-sensitive filesystem, \
|
LEDE can only be built on a case-sensitive filesystem, \
|
||||||
rm -f $(TMP_DIR)/test.*; touch $(TMP_DIR)/test.fs; \
|
rm -f $(TMP_DIR)/test.*; touch $(TMP_DIR)/test.fs; \
|
||||||
test ! -f $(TMP_DIR)/test.FS))
|
test ! -f $(TMP_DIR)/test.FS))
|
||||||
|
|
||||||
$(eval $(call TestHostCommand,proper-umask, \
|
$(eval $(call TestHostCommand,proper-umask, \
|
||||||
Please build with umask 022 - other values produce broken packages, \
|
Please build with umask 022 - other values produce broken packages, \
|
||||||
umask | grep -xE 0?0[012][012]))
|
umask | grep -xE 00[012][012]))
|
||||||
|
|
||||||
$(eval $(call SetupHostCommand,gcc, \
|
$(eval $(call SetupHostCommand,gcc, \
|
||||||
Please install the GNU C Compiler (gcc) 4.8 or later, \
|
Please install the GNU C Compiler (gcc), \
|
||||||
$(CC) -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?)', \
|
$(CC) --version | grep gcc, \
|
||||||
gcc -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?)', \
|
gcc --version | grep gcc, \
|
||||||
gcc48 --version | grep gcc, \
|
|
||||||
gcc49 --version | grep gcc, \
|
gcc49 --version | grep gcc, \
|
||||||
gcc5 --version | grep gcc, \
|
gcc48 --version | grep gcc, \
|
||||||
gcc6 --version | grep gcc, \
|
gcc47 --version | grep gcc, \
|
||||||
gcc7 --version | grep gcc, \
|
gcc46 --version | grep gcc, \
|
||||||
gcc8 --version | grep gcc, \
|
|
||||||
gcc9 --version | grep gcc, \
|
|
||||||
gcc --version | grep Apple.LLVM ))
|
gcc --version | grep Apple.LLVM ))
|
||||||
|
|
||||||
$(eval $(call TestHostCommand,working-gcc, \
|
$(eval $(call TestHostCommand,working-gcc, \
|
||||||
\nPlease reinstall the GNU C Compiler (4.8 or later) - \
|
Please reinstall the GNU C Compiler - it appears to be broken, \
|
||||||
it appears to be broken, \
|
|
||||||
echo 'int main(int argc, char **argv) { return 0; }' | \
|
echo 'int main(int argc, char **argv) { return 0; }' | \
|
||||||
gcc -x c -o $(TMP_DIR)/a.out -))
|
gcc -x c -o $(TMP_DIR)/a.out -))
|
||||||
|
|
||||||
$(eval $(call SetupHostCommand,g++, \
|
$(eval $(call SetupHostCommand,g++, \
|
||||||
Please install the GNU C++ Compiler (g++) 4.8 or later, \
|
Please install the GNU C++ Compiler (g++), \
|
||||||
$(CXX) -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?)', \
|
$(CXX) --version | grep g++, \
|
||||||
g++ -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?)', \
|
g++ --version | grep g++, \
|
||||||
g++48 --version | grep g++, \
|
|
||||||
g++49 --version | grep g++, \
|
g++49 --version | grep g++, \
|
||||||
g++5 --version | grep g++, \
|
g++48 --version | grep g++, \
|
||||||
g++6 --version | grep g++, \
|
g++47 --version | grep g++, \
|
||||||
g++7 --version | grep g++, \
|
g++46 --version | grep g++, \
|
||||||
g++8 --version | grep g++, \
|
|
||||||
g++9 --version | grep g++, \
|
|
||||||
g++ --version | grep Apple.LLVM ))
|
g++ --version | grep Apple.LLVM ))
|
||||||
|
|
||||||
$(eval $(call TestHostCommand,working-g++, \
|
$(eval $(call TestHostCommand,working-g++, \
|
||||||
\nPlease reinstall the GNU C++ Compiler (4.8 or later) - \
|
Please reinstall the GNU C++ Compiler - it appears to be broken, \
|
||||||
it appears to be broken, \
|
|
||||||
echo 'int main(int argc, char **argv) { return 0; }' | \
|
echo 'int main(int argc, char **argv) { return 0; }' | \
|
||||||
g++ -x c++ -o $(TMP_DIR)/a.out - -lstdc++ && \
|
g++ -x c++ -o $(TMP_DIR)/a.out - -lstdc++ && \
|
||||||
$(TMP_DIR)/a.out))
|
$(TMP_DIR)/a.out))
|
||||||
@@ -76,6 +70,11 @@ else
|
|||||||
zlib_link_flags := -lz
|
zlib_link_flags := -lz
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
$(eval $(call TestHostCommand,zlib, \
|
||||||
|
Please install a static zlib. (Missing libz.a or zlib.h), \
|
||||||
|
echo 'int main(int argc, char **argv) { gzdopen(0, "rb"); return 0; }' | \
|
||||||
|
gcc -include zlib.h -x c -o $(TMP_DIR)/a.out - $(zlib_link_flags)))
|
||||||
|
|
||||||
$(eval $(call TestHostCommand,perl-thread-queue, \
|
$(eval $(call TestHostCommand,perl-thread-queue, \
|
||||||
Please install the Perl Thread::Queue module, \
|
Please install the Perl Thread::Queue module, \
|
||||||
perl -MThread::Queue -e 1))
|
perl -MThread::Queue -e 1))
|
||||||
@@ -124,9 +123,9 @@ $(eval $(call SetupHostCommand,getopt, \
|
|||||||
getopt -o t --long test -- --test | grep '^ *--test *--'))
|
getopt -o t --long test -- --test | grep '^ *--test *--'))
|
||||||
|
|
||||||
$(eval $(call SetupHostCommand,stat,Cannot find a file stat utility, \
|
$(eval $(call SetupHostCommand,stat,Cannot find a file stat utility, \
|
||||||
gnustat -c%s $(TOPDIR)/Makefile, \
|
gnustat -c%s $(TMP_DIR)/.host.mk, \
|
||||||
gstat -c%s $(TOPDIR)/Makefile, \
|
gstat -c%s $(TMP_DIR)/.host.mk, \
|
||||||
stat -c%s $(TOPDIR)/Makefile))
|
stat -c%s $(TMP_DIR)/.host.mk))
|
||||||
|
|
||||||
$(eval $(call SetupHostCommand,unzip,Please install 'unzip', \
|
$(eval $(call SetupHostCommand,unzip,Please install 'unzip', \
|
||||||
unzip 2>&1 | grep zipfile, \
|
unzip 2>&1 | grep zipfile, \
|
||||||
|
|||||||
@@ -90,8 +90,7 @@ define SetupHostCommand
|
|||||||
for cmd in $(call QuoteHostCommand,$(3)) $(call QuoteHostCommand,$(4)) \
|
for cmd in $(call QuoteHostCommand,$(3)) $(call QuoteHostCommand,$(4)) \
|
||||||
$(call QuoteHostCommand,$(5)) $(call QuoteHostCommand,$(6)) \
|
$(call QuoteHostCommand,$(5)) $(call QuoteHostCommand,$(6)) \
|
||||||
$(call QuoteHostCommand,$(7)) $(call QuoteHostCommand,$(8)) \
|
$(call QuoteHostCommand,$(7)) $(call QuoteHostCommand,$(8)) \
|
||||||
$(call QuoteHostCommand,$(9)) $(call QuoteHostCommand,$(10)) \
|
$(call QuoteHostCommand,$(9)); do \
|
||||||
$(call QuoteHostCommand,$(11)) $(call QuoteHostCommand,$(12)); do \
|
|
||||||
if [ -n "$$$$$$$$cmd" ]; then \
|
if [ -n "$$$$$$$$cmd" ]; then \
|
||||||
bin="$$$$$$$$(PATH="$(subst $(space),:,$(filter-out $(STAGING_DIR_HOST)/%,$(subst :,$(space),$(PATH))))" \
|
bin="$$$$$$$$(PATH="$(subst $(space),:,$(filter-out $(STAGING_DIR_HOST)/%,$(subst :,$(space),$(PATH))))" \
|
||||||
which "$$$$$$$${cmd%% *}")"; \
|
which "$$$$$$$${cmd%% *}")"; \
|
||||||
|
|||||||
@@ -4,43 +4,22 @@
|
|||||||
# This is free software, licensed under the GNU General Public License v2.
|
# This is free software, licensed under the GNU General Public License v2.
|
||||||
# See /LICENSE for more information.
|
# See /LICENSE for more information.
|
||||||
|
|
||||||
ifeq ($(TARGET_BUILD),1)
|
|
||||||
PKG_BUILD_DIR:=$(LINUX_DIR)
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifneq ($(filter host-refresh refresh,$(MAKECMDGOALS)),)
|
|
||||||
override QUILT=1
|
|
||||||
override HOST_QUILT=1
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifneq ($(PKG_BUILD_DIR),)
|
|
||||||
QUILT?=$(if $(wildcard $(PKG_BUILD_DIR)/.quilt_used),y)
|
|
||||||
ifneq ($(QUILT),)
|
|
||||||
STAMP_CHECKED:=$(PKG_BUILD_DIR)/.quilt_checked
|
|
||||||
override CONFIG_AUTOREBUILD=
|
|
||||||
override CONFIG_AUTOREMOVE=
|
|
||||||
quilt-check: $(STAMP_CHECKED)
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifneq ($(HOST_BUILD_DIR),)
|
|
||||||
HOST_QUILT?=$(if $(findstring command,$(origin QUILT)),$(QUILT),$(if $(wildcard $(HOST_BUILD_DIR)/.quilt_used),y))
|
|
||||||
ifneq ($(HOST_QUILT),)
|
|
||||||
HOST_STAMP_CHECKED:=$(HOST_BUILD_DIR)/.quilt_checked
|
|
||||||
override CONFIG_AUTOREBUILD=
|
|
||||||
override CONFIG_AUTOREMOVE=
|
|
||||||
host-quilt-check: $(HOST_STAMP_CHECKED)
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifneq ($(if $(DUMP),1,$(__quilt_inc)),1)
|
ifneq ($(if $(DUMP),1,$(__quilt_inc)),1)
|
||||||
__quilt_inc:=1
|
__quilt_inc:=1
|
||||||
|
|
||||||
|
ifeq ($(TARGET_BUILD),1)
|
||||||
|
PKG_BUILD_DIR:=$(LINUX_DIR)
|
||||||
|
endif
|
||||||
PATCH_DIR?=./patches
|
PATCH_DIR?=./patches
|
||||||
FILES_DIR?=./files
|
FILES_DIR?=./files
|
||||||
HOST_PATCH_DIR?=$(PATCH_DIR)
|
HOST_PATCH_DIR?=$(PATCH_DIR)
|
||||||
HOST_FILES_DIR?=$(FILES_DIR)
|
HOST_FILES_DIR?=$(FILES_DIR)
|
||||||
|
|
||||||
|
ifeq ($(MAKECMDGOALS),refresh)
|
||||||
|
override QUILT=1
|
||||||
|
override HOST_QUILT=1
|
||||||
|
endif
|
||||||
|
|
||||||
QUILT_CMD:=quilt --quiltrc=-
|
QUILT_CMD:=quilt --quiltrc=-
|
||||||
|
|
||||||
define filter_series
|
define filter_series
|
||||||
@@ -80,6 +59,24 @@ define HostPatchDir
|
|||||||
$(call PatchDir/$(if $(strip $(HOST_QUILT)),Quilt,Default),$(strip $(1)),$(strip $(2)),$(strip $(3)))
|
$(call PatchDir/$(if $(strip $(HOST_QUILT)),Quilt,Default),$(strip $(1)),$(strip $(2)),$(strip $(3)))
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
ifneq ($(PKG_BUILD_DIR),)
|
||||||
|
QUILT?=$(if $(wildcard $(PKG_BUILD_DIR)/.quilt_used),y)
|
||||||
|
ifneq ($(QUILT),)
|
||||||
|
STAMP_CHECKED:=$(PKG_BUILD_DIR)/.quilt_checked
|
||||||
|
override CONFIG_AUTOREBUILD=
|
||||||
|
quilt-check: $(STAMP_CHECKED)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifneq ($(HOST_BUILD_DIR),)
|
||||||
|
HOST_QUILT?=$(if $(findstring command,$(origin QUILT)),$(QUILT),$(if $(wildcard $(HOST_BUILD_DIR)/.quilt_used),y))
|
||||||
|
ifneq ($(HOST_QUILT),)
|
||||||
|
HOST_STAMP_CHECKED:=$(HOST_BUILD_DIR)/.quilt_checked
|
||||||
|
override CONFIG_AUTOREBUILD=
|
||||||
|
host-quilt-check: $(HOST_STAMP_CHECKED)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
define Host/Patch/Default
|
define Host/Patch/Default
|
||||||
$(if $(HOST_QUILT),rm -rf $(HOST_BUILD_DIR)/patches; mkdir -p $(HOST_BUILD_DIR)/patches)
|
$(if $(HOST_QUILT),rm -rf $(HOST_BUILD_DIR)/patches; mkdir -p $(HOST_BUILD_DIR)/patches)
|
||||||
$(call HostPatchDir,$(HOST_BUILD_DIR),$(HOST_PATCH_DIR),)
|
$(call HostPatchDir,$(HOST_BUILD_DIR),$(HOST_PATCH_DIR),)
|
||||||
@@ -97,13 +94,7 @@ define Kernel/Patch/Default
|
|||||||
$(if $(QUILT),rm -rf $(PKG_BUILD_DIR)/patches; mkdir -p $(PKG_BUILD_DIR)/patches)
|
$(if $(QUILT),rm -rf $(PKG_BUILD_DIR)/patches; mkdir -p $(PKG_BUILD_DIR)/patches)
|
||||||
$(if $(kernel_files),$(CP) $(kernel_files) $(LINUX_DIR)/)
|
$(if $(kernel_files),$(CP) $(kernel_files) $(LINUX_DIR)/)
|
||||||
find $(LINUX_DIR)/ -name \*.rej -or -name \*.orig | $(XARGS) rm -f
|
find $(LINUX_DIR)/ -name \*.rej -or -name \*.orig | $(XARGS) rm -f
|
||||||
if [ -d $(GENERIC_PLATFORM_DIR)/patches$(if $(wildcard $(GENERIC_PLATFORM_DIR)/patches-$(KERNEL_PATCHVER)),-$(KERNEL_PATCHVER)) ]; then \
|
|
||||||
echo "generic patches directory is present. please move your patches to the pending directory" ; \
|
|
||||||
exit 1; \
|
|
||||||
fi
|
|
||||||
$(call PatchDir,$(PKG_BUILD_DIR),$(GENERIC_BACKPORT_DIR),generic-backport/)
|
|
||||||
$(call PatchDir,$(PKG_BUILD_DIR),$(GENERIC_PATCH_DIR),generic/)
|
$(call PatchDir,$(PKG_BUILD_DIR),$(GENERIC_PATCH_DIR),generic/)
|
||||||
$(call PatchDir,$(PKG_BUILD_DIR),$(GENERIC_HACK_DIR),generic-hack/)
|
|
||||||
$(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR),platform/)
|
$(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR),platform/)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
@@ -130,9 +121,7 @@ define Quilt/Refresh/Kernel
|
|||||||
echo "All kernel patches must start with either generic/ or platform/"; \
|
echo "All kernel patches must start with either generic/ or platform/"; \
|
||||||
false; \
|
false; \
|
||||||
}
|
}
|
||||||
$(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(GENERIC_BACKPORT_DIR),generic-backport/)
|
|
||||||
$(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(GENERIC_PATCH_DIR),generic/)
|
$(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(GENERIC_PATCH_DIR),generic/)
|
||||||
$(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(GENERIC_HACK_DIR),generic-hack/)
|
|
||||||
$(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(PATCH_DIR),platform/)
|
$(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(PATCH_DIR),platform/)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
include $(INCLUDE_DIR)/feeds.mk
|
||||||
|
|
||||||
ifdef CONFIG_USE_MKLIBS
|
ifdef CONFIG_USE_MKLIBS
|
||||||
define mklibs
|
define mklibs
|
||||||
rm -rf $(TMP_DIR)/mklibs-progs $(TMP_DIR)/mklibs-out
|
rm -rf $(TMP_DIR)/mklibs-progs $(TMP_DIR)/mklibs-out
|
||||||
@@ -47,25 +49,17 @@ TARGET_DIR_ORIG := $(TARGET_ROOTFS_DIR)/root.orig-$(BOARD)
|
|||||||
|
|
||||||
ifdef CONFIG_CLEAN_IPKG
|
ifdef CONFIG_CLEAN_IPKG
|
||||||
define clean_ipkg
|
define clean_ipkg
|
||||||
-find $(1)/usr/lib/opkg/info -type f -and -not -name '*.control' | $(XARGS) rm -rf
|
-find $(1)/usr/lib/opkg -type f -and -not -name '*.control' | $(XARGS) rm -rf
|
||||||
-sed -i -ne '/^Require-User: /p' $(1)/usr/lib/opkg/info/*.control
|
-sed -i -ne '/^Require-User: /p' $(1)/usr/lib/opkg/info/*.control
|
||||||
awk ' \
|
|
||||||
BEGIN { conffiles = 0; print "Conffiles:" } \
|
|
||||||
/^Conffiles:/ { conffiles = 1; next } \
|
|
||||||
!/^ / { conffiles = 0; next } \
|
|
||||||
conffiles == 1 { print } \
|
|
||||||
' $(1)/usr/lib/opkg/status >$(1)/usr/lib/opkg/status.new
|
|
||||||
mv $(1)/usr/lib/opkg/status.new $(1)/usr/lib/opkg/status
|
|
||||||
-find $(1)/usr/lib/opkg -empty | $(XARGS) rm -rf
|
-find $(1)/usr/lib/opkg -empty | $(XARGS) rm -rf
|
||||||
endef
|
endef
|
||||||
endif
|
endif
|
||||||
|
|
||||||
define prepare_rootfs
|
define prepare_rootfs
|
||||||
$(if $(2),@if [ -d '$(2)' ]; then \
|
@if [ -d $(TOPDIR)/files ]; then \
|
||||||
$(call file_copy,$(2)/.,$(1)); \
|
$(call file_copy,$(TOPDIR)/files/.,$(1)); \
|
||||||
fi)
|
fi
|
||||||
@mkdir -p $(1)/etc/rc.d
|
@mkdir -p $(1)/etc/rc.d
|
||||||
@mkdir -p $(1)/var/lock
|
|
||||||
@( \
|
@( \
|
||||||
cd $(1); \
|
cd $(1); \
|
||||||
for script in ./usr/lib/opkg/info/*.postinst; do \
|
for script in ./usr/lib/opkg/info/*.postinst; do \
|
||||||
@@ -86,11 +80,9 @@ define prepare_rootfs
|
|||||||
@-find $(1) -name .svn | $(XARGS) rm -rf
|
@-find $(1) -name .svn | $(XARGS) rm -rf
|
||||||
@-find $(1) -name .git | $(XARGS) rm -rf
|
@-find $(1) -name .git | $(XARGS) rm -rf
|
||||||
@-find $(1) -name '.#*' | $(XARGS) rm -f
|
@-find $(1) -name '.#*' | $(XARGS) rm -f
|
||||||
rm -rf $(1)/tmp/*
|
|
||||||
rm -f $(1)/usr/lib/opkg/lists/*
|
rm -f $(1)/usr/lib/opkg/lists/*
|
||||||
rm -f $(1)/usr/lib/opkg/info/*.postinst*
|
rm -f $(1)/usr/lib/opkg/info/*.postinst*
|
||||||
rm -f $(1)/var/lock/*.lock
|
rm -f $(1)/usr/lib/opkg/info/*.prerm*
|
||||||
rm -rf $(1)/boot
|
|
||||||
$(call clean_ipkg,$(1))
|
$(call clean_ipkg,$(1))
|
||||||
$(call mklibs,$(1))
|
$(call mklibs,$(1))
|
||||||
endef
|
endef
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ TMP_DIR:=$(TOPDIR)/tmp
|
|||||||
|
|
||||||
all: $(TMP_DIR)/.$(SCAN_TARGET)
|
all: $(TMP_DIR)/.$(SCAN_TARGET)
|
||||||
|
|
||||||
|
include $(TOPDIR)/include/host.mk
|
||||||
|
|
||||||
SCAN_TARGET ?= packageinfo
|
SCAN_TARGET ?= packageinfo
|
||||||
SCAN_NAME ?= package
|
SCAN_NAME ?= package
|
||||||
SCAN_DIR ?= package
|
SCAN_DIR ?= package
|
||||||
@@ -10,14 +12,6 @@ TARGET_STAMP:=$(TMP_DIR)/info/.files-$(SCAN_TARGET).stamp
|
|||||||
FILELIST:=$(TMP_DIR)/info/.files-$(SCAN_TARGET)-$(SCAN_COOKIE)
|
FILELIST:=$(TMP_DIR)/info/.files-$(SCAN_TARGET)-$(SCAN_COOKIE)
|
||||||
OVERRIDELIST:=$(TMP_DIR)/info/.overrides-$(SCAN_TARGET)-$(SCAN_COOKIE)
|
OVERRIDELIST:=$(TMP_DIR)/info/.overrides-$(SCAN_TARGET)-$(SCAN_COOKIE)
|
||||||
|
|
||||||
export PATH:=$(TOPDIR)/staging_dir/host/bin:$(PATH)
|
|
||||||
|
|
||||||
ifeq ($(SCAN_NAME),target)
|
|
||||||
SCAN_DEPS=image/Makefile profiles/*.mk $(TOPDIR)/include/kernel*.mk $(TOPDIR)/include/target.mk image/*.mk
|
|
||||||
else
|
|
||||||
SCAN_DEPS=$(TOPDIR)/include/package*.mk
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(IS_TTY),1)
|
ifeq ($(IS_TTY),1)
|
||||||
define progress
|
define progress
|
||||||
printf "\033[M\r$(1)" >&2;
|
printf "\033[M\r$(1)" >&2;
|
||||||
@@ -62,7 +56,7 @@ endif
|
|||||||
|
|
||||||
$(FILELIST): $(OVERRIDELIST)
|
$(FILELIST): $(OVERRIDELIST)
|
||||||
rm -f $(TMP_DIR)/info/.files-$(SCAN_TARGET)-*
|
rm -f $(TMP_DIR)/info/.files-$(SCAN_TARGET)-*
|
||||||
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 > $@
|
$(call 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)
|
$(TMP_DIR)/info/.files-$(SCAN_TARGET).mk: $(FILELIST)
|
||||||
( \
|
( \
|
||||||
|
|||||||
@@ -1,2 +0,0 @@
|
|||||||
ac_cv_func_futimens=no
|
|
||||||
ac_cv_func_utimensat=no
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
. $TOPDIR/include/site/linux
|
|
||||||
ac_cv_c_littleendian=${ac_cv_c_littleendian=no}
|
|
||||||
ac_cv_c_bigendian=${ac_cv_c_bigendian=yes}
|
|
||||||
|
|
||||||
ac_cv_sizeof_char=1
|
|
||||||
ac_cv_sizeof_char_p=8
|
|
||||||
ac_cv_sizeof_double=8
|
|
||||||
ac_cv_sizeof_float=4
|
|
||||||
ac_cv_sizeof_int=4
|
|
||||||
ac_cv_sizeof_long=8
|
|
||||||
ac_cv_sizeof_long_double=16
|
|
||||||
ac_cv_sizeof_long_int=8
|
|
||||||
ac_cv_sizeof_long_long=8
|
|
||||||
ac_cv_sizeof_long_long_int=8
|
|
||||||
ac_cv_sizeof_short=2
|
|
||||||
ac_cv_sizeof_short_int=2
|
|
||||||
ac_cv_sizeof_signed_char=1
|
|
||||||
ac_cv_sizeof_unsigned_char=1
|
|
||||||
ac_cv_sizeof_unsigned_int=4
|
|
||||||
ac_cv_sizeof_unsigned_long=8
|
|
||||||
ac_cv_sizeof_unsigned_long_int=8
|
|
||||||
ac_cv_sizeof_unsigned_long_long_int=8
|
|
||||||
ac_cv_sizeof_unsigned_short=2
|
|
||||||
ac_cv_sizeof_unsigned_short_int=2
|
|
||||||
ac_cv_sizeof_void_p=8
|
|
||||||
@@ -9,7 +9,7 @@ ifeq ($(MAKECMDGOALS),prereq)
|
|||||||
SUBTARGETS:=prereq
|
SUBTARGETS:=prereq
|
||||||
PREREQ_ONLY:=1
|
PREREQ_ONLY:=1
|
||||||
else
|
else
|
||||||
SUBTARGETS:=$(DEFAULT_SUBDIR_TARGETS)
|
SUBTARGETS:=clean download prepare compile install update refresh prereq dist distcheck configure check
|
||||||
endif
|
endif
|
||||||
|
|
||||||
subtarget-default = $(filter-out ., \
|
subtarget-default = $(filter-out ., \
|
||||||
@@ -29,11 +29,6 @@ endef
|
|||||||
lastdir=$(word $(words $(subst /, ,$(1))),$(subst /, ,$(1)))
|
lastdir=$(word $(words $(subst /, ,$(1))),$(subst /, ,$(1)))
|
||||||
diralias=$(if $(findstring $(1),$(call lastdir,$(1))),,$(call lastdir,$(1)))
|
diralias=$(if $(findstring $(1),$(call lastdir,$(1))),,$(call lastdir,$(1)))
|
||||||
|
|
||||||
subdir_make_opts = \
|
|
||||||
-r -C $(1) \
|
|
||||||
BUILD_SUBDIR="$(1)" \
|
|
||||||
BUILD_VARIANT="$(4)"
|
|
||||||
|
|
||||||
# 1: subdir
|
# 1: subdir
|
||||||
# 2: target
|
# 2: target
|
||||||
# 3: build type
|
# 3: build type
|
||||||
@@ -43,36 +38,26 @@ log_make = \
|
|||||||
$(if $(BUILD_LOG), \
|
$(if $(BUILD_LOG), \
|
||||||
set -o pipefail; \
|
set -o pipefail; \
|
||||||
mkdir -p $(BUILD_LOG_DIR)/$(1)$(if $(4),/$(4));) \
|
mkdir -p $(BUILD_LOG_DIR)/$(1)$(if $(4),/$(4));) \
|
||||||
$(SCRIPT_DIR)/time.pl "time: $(1)$(if $(4),/$(4))/$(if $(3),$(3)-)$(2)" \
|
$$(SUBMAKE) -r -C $(1) $(if $(3),$(3)-)$(2) \
|
||||||
$$(SUBMAKE) $(subdir_make_opts) $(if $(3),$(3)-)$(2) \
|
BUILD_SUBDIR="$(1)" \
|
||||||
|
BUILD_VARIANT="$(4)" \
|
||||||
$(if $(BUILD_LOG),SILENT= 2>&1 | tee $(BUILD_LOG_DIR)/$(1)$(if $(4),/$(4))/$(if $(3),$(3)-)$(2).txt)
|
$(if $(BUILD_LOG),SILENT= 2>&1 | tee $(BUILD_LOG_DIR)/$(1)$(if $(4),/$(4))/$(if $(3),$(3)-)$(2).txt)
|
||||||
|
|
||||||
ifdef CONFIG_AUTOREMOVE
|
|
||||||
rebuild_check = \
|
|
||||||
@-$$(NO_TRACE_MAKE) $(subdir_make_opts) check-depends >/dev/null 2>/dev/null; \
|
|
||||||
$(if $(BUILD_LOG),mkdir -p $(BUILD_LOG_DIR)/$(1)$(if $(4),/$(4));) \
|
|
||||||
$$(NO_TRACE_MAKE) $(if $(BUILD_LOG),-d) -q $(subdir_make_opts) .$(if $(3),$(3)-)$(2) \
|
|
||||||
> $(if $(BUILD_LOG),$(BUILD_LOG_DIR)/$(1)$(if $(4),/$(4))/check-$(if $(3),$(3)-)$(2).txt,/dev/null) 2>&1 || \
|
|
||||||
$$(SUBMAKE) $(subdir_make_opts) clean-build >/dev/null 2>/dev/null
|
|
||||||
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Parameters: <subdir>
|
# Parameters: <subdir>
|
||||||
define subdir
|
define subdir
|
||||||
$(call warn,$(1),d,D $(1))
|
$(call warn,$(1),d,D $(1))
|
||||||
$(foreach bd,$($(1)/builddirs),
|
$(foreach bd,$($(1)/builddirs),
|
||||||
$(call warn,$(1),d,BD $(1)/$(bd))
|
$(call warn,$(1),d,BD $(1)/$(bd))
|
||||||
$(foreach target,$(SUBTARGETS) $($(1)/subtargets),
|
$(foreach target,$(SUBTARGETS),
|
||||||
$(foreach btype,$(buildtypes-$(bd)),
|
$(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 warn_eval,$(1)/$(bd),t,T,$(1)/$(bd)/$(btype)/$(target): $(if $(QUILT),,$($(1)/$(bd)/$(btype)/$(target)) $(call $(1)//$(btype)/$(target),$(1)/$(bd)/$(btype))))
|
||||||
$(call log_make,$(1)/$(bd),$(target),$(btype),$(filter-out __default,$(variant))) \
|
$(call log_make,$(1)/$(bd),$(target),$(btype),$(filter-out __default,$(variant))) \
|
||||||
$(if $(findstring $(bd),$($(1)/builddirs-ignore-$(btype)-$(target))), || $(call ERROR,$(1), ERROR: $(1)/$(bd) [$(btype)] failed to build.))
|
$(if $(findstring $(bd),$($(1)/builddirs-ignore-$(btype)-$(target))), || $(call ERROR,$(1), ERROR: $(1)/$(bd) [$(btype)] failed to build.))
|
||||||
$(if $(call diralias,$(bd)),$(call warn_eval,$(1)/$(bd),l,T,$(1)/$(call diralias,$(bd))/$(btype)/$(target): $(1)/$(bd)/$(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))))
|
$(call warn_eval,$(1)/$(bd),t,T,$(1)/$(bd)/$(target): $(if $(QUILT),,$($(1)/$(bd)/$(target)) $(call $(1)//$(target),$(1)/$(bd))))
|
||||||
$(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))),
|
$(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 $(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))))
|
|
||||||
$(call log_make,$(1)/$(bd),$(target),,$(filter-out __default,$(variant))) \
|
$(call log_make,$(1)/$(bd),$(target),,$(filter-out __default,$(variant))) \
|
||||||
$(if $(findstring $(bd),$($(1)/builddirs-ignore-$(target))), || $(call ERROR,$(1), ERROR: $(1)/$(bd) failed to build$(if $(filter-out __default,$(variant)), (build variant: $(variant))).))
|
$(if $(findstring $(bd),$($(1)/builddirs-ignore-$(target))), || $(call ERROR,$(1), ERROR: $(1)/$(bd) failed to build$(if $(filter-out __default,$(variant)), (build variant: $(variant))).))
|
||||||
)
|
)
|
||||||
@@ -82,7 +67,7 @@ define subdir
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
$(foreach target,$(SUBTARGETS) $($(1)/subtargets),$(call subtarget,$(1),$(target)))
|
$(foreach target,$(SUBTARGETS),$(call subtarget,$(1),$(target)))
|
||||||
endef
|
endef
|
||||||
|
|
||||||
ifndef DUMP_TARGET_DB
|
ifndef DUMP_TARGET_DB
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ DEFAULT_PACKAGES:=base-files libc libgcc busybox dropbear mtd uci opkg netifd fs
|
|||||||
# For nas targets
|
# For nas targets
|
||||||
DEFAULT_PACKAGES.nas:=block-mount fdisk lsblk mdadm
|
DEFAULT_PACKAGES.nas:=block-mount fdisk lsblk mdadm
|
||||||
# For router targets
|
# For router targets
|
||||||
DEFAULT_PACKAGES.router:=dnsmasq iptables ip6tables ppp ppp-mod-pppoe firewall odhcpd-ipv6only odhcp6c kmod-ipt-offload
|
DEFAULT_PACKAGES.router:=dnsmasq iptables ip6tables ppp ppp-mod-pppoe firewall odhcpd odhcp6c
|
||||||
DEFAULT_PACKAGES.bootloader:=
|
DEFAULT_PACKAGES.bootloader:=
|
||||||
|
|
||||||
ifneq ($(DUMP),)
|
ifneq ($(DUMP),)
|
||||||
@@ -51,10 +51,6 @@ else
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq ($(filter 4.9,$(KERNEL_PATCHVER)),)
|
|
||||||
DEFAULT_PACKAGES.router:=$(filter-out kmod-ipt-offload,$(DEFAULT_PACKAGES.router))
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Add device specific packages (here below to allow device type set from subtarget)
|
# Add device specific packages (here below to allow device type set from subtarget)
|
||||||
DEFAULT_PACKAGES += $(DEFAULT_PACKAGES.$(DEVICE_TYPE))
|
DEFAULT_PACKAGES += $(DEFAULT_PACKAGES.$(DEVICE_TYPE))
|
||||||
|
|
||||||
@@ -72,7 +68,6 @@ define Profile
|
|||||||
$(eval $(call ProfileDefault))
|
$(eval $(call ProfileDefault))
|
||||||
$(eval $(call Profile/$(1)))
|
$(eval $(call Profile/$(1)))
|
||||||
dumpinfo : $(call shexport,Profile/$(1)/Description)
|
dumpinfo : $(call shexport,Profile/$(1)/Description)
|
||||||
PACKAGES := $(filter-out -%,$(PACKAGES))
|
|
||||||
DUMPINFO += \
|
DUMPINFO += \
|
||||||
echo "Target-Profile: $(1)"; \
|
echo "Target-Profile: $(1)"; \
|
||||||
$(if $(PRIORITY), echo "Target-Profile-Priority: $(PRIORITY)"; ) \
|
$(if $(PRIORITY), echo "Target-Profile-Priority: $(PRIORITY)"; ) \
|
||||||
@@ -109,9 +104,7 @@ ifneq ($(TARGET_BUILD)$(if $(DUMP),,1),)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
GENERIC_PLATFORM_DIR := $(TOPDIR)/target/linux/generic
|
GENERIC_PLATFORM_DIR := $(TOPDIR)/target/linux/generic
|
||||||
GENERIC_BACKPORT_DIR := $(GENERIC_PLATFORM_DIR)/backport$(if $(wildcard $(GENERIC_PLATFORM_DIR)/backport-$(KERNEL_PATCHVER)),-$(KERNEL_PATCHVER))
|
GENERIC_PATCH_DIR := $(GENERIC_PLATFORM_DIR)/patches$(if $(wildcard $(GENERIC_PLATFORM_DIR)/patches-$(KERNEL_PATCHVER)),-$(KERNEL_PATCHVER))
|
||||||
GENERIC_PATCH_DIR := $(GENERIC_PLATFORM_DIR)/pending$(if $(wildcard $(GENERIC_PLATFORM_DIR)/pending-$(KERNEL_PATCHVER)),-$(KERNEL_PATCHVER))
|
|
||||||
GENERIC_HACK_DIR := $(GENERIC_PLATFORM_DIR)/hack$(if $(wildcard $(GENERIC_PLATFORM_DIR)/hack-$(KERNEL_PATCHVER)),-$(KERNEL_PATCHVER))
|
|
||||||
GENERIC_FILES_DIR := $(foreach dir,$(wildcard $(GENERIC_PLATFORM_DIR)/files $(GENERIC_PLATFORM_DIR)/files-$(KERNEL_PATCHVER)),"$(dir)")
|
GENERIC_FILES_DIR := $(foreach dir,$(wildcard $(GENERIC_PLATFORM_DIR)/files $(GENERIC_PLATFORM_DIR)/files-$(KERNEL_PATCHVER)),"$(dir)")
|
||||||
|
|
||||||
__config_name_list = $(1)/config-$(KERNEL_PATCHVER) $(1)/config-default
|
__config_name_list = $(1)/config-$(KERNEL_PATCHVER) $(1)/config-default
|
||||||
@@ -193,7 +186,6 @@ ifeq ($(DUMP),1)
|
|||||||
CPU_CFLAGS_cortex-a9 = -mcpu=cortex-a9
|
CPU_CFLAGS_cortex-a9 = -mcpu=cortex-a9
|
||||||
CPU_CFLAGS_cortex-a15 = -mcpu=cortex-a15
|
CPU_CFLAGS_cortex-a15 = -mcpu=cortex-a15
|
||||||
CPU_CFLAGS_cortex-a53 = -mcpu=cortex-a53
|
CPU_CFLAGS_cortex-a53 = -mcpu=cortex-a53
|
||||||
CPU_CFLAGS_cortex-a72 = -mcpu=cortex-a72
|
|
||||||
CPU_CFLAGS_fa526 = -mcpu=fa526
|
CPU_CFLAGS_fa526 = -mcpu=fa526
|
||||||
CPU_CFLAGS_mpcore = -mcpu=mpcore
|
CPU_CFLAGS_mpcore = -mcpu=mpcore
|
||||||
CPU_CFLAGS_xscale = -mcpu=xscale
|
CPU_CFLAGS_xscale = -mcpu=xscale
|
||||||
@@ -211,29 +203,20 @@ ifeq ($(DUMP),1)
|
|||||||
CPU_CFLAGS_440:=-mcpu=440
|
CPU_CFLAGS_440:=-mcpu=440
|
||||||
CPU_CFLAGS_464fp:=-mcpu=464fp
|
CPU_CFLAGS_464fp:=-mcpu=464fp
|
||||||
endif
|
endif
|
||||||
ifeq ($(ARCH),powerpc64)
|
|
||||||
CPU_TYPE ?= powerpc64
|
|
||||||
CPU_CFLAGS_powerpc64:=-mcpu=powerpc64
|
|
||||||
endif
|
|
||||||
ifeq ($(ARCH),sparc)
|
ifeq ($(ARCH),sparc)
|
||||||
CPU_TYPE = sparc
|
CPU_TYPE = sparc
|
||||||
CPU_CFLAGS_ultrasparc = -mcpu=ultrasparc
|
CPU_CFLAGS_ultrasparc = -mcpu=ultrasparc
|
||||||
endif
|
endif
|
||||||
ifeq ($(ARCH),aarch64)
|
ifeq ($(ARCH),aarch64)
|
||||||
CPU_TYPE ?= generic
|
CPU_TYPE ?= armv8-a
|
||||||
CPU_CFLAGS_generic = -mcpu=generic
|
CPU_CFLAGS_armv8-a = -mcpu=armv8-a
|
||||||
CPU_CFLAGS_cortex-a53 = -mcpu=cortex-a53
|
CPU_CFLAGS_cortex-a53 = -mcpu=cortex-a53
|
||||||
endif
|
endif
|
||||||
ifeq ($(ARCH),arc)
|
ifeq ($(ARCH),arc)
|
||||||
CPU_TYPE ?= arc700
|
CPU_TYPE ?= arc700
|
||||||
CPU_CFLAGS += -matomic
|
CPU_CFLAGS += -matomic
|
||||||
CPU_CFLAGS_arc700 = -mcpu=arc700
|
CPU_CFLAGS_arc700 = -marc700
|
||||||
CPU_CFLAGS_archs = -mcpu=archs
|
CPU_CFLAGS_archs = -marchs
|
||||||
endif
|
|
||||||
ifneq ($(CPU_TYPE),)
|
|
||||||
ifndef CPU_CFLAGS_$(CPU_TYPE)
|
|
||||||
$(warning CPU_TYPE "$(CPU_TYPE)" doesn't correspond to a known type)
|
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
DEFAULT_CFLAGS=$(strip $(CPU_CFLAGS) $(CPU_CFLAGS_$(CPU_TYPE)) $(CPU_CFLAGS_$(CPU_SUBTYPE)))
|
DEFAULT_CFLAGS=$(strip $(CPU_CFLAGS) $(CPU_CFLAGS_$(CPU_TYPE)) $(CPU_CFLAGS_$(CPU_SUBTYPE)))
|
||||||
|
|
||||||
|
|||||||
@@ -6,9 +6,9 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
override CONFIG_AUTOREBUILD=
|
override CONFIG_AUTOREBUILD=
|
||||||
override CONFIG_AUTOREMOVE=
|
|
||||||
|
|
||||||
HOST_BUILD_PREFIX:=$(TOOLCHAIN_DIR)
|
REAL_STAGING_DIR_HOST:=$(STAGING_DIR_HOST)
|
||||||
|
STAGING_DIR_HOST:=$(TOOLCHAIN_DIR)
|
||||||
BUILD_DIR_HOST:=$(BUILD_DIR_TOOLCHAIN)
|
BUILD_DIR_HOST:=$(BUILD_DIR_TOOLCHAIN)
|
||||||
|
|
||||||
include $(INCLUDE_DIR)/host-build.mk
|
include $(INCLUDE_DIR)/host-build.mk
|
||||||
|
|||||||
@@ -23,11 +23,7 @@ HOSTCC ?= $(CC)
|
|||||||
export REVISION
|
export REVISION
|
||||||
export SOURCE_DATE_EPOCH
|
export SOURCE_DATE_EPOCH
|
||||||
export GIT_CONFIG_PARAMETERS='core.autocrlf=false'
|
export GIT_CONFIG_PARAMETERS='core.autocrlf=false'
|
||||||
export GIT_ASKPASS:=/bin/true
|
|
||||||
export MAKE_JOBSERVER=$(filter --jobserver%,$(MAKEFLAGS))
|
export MAKE_JOBSERVER=$(filter --jobserver%,$(MAKEFLAGS))
|
||||||
export GNU_HOST_NAME:=$(shell $(TOPDIR)/scripts/config.guess)
|
|
||||||
export HOST_OS:=$(shell uname)
|
|
||||||
export HOST_ARCH:=$(shell uname -m)
|
|
||||||
|
|
||||||
# prevent perforce from messing with the patch utility
|
# prevent perforce from messing with the patch utility
|
||||||
unexport P4PORT P4USER P4CONFIG P4CLIENT
|
unexport P4PORT P4USER P4CONFIG P4CLIENT
|
||||||
@@ -82,8 +78,8 @@ _ignore = $(foreach p,$(IGNORE_PACKAGES),--ignore $(p))
|
|||||||
prepare-tmpinfo: FORCE
|
prepare-tmpinfo: FORCE
|
||||||
@+$(MAKE) -r -s staging_dir/host/.prereq-build $(PREP_MK)
|
@+$(MAKE) -r -s staging_dir/host/.prereq-build $(PREP_MK)
|
||||||
mkdir -p tmp/info
|
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="packageinfo" SCAN_DIR="package" SCAN_NAME="package" SCAN_DEPS="$(TOPDIR)/include/package*.mk $(TOPDIR)/overlay/*/*.mk" 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=2 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_DEPS="image/Makefile profiles/*.mk $(TOPDIR)/include/kernel*.mk $(TOPDIR)/include/target.mk" SCAN_DEPTH=2 SCAN_EXTRA="" SCAN_MAKEOPTS="TARGET_BUILD=1"
|
||||||
for type in package target; do \
|
for type in package target; do \
|
||||||
f=tmp/.$${type}info; t=tmp/.config-$${type}.in; \
|
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; }; \
|
[ "$$t" -nt "$$f" ] || ./scripts/$${type}-metadata.pl $(_ignore) config "$$f" > "$$t" || { rm -f "$$t"; echo "Failed to build $$t"; false; break; }; \
|
||||||
@@ -104,15 +100,11 @@ scripts/config/mconf:
|
|||||||
|
|
||||||
$(eval $(call rdep,scripts/config,scripts/config/mconf))
|
$(eval $(call rdep,scripts/config,scripts/config/mconf))
|
||||||
|
|
||||||
scripts/config/qconf:
|
|
||||||
@$(_SINGLE)$(SUBMAKE) -s -C scripts/config qconf CC="$(HOSTCC_WRAPPER)"
|
|
||||||
|
|
||||||
scripts/config/conf:
|
scripts/config/conf:
|
||||||
@$(_SINGLE)$(SUBMAKE) -s -C scripts/config conf CC="$(HOSTCC_WRAPPER)"
|
@$(_SINGLE)$(SUBMAKE) -s -C scripts/config conf CC="$(HOSTCC_WRAPPER)"
|
||||||
|
|
||||||
config: scripts/config/conf prepare-tmpinfo FORCE
|
config: scripts/config/conf prepare-tmpinfo FORCE
|
||||||
[ -L .config ] && export KCONFIG_OVERWRITECONFIG=1; \
|
$< Config.in
|
||||||
$< Config.in
|
|
||||||
|
|
||||||
config-clean: FORCE
|
config-clean: FORCE
|
||||||
$(_SINGLE)$(NO_TRACE_MAKE) -C scripts/config clean
|
$(_SINGLE)$(NO_TRACE_MAKE) -C scripts/config clean
|
||||||
@@ -120,8 +112,7 @@ config-clean: FORCE
|
|||||||
defconfig: scripts/config/conf prepare-tmpinfo FORCE
|
defconfig: scripts/config/conf prepare-tmpinfo FORCE
|
||||||
touch .config
|
touch .config
|
||||||
@if [ ! -s .config -a -e $(HOME)/.openwrt/defconfig ]; then cp $(HOME)/.openwrt/defconfig .config; fi
|
@if [ ! -s .config -a -e $(HOME)/.openwrt/defconfig ]; then cp $(HOME)/.openwrt/defconfig .config; fi
|
||||||
[ -L .config ] && export KCONFIG_OVERWRITECONFIG=1; \
|
$< --defconfig=.config Config.in
|
||||||
$< --defconfig=.config Config.in
|
|
||||||
|
|
||||||
confdefault-y=allyes
|
confdefault-y=allyes
|
||||||
confdefault-m=allmod
|
confdefault-m=allmod
|
||||||
@@ -129,17 +120,9 @@ confdefault-n=allno
|
|||||||
confdefault:=$(confdefault-$(CONFDEFAULT))
|
confdefault:=$(confdefault-$(CONFDEFAULT))
|
||||||
|
|
||||||
oldconfig: scripts/config/conf prepare-tmpinfo FORCE
|
oldconfig: scripts/config/conf prepare-tmpinfo FORCE
|
||||||
[ -L .config ] && export KCONFIG_OVERWRITECONFIG=1; \
|
$< --$(if $(confdefault),$(confdefault),old)config Config.in
|
||||||
$< --$(if $(confdefault),$(confdefault),old)config Config.in
|
|
||||||
|
|
||||||
menuconfig: scripts/config/mconf prepare-tmpinfo FORCE
|
menuconfig: scripts/config/mconf prepare-tmpinfo FORCE
|
||||||
if [ \! -e .config -a -e $(HOME)/.openwrt/defconfig ]; then \
|
|
||||||
cp $(HOME)/.openwrt/defconfig .config; \
|
|
||||||
fi
|
|
||||||
[ -L .config ] && export KCONFIG_OVERWRITECONFIG=1; \
|
|
||||||
$< Config.in
|
|
||||||
|
|
||||||
xconfig: scripts/config/qconf prepare-tmpinfo FORCE
|
|
||||||
if [ \! -e .config -a -e $(HOME)/.openwrt/defconfig ]; then \
|
if [ \! -e .config -a -e $(HOME)/.openwrt/defconfig ]; then \
|
||||||
cp $(HOME)/.openwrt/defconfig .config; \
|
cp $(HOME)/.openwrt/defconfig .config; \
|
||||||
fi
|
fi
|
||||||
@@ -149,7 +132,7 @@ prepare_kernel_conf: .config FORCE
|
|||||||
|
|
||||||
ifeq ($(wildcard staging_dir/host/bin/quilt),)
|
ifeq ($(wildcard staging_dir/host/bin/quilt),)
|
||||||
prepare_kernel_conf:
|
prepare_kernel_conf:
|
||||||
@+$(SUBMAKE) -r tools/quilt/compile
|
@+$(SUBMAKE) -r tools/quilt/install
|
||||||
else
|
else
|
||||||
prepare_kernel_conf: ;
|
prepare_kernel_conf: ;
|
||||||
endif
|
endif
|
||||||
@@ -165,6 +148,7 @@ kernel_nconfig: prepare_kernel_conf
|
|||||||
|
|
||||||
staging_dir/host/.prereq-build: include/prereq-build.mk
|
staging_dir/host/.prereq-build: include/prereq-build.mk
|
||||||
mkdir -p tmp
|
mkdir -p tmp
|
||||||
|
rm -f tmp/.host.mk
|
||||||
@$(_SINGLE)$(NO_TRACE_MAKE) -j1 -r -s -f $(TOPDIR)/include/prereq-build.mk prereq 2>/dev/null || { \
|
@$(_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."; \
|
echo "Prerequisite check failed. Use FORCE=1 to override."; \
|
||||||
false; \
|
false; \
|
||||||
@@ -186,7 +170,7 @@ else
|
|||||||
DOWNLOAD_DIRS = package/download
|
DOWNLOAD_DIRS = package/download
|
||||||
endif
|
endif
|
||||||
|
|
||||||
download: .config FORCE $(if $(wildcard $(TOPDIR)/staging_dir/host/bin/flock),,tools/flock/compile)
|
download: .config FORCE
|
||||||
@+$(foreach dir,$(DOWNLOAD_DIRS),$(SUBMAKE) $(dir);)
|
@+$(foreach dir,$(DOWNLOAD_DIRS),$(SUBMAKE) $(dir);)
|
||||||
|
|
||||||
clean dirclean: .config
|
clean dirclean: .config
|
||||||
@@ -198,9 +182,6 @@ prereq:: prepare-tmpinfo .config
|
|||||||
check: .config FORCE
|
check: .config FORCE
|
||||||
@+$(NO_TRACE_MAKE) -r -s $@ QUIET= V=s
|
@+$(NO_TRACE_MAKE) -r -s $@ QUIET= V=s
|
||||||
|
|
||||||
val.%: FORCE
|
|
||||||
@+$(NO_TRACE_MAKE) -r -s $@ QUIET= V=s
|
|
||||||
|
|
||||||
WARN_PARALLEL_ERROR = $(if $(BUILD_LOG),,$(and $(filter -j,$(MAKEFLAGS)),$(findstring s,$(OPENWRT_VERBOSE))))
|
WARN_PARALLEL_ERROR = $(if $(BUILD_LOG),,$(and $(filter -j,$(MAKEFLAGS)),$(findstring s,$(OPENWRT_VERBOSE))))
|
||||||
|
|
||||||
ifeq ($(SDK),1)
|
ifeq ($(SDK),1)
|
||||||
|
|||||||
@@ -1,104 +0,0 @@
|
|||||||
PKG_NAME ?= u-boot
|
|
||||||
|
|
||||||
ifndef PKG_SOURCE_PROTO
|
|
||||||
PKG_SOURCE = $(PKG_NAME)-$(PKG_VERSION).tar.bz2
|
|
||||||
PKG_SOURCE_URL = \
|
|
||||||
http://sources.lede-project.org \
|
|
||||||
ftp://ftp.denx.de/pub/u-boot
|
|
||||||
endif
|
|
||||||
|
|
||||||
PKG_BUILD_DIR = $(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
|
|
||||||
|
|
||||||
PKG_TARGETS := bin
|
|
||||||
PKG_FLAGS:=nonshared
|
|
||||||
|
|
||||||
PKG_LICENSE:=GPL-2.0 GPL-2.0+
|
|
||||||
PKG_LICENSE_FILES:=Licenses/README
|
|
||||||
|
|
||||||
PKG_BUILD_PARALLEL:=1
|
|
||||||
|
|
||||||
export GCC_HONOUR_COPTS=s
|
|
||||||
|
|
||||||
define Package/u-boot/install/default
|
|
||||||
$(CP) $(patsubst %,$(PKG_BUILD_DIR)/%,$(UBOOT_IMAGE)) $(1)/
|
|
||||||
endef
|
|
||||||
|
|
||||||
Package/u-boot/install = $(Package/u-boot/install/default)
|
|
||||||
|
|
||||||
define U-Boot/Init
|
|
||||||
BUILD_TARGET:=
|
|
||||||
BUILD_SUBTARGET:=
|
|
||||||
BUILD_DEVICES:=
|
|
||||||
NAME:=
|
|
||||||
DEPENDS:=
|
|
||||||
HIDDEN:=
|
|
||||||
DEFAULT:=
|
|
||||||
VARIANT:=$(1)
|
|
||||||
UBOOT_CONFIG:=$(1)
|
|
||||||
UBOOT_IMAGE:=u-boot.bin
|
|
||||||
endef
|
|
||||||
|
|
||||||
TARGET_DEP = TARGET_$(BUILD_TARGET)$(if $(BUILD_SUBTARGET),_$(BUILD_SUBTARGET))
|
|
||||||
|
|
||||||
UBOOT_MAKE_FLAGS = \
|
|
||||||
HOSTCC="$(HOSTCC)" \
|
|
||||||
HOSTCFLAGS="$(HOST_CFLAGS) $(HOST_CPPFLAGS)" \
|
|
||||||
HOSTLDFLAGS="$(HOST_LDFLAGS)"
|
|
||||||
|
|
||||||
define Build/U-Boot/Target
|
|
||||||
$(eval $(call U-Boot/Init,$(1)))
|
|
||||||
$(eval $(call U-Boot/Default,$(1)))
|
|
||||||
$(eval $(call U-Boot/$(1),$(1)))
|
|
||||||
|
|
||||||
define Package/u-boot-$(1)
|
|
||||||
SECTION:=boot
|
|
||||||
CATEGORY:=Boot Loaders
|
|
||||||
TITLE:=U-Boot 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:=http://www.denx.de/wiki/U-Boot
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Package/u-boot-$(1)/install
|
|
||||||
$$(Package/u-boot/install)
|
|
||||||
endef
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Build/Configure/U-Boot
|
|
||||||
+$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) $(UBOOT_CONFIGURE_VARS) $(UBOOT_CONFIG)_config
|
|
||||||
endef
|
|
||||||
|
|
||||||
DTC=$(wildcard $(LINUX_DIR)/scripts/dtc/dtc)
|
|
||||||
|
|
||||||
define Build/Compile/U-Boot
|
|
||||||
+$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
|
|
||||||
CROSS_COMPILE=$(TARGET_CROSS) \
|
|
||||||
$(if $(DTC),DTC="$(DTC)") \
|
|
||||||
$(UBOOT_MAKE_FLAGS)
|
|
||||||
endef
|
|
||||||
|
|
||||||
define BuildPackage/U-Boot/Defaults
|
|
||||||
Build/Configure/Default = $$$$(Build/Configure/U-Boot)
|
|
||||||
Build/Compile/Default = $$$$(Build/Compile/U-Boot)
|
|
||||||
endef
|
|
||||||
|
|
||||||
define BuildPackage/U-Boot
|
|
||||||
$(eval $(call BuildPackage/U-Boot/Defaults))
|
|
||||||
$(foreach type,$(if $(DUMP),$(UBOOT_TARGETS),$(BUILD_VARIANT)), \
|
|
||||||
$(eval $(call Build/U-Boot/Target,$(type)))
|
|
||||||
)
|
|
||||||
$(eval $(call Build/DefaultTargets))
|
|
||||||
$(foreach type,$(if $(DUMP),$(UBOOT_TARGETS),$(BUILD_VARIANT)), \
|
|
||||||
$(call BuildPackage,u-boot-$(type))
|
|
||||||
)
|
|
||||||
endef
|
|
||||||
@@ -54,7 +54,7 @@ ifeq ($(findstring s,$(OPENWRT_VERBOSE)),)
|
|||||||
else
|
else
|
||||||
SILENT:=>/dev/null $(if $(findstring w,$(OPENWRT_VERBOSE)),,2>&1)
|
SILENT:=>/dev/null $(if $(findstring w,$(OPENWRT_VERBOSE)),,2>&1)
|
||||||
export QUIET:=1
|
export QUIET:=1
|
||||||
SUBMAKE=cmd() { $(SILENT) $(MAKE) -s "$$@" < /dev/null || { echo "make $$*: build failed. Please re-run make with -j1 V=s or V=sc for a higher verbosity level to see what's going on"; false; } } 8>&1 9>&2; cmd
|
SUBMAKE=cmd() { $(SILENT) $(MAKE) -s $$* < /dev/null || { echo "make $$*: build failed. Please re-run make with -j1 V=s to see what's going on"; false; } } 8>&1 9>&2; cmd
|
||||||
endif
|
endif
|
||||||
|
|
||||||
.SILENT: $(MAKECMDGOALS)
|
.SILENT: $(MAKECMDGOALS)
|
||||||
|
|||||||
@@ -10,11 +10,13 @@
|
|||||||
# REVISION:=x
|
# REVISION:=x
|
||||||
# SOURCE_DATE_EPOCH:=x
|
# SOURCE_DATE_EPOCH:=x
|
||||||
|
|
||||||
|
RELEASE:=Reboot
|
||||||
|
|
||||||
PKG_CONFIG_DEPENDS += \
|
PKG_CONFIG_DEPENDS += \
|
||||||
CONFIG_VERSION_HOME_URL \
|
|
||||||
CONFIG_VERSION_BUG_URL \
|
CONFIG_VERSION_BUG_URL \
|
||||||
CONFIG_VERSION_NUMBER \
|
CONFIG_VERSION_NUMBER \
|
||||||
CONFIG_VERSION_CODE \
|
CONFIG_VERSION_CODE \
|
||||||
|
CONFIG_VERSION_NICK \
|
||||||
CONFIG_VERSION_REPO \
|
CONFIG_VERSION_REPO \
|
||||||
CONFIG_VERSION_DIST \
|
CONFIG_VERSION_DIST \
|
||||||
CONFIG_VERSION_MANUFACTURER \
|
CONFIG_VERSION_MANUFACTURER \
|
||||||
@@ -23,40 +25,43 @@ PKG_CONFIG_DEPENDS += \
|
|||||||
CONFIG_VERSION_SUPPORT_URL \
|
CONFIG_VERSION_SUPPORT_URL \
|
||||||
CONFIG_VERSION_HWREV \
|
CONFIG_VERSION_HWREV \
|
||||||
|
|
||||||
|
qstrip_escape=$(subst ','\'',$(call qstrip,$(1)))
|
||||||
|
#'
|
||||||
|
|
||||||
sanitize = $(call tolower,$(subst _,-,$(subst $(space),-,$(1))))
|
sanitize = $(call tolower,$(subst _,-,$(subst $(space),-,$(1))))
|
||||||
|
|
||||||
VERSION_NUMBER:=$(call qstrip,$(CONFIG_VERSION_NUMBER))
|
VERSION_NUMBER:=$(call qstrip_escape,$(CONFIG_VERSION_NUMBER))
|
||||||
VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),18.06.2)
|
VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),17.01.1)
|
||||||
|
|
||||||
VERSION_CODE:=$(call qstrip,$(CONFIG_VERSION_CODE))
|
VERSION_CODE:=$(call qstrip_escape,$(CONFIG_VERSION_CODE))
|
||||||
VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),r7676-cddd7b4c77)
|
VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),r3316-7eb58cf109)
|
||||||
|
|
||||||
VERSION_REPO:=$(call qstrip,$(CONFIG_VERSION_REPO))
|
VERSION_NICK:=$(call qstrip_escape,$(CONFIG_VERSION_NICK))
|
||||||
VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),http://downloads.openwrt.org/releases/18.06.2)
|
VERSION_NICK:=$(if $(VERSION_NICK),$(VERSION_NICK),$(RELEASE))
|
||||||
|
|
||||||
VERSION_DIST:=$(call qstrip,$(CONFIG_VERSION_DIST))
|
VERSION_REPO:=$(call qstrip_escape,$(CONFIG_VERSION_REPO))
|
||||||
VERSION_DIST:=$(if $(VERSION_DIST),$(VERSION_DIST),OpenWrt)
|
VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),http://downloads.lede-project.org/releases/17.01.1)
|
||||||
|
|
||||||
|
VERSION_DIST:=$(call qstrip_escape,$(CONFIG_VERSION_DIST))
|
||||||
|
VERSION_DIST:=$(if $(VERSION_DIST),$(VERSION_DIST),LEDE)
|
||||||
VERSION_DIST_SANITIZED:=$(call sanitize,$(VERSION_DIST))
|
VERSION_DIST_SANITIZED:=$(call sanitize,$(VERSION_DIST))
|
||||||
|
|
||||||
VERSION_MANUFACTURER:=$(call qstrip,$(CONFIG_VERSION_MANUFACTURER))
|
VERSION_MANUFACTURER:=$(call qstrip_escape,$(CONFIG_VERSION_MANUFACTURER))
|
||||||
VERSION_MANUFACTURER:=$(if $(VERSION_MANUFACTURER),$(VERSION_MANUFACTURER),OpenWrt)
|
VERSION_MANUFACTURER:=$(if $(VERSION_MANUFACTURER),$(VERSION_MANUFACTURER),LEDE)
|
||||||
|
|
||||||
VERSION_MANUFACTURER_URL:=$(call qstrip,$(CONFIG_VERSION_MANUFACTURER_URL))
|
VERSION_MANUFACTURER_URL:=$(call qstrip_escape,$(CONFIG_VERSION_MANUFACTURER_URL))
|
||||||
VERSION_MANUFACTURER_URL:=$(if $(VERSION_MANUFACTURER_URL),$(VERSION_MANUFACTURER_URL),http://openwrt.org/)
|
VERSION_MANUFACTURER_URL:=$(if $(VERSION_MANUFACTURER_URL),$(VERSION_MANUFACTURER_URL),http://lede-project.org/)
|
||||||
|
|
||||||
VERSION_BUG_URL:=$(call qstrip,$(CONFIG_VERSION_BUG_URL))
|
VERSION_BUG_URL:=$(call qstrip_escape,$(CONFIG_VERSION_BUG_URL))
|
||||||
VERSION_BUG_URL:=$(if $(VERSION_BUG_URL),$(VERSION_BUG_URL),http://bugs.openwrt.org/)
|
VERSION_BUG_URL:=$(if $(VERSION_BUG_URL),$(VERSION_BUG_URL),http://bugs.lede-project.org/)
|
||||||
|
|
||||||
VERSION_HOME_URL:=$(call qstrip,$(CONFIG_VERSION_HOME_URL))
|
VERSION_SUPPORT_URL:=$(call qstrip_escape,$(CONFIG_VERSION_SUPPORT_URL))
|
||||||
VERSION_HOME_URL:=$(if $(VERSION_HOME_URL),$(VERSION_HOME_URL),http://openwrt.org/)
|
|
||||||
|
|
||||||
VERSION_SUPPORT_URL:=$(call qstrip,$(CONFIG_VERSION_SUPPORT_URL))
|
|
||||||
VERSION_SUPPORT_URL:=$(if $(VERSION_SUPPORT_URL),$(VERSION_SUPPORT_URL),http://forum.lede-project.org/)
|
VERSION_SUPPORT_URL:=$(if $(VERSION_SUPPORT_URL),$(VERSION_SUPPORT_URL),http://forum.lede-project.org/)
|
||||||
|
|
||||||
VERSION_PRODUCT:=$(call qstrip,$(CONFIG_VERSION_PRODUCT))
|
VERSION_PRODUCT:=$(call qstrip_escape,$(CONFIG_VERSION_PRODUCT))
|
||||||
VERSION_PRODUCT:=$(if $(VERSION_PRODUCT),$(VERSION_PRODUCT),Generic)
|
VERSION_PRODUCT:=$(if $(VERSION_PRODUCT),$(VERSION_PRODUCT),Generic)
|
||||||
|
|
||||||
VERSION_HWREV:=$(call qstrip,$(CONFIG_VERSION_HWREV))
|
VERSION_HWREV:=$(call qstrip_escape,$(CONFIG_VERSION_HWREV))
|
||||||
VERSION_HWREV:=$(if $(VERSION_HWREV),$(VERSION_HWREV),v0)
|
VERSION_HWREV:=$(if $(VERSION_HWREV),$(VERSION_HWREV),v0)
|
||||||
|
|
||||||
define taint2sym
|
define taint2sym
|
||||||
@@ -83,29 +88,25 @@ VERSION_TAINTS := $(strip $(foreach taint,$(VERSION_TAINT_SPECS), \
|
|||||||
|
|
||||||
PKG_CONFIG_DEPENDS += $(foreach taint,$(VERSION_TAINT_SPECS),$(call taint2sym,$(taint)))
|
PKG_CONFIG_DEPENDS += $(foreach taint,$(VERSION_TAINT_SPECS),$(call taint2sym,$(taint)))
|
||||||
|
|
||||||
# escape commas, backslashes, squotes, and ampersands for sed
|
VERSION_SED:=$(SED) 's,%U,$(VERSION_REPO),g' \
|
||||||
define sed_escape
|
-e 's,%V,$(VERSION_NUMBER),g' \
|
||||||
$(subst &,\&,$(subst $(comma),\$(comma),$(subst ','\'',$(subst \,\\,$(1)))))
|
-e 's,%v,\L$(subst $(space),_,$(VERSION_NUMBER)),g' \
|
||||||
endef
|
-e 's,%C,$(VERSION_CODE),g' \
|
||||||
#'
|
-e 's,%c,\L$(subst $(space),_,$(VERSION_CODE)),g' \
|
||||||
|
-e 's,%N,$(VERSION_NICK),g' \
|
||||||
VERSION_SED_SCRIPT:=$(SED) 's,%U,$(call sed_escape,$(VERSION_REPO)),g' \
|
-e 's,%n,\L$(subst $(space),_,$(VERSION_NICK)),g' \
|
||||||
-e 's,%V,$(call sed_escape,$(VERSION_NUMBER)),g' \
|
-e 's,%D,$(VERSION_DIST),g' \
|
||||||
-e 's,%v,\L$(call sed_escape,$(subst $(space),_,$(VERSION_NUMBER))),g' \
|
-e 's,%d,\L$(subst $(space),_,$(VERSION_DIST)),g' \
|
||||||
-e 's,%C,$(call sed_escape,$(VERSION_CODE)),g' \
|
-e 's,%R,$(REVISION),g' \
|
||||||
-e 's,%c,\L$(call sed_escape,$(subst $(space),_,$(VERSION_CODE))),g' \
|
-e 's,%T,$(BOARD),g' \
|
||||||
-e 's,%D,$(call sed_escape,$(VERSION_DIST)),g' \
|
-e 's,%S,$(BOARD)/$(if $(SUBTARGET),$(SUBTARGET),generic),g' \
|
||||||
-e 's,%d,\L$(call sed_escape,$(subst $(space),_,$(VERSION_DIST))),g' \
|
-e 's,%A,$(ARCH_PACKAGES),g' \
|
||||||
-e 's,%R,$(call sed_escape,$(REVISION)),g' \
|
-e 's,%t,$(VERSION_TAINTS),g' \
|
||||||
-e 's,%T,$(call sed_escape,$(BOARD)),g' \
|
-e 's,%M,$(VERSION_MANUFACTURER),g' \
|
||||||
-e 's,%S,$(call sed_escape,$(BOARD)/$(if $(SUBTARGET),$(SUBTARGET),generic)),g' \
|
-e 's,%m,$(VERSION_MANUFACTURER_URL),g' \
|
||||||
-e 's,%A,$(call sed_escape,$(ARCH_PACKAGES)),g' \
|
-e 's,%b,$(VERSION_BUG_URL),g' \
|
||||||
-e 's,%t,$(call sed_escape,$(VERSION_TAINTS)),g' \
|
-e 's,%s,$(VERSION_SUPPORT_URL),g' \
|
||||||
-e 's,%M,$(call sed_escape,$(VERSION_MANUFACTURER)),g' \
|
-e 's,%P,$(VERSION_PRODUCT),g' \
|
||||||
-e 's,%m,$(call sed_escape,$(VERSION_MANUFACTURER_URL)),g' \
|
-e 's,%h,$(VERSION_HWREV),g'
|
||||||
-e 's,%b,$(call sed_escape,$(VERSION_BUG_URL)),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'
|
|
||||||
|
|
||||||
|
VERSION_SED_SCRIPT:=$(subst '\'','\'\\\\\'\'',$(VERSION_SED))
|
||||||
|
|||||||
@@ -7,12 +7,11 @@
|
|||||||
|
|
||||||
curdir:=package
|
curdir:=package
|
||||||
|
|
||||||
include $(INCLUDE_DIR)/feeds.mk
|
|
||||||
include $(INCLUDE_DIR)/rootfs.mk
|
include $(INCLUDE_DIR)/rootfs.mk
|
||||||
|
|
||||||
-include $(TMP_DIR)/.packagedeps
|
-include $(TMP_DIR)/.packagedeps
|
||||||
$(curdir)/autoremove:=1
|
|
||||||
$(curdir)/builddirs:=$(sort $(package-) $(package-y) $(package-m))
|
$(curdir)/builddirs:=$(sort $(package-) $(package-y) $(package-m))
|
||||||
|
$(curdir)/builddirs-install:=.
|
||||||
$(curdir)/builddirs-default:=. $(sort $(package-y) $(package-m))
|
$(curdir)/builddirs-default:=. $(sort $(package-y) $(package-m))
|
||||||
$(curdir)/builddirs-prereq:=. $(sort $(prereq-y) $(prereq-m))
|
$(curdir)/builddirs-prereq:=. $(sort $(prereq-y) $(prereq-m))
|
||||||
ifdef CHECK_ALL
|
ifdef CHECK_ALL
|
||||||
@@ -57,14 +56,10 @@ $(curdir)/merge:
|
|||||||
$(curdir)/merge-index: $(curdir)/merge
|
$(curdir)/merge-index: $(curdir)/merge
|
||||||
(cd $(PACKAGE_DIR_ALL) && $(SCRIPT_DIR)/ipkg-make-index.sh . 2>&1 > Packages; )
|
(cd $(PACKAGE_DIR_ALL) && $(SCRIPT_DIR)/ipkg-make-index.sh . 2>&1 > Packages; )
|
||||||
|
|
||||||
ifndef SDK
|
$(curdir)/install: $(TMP_DIR)/.build $(curdir)/system/opkg/host/compile $(curdir)/merge $(if $(CONFIG_TARGET_PER_DEVICE_ROOTFS),$(curdir)/merge-index)
|
||||||
$(curdir)/compile: $(curdir)/system/opkg/host/compile
|
|
||||||
endif
|
|
||||||
|
|
||||||
$(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
|
- find $(STAGING_DIR_ROOT) -type d | $(XARGS) chmod 0755
|
||||||
rm -rf $(TARGET_DIR) $(TARGET_DIR_ORIG)
|
rm -rf $(TARGET_DIR) $(TARGET_DIR_ORIG)
|
||||||
mkdir -p $(TARGET_DIR)/tmp
|
[ -d $(TARGET_DIR)/tmp ] || mkdir -p $(TARGET_DIR)/tmp
|
||||||
$(call opkg,$(TARGET_DIR)) install \
|
$(call opkg,$(TARGET_DIR)) install \
|
||||||
$(call opkg_package_files,$(shell cat $(PACKAGE_INSTALL_FILES) 2>/dev/null))
|
$(call opkg_package_files,$(shell cat $(PACKAGE_INSTALL_FILES) 2>/dev/null))
|
||||||
@for file in $(PACKAGE_INSTALL_FILES); do \
|
@for file in $(PACKAGE_INSTALL_FILES); do \
|
||||||
@@ -73,10 +68,11 @@ $(curdir)/install: $(TMP_DIR)/.build $(curdir)/merge $(if $(CONFIG_TARGET_PER_DE
|
|||||||
$(call opkg,$(TARGET_DIR)) flag $$flag `cat $$file`; \
|
$(call opkg,$(TARGET_DIR)) flag $$flag `cat $$file`; \
|
||||||
done; \
|
done; \
|
||||||
done || true
|
done || true
|
||||||
|
@-$(MAKE) package/preconfig
|
||||||
|
|
||||||
$(CP) $(TARGET_DIR) $(TARGET_DIR_ORIG)
|
$(CP) $(TARGET_DIR) $(TARGET_DIR_ORIG)
|
||||||
|
|
||||||
$(call prepare_rootfs,$(TARGET_DIR),$(TOPDIR)/files)
|
$(call prepare_rootfs,$(TARGET_DIR))
|
||||||
|
|
||||||
$(curdir)/index: FORCE
|
$(curdir)/index: FORCE
|
||||||
@echo Generating package index...
|
@echo Generating package index...
|
||||||
@@ -96,6 +92,8 @@ ifdef CONFIG_SIGNED_PACKAGES
|
|||||||
); done
|
); done
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
$(curdir)/preconfig:
|
||||||
|
|
||||||
$(curdir)/flags-install:= -j1
|
$(curdir)/flags-install:= -j1
|
||||||
|
|
||||||
$(eval $(call stampfile,$(curdir),package,prereq,.config))
|
$(eval $(call stampfile,$(curdir),package,prereq,.config))
|
||||||
|
|||||||
@@ -9,23 +9,16 @@
|
|||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
include $(INCLUDE_DIR)/kernel.mk
|
include $(INCLUDE_DIR)/kernel.mk
|
||||||
include $(INCLUDE_DIR)/version.mk
|
include $(INCLUDE_DIR)/version.mk
|
||||||
include $(INCLUDE_DIR)/feeds.mk
|
|
||||||
|
|
||||||
PKG_NAME:=base-files
|
PKG_NAME:=base-files
|
||||||
PKG_RELEASE:=194.2
|
PKG_RELEASE:=172
|
||||||
PKG_FLAGS:=nonshared
|
PKG_FLAGS:=nonshared
|
||||||
|
|
||||||
PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/
|
PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/
|
||||||
PKG_BUILD_DEPENDS:=usign/host
|
PKG_BUILD_DEPENDS:=usign/host
|
||||||
PKG_LICENSE:=GPL-2.0
|
PKG_LICENSE:=GPL-2.0
|
||||||
|
|
||||||
# Extend depends from version.mk
|
PKG_CONFIG_DEPENDS := CONFIG_SIGNED_PACKAGES CONFIG_TARGET_INIT_PATH CONFIG_TARGET_PREINIT_DISABLE_FAILSAFE
|
||||||
PKG_CONFIG_DEPENDS += \
|
|
||||||
CONFIG_SIGNED_PACKAGES CONFIG_TARGET_INIT_PATH CONFIG_TARGET_PREINIT_DISABLE_FAILSAFE \
|
|
||||||
CONFIG_NAND_SUPPORT \
|
|
||||||
CONFIG_CLEAN_IPKG \
|
|
||||||
CONFIG_PER_FEED_REPO \
|
|
||||||
$(foreach feed,$(FEEDS_AVAILABLE),CONFIG_FEED_$(feed))
|
|
||||||
|
|
||||||
include $(INCLUDE_DIR)/package.mk
|
include $(INCLUDE_DIR)/package.mk
|
||||||
|
|
||||||
@@ -37,34 +30,34 @@ endif
|
|||||||
define Package/base-files
|
define Package/base-files
|
||||||
SECTION:=base
|
SECTION:=base
|
||||||
CATEGORY:=Base system
|
CATEGORY:=Base system
|
||||||
DEPENDS:=+netifd +libc +procd +jsonfilter +SIGNED_PACKAGES:usign +SIGNED_PACKAGES:openwrt-keyring +NAND_SUPPORT:ubi-utils +fstools +fwtool
|
DEPENDS:=+netifd +libc +procd +jsonfilter +SIGNED_PACKAGES:usign +SIGNED_PACKAGES:lede-keyring +fstools +fwtool
|
||||||
TITLE:=Base filesystem for OpenWrt
|
TITLE:=Base filesystem for Lede
|
||||||
URL:=http://openwrt.org/
|
URL:=http://openwrt.org/
|
||||||
VERSION:=$(PKG_RELEASE)-$(REVISION)
|
VERSION:=$(PKG_RELEASE)-$(REVISION)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Package/base-files/conffiles
|
define Package/base-files/conffiles
|
||||||
/etc/config/
|
|
||||||
/etc/config/network
|
/etc/config/network
|
||||||
/etc/config/system
|
/etc/config/system
|
||||||
/etc/crontabs/
|
|
||||||
/etc/dropbear/
|
|
||||||
/etc/ethers
|
|
||||||
/etc/group
|
|
||||||
/etc/hosts
|
/etc/hosts
|
||||||
/etc/inittab
|
/etc/inittab
|
||||||
/etc/iproute2/rt_protos
|
/etc/group
|
||||||
/etc/iproute2/rt_tables
|
|
||||||
/etc/passwd
|
/etc/passwd
|
||||||
/etc/profile
|
|
||||||
/etc/profile.d
|
|
||||||
/etc/protocols
|
|
||||||
/etc/rc.local
|
|
||||||
/etc/services
|
|
||||||
/etc/shadow
|
/etc/shadow
|
||||||
|
/etc/profile
|
||||||
|
/etc/protocols
|
||||||
|
/etc/services
|
||||||
/etc/shells
|
/etc/shells
|
||||||
/etc/sysctl.conf
|
/etc/sysctl.conf
|
||||||
|
/etc/rc.local
|
||||||
/etc/sysupgrade.conf
|
/etc/sysupgrade.conf
|
||||||
|
/etc/config/
|
||||||
|
/etc/dropbear/
|
||||||
|
/etc/crontabs/
|
||||||
|
/etc/sysctl.d/local.conf
|
||||||
|
/etc/sysctl.d/
|
||||||
|
/etc/iproute2/rt_tables
|
||||||
|
/etc/iproute2/rt_protos
|
||||||
$(call $(TARGET)/conffiles)
|
$(call $(TARGET)/conffiles)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
@@ -112,16 +105,9 @@ ifdef CONFIG_SIGNED_PACKAGES
|
|||||||
endef
|
endef
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(CONFIG_NAND_SUPPORT),)
|
|
||||||
define Package/base-files/nand-support
|
|
||||||
rm -f $(1)/lib/upgrade/nand.sh
|
|
||||||
endef
|
|
||||||
endif
|
|
||||||
|
|
||||||
define Package/base-files/install
|
define Package/base-files/install
|
||||||
$(CP) ./files/* $(1)/
|
$(CP) ./files/* $(1)/
|
||||||
$(Package/base-files/install-key)
|
$(Package/base-files/install-key)
|
||||||
$(Package/base-files/nand-support)
|
|
||||||
if [ -d $(GENERIC_PLATFORM_DIR)/base-files/. ]; then \
|
if [ -d $(GENERIC_PLATFORM_DIR)/base-files/. ]; then \
|
||||||
$(CP) $(GENERIC_PLATFORM_DIR)/base-files/* $(1)/; \
|
$(CP) $(GENERIC_PLATFORM_DIR)/base-files/* $(1)/; \
|
||||||
fi
|
fi
|
||||||
@@ -134,7 +120,7 @@ define Package/base-files/install
|
|||||||
fi; \
|
fi; \
|
||||||
)
|
)
|
||||||
|
|
||||||
$(VERSION_SED_SCRIPT) \
|
$(VERSION_SED) \
|
||||||
$(1)/etc/banner \
|
$(1)/etc/banner \
|
||||||
$(1)/etc/openwrt_version \
|
$(1)/etc/openwrt_version \
|
||||||
$(1)/usr/lib/os-release
|
$(1)/usr/lib/os-release
|
||||||
@@ -151,7 +137,6 @@ define Package/base-files/install
|
|||||||
|
|
||||||
mkdir -p $(1)/CONTROL
|
mkdir -p $(1)/CONTROL
|
||||||
mkdir -p $(1)/dev
|
mkdir -p $(1)/dev
|
||||||
mkdir -p $(1)/etc/config
|
|
||||||
mkdir -p $(1)/etc/crontabs
|
mkdir -p $(1)/etc/crontabs
|
||||||
mkdir -p $(1)/etc/rc.d
|
mkdir -p $(1)/etc/rc.d
|
||||||
mkdir -p $(1)/overlay
|
mkdir -p $(1)/overlay
|
||||||
@@ -168,7 +153,7 @@ define Package/base-files/install
|
|||||||
mkdir -p $(1)/root
|
mkdir -p $(1)/root
|
||||||
$(LN) /proc/mounts $(1)/etc/mtab
|
$(LN) /proc/mounts $(1)/etc/mtab
|
||||||
rm -f $(1)/var
|
rm -f $(1)/var
|
||||||
$(LN) tmp $(1)/var
|
$(LN) /tmp $(1)/var
|
||||||
mkdir -p $(1)/etc
|
mkdir -p $(1)/etc
|
||||||
$(LN) /tmp/resolv.conf /tmp/TZ /tmp/localtime $(1)/etc/
|
$(LN) /tmp/resolv.conf /tmp/TZ /tmp/localtime $(1)/etc/
|
||||||
|
|
||||||
@@ -183,15 +168,6 @@ define Package/base-files/install
|
|||||||
echo "$$$${conffile##$(1)}" >> $(1)/CONTROL/conffiles; \
|
echo "$$$${conffile##$(1)}" >> $(1)/CONTROL/conffiles; \
|
||||||
fi \
|
fi \
|
||||||
done
|
done
|
||||||
|
|
||||||
$(if $(CONFIG_INCLUDE_CONFIG), \
|
|
||||||
echo -e "# Build configuration for board $(BOARD)/$(SUBTARGET)/$(PROFILE)\n" >$(1)/etc/build.config; \
|
|
||||||
cat $(BIN_DIR)/config.seed >>$(1)/etc/build.config)
|
|
||||||
|
|
||||||
$(if $(CONFIG_CLEAN_IPKG),, \
|
|
||||||
mkdir -p $(1)/etc/opkg; \
|
|
||||||
$(call FeedSourcesAppend,$(1)/etc/opkg/distfeeds.conf); \
|
|
||||||
$(VERSION_SED_SCRIPT) $(1)/etc/opkg/distfeeds.conf)
|
|
||||||
endef
|
endef
|
||||||
|
|
||||||
ifneq ($(DUMP),1)
|
ifneq ($(DUMP),1)
|
||||||
|
|||||||
@@ -15,21 +15,17 @@ generate_static_network() {
|
|||||||
set network.loopback.proto='static'
|
set network.loopback.proto='static'
|
||||||
set network.loopback.ipaddr='127.0.0.1'
|
set network.loopback.ipaddr='127.0.0.1'
|
||||||
set network.loopback.netmask='255.0.0.0'
|
set network.loopback.netmask='255.0.0.0'
|
||||||
|
delete network.globals
|
||||||
|
set network.globals='globals'
|
||||||
|
set network.globals.ula_prefix='auto'
|
||||||
EOF
|
EOF
|
||||||
[ -e /proc/sys/net/ipv6 ] && {
|
|
||||||
uci -q batch <<-EOF
|
|
||||||
delete network.globals
|
|
||||||
set network.globals='globals'
|
|
||||||
set network.globals.ula_prefix='auto'
|
|
||||||
EOF
|
|
||||||
}
|
|
||||||
|
|
||||||
if json_is_a dsl object; then
|
if json_is_a dsl object; then
|
||||||
json_select dsl
|
json_select dsl
|
||||||
if json_is_a atmbridge object; then
|
if json_is_a atmbridge object; then
|
||||||
json_select atmbridge
|
json_select atmbridge
|
||||||
local vpi vci encaps payload nameprefix
|
local vpi vci encaps payload
|
||||||
json_get_vars vpi vci encaps payload nameprefix
|
json_get_vars vpi vci encaps payload
|
||||||
uci -q batch <<-EOF
|
uci -q batch <<-EOF
|
||||||
delete network.atm
|
delete network.atm
|
||||||
set network.atm='atm-bridge'
|
set network.atm='atm-bridge'
|
||||||
@@ -37,7 +33,6 @@ generate_static_network() {
|
|||||||
set network.atm.vci='$vci'
|
set network.atm.vci='$vci'
|
||||||
set network.atm.encaps='$encaps'
|
set network.atm.encaps='$encaps'
|
||||||
set network.atm.payload='$payload'
|
set network.atm.payload='$payload'
|
||||||
set network.atm.nameprefix='$nameprefix'
|
|
||||||
EOF
|
EOF
|
||||||
json_select ..
|
json_select ..
|
||||||
fi
|
fi
|
||||||
@@ -106,40 +101,37 @@ generate_network() {
|
|||||||
set network.$1.proto='static'
|
set network.$1.proto='static'
|
||||||
set network.$1.ipaddr='$ipad'
|
set network.$1.ipaddr='$ipad'
|
||||||
set network.$1.netmask='$netm'
|
set network.$1.netmask='$netm'
|
||||||
|
set network.$1.ip6assign='60'
|
||||||
EOF
|
EOF
|
||||||
[ -e /proc/sys/net/ipv6 ] && uci set network.$1.ip6assign='60'
|
|
||||||
;;
|
;;
|
||||||
|
|
||||||
dhcp)
|
dhcp)
|
||||||
# fixup IPv6 slave interface if parent is a bridge
|
# fixup IPv6 slave interface if parent is a bridge
|
||||||
[ "$type" = "bridge" ] && ifname="br-$1"
|
[ "$type" = "bridge" ] && ifname="br-$1"
|
||||||
|
|
||||||
uci set network.$1.proto='dhcp'
|
uci -q batch <<-EOF
|
||||||
[ -e /proc/sys/net/ipv6 ] && {
|
set network.$1.proto='dhcp'
|
||||||
uci -q batch <<-EOF
|
delete network.${1}6
|
||||||
delete network.${1}6
|
set network.${1}6='interface'
|
||||||
set network.${1}6='interface'
|
set network.${1}6.ifname='$ifname'
|
||||||
set network.${1}6.ifname='$ifname'
|
set network.${1}6.proto='dhcpv6'
|
||||||
set network.${1}6.proto='dhcpv6'
|
EOF
|
||||||
EOF
|
|
||||||
}
|
|
||||||
;;
|
;;
|
||||||
|
|
||||||
pppoe)
|
pppoe)
|
||||||
|
# fixup IPv6 slave interface
|
||||||
|
ifname="pppoe-$1"
|
||||||
|
|
||||||
uci -q batch <<-EOF
|
uci -q batch <<-EOF
|
||||||
set network.$1.proto='pppoe'
|
set network.$1.proto='pppoe'
|
||||||
set network.$1.username='username'
|
set network.$1.username='username'
|
||||||
set network.$1.password='password'
|
set network.$1.password='password'
|
||||||
|
set network.$1.ipv6='auto'
|
||||||
|
delete network.${1}6
|
||||||
|
set network.${1}6='interface'
|
||||||
|
set network.${1}6.ifname='$ifname'
|
||||||
|
set network.${1}6.proto='dhcpv6'
|
||||||
EOF
|
EOF
|
||||||
[ -e /proc/sys/net/ipv6 ] && {
|
|
||||||
uci -q batch <<-EOF
|
|
||||||
set network.$1.ipv6='1'
|
|
||||||
delete network.${1}6
|
|
||||||
set network.${1}6='interface'
|
|
||||||
set network.${1}6.ifname='@${1}'
|
|
||||||
set network.${1}6.proto='dhcpv6'
|
|
||||||
EOF
|
|
||||||
}
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
@@ -234,7 +226,7 @@ generate_static_system() {
|
|||||||
uci -q batch <<-EOF
|
uci -q batch <<-EOF
|
||||||
delete system.@system[0]
|
delete system.@system[0]
|
||||||
add system system
|
add system system
|
||||||
set system.@system[-1].hostname='OpenWrt'
|
set system.@system[-1].hostname='LEDE'
|
||||||
set system.@system[-1].timezone='UTC'
|
set system.@system[-1].timezone='UTC'
|
||||||
set system.@system[-1].ttylogin='0'
|
set system.@system[-1].ttylogin='0'
|
||||||
set system.@system[-1].log_size='64'
|
set system.@system[-1].log_size='64'
|
||||||
@@ -244,10 +236,10 @@ generate_static_system() {
|
|||||||
set system.ntp='timeserver'
|
set system.ntp='timeserver'
|
||||||
set system.ntp.enabled='1'
|
set system.ntp.enabled='1'
|
||||||
set system.ntp.enable_server='0'
|
set system.ntp.enable_server='0'
|
||||||
add_list system.ntp.server='0.openwrt.pool.ntp.org'
|
add_list system.ntp.server='0.lede.pool.ntp.org'
|
||||||
add_list system.ntp.server='1.openwrt.pool.ntp.org'
|
add_list system.ntp.server='1.lede.pool.ntp.org'
|
||||||
add_list system.ntp.server='2.openwrt.pool.ntp.org'
|
add_list system.ntp.server='2.lede.pool.ntp.org'
|
||||||
add_list system.ntp.server='3.openwrt.pool.ntp.org'
|
add_list system.ntp.server='3.lede.pool.ntp.org'
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
if json_is_a system object; then
|
if json_is_a system object; then
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
_______ ________ __
|
_________
|
||||||
| |.-----.-----.-----.| | | |.----.| |_
|
/ /\ _ ___ ___ ___
|
||||||
| - || _ | -__| || | | || _|| _|
|
/ LE / \ | | | __| \| __|
|
||||||
|_______|| __|_____|__|__||________||__| |____|
|
/ DE / \ | |__| _|| |) | _|
|
||||||
|__| W I R E L E S S F R E E D O M
|
/________/ LE \ |____|___|___/|___| lede-project.org
|
||||||
-----------------------------------------------------
|
\ \ DE /
|
||||||
%D %V, %C
|
\ LE \ / -----------------------------------------------------------
|
||||||
-----------------------------------------------------
|
\ DE \ / %N (%V, %C)
|
||||||
|
\________\/ -----------------------------------------------------------
|
||||||
|
|
||||||
|
|||||||
@@ -8,8 +8,6 @@ after mount_root:
|
|||||||
* /etc/config directory with config files
|
* /etc/config directory with config files
|
||||||
|
|
||||||
for more help see:
|
for more help see:
|
||||||
https://openwrt.org/docs/guide-user/troubleshooting/
|
http://wiki.openwrt.org/doc/howto/generic.failsafe
|
||||||
- failsafe_and_factory_reset
|
|
||||||
- root_password_reset
|
|
||||||
=======================================================
|
=======================================================
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
#
|
|
||||||
# Lookup man 5 ethers for syntax documentation
|
|
||||||
#
|
|
||||||
# Examples :
|
|
||||||
# 02:00:11:22:33:44 OpenWrt.lan
|
|
||||||
# 02:00:11:22:33:44 192.168.1.1
|
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
root:x:0:
|
root:x:0:
|
||||||
daemon:x:1:
|
daemon:x:1:
|
||||||
adm:x:4:
|
adm:x:4:
|
||||||
tty:x:5:
|
|
||||||
mail:x:8:
|
mail:x:8:
|
||||||
audio:x:29:
|
audio:x:29:
|
||||||
www-data:x:33:
|
www-data:x:33:
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
if [ "$ACTION" = add ]; then
|
if [ "$ACTION" = add ]; then
|
||||||
for CONF in /etc/sysctl.d/*.conf /etc/sysctl.conf; do
|
for CONF in /etc/sysctl.conf /etc/sysctl.d/*.conf; do
|
||||||
[ ! -f "$CONF" ] && continue;
|
[ ! -f "$CONF" ] && continue;
|
||||||
sed -ne "/^[[:space:]]*net\..*\.$DEVICENAME\./p" "$CONF" | \
|
sed -ne "/^[[:space:]]*net\..*\.$DEVICENAME\./p" "$CONF" | \
|
||||||
sysctl -e -p - | logger -t sysctl
|
sysctl -e -p - | logger -t sysctl
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh /etc/rc.common
|
#!/bin/sh /etc/rc.common
|
||||||
# Copyright (C) 2015 OpenWrt.org
|
# Copyright (C) 2015 OpenWrt.org
|
||||||
|
|
||||||
START=94
|
START=98
|
||||||
STOP=10
|
STOP=10
|
||||||
USE_PROCD=1
|
USE_PROCD=1
|
||||||
|
|
||||||
@@ -22,16 +22,10 @@ load_gpio_switch()
|
|||||||
echo "$gpio_pin" >/sys/class/gpio/export
|
echo "$gpio_pin" >/sys/class/gpio/export
|
||||||
# we need to wait a bit until the GPIO appears
|
# we need to wait a bit until the GPIO appears
|
||||||
[ -d "$gpio_path" ] || sleep 1
|
[ -d "$gpio_path" ] || sleep 1
|
||||||
|
echo out >"$gpio_path/direction"
|
||||||
}
|
}
|
||||||
|
# write 0 or 1 to the "value" field
|
||||||
# direction attribute only exists if the kernel supports changing the
|
{ [ "$value" = "0" ] && echo "0" || echo "1"; } >"$gpio_path/value"
|
||||||
# direction of a GPIO
|
|
||||||
if [ -e "${gpio_path}/direction" ]; then
|
|
||||||
# set the pin to output with high or low pin value
|
|
||||||
{ [ "$value" = "0" ] && echo "low" || echo "high"; } >"$gpio_path/direction"
|
|
||||||
else
|
|
||||||
{ [ "$value" = "0" ] && echo "0" || echo "1"; } >"$gpio_path/value"
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
service_triggers()
|
service_triggers()
|
||||||
|
|||||||
@@ -72,7 +72,6 @@ load_led() {
|
|||||||
[ -n "$dev" ] && {
|
[ -n "$dev" ] && {
|
||||||
echo $dev > /sys/class/leds/${sysfs}/device_name
|
echo $dev > /sys/class/leds/${sysfs}/device_name
|
||||||
echo $mode > /sys/class/leds/${sysfs}/mode
|
echo $mode > /sys/class/leds/${sysfs}/mode
|
||||||
echo $interval > /sys/class/leds/${sysfs}/interval
|
|
||||||
}
|
}
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|||||||
@@ -3,42 +3,23 @@
|
|||||||
|
|
||||||
START=11
|
START=11
|
||||||
|
|
||||||
apply_defaults() {
|
set_vm_min_free() {
|
||||||
local mem="$(awk '/^MemTotal:/ {print $2}' /proc/meminfo)"
|
mem="$(grep MemTotal /proc/meminfo | awk '{print $2}')"
|
||||||
local min_free frag_low_thresh frag_high_thresh
|
|
||||||
|
|
||||||
if [ "$mem" -gt 65536 ]; then # 128M
|
if [ "$mem" -gt 65536 ]; then # 128M
|
||||||
min_free=16384
|
val=16384
|
||||||
elif [ "$mem" -gt 32768 ]; then # 64M
|
elif [ "$mem" -gt 32768 ]; then # 64M
|
||||||
min_free=8192
|
val=8192
|
||||||
|
elif [ "$mem" -gt 16384 ]; then # 32M
|
||||||
|
val=1024
|
||||||
else
|
else
|
||||||
min_free=1024
|
return
|
||||||
frag_low_thresh=393216
|
|
||||||
frag_high_thresh=524288
|
|
||||||
fi
|
|
||||||
|
|
||||||
sysctl -qw vm.min_free_kbytes="$min_free"
|
|
||||||
|
|
||||||
[ "$frag_low_thresh" ] && sysctl -qw \
|
|
||||||
net.ipv4.ipfrag_low_thresh="$frag_low_thresh" \
|
|
||||||
net.ipv4.ipfrag_high_thresh="$frag_high_thresh" \
|
|
||||||
net.ipv6.ip6frag_low_thresh="$frag_low_thresh" \
|
|
||||||
net.ipv6.ip6frag_high_thresh="$frag_high_thresh" \
|
|
||||||
net.netfilter.nf_conntrack_frag6_low_thresh="$frag_low_thresh" \
|
|
||||||
net.netfilter.nf_conntrack_frag6_high_thresh="$frag_high_thresh"
|
|
||||||
|
|
||||||
# first set default, then all interfaces to avoid races with appearing interfaces
|
|
||||||
if [ -d /proc/sys/net/ipv6/conf ]; then
|
|
||||||
echo 0 > /proc/sys/net/ipv6/conf/default/accept_ra
|
|
||||||
for iface in /proc/sys/net/ipv6/conf/*/accept_ra; do
|
|
||||||
echo 0 > "$iface"
|
|
||||||
done
|
|
||||||
fi
|
fi
|
||||||
|
sysctl -qw vm.min_free_kbytes="$val"
|
||||||
}
|
}
|
||||||
|
|
||||||
start() {
|
start() {
|
||||||
apply_defaults
|
set_vm_min_free
|
||||||
for CONF in /etc/sysctl.d/*.conf /etc/sysctl.conf; do
|
for CONF in /etc/sysctl.conf /etc/sysctl.d/*.conf; do
|
||||||
[ -f "$CONF" ] && sysctl -e -p "$CONF" >&-
|
[ -f "$CONF" ] && sysctl -p "$CONF" -e >&-
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ USE_PROCD=1
|
|||||||
validate_system_section()
|
validate_system_section()
|
||||||
{
|
{
|
||||||
uci_validate_section system system "${1}" \
|
uci_validate_section system system "${1}" \
|
||||||
'hostname:string:OpenWrt' \
|
'hostname:string:lede' \
|
||||||
'conloglevel:uinteger' \
|
'conloglevel:uinteger' \
|
||||||
'buffersize:uinteger' \
|
'buffersize:uinteger' \
|
||||||
'timezone:string:UTC' \
|
'timezone:string:UTC' \
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
# lookup table for ematch kinds
|
|
||||||
1 cmp
|
|
||||||
2 nbyte
|
|
||||||
3 u32
|
|
||||||
4 meta
|
|
||||||
7 canid
|
|
||||||
8 ipset
|
|
||||||
9 ipt
|
|
||||||
@@ -1,7 +1,8 @@
|
|||||||
DISTRIB_ID='%D'
|
DISTRIB_ID='%D'
|
||||||
DISTRIB_RELEASE='%V'
|
DISTRIB_RELEASE='%V'
|
||||||
DISTRIB_REVISION='%R'
|
DISTRIB_REVISION='%R'
|
||||||
|
DISTRIB_CODENAME='%n'
|
||||||
DISTRIB_TARGET='%S'
|
DISTRIB_TARGET='%S'
|
||||||
DISTRIB_ARCH='%A'
|
DISTRIB_ARCH='%A'
|
||||||
DISTRIB_DESCRIPTION='%D %V %C'
|
DISTRIB_DESCRIPTION='%D %N %V %C'
|
||||||
DISTRIB_TAINTS='%t'
|
DISTRIB_TAINTS='%t'
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
[ -e /tmp/.failsafe ] && export FAILSAFE=1
|
|
||||||
|
|
||||||
[ -f /etc/banner ] && cat /etc/banner
|
[ -f /etc/banner ] && cat /etc/banner
|
||||||
[ -n "$FAILSAFE" ] && cat /etc/banner.failsafe
|
[ -e /tmp/.failsafe ] && cat /etc/banner.failsafe
|
||||||
|
|
||||||
fgrep -sq '/ overlay ro,' /proc/mounts && {
|
fgrep -sq '/ overlay ro,' /proc/mounts && {
|
||||||
echo 'Your JFFS2-partition seems full and overlayfs is mounted read-only.'
|
echo 'Your JFFS2-partition seems full and overlayfs is mounted read-only.'
|
||||||
echo 'Please try to remove files from /overlay/upper/... and reboot!'
|
echo 'Please try to remove files from /overlay/upper/... and reboot!'
|
||||||
@@ -14,11 +11,7 @@ export HOME=$(grep -e "^${USER:-root}:" /etc/passwd | cut -d ":" -f 6)
|
|||||||
export HOME=${HOME:-/root}
|
export HOME=${HOME:-/root}
|
||||||
export PS1='\u@\h:\w\$ '
|
export PS1='\u@\h:\w\$ '
|
||||||
|
|
||||||
case "$TERM" in
|
[ "$TERM" = "xterm" ] && export PS1='\[\e]0;\u@\h: \w\a\]'$PS1
|
||||||
xterm*|rxvt*)
|
|
||||||
export PS1='\[\e]0;\u@\h: \w\a\]'$PS1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
[ -x /bin/more ] || alias more=less
|
[ -x /bin/more ] || alias more=less
|
||||||
[ -x /usr/bin/vim ] && alias vi=vim || alias vim=vi
|
[ -x /usr/bin/vim ] && alias vi=vim || alias vim=vi
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ released)
|
|||||||
echo "REBOOT" > /dev/console
|
echo "REBOOT" > /dev/console
|
||||||
sync
|
sync
|
||||||
reboot
|
reboot
|
||||||
elif [ "$SEEN" -ge 5 -a -n "$OVERLAY" ]
|
elif [ "$SEEN" -gt 5 -a -n "$OVERLAY" ]
|
||||||
then
|
then
|
||||||
echo "FACTORY RESET" > /dev/console
|
echo "FACTORY RESET" > /dev/console
|
||||||
jffs2reset -y && reboot &
|
jffs2reset -y && reboot &
|
||||||
|
|||||||
@@ -17,13 +17,12 @@ stop() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
reload() {
|
reload() {
|
||||||
restart
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
restart() {
|
restart() {
|
||||||
trap '' TERM
|
trap '' TERM
|
||||||
stop "$@"
|
stop "$@"
|
||||||
trap - TERM
|
|
||||||
start "$@"
|
start "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -42,15 +41,14 @@ disable() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
enable() {
|
enable() {
|
||||||
err=1
|
|
||||||
name="$(basename "${initscript}")"
|
name="$(basename "${initscript}")"
|
||||||
[ "$START" ] && \
|
disable
|
||||||
ln -sf "../init.d/$name" "$IPKG_INSTROOT/etc/rc.d/S${START}${name##S[0-9][0-9]}" && \
|
[ -n "$START" -o -n "$STOP" ] || {
|
||||||
err=0
|
echo "/etc/init.d/$name does not have a START or STOP value"
|
||||||
[ "$STOP" ] && \
|
return 1
|
||||||
ln -sf "../init.d/$name" "$IPKG_INSTROOT/etc/rc.d/K${STOP}${name##K[0-9][0-9]}" && \
|
}
|
||||||
err=0
|
[ "$START" ] && ln -s "../init.d/$name" "$IPKG_INSTROOT/etc/rc.d/S${START}${name##S[0-9][0-9]}"
|
||||||
return $err
|
[ "$STOP" ] && ln -s "../init.d/$name" "$IPKG_INSTROOT/etc/rc.d/K${STOP}${name##K[0-9][0-9]}"
|
||||||
}
|
}
|
||||||
|
|
||||||
enabled() {
|
enabled() {
|
||||||
@@ -70,7 +68,7 @@ Available commands:
|
|||||||
start Start the service
|
start Start the service
|
||||||
stop Stop the service
|
stop Stop the service
|
||||||
restart Restart the service
|
restart Restart the service
|
||||||
reload Reload configuration files (or restart if service does not implement reload)
|
reload Reload configuration files (or restart if that fails)
|
||||||
enable Enable service autostart
|
enable Enable service autostart
|
||||||
disable Disable service autostart
|
disable Disable service autostart
|
||||||
$EXTRA_HELP
|
$EXTRA_HELP
|
||||||
@@ -90,10 +88,6 @@ service_triggers() {
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
service_data() {
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
service_running() {
|
service_running() {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
@@ -128,14 +122,12 @@ ${INIT_TRACE:+set -x}
|
|||||||
}
|
}
|
||||||
|
|
||||||
stop() {
|
stop() {
|
||||||
procd_lock
|
|
||||||
stop_service "$@"
|
stop_service "$@"
|
||||||
procd_kill "$(basename ${basescript:-$initscript})" "$1"
|
procd_kill "$(basename ${basescript:-$initscript})" "$1"
|
||||||
}
|
}
|
||||||
|
|
||||||
reload() {
|
reload() {
|
||||||
if eval "type reload_service" 2>/dev/null >/dev/null; then
|
if eval "type reload_service" 2>/dev/null >/dev/null; then
|
||||||
procd_lock
|
|
||||||
reload_service "$@"
|
reload_service "$@"
|
||||||
else
|
else
|
||||||
start
|
start
|
||||||
@@ -149,4 +141,5 @@ ${INIT_TRACE:+set -x}
|
|||||||
|
|
||||||
ALL_COMMANDS="start stop reload restart boot shutdown enable disable enabled depends ${EXTRA_COMMANDS}"
|
ALL_COMMANDS="start stop reload restart boot shutdown enable disable enabled depends ${EXTRA_COMMANDS}"
|
||||||
list_contains ALL_COMMANDS "$action" || action=help
|
list_contains ALL_COMMANDS "$action" || action=help
|
||||||
|
[ "$action" = "reload" ] && action='eval reload "$@" || restart "$@" && :'
|
||||||
$action "$@"
|
$action "$@"
|
||||||
|
|||||||
@@ -29,8 +29,8 @@ kerberos 88/tcp kerberos5 krb5 kerberos-sec
|
|||||||
kerberos 88/udp kerberos5 krb5 kerberos-sec
|
kerberos 88/udp kerberos5 krb5 kerberos-sec
|
||||||
pop3 110/tcp
|
pop3 110/tcp
|
||||||
pop3 110/udp
|
pop3 110/udp
|
||||||
sunrpc 111/tcp rpcbind
|
sunrpc 111/tcp
|
||||||
sunrpc 111/udp rpcbind
|
sunrpc 111/udp
|
||||||
auth 113/tcp ident
|
auth 113/tcp ident
|
||||||
sftp 115/tcp
|
sftp 115/tcp
|
||||||
nntp 119/tcp
|
nntp 119/tcp
|
||||||
@@ -76,8 +76,6 @@ afpovertcp 548/tcp
|
|||||||
afpovertcp 548/udp
|
afpovertcp 548/udp
|
||||||
nntps 563/tcp snntp
|
nntps 563/tcp snntp
|
||||||
nntps 563/udp snntp
|
nntps 563/udp snntp
|
||||||
submission 587/tcp
|
|
||||||
submission 587/udp
|
|
||||||
ldaps 636/tcp
|
ldaps 636/tcp
|
||||||
ldaps 636/udp
|
ldaps 636/udp
|
||||||
tinc 655/tcp
|
tinc 655/tcp
|
||||||
|
|||||||
@@ -1 +1,30 @@
|
|||||||
# Defaults are configured in /etc/sysctl.d/* and can be customized in this file
|
kernel.panic=3
|
||||||
|
kernel.core_pattern=/tmp/%e.%t.%p.%s.core
|
||||||
|
|
||||||
|
net.ipv4.conf.default.arp_ignore=1
|
||||||
|
net.ipv4.conf.all.arp_ignore=1
|
||||||
|
net.ipv4.ip_forward=1
|
||||||
|
net.ipv4.icmp_echo_ignore_broadcasts=1
|
||||||
|
net.ipv4.icmp_ignore_bogus_error_responses=1
|
||||||
|
net.ipv4.igmp_max_memberships=100
|
||||||
|
net.ipv4.tcp_fin_timeout=30
|
||||||
|
net.ipv4.tcp_keepalive_time=120
|
||||||
|
net.ipv4.tcp_syncookies=1
|
||||||
|
net.ipv4.tcp_timestamps=1
|
||||||
|
net.ipv4.tcp_sack=1
|
||||||
|
net.ipv4.tcp_dsack=1
|
||||||
|
|
||||||
|
net.ipv6.conf.default.forwarding=1
|
||||||
|
net.ipv6.conf.all.forwarding=1
|
||||||
|
|
||||||
|
net.netfilter.nf_conntrack_acct=1
|
||||||
|
net.netfilter.nf_conntrack_checksum=0
|
||||||
|
net.netfilter.nf_conntrack_max=16384
|
||||||
|
net.netfilter.nf_conntrack_tcp_timeout_established=7440
|
||||||
|
net.netfilter.nf_conntrack_udp_timeout=60
|
||||||
|
net.netfilter.nf_conntrack_udp_timeout_stream=180
|
||||||
|
|
||||||
|
# disable bridge firewalling by default
|
||||||
|
net.bridge.bridge-nf-call-arptables=0
|
||||||
|
net.bridge.bridge-nf-call-ip6tables=0
|
||||||
|
net.bridge.bridge-nf-call-iptables=0
|
||||||
|
|||||||
@@ -1,25 +0,0 @@
|
|||||||
# Do not edit, changes to this file will be lost on upgrades
|
|
||||||
# /etc/sysctl.conf can be used to customize sysctl settings
|
|
||||||
|
|
||||||
kernel.panic=3
|
|
||||||
kernel.core_pattern=/tmp/%e.%t.%p.%s.core
|
|
||||||
fs.suid_dumpable=2
|
|
||||||
|
|
||||||
fs.protected_hardlinks=1
|
|
||||||
fs.protected_symlinks=1
|
|
||||||
|
|
||||||
net.ipv4.conf.default.arp_ignore=1
|
|
||||||
net.ipv4.conf.all.arp_ignore=1
|
|
||||||
net.ipv4.ip_forward=1
|
|
||||||
net.ipv4.icmp_echo_ignore_broadcasts=1
|
|
||||||
net.ipv4.icmp_ignore_bogus_error_responses=1
|
|
||||||
net.ipv4.igmp_max_memberships=100
|
|
||||||
net.ipv4.tcp_fin_timeout=30
|
|
||||||
net.ipv4.tcp_keepalive_time=120
|
|
||||||
net.ipv4.tcp_syncookies=1
|
|
||||||
net.ipv4.tcp_timestamps=1
|
|
||||||
net.ipv4.tcp_sack=1
|
|
||||||
net.ipv4.tcp_dsack=1
|
|
||||||
|
|
||||||
net.ipv6.conf.default.forwarding=1
|
|
||||||
net.ipv6.conf.all.forwarding=1
|
|
||||||
16
package/base-files/files/etc/uci-defaults/11_migrate-sysctl
Normal file
16
package/base-files/files/etc/uci-defaults/11_migrate-sysctl
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
if [ ! -f "/rom/etc/sysctl.conf" ] || cmp -s "/rom/etc/sysctl.conf" "/etc/sysctl.conf"; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
fingerprint="$(md5sum /etc/sysctl.conf)"
|
||||||
|
fingerprint="${fingerprint%% *}"
|
||||||
|
|
||||||
|
if [ "$fingerprint" = "1b05ebb41f72cb84e5510573cd4aca26" ] || \
|
||||||
|
[ "$fingerprint" = "62deb895be1a7f496040187b7c930e4e" ]; then
|
||||||
|
logger -t migrate-sysctl "Updating sysctl.conf to use current defaults"
|
||||||
|
cp "/rom/etc/sysctl.conf" "/etc/sysctl.conf"
|
||||||
|
fi
|
||||||
|
|
||||||
|
exit 0
|
||||||
@@ -57,16 +57,16 @@ config () {
|
|||||||
export ${NO_EXPORT:+-n} CONFIG_NUM_SECTIONS=$(($CONFIG_NUM_SECTIONS + 1))
|
export ${NO_EXPORT:+-n} CONFIG_NUM_SECTIONS=$(($CONFIG_NUM_SECTIONS + 1))
|
||||||
name="${name:-cfg$CONFIG_NUM_SECTIONS}"
|
name="${name:-cfg$CONFIG_NUM_SECTIONS}"
|
||||||
append CONFIG_SECTIONS "$name"
|
append CONFIG_SECTIONS "$name"
|
||||||
export ${NO_EXPORT:+-n} CONFIG_SECTION="$name"
|
|
||||||
config_set "$CONFIG_SECTION" "TYPE" "${cfgtype}"
|
|
||||||
[ -n "$NO_CALLBACK" ] || config_cb "$cfgtype" "$name"
|
[ -n "$NO_CALLBACK" ] || config_cb "$cfgtype" "$name"
|
||||||
|
export ${NO_EXPORT:+-n} CONFIG_SECTION="$name"
|
||||||
|
export ${NO_EXPORT:+-n} "CONFIG_${CONFIG_SECTION}_TYPE=$cfgtype"
|
||||||
}
|
}
|
||||||
|
|
||||||
option () {
|
option () {
|
||||||
local varname="$1"; shift
|
local varname="$1"; shift
|
||||||
local value="$*"
|
local value="$*"
|
||||||
|
|
||||||
config_set "$CONFIG_SECTION" "${varname}" "${value}"
|
export ${NO_EXPORT:+-n} "CONFIG_${CONFIG_SECTION}_${varname}=$value"
|
||||||
[ -n "$NO_CALLBACK" ] || option_cb "$varname" "$*"
|
[ -n "$NO_CALLBACK" ] || option_cb "$varname" "$*"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -81,7 +81,7 @@ list() {
|
|||||||
config_set "$CONFIG_SECTION" "${varname}_ITEM$len" "$value"
|
config_set "$CONFIG_SECTION" "${varname}_ITEM$len" "$value"
|
||||||
config_set "$CONFIG_SECTION" "${varname}_LENGTH" "$len"
|
config_set "$CONFIG_SECTION" "${varname}_LENGTH" "$len"
|
||||||
append "CONFIG_${CONFIG_SECTION}_${varname}" "$value" "$LIST_SEP"
|
append "CONFIG_${CONFIG_SECTION}_${varname}" "$value" "$LIST_SEP"
|
||||||
[ -n "$NO_CALLBACK" ] || list_cb "$varname" "$*"
|
list_cb "$varname" "$*"
|
||||||
}
|
}
|
||||||
|
|
||||||
config_unset() {
|
config_unset() {
|
||||||
@@ -92,7 +92,7 @@ config_unset() {
|
|||||||
# config_get <section> <option>
|
# config_get <section> <option>
|
||||||
config_get() {
|
config_get() {
|
||||||
case "$3" in
|
case "$3" in
|
||||||
"") eval echo "\"\${CONFIG_${1}_${2}:-\${4}}\"";;
|
"") eval echo "\${CONFIG_${1}_${2}:-\${4}}";;
|
||||||
*) eval export ${NO_EXPORT:+-n} -- "${1}=\${CONFIG_${2}_${3}:-\${4}}";;
|
*) eval export ${NO_EXPORT:+-n} -- "${1}=\${CONFIG_${2}_${3}:-\${4}}";;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
@@ -113,8 +113,11 @@ config_set() {
|
|||||||
local section="$1"
|
local section="$1"
|
||||||
local option="$2"
|
local option="$2"
|
||||||
local value="$3"
|
local value="$3"
|
||||||
|
local old_section="$CONFIG_SECTION"
|
||||||
|
|
||||||
export ${NO_EXPORT:+-n} "CONFIG_${section}_${option}=${value}"
|
CONFIG_SECTION="$section"
|
||||||
|
option "$option" "$value"
|
||||||
|
CONFIG_SECTION="$old_section"
|
||||||
}
|
}
|
||||||
|
|
||||||
config_foreach() {
|
config_foreach() {
|
||||||
@@ -150,29 +153,34 @@ config_list_foreach() {
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
insert_modules() {
|
||||||
|
for m in $*; do
|
||||||
|
if [ -f /etc/modules.d/$m ]; then
|
||||||
|
sed 's/^[^#]/insmod &/' /etc/modules.d/$m | ash 2>&- || :
|
||||||
|
else
|
||||||
|
modprobe $m
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
default_prerm() {
|
default_prerm() {
|
||||||
local root="${IPKG_INSTROOT}"
|
local root="${IPKG_INSTROOT}"
|
||||||
local pkgname="$(basename ${1%.*})"
|
local name
|
||||||
local ret=0
|
|
||||||
|
|
||||||
if [ -f "$root/usr/lib/opkg/info/${pkgname}.prerm-pkg" ]; then
|
name=$(basename ${1%.*})
|
||||||
( . "$root/usr/lib/opkg/info/${pkgname}.prerm-pkg" )
|
[ -f "$root/usr/lib/opkg/info/${name}.prerm-pkg" ] && . "$root/usr/lib/opkg/info/${name}.prerm-pkg"
|
||||||
ret=$?
|
|
||||||
fi
|
|
||||||
|
|
||||||
local shell="$(which bash)"
|
local shell="$(which bash)"
|
||||||
for i in $(grep -s "^/etc/init.d/" "$root/usr/lib/opkg/info/${pkgname}.list"); do
|
for i in `cat "$root/usr/lib/opkg/info/${name}.list" | grep "^/etc/init.d/"`; do
|
||||||
if [ -n "$root" ]; then
|
if [ -n "$root" ]; then
|
||||||
${shell:-/bin/sh} "$root/etc/rc.common" "$root$i" disable
|
${shell:-/bin/sh} "$root/etc/rc.common" "$root$i" disable
|
||||||
else
|
else
|
||||||
if [ "$PKG_UPGRADE" != "1" ]; then
|
if [ "$PKG_UPGRADE" != "1" ]; then
|
||||||
"$i" disable
|
"$i" disable
|
||||||
fi
|
fi
|
||||||
"$i" stop
|
"$i" stop || /bin/true
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
return $ret
|
|
||||||
}
|
}
|
||||||
|
|
||||||
add_group_and_user() {
|
add_group_and_user() {
|
||||||
@@ -194,7 +202,7 @@ add_group_and_user() {
|
|||||||
if [ -n "$gname" ] && [ -n "$gid" ]; then
|
if [ -n "$gname" ] && [ -n "$gid" ]; then
|
||||||
group_exists "$gname" || group_add "$gname" "$gid"
|
group_exists "$gname" || group_add "$gname" "$gid"
|
||||||
elif [ -n "$gname" ]; then
|
elif [ -n "$gname" ]; then
|
||||||
gid="$(group_add_next "$gname")"
|
group_add_next "$gname"; gid=$?
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$uname" ]; then
|
if [ -n "$uname" ]; then
|
||||||
@@ -227,16 +235,13 @@ default_postinst() {
|
|||||||
rm -fR $root/rootfs-overlay/
|
rm -fR $root/rootfs-overlay/
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$root" ] && grep -q -s "^/etc/modules.d/" "/usr/lib/opkg/info/${pkgname}.list"; then
|
|
||||||
kmodloader
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -z "$root" ] && grep -q -s "^/etc/uci-defaults/" "/usr/lib/opkg/info/${pkgname}.list"; then
|
if [ -z "$root" ] && grep -q -s "^/etc/uci-defaults/" "/usr/lib/opkg/info/${pkgname}.list"; then
|
||||||
. /lib/functions/system.sh
|
. /lib/functions/system.sh
|
||||||
[ -d /tmp/.uci ] || mkdir -p /tmp/.uci
|
[ -d /tmp/.uci ] || mkdir -p /tmp/.uci
|
||||||
for i in $(grep -s "^/etc/uci-defaults/" "/usr/lib/opkg/info/${pkgname}.list"); do
|
for i in $(sed -ne 's!^/etc/uci-defaults/!!p' "/usr/lib/opkg/info/${pkgname}.list"); do (
|
||||||
( [ -f "$i" ] && cd "$(dirname $i)" && . "$i" ) && rm -f "$i"
|
cd /etc/uci-defaults
|
||||||
done
|
[ -f "$i" ] && . "$i" && rm -f "$i"
|
||||||
|
) done
|
||||||
uci commit
|
uci commit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -287,7 +292,9 @@ group_add() {
|
|||||||
[ -f "${IPKG_INSTROOT}/etc/group" ] || return 1
|
[ -f "${IPKG_INSTROOT}/etc/group" ] || return 1
|
||||||
[ -n "$IPKG_INSTROOT" ] || lock /var/lock/group
|
[ -n "$IPKG_INSTROOT" ] || lock /var/lock/group
|
||||||
echo "${name}:x:${gid}:" >> ${IPKG_INSTROOT}/etc/group
|
echo "${name}:x:${gid}:" >> ${IPKG_INSTROOT}/etc/group
|
||||||
|
rc=$?
|
||||||
[ -n "$IPKG_INSTROOT" ] || lock -u /var/lock/group
|
[ -n "$IPKG_INSTROOT" ] || lock -u /var/lock/group
|
||||||
|
return $rc
|
||||||
}
|
}
|
||||||
|
|
||||||
group_exists() {
|
group_exists() {
|
||||||
@@ -297,17 +304,14 @@ group_exists() {
|
|||||||
group_add_next() {
|
group_add_next() {
|
||||||
local gid gids
|
local gid gids
|
||||||
gid=$(grep -s "^${1}:" ${IPKG_INSTROOT}/etc/group | cut -d: -f3)
|
gid=$(grep -s "^${1}:" ${IPKG_INSTROOT}/etc/group | cut -d: -f3)
|
||||||
if [ -n "$gid" ]; then
|
[ -n "$gid" ] && return $gid
|
||||||
echo $gid
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
gids=$(cat ${IPKG_INSTROOT}/etc/group | cut -d: -f3)
|
gids=$(cat ${IPKG_INSTROOT}/etc/group | cut -d: -f3)
|
||||||
gid=65536
|
gid=100
|
||||||
while [ -n "$(echo "$gids" | grep "^$gid$")" ] ; do
|
while [ -n "$(echo $gids | grep $gid)" ] ; do
|
||||||
gid=$((gid + 1))
|
gid=$((gid + 1))
|
||||||
done
|
done
|
||||||
group_add $1 $gid
|
group_add $1 $gid
|
||||||
echo $gid
|
return $gid
|
||||||
}
|
}
|
||||||
|
|
||||||
group_add_user() {
|
group_add_user() {
|
||||||
@@ -330,8 +334,8 @@ user_add() {
|
|||||||
local rc
|
local rc
|
||||||
[ -z "$uid" ] && {
|
[ -z "$uid" ] && {
|
||||||
uids=$(cat ${IPKG_INSTROOT}/etc/passwd | cut -d: -f3)
|
uids=$(cat ${IPKG_INSTROOT}/etc/passwd | cut -d: -f3)
|
||||||
uid=65536
|
uid=100
|
||||||
while [ -n "$(echo "$uids" | grep "^$uid$")" ] ; do
|
while [ -n "$(echo $uids | grep $uid)" ] ; do
|
||||||
uid=$((uid + 1))
|
uid=$((uid + 1))
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
@@ -340,15 +344,13 @@ user_add() {
|
|||||||
[ -n "$IPKG_INSTROOT" ] || lock /var/lock/passwd
|
[ -n "$IPKG_INSTROOT" ] || lock /var/lock/passwd
|
||||||
echo "${name}:x:${uid}:${gid}:${desc}:${home}:${shell}" >> ${IPKG_INSTROOT}/etc/passwd
|
echo "${name}:x:${uid}:${gid}:${desc}:${home}:${shell}" >> ${IPKG_INSTROOT}/etc/passwd
|
||||||
echo "${name}:x:0:0:99999:7:::" >> ${IPKG_INSTROOT}/etc/shadow
|
echo "${name}:x:0:0:99999:7:::" >> ${IPKG_INSTROOT}/etc/shadow
|
||||||
|
rc=$?
|
||||||
[ -n "$IPKG_INSTROOT" ] || lock -u /var/lock/passwd
|
[ -n "$IPKG_INSTROOT" ] || lock -u /var/lock/passwd
|
||||||
|
return $rc
|
||||||
}
|
}
|
||||||
|
|
||||||
user_exists() {
|
user_exists() {
|
||||||
grep -qs "^${1}:" ${IPKG_INSTROOT}/etc/passwd
|
grep -qs "^${1}:" ${IPKG_INSTROOT}/etc/passwd
|
||||||
}
|
}
|
||||||
|
|
||||||
board_name() {
|
|
||||||
[ -e /tmp/sysinfo/board_name ] && cat /tmp/sysinfo/board_name || echo "generic"
|
|
||||||
}
|
|
||||||
|
|
||||||
[ -z "$IPKG_INSTROOT" -a -f /lib/config/uci.sh ] && . /lib/config/uci.sh
|
[ -z "$IPKG_INSTROOT" -a -f /lib/config/uci.sh ] && . /lib/config/uci.sh
|
||||||
|
|||||||
@@ -1,20 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# Copyright (C) 2013 OpenWrt.org
|
# Copyright (C) 2013 OpenWrt.org
|
||||||
|
|
||||||
get_dt_led() {
|
|
||||||
local label
|
|
||||||
local ledpath
|
|
||||||
local basepath="/proc/device-tree"
|
|
||||||
local nodepath="$basepath/aliases/led-$1"
|
|
||||||
|
|
||||||
[ -f "$nodepath" ] && ledpath=$(cat "$nodepath")
|
|
||||||
[ -n "$ledpath" ] && \
|
|
||||||
label=$(cat "$basepath$ledpath/label" 2>/dev/null) || \
|
|
||||||
label=$(cat "$basepath$ledpath/chan-name" 2>/dev/null)
|
|
||||||
|
|
||||||
echo "$label"
|
|
||||||
}
|
|
||||||
|
|
||||||
led_set_attr() {
|
led_set_attr() {
|
||||||
[ -f "/sys/class/leds/$1/$2" ] && echo "$3" > "/sys/class/leds/$1/$2"
|
[ -f "/sys/class/leds/$1/$2" ] && echo "$3" > "/sys/class/leds/$1/$2"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,16 +6,10 @@
|
|||||||
__network_ifstatus() {
|
__network_ifstatus() {
|
||||||
local __tmp
|
local __tmp
|
||||||
|
|
||||||
[ -z "$__NETWORK_CACHE" ] && {
|
[ -z "$__NETWORK_CACHE" ] && \
|
||||||
__tmp="$(ubus call network.interface dump 2>&1)"
|
export __NETWORK_CACHE="$(ubus call network.interface dump)"
|
||||||
case "$?" in
|
|
||||||
4) : ;;
|
|
||||||
0) export __NETWORK_CACHE="$__tmp" ;;
|
|
||||||
*) echo "$__tmp" >&2 ;;
|
|
||||||
esac
|
|
||||||
}
|
|
||||||
|
|
||||||
__tmp="$(jsonfilter ${4:+-F "$4"} ${5:+-l "$5"} -s "${__NETWORK_CACHE:-{}}" -e "$1=@.interface${2:+[@.interface='$2']}$3")"
|
__tmp="$(jsonfilter ${4:+-F "$4"} ${5:+-l "$5"} -s "$__NETWORK_CACHE" -e "$1=@.interface${2:+[@.interface='$2']}$3")"
|
||||||
|
|
||||||
[ -z "$__tmp" ] && \
|
[ -z "$__tmp" ] && \
|
||||||
unset "$1" && \
|
unset "$1" && \
|
||||||
@@ -35,9 +29,18 @@ network_get_ipaddr() {
|
|||||||
# 1: destination variable
|
# 1: destination variable
|
||||||
# 2: interface
|
# 2: interface
|
||||||
network_get_ipaddr6() {
|
network_get_ipaddr6() {
|
||||||
__network_ifstatus "$1" "$2" "['ipv6-address'][0].address" || \
|
local __addr
|
||||||
__network_ifstatus "$1" "$2" "['ipv6-prefix-assignment'][0]['local-address'].address" || \
|
|
||||||
return 1
|
if __network_ifstatus "__addr" "$2" "['ipv6-address','ipv6-prefix-assignment'][0].address"; then
|
||||||
|
case "$__addr" in
|
||||||
|
*:) export "$1=${__addr}1" ;;
|
||||||
|
*) export "$1=${__addr}" ;;
|
||||||
|
esac
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
unset $1
|
||||||
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
# determine first IPv4 subnet of given logical interface
|
# determine first IPv4 subnet of given logical interface
|
||||||
@@ -51,36 +54,7 @@ network_get_subnet() {
|
|||||||
# 1: destination variable
|
# 1: destination variable
|
||||||
# 2: interface
|
# 2: interface
|
||||||
network_get_subnet6() {
|
network_get_subnet6() {
|
||||||
local __nets __addr
|
__network_ifstatus "$1" "$2" "['ipv6-address'][0]['address','mask']" "/"
|
||||||
|
|
||||||
if network_get_subnets6 __nets "$2"; then
|
|
||||||
# Attempt to return first non-fe80::/10, non-fc::/7 range
|
|
||||||
for __addr in $__nets; do
|
|
||||||
case "$__addr" in fe[8ab]?:*|f[cd]??:*)
|
|
||||||
continue
|
|
||||||
esac
|
|
||||||
export "$1=$__addr"
|
|
||||||
return 0
|
|
||||||
done
|
|
||||||
|
|
||||||
# Attempt to return first non-fe80::/10 range
|
|
||||||
for __addr in $__nets; do
|
|
||||||
case "$__addr" in fe[8ab]?:*)
|
|
||||||
continue
|
|
||||||
esac
|
|
||||||
export "$1=$__addr"
|
|
||||||
return 0
|
|
||||||
done
|
|
||||||
|
|
||||||
# Return first item
|
|
||||||
for __addr in $__nets; do
|
|
||||||
export "$1=$__addr"
|
|
||||||
return 0
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
|
|
||||||
unset "$1"
|
|
||||||
return 1
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# determine first IPv6 prefix of given logical interface
|
# determine first IPv6 prefix of given logical interface
|
||||||
@@ -104,19 +78,14 @@ network_get_ipaddrs6() {
|
|||||||
local __addr
|
local __addr
|
||||||
local __list=""
|
local __list=""
|
||||||
|
|
||||||
if __network_ifstatus "__addr" "$2" "['ipv6-address'][*].address"; then
|
if __network_ifstatus "__addr" "$2" "['ipv6-address','ipv6-prefix-assignment'][*].address"; then
|
||||||
for __addr in $__addr; do
|
for __addr in $__addr; do
|
||||||
__list="${__list:+$__list }${__addr}"
|
case "$__addr" in
|
||||||
|
*:) __list="${__list:+$__list }${__addr}1" ;;
|
||||||
|
*) __list="${__list:+$__list }${__addr}" ;;
|
||||||
|
esac
|
||||||
done
|
done
|
||||||
fi
|
|
||||||
|
|
||||||
if __network_ifstatus "__addr" "$2" "['ipv6-prefix-assignment'][*]['local-address'].address"; then
|
|
||||||
for __addr in $__addr; do
|
|
||||||
__list="${__list:+$__list }${__addr}"
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -n "$__list" ]; then
|
|
||||||
export "$1=$__list"
|
export "$1=$__list"
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
@@ -129,13 +98,18 @@ network_get_ipaddrs6() {
|
|||||||
# 1: destination variable
|
# 1: destination variable
|
||||||
# 2: interface
|
# 2: interface
|
||||||
network_get_ipaddrs_all() {
|
network_get_ipaddrs_all() {
|
||||||
local __addr __addr6
|
local __addr
|
||||||
|
local __list=""
|
||||||
|
|
||||||
network_get_ipaddrs __addr "$2"
|
if __network_ifstatus "__addr" "$2" "['ipv4-address','ipv6-address','ipv6-prefix-assignment'][*].address"; then
|
||||||
network_get_ipaddrs6 __addr6 "$2"
|
for __addr in $__addr; do
|
||||||
|
case "$__addr" in
|
||||||
|
*:) __list="${__list:+$__list }${__addr}1" ;;
|
||||||
|
*) __list="${__list:+$__list }${__addr}" ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
if [ -n "$__addr" -o -n "$__addr6" ]; then
|
export "$1=$__list"
|
||||||
export "$1=${__addr:+$__addr }$__addr6"
|
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -154,24 +128,17 @@ network_get_subnets() {
|
|||||||
# 1: destination variable
|
# 1: destination variable
|
||||||
# 2: interface
|
# 2: interface
|
||||||
network_get_subnets6() {
|
network_get_subnets6() {
|
||||||
local __addr __mask
|
local __addr
|
||||||
local __list=""
|
local __list=""
|
||||||
|
|
||||||
if __network_ifstatus "__addr" "$2" "['ipv6-address'][*]['address','mask']" "/ "; then
|
if __network_ifstatus "__addr" "$2" "['ipv6-address','ipv6-prefix-assignment'][*]['address','mask']" "/ "; then
|
||||||
for __addr in $__addr; do
|
for __addr in $__addr; do
|
||||||
__list="${__list:+$__list }${__addr}"
|
case "$__addr" in
|
||||||
|
*:/*) __list="${__list:+$__list }${__addr%/*}1/${__addr##*/}" ;;
|
||||||
|
*) __list="${__list:+$__list }${__addr}" ;;
|
||||||
|
esac
|
||||||
done
|
done
|
||||||
fi
|
|
||||||
|
|
||||||
if __network_ifstatus "__addr" "$2" "['ipv6-prefix-assignment'][*]['local-address'].address" && \
|
|
||||||
__network_ifstatus "__mask" "$2" "['ipv6-prefix-assignment'][*].mask"; then
|
|
||||||
for __addr in $__addr; do
|
|
||||||
__list="${__list:+$__list }${__addr}/${__mask%% *}"
|
|
||||||
__mask="${__mask#* }"
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -n "$__list" ]; then
|
|
||||||
export "$1=$__list"
|
export "$1=$__list"
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
@@ -271,11 +238,6 @@ network_is_up()
|
|||||||
# 2: interface
|
# 2: interface
|
||||||
network_get_protocol() { __network_ifstatus "$1" "$2" ".proto"; }
|
network_get_protocol() { __network_ifstatus "$1" "$2" ".proto"; }
|
||||||
|
|
||||||
# determine the metric of the given logical interface
|
|
||||||
# 1: destination variable
|
|
||||||
# 2: interface
|
|
||||||
network_get_metric() { __network_ifstatus "$1" "$2" ".metric"; }
|
|
||||||
|
|
||||||
# determine the layer 3 linux network device of the given logical interface
|
# determine the layer 3 linux network device of the given logical interface
|
||||||
# 1: destination variable
|
# 1: destination variable
|
||||||
# 2: interface
|
# 2: interface
|
||||||
|
|||||||
@@ -1,17 +1,5 @@
|
|||||||
# Copyright (C) 2006-2013 OpenWrt.org
|
# Copyright (C) 2006-2013 OpenWrt.org
|
||||||
|
|
||||||
get_mac_binary() {
|
|
||||||
local path="$1"
|
|
||||||
local offset="$2"
|
|
||||||
|
|
||||||
if [ -z "$path" ]; then
|
|
||||||
echo "get_mac_binary: file $path not found!" >&2
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
|
|
||||||
hexdump -v -n 6 -s $offset -e '5/1 "%02x:" 1/1 "%02x"' $path 2>/dev/null
|
|
||||||
}
|
|
||||||
|
|
||||||
find_mtd_chardev() {
|
find_mtd_chardev() {
|
||||||
local INDEX=$(find_mtd_index "$1")
|
local INDEX=$(find_mtd_index "$1")
|
||||||
local PREFIX=/dev/mtd
|
local PREFIX=/dev/mtd
|
||||||
@@ -20,7 +8,8 @@ find_mtd_chardev() {
|
|||||||
echo "${INDEX:+$PREFIX$INDEX}"
|
echo "${INDEX:+$PREFIX$INDEX}"
|
||||||
}
|
}
|
||||||
|
|
||||||
mtd_get_mac_ascii() {
|
mtd_get_mac_ascii()
|
||||||
|
{
|
||||||
local mtdname="$1"
|
local mtdname="$1"
|
||||||
local key="$2"
|
local key="$2"
|
||||||
local part
|
local part
|
||||||
@@ -38,36 +27,18 @@ mtd_get_mac_ascii() {
|
|||||||
[ -n "$mac_dirty" ] && macaddr_canonicalize "$mac_dirty"
|
[ -n "$mac_dirty" ] && macaddr_canonicalize "$mac_dirty"
|
||||||
}
|
}
|
||||||
|
|
||||||
mtd_get_mac_text() {
|
|
||||||
local mtdname=$1
|
|
||||||
local offset=$2
|
|
||||||
local part
|
|
||||||
local mac_dirty
|
|
||||||
|
|
||||||
part=$(find_mtd_part "$mtdname")
|
|
||||||
if [ -z "$part" ]; then
|
|
||||||
echo "mtd_get_mac_text: partition $mtdname not found!" >&2
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -z "$offset" ]; then
|
|
||||||
echo "mtd_get_mac_text: offset missing!" >&2
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
|
|
||||||
mac_dirty=$(dd if="$part" bs=1 skip="$offset" count=17 2>/dev/null)
|
|
||||||
|
|
||||||
# "canonicalize" mac
|
|
||||||
[ -n "$mac_dirty" ] && macaddr_canonicalize "$mac_dirty"
|
|
||||||
}
|
|
||||||
|
|
||||||
mtd_get_mac_binary() {
|
mtd_get_mac_binary() {
|
||||||
local mtdname="$1"
|
local mtdname="$1"
|
||||||
local offset="$2"
|
local offset="$2"
|
||||||
local part
|
local part
|
||||||
|
|
||||||
part=$(find_mtd_part "$mtdname")
|
part=$(find_mtd_part "$mtdname")
|
||||||
get_mac_binary "$part" "$offset"
|
if [ -z "$part" ]; then
|
||||||
|
echo "mtd_get_mac_binary: partition $mtdname not found!" >&2
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
hexdump -v -n 6 -s $offset -e '5/1 "%02x:" 1/1 "%02x"' $part 2>/dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
mtd_get_mac_binary_ubi() {
|
mtd_get_mac_binary_ubi() {
|
||||||
@@ -109,19 +80,22 @@ macaddr_add() {
|
|||||||
echo $oui:$nic
|
echo $oui:$nic
|
||||||
}
|
}
|
||||||
|
|
||||||
macaddr_setbit_la() {
|
macaddr_setbit_la()
|
||||||
|
{
|
||||||
local mac=$1
|
local mac=$1
|
||||||
|
|
||||||
printf "%02x:%s" $((0x${mac%%:*} | 0x02)) ${mac#*:}
|
printf "%02x:%s" $((0x${mac%%:*} | 0x02)) ${mac#*:}
|
||||||
}
|
}
|
||||||
|
|
||||||
macaddr_2bin() {
|
macaddr_2bin()
|
||||||
|
{
|
||||||
local mac=$1
|
local mac=$1
|
||||||
|
|
||||||
echo -ne \\x${mac//:/\\x}
|
echo -ne \\x${mac//:/\\x}
|
||||||
}
|
}
|
||||||
|
|
||||||
macaddr_canonicalize() {
|
macaddr_canonicalize()
|
||||||
|
{
|
||||||
local mac="$1"
|
local mac="$1"
|
||||||
local canon=""
|
local canon=""
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ _ucidef_set_interface() {
|
|||||||
json_select_object "$name"
|
json_select_object "$name"
|
||||||
json_add_string ifname "$iface"
|
json_add_string ifname "$iface"
|
||||||
|
|
||||||
if ! json_is_a protocol string || [ -n "$proto" ]; then
|
if ! json_is_a protocol string; then
|
||||||
case "$proto" in
|
case "$proto" in
|
||||||
static|dhcp|none|pppoe) : ;;
|
static|dhcp|none|pppoe) : ;;
|
||||||
*)
|
*)
|
||||||
@@ -160,7 +160,7 @@ _ucidef_finish_switch_roles() {
|
|||||||
json_select ..
|
json_select ..
|
||||||
json_select ..
|
json_select ..
|
||||||
|
|
||||||
if [ ${need_tag:-0} -eq 1 -o ${want_untag:-0} -ne 1 ]; then
|
if [ $n_vlan -gt $n_cpu -o ${need_tag:-0} -eq 1 ]; then
|
||||||
num="${num}t"
|
num="${num}t"
|
||||||
device="${device}.${index}"
|
device="${device}.${index}"
|
||||||
fi
|
fi
|
||||||
@@ -319,7 +319,6 @@ ucidef_add_atm_bridge() {
|
|||||||
local vci="$2"
|
local vci="$2"
|
||||||
local encaps="$3"
|
local encaps="$3"
|
||||||
local payload="$4"
|
local payload="$4"
|
||||||
local nameprefix="$5"
|
|
||||||
|
|
||||||
json_select_object dsl
|
json_select_object dsl
|
||||||
json_select_object atmbridge
|
json_select_object atmbridge
|
||||||
@@ -327,7 +326,6 @@ ucidef_add_atm_bridge() {
|
|||||||
json_add_int vci "$vci"
|
json_add_int vci "$vci"
|
||||||
json_add_string encaps "$encaps"
|
json_add_string encaps "$encaps"
|
||||||
json_add_string payload "$payload"
|
json_add_string payload "$payload"
|
||||||
json_add_string nameprefix "$nameprefix"
|
|
||||||
json_select ..
|
json_select ..
|
||||||
json_select ..
|
json_select ..
|
||||||
}
|
}
|
||||||
@@ -360,59 +358,19 @@ ucidef_add_vdsl_modem() {
|
|||||||
json_select ..
|
json_select ..
|
||||||
}
|
}
|
||||||
|
|
||||||
ucidef_set_led_ataport() {
|
ucidef_set_led_netdev() {
|
||||||
_ucidef_set_led_trigger "$1" "$2" "$3" ata"$4"
|
|
||||||
}
|
|
||||||
|
|
||||||
_ucidef_set_led_common() {
|
|
||||||
local cfg="led_$1"
|
local cfg="led_$1"
|
||||||
local name="$2"
|
local name="$2"
|
||||||
local sysfs="$3"
|
local sysfs="$3"
|
||||||
|
local dev="$4"
|
||||||
|
local mode="${5:-link tx rx}"
|
||||||
|
|
||||||
json_select_object led
|
json_select_object led
|
||||||
|
|
||||||
json_select_object "$1"
|
json_select_object "$1"
|
||||||
json_add_string name "$name"
|
json_add_string name "$name"
|
||||||
json_add_string sysfs "$sysfs"
|
|
||||||
}
|
|
||||||
|
|
||||||
ucidef_set_led_default() {
|
|
||||||
local default="$4"
|
|
||||||
|
|
||||||
_ucidef_set_led_common "$1" "$2" "$3"
|
|
||||||
|
|
||||||
json_add_string default "$default"
|
|
||||||
json_select ..
|
|
||||||
|
|
||||||
json_select ..
|
|
||||||
}
|
|
||||||
|
|
||||||
ucidef_set_led_gpio() {
|
|
||||||
local gpio="$4"
|
|
||||||
local inverted="$5"
|
|
||||||
|
|
||||||
_ucidef_set_led_common "$1" "$2" "$3"
|
|
||||||
|
|
||||||
json_add_string trigger "$trigger"
|
|
||||||
json_add_string type gpio
|
|
||||||
json_add_int gpio "$gpio"
|
|
||||||
json_add_boolean inverted "$inverted"
|
|
||||||
json_select ..
|
|
||||||
|
|
||||||
json_select ..
|
|
||||||
}
|
|
||||||
|
|
||||||
ucidef_set_led_ide() {
|
|
||||||
_ucidef_set_led_trigger "$1" "$2" "$3" ide-disk
|
|
||||||
}
|
|
||||||
|
|
||||||
ucidef_set_led_netdev() {
|
|
||||||
local dev="$4"
|
|
||||||
local mode="${5:-link tx rx}"
|
|
||||||
|
|
||||||
_ucidef_set_led_common "$1" "$2" "$3"
|
|
||||||
|
|
||||||
json_add_string type netdev
|
json_add_string type netdev
|
||||||
|
json_add_string sysfs "$sysfs"
|
||||||
json_add_string device "$dev"
|
json_add_string device "$dev"
|
||||||
json_add_string mode "$mode"
|
json_add_string mode "$mode"
|
||||||
json_select ..
|
json_select ..
|
||||||
@@ -420,106 +378,24 @@ ucidef_set_led_netdev() {
|
|||||||
json_select ..
|
json_select ..
|
||||||
}
|
}
|
||||||
|
|
||||||
ucidef_set_led_oneshot() {
|
|
||||||
_ucidef_set_led_timer $1 $2 $3 "oneshot" $4 $5
|
|
||||||
}
|
|
||||||
|
|
||||||
ucidef_set_led_portstate() {
|
|
||||||
local port_state="$4"
|
|
||||||
|
|
||||||
_ucidef_set_led_common "$1" "$2" "$3"
|
|
||||||
|
|
||||||
json_add_string trigger port_state
|
|
||||||
json_add_string type portstate
|
|
||||||
json_add_string port_state "$port_state"
|
|
||||||
json_select ..
|
|
||||||
|
|
||||||
json_select ..
|
|
||||||
}
|
|
||||||
|
|
||||||
ucidef_set_led_rssi() {
|
|
||||||
local iface="$4"
|
|
||||||
local minq="$5"
|
|
||||||
local maxq="$6"
|
|
||||||
local offset="${7:-0}"
|
|
||||||
local factor="${8:-1}"
|
|
||||||
|
|
||||||
_ucidef_set_led_common "$1" "$2" "$3"
|
|
||||||
|
|
||||||
json_add_string type rssi
|
|
||||||
json_add_string name "$name"
|
|
||||||
json_add_string iface "$iface"
|
|
||||||
json_add_string minq "$minq"
|
|
||||||
json_add_string maxq "$maxq"
|
|
||||||
json_add_string offset "$offset"
|
|
||||||
json_add_string factor "$factor"
|
|
||||||
json_select ..
|
|
||||||
|
|
||||||
json_select ..
|
|
||||||
}
|
|
||||||
|
|
||||||
ucidef_set_led_switch() {
|
|
||||||
local trigger_name="$4"
|
|
||||||
local port_mask="$5"
|
|
||||||
local speed_mask="$6"
|
|
||||||
|
|
||||||
_ucidef_set_led_common "$1" "$2" "$3"
|
|
||||||
|
|
||||||
json_add_string trigger "$trigger_name"
|
|
||||||
json_add_string type switch
|
|
||||||
json_add_string port_mask "$port_mask"
|
|
||||||
json_add_string speed_mask "$speed_mask"
|
|
||||||
json_select ..
|
|
||||||
|
|
||||||
json_select ..
|
|
||||||
}
|
|
||||||
|
|
||||||
_ucidef_set_led_timer() {
|
|
||||||
local trigger_name="$4"
|
|
||||||
local delayon="$5"
|
|
||||||
local delayoff="$6"
|
|
||||||
|
|
||||||
_ucidef_set_led_common "$1" "$2" "$3"
|
|
||||||
|
|
||||||
json_add_string trigger "$trigger_name"
|
|
||||||
json_add_int delayon "$delayon"
|
|
||||||
json_add_int delayoff "$delayoff"
|
|
||||||
json_select ..
|
|
||||||
|
|
||||||
json_select ..
|
|
||||||
}
|
|
||||||
|
|
||||||
ucidef_set_led_timer() {
|
|
||||||
_ucidef_set_led_timer $1 $2 $3 "timer" $4 $5
|
|
||||||
}
|
|
||||||
|
|
||||||
_ucidef_set_led_trigger() {
|
|
||||||
local trigger_name="$4"
|
|
||||||
|
|
||||||
_ucidef_set_led_common "$1" "$2" "$3"
|
|
||||||
|
|
||||||
json_add_string trigger "$trigger_name"
|
|
||||||
json_select ..
|
|
||||||
|
|
||||||
json_select ..
|
|
||||||
}
|
|
||||||
|
|
||||||
ucidef_set_led_usbdev() {
|
ucidef_set_led_usbdev() {
|
||||||
|
local cfg="led_$1"
|
||||||
|
local name="$2"
|
||||||
|
local sysfs="$3"
|
||||||
local dev="$4"
|
local dev="$4"
|
||||||
|
|
||||||
_ucidef_set_led_common "$1" "$2" "$3"
|
json_select_object led
|
||||||
|
|
||||||
|
json_select_object "$1"
|
||||||
|
json_add_string name "$name"
|
||||||
json_add_string type usb
|
json_add_string type usb
|
||||||
|
json_add_string sysfs "$sysfs"
|
||||||
json_add_string device "$dev"
|
json_add_string device "$dev"
|
||||||
json_select ..
|
json_select ..
|
||||||
|
|
||||||
json_select ..
|
json_select ..
|
||||||
}
|
}
|
||||||
|
|
||||||
ucidef_set_led_usbhost() {
|
|
||||||
_ucidef_set_led_trigger "$1" "$2" "$3" usb-host
|
|
||||||
}
|
|
||||||
|
|
||||||
ucidef_set_led_usbport() {
|
ucidef_set_led_usbport() {
|
||||||
local obj="$1"
|
local obj="$1"
|
||||||
local name="$2"
|
local name="$2"
|
||||||
@@ -528,9 +404,12 @@ ucidef_set_led_usbport() {
|
|||||||
shift
|
shift
|
||||||
shift
|
shift
|
||||||
|
|
||||||
_ucidef_set_led_common "$obj" "$name" "$sysfs"
|
json_select_object led
|
||||||
|
|
||||||
|
json_select_object "$obj"
|
||||||
|
json_add_string name "$name"
|
||||||
json_add_string type usbport
|
json_add_string type usbport
|
||||||
|
json_add_string sysfs "$sysfs"
|
||||||
json_select_array ports
|
json_select_array ports
|
||||||
for port in "$@"; do
|
for port in "$@"; do
|
||||||
json_add_string port "$port"
|
json_add_string port "$port"
|
||||||
@@ -542,7 +421,171 @@ ucidef_set_led_usbport() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ucidef_set_led_wlan() {
|
ucidef_set_led_wlan() {
|
||||||
_ucidef_set_led_trigger "$1" "$2" "$3" "$4"
|
local cfg="led_$1"
|
||||||
|
local name="$2"
|
||||||
|
local sysfs="$3"
|
||||||
|
local trigger="$4"
|
||||||
|
|
||||||
|
json_select_object led
|
||||||
|
|
||||||
|
json_select_object "$1"
|
||||||
|
json_add_string name "$name"
|
||||||
|
json_add_string type trigger
|
||||||
|
json_add_string sysfs "$sysfs"
|
||||||
|
json_add_string trigger "$trigger"
|
||||||
|
json_select ..
|
||||||
|
|
||||||
|
json_select ..
|
||||||
|
}
|
||||||
|
|
||||||
|
ucidef_set_led_switch() {
|
||||||
|
local cfg="led_$1"
|
||||||
|
local name="$2"
|
||||||
|
local sysfs="$3"
|
||||||
|
local trigger="$4"
|
||||||
|
local port_mask="$5"
|
||||||
|
local speed_mask="$6"
|
||||||
|
|
||||||
|
json_select_object led
|
||||||
|
|
||||||
|
json_select_object "$1"
|
||||||
|
json_add_string name "$name"
|
||||||
|
json_add_string type switch
|
||||||
|
json_add_string sysfs "$sysfs"
|
||||||
|
json_add_string trigger "$trigger"
|
||||||
|
json_add_string port_mask "$port_mask"
|
||||||
|
json_add_string speed_mask "$speed_mask"
|
||||||
|
json_select ..
|
||||||
|
|
||||||
|
json_select ..
|
||||||
|
}
|
||||||
|
|
||||||
|
ucidef_set_led_portstate() {
|
||||||
|
local cfg="led_$1"
|
||||||
|
local name="$2"
|
||||||
|
local sysfs="$3"
|
||||||
|
local port_state="$4"
|
||||||
|
|
||||||
|
json_select_object led
|
||||||
|
|
||||||
|
json_select_object "$1"
|
||||||
|
json_add_string name "$name"
|
||||||
|
json_add_string type portstate
|
||||||
|
json_add_string sysfs "$sysfs"
|
||||||
|
json_add_string trigger port_state
|
||||||
|
json_add_string port_state "$port_state"
|
||||||
|
json_select ..
|
||||||
|
|
||||||
|
json_select ..
|
||||||
|
}
|
||||||
|
|
||||||
|
ucidef_set_led_default() {
|
||||||
|
local cfg="led_$1"
|
||||||
|
local name="$2"
|
||||||
|
local sysfs="$3"
|
||||||
|
local default="$4"
|
||||||
|
|
||||||
|
json_select_object led
|
||||||
|
|
||||||
|
json_select_object "$1"
|
||||||
|
json_add_string name "$name"
|
||||||
|
json_add_string sysfs "$sysfs"
|
||||||
|
json_add_string default "$default"
|
||||||
|
json_select ..
|
||||||
|
|
||||||
|
json_select ..
|
||||||
|
}
|
||||||
|
|
||||||
|
ucidef_set_led_gpio() {
|
||||||
|
local cfg="led_$1"
|
||||||
|
local name="$2"
|
||||||
|
local sysfs="$3"
|
||||||
|
local gpio="$4"
|
||||||
|
local inverted="$5"
|
||||||
|
|
||||||
|
json_select_object led
|
||||||
|
|
||||||
|
json_select_object "$1"
|
||||||
|
json_add_string type gpio
|
||||||
|
json_add_string name "$name"
|
||||||
|
json_add_string sysfs "$sysfs"
|
||||||
|
json_add_string trigger "$trigger"
|
||||||
|
json_add_int gpio "$gpio"
|
||||||
|
json_add_boolean inverted "$inverted"
|
||||||
|
json_select ..
|
||||||
|
|
||||||
|
json_select ..
|
||||||
|
}
|
||||||
|
|
||||||
|
ucidef_set_led_ide() {
|
||||||
|
local cfg="led_$1"
|
||||||
|
local name="$2"
|
||||||
|
local sysfs="$3"
|
||||||
|
|
||||||
|
json_select_object led
|
||||||
|
|
||||||
|
json_select_object "$1"
|
||||||
|
json_add_string name "$name"
|
||||||
|
json_add_string sysfs "$sysfs"
|
||||||
|
json_add_string trigger ide-disk
|
||||||
|
json_select ..
|
||||||
|
|
||||||
|
json_select ..
|
||||||
|
}
|
||||||
|
|
||||||
|
__ucidef_set_led_timer() {
|
||||||
|
local cfg="led_$1"
|
||||||
|
local name="$2"
|
||||||
|
local sysfs="$3"
|
||||||
|
local trigger="$4"
|
||||||
|
local delayon="$5"
|
||||||
|
local delayoff="$6"
|
||||||
|
|
||||||
|
json_select_object led
|
||||||
|
|
||||||
|
json_select_object "$1"
|
||||||
|
json_add_string type "$trigger"
|
||||||
|
json_add_string name "$name"
|
||||||
|
json_add_string sysfs "$sysfs"
|
||||||
|
json_add_int delayon "$delayon"
|
||||||
|
json_add_int delayoff "$delayoff"
|
||||||
|
json_select ..
|
||||||
|
|
||||||
|
json_select ..
|
||||||
|
}
|
||||||
|
|
||||||
|
ucidef_set_led_oneshot() {
|
||||||
|
__ucidef_set_led_timer $1 $2 $3 "oneshot" $4 $5
|
||||||
|
}
|
||||||
|
|
||||||
|
ucidef_set_led_timer() {
|
||||||
|
__ucidef_set_led_timer $1 $2 $3 "timer" $4 $5
|
||||||
|
}
|
||||||
|
|
||||||
|
ucidef_set_led_rssi() {
|
||||||
|
local cfg="led_$1"
|
||||||
|
local name="$2"
|
||||||
|
local sysfs="$3"
|
||||||
|
local iface="$4"
|
||||||
|
local minq="$5"
|
||||||
|
local maxq="$6"
|
||||||
|
local offset="$7"
|
||||||
|
local factor="$8"
|
||||||
|
|
||||||
|
json_select_object led
|
||||||
|
|
||||||
|
json_select_object "$1"
|
||||||
|
json_add_string type rssi
|
||||||
|
json_add_string name "$name"
|
||||||
|
json_add_string iface "$iface"
|
||||||
|
json_add_string sysfs "$sysfs"
|
||||||
|
json_add_string minq "$minq"
|
||||||
|
json_add_string maxq "$maxq"
|
||||||
|
json_add_string offset "$offset"
|
||||||
|
json_add_string factor "$factor"
|
||||||
|
json_select ..
|
||||||
|
|
||||||
|
json_select ..
|
||||||
}
|
}
|
||||||
|
|
||||||
ucidef_set_rssimon() {
|
ucidef_set_rssimon() {
|
||||||
@@ -558,6 +601,7 @@ ucidef_set_rssimon() {
|
|||||||
json_select ..
|
json_select ..
|
||||||
|
|
||||||
json_select ..
|
json_select ..
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ucidef_add_gpio_switch() {
|
ucidef_add_gpio_switch() {
|
||||||
@@ -575,26 +619,6 @@ ucidef_add_gpio_switch() {
|
|||||||
json_select ..
|
json_select ..
|
||||||
}
|
}
|
||||||
|
|
||||||
ucidef_set_hostname() {
|
|
||||||
local hostname="$1"
|
|
||||||
|
|
||||||
json_select_object system
|
|
||||||
json_add_string hostname "$hostname"
|
|
||||||
json_select ..
|
|
||||||
}
|
|
||||||
|
|
||||||
ucidef_set_ntpserver() {
|
|
||||||
local server
|
|
||||||
|
|
||||||
json_select_object system
|
|
||||||
json_select_array ntpserver
|
|
||||||
for server in "$@"; do
|
|
||||||
json_add_string "" "$server"
|
|
||||||
done
|
|
||||||
json_select ..
|
|
||||||
json_select ..
|
|
||||||
}
|
|
||||||
|
|
||||||
board_config_update() {
|
board_config_update() {
|
||||||
json_init
|
json_init
|
||||||
[ -f ${CFG} ] && json_load "$(cat ${CFG})"
|
[ -f ${CFG} ] && json_load "$(cat ${CFG})"
|
||||||
|
|||||||
@@ -43,10 +43,7 @@ preinit_config_switch() {
|
|||||||
json_select ..
|
json_select ..
|
||||||
|
|
||||||
if [ "$device" = "$lan_if" ]; then
|
if [ "$device" = "$lan_if" ]; then
|
||||||
if [ "$reset" -eq "1" ]; then
|
swconfig dev $name set reset $reset
|
||||||
swconfig dev $name set reset
|
|
||||||
fi
|
|
||||||
|
|
||||||
swconfig dev $name set enable_vlan $enable
|
swconfig dev $name set enable_vlan $enable
|
||||||
swconfig dev $name vlan $role set ports "$ports"
|
swconfig dev $name vlan $role set ports "$ports"
|
||||||
swconfig dev $name set apply
|
swconfig dev $name set apply
|
||||||
@@ -99,8 +96,6 @@ preinit_config_board() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
preinit_ip() {
|
preinit_ip() {
|
||||||
[ "$pi_preinit_no_failsafe" = "y" ] && return
|
|
||||||
|
|
||||||
# if the preinit interface isn't specified and ifname is set in
|
# if the preinit interface isn't specified and ifname is set in
|
||||||
# preinit.arch use that interface
|
# preinit.arch use that interface
|
||||||
if [ -z "$pi_ifname" ]; then
|
if [ -z "$pi_ifname" ]; then
|
||||||
@@ -112,8 +107,6 @@ preinit_ip() {
|
|||||||
elif [ -d "/etc/board.d/" ]; then
|
elif [ -d "/etc/board.d/" ]; then
|
||||||
preinit_config_board
|
preinit_config_board
|
||||||
fi
|
fi
|
||||||
|
|
||||||
preinit_net_echo "Doing OpenWrt Preinit\n"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
preinit_ip_deconfig() {
|
preinit_ip_deconfig() {
|
||||||
@@ -147,7 +140,13 @@ preinit_net_echo() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
preinit_echo() {
|
||||||
|
preinit_net_echo $1
|
||||||
|
echo $1
|
||||||
|
}
|
||||||
|
|
||||||
pi_indicate_preinit() {
|
pi_indicate_preinit() {
|
||||||
|
preinit_net_echo "Doing Lede Preinit\n"
|
||||||
set_state preinit
|
set_state preinit
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,12 +5,8 @@
|
|||||||
run_failsafe_hook() {
|
run_failsafe_hook() {
|
||||||
[ "$pi_preinit_no_failsafe" = "y" ] && return
|
[ "$pi_preinit_no_failsafe" = "y" ] && return
|
||||||
if [ "$FAILSAFE" = "true" ]; then
|
if [ "$FAILSAFE" = "true" ]; then
|
||||||
lock /tmp/.failsafe
|
|
||||||
boot_run_hook failsafe
|
boot_run_hook failsafe
|
||||||
while [ ! -e /tmp/sysupgrade ]; do
|
lock -w /tmp/.failsafe
|
||||||
lock -w /tmp/.failsafe
|
|
||||||
done
|
|
||||||
exit
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,13 +8,10 @@ failsafe_netlogin () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
failsafe_shell() {
|
failsafe_shell() {
|
||||||
local console="$(sed -e 's/ /\n/g' /proc/cmdline | grep '^console=' | head -1 | sed -e 's/^console=//' -e 's/,.*//')"
|
lock /tmp/.failsafe
|
||||||
[ -n "$console" ] || console=console
|
ash --login
|
||||||
[ -c "/dev/$console" ] || return 0
|
echo "Please reboot system when done with failsafe network logins"
|
||||||
while true; do
|
while true; do sleep 1; done
|
||||||
ash --login <"/dev/$console" >"/dev/$console" 2>"/dev/$console"
|
|
||||||
sleep 1
|
|
||||||
done &
|
|
||||||
}
|
}
|
||||||
|
|
||||||
boot_hook_add failsafe failsafe_netlogin
|
boot_hook_add failsafe failsafe_netlogin
|
||||||
|
|||||||
@@ -6,33 +6,143 @@ RAM_ROOT=/tmp/root
|
|||||||
libs() { ldd $* 2>/dev/null | sed -r 's/(.* => )?(.*) .*/\2/'; }
|
libs() { ldd $* 2>/dev/null | sed -r 's/(.* => )?(.*) .*/\2/'; }
|
||||||
|
|
||||||
install_file() { # <file> [ <file> ... ]
|
install_file() { # <file> [ <file> ... ]
|
||||||
local target dest dir
|
|
||||||
for file in "$@"; do
|
for file in "$@"; do
|
||||||
if [ -L "$file" ]; then
|
|
||||||
target="$(readlink -f "$file")"
|
|
||||||
dest="$RAM_ROOT/$file"
|
|
||||||
[ ! -f "$dest" ] && {
|
|
||||||
dir="$(dirname "$dest")"
|
|
||||||
mkdir -p "$dir"
|
|
||||||
ln -s "$target" "$dest"
|
|
||||||
}
|
|
||||||
file="$target"
|
|
||||||
fi
|
|
||||||
dest="$RAM_ROOT/$file"
|
dest="$RAM_ROOT/$file"
|
||||||
[ -f "$file" -a ! -f "$dest" ] && {
|
[ -f $file -a ! -f $dest ] && {
|
||||||
dir="$(dirname "$dest")"
|
dir="$(dirname $dest)"
|
||||||
mkdir -p "$dir"
|
mkdir -p "$dir"
|
||||||
cp "$file" "$dest"
|
cp $file $dest
|
||||||
}
|
}
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
install_bin() {
|
install_bin() { # <file> [ <symlink> ... ]
|
||||||
local src files
|
|
||||||
src=$1
|
src=$1
|
||||||
files=$1
|
files=$1
|
||||||
[ -x "$src" ] && files="$src $(libs $src)"
|
[ -x "$src" ] && files="$src $(libs $src)"
|
||||||
install_file $files
|
install_file $files
|
||||||
|
shift
|
||||||
|
for link in "$@"; do {
|
||||||
|
dest="$RAM_ROOT/$link"
|
||||||
|
dir="$(dirname $dest)"
|
||||||
|
mkdir -p "$dir"
|
||||||
|
[ -f "$dest" ] || ln -s $src $dest
|
||||||
|
}; done
|
||||||
|
}
|
||||||
|
|
||||||
|
supivot() { # <new_root> <old_root>
|
||||||
|
/bin/mount | grep "on $1 type" 2>&- 1>&- || /bin/mount -o bind $1 $1
|
||||||
|
mkdir -p $1$2 $1/proc $1/sys $1/dev $1/tmp $1/overlay && \
|
||||||
|
/bin/mount -o noatime,move /proc $1/proc && \
|
||||||
|
pivot_root $1 $1$2 || {
|
||||||
|
/bin/umount -l $1 $1
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
/bin/mount -o noatime,move $2/sys /sys
|
||||||
|
/bin/mount -o noatime,move $2/dev /dev
|
||||||
|
/bin/mount -o noatime,move $2/tmp /tmp
|
||||||
|
/bin/mount -o noatime,move $2/overlay /overlay 2>&-
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
run_ramfs() { # <command> [...]
|
||||||
|
install_bin /bin/busybox /bin/ash /bin/sh /bin/mount /bin/umount \
|
||||||
|
/sbin/pivot_root /sbin/reboot /bin/sync /bin/dd /bin/grep \
|
||||||
|
/bin/cp /bin/mv /bin/tar /usr/bin/md5sum "/usr/bin/[" /bin/dd \
|
||||||
|
/bin/vi /bin/ls /bin/cat /usr/bin/awk /usr/bin/hexdump \
|
||||||
|
/bin/sleep /bin/zcat /usr/bin/bzcat /usr/bin/printf /usr/bin/wc \
|
||||||
|
/bin/cut /usr/bin/printf /bin/sync /bin/mkdir /bin/rmdir \
|
||||||
|
/bin/rm /usr/bin/basename /bin/kill /bin/chmod /usr/bin/find \
|
||||||
|
/bin/mknod
|
||||||
|
|
||||||
|
install_bin /bin/uclient-fetch /bin/wget
|
||||||
|
install_bin /sbin/mtd
|
||||||
|
install_bin /sbin/mount_root
|
||||||
|
install_bin /sbin/snapshot
|
||||||
|
install_bin /sbin/snapshot_tool
|
||||||
|
install_bin /usr/sbin/ubiupdatevol
|
||||||
|
install_bin /usr/sbin/ubiattach
|
||||||
|
install_bin /usr/sbin/ubiblock
|
||||||
|
install_bin /usr/sbin/ubiformat
|
||||||
|
install_bin /usr/sbin/ubidetach
|
||||||
|
install_bin /usr/sbin/ubirsvol
|
||||||
|
install_bin /usr/sbin/ubirmvol
|
||||||
|
install_bin /usr/sbin/ubimkvol
|
||||||
|
install_bin /usr/sbin/partx
|
||||||
|
install_bin /usr/sbin/losetup
|
||||||
|
install_bin /usr/sbin/mkfs.ext4
|
||||||
|
for file in $RAMFS_COPY_BIN; do
|
||||||
|
install_bin ${file//:/ }
|
||||||
|
done
|
||||||
|
install_file /etc/resolv.conf /lib/*.sh /lib/functions/*.sh /lib/upgrade/*.sh $RAMFS_COPY_DATA
|
||||||
|
|
||||||
|
[ -L "/lib64" ] && ln -s /lib $RAM_ROOT/lib64
|
||||||
|
|
||||||
|
supivot $RAM_ROOT /mnt || {
|
||||||
|
echo "Failed to switch over to ramfs. Please reboot."
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
/bin/mount -o remount,ro /mnt
|
||||||
|
/bin/umount -l /mnt
|
||||||
|
|
||||||
|
grep /overlay /proc/mounts > /dev/null && {
|
||||||
|
/bin/mount -o noatime,remount,ro /overlay
|
||||||
|
/bin/umount -l /overlay
|
||||||
|
}
|
||||||
|
|
||||||
|
# spawn a new shell from ramdisk to reduce the probability of cache issues
|
||||||
|
exec /bin/busybox ash -c "$*"
|
||||||
|
}
|
||||||
|
|
||||||
|
kill_remaining() { # [ <signal> ]
|
||||||
|
local sig="${1:-TERM}"
|
||||||
|
echo -n "Sending $sig to remaining processes ... "
|
||||||
|
|
||||||
|
local my_pid=$$
|
||||||
|
local my_ppid=$(cut -d' ' -f4 /proc/$my_pid/stat)
|
||||||
|
local my_ppisupgraded=
|
||||||
|
grep -q upgraded /proc/$my_ppid/cmdline >/dev/null && {
|
||||||
|
local my_ppisupgraded=1
|
||||||
|
}
|
||||||
|
|
||||||
|
local stat
|
||||||
|
for stat in /proc/[0-9]*/stat; do
|
||||||
|
[ -f "$stat" ] || continue
|
||||||
|
|
||||||
|
local pid name state ppid rest
|
||||||
|
read pid name state ppid rest < $stat
|
||||||
|
name="${name#(}"; name="${name%)}"
|
||||||
|
|
||||||
|
local cmdline
|
||||||
|
read cmdline < /proc/$pid/cmdline
|
||||||
|
|
||||||
|
# Skip kernel threads
|
||||||
|
[ -n "$cmdline" ] || continue
|
||||||
|
|
||||||
|
if [ $$ -eq 1 ] || [ $my_ppid -eq 1 ] && [ -n "$my_ppisupgraded" ]; then
|
||||||
|
# Running as init process, kill everything except me
|
||||||
|
if [ $pid -ne $$ ] && [ $pid -ne $my_ppid ]; then
|
||||||
|
echo -n "$name "
|
||||||
|
kill -$sig $pid 2>/dev/null
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
case "$name" in
|
||||||
|
# Skip essential services
|
||||||
|
*procd*|*ash*|*init*|*watchdog*|*ssh*|*dropbear*|*telnet*|*login*|*hostapd*|*wpa_supplicant*|*nas*|*relayd*) : ;;
|
||||||
|
|
||||||
|
# Killable process
|
||||||
|
*)
|
||||||
|
if [ $pid -ne $$ ] && [ $ppid -ne $$ ]; then
|
||||||
|
echo -n "$name "
|
||||||
|
kill -$sig $pid 2>/dev/null
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
echo ""
|
||||||
}
|
}
|
||||||
|
|
||||||
run_hooks() {
|
run_hooks() {
|
||||||
@@ -65,31 +175,28 @@ v() {
|
|||||||
[ "$VERBOSE" -ge 1 ] && echo "$@"
|
[ "$VERBOSE" -ge 1 ] && echo "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
json_string() {
|
|
||||||
local v="$1"
|
|
||||||
v="${v//\\/\\\\}"
|
|
||||||
v="${v//\"/\\\"}"
|
|
||||||
echo "\"$v\""
|
|
||||||
}
|
|
||||||
|
|
||||||
rootfs_type() {
|
rootfs_type() {
|
||||||
/bin/mount | awk '($3 ~ /^\/$/) && ($5 !~ /rootfs/) { print $5 }'
|
/bin/mount | awk '($3 ~ /^\/$/) && ($5 !~ /rootfs/) { print $5 }'
|
||||||
}
|
}
|
||||||
|
|
||||||
get_image() { # <source> [ <command> ]
|
get_image() { # <source> [ <command> ]
|
||||||
local from="$1"
|
local from="$1"
|
||||||
local cmd="$2"
|
local conc="$2"
|
||||||
|
local cmd
|
||||||
|
|
||||||
if [ -z "$cmd" ]; then
|
case "$from" in
|
||||||
local magic="$(dd if="$from" bs=2 count=1 2>/dev/null | hexdump -n 2 -e '1/1 "%02x"')"
|
http://*|ftp://*) cmd="wget -O- -q";;
|
||||||
|
*) cmd="cat";;
|
||||||
|
esac
|
||||||
|
if [ -z "$conc" ]; then
|
||||||
|
local magic="$(eval $cmd \"$from\" 2>/dev/null | dd bs=2 count=1 2>/dev/null | hexdump -n 2 -e '1/1 "%02x"')"
|
||||||
case "$magic" in
|
case "$magic" in
|
||||||
1f8b) cmd="zcat";;
|
1f8b) conc="zcat";;
|
||||||
425a) cmd="bzcat";;
|
425a) conc="bzcat";;
|
||||||
*) cmd="cat";;
|
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cat "$from" 2>/dev/null | $cmd
|
eval "$cmd \"$from\" 2>/dev/null ${conc:+| $conc}"
|
||||||
}
|
}
|
||||||
|
|
||||||
get_magic_word() {
|
get_magic_word() {
|
||||||
@@ -101,7 +208,7 @@ get_magic_long() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export_bootdevice() {
|
export_bootdevice() {
|
||||||
local cmdline uuid disk uevent line
|
local cmdline uuid disk uevent
|
||||||
local MAJOR MINOR DEVNAME DEVTYPE
|
local MAJOR MINOR DEVNAME DEVTYPE
|
||||||
|
|
||||||
if read cmdline < /proc/cmdline; then
|
if read cmdline < /proc/cmdline; then
|
||||||
@@ -134,9 +241,8 @@ export_bootdevice() {
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
if [ -e "$uevent" ]; then
|
if [ -e "$uevent" ]; then
|
||||||
while read line; do
|
. "$uevent"
|
||||||
export -n "$line"
|
|
||||||
done < "$uevent"
|
|
||||||
export BOOTDEV_MAJOR=$MAJOR
|
export BOOTDEV_MAJOR=$MAJOR
|
||||||
export BOOTDEV_MINOR=$MINOR
|
export BOOTDEV_MINOR=$MINOR
|
||||||
return 0
|
return 0
|
||||||
@@ -148,12 +254,10 @@ export_bootdevice() {
|
|||||||
|
|
||||||
export_partdevice() {
|
export_partdevice() {
|
||||||
local var="$1" offset="$2"
|
local var="$1" offset="$2"
|
||||||
local uevent line MAJOR MINOR DEVNAME DEVTYPE
|
local uevent MAJOR MINOR DEVNAME DEVTYPE
|
||||||
|
|
||||||
for uevent in /sys/class/block/*/uevent; do
|
for uevent in /sys/class/block/*/uevent; do
|
||||||
while read line; do
|
. "$uevent"
|
||||||
export -n "$line"
|
|
||||||
done < "$uevent"
|
|
||||||
if [ $BOOTDEV_MAJOR = $MAJOR -a $(($BOOTDEV_MINOR + $offset)) = $MINOR -a -b "/dev/$DEVNAME" ]; then
|
if [ $BOOTDEV_MAJOR = $MAJOR -a $(($BOOTDEV_MINOR + $offset)) = $MINOR -a -b "/dev/$DEVNAME" ]; then
|
||||||
export "$var=$DEVNAME"
|
export "$var=$DEVNAME"
|
||||||
return 0
|
return 0
|
||||||
@@ -163,14 +267,6 @@ export_partdevice() {
|
|||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
hex_le32_to_cpu() {
|
|
||||||
[ "$(echo 01 | hexdump -v -n 2 -e '/2 "%x"')" == "3031" ] && {
|
|
||||||
echo "${1:0:2}${1:8:2}${1:6:2}${1:4:2}${1:2:2}"
|
|
||||||
return
|
|
||||||
}
|
|
||||||
echo "$@"
|
|
||||||
}
|
|
||||||
|
|
||||||
get_partitions() { # <device> <filename>
|
get_partitions() { # <device> <filename>
|
||||||
local disk="$1"
|
local disk="$1"
|
||||||
local filename="$2"
|
local filename="$2"
|
||||||
@@ -178,8 +274,8 @@ get_partitions() { # <device> <filename>
|
|||||||
if [ -b "$disk" -o -f "$disk" ]; then
|
if [ -b "$disk" -o -f "$disk" ]; then
|
||||||
v "Reading partition table from $filename..."
|
v "Reading partition table from $filename..."
|
||||||
|
|
||||||
local magic=$(dd if="$disk" bs=2 count=1 skip=255 2>/dev/null)
|
local magic="$(hexdump -v -n 2 -s 0x1FE -e '1/2 "0x%04X"' "$disk")"
|
||||||
if [ "$magic" != $'\x55\xAA' ]; then
|
if [ "$magic" != 0xAA55 ]; then
|
||||||
v "Invalid partition table on $disk"
|
v "Invalid partition table on $disk"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
@@ -190,9 +286,9 @@ get_partitions() { # <device> <filename>
|
|||||||
for part in 1 2 3 4; do
|
for part in 1 2 3 4; do
|
||||||
set -- $(hexdump -v -n 12 -s "$((0x1B2 + $part * 16))" -e '3/4 "0x%08X "' "$disk")
|
set -- $(hexdump -v -n 12 -s "$((0x1B2 + $part * 16))" -e '3/4 "0x%08X "' "$disk")
|
||||||
|
|
||||||
local type="$(( $(hex_le32_to_cpu $1) % 256))"
|
local type="$(($1 % 256))"
|
||||||
local lba="$(( $(hex_le32_to_cpu $2) ))"
|
local lba="$(($2))"
|
||||||
local num="$(( $(hex_le32_to_cpu $3) ))"
|
local num="$(($3))"
|
||||||
|
|
||||||
[ $type -gt 0 ] || continue
|
[ $type -gt 0 ] || continue
|
||||||
|
|
||||||
@@ -222,17 +318,14 @@ default_do_upgrade() {
|
|||||||
else
|
else
|
||||||
get_image "$1" "$2" | mtd write - "${PART_NAME:-image}"
|
get_image "$1" "$2" | mtd write - "${PART_NAME:-image}"
|
||||||
fi
|
fi
|
||||||
[ $? -ne 0 ] && exit 1
|
|
||||||
}
|
}
|
||||||
|
|
||||||
do_upgrade_stage2() {
|
do_upgrade() {
|
||||||
v "Performing system upgrade..."
|
v "Performing system upgrade..."
|
||||||
if [ -n "$do_upgrade" ]; then
|
if type 'platform_do_upgrade' >/dev/null 2>/dev/null; then
|
||||||
eval "$do_upgrade"
|
platform_do_upgrade "$ARGV"
|
||||||
elif type 'platform_do_upgrade' >/dev/null 2>/dev/null; then
|
|
||||||
platform_do_upgrade "$IMAGE"
|
|
||||||
else
|
else
|
||||||
default_do_upgrade "$IMAGE"
|
default_do_upgrade "$ARGV"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$SAVE_CONFIG" -eq 1 ] && type 'platform_copy_config' >/dev/null 2>/dev/null; then
|
if [ "$SAVE_CONFIG" -eq 1 ] && type 'platform_copy_config' >/dev/null 2>/dev/null; then
|
||||||
@@ -240,11 +333,12 @@ do_upgrade_stage2() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
v "Upgrade completed"
|
v "Upgrade completed"
|
||||||
sleep 1
|
[ -n "$DELAY" ] && sleep "$DELAY"
|
||||||
|
ask_bool 1 "Reboot" && {
|
||||||
v "Rebooting system..."
|
v "Rebooting system..."
|
||||||
umount -a
|
umount -a
|
||||||
reboot -f
|
reboot -f
|
||||||
sleep 5
|
sleep 5
|
||||||
echo b 2>/dev/null >/proc/sysrq-trigger
|
echo b 2>/dev/null >/proc/sysrq-trigger
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,7 @@
|
|||||||
|
fwtool_pre_upgrade() {
|
||||||
|
fwtool -q -i /dev/null "$1"
|
||||||
|
}
|
||||||
|
|
||||||
fwtool_check_image() {
|
fwtool_check_image() {
|
||||||
[ $# -gt 1 ] && return 1
|
[ $# -gt 1 ] && return 1
|
||||||
|
|
||||||
|
|||||||
@@ -1,150 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
. /lib/functions.sh
|
|
||||||
. /lib/functions/system.sh
|
|
||||||
|
|
||||||
export IMAGE="$1"
|
|
||||||
COMMAND="$2"
|
|
||||||
|
|
||||||
export ARGV="$IMAGE"
|
|
||||||
export ARGC=1
|
|
||||||
|
|
||||||
export SAVE_CONFIG=1
|
|
||||||
export SAVE_PARTITIONS=1
|
|
||||||
|
|
||||||
export INTERACTIVE=0
|
|
||||||
export VERBOSE=1
|
|
||||||
export CONFFILES=/tmp/sysupgrade.conffiles
|
|
||||||
export CONF_TAR=/tmp/sysupgrade.tgz
|
|
||||||
|
|
||||||
RAMFS_COPY_BIN= # extra programs for temporary ramfs root
|
|
||||||
RAMFS_COPY_DATA= # extra data files
|
|
||||||
|
|
||||||
|
|
||||||
[ -f "$CONF_TAR" ] || export SAVE_CONFIG=0
|
|
||||||
[ -f /tmp/sysupgrade.always.overwrite.bootdisk.partmap ] && export SAVE_PARTITIONS=0
|
|
||||||
|
|
||||||
include /lib/upgrade
|
|
||||||
|
|
||||||
|
|
||||||
supivot() { # <new_root> <old_root>
|
|
||||||
/bin/mount | grep "on $1 type" 2>&- 1>&- || /bin/mount -o bind $1 $1
|
|
||||||
mkdir -p $1$2 $1/proc $1/sys $1/dev $1/tmp $1/overlay && \
|
|
||||||
/bin/mount -o noatime,move /proc $1/proc && \
|
|
||||||
pivot_root $1 $1$2 || {
|
|
||||||
/bin/umount -l $1 $1
|
|
||||||
return 1
|
|
||||||
}
|
|
||||||
|
|
||||||
/bin/mount -o noatime,move $2/sys /sys
|
|
||||||
/bin/mount -o noatime,move $2/dev /dev
|
|
||||||
/bin/mount -o noatime,move $2/tmp /tmp
|
|
||||||
/bin/mount -o noatime,move $2/overlay /overlay 2>&-
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
switch_to_ramfs() {
|
|
||||||
for binary in \
|
|
||||||
/bin/busybox /bin/ash /bin/sh /bin/mount /bin/umount \
|
|
||||||
pivot_root mount_root reboot sync kill sleep \
|
|
||||||
md5sum hexdump cat zcat bzcat dd tar \
|
|
||||||
ls basename find cp mv rm mkdir rmdir mknod touch chmod \
|
|
||||||
'[' printf wc grep awk sed cut \
|
|
||||||
mtd partx losetup mkfs.ext4 \
|
|
||||||
ubiupdatevol ubiattach ubiblock ubiformat \
|
|
||||||
ubidetach ubirsvol ubirmvol ubimkvol \
|
|
||||||
snapshot snapshot_tool \
|
|
||||||
$RAMFS_COPY_BIN
|
|
||||||
do
|
|
||||||
local file="$(which "$binary" 2>/dev/null)"
|
|
||||||
[ -n "$file" ] && install_bin "$file"
|
|
||||||
done
|
|
||||||
install_file /etc/resolv.conf /lib/*.sh /lib/functions/*.sh /lib/upgrade/*.sh $RAMFS_COPY_DATA
|
|
||||||
|
|
||||||
[ -L "/lib64" ] && ln -s /lib $RAM_ROOT/lib64
|
|
||||||
|
|
||||||
supivot $RAM_ROOT /mnt || {
|
|
||||||
echo "Failed to switch over to ramfs. Please reboot."
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
/bin/mount -o remount,ro /mnt
|
|
||||||
/bin/umount -l /mnt
|
|
||||||
|
|
||||||
grep /overlay /proc/mounts > /dev/null && {
|
|
||||||
/bin/mount -o noatime,remount,ro /overlay
|
|
||||||
/bin/umount -l /overlay
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
kill_remaining() { # [ <signal> [ <loop> ] ]
|
|
||||||
local loop_limit=10
|
|
||||||
|
|
||||||
local sig="${1:-TERM}"
|
|
||||||
local loop="${2:-0}"
|
|
||||||
local run=true
|
|
||||||
local stat
|
|
||||||
local proc_ppid=$(cut -d' ' -f4 /proc/$$/stat)
|
|
||||||
|
|
||||||
echo -n "Sending $sig to remaining processes ... "
|
|
||||||
|
|
||||||
while $run; do
|
|
||||||
run=false
|
|
||||||
for stat in /proc/[0-9]*/stat; do
|
|
||||||
[ -f "$stat" ] || continue
|
|
||||||
|
|
||||||
local pid name state ppid rest
|
|
||||||
read pid name state ppid rest < $stat
|
|
||||||
name="${name#(}"; name="${name%)}"
|
|
||||||
|
|
||||||
# Skip PID1, our parent, ourself and our children
|
|
||||||
[ $pid -ne 1 -a $pid -ne $proc_ppid -a $pid -ne $$ -a $ppid -ne $$ ] || continue
|
|
||||||
|
|
||||||
local cmdline
|
|
||||||
read cmdline < /proc/$pid/cmdline
|
|
||||||
|
|
||||||
# Skip kernel threads
|
|
||||||
[ -n "$cmdline" ] || continue
|
|
||||||
|
|
||||||
echo -n "$name "
|
|
||||||
kill -$sig $pid 2>/dev/null
|
|
||||||
|
|
||||||
[ $loop -eq 1 ] && run=true
|
|
||||||
done
|
|
||||||
|
|
||||||
let loop_limit--
|
|
||||||
[ $loop_limit -eq 0 ] && {
|
|
||||||
echo
|
|
||||||
echo "Failed to kill all processes."
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
done
|
|
||||||
echo
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
killall -9 telnetd
|
|
||||||
killall -9 dropbear
|
|
||||||
killall -9 ash
|
|
||||||
|
|
||||||
kill_remaining TERM
|
|
||||||
sleep 3
|
|
||||||
kill_remaining KILL 1
|
|
||||||
|
|
||||||
sleep 1
|
|
||||||
|
|
||||||
|
|
||||||
if [ -n "$IMAGE" ] && type 'platform_pre_upgrade' >/dev/null 2>/dev/null; then
|
|
||||||
IS_PRE_UPGRADE=1 platform_pre_upgrade "$IMAGE"
|
|
||||||
|
|
||||||
# Needs to be unset again because of busybox weirdness ...
|
|
||||||
IS_PRE_UPGRADE=
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -n "$(rootfs_type)" ]; then
|
|
||||||
echo "Switching to ramdisk..."
|
|
||||||
switch_to_ramfs
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Exec new shell from ramfs
|
|
||||||
exec /bin/busybox ash -c "$COMMAND"
|
|
||||||
@@ -1,15 +1,17 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
. /lib/functions.sh
|
. /lib/functions.sh
|
||||||
. /lib/functions/system.sh
|
. /lib/functions/system.sh
|
||||||
|
|
||||||
# initialize defaults
|
# initialize defaults
|
||||||
|
RAMFS_COPY_BIN="" # extra programs for temporary ramfs root
|
||||||
|
RAMFS_COPY_DATA="" # extra data files
|
||||||
export MTD_CONFIG_ARGS=""
|
export MTD_CONFIG_ARGS=""
|
||||||
export INTERACTIVE=0
|
export INTERACTIVE=0
|
||||||
export VERBOSE=1
|
export VERBOSE=1
|
||||||
export SAVE_CONFIG=1
|
export SAVE_CONFIG=1
|
||||||
export SAVE_OVERLAY=0
|
export SAVE_OVERLAY=0
|
||||||
export SAVE_PARTITIONS=1
|
export SAVE_PARTITIONS=1
|
||||||
|
export DELAY=
|
||||||
export CONF_IMAGE=
|
export CONF_IMAGE=
|
||||||
export CONF_BACKUP_LIST=0
|
export CONF_BACKUP_LIST=0
|
||||||
export CONF_BACKUP=
|
export CONF_BACKUP=
|
||||||
@@ -23,6 +25,7 @@ export TEST=0
|
|||||||
while [ -n "$1" ]; do
|
while [ -n "$1" ]; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
-i) export INTERACTIVE=1;;
|
-i) export INTERACTIVE=1;;
|
||||||
|
-d) export DELAY="$2"; shift;;
|
||||||
-v) export VERBOSE="$(($VERBOSE + 1))";;
|
-v) export VERBOSE="$(($VERBOSE + 1))";;
|
||||||
-q) export VERBOSE="$(($VERBOSE - 1))";;
|
-q) export VERBOSE="$(($VERBOSE - 1))";;
|
||||||
-n) export SAVE_CONFIG=0;;
|
-n) export SAVE_CONFIG=0;;
|
||||||
@@ -47,14 +50,16 @@ done
|
|||||||
export CONFFILES=/tmp/sysupgrade.conffiles
|
export CONFFILES=/tmp/sysupgrade.conffiles
|
||||||
export CONF_TAR=/tmp/sysupgrade.tgz
|
export CONF_TAR=/tmp/sysupgrade.tgz
|
||||||
|
|
||||||
IMAGE="$1"
|
export ARGV="$*"
|
||||||
|
export ARGC="$#"
|
||||||
|
|
||||||
[ -z "$IMAGE" -a -z "$NEED_IMAGE" -o $HELP -gt 0 ] && {
|
[ -z "$ARGV" -a -z "$NEED_IMAGE" -o $HELP -gt 0 ] && {
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
Usage: $0 [<upgrade-option>...] <image file or URL>
|
Usage: $0 [<upgrade-option>...] <image file or URL>
|
||||||
$0 [-q] [-i] <backup-command> <file>
|
$0 [-q] [-i] <backup-command> <file>
|
||||||
|
|
||||||
upgrade-option:
|
upgrade-option:
|
||||||
|
-d <delay> add a delay before rebooting
|
||||||
-f <config> restore configuration from .tar.gz (file or url)
|
-f <config> restore configuration from .tar.gz (file or url)
|
||||||
-i interactive mode
|
-i interactive mode
|
||||||
-c attempt to preserve all changed files in /etc/
|
-c attempt to preserve all changed files in /etc/
|
||||||
@@ -85,7 +90,7 @@ EOF
|
|||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
[ -n "$IMAGE" -a -n "$NEED_IMAGE" ] && {
|
[ -n "$ARGV" -a -n "$NEED_IMAGE" ] && {
|
||||||
cat <<-EOF
|
cat <<-EOF
|
||||||
-b|--create-backup and -r|--restore-backup do not perform a firmware upgrade.
|
-b|--create-backup and -r|--restore-backup do not perform a firmware upgrade.
|
||||||
Do not specify both -b|-r and a firmware image.
|
Do not specify both -b|-r and a firmware image.
|
||||||
@@ -96,38 +101,25 @@ EOF
|
|||||||
# prevent messages from clobbering the tarball when using stdout
|
# prevent messages from clobbering the tarball when using stdout
|
||||||
[ "$CONF_BACKUP" = "-" ] && export VERBOSE=0
|
[ "$CONF_BACKUP" = "-" ] && export VERBOSE=0
|
||||||
|
|
||||||
|
|
||||||
list_conffiles() {
|
|
||||||
awk '
|
|
||||||
BEGIN { conffiles = 0 }
|
|
||||||
/^Conffiles:/ { conffiles = 1; next }
|
|
||||||
!/^ / { conffiles = 0; next }
|
|
||||||
conffiles == 1 { print }
|
|
||||||
' /usr/lib/opkg/status
|
|
||||||
}
|
|
||||||
|
|
||||||
list_changed_conffiles() {
|
|
||||||
# Cannot handle spaces in filenames - but opkg cannot either...
|
|
||||||
list_conffiles | while read file csum; do
|
|
||||||
[ -r "$file" ] || continue
|
|
||||||
|
|
||||||
echo "${csum} ${file}" | sha256sum -sc - || echo "$file"
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
add_uci_conffiles() {
|
add_uci_conffiles() {
|
||||||
local file="$1"
|
local file="$1"
|
||||||
( find $(sed -ne '/^[[:space:]]*$/d; /^#/d; p' \
|
( find $(sed -ne '/^[[:space:]]*$/d; /^#/d; p' \
|
||||||
/etc/sysupgrade.conf /lib/upgrade/keep.d/* 2>/dev/null) \
|
/etc/sysupgrade.conf /lib/upgrade/keep.d/* 2>/dev/null) \
|
||||||
-type f -o -type l 2>/dev/null;
|
-type f -o -type l 2>/dev/null;
|
||||||
list_changed_conffiles ) | sort -u > "$file"
|
opkg list-changed-conffiles ) | sort -u > "$file"
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
add_overlayfiles() {
|
add_overlayfiles() {
|
||||||
local file="$1"
|
local file="$1"
|
||||||
find /overlay/upper/etc/ -type f -o -type l | sed \
|
if [ -d /overlay/upper ]; then
|
||||||
|
local overlaydir="/overlay/upper"
|
||||||
|
else
|
||||||
|
local overlaydir="/overlay"
|
||||||
|
fi
|
||||||
|
find $overlaydir/etc/ -type f -o -type l | sed \
|
||||||
-e 's,^/overlay\/upper/,/,' \
|
-e 's,^/overlay\/upper/,/,' \
|
||||||
|
-e 's,^/overlay/,/,' \
|
||||||
-e '\,/META_[a-zA-Z0-9]*$,d' \
|
-e '\,/META_[a-zA-Z0-9]*$,d' \
|
||||||
-e '\,/functions.sh$,d' \
|
-e '\,/functions.sh$,d' \
|
||||||
-e '\,/[^/]*-opkg$,d' \
|
-e '\,/[^/]*-opkg$,d' \
|
||||||
@@ -137,27 +129,21 @@ add_overlayfiles() {
|
|||||||
|
|
||||||
# hooks
|
# hooks
|
||||||
sysupgrade_image_check="fwtool_check_image platform_check_image"
|
sysupgrade_image_check="fwtool_check_image platform_check_image"
|
||||||
sysupgrade_pre_upgrade=""
|
sysupgrade_pre_upgrade="fwtool_pre_upgrade"
|
||||||
|
[ $SAVE_OVERLAY = 0 -o ! -d /overlay/etc ] && \
|
||||||
if [ $SAVE_OVERLAY = 1 ]; then
|
sysupgrade_init_conffiles="add_uci_conffiles" || \
|
||||||
[ ! -d /overlay/upper/etc ] && {
|
|
||||||
echo "Cannot find '/overlay/upper/etc', required for '-c'"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
sysupgrade_init_conffiles="add_overlayfiles"
|
sysupgrade_init_conffiles="add_overlayfiles"
|
||||||
else
|
|
||||||
sysupgrade_init_conffiles="add_uci_conffiles"
|
|
||||||
fi
|
|
||||||
|
|
||||||
include /lib/upgrade
|
include /lib/upgrade
|
||||||
|
|
||||||
|
[ "$1" = "nand" ] && nand_upgrade_stage2 $@
|
||||||
|
|
||||||
do_save_conffiles() {
|
do_save_conffiles() {
|
||||||
local conf_tar="${1:-$CONF_TAR}"
|
local conf_tar="${1:-$CONF_TAR}"
|
||||||
|
|
||||||
[ -z "$(rootfs_type)" ] && {
|
[ -z "$(rootfs_type)" ] && {
|
||||||
echo "Cannot save config while running from ramdisk."
|
echo "Cannot save config while running from ramdisk."
|
||||||
ask_bool 0 "Abort" && exit
|
ask_bool 0 "Abort" && exit
|
||||||
rm -f "$conf_tar"
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
run_hooks "$CONFFILES" $sysupgrade_init_conffiles
|
run_hooks "$CONFFILES" $sysupgrade_init_conffiles
|
||||||
@@ -166,17 +152,12 @@ do_save_conffiles() {
|
|||||||
v "Saving config files..."
|
v "Saving config files..."
|
||||||
[ "$VERBOSE" -gt 1 ] && TAR_V="v" || TAR_V=""
|
[ "$VERBOSE" -gt 1 ] && TAR_V="v" || TAR_V=""
|
||||||
tar c${TAR_V}zf "$conf_tar" -T "$CONFFILES" 2>/dev/null
|
tar c${TAR_V}zf "$conf_tar" -T "$CONFFILES" 2>/dev/null
|
||||||
if [ "$?" -ne 0 ]; then
|
|
||||||
echo "Failed to create the configuration backup."
|
|
||||||
rm -f "$conf_tar"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
rm -f "$CONFFILES"
|
rm -f "$CONFFILES"
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ $CONF_BACKUP_LIST -eq 1 ]; then
|
if [ $CONF_BACKUP_LIST -eq 1 ]; then
|
||||||
run_hooks "$CONFFILES" $sysupgrade_init_conffiles
|
add_uci_conffiles "$CONFFILES"
|
||||||
cat "$CONFFILES"
|
cat "$CONFFILES"
|
||||||
rm -f "$CONFFILES"
|
rm -f "$CONFFILES"
|
||||||
exit 0
|
exit 0
|
||||||
@@ -203,34 +184,8 @@ type platform_check_image >/dev/null 2>/dev/null || {
|
|||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
case "$IMAGE" in
|
|
||||||
http://*|\
|
|
||||||
https://*)
|
|
||||||
wget -O/tmp/sysupgrade.img "$IMAGE"
|
|
||||||
IMAGE=/tmp/sysupgrade.img
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
IMAGE="$(readlink -f "$IMAGE")"
|
|
||||||
|
|
||||||
case "$IMAGE" in
|
|
||||||
'')
|
|
||||||
echo "Image file not found."
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
/tmp/*) ;;
|
|
||||||
*)
|
|
||||||
v "Image not in /tmp, copying..."
|
|
||||||
cp -f "$IMAGE" /tmp/sysupgrade.img
|
|
||||||
IMAGE=/tmp/sysupgrade.img
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
export ARGV="$IMAGE"
|
|
||||||
export ARGC=1
|
|
||||||
|
|
||||||
for check in $sysupgrade_image_check; do
|
for check in $sysupgrade_image_check; do
|
||||||
( $check "$IMAGE" ) || {
|
( eval "$check \"\$ARGV\"" ) || {
|
||||||
if [ $FORCE -eq 1 ]; then
|
if [ $FORCE -eq 1 ]; then
|
||||||
echo "Image check '$check' failed but --force given - will update anyway!"
|
echo "Image check '$check' failed but --force given - will update anyway!"
|
||||||
break
|
break
|
||||||
@@ -256,7 +211,6 @@ elif ask_bool $SAVE_CONFIG "Keep config files over reflash"; then
|
|||||||
[ $TEST -eq 1 ] || do_save_conffiles
|
[ $TEST -eq 1 ] || do_save_conffiles
|
||||||
export SAVE_CONFIG=1
|
export SAVE_CONFIG=1
|
||||||
else
|
else
|
||||||
[ $TEST -eq 1 ] || rm -f "$CONF_TAR"
|
|
||||||
export SAVE_CONFIG=0
|
export SAVE_CONFIG=0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -264,26 +218,28 @@ if [ $TEST -eq 1 ]; then
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $SAVE_PARTITIONS -eq 0 ]; then
|
|
||||||
touch /tmp/sysupgrade.always.overwrite.bootdisk.partmap
|
|
||||||
else
|
|
||||||
rm -f /tmp/sysupgrade.always.overwrite.bootdisk.partmap
|
|
||||||
fi
|
|
||||||
|
|
||||||
run_hooks "" $sysupgrade_pre_upgrade
|
run_hooks "" $sysupgrade_pre_upgrade
|
||||||
|
|
||||||
install_bin /sbin/upgraded
|
# Some platforms/devices may want different sysupgrade process, e.g. without
|
||||||
v "Commencing upgrade. Closing all shell sessions."
|
# killing processes yet or calling ubus system upgrade method.
|
||||||
|
# This is needed e.g. on NAND devices where we just want to trigger stage1 at
|
||||||
COMMAND='. /lib/functions.sh; include /lib/upgrade; do_upgrade_stage2'
|
# this point.
|
||||||
|
if type 'platform_pre_upgrade' >/dev/null 2>/dev/null; then
|
||||||
if [ -n "$FAILSAFE" ]; then
|
platform_pre_upgrade "$ARGV"
|
||||||
printf '%s\x00%s\x00%s' "$RAM_ROOT" "$IMAGE" "$COMMAND" >/tmp/sysupgrade
|
fi
|
||||||
lock -u /tmp/.failsafe
|
|
||||||
else
|
ubus call system upgrade
|
||||||
ubus call system sysupgrade "{
|
touch /tmp/sysupgrade
|
||||||
\"prefix\": $(json_string "$RAM_ROOT"),
|
|
||||||
\"path\": $(json_string "$IMAGE"),
|
if [ ! -f /tmp/failsafe ] ; then
|
||||||
\"command\": $(json_string "$COMMAND")
|
kill_remaining TERM
|
||||||
}"
|
sleep 3
|
||||||
|
kill_remaining KILL
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "$(rootfs_type)" ]; then
|
||||||
|
v "Switching to ramdisk..."
|
||||||
|
run_ramfs '. /lib/functions.sh; include /lib/upgrade; do_upgrade'
|
||||||
|
else
|
||||||
|
do_upgrade
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
Usage: $0 [config|up|down|reload|status]
|
Usage: $0 [config|down|reload|status]
|
||||||
enables (default), disables or configures devices not yet configured.
|
enables (default), disables or configures devices not yet configured.
|
||||||
EOF
|
EOF
|
||||||
exit 1
|
exit 1
|
||||||
@@ -241,6 +241,5 @@ case "$1" in
|
|||||||
reload) wifi_reload "$2";;
|
reload) wifi_reload "$2";;
|
||||||
reload_legacy) wifi_reload_legacy "$2";;
|
reload_legacy) wifi_reload_legacy "$2";;
|
||||||
--help|help) usage;;
|
--help|help) usage;;
|
||||||
''|up) ubus call network reload; wifi_updown "enable" "$2";;
|
*) ubus call network reload; wifi_updown "enable" "$2";;
|
||||||
*) usage; exit 1;;
|
|
||||||
esac
|
esac
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
NAME="%D"
|
NAME="%D"
|
||||||
VERSION="%V"
|
VERSION="%V, %N"
|
||||||
ID="%d"
|
ID="%d"
|
||||||
ID_LIKE="lede openwrt"
|
ID_LIKE="lede openwrt"
|
||||||
PRETTY_NAME="%D %V"
|
PRETTY_NAME="%D %N %V"
|
||||||
VERSION_ID="%v"
|
VERSION_ID="%v"
|
||||||
HOME_URL="%u"
|
HOME_URL="%m"
|
||||||
BUG_URL="%b"
|
BUG_URL="%b"
|
||||||
SUPPORT_URL="%s"
|
SUPPORT_URL="%s"
|
||||||
BUILD_ID="%R"
|
BUILD_ID="%R"
|
||||||
@@ -15,4 +15,4 @@ LEDE_DEVICE_MANUFACTURER="%M"
|
|||||||
LEDE_DEVICE_MANUFACTURER_URL="%m"
|
LEDE_DEVICE_MANUFACTURER_URL="%m"
|
||||||
LEDE_DEVICE_PRODUCT="%P"
|
LEDE_DEVICE_PRODUCT="%P"
|
||||||
LEDE_DEVICE_REVISION="%h"
|
LEDE_DEVICE_REVISION="%h"
|
||||||
LEDE_RELEASE="%D %V %C"
|
LEDE_RELEASE="%D %N %V %C"
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
[ "$(uci -q get system.@system[0].ttylogin)" == 1 ] || exec /bin/ash --login
|
[ "$(uci get system.@system[0].ttylogin)" == 1 ] || exec /bin/ash --login
|
||||||
|
|
||||||
exec /bin/login
|
exec /bin/login
|
||||||
|
|||||||
@@ -158,11 +158,18 @@ if VERSIONOPT
|
|||||||
config VERSION_DIST
|
config VERSION_DIST
|
||||||
string
|
string
|
||||||
prompt "Release distribution"
|
prompt "Release distribution"
|
||||||
default "OpenWrt"
|
default "LEDE"
|
||||||
help
|
help
|
||||||
This is the name of the release distribution.
|
This is the name of the release distribution.
|
||||||
If unspecified, it defaults to OpenWrt.
|
If unspecified, it defaults to OpenWrt.
|
||||||
|
|
||||||
|
config VERSION_NICK
|
||||||
|
string
|
||||||
|
prompt "Release version nickname"
|
||||||
|
help
|
||||||
|
This is the release codename embedded in the image.
|
||||||
|
If unspecified, it defaults to the name of source branch.
|
||||||
|
|
||||||
config VERSION_NUMBER
|
config VERSION_NUMBER
|
||||||
string
|
string
|
||||||
prompt "Release version number"
|
prompt "Release version number"
|
||||||
@@ -183,7 +190,7 @@ if VERSIONOPT
|
|||||||
config VERSION_REPO
|
config VERSION_REPO
|
||||||
string
|
string
|
||||||
prompt "Release repository"
|
prompt "Release repository"
|
||||||
default "http://downloads.openwrt.org/releases/18.06.2"
|
default "http://downloads.lede-project.org/releases/17.01.1"
|
||||||
help
|
help
|
||||||
This is the repository address embedded in the image, it defaults
|
This is the repository address embedded in the image, it defaults
|
||||||
to the trunk snapshot repo; the url may contain the following placeholders:
|
to the trunk snapshot repo; the url may contain the following placeholders:
|
||||||
@@ -192,22 +199,18 @@ if VERSIONOPT
|
|||||||
%v .. Configured release version number or "snapshot", lowercase
|
%v .. Configured release version number or "snapshot", lowercase
|
||||||
%C .. Configured release revision code or value of %R, uppercase
|
%C .. Configured release revision code or value of %R, uppercase
|
||||||
%c .. Configured release revision code or value of %R, lowercase
|
%c .. Configured release revision code or value of %R, lowercase
|
||||||
%D .. Distribution name or "OpenWrt", uppercase
|
%N .. Release name, uppercase
|
||||||
%d .. Distribution name or "openwrt", lowercase
|
%n .. Release name, lowercase
|
||||||
|
%D .. Distribution name or "Lede", uppercase
|
||||||
|
%d .. Distribution name or "lede", lowercase
|
||||||
%T .. Target name
|
%T .. Target name
|
||||||
%S .. Target/Subtarget name
|
%S .. Target/Subtarget name
|
||||||
%A .. Package architecture
|
%A .. Package architecture
|
||||||
%t .. Build taint flags, e.g. "no-all busybox"
|
%t .. Build taint flags, e.g. "no-all busybox"
|
||||||
%M .. Manufacturer name or "OpenWrt"
|
%M .. Manufacturer name or "Lede"
|
||||||
%P .. Product name or "Generic"
|
%P .. Product name or "Generic"
|
||||||
%h .. Hardware revision or "v0"
|
%h .. Hardware revision or "v0"
|
||||||
|
|
||||||
config VERSION_HOME_URL
|
|
||||||
string
|
|
||||||
prompt "Release Homepage"
|
|
||||||
help
|
|
||||||
This is the release version homepage
|
|
||||||
|
|
||||||
config VERSION_MANUFACTURER
|
config VERSION_MANUFACTURER
|
||||||
string
|
string
|
||||||
prompt "Manufacturer name"
|
prompt "Manufacturer name"
|
||||||
@@ -274,4 +277,18 @@ menuconfig PER_FEED_REPO
|
|||||||
If set, a separate repository is generated within bin/*/packages/
|
If set, a separate repository is generated within bin/*/packages/
|
||||||
for the core packages and each enabled feed.
|
for the core packages and each enabled feed.
|
||||||
|
|
||||||
|
config PER_FEED_REPO_ADD_DISABLED
|
||||||
|
bool "Add available but not enabled feeds to opkg.conf"
|
||||||
|
default y
|
||||||
|
depends on PER_FEED_REPO
|
||||||
|
help
|
||||||
|
Add not installed or disabled feeds from feeds.conf to opkg.conf.
|
||||||
|
|
||||||
|
config PER_FEED_REPO_ADD_COMMENTED
|
||||||
|
bool "Comment out not enabled feeds"
|
||||||
|
default !BUILDBOT
|
||||||
|
depends on PER_FEED_REPO && PER_FEED_REPO_ADD_DISABLED
|
||||||
|
help
|
||||||
|
Add not enabled feeds as commented out source lines to opkg.conf.
|
||||||
|
|
||||||
source "tmp/.config-feeds.in"
|
source "tmp/.config-feeds.in"
|
||||||
|
|||||||
@@ -56,8 +56,7 @@ define Package/apex/install
|
|||||||
endef
|
endef
|
||||||
|
|
||||||
define Build/InstallDev
|
define Build/InstallDev
|
||||||
$(INSTALL_DIR) $(STAGING_DIR_IMAGE)
|
$(CP) $(PKG_BUILD_DIR)/out/*.bin $(KERNEL_BUILD_DIR)
|
||||||
$(CP) $(PKG_BUILD_DIR)/out/*.bin $(STAGING_DIR_IMAGE)/
|
|
||||||
endef
|
endef
|
||||||
|
|
||||||
$(eval $(call BuildPackage,apex))
|
$(eval $(call BuildPackage,apex))
|
||||||
|
|||||||
@@ -1,51 +0,0 @@
|
|||||||
#
|
|
||||||
# Copyright (C) 2017 Hauke Mehrtens
|
|
||||||
#
|
|
||||||
# This is free software, licensed under the GNU General Public License v2.
|
|
||||||
# See /LICENSE for more information.
|
|
||||||
#
|
|
||||||
|
|
||||||
include $(TOPDIR)/rules.mk
|
|
||||||
|
|
||||||
PKG_NAME:=arm-trusted-firmware-sunxi
|
|
||||||
PKG_RELEASE:=1
|
|
||||||
|
|
||||||
PKG_SOURCE_PROTO:=git
|
|
||||||
PKG_SOURCE_URL=https://github.com/apritzel/arm-trusted-firmware
|
|
||||||
PKG_SOURCE_DATE:=2018-02-04
|
|
||||||
PKG_SOURCE_VERSION:=ae78724247a01560164d607ed66db111c74d8df0
|
|
||||||
PKG_MIRROR_HASH:=e4ddc3294f86c1e163d683a2322427bbdd5b63762ead4b1792b34df75d7bda28
|
|
||||||
|
|
||||||
PKG_LICENSE:=BSD-3-Clause
|
|
||||||
PKG_LICENSE_FILES:=license.md
|
|
||||||
|
|
||||||
PKG_MAINTAINER:=Hauke Mehrtens <hauke@hauke-m.de>
|
|
||||||
|
|
||||||
include $(INCLUDE_DIR)/package.mk
|
|
||||||
|
|
||||||
|
|
||||||
define Package/arm-trusted-firmware-sunxi
|
|
||||||
SECTION:=boot
|
|
||||||
CATEGORY:=Boot Loaders
|
|
||||||
TITLE:=ARM Trusted Firmware for Allwinner
|
|
||||||
DEPENDS:=@TARGET_sunxi_cortexa53
|
|
||||||
endef
|
|
||||||
|
|
||||||
export GCC_HONOUR_COPTS=s
|
|
||||||
|
|
||||||
MAKE_VARS = \
|
|
||||||
CROSS_COMPILE="$(TARGET_CROSS)"
|
|
||||||
|
|
||||||
MAKE_FLAGS += \
|
|
||||||
PLAT=sun50iw1p1 \
|
|
||||||
bl31
|
|
||||||
|
|
||||||
define Build/InstallDev
|
|
||||||
$(INSTALL_DIR) $(STAGING_DIR_IMAGE)
|
|
||||||
$(CP) $(PKG_BUILD_DIR)/build/sun50iw1p1/release/bl31.bin $(STAGING_DIR_IMAGE)/bl31.bin
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Package/arm-trusted-firmware-sunxi/install
|
|
||||||
endef
|
|
||||||
|
|
||||||
$(eval $(call BuildPackage,arm-trusted-firmware-sunxi))
|
|
||||||
@@ -1,128 +0,0 @@
|
|||||||
#
|
|
||||||
# Copyright (C) 2016 Microchip Technology Inc.
|
|
||||||
# <Sandeepsheriker.mallikarjun@microchip.com>
|
|
||||||
#
|
|
||||||
# This is free software, licensed under the GNU General Public License v2.
|
|
||||||
# See /LICENSE for more information.
|
|
||||||
#
|
|
||||||
|
|
||||||
include $(TOPDIR)/rules.mk
|
|
||||||
|
|
||||||
PKG_NAME:=at91bootstrap
|
|
||||||
PKG_VERSION:=v3.8.10
|
|
||||||
PKG_RELEASE:=
|
|
||||||
|
|
||||||
PKG_SOURCE_PROTO:=git
|
|
||||||
PKG_SOURCE_URL:=https://github.com/linux4sam/at91bootstrap.git
|
|
||||||
PKG_SOURCE_VERSION:=04efa5500d60a0211d14b6ee60df7ce0a828704d
|
|
||||||
|
|
||||||
PKG_BUILD_DIR = \
|
|
||||||
$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
|
|
||||||
|
|
||||||
include at91bootstrap.mk
|
|
||||||
include $(INCLUDE_DIR)/package.mk
|
|
||||||
|
|
||||||
define AT91Bootstrap/Default
|
|
||||||
BUILD_TARGET:=at91
|
|
||||||
HIDDEN:=1
|
|
||||||
AT91BOOTSTRAP_IMAGE:=at91bootstrap.bin
|
|
||||||
endef
|
|
||||||
|
|
||||||
define AT91Bootstrap/sama5d2_xplaineddf_uboot
|
|
||||||
TITLE:=AT91Bootstrap for SAMA5D2 Xplained board (SPI Flash)
|
|
||||||
BUILD_SUBTARGET:=sama5d2
|
|
||||||
BUILD_DEVICES:=at91-sama5d2_xplained
|
|
||||||
endef
|
|
||||||
|
|
||||||
define AT91Bootstrap/sama5d2_xplaineddf_qspi_uboot
|
|
||||||
TITLE:=AT91Bootstrap for SAMA5D2 Xplained board (QSPI Flash)
|
|
||||||
BUILD_SUBTARGET:=sama5d2
|
|
||||||
BUILD_DEVICES:=at91-sama5d2_xplained
|
|
||||||
endef
|
|
||||||
|
|
||||||
define AT91Bootstrap/sama5d2_xplainedsd_uboot
|
|
||||||
TITLE:=AT91Bootstrap for SAMA5D2 Xplained board (SDcard/EMMC)
|
|
||||||
BUILD_SUBTARGET:=sama5d2
|
|
||||||
BUILD_DEVICES:=at91-sama5d2_xplained
|
|
||||||
endef
|
|
||||||
|
|
||||||
define AT91Bootstrap/sama5d3_xplainednf_uboot
|
|
||||||
TITLE:=AT91Bootstrap for SAMA5D3 Xplained board (Nand Flash)
|
|
||||||
BUILD_SUBTARGET:=sama5d3
|
|
||||||
BUILD_DEVICES:=at91-sama5d3_xplained
|
|
||||||
endef
|
|
||||||
|
|
||||||
define AT91Bootstrap/sama5d3_xplainedsd_uboot
|
|
||||||
TITLE:=AT91Bootstrap for SAMA5D3 Xplained board (SDcard)
|
|
||||||
BUILD_SUBTARGET:=sama5d3
|
|
||||||
BUILD_DEVICES:=at91-sama5d3_xplained
|
|
||||||
endef
|
|
||||||
|
|
||||||
define AT91Bootstrap/sama5d4_xplainednf_uboot_secure
|
|
||||||
TITLE:=AT91Bootstrap for SAMA5D4 Xplained board (Nand Flash)
|
|
||||||
BUILD_SUBTARGET:=sama5d4
|
|
||||||
BUILD_DEVICES:=at91-sama5d4_xplained
|
|
||||||
endef
|
|
||||||
|
|
||||||
define AT91Bootstrap/sama5d4_xplaineddf_uboot_secure
|
|
||||||
TITLE:=AT91Bootstrap for SAMA5D4 Xplained board (SPI Flash)
|
|
||||||
BUILD_SUBTARGET:=sama5d4
|
|
||||||
BUILD_DEVICES:=at91-sama5d4_xplained
|
|
||||||
endef
|
|
||||||
|
|
||||||
define AT91Bootstrap/sama5d4_xplainedsd_uboot_secure
|
|
||||||
TITLE:=AT91Bootstrap for SAMA5D4 Xplained board (SDcard)
|
|
||||||
BUILD_SUBTARGET:=sama5d4
|
|
||||||
BUILD_DEVICES:=at91-sama5d4_xplained
|
|
||||||
endef
|
|
||||||
|
|
||||||
define AT91Bootstrap/sama5d27_som1_eksd_uboot
|
|
||||||
TITLE:=AT91Bootstrap for SAMA5D27 SOM1 Ek (SDcard0)
|
|
||||||
BUILD_SUBTARGET:=sama5d2
|
|
||||||
BUILD_DEVICES:=at91-sama5d27_som1_ek
|
|
||||||
endef
|
|
||||||
|
|
||||||
define AT91Bootstrap/sama5d27_som1_eksd1_uboot
|
|
||||||
TITLE:=AT91Bootstrap for SAMA5D27 SOM1 Ek (SDcard1)
|
|
||||||
BUILD_SUBTARGET:=sama5d2
|
|
||||||
BUILD_DEVICES:=at91-sama5d27_som1_ek
|
|
||||||
endef
|
|
||||||
|
|
||||||
define AT91Bootstrap/sama5d27_som1_ekqspi_uboot
|
|
||||||
TITLE:=AT91Bootstrap for SAMA5D27 SOM1 Ek (QSPI Flash)
|
|
||||||
BUILD_SUBTARGET:=sama5d2
|
|
||||||
BUILD_DEVICES:=at91-sama5d27_som1_ek
|
|
||||||
endef
|
|
||||||
|
|
||||||
define AT91Bootstrap/sama5d2_ptc_eknf_uboot
|
|
||||||
TITLE:=AT91Bootstrap for SAMA5D2 PTC EK (Nand Flash)
|
|
||||||
BUILD_SUBTARGET:=sama5d2
|
|
||||||
BUILD_DEVICES:=at91-sama5d2_ptc_ek
|
|
||||||
endef
|
|
||||||
|
|
||||||
define AT91Bootstrap/sama5d2_ptc_eksd_uboot
|
|
||||||
TITLE:=AT91Bootstrap for SAMA5D2 PTC EK (SDCard)
|
|
||||||
BUILD_SUBTARGET:=sama5d2
|
|
||||||
BUILD_DEVICES:=at91-sama5d2_ptc_ek
|
|
||||||
endef
|
|
||||||
|
|
||||||
AT91BOOTSTRAP_TARGETS := \
|
|
||||||
sama5d2_xplaineddf_uboot \
|
|
||||||
sama5d2_xplaineddf_qspi_uboot \
|
|
||||||
sama5d2_xplainedsd_uboot \
|
|
||||||
sama5d3_xplainednf_uboot \
|
|
||||||
sama5d3_xplainedsd_uboot \
|
|
||||||
sama5d4_xplainednf_uboot_secure \
|
|
||||||
sama5d4_xplaineddf_uboot_secure \
|
|
||||||
sama5d4_xplainedsd_uboot_secure \
|
|
||||||
sama5d27_som1_eksd_uboot \
|
|
||||||
sama5d27_som1_ekqspi_uboot \
|
|
||||||
sama5d2_ptc_eknf_uboot \
|
|
||||||
sama5d2_ptc_eksd_uboot
|
|
||||||
|
|
||||||
define Build/Compile
|
|
||||||
+$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
|
|
||||||
CROSS_COMPILE=$(TARGET_CROSS)
|
|
||||||
endef
|
|
||||||
|
|
||||||
$(eval $(call BuildPackage/AT91Bootstrap))
|
|
||||||
@@ -1,88 +0,0 @@
|
|||||||
|
|
||||||
PKG_TARGETS := bin
|
|
||||||
PKG_FLAGS:=nonshared
|
|
||||||
|
|
||||||
export GCC_HONOUR_COPTS=s
|
|
||||||
|
|
||||||
define Package/at91bootstrap/install/default
|
|
||||||
$(CP) -avL $(PKG_BUILD_DIR)/binaries/at91bootstrap.bin $(1)/
|
|
||||||
endef
|
|
||||||
|
|
||||||
Package/at91bootstrap/install = $(Package/at91bootstrap/install/default)
|
|
||||||
|
|
||||||
define AT91Bootstrap/Init
|
|
||||||
BUILD_TARGET:=
|
|
||||||
BUILD_SUBTARGET:=
|
|
||||||
BUILD_DEVICES:=
|
|
||||||
NAME:=
|
|
||||||
DEPENDS:=
|
|
||||||
HIDDEN:=
|
|
||||||
DEFAULT:=
|
|
||||||
VARIANT:=$(1)
|
|
||||||
AT91BOOTSTRAP_CONFIG:=$(1)
|
|
||||||
endef
|
|
||||||
|
|
||||||
TARGET_DEP = TARGET_$(BUILD_TARGET)$(if $(BUILD_SUBTARGET),_$(BUILD_SUBTARGET))
|
|
||||||
|
|
||||||
AT91BOOTSTRAP_MAKE_FLAGS = \
|
|
||||||
HOSTCC="$(HOSTCC)" \
|
|
||||||
HOSTCFLAGS="$(HOST_CFLAGS) $(HOST_CPPFLAGS)" \
|
|
||||||
HOSTLDFLAGS=""
|
|
||||||
|
|
||||||
define Build/AT91Bootstrap/Target
|
|
||||||
$(eval $(call AT91Bootstrap/Init,$(1)))
|
|
||||||
$(eval $(call AT91Bootstrap/Default,$(1)))
|
|
||||||
$(eval $(call AT91Bootstrap/$(1),$(1)))
|
|
||||||
|
|
||||||
define Package/at91bootstrap-$(1)
|
|
||||||
SECTION:=boot
|
|
||||||
CATEGORY:=Boot Loaders
|
|
||||||
TITLE:= .$(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://www.at91.com/linux4sam/bin/view/Linux4SAM/AT91Bootstrap
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Package/at91bootstrap-$(1)/install
|
|
||||||
$$(Package/at91bootstrap/install)
|
|
||||||
endef
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Build/Configure/AT91Bootstrap
|
|
||||||
+$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
|
|
||||||
$(AT91BOOTSTRAP_CONFIG)_defconfig
|
|
||||||
endef
|
|
||||||
|
|
||||||
|
|
||||||
define Build/Compile/AT91Bootstrap
|
|
||||||
+$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
|
|
||||||
CROSS_COMPILE=$(TARGET_CROSS) \
|
|
||||||
$(AT91BOOTSTRAP_MAKE_FLAGS)
|
|
||||||
endef
|
|
||||||
|
|
||||||
define BuildPackage/AT91Bootstrap/Defaults
|
|
||||||
Build/Configure/Default = $$$$(Build/Configure/AT91Bootstrap)
|
|
||||||
Build/Compile/Default = $$$$(Build/Compile/AT91Bootstrap)
|
|
||||||
endef
|
|
||||||
|
|
||||||
define BuildPackage/AT91Bootstrap
|
|
||||||
$(eval $(call BuildPackage/AT91Bootstrap/Defaults))
|
|
||||||
$(foreach type,$(if $(DUMP),$(AT91BOOTSTRAP_TARGETS),$(BUILD_VARIANT)), \
|
|
||||||
$(eval $(call Build/AT91Bootstrap/Target,$(type)))
|
|
||||||
)
|
|
||||||
$(eval $(call Build/DefaultTargets))
|
|
||||||
$(foreach type,$(if $(DUMP),$(AT91BOOTSTRAP_TARGETS),$(BUILD_VARIANT)), \
|
|
||||||
$(call BuildPackage,at91bootstrap-$(type))
|
|
||||||
)
|
|
||||||
endef
|
|
||||||
@@ -9,13 +9,15 @@ include $(TOPDIR)/rules.mk
|
|||||||
include $(INCLUDE_DIR)/kernel.mk
|
include $(INCLUDE_DIR)/kernel.mk
|
||||||
|
|
||||||
PKG_NAME:=grub
|
PKG_NAME:=grub
|
||||||
PKG_CPE_ID:=cpe:/a:gnu:grub2
|
PKG_VERSION:=2.02~rc1
|
||||||
PKG_VERSION:=2.02
|
PKG_RELEASE:=1
|
||||||
PKG_RELEASE:=2
|
|
||||||
|
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||||
PKG_SOURCE_URL:=@GNU/grub
|
PKG_SOURCE_URL:=http://alpha.gnu.org/gnu/grub \
|
||||||
PKG_HASH:=810b3798d316394f94096ec2797909dbf23c858e48f7b3830826b8daa06b7b0f
|
http://gnualpha.uib.no/grub/ \
|
||||||
|
http://mirrors.fe.up.pt/pub/gnu-alpha/grub/ \
|
||||||
|
http://www.nic.funet.fi/pub/gnu/alpha/gnu/grub/
|
||||||
|
PKG_HASH:=445239e9b96d1143c194c1d37851cf4196b83701c60172e49665e9d453d80278
|
||||||
|
|
||||||
PKG_FIXUP:=autoreconf
|
PKG_FIXUP:=autoreconf
|
||||||
HOST_BUILD_PARALLEL:=1
|
HOST_BUILD_PARALLEL:=1
|
||||||
@@ -60,8 +62,7 @@ CONFIGURE_ARGS += \
|
|||||||
--disable-nls \
|
--disable-nls \
|
||||||
--disable-device-mapper \
|
--disable-device-mapper \
|
||||||
--disable-libzfs \
|
--disable-libzfs \
|
||||||
--disable-grub-mkfont \
|
--disable-grub-mkfont
|
||||||
--with-platform=none
|
|
||||||
|
|
||||||
HOST_CONFIGURE_VARS += \
|
HOST_CONFIGURE_VARS += \
|
||||||
grub_build_mkfont_excuse="don't want fonts"
|
grub_build_mkfont_excuse="don't want fonts"
|
||||||
|
|||||||
@@ -1,40 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Hector Marco-Gisbert <hecmargi@upv.es>
|
|
||||||
Date: Fri, 13 Nov 2015 16:21:09 +0100
|
|
||||||
Subject: [PATCH] Fix security issue when reading username and password
|
|
||||||
|
|
||||||
This patch fixes two integer underflows at:
|
|
||||||
* grub-core/lib/crypto.c
|
|
||||||
* grub-core/normal/auth.c
|
|
||||||
|
|
||||||
Resolves: CVE-2015-8370
|
|
||||||
|
|
||||||
Signed-off-by: Hector Marco-Gisbert <hecmargi@upv.es>
|
|
||||||
Signed-off-by: Ismael Ripoll-Ripoll <iripoll@disca.upv.es>
|
|
||||||
---
|
|
||||||
grub-core/lib/crypto.c | 2 +-
|
|
||||||
grub-core/normal/auth.c | 2 +-
|
|
||||||
2 files changed, 2 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
--- a/grub-core/lib/crypto.c
|
|
||||||
+++ b/grub-core/lib/crypto.c
|
|
||||||
@@ -468,7 +468,7 @@ grub_password_get (char buf[], unsigned
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
- if (key == '\b')
|
|
||||||
+ if (key == '\b' && cur_len)
|
|
||||||
{
|
|
||||||
if (cur_len)
|
|
||||||
cur_len--;
|
|
||||||
--- a/grub-core/normal/auth.c
|
|
||||||
+++ b/grub-core/normal/auth.c
|
|
||||||
@@ -172,7 +172,7 @@ grub_username_get (char buf[], unsigned
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
- if (key == '\b')
|
|
||||||
+ if (key == '\b' && cur_len)
|
|
||||||
{
|
|
||||||
if (cur_len)
|
|
||||||
{
|
|
||||||
@@ -1,5 +1,12 @@
|
|||||||
menu "Configuration"
|
menu "Configuration"
|
||||||
depends on PACKAGE_kexec
|
depends on PACKAGE_kexec-tools
|
||||||
|
|
||||||
|
config KEXEC_TOOLS_kdump
|
||||||
|
bool
|
||||||
|
prompt "kdump support"
|
||||||
|
default n
|
||||||
|
help
|
||||||
|
Include the kdump utility.
|
||||||
|
|
||||||
config KEXEC_ZLIB
|
config KEXEC_ZLIB
|
||||||
bool
|
bool
|
||||||
|
|||||||
@@ -8,12 +8,12 @@
|
|||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=kexec-tools
|
PKG_NAME:=kexec-tools
|
||||||
PKG_VERSION:=2.0.16
|
PKG_VERSION:=2.0.14-rc1
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=1
|
||||||
|
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||||
PKG_SOURCE_URL:=@KERNEL/linux/utils/kernel/kexec
|
PKG_SOURCE_URL:=@KERNEL/linux/utils/kernel/kexec
|
||||||
PKG_HASH:=5b103351ad752c9badd1d65b00eb6de4bce579f944f4df4e3ef3a755ba567010
|
PKG_HASH:=3fc505ff8d8a2d24c68aac5e6b4783997d5a086966ff3de8b05a0ceb27e5e23b
|
||||||
|
|
||||||
PKG_FIXUP:=autoreconf
|
PKG_FIXUP:=autoreconf
|
||||||
|
|
||||||
@@ -21,49 +21,22 @@ PKG_CONFIG_DEPENDS := CONFIG_KEXEC_ZLIB CONFIG_KEXEC_LZMA
|
|||||||
|
|
||||||
include $(INCLUDE_DIR)/package.mk
|
include $(INCLUDE_DIR)/package.mk
|
||||||
|
|
||||||
define Package/kexec-tools/Default
|
define Package/kexec-tools
|
||||||
SECTION:=utils
|
SECTION:=utils
|
||||||
CATEGORY:=Utilities
|
CATEGORY:=Utilities
|
||||||
|
DEPENDS:=@armeb||@arm||@i386||@x86_64||@powerpc64||@mipsel||@mips +KEXEC_ZLIB:zlib +KEXEC_LZMA:liblzma
|
||||||
|
TITLE:=Kernel boots kernel
|
||||||
URL:=http://kernel.org/pub/linux/kernel/people/horms/kexec-tools/
|
URL:=http://kernel.org/pub/linux/kernel/people/horms/kexec-tools/
|
||||||
MAINTAINER:=Florian Fainelli <florian@openwrt.org>
|
MAINTAINER:=Florian Fainelli <florian@openwrt.org>
|
||||||
endef
|
MENU:=1
|
||||||
|
|
||||||
define Package/kexec-tools
|
|
||||||
$(call Package/kexec-tools/Default)
|
|
||||||
TITLE:=kexec-tools transition meta package
|
|
||||||
DEPENDS:=+kexec
|
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Package/kexec-tools/description
|
define Package/kexec-tools/description
|
||||||
kexec is a set of system calls that allows you to load
|
kexec is a set of systems call that allows you to load
|
||||||
another kernel from the currently executing Linux kernel.
|
another kernel from the currently executing Linux kernel.
|
||||||
The kexec utility allows to load and boot another kernel.
|
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Package/kexec
|
define Package/kexec-tools/config
|
||||||
$(call Package/kexec-tools/Default)
|
|
||||||
TITLE:=Kernel boots kernel
|
|
||||||
DEPENDS:=\
|
|
||||||
@armeb||@arm||@i386||@x86_64||@powerpc64||@mipsel||@mips \
|
|
||||||
+KEXEC_ZLIB:zlib +KEXEC_LZMA:liblzma @KERNEL_KEXEC
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Package/kexec/description
|
|
||||||
The kexec utility allows to load and boot another kernel.
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Package/kdump
|
|
||||||
$(call Package/kexec-tools/Default)
|
|
||||||
TITLE:=Kernel crash analysis
|
|
||||||
DEPENDS:=+kexec @i386||@x86_64||@arm @KERNEL_CRASH_DUMP
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Package/kdump/description
|
|
||||||
The kdump package allows to automatically boot into a
|
|
||||||
special kernel for analyzing kernel crashes using kdump.
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Package/kexec/config
|
|
||||||
source "$(SOURCE)/Config.in"
|
source "$(SOURCE)/Config.in"
|
||||||
endef
|
endef
|
||||||
|
|
||||||
@@ -92,45 +65,24 @@ CONFIGURE_VARS += \
|
|||||||
BUILD_CC="$(HOSTCC)" \
|
BUILD_CC="$(HOSTCC)" \
|
||||||
TARGET_CC="$(TARGET_CC)"
|
TARGET_CC="$(TARGET_CC)"
|
||||||
|
|
||||||
|
kexec-extra-sbin-$(CONFIG_KEXEC_TOOLS_kdump) += kdump
|
||||||
|
|
||||||
define Build/Compile
|
define Build/Compile
|
||||||
$(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" all install
|
$(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" all install
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Package/kexec-tools/install
|
define Package/kexec-tools/install
|
||||||
:
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Package/kexec/install
|
|
||||||
$(INSTALL_DIR) $(1)/usr/sbin
|
$(INSTALL_DIR) $(1)/usr/sbin
|
||||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kexec $(1)/usr/sbin
|
$(INSTALL_BIN) \
|
||||||
|
$(addprefix $(PKG_INSTALL_DIR)/usr/sbin/, \
|
||||||
|
$(kexec-extra-sbin-y)) \
|
||||||
|
$(kexec-extra-bin-y) \
|
||||||
|
$(PKG_INSTALL_DIR)/usr/sbin/kexec \
|
||||||
|
$(1)/usr/sbin
|
||||||
|
|
||||||
# make a link for compatability with other distros
|
# make a link for compatability with other distros
|
||||||
$(INSTALL_DIR) $(1)/sbin
|
$(INSTALL_DIR) $(1)/sbin
|
||||||
$(LN) ../usr/sbin/kexec $(1)/sbin/kexec
|
$(LN) ../usr/sbin/kexec $(1)/sbin/kexec
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Package/kdump/install
|
|
||||||
$(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/init.d $(1)/etc/config $(1)/etc/uci-defaults
|
|
||||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kdump $(PKG_INSTALL_DIR)/usr/sbin/vmcore-dmesg $(1)/usr/sbin
|
|
||||||
$(INSTALL_BIN) ./files/kdump.init $(1)/etc/init.d/kdump
|
|
||||||
$(INSTALL_BIN) ./files/kdump.defaults $(1)/etc/uci-defaults/kdump
|
|
||||||
$(INSTALL_CONF) ./files/kdump.config $(1)/etc/config/kdump
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Package/kdump/prerm
|
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
case $$(uname -m) in
|
|
||||||
i?86|x86_64)
|
|
||||||
if grep -q " crashkernel=" /boot/grub/grub.cfg; then
|
|
||||||
mount /boot -o remount,rw
|
|
||||||
sed -i 's/ crashkernel=[^ ]*//' /boot/grub/grub.cfg
|
|
||||||
mount /boot -o remount,ro
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
endef
|
|
||||||
|
|
||||||
$(eval $(call BuildPackage,kexec-tools))
|
$(eval $(call BuildPackage,kexec-tools))
|
||||||
$(eval $(call BuildPackage,kexec))
|
|
||||||
$(eval $(call BuildPackage,kdump))
|
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
|
|
||||||
config kdump
|
|
||||||
option enabled '1'
|
|
||||||
option save_dmesg '1'
|
|
||||||
option save_vmcore '0'
|
|
||||||
# using an external partition to store vmcore is highly recommended!
|
|
||||||
# option path '/mnt/crashdump'
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
case $(uname -m) in
|
|
||||||
i?86|x86_64)
|
|
||||||
if ! grep -q crashkernel /boot/grub/grub.cfg; then
|
|
||||||
mount /boot -o remount,rw
|
|
||||||
sed -i 's/linux.*/& crashkernel=32M@32M/' /boot/grub/grub.cfg
|
|
||||||
mount /boot -o remount,ro
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
@@ -1,184 +0,0 @@
|
|||||||
#!/bin/sh /etc/rc.common
|
|
||||||
|
|
||||||
START=41
|
|
||||||
STOP=98
|
|
||||||
|
|
||||||
EXTRA_COMMANDS="status"
|
|
||||||
EXTRA_HELP=" status Print crashkernel status"
|
|
||||||
|
|
||||||
verify_kdump() {
|
|
||||||
local cfg="$1"
|
|
||||||
local enabled
|
|
||||||
local path
|
|
||||||
local save_vmcore
|
|
||||||
local save_dmesg
|
|
||||||
|
|
||||||
config_get_bool enabled "$cfg" enabled 1
|
|
||||||
config_get_bool save_dmesg "$cfg" save_dmesg 1
|
|
||||||
config_get_bool save_vmcore "$cfg" save_vmcore 0
|
|
||||||
|
|
||||||
[ "$enabled" -gt 0 ] || return 2
|
|
||||||
|
|
||||||
[ "$save_dmesg" -gt 0 ] || [ "$save_vmcore" -gt 0 ] || return 2
|
|
||||||
|
|
||||||
config_get path "$cfg" path "/"
|
|
||||||
|
|
||||||
[ -d "$path" ] || mkdir -p "$path" 2>/dev/null || return 1
|
|
||||||
}
|
|
||||||
|
|
||||||
run_kdump() {
|
|
||||||
local cfg="$1"
|
|
||||||
local enabled
|
|
||||||
local path
|
|
||||||
local save_vmcore
|
|
||||||
local save_dmesg
|
|
||||||
|
|
||||||
config_get_bool enabled "$cfg" enabled 1
|
|
||||||
[ "$enabled" -gt 0 ] || return
|
|
||||||
|
|
||||||
config_get_bool save_dmesg "$cfg" save_dmesg 1
|
|
||||||
config_get_bool save_vmcore "$cfg" save_vmcore 0
|
|
||||||
config_get path "$cfg" path "/"
|
|
||||||
|
|
||||||
timestamp=$(date "+%Y%m%dT%H%M%S")
|
|
||||||
|
|
||||||
if [ "$save_vmcore" -eq 1 ]; then
|
|
||||||
echo -n "Saving vmcore (this may take a while)..."
|
|
||||||
# would like 'sparse' but busybox doesn't support it
|
|
||||||
dd if=/proc/vmcore of="$path/vmcore-$timestamp" conv=fsync bs=1M
|
|
||||||
echo " done"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$save_dmesg" -eq 1 ]; then
|
|
||||||
vmcore-dmesg /proc/vmcore > "$path/dmesg-$timestamp"
|
|
||||||
fi
|
|
||||||
|
|
||||||
sync
|
|
||||||
reboot -f
|
|
||||||
}
|
|
||||||
|
|
||||||
find_kernel() {
|
|
||||||
. /lib/functions.sh
|
|
||||||
local kernel
|
|
||||||
|
|
||||||
kernel="$BOOT_IMAGE"
|
|
||||||
if [ -r "$kernel" ]; then
|
|
||||||
echo $kernel
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
kernel="$(find_mtd_part kernel)"
|
|
||||||
if [ -r "$kernel" ]; then
|
|
||||||
echo $kernel
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
for voldir in /sys/class/ubi/ubi*_*; do
|
|
||||||
[ ! -e "$voldir" ] && continue
|
|
||||||
if [ "$(cat "${voldir}/name")" = "kernel" ]; then
|
|
||||||
kernel="/dev/$(basename "$voldir")"
|
|
||||||
echo $kernel
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
return 1
|
|
||||||
}
|
|
||||||
|
|
||||||
load_crashkernel() {
|
|
||||||
local append_cmdline
|
|
||||||
local kernel
|
|
||||||
|
|
||||||
kernel="$(find_kernel)"
|
|
||||||
[ $? -gt 0 ] && return 1
|
|
||||||
|
|
||||||
case "$(uname -m)" in
|
|
||||||
i?86|x86_64)
|
|
||||||
grep -q "crashkernel=" /proc/cmdline || return 1
|
|
||||||
append_cmdline="1 irqpoll reset_devices maxcpus=1"
|
|
||||||
;;
|
|
||||||
arm*)
|
|
||||||
append_cmdline="1 maxcpus=1 reset_devices"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
kexec -p "$kernel" --reuse-cmdline --append="$append_cmdline"
|
|
||||||
return $?
|
|
||||||
}
|
|
||||||
|
|
||||||
start() {
|
|
||||||
local retval
|
|
||||||
|
|
||||||
if [ ! -e /sys/kernel/kexec_crash_loaded ]; then
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -e /proc/vmcore ]; then
|
|
||||||
config_load kdump
|
|
||||||
config_foreach run_kdump kdump
|
|
||||||
else
|
|
||||||
config_load kdump
|
|
||||||
config_foreach verify_kdump kdump
|
|
||||||
retval=$?
|
|
||||||
[ $retval = 1 ] && return 1
|
|
||||||
[ $retval = 0 ] && load_crashkernel
|
|
||||||
return $?
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
stop() {
|
|
||||||
[ "$(cat /sys/kernel/kexec_crash_loaded)" = "1" ] || return
|
|
||||||
|
|
||||||
if [ -e "$BOOT_IMAGE" ]; then
|
|
||||||
kexec -p -u "$BOOT_IMAGE"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
status() {
|
|
||||||
local retval kernel
|
|
||||||
|
|
||||||
if [ ! -e /sys/kernel/kexec_crash_loaded ]; then
|
|
||||||
echo "crashdump not supported by kernel"
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ $(cat /sys/kernel/kexec_crash_size) -eq 0 ]; then
|
|
||||||
echo "memory for crashdump kernel not reserved!"
|
|
||||||
echo "check crashkernel= kernel cmdline parameter"
|
|
||||||
echo "(a reboot is required after installing kdump)"
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
|
|
||||||
kernel="$(find_kernel)"
|
|
||||||
if [ $? -gt 0 ]; then
|
|
||||||
echo "cannot find kernel image"
|
|
||||||
return
|
|
||||||
else
|
|
||||||
echo "using kernel image $kernel"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo -n "kdump configuration is "
|
|
||||||
config_load kdump
|
|
||||||
retval=$?
|
|
||||||
if [ $retval = 0 ]; then
|
|
||||||
if [ "$(config_foreach echo kdump)" ]; then
|
|
||||||
config_foreach verify_kdump kdump
|
|
||||||
retval=$?
|
|
||||||
else
|
|
||||||
retval=1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ $retval = 0 ]; then
|
|
||||||
echo "valid"
|
|
||||||
elif [ $retval = 2 ]; then
|
|
||||||
echo "disabled"
|
|
||||||
else
|
|
||||||
echo "BROKEN"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo -n "kexec crash kernel "
|
|
||||||
if [ "$(cat /sys/kernel/kexec_crash_loaded)" = "0" ]; then
|
|
||||||
echo -n "not "
|
|
||||||
fi
|
|
||||||
echo "loaded"
|
|
||||||
}
|
|
||||||
20
package/boot/kexec-tools/patches/100-format_string_fix.patch
Normal file
20
package/boot/kexec-tools/patches/100-format_string_fix.patch
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
--- a/kexec/arch/i386/kexec-elf-x86.c
|
||||||
|
+++ b/kexec/arch/i386/kexec-elf-x86.c
|
||||||
|
@@ -296,6 +296,6 @@ out:
|
||||||
|
free(command_line);
|
||||||
|
free(modified_cmdline);
|
||||||
|
if (error_msg)
|
||||||
|
- die(error_msg);
|
||||||
|
+ die("%s", error_msg);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
--- a/kexec/arch/x86_64/kexec-elf-x86_64.c
|
||||||
|
+++ b/kexec/arch/x86_64/kexec-elf-x86_64.c
|
||||||
|
@@ -276,6 +276,6 @@ out:
|
||||||
|
free(command_line);
|
||||||
|
free(modified_cmdline);
|
||||||
|
if (error_msg)
|
||||||
|
- die(error_msg);
|
||||||
|
+ die("%s", error_msg);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
--- a/vmcore-dmesg/vmcore-dmesg.c
|
||||||
|
+++ b/vmcore-dmesg/vmcore-dmesg.c
|
||||||
|
@@ -1,6 +1,8 @@
|
||||||
|
#define _XOPEN_SOURCE 600
|
||||||
|
#define _LARGEFILE_SOURCE 1
|
||||||
|
#define _FILE_OFFSET_BITS 64
|
||||||
|
+#define _GNU_SOURCE
|
||||||
|
+
|
||||||
|
#include <endian.h>
|
||||||
|
#include <byteswap.h>
|
||||||
|
#include <stdio.h>
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user