Compare commits
184 Commits
v19.07.1
...
v18.06.0-r
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
13f64a1e59 | ||
|
|
d2aa3a1b62 | ||
|
|
78abc65347 | ||
|
|
55df39e684 | ||
|
|
97b1765a45 | ||
|
|
f27e0b6bc4 | ||
|
|
71825c0bd8 | ||
|
|
04353c3af8 | ||
|
|
6e4fb77f9e | ||
|
|
642acc0fb0 | ||
|
|
843e421a05 | ||
|
|
c4a0c0718a | ||
|
|
2ac5800fd9 | ||
|
|
7f3121cf8a | ||
|
|
c276abf061 | ||
|
|
7950e1b9f4 | ||
|
|
c2da3505e2 | ||
|
|
b72bced2d7 | ||
|
|
4e9fa569b0 | ||
|
|
29934e5f03 | ||
|
|
36234df96c | ||
|
|
0c4f658d58 | ||
|
|
9178dc282d | ||
|
|
1863c38643 | ||
|
|
7381ed3d01 | ||
|
|
5529e71357 | ||
|
|
615186d415 | ||
|
|
0daff7fe23 | ||
|
|
eb568e0aba | ||
|
|
da318f3522 | ||
|
|
afe0320ffc | ||
|
|
a1373bc6fc | ||
|
|
3a99b278cd | ||
|
|
2af5cfe9b7 | ||
|
|
3c4cf92f13 | ||
|
|
192866d2b8 | ||
|
|
2369c89b75 | ||
|
|
a21210fbb7 | ||
|
|
637d10d91e | ||
|
|
747600e93c | ||
|
|
25eb240f63 | ||
|
|
97cb9d04ee | ||
|
|
8af649756f | ||
|
|
b6c134f254 | ||
|
|
b85e150182 | ||
|
|
b3b81d9d2a | ||
|
|
520c656d7b | ||
|
|
370078466c | ||
|
|
ae0712ae8f | ||
|
|
38eee4da94 | ||
|
|
56f66be113 | ||
|
|
db969b2f30 | ||
|
|
1bb1239c28 | ||
|
|
4a571ae62b | ||
|
|
503f7f0614 | ||
|
|
697d7fd000 | ||
|
|
9fd0a2f273 | ||
|
|
29ba45bb35 | ||
|
|
0506039845 | ||
|
|
8e662b9654 | ||
|
|
da8fc1511f | ||
|
|
763c0473c8 | ||
|
|
b32c304be8 | ||
|
|
6f398aa762 | ||
|
|
d6ee5e462c | ||
|
|
4f765922f0 | ||
|
|
6cf00dcf7d | ||
|
|
4121018b3f | ||
|
|
5881e2434f | ||
|
|
be799e8c2a | ||
|
|
3b8e53f6af | ||
|
|
68598374d1 | ||
|
|
e0363a7d74 | ||
|
|
18f18a2054 | ||
|
|
244fd1aac6 | ||
|
|
8e1269c29d | ||
|
|
c0763f08a5 | ||
|
|
e6c17aa219 | ||
|
|
f18f08d9c8 | ||
|
|
21a12f4269 | ||
|
|
46e232d8a1 | ||
|
|
433fb7d2c7 | ||
|
|
48c5d6ab77 | ||
|
|
b8a5fc207a | ||
|
|
9811057ed1 | ||
|
|
c24c8bfd0a | ||
|
|
0c59c9c9db | ||
|
|
1199a91095 | ||
|
|
6f8eb1b50f | ||
|
|
805e59cdcc | ||
|
|
aa87a5cffb | ||
|
|
9310304d1a | ||
|
|
7128fe094f | ||
|
|
e5301885bc | ||
|
|
0239448532 | ||
|
|
b295e3a18d | ||
|
|
ba204d941c | ||
|
|
324ea1f414 | ||
|
|
82cfec057f | ||
|
|
b9555a9831 | ||
|
|
a973a0a38b | ||
|
|
0bfb41a55a | ||
|
|
bf5829ddf9 | ||
|
|
0037b13480 | ||
|
|
dd49c62611 | ||
|
|
17eb0c4872 | ||
|
|
8ccdf809c0 | ||
|
|
fa0275bd90 | ||
|
|
76ba98d9b0 | ||
|
|
45456fe0c8 | ||
|
|
ac24a026d2 | ||
|
|
f39a7179bc | ||
|
|
63c1719988 | ||
|
|
2301bbdf88 | ||
|
|
1df8281737 | ||
|
|
eac20ce427 | ||
|
|
c52cd4d8c3 | ||
|
|
bdddbe9718 | ||
|
|
8458febc01 | ||
|
|
a64a36308c | ||
|
|
715ff75b1b | ||
|
|
a6d825d735 | ||
|
|
d629e013ef | ||
|
|
65de91a884 | ||
|
|
e567d313b6 | ||
|
|
1b39b665c3 | ||
|
|
3ec4921c16 | ||
|
|
0882a4cf25 | ||
|
|
ec7d974055 | ||
|
|
742ac017ba | ||
|
|
66871d9c62 | ||
|
|
27223c0761 | ||
|
|
d805812e75 | ||
|
|
9361c359e4 | ||
|
|
0411d3f654 | ||
|
|
701a7b1c86 | ||
|
|
53507cef82 | ||
|
|
991ec8e5b2 | ||
|
|
23cdf9f246 | ||
|
|
16e0866a74 | ||
|
|
1f26cfc92b | ||
|
|
294a45adbe | ||
|
|
1deadfe3de | ||
|
|
95922e16d7 | ||
|
|
2c9e3736f4 | ||
|
|
a6a5de4ef3 | ||
|
|
9e4f4e1a1f | ||
|
|
8f2ac5c085 | ||
|
|
5d3b216d21 | ||
|
|
586872da59 | ||
|
|
acdac1aa55 | ||
|
|
0d6d8d71fc | ||
|
|
d4cad59927 | ||
|
|
09cb0a5626 | ||
|
|
0f35193aec | ||
|
|
1780f09ee3 | ||
|
|
fff02093e6 | ||
|
|
efdfb253d8 | ||
|
|
644f65afe1 | ||
|
|
f47b5802b5 | ||
|
|
f882f4474f | ||
|
|
9373836f94 | ||
|
|
d4df69697d | ||
|
|
dcd68100c2 | ||
|
|
e39414ed07 | ||
|
|
2b7289cd3b | ||
|
|
fdeba0e0ef | ||
|
|
c97189e26d | ||
|
|
8aae794e99 | ||
|
|
60522320f6 | ||
|
|
68586cf233 | ||
|
|
938908f400 | ||
|
|
a88ff7bf5b | ||
|
|
ff8bde5296 | ||
|
|
8948a78862 | ||
|
|
7d368e41ce | ||
|
|
fc6f1fd8fe | ||
|
|
54a864d914 | ||
|
|
4dab912edb | ||
|
|
72ebcef5be | ||
|
|
617b7e9bf4 | ||
|
|
323285ac00 | ||
|
|
dc7487885e | ||
|
|
f93c029395 |
2
.github/pull_request_template
vendored
2
.github/pull_request_template
vendored
@@ -3,6 +3,6 @@ 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
|
||||
https://lede-project.org/submitting-patches
|
||||
|
||||
Please remove this message before posting the pull request.
|
||||
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -16,7 +16,6 @@
|
||||
/overlay
|
||||
/package/feeds
|
||||
/package/openwrt-packages
|
||||
/*.patch
|
||||
key-build*
|
||||
*.orig
|
||||
*.rej
|
||||
|
||||
18
Makefile
18
Makefile
@@ -18,7 +18,6 @@ $(if $(findstring $(space),$(TOPDIR)),$(error ERROR: The path to the OpenWrt dir
|
||||
|
||||
world:
|
||||
|
||||
DISTRO_PKG_CONFIG:=$(shell which -a pkg-config | grep -E '\/usr' | head -n 1)
|
||||
export PATH:=$(TOPDIR)/staging_dir/host/bin:$(PATH)
|
||||
|
||||
ifneq ($(OPENWRT_BUILD),1)
|
||||
@@ -28,8 +27,6 @@ ifneq ($(OPENWRT_BUILD),1)
|
||||
export OPENWRT_BUILD
|
||||
GREP_OPTIONS=
|
||||
export GREP_OPTIONS
|
||||
CDPATH=
|
||||
export CDPATH
|
||||
include $(TOPDIR)/include/debug.mk
|
||||
include $(TOPDIR)/include/depends.mk
|
||||
include $(TOPDIR)/include/toplevel.mk
|
||||
@@ -88,23 +85,14 @@ prereq: $(target/stamp-prereq) tmp/.prereq_packages
|
||||
fi
|
||||
|
||||
checksum: FORCE
|
||||
$(call sha256sums,$(BIN_DIR),$(CONFIG_BUILDBOT))
|
||||
|
||||
buildversion: FORCE
|
||||
$(SCRIPT_DIR)/getver.sh > $(BIN_DIR)/version.buildinfo
|
||||
|
||||
feedsversion: FORCE
|
||||
$(SCRIPT_DIR)/feeds list -fs > $(BIN_DIR)/feeds.buildinfo
|
||||
$(call sha256sums,$(BIN_DIR))
|
||||
|
||||
diffconfig: FORCE
|
||||
mkdir -p $(BIN_DIR)
|
||||
$(SCRIPT_DIR)/diffconfig.sh > $(BIN_DIR)/config.buildinfo
|
||||
|
||||
buildinfo: FORCE
|
||||
$(_SINGLE)$(SUBMAKE) -r diffconfig buildversion feedsversion
|
||||
$(SCRIPT_DIR)/diffconfig.sh > $(BIN_DIR)/config.seed
|
||||
|
||||
prepare: .config $(tools/stamp-compile) $(toolchain/stamp-compile)
|
||||
$(_SINGLE)$(SUBMAKE) -r buildinfo
|
||||
$(_SINGLE)$(SUBMAKE) -r diffconfig
|
||||
|
||||
world: prepare $(target/stamp-compile) $(package/stamp-compile) $(package/stamp-install) $(target/stamp-install) FORCE
|
||||
$(_SINGLE)$(SUBMAKE) -r package/index
|
||||
|
||||
37
README
37
README
@@ -1,31 +1,26 @@
|
||||
_______ ________ __
|
||||
| |.-----.-----.-----.| | | |.----.| |_
|
||||
| - || _ | -__| || | | || _|| _|
|
||||
|_______|| __|_____|__|__||________||__| |____|
|
||||
|__| W I R E L E S S F R E E D O M
|
||||
-----------------------------------------------------
|
||||
|
||||
This is the buildsystem for the OpenWrt Linux distribution.
|
||||
|
||||
To build your own firmware you need a Linux, BSD or MacOSX system (case
|
||||
sensitive filesystem required). Cygwin is unsupported because of the lack
|
||||
of a case sensitive file system.
|
||||
Please use "make menuconfig" to choose your preferred
|
||||
configuration for the toolchain and firmware.
|
||||
|
||||
You need gcc, binutils, bzip2, flex, python, perl, make, find, grep, diff,
|
||||
unzip, gawk, getopt, subversion, libz-dev and libc headers installed.
|
||||
You need to have installed gcc, binutils, bzip2, flex, python, perl, make,
|
||||
find, grep, diff, unzip, gawk, getopt, subversion, libz-dev and libc headers.
|
||||
|
||||
1. Run "./scripts/feeds update -a" to obtain all the latest package definitions
|
||||
defined in feeds.conf / feeds.conf.default
|
||||
Run "./scripts/feeds update -a" to get all the latest package definitions
|
||||
defined in feeds.conf / feeds.conf.default respectively
|
||||
and "./scripts/feeds install -a" to install symlinks of all of them into
|
||||
package/feeds/.
|
||||
|
||||
2. Run "./scripts/feeds install -a" to install symlinks for all obtained
|
||||
packages into package/feeds/
|
||||
Use "make menuconfig" to configure your image.
|
||||
|
||||
3. Run "make menuconfig" to select your preferred configuration for the
|
||||
toolchain, target system & firmware packages.
|
||||
Simply running "make" will build your firmware.
|
||||
It will download all sources, build the cross-compile toolchain,
|
||||
the kernel and all choosen applications.
|
||||
|
||||
To build your own firmware you need to have access to a Linux, BSD or MacOSX system
|
||||
(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!
|
||||
Your OpenWrt Community
|
||||
|
||||
@@ -34,21 +34,8 @@ menu "Global build settings"
|
||||
bool "Cryptographically signed package lists"
|
||||
default y
|
||||
|
||||
config SIGNATURE_CHECK
|
||||
bool "Enable signature checking in opkg"
|
||||
default SIGNED_PACKAGES
|
||||
|
||||
comment "General build options"
|
||||
|
||||
config TESTING_KERNEL
|
||||
bool "Use the testing kernel version"
|
||||
depends on HAS_TESTING_KERNEL
|
||||
default n
|
||||
help
|
||||
If the target supports a newer kernel version than the default,
|
||||
you can use this config option to enable it
|
||||
|
||||
|
||||
config DISPLAY_SUPPORT
|
||||
bool "Show packages that require graphics support (local or remote)"
|
||||
default n
|
||||
@@ -81,19 +68,11 @@ menu "Global build settings"
|
||||
This removes all ipkg/opkg status data files from the target directory
|
||||
before building the root filesystem.
|
||||
|
||||
config IPK_FILES_CHECKSUMS
|
||||
bool
|
||||
prompt "Record files checksums in package metadata"
|
||||
default n
|
||||
help
|
||||
This makes file checksums part of package metadata. It increases size
|
||||
but provides you with pkg_check command to check for flash coruptions.
|
||||
|
||||
config INCLUDE_CONFIG
|
||||
bool "Include build configuration in firmware" if DEVEL
|
||||
default n
|
||||
help
|
||||
If enabled, config.buildinfo will be stored in /etc/build.config of firmware.
|
||||
If enabled, config.seed will be stored in /etc/build.config of firmware.
|
||||
|
||||
config COLLECT_KERNEL_DEBUG
|
||||
bool
|
||||
@@ -255,14 +234,6 @@ menu "Global build settings"
|
||||
bool "Strong"
|
||||
endchoice
|
||||
|
||||
config KERNEL_STACKPROTECTOR
|
||||
bool
|
||||
default KERNEL_CC_STACKPROTECTOR_REGULAR || KERNEL_CC_STACKPROTECTOR_STRONG
|
||||
|
||||
config KERNEL_STACKPROTECTOR_STRONG
|
||||
bool
|
||||
default KERNEL_CC_STACKPROTECTOR_STRONG
|
||||
|
||||
choice
|
||||
prompt "Enable buffer-overflows detection (FORTIFY_SOURCE)"
|
||||
default PKG_FORTIFY_SOURCE_1
|
||||
|
||||
@@ -14,11 +14,10 @@ menu "Target Images"
|
||||
|
||||
choice
|
||||
prompt "Compression"
|
||||
default TARGET_INITRAMFS_COMPRESSION_LZMA if TARGET_apm821xx
|
||||
default TARGET_INITRAMFS_COMPRESSION_LZMA if TARGET_ar71xx
|
||||
default TARGET_INITRAMFS_COMPRESSION_LZMA if TARGET_lantiq
|
||||
default TARGET_INITRAMFS_COMPRESSION_LZMA if TARGET_mpc85xx
|
||||
default TARGET_INITRAMFS_COMPRESSION_LZMA if TARGET_ramips
|
||||
default TARGET_INITRAMFS_COMPRESSION_LZMA if TARGET_apm821xx
|
||||
default TARGET_INITRAMFS_COMPRESSION_LZMA if TARGET_mpc85xx
|
||||
default TARGET_INITRAMFS_COMPRESSION_NONE
|
||||
depends on TARGET_ROOTFS_INITRAMFS
|
||||
help
|
||||
@@ -150,7 +149,6 @@ menu "Target Images"
|
||||
int "Block size (in KiB)"
|
||||
depends on TARGET_ROOTFS_SQUASHFS
|
||||
default 64 if LOW_MEMORY_FOOTPRINT
|
||||
default 1024 if (SMALL_FLASH && !LOW_MEMORY_FOOTPRINT)
|
||||
default 256
|
||||
|
||||
menuconfig TARGET_ROOTFS_UBIFS
|
||||
@@ -198,12 +196,14 @@ menu "Target Images"
|
||||
config GRUB_CONSOLE
|
||||
bool "Use Console Terminal (in addition to Serial)"
|
||||
depends on GRUB_IMAGES
|
||||
default n if (TARGET_x86_generic_Soekris45xx || TARGET_x86_generic_Soekris48xx || TARGET_x86_net5501 || TARGET_x86_geos || TARGET_x86_alix2)
|
||||
default y
|
||||
|
||||
config GRUB_SERIAL
|
||||
string "Serial port device"
|
||||
depends on GRUB_IMAGES
|
||||
default "ttyS0"
|
||||
default "hvc0" if TARGET_x86_xen_domu
|
||||
default "ttyS0" if ! TARGET_x86_xen_domu
|
||||
|
||||
config GRUB_BAUDRATE
|
||||
int "Serial port baud rate"
|
||||
@@ -219,6 +219,7 @@ menu "Target Images"
|
||||
config GRUB_BOOTOPTS
|
||||
string "Extra kernel boot options"
|
||||
depends on GRUB_IMAGES
|
||||
default "xencons=hvc" if TARGET_x86_xen_domu
|
||||
help
|
||||
If you don't know, just leave it blank.
|
||||
|
||||
@@ -229,24 +230,16 @@ menu "Target Images"
|
||||
help
|
||||
If you don't know, 5 seconds is a reasonable default.
|
||||
|
||||
config GRUB_TITLE
|
||||
string "Title for the menu entry in GRUB"
|
||||
depends on GRUB_IMAGES
|
||||
default "OpenWrt"
|
||||
help
|
||||
This is the title of the GRUB menu entry.
|
||||
If unspecified, it defaults to OpenWrt.
|
||||
|
||||
config VDI_IMAGES
|
||||
bool "Build VirtualBox image files (VDI)"
|
||||
depends on TARGET_x86
|
||||
depends on TARGET_x86 || TARGET_x86_64
|
||||
select GRUB_IMAGES
|
||||
select TARGET_IMAGES_PAD
|
||||
select PACKAGE_kmod-e1000
|
||||
|
||||
config VMDK_IMAGES
|
||||
bool "Build VMware image files (VMDK)"
|
||||
depends on TARGET_x86
|
||||
depends on TARGET_x86 || TARGET_x86_64
|
||||
select GRUB_IMAGES
|
||||
select TARGET_IMAGES_PAD
|
||||
select PACKAGE_kmod-e1000
|
||||
@@ -266,14 +259,12 @@ menu "Target Images"
|
||||
|
||||
config TARGET_KERNEL_PARTSIZE
|
||||
int "Kernel partition size (in MB)"
|
||||
depends on GRUB_IMAGES || USES_BOOT_PART
|
||||
default 8 if TARGET_apm821xx_sata
|
||||
default 20 if TARGET_brcm2708
|
||||
depends on GRUB_IMAGES
|
||||
default 16
|
||||
|
||||
config TARGET_ROOTFS_PARTSIZE
|
||||
int "Root filesystem partition size (in MB)"
|
||||
depends on GRUB_IMAGES || USES_ROOTFS_PART || TARGET_ROOTFS_EXT4FS || TARGET_omap || TARGET_rb532 || TARGET_sunxi || TARGET_uml
|
||||
depends on GRUB_IMAGES || TARGET_ROOTFS_EXT4FS || TARGET_rb532 || TARGET_mvebu || TARGET_uml
|
||||
default 256
|
||||
help
|
||||
Select the root filesystem partition size.
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
|
||||
config KERNEL_BUILD_USER
|
||||
string "Custom Kernel Build User Name"
|
||||
default "builder" if BUILDBOT
|
||||
default ""
|
||||
help
|
||||
Sets the Kernel build user string, which for example will be returned
|
||||
@@ -15,7 +14,6 @@ config KERNEL_BUILD_USER
|
||||
|
||||
config KERNEL_BUILD_DOMAIN
|
||||
string "Custom Kernel Build Domain Name"
|
||||
default "buildhost" if BUILDBOT
|
||||
default ""
|
||||
help
|
||||
Sets the Kernel build domain string, which for example will be
|
||||
@@ -33,7 +31,7 @@ config KERNEL_CRASHLOG
|
||||
|
||||
config KERNEL_SWAP
|
||||
bool "Support for paging of anonymous memory (swap)"
|
||||
default y if !SMALL_FLASH
|
||||
default y
|
||||
|
||||
config KERNEL_DEBUG_FS
|
||||
bool "Compile the kernel with debug filesystem enabled"
|
||||
@@ -67,27 +65,6 @@ config KERNEL_PROFILING
|
||||
Enable the extended profiling support mechanisms used by profilers such
|
||||
as OProfile.
|
||||
|
||||
config KERNEL_TASKSTATS
|
||||
bool "Compile the kernel with task resource/io statistics and accounting"
|
||||
default n
|
||||
help
|
||||
Enable the collection and publishing of task/io statistics and
|
||||
accounting. Enable this option to enable i/o monitoring in system
|
||||
monitors.
|
||||
|
||||
if KERNEL_TASKSTATS
|
||||
|
||||
config KERNEL_TASK_DELAY_ACCT
|
||||
def_bool y
|
||||
|
||||
config KERNEL_TASK_IO_ACCOUNTING
|
||||
def_bool y
|
||||
|
||||
config KERNEL_TASK_XACCT
|
||||
def_bool y
|
||||
|
||||
endif
|
||||
|
||||
config KERNEL_KALLSYMS
|
||||
bool "Compile the kernel with symbol table information"
|
||||
default y if !SMALL_FLASH
|
||||
@@ -135,7 +112,7 @@ config KERNEL_DEBUG_KERNEL
|
||||
|
||||
config KERNEL_DEBUG_INFO
|
||||
bool "Compile the kernel with debug information"
|
||||
default y if !SMALL_FLASH
|
||||
default y
|
||||
select KERNEL_DEBUG_KERNEL
|
||||
help
|
||||
This will compile your kernel and modules with debug information.
|
||||
@@ -194,10 +171,6 @@ config KERNEL_KPROBE_EVENT
|
||||
bool
|
||||
default y if KERNEL_KPROBES
|
||||
|
||||
config KERNEL_KPROBE_EVENTS
|
||||
bool
|
||||
default y if KERNEL_KPROBES
|
||||
|
||||
config KERNEL_AIO
|
||||
bool "Compile the kernel with asynchronous IO support"
|
||||
default n
|
||||
@@ -232,7 +205,7 @@ config KERNEL_COREDUMP
|
||||
config KERNEL_ELF_CORE
|
||||
bool "Enable process core dump support"
|
||||
select KERNEL_COREDUMP
|
||||
default y if !SMALL_FLASH
|
||||
default y
|
||||
|
||||
config KERNEL_PROVE_LOCKING
|
||||
bool "Enable kernel lock checking"
|
||||
@@ -525,20 +498,6 @@ if KERNEL_CGROUPS
|
||||
CONFIG_CFQ_GROUP_IOSCHED=y; for enabling throttling policy, set
|
||||
CONFIG_BLK_DEV_THROTTLING=y.
|
||||
|
||||
if KERNEL_BLK_CGROUP
|
||||
|
||||
config KERNEL_CFQ_GROUP_IOSCHED
|
||||
bool "Proportional weight of disk bandwidth in CFQ"
|
||||
|
||||
config KERNEL_BLK_DEV_THROTTLING
|
||||
bool "Enable throttling policy"
|
||||
default y if TARGET_brcm2708
|
||||
|
||||
config KERNEL_BLK_DEV_THROTTLING_LOW
|
||||
bool "Block throttling .low limit interface support (EXPERIMENTAL)"
|
||||
depends on KERNEL_BLK_DEV_THROTTLING
|
||||
endif
|
||||
|
||||
config KERNEL_DEBUG_BLK_CGROUP
|
||||
bool "Enable Block IO controller debugging"
|
||||
default n
|
||||
@@ -775,7 +734,7 @@ menu "Filesystem ACL and attr support options"
|
||||
select KERNEL_FS_POSIX_ACL
|
||||
default y if USE_FS_ACL_ATTR
|
||||
|
||||
config KERNEL_HFSPLUS_FS_POSIX_ACL
|
||||
config KERNEL_HFSPLUG_FS_POSIX_ACL
|
||||
bool "Enable POSIX ACL for HFS+ Filesystems"
|
||||
select KERNEL_FS_POSIX_ACL
|
||||
default y if USE_FS_ACL_ATTR
|
||||
@@ -826,30 +785,3 @@ config KERNEL_DEVKMEM
|
||||
Say Y here if you want to support the /dev/kmem device. The
|
||||
/dev/kmem device is rarely used, but can be used for certain
|
||||
kind of kernel debugging operations.
|
||||
|
||||
config KERNEL_SQUASHFS_FRAGMENT_CACHE_SIZE
|
||||
int "Number of squashfs fragments cached"
|
||||
default 2 if (SMALL_FLASH && !LOW_MEMORY_FOOTPRINT)
|
||||
default 3
|
||||
|
||||
#
|
||||
# compile optimiziation setting
|
||||
#
|
||||
choice
|
||||
prompt "Compiler optimization level"
|
||||
default KERNEL_CC_OPTIMIZE_FOR_SIZE if SMALL_FLASH
|
||||
|
||||
config KERNEL_CC_OPTIMIZE_FOR_PERFORMANCE
|
||||
bool "Optimize for performance"
|
||||
help
|
||||
This is the default optimization level for the kernel, building
|
||||
with the "-O2" compiler flag for best performance and most
|
||||
helpful compile-time warnings.
|
||||
|
||||
config KERNEL_CC_OPTIMIZE_FOR_SIZE
|
||||
bool "Optimize for size"
|
||||
help
|
||||
Enabling this option will pass "-Os" instead of "-O2" to
|
||||
your compiler resulting in a smaller kernel.
|
||||
|
||||
endchoice
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
src-git packages https://git.openwrt.org/feed/packages.git^1ec76dd7ca647f76a75c4f88b3b70d154221e7e9
|
||||
src-git luci https://git.openwrt.org/project/luci.git^adbbd5cf690cf993e0de1e56266ac6fd2b2dfe91
|
||||
src-git routing https://git.openwrt.org/feed/routing.git^839ea37939ad1c6cbb4ac543962bbb66be4a2a3f
|
||||
src-git telephony https://git.openwrt.org/feed/telephony.git^6f95d6ab3f359ee2ce81c20522700937424d1591
|
||||
src-git packages https://git.openwrt.org/feed/packages.git^d83dc7cfb81680eff063acb7343eb9d6b0c9a6ab
|
||||
src-git luci https://git.openwrt.org/project/luci.git^c379f00e86a5fc5d05a8e967c5c5daa035a72359
|
||||
src-git routing https://git.openwrt.org/feed/routing.git^1b9d1c419f0ecefda51922a7845ab2183d6acd76
|
||||
src-git telephony https://git.openwrt.org/feed/telephony.git^1195dafe98bca2d3a41383eb2723d0104d7f9046
|
||||
|
||||
@@ -39,9 +39,7 @@ define autoreconf
|
||||
[ -e $(p)/config.rpath ] || \
|
||||
ln -s $(SCRIPT_DIR)/config.rpath $(p)/config.rpath; \
|
||||
touch NEWS AUTHORS COPYING ABOUT-NLS ChangeLog; \
|
||||
$(AM_TOOL_PATHS) \
|
||||
LIBTOOLIZE='$(STAGING_DIR_HOST)/bin/libtoolize --install' \
|
||||
$(STAGING_DIR_HOST)/bin/autoreconf -v -f -i -s \
|
||||
$(AM_TOOL_PATHS) $(STAGING_DIR_HOST)/bin/autoreconf -v -f -i -s \
|
||||
$(if $(word 2,$(3)),--no-recursive) \
|
||||
-B $(STAGING_DIR_HOST)/share/aclocal \
|
||||
$(patsubst %,-I %,$(5)) \
|
||||
|
||||
@@ -7,8 +7,8 @@ ifneq ($(findstring c,$(OPENWRT_VERBOSE)),)
|
||||
endif
|
||||
|
||||
CMAKE_BINARY_DIR = $(PKG_BUILD_DIR)$(if $(CMAKE_BINARY_SUBDIR),/$(CMAKE_BINARY_SUBDIR))
|
||||
CMAKE_SOURCE_DIR = $(PKG_BUILD_DIR)$(if $(CMAKE_SOURCE_SUBDIR),/$(CMAKE_SOURCE_SUBDIR))
|
||||
HOST_CMAKE_SOURCE_DIR = $(HOST_BUILD_DIR)$(if $(CMAKE_SOURCE_SUBDIR),/$(CMAKE_SOURCE_SUBDIR))
|
||||
CMAKE_SOURCE_DIR = $(PKG_BUILD_DIR)
|
||||
HOST_CMAKE_SOURCE_DIR = $(HOST_BUILD_DIR)
|
||||
MAKE_PATH = $(firstword $(CMAKE_BINARY_SUBDIR) .)
|
||||
|
||||
ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),)
|
||||
@@ -103,7 +103,6 @@ define Host/Configure/Default
|
||||
-DCMAKE_INSTALL_PREFIX=$(HOST_BUILD_PREFIX) \
|
||||
-DCMAKE_PREFIX_PATH=$(HOST_BUILD_PREFIX) \
|
||||
-DCMAKE_SKIP_RPATH=TRUE \
|
||||
-DCMAKE_INSTALL_LIBDIR=lib \
|
||||
$(CMAKE_HOST_OPTIONS) \
|
||||
$(HOST_CMAKE_SOURCE_DIR) \
|
||||
)
|
||||
|
||||
@@ -19,23 +19,17 @@ endif
|
||||
|
||||
DOWNLOAD_RDEP=$(STAMP_PREPARED) $(HOST_STAMP_PREPARED)
|
||||
|
||||
define dl_method_git
|
||||
$(if $(filter https://github.com/% git://github.com/%,$(1)),github_archive,git)
|
||||
endef
|
||||
|
||||
# Try to guess the download method from the URL
|
||||
define dl_method
|
||||
$(strip \
|
||||
$(if $(filter git,$(2)),$(call dl_method_git,$(1),$(2)),
|
||||
$(if $(2),$(2), \
|
||||
$(if $(filter @APACHE/% @GITHUB/% @GNOME/% @GNU/% @KERNEL/% @SF/% @SAVANNAH/% ftp://% http://% https://% file://%,$(1)),default, \
|
||||
$(if $(filter git://%,$(1)),$(call dl_method_git,$(1),$(2)), \
|
||||
$(if $(filter svn://%,$(1)),svn, \
|
||||
$(if $(filter cvs://%,$(1)),cvs, \
|
||||
$(if $(filter hg://%,$(1)),hg, \
|
||||
$(if $(filter sftp://%,$(1)),bzr, \
|
||||
unknown \
|
||||
) \
|
||||
$(if $(2),$(2), \
|
||||
$(if $(filter @APACHE/% @GITHUB/% @GNOME/% @GNU/% @KERNEL/% @SF/% @SAVANNAH/% ftp://% http://% https://% file://%,$(1)),default, \
|
||||
$(if $(filter git://%,$(1)),git, \
|
||||
$(if $(filter svn://%,$(1)),svn, \
|
||||
$(if $(filter cvs://%,$(1)),cvs, \
|
||||
$(if $(filter hg://%,$(1)),hg, \
|
||||
$(if $(filter sftp://%,$(1)),bzr, \
|
||||
unknown \
|
||||
) \
|
||||
) \
|
||||
) \
|
||||
@@ -55,18 +49,13 @@ define dl_pack
|
||||
$(if $(dl_pack/$(call ext,$(1))),$(dl_pack/$(call ext,$(1))),$(dl_pack/unknown))
|
||||
endef
|
||||
define dl_tar_pack
|
||||
$(TAR) --numeric-owner --owner=0 --group=0 --mode=a-s --sort=name \
|
||||
$$$${TAR_TIMESTAMP:+--mtime="$$$$TAR_TIMESTAMP"} -c $(2) | $(call dl_pack,$(1))
|
||||
$(TAR) --numeric-owner --owner=0 --group=0 --sort=name $$$${TAR_TIMESTAMP:+--mtime="$$$$TAR_TIMESTAMP"} -c $(2) | $(call dl_pack,$(1))
|
||||
endef
|
||||
|
||||
ifdef CHECK
|
||||
check_escape=$(subst ','\'',$(1))
|
||||
#')
|
||||
|
||||
# $(1): suffix of the F_, C_ variables, e.g. hash_deprecated, hash_mismatch, etc.
|
||||
# $(2): filename
|
||||
# $(3): expected hash value
|
||||
# $(4): var name of the the form: {PKG_,Download/<name>:}{,MIRROR_}{HASH,MIRROR_HASH}
|
||||
check_warn_nofix = $(info $(shell printf "$(_R)WARNING: %s$(_N)" '$(call check_escape,$(call C_$(1),$(2),$(3),$(4)))'))
|
||||
ifndef FIXUP
|
||||
check_warn = $(check_warn_nofix)
|
||||
@@ -82,17 +71,11 @@ F_hash_mismatch = $(F_hash_deprecated)
|
||||
F_hash_missing = $(SCRIPT_DIR)/fixup-makefile.pl $(CURDIR)/Makefile add-hash $(3) $(call gen_sha256sum,$(1))
|
||||
endif
|
||||
|
||||
# $(1): filename
|
||||
# $(2): expected hash value
|
||||
# $(3): var name of the the form: {PKG_,Download/<name>:}{,MIRROR_}{HASH,MIRROR_HASH}
|
||||
C_download_missing = $(1) is missing, please run make download before re-running this check
|
||||
C_hash_mismatch = $(3) does not match $(1) hash $(call gen_sha256sum,$(1))
|
||||
C_hash_deprecated = $(3) uses deprecated hash, set to $(call gen_sha256sum,$(1))
|
||||
C_hash_missing = $(3) is missing, set to $(call gen_sha256sum,$(1))
|
||||
|
||||
# $(1): filename
|
||||
# $(2): expected hash value
|
||||
# $(3): var name of the the form: {PKG_,Download/<name>:}{,MIRROR_}{HASH,MIRROR_HASH}
|
||||
check_hash = \
|
||||
$(if $(wildcard $(DL_DIR)/$(1)), \
|
||||
$(if $(filter-out x,$(2)), \
|
||||
@@ -133,9 +116,6 @@ define DownloadMethod/default
|
||||
)
|
||||
endef
|
||||
|
||||
# $(1): "check"
|
||||
# $(2): "PKG_" if <name> as in Download/<name> is "default", otherwise "Download/<name>:"
|
||||
# $(3): shell command sequence to do the download
|
||||
define wrap_mirror
|
||||
$(if $(if $(MIRROR),$(filter-out x,$(MIRROR_HASH))),$(SCRIPT_DIR)/download.pl "$(DL_DIR)" "$(FILE)" "$(MIRROR_HASH)" "" || ( $(3) ),$(3)) \
|
||||
$(if $(filter check,$(1)), \
|
||||
@@ -179,41 +159,23 @@ endef
|
||||
|
||||
define DownloadMethod/git
|
||||
$(call wrap_mirror,$(1),$(2), \
|
||||
$(call DownloadMethod/rawgit) \
|
||||
echo "Checking out files from the git repository..."; \
|
||||
mkdir -p $(TMP_DIR)/dl && \
|
||||
cd $(TMP_DIR)/dl && \
|
||||
rm -rf $(SUBDIR) && \
|
||||
[ \! -d $(SUBDIR) ] && \
|
||||
git clone $(OPTS) $(URL) $(SUBDIR) && \
|
||||
(cd $(SUBDIR) && git checkout $(VERSION) && \
|
||||
git submodule update --init --recursive) && \
|
||||
echo "Packing checkout..." && \
|
||||
export TAR_TIMESTAMP=`cd $(SUBDIR) && git log -1 --format='@%ct'` && \
|
||||
rm -rf $(SUBDIR)/.git && \
|
||||
$(call dl_tar_pack,$(TMP_DIR)/dl/$(FILE),$(SUBDIR)) && \
|
||||
mv $(TMP_DIR)/dl/$(FILE) $(DL_DIR)/ && \
|
||||
rm -rf $(SUBDIR); \
|
||||
)
|
||||
endef
|
||||
|
||||
define DownloadMethod/github_archive
|
||||
$(call wrap_mirror,$(1),$(2), \
|
||||
$(SCRIPT_DIR)/dl_github_archive.py \
|
||||
--dl-dir="$(DL_DIR)" \
|
||||
--url="$(URL)" \
|
||||
--version="$(VERSION)" \
|
||||
--subdir="$(SUBDIR)" \
|
||||
--source="$(FILE)" \
|
||||
--hash="$(MIRROR_HASH)" \
|
||||
|| ( $(call DownloadMethod/rawgit) ); \
|
||||
)
|
||||
endef
|
||||
|
||||
# Only intends to be called as a submethod from other DownloadMethod
|
||||
define DownloadMethod/rawgit
|
||||
echo "Checking out files from the git repository..."; \
|
||||
mkdir -p $(TMP_DIR)/dl && \
|
||||
cd $(TMP_DIR)/dl && \
|
||||
rm -rf $(SUBDIR) && \
|
||||
[ \! -d $(SUBDIR) ] && \
|
||||
git clone $(OPTS) $(URL) $(SUBDIR) && \
|
||||
(cd $(SUBDIR) && git checkout $(VERSION) && \
|
||||
git submodule update --init --recursive) && \
|
||||
echo "Packing checkout..." && \
|
||||
export TAR_TIMESTAMP=`cd $(SUBDIR) && git log -1 --format='@%ct'` && \
|
||||
rm -rf $(SUBDIR)/.git && \
|
||||
$(call dl_tar_pack,$(TMP_DIR)/dl/$(FILE),$(SUBDIR)) && \
|
||||
mv $(TMP_DIR)/dl/$(FILE) $(DL_DIR)/ && \
|
||||
rm -rf $(SUBDIR);
|
||||
endef
|
||||
|
||||
define DownloadMethod/bzr
|
||||
$(call wrap_mirror,$(1),$(2), \
|
||||
echo "Checking out files from the bzr repository..."; \
|
||||
@@ -289,7 +251,6 @@ endef
|
||||
define Download/default
|
||||
FILE:=$(PKG_SOURCE)
|
||||
URL:=$(PKG_SOURCE_URL)
|
||||
URL_FILE:=$(PKG_SOURCE_URL_FILE)
|
||||
SUBDIR:=$(PKG_SOURCE_SUBDIR)
|
||||
PROTO:=$(PKG_SOURCE_PROTO)
|
||||
$(if $(PKG_SOURCE_MIRROR),MIRROR:=$(filter 1,$(PKG_MIRROR)))
|
||||
|
||||
@@ -6,15 +6,21 @@
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
-include $(TMP_DIR)/.packageauxvars
|
||||
-include $(TMP_DIR)/.packagesubdirs
|
||||
|
||||
FEEDS_INSTALLED:=$(notdir $(wildcard $(TOPDIR)/package/feeds/*))
|
||||
FEEDS_AVAILABLE:=$(sort $(FEEDS_INSTALLED) $(shell $(SCRIPT_DIR)/feeds list -n 2>/dev/null))
|
||||
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)
|
||||
ifneq ($(CONFIG_PER_FEED_REPO),)
|
||||
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
|
||||
|
||||
opkg_package_files = $(wildcard \
|
||||
@@ -33,16 +39,10 @@ endef
|
||||
# 1: destination file
|
||||
define FeedSourcesAppend
|
||||
( \
|
||||
echo 'src/gz %d_core %U/targets/%S/packages'; \
|
||||
echo "src/gz %d_core %U/targets/%S/packages"; \
|
||||
$(strip $(if $(CONFIG_PER_FEED_REPO), \
|
||||
echo 'src/gz %d_base %U/packages/%A/base'; \
|
||||
$(foreach feed,$(FEEDS_AVAILABLE), \
|
||||
$(if $(CONFIG_FEED_$(feed)), \
|
||||
echo '$(if $(filter m,$(CONFIG_FEED_$(feed))),# )src/gz %d_$(feed) %U/packages/%A/$(feed)';)))) \
|
||||
$(foreach feed,base $(FEEDS_ENABLED),echo "src/gz %d_$(feed) %U/packages/%A/$(feed)";) \
|
||||
$(if $(CONFIG_PER_FEED_REPO_ADD_DISABLED), \
|
||||
$(foreach feed,$(FEEDS_DISABLED),echo "$(if $(CONFIG_PER_FEED_REPO_ADD_COMMENTED),# )src/gz %d_$(feed) %U/packages/%A/$(feed)";)))) \
|
||||
) >> $(1)
|
||||
endef
|
||||
|
||||
# 1: package name
|
||||
define GetABISuffix
|
||||
$(if $(filter-out kmod-%,$(1)),$(if $(Package/$(1)/abiversion),$(if $(filter %0 %1 %2 %3 %4 %5 %6 %7 %8 %9,$(1)),-)$(Package/$(1)/abiversion)))
|
||||
endef
|
||||
|
||||
@@ -18,8 +18,8 @@ ifdef CONFIG_PKG_CHECK_FORMAT_SECURITY
|
||||
endif
|
||||
ifdef CONFIG_PKG_ASLR_PIE
|
||||
ifeq ($(strip $(PKG_ASLR_PIE)),1)
|
||||
TARGET_CFLAGS += $(FPIC)
|
||||
TARGET_LDFLAGS += $(FPIC) -specs=$(INCLUDE_DIR)/hardened-ld-pie.specs
|
||||
TARGET_CFLAGS += -fPIC
|
||||
TARGET_LDFLAGS += -specs=$(INCLUDE_DIR)/hardened-ld-pie.specs
|
||||
endif
|
||||
endif
|
||||
ifdef CONFIG_PKG_CC_STACKPROTECTOR_REGULAR
|
||||
|
||||
@@ -132,7 +132,7 @@ define Host/Exports/Default
|
||||
$(1) : export STAGING_PREFIX=$$(HOST_BUILD_PREFIX)
|
||||
$(1) : export PKG_CONFIG_PATH=$$(STAGING_DIR_HOST)/lib/pkgconfig:$$(HOST_BUILD_PREFIX)/lib/pkgconfig
|
||||
$(1) : export PKG_CONFIG_LIBDIR=$$(HOST_BUILD_PREFIX)/lib/pkgconfig
|
||||
$(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))
|
||||
endef
|
||||
|
||||
@@ -49,31 +49,6 @@ define Build/eva-image
|
||||
mv $@.new $@
|
||||
endef
|
||||
|
||||
define Build/seama
|
||||
$(STAGING_DIR_HOST)/bin/seama -i $@ \
|
||||
-m "dev=/dev/mtdblock/$(SEAMA_MTDBLOCK)" -m "type=firmware"
|
||||
mv $@.seama $@
|
||||
endef
|
||||
|
||||
define Build/seama-seal
|
||||
$(STAGING_DIR_HOST)/bin/seama -i $@ -s $@.seama \
|
||||
-m "signature=$(SEAMA_SIGNATURE)"
|
||||
mv $@.seama $@
|
||||
endef
|
||||
|
||||
define Build/zyxel-ras-image
|
||||
let \
|
||||
newsize="$(subst k,* 1024,$(RAS_ROOTFS_SIZE))"; \
|
||||
$(STAGING_DIR_HOST)/bin/mkrasimage \
|
||||
-b $(RAS_BOARD) \
|
||||
-v $(RAS_VERSION) \
|
||||
-r $@ \
|
||||
-s $$newsize \
|
||||
-o $@.new \
|
||||
$(if $(findstring separate-kernel,$(word 1,$(1))),-k $(IMAGE_KERNEL)) \
|
||||
&& mv $@.new $@
|
||||
endef
|
||||
|
||||
define Build/netgear-chk
|
||||
$(STAGING_DIR_HOST)/bin/mkchkimg \
|
||||
-o $@.new \
|
||||
@@ -102,10 +77,6 @@ define Build/append-squashfs-fakeroot-be
|
||||
cat $@.fakesquashfs >> $@
|
||||
endef
|
||||
|
||||
define Build/append-string
|
||||
echo -n $(1) >> $@
|
||||
endef
|
||||
|
||||
# append a fake/empty uImage header, to fool bootloaders rootfs integrity check
|
||||
# for example
|
||||
define Build/append-uImage-fakehdr
|
||||
@@ -120,7 +91,7 @@ define Build/append-uImage-fakehdr
|
||||
endef
|
||||
|
||||
define Build/tplink-safeloader
|
||||
-$(STAGING_DIR_HOST)/bin/tplink-safeloader \
|
||||
-$(STAGING_DIR_HOST)/bin/tplink-safeloader \
|
||||
-B $(TPLINK_BOARD_ID) \
|
||||
-V $(REVISION) \
|
||||
-k $(IMAGE_KERNEL) \
|
||||
@@ -168,16 +139,6 @@ define Build/gzip
|
||||
@mv $@.new $@
|
||||
endef
|
||||
|
||||
define Build/zip
|
||||
mkdir $@.tmp
|
||||
mv $@ $@.tmp/$(1)
|
||||
|
||||
zip -j -X \
|
||||
$(if $(SOURCE_DATE_EPOCH),--mtime="$(SOURCE_DATE_EPOCH)") \
|
||||
$@ $@.tmp/$(if $(1),$(1),$@)
|
||||
rm -rf $@.tmp
|
||||
endef
|
||||
|
||||
define Build/jffs2
|
||||
rm -rf $(KDIR_TMP)/$(DEVICE_NAME)/jffs2 && \
|
||||
mkdir -p $(KDIR_TMP)/$(DEVICE_NAME)/jffs2/$$(dirname $(1)) && \
|
||||
@@ -254,11 +215,6 @@ define Build/pad-offset
|
||||
mv $@.new $@
|
||||
endef
|
||||
|
||||
define Build/xor-image
|
||||
$(STAGING_DIR_HOST)/bin/xorimage -i $@ -o $@.xor $(1)
|
||||
mv $@.xor $@
|
||||
endef
|
||||
|
||||
define Build/check-size
|
||||
@[ $$(($(subst k,* 1024,$(subst m, * 1024k,$(1))))) -ge "$$(stat -c%s $@)" ] || { \
|
||||
echo "WARNING: Image file $@ is too big" >&2; \
|
||||
@@ -274,13 +230,6 @@ define Build/combined-image
|
||||
@mv $@.new $@
|
||||
endef
|
||||
|
||||
define Build/linksys-image
|
||||
$(TOPDIR)/scripts/linksys-image.sh \
|
||||
"$(call param_get_default,type,$(1),$(DEVICE_NAME))" \
|
||||
$@ $@.new
|
||||
mv $@.new $@
|
||||
endef
|
||||
|
||||
define Build/openmesh-image
|
||||
$(TOPDIR)/scripts/om-fwupgradecfg-gen.sh \
|
||||
"$(call param_get_default,ce_type,$(1),$(DEVICE_NAME))" \
|
||||
@@ -294,25 +243,6 @@ define Build/openmesh-image
|
||||
"$(call param_get_default,rootfs,$(1),$@)" "rootfs"
|
||||
endef
|
||||
|
||||
define Build/qsdk-ipq-factory-nand
|
||||
$(TOPDIR)/scripts/mkits-qsdk-ipq-image.sh \
|
||||
$@.its ubi $@
|
||||
PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $@.its $@.new
|
||||
@mv $@.new $@
|
||||
endef
|
||||
|
||||
define Build/qsdk-ipq-factory-nor
|
||||
$(TOPDIR)/scripts/mkits-qsdk-ipq-image.sh \
|
||||
$@.its hlos $(IMAGE_KERNEL) rootfs $(IMAGE_ROOTFS)
|
||||
PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $@.its $@.new
|
||||
@mv $@.new $@
|
||||
endef
|
||||
|
||||
define Build/senao-header
|
||||
$(STAGING_DIR_HOST)/bin/mksenaofw $(1) -e $@ -o $@.new
|
||||
mv $@.new $@
|
||||
endef
|
||||
|
||||
define Build/sysupgrade-tar
|
||||
sh $(TOPDIR)/scripts/sysupgrade-tar.sh \
|
||||
--board $(if $(BOARD_NAME),$(BOARD_NAME),$(DEVICE_NAME)) \
|
||||
@@ -355,25 +285,17 @@ json_quote=$(subst ','\'',$(subst ",\",$(1)))
|
||||
metadata_devices=$(if $(1),$(subst "$(space)","$(comma)",$(strip $(foreach v,$(1),"$(call json_quote,$(v))"))))
|
||||
metadata_json = \
|
||||
'{ $(if $(IMAGE_METADATA),$(IMAGE_METADATA)$(comma)) \
|
||||
"metadata_version": "1.0", \
|
||||
"supported_devices":[$(call metadata_devices,$(1))], \
|
||||
"version": { \
|
||||
"dist": "$(call json_quote,$(VERSION_DIST))", \
|
||||
"version": "$(call json_quote,$(VERSION_NUMBER))", \
|
||||
"revision": "$(call json_quote,$(REVISION))", \
|
||||
"target": "$(call json_quote,$(TARGETID))", \
|
||||
"board": "$(call json_quote,$(if $(BOARD_NAME),$(BOARD_NAME),$(DEVICE_NAME)))" \
|
||||
"board": "$(call json_quote,$(BOARD))" \
|
||||
} \
|
||||
}'
|
||||
|
||||
define Build/append-metadata
|
||||
$(if $(SUPPORTED_DEVICES),-echo $(call metadata_json,$(SUPPORTED_DEVICES)) | fwtool -I - $@)
|
||||
[ ! -s "$(BUILD_KEY)" -o ! -s "$(BUILD_KEY).ucert" -o ! -s "$@" ] || { \
|
||||
cp "$(BUILD_KEY).ucert" "$@.ucert" ;\
|
||||
usign -S -m "$@" -s "$(BUILD_KEY)" -x "$@.sig" ;\
|
||||
ucert -A -c "$@.ucert" -x "$@.sig" ;\
|
||||
fwtool -S "$@.ucert" "$@" ;\
|
||||
}
|
||||
endef
|
||||
|
||||
define Build/kernel2minor
|
||||
|
||||
@@ -152,32 +152,6 @@ ifdef CONFIG_TARGET_IMAGES_GZIP
|
||||
endef
|
||||
endif
|
||||
|
||||
|
||||
# Disable noisy checks by default as in upstream
|
||||
ifeq ($(strip $(call kernel_patchver_ge,4.7.0)),1)
|
||||
DTC_FLAGS += -Wno-unit_address_vs_reg
|
||||
endif
|
||||
ifeq ($(strip $(call kernel_patchver_ge,4.12.0)),1)
|
||||
DTC_FLAGS += \
|
||||
-Wno-unit_address_vs_reg \
|
||||
-Wno-simple_bus_reg \
|
||||
-Wno-unit_address_format \
|
||||
-Wno-pci_bridge \
|
||||
-Wno-pci_device_bus_num \
|
||||
-Wno-pci_device_reg
|
||||
endif
|
||||
ifeq ($(strip $(call kernel_patchver_ge,4.17.0)),1)
|
||||
DTC_FLAGS += \
|
||||
-Wno-avoid_unnecessary_addr_size \
|
||||
-Wno-alias_paths
|
||||
endif
|
||||
ifeq ($(strip $(call kernel_patchver_ge,4.18.0)),1)
|
||||
DTC_FLAGS += \
|
||||
-Wno-graph_child_address \
|
||||
-Wno-graph_port \
|
||||
-Wno-unique_unit_address
|
||||
endif
|
||||
|
||||
# $(1) source dts file
|
||||
# $(2) target dtb file
|
||||
# $(3) extra CPP flags
|
||||
@@ -190,7 +164,7 @@ define Image/BuildDTB
|
||||
-undef -D__DTS__ $(3) \
|
||||
-o $(2).tmp $(1)
|
||||
$(LINUX_DIR)/scripts/dtc/dtc -O dtb \
|
||||
-i$(dir $(1)) $(DTC_FLAGS) $(4) \
|
||||
-i$(dir $(1)) $(4) \
|
||||
-o $(2) $(2).tmp
|
||||
$(RM) $(2).tmp
|
||||
endef
|
||||
@@ -229,7 +203,8 @@ define Image/mkfs/squashfs
|
||||
$(STAGING_DIR_HOST)/bin/mksquashfs4 $(call mkfs_target_dir,$(1)) $@ \
|
||||
-nopad -noappend -root-owned \
|
||||
-comp $(SQUASHFSCOMP) $(SQUASHFSOPT) \
|
||||
-processors 1
|
||||
-processors 1 \
|
||||
$(if $(SOURCE_DATE_EPOCH),-fixed-time $(SOURCE_DATE_EPOCH))
|
||||
endef
|
||||
|
||||
# $(1): board name
|
||||
@@ -291,7 +266,7 @@ endef
|
||||
|
||||
ifdef CONFIG_TARGET_ROOTFS_TARGZ
|
||||
define Image/Build/targz
|
||||
$(TAR) -cp --numeric-owner --owner=0 --group=0 --mode=a-s --sort=name \
|
||||
$(TAR) -cp --numeric-owner --owner=0 --group=0 --sort=name \
|
||||
$(if $(SOURCE_DATE_EPOCH),--mtime="@$(SOURCE_DATE_EPOCH)") \
|
||||
-C $(TARGET_DIR)/ . | gzip -9n > $(BIN_DIR)/$(IMG_PREFIX)$(if $(PROFILE_SANITIZED),-$(PROFILE_SANITIZED))-rootfs.tar.gz
|
||||
endef
|
||||
@@ -304,8 +279,8 @@ ifdef CONFIG_TARGET_ROOTFS_CPIOGZ
|
||||
endif
|
||||
|
||||
mkfs_packages = $(filter-out @%,$(PACKAGES_$(call param_get,pkg,pkg=$(target_params))))
|
||||
mkfs_packages_add = $(foreach pkg,$(filter-out -%,$(mkfs_packages)),$(pkg)$(call GetABISuffix,$(pkg)))
|
||||
mkfs_packages_remove = $(foreach pkg,$(patsubst -%,%,$(filter -%,$(mkfs_packages))),$(pkg)$(call GetABISuffix,$(pkg)))
|
||||
mkfs_packages_add = $(filter-out -%,$(mkfs_packages))
|
||||
mkfs_packages_remove = $(patsubst -%,%,$(filter -%,$(mkfs_packages)))
|
||||
mkfs_cur_target_dir = $(call mkfs_target_dir,pkg=$(target_params))
|
||||
|
||||
opkg_target = \
|
||||
@@ -346,7 +321,6 @@ define Device/Init
|
||||
CMDLINE:=
|
||||
|
||||
IMAGES :=
|
||||
ARTIFACTS :=
|
||||
IMAGE_PREFIX := $(IMG_PREFIX)-$(1)
|
||||
IMAGE_NAME = $$(IMAGE_PREFIX)-$$(1)-$$(2)
|
||||
KERNEL_PREFIX = $$(IMAGE_PREFIX)
|
||||
@@ -383,18 +357,15 @@ define Device/Init
|
||||
IMAGE_METADATA :=
|
||||
|
||||
FILESYSTEMS := $(TARGET_FILESYSTEMS)
|
||||
|
||||
UBOOT_PATH := $(STAGING_DIR_IMAGE)/uboot-$(1)
|
||||
|
||||
DEFAULT :=
|
||||
endef
|
||||
|
||||
DEFAULT_DEVICE_VARS := \
|
||||
DEVICE_NAME KERNEL KERNEL_INITRAMFS KERNEL_INITRAMFS_IMAGE KERNEL_SIZE \
|
||||
CMDLINE UBOOTENV_IN_UBI KERNEL_IN_UBI BLOCKSIZE PAGESIZE SUBPAGESIZE \
|
||||
VID_HDR_OFFSET UBINIZE_OPTS UBINIZE_PARTS MKUBIFS_OPTS DEVICE_DTS \
|
||||
DEVICE_DTS_CONFIG DEVICE_DTS_DIR BOARD_NAME UIMAGE_NAME SUPPORTED_DEVICES \
|
||||
IMAGE_METADATA KERNEL_ENTRY KERNEL_LOADADDR UBOOT_PATH
|
||||
DEVICE_NAME KERNEL KERNEL_INITRAMFS KERNEL_SIZE KERNEL_INITRAMFS_IMAGE \
|
||||
KERNEL_LOADADDR DEVICE_DTS DEVICE_DTS_CONFIG DEVICE_DTS_DIR BOARD_NAME \
|
||||
CMDLINE UBOOTENV_IN_UBI KERNEL_IN_UBI \
|
||||
BLOCKSIZE PAGESIZE SUBPAGESIZE VID_HDR_OFFSET \
|
||||
UBINIZE_OPTS UIMAGE_NAME UBINIZE_PARTS \
|
||||
SUPPORTED_DEVICES IMAGE_METADATA
|
||||
|
||||
define Device/ExportVar
|
||||
$(1) : $(2):=$$($(2))
|
||||
@@ -422,7 +393,6 @@ endef
|
||||
|
||||
define Device/Check/Common
|
||||
_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
|
||||
$$(eval $$(call merge_packages,_PACKAGES,$$(DEVICE_PACKAGES) $$(call DEVICE_EXTRA_PACKAGES,$(1))))
|
||||
ROOTFS_ID/$(1) := $$(if $$(_PROFILE_SET),$$(call mkfs_packages_id,$$(_PACKAGES)))
|
||||
@@ -527,20 +497,6 @@ define Device/Build/image
|
||||
|
||||
endef
|
||||
|
||||
define Device/Build/artifact
|
||||
$$(_TARGET): $(BIN_DIR)/$(IMAGE_PREFIX)-$(1)
|
||||
$(eval $(call Device/Export,$(KDIR)/tmp/$(IMAGE_PREFIX)-$(1)))
|
||||
$(KDIR)/tmp/$(IMAGE_PREFIX)-$(1): $$(KDIR_KERNEL_IMAGE)
|
||||
@rm -f $$@
|
||||
$$(call concat_cmd,$(ARTIFACT/$(1)))
|
||||
|
||||
.IGNORE: $(BIN_DIR)/$(IMAGE_PREFIX)-$(1)
|
||||
|
||||
$(BIN_DIR)/$(IMAGE_PREFIX)-$(1): $(KDIR)/tmp/$(IMAGE_PREFIX)-$(1)
|
||||
cp $$^ $$@
|
||||
|
||||
endef
|
||||
|
||||
define Device/Build
|
||||
$(if $(CONFIG_TARGET_ROOTFS_INITRAMFS),$(call Device/Build/initramfs,$(1)))
|
||||
$(call Device/Build/kernel,$(1))
|
||||
@@ -551,19 +507,12 @@ define Device/Build
|
||||
$$(eval $$(foreach image,$$(IMAGES), \
|
||||
$$(foreach fs,$$(filter $(TARGET_FILESYSTEMS),$$(FILESYSTEMS)), \
|
||||
$$(call Device/Build/image,$$(fs),$$(image),$(1)))))
|
||||
|
||||
$$(eval $$(foreach artifact,$$(ARTIFACTS), \
|
||||
$$(call Device/Build/artifact,$$(artifact))))
|
||||
|
||||
endef
|
||||
|
||||
define Device/DumpInfo
|
||||
Target-Profile: DEVICE_$(1)
|
||||
Target-Profile-Name: $(DEVICE_TITLE)
|
||||
Target-Profile-Packages: $(DEVICE_PACKAGES)
|
||||
Target-Profile-hasImageMetadata: $(if $(foreach image,$(IMAGES),$(findstring append-metadata,$(IMAGE/$(image)))),1,0)
|
||||
Target-Profile-SupportedDevices: $(SUPPORTED_DEVICES)
|
||||
$(if $(DEFAULT),Target-Profile-Default: $(DEFAULT))
|
||||
Target-Profile-Description:
|
||||
$(DEVICE_DESCRIPTION)
|
||||
@@
|
||||
@@ -613,7 +562,7 @@ define BuildImage
|
||||
$(call Image/Prepare)
|
||||
|
||||
legacy-images-prepare-make: image_prepare
|
||||
$(MAKE) legacy-images-prepare BIN_DIR="$(BIN_DIR)"
|
||||
$(MAKE) legacy-images-prepare
|
||||
|
||||
else
|
||||
image_prepare:
|
||||
@@ -637,7 +586,7 @@ define BuildImage
|
||||
|
||||
legacy-images-make: install-images
|
||||
$(call Image/mkfs/ubifs/legacy)
|
||||
$(MAKE) legacy-images BIN_DIR="$(BIN_DIR)"
|
||||
$(MAKE) legacy-images
|
||||
|
||||
install: install-images
|
||||
$(call Image/Manifest)
|
||||
|
||||
@@ -11,7 +11,7 @@ ifneq ($(DUMP),1)
|
||||
all: compile
|
||||
endif
|
||||
|
||||
KERNEL_FILE_DEPENDS=$(GENERIC_BACKPORT_DIR) $(GENERIC_PATCH_DIR) $(GENERIC_HACK_DIR) $(PATCH_DIR) $(GENERIC_FILES_DIR) $(FILES_DIR)
|
||||
KERNEL_FILE_DEPENDS=$(BACKPORT_PATCH_DIR) $(GENERIC_PATCH_DIR) $(GENERIC_HACK_DIR) $(PATCH_DIR) $(GENERIC_FILES_DIR) $(FILES_DIR)
|
||||
STAMP_PREPARED=$(LINUX_DIR)/.prepared$(if $(QUILT)$(DUMP),,_$(shell $(call find_md5,$(KERNEL_FILE_DEPENDS),)))
|
||||
STAMP_CONFIGURED:=$(LINUX_DIR)/.configured
|
||||
include $(INCLUDE_DIR)/download.mk
|
||||
@@ -131,16 +131,10 @@ define BuildKernel
|
||||
$(Kernel/Configure)
|
||||
touch $$@
|
||||
|
||||
$(LINUX_DIR)/.modules: export STAGING_PREFIX=$$(STAGING_DIR_HOST)
|
||||
$(LINUX_DIR)/.modules: export PKG_CONFIG_PATH=$$(STAGING_DIR_HOST)/lib/pkgconfig
|
||||
$(LINUX_DIR)/.modules: export PKG_CONFIG_LIBDIR=$$(STAGING_DIR_HOST)/lib/pkgconfig
|
||||
$(LINUX_DIR)/.modules: $(STAMP_CONFIGURED) $(LINUX_DIR)/.config FORCE
|
||||
$(Kernel/CompileModules)
|
||||
touch $$@
|
||||
|
||||
$(LINUX_DIR)/.image: export STAGING_PREFIX=$$(STAGING_DIR_HOST)
|
||||
$(LINUX_DIR)/.image: export PKG_CONFIG_PATH=$$(STAGING_DIR_HOST)/lib/pkgconfig
|
||||
$(LINUX_DIR)/.image: export PKG_CONFIG_LIBDIR=$$(STAGING_DIR_HOST)/lib/pkgconfig
|
||||
$(LINUX_DIR)/.image: $(STAMP_CONFIGURED) $(if $(CONFIG_STRIP_KERNEL_EXPORTS),$(KERNEL_BUILD_DIR)/symtab.h) FORCE
|
||||
$(Kernel/CompileImage)
|
||||
$(Kernel/CollectDebug)
|
||||
|
||||
@@ -21,22 +21,16 @@ export HOST_EXTRACFLAGS=-I$(STAGING_DIR_HOST)/include
|
||||
# defined in quilt.mk
|
||||
Kernel/Patch:=$(Kernel/Patch/Default)
|
||||
|
||||
ifneq (,$(findstring .xz,$(LINUX_SOURCE)))
|
||||
LINUX_CAT:=xzcat
|
||||
else
|
||||
LINUX_CAT:=zcat
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(CONFIG_EXTERNAL_KERNEL_TREE)),"")
|
||||
ifeq ($(strip $(CONFIG_KERNEL_GIT_CLONE_URI)),"")
|
||||
define Kernel/Prepare/Default
|
||||
$(LINUX_CAT) $(DL_DIR)/$(LINUX_SOURCE) | $(TAR) -C $(KERNEL_BUILD_DIR) $(TAR_OPTIONS)
|
||||
xzcat $(DL_DIR)/$(LINUX_SOURCE) | $(TAR) -C $(KERNEL_BUILD_DIR) $(TAR_OPTIONS)
|
||||
$(Kernel/Patch)
|
||||
$(if $(QUILT),touch $(LINUX_DIR)/.quilt_used)
|
||||
endef
|
||||
else
|
||||
define Kernel/Prepare/Default
|
||||
$(LINUX_CAT) $(DL_DIR)/$(LINUX_SOURCE) | $(TAR) -C $(KERNEL_BUILD_DIR) $(TAR_OPTIONS)
|
||||
xzcat $(DL_DIR)/$(LINUX_SOURCE) | $(TAR) -C $(KERNEL_BUILD_DIR) $(TAR_OPTIONS)
|
||||
endef
|
||||
endif
|
||||
else
|
||||
|
||||
@@ -2,13 +2,15 @@
|
||||
|
||||
LINUX_RELEASE?=1
|
||||
|
||||
ifdef CONFIG_TESTING_KERNEL
|
||||
KERNEL_PATCHVER:=$(KERNEL_TESTING_PATCHVER)
|
||||
endif
|
||||
LINUX_VERSION-3.18 = .71
|
||||
LINUX_VERSION-4.4 = .121
|
||||
LINUX_VERSION-4.9 = .109
|
||||
LINUX_VERSION-4.14 = .50
|
||||
|
||||
LINUX_VERSION-4.14 = .167
|
||||
|
||||
LINUX_KERNEL_HASH-4.14.167 = 2bb78fc7a902faf4f5dad47fdbc2f4bf3df3cf9b41f408e7260f36656659fe43
|
||||
LINUX_KERNEL_HASH-3.18.71 = 5abc9778ad44ce02ed6c8ab52ece8a21c6d20d21f6ed8a19287b4a38a50c1240
|
||||
LINUX_KERNEL_HASH-4.4.121 = 44a88268b5088dc326b30c9b9133ac35a9a200b636b7268d08f32abeae6ca729
|
||||
LINUX_KERNEL_HASH-4.9.109 = 3dcd5654a553432119492b69e649c4ed117781bfd571edcb02346c945be359b0
|
||||
LINUX_KERNEL_HASH-4.14.50 = 703a8d013b25dc428d936f72858fa0c702c22cb3114a040fb9bb47562e4ea2ac
|
||||
|
||||
remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1))))
|
||||
sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1)))))))
|
||||
@@ -23,9 +25,6 @@ else
|
||||
ifdef KERNEL_PATCHVER
|
||||
LINUX_VERSION:=$(KERNEL_PATCHVER)$(strip $(LINUX_VERSION-$(KERNEL_PATCHVER)))
|
||||
endif
|
||||
ifdef KERNEL_TESTING_PATCHVER
|
||||
LINUX_TESTING_VERSION:=$(KERNEL_TESTING_PATCHVER)$(strip $(LINUX_VERSION-$(KERNEL_TESTING_PATCHVER)))
|
||||
endif
|
||||
endif
|
||||
|
||||
split_version=$(subst ., ,$(1))
|
||||
|
||||
@@ -59,16 +59,10 @@ else
|
||||
|
||||
LINUX_KERNEL:=$(KERNEL_BUILD_DIR)/vmlinux
|
||||
|
||||
ifneq (,$(findstring -rc,$(LINUX_VERSION)))
|
||||
LINUX_SOURCE:=linux-$(LINUX_VERSION).tar.gz
|
||||
else
|
||||
LINUX_SOURCE:=linux-$(LINUX_VERSION).tar.xz
|
||||
endif
|
||||
|
||||
ifneq (,$(findstring -rc,$(LINUX_VERSION)))
|
||||
LINUX_SITE:=https://git.kernel.org/torvalds/t
|
||||
else 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_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)),)
|
||||
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
|
||||
@@ -77,7 +71,7 @@ else
|
||||
TARGET_MODULES_DIR:=$(LINUX_TARGET_DIR)/$(MODULES_SUBDIR)
|
||||
|
||||
ifneq ($(TARGET_BUILD),1)
|
||||
PKG_BUILD_DIR ?= $(KERNEL_BUILD_DIR)/$(if $(BUILD_VARIANT),$(PKG_NAME)-$(BUILD_VARIANT)/)$(PKG_NAME)$(if $(PKG_VERSION),-$(PKG_VERSION))
|
||||
PKG_BUILD_DIR ?= $(KERNEL_BUILD_DIR)/$(PKG_NAME)$(if $(PKG_VERSION),-$(PKG_VERSION))
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -103,7 +97,7 @@ endif
|
||||
|
||||
KERNEL_MAKE = $(MAKE) $(KERNEL_MAKEOPTS)
|
||||
|
||||
KERNEL_MAKE_FLAGS = \
|
||||
KERNEL_MAKE_FLAGS := \
|
||||
HOSTCFLAGS="$(HOST_CFLAGS) -Wall -Wmissing-prototypes -Wstrict-prototypes" \
|
||||
CROSS_COMPILE="$(KERNEL_CROSS)" \
|
||||
ARCH="$(LINUX_KARCH)" \
|
||||
@@ -129,10 +123,6 @@ ifdef CONFIG_USE_SPARSE
|
||||
KERNEL_MAKEOPTS += C=1 CHECK=$(STAGING_DIR_HOST)/bin/sparse
|
||||
endif
|
||||
|
||||
ifeq ($(HOST_OS),Darwin)
|
||||
export SKIP_STACK_VALIDATION:=1
|
||||
endif
|
||||
|
||||
PKG_EXTMOD_SUBDIRS ?= .
|
||||
|
||||
define populate_module_symvers
|
||||
@@ -145,10 +135,7 @@ endef
|
||||
|
||||
define collect_module_symvers
|
||||
for subdir in $(PKG_EXTMOD_SUBDIRS); do \
|
||||
realdir=$$$$(readlink -f $(PKG_BUILD_DIR)); \
|
||||
grep -F $(PKG_BUILD_DIR) $(PKG_BUILD_DIR)/$$$$subdir/Module.symvers >> $(PKG_BUILD_DIR)/Module.symvers.tmp; \
|
||||
[ "$(PKG_BUILD_DIR)" = "$$$$realdir" ] || \
|
||||
grep -F $$$$realdir $(PKG_BUILD_DIR)/$$$$subdir/Module.symvers >> $(PKG_BUILD_DIR)/Module.symvers.tmp; \
|
||||
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
|
||||
@@ -250,7 +237,7 @@ $(call KernelPackage/$(1)/config)
|
||||
exit 1; \
|
||||
fi; \
|
||||
done;
|
||||
$(call ModuleAutoLoad,$(1),$$(1),$(filter-out 0-,$(word 1,$(AUTOLOAD))-),$(filter-out 0,$(word 2,$(AUTOLOAD))),$(sort $(wordlist 3,99,$(AUTOLOAD))))
|
||||
$(call ModuleAutoLoad,$(1),$$(1),$(filter-out 0-,$(word 1,$(AUTOLOAD))-),$(filter-out 0,$(word 2,$(AUTOLOAD))),$(wordlist 3,99,$(AUTOLOAD)))
|
||||
$(call KernelPackage/$(1)/install,$$(1))
|
||||
endef
|
||||
$(if $(CONFIG_PACKAGE_kmod-$(1)),
|
||||
@@ -266,8 +253,7 @@ $(call KernelPackage/$(1)/config)
|
||||
endif
|
||||
$$(eval $$(call BuildPackage,kmod-$(1)))
|
||||
|
||||
$$(IPKG_kmod-$(1)): $$(wildcard $$(call version_filter,$$(FILES)))
|
||||
|
||||
$$(IPKG_kmod-$(1)): $$(wildcard $$(FILES))
|
||||
endef
|
||||
|
||||
version_filter=$(if $(findstring @,$(1)),$(shell $(SCRIPT_DIR)/package-metadata.pl version_filter $(KERNEL_PATCHVER) $(1)),$(1))
|
||||
|
||||
@@ -80,7 +80,6 @@ $(eval $(call nf_add,IPT_CONNTRACK,CONFIG_NETFILTER_XT_MATCH_CONNTRACK, $(P_XT)x
|
||||
|
||||
$(eval $(call nf_add,IPT_CONNTRACK_EXTRA,CONFIG_NETFILTER_XT_MATCH_CONNBYTES, $(P_XT)xt_connbytes))
|
||||
$(eval $(call nf_add,IPT_CONNTRACK_EXTRA,CONFIG_NETFILTER_XT_MATCH_CONNLIMIT, $(P_XT)xt_connlimit))
|
||||
$(eval $(call nf_add,IPT_CONNTRACK_EXTRA,CONFIG_NETFILTER_CONNCOUNT, $(P_XT)nf_conncount))
|
||||
$(eval $(call nf_add,IPT_CONNTRACK_EXTRA,CONFIG_NETFILTER_XT_CONNMARK, $(P_XT)xt_connmark))
|
||||
$(eval $(call nf_add,IPT_CONNTRACK_EXTRA,CONFIG_NETFILTER_XT_MATCH_HELPER, $(P_XT)xt_helper))
|
||||
$(eval $(call nf_add,IPT_CONNTRACK_EXTRA,CONFIG_NETFILTER_XT_MATCH_RECENT, $(P_XT)xt_recent))
|
||||
@@ -107,7 +106,6 @@ $(eval $(call nf_add,IPT_PHYSDEV,CONFIG_NETFILTER_XT_MATCH_PHYSDEV, $(P_XT)xt_ph
|
||||
# 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_BPF, $(P_XT)xt_bpf))
|
||||
|
||||
|
||||
# ipopt
|
||||
@@ -157,8 +155,7 @@ $(eval $(if $(NF_KMOD),$(call nf_add,NF_REJECT6,CONFIG_NF_REJECT_IPV6, $(P_V6)nf
|
||||
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NF_IPT6,CONFIG_IP6_NF_IPTABLES, $(P_V6)ip6_tables),))
|
||||
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NF_CONNTRACK,CONFIG_NF_DEFRAG_IPV6, $(P_V6)nf_defrag_ipv6, ge 4.19),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NF_CONNTRACK6,CONFIG_NF_DEFRAG_IPV6, $(P_V6)nf_defrag_ipv6, lt 4.19),))
|
||||
$(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,IPT_IPV6,CONFIG_IP6_NF_FILTER, $(P_V6)ip6table_filter),))
|
||||
@@ -187,10 +184,10 @@ $(eval $(call nf_add,IPT_IPV6_EXTRA,CONFIG_IP6_NF_MATCH_RT, $(P_V6)ip6t_rt))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NF_NAT,CONFIG_NF_NAT, $(P_XT)nf_nat),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NF_NAT,CONFIG_NF_NAT_REDIRECT, $(P_XT)nf_nat_redirect, ge 3.19.0),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NF_NAT,CONFIG_NF_NAT_IPV4, $(P_V4)nf_nat_ipv4),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NF_NAT,CONFIG_NF_NAT_MASQUERADE_IPV4, $(P_V4)nf_nat_masquerade_ipv4, lt 4.18),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NF_NAT,CONFIG_NF_NAT_MASQUERADE_IPV4, $(P_V4)nf_nat_masquerade_ipv4),))
|
||||
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NF_NAT6,CONFIG_NF_NAT_IPV6, $(P_V6)nf_nat_ipv6),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NF_NAT6,CONFIG_NF_NAT_MASQUERADE_IPV6, $(P_V6)nf_nat_masquerade_ipv6, lt 4.18),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NF_NAT6,CONFIG_NF_NAT_MASQUERADE_IPV6, $(P_V6)nf_nat_masquerade_ipv6),))
|
||||
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,IPT_NAT,CONFIG_NETFILTER_XT_NAT, $(P_XT)xt_nat),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,IPT_NAT,CONFIG_IP_NF_NAT, $(P_V4)iptable_nat),))
|
||||
@@ -260,11 +257,7 @@ $(eval $(call nf_add,IPT_DEBUG,CONFIG_NETFILTER_XT_TARGET_TRACE, $(P_XT)xt_TRACE
|
||||
# tproxy
|
||||
|
||||
$(eval $(call nf_add,IPT_TPROXY,CONFIG_NETFILTER_XT_MATCH_SOCKET, $(P_XT)xt_socket))
|
||||
$(eval $(call nf_add,IPT_TPROXY,CONFIG_NF_SOCKET_IPV4, $(P_V4)nf_socket_ipv4, ge 4.10))
|
||||
$(eval $(call nf_add,IPT_TPROXY,CONFIG_NF_SOCKET_IPV6, $(P_V6)nf_socket_ipv6, ge 4.10))
|
||||
$(eval $(call nf_add,IPT_TPROXY,CONFIG_NETFILTER_XT_TARGET_TPROXY, $(P_XT)xt_TPROXY))
|
||||
$(eval $(call nf_add,IPT_TPROXY,CONFIG_NF_TPROXY_IPV4, $(P_V4)nf_tproxy_ipv4, ge 4.18))
|
||||
$(eval $(call nf_add,IPT_TPROXY,CONFIG_NF_TPROXY_IPV6, $(P_V6)nf_tproxy_ipv6, ge 4.18))
|
||||
|
||||
# led
|
||||
$(eval $(call nf_add,IPT_LED,CONFIG_NETFILTER_XT_TARGET_LED, $(P_XT)xt_LED))
|
||||
@@ -334,7 +327,7 @@ $(eval $(call nf_add,EBTABLES_WATCHERS,CONFIG_BRIDGE_EBT_NFQUEUE, $(P_EBT)ebt_nf
|
||||
|
||||
# nftables
|
||||
$(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, lt 4.17),))
|
||||
$(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_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),))
|
||||
@@ -348,16 +341,16 @@ $(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_REJECT, $(P_XT)nft_reject $(P_V4)nft_reject_ipv4 $(P_V6)nft_reject_ipv6),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NFT_REJECT_INET, $(P_XT)nft_reject_inet),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NF_TABLES_IPV4, $(P_V4)nf_tables_ipv4, lt 4.17),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NF_TABLES_IPV4, $(P_V4)nf_tables_ipv4),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NFT_CHAIN_ROUTE_IPV4, $(P_V4)nft_chain_route_ipv4),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NF_TABLES_IPV6, $(P_V6)nf_tables_ipv6, lt 4.17),))
|
||||
$(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_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, lt 4.17),))
|
||||
$(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, lt 4.17),))
|
||||
$(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),))
|
||||
|
||||
@@ -371,11 +364,6 @@ $(eval $(if $(NF_KMOD),$(call nf_add,NFT_NAT6,CONFIG_NFT_REDIR_IPV6, $(P_V6)nft_
|
||||
$(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_FIB,CONFIG_NFT_FIB, $(P_XT)nft_fib),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_FIB,CONFIG_NFT_FIB_INET, $(P_XT)nft_fib_inet),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_FIB,CONFIG_NFT_FIB_IPV4, $(P_V4)nft_fib_ipv4),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_FIB,CONFIG_NFT_FIB_IPV6, $(P_V6)nft_fib_ipv6),))
|
||||
|
||||
|
||||
# userland only
|
||||
IPT_BUILTIN += $(NF_IPT-y) $(NF_IPT-m)
|
||||
|
||||
@@ -24,8 +24,7 @@ $(if $(MENU),Menu: $(MENU)
|
||||
)$(if $(DEFAULT),Default: $(DEFAULT)
|
||||
)$(if $(findstring $(PREREQ_CHECK),1),Prereq-Check: 1
|
||||
)Version: $(VERSION)
|
||||
$(if $(ABI_VERSION),ABIVersion: $(ABI_VERSION)
|
||||
)Depends: $(call PKG_FIXUP_DEPENDS,$(1),$(DEPENDS))
|
||||
Depends: $(call PKG_FIXUP_DEPENDS,$(1),$(DEPENDS))
|
||||
Conflicts: $(CONFLICTS)
|
||||
Menu-Depends: $(MDEPENDS)
|
||||
Provides: $(PROVIDES)
|
||||
|
||||
@@ -13,9 +13,6 @@ endif
|
||||
IPKG_BUILD:= \
|
||||
$(SCRIPT_DIR)/ipkg-build -c -o 0 -g 0
|
||||
|
||||
IPKG_REMOVE:= \
|
||||
$(SCRIPT_DIR)/ipkg-remove
|
||||
|
||||
IPKG_STATE_DIR:=$(TARGET_DIR)/usr/lib/opkg
|
||||
|
||||
# 1: package name
|
||||
@@ -35,8 +32,7 @@ PARENR :=)
|
||||
|
||||
dep_split=$(subst :,$(space),$(1))
|
||||
dep_rem=$(subst !,,$(subst $(strip $(PARENL)),,$(subst $(strip $(PARENR)),,$(word 1,$(call dep_split,$(1))))))
|
||||
dep_and=dep_and_res:=$$(and $(subst $(space),$(comma),$(foreach cond,$(subst &&, ,$(1)),$$(CONFIG_$(cond)))))
|
||||
dep_confvar=$(strip $(foreach cond,$(subst ||, ,$(call dep_rem,$(1))),$(eval $(call dep_and,$(cond)))$(dep_and_res)))
|
||||
dep_confvar=$(strip $(foreach cond,$(subst ||, ,$(call dep_rem,$(1))),$(CONFIG_$(cond))))
|
||||
dep_pos=$(if $(call dep_confvar,$(1)),$(call dep_val,$(1)))
|
||||
dep_neg=$(if $(call dep_confvar,$(1)),,$(call dep_val,$(1)))
|
||||
dep_if=$(if $(findstring !,$(1)),$(call dep_neg,$(1)),$(call dep_pos,$(1)))
|
||||
@@ -94,9 +90,8 @@ _endef=endef
|
||||
|
||||
ifeq ($(DUMP),)
|
||||
define BuildTarget/ipkg
|
||||
ABIV_$(1):=$(call GetABISuffix,$(1))
|
||||
PDIR_$(1):=$(call FeedPackageDir,$(1))
|
||||
IPKG_$(1):=$$(PDIR_$(1))/$(1)$$(ABIV_$(1))_$(VERSION)_$(PKGARCH).ipk
|
||||
IPKG_$(1):=$$(PDIR_$(1))/$(1)_$(VERSION)_$(PKGARCH).ipk
|
||||
IDIR_$(1):=$(PKG_BUILD_DIR)/ipkg-$(PKGARCH)/$(1)
|
||||
KEEP_$(1):=$(strip $(call Package/$(1)/conffiles))
|
||||
|
||||
@@ -124,8 +119,6 @@ ifeq ($(DUMP),)
|
||||
endif
|
||||
$(PKG_INSTALL_STAMP).$(1): prepare-package-install
|
||||
echo "$(1)" >> $(PKG_INSTALL_STAMP)
|
||||
else
|
||||
$(if $(CONFIG_PACKAGE_$(1)),$$(warning WARNING: skipping $(1) -- package has no install section))
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -155,20 +148,19 @@ ifeq ($(DUMP),)
|
||||
$(call locked,$(CP) $(PKG_BUILD_DIR)/.pkgdir/$(1)/. $(STAGING_DIR_ROOT)/,root-copy)
|
||||
touch $$@
|
||||
|
||||
Package/$(1)/DEPENDS := $$(call mergelist,$$(foreach dep,$$(filter-out @%,$$(IDEPEND_$(1))),$$(dep)$$(call GetABISuffix,$$(dep))))
|
||||
Package/$(1)/DEPENDS := $$(call mergelist,$$(filter-out @%,$$(IDEPEND_$(1))))
|
||||
ifneq ($$(EXTRA_DEPENDS),)
|
||||
Package/$(1)/DEPENDS := $$(EXTRA_DEPENDS)$$(if $$(Package/$(1)/DEPENDS),$$(comma) $$(Package/$(1)/DEPENDS))
|
||||
endif
|
||||
|
||||
$(_define) Package/$(1)/CONTROL
|
||||
Package: $(1)$$(ABIV_$(1))
|
||||
Package: $(1)
|
||||
Version: $(VERSION)
|
||||
$$(call addfield,Depends,$$(Package/$(1)/DEPENDS)
|
||||
)$$(call addfield,Conflicts,$$(call mergelist,$(CONFLICTS))
|
||||
)$$(call addfield,Provides,$$(call mergelist,$$(filter-out $(1)$$(ABIV_$(1)),$(PROVIDES)$$(if $$(ABIV_$(1)), $(1) $(foreach provide,$(PROVIDES),$(provide)$$(call GetABISuffix,$(provide))))))
|
||||
)$$(call addfield,Provides,$$(call mergelist,$(PROVIDES))
|
||||
)$$(call addfield,Alternatives,$$(call mergelist,$(ALTERNATIVES))
|
||||
)$$(call addfield,Source,$(SOURCE)
|
||||
)$$(call addfield,SourceName,$(1)
|
||||
)$$(call addfield,License,$(LICENSE)
|
||||
)$$(call addfield,LicenseFiles,$(LICENSE_FILES)
|
||||
)$$(call addfield,Section,$(SECTION)
|
||||
@@ -184,7 +176,7 @@ $(_endef)
|
||||
$$(IPKG_$(1)) : export DESCRIPTION=$$(Package/$(1)/description)
|
||||
$$(IPKG_$(1)) : export PATH=$$(TARGET_PATH_PKG)
|
||||
$(PKG_INFO_DIR)/$(1).provides $$(IPKG_$(1)): $(STAMP_BUILT) $(INCLUDE_DIR)/package-ipkg.mk
|
||||
@rm -rf $$(IDIR_$(1)) $$(if $$(call opkg_package_files,$(1)*),; $$(IPKG_REMOVE) $(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)
|
||||
$(call Package/$(1)/install,$$(IDIR_$(1)))
|
||||
$(if $(Package/$(1)/install-overlay),mkdir -p $(PACKAGE_DIR) $$(IDIR_$(1))/rootfs-overlay)
|
||||
@@ -198,19 +190,10 @@ $(_endef)
|
||||
fi; \
|
||||
done; $(Package/$(1)/extra_provides) \
|
||||
) | sort -u > $(PKG_INFO_DIR)/$(1).provides
|
||||
$(if $(PROVIDES),@for pkg in $(filter-out $(1),$(PROVIDES)); do cp $(PKG_INFO_DIR)/$(1).provides $(PKG_INFO_DIR)/$$$$pkg.provides; done)
|
||||
$(if $(PROVIDES),@for pkg in $(PROVIDES); do cp $(PKG_INFO_DIR)/$(1).provides $(PKG_INFO_DIR)/$$$$pkg.provides; done)
|
||||
$(CheckDependencies)
|
||||
|
||||
$(RSTRIP) $$(IDIR_$(1))
|
||||
|
||||
ifneq ($$(CONFIG_IPK_FILES_CHECKSUMS),)
|
||||
(cd $$(IDIR_$(1)); \
|
||||
( \
|
||||
find . -type f \! -path ./CONTROL/\* -exec sha256sum \{\} \; 2> /dev/null | \
|
||||
sed 's|\([[:blank:]]\)\./|\1/|' > $$(IDIR_$(1))/CONTROL/files-sha256 \
|
||||
) || true \
|
||||
)
|
||||
endif
|
||||
(cd $$(IDIR_$(1))/CONTROL; \
|
||||
( \
|
||||
echo "$$$$CONTROL"; \
|
||||
@@ -252,7 +235,7 @@ $(_endef)
|
||||
@[ -f $$(IPKG_$(1)) ]
|
||||
|
||||
$(1)-clean:
|
||||
$$(if $$(call opkg_package_files,$(1)*),$$(IPKG_REMOVE) $(1) $$(call opkg_package_files,$(1)*))
|
||||
$$(if $$(call opkg_package_files,$(1)),rm -f $$(call opkg_package_files,$(1)))
|
||||
|
||||
clean: $(1)-clean
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ all: $(if $(DUMP),dumpinfo,$(if $(CHECK),check,compile))
|
||||
|
||||
include $(INCLUDE_DIR)/download.mk
|
||||
|
||||
PKG_BUILD_DIR ?= $(BUILD_DIR)/$(if $(BUILD_VARIANT),$(PKG_NAME)-$(BUILD_VARIANT)/)$(PKG_NAME)$(if $(PKG_VERSION),-$(PKG_VERSION))
|
||||
PKG_BUILD_DIR ?= $(BUILD_DIR)/$(PKG_NAME)$(if $(PKG_VERSION),-$(PKG_VERSION))
|
||||
PKG_INSTALL_DIR ?= $(PKG_BUILD_DIR)/ipkg-install
|
||||
PKG_BUILD_PARALLEL ?=
|
||||
PKG_USE_MIPS16 ?= 1
|
||||
@@ -40,10 +40,6 @@ include $(INCLUDE_DIR)/prereq.mk
|
||||
include $(INCLUDE_DIR)/unpack.mk
|
||||
include $(INCLUDE_DIR)/depends.mk
|
||||
|
||||
ifneq ($(wildcard $(TOPDIR)/git-src/$(PKG_NAME)/.git),)
|
||||
USE_GIT_SRC_CHECKOUT:=1
|
||||
QUILT:=1
|
||||
endif
|
||||
ifneq ($(if $(CONFIG_SRC_TREE_OVERRIDE),$(wildcard ./git-src)),)
|
||||
USE_GIT_TREE:=1
|
||||
QUILT:=1
|
||||
@@ -57,26 +53,14 @@ endif
|
||||
|
||||
include $(INCLUDE_DIR)/quilt.mk
|
||||
|
||||
find_library_dependencies = \
|
||||
$(wildcard $(patsubst %,$(STAGING_DIR)/pkginfo/%.version, \
|
||||
$(sort $(foreach dep4, \
|
||||
$(sort $(foreach dep3, \
|
||||
$(sort $(foreach dep2, \
|
||||
$(sort $(foreach dep1, \
|
||||
$(sort $(foreach dep0, \
|
||||
$(Package/$(1)/depends), \
|
||||
$(Package/$(dep0)/depends) $(dep0) \
|
||||
)), \
|
||||
$(Package/$(dep1)/depends) $(dep1) \
|
||||
)), \
|
||||
$(Package/$(dep2)/depends) $(dep2) \
|
||||
)), \
|
||||
$(Package/$(dep3)/depends) $(dep3) \
|
||||
)), \
|
||||
$(Package/$(dep4)/depends) $(dep4) \
|
||||
)), \
|
||||
))
|
||||
|
||||
find_library_dependencies = $(wildcard $(patsubst %,$(STAGING_DIR)/pkginfo/%.version, \
|
||||
$(filter-out $(BUILD_PACKAGES),$(foreach dep, \
|
||||
$(filter-out @%, $(patsubst +%,%,$(1))), \
|
||||
$(if $(findstring :,$(dep)), \
|
||||
$(word 2,$(subst :,$(space),$(dep))), \
|
||||
$(dep) \
|
||||
) \
|
||||
))))
|
||||
|
||||
PKG_DIR_NAME:=$(lastword $(subst /,$(space),$(CURDIR)))
|
||||
STAMP_NO_AUTOREBUILD=$(wildcard $(PKG_BUILD_DIR)/.no_autorebuild)
|
||||
@@ -97,10 +81,9 @@ STAGING_FILES_LIST:=$(PKG_DIR_NAME)$(if $(BUILD_VARIANT),.$(BUILD_VARIANT),).lis
|
||||
define CleanStaging
|
||||
rm -f $(STAMP_INSTALLED)
|
||||
@-(\
|
||||
if [ -f $(STAGING_DIR)/packages/$(STAGING_FILES_LIST) ]; then \
|
||||
$(SCRIPT_DIR)/clean-package.sh \
|
||||
"$(STAGING_DIR)/packages/$(STAGING_FILES_LIST)" \
|
||||
"$(STAGING_DIR)"; \
|
||||
cd "$(STAGING_DIR)"; \
|
||||
if [ -f packages/$(STAGING_FILES_LIST) ]; then \
|
||||
cat packages/$(STAGING_FILES_LIST) | xargs -r rm -f 2>/dev/null; \
|
||||
fi; \
|
||||
)
|
||||
endef
|
||||
@@ -133,18 +116,6 @@ ifeq ($(DUMP)$(filter prereq clean refresh update,$(MAKECMDGOALS)),)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef USE_GIT_SRC_CHECKOUT
|
||||
define Build/Prepare/Default
|
||||
mkdir -p $(PKG_BUILD_DIR)
|
||||
ln -s $(TOPDIR)/git-src/$(PKG_NAME)/.git $(PKG_BUILD_DIR)/.git
|
||||
( cd $(PKG_BUILD_DIR); \
|
||||
git checkout .; \
|
||||
git submodule update --recursive; \
|
||||
git submodule foreach git config --unset core.worktree; \
|
||||
git submodule foreach git checkout .; \
|
||||
)
|
||||
endef
|
||||
endif
|
||||
ifdef USE_GIT_TREE
|
||||
define Build/Prepare/Default
|
||||
mkdir -p $(PKG_BUILD_DIR)
|
||||
@@ -173,7 +144,7 @@ define Build/Exports/Default
|
||||
$(1) : export CONFIG_SITE:=$$(CONFIG_SITE)
|
||||
$(1) : export PKG_CONFIG_PATH:=$$(PKG_CONFIG_PATH)
|
||||
$(1) : export PKG_CONFIG_LIBDIR:=$$(PKG_CONFIG_PATH)
|
||||
$(if $(CONFIG_CCACHE),$(1) : export CCACHE_DIR:=$(STAGING_DIR)/ccache)
|
||||
$(1) : export CCACHE_DIR:=$(STAGING_DIR)/ccache
|
||||
endef
|
||||
Build/Exports=$(Build/Exports/Default)
|
||||
|
||||
@@ -264,7 +235,7 @@ define Build/CoreTargets
|
||||
endef
|
||||
|
||||
define Build/DefaultTargets
|
||||
$(if $(USE_SOURCE_DIR)$(USE_GIT_TREE)$(USE_GIT_SRC_CHECKOUT),,$(if $(strip $(PKG_SOURCE_URL)),$(call Download,default)))
|
||||
$(if $(USE_SOURCE_DIR)$(USE_GIT_TREE),,$(if $(strip $(PKG_SOURCE_URL)),$(call Download,default)))
|
||||
$(if $(DUMP),,$(Build/CoreTargets))
|
||||
|
||||
define Build/DefaultTargets
|
||||
@@ -286,7 +257,7 @@ endef
|
||||
endif
|
||||
|
||||
BUILD_PACKAGES += $(1)
|
||||
$(STAMP_PREPARED): $$(if $(QUILT)$(DUMP),,$(call find_library_dependencies,$(1)))
|
||||
$(STAMP_PREPARED): $$(if $(QUILT)$(DUMP),,$(call find_library_dependencies,$(DEPENDS)))
|
||||
|
||||
$(foreach FIELD, TITLE CATEGORY SECTION VERSION,
|
||||
ifeq ($($(FIELD)),)
|
||||
|
||||
@@ -24,10 +24,10 @@ $(eval $(call TestHostCommand,case-sensitive-fs, \
|
||||
|
||||
$(eval $(call TestHostCommand,proper-umask, \
|
||||
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, \
|
||||
Please install the GNU C Compiler (gcc) 4.8 or later, \
|
||||
Please install the GNU C Compiler (gcc) 4.8 or later \
|
||||
$(CC) -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?)', \
|
||||
gcc -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?)', \
|
||||
gcc48 --version | grep gcc, \
|
||||
@@ -37,7 +37,7 @@ $(eval $(call SetupHostCommand,gcc, \
|
||||
gcc7 --version | grep gcc, \
|
||||
gcc8 --version | grep gcc, \
|
||||
gcc9 --version | grep gcc, \
|
||||
gcc --version | grep -E 'Apple.(LLVM|clang)' ))
|
||||
gcc --version | grep Apple.LLVM ))
|
||||
|
||||
$(eval $(call TestHostCommand,working-gcc, \
|
||||
\nPlease reinstall the GNU C Compiler (4.8 or later) - \
|
||||
@@ -46,7 +46,7 @@ $(eval $(call TestHostCommand,working-gcc, \
|
||||
gcc -x c -o $(TMP_DIR)/a.out -))
|
||||
|
||||
$(eval $(call SetupHostCommand,g++, \
|
||||
Please install the GNU C++ Compiler (g++) 4.8 or later, \
|
||||
Please install the GNU C++ Compiler (g++) 4.8 or later \
|
||||
$(CXX) -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?)', \
|
||||
g++ -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?)', \
|
||||
g++48 --version | grep g++, \
|
||||
@@ -56,7 +56,7 @@ $(eval $(call SetupHostCommand,g++, \
|
||||
g++7 --version | grep g++, \
|
||||
g++8 --version | grep g++, \
|
||||
g++9 --version | grep g++, \
|
||||
g++ --version | grep -E 'Apple.(LLVM|clang)' ))
|
||||
g++ --version | grep Apple.LLVM ))
|
||||
|
||||
$(eval $(call TestHostCommand,working-g++, \
|
||||
\nPlease reinstall the GNU C++ Compiler (4.8 or later) - \
|
||||
@@ -138,15 +138,18 @@ $(eval $(call SetupHostCommand,bzip2,Please install 'bzip2', \
|
||||
$(eval $(call SetupHostCommand,wget,Please install GNU 'wget', \
|
||||
wget --version | grep GNU))
|
||||
|
||||
$(eval $(call SetupHostCommand,time,Please install GNU 'time' or BusyBox 'time', \
|
||||
gtime --version 2>&1 | grep GNU, \
|
||||
time --version 2>&1 | grep GNU, \
|
||||
busybox time 2>&1 | grep BusyBox))
|
||||
|
||||
$(eval $(call SetupHostCommand,perl,Please install Perl 5.x, \
|
||||
perl --version | grep "perl.*v5"))
|
||||
|
||||
$(eval $(call CleanupPython3))
|
||||
|
||||
$(eval $(call SetupHostCommand,python,Please install Python 2.x, \
|
||||
python2.7 -V 2>&1 | grep 'Python 2.7', \
|
||||
python2 -V 2>&1 | grep 'Python 2', \
|
||||
python -V 2>&1 | grep 'Python 2'))
|
||||
python2.7 -V 2>&1 | grep Python, \
|
||||
python2 -V 2>&1 | grep Python, \
|
||||
python -V 2>&1 | grep Python))
|
||||
|
||||
$(eval $(call SetupHostCommand,git,Please install Git (git-core) >= 1.7.12.2, \
|
||||
git --exec-path | xargs -I % -- grep -q -- --recursive %/git-submodule))
|
||||
|
||||
@@ -66,18 +66,6 @@ define RequireHeader
|
||||
$$(eval $$(call Require,$(1),$(2)))
|
||||
endef
|
||||
|
||||
define CleanupPython3
|
||||
define Require/python3-cleanup
|
||||
if [ -f "$(STAGING_DIR_HOST)/bin/python" ] && \
|
||||
$(STAGING_DIR_HOST)/bin/python -V 2>&1 | \
|
||||
grep -q 'Python 3'; then \
|
||||
rm $(STAGING_DIR_HOST)/bin/python; \
|
||||
fi
|
||||
endef
|
||||
|
||||
$$(eval $$(call Require,python3-cleanup))
|
||||
endef
|
||||
|
||||
define QuoteHostCommand
|
||||
'$(subst ','"'"',$(strip $(1)))'
|
||||
endef
|
||||
|
||||
@@ -94,17 +94,17 @@ endef
|
||||
|
||||
kernel_files=$(foreach fdir,$(GENERIC_FILES_DIR) $(FILES_DIR),$(fdir)/.)
|
||||
define Kernel/Patch/Default
|
||||
$(if $(QUILT),rm -rf $(LINUX_DIR)/patches; mkdir -p $(LINUX_DIR)/patches)
|
||||
$(if $(QUILT),rm -rf $(PKG_BUILD_DIR)/patches; mkdir -p $(PKG_BUILD_DIR)/patches)
|
||||
$(if $(kernel_files),$(CP) $(kernel_files) $(LINUX_DIR)/)
|
||||
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,$(LINUX_DIR),$(GENERIC_BACKPORT_DIR),generic-backport/)
|
||||
$(call PatchDir,$(LINUX_DIR),$(GENERIC_PATCH_DIR),generic/)
|
||||
$(call PatchDir,$(LINUX_DIR),$(GENERIC_HACK_DIR),generic-hack/)
|
||||
$(call PatchDir,$(LINUX_DIR),$(PATCH_DIR),platform/)
|
||||
$(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_HACK_DIR),generic-hack/)
|
||||
$(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR),platform/)
|
||||
endef
|
||||
|
||||
define Quilt/RefreshDir
|
||||
|
||||
@@ -78,13 +78,7 @@ define prepare_rootfs
|
||||
done; \
|
||||
for script in ./etc/init.d/*; do \
|
||||
grep '#!/bin/sh /etc/rc.common' $$script >/dev/null || continue; \
|
||||
if ! echo " $(3) " | grep -q " $$(basename $$script) "; then \
|
||||
IPKG_INSTROOT=$(1) $$(which bash) ./etc/rc.common $$script enable; \
|
||||
echo "Enabling" $$(basename $$script); \
|
||||
else \
|
||||
IPKG_INSTROOT=$(1) $$(which bash) ./etc/rc.common $$script disable; \
|
||||
echo "Disabling" $$(basename $$script); \
|
||||
fi; \
|
||||
IPKG_INSTROOT=$(1) $$(which bash) ./etc/rc.common $$script enable; \
|
||||
done || true \
|
||||
)
|
||||
$(if $(SOURCE_DATE_EPOCH),sed -i "s/Installed-Time: .*/Installed-Time: $(SOURCE_DATE_EPOCH)/" $(1)/usr/lib/opkg/status)
|
||||
@@ -96,7 +90,6 @@ define prepare_rootfs
|
||||
rm -f $(1)/usr/lib/opkg/lists/*
|
||||
rm -f $(1)/usr/lib/opkg/info/*.postinst*
|
||||
rm -f $(1)/var/lock/*.lock
|
||||
rm -rf $(1)/boot
|
||||
$(call clean_ipkg,$(1))
|
||||
$(call mklibs,$(1))
|
||||
endef
|
||||
|
||||
@@ -12,22 +12,10 @@ 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)
|
||||
ifneq ($(strip $(NO_COLOR)),1)
|
||||
define progress
|
||||
define progress
|
||||
printf "\033[M\r$(1)" >&2;
|
||||
endef
|
||||
else
|
||||
define progress
|
||||
printf "\r$(1)" >&2;
|
||||
endef
|
||||
endif
|
||||
endef
|
||||
else
|
||||
define progress
|
||||
:;
|
||||
|
||||
@@ -43,7 +43,7 @@ log_make = \
|
||||
$(if $(BUILD_LOG), \
|
||||
set -o pipefail; \
|
||||
mkdir -p $(BUILD_LOG_DIR)/$(1)$(if $(4),/$(4));) \
|
||||
$(SCRIPT_DIR)/time.pl "time: $(1)$(if $(4),/$(4))/$(if $(3),$(3)-)$(2)" \
|
||||
env time -f "time: $(1)$(if $(4),/$(4))/$(if $(3),$(3)-)$(2)\#%U\#%S\#%e" -- \
|
||||
$$(SUBMAKE) $(subdir_make_opts) $(if $(3),$(3)-)$(2) \
|
||||
$(if $(BUILD_LOG),SILENT= 2>&1 | tee $(BUILD_LOG_DIR)/$(1)$(if $(4),/$(4))/$(if $(3),$(3)-)$(2).txt)
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ __target_inc=1
|
||||
DEVICE_TYPE?=router
|
||||
|
||||
# Default packages - the really basic set
|
||||
DEFAULT_PACKAGES:=base-files libc libgcc busybox dropbear mtd uci opkg netifd fstools uclient-fetch logd urandom-seed urngd
|
||||
DEFAULT_PACKAGES:=base-files libc libgcc busybox dropbear mtd uci opkg netifd fstools uclient-fetch logd
|
||||
# For nas targets
|
||||
DEFAULT_PACKAGES.nas:=block-mount fdisk lsblk mdadm
|
||||
# For router targets
|
||||
@@ -51,7 +51,7 @@ else
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(filter 4.9,$(KERNEL_PATCHVER)),)
|
||||
ifneq ($(filter 3.18 4.4 4.9,$(KERNEL_PATCHVER)),)
|
||||
DEFAULT_PACKAGES.router:=$(filter-out kmod-ipt-offload,$(DEFAULT_PACKAGES.router))
|
||||
endif
|
||||
|
||||
@@ -59,7 +59,7 @@ endif
|
||||
DEFAULT_PACKAGES += $(DEFAULT_PACKAGES.$(DEVICE_TYPE))
|
||||
|
||||
filter_packages = $(filter-out -% $(patsubst -%,%,$(filter -%,$(1))),$(1))
|
||||
extra_packages = $(if $(filter wpad-mini wpad-basic wpad nas,$(1)),iwinfo)
|
||||
extra_packages = $(if $(filter wpad-mini wpad nas,$(1)),iwinfo)
|
||||
|
||||
define ProfileDefault
|
||||
NAME:=
|
||||
@@ -72,6 +72,7 @@ define Profile
|
||||
$(eval $(call ProfileDefault))
|
||||
$(eval $(call Profile/$(1)))
|
||||
dumpinfo : $(call shexport,Profile/$(1)/Description)
|
||||
DEFAULT_PACKAGES := $(filter-out $(patsubst -%,%,$(filter -%,$(PACKAGES))),$(DEFAULT_PACKAGES))
|
||||
PACKAGES := $(filter-out -%,$(PACKAGES))
|
||||
DUMPINFO += \
|
||||
echo "Target-Profile: $(1)"; \
|
||||
@@ -174,7 +175,7 @@ ifeq ($(DUMP),1)
|
||||
CPU_CFLAGS_mips64 = -mips64 -mtune=mips64 -mabi=64
|
||||
CPU_CFLAGS_24kc = -mips32r2 -mtune=24kc
|
||||
CPU_CFLAGS_74kc = -mips32r2 -mtune=74kc
|
||||
CPU_CFLAGS_octeonplus = -march=octeon+ -mabi=64
|
||||
CPU_CFLAGS_octeon = -march=octeon -mabi=64
|
||||
endif
|
||||
ifeq ($(ARCH),i386)
|
||||
CPU_TYPE ?= pentium
|
||||
@@ -183,6 +184,26 @@ ifeq ($(DUMP),1)
|
||||
endif
|
||||
ifneq ($(findstring arm,$(ARCH)),)
|
||||
CPU_TYPE ?= xscale
|
||||
CPU_CFLAGS_arm920t = -mcpu=arm920t
|
||||
CPU_CFLAGS_arm926ej-s = -mcpu=arm926ej-s
|
||||
CPU_CFLAGS_arm1136j-s = -mcpu=arm1136j-s
|
||||
CPU_CFLAGS_arm1176jzf-s = -mcpu=arm1176jzf-s
|
||||
CPU_CFLAGS_cortex-a5 = -mcpu=cortex-a5
|
||||
CPU_CFLAGS_cortex-a7 = -mcpu=cortex-a7
|
||||
CPU_CFLAGS_cortex-a8 = -mcpu=cortex-a8
|
||||
CPU_CFLAGS_cortex-a9 = -mcpu=cortex-a9
|
||||
CPU_CFLAGS_cortex-a15 = -mcpu=cortex-a15
|
||||
CPU_CFLAGS_cortex-a53 = -mcpu=cortex-a53
|
||||
CPU_CFLAGS_cortex-a72 = -mcpu=cortex-a72
|
||||
CPU_CFLAGS_fa526 = -mcpu=fa526
|
||||
CPU_CFLAGS_mpcore = -mcpu=mpcore
|
||||
CPU_CFLAGS_xscale = -mcpu=xscale
|
||||
ifeq ($(CONFIG_SOFT_FLOAT),)
|
||||
CPU_CFLAGS_neon = -mfpu=neon
|
||||
CPU_CFLAGS_vfp = -mfpu=vfp
|
||||
CPU_CFLAGS_vfpv3 = -mfpu=vfpv3-d16
|
||||
CPU_CFLAGS_neon-vfpv4 = -mfpu=neon-vfpv4
|
||||
endif
|
||||
endif
|
||||
ifeq ($(ARCH),powerpc)
|
||||
CPU_CFLAGS_603e:=-mcpu=603e
|
||||
@@ -225,9 +246,6 @@ ifeq ($(DUMP),1)
|
||||
.SILENT: $(TMP_CONFIG)
|
||||
.PRECIOUS: $(TMP_CONFIG)
|
||||
|
||||
ifdef KERNEL_TESTING_PATCHVER
|
||||
FEATURES += testing-kernel
|
||||
endif
|
||||
ifneq ($(CONFIG_OF),)
|
||||
FEATURES += dt
|
||||
endif
|
||||
@@ -286,7 +304,6 @@ define BuildTargets/DumpCurrent
|
||||
echo 'Target-Optimization: $(if $(CFLAGS),$(CFLAGS),$(DEFAULT_CFLAGS))'; \
|
||||
echo 'CPU-Type: $(CPU_TYPE)$(if $(CPU_SUBTYPE),+$(CPU_SUBTYPE))'; \
|
||||
echo 'Linux-Version: $(LINUX_VERSION)'; \
|
||||
$(if $(LINUX_TESTING_VERSION),echo 'Linux-Testing-Version: $(LINUX_TESTING_VERSION)';) \
|
||||
echo 'Linux-Release: $(LINUX_RELEASE)'; \
|
||||
echo 'Linux-Kernel-Arch: $(LINUX_KARCH)'; \
|
||||
$(if $(SUBTARGET),,$(if $(DEFAULT_SUBTARGET), echo 'Default-Subtarget: $(DEFAULT_SUBTARGET)'; )) \
|
||||
|
||||
@@ -12,7 +12,6 @@ HOST_BUILD_PREFIX:=$(TOOLCHAIN_DIR)
|
||||
BUILD_DIR_HOST:=$(BUILD_DIR_TOOLCHAIN)
|
||||
|
||||
include $(INCLUDE_DIR)/host-build.mk
|
||||
include $(INCLUDE_DIR)/hardening.mk
|
||||
|
||||
HOST_STAMP_PREPARED=$(HOST_BUILD_DIR)/.prepared
|
||||
|
||||
|
||||
@@ -82,15 +82,15 @@ _ignore = $(foreach p,$(IGNORE_PACKAGES),--ignore $(p))
|
||||
prepare-tmpinfo: FORCE
|
||||
@+$(MAKE) -r -s staging_dir/host/.prereq-build $(PREP_MK)
|
||||
mkdir -p tmp/info
|
||||
$(_SINGLE)$(NO_TRACE_MAKE) -j1 -r -s -f include/scan.mk SCAN_TARGET="packageinfo" SCAN_DIR="package" SCAN_NAME="package" SCAN_DEPTH=5 SCAN_EXTRA=""
|
||||
$(_SINGLE)$(NO_TRACE_MAKE) -j1 -r -s -f include/scan.mk SCAN_TARGET="targetinfo" SCAN_DIR="target/linux" SCAN_NAME="target" SCAN_DEPTH=2 SCAN_EXTRA="" SCAN_MAKEOPTS="TARGET_BUILD=1"
|
||||
$(_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" 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_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 \
|
||||
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; }; \
|
||||
done
|
||||
[ tmp/.config-feeds.in -nt tmp/.packageauxvars ] || ./scripts/feeds feed_config > tmp/.config-feeds.in
|
||||
[ tmp/.config-feeds.in -nt tmp/.packagesubdirs ] || ./scripts/feeds feed_config > tmp/.config-feeds.in
|
||||
./scripts/package-metadata.pl mk tmp/.packageinfo > tmp/.packagedeps || { rm -f tmp/.packagedeps; false; }
|
||||
./scripts/package-metadata.pl pkgaux tmp/.packageinfo > tmp/.packageauxvars || { rm -f tmp/.packageauxvars; false; }
|
||||
./scripts/package-metadata.pl subdirs tmp/.packageinfo > tmp/.packagesubdirs || { rm -f tmp/.packagesubdirs; false; }
|
||||
touch $(TOPDIR)/tmp/.build
|
||||
|
||||
.config: ./scripts/config/conf $(if $(CONFIG_HAVE_DOT_CONFIG),,prepare-tmpinfo)
|
||||
@@ -99,18 +99,13 @@ prepare-tmpinfo: FORCE
|
||||
$(_SINGLE)$(NO_TRACE_MAKE) menuconfig $(PREP_MK); \
|
||||
fi
|
||||
|
||||
ifneq ($(DISTRO_PKG_CONFIG),)
|
||||
scripts/config/mconf: export PATH:=$(dir $(DISTRO_PKG_CONFIG)):$(PATH)
|
||||
endif
|
||||
scripts/config/mconf:
|
||||
@$(_SINGLE)$(SUBMAKE) -s -C scripts/config all CC="$(HOSTCC_WRAPPER)"
|
||||
|
||||
$(eval $(call rdep,scripts/config,scripts/config/mconf))
|
||||
|
||||
scripts/config/qconf:
|
||||
@$(_SINGLE)$(SUBMAKE) -s -C scripts/config qconf \
|
||||
CC="$(HOSTCC_WRAPPER)" \
|
||||
DISTRO-PKG-CONFIG="$(DISTRO_PKG_CONFIG)"
|
||||
@$(_SINGLE)$(SUBMAKE) -s -C scripts/config qconf CC="$(HOSTCC_WRAPPER)"
|
||||
|
||||
scripts/config/conf:
|
||||
@$(_SINGLE)$(SUBMAKE) -s -C scripts/config conf CC="$(HOSTCC_WRAPPER)"
|
||||
@@ -162,10 +157,6 @@ endif
|
||||
kernel_oldconfig: prepare_kernel_conf
|
||||
$(_SINGLE)$(NO_TRACE_MAKE) -C target/linux oldconfig
|
||||
|
||||
ifneq ($(DISTRO_PKG_CONFIG),)
|
||||
kernel_menuconfig: export PATH:=$(dir $(DISTRO_PKG_CONFIG)):$(PATH)
|
||||
kernel_nconfig: export PATH:=$(dir $(DISTRO_PKG_CONFIG)):$(PATH)
|
||||
endif
|
||||
kernel_menuconfig: prepare_kernel_conf
|
||||
$(_SINGLE)$(NO_TRACE_MAKE) -C target/linux menuconfig
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ PKG_NAME ?= u-boot
|
||||
ifndef PKG_SOURCE_PROTO
|
||||
PKG_SOURCE = $(PKG_NAME)-$(PKG_VERSION).tar.bz2
|
||||
PKG_SOURCE_URL = \
|
||||
https://sources.openwrt.org \
|
||||
http://sources.lede-project.org \
|
||||
ftp://ftp.denx.de/pub/u-boot
|
||||
endif
|
||||
|
||||
@@ -42,7 +42,7 @@ TARGET_DEP = TARGET_$(BUILD_TARGET)$(if $(BUILD_SUBTARGET),_$(BUILD_SUBTARGET))
|
||||
|
||||
UBOOT_MAKE_FLAGS = \
|
||||
HOSTCC="$(HOSTCC)" \
|
||||
HOSTCFLAGS="$(HOST_CFLAGS) $(HOST_CPPFLAGS) -std=gnu11" \
|
||||
HOSTCFLAGS="$(HOST_CFLAGS) $(HOST_CPPFLAGS)" \
|
||||
HOSTLDFLAGS="$(HOST_LDFLAGS)"
|
||||
|
||||
define Build/U-Boot/Target
|
||||
|
||||
@@ -58,13 +58,18 @@ ifeq ($(strip $(UNPACK_CMD)),)
|
||||
UNPACK_CMD=gzip -dc $(DL_DIR)/$(PKG_SOURCE) | $(TAR_CMD)
|
||||
endif
|
||||
endif
|
||||
ifneq ($(strip $(CRLF_WORKAROUND)),)
|
||||
CRLF_CMD := && find $(PKG_BUILD_DIR) -type f -print0 | xargs -0 perl -pi -e 's!\r$$$$!!g'
|
||||
else
|
||||
CRLF_CMD :=
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef PKG_BUILD_DIR
|
||||
PKG_UNPACK ?= $(SH_FUNC) $(call UNPACK_CMD,$(PKG_BUILD_DIR))
|
||||
PKG_UNPACK ?= $(SH_FUNC) $(call UNPACK_CMD,$(PKG_BUILD_DIR)) $(call CRLF_CMD,$(PKG_BUILD_DIR))
|
||||
endif
|
||||
ifdef HOST_BUILD_DIR
|
||||
HOST_UNPACK ?= $(SH_FUNC) $(call UNPACK_CMD,$(HOST_BUILD_DIR))
|
||||
HOST_UNPACK ?= $(SH_FUNC) $(call UNPACK_CMD,$(HOST_BUILD_DIR)) $(call CRLF_CMD,$(HOST_BUILD_DIR))
|
||||
endif
|
||||
|
||||
endif # PKG_SOURCE
|
||||
|
||||
@@ -54,7 +54,7 @@ ifeq ($(findstring s,$(OPENWRT_VERBOSE)),)
|
||||
else
|
||||
SILENT:=>/dev/null $(if $(findstring w,$(OPENWRT_VERBOSE)),,2>&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
|
||||
|
||||
.SILENT: $(MAKECMDGOALS)
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
# SOURCE_DATE_EPOCH:=x
|
||||
|
||||
PKG_CONFIG_DEPENDS += \
|
||||
CONFIG_VERSION_HOME_URL \
|
||||
CONFIG_VERSION_BUG_URL \
|
||||
CONFIG_VERSION_NUMBER \
|
||||
CONFIG_VERSION_CODE \
|
||||
@@ -26,13 +25,13 @@ PKG_CONFIG_DEPENDS += \
|
||||
sanitize = $(call tolower,$(subst _,-,$(subst $(space),-,$(1))))
|
||||
|
||||
VERSION_NUMBER:=$(call qstrip,$(CONFIG_VERSION_NUMBER))
|
||||
VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),19.07.1)
|
||||
VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),18.06.0-rc1)
|
||||
|
||||
VERSION_CODE:=$(call qstrip,$(CONFIG_VERSION_CODE))
|
||||
VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),r10911-c155900f66)
|
||||
VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),r7090-d2aa3a1b62)
|
||||
|
||||
VERSION_REPO:=$(call qstrip,$(CONFIG_VERSION_REPO))
|
||||
VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),http://downloads.openwrt.org/releases/19.07.1)
|
||||
VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),http://downloads.openwrt.org/releases/18.06.0-rc1)
|
||||
|
||||
VERSION_DIST:=$(call qstrip,$(CONFIG_VERSION_DIST))
|
||||
VERSION_DIST:=$(if $(VERSION_DIST),$(VERSION_DIST),OpenWrt)
|
||||
@@ -42,16 +41,13 @@ VERSION_MANUFACTURER:=$(call qstrip,$(CONFIG_VERSION_MANUFACTURER))
|
||||
VERSION_MANUFACTURER:=$(if $(VERSION_MANUFACTURER),$(VERSION_MANUFACTURER),OpenWrt)
|
||||
|
||||
VERSION_MANUFACTURER_URL:=$(call qstrip,$(CONFIG_VERSION_MANUFACTURER_URL))
|
||||
VERSION_MANUFACTURER_URL:=$(if $(VERSION_MANUFACTURER_URL),$(VERSION_MANUFACTURER_URL),https://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:=$(if $(VERSION_BUG_URL),$(VERSION_BUG_URL),https://bugs.openwrt.org/)
|
||||
|
||||
VERSION_HOME_URL:=$(call qstrip,$(CONFIG_VERSION_HOME_URL))
|
||||
VERSION_HOME_URL:=$(if $(VERSION_HOME_URL),$(VERSION_HOME_URL),https://openwrt.org/)
|
||||
VERSION_BUG_URL:=$(if $(VERSION_BUG_URL),$(VERSION_BUG_URL),http://bugs.lede-project.org/)
|
||||
|
||||
VERSION_SUPPORT_URL:=$(call qstrip,$(CONFIG_VERSION_SUPPORT_URL))
|
||||
VERSION_SUPPORT_URL:=$(if $(VERSION_SUPPORT_URL),$(VERSION_SUPPORT_URL),https://forum.openwrt.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:=$(if $(VERSION_PRODUCT),$(VERSION_PRODUCT),Generic)
|
||||
@@ -104,7 +100,6 @@ VERSION_SED_SCRIPT:=$(SED) 's,%U,$(call sed_escape,$(VERSION_REPO)),g' \
|
||||
-e 's,%M,$(call sed_escape,$(VERSION_MANUFACTURER)),g' \
|
||||
-e 's,%m,$(call sed_escape,$(VERSION_MANUFACTURER_URL)),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'
|
||||
|
||||
@@ -66,7 +66,7 @@ $(curdir)/install: $(TMP_DIR)/.build $(curdir)/merge $(if $(CONFIG_TARGET_PER_DE
|
||||
rm -rf $(TARGET_DIR) $(TARGET_DIR_ORIG)
|
||||
mkdir -p $(TARGET_DIR)/tmp
|
||||
$(call opkg,$(TARGET_DIR)) install \
|
||||
$(call opkg_package_files,$(foreach pkg,$(shell cat $(PACKAGE_INSTALL_FILES) 2>/dev/null),$(pkg)$(call GetABISuffix,$(pkg))))
|
||||
$(call opkg_package_files,$(shell cat $(PACKAGE_INSTALL_FILES) 2>/dev/null))
|
||||
@for file in $(PACKAGE_INSTALL_FILES); do \
|
||||
[ -s $$file.flags ] || continue; \
|
||||
for flag in `cat $$file.flags`; do \
|
||||
@@ -84,12 +84,8 @@ $(curdir)/index: FORCE
|
||||
mkdir -p $$d; \
|
||||
cd $$d || continue; \
|
||||
$(SCRIPT_DIR)/ipkg-make-index.sh . 2>&1 > Packages.manifest; \
|
||||
grep -vE '^(Maintainer|LicenseFiles|Source|SourceName|Require)' Packages.manifest > Packages; \
|
||||
case "$$(((64 + $$(stat -L -c%s Packages)) % 128))" in 110|111) \
|
||||
$(call ERROR_MESSAGE,WARNING: Applying padding in $$d/Packages to workaround usign SHA-512 bug!); \
|
||||
{ echo ""; echo ""; } >> Packages;; \
|
||||
esac; \
|
||||
gzip -9nc Packages > Packages.gz; \
|
||||
grep -vE '^(Maintainer|LicenseFiles|Source|Require)' Packages.manifest > Packages && \
|
||||
gzip -9nc Packages > Packages.gz; \
|
||||
); done
|
||||
ifdef CONFIG_SIGNED_PACKAGES
|
||||
@echo Signing package index...
|
||||
|
||||
@@ -12,11 +12,11 @@ include $(INCLUDE_DIR)/version.mk
|
||||
include $(INCLUDE_DIR)/feeds.mk
|
||||
|
||||
PKG_NAME:=base-files
|
||||
PKG_RELEASE:=204.2
|
||||
PKG_RELEASE:=190
|
||||
PKG_FLAGS:=nonshared
|
||||
|
||||
PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/
|
||||
PKG_BUILD_DEPENDS:=usign/host ucert/host
|
||||
PKG_BUILD_DEPENDS:=usign/host
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
|
||||
# Extend depends from version.mk
|
||||
@@ -25,7 +25,9 @@ PKG_CONFIG_DEPENDS += \
|
||||
CONFIG_NAND_SUPPORT \
|
||||
CONFIG_CLEAN_IPKG \
|
||||
CONFIG_PER_FEED_REPO \
|
||||
$(foreach feed,$(FEEDS_AVAILABLE),CONFIG_FEED_$(feed))
|
||||
CONFIG_PER_FEED_REPO_ADD_DISABLED \
|
||||
CONFIG_PER_FEED_REPO_ADD_COMMENTED \
|
||||
$(foreach feed,$(FEEDS_INSTALLED),CONFIG_FEED_$(feed))
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
@@ -43,22 +45,12 @@ define Package/base-files
|
||||
VERSION:=$(PKG_RELEASE)-$(REVISION)
|
||||
endef
|
||||
|
||||
define Package/urandom-seed
|
||||
SECTION:=base
|
||||
CATEGORY:=Base system
|
||||
DEPENDS:=+libc +ubox-getrandom
|
||||
TITLE:=/etc/urandom.seed handling for OpenWrt
|
||||
URL:=http://openwrt.org/
|
||||
VERSION:=$(PKG_RELEASE)-$(REVISION)
|
||||
endef
|
||||
|
||||
define Package/base-files/conffiles
|
||||
/etc/config/
|
||||
/etc/config/network
|
||||
/etc/config/system
|
||||
/etc/crontabs/
|
||||
/etc/dropbear/
|
||||
/etc/ethers
|
||||
/etc/group
|
||||
/etc/hosts
|
||||
/etc/inittab
|
||||
@@ -112,9 +104,6 @@ ifdef CONFIG_SIGNED_PACKAGES
|
||||
[ -s $(BUILD_KEY) -a -s $(BUILD_KEY).pub ] || \
|
||||
$(STAGING_DIR_HOST)/bin/usign -G -s $(BUILD_KEY) -p $(BUILD_KEY).pub -c "Local build key"
|
||||
|
||||
[ -s $(BUILD_KEY).ucert ] || \
|
||||
$(STAGING_DIR_HOST)/bin/ucert -I -c $(BUILD_KEY).ucert -p $(BUILD_KEY).pub -s $(BUILD_KEY)
|
||||
|
||||
endef
|
||||
|
||||
define Package/base-files/install-key
|
||||
@@ -198,14 +187,12 @@ define Package/base-files/install
|
||||
|
||||
$(if $(CONFIG_INCLUDE_CONFIG), \
|
||||
echo -e "# Build configuration for board $(BOARD)/$(SUBTARGET)/$(PROFILE)\n" >$(1)/etc/build.config; \
|
||||
cat $(BIN_DIR)/config.buildinfo >>$(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)
|
||||
$(if $(CONFIG_IPK_FILES_CHECKSUMS), \
|
||||
rm -f $(1)/sbin/pkg_check,)
|
||||
endef
|
||||
|
||||
ifneq ($(DUMP),1)
|
||||
|
||||
@@ -15,14 +15,10 @@ generate_static_network() {
|
||||
set network.loopback.proto='static'
|
||||
set network.loopback.ipaddr='127.0.0.1'
|
||||
set network.loopback.netmask='255.0.0.0'
|
||||
delete network.globals
|
||||
set network.globals='globals'
|
||||
set network.globals.ula_prefix='auto'
|
||||
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
|
||||
json_select dsl
|
||||
@@ -85,16 +81,12 @@ generate_network() {
|
||||
set network.$1.proto='none'
|
||||
EOF
|
||||
|
||||
if [ -n "$macaddr" ]; then
|
||||
for name in $ifname; do
|
||||
uci -q batch <<-EOF
|
||||
delete network.$1_${name/./_}_dev
|
||||
set network.$1_${name/./_}_dev='device'
|
||||
set network.$1_${name/./_}_dev.name='$name'
|
||||
set network.$1_${name/./_}_dev.macaddr='$macaddr'
|
||||
EOF
|
||||
done
|
||||
fi
|
||||
[ -n "$macaddr" ] && uci -q batch <<-EOF
|
||||
delete network.$1_dev
|
||||
set network.$1_dev='device'
|
||||
set network.$1_dev.name='$ifname'
|
||||
set network.$1_dev.macaddr='$macaddr'
|
||||
EOF
|
||||
|
||||
case "$protocol" in
|
||||
static)
|
||||
@@ -110,23 +102,21 @@ generate_network() {
|
||||
set network.$1.proto='static'
|
||||
set network.$1.ipaddr='$ipad'
|
||||
set network.$1.netmask='$netm'
|
||||
set network.$1.ip6assign='60'
|
||||
EOF
|
||||
[ -e /proc/sys/net/ipv6 ] && uci set network.$1.ip6assign='60'
|
||||
;;
|
||||
|
||||
dhcp)
|
||||
# fixup IPv6 slave interface if parent is a bridge
|
||||
[ "$type" = "bridge" ] && ifname="br-$1"
|
||||
|
||||
uci set network.$1.proto='dhcp'
|
||||
[ -e /proc/sys/net/ipv6 ] && {
|
||||
uci -q batch <<-EOF
|
||||
delete network.${1}6
|
||||
set network.${1}6='interface'
|
||||
set network.${1}6.ifname='$ifname'
|
||||
set network.${1}6.proto='dhcpv6'
|
||||
EOF
|
||||
}
|
||||
uci -q batch <<-EOF
|
||||
set network.$1.proto='dhcp'
|
||||
delete network.${1}6
|
||||
set network.${1}6='interface'
|
||||
set network.${1}6.ifname='$ifname'
|
||||
set network.${1}6.proto='dhcpv6'
|
||||
EOF
|
||||
;;
|
||||
|
||||
pppoe)
|
||||
@@ -134,16 +124,12 @@ generate_network() {
|
||||
set network.$1.proto='pppoe'
|
||||
set network.$1.username='username'
|
||||
set network.$1.password='password'
|
||||
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
|
||||
[ -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
|
||||
}
|
||||
@@ -217,8 +203,7 @@ generate_switch() {
|
||||
|
||||
json_select switch
|
||||
json_select "$key"
|
||||
json_get_vars enable reset blinkrate cpu_port \
|
||||
ar8xxx_mib_type ar8xxx_mib_poll_interval
|
||||
json_get_vars enable reset blinkrate cpu_port
|
||||
|
||||
uci -q batch <<-EOF
|
||||
add network switch
|
||||
@@ -226,8 +211,6 @@ generate_switch() {
|
||||
set network.@switch[-1].reset='$reset'
|
||||
set network.@switch[-1].enable_vlan='$enable'
|
||||
set network.@switch[-1].blinkrate='$blinkrate'
|
||||
set network.@switch[-1].ar8xxx_mib_type='$ar8xxx_mib_type'
|
||||
set network.@switch[-1].ar8xxx_mib_poll_interval='$ar8xxx_mib_poll_interval'
|
||||
EOF
|
||||
|
||||
generate_switch_vlans_ports "$1"
|
||||
@@ -373,12 +356,11 @@ generate_led() {
|
||||
;;
|
||||
|
||||
switch)
|
||||
local port_mask speed_mask mode
|
||||
json_get_vars port_mask speed_mask mode
|
||||
local port_mask speed_mask
|
||||
json_get_vars port_mask speed_mask
|
||||
uci -q batch <<-EOF
|
||||
set system.$cfg.port_mask='$port_mask'
|
||||
set system.$cfg.speed_mask='$speed_mask'
|
||||
set system.$cfg.mode='$mode'
|
||||
EOF
|
||||
;;
|
||||
|
||||
|
||||
@@ -8,8 +8,6 @@ after mount_root:
|
||||
* /etc/config directory with config files
|
||||
|
||||
for more help see:
|
||||
https://openwrt.org/docs/guide-user/troubleshooting/
|
||||
- failsafe_and_factory_reset
|
||||
- root_password_reset
|
||||
http://wiki.openwrt.org/doc/howto/generic.failsafe
|
||||
=======================================================
|
||||
|
||||
|
||||
@@ -1,50 +1,4 @@
|
||||
#!/bin/sh
|
||||
# Copyright (C) 2006-2019 OpenWrt.org
|
||||
# Copyright (C) 2006-2009 OpenWrt.org
|
||||
|
||||
. /lib/functions/leds.sh
|
||||
|
||||
boot="$(get_dt_led boot)"
|
||||
failsafe="$(get_dt_led failsafe)"
|
||||
running="$(get_dt_led running)"
|
||||
upgrade="$(get_dt_led upgrade)"
|
||||
|
||||
set_led_state() {
|
||||
status_led="$boot"
|
||||
|
||||
case "$1" in
|
||||
preinit)
|
||||
status_led_blink_preinit
|
||||
;;
|
||||
failsafe)
|
||||
status_led_off
|
||||
[ -n "$running" ] && {
|
||||
status_led="$running"
|
||||
status_led_off
|
||||
}
|
||||
status_led="$failsafe"
|
||||
status_led_blink_failsafe
|
||||
;;
|
||||
preinit_regular)
|
||||
status_led_blink_preinit_regular
|
||||
;;
|
||||
upgrade)
|
||||
[ -n "$running" ] && {
|
||||
status_led="$running"
|
||||
status_led_off
|
||||
}
|
||||
status_led="$upgrade"
|
||||
status_led_blink_preinit_regular
|
||||
;;
|
||||
done)
|
||||
status_led_off
|
||||
[ -n "$running" ] && {
|
||||
status_led="$running"
|
||||
status_led_on
|
||||
}
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
set_state() {
|
||||
[ -n "$boot" -o -n "$failsafe" -o -n "$running" -o -n "$upgrade" ] && set_led_state "$1"
|
||||
}
|
||||
set_state() { :; }
|
||||
|
||||
@@ -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,8 +1,8 @@
|
||||
root:x:0:
|
||||
daemon:x:1:
|
||||
adm:x:4:
|
||||
tty:x:5:
|
||||
mail:x:8:
|
||||
dialout:x:20:
|
||||
audio:x:29:
|
||||
www-data:x:33:
|
||||
ftp:x:55:
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# Copyright (C) 2006-2011 OpenWrt.org
|
||||
|
||||
START=10
|
||||
STOP=90
|
||||
STOP=98
|
||||
|
||||
uci_apply_defaults() {
|
||||
. /lib/functions/system.sh
|
||||
|
||||
@@ -20,7 +20,7 @@ load_led() {
|
||||
config_get trigger $1 trigger "none"
|
||||
config_get dev $1 dev
|
||||
config_get ports $1 port
|
||||
config_get mode $1 mode
|
||||
config_get mode $1 mode "link"
|
||||
config_get_bool default $1 default "nil"
|
||||
config_get delayon $1 delayon
|
||||
config_get delayoff $1 delayoff
|
||||
@@ -71,10 +71,7 @@ load_led() {
|
||||
"netdev")
|
||||
[ -n "$dev" ] && {
|
||||
echo $dev > /sys/class/leds/${sysfs}/device_name
|
||||
for m in $mode; do
|
||||
[ -e "/sys/class/leds/${sysfs}/$m" ] && \
|
||||
echo 1 > /sys/class/leds/${sysfs}/$m
|
||||
done
|
||||
echo $mode > /sys/class/leds/${sysfs}/mode
|
||||
echo $interval > /sys/class/leds/${sysfs}/interval
|
||||
}
|
||||
;;
|
||||
@@ -113,8 +110,6 @@ load_led() {
|
||||
config_get speed_mask $1 speed_mask
|
||||
[ -n "$speed_mask" ] && \
|
||||
echo $speed_mask > /sys/class/leds/${sysfs}/speed_mask
|
||||
[ -n "$mode" ] && \
|
||||
echo "$mode" > /sys/class/leds/${sysfs}/mode
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
@@ -39,6 +39,6 @@ apply_defaults() {
|
||||
start() {
|
||||
apply_defaults
|
||||
for CONF in /etc/sysctl.d/*.conf /etc/sysctl.conf; do
|
||||
[ -f "$CONF" ] && sysctl -e -p "$CONF" >&-
|
||||
[ -f "$CONF" ] && sysctl -p "$CONF" -e >&-
|
||||
done
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ USE_PROCD=1
|
||||
|
||||
validate_system_section()
|
||||
{
|
||||
uci_load_validate system system "$1" "$2" \
|
||||
uci_validate_section system system "${1}" \
|
||||
'hostname:string:OpenWrt' \
|
||||
'conloglevel:uinteger' \
|
||||
'buffersize:uinteger' \
|
||||
@@ -15,7 +15,11 @@ validate_system_section()
|
||||
}
|
||||
|
||||
system_config() {
|
||||
[ "$2" = 0 ] || {
|
||||
local cfg="$1"
|
||||
|
||||
local hostname conloglevel buffersize timezone zonename
|
||||
|
||||
validate_system_section "${1}" || {
|
||||
echo "validation failed"
|
||||
return 1
|
||||
}
|
||||
@@ -32,7 +36,7 @@ system_config() {
|
||||
|
||||
reload_service() {
|
||||
config_load system
|
||||
config_foreach validate_system_section system system_config
|
||||
config_foreach system_config system
|
||||
}
|
||||
|
||||
service_triggers()
|
||||
|
||||
@@ -1,12 +1,7 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
# Copyright (C) 2006 OpenWrt.org
|
||||
|
||||
STOP=90
|
||||
|
||||
restart() {
|
||||
:
|
||||
}
|
||||
|
||||
STOP=99
|
||||
stop() {
|
||||
sync
|
||||
/bin/umount -a -d -r
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
# lookup table for ematch kinds
|
||||
1 cmp
|
||||
2 nbyte
|
||||
3 u32
|
||||
4 meta
|
||||
7 canid
|
||||
8 ipset
|
||||
9 ipt
|
||||
@@ -14,11 +14,7 @@ export HOME=$(grep -e "^${USER:-root}:" /etc/passwd | cut -d ":" -f 6)
|
||||
export HOME=${HOME:-/root}
|
||||
export PS1='\u@\h:\w\$ '
|
||||
|
||||
case "$TERM" in
|
||||
xterm*|rxvt*)
|
||||
export PS1='\[\e]0;\u@\h: \w\a\]'$PS1
|
||||
;;
|
||||
esac
|
||||
[ "$TERM" = "xterm" ] && export PS1='\[\e]0;\u@\h: \w\a\]'$PS1
|
||||
|
||||
[ -x /bin/more ] || alias more=less
|
||||
[ -x /usr/bin/vim ] && alias vi=vim || alias vim=vi
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
[ "${ACTION}" = "released" ] || exit 0
|
||||
|
||||
if [ "$SEEN" -ge 5 ]
|
||||
then
|
||||
echo "REBOOT" > /dev/console
|
||||
sync
|
||||
reboot
|
||||
fi
|
||||
|
||||
return 0
|
||||
@@ -23,7 +23,6 @@ reload() {
|
||||
restart() {
|
||||
trap '' TERM
|
||||
stop "$@"
|
||||
trap - TERM
|
||||
start "$@"
|
||||
}
|
||||
|
||||
@@ -131,9 +130,6 @@ ${INIT_TRACE:+set -x}
|
||||
procd_lock
|
||||
stop_service "$@"
|
||||
procd_kill "$(basename ${basescript:-$initscript})" "$1"
|
||||
if eval "type service_stopped" 2>/dev/null >/dev/null; then
|
||||
service_stopped
|
||||
fi
|
||||
}
|
||||
|
||||
reload() {
|
||||
|
||||
@@ -29,8 +29,8 @@ kerberos 88/tcp kerberos5 krb5 kerberos-sec
|
||||
kerberos 88/udp kerberos5 krb5 kerberos-sec
|
||||
pop3 110/tcp
|
||||
pop3 110/udp
|
||||
sunrpc 111/tcp rpcbind
|
||||
sunrpc 111/udp rpcbind
|
||||
sunrpc 111/tcp
|
||||
sunrpc 111/udp
|
||||
auth 113/tcp ident
|
||||
sftp 115/tcp
|
||||
nntp 119/tcp
|
||||
|
||||
@@ -8,8 +8,6 @@ fs.suid_dumpable=2
|
||||
fs.protected_hardlinks=1
|
||||
fs.protected_symlinks=1
|
||||
|
||||
net.core.bpf_jit_enable=1
|
||||
|
||||
net.ipv4.conf.default.arp_ignore=1
|
||||
net.ipv4.conf.all.arp_ignore=1
|
||||
net.ipv4.ip_forward=1
|
||||
|
||||
@@ -57,16 +57,16 @@ config () {
|
||||
export ${NO_EXPORT:+-n} CONFIG_NUM_SECTIONS=$(($CONFIG_NUM_SECTIONS + 1))
|
||||
name="${name:-cfg$CONFIG_NUM_SECTIONS}"
|
||||
append CONFIG_SECTIONS "$name"
|
||||
export ${NO_EXPORT:+-n} CONFIG_SECTION="$name"
|
||||
config_set "$CONFIG_SECTION" "TYPE" "${cfgtype}"
|
||||
[ -n "$NO_CALLBACK" ] || config_cb "$cfgtype" "$name"
|
||||
export ${NO_EXPORT:+-n} CONFIG_SECTION="$name"
|
||||
export ${NO_EXPORT:+-n} "CONFIG_${CONFIG_SECTION}_TYPE=$cfgtype"
|
||||
}
|
||||
|
||||
option () {
|
||||
local varname="$1"; shift
|
||||
local value="$*"
|
||||
|
||||
config_set "$CONFIG_SECTION" "${varname}" "${value}"
|
||||
export ${NO_EXPORT:+-n} "CONFIG_${CONFIG_SECTION}_${varname}=$value"
|
||||
[ -n "$NO_CALLBACK" ] || option_cb "$varname" "$*"
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ list() {
|
||||
config_set "$CONFIG_SECTION" "${varname}_ITEM$len" "$value"
|
||||
config_set "$CONFIG_SECTION" "${varname}_LENGTH" "$len"
|
||||
append "CONFIG_${CONFIG_SECTION}_${varname}" "$value" "$LIST_SEP"
|
||||
[ -n "$NO_CALLBACK" ] || list_cb "$varname" "$*"
|
||||
list_cb "$varname" "$*"
|
||||
}
|
||||
|
||||
config_unset() {
|
||||
@@ -92,7 +92,7 @@ config_unset() {
|
||||
# config_get <section> <option>
|
||||
config_get() {
|
||||
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}}";;
|
||||
esac
|
||||
}
|
||||
@@ -113,8 +113,11 @@ config_set() {
|
||||
local section="$1"
|
||||
local option="$2"
|
||||
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() {
|
||||
@@ -152,27 +155,22 @@ config_list_foreach() {
|
||||
|
||||
default_prerm() {
|
||||
local root="${IPKG_INSTROOT}"
|
||||
local pkgname="$(basename ${1%.*})"
|
||||
local ret=0
|
||||
local name
|
||||
|
||||
if [ -f "$root/usr/lib/opkg/info/${pkgname}.prerm-pkg" ]; then
|
||||
( . "$root/usr/lib/opkg/info/${pkgname}.prerm-pkg" )
|
||||
ret=$?
|
||||
fi
|
||||
name=$(basename ${1%.*})
|
||||
[ -f "$root/usr/lib/opkg/info/${name}.prerm-pkg" ] && . "$root/usr/lib/opkg/info/${name}.prerm-pkg"
|
||||
|
||||
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
|
||||
${shell:-/bin/sh} "$root/etc/rc.common" "$root$i" disable
|
||||
else
|
||||
if [ "$PKG_UPGRADE" != "1" ]; then
|
||||
"$i" disable
|
||||
fi
|
||||
"$i" stop
|
||||
"$i" stop || /bin/true
|
||||
fi
|
||||
done
|
||||
|
||||
return $ret
|
||||
}
|
||||
|
||||
add_group_and_user() {
|
||||
@@ -213,7 +211,6 @@ add_group_and_user() {
|
||||
default_postinst() {
|
||||
local root="${IPKG_INSTROOT}"
|
||||
local pkgname="$(basename ${1%.*})"
|
||||
local filelist="/usr/lib/opkg/info/${pkgname}.list"
|
||||
local ret=0
|
||||
|
||||
add_group_and_user "${pkgname}"
|
||||
@@ -228,29 +225,24 @@ default_postinst() {
|
||||
rm -fR $root/rootfs-overlay/
|
||||
fi
|
||||
|
||||
if [ -z "$root" ]; then
|
||||
if grep -m1 -q -s "^/etc/modules.d/" "$filelist"; then
|
||||
kmodloader
|
||||
fi
|
||||
|
||||
if grep -m1 -q -s "^/etc/sysctl.d/" "$filelist"; then
|
||||
/etc/init.d/sysctl restart
|
||||
fi
|
||||
|
||||
if grep -m1 -q -s "^/etc/uci-defaults/" "$filelist"; then
|
||||
. /lib/functions/system.sh
|
||||
[ -d /tmp/.uci ] || mkdir -p /tmp/.uci
|
||||
for i in $(grep -s "^/etc/uci-defaults/" "$filelist"); do
|
||||
( [ -f "$i" ] && cd "$(dirname $i)" && . "$i" ) && rm -f "$i"
|
||||
done
|
||||
uci commit
|
||||
fi
|
||||
|
||||
rm -f /tmp/luci-indexcache
|
||||
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
|
||||
. /lib/functions/system.sh
|
||||
[ -d /tmp/.uci ] || mkdir -p /tmp/.uci
|
||||
for i in $(sed -ne 's!^/etc/uci-defaults/!!p' "/usr/lib/opkg/info/${pkgname}.list"); do (
|
||||
cd /etc/uci-defaults
|
||||
[ -f "$i" ] && . ./"$i" && rm -f "$i"
|
||||
) done
|
||||
uci commit
|
||||
fi
|
||||
|
||||
[ -n "$root" ] || rm -f /tmp/luci-indexcache 2>/dev/null
|
||||
|
||||
local shell="$(which bash)"
|
||||
for i in $(grep -s "^/etc/init.d/" "$root$filelist"); do
|
||||
for i in $(grep -s "^/etc/init.d/" "$root/usr/lib/opkg/info/${pkgname}.list"); do
|
||||
if [ -n "$root" ]; then
|
||||
${shell:-/bin/sh} "$root/etc/rc.common" "$root$i" enable
|
||||
else
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
migrate_led_sysfs() {
|
||||
local cfg="$1"; shift
|
||||
local tuples="$@"
|
||||
local sysfs
|
||||
local name
|
||||
|
||||
config_get sysfs ${cfg} sysfs
|
||||
config_get name ${cfg} name
|
||||
|
||||
[ -z "${sysfs}" ] && return
|
||||
|
||||
for tuple in ${tuples}; do
|
||||
local old=${tuple%=*}
|
||||
local new=${tuple#*=}
|
||||
local new_sysfs
|
||||
|
||||
new_sysfs=$(echo ${sysfs} | sed "s/${old}/${new}/")
|
||||
|
||||
[ "${new_sysfs}" = "${sysfs}" ] && continue
|
||||
|
||||
uci set system.${cfg}.sysfs="${new_sysfs}"
|
||||
|
||||
logger -t led-migration "sysfs option of LED \"${name}\" updated to ${new_sysfs}"
|
||||
done;
|
||||
}
|
||||
|
||||
migrate_leds() {
|
||||
config_load system
|
||||
config_foreach migrate_led_sysfs led "$@"
|
||||
}
|
||||
|
||||
migrations_apply() {
|
||||
local realm="$1"
|
||||
[ -n "$(uci changes ${realm})" ] && uci -q commit ${realm}
|
||||
}
|
||||
@@ -6,16 +6,10 @@
|
||||
__network_ifstatus() {
|
||||
local __tmp
|
||||
|
||||
[ -z "$__NETWORK_CACHE" ] && {
|
||||
__tmp="$(ubus call network.interface dump 2>&1)"
|
||||
case "$?" in
|
||||
4) : ;;
|
||||
0) export __NETWORK_CACHE="$__tmp" ;;
|
||||
*) echo "$__tmp" >&2 ;;
|
||||
esac
|
||||
}
|
||||
[ -z "$__NETWORK_CACHE" ] && \
|
||||
export __NETWORK_CACHE="$(ubus call network.interface dump)"
|
||||
|
||||
__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" ] && \
|
||||
unset "$1" && \
|
||||
@@ -271,16 +265,6 @@ network_is_up()
|
||||
# 2: interface
|
||||
network_get_protocol() { __network_ifstatus "$1" "$2" ".proto"; }
|
||||
|
||||
# determine the uptime of the given logical interface
|
||||
# 1: destination variable
|
||||
# 2: interface
|
||||
network_get_uptime() { __network_ifstatus "$1" "$2" ".uptime"; }
|
||||
|
||||
# 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
|
||||
# 1: destination variable
|
||||
# 2: interface
|
||||
|
||||
@@ -4,7 +4,7 @@ get_mac_binary() {
|
||||
local path="$1"
|
||||
local offset="$2"
|
||||
|
||||
if ! [ -e "$path" ]; then
|
||||
if [ -z "$path" ]; then
|
||||
echo "get_mac_binary: file $path not found!" >&2
|
||||
return
|
||||
fi
|
||||
@@ -20,7 +20,8 @@ find_mtd_chardev() {
|
||||
echo "${INDEX:+$PREFIX$INDEX}"
|
||||
}
|
||||
|
||||
mtd_get_mac_ascii() {
|
||||
mtd_get_mac_ascii()
|
||||
{
|
||||
local mtdname="$1"
|
||||
local key="$2"
|
||||
local part
|
||||
@@ -38,29 +39,6 @@ mtd_get_mac_ascii() {
|
||||
[ -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() {
|
||||
local mtdname="$1"
|
||||
local offset="$2"
|
||||
@@ -79,7 +57,12 @@ mtd_get_mac_binary_ubi() {
|
||||
local ubidev=$(nand_find_ubi $CI_UBIPART)
|
||||
local part=$(nand_find_volume $ubidev $1)
|
||||
|
||||
get_mac_binary "/dev/$part" "$offset"
|
||||
if [ -z "$part" ]; then
|
||||
echo "mtd_get_mac_binary: ubi volume $mtdname not found!" >&2
|
||||
return
|
||||
fi
|
||||
|
||||
hexdump -v -n 6 -s $offset -e '5/1 "%02x:" 1/1 "%02x"' /dev/$part 2>/dev/null
|
||||
}
|
||||
|
||||
mtd_get_part_size() {
|
||||
@@ -104,19 +87,22 @@ macaddr_add() {
|
||||
echo $oui:$nic
|
||||
}
|
||||
|
||||
macaddr_setbit_la() {
|
||||
macaddr_setbit_la()
|
||||
{
|
||||
local mac=$1
|
||||
|
||||
printf "%02x:%s" $((0x${mac%%:*} | 0x02)) ${mac#*:}
|
||||
}
|
||||
|
||||
macaddr_2bin() {
|
||||
macaddr_2bin()
|
||||
{
|
||||
local mac=$1
|
||||
|
||||
echo -ne \\x${mac//:/\\x}
|
||||
}
|
||||
|
||||
macaddr_canonicalize() {
|
||||
macaddr_canonicalize()
|
||||
{
|
||||
local mac="$1"
|
||||
local canon=""
|
||||
|
||||
|
||||
@@ -27,33 +27,30 @@ json_select_object() {
|
||||
json_select "$1"
|
||||
}
|
||||
|
||||
ucidef_set_interface() {
|
||||
local network=$1; shift
|
||||
_ucidef_set_interface() {
|
||||
local name="$1"
|
||||
local iface="$2"
|
||||
local proto="$3"
|
||||
|
||||
[ -z "$network" ] && return
|
||||
json_select_object "$name"
|
||||
json_add_string ifname "$iface"
|
||||
|
||||
json_select_object network
|
||||
json_select_object "$network"
|
||||
|
||||
while [ -n "$1" ]; do
|
||||
local opt=$1; shift
|
||||
local val=$1; shift
|
||||
|
||||
[ -n "$opt" -a -n "$val" ] || break
|
||||
|
||||
json_add_string "$opt" "$val"
|
||||
done
|
||||
|
||||
if ! json_is_a protocol string; then
|
||||
case "$network" in
|
||||
lan) json_add_string protocol static ;;
|
||||
wan) json_add_string protocol dhcp ;;
|
||||
*) json_add_string protocol none ;;
|
||||
if ! json_is_a protocol string || [ -n "$proto" ]; then
|
||||
case "$proto" in
|
||||
static|dhcp|none|pppoe) : ;;
|
||||
*)
|
||||
case "$name" in
|
||||
lan) proto="static" ;;
|
||||
wan) proto="dhcp" ;;
|
||||
*) proto="none" ;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
||||
json_add_string protocol "$proto"
|
||||
fi
|
||||
|
||||
json_select ..
|
||||
json_select ..
|
||||
}
|
||||
|
||||
ucidef_set_board_id() {
|
||||
@@ -69,19 +66,31 @@ ucidef_set_model_name() {
|
||||
}
|
||||
|
||||
ucidef_set_interface_lan() {
|
||||
ucidef_set_interface "lan" ifname "$1" protocol "${2:-static}"
|
||||
json_select_object network
|
||||
_ucidef_set_interface lan "$@"
|
||||
json_select ..
|
||||
}
|
||||
|
||||
ucidef_set_interface_wan() {
|
||||
ucidef_set_interface "wan" ifname "$1" protocol "${2:-dhcp}"
|
||||
json_select_object network
|
||||
_ucidef_set_interface wan "$@"
|
||||
json_select ..
|
||||
}
|
||||
|
||||
ucidef_set_interfaces_lan_wan() {
|
||||
local lan_if="$1"
|
||||
local wan_if="$2"
|
||||
|
||||
ucidef_set_interface_lan "$lan_if"
|
||||
ucidef_set_interface_wan "$wan_if"
|
||||
json_select_object network
|
||||
_ucidef_set_interface lan "$lan_if"
|
||||
_ucidef_set_interface wan "$wan_if"
|
||||
json_select ..
|
||||
}
|
||||
|
||||
ucidef_set_interface_raw() {
|
||||
json_select_object network
|
||||
_ucidef_set_interface "$@"
|
||||
json_select ..
|
||||
}
|
||||
|
||||
_ucidef_add_switch_port() {
|
||||
@@ -176,25 +185,12 @@ _ucidef_finish_switch_roles() {
|
||||
devices="${devices:+$devices }$device"
|
||||
fi
|
||||
json_select ..
|
||||
json_select ..
|
||||
|
||||
ucidef_set_interface "$role" ifname "$devices"
|
||||
_ucidef_set_interface "$role" "$devices"
|
||||
json_select ..
|
||||
done
|
||||
}
|
||||
|
||||
ucidef_set_ar8xxx_switch_mib() {
|
||||
local name="$1"
|
||||
local type="$2"
|
||||
local interval="$3"
|
||||
|
||||
json_select_object switch
|
||||
json_select_object "$name"
|
||||
json_add_int ar8xxx_mib_type $type
|
||||
json_add_int ar8xxx_mib_poll_interval $interval
|
||||
json_select ..
|
||||
json_select ..
|
||||
}
|
||||
|
||||
ucidef_add_switch() {
|
||||
local name="$1"; shift
|
||||
local port num role device index need_tag prev_role
|
||||
@@ -304,7 +300,18 @@ ucidef_set_interface_macaddr() {
|
||||
local network="$1"
|
||||
local macaddr="$2"
|
||||
|
||||
ucidef_set_interface "$network" macaddr "$macaddr"
|
||||
json_select_object network
|
||||
|
||||
json_select "$network"
|
||||
[ $? -eq 0 ] || {
|
||||
json_select ..
|
||||
return
|
||||
}
|
||||
|
||||
json_add_string macaddr "$macaddr"
|
||||
json_select ..
|
||||
|
||||
json_select ..
|
||||
}
|
||||
|
||||
ucidef_add_atm_bridge() {
|
||||
@@ -455,13 +462,11 @@ ucidef_set_led_switch() {
|
||||
local trigger_name="$4"
|
||||
local port_mask="$5"
|
||||
local speed_mask="$6"
|
||||
local mode="$7"
|
||||
|
||||
_ucidef_set_led_common "$1" "$2" "$3"
|
||||
|
||||
json_add_string trigger "$trigger_name"
|
||||
json_add_string type switch
|
||||
json_add_string mode "$mode"
|
||||
json_add_string port_mask "$port_mask"
|
||||
json_add_string speed_mask "$speed_mask"
|
||||
json_select ..
|
||||
@@ -476,7 +481,6 @@ _ucidef_set_led_timer() {
|
||||
|
||||
_ucidef_set_led_common "$1" "$2" "$3"
|
||||
|
||||
json_add_string type "$trigger_name"
|
||||
json_add_string trigger "$trigger_name"
|
||||
json_add_int delayon "$delayon"
|
||||
json_add_int delayoff "$delayoff"
|
||||
|
||||
@@ -82,7 +82,7 @@ fs_wait_for_key () {
|
||||
|
||||
failsafe_wait() {
|
||||
FAILSAFE=
|
||||
[ "$pi_preinit_no_failsafe" = "y" ] && {
|
||||
[ "$pi_preinit_no_failsafe" == "y" ] && {
|
||||
fs_wait_for_key "" "" $fs_failsafe_wait_timeout
|
||||
return
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ do_urandom_seed() {
|
||||
_do_urandom_seed "/etc/urandom.seed"
|
||||
|
||||
SEED="$(uci -q get system.@system[0].urandom_seed)"
|
||||
[ "${SEED:0:1}" = "/" -a "$SEED" != "/etc/urandom.seed" ] && _do_urandom_seed "$SEED"
|
||||
[ "${SEED:0:1}" == "/" -a "$SEED" != "/etc/urandom.seed" ] && _do_urandom_seed "$SEED"
|
||||
}
|
||||
|
||||
boot_hook_add preinit_main do_urandom_seed
|
||||
@@ -2,8 +2,6 @@
|
||||
|
||||
RAM_ROOT=/tmp/root
|
||||
|
||||
export BACKUP_FILE=sysupgrade.tgz # file extracted by preinit
|
||||
|
||||
[ -x /usr/bin/ldd ] || ldd() { LD_TRACE_LOADED_OBJECTS=1 $*; }
|
||||
libs() { ldd $* 2>/dev/null | sed -r 's/(.* => )?(.*) .*/\2/'; }
|
||||
|
||||
@@ -103,53 +101,35 @@ get_magic_long() {
|
||||
}
|
||||
|
||||
export_bootdevice() {
|
||||
local cmdline bootdisk rootpart uuid blockdev uevent line class
|
||||
local cmdline uuid disk uevent line
|
||||
local MAJOR MINOR DEVNAME DEVTYPE
|
||||
|
||||
if read cmdline < /proc/cmdline; then
|
||||
case "$cmdline" in
|
||||
*block2mtd=*)
|
||||
bootdisk="${cmdline##*block2mtd=}"
|
||||
bootdisk="${bootdisk%%,*}"
|
||||
disk="${cmdline##*block2mtd=}"
|
||||
disk="${disk%%,*}"
|
||||
;;
|
||||
*root=*)
|
||||
rootpart="${cmdline##*root=}"
|
||||
rootpart="${rootpart%% *}"
|
||||
disk="${cmdline##*root=}"
|
||||
disk="${disk%% *}"
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$bootdisk" in
|
||||
/dev/*)
|
||||
uevent="/sys/class/block/${bootdisk##*/}/uevent"
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$rootpart" in
|
||||
PARTUUID=[a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9]-[a-f0-9][a-f0-9])
|
||||
uuid="${rootpart#PARTUUID=}"
|
||||
uuid="${uuid%-[a-f0-9][a-f0-9]}"
|
||||
for blockdev in $(find /dev -type b); do
|
||||
set -- $(dd if=$blockdev bs=1 skip=440 count=4 2>/dev/null | hexdump -v -e '4/1 "%02x "')
|
||||
case "$disk" in
|
||||
PARTUUID=[a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9]-02)
|
||||
uuid="${disk#PARTUUID=}"
|
||||
uuid="${uuid%-02}"
|
||||
for disk in $(find /dev -type b); do
|
||||
set -- $(dd if=$disk bs=1 skip=440 count=4 2>/dev/null | hexdump -v -e '4/1 "%02x "')
|
||||
if [ "$4$3$2$1" = "$uuid" ]; then
|
||||
uevent="/sys/class/block/${blockdev##*/}/uevent"
|
||||
uevent="/sys/class/block/${disk##*/}/uevent"
|
||||
break
|
||||
fi
|
||||
done
|
||||
;;
|
||||
/dev/*)
|
||||
uevent="/sys/class/block/${rootpart##*/}/../uevent"
|
||||
;;
|
||||
0x[a-f0-9][a-f0-9][a-f0-9] | 0x[a-f0-9][a-f0-9][a-f0-9][a-f0-9] | \
|
||||
[a-f0-9][a-f0-9][a-f0-9] | [a-f0-9][a-f0-9][a-f0-9][a-f0-9])
|
||||
rootpart=0x${rootpart#0x}
|
||||
for class in /sys/class/block/*; do
|
||||
while read line; do
|
||||
export -n "$line"
|
||||
done < "$class/uevent"
|
||||
if [ $((rootpart/256)) = $MAJOR -a $((rootpart%256)) = $MINOR ]; then
|
||||
uevent="$class/../uevent"
|
||||
fi
|
||||
done
|
||||
uevent="/sys/class/block/${disk##*/}/uevent"
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -184,7 +164,7 @@ export_partdevice() {
|
||||
}
|
||||
|
||||
hex_le32_to_cpu() {
|
||||
[ "$(echo 01 | hexdump -v -n 2 -e '/2 "%x"')" = "3031" ] && {
|
||||
[ "$(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
|
||||
}
|
||||
@@ -221,9 +201,14 @@ get_partitions() { # <device> <filename>
|
||||
fi
|
||||
}
|
||||
|
||||
indicate_upgrade() {
|
||||
. /etc/diag.sh
|
||||
set_state upgrade
|
||||
jffs2_copy_config() {
|
||||
if grep rootfs_data /proc/mtd >/dev/null; then
|
||||
# squashfs+jffs2
|
||||
mtd -e rootfs_data jffs2write "$CONF_TAR" rootfs_data
|
||||
else
|
||||
# jffs2
|
||||
mtd jffs2write "$CONF_TAR" rootfs
|
||||
fi
|
||||
}
|
||||
|
||||
# Flash firmware to MTD partition
|
||||
@@ -232,10 +217,33 @@ indicate_upgrade() {
|
||||
# $(2): (optional) pipe command to extract firmware, e.g. dd bs=n skip=m
|
||||
default_do_upgrade() {
|
||||
sync
|
||||
if [ -n "$UPGRADE_BACKUP" ]; then
|
||||
get_image "$1" "$2" | mtd $MTD_ARGS $MTD_CONFIG_ARGS -j "$UPGRADE_BACKUP" write - "${PART_NAME:-image}"
|
||||
if [ "$SAVE_CONFIG" -eq 1 ]; then
|
||||
get_image "$1" "$2" | mtd $MTD_CONFIG_ARGS -j "$CONF_TAR" write - "${PART_NAME:-image}"
|
||||
else
|
||||
get_image "$1" "$2" | mtd $MTD_ARGS write - "${PART_NAME:-image}"
|
||||
get_image "$1" "$2" | mtd write - "${PART_NAME:-image}"
|
||||
fi
|
||||
[ $? -ne 0 ] && exit 1
|
||||
}
|
||||
|
||||
do_upgrade_stage2() {
|
||||
v "Performing system upgrade..."
|
||||
if [ -n "$do_upgrade" ]; then
|
||||
eval "$do_upgrade"
|
||||
elif type 'platform_do_upgrade' >/dev/null 2>/dev/null; then
|
||||
platform_do_upgrade "$IMAGE"
|
||||
else
|
||||
default_do_upgrade "$IMAGE"
|
||||
fi
|
||||
|
||||
if [ "$SAVE_CONFIG" -eq 1 ] && type 'platform_copy_config' >/dev/null 2>/dev/null; then
|
||||
platform_copy_config
|
||||
fi
|
||||
|
||||
v "Upgrade completed"
|
||||
sleep 1
|
||||
|
||||
v "Rebooting system..."
|
||||
umount -a
|
||||
reboot -f
|
||||
sleep 5
|
||||
echo b 2>/dev/null >/proc/sysrq-trigger
|
||||
}
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
include /lib/upgrade
|
||||
|
||||
v "Performing system upgrade..."
|
||||
if type 'platform_do_upgrade' >/dev/null 2>/dev/null; then
|
||||
platform_do_upgrade "$IMAGE"
|
||||
else
|
||||
default_do_upgrade "$IMAGE"
|
||||
fi
|
||||
|
||||
if [ -n "$UPGRADE_BACKUP" ] && type 'platform_copy_config' >/dev/null 2>/dev/null; then
|
||||
platform_copy_config
|
||||
fi
|
||||
|
||||
v "Upgrade completed"
|
||||
sleep 1
|
||||
|
||||
v "Rebooting system..."
|
||||
umount -a
|
||||
reboot -f
|
||||
sleep 5
|
||||
echo b 2>/dev/null >/proc/sysrq-trigger
|
||||
@@ -1,27 +1,5 @@
|
||||
fwtool_check_signature() {
|
||||
[ $# -gt 1 ] && return 1
|
||||
|
||||
[ ! -x /usr/bin/ucert ] && {
|
||||
if [ "$REQUIRE_IMAGE_SIGNATURE" = 1 ]; then
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
|
||||
if ! fwtool -q -s /tmp/sysupgrade.ucert "$1"; then
|
||||
echo "Image signature not found"
|
||||
[ "$REQUIRE_IMAGE_SIGNATURE" = 1 -a "$FORCE" != 1 ] && {
|
||||
echo "Use sysupgrade -F to override this check when downgrading or flashing to vendor firmware"
|
||||
}
|
||||
[ "$REQUIRE_IMAGE_SIGNATURE" = 1 ] && return 1
|
||||
return 0
|
||||
fi
|
||||
|
||||
fwtool -q -T -s /dev/null "$1" | \
|
||||
ucert -V -m - -c "/tmp/sysupgrade.ucert" -P /etc/opkg/keys
|
||||
|
||||
return $?
|
||||
fwtool_pre_upgrade() {
|
||||
fwtool -q -i /dev/null "$1"
|
||||
}
|
||||
|
||||
fwtool_check_image() {
|
||||
|
||||
@@ -10,9 +10,6 @@ CI_KERNPART="${CI_KERNPART:-kernel}"
|
||||
# 'ubi' partition on NAND contains UBI
|
||||
CI_UBIPART="${CI_UBIPART:-ubi}"
|
||||
|
||||
# 'rootfs' partition on NAND contains the rootfs
|
||||
CI_ROOTPART="${CI_ROOTPART:-rootfs}"
|
||||
|
||||
ubi_mknod() {
|
||||
local dir="$1"
|
||||
local dev="/dev/$(basename $dir)"
|
||||
@@ -102,14 +99,14 @@ nand_restore_config() {
|
||||
local ubidev=$( nand_find_ubi $CI_UBIPART )
|
||||
local ubivol="$( nand_find_volume $ubidev rootfs_data )"
|
||||
[ ! "$ubivol" ] &&
|
||||
ubivol="$( nand_find_volume $ubidev $CI_ROOTPART )"
|
||||
ubivol="$( nand_find_volume $ubidev rootfs )"
|
||||
mkdir /tmp/new_root
|
||||
if ! mount -t ubifs /dev/$ubivol /tmp/new_root; then
|
||||
echo "mounting ubifs $ubivol failed"
|
||||
rmdir /tmp/new_root
|
||||
return 1
|
||||
fi
|
||||
mv "$1" "/tmp/new_root/$BACKUP_FILE"
|
||||
mv "$1" "/tmp/new_root/sysupgrade.tgz"
|
||||
umount /tmp/new_root
|
||||
sync
|
||||
rmdir /tmp/new_root
|
||||
@@ -146,7 +143,7 @@ nand_upgrade_prepare_ubi() {
|
||||
fi
|
||||
|
||||
local kern_ubivol="$( nand_find_volume $ubidev $CI_KERNPART )"
|
||||
local root_ubivol="$( nand_find_volume $ubidev $CI_ROOTPART )"
|
||||
local root_ubivol="$( nand_find_volume $ubidev rootfs )"
|
||||
local data_ubivol="$( nand_find_volume $ubidev rootfs_data )"
|
||||
|
||||
# remove ubiblock device of rootfs
|
||||
@@ -161,7 +158,7 @@ nand_upgrade_prepare_ubi() {
|
||||
|
||||
# kill volumes
|
||||
[ "$kern_ubivol" ] && ubirmvol /dev/$ubidev -N $CI_KERNPART || true
|
||||
[ "$root_ubivol" ] && ubirmvol /dev/$ubidev -N $CI_ROOTPART || true
|
||||
[ "$root_ubivol" ] && ubirmvol /dev/$ubidev -N rootfs || true
|
||||
[ "$data_ubivol" ] && ubirmvol /dev/$ubidev -N rootfs_data || true
|
||||
|
||||
# update kernel
|
||||
@@ -179,7 +176,7 @@ nand_upgrade_prepare_ubi() {
|
||||
else
|
||||
root_size_param="-s $rootfs_length"
|
||||
fi
|
||||
if ! ubimkvol /dev/$ubidev -N $CI_ROOTPART $root_size_param; then
|
||||
if ! ubimkvol /dev/$ubidev -N rootfs $root_size_param; then
|
||||
echo "cannot create rootfs volume"
|
||||
return 1;
|
||||
fi
|
||||
@@ -236,7 +233,7 @@ nand_upgrade_ubifs() {
|
||||
nand_upgrade_prepare_ubi "$rootfs_length" "ubifs" "0" "0"
|
||||
|
||||
local ubidev="$( nand_find_ubi "$CI_UBIPART" )"
|
||||
local root_ubivol="$(nand_find_volume $ubidev $CI_ROOTPART)"
|
||||
local root_ubivol="$(nand_find_volume $ubidev rootfs)"
|
||||
ubiupdatevol /dev/$root_ubivol -s $rootfs_length $1
|
||||
|
||||
nand_do_upgrade_success
|
||||
@@ -271,7 +268,7 @@ nand_upgrade_tar() {
|
||||
ubiupdatevol /dev/$kern_ubivol -s $kernel_length -
|
||||
}
|
||||
|
||||
local root_ubivol="$(nand_find_volume $ubidev $CI_ROOTPART)"
|
||||
local root_ubivol="$(nand_find_volume $ubidev rootfs)"
|
||||
tar xf $tar_file ${board_dir}/root -O | \
|
||||
ubiupdatevol /dev/$root_ubivol -s $rootfs_length -
|
||||
|
||||
@@ -280,6 +277,15 @@ nand_upgrade_tar() {
|
||||
|
||||
# Recognize type of passed file and start the upgrade process
|
||||
nand_do_upgrade() {
|
||||
if [ -n "$IS_PRE_UPGRADE" ]; then
|
||||
# Previously, nand_do_upgrade was called from the platform_pre_upgrade
|
||||
# hook; this piece of code handles scripts that haven't been
|
||||
# updated. All scripts should gradually move to call nand_do_upgrade
|
||||
# from platform_do_upgrade instead.
|
||||
export do_upgrade="nand_do_upgrade '$1'"
|
||||
return
|
||||
fi
|
||||
|
||||
local file_type=$(identify $1)
|
||||
|
||||
if type 'platform_nand_pre_upgrade' >/dev/null 2>/dev/null; then
|
||||
|
||||
@@ -6,13 +6,24 @@
|
||||
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
|
||||
|
||||
|
||||
@@ -48,7 +59,7 @@ switch_to_ramfs() {
|
||||
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 /lib/upgrade/do_stage2 /usr/share/libubox/jshn.sh $RAMFS_COPY_DATA
|
||||
install_file /etc/resolv.conf /lib/*.sh /lib/functions/*.sh /lib/upgrade/*.sh $RAMFS_COPY_DATA
|
||||
|
||||
[ -L "/lib64" ] && ln -s /lib $RAM_ROOT/lib64
|
||||
|
||||
@@ -111,7 +122,6 @@ kill_remaining() { # [ <signal> [ <loop> ] ]
|
||||
echo
|
||||
}
|
||||
|
||||
indicate_upgrade
|
||||
|
||||
killall -9 telnetd
|
||||
killall -9 dropbear
|
||||
@@ -125,7 +135,10 @@ sleep 1
|
||||
|
||||
|
||||
if [ -n "$IMAGE" ] && type 'platform_pre_upgrade' >/dev/null 2>/dev/null; then
|
||||
platform_pre_upgrade "$IMAGE"
|
||||
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
|
||||
|
||||
@@ -1,130 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Package checksums checking script
|
||||
# (C) 2018 CZ.NIC, z.s.p.o.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
ERRFATAL="no"
|
||||
QUIET="yes"
|
||||
MISSING=""
|
||||
SUMMARY=""
|
||||
NL="
|
||||
"
|
||||
|
||||
# Arguments parsing
|
||||
while expr "x$1" : "x-" > /dev/null; do
|
||||
if [ "x$1" = "x-s" ]; then
|
||||
ERRFATAL="yes"
|
||||
shift
|
||||
elif [ "x$1" = "x-v" ]; then
|
||||
QUIET=" no"
|
||||
shift
|
||||
else
|
||||
echo "Usage: $(basename $0) [-s] [-v] [pkg1 pkg2 ...]"
|
||||
echo
|
||||
echo " -s Stop on first change"
|
||||
echo " -v Verbose"
|
||||
if [ "x$1" = "x-h" ]; then
|
||||
exit 0
|
||||
else
|
||||
echo
|
||||
echo "ERROR: Unknown option '$1'"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
# Check all packages by default
|
||||
if [ -z "$1" ]; then
|
||||
set $(cd /usr/lib/opkg/info/; for i in *.files-sha256sum; do basename $i .files-sha256sum; done)
|
||||
fi
|
||||
|
||||
# Iterate over packages
|
||||
while [ "$1" ]; do
|
||||
if [ \! -f "/usr/lib/opkg/info/$1.files-sha256sum" ]; then
|
||||
if [ "$ERRFATAL" = no ]; then
|
||||
echo " * No checksums for $1 - skipping"
|
||||
echo
|
||||
else
|
||||
echo " * No checksums for $1 - exiting"
|
||||
exit 1
|
||||
fi
|
||||
if [ -z "$MISSING" ]; then
|
||||
MISSING="$1"
|
||||
else
|
||||
MISSING="$MISSING, $1"
|
||||
fi
|
||||
shift
|
||||
continue
|
||||
fi
|
||||
[ $QUIET = yes ] || echo " * Checking package $1:"
|
||||
ERR=""
|
||||
CHECK="`sha256sum -c /usr/lib/opkg/info/$1.files-sha256sum 2> /dev/null`"
|
||||
|
||||
# Are the changed files config files?
|
||||
if [ $? -ne 0 ] && [ "`cat "/usr/lib/opkg/info/$1.files-sha256sum"`" ]; then
|
||||
NEWCHECK="`echo "$CHECK" | grep '^.*: OK$'`"
|
||||
for i in `echo "$CHECK" | sed -n 's|^\(.*\): FAILED$|\1|p'`; do
|
||||
if [ "`grep "^$i\$" "/usr/lib/opkg/info/$1.conffiles" 2> /dev/null`" ] || \
|
||||
[ "`echo "$i" | grep "^/etc/uci-defaults/"`" ]; then
|
||||
NEWCHECK="${NEWCHECK}${NL}${i}: CONFIGURED"
|
||||
else
|
||||
NEWCHECK="${NEWCHECK}${NL}${i}: FAILED"
|
||||
ERR="y"
|
||||
fi
|
||||
done
|
||||
CHECK="$NEWCHECK"
|
||||
fi
|
||||
|
||||
# Do we have changed files or not?
|
||||
if [ -z "$ERR" ]; then
|
||||
[ $QUIET = yes ] || [ -z "`cat "/usr/lib/opkg/info/$1.files-sha256sum"`" ] || echo "$CHECK" | sed 's|^| - |'
|
||||
[ $QUIET = yes ] || echo " * Package $1 is ok"
|
||||
[ $QUIET = yes ] || echo
|
||||
else
|
||||
if [ $QUIET = yes ]; then
|
||||
echo " * Changes found in package $1:"
|
||||
echo "$CHECK" | sed -n 's|^\(.*:[[:blank:]]*FAILED\)$| - \1|p'
|
||||
else
|
||||
echo "$CHECK" | sed 's|^| - |'
|
||||
echo " * Changes found in package $1!"
|
||||
fi
|
||||
if [ "$ERRFATAL" = yes ]; then
|
||||
echo
|
||||
echo "Exiting on first change found!"
|
||||
exit 1
|
||||
fi
|
||||
for i in `echo "$CHECK" | sed -n 's|^\(.*\): FAILED$|\1|p'`; do
|
||||
SUMMARY="${SUMMARY}${NL} - $1: $i"
|
||||
done
|
||||
echo
|
||||
fi
|
||||
shift
|
||||
done
|
||||
|
||||
# If there are changed files, report them
|
||||
if [ "$SUMMARY" ]; then
|
||||
echo "Some packages contain changed files!"
|
||||
echo "Maybe something worth looking into?"
|
||||
echo "Here is the list of packages and changed files:"
|
||||
echo "$SUMMARY"
|
||||
fi
|
||||
if [ "$MISSING" ]; then
|
||||
echo "Following packages are missing checksums: $MISSING"
|
||||
fi
|
||||
if [ "$MISSING" ] || [ "$SUMMARY" ]; then
|
||||
exit 1
|
||||
fi
|
||||
@@ -2,19 +2,14 @@
|
||||
|
||||
. /lib/functions.sh
|
||||
. /lib/functions/system.sh
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
# initialize defaults
|
||||
export MTD_ARGS=""
|
||||
export MTD_CONFIG_ARGS=""
|
||||
export INTERACTIVE=0
|
||||
export VERBOSE=1
|
||||
export SAVE_CONFIG=1
|
||||
export SAVE_OVERLAY=0
|
||||
export SAVE_OVERLAY_PATH=
|
||||
export SAVE_PARTITIONS=1
|
||||
export SAVE_INSTALLED_PKGS=0
|
||||
export SKIP_UNCHANGED=0
|
||||
export CONF_IMAGE=
|
||||
export CONF_BACKUP_LIST=0
|
||||
export CONF_BACKUP=
|
||||
@@ -23,7 +18,6 @@ export NEED_IMAGE=
|
||||
export HELP=0
|
||||
export FORCE=0
|
||||
export TEST=0
|
||||
export UMOUNT_ETCBACKUP_DIR=0
|
||||
|
||||
# parse options
|
||||
while [ -n "$1" ]; do
|
||||
@@ -32,20 +26,17 @@ while [ -n "$1" ]; do
|
||||
-v) export VERBOSE="$(($VERBOSE + 1))";;
|
||||
-q) export VERBOSE="$(($VERBOSE - 1))";;
|
||||
-n) export SAVE_CONFIG=0;;
|
||||
-c) export SAVE_OVERLAY=1 SAVE_OVERLAY_PATH=/etc;;
|
||||
-o) export SAVE_OVERLAY=1 SAVE_OVERLAY_PATH=/;;
|
||||
-c) export SAVE_OVERLAY=1;;
|
||||
-p) export SAVE_PARTITIONS=0;;
|
||||
-k) export SAVE_INSTALLED_PKGS=1;;
|
||||
-u) export SKIP_UNCHANGED=1;;
|
||||
-b|--create-backup) export CONF_BACKUP="$2" NEED_IMAGE=1; shift;;
|
||||
-r|--restore-backup) export CONF_RESTORE="$2" NEED_IMAGE=1; shift;;
|
||||
-l|--list-backup) export CONF_BACKUP_LIST=1;;
|
||||
-l|--list-backup) export CONF_BACKUP_LIST=1; break;;
|
||||
-f) export CONF_IMAGE="$2"; shift;;
|
||||
-F|--force) export FORCE=1;;
|
||||
-T|--test) export TEST=1;;
|
||||
-h|--help) export HELP=1; break;;
|
||||
-*)
|
||||
echo "Invalid option: $1" >&2
|
||||
echo "Invalid option: $1"
|
||||
exit 1
|
||||
;;
|
||||
*) break;;
|
||||
@@ -55,27 +46,20 @@ done
|
||||
|
||||
export CONFFILES=/tmp/sysupgrade.conffiles
|
||||
export CONF_TAR=/tmp/sysupgrade.tgz
|
||||
export ETCBACKUP_DIR=/etc/backup
|
||||
export INSTALLED_PACKAGES=${ETCBACKUP_DIR}/installed_packages.txt
|
||||
|
||||
IMAGE="$1"
|
||||
|
||||
[ -z "$IMAGE" -a -z "$NEED_IMAGE" -a $CONF_BACKUP_LIST -eq 0 -o $HELP -gt 0 ] && {
|
||||
[ -z "$IMAGE" -a -z "$NEED_IMAGE" -o $HELP -gt 0 ] && {
|
||||
cat <<EOF
|
||||
Usage: $0 [<upgrade-option>...] <image file or URL>
|
||||
$0 [-q] [-i] [-c] [-u] [-o] [-k] <backup-command> <file>
|
||||
$0 [-q] [-i] <backup-command> <file>
|
||||
|
||||
upgrade-option:
|
||||
-f <config> restore configuration from .tar.gz (file or url)
|
||||
-i interactive mode
|
||||
-c attempt to preserve all changed files in /etc/
|
||||
-o attempt to preserve all changed files in /, except those
|
||||
from packages but including changed confs.
|
||||
-u skip from backup files that are equal to those in /rom
|
||||
-n do not save configuration over reflash
|
||||
-p do not attempt to restore the partition table after flash.
|
||||
-k include in backup a list of current installed packages at
|
||||
$INSTALLED_PACKAGES
|
||||
-T | --test
|
||||
Verify image and config .tar.gz but do not actually flash.
|
||||
-F | --force
|
||||
@@ -131,93 +115,47 @@ list_changed_conffiles() {
|
||||
done
|
||||
}
|
||||
|
||||
add_conffiles() {
|
||||
add_uci_conffiles() {
|
||||
local file="$1"
|
||||
( find $(sed -ne '/^[[:space:]]*$/d; /^#/d; p' \
|
||||
/etc/sysupgrade.conf /lib/upgrade/keep.d/* 2>/dev/null) \
|
||||
\( -type f -o -type l \) $find_filter 2>/dev/null;
|
||||
-type f -o -type l 2>/dev/null;
|
||||
list_changed_conffiles ) | sort -u > "$file"
|
||||
return 0
|
||||
}
|
||||
|
||||
add_overlayfiles() {
|
||||
local file="$1"
|
||||
|
||||
local packagesfiles=$1.packagesfiles
|
||||
touch "$packagesfiles"
|
||||
|
||||
if [ "$SAVE_OVERLAY_PATH" = / ]; then
|
||||
local conffiles=$1.conffiles
|
||||
local keepfiles=$1.keepfiles
|
||||
|
||||
list_conffiles | cut -f2 -d ' ' | sort -u > "$conffiles"
|
||||
|
||||
# backup files from /etc/sysupgrade.conf and /lib/upgrade/keep.d, but
|
||||
# ignore those aready controlled by opkg conffiles
|
||||
find $(sed -ne '/^[[:space:]]*$/d; /^#/d; p' \
|
||||
/etc/sysupgrade.conf /lib/upgrade/keep.d/* 2>/dev/null) \
|
||||
\( -type f -o -type l \) 2>/dev/null | sort -u |
|
||||
grep -h -v -x -F -f $conffiles > "$keepfiles"
|
||||
|
||||
# backup conffiles, but only those changed if '-u'
|
||||
[ $SKIP_UNCHANGED = 1 ] &&
|
||||
list_changed_conffiles | sort -u > "$conffiles"
|
||||
|
||||
# do not backup files from packages, except those listed
|
||||
# in conffiles and keep.d
|
||||
{
|
||||
find /usr/lib/opkg/info -type f -name "*.list" -exec cat {} \;
|
||||
find /usr/lib/opkg/info -type f -name "*.control" -exec sed \
|
||||
-ne '/^Alternatives/{s/^Alternatives: //;s/, /\n/g;p}' {} \; |
|
||||
cut -f2 -d:
|
||||
} | grep -v -x -F -f $conffiles |
|
||||
grep -v -x -F -f $keepfiles | sort -u > "$packagesfiles"
|
||||
rm -f "$keepfiles" "$conffiles"
|
||||
fi
|
||||
|
||||
# busybox grep bug when file is empty
|
||||
[ -s "$packagesfiles" ] || echo > $packagesfiles
|
||||
|
||||
( cd /overlay/upper/; find .$SAVE_OVERLAY_PATH \( -type f -o -type l \) $find_filter | sed \
|
||||
-e 's,^\.,,' \
|
||||
-e '\,^/etc/board.json$,d' \
|
||||
find /overlay/upper/etc/ -type f -o -type l | sed \
|
||||
-e 's,^/overlay\/upper/,/,' \
|
||||
-e '\,/META_[a-zA-Z0-9]*$,d' \
|
||||
-e '\,/functions.sh$,d' \
|
||||
-e '\,/[^/]*-opkg$,d' \
|
||||
-e '\,^/etc/urandom.seed$,d' \
|
||||
-e "\,^$INSTALLED_PACKAGES$,d" \
|
||||
-e '\,^/usr/lib/opkg/.*,d' \
|
||||
) | grep -v -x -F -f $packagesfiles > "$file"
|
||||
|
||||
rm -f "$packagesfiles"
|
||||
|
||||
> "$file"
|
||||
return 0
|
||||
}
|
||||
|
||||
# hooks
|
||||
sysupgrade_image_check="fwtool_check_image platform_check_image"
|
||||
sysupgrade_pre_upgrade="fwtool_pre_upgrade"
|
||||
|
||||
if [ $SAVE_OVERLAY = 1 ]; then
|
||||
[ ! -d /overlay/upper/etc ] && {
|
||||
echo "Cannot find '/overlay/upper/etc', required for '-c'" >&2
|
||||
echo "Cannot find '/overlay/upper/etc', required for '-c'"
|
||||
exit 1
|
||||
}
|
||||
sysupgrade_init_conffiles="add_overlayfiles"
|
||||
else
|
||||
sysupgrade_init_conffiles="add_conffiles"
|
||||
fi
|
||||
|
||||
find_filter=""
|
||||
if [ $SKIP_UNCHANGED = 1 ]; then
|
||||
[ ! -d /rom/ ] && {
|
||||
echo "'/rom/' is required by '-u'"
|
||||
exit 1
|
||||
}
|
||||
find_filter='( ( -exec test -e /rom/{} ; -exec cmp -s /{} /rom/{} ; ) -o -print )'
|
||||
sysupgrade_init_conffiles="add_uci_conffiles"
|
||||
fi
|
||||
|
||||
include /lib/upgrade
|
||||
|
||||
do_save_conffiles() {
|
||||
local conf_tar="$1"
|
||||
local conf_tar="${1:-$CONF_TAR}"
|
||||
|
||||
[ -z "$(rootfs_type)" ] && {
|
||||
echo "Cannot save config while running from ramdisk." >&2
|
||||
echo "Cannot save config while running from ramdisk."
|
||||
ask_bool 0 "Abort" && exit
|
||||
rm -f "$conf_tar"
|
||||
return 0
|
||||
@@ -225,46 +163,15 @@ do_save_conffiles() {
|
||||
run_hooks "$CONFFILES" $sysupgrade_init_conffiles
|
||||
ask_bool 0 "Edit config file list" && vi "$CONFFILES"
|
||||
|
||||
if [ "$SAVE_INSTALLED_PKGS" -eq 1 ]; then
|
||||
echo "${INSTALLED_PACKAGES}" >> "$CONFFILES"
|
||||
mkdir -p "$ETCBACKUP_DIR"
|
||||
# Avoid touching filesystem on each backup
|
||||
RAMFS="$(mktemp -d -t sysupgrade.XXXXXX)"
|
||||
mkdir -p "$RAMFS/upper" "$RAMFS/work"
|
||||
mount -t overlay overlay -o lowerdir=$ETCBACKUP_DIR,upperdir=$RAMFS/upper,workdir=$RAMFS/work $ETCBACKUP_DIR &&
|
||||
UMOUNT_ETCBACKUP_DIR=1 || {
|
||||
echo "Cannot mount '$ETCBACKUP_DIR' as tmpfs to avoid touching disk while saving the list of installed packages." >&2
|
||||
ask_bool 0 "Abort" && exit
|
||||
}
|
||||
|
||||
# Format: pkg-name<TAB>{rom,overlay,unkown}
|
||||
# rom is used for pkgs in /rom, even if updated later
|
||||
find /usr/lib/opkg/info -name "*.control" \( \
|
||||
\( -exec test -f /rom/{} \; -exec echo {} rom \; \) -o \
|
||||
\( -exec test -f /overlay/upper/{} \; -exec echo {} overlay \; \) -o \
|
||||
\( -exec echo {} unknown \; \) \
|
||||
\) | sed -e 's,.*/,,;s/\.control /\t/' > ${INSTALLED_PACKAGES}
|
||||
fi
|
||||
|
||||
v "Saving config files..."
|
||||
[ "$VERBOSE" -gt 1 ] && TAR_V="v" || TAR_V=""
|
||||
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
|
||||
|
||||
[ "$UMOUNT_ETCBACKUP_DIR" -eq 1 ] && {
|
||||
umount "$ETCBACKUP_DIR"
|
||||
rm -rf "$RAMFS"
|
||||
}
|
||||
rm -f "$CONFFILES"
|
||||
}
|
||||
|
||||
if [ $CONF_BACKUP_LIST -eq 1 ]; then
|
||||
run_hooks "$CONFFILES" $sysupgrade_init_conffiles
|
||||
[ "$SAVE_INSTALLED_PKGS" -eq 1 ] && echo ${INSTALLED_PACKAGES} >> "$CONFFILES"
|
||||
cat "$CONFFILES"
|
||||
rm -f "$CONFFILES"
|
||||
exit 0
|
||||
@@ -277,7 +184,7 @@ fi
|
||||
|
||||
if [ -n "$CONF_RESTORE" ]; then
|
||||
if [ "$CONF_RESTORE" != "-" ] && [ ! -f "$CONF_RESTORE" ]; then
|
||||
echo "Backup archive '$CONF_RESTORE' not found." >&2
|
||||
echo "Backup archive '$CONF_RESTORE' not found."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -287,14 +194,13 @@ if [ -n "$CONF_RESTORE" ]; then
|
||||
fi
|
||||
|
||||
type platform_check_image >/dev/null 2>/dev/null || {
|
||||
echo "Firmware upgrade is not implemented for this platform." >&2
|
||||
echo "Firmware upgrade is not implemented for this platform."
|
||||
exit 1
|
||||
}
|
||||
|
||||
case "$IMAGE" in
|
||||
http://*|\
|
||||
https://*)
|
||||
wget -O/tmp/sysupgrade.img "$IMAGE" || exit 1
|
||||
http://*)
|
||||
wget -O/tmp/sysupgrade.img "$IMAGE"
|
||||
IMAGE=/tmp/sysupgrade.img
|
||||
;;
|
||||
esac
|
||||
@@ -303,7 +209,7 @@ IMAGE="$(readlink -f "$IMAGE")"
|
||||
|
||||
case "$IMAGE" in
|
||||
'')
|
||||
echo "Image file not found." >&2
|
||||
echo "Image file not found."
|
||||
exit 1
|
||||
;;
|
||||
/tmp/*) ;;
|
||||
@@ -314,33 +220,34 @@ case "$IMAGE" in
|
||||
;;
|
||||
esac
|
||||
|
||||
json_load "$(/usr/libexec/validate_firmware_image "$IMAGE")" || {
|
||||
echo "Failed to check image"
|
||||
exit 1
|
||||
}
|
||||
json_get_var valid "valid"
|
||||
[ "$valid" -eq 0 ] && {
|
||||
if [ $FORCE -eq 1 ]; then
|
||||
echo "Image check failed but --force given - will update anyway!" >&2
|
||||
else
|
||||
echo "Image check failed." >&2
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
export ARGV="$IMAGE"
|
||||
export ARGC=1
|
||||
|
||||
for check in $sysupgrade_image_check; do
|
||||
( $check "$IMAGE" ) || {
|
||||
if [ $FORCE -eq 1 ]; then
|
||||
echo "Image check '$check' failed but --force given - will update anyway!"
|
||||
break
|
||||
else
|
||||
echo "Image check '$check' failed."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
done
|
||||
|
||||
if [ -n "$CONF_IMAGE" ]; then
|
||||
case "$(get_magic_word $CONF_IMAGE cat)" in
|
||||
# .gz files
|
||||
1f8b) ;;
|
||||
*)
|
||||
echo "Invalid config file. Please use only .tar.gz files" >&2
|
||||
echo "Invalid config file. Please use only .tar.gz files"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
get_image "$CONF_IMAGE" "cat" > "$CONF_TAR"
|
||||
export SAVE_CONFIG=1
|
||||
elif ask_bool $SAVE_CONFIG "Keep config files over reflash"; then
|
||||
[ $TEST -eq 1 ] || do_save_conffiles "$CONF_TAR"
|
||||
[ $TEST -eq 1 ] || do_save_conffiles
|
||||
export SAVE_CONFIG=1
|
||||
else
|
||||
[ $TEST -eq 1 ] || rm -f "$CONF_TAR"
|
||||
@@ -351,27 +258,26 @@ if [ $TEST -eq 1 ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
install_bin /sbin/upgraded
|
||||
v "Commencing upgrade. Closing all shell sessions."
|
||||
if [ $SAVE_PARTITIONS -eq 0 ]; then
|
||||
touch /tmp/sysupgrade.always.overwrite.bootdisk.partmap
|
||||
else
|
||||
rm -f /tmp/sysupgrade.always.overwrite.bootdisk.partmap
|
||||
fi
|
||||
|
||||
COMMAND='/lib/upgrade/do_stage2'
|
||||
run_hooks "" $sysupgrade_pre_upgrade
|
||||
|
||||
install_bin /sbin/upgraded
|
||||
v "Commencing upgrade. All shell sessions will be closed now."
|
||||
|
||||
COMMAND='. /lib/functions.sh; include /lib/upgrade; do_upgrade_stage2'
|
||||
|
||||
if [ -n "$FAILSAFE" ]; then
|
||||
printf '%s\x00%s\x00%s' "$RAM_ROOT" "$IMAGE" "$COMMAND" >/tmp/sysupgrade
|
||||
lock -u /tmp/.failsafe
|
||||
else
|
||||
force_attr=""
|
||||
[ $FORCE -eq 1 ] && force_attr="\"force\": true,"
|
||||
backup_attr=""
|
||||
[ $SAVE_CONFIG -eq 1 ] && backup_attr="\"backup\": $(json_string $CONF_TAR),"
|
||||
ubus call system sysupgrade "{
|
||||
\"prefix\": $(json_string "$RAM_ROOT"),
|
||||
\"path\": $(json_string "$IMAGE"),
|
||||
$force_attr
|
||||
$backup_attr
|
||||
\"command\": $(json_string "$COMMAND"),
|
||||
\"options\": {
|
||||
\"save_partitions\": $SAVE_PARTITIONS
|
||||
}
|
||||
\"command\": $(json_string "$COMMAND")
|
||||
}"
|
||||
fi
|
||||
|
||||
@@ -13,7 +13,7 @@ save() {
|
||||
}
|
||||
|
||||
SEED="$(uci -q get system.@system[0].urandom_seed || true)"
|
||||
[ "${SEED:0:1}" = "/" ] && save "$SEED"
|
||||
[ "${SEED:0:1}" == "/" ] && save "$SEED"
|
||||
|
||||
SEED=/etc/urandom.seed
|
||||
[ ! -f $SEED ] && save "$SEED"
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
usage() {
|
||||
cat <<EOF
|
||||
Usage: $0 [config|up|down|reload|status]
|
||||
Usage: $0 [config|down|reload|status]
|
||||
enables (default), disables or configures devices not yet configured.
|
||||
EOF
|
||||
exit 1
|
||||
@@ -241,6 +241,5 @@ case "$1" in
|
||||
reload) wifi_reload "$2";;
|
||||
reload_legacy) wifi_reload_legacy "$2";;
|
||||
--help|help) usage;;
|
||||
''|up) ubus call network reload; wifi_updown "enable" "$2";;
|
||||
*) usage; exit 1;;
|
||||
*) ubus call network reload; wifi_updown "enable" "$2";;
|
||||
esac
|
||||
|
||||
@@ -4,15 +4,15 @@ ID="%d"
|
||||
ID_LIKE="lede openwrt"
|
||||
PRETTY_NAME="%D %V"
|
||||
VERSION_ID="%v"
|
||||
HOME_URL="%u"
|
||||
HOME_URL="%m"
|
||||
BUG_URL="%b"
|
||||
SUPPORT_URL="%s"
|
||||
BUILD_ID="%R"
|
||||
OPENWRT_BOARD="%S"
|
||||
OPENWRT_ARCH="%A"
|
||||
OPENWRT_TAINTS="%t"
|
||||
OPENWRT_DEVICE_MANUFACTURER="%M"
|
||||
OPENWRT_DEVICE_MANUFACTURER_URL="%m"
|
||||
OPENWRT_DEVICE_PRODUCT="%P"
|
||||
OPENWRT_DEVICE_REVISION="%h"
|
||||
OPENWRT_RELEASE="%D %V %C"
|
||||
LEDE_BOARD="%S"
|
||||
LEDE_ARCH="%A"
|
||||
LEDE_TAINTS="%t"
|
||||
LEDE_DEVICE_MANUFACTURER="%M"
|
||||
LEDE_DEVICE_MANUFACTURER_URL="%m"
|
||||
LEDE_DEVICE_PRODUCT="%P"
|
||||
LEDE_DEVICE_REVISION="%h"
|
||||
LEDE_RELEASE="%D %V %C"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
[ "$(uci -q get system.@system[0].ttylogin)" = 1 ] || exec /bin/ash --login
|
||||
[ "$(uci -q get system.@system[0].ttylogin)" == 1 ] || exec /bin/ash --login
|
||||
|
||||
exec /bin/login
|
||||
|
||||
@@ -1,66 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
. /lib/functions/system.sh
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
include /lib/upgrade
|
||||
|
||||
VALID=1
|
||||
FORCEABLE=1
|
||||
ALLOW_BACKUP=1
|
||||
|
||||
# Mark image as invalid but still possible to install
|
||||
notify_firmware_invalid() {
|
||||
VALID=0
|
||||
}
|
||||
|
||||
# Mark image as broken (impossible to install)
|
||||
notify_firmware_broken() {
|
||||
VALID=0
|
||||
FORCEABLE=0
|
||||
}
|
||||
|
||||
# Mark image as incompatible with preserving a backup
|
||||
notify_firmware_no_backup() {
|
||||
ALLOW_BACKUP=0
|
||||
}
|
||||
|
||||
# Add result of validation test
|
||||
notify_firmware_test_result() {
|
||||
local old_ns
|
||||
|
||||
json_set_namespace validate_firmware_image old_ns
|
||||
json_add_boolean "$1" "$2"
|
||||
json_set_namespace $old_ns
|
||||
}
|
||||
|
||||
err_to_bool() {
|
||||
[ "$1" -ne 0 ] && echo 0 || echo 1
|
||||
}
|
||||
|
||||
fwtool_check_signature "$1" >&2
|
||||
FWTOOL_SIGNATURE=$?
|
||||
[ "$FWTOOL_SIGNATURE" -ne 0 ] && notify_firmware_invalid
|
||||
|
||||
fwtool_check_image "$1" >&2
|
||||
FWTOOL_DEVICE_MATCH=$?
|
||||
[ "$FWTOOL_DEVICE_MATCH" -ne 0 ] && notify_firmware_invalid
|
||||
|
||||
json_set_namespace validate_firmware_image old_ns
|
||||
json_init
|
||||
json_add_object "tests"
|
||||
json_add_boolean fwtool_signature "$(err_to_bool $FWTOOL_SIGNATURE)"
|
||||
json_add_boolean fwtool_device_match "$(err_to_bool $FWTOOL_DEVICE_MATCH)"
|
||||
|
||||
# Call platform_check_image() here so it can add its test
|
||||
# results and still mark image properly.
|
||||
json_set_namespace $old_ns
|
||||
platform_check_image "$1" >&2 || notify_firmware_invalid
|
||||
json_set_namespace validate_firmware_image old_ns
|
||||
json_close_object
|
||||
json_add_boolean valid "$VALID"
|
||||
json_add_boolean forceable "$FORCEABLE"
|
||||
json_add_boolean allow_backup "$ALLOW_BACKUP"
|
||||
json_dump -i
|
||||
json_set_namespace $old_ns
|
||||
@@ -183,7 +183,7 @@ if VERSIONOPT
|
||||
config VERSION_REPO
|
||||
string
|
||||
prompt "Release repository"
|
||||
default "http://downloads.openwrt.org/releases/19.07.1"
|
||||
default "http://downloads.openwrt.org/releases/18.06.0-rc1"
|
||||
help
|
||||
This is the repository address embedded in the image, it defaults
|
||||
to the trunk snapshot repo; the url may contain the following placeholders:
|
||||
@@ -202,12 +202,6 @@ if VERSIONOPT
|
||||
%P .. Product name or "Generic"
|
||||
%h .. Hardware revision or "v0"
|
||||
|
||||
config VERSION_HOME_URL
|
||||
string
|
||||
prompt "Release Homepage"
|
||||
help
|
||||
This is the release version homepage
|
||||
|
||||
config VERSION_MANUFACTURER
|
||||
string
|
||||
prompt "Manufacturer name"
|
||||
@@ -274,4 +268,18 @@ menuconfig PER_FEED_REPO
|
||||
If set, a separate repository is generated within bin/*/packages/
|
||||
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"
|
||||
|
||||
@@ -13,7 +13,7 @@ PKG_VERSION:=1.6.9
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://downloads.openwrt.org/sources/
|
||||
PKG_SOURCE_URL:=http://downloads.openwrt.org/sources/
|
||||
PKG_HASH:=1d2bc04c2c6bb3d2d6c1916b6dc559cda2b1ecb045d7801fd49af6af4234abeb
|
||||
PKG_TARGETS:=bin
|
||||
|
||||
@@ -27,6 +27,7 @@ define Package/apex
|
||||
DEPENDS:=@TARGET_ixp4xx
|
||||
DEFAULT:=y
|
||||
TITLE:=Boot loader for NSLU2, FSG3, NAS100D and others
|
||||
URL:=http://wiki.buici.com/wiki/Apex_Bootloader
|
||||
endef
|
||||
|
||||
define build_apex
|
||||
|
||||
@@ -11,10 +11,10 @@ PKG_NAME:=arm-trusted-firmware-sunxi
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL=https://github.com/ARM-software/arm-trusted-firmware
|
||||
PKG_SOURCE_DATE:=2018-10-02
|
||||
PKG_SOURCE_VERSION:=dbc8d9496ead9ecdd7c2a276b542a4fbbbf64027
|
||||
PKG_MIRROR_HASH:=c81521a27b86f606e927b4e346286540b862828c8d49292eae1f5c6adfc24001
|
||||
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
|
||||
@@ -37,12 +37,12 @@ MAKE_VARS = \
|
||||
CROSS_COMPILE="$(TARGET_CROSS)"
|
||||
|
||||
MAKE_FLAGS += \
|
||||
PLAT=sun50i_a64 \
|
||||
PLAT=sun50iw1p1 \
|
||||
bl31
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(STAGING_DIR_IMAGE)
|
||||
$(CP) $(PKG_BUILD_DIR)/build/sun50i_a64/release/bl31.bin $(STAGING_DIR_IMAGE)/bl31.bin
|
||||
$(CP) $(PKG_BUILD_DIR)/build/sun50iw1p1/release/bl31.bin $(STAGING_DIR_IMAGE)/bl31.bin
|
||||
endef
|
||||
|
||||
define Package/arm-trusted-firmware-sunxi/install
|
||||
|
||||
@@ -30,79 +30,79 @@ endef
|
||||
|
||||
define AT91Bootstrap/sama5d2_xplaineddf_uboot
|
||||
TITLE:=AT91Bootstrap for SAMA5D2 Xplained board (SPI Flash)
|
||||
BUILD_SUBTARGET:=sama5
|
||||
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:=sama5
|
||||
BUILD_SUBTARGET:=sama5d2
|
||||
BUILD_DEVICES:=at91-sama5d2_xplained
|
||||
endef
|
||||
|
||||
define AT91Bootstrap/sama5d2_xplainedsd_uboot
|
||||
TITLE:=AT91Bootstrap for SAMA5D2 Xplained board (SDcard/EMMC)
|
||||
BUILD_SUBTARGET:=sama5
|
||||
BUILD_SUBTARGET:=sama5d2
|
||||
BUILD_DEVICES:=at91-sama5d2_xplained
|
||||
endef
|
||||
|
||||
define AT91Bootstrap/sama5d3_xplainednf_uboot
|
||||
TITLE:=AT91Bootstrap for SAMA5D3 Xplained board (Nand Flash)
|
||||
BUILD_SUBTARGET:=sama5
|
||||
BUILD_SUBTARGET:=sama5d3
|
||||
BUILD_DEVICES:=at91-sama5d3_xplained
|
||||
endef
|
||||
|
||||
define AT91Bootstrap/sama5d3_xplainedsd_uboot
|
||||
TITLE:=AT91Bootstrap for SAMA5D3 Xplained board (SDcard)
|
||||
BUILD_SUBTARGET:=sama5
|
||||
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:=sama5
|
||||
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:=sama5
|
||||
BUILD_SUBTARGET:=sama5d4
|
||||
BUILD_DEVICES:=at91-sama5d4_xplained
|
||||
endef
|
||||
|
||||
define AT91Bootstrap/sama5d4_xplainedsd_uboot_secure
|
||||
TITLE:=AT91Bootstrap for SAMA5D4 Xplained board (SDcard)
|
||||
BUILD_SUBTARGET:=sama5
|
||||
BUILD_SUBTARGET:=sama5d4
|
||||
BUILD_DEVICES:=at91-sama5d4_xplained
|
||||
endef
|
||||
|
||||
define AT91Bootstrap/sama5d27_som1_eksd_uboot
|
||||
TITLE:=AT91Bootstrap for SAMA5D27 SOM1 Ek (SDcard0)
|
||||
BUILD_SUBTARGET:=sama5
|
||||
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:=sama5
|
||||
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:=sama5
|
||||
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:=sama5
|
||||
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:=sama5
|
||||
BUILD_SUBTARGET:=sama5d2
|
||||
BUILD_DEVICES:=at91-sama5d2_ptc_ek
|
||||
endef
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ PKG_VERSION:=20080329
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://downloads.openwrt.org/sources
|
||||
PKG_SOURCE_URL:=http://andrzejekiert.ovh.org/software/fconfig/
|
||||
PKG_HASH:=4ff0e8f07e35e46b705c0dbe9d9544ede01ea092a69e3f7db03e55a3f2bb8eb7
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
|
||||
@@ -24,12 +24,20 @@ define Package/fconfig
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=Boot Loaders
|
||||
TITLE:=RedBoot configuration editor
|
||||
URL:=http://andrzejekiert.ovh.org/software.html.en
|
||||
endef
|
||||
|
||||
define Package/fconfig/description
|
||||
displays and (if writable) also edits the RedBoot configuration.
|
||||
endef
|
||||
|
||||
define Build/Configure
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
$(call Build/Compile/Default)
|
||||
endef
|
||||
|
||||
define Package/fconfig/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/fconfig $(1)/usr/sbin/
|
||||
|
||||
@@ -11,7 +11,7 @@ include $(INCLUDE_DIR)/kernel.mk
|
||||
PKG_NAME:=grub
|
||||
PKG_CPE_ID:=cpe:/a:gnu:grub2
|
||||
PKG_VERSION:=2.02
|
||||
PKG_RELEASE:=3
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:=@GNU/grub
|
||||
@@ -33,7 +33,7 @@ define Package/grub2
|
||||
SECTION:=boot
|
||||
TITLE:=GRand Unified Bootloader
|
||||
URL:=http://www.gnu.org/software/grub/
|
||||
DEPENDS:=@TARGET_x86
|
||||
DEPENDS:=@TARGET_x86||TARGET_x86_64
|
||||
endef
|
||||
|
||||
define Package/grub2-editenv
|
||||
@@ -42,7 +42,7 @@ define Package/grub2-editenv
|
||||
SUBMENU:=Boot Loaders
|
||||
TITLE:=Grub2 Environment editor
|
||||
URL:=http://www.gnu.org/software/grub/
|
||||
DEPENDS:=@TARGET_x86
|
||||
DEPENDS:=@TARGET_x86||TARGET_x86_64
|
||||
endef
|
||||
|
||||
define Package/grub2-editenv/description
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
From 563b1da6e6ae7af46cc8354cadb5dab416989f0a Mon Sep 17 00:00:00 2001
|
||||
From: Michael Chang <mchang@suse.com>
|
||||
Date: Mon, 26 Mar 2018 16:52:34 +0800
|
||||
Subject: Fix packed-not-aligned error on GCC 8
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
When building with GCC 8, there are several errors regarding packed-not-aligned.
|
||||
|
||||
./include/grub/gpt_partition.h:79:1: error: alignment 1 of ‘struct grub_gpt_partentry’ is less than 8 [-Werror=packed-not-aligned]
|
||||
|
||||
This patch fixes the build error by cleaning up the ambiguity of placing
|
||||
aligned structure in a packed one. In "struct grub_btrfs_time" and "struct
|
||||
grub_gpt_part_type", the aligned attribute seems to be superfluous, and also
|
||||
has to be packed, to ensure the structure is bit-to-bit mapped to the format
|
||||
laid on disk. I think we could blame to copy and paste error here for the
|
||||
mistake. In "struct efi_variable", we have to use grub_efi_packed_guid_t, as
|
||||
the name suggests. :)
|
||||
|
||||
Signed-off-by: Michael Chang <mchang@suse.com>
|
||||
Tested-by: Michael Chang <mchang@suse.com>
|
||||
Tested-by: Paul Menzel <paulepanter@users.sourceforge.net>
|
||||
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
|
||||
---
|
||||
grub-core/fs/btrfs.c | 2 +-
|
||||
include/grub/efiemu/runtime.h | 2 +-
|
||||
include/grub/gpt_partition.h | 2 +-
|
||||
3 files changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c
|
||||
index 4849c1ceb..be195448d 100644
|
||||
--- a/grub-core/fs/btrfs.c
|
||||
+++ b/grub-core/fs/btrfs.c
|
||||
@@ -175,7 +175,7 @@ struct grub_btrfs_time
|
||||
{
|
||||
grub_int64_t sec;
|
||||
grub_uint32_t nanosec;
|
||||
-} __attribute__ ((aligned (4)));
|
||||
+} GRUB_PACKED;
|
||||
|
||||
struct grub_btrfs_inode
|
||||
{
|
||||
diff --git a/include/grub/efiemu/runtime.h b/include/grub/efiemu/runtime.h
|
||||
index 9b6b729f4..36d2dedf4 100644
|
||||
--- a/include/grub/efiemu/runtime.h
|
||||
+++ b/include/grub/efiemu/runtime.h
|
||||
@@ -29,7 +29,7 @@ struct grub_efiemu_ptv_rel
|
||||
|
||||
struct efi_variable
|
||||
{
|
||||
- grub_efi_guid_t guid;
|
||||
+ grub_efi_packed_guid_t guid;
|
||||
grub_uint32_t namelen;
|
||||
grub_uint32_t size;
|
||||
grub_efi_uint32_t attributes;
|
||||
diff --git a/include/grub/gpt_partition.h b/include/grub/gpt_partition.h
|
||||
index 1b32f6725..9668a68c3 100644
|
||||
--- a/include/grub/gpt_partition.h
|
||||
+++ b/include/grub/gpt_partition.h
|
||||
@@ -28,7 +28,7 @@ struct grub_gpt_part_type
|
||||
grub_uint16_t data2;
|
||||
grub_uint16_t data3;
|
||||
grub_uint8_t data4[8];
|
||||
-} __attribute__ ((aligned(8)));
|
||||
+} GRUB_PACKED;
|
||||
typedef struct grub_gpt_part_type grub_gpt_part_type_t;
|
||||
|
||||
#define GRUB_GPT_PARTITION_TYPE_EMPTY \
|
||||
--
|
||||
cgit v1.1-33-g03f6
|
||||
@@ -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,75 +0,0 @@
|
||||
From 02702bdfe14d8a04643a45b03715f734ae34dbac Mon Sep 17 00:00:00 2001
|
||||
From: "H.J. Lu" <hjl.tools@gmail.com>
|
||||
Date: Sat, 17 Feb 2018 06:47:28 -0800
|
||||
Subject: x86-64: Treat R_X86_64_PLT32 as R_X86_64_PC32
|
||||
|
||||
Starting from binutils commit bd7ab16b4537788ad53521c45469a1bdae84ad4a:
|
||||
|
||||
https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=bd7ab16b4537788ad53521c45469a1bdae84ad4a
|
||||
|
||||
x86-64 assembler generates R_X86_64_PLT32, instead of R_X86_64_PC32, for
|
||||
32-bit PC-relative branches. Grub2 should treat R_X86_64_PLT32 as
|
||||
R_X86_64_PC32.
|
||||
|
||||
Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
|
||||
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
|
||||
|
||||
Origin: upstream, https://git.savannah.gnu.org/cgit/grub.git/commit/?id=842c390469e2c2e10b5aa36700324cd3bde25875
|
||||
Last-Update: 2018-07-30
|
||||
|
||||
Patch-Name: R_X86_64_PLT32.patch
|
||||
---
|
||||
grub-core/efiemu/i386/loadcore64.c | 1 +
|
||||
grub-core/kern/x86_64/dl.c | 1 +
|
||||
util/grub-mkimagexx.c | 1 +
|
||||
util/grub-module-verifier.c | 1 +
|
||||
4 files changed, 4 insertions(+)
|
||||
|
||||
diff --git a/grub-core/efiemu/i386/loadcore64.c b/grub-core/efiemu/i386/loadcore64.c
|
||||
index e49d0b6ff..18facf47f 100644
|
||||
--- a/grub-core/efiemu/i386/loadcore64.c
|
||||
+++ b/grub-core/efiemu/i386/loadcore64.c
|
||||
@@ -98,6 +98,7 @@ grub_arch_efiemu_relocate_symbols64 (grub_efiemu_segment_t segs,
|
||||
break;
|
||||
|
||||
case R_X86_64_PC32:
|
||||
+ case R_X86_64_PLT32:
|
||||
err = grub_efiemu_write_value (addr,
|
||||
*addr32 + rel->r_addend
|
||||
+ sym.off
|
||||
diff --git a/grub-core/kern/x86_64/dl.c b/grub-core/kern/x86_64/dl.c
|
||||
index 440690673..3a73e6e6c 100644
|
||||
--- a/grub-core/kern/x86_64/dl.c
|
||||
+++ b/grub-core/kern/x86_64/dl.c
|
||||
@@ -70,6 +70,7 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr,
|
||||
break;
|
||||
|
||||
case R_X86_64_PC32:
|
||||
+ case R_X86_64_PLT32:
|
||||
{
|
||||
grub_int64_t value;
|
||||
value = ((grub_int32_t) *addr32) + rel->r_addend + sym->st_value -
|
||||
diff --git a/util/grub-mkimagexx.c b/util/grub-mkimagexx.c
|
||||
index e63f148e4..f20255a28 100644
|
||||
--- a/util/grub-mkimagexx.c
|
||||
+++ b/util/grub-mkimagexx.c
|
||||
@@ -832,6 +832,7 @@ SUFFIX (relocate_addresses) (Elf_Ehdr *e, Elf_Shdr *sections,
|
||||
break;
|
||||
|
||||
case R_X86_64_PC32:
|
||||
+ case R_X86_64_PLT32:
|
||||
{
|
||||
grub_uint32_t *t32 = (grub_uint32_t *) target;
|
||||
*t32 = grub_host_to_target64 (grub_target_to_host32 (*t32)
|
||||
diff --git a/util/grub-module-verifier.c b/util/grub-module-verifier.c
|
||||
index 9179285a5..a79271f66 100644
|
||||
--- a/util/grub-module-verifier.c
|
||||
+++ b/util/grub-module-verifier.c
|
||||
@@ -19,6 +19,7 @@ struct grub_module_verifier_arch archs[] = {
|
||||
-1
|
||||
}, (int[]){
|
||||
R_X86_64_PC32,
|
||||
+ R_X86_64_PLT32,
|
||||
-1
|
||||
}
|
||||
},
|
||||
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=kexec-tools
|
||||
PKG_VERSION:=2.0.16
|
||||
PKG_RELEASE:=2
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:=@KERNEL/linux/utils/kernel/kexec
|
||||
@@ -44,7 +44,7 @@ define Package/kexec
|
||||
$(call Package/kexec-tools/Default)
|
||||
TITLE:=Kernel boots kernel
|
||||
DEPENDS:=\
|
||||
@(armeb||arm||i386||x86_64||powerpc64||mipsel||mips) \
|
||||
@armeb||@arm||@i386||@x86_64||@powerpc64||@mipsel||@mips \
|
||||
+KEXEC_ZLIB:zlib +KEXEC_LZMA:liblzma @KERNEL_KEXEC
|
||||
endef
|
||||
|
||||
@@ -55,7 +55,7 @@ endef
|
||||
define Package/kdump
|
||||
$(call Package/kexec-tools/Default)
|
||||
TITLE:=Kernel crash analysis
|
||||
DEPENDS:=+kexec @(i386||x86_64||arm) @KERNEL_CRASH_DUMP
|
||||
DEPENDS:=+kexec @i386||@x86_64||@arm @KERNEL_CRASH_DUMP
|
||||
endef
|
||||
|
||||
define Package/kdump/description
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=41
|
||||
STOP=90
|
||||
STOP=98
|
||||
|
||||
EXTRA_COMMANDS="status"
|
||||
EXTRA_HELP=" status Print crashkernel status"
|
||||
|
||||
@@ -1,161 +0,0 @@
|
||||
#
|
||||
# Copyright 2019 NXP
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=tfa-layerscape
|
||||
PKG_VERSION:=lsdk-1903
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://source.codeaurora.org/external/qoriq/qoriq-components/atf
|
||||
PKG_SOURCE_VERSION:=7e34aebe658c7c3439d2d68b0ce6b9776e8e6996
|
||||
PKG_MIRROR_HASH:=9cf0bc32fa589a0ee7c48c87898679e645341f29da1253d0ba5d2e82c6ea074d
|
||||
PKG_BUILD_DEPENDS:=uboot-layerscape tfa-layerscape/host
|
||||
|
||||
include $(INCLUDE_DIR)/host-build.mk
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/tfa-layerscape/Config
|
||||
define Package/tfa-$(1)
|
||||
SECTION:=boot
|
||||
CATEGORY:=Boot Loaders
|
||||
TITLE:=$(2)
|
||||
DEPENDS:=@TARGET_layerscape_armv8_64b +layerscape-rcw-$(1)
|
||||
HIDDEN:=1
|
||||
VARIANT:=$(1)
|
||||
BIN_BL2:=$(3)
|
||||
BIN_FIP:=$(4)
|
||||
endef
|
||||
endef
|
||||
|
||||
define Package/tfa-layerscape/Install
|
||||
define Package/tfa-$(1)/install
|
||||
$(INSTALL_DIR) $(STAGING_DIR_IMAGE)
|
||||
$(CP) $(PKG_BUILD_DIR)/$(BIN_BL2) $(STAGING_DIR_IMAGE)/$(1)-bl2.pbl
|
||||
$(CP) $(PKG_BUILD_DIR)/$(BIN_FIP) $(STAGING_DIR_IMAGE)/$(1)-fip.bin
|
||||
endef
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
$(eval $(Package/tfa-layerscape/$(BUILD_VARIANT))) \
|
||||
$(MAKE) -C $(PKG_BUILD_DIR) CROSS_COMPILE=$(TARGET_CROSS) \
|
||||
fip pbl PLAT=$(PLAT) BOOT_MODE=$(BOOT_MODE) \
|
||||
RCW=$(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-rcw.bin \
|
||||
BL33=$(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-uboot.bin \
|
||||
FIPTOOL=$(STAGING_DIR_HOST)/bin/tfa-fiptool \
|
||||
CREATE_PBL=$(STAGING_DIR_HOST)/bin/tfa-create-pbl \
|
||||
BYTE_SWAP=$(STAGING_DIR_HOST)/bin/tfa-byte-swap
|
||||
endef
|
||||
|
||||
HOST_CFLAGS += -Wall -Werror -pedantic -std=c99
|
||||
define Host/Compile
|
||||
$(MAKE) -C \
|
||||
$(HOST_BUILD_DIR)/tools/fiptool \
|
||||
CFLAGS="$(HOST_CFLAGS)" \
|
||||
LDFLAGS="$(HOST_LDFLAGS)"
|
||||
$(MAKE) -C \
|
||||
$(HOST_BUILD_DIR)/plat/nxp/tools \
|
||||
CFLAGS="$(HOST_CFLAGS)"
|
||||
endef
|
||||
|
||||
define Host/Install
|
||||
$(INSTALL_BIN) $(HOST_BUILD_DIR)/tools/fiptool/fiptool $(STAGING_DIR_HOST)/bin/tfa-fiptool
|
||||
$(INSTALL_BIN) $(HOST_BUILD_DIR)/plat/nxp/tools/create_pbl $(STAGING_DIR_HOST)/bin/tfa-create-pbl
|
||||
$(INSTALL_BIN) $(HOST_BUILD_DIR)/plat/nxp/tools/byte_swap $(STAGING_DIR_HOST)/bin/tfa-byte-swap
|
||||
endef
|
||||
|
||||
define Package/tfa-layerscape/ls1012ardb
|
||||
TITLE:=NXP LS1012ARDB Trusted Firmware
|
||||
PLAT:=ls1012ardb
|
||||
BOOT_MODE:=qspi
|
||||
BIN_BL2:=build/ls1012ardb/release/bl2_qspi.pbl
|
||||
BIN_FIP:=build/ls1012ardb/release/fip.bin
|
||||
endef
|
||||
|
||||
define Package/tfa-layerscape/ls1012afrwy
|
||||
TITLE:=NXP LS1012AFRWY Trusted Firmware
|
||||
PLAT:=ls1012afrwy
|
||||
BOOT_MODE:=qspi
|
||||
BIN_BL2:=build/ls1012afrwy/release/bl2_qspi.pbl
|
||||
BIN_FIP:=build/ls1012afrwy/release/fip.bin
|
||||
endef
|
||||
|
||||
define Package/tfa-layerscape/ls1043ardb
|
||||
TITLE:=NXP LS1043ARDB Trusted Firmware
|
||||
PLAT:=ls1043ardb
|
||||
BOOT_MODE:=nor
|
||||
BIN_BL2:=build/ls1043ardb/release/bl2_nor.pbl
|
||||
BIN_FIP:=build/ls1043ardb/release/fip.bin
|
||||
endef
|
||||
|
||||
define Package/tfa-layerscape/ls1043ardb-sdboot
|
||||
TITLE:=NXP LS1043ARDB SD Boot Trusted Firmware
|
||||
PLAT:=ls1043ardb
|
||||
BOOT_MODE:=sd
|
||||
BIN_BL2:=build/ls1043ardb/release/bl2_sd.pbl
|
||||
BIN_FIP:=build/ls1043ardb/release/fip.bin
|
||||
endef
|
||||
|
||||
define Package/tfa-layerscape/ls1046ardb
|
||||
TITLE:=NXP LS1046ARDB Trusted Firmware
|
||||
PLAT:=ls1046ardb
|
||||
BOOT_MODE:=qspi
|
||||
BIN_BL2:=build/ls1046ardb/release/bl2_qspi.pbl
|
||||
BIN_FIP:=build/ls1046ardb/release/fip.bin
|
||||
endef
|
||||
|
||||
define Package/tfa-layerscape/ls1046ardb-sdboot
|
||||
TITLE:=NXP LS1046ARDB SD Boot Trusted Firmware
|
||||
PLAT:=ls1046ardb
|
||||
BOOT_MODE:=sd
|
||||
BIN_BL2:=build/ls1046ardb/release/bl2_sd.pbl
|
||||
BIN_FIP:=build/ls1046ardb/release/fip.bin
|
||||
endef
|
||||
|
||||
define Package/tfa-layerscape/ls1088ardb
|
||||
TITLE:=NXP LS1088ARDB Trusted Firmware
|
||||
PLAT:=ls1088ardb
|
||||
BOOT_MODE:=qspi
|
||||
BIN_BL2:=build/ls1088ardb/release/bl2_qspi.pbl
|
||||
BIN_FIP:=build/ls1088ardb/release/fip.bin
|
||||
endef
|
||||
|
||||
define Package/tfa-layerscape/ls1088ardb-sdboot
|
||||
TITLE:=NXP LS1088ARDB SD Boot Trusted Firmware
|
||||
PLAT:=ls1088ardb
|
||||
BOOT_MODE:=sd
|
||||
BIN_BL2:=build/ls1088ardb/release/bl2_sd.pbl
|
||||
BIN_FIP:=build/ls1088ardb/release/fip.bin
|
||||
endef
|
||||
|
||||
define Package/tfa-layerscape/ls2088ardb
|
||||
TITLE:=NXP LS2088ARDB Trusted Firmware
|
||||
PLAT:=ls2088ardb
|
||||
BOOT_MODE:=nor
|
||||
BIN_BL2:=build/ls2088ardb/release/bl2_nor.pbl
|
||||
BIN_FIP:=build/ls2088ardb/release/fip.bin
|
||||
endef
|
||||
|
||||
TFAS := \
|
||||
ls1012ardb \
|
||||
ls1012afrwy \
|
||||
ls1043ardb \
|
||||
ls1043ardb-sdboot \
|
||||
ls1046ardb \
|
||||
ls1046ardb-sdboot \
|
||||
ls1088ardb \
|
||||
ls1088ardb-sdboot \
|
||||
ls2088ardb
|
||||
|
||||
$(eval $(call HostBuild))
|
||||
$(foreach tfa,$(TFAS), \
|
||||
$(eval $(Package/tfa-layerscape/$(tfa))) \
|
||||
$(eval $(call Package/tfa-layerscape/Config,$(tfa),$(TITLE),$(BIN_BL2),$(BIN_FIP))) \
|
||||
$(eval $(call Package/tfa-layerscape/Install,$(tfa))) \
|
||||
$(eval $(call BuildPackage,tfa-$(tfa))) \
|
||||
)
|
||||
@@ -1,71 +0,0 @@
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -448,10 +448,6 @@ endif
|
||||
CRTTOOLPATH ?= tools/cert_create
|
||||
CRTTOOL ?= ${CRTTOOLPATH}/cert_create${BIN_EXT}
|
||||
|
||||
-# Variables for use with Firmware Image Package
|
||||
-FIPTOOLPATH ?= tools/fiptool
|
||||
-FIPTOOL ?= ${FIPTOOLPATH}/fiptool${BIN_EXT}
|
||||
-
|
||||
################################################################################
|
||||
# Include BL specific makefiles
|
||||
################################################################################
|
||||
@@ -661,14 +657,12 @@ endif
|
||||
clean:
|
||||
@echo " CLEAN"
|
||||
$(call SHELL_REMOVE_DIR,${BUILD_PLAT})
|
||||
- ${Q}${MAKE} --no-print-directory -C ${FIPTOOLPATH} clean
|
||||
${Q}${MAKE} PLAT=${PLAT} --no-print-directory -C ${CRTTOOLPATH} clean
|
||||
|
||||
realclean distclean:
|
||||
@echo " REALCLEAN"
|
||||
$(call SHELL_REMOVE_DIR,${BUILD_BASE})
|
||||
$(call SHELL_DELETE_ALL, ${CURDIR}/cscope.*)
|
||||
- ${Q}${MAKE} --no-print-directory -C ${FIPTOOLPATH} clean
|
||||
${Q}${MAKE} PLAT=${PLAT} --no-print-directory -C ${CRTTOOLPATH} clean
|
||||
|
||||
checkcodebase: locate-checkpatch
|
||||
@@ -717,7 +711,7 @@ certificates: ${CRT_DEPS} ${CRTTOOL}
|
||||
@${ECHO_BLANK_LINE}
|
||||
endif
|
||||
|
||||
-${BUILD_PLAT}/${FIP_NAME}: ${FIP_DEPS} ${FIPTOOL}
|
||||
+${BUILD_PLAT}/${FIP_NAME}: ${FIP_DEPS}
|
||||
${Q}${FIPTOOL} create ${FIP_ARGS} $@
|
||||
${Q}${FIPTOOL} info $@
|
||||
@${ECHO_BLANK_LINE}
|
||||
@@ -733,21 +727,16 @@ fwu_certificates: ${FWU_CRT_DEPS} ${CRTT
|
||||
@${ECHO_BLANK_LINE}
|
||||
endif
|
||||
|
||||
-${BUILD_PLAT}/${FWU_FIP_NAME}: ${FWU_FIP_DEPS} ${FIPTOOL}
|
||||
+${BUILD_PLAT}/${FWU_FIP_NAME}: ${FWU_FIP_DEPS}
|
||||
${Q}${FIPTOOL} create ${FWU_FIP_ARGS} $@
|
||||
${Q}${FIPTOOL} info $@
|
||||
@${ECHO_BLANK_LINE}
|
||||
@echo "Built $@ successfully"
|
||||
@${ECHO_BLANK_LINE}
|
||||
|
||||
-fiptool: ${FIPTOOL}
|
||||
fip: ${BUILD_PLAT}/${FIP_NAME}
|
||||
fwu_fip: ${BUILD_PLAT}/${FWU_FIP_NAME}
|
||||
|
||||
-.PHONY: ${FIPTOOL}
|
||||
-${FIPTOOL}:
|
||||
- ${Q}${MAKE} CPPFLAGS="-DVERSION='\"${VERSION_STRING}\"'" --no-print-directory -C ${FIPTOOLPATH}
|
||||
-
|
||||
cscope:
|
||||
@echo " CSCOPE"
|
||||
${Q}find ${CURDIR} -name "*.[chsS]" > cscope.files
|
||||
--- a/tools/fiptool/Makefile
|
||||
+++ b/tools/fiptool/Makefile
|
||||
@@ -37,7 +37,7 @@ all: ${PROJECT} fip_create
|
||||
|
||||
${PROJECT}: ${OBJECTS} Makefile
|
||||
@echo " LD $@"
|
||||
- ${Q}${HOSTCC} ${OBJECTS} -o $@ ${LDLIBS}
|
||||
+ ${Q}${HOSTCC} ${OBJECTS} -o $@ ${LDLIBS} $(LDFLAGS)
|
||||
@${ECHO_BLANK_LINE}
|
||||
@echo "Built $@ successfully"
|
||||
@${ECHO_BLANK_LINE}
|
||||
@@ -1,30 +0,0 @@
|
||||
From 65e9a722b44bf28b98fe25b3b174761b47ec7dbd Mon Sep 17 00:00:00 2001
|
||||
From: Biwen Li <biwen.li@nxp.com>
|
||||
Date: Mon, 1 Apr 2019 13:41:55 +0800
|
||||
Subject: [PATCH 2/3] plat/nxp/tools: fix a makefile bug that will use default
|
||||
implicit rules
|
||||
|
||||
The patch fix a makefile bug that will use default implicit rules,
|
||||
because do not have explicit rules for the destination files.
|
||||
|
||||
Signed-off-by: Biwen Li <biwen.li@nxp.com>
|
||||
---
|
||||
plat/nxp/tools/Makefile | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/plat/nxp/tools/Makefile b/plat/nxp/tools/Makefile
|
||||
index 2095294b..0082a0be 100644
|
||||
--- a/plat/nxp/tools/Makefile
|
||||
+++ b/plat/nxp/tools/Makefile
|
||||
@@ -53,7 +53,7 @@ ${PROJECT_2}: ${OBJECTS_2} Makefile
|
||||
@echo "Built $@ successfully"
|
||||
@${ECHO_BLANK_LINE}
|
||||
|
||||
-%.o: %.c %.h Makefile
|
||||
+%.o: %.c Makefile
|
||||
@echo " CC $<"
|
||||
${Q}${HOSTCC} -c ${CPPFLAGS} ${CFLAGS} ${INCLUDE_PATHS} $< -o $@
|
||||
|
||||
--
|
||||
2.17.1
|
||||
|
||||
@@ -1,60 +0,0 @@
|
||||
From 8a458876013991fe2f288bbe4694264b16c3b9e9 Mon Sep 17 00:00:00 2001
|
||||
From: Biwen Li <biwen.li@nxp.com>
|
||||
Date: Fri, 26 Jul 2019 15:44:10 +0800
|
||||
Subject: [PATCH 3/3] plat/nxp/tools: fix create_pbl and byte_swap host build
|
||||
|
||||
Not compile create_pbl and byte_swap in the process of cross compilation
|
||||
|
||||
Signed-off-by: Biwen Li <biwen.li@nxp.com>
|
||||
---
|
||||
plat/nxp/tools/pbl_ch2.mk | 3 ---
|
||||
plat/nxp/tools/pbl_ch3.mk | 5 -----
|
||||
2 files changed, 8 deletions(-)
|
||||
|
||||
diff --git a/plat/nxp/tools/pbl_ch2.mk b/plat/nxp/tools/pbl_ch2.mk
|
||||
index afa43520..ff624dd9 100644
|
||||
--- a/plat/nxp/tools/pbl_ch2.mk
|
||||
+++ b/plat/nxp/tools/pbl_ch2.mk
|
||||
@@ -20,8 +20,6 @@ ifeq ($(RCW),"")
|
||||
else
|
||||
# Generate header for bl2.bin
|
||||
$(Q)$(CST_DIR)/create_hdr_isbc --in ${BUILD_PLAT}/bl2.bin --out ${BUILD_PLAT}/hdr_bl2 ${BL2_INPUT_FILE}
|
||||
- # Compile create_pbl tool
|
||||
- ${Q}${MAKE} CPPFLAGS="-DVERSION='\"${VERSION_STRING}\"'" --no-print-directory -C ${PLAT_TOOL_PATH};\
|
||||
# Add bl2.bin to RCW
|
||||
${CREATE_PBL} -r ${RCW} -i ${BUILD_PLAT}/bl2.bin -b ${BOOT_MODE} -c ${SOC_NUM} -d ${BL2_BASE} -e ${BL2_BASE}\
|
||||
-o ${BUILD_PLAT}/bl2_${BOOT_MODE}.pbl ;\
|
||||
@@ -43,7 +41,6 @@ ifeq ($(RCW),"")
|
||||
${Q}echo "Platform ${PLAT} requires rcw file. Please set RCW to point to the right RCW file for boot mode ${BOOT_MODE}"
|
||||
else
|
||||
# -a option appends the image for Chassis 3 devices in case of non secure boot
|
||||
- ${Q}${MAKE} CPPFLAGS="-DVERSION='\"${VERSION_STRING}\"'" --no-print-directory -C ${PLAT_TOOL_PATH};
|
||||
${CREATE_PBL} -r ${RCW} -i ${BUILD_PLAT}/bl2.bin -b ${BOOT_MODE} -c ${SOC_NUM} -d ${BL2_BASE} -e ${BL2_BASE} \
|
||||
-o ${BUILD_PLAT}/bl2_${BOOT_MODE}.pbl ;
|
||||
# Swapping of RCW is required for QSPi Chassis 2 devices
|
||||
diff --git a/plat/nxp/tools/pbl_ch3.mk b/plat/nxp/tools/pbl_ch3.mk
|
||||
index 944ae3bb..9aa8f635 100644
|
||||
--- a/plat/nxp/tools/pbl_ch3.mk
|
||||
+++ b/plat/nxp/tools/pbl_ch3.mk
|
||||
@@ -27,9 +27,6 @@ else
|
||||
# Generate header for bl2.bin
|
||||
$(Q)$(CST_DIR)/create_hdr_isbc --in ${BUILD_PLAT}/bl2.bin --out ${BUILD_PLAT}/hdr_bl2 ${BL2_INPUT_FILE}
|
||||
|
||||
- # Compile create_pbl tool
|
||||
- ${Q}${MAKE} CPPFLAGS="-DVERSION='\"${VERSION_STRING}\"'" --no-print-directory -C ${PLAT_TOOL_PATH};\
|
||||
-
|
||||
# Add Block Copy command for bl2.bin to RCW
|
||||
${CREATE_PBL} -r ${RCW} -i ${BUILD_PLAT}/bl2.bin -b ${BOOT_MODE} -c ${SOC_NUM} -d ${BL2_BASE} -e ${BL2_BASE}\
|
||||
-o ${BUILD_PLAT}/bl2_${BOOT_MODE}.pbl -f ${BL2_SRC_OFFSET};\
|
||||
@@ -57,8 +54,6 @@ else #SECURE_BOOT
|
||||
ifeq ($(RCW),"")
|
||||
${Q}echo "Platform ${PLAT} requires rcw file. Please set RCW to point to the right RCW file for boot mode ${BOOT_MODE}"
|
||||
else
|
||||
- ${Q}${MAKE} CPPFLAGS="-DVERSION='\"${VERSION_STRING}\"'" --no-print-directory -C ${PLAT_TOOL_PATH};
|
||||
-
|
||||
# Add Block Copy command and populate boot loc ptrfor bl2.bin to RCW
|
||||
${CREATE_PBL} -r ${RCW} -i ${BUILD_PLAT}/bl2.bin -b ${BOOT_MODE} -c ${SOC_NUM} -d ${BL2_BASE} -e ${BL2_BASE} \
|
||||
-o ${BUILD_PLAT}/bl2_${BOOT_MODE}.pbl -f ${BL2_SRC_OFFSET};
|
||||
--
|
||||
2.17.1
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
--- a/include/compiler.h 2018-08-29
|
||||
+++ b/include/compiler.h 2018-08-29
|
||||
@@ -46,6 +46,10 @@ extern int errno;
|
||||
#ifdef __linux__
|
||||
# include <endian.h>
|
||||
# include <byteswap.h>
|
||||
+#ifndef __GLIBC__
|
||||
+typedef unsigned long ulong;
|
||||
+typedef unsigned int uint;
|
||||
+#endif
|
||||
#elif defined(__MACH__) || defined(__FreeBSD__)
|
||||
# include <machine/endian.h>
|
||||
typedef unsigned long ulong;
|
||||
@@ -26,13 +26,13 @@ endef
|
||||
|
||||
define U-Boot/at91sam9m10g45ek_nandflash
|
||||
NAME:=AT91SAM9M10G45-EK board (NandFlash)
|
||||
BUILD_SUBTARGET:=sam9x
|
||||
BUILD_SUBTARGET:=legacy
|
||||
BUILD_DEVICES:=at91sam9m10g45ek
|
||||
endef
|
||||
|
||||
define U-Boot/at91sam9x5ek_nandflash
|
||||
NAME:=AT91SAM9X5-EK board (NandFlash)
|
||||
BUILD_SUBTARGET:=sam9x
|
||||
BUILD_SUBTARGET:=legacy
|
||||
BUILD_DEVICES:=at91sam9g15ek at91sam9g25ek \
|
||||
at91sam9g35ek at91sam9x25ek \
|
||||
at91sam9x35ek
|
||||
@@ -40,67 +40,67 @@ endef
|
||||
|
||||
define U-Boot/sama5d3_xplained_nandflash
|
||||
NAME:=SAMA5D3 Xplained board (NandFlash)
|
||||
BUILD_SUBTARGET:=sama5
|
||||
BUILD_SUBTARGET:=sama5d3
|
||||
BUILD_DEVICES:=at91-sama5d3_xplained
|
||||
endef
|
||||
|
||||
define U-Boot/sama5d3_xplained_mmc
|
||||
NAME:=SAMA5D3 Xplained board (SDcard)
|
||||
BUILD_SUBTARGET:=sama5
|
||||
BUILD_SUBTARGET:=sama5d3
|
||||
BUILD_DEVICES:=at91-sama5d3_xplained
|
||||
endef
|
||||
|
||||
define U-Boot/sama5d2_xplained_spiflash
|
||||
NAME:=SAMA5D2 Xplained board (SPI Flash)
|
||||
BUILD_SUBTARGET:=sama5
|
||||
BUILD_SUBTARGET:=sama5d2
|
||||
BUILD_DEVICES:=at91-sama5d2_xplained
|
||||
endef
|
||||
|
||||
define U-Boot/sama5d2_xplained_mmc
|
||||
NAME:=SAMA5D2 Xplained board (SDcard/EMMC)
|
||||
BUILD_SUBTARGET:=sama5
|
||||
BUILD_SUBTARGET:=sama5d2
|
||||
BUILD_DEVICES:=at91-sama5d2_xplained
|
||||
endef
|
||||
|
||||
define U-Boot/sama5d4_xplained_spiflash
|
||||
NAME:=SAMA5D4 Xplained board (SPI Flash)
|
||||
BUILD_SUBTARGET:=sama5
|
||||
BUILD_SUBTARGET:=sama5d4
|
||||
BUILD_DEVICES:=at91-sama5d4_xplained
|
||||
endef
|
||||
|
||||
define U-Boot/sama5d4_xplained_mmc
|
||||
NAME:=SAMA5D4 Xplained board (SDcard)
|
||||
BUILD_SUBTARGET:=sama5
|
||||
BUILD_SUBTARGET:=sama5d4
|
||||
BUILD_DEVICES:=at91-sama5d4_xplained
|
||||
endef
|
||||
|
||||
define U-Boot/sama5d4_xplained_nandflash
|
||||
NAME:=SAMA5D4 Xplained board (NandFlash)
|
||||
BUILD_SUBTARGET:=sama5
|
||||
BUILD_SUBTARGET:=sama5d4
|
||||
BUILD_DEVICES:=at91-sama5d4_xplained
|
||||
endef
|
||||
|
||||
define U-Boot/sama5d27_som1_ek_mmc
|
||||
NAME:=SAMA5D27 SOM1 Ek (SDCard)
|
||||
BUILD_SUBTARGET:=sama5
|
||||
BUILD_SUBTARGET:=sama5d2
|
||||
BUILD_DEVICES:=at91-sama5d27_som1_ek
|
||||
endef
|
||||
|
||||
define U-Boot/sama5d27_som1_ek_spiflash
|
||||
NAME:=SAMA5D27 SOM1 Ek (QSPI Flash)
|
||||
BUILD_SUBTARGET:=sama5
|
||||
BUILD_SUBTARGET:=sama5d2
|
||||
BUILD_DEVICES:=at91-sama5d27_som1_ek
|
||||
endef
|
||||
|
||||
define U-Boot/sama5d2_ptc_ek_nandflash
|
||||
NAME:=SAMA5D2 PTC Ek (Nand Flash)
|
||||
BUILD_SUBTARGET:=sama5
|
||||
BUILD_SUBTARGET:=sama5d2
|
||||
BUILD_DEVICES:=at91-sama5d2_ptc_ek
|
||||
endef
|
||||
|
||||
define U-Boot/sama5d2_ptc_ek_mmc
|
||||
NAME:=SAMA5D2 PTC Ek (SDCard)
|
||||
BUILD_SUBTARGET:=sama5
|
||||
BUILD_SUBTARGET:=sama5d2
|
||||
BUILD_DEVICES:=at91-sama5d2_ptc_ek
|
||||
endef
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
|
||||
PKG_NAME:=uboot-envtools
|
||||
PKG_DISTNAME:=u-boot
|
||||
PKG_VERSION:=2018.03
|
||||
PKG_RELEASE:=3
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE:=$(PKG_DISTNAME)-$(PKG_VERSION).tar.xz
|
||||
@@ -51,11 +51,16 @@ define Build/Configure
|
||||
touch $(PKG_BUILD_DIR)/include/generated/autoconf.h
|
||||
endef
|
||||
|
||||
MAKE_FLAGS += \
|
||||
TARGET_CFLAGS="$(TARGET_CFLAGS)" \
|
||||
TARGET_LDFLAGS="$(TARGET_LDFLAGS)" \
|
||||
no-dot-config-targets=envtools \
|
||||
envtools
|
||||
TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include
|
||||
|
||||
define Build/Compile
|
||||
$(MAKE) -C $(PKG_BUILD_DIR) \
|
||||
CROSS_COMPILE="$(TARGET_CROSS)" \
|
||||
TARGET_CFLAGS="$(TARGET_CFLAGS)" \
|
||||
HOSTLDFLAGS= \
|
||||
no-dot-config-targets=envtools \
|
||||
envtools
|
||||
endef
|
||||
|
||||
define Package/uboot-envtools/conffiles
|
||||
/etc/config/ubootenv
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
[ -e /etc/config/ubootenv ] && exit 0
|
||||
|
||||
touch /etc/config/ubootenv
|
||||
|
||||
. /lib/uboot-envtools.sh
|
||||
. /lib/functions.sh
|
||||
|
||||
board=$(board_name)
|
||||
|
||||
case "$board" in
|
||||
meraki,mr24)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x4000" "0x4000" "4"
|
||||
ubootenv_add_uci_config "/dev/mtd2" "0x0" "0x4000" "0x4000" "4"
|
||||
;;
|
||||
meraki,mx60)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000" "4"
|
||||
;;
|
||||
netgear,wndap620|\
|
||||
netgear,wndap660)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x4000" "0x4000" "4"
|
||||
;;
|
||||
esac
|
||||
|
||||
config_load ubootenv
|
||||
config_foreach ubootenv_add_app_config ubootenv
|
||||
|
||||
exit 0
|
||||
@@ -28,7 +28,6 @@ cpe830|\
|
||||
cpe870|\
|
||||
cr3000|\
|
||||
cr5000|\
|
||||
dw33d|\
|
||||
e1700ac-v2|\
|
||||
e600g-v2|\
|
||||
e600gac-v2|\
|
||||
@@ -58,10 +57,7 @@ sr3200|\
|
||||
t830|\
|
||||
tube2h|\
|
||||
wam250|\
|
||||
wnr1000-v2|\
|
||||
wnr2000-v3|\
|
||||
wnr2200|\
|
||||
wnr612-v2|\
|
||||
wndr3700|\
|
||||
xd3200)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000"
|
||||
;;
|
||||
@@ -85,11 +81,6 @@ dr342|\
|
||||
dr531)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0xf800" "0x10000"
|
||||
;;
|
||||
gl-ar150|\
|
||||
gl-domino|\
|
||||
gl-mifi)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x8000" "0x10000"
|
||||
;;
|
||||
rambutan)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x100000" "0x20000" "0x20000"
|
||||
@@ -100,12 +91,6 @@ qihoo-c301)
|
||||
wi2a-ac200i)
|
||||
ubootenv_add_uci_config "/dev/mtd4" "0x0" "0x8000" "0x10000"
|
||||
;;
|
||||
wndr3700)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x10000"
|
||||
;;
|
||||
wndr4300)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x40000" "0x20000"
|
||||
;;
|
||||
esac
|
||||
|
||||
config_load ubootenv
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (C) 2011-2014 OpenWrt.org
|
||||
#
|
||||
|
||||
[ -e /etc/config/ubootenv ] && exit 0
|
||||
|
||||
touch /etc/config/ubootenv
|
||||
|
||||
. /lib/uboot-envtools.sh
|
||||
. /lib/functions.sh
|
||||
|
||||
board=$(board_name)
|
||||
|
||||
case "$board" in
|
||||
buffalo,wzr-hp-ag300h)
|
||||
ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x10000" "0x10000"
|
||||
;;
|
||||
buffalo,bhr-4grv2|\
|
||||
engenius,ecb1750|\
|
||||
glinet,gl-ar300m-nand|\
|
||||
glinet,gl-ar300m-nor|\
|
||||
librerouter,librerouter-v1|\
|
||||
netgear,ex6400|\
|
||||
netgear,ex7300|\
|
||||
netgear,wnr612-v2|\
|
||||
ocedo,koala|\
|
||||
ocedo,raccoon|\
|
||||
openmesh,om5p-ac-v2|\
|
||||
yuncore,a770|\
|
||||
yuncore,a782|\
|
||||
yuncore,xd4200)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000"
|
||||
;;
|
||||
glinet,gl-ar150)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x8000" "0x10000"
|
||||
;;
|
||||
netgear,wndr3700)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x10000"
|
||||
;;
|
||||
esac
|
||||
|
||||
config_load ubootenv
|
||||
config_foreach ubootenv_add_app_config ubootenv
|
||||
|
||||
exit 0
|
||||
@@ -7,16 +7,12 @@
|
||||
|
||||
touch /etc/config/ubootenv
|
||||
|
||||
. /lib/imx6.sh
|
||||
. /lib/uboot-envtools.sh
|
||||
. /lib/functions.sh
|
||||
|
||||
board=$(board_name)
|
||||
|
||||
case "$board" in
|
||||
apalis*)
|
||||
ubootenv_add_uci_config $(bootdev_from_uuid)boot0 -0x2200 0x2000 0x200 10
|
||||
;;
|
||||
*gw5*)
|
||||
if [ -c /dev/mtd1 ]; then
|
||||
# board boots from NAND
|
||||
|
||||
@@ -31,21 +31,10 @@ ubootenv_mtdinfo () {
|
||||
}
|
||||
|
||||
case "$board" in
|
||||
alfa-network,ap120c-ac |\
|
||||
glinet,gl-b1300 |\
|
||||
openmesh,a42 |\
|
||||
openmesh,a62)
|
||||
ubootenv_add_uci_config "/dev/mtd5" "0x0" "0x10000" "0x10000"
|
||||
;;
|
||||
linksys,ea6350v3)
|
||||
ubootenv_add_uci_config "/dev/mtd7" "0x0" "0x20000" "0x20000"
|
||||
;;
|
||||
linksys,ea8300)
|
||||
ubootenv_add_uci_config "/dev/mtd7" "0x0" "0x40000" "0x20000"
|
||||
;;
|
||||
zyxel,nbg6617)
|
||||
ubootenv_add_uci_config "/dev/mtd6" "0x0" "0x10000" "0x10000"
|
||||
;;
|
||||
esac
|
||||
|
||||
config_load ubootenv
|
||||
|
||||
@@ -34,9 +34,6 @@ case "$board" in
|
||||
linksys,ea8500)
|
||||
ubootenv_add_uci_config "/dev/mtd10" "0x0" "0x20000" "0x20000"
|
||||
;;
|
||||
netgear,r7800)
|
||||
ubootenv_add_uci_config "/dev/mtd2" "0x0" "0x040000" "0x20000"
|
||||
;;
|
||||
qcom,ipq8064-ap148 |\
|
||||
qcom,ipq8064-db149)
|
||||
ubootenv_add_uci_config $(ubootenv_mtdinfo)
|
||||
|
||||
@@ -15,7 +15,6 @@ board=$(board_name)
|
||||
case "$board" in
|
||||
cloudengines,pogoe02|\
|
||||
cloudengines,pogoplugv4|\
|
||||
iom,ix2-200|\
|
||||
linksys,viper|\
|
||||
raidsonic,ib-nas62x0|\
|
||||
seagate,dockstar|\
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user