mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-04-14 11:13:29 +00:00
Sync to snapshot kernel 5.4 version
This commit is contained in:
parent
cc2ddb220a
commit
33abeff31c
24
Makefile
24
Makefile
@ -18,6 +18,7 @@ $(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)
|
||||
@ -59,6 +60,7 @@ clean: FORCE
|
||||
dirclean: clean
|
||||
rm -rf $(STAGING_DIR_HOST) $(STAGING_DIR_HOSTPKG) $(TOOLCHAIN_DIR) $(BUILD_DIR_BASE)/host $(BUILD_DIR_BASE)/hostpkg $(BUILD_DIR_TOOLCHAIN)
|
||||
rm -rf $(TMP_DIR)
|
||||
$(MAKE) -C $(TOPDIR)/scripts/config clean
|
||||
|
||||
ifndef DUMP_TARGET_DB
|
||||
$(BUILD_DIR)/.prepared: Makefile
|
||||
@ -86,18 +88,36 @@ prereq: $(target/stamp-prereq) tmp/.prereq_packages
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
$(BIN_DIR)/profiles.json: FORCE
|
||||
$(if $(CONFIG_JSON_OVERVIEW_IMAGE_INFO), \
|
||||
WORK_DIR=$(BUILD_DIR)/json_info_files \
|
||||
$(SCRIPT_DIR)/json_overview_image_info.py $@ \
|
||||
)
|
||||
|
||||
json_overview_image_info: $(BIN_DIR)/profiles.json
|
||||
|
||||
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
|
||||
|
||||
diffconfig: FORCE
|
||||
mkdir -p $(BIN_DIR)
|
||||
$(SCRIPT_DIR)/diffconfig.sh > $(BIN_DIR)/config.seed
|
||||
$(SCRIPT_DIR)/diffconfig.sh > $(BIN_DIR)/config.buildinfo
|
||||
|
||||
buildinfo: FORCE
|
||||
$(_SINGLE)$(SUBMAKE) -r diffconfig buildversion feedsversion
|
||||
|
||||
prepare: .config $(tools/stamp-compile) $(toolchain/stamp-compile)
|
||||
$(_SINGLE)$(SUBMAKE) -r diffconfig
|
||||
$(_SINGLE)$(SUBMAKE) -r buildinfo
|
||||
|
||||
world: prepare $(target/stamp-compile) $(package/stamp-compile) $(package/stamp-install) $(target/stamp-install) FORCE
|
||||
$(_SINGLE)$(SUBMAKE) -r package/index
|
||||
$(_SINGLE)$(SUBMAKE) -r json_overview_image_info
|
||||
$(_SINGLE)$(SUBMAKE) -r checksum
|
||||
|
||||
.PHONY: clean dirclean prereq prepare world package/symlinks package/symlinks-install package/symlinks-clean
|
||||
|
@ -7,12 +7,13 @@
|
||||
|
||||
menu "Global build settings"
|
||||
|
||||
config JSON_ADD_IMAGE_INFO
|
||||
bool "Create JSON info files per build image"
|
||||
config JSON_OVERVIEW_IMAGE_INFO
|
||||
bool "Create JSON info file overview per target"
|
||||
default BUILDBOT
|
||||
help
|
||||
The JSON info files contain information about the device and
|
||||
build images, stored next to the firmware images.
|
||||
Create a JSON info file called profiles.json in the target
|
||||
directory containing machine readable list of built profiles
|
||||
and resulting images.
|
||||
|
||||
config ALL_NONSHARED
|
||||
bool "Select all target specific packages by default"
|
||||
@ -39,7 +40,7 @@ menu "Global build settings"
|
||||
|
||||
config SIGNED_PACKAGES
|
||||
bool "Cryptographically signed package lists"
|
||||
default n
|
||||
default y
|
||||
|
||||
config SIGNATURE_CHECK
|
||||
bool "Enable signature checking in opkg"
|
||||
@ -47,12 +48,21 @@ menu "Global build settings"
|
||||
|
||||
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
|
||||
|
||||
config BUILD_PATENTED
|
||||
default y
|
||||
default n
|
||||
bool "Compile with support for patented functionality"
|
||||
help
|
||||
When this option is disabled, software which provides patented functionality
|
||||
@ -79,11 +89,19 @@ 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.seed will be stored in /etc/build.config of firmware.
|
||||
If enabled, buildinfo files will be stored in /etc/build.* of firmware.
|
||||
|
||||
config COLLECT_KERNEL_DEBUG
|
||||
bool
|
||||
@ -182,6 +200,7 @@ menu "Global build settings"
|
||||
|
||||
config USE_LIBCXX
|
||||
bool "libc++"
|
||||
depends on !USE_UCLIBC
|
||||
|
||||
config USE_LIBSTDCXX
|
||||
bool "libstdc++"
|
||||
@ -230,7 +249,6 @@ menu "Global build settings"
|
||||
|
||||
choice
|
||||
prompt "User space Stack-Smashing Protection"
|
||||
depends on USE_MUSL
|
||||
default PKG_CC_STACKPROTECTOR_REGULAR
|
||||
help
|
||||
Enable GCC Stack Smashing Protection (SSP) for userspace applications
|
||||
@ -238,19 +256,15 @@ menu "Global build settings"
|
||||
bool "None"
|
||||
config PKG_CC_STACKPROTECTOR_REGULAR
|
||||
bool "Regular"
|
||||
select GCC_LIBSSP if !USE_MUSL
|
||||
depends on KERNEL_CC_STACKPROTECTOR_REGULAR
|
||||
config PKG_CC_STACKPROTECTOR_STRONG
|
||||
bool "Strong"
|
||||
select GCC_LIBSSP if !USE_MUSL
|
||||
depends on !GCC_VERSION_4_8
|
||||
depends on KERNEL_CC_STACKPROTECTOR_STRONG
|
||||
endchoice
|
||||
|
||||
choice
|
||||
prompt "Kernel space Stack-Smashing Protection"
|
||||
default KERNEL_CC_STACKPROTECTOR_REGULAR
|
||||
depends on USE_MUSL || !(x86_64 || i386)
|
||||
help
|
||||
Enable GCC Stack-Smashing Protection (SSP) for the kernel
|
||||
config KERNEL_CC_STACKPROTECTOR_NONE
|
||||
@ -258,7 +272,6 @@ menu "Global build settings"
|
||||
config KERNEL_CC_STACKPROTECTOR_REGULAR
|
||||
bool "Regular"
|
||||
config KERNEL_CC_STACKPROTECTOR_STRONG
|
||||
depends on !GCC_VERSION_4_8
|
||||
bool "Strong"
|
||||
endchoice
|
||||
|
||||
|
@ -105,6 +105,13 @@ menuconfig DEVEL
|
||||
help
|
||||
If enabled, log files will be written to the ./log directory.
|
||||
|
||||
config BUILD_LOG_DIR
|
||||
string "Log folder" if DEVEL
|
||||
default ""
|
||||
help
|
||||
Store build logs in this directory.
|
||||
If not set, uses './logs'
|
||||
|
||||
config SRC_TREE_OVERRIDE
|
||||
bool "Enable package source tree override" if DEVEL
|
||||
help
|
||||
|
@ -16,7 +16,7 @@ menu "Target Images"
|
||||
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_ipq40xx
|
||||
default TARGET_INITRAMFS_COMPRESSION_LZMA if TARGET_ath79_mikrotik
|
||||
default TARGET_INITRAMFS_COMPRESSION_LZMA if TARGET_lantiq
|
||||
default TARGET_INITRAMFS_COMPRESSION_LZMA if TARGET_mpc85xx
|
||||
default TARGET_INITRAMFS_COMPRESSION_LZMA if TARGET_ramips
|
||||
@ -79,7 +79,7 @@ menu "Target Images"
|
||||
|
||||
menuconfig TARGET_ROOTFS_EXT4FS
|
||||
bool "ext4"
|
||||
default n
|
||||
default y if USES_EXT4
|
||||
help
|
||||
Build an ext4 root filesystem.
|
||||
|
||||
@ -121,13 +121,6 @@ menu "Target Images"
|
||||
help
|
||||
Create an ext4 filesystem with a journal.
|
||||
|
||||
config TARGET_ROOTFS_ISO
|
||||
bool "iso"
|
||||
default n
|
||||
depends on TARGET_x86_generic
|
||||
help
|
||||
Create a bootable ISO image.
|
||||
|
||||
config TARGET_ROOTFS_JFFS2
|
||||
bool "jffs2"
|
||||
depends on USES_JFFS2
|
||||
@ -192,32 +185,32 @@ menu "Target Images"
|
||||
config GRUB_IMAGES
|
||||
bool "Build GRUB images (Linux x86 or x86_64 host only)"
|
||||
depends on TARGET_x86
|
||||
depends on TARGET_ROOTFS_EXT4FS || TARGET_ROOTFS_ISO || TARGET_ROOTFS_JFFS2 || TARGET_ROOTFS_SQUASHFS
|
||||
depends on TARGET_ROOTFS_EXT4FS || TARGET_ROOTFS_JFFS2 || TARGET_ROOTFS_SQUASHFS
|
||||
select PACKAGE_grub2
|
||||
default y
|
||||
|
||||
config EFI_IMAGES
|
||||
bool "Build EFI GRUB images (Linux x86 or x86_64 host only)"
|
||||
config GRUB_EFI_IMAGES
|
||||
bool "Build GRUB EFI images (Linux x86 or x86_64 host only)"
|
||||
depends on TARGET_x86
|
||||
depends on TARGET_ROOTFS_EXT4FS || TARGET_ROOTFS_ISO || TARGET_ROOTFS_JFFS2 || TARGET_ROOTFS_SQUASHFS
|
||||
depends on TARGET_ROOTFS_EXT4FS || TARGET_ROOTFS_JFFS2 || TARGET_ROOTFS_SQUASHFS
|
||||
select PACKAGE_grub2
|
||||
select PACKAGE_grub2-efi
|
||||
select PACKAGE_kmod-fs-vfat
|
||||
default y
|
||||
|
||||
config GRUB_CONSOLE
|
||||
bool "Use Console Terminal (in addition to Serial)"
|
||||
depends on GRUB_IMAGES || EFI_IMAGES
|
||||
default n
|
||||
depends on GRUB_IMAGES || GRUB_EFI_IMAGES
|
||||
default y
|
||||
|
||||
config GRUB_SERIAL
|
||||
string "Serial port device"
|
||||
depends on GRUB_IMAGES || EFI_IMAGES
|
||||
default "hvc0" if TARGET_x86_xen_domu
|
||||
default "ttyS0" if ! TARGET_x86_xen_domu
|
||||
depends on GRUB_IMAGES || GRUB_EFI_IMAGES
|
||||
default "ttyS0"
|
||||
|
||||
config GRUB_BAUDRATE
|
||||
int "Serial port baud rate"
|
||||
depends on GRUB_IMAGES || EFI_IMAGES
|
||||
depends on GRUB_IMAGES || GRUB_EFI_IMAGES
|
||||
default 38400 if TARGET_x86_generic
|
||||
default 115200
|
||||
|
||||
@ -228,65 +221,46 @@ menu "Target Images"
|
||||
|
||||
config GRUB_BOOTOPTS
|
||||
string "Extra kernel boot options"
|
||||
depends on GRUB_IMAGES || EFI_IMAGES
|
||||
default "xencons=hvc" if TARGET_x86_xen_domu
|
||||
depends on GRUB_IMAGES || GRUB_EFI_IMAGES
|
||||
help
|
||||
If you don't know, just leave it blank.
|
||||
|
||||
config GRUB_TIMEOUT
|
||||
string "Seconds to wait before booting the default entry"
|
||||
depends on GRUB_IMAGES || EFI_IMAGES
|
||||
default "0"
|
||||
depends on GRUB_IMAGES || GRUB_EFI_IMAGES
|
||||
default "5"
|
||||
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 || EFI_IMAGES
|
||||
depends on GRUB_IMAGES || GRUB_EFI_IMAGES
|
||||
default "OpenWrt"
|
||||
help
|
||||
This is the title of the GRUB menu entry.
|
||||
If unspecified, it defaults to OpenWrt.
|
||||
|
||||
config ISO_IMAGES
|
||||
bool "Build LiveCD image (ISO)"
|
||||
depends on TARGET_x86
|
||||
depends on GRUB_IMAGES || GRUB_EFI_IMAGES
|
||||
|
||||
config VDI_IMAGES
|
||||
bool "Build VirtualBox image files (VDI)"
|
||||
depends on TARGET_x86 || TARGET_x86_64
|
||||
select GRUB_IMAGES
|
||||
select TARGET_IMAGES_PAD
|
||||
depends on TARGET_x86
|
||||
depends on GRUB_IMAGES || GRUB_EFI_IMAGES
|
||||
select PACKAGE_kmod-e1000
|
||||
|
||||
config VMDK_IMAGES
|
||||
bool "Build VMware image files (VMDK)"
|
||||
depends on TARGET_x86 || TARGET_x86_64
|
||||
select GRUB_IMAGES
|
||||
select TARGET_IMAGES_PAD
|
||||
select PACKAGE_kmod-e1000
|
||||
depends on TARGET_x86
|
||||
depends on GRUB_IMAGES || GRUB_EFI_IMAGES
|
||||
default y
|
||||
|
||||
config VHD_IMAGES
|
||||
bool "Build Hyper-V image files (VHD)"
|
||||
depends on TARGET_x86 || TARGET_x86_64
|
||||
depends on GRUB_IMAGES || EFI_IMAGES
|
||||
select TARGET_IMAGES_PAD
|
||||
select PACKAGE_kmod-tulip
|
||||
default n
|
||||
|
||||
config QCOW2_IMAGES
|
||||
bool "Build PVE/KVM image files (QCOW2)"
|
||||
depends on TARGET_x86 || TARGET_x86_64
|
||||
depends on GRUB_IMAGES || EFI_IMAGES
|
||||
select TARGET_IMAGES_PAD
|
||||
select PACKAGE_kmod-e1000
|
||||
default n
|
||||
|
||||
config TARGET_IMAGES_PAD
|
||||
bool "Pad images to filesystem size (for JFFS2)"
|
||||
depends on GRUB_IMAGES || EFI_IMAGES
|
||||
default y
|
||||
|
||||
config TARGET_IMAGES_GZIP
|
||||
bool "GZip images"
|
||||
depends on TARGET_IMAGES_PAD || TARGET_ROOTFS_EXT4FS || TARGET_x86
|
||||
depends on TARGET_ROOTFS_EXT4FS || TARGET_x86 || TARGET_armvirt || TARGET_malta
|
||||
default n
|
||||
|
||||
comment "Image Options"
|
||||
@ -295,21 +269,21 @@ menu "Target Images"
|
||||
|
||||
config TARGET_KERNEL_PARTSIZE
|
||||
int "Kernel partition size (in MB)"
|
||||
depends on GRUB_IMAGES || EFI_IMAGES || USES_BOOT_PART
|
||||
depends on USES_BOOT_PART
|
||||
default 8 if TARGET_apm821xx_sata
|
||||
default 64 if TARGET_bcm27xx
|
||||
default 16
|
||||
|
||||
config TARGET_ROOTFS_PARTSIZE
|
||||
int "Root filesystem partition size (in MB)"
|
||||
depends on GRUB_IMAGES || EFI_IMAGES || USES_ROOTFS_PART || TARGET_ROOTFS_EXT4FS || TARGET_mvebu || TARGET_rb532 || TARGET_sunxi || TARGET_uml
|
||||
depends on USES_ROOTFS_PART || TARGET_ROOTFS_EXT4FS || TARGET_omap || TARGET_rb532 || TARGET_sunxi || TARGET_uml
|
||||
default 160
|
||||
help
|
||||
Select the root filesystem partition size.
|
||||
|
||||
config TARGET_ROOTFS_PARTNAME
|
||||
string "Root partition on target device"
|
||||
depends on GRUB_IMAGES || EFI_IMAGES
|
||||
depends on GRUB_IMAGES || GRUB_EFI_IMAGES
|
||||
help
|
||||
Override the root partition on the final device. If left empty,
|
||||
it will be mounted by PARTUUID which makes the kernel find the
|
||||
|
@ -44,11 +44,16 @@ config KERNEL_DEBUG_FS
|
||||
write to these files. Many common debugging facilities, such as
|
||||
ftrace, require the existence of debugfs.
|
||||
|
||||
# remove KERNEL_MIPS_FPU_EMULATOR after kernel 4.14 and 4.14 are gone
|
||||
config KERNEL_MIPS_FPU_EMULATOR
|
||||
bool "Compile the kernel with MIPS FPU Emulator"
|
||||
default y
|
||||
depends on (mips || mipsel || mips64 || mips64el)
|
||||
|
||||
config KERNEL_MIPS_FP_SUPPORT
|
||||
bool
|
||||
default y if KERNEL_MIPS_FPU_EMULATOR
|
||||
|
||||
config KERNEL_ARM_PMU
|
||||
bool
|
||||
default n
|
||||
@ -85,6 +90,126 @@ config KERNEL_PROFILING
|
||||
Enable the extended profiling support mechanisms used by profilers such
|
||||
as OProfile.
|
||||
|
||||
config KERNEL_UBSAN
|
||||
bool "Compile the kernel with undefined behaviour sanity checker"
|
||||
help
|
||||
This option enables undefined behaviour sanity checker
|
||||
Compile-time instrumentation is used to detect various undefined
|
||||
behaviours in runtime. Various types of checks may be enabled
|
||||
via boot parameter ubsan_handle
|
||||
(see: Documentation/dev-tools/ubsan.rst).
|
||||
|
||||
config KERNEL_UBSAN_SANITIZE_ALL
|
||||
bool "Enable instrumentation for the entire kernel"
|
||||
depends on KERNEL_UBSAN
|
||||
default y
|
||||
help
|
||||
This option activates instrumentation for the entire kernel.
|
||||
If you don't enable this option, you have to explicitly specify
|
||||
UBSAN_SANITIZE := y for the files/directories you want to check for UB.
|
||||
Enabling this option will get kernel image size increased
|
||||
significantly.
|
||||
|
||||
config KERNEL_UBSAN_ALIGNMENT
|
||||
bool "Enable checking of pointers alignment"
|
||||
depends on KERNEL_UBSAN
|
||||
help
|
||||
This option enables detection of unaligned memory accesses.
|
||||
Enabling this option on architectures that support unaligned
|
||||
accesses may produce a lot of false positives.
|
||||
|
||||
config KERNEL_UBSAN_NULL
|
||||
bool "Enable checking of null pointers"
|
||||
depends on KERNEL_UBSAN
|
||||
help
|
||||
This option enables detection of memory accesses via a
|
||||
null pointer.
|
||||
|
||||
config KERNEL_KASAN
|
||||
bool "Compile the kernel with KASan: runtime memory debugger"
|
||||
select KERNEL_SLUB_DEBUG
|
||||
depends on (x86_64 || aarch64)
|
||||
help
|
||||
Enables kernel address sanitizer - runtime memory debugger,
|
||||
designed to find out-of-bounds accesses and use-after-free bugs.
|
||||
This is strictly a debugging feature and it requires a gcc version
|
||||
of 4.9.2 or later. Detection of out of bounds accesses to stack or
|
||||
global variables requires gcc 5.0 or later.
|
||||
This feature consumes about 1/8 of available memory and brings about
|
||||
~x3 performance slowdown.
|
||||
For better error detection enable CONFIG_STACKTRACE.
|
||||
Currently CONFIG_KASAN doesn't work with CONFIG_DEBUG_SLAB
|
||||
(the resulting kernel does not boot).
|
||||
|
||||
config KERNEL_KASAN_EXTRA
|
||||
bool "KAsan: extra checks"
|
||||
depends on KERNEL_KASAN && KERNEL_DEBUG_KERNEL
|
||||
help
|
||||
This enables further checks in the kernel address sanitizer, for now
|
||||
it only includes the address-use-after-scope check that can lead
|
||||
to excessive kernel stack usage, frame size warnings and longer
|
||||
compile time.
|
||||
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81715 has more
|
||||
|
||||
|
||||
choice
|
||||
prompt "Instrumentation type"
|
||||
depends on KERNEL_KASAN
|
||||
default KERNEL_KASAN_OUTLINE
|
||||
|
||||
config KERNEL_KASAN_OUTLINE
|
||||
bool "Outline instrumentation"
|
||||
help
|
||||
Before every memory access compiler insert function call
|
||||
__asan_load*/__asan_store*. These functions performs check
|
||||
of shadow memory. This is slower than inline instrumentation,
|
||||
however it doesn't bloat size of kernel's .text section so
|
||||
much as inline does.
|
||||
|
||||
config KERNEL_KASAN_INLINE
|
||||
bool "Inline instrumentation"
|
||||
help
|
||||
Compiler directly inserts code checking shadow memory before
|
||||
memory accesses. This is faster than outline (in some workloads
|
||||
it gives about x2 boost over outline instrumentation), but
|
||||
make kernel's .text size much bigger.
|
||||
This requires a gcc version of 5.0 or later.
|
||||
|
||||
endchoice
|
||||
|
||||
config KERNEL_KCOV
|
||||
bool "Compile the kernel with code coverage for fuzzing"
|
||||
select KERNEL_DEBUG_FS
|
||||
help
|
||||
KCOV exposes kernel code coverage information in a form suitable
|
||||
for coverage-guided fuzzing (randomized testing).
|
||||
|
||||
If RANDOMIZE_BASE is enabled, PC values will not be stable across
|
||||
different machines and across reboots. If you need stable PC values,
|
||||
disable RANDOMIZE_BASE.
|
||||
|
||||
For more details, see Documentation/kcov.txt.
|
||||
|
||||
config KERNEL_KCOV_ENABLE_COMPARISONS
|
||||
bool "Enable comparison operands collection by KCOV"
|
||||
depends on KERNEL_KCOV
|
||||
help
|
||||
KCOV also exposes operands of every comparison in the instrumented
|
||||
code along with operand sizes and PCs of the comparison instructions.
|
||||
These operands can be used by fuzzing engines to improve the quality
|
||||
of fuzzing coverage.
|
||||
|
||||
config KERNEL_KCOV_INSTRUMENT_ALL
|
||||
bool "Instrument all code by default"
|
||||
depends on KERNEL_KCOV
|
||||
default y if KERNEL_KCOV
|
||||
help
|
||||
If you are doing generic system call fuzzing (like e.g. syzkaller),
|
||||
then you will want to instrument the whole kernel and you should
|
||||
say y here. If you are doing more targeted fuzzing (like e.g.
|
||||
filesystem fuzzing with AFL) then you will want to enable coverage
|
||||
for more specific subsets of files, and should say n here.
|
||||
|
||||
config KERNEL_TASKSTATS
|
||||
bool "Compile the kernel with task resource/io statistics and accounting"
|
||||
default n
|
||||
@ -244,21 +369,6 @@ config KERNEL_DEBUG_GPIO
|
||||
bool "Compile the kernel with gpio debugging"
|
||||
select KERNEL_DEBUG_KERNEL
|
||||
|
||||
choice
|
||||
prompt "Algorithms enabled for QCE acceleration"
|
||||
default KERNEL_CRYPTO_DEV_QCE_ENABLE_ALL
|
||||
depends on TARGET_ipq40xx
|
||||
|
||||
config KERNEL_CRYPTO_DEV_QCE_ENABLE_ALL
|
||||
bool "All supported algorithms"
|
||||
|
||||
config KERNEL_CRYPTO_DEV_QCE_ENABLE_BLKCIPHER
|
||||
bool "Block ciphers only"
|
||||
|
||||
config KERNEL_CRYPTO_DEV_QCE_ENABLE_SHA
|
||||
bool "Hash/HMAC only"
|
||||
endchoice
|
||||
|
||||
config KERNEL_COREDUMP
|
||||
bool
|
||||
|
||||
@ -272,6 +382,74 @@ config KERNEL_PROVE_LOCKING
|
||||
select KERNEL_DEBUG_KERNEL
|
||||
default n
|
||||
|
||||
config KERNEL_LOCKUP_DETECTOR
|
||||
bool "Compile the kernel with detect Hard and Soft Lockups"
|
||||
depends on KERNEL_DEBUG_KERNEL
|
||||
help
|
||||
Say Y here to enable the kernel to act as a watchdog to detect
|
||||
hard and soft lockups.
|
||||
|
||||
Softlockups are bugs that cause the kernel to loop in kernel
|
||||
mode for more than 20 seconds, without giving other tasks a
|
||||
chance to run. The current stack trace is displayed upon
|
||||
detection and the system will stay locked up.
|
||||
|
||||
Hardlockups are bugs that cause the CPU to loop in kernel mode
|
||||
for more than 10 seconds, without letting other interrupts have a
|
||||
chance to run. The current stack trace is displayed upon detection
|
||||
and the system will stay locked up.
|
||||
|
||||
The overhead should be minimal. A periodic hrtimer runs to
|
||||
generate interrupts and kick the watchdog task every 4 seconds.
|
||||
An NMI is generated every 10 seconds or so to check for hardlockups.
|
||||
|
||||
The frequency of hrtimer and NMI events and the soft and hard lockup
|
||||
thresholds can be controlled through the sysctl watchdog_thresh.
|
||||
|
||||
config KERNEL_DETECT_HUNG_TASK
|
||||
bool "Compile the kernel with detect Hung Tasks"
|
||||
depends on KERNEL_DEBUG_KERNEL
|
||||
default KERNEL_LOCKUP_DETECTOR
|
||||
help
|
||||
Say Y here to enable the kernel to detect "hung tasks",
|
||||
which are bugs that cause the task to be stuck in
|
||||
uninterruptible "D" state indefinitely.
|
||||
|
||||
When a hung task is detected, the kernel will print the
|
||||
current stack trace (which you should report), but the
|
||||
task will stay in uninterruptible state. If lockdep is
|
||||
enabled then all held locks will also be reported. This
|
||||
feature has negligible overhead.
|
||||
|
||||
config KERNEL_WQ_WATCHDOG
|
||||
bool "Compile the kernel with detect Workqueue Stalls"
|
||||
depends on KERNEL_DEBUG_KERNEL
|
||||
help
|
||||
Say Y here to enable stall detection on workqueues. If a
|
||||
worker pool doesn't make forward progress on a pending work
|
||||
item for over a given amount of time, 30s by default, a
|
||||
warning message is printed along with dump of workqueue
|
||||
state. This can be configured through kernel parameter
|
||||
"workqueue.watchdog_thresh" and its sysfs counterpart.
|
||||
|
||||
config KERNEL_DEBUG_ATOMIC_SLEEP
|
||||
bool "Compile the kernel with sleep inside atomic section checking"
|
||||
depends on KERNEL_DEBUG_KERNEL
|
||||
help
|
||||
If you say Y here, various routines which may sleep will become very
|
||||
noisy if they are called inside atomic sections: when a spinlock is
|
||||
held, inside an rcu read side critical section, inside preempt disabled
|
||||
sections, inside an interrupt, etc...
|
||||
|
||||
config KERNEL_DEBUG_VM
|
||||
bool "Compile the kernel with debug VM"
|
||||
depends on KERNEL_DEBUG_KERNEL
|
||||
help
|
||||
Enable this to turn on extended checks in the virtual-memory system
|
||||
that may impact performance.
|
||||
|
||||
If unsure, say N.
|
||||
|
||||
config KERNEL_PRINTK_TIME
|
||||
bool "Enable printk timestamps"
|
||||
default y
|
||||
@ -299,10 +477,14 @@ config KERNEL_KEXEC
|
||||
config KERNEL_PROC_VMCORE
|
||||
bool
|
||||
|
||||
config KERNEL_PROC_KCORE
|
||||
bool
|
||||
|
||||
config KERNEL_CRASH_DUMP
|
||||
depends on i386 || x86_64 || arm || armeb
|
||||
select KERNEL_KEXEC
|
||||
select KERNEL_PROC_VMCORE
|
||||
select KERNEL_PROC_KCORE
|
||||
bool "Enable support for kexec crashdump"
|
||||
default y
|
||||
|
||||
@ -584,7 +766,7 @@ if KERNEL_CGROUPS
|
||||
bool "Control Group Classifier"
|
||||
default y
|
||||
|
||||
config KERNEL_NETPRIO_CGROUP
|
||||
config KERNEL_CGROUP_NET_PRIO
|
||||
bool "Network priority cgroup"
|
||||
default y
|
||||
|
||||
@ -596,7 +778,7 @@ endif
|
||||
|
||||
config KERNEL_NAMESPACES
|
||||
bool "Enable kernel namespaces"
|
||||
default n
|
||||
default y if !SMALL_FLASH
|
||||
|
||||
if KERNEL_NAMESPACES
|
||||
|
||||
@ -665,13 +847,13 @@ config KERNEL_POSIX_MQUEUE
|
||||
|
||||
config KERNEL_SECCOMP_FILTER
|
||||
bool
|
||||
default n
|
||||
default y if !SMALL_FLASH
|
||||
|
||||
config KERNEL_SECCOMP
|
||||
bool "Enable seccomp support"
|
||||
depends on !(TARGET_uml)
|
||||
select KERNEL_SECCOMP_FILTER
|
||||
default n
|
||||
default y if !SMALL_FLASH
|
||||
help
|
||||
Build kernel with support for seccomp.
|
||||
|
||||
@ -797,7 +979,7 @@ menu "Filesystem ACL and attr support options"
|
||||
select KERNEL_FS_POSIX_ACL
|
||||
default y if USE_FS_ACL_ATTR
|
||||
|
||||
config KERNEL_HFSPLUG_FS_POSIX_ACL
|
||||
config KERNEL_HFSPLUS_FS_POSIX_ACL
|
||||
bool "Enable POSIX ACL for HFS+ Filesystems"
|
||||
select KERNEL_FS_POSIX_ACL
|
||||
default y if USE_FS_ACL_ATTR
|
||||
|
@ -1,5 +1,11 @@
|
||||
src-git packages https://github.com/coolsnowwolf/packages
|
||||
src-git packages https://git.openwrt.org/feed/packages.git
|
||||
src-git luci https://github.com/coolsnowwolf/luci
|
||||
src-git routing https://git.openwrt.org/feed/routing.git;openwrt-19.07
|
||||
#src-git telephony https://git.openwrt.org/feed/telephony.git;openwrt-19.07
|
||||
src-git routing https://git.openwrt.org/feed/routing.git
|
||||
src-git telephony https://git.openwrt.org/feed/telephony.git
|
||||
src-git freifunk https://github.com/freifunk/openwrt-packages.git
|
||||
#src-git video https://github.com/openwrt/video.git
|
||||
#src-git targets https://github.com/openwrt/targets.git
|
||||
#src-git management https://github.com/openwrt-management/packages.git
|
||||
#src-git oldpackages http://git.openwrt.org/packages.git
|
||||
#src-link custom /usr/src/openwrt/custom-feed
|
||||
#src-git helloworld https://github.com/fw876/helloworld
|
||||
|
@ -50,6 +50,7 @@ endef
|
||||
dl_pack/bz2=bzip2 -c > $(1)
|
||||
dl_pack/gz=gzip -nc > $(1)
|
||||
dl_pack/xz=xz -zc -7e > $(1)
|
||||
dl_pack/zst=zstd -T0 --ultra -20 -c > $(1)
|
||||
dl_pack/unknown=$(error ERROR: Unknown pack format for file $(1))
|
||||
define dl_pack
|
||||
$(if $(dl_pack/$(call ext,$(1))),$(dl_pack/$(call ext,$(1))),$(dl_pack/unknown))
|
||||
|
@ -269,7 +269,7 @@ define Build/xor-image
|
||||
endef
|
||||
|
||||
define Build/check-size
|
||||
@[ $$(($(subst k,* 1024,$(subst m, * 1024k,$(1))))) -ge "$$(stat -c%s $@)" ] || { \
|
||||
@[ $$(($(subst k,* 1024,$(subst m, * 1024k,$(if $(1),$(1),$(IMAGE_SIZE)))))) -ge "$$(stat -c%s $@)" ] || { \
|
||||
echo "WARNING: Image file $@ is too big" >&2; \
|
||||
rm -f $@; \
|
||||
}
|
||||
@ -319,7 +319,7 @@ endef
|
||||
|
||||
define Build/qsdk-ipq-factory-nor
|
||||
$(TOPDIR)/scripts/mkits-qsdk-ipq-image.sh \
|
||||
$@.its kernel $(IMAGE_KERNEL) rootfs $(IMAGE_ROOTFS)
|
||||
$@.its hlos $(IMAGE_KERNEL) rootfs $(IMAGE_ROOTFS)
|
||||
PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $@.its $@.new
|
||||
@mv $@.new $@
|
||||
endef
|
||||
@ -414,3 +414,10 @@ define Build/kernel2minor
|
||||
kernel2minor -k $@ -r $@.new $(1)
|
||||
mv $@.new $@
|
||||
endef
|
||||
|
||||
# Convert a raw image into a $1 type image.
|
||||
# E.g. | qemu-image vdi
|
||||
define Build/qemu-image
|
||||
qemu-img convert -f raw -O $1 $@ $@.new
|
||||
@mv $@.new $@
|
||||
endef
|
||||
|
@ -45,6 +45,7 @@ IMG_PREFIX:=$(VERSION_DIST_SANITIZED)-$(IMG_PREFIX_VERNUM)$(IMG_PREFIX_VERCODE)$
|
||||
IMG_ROOTFS:=$(IMG_PREFIX)-rootfs
|
||||
IMG_COMBINED:=$(IMG_PREFIX)-combined
|
||||
IMG_PART_SIGNATURE:=$(shell echo $(SOURCE_DATE_EPOCH)$(LINUX_VERMAGIC) | mkhash md5 | cut -b1-8)
|
||||
IMG_PART_DISKGUID:=$(shell echo $(SOURCE_DATE_EPOCH)$(LINUX_VERMAGIC) | mkhash md5 | sed -E 's/(.{8})(.{4})(.{4})(.{4})(.{10})../\1-\2-\3-\4-\500/')
|
||||
|
||||
MKFS_DEVTABLE_OPT := -D $(INCLUDE_DIR)/device_table.txt
|
||||
|
||||
@ -93,7 +94,6 @@ fs-types-$(CONFIG_TARGET_ROOTFS_SQUASHFS) += squashfs
|
||||
fs-types-$(CONFIG_TARGET_ROOTFS_JFFS2) += $(addprefix jffs2-,$(JFFS2_BLOCKSIZE))
|
||||
fs-types-$(CONFIG_TARGET_ROOTFS_JFFS2_NAND) += $(addprefix jffs2-nand-,$(NAND_BLOCKSIZE))
|
||||
fs-types-$(CONFIG_TARGET_ROOTFS_EXT4FS) += ext4
|
||||
fs-types-$(CONFIG_TARGET_ROOTFS_ISO) += iso
|
||||
fs-types-$(CONFIG_TARGET_ROOTFS_UBIFS) += ubifs
|
||||
fs-subtypes-$(CONFIG_TARGET_ROOTFS_JFFS2) += $(addsuffix -raw,$(addprefix jffs2-,$(JFFS2_BLOCKSIZE)))
|
||||
|
||||
@ -238,7 +238,7 @@ define Image/mkfs/squashfs
|
||||
$(STAGING_DIR_HOST)/bin/mksquashfs4 $(call mkfs_target_dir,$(1)) $@ \
|
||||
-nopad -noappend -root-owned \
|
||||
-comp $(SQUASHFSCOMP) $(SQUASHFSOPT) \
|
||||
-processors $(shell nproc)
|
||||
-processors 1
|
||||
endef
|
||||
|
||||
# $(1): board name
|
||||
@ -381,13 +381,13 @@ define Device/Init
|
||||
DEVICE_NAME := $(1)
|
||||
KERNEL:=
|
||||
KERNEL_INITRAMFS = $$(KERNEL)
|
||||
KERNEL_SIZE:=
|
||||
CMDLINE:=
|
||||
|
||||
IMAGES :=
|
||||
ARTIFACTS :=
|
||||
IMAGE_PREFIX := $(IMG_PREFIX)-$(1)
|
||||
IMAGE_NAME = $$(IMAGE_PREFIX)-$$(1)-$$(2)
|
||||
IMAGE_SIZE :=
|
||||
KERNEL_PREFIX = $$(IMAGE_PREFIX)
|
||||
KERNEL_SUFFIX := -kernel.bin
|
||||
KERNEL_INITRAMFS_SUFFIX = $$(KERNEL_SUFFIX)
|
||||
@ -434,8 +434,8 @@ DEFAULT_DEVICE_VARS := \
|
||||
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 SOC BOARD_NAME UIMAGE_NAME SUPPORTED_DEVICES \
|
||||
IMAGE_METADATA KERNEL_ENTRY KERNEL_LOADADDR UBOOT_PATH DEVICE_VENDOR \
|
||||
DEVICE_MODEL DEVICE_VARIANT \
|
||||
IMAGE_METADATA KERNEL_ENTRY KERNEL_LOADADDR UBOOT_PATH IMAGE_SIZE \
|
||||
DEVICE_VENDOR DEVICE_MODEL DEVICE_VARIANT \
|
||||
DEVICE_ALT0_VENDOR DEVICE_ALT0_MODEL DEVICE_ALT0_VARIANT \
|
||||
DEVICE_ALT1_VENDOR DEVICE_ALT1_MODEL DEVICE_ALT1_VARIANT \
|
||||
DEVICE_ALT2_VENDOR DEVICE_ALT2_MODEL DEVICE_ALT2_VARIANT
|
||||
@ -545,8 +545,11 @@ endef
|
||||
|
||||
define Device/Build/image
|
||||
GZ_SUFFIX := $(if $(filter %dtb %gz,$(2)),,$(if $(and $(findstring ext4,$(1)),$(CONFIG_TARGET_IMAGES_GZIP)),.gz))
|
||||
$$(_TARGET): $(BIN_DIR)/$(call IMAGE_NAME,$(1),$(2))$$(GZ_SUFFIX)
|
||||
$$(_TARGET): $(if $(CONFIG_JSON_OVERVIEW_IMAGE_INFO), \
|
||||
$(BUILD_DIR)/json_info_files/$(call IMAGE_NAME,$(1),$(2)).json, \
|
||||
$(BIN_DIR)/$(call IMAGE_NAME,$(1),$(2))$$(GZ_SUFFIX))
|
||||
$(eval $(call Device/Export,$(KDIR)/tmp/$(call IMAGE_NAME,$(1),$(2)),$(1)))
|
||||
|
||||
ROOTFS/$(1)/$(3) := \
|
||||
$(KDIR)/root.$(1)$$(strip \
|
||||
$$(if $$(FS_OPTIONS/$(1)),+fs=$$(call param_mangle,$$(FS_OPTIONS/$(1)))) \
|
||||
@ -568,32 +571,34 @@ define Device/Build/image
|
||||
|
||||
$(BIN_DIR)/$(call IMAGE_NAME,$(1),$(2)): $(KDIR)/tmp/$(call IMAGE_NAME,$(1),$(2))
|
||||
cp $$^ $$@
|
||||
$(if $(CONFIG_JSON_ADD_IMAGE_INFO), \
|
||||
DEVICE_ID="$(DEVICE_NAME)" \
|
||||
BIN_DIR="$(BIN_DIR)" \
|
||||
IMAGE_NAME="$(IMAGE_NAME)" \
|
||||
IMAGE_TYPE=$(word 1,$(subst ., ,$(2))) \
|
||||
IMAGE_PREFIX="$(IMAGE_PREFIX)" \
|
||||
DEVICE_VENDOR="$(DEVICE_VENDOR)" \
|
||||
DEVICE_MODEL="$(DEVICE_MODEL)" \
|
||||
DEVICE_VARIANT="$(DEVICE_VARIANT)" \
|
||||
DEVICE_ALT0_VENDOR="$(DEVICE_ALT0_VENDOR)" \
|
||||
DEVICE_ALT0_MODEL="$(DEVICE_ALT0_MODEL)" \
|
||||
DEVICE_ALT0_VARIANT="$(DEVICE_ALT0_VARIANT)" \
|
||||
DEVICE_ALT1_VENDOR="$(DEVICE_ALT1_VENDOR)" \
|
||||
DEVICE_ALT1_MODEL="$(DEVICE_ALT1_MODEL)" \
|
||||
DEVICE_ALT1_VARIANT="$(DEVICE_ALT1_VARIANT)" \
|
||||
DEVICE_ALT2_VENDOR="$(DEVICE_ALT2_VENDOR)" \
|
||||
DEVICE_ALT2_MODEL="$(DEVICE_ALT2_MODEL)" \
|
||||
DEVICE_ALT2_VARIANT="$(DEVICE_ALT2_VARIANT)" \
|
||||
DEVICE_TITLE="$(DEVICE_TITLE)" \
|
||||
TARGET="$(BOARD)" \
|
||||
SUBTARGET="$(if $(SUBTARGET),$(SUBTARGET),generic)" \
|
||||
VERSION_NUMBER="$(VERSION_NUMBER)" \
|
||||
VERSION_CODE="$(VERSION_CODE)" \
|
||||
SUPPORTED_DEVICES="$(SUPPORTED_DEVICES)" \
|
||||
$(TOPDIR)/scripts/json_add_image_info.py \
|
||||
)
|
||||
|
||||
$(BUILD_DIR)/json_info_files/$(call IMAGE_NAME,$(1),$(2)).json: $(BIN_DIR)/$(call IMAGE_NAME,$(1),$(2))$$(GZ_SUFFIX)
|
||||
@mkdir -p $$(shell dirname $$@)
|
||||
DEVICE_ID="$(DEVICE_NAME)" \
|
||||
BIN_DIR="$(BIN_DIR)" \
|
||||
IMAGE_NAME="$(IMAGE_NAME)" \
|
||||
IMAGE_TYPE=$(word 1,$(subst ., ,$(2))) \
|
||||
IMAGE_PREFIX="$(IMAGE_PREFIX)" \
|
||||
DEVICE_VENDOR="$(DEVICE_VENDOR)" \
|
||||
DEVICE_MODEL="$(DEVICE_MODEL)" \
|
||||
DEVICE_VARIANT="$(DEVICE_VARIANT)" \
|
||||
DEVICE_ALT0_VENDOR="$(DEVICE_ALT0_VENDOR)" \
|
||||
DEVICE_ALT0_MODEL="$(DEVICE_ALT0_MODEL)" \
|
||||
DEVICE_ALT0_VARIANT="$(DEVICE_ALT0_VARIANT)" \
|
||||
DEVICE_ALT1_VENDOR="$(DEVICE_ALT1_VENDOR)" \
|
||||
DEVICE_ALT1_MODEL="$(DEVICE_ALT1_MODEL)" \
|
||||
DEVICE_ALT1_VARIANT="$(DEVICE_ALT1_VARIANT)" \
|
||||
DEVICE_ALT2_VENDOR="$(DEVICE_ALT2_VENDOR)" \
|
||||
DEVICE_ALT2_MODEL="$(DEVICE_ALT2_MODEL)" \
|
||||
DEVICE_ALT2_VARIANT="$(DEVICE_ALT2_VARIANT)" \
|
||||
DEVICE_TITLE="$(DEVICE_TITLE)" \
|
||||
DEVICE_PACKAGES="$(DEVICE_PACKAGES)" \
|
||||
TARGET="$(BOARD)" \
|
||||
SUBTARGET="$(if $(SUBTARGET),$(SUBTARGET),generic)" \
|
||||
VERSION_NUMBER="$(VERSION_NUMBER)" \
|
||||
VERSION_CODE="$(VERSION_CODE)" \
|
||||
SUPPORTED_DEVICES="$(SUPPORTED_DEVICES)" \
|
||||
$(TOPDIR)/scripts/json_add_image_info.py $$@
|
||||
|
||||
endef
|
||||
|
||||
@ -612,8 +617,6 @@ define Device/Build/artifact
|
||||
endef
|
||||
|
||||
define Device/Build
|
||||
$(shell rm -f $(BIN_DIR)/$(IMG_PREFIX)-$(1).json)
|
||||
|
||||
$(if $(CONFIG_TARGET_ROOTFS_INITRAMFS),$(call Device/Build/initramfs,$(1)))
|
||||
$(call Device/Build/kernel,$(1))
|
||||
|
||||
@ -699,6 +702,7 @@ define BuildImage
|
||||
|
||||
image_prepare: compile
|
||||
mkdir -p $(BIN_DIR) $(KDIR)/tmp
|
||||
rm -rf $(BUILD_DIR)/json_info_files
|
||||
$(call Image/Prepare)
|
||||
|
||||
legacy-images-prepare-make: image_prepare
|
||||
|
@ -70,7 +70,7 @@ ifdef CONFIG_COLLECT_KERNEL_DEBUG
|
||||
$(FIND) $(KERNEL_BUILD_DIR)/debug -type f | $(XARGS) $(KERNEL_CROSS)strip --only-keep-debug
|
||||
$(TAR) c -C $(KERNEL_BUILD_DIR) debug \
|
||||
$(if $(SOURCE_DATE_EPOCH),--mtime="@$(SOURCE_DATE_EPOCH)") \
|
||||
| bzip2 -c -9 > $(BIN_DIR)/kernel-debug.tar.bz2
|
||||
| zstd -T0 -f -o $(BIN_DIR)/kernel-debug.tar.zst
|
||||
endef
|
||||
endif
|
||||
|
||||
@ -162,7 +162,11 @@ define BuildKernel
|
||||
rm -f $(STAMP_CONFIGURED)
|
||||
$(LINUX_RECONF_CMD) > $(LINUX_DIR)/.config
|
||||
$(_SINGLE)$(KERNEL_MAKE) \
|
||||
$(if $(findstring Darwin,$(HOST_OS)),HOST_LOADLIBES="-L$(STAGING_DIR_HOST)/lib -lncurses") \
|
||||
$(if $(findstring Darwin,$(HOST_OS)), \
|
||||
HOST_LOADLIBES="-L$(STAGING_DIR_HOST)/lib -lncurses" \
|
||||
HOSTLDLIBS_mconf="-L$(STAGING_DIR_HOST)/lib -lncurses" \
|
||||
filechk_conf_cfg=" :" \
|
||||
) \
|
||||
YACC=$(STAGING_DIR_HOST)/bin/bison \
|
||||
$$@
|
||||
$(LINUX_RECONF_DIFF) $(LINUX_DIR)/.config | \
|
||||
|
@ -8,11 +8,11 @@ endif
|
||||
|
||||
LINUX_VERSION-4.14 = .180
|
||||
LINUX_VERSION-4.19 = .123
|
||||
LINUX_VERSION-5.4 = .40
|
||||
LINUX_VERSION-5.4 = .48
|
||||
|
||||
LINUX_KERNEL_HASH-4.14.180 = 444ef973d9b6a6ea174e4a9086f0aea980d8575d13302e431ad688f22e27ed0e
|
||||
LINUX_KERNEL_HASH-4.19.123 = a79914d31a8d8c6b0e2bb0f2b143d615fe8a6c4dd2e0f36e97aa20efd69a993f
|
||||
LINUX_KERNEL_HASH-5.4.40 = 83563f027687ecaafb41d0d2d52056f40ec9822f8a9e43592e215349730020ab
|
||||
LINUX_KERNEL_HASH-5.4.48 = bf20ddafcd04c114d34654bb10d1eb74f1864f3d14b676c6f0d42d60bbcf1d53
|
||||
|
||||
remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1))))
|
||||
sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1)))))))
|
||||
@ -40,4 +40,4 @@ KERNEL_PATCHVER ?= $(KERNEL)
|
||||
|
||||
# disable the md5sum check for unknown kernel versions
|
||||
LINUX_KERNEL_HASH:=$(LINUX_KERNEL_HASH-$(strip $(LINUX_VERSION)))
|
||||
LINUX_KERNEL_HASH?=x
|
||||
LINUX_KERNEL_HASH?=x
|
||||
|
@ -138,11 +138,13 @@ endif
|
||||
|
||||
PKG_EXTMOD_SUBDIRS ?= .
|
||||
|
||||
PKG_SYMVERS_DIR = $(KERNEL_BUILD_DIR)/symvers
|
||||
|
||||
define populate_module_symvers
|
||||
@mkdir -p $(PKG_INFO_DIR)
|
||||
cat /dev/null > $(PKG_INFO_DIR)/$(PKG_NAME).symvers; \
|
||||
@mkdir -p $(PKG_SYMVERS_DIR)
|
||||
cat /dev/null > $(PKG_SYMVERS_DIR)/$(PKG_NAME).symvers; \
|
||||
for subdir in $(PKG_EXTMOD_SUBDIRS); do \
|
||||
cat $(PKG_INFO_DIR)/*.symvers 2>/dev/null > $(PKG_BUILD_DIR)/$$$$subdir/Module.symvers; \
|
||||
cat $(PKG_SYMVERS_DIR)/*.symvers 2>/dev/null > $(PKG_BUILD_DIR)/$$$$subdir/Module.symvers; \
|
||||
done
|
||||
endef
|
||||
|
||||
@ -154,7 +156,7 @@ define collect_module_symvers
|
||||
grep -F $$$$realdir $(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
|
||||
mv $(PKG_BUILD_DIR)/Module.symvers $(PKG_SYMVERS_DIR)/$(PKG_NAME).symvers
|
||||
endef
|
||||
|
||||
define KernelPackage/hooks
|
||||
|
@ -185,7 +185,7 @@ $(eval $(call nf_add,IPT_IPV6_EXTRA,CONFIG_IP6_NF_MATCH_RT, $(P_V6)ip6t_rt))
|
||||
|
||||
# kernel only
|
||||
$(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_REDIRECT, $(P_XT)nf_nat_redirect),))
|
||||
$(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),))
|
||||
|
||||
@ -195,7 +195,7 @@ $(eval $(if $(NF_KMOD),$(call nf_add,NF_NAT6,CONFIG_NF_NAT_MASQUERADE_IPV6, $(P_
|
||||
$(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),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,IPT_NAT6,CONFIG_IP6_NF_NAT, $(P_V6)ip6table_nat),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,IPT_NAT6,CONFIG_IP6_NF_TARGET_MASQUERADE, $(P_V6)ip6t_MASQUERADE),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,IPT_NAT6,CONFIG_IP6_NF_TARGET_MASQUERADE, $(P_V6)ip6t_MASQUERADE, lt 5.2),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,IPT_NAT6,CONFIG_IP6_NF_TARGET_NPT, $(P_V6)ip6t_NPT),))
|
||||
|
||||
# userland only
|
||||
@ -261,8 +261,8 @@ $(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_NF_SOCKET_IPV4, $(P_V4)nf_socket_ipv4))
|
||||
$(eval $(call nf_add,IPT_TPROXY,CONFIG_NF_SOCKET_IPV6, $(P_V6)nf_socket_ipv6))
|
||||
$(eval $(call nf_add,IPT_TPROXY,CONFIG_NETFILTER_XT_TARGET_TPROXY, $(P_XT)xt_TPROXY))
|
||||
$(eval $(call nf_add,IPT_TPROXY,CONFIG_NF_TPROXY_IPV4, $(P_V4)nf_tproxy_ipv4, ge 4.18))
|
||||
$(eval $(call nf_add,IPT_TPROXY,CONFIG_NF_TPROXY_IPV6, $(P_V6)nf_tproxy_ipv6, ge 4.18))
|
||||
@ -273,8 +273,8 @@ $(eval $(call nf_add,IPT_LED,CONFIG_NETFILTER_XT_TARGET_LED, $(P_XT)xt_LED))
|
||||
# tee
|
||||
|
||||
$(eval $(call nf_add,IPT_TEE,CONFIG_NETFILTER_XT_TARGET_TEE, $(P_XT)xt_TEE))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,IPT_TEE,CONFIG_NF_DUP_IPV4, $(P_V4)nf_dup_ipv4, ge 4.3),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,IPT_TEE,CONFIG_NF_DUP_IPV6, $(P_V6)nf_dup_ipv6, ge 4.3),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,IPT_TEE,CONFIG_NF_DUP_IPV4, $(P_V4)nf_dup_ipv4),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,IPT_TEE,CONFIG_NF_DUP_IPV6, $(P_V6)nf_dup_ipv6),))
|
||||
|
||||
# u32
|
||||
|
||||
@ -336,25 +336,26 @@ $(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_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),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NFT_CT, $(P_XT)nft_ct),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NFT_SET_RBTREE, $(P_XT)nft_set_rbtree, ge 4.9.0),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NFT_RBTREE, $(P_XT)nft_rbtree, lt 4.9.0),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NFT_SET_HASH, $(P_XT)nft_set_hash, ge 4.9.0),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NFT_HASH, $(P_XT)nft_hash, lt 4.9.0),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NF_TABLES_IPV4, $(P_V4)nf_tables_ipv4, lt 4.17),))
|
||||
$(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_SET, $(P_XT)nf_tables_set, ge 4.18),))
|
||||
$(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_NFT_CHAIN_ROUTE_IPV6, $(P_V6)nft_chain_route_ipv6),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NFT_COUNTER, $(P_XT)nft_counter),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NFT_LOG, $(P_XT)nft_log),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NFT_CT, $(P_XT)nft_ct),))
|
||||
$(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_HASH, $(P_XT)nft_hash),))
|
||||
$(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_LOG, $(P_XT)nft_log),))
|
||||
$(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),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NFT_OBJREF, $(P_XT)nft_objref),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NFT_QUOTA, $(P_XT)nft_quota),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NFT_REDIR, $(P_XT)nft_redir),))
|
||||
$(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_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_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_CORE,CONFIG_NFT_SET_HASH, $(P_XT)nft_set_hash, lt 4.18),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NFT_SET_RBTREE, $(P_XT)nft_set_rbtree, lt 4.18),))
|
||||
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_ARP,CONFIG_NF_TABLES_ARP, $(P_V4)nf_tables_arp, lt 4.17),))
|
||||
|
||||
@ -364,11 +365,11 @@ $(eval $(if $(NF_KMOD),$(call nf_add,NFT_BRIDGE,CONFIG_NFT_BRIDGE_REJECT, $(P_EB
|
||||
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_NAT,CONFIG_NFT_NAT, $(P_XT)nft_nat),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_NAT,CONFIG_NFT_CHAIN_NAT_IPV4, $(P_V4)nft_chain_nat_ipv4),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_NAT,CONFIG_NFT_REDIR_IPV4, $(P_V4)nft_redir_ipv4, ge 3.19.0),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_NAT,CONFIG_NFT_REDIR_IPV4, $(P_V4)nft_redir_ipv4),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_NAT,CONFIG_NFT_MASQ, $(P_XT)nft_masq),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_NAT,CONFIG_NFT_MASQ_IPV4, $(P_V4)nft_masq_ipv4),))
|
||||
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_NAT6,CONFIG_NFT_REDIR_IPV6, $(P_V6)nft_redir_ipv6, ge 3.19.0),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_NAT6,CONFIG_NFT_REDIR_IPV6, $(P_V6)nft_redir_ipv6),))
|
||||
$(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),))
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
PKG_DEFAULT_DEPENDS = +libc +GCC_LIBSSP:libssp +USE_GLIBC:librt +USE_GLIBC:libpthread
|
||||
PKG_DEFAULT_DEPENDS = +libc +USE_GLIBC:librt +USE_GLIBC:libpthread
|
||||
|
||||
ifneq ($(PKG_NAME),toolchain)
|
||||
PKG_FIXUP_DEPENDS = $(if $(filter kmod-%,$(1)),$(2),$(PKG_DEFAULT_DEPENDS) $(filter-out $(PKG_DEFAULT_DEPENDS),$(2)))
|
||||
|
@ -173,6 +173,7 @@ $$(call addfield,Depends,$$(Package/$(1)/DEPENDS)
|
||||
)$$(call addfield,LicenseFiles,$(LICENSE_FILES)
|
||||
)$$(call addfield,Section,$(SECTION)
|
||||
)$$(call addfield,Require-User,$(USERID)
|
||||
)$(if $(PKG_CPE_ID),CPE-ID: $(PKG_CPE_ID)
|
||||
)$(if $(filter hold,$(PKG_FLAGS)),Status: unknown hold not-installed
|
||||
)$(if $(filter essential,$(PKG_FLAGS)),Essential: yes
|
||||
)$(if $(MAINTAINER),Maintainer: $(MAINTAINER)
|
||||
|
@ -223,7 +223,7 @@ define Build/CoreTargets
|
||||
$(STAMP_INSTALLED) : export PATH=$$(TARGET_PATH_PKG)
|
||||
$(STAMP_INSTALLED): $(STAMP_BUILT)
|
||||
rm -rf $(TMP_DIR)/stage-$(PKG_DIR_NAME)
|
||||
mkdir -p $(TMP_DIR)/stage-$(PKG_DIR_NAME)/host $(STAGING_DIR)/packages $(STAGING_DIR_HOST)/packages
|
||||
mkdir -p $(TMP_DIR)/stage-$(PKG_DIR_NAME)/host $(STAGING_DIR)/packages
|
||||
$(foreach hook,$(Hooks/InstallDev/Pre),\
|
||||
$(call $(hook),$(TMP_DIR)/stage-$(PKG_DIR_NAME),$(TMP_DIR)/stage-$(PKG_DIR_NAME)/host)$(sep)\
|
||||
)
|
||||
@ -342,9 +342,9 @@ clean-build: $(if $(wildcard $(PKG_BUILD_DIR)/.autoremove),force-clean-build)
|
||||
|
||||
clean: force-clean-build
|
||||
$(CleanStaging)
|
||||
$(call Build/UninstallDev,$(STAGING_DIR),$(STAGING_DIR_HOST))
|
||||
$(call Build/UninstallDev,$(STAGING_DIR),$(STAGING_DIR)/host)
|
||||
$(Build/Clean)
|
||||
rm -f $(STAGING_DIR)/packages/$(STAGING_FILES_LIST) $(STAGING_DIR_HOST)/packages/$(STAGING_FILES_LIST)
|
||||
rm -f $(STAGING_DIR)/packages/$(STAGING_FILES_LIST)
|
||||
|
||||
dist:
|
||||
$(Build/Dist)
|
||||
|
@ -14,8 +14,8 @@ PKG_NAME:=Build dependency
|
||||
|
||||
# Required for the toolchain
|
||||
$(eval $(call TestHostCommand,working-make, \
|
||||
Please install GNU make v3.81 or later. (This version has bugs), \
|
||||
$(MAKE) -v | grep -E 'Make (3\.8[1-9]|3\.9[0-9]|[4-9]\.)'))
|
||||
Please install GNU make v3.82 or later. (This version has bugs), \
|
||||
$(MAKE) -v | grep -E 'Make (3\.8[2-9]|3\.9[0-9]|[4-9]\.)'))
|
||||
|
||||
$(eval $(call TestHostCommand,case-sensitive-fs, \
|
||||
OpenWrt can only be built on a case-sensitive filesystem, \
|
||||
@ -30,14 +30,6 @@ $(eval $(call SetupHostCommand,gcc, \
|
||||
Please install the GNU C Compiler (gcc) 4.8 or later, \
|
||||
$(CC) -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?|10\.?)', \
|
||||
gcc -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?|10\.?)', \
|
||||
gcc48 --version | grep gcc, \
|
||||
gcc49 --version | grep gcc, \
|
||||
gcc5 --version | grep gcc, \
|
||||
gcc6 --version | grep gcc, \
|
||||
gcc7 --version | grep gcc, \
|
||||
gcc8 --version | grep gcc, \
|
||||
gcc9 --version | grep gcc, \
|
||||
gcc10 --version | grep gcc, \
|
||||
gcc --version | grep -E 'Apple.(LLVM|clang)' ))
|
||||
|
||||
$(eval $(call TestHostCommand,working-gcc, \
|
||||
@ -50,14 +42,6 @@ $(eval $(call SetupHostCommand,g++, \
|
||||
Please install the GNU C++ Compiler (g++) 4.8 or later, \
|
||||
$(CXX) -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?|10\.?)', \
|
||||
g++ -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?|10\.?)', \
|
||||
g++48 --version | grep g++, \
|
||||
g++49 --version | grep g++, \
|
||||
g++5 --version | grep g++, \
|
||||
g++6 --version | grep g++, \
|
||||
g++7 --version | grep g++, \
|
||||
g++8 --version | grep g++, \
|
||||
g++9 --version | grep g++, \
|
||||
g++10 --version | grep g++, \
|
||||
g++ --version | grep -E 'Apple.(LLVM|clang)' ))
|
||||
|
||||
$(eval $(call TestHostCommand,working-g++, \
|
||||
@ -67,10 +51,12 @@ $(eval $(call TestHostCommand,working-g++, \
|
||||
g++ -x c++ -o $(TMP_DIR)/a.out - -lstdc++ && \
|
||||
$(TMP_DIR)/a.out))
|
||||
|
||||
ifndef IB
|
||||
$(eval $(call TestHostCommand,ncurses, \
|
||||
Please install ncurses. (Missing libncurses.so or ncurses.h), \
|
||||
echo 'int main(int argc, char **argv) { initscr(); return 0; }' | \
|
||||
gcc -include ncurses.h -x c -o $(TMP_DIR)/a.out - -lncurses))
|
||||
endif
|
||||
|
||||
ifeq ($(HOST_OS),Linux)
|
||||
zlib_link_flags := -Wl,-Bstatic -lz -Wl,-Bdynamic
|
||||
@ -78,6 +64,10 @@ else
|
||||
zlib_link_flags := -lz
|
||||
endif
|
||||
|
||||
$(eval $(call TestHostCommand,perl-data-dumper, \
|
||||
Please install the Perl Data::Dumper module, \
|
||||
perl -MData::Dumper -e 1))
|
||||
|
||||
$(eval $(call TestHostCommand,perl-thread-queue, \
|
||||
Please install the Perl Thread::Queue module, \
|
||||
perl -MThread::Queue -e 1))
|
||||
|
@ -18,13 +18,14 @@ block-mount coremark kmod-nf-nathelper kmod-nf-nathelper-extra kmod-ipt-raw wget
|
||||
default-settings luci luci-app-ddns luci-app-upnp luci-app-adbyby-plus luci-app-autoreboot \
|
||||
luci-app-filetransfer luci-app-vsftpd luci-app-ssr-plus luci-app-unblockmusic \
|
||||
luci-app-arpbind luci-app-vlmcsd luci-app-wol luci-app-ramfree \
|
||||
luci-app-sfe luci-app-flowoffload luci-app-nlbwmon luci-app-accesscontrol luci-app-cpufreq \
|
||||
luci-app-sfe luci-app-nlbwmon luci-app-accesscontrol luci-app-cpufreq \
|
||||
ddns-scripts_aliyun ddns-scripts_dnspod
|
||||
# For the basic set
|
||||
DEFAULT_PACKAGES.basic:=
|
||||
# For nas targets
|
||||
DEFAULT_PACKAGES.nas:=block-mount fdisk lsblk mdadm
|
||||
# For router targets
|
||||
DEFAULT_PACKAGES.router:=dnsmasq-full iptables ppp ppp-mod-pppoe firewall kmod-ipt-offload kmod-tcp-bbr
|
||||
DEFAULT_PACKAGES.bootloader:=
|
||||
DEFAULT_PACKAGES.router:=dnsmasq-full iptables ip6tables ppp ppp-mod-pppoe firewall kmod-ipt-offload
|
||||
|
||||
ifneq ($(DUMP),)
|
||||
all: dumpinfo
|
||||
|
@ -99,25 +99,22 @@ 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)
|
||||
ifeq ($(RECURSIVE_DEP_IS_ERROR),1)
|
||||
KCONF_FLAGS=--fatalrecursive
|
||||
endif
|
||||
scripts/config/mconf:
|
||||
@$(_SINGLE)$(SUBMAKE) -s -C scripts/config all CC="$(HOSTCC_WRAPPER)"
|
||||
ifneq ($(DISTRO_PKG_CONFIG),)
|
||||
scripts/config/%onf: export PATH:=$(dir $(DISTRO_PKG_CONFIG)):$(PATH)
|
||||
endif
|
||||
scripts/config/%onf: CFLAGS+= -O2
|
||||
scripts/config/%onf:
|
||||
@$(_SINGLE)$(SUBMAKE) $(if $(findstring s,$(OPENWRT_VERBOSE)),,-s) \
|
||||
-C scripts/config $(notdir $@) 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)"
|
||||
|
||||
scripts/config/conf:
|
||||
@$(_SINGLE)$(SUBMAKE) -s -C scripts/config conf CC="$(HOSTCC_WRAPPER)"
|
||||
|
||||
config: scripts/config/conf prepare-tmpinfo FORCE
|
||||
[ -L .config ] && export KCONFIG_OVERWRITECONFIG=1; \
|
||||
$< Config.in
|
||||
$< $(KCONF_FLAGS) Config.in
|
||||
|
||||
config-clean: FORCE
|
||||
$(_SINGLE)$(NO_TRACE_MAKE) -C scripts/config clean
|
||||
@ -126,7 +123,7 @@ defconfig: scripts/config/conf prepare-tmpinfo FORCE
|
||||
touch .config
|
||||
@if [ ! -s .config -a -e $(HOME)/.openwrt/defconfig ]; then cp $(HOME)/.openwrt/defconfig .config; fi
|
||||
[ -L .config ] && export KCONFIG_OVERWRITECONFIG=1; \
|
||||
$< --defconfig=.config Config.in
|
||||
$< $(KCONF_FLAGS) --defconfig=.config Config.in
|
||||
|
||||
confdefault-y=allyes
|
||||
confdefault-m=allmod
|
||||
@ -135,7 +132,7 @@ confdefault:=$(confdefault-$(CONFDEFAULT))
|
||||
|
||||
oldconfig: scripts/config/conf prepare-tmpinfo FORCE
|
||||
[ -L .config ] && export KCONFIG_OVERWRITECONFIG=1; \
|
||||
$< --$(if $(confdefault),$(confdefault),old)config Config.in
|
||||
$< $(KCONF_FLAGS) --$(if $(confdefault),$(confdefault),old)config Config.in
|
||||
|
||||
menuconfig: scripts/config/mconf prepare-tmpinfo FORCE
|
||||
if [ \! -e .config -a -e $(HOME)/.openwrt/defconfig ]; then \
|
||||
@ -216,7 +213,7 @@ ifeq ($(SDK),1)
|
||||
|
||||
%::
|
||||
@+$(PREP_MK) $(NO_TRACE_MAKE) -r -s prereq
|
||||
@./scripts/config/conf --defconfig=.config Config.in
|
||||
@./scripts/config/conf $(KCONF_FLAGS) --defconfig=.config Config.in
|
||||
@+$(ULIMIT_FIX) $(SUBMAKE) -r $@
|
||||
|
||||
else
|
||||
@ -225,7 +222,7 @@ else
|
||||
@+$(PREP_MK) $(NO_TRACE_MAKE) -r -s prereq
|
||||
@( \
|
||||
cp .config tmp/.config; \
|
||||
./scripts/config/conf --defconfig=tmp/.config -w tmp/.config Config.in > /dev/null 2>&1; \
|
||||
./scripts/config/conf $(KCONF_FLAGS) --defconfig=tmp/.config -w tmp/.config Config.in > /dev/null 2>&1; \
|
||||
if ./scripts/kconfig.pl '>' .config tmp/.config | grep -q CONFIG; then \
|
||||
printf "$(_R)WARNING: your configuration is out of sync. Please run make menuconfig, oldconfig or defconfig!$(_N)\n" >&2; \
|
||||
fi \
|
||||
|
@ -3,7 +3,8 @@ PKG_NAME ?= u-boot
|
||||
ifndef PKG_SOURCE_PROTO
|
||||
PKG_SOURCE = $(PKG_NAME)-$(PKG_VERSION).tar.bz2
|
||||
PKG_SOURCE_URL = \
|
||||
https://sources.openwrt.org \
|
||||
https://mirror.cyberbits.eu/u-boot \
|
||||
https://ftp.denx.de/pub/u-boot \
|
||||
ftp://ftp.denx.de/pub/u-boot
|
||||
endif
|
||||
|
||||
|
@ -31,6 +31,10 @@ ifeq ($(strip $(UNPACK_CMD)),)
|
||||
EXT:=$(call ext,$(PKG_SOURCE:.$(EXT)=))
|
||||
DECOMPRESS_CMD:=xzcat $(DL_DIR)/$(PKG_SOURCE) |
|
||||
endif
|
||||
ifeq (zst,$(EXT))
|
||||
EXT:=$(call ext,$(PKG_SOURCE:.$(EXT)=))
|
||||
DECOMPRESS_CMD:=zstdcat $(DL_DIR)/$(PKG_SOURCE) |
|
||||
endif
|
||||
ifeq ($(filter tgz tbz tbz2 txz,$(EXT1)),$(EXT1))
|
||||
EXT:=tar
|
||||
endif
|
||||
|
@ -12,7 +12,7 @@ include $(INCLUDE_DIR)/version.mk
|
||||
include $(INCLUDE_DIR)/feeds.mk
|
||||
|
||||
PKG_NAME:=base-files
|
||||
PKG_RELEASE:=200
|
||||
PKG_RELEASE:=223
|
||||
PKG_FLAGS:=nonshared
|
||||
|
||||
PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/
|
||||
@ -63,6 +63,7 @@ define Package/base-files/conffiles
|
||||
/etc/services
|
||||
/etc/shadow
|
||||
/etc/shells
|
||||
/etc/shinit
|
||||
/etc/sysctl.conf
|
||||
/etc/sysupgrade.conf
|
||||
$(call $(TARGET)/conffiles)
|
||||
@ -108,12 +109,14 @@ ifdef CONFIG_SIGNED_PACKAGES
|
||||
|
||||
endef
|
||||
|
||||
ifndef CONFIG_BUILDBOT
|
||||
define Package/base-files/install-key
|
||||
mkdir -p $(1)/etc/opkg/keys
|
||||
$(CP) $(BUILD_KEY).pub $(1)/etc/opkg/keys/`$(STAGING_DIR_HOST)/bin/usign -F -p $(BUILD_KEY).pub`
|
||||
|
||||
endef
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_NAND_SUPPORT),)
|
||||
define Package/base-files/nand-support
|
||||
@ -189,12 +192,16 @@ 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.seed >>$(1)/etc/build.config)
|
||||
cat $(BIN_DIR)/config.buildinfo >>$(1)/etc/build.config; \
|
||||
cat $(BIN_DIR)/feeds.buildinfo >>$(1)/etc/build.feeds; \
|
||||
cat $(BIN_DIR)/version.buildinfo >>$(1)/etc/build.version)
|
||||
|
||||
$(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)
|
||||
|
@ -85,12 +85,16 @@ generate_network() {
|
||||
set network.$1.proto='none'
|
||||
EOF
|
||||
|
||||
[ -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
|
||||
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
|
||||
|
||||
case "$protocol" in
|
||||
static)
|
||||
@ -213,7 +217,8 @@ generate_switch() {
|
||||
|
||||
json_select switch
|
||||
json_select "$key"
|
||||
json_get_vars enable reset blinkrate cpu_port
|
||||
json_get_vars enable reset blinkrate cpu_port \
|
||||
ar8xxx_mib_type ar8xxx_mib_poll_interval
|
||||
|
||||
uci -q batch <<-EOF
|
||||
add network switch
|
||||
@ -221,6 +226,8 @@ 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"
|
||||
@ -244,10 +251,10 @@ generate_static_system() {
|
||||
set system.ntp='timeserver'
|
||||
set system.ntp.enabled='1'
|
||||
set system.ntp.enable_server='0'
|
||||
add_list system.ntp.server='ntp1.aliyun.com'
|
||||
add_list system.ntp.server='time1.cloud.tencent.com'
|
||||
add_list system.ntp.server='time.ustc.edu.cn'
|
||||
add_list system.ntp.server='pool.ntp.org'
|
||||
add_list system.ntp.server='0.openwrt.pool.ntp.org'
|
||||
add_list system.ntp.server='1.openwrt.pool.ntp.org'
|
||||
add_list system.ntp.server='2.openwrt.pool.ntp.org'
|
||||
add_list system.ntp.server='3.openwrt.pool.ntp.org'
|
||||
EOF
|
||||
|
||||
if json_is_a system object; then
|
||||
@ -419,6 +426,8 @@ generate_gpioswitch() {
|
||||
json_init
|
||||
json_load "$(cat ${CFG})"
|
||||
|
||||
umask 077
|
||||
|
||||
if [ ! -s /etc/config/network ]; then
|
||||
touch /etc/config/network
|
||||
generate_static_network
|
||||
|
@ -37,6 +37,8 @@ set_led_state() {
|
||||
;;
|
||||
done)
|
||||
status_led_off
|
||||
[ "$status_led" != "$running" ] && \
|
||||
status_led_restore_trigger "boot"
|
||||
[ -n "$running" ] && {
|
||||
status_led="$running"
|
||||
status_led_on
|
||||
|
@ -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=98
|
||||
STOP=90
|
||||
|
||||
uci_apply_defaults() {
|
||||
. /lib/functions/system.sh
|
||||
@ -31,15 +31,16 @@ boot() {
|
||||
chmod 0700 /tmp/.uci
|
||||
touch /var/log/wtmp
|
||||
touch /var/log/lastlog
|
||||
touch /tmp/resolv.conf.auto
|
||||
ln -sf /tmp/resolv.conf.auto /tmp/resolv.conf
|
||||
mkdir -p /tmp/resolv.conf.d
|
||||
touch /tmp/resolv.conf.d/resolv.conf.auto
|
||||
ln -sf /tmp/resolv.conf.d/resolv.conf.auto /tmp/resolv.conf
|
||||
grep -q debugfs /proc/filesystems && /bin/mount -o noatime -t debugfs debugfs /sys/kernel/debug
|
||||
[ "$FAILSAFE" = "true" ] && touch /tmp/.failsafe
|
||||
|
||||
/sbin/kmodloader
|
||||
|
||||
[ ! -f /etc/config/wireless ] && {
|
||||
# compat for brcm47xx and mvebu
|
||||
# compat for bcm47xx and mvebu
|
||||
sleep 1
|
||||
}
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
START=95
|
||||
boot() {
|
||||
mount_root done
|
||||
rm -f /sysupgrade.tgz
|
||||
rm -f /sysupgrade.tgz && sync
|
||||
|
||||
# process user commands
|
||||
[ -f /etc/rc.local ] && {
|
||||
|
@ -16,21 +16,39 @@ load_gpio_switch()
|
||||
config_get name "$1" name
|
||||
config_get value "$1" value 0
|
||||
|
||||
local gpio_path="/sys/class/gpio/gpio${gpio_pin}"
|
||||
# export GPIO pin for access
|
||||
[ -d "$gpio_path" ] || {
|
||||
echo "$gpio_pin" >/sys/class/gpio/export
|
||||
# we need to wait a bit until the GPIO appears
|
||||
[ -d "$gpio_path" ] || sleep 1
|
||||
[ -z "$gpio_pin" ] && {
|
||||
echo >&2 "Skipping gpio_switch '$name' due to missing gpio_pin"
|
||||
return 1
|
||||
}
|
||||
|
||||
# direction attribute only exists if the kernel supports changing the
|
||||
# direction of a GPIO
|
||||
if [ -e "${gpio_path}/direction" ]; then
|
||||
# set the pin to output with high or low pin value
|
||||
{ [ "$value" = "0" ] && echo "low" || echo "high"; } >"$gpio_path/direction"
|
||||
local gpio_path
|
||||
if [ -n "$(echo "$gpio_pin" | grep -E "^[0-9]+$")" ]; then
|
||||
gpio_path="/sys/class/gpio/gpio${gpio_pin}"
|
||||
|
||||
# export GPIO pin for access
|
||||
[ -d "$gpio_path" ] || {
|
||||
echo "$gpio_pin" >/sys/class/gpio/export
|
||||
# we need to wait a bit until the GPIO appears
|
||||
[ -d "$gpio_path" ] || sleep 1
|
||||
}
|
||||
|
||||
# direction attribute only exists if the kernel supports changing the
|
||||
# direction of a GPIO
|
||||
if [ -e "${gpio_path}/direction" ]; then
|
||||
# set the pin to output with high or low pin value
|
||||
{ [ "$value" = "0" ] && echo "low" || echo "high"; } \
|
||||
>"$gpio_path/direction"
|
||||
else
|
||||
{ [ "$value" = "0" ] && echo "0" || echo "1"; } \
|
||||
>"$gpio_path/value"
|
||||
fi
|
||||
else
|
||||
{ [ "$value" = "0" ] && echo "0" || echo "1"; } >"$gpio_path/value"
|
||||
gpio_path="/sys/class/gpio/${gpio_pin}"
|
||||
|
||||
[ -d "$gpio_path" ] && {
|
||||
{ [ "$value" = "0" ] && echo "0" || echo "1"; } \
|
||||
>"$gpio_path/value"
|
||||
}
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,7 @@ USE_PROCD=1
|
||||
|
||||
validate_system_section()
|
||||
{
|
||||
uci_validate_section system system "${1}" \
|
||||
uci_load_validate system system "$1" "$2" \
|
||||
'hostname:string:OpenWrt' \
|
||||
'conloglevel:uinteger' \
|
||||
'buffersize:uinteger' \
|
||||
@ -15,11 +15,7 @@ validate_system_section()
|
||||
}
|
||||
|
||||
system_config() {
|
||||
local cfg="$1"
|
||||
|
||||
local hostname conloglevel buffersize timezone zonename
|
||||
|
||||
validate_system_section "${1}" || {
|
||||
[ "$2" = 0 ] || {
|
||||
echo "validation failed"
|
||||
return 1
|
||||
}
|
||||
@ -31,12 +27,12 @@ system_config() {
|
||||
ln -sf "/usr/share/zoneinfo/$zonename" /tmp/localtime && rm -f /tmp/TZ
|
||||
|
||||
# apply timezone to kernel
|
||||
date -k
|
||||
busybox date -k
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
config_load system
|
||||
config_foreach system_config system
|
||||
config_foreach validate_system_section system system_config
|
||||
}
|
||||
|
||||
service_triggers()
|
||||
|
@ -1,7 +1,12 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
# Copyright (C) 2006 OpenWrt.org
|
||||
|
||||
STOP=99
|
||||
STOP=90
|
||||
|
||||
restart() {
|
||||
:
|
||||
}
|
||||
|
||||
stop() {
|
||||
sync
|
||||
/bin/umount -a -d -r
|
||||
|
@ -1,4 +1,3 @@
|
||||
#!/bin/sh
|
||||
[ -e /tmp/.failsafe ] && export FAILSAFE=1
|
||||
|
||||
[ -f /etc/banner ] && cat /etc/banner
|
||||
@ -13,6 +12,7 @@ export PATH="%PATH%"
|
||||
export HOME=$(grep -e "^${USER:-root}:" /etc/passwd | cut -d ":" -f 6)
|
||||
export HOME=${HOME:-/root}
|
||||
export PS1='\u@\h:\w\$ '
|
||||
export ENV=/etc/shinit
|
||||
|
||||
case "$TERM" in
|
||||
xterm*|rxvt*)
|
||||
@ -20,16 +20,6 @@ case "$TERM" in
|
||||
;;
|
||||
esac
|
||||
|
||||
[ -x /bin/more ] || alias more=less
|
||||
[ -x /usr/bin/vim ] && alias vi=vim || alias vim=vi
|
||||
|
||||
alias ll='ls -alF --color=auto'
|
||||
|
||||
[ -z "$KSH_VERSION" -o \! -s /etc/mkshrc ] || . /etc/mkshrc
|
||||
|
||||
[ -x /usr/bin/arp -o -x /sbin/arp ] || arp() { cat /proc/net/arp; }
|
||||
[ -x /usr/bin/ldd ] || ldd() { LD_TRACE_LOADED_OBJECTS=1 $*; }
|
||||
|
||||
[ -n "$FAILSAFE" ] || {
|
||||
for FILE in /etc/profile.d/*.sh; do
|
||||
[ -e "$FILE" ] && . "$FILE"
|
||||
@ -48,12 +38,3 @@ in order to prevent unauthorized SSH logins.
|
||||
--------------------------------------------------
|
||||
EOF
|
||||
fi
|
||||
|
||||
service() {
|
||||
[ -f "/etc/init.d/$1" ] || {
|
||||
echo "service "'"'"$1"'"'" not found, the following services are available:"
|
||||
ls "/etc/init.d"
|
||||
return 1
|
||||
}
|
||||
/etc/init.d/$@
|
||||
}
|
||||
|
12
package/base-files/files/etc/rc.button/reboot
Executable file
12
package/base-files/files/etc/rc.button/reboot
Executable file
@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
|
||||
[ "${ACTION}" = "released" ] || exit 0
|
||||
|
||||
if [ "$SEEN" -ge 5 ]
|
||||
then
|
||||
echo "REBOOT" > /dev/console
|
||||
sync
|
||||
reboot
|
||||
fi
|
||||
|
||||
return 0
|
@ -73,6 +73,7 @@ Available commands:
|
||||
reload Reload configuration files (or restart if service does not implement reload)
|
||||
enable Enable service autostart
|
||||
disable Disable service autostart
|
||||
enabled Check if service is started on boot
|
||||
$EXTRA_HELP
|
||||
EOF
|
||||
}
|
||||
@ -95,7 +96,9 @@ service_data() {
|
||||
}
|
||||
|
||||
service_running() {
|
||||
return 0
|
||||
local service="${1:-$(basename $initscript)}"
|
||||
local instance="${2:-*}"
|
||||
procd_running "$service" "$instance" "$@"
|
||||
}
|
||||
|
||||
${INIT_TRACE:+set -x}
|
||||
@ -103,7 +106,11 @@ ${INIT_TRACE:+set -x}
|
||||
. "$initscript"
|
||||
|
||||
[ -n "$USE_PROCD" ] && {
|
||||
EXTRA_COMMANDS="${EXTRA_COMMANDS} running trace"
|
||||
EXTRA_COMMANDS="${EXTRA_COMMANDS} running status trace"
|
||||
EXTRA_HELP="\
|
||||
running Check if service is running
|
||||
status Service status
|
||||
${EXTRA_HELP}"
|
||||
|
||||
. $IPKG_INSTROOT/lib/functions/procd.sh
|
||||
basescript=$(readlink "$initscript")
|
||||
@ -131,6 +138,9 @@ ${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() {
|
||||
@ -145,6 +155,14 @@ ${INIT_TRACE:+set -x}
|
||||
running() {
|
||||
service_running "$@"
|
||||
}
|
||||
|
||||
status() {
|
||||
if eval "type status_service" 2>/dev/null >/dev/null; then
|
||||
status_service "$@"
|
||||
else
|
||||
_procd_status "$(basename ${basescript:-$initscript})" "$1"
|
||||
fi
|
||||
}
|
||||
}
|
||||
|
||||
ALL_COMMANDS="start stop reload restart boot shutdown enable disable enabled depends ${EXTRA_COMMANDS}"
|
||||
|
21
package/base-files/files/etc/shinit
Normal file
21
package/base-files/files/etc/shinit
Normal file
@ -0,0 +1,21 @@
|
||||
[ -x /bin/more ] || alias more=less
|
||||
[ -x /usr/bin/vim ] && alias vi=vim || alias vim=vi
|
||||
|
||||
alias ll='ls -alF --color=auto'
|
||||
|
||||
[ -z "$KSH_VERSION" -o \! -s /etc/mkshrc ] || . /etc/mkshrc
|
||||
|
||||
[ -x /usr/bin/arp -o -x /sbin/arp ] || arp() { cat /proc/net/arp; }
|
||||
[ -x /usr/bin/ldd ] || ldd() { LD_TRACE_LOADED_OBJECTS=1 $*; }
|
||||
|
||||
service() {
|
||||
[ -f "/etc/init.d/$1" ] || {
|
||||
echo "service "'"'"$1"'"'" not found, the following services are available:"
|
||||
ls "/etc/init.d"
|
||||
return 1
|
||||
}
|
||||
/etc/init.d/$@
|
||||
}
|
||||
|
||||
[ -n "$KSH_VERSION" -o \! -s "$HOME/.shinit" ] || . "$HOME/.shinit"
|
||||
[ -z "$KSH_VERSION" -o \! -s "$HOME/.mkshrc" ] || . "$HOME/.mkshrc"
|
@ -8,6 +8,8 @@ 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
|
||||
|
@ -1,5 +1,3 @@
|
||||
#!/bin/sh
|
||||
|
||||
ppwd="$(sed -ne '/^root:/s/^root:\([^:]*\):.*$/\1/p' /etc/passwd)"
|
||||
spwd="$(sed -ne '/^root:/s/^root:\([^:]*\):.*$/\1/p' /etc/shadow)"
|
||||
|
||||
|
@ -1,5 +1,3 @@
|
||||
#!/bin/sh
|
||||
|
||||
[ "$(uci -q get network.globals.ula_prefix)" != "auto" ] && exit 0
|
||||
|
||||
r1=$(dd if=/dev/urandom bs=1 count=1 |hexdump -e '1/1 "%02x"')
|
||||
|
@ -0,0 +1,9 @@
|
||||
. /lib/functions.sh
|
||||
|
||||
for file in `grep -sl Require-User /usr/lib/opkg/info/*.control`; do
|
||||
file="${file##*/}"
|
||||
file="${file%.control}"
|
||||
add_group_and_user "${file}"
|
||||
done
|
||||
|
||||
exit 0
|
@ -1,11 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
for file in `grep -sl Require-User /usr/lib/opkg/info/*.control`; do
|
||||
file="${file##*/}"
|
||||
file="${file%.control}"
|
||||
add_group_and_user "${file}"
|
||||
done
|
||||
|
||||
exit 0
|
@ -17,6 +17,22 @@ NO_EXPORT=1
|
||||
LOAD_STATE=1
|
||||
LIST_SEP=" "
|
||||
|
||||
# xor multiple hex values of the same length
|
||||
xor() {
|
||||
local val
|
||||
local ret="0x$1"
|
||||
local retlen=${#1}
|
||||
|
||||
shift
|
||||
while [ -n "$1" ]; do
|
||||
val="0x$1"
|
||||
ret=$((ret ^ val))
|
||||
shift
|
||||
done
|
||||
|
||||
printf "%0${retlen}x" "$ret"
|
||||
}
|
||||
|
||||
append() {
|
||||
local var="$1"
|
||||
local value="$2"
|
||||
@ -54,7 +70,7 @@ config () {
|
||||
local cfgtype="$1"
|
||||
local name="$2"
|
||||
|
||||
export ${NO_EXPORT:+-n} CONFIG_NUM_SECTIONS=$(($CONFIG_NUM_SECTIONS + 1))
|
||||
export ${NO_EXPORT:+-n} CONFIG_NUM_SECTIONS=$((CONFIG_NUM_SECTIONS + 1))
|
||||
name="${name:-cfg$CONFIG_NUM_SECTIONS}"
|
||||
append CONFIG_SECTIONS "$name"
|
||||
export ${NO_EXPORT:+-n} CONFIG_SECTION="$name"
|
||||
@ -77,7 +93,7 @@ list() {
|
||||
|
||||
config_get len "$CONFIG_SECTION" "${varname}_LENGTH" 0
|
||||
[ $len = 0 ] && append CONFIG_LIST_STATE "${CONFIG_SECTION}_${varname}"
|
||||
len=$(($len + 1))
|
||||
len=$((len + 1))
|
||||
config_set "$CONFIG_SECTION" "${varname}_ITEM$len" "$value"
|
||||
config_set "$CONFIG_SECTION" "${varname}_LENGTH" "$len"
|
||||
append "CONFIG_${CONFIG_SECTION}_${varname}" "$value" "$LIST_SEP"
|
||||
@ -92,7 +108,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
|
||||
}
|
||||
@ -127,7 +143,7 @@ config_foreach() {
|
||||
[ -z "$CONFIG_SECTIONS" ] && return 0
|
||||
for section in ${CONFIG_SECTIONS}; do
|
||||
config_get cfgtype "$section" TYPE
|
||||
[ -n "$___type" -a "x$cfgtype" != "x$___type" ] && continue
|
||||
[ -n "$___type" ] && [ "x$cfgtype" != "x$___type" ] && continue
|
||||
eval "$___function \"\$section\" \"\$@\""
|
||||
done
|
||||
}
|
||||
@ -146,7 +162,7 @@ config_list_foreach() {
|
||||
while [ $c -le "$len" ]; do
|
||||
config_get val "${section}" "${option}_ITEM$c"
|
||||
eval "$function \"\$val\" \"\$@\""
|
||||
c="$(($c + 1))"
|
||||
c="$((c + 1))"
|
||||
done
|
||||
}
|
||||
|
||||
@ -213,6 +229,7 @@ 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}"
|
||||
@ -227,23 +244,28 @@ default_postinst() {
|
||||
rm -fR $root/rootfs-overlay/
|
||||
fi
|
||||
|
||||
if [ -z "$root" ] && grep -q -s "^/etc/modules.d/" "/usr/lib/opkg/info/${pkgname}.list"; then
|
||||
kmodloader
|
||||
fi
|
||||
if [ -z "$root" ]; then
|
||||
if grep -m1 -q -s "^/etc/modules.d/" "$filelist"; 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 $(grep -s "^/etc/uci-defaults/" "/usr/lib/opkg/info/${pkgname}.list"); do
|
||||
( [ -f "$i" ] && cd "$(dirname $i)" && . "$i" ) && rm -f "$i"
|
||||
done
|
||||
uci commit
|
||||
fi
|
||||
if grep -m1 -q -s "^/etc/sysctl.d/" "$filelist"; then
|
||||
/etc/init.d/sysctl restart
|
||||
fi
|
||||
|
||||
[ -n "$root" ] || rm -f /tmp/luci-indexcache 2>/dev/null
|
||||
if grep -m1 -q -s "^/etc/uci-defaults/" "$filelist"; then
|
||||
[ -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
|
||||
fi
|
||||
|
||||
local shell="$(which bash)"
|
||||
for i in $(grep -s "^/etc/init.d/" "$root/usr/lib/opkg/info/${pkgname}.list"); do
|
||||
for i in $(grep -s "^/etc/init.d/" "$root$filelist"); do
|
||||
if [ -n "$root" ]; then
|
||||
${shell:-/bin/sh} "$root/etc/rc.common" "$root$i" enable
|
||||
else
|
||||
@ -301,10 +323,10 @@ group_add_next() {
|
||||
echo $gid
|
||||
return
|
||||
fi
|
||||
gids=$(cat ${IPKG_INSTROOT}/etc/group | cut -d: -f3)
|
||||
gids=$(cut -d: -f3 ${IPKG_INSTROOT}/etc/group)
|
||||
gid=65536
|
||||
while [ -n "$(echo "$gids" | grep "^$gid$")" ] ; do
|
||||
gid=$((gid + 1))
|
||||
while echo "$gids" | grep -q "^$gid$"; do
|
||||
gid=$((gid + 1))
|
||||
done
|
||||
group_add $1 $gid
|
||||
echo $gid
|
||||
@ -313,8 +335,8 @@ group_add_next() {
|
||||
group_add_user() {
|
||||
local grp delim=","
|
||||
grp=$(grep -s "^${1}:" ${IPKG_INSTROOT}/etc/group)
|
||||
[ -z "$(echo $grp | cut -d: -f4 | grep $2)" ] || return
|
||||
[ -n "$(echo $grp | grep ":$")" ] && delim=""
|
||||
echo "$grp" | cut -d: -f4 | grep -q $2 && return
|
||||
echo "$grp" | grep -q ":$" && delim=""
|
||||
[ -n "$IPKG_INSTROOT" ] || lock /var/lock/passwd
|
||||
sed -i "s/$grp/$grp$delim$2/g" ${IPKG_INSTROOT}/etc/group
|
||||
[ -n "$IPKG_INSTROOT" ] || lock -u /var/lock/passwd
|
||||
@ -329,10 +351,10 @@ user_add() {
|
||||
local shell="${6:-/bin/false}"
|
||||
local rc
|
||||
[ -z "$uid" ] && {
|
||||
uids=$(cat ${IPKG_INSTROOT}/etc/passwd | cut -d: -f3)
|
||||
uids=$(cut -d: -f3 ${IPKG_INSTROOT}/etc/passwd)
|
||||
uid=65536
|
||||
while [ -n "$(echo "$uids" | grep "^$uid$")" ] ; do
|
||||
uid=$((uid + 1))
|
||||
while echo "$uids" | grep -q "^$uid$"; do
|
||||
uid=$((uid + 1))
|
||||
done
|
||||
}
|
||||
[ -z "$gid" ] && gid=$uid
|
||||
@ -351,4 +373,4 @@ board_name() {
|
||||
[ -e /tmp/sysinfo/board_name ] && cat /tmp/sysinfo/board_name || echo "generic"
|
||||
}
|
||||
|
||||
[ -z "$IPKG_INSTROOT" -a -f /lib/config/uci.sh ] && . /lib/config/uci.sh
|
||||
[ -z "$IPKG_INSTROOT" ] && [ -f /lib/config/uci.sh ] && . /lib/config/uci.sh
|
||||
|
158
package/base-files/files/lib/functions/caldata.sh
Normal file
158
package/base-files/files/lib/functions/caldata.sh
Normal file
@ -0,0 +1,158 @@
|
||||
# Copyright (C) 2019 OpenWrt.org
|
||||
|
||||
. /lib/functions.sh
|
||||
. /lib/functions/system.sh
|
||||
|
||||
caldata_die() {
|
||||
echo "caldata: " "$*"
|
||||
exit 1
|
||||
}
|
||||
|
||||
caldata_extract() {
|
||||
local part=$1
|
||||
local offset=$(($2))
|
||||
local count=$(($3))
|
||||
local mtd
|
||||
|
||||
mtd=$(find_mtd_chardev $part)
|
||||
[ -n "$mtd" ] || caldata_die "no mtd device found for partition $part"
|
||||
|
||||
dd if=$mtd of=/lib/firmware/$FIRMWARE iflag=skip_bytes bs=$count skip=$offset count=1 2>/dev/null || \
|
||||
caldata_die "failed to extract calibration data from $mtd"
|
||||
}
|
||||
|
||||
caldata_extract_ubi() {
|
||||
local part=$1
|
||||
local offset=$(($2))
|
||||
local count=$(($3))
|
||||
local ubidev
|
||||
local ubi
|
||||
|
||||
. /lib/upgrade/nand.sh
|
||||
|
||||
ubidev=$(nand_find_ubi $CI_UBIPART)
|
||||
ubi=$(nand_find_volume $ubidev $part)
|
||||
[ -n "$ubi" ] || caldata_die "no UBI volume found for $part"
|
||||
|
||||
dd if=/dev/$ubi of=/lib/firmware/$FIRMWARE iflag=skip_bytes bs=$count skip=$offset count=1 2>/dev/null || \
|
||||
caldata_die "failed to extract calibration data from $ubi"
|
||||
}
|
||||
|
||||
caldata_extract_reverse() {
|
||||
local part=$1
|
||||
local offset=$2
|
||||
local count=$(($3))
|
||||
local mtd
|
||||
local reversed
|
||||
local caldata
|
||||
|
||||
mtd=$(find_mtd_chardev "$part")
|
||||
reversed=$(hexdump -v -s $offset -n $count -e '/1 "%02x "' $mtd)
|
||||
|
||||
for byte in $reversed; do
|
||||
caldata="\x${byte}${caldata}"
|
||||
done
|
||||
|
||||
printf "%b" "$caldata" > /lib/firmware/$FIRMWARE
|
||||
}
|
||||
|
||||
caldata_from_file() {
|
||||
local source=$1
|
||||
local offset=$(($2))
|
||||
local count=$(($3))
|
||||
local target=$4
|
||||
|
||||
[ -n "$target" ] || target=/lib/firmware/$FIRMWARE
|
||||
|
||||
# dd doesn't handle partial reads from special files: use cat
|
||||
cat $source | dd of=$target iflag=skip_bytes bs=$count skip=$offset count=1 2>/dev/null || \
|
||||
caldata_die "failed to extract calibration data from $source"
|
||||
}
|
||||
|
||||
caldata_sysfsload_from_file() {
|
||||
local source=$1
|
||||
local offset=$(($2))
|
||||
local count=$(($3))
|
||||
|
||||
# dd doesn't handle partial reads from special files: use cat
|
||||
# test extract to /dev/null first
|
||||
cat $source | dd of=/dev/null iflag=skip_bytes bs=$count skip=$offset count=1 2>/dev/null || \
|
||||
caldata_die "failed to extract calibration data from $source"
|
||||
|
||||
# can't fail now
|
||||
echo 1 > /sys/$DEVPATH/loading
|
||||
cat $source | dd of=/sys/$DEVPATH/data iflag=skip_bytes bs=$count skip=$offset count=1 2>/dev/null
|
||||
echo 0 > /sys/$DEVPATH/loading
|
||||
}
|
||||
|
||||
caldata_valid() {
|
||||
local expected="$1"
|
||||
local target=$2
|
||||
|
||||
[ -n "$target" ] || target=/lib/firmware/$FIRMWARE
|
||||
|
||||
magic=$(hexdump -v -n 2 -e '1/1 "%02x"' $target)
|
||||
[ "$magic" = "$expected" ]
|
||||
return $?
|
||||
}
|
||||
|
||||
caldata_patch_chksum() {
|
||||
local mac=$1
|
||||
local mac_offset=$(($2))
|
||||
local chksum_offset=$(($3))
|
||||
local target=$4
|
||||
local xor_mac
|
||||
local xor_fw_mac
|
||||
local xor_fw_chksum
|
||||
|
||||
xor_mac=${mac//:/}
|
||||
xor_mac="${xor_mac:0:4} ${xor_mac:4:4} ${xor_mac:8:4}"
|
||||
|
||||
xor_fw_mac=$(hexdump -v -n 6 -s $mac_offset -e '/1 "%02x"' /lib/firmware/$FIRMWARE)
|
||||
xor_fw_mac="${xor_fw_mac:0:4} ${xor_fw_mac:4:4} ${xor_fw_mac:8:4}"
|
||||
|
||||
xor_fw_chksum=$(hexdump -v -n 2 -s $chksum_offset -e '/1 "%02x"' /lib/firmware/$FIRMWARE)
|
||||
xor_fw_chksum=$(xor $xor_fw_chksum $xor_fw_mac $xor_mac)
|
||||
|
||||
printf "%b" "\x${xor_fw_chksum:0:2}\x${xor_fw_chksum:2:2}" | \
|
||||
dd of=$target conv=notrunc bs=1 seek=$chksum_offset count=2
|
||||
}
|
||||
|
||||
caldata_patch_mac() {
|
||||
local mac=$1
|
||||
local mac_offset=$(($2))
|
||||
local chksum_offset=$3
|
||||
local target=$4
|
||||
|
||||
[ -z "$mac" -o -z "$mac_offset" ] && return
|
||||
|
||||
[ -n "$target" ] || target=/lib/firmware/$FIRMWARE
|
||||
|
||||
[ -n "$chksum_offset" ] && caldata_patch_chksum "$mac" "$mac_offset" "$chksum_offset" "$target"
|
||||
|
||||
macaddr_2bin $mac | dd of=$target conv=notrunc oflag=seek_bytes bs=6 seek=$mac_offset count=1 || \
|
||||
caldata_die "failed to write MAC address to eeprom file"
|
||||
}
|
||||
|
||||
ath9k_patch_mac() {
|
||||
local mac=$1
|
||||
local target=$2
|
||||
|
||||
caldata_patch_mac "$mac" 0x2 "" "$target"
|
||||
}
|
||||
|
||||
ath9k_patch_mac_crc() {
|
||||
local mac=$1
|
||||
local mac_offset=$2
|
||||
local chksum_offset=$((mac_offset - 10))
|
||||
local target=$4
|
||||
|
||||
caldata_patch_mac "$mac" "$mac_offset" "$chksum_offset" "$target"
|
||||
}
|
||||
|
||||
ath10k_patch_mac() {
|
||||
local mac=$1
|
||||
local target=$2
|
||||
|
||||
caldata_patch_mac "$mac" 0x6 0x2 "$target"
|
||||
}
|
@ -1,16 +1,24 @@
|
||||
#!/bin/sh
|
||||
# Copyright (C) 2013 OpenWrt.org
|
||||
|
||||
get_dt_led() {
|
||||
local label
|
||||
get_dt_led_path() {
|
||||
local ledpath
|
||||
local basepath="/proc/device-tree"
|
||||
local nodepath="$basepath/aliases/led-$1"
|
||||
|
||||
[ -f "$nodepath" ] && ledpath=$(cat "$nodepath")
|
||||
[ -n "$ledpath" ] && ledpath="$basepath$ledpath"
|
||||
|
||||
echo "$ledpath"
|
||||
}
|
||||
|
||||
get_dt_led() {
|
||||
local label
|
||||
local ledpath=$(get_dt_led_path $1)
|
||||
|
||||
[ -n "$ledpath" ] && \
|
||||
label=$(cat "$basepath$ledpath/label" 2>/dev/null) || \
|
||||
label=$(cat "$basepath$ledpath/chan-name" 2>/dev/null)
|
||||
label=$(cat "$ledpath/label" 2>/dev/null) || \
|
||||
label=$(cat "$ledpath/chan-name" 2>/dev/null)
|
||||
|
||||
echo "$label"
|
||||
}
|
||||
@ -35,6 +43,17 @@ led_off() {
|
||||
led_set_attr $1 "brightness" 0
|
||||
}
|
||||
|
||||
status_led_restore_trigger() {
|
||||
local trigger
|
||||
local ledpath=$(get_dt_led_path $1)
|
||||
|
||||
[ -n "$ledpath" ] && \
|
||||
trigger=$(cat "$ledpath/linux,default-trigger" 2>/dev/null)
|
||||
|
||||
[ -n "$trigger" ] && \
|
||||
led_set_attr "$(get_dt_led $1)" "trigger" "$trigger"
|
||||
}
|
||||
|
||||
status_led_set_timer() {
|
||||
led_timer $status_led "$1" "$2"
|
||||
[ -n "$status_led2" ] && led_timer $status_led2 "$1" "$2"
|
||||
|
39
package/base-files/files/lib/functions/migrations.sh
Normal file
39
package/base-files/files/lib/functions/migrations.sh
Normal file
@ -0,0 +1,39 @@
|
||||
#!/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}
|
||||
}
|
@ -271,6 +271,11 @@ 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
|
||||
|
@ -1,10 +1,13 @@
|
||||
# Copyright (C) 2006-2013 OpenWrt.org
|
||||
|
||||
. /lib/functions.sh
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
get_mac_binary() {
|
||||
local path="$1"
|
||||
local offset="$2"
|
||||
|
||||
if [ -z "$path" ]; then
|
||||
if ! [ -e "$path" ]; then
|
||||
echo "get_mac_binary: file $path not found!" >&2
|
||||
return
|
||||
fi
|
||||
@ -12,6 +15,44 @@ get_mac_binary() {
|
||||
hexdump -v -n 6 -s $offset -e '5/1 "%02x:" 1/1 "%02x"' $path 2>/dev/null
|
||||
}
|
||||
|
||||
get_mac_label_dt() {
|
||||
local basepath="/proc/device-tree"
|
||||
local macdevice="$(cat "$basepath/aliases/label-mac-device" 2>/dev/null)"
|
||||
local macaddr
|
||||
|
||||
[ -n "$macdevice" ] || return
|
||||
|
||||
macaddr=$(get_mac_binary "$basepath/$macdevice/mac-address" 0 2>/dev/null)
|
||||
[ -n "$macaddr" ] || macaddr=$(get_mac_binary "$basepath/$macdevice/local-mac-address" 0 2>/dev/null)
|
||||
|
||||
echo $macaddr
|
||||
}
|
||||
|
||||
get_mac_label_json() {
|
||||
local cfg="/etc/board.json"
|
||||
local macaddr
|
||||
|
||||
[ -s "$cfg" ] || return
|
||||
|
||||
json_init
|
||||
json_load "$(cat $cfg)"
|
||||
if json_is_a system object; then
|
||||
json_select system
|
||||
json_get_var macaddr label_macaddr
|
||||
json_select ..
|
||||
fi
|
||||
|
||||
echo $macaddr
|
||||
}
|
||||
|
||||
get_mac_label() {
|
||||
local macaddr=$(get_mac_label_dt)
|
||||
|
||||
[ -n "$macaddr" ] || macaddr=$(get_mac_label_json)
|
||||
|
||||
echo $macaddr
|
||||
}
|
||||
|
||||
find_mtd_chardev() {
|
||||
local INDEX=$(find_mtd_index "$1")
|
||||
local PREFIX=/dev/mtd
|
||||
@ -40,7 +81,7 @@ mtd_get_mac_ascii() {
|
||||
|
||||
mtd_get_mac_text() {
|
||||
local mtdname=$1
|
||||
local offset=$2
|
||||
local offset=$(($2))
|
||||
local part
|
||||
local mac_dirty
|
||||
|
||||
@ -79,12 +120,7 @@ mtd_get_mac_binary_ubi() {
|
||||
local ubidev=$(nand_find_ubi $CI_UBIPART)
|
||||
local part=$(nand_find_volume $ubidev $1)
|
||||
|
||||
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
|
||||
get_mac_binary "/dev/$part" "$offset"
|
||||
}
|
||||
|
||||
mtd_get_part_size() {
|
||||
@ -105,10 +141,17 @@ macaddr_add() {
|
||||
local oui=${mac%:*:*:*}
|
||||
local nic=${mac#*:*:*:}
|
||||
|
||||
nic=$(printf "%06x" $((0x${nic//:/} + $val & 0xffffff)) | sed 's/^\(.\{2\}\)\(.\{2\}\)\(.\{2\}\)/\1:\2:\3/')
|
||||
nic=$(printf "%06x" $((0x${nic//:/} + val & 0xffffff)) | sed 's/^\(.\{2\}\)\(.\{2\}\)\(.\{2\}\)/\1:\2:\3/')
|
||||
echo $oui:$nic
|
||||
}
|
||||
|
||||
macaddr_geteui() {
|
||||
local mac=$1
|
||||
local sep=$2
|
||||
|
||||
echo ${mac:9:2}$sep${mac:12:2}$sep${mac:15:2}
|
||||
}
|
||||
|
||||
macaddr_setbit_la() {
|
||||
local mac=$1
|
||||
|
||||
|
@ -182,6 +182,19 @@ _ucidef_finish_switch_roles() {
|
||||
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
|
||||
@ -294,6 +307,14 @@ ucidef_set_interface_macaddr() {
|
||||
ucidef_set_interface "$network" macaddr "$macaddr"
|
||||
}
|
||||
|
||||
ucidef_set_label_macaddr() {
|
||||
local macaddr="$1"
|
||||
|
||||
json_select_object system
|
||||
json_add_string label_macaddr "$macaddr"
|
||||
json_select ..
|
||||
}
|
||||
|
||||
ucidef_add_atm_bridge() {
|
||||
local vpi="$1"
|
||||
local vci="$2"
|
||||
@ -383,7 +404,7 @@ ucidef_set_led_gpio() {
|
||||
}
|
||||
|
||||
ucidef_set_led_ide() {
|
||||
_ucidef_set_led_trigger "$1" "$2" "$3" ide-disk
|
||||
_ucidef_set_led_trigger "$1" "$2" "$3" disk-activity
|
||||
}
|
||||
|
||||
ucidef_set_led_netdev() {
|
||||
@ -463,6 +484,7 @@ _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"
|
||||
@ -551,7 +573,7 @@ ucidef_add_gpio_switch() {
|
||||
json_select_object gpioswitch
|
||||
json_select_object "$cfg"
|
||||
json_add_string name "$name"
|
||||
json_add_int pin "$pin"
|
||||
json_add_string pin "$pin"
|
||||
json_add_int default "$default"
|
||||
json_select ..
|
||||
json_select ..
|
||||
@ -593,6 +615,5 @@ board_config_update() {
|
||||
}
|
||||
|
||||
board_config_flush() {
|
||||
json_dump -i > /tmp/.board.json
|
||||
mv /tmp/.board.json ${CFG}
|
||||
json_dump -i -o ${CFG}
|
||||
}
|
||||
|
@ -33,6 +33,11 @@ preinit_config_switch() {
|
||||
|
||||
json_get_vars enable reset
|
||||
|
||||
if [ "$reset" -eq "1" ]; then
|
||||
swconfig dev $name set reset
|
||||
fi
|
||||
swconfig dev $name set enable_vlan $enable
|
||||
|
||||
if json_is_a roles array; then
|
||||
json_get_keys roles roles
|
||||
json_select roles
|
||||
@ -43,19 +48,15 @@ preinit_config_switch() {
|
||||
json_select ..
|
||||
|
||||
if [ "$device" = "$lan_if" ]; then
|
||||
if [ "$reset" -eq "1" ]; then
|
||||
swconfig dev $name set reset
|
||||
fi
|
||||
|
||||
swconfig dev $name set enable_vlan $enable
|
||||
swconfig dev $name vlan $role set ports "$ports"
|
||||
swconfig dev $name set apply
|
||||
fi
|
||||
done
|
||||
|
||||
json_select ..
|
||||
fi
|
||||
|
||||
swconfig dev $name set apply
|
||||
|
||||
json_select ..
|
||||
json_select ..
|
||||
}
|
||||
|
@ -31,6 +31,8 @@ fs_wait_for_key () {
|
||||
lock $keypress_wait
|
||||
{
|
||||
while [ $timer -gt 0 ]; do
|
||||
pi_failsafe_net_message=true \
|
||||
preinit_net_echo "Please press button now to enter failsafe"
|
||||
echo "$timer" >$keypress_sec
|
||||
timer=$(($timer - 1))
|
||||
sleep 1
|
||||
@ -88,9 +90,6 @@ failsafe_wait() {
|
||||
}
|
||||
grep -q 'failsafe=' /proc/cmdline && FAILSAFE=true && export FAILSAFE
|
||||
if [ "$FAILSAFE" != "true" ]; then
|
||||
pi_failsafe_net_message=true
|
||||
preinit_net_echo "Please press button now to enter failsafe"
|
||||
pi_failsafe_net_message=false
|
||||
fs_wait_for_key f 'to enter failsafe mode' $fs_failsafe_wait_timeout && FAILSAFE=true
|
||||
[ -f "/tmp/failsafe_button" ] && FAILSAFE=true && echo "- failsafe button "`cat /tmp/failsafe_button`" was pressed -"
|
||||
[ "$FAILSAFE" = "true" ] && export FAILSAFE && touch /tmp/failsafe
|
||||
|
@ -9,6 +9,8 @@ do_mount_root() {
|
||||
echo "- config restore -"
|
||||
cd /
|
||||
tar xzf /sysupgrade.tgz
|
||||
# Prevent configuration corruption on a power loss
|
||||
sync
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2,11 +2,6 @@
|
||||
# Copyright (C) 2006-2015 OpenWrt.org
|
||||
# Copyright (C) 2010 Vertical Communications
|
||||
|
||||
failsafe_netlogin () {
|
||||
dropbearkey -t rsa -s 1024 -f /tmp/dropbear_failsafe_host_key
|
||||
dropbear -r /tmp/dropbear_failsafe_host_key <> /dev/null 2>&1
|
||||
}
|
||||
|
||||
failsafe_shell() {
|
||||
local console="$(sed -e 's/ /\n/g' /proc/cmdline | grep '^console=' | head -1 | sed -e 's/^console=//' -e 's/,.*//')"
|
||||
[ -n "$console" ] || console=console
|
||||
@ -17,5 +12,4 @@ failsafe_shell() {
|
||||
done &
|
||||
}
|
||||
|
||||
boot_hook_add failsafe failsafe_netlogin
|
||||
boot_hook_add failsafe failsafe_shell
|
||||
|
@ -2,8 +2,10 @@
|
||||
|
||||
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/'; }
|
||||
libs() { ldd $* 2>/dev/null | sed -E 's/(.* => )?(.*) .*/\2/'; }
|
||||
|
||||
install_file() { # <file> [ <file> ... ]
|
||||
local target dest dir
|
||||
@ -62,7 +64,7 @@ ask_bool() {
|
||||
}
|
||||
|
||||
v() {
|
||||
[ "$VERBOSE" -ge 1 ] && echo "$@"
|
||||
[ -n "$VERBOSE" ] && [ "$VERBOSE" -ge 1 ] && echo "$@"
|
||||
}
|
||||
|
||||
json_string() {
|
||||
@ -100,54 +102,83 @@ get_magic_long() {
|
||||
(get_image "$@" | dd bs=4 count=1 | hexdump -v -n 4 -e '1/1 "%02x"') 2>/dev/null
|
||||
}
|
||||
|
||||
get_magic_gpt() {
|
||||
(get_image "$@" | dd bs=8 count=1 skip=64) 2>/dev/null
|
||||
}
|
||||
|
||||
get_magic_vfat() {
|
||||
(get_image "$@" | dd bs=1 count=3 skip=54) 2>/dev/null
|
||||
}
|
||||
|
||||
part_magic_efi() {
|
||||
local magic=$(get_magic_gpt "$@")
|
||||
[ "$magic" = "EFI PART" ]
|
||||
}
|
||||
|
||||
part_magic_fat() {
|
||||
local magic=$(get_magic_vfat "$@")
|
||||
[ "$magic" = "FAT" ]
|
||||
}
|
||||
|
||||
export_bootdevice() {
|
||||
local cmdline uuid disk uevent line
|
||||
local cmdline bootdisk rootpart uuid blockdev uevent line class
|
||||
local MAJOR MINOR DEVNAME DEVTYPE
|
||||
|
||||
if read cmdline < /proc/cmdline; then
|
||||
case "$cmdline" in
|
||||
*block2mtd=*)
|
||||
disk="${cmdline##*block2mtd=}"
|
||||
disk="${disk%%,*}"
|
||||
bootdisk="${cmdline##*block2mtd=}"
|
||||
bootdisk="${bootdisk%%,*}"
|
||||
;;
|
||||
*root=*)
|
||||
disk="${cmdline##*root=}"
|
||||
disk="${disk%% *}"
|
||||
rootpart="${cmdline##*root=}"
|
||||
rootpart="${rootpart%% *}"
|
||||
;;
|
||||
esac
|
||||
|
||||
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]-[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][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]0002)
|
||||
uuid="${disk#PARTUUID=}"
|
||||
uuid="${uuid%0002}0002"
|
||||
for disk in $(find /dev -type b); do
|
||||
set -- $(dd if=$disk bs=1 skip=$((2*512+256+128+16)) count=16 2>/dev/null | hexdump -v -e '4/1 "%02x"' | awk '{ \
|
||||
for(i=1;i<9;i=i+2) first=substr($0,i,1) substr($0,i+1,1) first; \
|
||||
for(i=9;i<13;i=i+2) second=substr($0,i,1) substr($0,i+1,1) second; \
|
||||
for(i=13;i<16;i=i+2) third=substr($0,i,1) substr($0,i+1,1) third; \
|
||||
fourth = substr($0,17,4); \
|
||||
five = substr($0,21,12); \
|
||||
} END { print toupper(first"-"second"-"third"-"fourth"-"five) }')
|
||||
if [ "$1" = "$uuid" ]; then
|
||||
uevent="/sys/class/block/${disk##*/}/uevent"
|
||||
export SAVE_PARTITIONS=0
|
||||
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 "')
|
||||
if [ "$4$3$2$1" = "$uuid" ]; then
|
||||
uevent="/sys/class/block/${blockdev##*/}/uevent"
|
||||
break
|
||||
fi
|
||||
done
|
||||
;;
|
||||
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}"
|
||||
PARTUUID=????????-????-????-????-??????????02)
|
||||
uuid="${rootpart#PARTUUID=}"
|
||||
uuid="${uuid%02}00"
|
||||
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
|
||||
set -- $(dd if=$disk bs=1 skip=568 count=16 2>/dev/null | hexdump -v -e '8/1 "%02x "" "2/1 "%02x""-"6/1 "%02x"')
|
||||
if [ "$4$3$2$1-$6$5-$8$7-$9" = "$uuid" ]; then
|
||||
uevent="/sys/class/block/${disk##*/}/uevent"
|
||||
break
|
||||
fi
|
||||
done
|
||||
;;
|
||||
/dev/*)
|
||||
uevent="/sys/class/block/${disk##*/}/uevent"
|
||||
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
|
||||
;;
|
||||
esac
|
||||
|
||||
@ -205,27 +236,34 @@ get_partitions() { # <device> <filename>
|
||||
rm -f "/tmp/partmap.$filename"
|
||||
|
||||
local part
|
||||
for part in 1 2 3 4; do
|
||||
set -- $(hexdump -v -n 12 -s "$((0x1B2 + $part * 16))" -e '3/4 "0x%08X "' "$disk")
|
||||
part_magic_efi "$disk" && {
|
||||
#export_partdevice will fail when partition number is greater than 15, as
|
||||
#the partition major device number is not equal to the disk major device number
|
||||
for part in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15; do
|
||||
set -- $(hexdump -v -n 48 -s "$((0x380 + $part * 0x80))" -e '4/4 "%08x"" "4/4 "%08x"" "4/4 "0x%08X "' "$disk")
|
||||
|
||||
local type="$(( $(hex_le32_to_cpu $1) % 256))"
|
||||
local lba="$(( $(hex_le32_to_cpu $2) ))"
|
||||
local num="$(( $(hex_le32_to_cpu $3) ))"
|
||||
local type="$1"
|
||||
local lba="$(( $(hex_le32_to_cpu $4) * 0x100000000 + $(hex_le32_to_cpu $3) ))"
|
||||
local end="$(( $(hex_le32_to_cpu $6) * 0x100000000 + $(hex_le32_to_cpu $5) ))"
|
||||
local num="$(( $end - $lba ))"
|
||||
|
||||
[ $type -gt 0 ] || continue
|
||||
[ "$type" = "00000000000000000000000000000000" ] && continue
|
||||
|
||||
printf "%2d %5d %7d\n" $part $lba $num >> "/tmp/partmap.$filename"
|
||||
done
|
||||
fi
|
||||
}
|
||||
printf "%2d %5d %7d\n" $part $lba $num >> "/tmp/partmap.$filename"
|
||||
done
|
||||
} || {
|
||||
for part in 1 2 3 4; do
|
||||
set -- $(hexdump -v -n 12 -s "$((0x1B2 + $part * 16))" -e '3/4 "0x%08X "' "$disk")
|
||||
|
||||
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
|
||||
local type="$(( $(hex_le32_to_cpu $1) % 256))"
|
||||
local lba="$(( $(hex_le32_to_cpu $2) ))"
|
||||
local num="$(( $(hex_le32_to_cpu $3) ))"
|
||||
|
||||
[ $type -gt 0 ] || continue
|
||||
|
||||
printf "%2d %5d %7d\n" $part $lba $num >> "/tmp/partmap.$filename"
|
||||
done
|
||||
}
|
||||
fi
|
||||
}
|
||||
|
||||
@ -240,34 +278,10 @@ indicate_upgrade() {
|
||||
# $(2): (optional) pipe command to extract firmware, e.g. dd bs=n skip=m
|
||||
default_do_upgrade() {
|
||||
sync
|
||||
if [ "$SAVE_CONFIG" -eq 1 ]; then
|
||||
get_image "$1" "$2" | mtd $MTD_CONFIG_ARGS -j "$CONF_TAR" write - "${PART_NAME:-image}"
|
||||
if [ -n "$UPGRADE_BACKUP" ]; then
|
||||
get_image "$1" "$2" | mtd $MTD_ARGS $MTD_CONFIG_ARGS -j "$UPGRADE_BACKUP" write - "${PART_NAME:-image}"
|
||||
else
|
||||
get_image "$1" "$2" | mtd write - "${PART_NAME:-image}"
|
||||
get_image "$1" "$2" | mtd $MTD_ARGS 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
|
||||
}
|
||||
|
25
package/base-files/files/lib/upgrade/do_stage2
Executable file
25
package/base-files/files/lib/upgrade/do_stage2
Executable file
@ -0,0 +1,25 @@
|
||||
#!/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
|
@ -9,7 +9,7 @@ fwtool_check_signature() {
|
||||
fi
|
||||
}
|
||||
|
||||
if ! fwtool -q -t -s /tmp/sysupgrade.ucert "$1"; then
|
||||
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"
|
||||
@ -18,7 +18,8 @@ fwtool_check_signature() {
|
||||
return 0
|
||||
fi
|
||||
|
||||
ucert -V -m "$1" -c "/tmp/sysupgrade.ucert" -P /etc/opkg/keys
|
||||
fwtool -q -T -s /dev/null "$1" | \
|
||||
ucert -V -m - -c "/tmp/sysupgrade.ucert" -P /etc/opkg/keys
|
||||
|
||||
return $?
|
||||
}
|
||||
|
@ -6,5 +6,6 @@
|
||||
/etc/profile
|
||||
/etc/shadow
|
||||
/etc/shells
|
||||
/etc/shinit
|
||||
/etc/sysctl.conf
|
||||
/etc/rc.local
|
||||
|
@ -109,7 +109,7 @@ nand_restore_config() {
|
||||
rmdir /tmp/new_root
|
||||
return 1
|
||||
fi
|
||||
mv "$1" "/tmp/new_root/sysupgrade.tgz"
|
||||
mv "$1" "/tmp/new_root/$BACKUP_FILE"
|
||||
umount /tmp/new_root
|
||||
sync
|
||||
rmdir /tmp/new_root
|
||||
@ -280,21 +280,8 @@ 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
|
||||
platform_nand_pre_upgrade "$1"
|
||||
fi
|
||||
|
||||
[ ! "$(find_mtd_index "$CI_UBIPART")" ] && CI_UBIPART="rootfs"
|
||||
|
||||
case "$file_type" in
|
||||
|
@ -6,24 +6,13 @@
|
||||
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
|
||||
|
||||
|
||||
@ -50,7 +39,7 @@ switch_to_ramfs() {
|
||||
md5sum hexdump cat zcat bzcat dd tar \
|
||||
ls basename find cp mv rm mkdir rmdir mknod touch chmod \
|
||||
'[' printf wc grep awk sed cut \
|
||||
mtd partx losetup mkfs.ext4 \
|
||||
mtd partx losetup mkfs.ext4 nandwrite flash_erase \
|
||||
ubiupdatevol ubiattach ubiblock ubiformat \
|
||||
ubidetach ubirsvol ubirmvol ubimkvol \
|
||||
snapshot snapshot_tool \
|
||||
@ -59,7 +48,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 $RAMFS_COPY_DATA
|
||||
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
|
||||
|
||||
[ -L "/lib64" ] && ln -s /lib $RAM_ROOT/lib64
|
||||
|
||||
@ -136,10 +125,7 @@ sleep 1
|
||||
|
||||
|
||||
if [ -n "$IMAGE" ] && type 'platform_pre_upgrade' >/dev/null 2>/dev/null; then
|
||||
IS_PRE_UPGRADE=1 platform_pre_upgrade "$IMAGE"
|
||||
|
||||
# Needs to be unset again because of busybox weirdness ...
|
||||
IS_PRE_UPGRADE=
|
||||
platform_pre_upgrade "$IMAGE"
|
||||
fi
|
||||
|
||||
if [ -n "$(rootfs_type)" ]; then
|
||||
|
@ -15,4 +15,4 @@ if [ \! -z "$1" -a -d /etc/hotplug.d/$1 ]; then
|
||||
for script in $(ls /etc/hotplug.d/$1/* 2>&-); do (
|
||||
[ -f $script ] && . $script
|
||||
); done
|
||||
fi
|
||||
fi
|
||||
|
130
package/base-files/files/sbin/pkg_check
Executable file
130
package/base-files/files/sbin/pkg_check
Executable file
@ -0,0 +1,130 @@
|
||||
#!/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
|
@ -5,6 +5,7 @@
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
# initialize defaults
|
||||
export MTD_ARGS=""
|
||||
export MTD_CONFIG_ARGS=""
|
||||
export INTERACTIVE=0
|
||||
export VERBOSE=1
|
||||
@ -126,7 +127,7 @@ list_changed_conffiles() {
|
||||
list_conffiles | while read file csum; do
|
||||
[ -r "$file" ] || continue
|
||||
|
||||
echo "${csum} ${file}" | sha256sum -sc - || echo "$file"
|
||||
echo "${csum} ${file}" | busybox sha256sum -sc - || echo "$file"
|
||||
done
|
||||
}
|
||||
|
||||
@ -191,9 +192,6 @@ add_overlayfiles() {
|
||||
return 0
|
||||
}
|
||||
|
||||
# hooks
|
||||
sysupgrade_image_check="fwtool_check_signature fwtool_check_image platform_check_image"
|
||||
|
||||
if [ $SAVE_OVERLAY = 1 ]; then
|
||||
[ ! -d /overlay/upper/etc ] && {
|
||||
echo "Cannot find '/overlay/upper/etc', required for '-c'" >&2
|
||||
@ -250,7 +248,7 @@ do_save_conffiles() {
|
||||
|
||||
v "Saving config files..."
|
||||
[ "$VERBOSE" -gt 1 ] && TAR_V="v" || TAR_V=""
|
||||
tar c${TAR_V}zpf "$conf_tar" -T "$CONFFILES" 2>/dev/null
|
||||
tar c${TAR_V}zf "$conf_tar" -T "$CONFFILES" 2>/dev/null
|
||||
if [ "$?" -ne 0 ]; then
|
||||
echo "Failed to create the configuration backup."
|
||||
rm -f "$conf_tar"
|
||||
@ -296,7 +294,7 @@ type platform_check_image >/dev/null 2>/dev/null || {
|
||||
case "$IMAGE" in
|
||||
http://*|\
|
||||
https://*)
|
||||
wget -O/tmp/sysupgrade.img "$IMAGE"
|
||||
wget -O/tmp/sysupgrade.img "$IMAGE" || exit 1
|
||||
IMAGE=/tmp/sysupgrade.img
|
||||
;;
|
||||
esac
|
||||
@ -316,20 +314,19 @@ case "$IMAGE" in
|
||||
;;
|
||||
esac
|
||||
|
||||
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!" >&2
|
||||
break
|
||||
else
|
||||
echo "Image check '$check' failed." >&2
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
done
|
||||
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
|
||||
}
|
||||
|
||||
if [ -n "$CONF_IMAGE" ]; then
|
||||
case "$(get_magic_word $CONF_IMAGE cat)" in
|
||||
@ -354,16 +351,10 @@ if [ $TEST -eq 1 ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ $SAVE_PARTITIONS -eq 0 ]; then
|
||||
touch /tmp/sysupgrade.always.overwrite.bootdisk.partmap
|
||||
else
|
||||
rm -f /tmp/sysupgrade.always.overwrite.bootdisk.partmap
|
||||
fi
|
||||
|
||||
install_bin /sbin/upgraded
|
||||
v "Commencing upgrade. Closing all shell sessions."
|
||||
|
||||
COMMAND='. /lib/functions.sh; include /lib/upgrade; do_upgrade_stage2'
|
||||
COMMAND='/lib/upgrade/do_stage2'
|
||||
|
||||
if [ -n "$FAILSAFE" ]; then
|
||||
printf '%s\x00%s\x00%s' "$RAM_ROOT" "$IMAGE" "$COMMAND" >/tmp/sysupgrade
|
||||
|
@ -9,14 +9,14 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=arm-trusted-firmware-mvebu
|
||||
PKG_VERSION:=2.2
|
||||
PKG_RELEASE:=1
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_RELEASE).tar.xz
|
||||
PKG_SOURCE_URL:=https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git
|
||||
PKG_SOURCE_DATE:=2019-10-22
|
||||
PKG_SOURCE_VERSION:=a04808c16cfc126d9fe572ae7c4b5a3d39de5796
|
||||
PKG_MIRROR_HASH:=ff93aad67227ca96db54e92288f61b4ff3abbaad291fc88ad95c29cd3dd3588c
|
||||
PKG_SOURCE_DATE:=2020-01-21
|
||||
PKG_SOURCE_VERSION:=3b3d406ebc6f5dae6b5c9170c674183026e7301b
|
||||
PKG_MIRROR_HASH:=7c63da237c52808e1fe49458d5a4ac804a8eb4c365e26c6b2b709256e8fc041f
|
||||
|
||||
PKG_MAINTAINER:=Vladimir Vid <vladimir.vid@sartura.hr>
|
||||
|
||||
|
49
package/boot/arm-trusted-firmware-rockchip/Makefile
Normal file
49
package/boot/arm-trusted-firmware-rockchip/Makefile
Normal file
@ -0,0 +1,49 @@
|
||||
#
|
||||
# Copyright (C) 2020 Tobias Maedel <openwrt@tbspace.de>
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=arm-trusted-firmware-rockchip
|
||||
PKG_VERSION:=2.3-rc0
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=atf-v$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://github.com/atf-builds/atf/releases/download/v$(PKG_VERSION)/atf-v$(PKG_VERSION).tar.gz?
|
||||
PKG_HASH:=8d0a2bd18adf54f9cf6fe923d10f21c1d21f42a15067757333ff8989b25f100a
|
||||
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
PKG_LICENSE_FILES:=license.md
|
||||
|
||||
PKG_MAINTAINER:=Tobias Maedel <openwrt@tbspace.de>
|
||||
|
||||
MAKE_PATH:=$(PKG_NAME)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/arm-trusted-firmware-rockchip
|
||||
SECTION:=boot
|
||||
CATEGORY:=Boot Loaders
|
||||
TITLE:=ARM Trusted Firmware for Rockchip
|
||||
DEPENDS:=@TARGET_rockchip_armv8
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
$(TAR) -C $(PKG_BUILD_DIR) -xf $(DL_DIR)/$(PKG_SOURCE)
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) -p $(STAGING_DIR_IMAGE)
|
||||
$(CP) $(PKG_BUILD_DIR)/rk3399_bl31.elf $(STAGING_DIR_IMAGE)/bl31.elf
|
||||
endef
|
||||
|
||||
define Package/arm-trusted-firmware-rockchip/install
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,arm-trusted-firmware-rockchip))
|
157
package/boot/grub2/Makefile
Normal file
157
package/boot/grub2/Makefile
Normal file
@ -0,0 +1,157 @@
|
||||
#
|
||||
# Copyright (C) 2006-2015 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=grub
|
||||
PKG_CPE_ID:=cpe:/a:gnu:grub2
|
||||
PKG_VERSION:=2.04
|
||||
PKG_RELEASE:=3
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:=@GNU/grub
|
||||
PKG_HASH:=e5292496995ad42dabe843a0192cf2a2c502e7ffcc7479398232b10a472df77d
|
||||
|
||||
HOST_BUILD_PARALLEL:=1
|
||||
PKG_BUILD_DEPENDS:=grub2/host
|
||||
|
||||
PKG_ASLR_PIE:=0
|
||||
PKG_SSP:=0
|
||||
|
||||
PKG_FLAGS:=nonshared
|
||||
|
||||
include $(INCLUDE_DIR)/host-build.mk
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/grub2/Default
|
||||
CATEGORY:=Boot Loaders
|
||||
SECTION:=boot
|
||||
TITLE:=GRand Unified Bootloader ($(1))
|
||||
URL:=http://www.gnu.org/software/grub/
|
||||
DEPENDS:=@TARGET_x86
|
||||
VARIANT:=$(1)
|
||||
endef
|
||||
|
||||
Package/grub2=$(call Package/grub2/Default,pc)
|
||||
Package/grub2-efi=$(call Package/grub2/Default,efi)
|
||||
|
||||
define Package/grub2-editenv
|
||||
CATEGORY:=Utilities
|
||||
SECTION:=utils
|
||||
SUBMENU:=Boot Loaders
|
||||
TITLE:=Grub2 Environment editor
|
||||
URL:=http://www.gnu.org/software/grub/
|
||||
DEPENDS:=@TARGET_x86
|
||||
VARIANT:=pc
|
||||
endef
|
||||
|
||||
define Package/grub2-editenv/description
|
||||
Edit grub2 environment files.
|
||||
endef
|
||||
|
||||
HOST_BUILD_PREFIX := $(STAGING_DIR_HOST)
|
||||
|
||||
CONFIGURE_VARS += \
|
||||
grub_build_mkfont_excuse="don't want fonts"
|
||||
|
||||
CONFIGURE_ARGS += \
|
||||
--target=$(REAL_GNU_TARGET_NAME) \
|
||||
--disable-werror \
|
||||
--disable-nls \
|
||||
--disable-device-mapper \
|
||||
--disable-libzfs \
|
||||
--disable-grub-mkfont \
|
||||
--with-platform=$(BUILD_VARIANT)
|
||||
|
||||
HOST_CONFIGURE_VARS += \
|
||||
grub_build_mkfont_excuse="don't want fonts"
|
||||
|
||||
HOST_CONFIGURE_ARGS += \
|
||||
--disable-grub-mkfont \
|
||||
--target=$(REAL_GNU_TARGET_NAME) \
|
||||
--sbindir="$(STAGING_DIR_HOST)/bin" \
|
||||
--disable-werror \
|
||||
--disable-libzfs \
|
||||
--disable-nls \
|
||||
--with-platform=none
|
||||
|
||||
HOST_MAKE_FLAGS += \
|
||||
TARGET_RANLIB=$(TARGET_RANLIB) \
|
||||
LIBLZMA=$(STAGING_DIR_HOST)/lib/liblzma.a
|
||||
|
||||
TARGET_CFLAGS := $(filter-out -fno-plt,$(TARGET_CFLAGS))
|
||||
|
||||
define Host/Configure
|
||||
$(SED) 's,(RANLIB),(TARGET_RANLIB),' $(HOST_BUILD_DIR)/grub-core/Makefile.in
|
||||
$(Host/Configure/Default)
|
||||
endef
|
||||
|
||||
define Package/grub2/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/grub-bios-setup $(1)/usr/sbin/
|
||||
$(INSTALL_DIR) $(STAGING_DIR_IMAGE)/grub2
|
||||
$(CP) $(PKG_BUILD_DIR)/grub-core/boot.img $(STAGING_DIR_IMAGE)/grub2/
|
||||
$(CP) $(PKG_BUILD_DIR)/grub-core/cdboot.img $(STAGING_DIR_IMAGE)/grub2/
|
||||
sed 's#msdos1#gpt1#g' ./files/grub-early.cfg >$(PKG_BUILD_DIR)/grub-early.cfg
|
||||
$(STAGING_DIR_HOST)/bin/grub-mkimage \
|
||||
-d $(PKG_BUILD_DIR)/grub-core \
|
||||
-p /boot/grub \
|
||||
-O i386-pc \
|
||||
-c $(PKG_BUILD_DIR)/grub-early.cfg \
|
||||
-o $(STAGING_DIR_IMAGE)/grub2/gpt-core.img \
|
||||
at_keyboard biosdisk boot chain configfile fat linux ls part_gpt reboot serial vga
|
||||
$(STAGING_DIR_HOST)/bin/grub-mkimage \
|
||||
-d $(PKG_BUILD_DIR)/grub-core \
|
||||
-p /boot/grub \
|
||||
-O i386-pc \
|
||||
-c ./files/grub-early.cfg \
|
||||
-o $(STAGING_DIR_IMAGE)/grub2/generic-core.img \
|
||||
at_keyboard biosdisk boot chain configfile ext2 linux ls part_msdos reboot serial vga
|
||||
$(STAGING_DIR_HOST)/bin/grub-mkimage \
|
||||
-d $(PKG_BUILD_DIR)/grub-core \
|
||||
-p /boot/grub \
|
||||
-O i386-pc \
|
||||
-c ./files/grub-early.cfg \
|
||||
-o $(STAGING_DIR_IMAGE)/grub2/eltorito.img \
|
||||
at_keyboard biosdisk boot chain configfile iso9660 linux ls part_msdos reboot serial test vga
|
||||
$(STAGING_DIR_HOST)/bin/grub-mkimage \
|
||||
-d $(PKG_BUILD_DIR)/grub-core \
|
||||
-p /boot/grub \
|
||||
-O i386-pc \
|
||||
-c ./files/grub-early.cfg \
|
||||
-o $(STAGING_DIR_IMAGE)/grub2/legacy-core.img \
|
||||
biosdisk boot chain configfile ext2 linux ls part_msdos reboot serial vga
|
||||
endef
|
||||
|
||||
define Package/grub2-efi/install
|
||||
sed 's#msdos1#gpt1#g' ./files/grub-early.cfg >$(PKG_BUILD_DIR)/grub-early.cfg
|
||||
$(STAGING_DIR_HOST)/bin/grub-mkimage \
|
||||
-d $(PKG_BUILD_DIR)/grub-core \
|
||||
-p /boot/grub \
|
||||
-O $(CONFIG_ARCH)-efi \
|
||||
-c $(PKG_BUILD_DIR)/grub-early.cfg \
|
||||
-o $(STAGING_DIR_IMAGE)/grub2/boot$(if $(CONFIG_x86_64),x64,ia32).efi \
|
||||
at_keyboard boot chain configfile fat linux ls part_gpt reboot serial efi_gop efi_uga
|
||||
$(STAGING_DIR_HOST)/bin/grub-mkimage \
|
||||
-d $(PKG_BUILD_DIR)/grub-core \
|
||||
-p /boot/grub \
|
||||
-O $(CONFIG_ARCH)-efi \
|
||||
-c ./files/grub-early.cfg \
|
||||
-o $(STAGING_DIR_IMAGE)/grub2/iso-boot$(if $(CONFIG_x86_64),x64,ia32).efi \
|
||||
at_keyboard boot chain configfile fat iso9660 linux ls part_msdos part_gpt reboot serial test efi_gop efi_uga
|
||||
endef
|
||||
|
||||
define Package/grub2-editenv/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/grub-editenv $(1)/usr/sbin/
|
||||
endef
|
||||
|
||||
$(eval $(call HostBuild))
|
||||
$(eval $(call BuildPackage,grub2))
|
||||
$(eval $(call BuildPackage,grub2-efi))
|
||||
$(eval $(call BuildPackage,grub2-editenv))
|
@ -1,73 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2006-2015 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_CPE_ID:=cpe:/a:gnu:grub2
|
||||
PKG_VERSION:=2.04
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=grub-$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:=@GNU/grub
|
||||
PKG_HASH:=e5292496995ad42dabe843a0192cf2a2c502e7ffcc7479398232b10a472df77d
|
||||
|
||||
HOST_BUILD_PARALLEL:=1
|
||||
|
||||
PKG_SSP:=0
|
||||
|
||||
PKG_FLAGS:=nonshared
|
||||
|
||||
PATCH_DIR := ../patches
|
||||
HOST_PATCH_DIR := ../patches
|
||||
HOST_BUILD_DIR := $(BUILD_DIR_HOST)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
include $(INCLUDE_DIR)/host-build.mk
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/grub2/Default
|
||||
CATEGORY:=Boot Loaders
|
||||
SECTION:=boot
|
||||
TITLE:=GRand Unified Bootloader
|
||||
URL:=http://www.gnu.org/software/grub/
|
||||
DEPENDS:=@TARGET_x86||TARGET_x86_64
|
||||
endef
|
||||
|
||||
HOST_BUILD_PREFIX := $(STAGING_DIR_HOST)
|
||||
|
||||
CONFIGURE_VARS += \
|
||||
grub_build_mkfont_excuse="don't want fonts"
|
||||
|
||||
CONFIGURE_ARGS += \
|
||||
--target=$(REAL_GNU_TARGET_NAME) \
|
||||
--disable-werror \
|
||||
--disable-nls \
|
||||
--disable-device-mapper \
|
||||
--disable-libzfs \
|
||||
--disable-grub-mkfont \
|
||||
--with-platform=none
|
||||
|
||||
HOST_CONFIGURE_VARS += \
|
||||
grub_build_mkfont_excuse="don't want fonts"
|
||||
|
||||
HOST_CONFIGURE_ARGS += \
|
||||
--disable-grub-mkfont \
|
||||
--target=$(REAL_GNU_TARGET_NAME) \
|
||||
--sbindir="$(STAGING_DIR_HOST)/bin" \
|
||||
--disable-werror \
|
||||
--disable-libzfs \
|
||||
--disable-nls
|
||||
|
||||
HOST_MAKE_FLAGS += \
|
||||
TARGET_RANLIB=$(TARGET_RANLIB) \
|
||||
LIBLZMA=$(STAGING_DIR_HOST)/lib/liblzma.a
|
||||
|
||||
define Host/Configure
|
||||
$(SED) 's,(RANLIB),(TARGET_RANLIB),' $(HOST_BUILD_DIR)/grub-core/Makefile.in
|
||||
$(Host/Configure/Default)
|
||||
endef
|
||||
|
@ -1,23 +0,0 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=grub-efi
|
||||
|
||||
include ../common.mk
|
||||
|
||||
TAR_OPTIONS:= --transform 's/grub-${PKG_VERSION}/${PKG_NAME}-${PKG_VERSION}/' $(TAR_OPTIONS)
|
||||
|
||||
PKG_BUILD_DEPENDS:=grub2-efi/host
|
||||
|
||||
CONFIGURE_ARGS += --with-platform=efi
|
||||
HOST_CONFIGURE_ARGS += --with-platform=efi --program-suffix=-efi
|
||||
HOST_BUILD_DIR := $(BUILD_DIR_HOST)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
define Package/grub2-efi
|
||||
$(call Package/grub2/Default)
|
||||
HIDDEN:=1
|
||||
TITLE += (with EFI support)
|
||||
endef
|
||||
|
||||
$(eval $(call HostBuild))
|
||||
$(eval $(call BuildPackage,grub2-efi))
|
@ -1,33 +0,0 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=grub
|
||||
|
||||
include ../common.mk
|
||||
|
||||
PKG_BUILD_DEPENDS:=grub2/host
|
||||
|
||||
define Package/grub2
|
||||
$(call Package/grub2/Default)
|
||||
endef
|
||||
|
||||
define Package/grub2-editenv
|
||||
CATEGORY:=Utilities
|
||||
SECTION:=utils
|
||||
TITLE:=Grub2 Environment editor
|
||||
URL:=http://www.gnu.org/software/grub/
|
||||
DEPENDS:=@TARGET_x86||TARGET_x86_64
|
||||
endef
|
||||
|
||||
define Package/grub2-editenv/description
|
||||
Edit grub2 environment files.
|
||||
endef
|
||||
|
||||
define Package/grub2-editenv/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/grub-editenv $(1)/usr/sbin/
|
||||
endef
|
||||
|
||||
$(eval $(call HostBuild))
|
||||
$(eval $(call BuildPackage,grub2))
|
||||
$(eval $(call BuildPackage,grub2-editenv))
|
@ -0,0 +1,31 @@
|
||||
From: David Michael <fedora.dm0@gmail.com>
|
||||
Date: Fri, 5 Jul 2019 07:45:59 -0400
|
||||
Subject: [PATCH] verifiers: Blocklist fallout cleanup
|
||||
|
||||
Blocklist fallout cleanup after commit 5c6f9bc15 (generic/blocklist: Fix
|
||||
implicit declaration of function grub_file_filter_disable_compression()).
|
||||
|
||||
Signed-off-by: David Michael <fedora.dm0@gmail.com>
|
||||
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
|
||||
---
|
||||
|
||||
--- a/grub-core/osdep/generic/blocklist.c
|
||||
+++ b/grub-core/osdep/generic/blocklist.c
|
||||
@@ -59,7 +59,7 @@ grub_install_get_blocklist (grub_device_
|
||||
|
||||
grub_disk_cache_invalidate_all ();
|
||||
|
||||
- file = grub_file_open (core_path_dev, GRUB_FILE_TYPE_NONE | FILE_TYPE_NO_DECOMPRESS);
|
||||
+ file = grub_file_open (core_path_dev, GRUB_FILE_TYPE_NONE | GRUB_FILE_TYPE_NO_DECOMPRESS);
|
||||
if (file)
|
||||
{
|
||||
if (grub_file_size (file) != core_size)
|
||||
@@ -116,7 +116,7 @@ grub_install_get_blocklist (grub_device_
|
||||
|
||||
grub_file_t file;
|
||||
/* Now read the core image to determine where the sectors are. */
|
||||
- file = grub_file_open (core_path_dev, GRUB_FILE_TYPE_NONE | FILE_TYPE_NO_DECOMPRESS);
|
||||
+ file = grub_file_open (core_path_dev, GRUB_FILE_TYPE_NONE | GRUB_FILE_TYPE_NO_DECOMPRESS);
|
||||
if (! file)
|
||||
grub_util_error ("%s", grub_errmsg);
|
||||
|
@ -42,7 +42,7 @@
|
||||
|
||||
--- a/util/setup.c
|
||||
+++ b/util/setup.c
|
||||
@@ -247,13 +247,12 @@ identify_partmap (grub_disk_t disk __att
|
||||
@@ -252,13 +252,12 @@ identify_partmap (grub_disk_t disk __att
|
||||
void
|
||||
SETUP (const char *dir,
|
||||
const char *boot_file, const char *core_file,
|
||||
|
@ -32,7 +32,7 @@ Signed-off-by: Ismael Ripoll-Ripoll <iripoll@disca.upv.es>
|
||||
@@ -172,7 +172,7 @@ grub_username_get (char buf[], unsigned
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
- if (key == GRUB_TERM_BACKSPACE)
|
||||
+ if (key == GRUB_TERM_BACKSPACE && cur_len)
|
||||
{
|
||||
|
@ -1,10 +1,22 @@
|
||||
#!/bin/sh
|
||||
|
||||
# kB disable if mem low than 256MB
|
||||
memtotal=`grep MemTotal /proc/meminfo | awk '{print $2}'`
|
||||
if test $memtotal -le 262144; then
|
||||
exit 0
|
||||
fi
|
||||
KZ=128
|
||||
if test $memtotal -ge 8388608; then
|
||||
KZ=512
|
||||
elif test $memtotal -ge 4194304; then
|
||||
KZ=256
|
||||
fi
|
||||
|
||||
case $(uname -m) in
|
||||
i?86|x86_64)
|
||||
if ! grep -q crashkernel /boot/grub/grub.cfg; then
|
||||
mount /boot -o remount,rw
|
||||
sed -i 's/linux.*/& crashkernel=32M@32M/' /boot/grub/grub.cfg
|
||||
sed -i "s/linux.*/& crashkernel=${KZ}M/" /boot/grub/grub.cfg
|
||||
mount /boot -o remount,ro
|
||||
fi
|
||||
;;
|
||||
|
@ -3,6 +3,8 @@
|
||||
START=41
|
||||
STOP=90
|
||||
|
||||
BOOT_IMAGE=/boot/vmlinuz
|
||||
|
||||
EXTRA_COMMANDS="status"
|
||||
EXTRA_HELP=" status Print crashkernel status"
|
||||
|
||||
|
@ -0,0 +1,14 @@
|
||||
diff --git a/kexec/arch/x86_64/kexec-elf-rel-x86_64.c b/kexec/arch/x86_64/kexec-elf-rel-x86_64.c
|
||||
index 7fdde73..af33689 100644
|
||||
--- a/kexec/arch/x86_64/kexec-elf-rel-x86_64.c
|
||||
+++ b/kexec/arch/x86_64/kexec-elf-rel-x86_64.c
|
||||
@@ -78,7 +78,8 @@ void machine_apply_elf_rel(struct mem_ehdr *UNUSED(ehdr),
|
||||
if ((int64_t)value != *(int32_t *)location)
|
||||
goto overflow;
|
||||
break;
|
||||
- case R_X86_64_PC32:
|
||||
+ case R_X86_64_PC32:
|
||||
+ case R_X86_64_PLT32:
|
||||
*(uint32_t *)location = value - address;
|
||||
break;
|
||||
default:
|
@ -1,47 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2010 Gabor Juhos <juhosg@openwrt.org>
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=rbcfg
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
||||
|
||||
PKG_FLAGS:=nonshared
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/rbcfg
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=Boot Loaders
|
||||
TITLE:=RouterBOOT configuration tool
|
||||
DEPENDS:=@(TARGET_ar71xx||TARGET_ath79)
|
||||
endef
|
||||
|
||||
define Package/rbcfg/description
|
||||
This package contains an utility to manipulate RouterBOOT configuration on the
|
||||
MikroTIK RB-4XX devices.
|
||||
endef
|
||||
|
||||
define Build/Configure
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
$(MAKE) -C $(PKG_BUILD_DIR) \
|
||||
CC="$(TARGET_CC)" \
|
||||
CFLAGS="$(TARGET_CFLAGS) -Wall" \
|
||||
LDFLAGS="$(TARGET_LDFLAGS)"
|
||||
endef
|
||||
|
||||
define Package/rbcfg/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/rbcfg $(1)/usr/sbin/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,rbcfg))
|
@ -1,14 +0,0 @@
|
||||
CC = gcc
|
||||
CFLAGS = -Wall
|
||||
OBJS = main.o cyg_crc32.o
|
||||
|
||||
all: rbcfg
|
||||
|
||||
%.o: %.c
|
||||
$(CC) $(CFLAGS) -c -o $@ $<
|
||||
|
||||
rbcfg: $(OBJS)
|
||||
$(CC) -o $@ $(OBJS)
|
||||
|
||||
clean:
|
||||
rm -f rbcfg *.o
|
@ -1,109 +0,0 @@
|
||||
//==========================================================================
|
||||
//
|
||||
// crc.h
|
||||
//
|
||||
// Interface for the CRC algorithms.
|
||||
//
|
||||
//==========================================================================
|
||||
//####ECOSGPLCOPYRIGHTBEGIN####
|
||||
// -------------------------------------------
|
||||
// This file is part of eCos, the Embedded Configurable Operating System.
|
||||
// Copyright (C) 2002 Andrew Lunn
|
||||
//
|
||||
// eCos 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 2 or (at your option) any later version.
|
||||
//
|
||||
// eCos 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 eCos; if not, write to the Free Software Foundation, Inc.,
|
||||
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
//
|
||||
// As a special exception, if other files instantiate templates or use macros
|
||||
// or inline functions from this file, or you compile this file and link it
|
||||
// with other works to produce a work based on this file, this file does not
|
||||
// by itself cause the resulting work to be covered by the GNU General Public
|
||||
// License. However the source code for this file must still be made available
|
||||
// in accordance with section (3) of the GNU General Public License.
|
||||
//
|
||||
// This exception does not invalidate any other reasons why a work based on
|
||||
// this file might be covered by the GNU General Public License.
|
||||
//
|
||||
// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
|
||||
// at http://sources.redhat.com/ecos/ecos-license/
|
||||
// -------------------------------------------
|
||||
//####ECOSGPLCOPYRIGHTEND####
|
||||
//==========================================================================
|
||||
//#####DESCRIPTIONBEGIN####
|
||||
//
|
||||
// Author(s): Andrew Lunn
|
||||
// Contributors: Andrew Lunn
|
||||
// Date: 2002-08-06
|
||||
// Purpose:
|
||||
// Description:
|
||||
//
|
||||
// This code is part of eCos (tm).
|
||||
//
|
||||
//####DESCRIPTIONEND####
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
#ifndef _SERVICES_CRC_CRC_H_
|
||||
#define _SERVICES_CRC_CRC_H_
|
||||
|
||||
#if 0
|
||||
#include <cyg/infra/cyg_type.h>
|
||||
#else
|
||||
#include <stdint.h>
|
||||
typedef uint32_t cyg_uint32;
|
||||
typedef uint16_t cyg_uint16;
|
||||
#endif
|
||||
|
||||
#ifndef __externC
|
||||
# ifdef __cplusplus
|
||||
# define __externC extern "C"
|
||||
# else
|
||||
# define __externC extern
|
||||
# endif
|
||||
#endif
|
||||
|
||||
// Compute a CRC, using the POSIX 1003 definition
|
||||
|
||||
__externC cyg_uint32
|
||||
cyg_posix_crc32(unsigned char *s, int len);
|
||||
|
||||
// Gary S. Brown's 32 bit CRC
|
||||
|
||||
__externC cyg_uint32
|
||||
cyg_crc32(unsigned char *s, int len);
|
||||
|
||||
// Gary S. Brown's 32 bit CRC, but accumulate the result from a
|
||||
// previous CRC calculation
|
||||
|
||||
__externC cyg_uint32
|
||||
cyg_crc32_accumulate(cyg_uint32 crc, unsigned char *s, int len);
|
||||
|
||||
// Ethernet FCS Algorithm
|
||||
|
||||
__externC cyg_uint32
|
||||
cyg_ether_crc32(unsigned char *s, int len);
|
||||
|
||||
// Ethernet FCS algorithm, but accumulate the result from a previous
|
||||
// CRC calculation.
|
||||
|
||||
__externC cyg_uint32
|
||||
cyg_ether_crc32_accumulate(cyg_uint32 crc, unsigned char *s, int len);
|
||||
|
||||
// 16 bit CRC with polynomial x^16+x^12+x^5+1
|
||||
|
||||
__externC cyg_uint16
|
||||
cyg_crc16(unsigned char *s, int len);
|
||||
|
||||
#endif // _SERVICES_CRC_CRC_H_
|
||||
|
||||
|
||||
|
@ -1,172 +0,0 @@
|
||||
//==========================================================================
|
||||
//
|
||||
// crc32.c
|
||||
//
|
||||
// Gary S. Brown's 32 bit CRC
|
||||
//
|
||||
//==========================================================================
|
||||
//####ECOSGPLCOPYRIGHTBEGIN####
|
||||
// -------------------------------------------
|
||||
// This file is part of eCos, the Embedded Configurable Operating System.
|
||||
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
|
||||
// Copyright (C) 2002 Gary Thomas
|
||||
//
|
||||
// eCos 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 2 or (at your option) any later version.
|
||||
//
|
||||
// eCos 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 eCos; if not, write to the Free Software Foundation, Inc.,
|
||||
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
//
|
||||
// As a special exception, if other files instantiate templates or use macros
|
||||
// or inline functions from this file, or you compile this file and link it
|
||||
// with other works to produce a work based on this file, this file does not
|
||||
// by itself cause the resulting work to be covered by the GNU General Public
|
||||
// License. However the source code for this file must still be made available
|
||||
// in accordance with section (3) of the GNU General Public License.
|
||||
//
|
||||
// This exception does not invalidate any other reasons why a work based on
|
||||
// this file might be covered by the GNU General Public License.
|
||||
//
|
||||
// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
|
||||
// at http://sources.redhat.com/ecos/ecos-license/
|
||||
// -------------------------------------------
|
||||
//####ECOSGPLCOPYRIGHTEND####
|
||||
//==========================================================================
|
||||
//#####DESCRIPTIONBEGIN####
|
||||
//
|
||||
// Author(s): gthomas
|
||||
// Contributors: gthomas,asl
|
||||
// Date: 2001-01-31
|
||||
// Purpose:
|
||||
// Description:
|
||||
//
|
||||
// This code is part of eCos (tm).
|
||||
//
|
||||
//####DESCRIPTIONEND####
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
#if 0
|
||||
#include <cyg/crc/crc.h>
|
||||
#else
|
||||
#include "cyg_crc.h"
|
||||
#endif
|
||||
|
||||
/* ====================================================================== */
|
||||
/* COPYRIGHT (C) 1986 Gary S. Brown. You may use this program, or */
|
||||
/* code or tables extracted from it, as desired without restriction. */
|
||||
/* */
|
||||
/* First, the polynomial itself and its table of feedback terms. The */
|
||||
/* polynomial is */
|
||||
/* X^32+X^26+X^23+X^22+X^16+X^12+X^11+X^10+X^8+X^7+X^5+X^4+X^2+X^1+X^0 */
|
||||
/* */
|
||||
/* ====================================================================== */
|
||||
|
||||
static const cyg_uint32 crc32_tab[] = {
|
||||
0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL, 0x076dc419L,
|
||||
0x706af48fL, 0xe963a535L, 0x9e6495a3L, 0x0edb8832L, 0x79dcb8a4L,
|
||||
0xe0d5e91eL, 0x97d2d988L, 0x09b64c2bL, 0x7eb17cbdL, 0xe7b82d07L,
|
||||
0x90bf1d91L, 0x1db71064L, 0x6ab020f2L, 0xf3b97148L, 0x84be41deL,
|
||||
0x1adad47dL, 0x6ddde4ebL, 0xf4d4b551L, 0x83d385c7L, 0x136c9856L,
|
||||
0x646ba8c0L, 0xfd62f97aL, 0x8a65c9ecL, 0x14015c4fL, 0x63066cd9L,
|
||||
0xfa0f3d63L, 0x8d080df5L, 0x3b6e20c8L, 0x4c69105eL, 0xd56041e4L,
|
||||
0xa2677172L, 0x3c03e4d1L, 0x4b04d447L, 0xd20d85fdL, 0xa50ab56bL,
|
||||
0x35b5a8faL, 0x42b2986cL, 0xdbbbc9d6L, 0xacbcf940L, 0x32d86ce3L,
|
||||
0x45df5c75L, 0xdcd60dcfL, 0xabd13d59L, 0x26d930acL, 0x51de003aL,
|
||||
0xc8d75180L, 0xbfd06116L, 0x21b4f4b5L, 0x56b3c423L, 0xcfba9599L,
|
||||
0xb8bda50fL, 0x2802b89eL, 0x5f058808L, 0xc60cd9b2L, 0xb10be924L,
|
||||
0x2f6f7c87L, 0x58684c11L, 0xc1611dabL, 0xb6662d3dL, 0x76dc4190L,
|
||||
0x01db7106L, 0x98d220bcL, 0xefd5102aL, 0x71b18589L, 0x06b6b51fL,
|
||||
0x9fbfe4a5L, 0xe8b8d433L, 0x7807c9a2L, 0x0f00f934L, 0x9609a88eL,
|
||||
0xe10e9818L, 0x7f6a0dbbL, 0x086d3d2dL, 0x91646c97L, 0xe6635c01L,
|
||||
0x6b6b51f4L, 0x1c6c6162L, 0x856530d8L, 0xf262004eL, 0x6c0695edL,
|
||||
0x1b01a57bL, 0x8208f4c1L, 0xf50fc457L, 0x65b0d9c6L, 0x12b7e950L,
|
||||
0x8bbeb8eaL, 0xfcb9887cL, 0x62dd1ddfL, 0x15da2d49L, 0x8cd37cf3L,
|
||||
0xfbd44c65L, 0x4db26158L, 0x3ab551ceL, 0xa3bc0074L, 0xd4bb30e2L,
|
||||
0x4adfa541L, 0x3dd895d7L, 0xa4d1c46dL, 0xd3d6f4fbL, 0x4369e96aL,
|
||||
0x346ed9fcL, 0xad678846L, 0xda60b8d0L, 0x44042d73L, 0x33031de5L,
|
||||
0xaa0a4c5fL, 0xdd0d7cc9L, 0x5005713cL, 0x270241aaL, 0xbe0b1010L,
|
||||
0xc90c2086L, 0x5768b525L, 0x206f85b3L, 0xb966d409L, 0xce61e49fL,
|
||||
0x5edef90eL, 0x29d9c998L, 0xb0d09822L, 0xc7d7a8b4L, 0x59b33d17L,
|
||||
0x2eb40d81L, 0xb7bd5c3bL, 0xc0ba6cadL, 0xedb88320L, 0x9abfb3b6L,
|
||||
0x03b6e20cL, 0x74b1d29aL, 0xead54739L, 0x9dd277afL, 0x04db2615L,
|
||||
0x73dc1683L, 0xe3630b12L, 0x94643b84L, 0x0d6d6a3eL, 0x7a6a5aa8L,
|
||||
0xe40ecf0bL, 0x9309ff9dL, 0x0a00ae27L, 0x7d079eb1L, 0xf00f9344L,
|
||||
0x8708a3d2L, 0x1e01f268L, 0x6906c2feL, 0xf762575dL, 0x806567cbL,
|
||||
0x196c3671L, 0x6e6b06e7L, 0xfed41b76L, 0x89d32be0L, 0x10da7a5aL,
|
||||
0x67dd4accL, 0xf9b9df6fL, 0x8ebeeff9L, 0x17b7be43L, 0x60b08ed5L,
|
||||
0xd6d6a3e8L, 0xa1d1937eL, 0x38d8c2c4L, 0x4fdff252L, 0xd1bb67f1L,
|
||||
0xa6bc5767L, 0x3fb506ddL, 0x48b2364bL, 0xd80d2bdaL, 0xaf0a1b4cL,
|
||||
0x36034af6L, 0x41047a60L, 0xdf60efc3L, 0xa867df55L, 0x316e8eefL,
|
||||
0x4669be79L, 0xcb61b38cL, 0xbc66831aL, 0x256fd2a0L, 0x5268e236L,
|
||||
0xcc0c7795L, 0xbb0b4703L, 0x220216b9L, 0x5505262fL, 0xc5ba3bbeL,
|
||||
0xb2bd0b28L, 0x2bb45a92L, 0x5cb36a04L, 0xc2d7ffa7L, 0xb5d0cf31L,
|
||||
0x2cd99e8bL, 0x5bdeae1dL, 0x9b64c2b0L, 0xec63f226L, 0x756aa39cL,
|
||||
0x026d930aL, 0x9c0906a9L, 0xeb0e363fL, 0x72076785L, 0x05005713L,
|
||||
0x95bf4a82L, 0xe2b87a14L, 0x7bb12baeL, 0x0cb61b38L, 0x92d28e9bL,
|
||||
0xe5d5be0dL, 0x7cdcefb7L, 0x0bdbdf21L, 0x86d3d2d4L, 0xf1d4e242L,
|
||||
0x68ddb3f8L, 0x1fda836eL, 0x81be16cdL, 0xf6b9265bL, 0x6fb077e1L,
|
||||
0x18b74777L, 0x88085ae6L, 0xff0f6a70L, 0x66063bcaL, 0x11010b5cL,
|
||||
0x8f659effL, 0xf862ae69L, 0x616bffd3L, 0x166ccf45L, 0xa00ae278L,
|
||||
0xd70dd2eeL, 0x4e048354L, 0x3903b3c2L, 0xa7672661L, 0xd06016f7L,
|
||||
0x4969474dL, 0x3e6e77dbL, 0xaed16a4aL, 0xd9d65adcL, 0x40df0b66L,
|
||||
0x37d83bf0L, 0xa9bcae53L, 0xdebb9ec5L, 0x47b2cf7fL, 0x30b5ffe9L,
|
||||
0xbdbdf21cL, 0xcabac28aL, 0x53b39330L, 0x24b4a3a6L, 0xbad03605L,
|
||||
0xcdd70693L, 0x54de5729L, 0x23d967bfL, 0xb3667a2eL, 0xc4614ab8L,
|
||||
0x5d681b02L, 0x2a6f2b94L, 0xb40bbe37L, 0xc30c8ea1L, 0x5a05df1bL,
|
||||
0x2d02ef8dL
|
||||
};
|
||||
|
||||
/* This is the standard Gary S. Brown's 32 bit CRC algorithm, but
|
||||
accumulate the CRC into the result of a previous CRC. */
|
||||
cyg_uint32
|
||||
cyg_crc32_accumulate(cyg_uint32 crc32val, unsigned char *s, int len)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < len; i++) {
|
||||
crc32val = crc32_tab[(crc32val ^ s[i]) & 0xff] ^ (crc32val >> 8);
|
||||
}
|
||||
return crc32val;
|
||||
}
|
||||
|
||||
/* This is the standard Gary S. Brown's 32 bit CRC algorithm */
|
||||
cyg_uint32
|
||||
cyg_crc32(unsigned char *s, int len)
|
||||
{
|
||||
return (cyg_crc32_accumulate(0,s,len));
|
||||
}
|
||||
|
||||
/* Return a 32-bit CRC of the contents of the buffer accumulating the
|
||||
result from a previous CRC calculation. This uses the Ethernet FCS
|
||||
algorithm.*/
|
||||
cyg_uint32
|
||||
cyg_ether_crc32_accumulate(cyg_uint32 crc32val, unsigned char *s, int len)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (s == 0) return 0L;
|
||||
|
||||
crc32val = crc32val ^ 0xffffffff;
|
||||
for (i = 0; i < len; i++) {
|
||||
crc32val = crc32_tab[(crc32val ^ s[i]) & 0xff] ^ (crc32val >> 8);
|
||||
}
|
||||
return crc32val ^ 0xffffffff;
|
||||
}
|
||||
|
||||
/* Return a 32-bit CRC of the contents of the buffer, using the
|
||||
Ethernet FCS algorithm. */
|
||||
cyg_uint32
|
||||
cyg_ether_crc32(unsigned char *s, int len)
|
||||
{
|
||||
return cyg_ether_crc32_accumulate(0,s,len);
|
||||
}
|
||||
|
||||
|
@ -1,922 +0,0 @@
|
||||
/*
|
||||
* RouterBOOT configuration utility
|
||||
*
|
||||
* Copyright (C) 2010 Gabor Juhos <juhosg@openwrt.org>
|
||||
* Copyright (C) 2017 Thibaut VARENE <varenet@parisc-linux.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 as published
|
||||
* by the Free Software Foundation.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/stat.h>
|
||||
#include <linux/limits.h>
|
||||
|
||||
#include "rbcfg.h"
|
||||
#include "cyg_crc.h"
|
||||
|
||||
#define RBCFG_TMP_FILE "/tmp/.rbcfg"
|
||||
#define RBCFG_MTD_NAME "soft_config"
|
||||
|
||||
#define RB_ERR_NOTFOUND 1
|
||||
#define RB_ERR_INVALID 2
|
||||
#define RB_ERR_NOMEM 3
|
||||
#define RB_ERR_IO 4
|
||||
#define RB_ERR_NOTWANTED 5
|
||||
|
||||
#define ARRAY_SIZE(_a) (sizeof((_a)) / sizeof((_a)[0]))
|
||||
|
||||
struct rbcfg_ctx {
|
||||
char *mtd_device;
|
||||
char *tmp_file;
|
||||
char *buf;
|
||||
unsigned buflen;
|
||||
};
|
||||
|
||||
struct rbcfg_value {
|
||||
const char *name;
|
||||
const char *desc;
|
||||
union {
|
||||
uint32_t u32;
|
||||
const char *raw;
|
||||
} val;
|
||||
};
|
||||
|
||||
#define RBCFG_ENV_TYPE_U32 0
|
||||
|
||||
struct rbcfg_env {
|
||||
const char *name;
|
||||
int type;
|
||||
uint16_t id;
|
||||
const struct rbcfg_value *values;
|
||||
int num_values;
|
||||
};
|
||||
|
||||
#define CMD_FLAG_USES_CFG 0x01
|
||||
|
||||
struct rbcfg_command {
|
||||
const char *command;
|
||||
const char *usage;
|
||||
int flags;
|
||||
int (*exec)(int argc, const char *argv[]);
|
||||
};
|
||||
|
||||
struct rbcfg_soc {
|
||||
const char *needle;
|
||||
const int type;
|
||||
};
|
||||
|
||||
static void usage(void);
|
||||
|
||||
/* Globals */
|
||||
|
||||
static struct rbcfg_ctx *rbcfg_ctx;
|
||||
static char *rbcfg_name;
|
||||
|
||||
#define CFG_U32(_name, _desc, _val) { \
|
||||
.name = (_name), \
|
||||
.desc = (_desc), \
|
||||
.val.u32 = (_val), \
|
||||
}
|
||||
|
||||
static const struct rbcfg_value rbcfg_boot_delay[] = {
|
||||
CFG_U32("1", "1 second", RB_BOOT_DELAY_1SEC),
|
||||
CFG_U32("2", "2 seconds", RB_BOOT_DELAY_2SEC),
|
||||
CFG_U32("3", "3 seconds", RB_BOOT_DELAY_3SEC),
|
||||
CFG_U32("4", "4 seconds", RB_BOOT_DELAY_4SEC),
|
||||
CFG_U32("5", "5 seconds", RB_BOOT_DELAY_5SEC),
|
||||
CFG_U32("6", "6 seconds", RB_BOOT_DELAY_6SEC),
|
||||
CFG_U32("7", "7 seconds", RB_BOOT_DELAY_7SEC),
|
||||
CFG_U32("8", "8 seconds", RB_BOOT_DELAY_8SEC),
|
||||
CFG_U32("9", "9 seconds", RB_BOOT_DELAY_9SEC),
|
||||
};
|
||||
|
||||
static const struct rbcfg_value rbcfg_boot_device[] = {
|
||||
CFG_U32("eth", "boot over Ethernet",
|
||||
RB_BOOT_DEVICE_ETHER),
|
||||
CFG_U32("nandeth", "boot from NAND, if fail then Ethernet",
|
||||
RB_BOOT_DEVICE_NANDETH),
|
||||
CFG_U32("ethnand", "boot Ethernet once, then NAND",
|
||||
RB_BOOT_DEVICE_ETHONCE),
|
||||
CFG_U32("nand", "boot from NAND only",
|
||||
RB_BOOT_DEVICE_NANDONLY),
|
||||
CFG_U32("flash", "boot in flash configuration mode",
|
||||
RB_BOOT_DEVICE_FLASHCFG),
|
||||
CFG_U32("flashnand", "boot in flash configuration mode once, then NAND",
|
||||
RB_BOOT_DEVICE_FLSHONCE),
|
||||
};
|
||||
|
||||
static const struct rbcfg_value rbcfg_boot_key[] = {
|
||||
CFG_U32("any", "any key", RB_BOOT_KEY_ANY),
|
||||
CFG_U32("del", "<Delete> key only", RB_BOOT_KEY_DEL),
|
||||
};
|
||||
|
||||
static const struct rbcfg_value rbcfg_boot_protocol[] = {
|
||||
CFG_U32("bootp", "BOOTP protocol", RB_BOOT_PROTOCOL_BOOTP),
|
||||
CFG_U32("dhcp", "DHCP protocol", RB_BOOT_PROTOCOL_DHCP),
|
||||
};
|
||||
|
||||
static const struct rbcfg_value rbcfg_uart_speed[] = {
|
||||
CFG_U32("115200", "", RB_UART_SPEED_115200),
|
||||
CFG_U32("57600", "", RB_UART_SPEED_57600),
|
||||
CFG_U32("38400", "", RB_UART_SPEED_38400),
|
||||
CFG_U32("19200", "", RB_UART_SPEED_19200),
|
||||
CFG_U32("9600", "", RB_UART_SPEED_9600),
|
||||
CFG_U32("4800", "", RB_UART_SPEED_4800),
|
||||
CFG_U32("2400", "", RB_UART_SPEED_2400),
|
||||
CFG_U32("1200", "", RB_UART_SPEED_1200),
|
||||
CFG_U32("off", "disable console output", RB_UART_SPEED_OFF),
|
||||
};
|
||||
|
||||
static const struct rbcfg_value rbcfg_cpu_mode[] = {
|
||||
CFG_U32("powersave", "power save", RB_CPU_MODE_POWERSAVE),
|
||||
CFG_U32("regular", "regular (better for -0c environment)",
|
||||
RB_CPU_MODE_REGULAR),
|
||||
};
|
||||
|
||||
static const struct rbcfg_value rbcfg_cpu_freq_dummy[] = {
|
||||
};
|
||||
|
||||
static const struct rbcfg_value rbcfg_cpu_freq_qca953x[] = {
|
||||
CFG_U32("-2", "-100MHz", RB_CPU_FREQ_L2),
|
||||
CFG_U32("-1", "- 50MHz", RB_CPU_FREQ_L1),
|
||||
CFG_U32("0", "Factory", RB_CPU_FREQ_N0),
|
||||
CFG_U32("+1", "+ 50MHz", RB_CPU_FREQ_H1),
|
||||
CFG_U32("+2", "+100MHz", RB_CPU_FREQ_H2),
|
||||
};
|
||||
|
||||
static const struct rbcfg_value rbcfg_cpu_freq_ar9344[] = {
|
||||
CFG_U32("-2", "-100MHz", RB_CPU_FREQ_L2),
|
||||
CFG_U32("-1", "- 50MHz", RB_CPU_FREQ_L1),
|
||||
CFG_U32("0", "Factory", RB_CPU_FREQ_N0),
|
||||
CFG_U32("+1", "+ 50MHz", RB_CPU_FREQ_H1),
|
||||
CFG_U32("+2", "+100MHz", RB_CPU_FREQ_H2),
|
||||
CFG_U32("+3", "+150MHz", RB_CPU_FREQ_H3),
|
||||
};
|
||||
|
||||
static const struct rbcfg_value rbcfg_booter[] = {
|
||||
CFG_U32("regular", "load regular booter", RB_BOOTER_REGULAR),
|
||||
CFG_U32("backup", "force backup-booter loading", RB_BOOTER_BACKUP),
|
||||
};
|
||||
|
||||
static struct rbcfg_env rbcfg_envs[] = {
|
||||
{
|
||||
.name = "boot_delay",
|
||||
.id = RB_ID_BOOT_DELAY,
|
||||
.type = RBCFG_ENV_TYPE_U32,
|
||||
.values = rbcfg_boot_delay,
|
||||
.num_values = ARRAY_SIZE(rbcfg_boot_delay),
|
||||
}, {
|
||||
.name = "boot_device",
|
||||
.id = RB_ID_BOOT_DEVICE,
|
||||
.type = RBCFG_ENV_TYPE_U32,
|
||||
.values = rbcfg_boot_device,
|
||||
.num_values = ARRAY_SIZE(rbcfg_boot_device),
|
||||
}, {
|
||||
.name = "boot_key",
|
||||
.id = RB_ID_BOOT_KEY,
|
||||
.type = RBCFG_ENV_TYPE_U32,
|
||||
.values = rbcfg_boot_key,
|
||||
.num_values = ARRAY_SIZE(rbcfg_boot_key),
|
||||
}, {
|
||||
.name = "boot_protocol",
|
||||
.id = RB_ID_BOOT_PROTOCOL,
|
||||
.type = RBCFG_ENV_TYPE_U32,
|
||||
.values = rbcfg_boot_protocol,
|
||||
.num_values = ARRAY_SIZE(rbcfg_boot_protocol),
|
||||
}, {
|
||||
.name = "booter",
|
||||
.id = RB_ID_BOOTER,
|
||||
.type = RBCFG_ENV_TYPE_U32,
|
||||
.values = rbcfg_booter,
|
||||
.num_values = ARRAY_SIZE(rbcfg_booter),
|
||||
}, {
|
||||
.name = "cpu_mode",
|
||||
.id = RB_ID_CPU_MODE,
|
||||
.type = RBCFG_ENV_TYPE_U32,
|
||||
.values = rbcfg_cpu_mode,
|
||||
.num_values = ARRAY_SIZE(rbcfg_cpu_mode),
|
||||
}, {
|
||||
.name = "cpu_freq",
|
||||
.id = RB_ID_CPU_FREQ,
|
||||
.type = RBCFG_ENV_TYPE_U32,
|
||||
.values = rbcfg_cpu_freq_dummy,
|
||||
.num_values = ARRAY_SIZE(rbcfg_cpu_freq_dummy),
|
||||
}, {
|
||||
.name = "uart_speed",
|
||||
.id = RB_ID_UART_SPEED,
|
||||
.type = RBCFG_ENV_TYPE_U32,
|
||||
.values = rbcfg_uart_speed,
|
||||
.num_values = ARRAY_SIZE(rbcfg_uart_speed),
|
||||
}
|
||||
};
|
||||
|
||||
static inline uint16_t
|
||||
get_u16(const void *buf)
|
||||
{
|
||||
const uint8_t *p = buf;
|
||||
|
||||
return ((uint16_t) p[1] + ((uint16_t) p[0] << 8));
|
||||
}
|
||||
|
||||
static inline uint32_t
|
||||
get_u32(const void *buf)
|
||||
{
|
||||
const uint8_t *p = buf;
|
||||
|
||||
return ((uint32_t) p[3] + ((uint32_t) p[2] << 8) +
|
||||
((uint32_t) p[1] << 16) + ((uint32_t) p[0] << 24));
|
||||
}
|
||||
|
||||
static inline void
|
||||
put_u32(void *buf, uint32_t val)
|
||||
{
|
||||
uint8_t *p = buf;
|
||||
|
||||
p[3] = val & 0xff;
|
||||
p[2] = (val >> 8) & 0xff;
|
||||
p[1] = (val >> 16) & 0xff;
|
||||
p[0] = (val >> 24) & 0xff;
|
||||
}
|
||||
|
||||
static int
|
||||
rbcfg_find_tag(struct rbcfg_ctx *ctx, uint16_t tag_id, uint16_t *tag_len,
|
||||
void **tag_data)
|
||||
{
|
||||
uint16_t id;
|
||||
uint16_t len;
|
||||
char *buf = ctx->buf;
|
||||
unsigned int buflen = ctx->buflen;
|
||||
int ret = RB_ERR_NOTFOUND;
|
||||
|
||||
/* skip magic and CRC value */
|
||||
buf += 8;
|
||||
buflen -= 8;
|
||||
|
||||
while (buflen > 2) {
|
||||
len = get_u16(buf);
|
||||
buf += 2;
|
||||
buflen -= 2;
|
||||
|
||||
if (buflen < 2)
|
||||
break;
|
||||
|
||||
id = get_u16(buf);
|
||||
buf += 2;
|
||||
buflen -= 2;
|
||||
|
||||
if (id == RB_ID_TERMINATOR) {
|
||||
ret = RB_ERR_NOTWANTED;
|
||||
break;
|
||||
}
|
||||
|
||||
if (buflen < len)
|
||||
break;
|
||||
|
||||
if (id == tag_id) {
|
||||
*tag_len = len;
|
||||
*tag_data = buf;
|
||||
ret = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
buf += len;
|
||||
buflen -= len;
|
||||
}
|
||||
|
||||
if (RB_ERR_NOTFOUND == ret)
|
||||
fprintf(stderr, "no tag found with id=%u\n", tag_id);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int
|
||||
rbcfg_get_u32(struct rbcfg_ctx *ctx, uint16_t id, uint32_t *val)
|
||||
{
|
||||
void *tag_data;
|
||||
uint16_t tag_len;
|
||||
int err;
|
||||
|
||||
err = rbcfg_find_tag(ctx, id, &tag_len, &tag_data);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
*val = get_u32(tag_data);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
rbcfg_set_u32(struct rbcfg_ctx *ctx, uint16_t id, uint32_t val)
|
||||
{
|
||||
void *tag_data;
|
||||
uint16_t tag_len;
|
||||
int err;
|
||||
|
||||
err = rbcfg_find_tag(ctx, id, &tag_len, &tag_data);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
put_u32(tag_data, val);
|
||||
return 0;
|
||||
}
|
||||
|
||||
char *rbcfg_find_mtd(const char *name, int *erase_size)
|
||||
{
|
||||
FILE *f;
|
||||
int mtd_num;
|
||||
char dev[PATH_MAX];
|
||||
char *ret = NULL;
|
||||
struct stat s;
|
||||
int err;
|
||||
|
||||
f = fopen("/proc/mtd", "r");
|
||||
if (!f)
|
||||
return NULL;
|
||||
|
||||
while (1) {
|
||||
char *p;
|
||||
p = fgets(dev, sizeof(dev), f);
|
||||
if (!p)
|
||||
break;
|
||||
|
||||
if (!strstr(dev, name))
|
||||
continue;
|
||||
|
||||
err = sscanf(dev, "mtd%d: %08x", &mtd_num, erase_size);
|
||||
if (err != 2)
|
||||
break;
|
||||
|
||||
sprintf(dev, "/dev/mtdblock%d", mtd_num);
|
||||
err = stat(dev, &s);
|
||||
if (err < 0)
|
||||
break;
|
||||
|
||||
if ((s.st_mode & S_IFBLK) == 0)
|
||||
break;
|
||||
|
||||
ret = malloc(strlen(dev) + 1);
|
||||
if (ret == NULL)
|
||||
break;
|
||||
|
||||
strncpy(ret, dev, strlen(dev) + 1);
|
||||
break;
|
||||
}
|
||||
|
||||
fclose(f);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int
|
||||
rbcfg_check_tmp(struct rbcfg_ctx *ctx)
|
||||
{
|
||||
struct stat s;
|
||||
int err;
|
||||
|
||||
err = stat(ctx->tmp_file, &s);
|
||||
if (err < 0)
|
||||
return 0;
|
||||
|
||||
if ((s.st_mode & S_IFREG) == 0)
|
||||
return 0;
|
||||
|
||||
if (s.st_size != ctx->buflen)
|
||||
return 0;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int
|
||||
rbcfg_load(struct rbcfg_ctx *ctx)
|
||||
{
|
||||
uint32_t magic;
|
||||
uint32_t crc_orig, crc;
|
||||
char *name;
|
||||
int tmp;
|
||||
int fd;
|
||||
int err;
|
||||
|
||||
tmp = rbcfg_check_tmp(ctx);
|
||||
name = (tmp) ? ctx->tmp_file : ctx->mtd_device;
|
||||
|
||||
fd = open(name, O_RDONLY);
|
||||
if (fd < 0) {
|
||||
fprintf(stderr, "unable to open %s\n", name);
|
||||
err = RB_ERR_IO;
|
||||
goto err;
|
||||
}
|
||||
|
||||
err = read(fd, ctx->buf, ctx->buflen);
|
||||
if (err != ctx->buflen) {
|
||||
fprintf(stderr, "unable to read from %s\n", name);
|
||||
err = RB_ERR_IO;
|
||||
goto err_close;
|
||||
}
|
||||
|
||||
magic = get_u32(ctx->buf);
|
||||
if (magic != RB_MAGIC_SOFT) {
|
||||
fprintf(stderr, "invalid configuration\n");
|
||||
err = RB_ERR_INVALID;
|
||||
goto err_close;
|
||||
}
|
||||
|
||||
crc_orig = get_u32(ctx->buf + 4);
|
||||
put_u32(ctx->buf + 4, 0);
|
||||
crc = cyg_ether_crc32((unsigned char *) ctx->buf, ctx->buflen);
|
||||
if (crc != crc_orig) {
|
||||
fprintf(stderr, "configuration has CRC error\n");
|
||||
err = RB_ERR_INVALID;
|
||||
goto err_close;
|
||||
}
|
||||
|
||||
err = 0;
|
||||
|
||||
err_close:
|
||||
close(fd);
|
||||
err:
|
||||
return err;
|
||||
}
|
||||
|
||||
static int
|
||||
rbcfg_open()
|
||||
{
|
||||
char *mtd_device;
|
||||
struct rbcfg_ctx *ctx;
|
||||
int buflen;
|
||||
int err;
|
||||
|
||||
mtd_device = rbcfg_find_mtd(RBCFG_MTD_NAME, &buflen);
|
||||
if (!mtd_device) {
|
||||
fprintf(stderr, "unable to find configuration\n");
|
||||
return RB_ERR_NOTFOUND;
|
||||
}
|
||||
|
||||
ctx = malloc(sizeof(struct rbcfg_ctx) + buflen);
|
||||
if (ctx == NULL) {
|
||||
err = RB_ERR_NOMEM;
|
||||
goto err_free_mtd;
|
||||
}
|
||||
|
||||
ctx->mtd_device = mtd_device;
|
||||
ctx->tmp_file = RBCFG_TMP_FILE;
|
||||
ctx->buflen = buflen;
|
||||
ctx->buf = (char *) &ctx[1];
|
||||
|
||||
err = rbcfg_load(ctx);
|
||||
if (err)
|
||||
goto err_free_ctx;
|
||||
|
||||
rbcfg_ctx = ctx;
|
||||
return 0;
|
||||
|
||||
err_free_ctx:
|
||||
free(ctx);
|
||||
err_free_mtd:
|
||||
free(mtd_device);
|
||||
return err;
|
||||
}
|
||||
|
||||
static int
|
||||
rbcfg_update(int tmp)
|
||||
{
|
||||
struct rbcfg_ctx *ctx = rbcfg_ctx;
|
||||
char *name;
|
||||
uint32_t crc;
|
||||
int fd;
|
||||
int err;
|
||||
|
||||
put_u32(ctx->buf, RB_MAGIC_SOFT);
|
||||
put_u32(ctx->buf + 4, 0);
|
||||
crc = cyg_ether_crc32((unsigned char *) ctx->buf, ctx->buflen);
|
||||
put_u32(ctx->buf + 4, crc);
|
||||
|
||||
name = (tmp) ? ctx->tmp_file : ctx->mtd_device;
|
||||
fd = open(name, O_WRONLY | O_CREAT);
|
||||
if (fd < 0) {
|
||||
fprintf(stderr, "unable to open %s for writing\n", name);
|
||||
err = RB_ERR_IO;
|
||||
goto out;
|
||||
}
|
||||
|
||||
err = write(fd, ctx->buf, ctx->buflen);
|
||||
if (err != ctx->buflen) {
|
||||
err = RB_ERR_IO;
|
||||
goto out_close;
|
||||
}
|
||||
|
||||
fsync(fd);
|
||||
err = 0;
|
||||
|
||||
out_close:
|
||||
close(fd);
|
||||
out:
|
||||
return err;
|
||||
}
|
||||
|
||||
static void
|
||||
rbcfg_close(void)
|
||||
{
|
||||
struct rbcfg_ctx *ctx;
|
||||
|
||||
ctx = rbcfg_ctx;
|
||||
free(ctx->mtd_device);
|
||||
free(ctx);
|
||||
}
|
||||
|
||||
static const struct rbcfg_value *
|
||||
rbcfg_env_find(const struct rbcfg_env *env, const char *name)
|
||||
{
|
||||
unsigned i;
|
||||
|
||||
for (i = 0; i < env->num_values; i++) {
|
||||
const struct rbcfg_value *v = &env->values[i];
|
||||
|
||||
if (strcmp(v->name, name) == 0)
|
||||
return v;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static const struct rbcfg_value *
|
||||
rbcfg_env_find_u32(const struct rbcfg_env *env, uint32_t val)
|
||||
{
|
||||
unsigned i;
|
||||
|
||||
for (i = 0; i < env->num_values; i++) {
|
||||
const struct rbcfg_value *v = &env->values[i];
|
||||
|
||||
if (v->val.u32 == val)
|
||||
return v;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static const char *
|
||||
rbcfg_env_get_u32(const struct rbcfg_env *env)
|
||||
{
|
||||
const struct rbcfg_value *v;
|
||||
uint32_t val;
|
||||
int err;
|
||||
|
||||
err = rbcfg_get_u32(rbcfg_ctx, env->id, &val);
|
||||
if (err)
|
||||
return NULL;
|
||||
|
||||
v = rbcfg_env_find_u32(env, val);
|
||||
if (v == NULL) {
|
||||
fprintf(stderr, "unknown value %08x found for %s\n",
|
||||
val, env->name);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return v->name;
|
||||
}
|
||||
|
||||
static int
|
||||
rbcfg_env_set_u32(const struct rbcfg_env *env, const char *data)
|
||||
{
|
||||
const struct rbcfg_value *v;
|
||||
int err;
|
||||
|
||||
v = rbcfg_env_find(env, data);
|
||||
if (v == NULL) {
|
||||
fprintf(stderr, "invalid value '%s'\n", data);
|
||||
return RB_ERR_INVALID;
|
||||
}
|
||||
|
||||
err = rbcfg_set_u32(rbcfg_ctx, env->id, v->val.u32);
|
||||
return err;
|
||||
}
|
||||
|
||||
static const char *
|
||||
rbcfg_env_get(const struct rbcfg_env *env)
|
||||
{
|
||||
const char *ret = NULL;
|
||||
|
||||
switch (env->type) {
|
||||
case RBCFG_ENV_TYPE_U32:
|
||||
ret = rbcfg_env_get_u32(env);
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int
|
||||
rbcfg_env_set(const struct rbcfg_env *env, const char *data)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
switch (env->type) {
|
||||
case RBCFG_ENV_TYPE_U32:
|
||||
ret = rbcfg_env_set_u32(env, data);
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int
|
||||
rbcfg_cmd_apply(int argc, const char *argv[])
|
||||
{
|
||||
return rbcfg_update(0);
|
||||
}
|
||||
|
||||
static int
|
||||
rbcfg_cmd_help(int argc, const char *argv[])
|
||||
{
|
||||
usage();
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
rbcfg_cmd_get(int argc, const char *argv[])
|
||||
{
|
||||
int err = RB_ERR_NOTFOUND;
|
||||
int i;
|
||||
|
||||
if (argc != 1) {
|
||||
usage();
|
||||
return RB_ERR_INVALID;
|
||||
}
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(rbcfg_envs); i++) {
|
||||
const struct rbcfg_env *env = &rbcfg_envs[i];
|
||||
const char *value;
|
||||
|
||||
if (strcmp(env->name, argv[0]))
|
||||
continue;
|
||||
|
||||
value = rbcfg_env_get(env);
|
||||
if (value) {
|
||||
fprintf(stdout, "%s\n", value);
|
||||
err = 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
static int
|
||||
rbcfg_cmd_set(int argc, const char *argv[])
|
||||
{
|
||||
int err = RB_ERR_INVALID;
|
||||
int i;
|
||||
|
||||
if (argc != 2) {
|
||||
/* not enough parameters */
|
||||
usage();
|
||||
return RB_ERR_INVALID;
|
||||
}
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(rbcfg_envs); i++) {
|
||||
const struct rbcfg_env *env = &rbcfg_envs[i];
|
||||
|
||||
if (strcmp(env->name, argv[0]))
|
||||
continue;
|
||||
|
||||
err = rbcfg_env_set(env, argv[1]);
|
||||
if (err == 0)
|
||||
err = rbcfg_update(1);
|
||||
break;
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
static int
|
||||
rbcfg_cmd_show(int argc, const char *argv[])
|
||||
{
|
||||
int i;
|
||||
|
||||
if (argc != 0) {
|
||||
usage();
|
||||
return RB_ERR_INVALID;
|
||||
}
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(rbcfg_envs); i++) {
|
||||
const struct rbcfg_env *env = &rbcfg_envs[i];
|
||||
const char *value;
|
||||
|
||||
value = rbcfg_env_get(env);
|
||||
if (value)
|
||||
fprintf(stdout, "%s=%s\n", env->name, value);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct rbcfg_command rbcfg_commands[] = {
|
||||
{
|
||||
.command = "apply",
|
||||
.usage = "apply\n"
|
||||
"\t- write configuration to the mtd device",
|
||||
.flags = CMD_FLAG_USES_CFG,
|
||||
.exec = rbcfg_cmd_apply,
|
||||
}, {
|
||||
.command = "help",
|
||||
.usage = "help\n"
|
||||
"\t- show this screen",
|
||||
.exec = rbcfg_cmd_help,
|
||||
}, {
|
||||
.command = "get",
|
||||
.usage = "get <name>\n"
|
||||
"\t- get value of the configuration option <name>",
|
||||
.flags = CMD_FLAG_USES_CFG,
|
||||
.exec = rbcfg_cmd_get,
|
||||
}, {
|
||||
.command = "set",
|
||||
.usage = "set <name> <value>\n"
|
||||
"\t- set value of the configuration option <name> to <value>",
|
||||
.flags = CMD_FLAG_USES_CFG,
|
||||
.exec = rbcfg_cmd_set,
|
||||
}, {
|
||||
.command = "show",
|
||||
.usage = "show\n"
|
||||
"\t- show value of all configuration options",
|
||||
.flags = CMD_FLAG_USES_CFG,
|
||||
.exec = rbcfg_cmd_show,
|
||||
}
|
||||
};
|
||||
|
||||
static void
|
||||
usage(void)
|
||||
{
|
||||
char buf[255];
|
||||
int len;
|
||||
int i;
|
||||
|
||||
fprintf(stderr, "Usage: %s <command>\n", rbcfg_name);
|
||||
|
||||
fprintf(stderr, "\nCommands:\n");
|
||||
for (i = 0; i < ARRAY_SIZE(rbcfg_commands); i++) {
|
||||
const struct rbcfg_command *cmd;
|
||||
cmd = &rbcfg_commands[i];
|
||||
|
||||
len = snprintf(buf, sizeof(buf), "%s", cmd->usage);
|
||||
buf[len] = '\0';
|
||||
fprintf(stderr, "%s\n", buf);
|
||||
}
|
||||
|
||||
fprintf(stderr, "\nConfiguration options:\n");
|
||||
for (i = 0; i < ARRAY_SIZE(rbcfg_envs); i++) {
|
||||
const struct rbcfg_env *env;
|
||||
int j;
|
||||
|
||||
env = &rbcfg_envs[i];
|
||||
fprintf(stderr, "\n%s:\n", env->name);
|
||||
for (j = 0; j < env->num_values; j++) {
|
||||
const struct rbcfg_value *v = &env->values[j];
|
||||
fprintf(stderr, "\t%-12s %s\n", v->name, v->desc);
|
||||
}
|
||||
}
|
||||
fprintf(stderr, "\n");
|
||||
}
|
||||
|
||||
#define RBCFG_SOC_UNKNOWN 0
|
||||
#define RBCFG_SOC_QCA953X 1
|
||||
#define RBCFG_SOC_AR9344 2
|
||||
|
||||
static const struct rbcfg_soc rbcfg_socs[] = {
|
||||
{
|
||||
.needle = "QCA953",
|
||||
.type = RBCFG_SOC_QCA953X,
|
||||
}, {
|
||||
.needle = "AR9344",
|
||||
.type = RBCFG_SOC_AR9344,
|
||||
},
|
||||
};
|
||||
|
||||
#define CPUINFO_BUFSIZE 128 /* lines of interest are < 80 chars */
|
||||
|
||||
static int cpuinfo_find_soc(void)
|
||||
{
|
||||
FILE *fp;
|
||||
char temp[CPUINFO_BUFSIZE];
|
||||
char *haystack, *needle;
|
||||
int i, found = 0, soc_type = RBCFG_SOC_UNKNOWN;
|
||||
|
||||
fp = fopen("/proc/cpuinfo", "r");
|
||||
if (!fp)
|
||||
goto end;
|
||||
|
||||
/* first, extract the system type line */
|
||||
needle = "system type";
|
||||
while(fgets(temp, CPUINFO_BUFSIZE, fp)) {
|
||||
if (!strncmp(temp, needle, strlen(needle))) {
|
||||
found = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
fclose(fp);
|
||||
|
||||
/* failsafe in case cpuinfo format changes */
|
||||
if (!found)
|
||||
goto end;
|
||||
|
||||
/* skip the field header */
|
||||
haystack = strchr(temp, ':');
|
||||
|
||||
/* then, try to identify known SoC, stop at first match */
|
||||
for (i = 0; i < ARRAY_SIZE(rbcfg_socs); i++) {
|
||||
if ((strstr(haystack, rbcfg_socs[i].needle))) {
|
||||
soc_type = rbcfg_socs[i].type;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
return soc_type;
|
||||
}
|
||||
|
||||
static void fixup_rbcfg_envs(void)
|
||||
{
|
||||
int i, num_val, soc_type;
|
||||
const struct rbcfg_value * env_value;
|
||||
|
||||
/* detect SoC */
|
||||
soc_type = cpuinfo_find_soc();
|
||||
|
||||
/* update rbcfg_envs */
|
||||
switch (soc_type) {
|
||||
case RBCFG_SOC_QCA953X:
|
||||
env_value = rbcfg_cpu_freq_qca953x;
|
||||
num_val = ARRAY_SIZE(rbcfg_cpu_freq_qca953x);
|
||||
break;
|
||||
case RBCFG_SOC_AR9344:
|
||||
env_value = rbcfg_cpu_freq_ar9344;
|
||||
num_val = ARRAY_SIZE(rbcfg_cpu_freq_ar9344);
|
||||
break;
|
||||
}
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(rbcfg_envs); i++) {
|
||||
if (RB_ID_CPU_FREQ == rbcfg_envs[i].id) {
|
||||
if (RBCFG_SOC_UNKNOWN == soc_type)
|
||||
rbcfg_envs[i].id = RB_ID_TERMINATOR;
|
||||
else {
|
||||
rbcfg_envs[i].values = env_value;
|
||||
rbcfg_envs[i].num_values = num_val;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, const char *argv[])
|
||||
{
|
||||
const struct rbcfg_command *cmd = NULL;
|
||||
int ret;
|
||||
int i;
|
||||
|
||||
rbcfg_name = (char *) argv[0];
|
||||
|
||||
fixup_rbcfg_envs();
|
||||
|
||||
if (argc < 2) {
|
||||
usage();
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(rbcfg_commands); i++) {
|
||||
if (strcmp(rbcfg_commands[i].command, argv[1]) == 0) {
|
||||
cmd = &rbcfg_commands[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (cmd == NULL) {
|
||||
fprintf(stderr, "unknown command '%s'\n", argv[1]);
|
||||
usage();
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
argc -= 2;
|
||||
argv += 2;
|
||||
|
||||
if (cmd->flags & CMD_FLAG_USES_CFG) {
|
||||
ret = rbcfg_open();
|
||||
if (ret)
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
ret = cmd->exec(argc, argv);
|
||||
|
||||
if (cmd->flags & CMD_FLAG_USES_CFG)
|
||||
rbcfg_close();
|
||||
|
||||
if (ret)
|
||||
return EXIT_FAILURE;
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
@ -1,85 +0,0 @@
|
||||
/*
|
||||
* Mikrotik's RouterBOOT configuration defines
|
||||
*
|
||||
* Copyright (C) 2010 Gabor Juhos <juhosg@openwrt.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 as published
|
||||
* by the Free Software Foundation.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _RBCFG_H
|
||||
#define _RBCFG_H
|
||||
|
||||
/*
|
||||
* Magic numbers
|
||||
*/
|
||||
#define RB_MAGIC_SOFT 0x74666f53 /* 'Soft' */
|
||||
|
||||
/*
|
||||
* ID values for Software settings
|
||||
*/
|
||||
#define RB_ID_TERMINATOR 0
|
||||
#define RB_ID_UART_SPEED 1
|
||||
#define RB_ID_BOOT_DELAY 2
|
||||
#define RB_ID_BOOT_DEVICE 3
|
||||
#define RB_ID_BOOT_KEY 4
|
||||
#define RB_ID_CPU_MODE 5
|
||||
#define RB_ID_FW_VERSION 6
|
||||
#define RB_ID_SOFT_07 7
|
||||
#define RB_ID_SOFT_08 8
|
||||
#define RB_ID_BOOT_PROTOCOL 9
|
||||
#define RB_ID_SOFT_10 10
|
||||
#define RB_ID_SOFT_11 11
|
||||
#define RB_ID_CPU_FREQ 12
|
||||
#define RB_ID_BOOTER 13
|
||||
|
||||
#define RB_UART_SPEED_115200 0
|
||||
#define RB_UART_SPEED_57600 1
|
||||
#define RB_UART_SPEED_38400 2
|
||||
#define RB_UART_SPEED_19200 3
|
||||
#define RB_UART_SPEED_9600 4
|
||||
#define RB_UART_SPEED_4800 5
|
||||
#define RB_UART_SPEED_2400 6
|
||||
#define RB_UART_SPEED_1200 7
|
||||
#define RB_UART_SPEED_OFF 8
|
||||
|
||||
#define RB_BOOT_DELAY_1SEC 1
|
||||
#define RB_BOOT_DELAY_2SEC 2
|
||||
#define RB_BOOT_DELAY_3SEC 3
|
||||
#define RB_BOOT_DELAY_4SEC 4
|
||||
#define RB_BOOT_DELAY_5SEC 5
|
||||
#define RB_BOOT_DELAY_6SEC 6
|
||||
#define RB_BOOT_DELAY_7SEC 7
|
||||
#define RB_BOOT_DELAY_8SEC 8
|
||||
#define RB_BOOT_DELAY_9SEC 9
|
||||
|
||||
#define RB_BOOT_DEVICE_ETHER 0
|
||||
#define RB_BOOT_DEVICE_NANDETH 1
|
||||
#define RB_BOOT_DEVICE_CFCARD 2
|
||||
#define RB_BOOT_DEVICE_ETHONCE 3
|
||||
#define RB_BOOT_DEVICE_NANDONLY 5
|
||||
#define RB_BOOT_DEVICE_FLASHCFG 7
|
||||
#define RB_BOOT_DEVICE_FLSHONCE 8
|
||||
|
||||
#define RB_BOOT_KEY_ANY 0
|
||||
#define RB_BOOT_KEY_DEL 1
|
||||
|
||||
#define RB_CPU_MODE_POWERSAVE 0
|
||||
#define RB_CPU_MODE_REGULAR 1
|
||||
|
||||
#define RB_BOOT_PROTOCOL_BOOTP 0
|
||||
#define RB_BOOT_PROTOCOL_DHCP 1
|
||||
|
||||
#define RB_CPU_FREQ_L2 (0 << 3)
|
||||
#define RB_CPU_FREQ_L1 (1 << 3)
|
||||
#define RB_CPU_FREQ_N0 (2 << 3)
|
||||
#define RB_CPU_FREQ_H1 (3 << 3)
|
||||
#define RB_CPU_FREQ_H2 (4 << 3)
|
||||
#define RB_CPU_FREQ_H3 (5 << 3)
|
||||
|
||||
#define RB_BOOTER_REGULAR 0
|
||||
#define RB_BOOTER_BACKUP 1
|
||||
|
||||
#endif /* _RBCFG_H */
|
@ -8,50 +8,18 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=tfa-layerscape
|
||||
PKG_VERSION:=lsdk-1903
|
||||
PKG_VERSION:=LSDK-20.04
|
||||
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
|
||||
PKG_SOURCE_VERSION:=4a82c939a0211196e2b80a495f966383803753bb
|
||||
PKG_MIRROR_HASH:=31c264551ce800b646d7dcc5baa62cfbb4c8fa3299a93931c7ef71dc3e88380d
|
||||
PKG_BUILD_DEPENDS:=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 \
|
||||
@ -69,6 +37,14 @@ define Host/Install
|
||||
$(INSTALL_BIN) $(HOST_BUILD_DIR)/plat/nxp/tools/byte_swap $(STAGING_DIR_HOST)/bin/tfa-byte-swap
|
||||
endef
|
||||
|
||||
define Package/tfa-layerscape/ls1012afrdm
|
||||
TITLE:=NXP LS1012AFRDM Trusted Firmware
|
||||
PLAT:=ls1012afrdm
|
||||
BOOT_MODE:=qspi
|
||||
BIN_BL2:=build/ls1012afrdm/release/bl2_qspi.pbl
|
||||
BIN_FIP:=build/ls1012afrdm/release/fip.bin
|
||||
endef
|
||||
|
||||
define Package/tfa-layerscape/ls1012ardb
|
||||
TITLE:=NXP LS1012ARDB Trusted Firmware
|
||||
PLAT:=ls1012ardb
|
||||
@ -141,7 +117,37 @@ define Package/tfa-layerscape/ls2088ardb
|
||||
BIN_FIP:=build/ls2088ardb/release/fip.bin
|
||||
endef
|
||||
|
||||
define Package/tfa-layerscape/Config
|
||||
define Package/tfa-$(1)
|
||||
SECTION:=boot
|
||||
CATEGORY:=Boot Loaders
|
||||
TITLE:=$(2)
|
||||
DEPENDS:=@TARGET_layerscape_armv8_64b +layerscape-rcw +u-boot-$(1)
|
||||
VARIANT:=$(1)
|
||||
BIN_BL2:=$(3)
|
||||
BIN_FIP:=$(4)
|
||||
endef
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(STAGING_DIR_IMAGE)
|
||||
$(CP) $(PKG_BUILD_DIR)/$(BIN_BL2) $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-bl2.pbl
|
||||
$(CP) $(PKG_BUILD_DIR)/$(BIN_FIP) $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-fip.bin
|
||||
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
|
||||
|
||||
TFAS := \
|
||||
ls1012afrdm \
|
||||
ls1012ardb \
|
||||
ls1012afrwy \
|
||||
ls1043ardb \
|
||||
@ -154,8 +160,7 @@ TFAS := \
|
||||
|
||||
$(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))) \
|
||||
$(eval $(Package/tfa-layerscape/$(tfa))) \
|
||||
$(eval $(call Package/tfa-layerscape/Config,$(tfa),$(TITLE),$(BIN_BL2),$(BIN_FIP))) \
|
||||
$(eval $(call BuildPackage,tfa-$(tfa))) \
|
||||
)
|
||||
|
@ -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
|
||||
|
@ -45,15 +45,20 @@ yuncore,xd4200)
|
||||
buffalo,wzr-hp-ag300h)
|
||||
ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x10000" "0x10000"
|
||||
;;
|
||||
domywifi,dw33d)
|
||||
ubootenv_add_uci_config "/dev/mtd4" "0x0" "0x10000" "0x10000"
|
||||
;;
|
||||
glinet,gl-ar150)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x8000" "0x10000"
|
||||
;;
|
||||
netgear,wndr3700|\
|
||||
netgear,wndr3700-v2)
|
||||
netgear,wndr3700-v2|\
|
||||
netgear,wndrmac-v1)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x10000"
|
||||
;;
|
||||
netgear,wndr3700-v4|\
|
||||
netgear,wndr4300)
|
||||
netgear,wndr4300|\
|
||||
netgear,wndr4300sw)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x40000" "0x20000"
|
||||
;;
|
||||
qihoo,c301)
|
||||
|
@ -27,16 +27,16 @@ globalscale,espressobin-v7-emmc|\
|
||||
marvell,armada8040-mcbin)
|
||||
ubootenv_add_uci_config "/dev/mtd0" "0x3f0000" "0x10000" "0x10000" "1"
|
||||
;;
|
||||
linksys,caiman|\
|
||||
linksys,cobra|\
|
||||
linksys,shelby)
|
||||
linksys,wrt1200ac|\
|
||||
linksys,wrt1900ac-v2|\
|
||||
linksys,wrt1900acs)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x40000"
|
||||
;;
|
||||
linksys,mamba)
|
||||
linksys,wrt1900ac-v1)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x40000" "0x20000"
|
||||
;;
|
||||
linksys,rango|\
|
||||
linksys,venom)
|
||||
linksys,wrt3200acm|\
|
||||
linksys,wrt32x)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
|
||||
;;
|
||||
methode,udpu)
|
||||
|
@ -36,9 +36,6 @@ zbtlink,zbt-wg2626)
|
||||
linksys,ea7500-v2|\
|
||||
xiaomi,mir3p|\
|
||||
xiaomi,mir3g|\
|
||||
xiaomi,mir4|\
|
||||
xiaomi,miwifi-r3|\
|
||||
xiaomi,mi-router-ac2100|\
|
||||
xiaomi,redmi-router-ac2100)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000"
|
||||
;;
|
||||
|
@ -7,10 +7,10 @@
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_VERSION:=2019.04
|
||||
PKG_VERSION:=2020.04
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_HASH:=76b7772d156b3ddd7644c8a1736081e55b78828537ff714065d21dbade229bef
|
||||
PKG_HASH:=fe732aaf037d9cc3c0909bad8362af366ae964bbdac6913a34081ff4ad565372
|
||||
|
||||
include $(INCLUDE_DIR)/u-boot.mk
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
@ -0,0 +1,37 @@
|
||||
From 630b39c46b29de1874149c6b2c18c64966a0fabf Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Petr=20=C5=A0tetiar?= <ynezz@true.cz>
|
||||
Date: Sun, 1 Mar 2020 22:47:31 +0100
|
||||
Subject: [PATCH] apalis_imx6_defconfig: enable some useful commands
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
partition table info, EXT4 write support, support for FAT and generic FS
|
||||
commands like load/ls that work for multiple FS types.
|
||||
|
||||
Signed-off-by: Petr Štetiar <ynezz@true.cz>
|
||||
---
|
||||
configs/apalis_imx6_defconfig | 5 +++++
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
--- a/configs/apalis_imx6_defconfig
|
||||
+++ b/configs/apalis_imx6_defconfig
|
||||
@@ -44,6 +44,7 @@ CONFIG_CMD_GPIO=y
|
||||
CONFIG_CMD_GPT=y
|
||||
CONFIG_CMD_I2C=y
|
||||
CONFIG_CMD_MMC=y
|
||||
+CONFIG_CMD_PART=y
|
||||
CONFIG_CMD_USB=y
|
||||
CONFIG_CMD_USB_SDP=y
|
||||
CONFIG_CMD_USB_MASS_STORAGE=y
|
||||
@@ -53,6 +54,10 @@ CONFIG_CMD_PMIC=y
|
||||
CONFIG_CMD_REGULATOR=y
|
||||
CONFIG_OF_CONTROL=y
|
||||
CONFIG_DEFAULT_DEVICE_TREE="imx6-apalis"
|
||||
+CONFIG_CMD_EXT4=y
|
||||
+CONFIG_CMD_EXT4_WRITE=y
|
||||
+CONFIG_CMD_FAT=y
|
||||
+CONFIG_CMD_FS_GENERIC=y
|
||||
CONFIG_ENV_IS_IN_MMC=y
|
||||
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
|
||||
CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
|
@ -1,123 +0,0 @@
|
||||
From 42cc2cffb6d550fbb21dad033d2564d4da571015 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Petr=20=C5=A0tetiar?= <ynezz@true.cz>
|
||||
Date: Sat, 1 Dec 2018 12:46:37 +0100
|
||||
Subject: [PATCH] imx6: apalis: Make the boot process more generic
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
I'm preparing support for Apalis imx6 boards in OpenWrt and I've ended
|
||||
up with quite huge patchset against upstream U-Boot 2018.03, so I'm
|
||||
trying to propose more generic way of boot process handling.
|
||||
|
||||
In OpenWrt we usually have kernel, dtbs and U-Boot boot script in boot
|
||||
partition with ext4fs, so for some use cases it would be handy to be
|
||||
able to replace some of the files in the boot partion, that's why I've
|
||||
added write support to the ext4.
|
||||
|
||||
I've added `set_blkcnt` environment variable which is needed for every
|
||||
`mmc write` command as we need to always specify size in block count.
|
||||
This is copy&pasted from official Toradex's flashing scripts, so all the
|
||||
credits for this work belongs to them.
|
||||
|
||||
Currently the rootfs location is passed via mmcblk number and the
|
||||
problem with this approach is that the mmcblk number for the boot device
|
||||
changes depending on the kernel version and imx6 SoC type. In order to
|
||||
avoid such issues, use the UUID method to specify the rootfs location.
|
||||
|
||||
I've added new boot sequence, where we first try to load and run boot
|
||||
script defined in the new `script` variable, so the boot process could
|
||||
be more generic and overridden by the distro. When the boot script isn't
|
||||
loaded, it will use the previous boot sequence so it should be backward
|
||||
compatible.
|
||||
|
||||
For the recovery purposes and better end user experience I've added boot
|
||||
from SDP as the last boot command if every other boot option fails. I
|
||||
plan to use SDP as official flashing/recovery procedure in OpenWrt for
|
||||
Apalis imx6 boards.
|
||||
|
||||
I've copy&pasted almost everything from the `f086812a mx6sxsabresd: Use
|
||||
PARTUUID to specify the rootfs location` commit, so credits for the rest
|
||||
of this patch belongs to Fabio.
|
||||
|
||||
Cc: Stefan Agner <stefan.agner@toradex.com>
|
||||
Cc: Max Krummenacher <max.krummenacher@toradex.com>
|
||||
Signed-off-by: Petr Štetiar <ynezz@true.cz>
|
||||
---
|
||||
configs/apalis_imx6_defconfig | 2 ++
|
||||
include/configs/apalis_imx6.h | 26 +++++++++++++++++++++-----
|
||||
2 files changed, 23 insertions(+), 5 deletions(-)
|
||||
|
||||
--- a/configs/apalis_imx6_defconfig
|
||||
+++ b/configs/apalis_imx6_defconfig
|
||||
@@ -40,6 +40,7 @@ CONFIG_CMD_DFU=y
|
||||
CONFIG_CMD_GPIO=y
|
||||
CONFIG_CMD_I2C=y
|
||||
CONFIG_CMD_MMC=y
|
||||
+CONFIG_CMD_PART=y
|
||||
CONFIG_CMD_USB=y
|
||||
CONFIG_CMD_USB_SDP=y
|
||||
CONFIG_CMD_USB_MASS_STORAGE=y
|
||||
@@ -49,6 +50,7 @@ CONFIG_CMD_PING=y
|
||||
CONFIG_CMD_BMP=y
|
||||
CONFIG_CMD_CACHE=y
|
||||
CONFIG_CMD_EXT4=y
|
||||
+CONFIG_CMD_EXT4_WRITE=y
|
||||
CONFIG_CMD_FAT=y
|
||||
CONFIG_CMD_FS_GENERIC=y
|
||||
CONFIG_ENV_IS_IN_MMC=y
|
||||
--- a/include/configs/apalis_imx6.h
|
||||
+++ b/include/configs/apalis_imx6.h
|
||||
@@ -138,9 +138,9 @@
|
||||
"imx6q-colibri-cam-eval-v3.dtb fat 0 1"
|
||||
|
||||
#define EMMC_BOOTCMD \
|
||||
- "emmcargs=ip=off root=/dev/mmcblk0p2 rw,noatime rootfstype=ext3 " \
|
||||
+ "emmcargs=ip=off root=PARTUUID=${uuid} rw,noatime rootfstype=ext3 " \
|
||||
"rootwait\0" \
|
||||
- "emmcboot=run setup; " \
|
||||
+ "emmcboot=run setup; run finduuid;" \
|
||||
"setenv bootargs ${defargs} ${emmcargs} ${setupargs} " \
|
||||
"${vidargs}; echo Booting from internal eMMC chip...; " \
|
||||
"run emmcdtbload; load mmc 0:1 ${kernel_addr_r} " \
|
||||
@@ -197,10 +197,17 @@
|
||||
#define FDT_FILE "imx6q-apalis_v1_0-eval.dtb"
|
||||
#endif
|
||||
#define CONFIG_EXTRA_ENV_SETTINGS \
|
||||
- "bootcmd=run emmcboot ; echo ; echo emmcboot failed ; " \
|
||||
+ "script=boot.scr\0" \
|
||||
+ "finduuid=part uuid mmc 0:2 uuid\0" \
|
||||
+ "loadbootscript=" \
|
||||
+ "load mmc 0:1 ${loadaddr} ${script};\0" \
|
||||
+ "bootscript=echo Running bootscript from mmc ...; " \
|
||||
+ "source\0" \
|
||||
+ "bootcmd_default=run emmcboot ; echo ; echo emmcboot failed ; " \
|
||||
"run nfsboot ; echo ; echo nfsboot failed ; " \
|
||||
"usb start ;" \
|
||||
- "setenv stdout serial,vga ; setenv stdin serial,usbkbd\0" \
|
||||
+ "setenv stdout serial,vga ; setenv stdin serial,usbkbd;" \
|
||||
+ "sdp 0\0" \
|
||||
"boot_file=uImage\0" \
|
||||
"console=ttymxc0\0" \
|
||||
"defargs=enable_wait_mode=off vmalloc=400M\0" \
|
||||
@@ -228,7 +235,16 @@
|
||||
"vidargs=mxc_hdmi.only_cea=1 " \
|
||||
"video=mxcfb0:dev=hdmi,1920x1080M@60,if=RGB24 " \
|
||||
"video=mxcfb1:off video=mxcfb2:off video=mxcfb3:off " \
|
||||
- "fbmem=32M\0 "
|
||||
+ "fbmem=32M\0 " \
|
||||
+ "set_blkcnt=setexpr blkcnt ${filesize} + 0x1ff && setexpr blkcnt ${blkcnt} / 0x200\0"
|
||||
+
|
||||
+#define CONFIG_BOOTCOMMAND \
|
||||
+ "mmc dev 0;" \
|
||||
+ "if run loadbootscript; then " \
|
||||
+ "run bootscript; " \
|
||||
+ "else " \
|
||||
+ "run bootcmd_default; " \
|
||||
+ "fi; "
|
||||
|
||||
/* Miscellaneous configurable options */
|
||||
#undef CONFIG_SYS_CBSIZE
|
||||
--
|
||||
1.9.1
|
||||
|
@ -1,17 +0,0 @@
|
||||
--- a/configs/wandboard_defconfig
|
||||
+++ b/configs/wandboard_defconfig
|
||||
@@ -30,7 +30,7 @@ CONFIG_CMD_I2C=y
|
||||
CONFIG_CMD_MMC=y
|
||||
CONFIG_CMD_SATA=y
|
||||
CONFIG_CMD_USB=y
|
||||
-CONFIG_CMD_CACHE=y
|
||||
+# CONFIG_CMD_CACHE is not set
|
||||
CONFIG_CMD_EXT4_WRITE=y
|
||||
CONFIG_ENV_IS_IN_MMC=y
|
||||
CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
|
||||
@@ -44,3 +44,5 @@ CONFIG_USB=y
|
||||
CONFIG_VIDEO=y
|
||||
# CONFIG_VIDEO_SW_CURSOR is not set
|
||||
CONFIG_OF_LIBFDT=y
|
||||
+CONFIG_FIT=y
|
||||
+CONFIG_FIT_VERBOSE=y
|
@ -1,7 +1,7 @@
|
||||
--- a/board/solidrun/mx6cuboxi/mx6cuboxi.c
|
||||
+++ b/board/solidrun/mx6cuboxi/mx6cuboxi.c
|
||||
@@ -290,6 +290,12 @@ static void setup_iomux_enet(void)
|
||||
udelay(100);
|
||||
@@ -286,6 +286,12 @@ static void setup_iomux_enet(void)
|
||||
gpio_free_list_nodev(&desc, 1);
|
||||
}
|
||||
|
||||
+void board_boot_order(u32 *spl_boot_list)
|
||||
@ -13,14 +13,3 @@
|
||||
int board_phy_config(struct phy_device *phydev)
|
||||
{
|
||||
if (phydev->drv->config)
|
||||
--- a/arch/arm/mach-imx/spl.c
|
||||
+++ b/arch/arm/mach-imx/spl.c
|
||||
@@ -176,7 +176,7 @@ int g_dnl_bind_fixup(struct usb_device_d
|
||||
/* called from spl_mmc to see type of boot mode for storage (RAW or FAT) */
|
||||
u32 spl_boot_mode(const u32 boot_device)
|
||||
{
|
||||
- switch (spl_boot_device()) {
|
||||
+ switch (boot_device) {
|
||||
/* for MMC return either RAW or FAT mode */
|
||||
case BOOT_DEVICE_MMC1:
|
||||
case BOOT_DEVICE_MMC2:
|
||||
|
@ -0,0 +1,23 @@
|
||||
From 00ad8b42dfe801107db25ead8249cb10afcd0f94 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Petr=20=C5=A0tetiar?= <ynezz@true.cz>
|
||||
Date: Sun, 1 Mar 2020 22:10:23 +0100
|
||||
Subject: [PATCH] mx6cuboxi_defconfig: force mmc boot
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Signed-off-by: Petr Štetiar <ynezz@true.cz>
|
||||
---
|
||||
configs/mx6cuboxi_defconfig | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
--- a/configs/mx6cuboxi_defconfig
|
||||
+++ b/configs/mx6cuboxi_defconfig
|
||||
@@ -9,6 +9,7 @@ CONFIG_ENV_SIZE=0x2000
|
||||
CONFIG_ENV_OFFSET=0xFE000
|
||||
CONFIG_DM_GPIO=y
|
||||
CONFIG_SPL_MMC_SUPPORT=y
|
||||
+CONFIG_SPL_FORCE_MMC_BOOT=y
|
||||
CONFIG_SPL_SERIAL_SUPPORT=y
|
||||
CONFIG_NR_DRAM_BANKS=1
|
||||
CONFIG_SPL=y
|
@ -7,10 +7,10 @@
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_VERSION:=2019.01
|
||||
PKG_VERSION:=2020.04
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_HASH:=50bd7e5a466ab828914d080d5f6a432345b500e8fba1ad3b7b61e95e60d51c22
|
||||
PKG_HASH:=fe732aaf037d9cc3c0909bad8362af366ae964bbdac6913a34081ff4ad565372
|
||||
|
||||
include $(INCLUDE_DIR)/u-boot.mk
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
@ -25,7 +25,7 @@ NOTE: this patch is ready for upstream, LEDE-specific parts are in
|
||||
|
||||
--- a/arch/arm/mach-kirkwood/Kconfig
|
||||
+++ b/arch/arm/mach-kirkwood/Kconfig
|
||||
@@ -56,6 +56,9 @@ config TARGET_GOFLEXHOME
|
||||
@@ -53,6 +53,9 @@ config TARGET_GOFLEXHOME
|
||||
config TARGET_NAS220
|
||||
bool "BlackArmor NAS220"
|
||||
|
||||
@ -505,8 +505,10 @@ NOTE: this patch is ready for upstream, LEDE-specific parts are in
|
||||
+#endif /* __NSA310_H */
|
||||
--- /dev/null
|
||||
+++ b/configs/nsa310_defconfig
|
||||
@@ -0,0 +1,40 @@
|
||||
@@ -0,0 +1,48 @@
|
||||
+CONFIG_ARM=y
|
||||
+CONFIG_SYS_DCACHE_OFF=y
|
||||
+CONFIG_ARCH_CPU_INIT=y
|
||||
+CONFIG_KIRKWOOD=y
|
||||
+CONFIG_SYS_TEXT_BASE=0x600000
|
||||
+CONFIG_TARGET_NSA310=y
|
||||
@ -533,12 +535,18 @@ NOTE: this patch is ready for upstream, LEDE-specific parts are in
|
||||
+CONFIG_CMD_EXT4=y
|
||||
+CONFIG_CMD_FAT=y
|
||||
+CONFIG_CMD_JFFS2=y
|
||||
+CONFIG_MTD=y
|
||||
+CONFIG_MTD_RAW_NAND=y
|
||||
+CONFIG_MTDPARTS_DEFAULT="mtdparts=orion_nand:0x0c0000(uboot),0x80000(uboot_env),0x7ec0000(ubi)"
|
||||
+CONFIG_CMD_MTDPARTS=y
|
||||
+CONFIG_CMD_ENV=y
|
||||
+CONFIG_CMD_NAND=y
|
||||
+CONFIG_EFI_PARTITION=y
|
||||
+CONFIG_ENV_IS_IN_NAND=y
|
||||
+CONFIG_ENV_SIZE=0x20000
|
||||
+CONFIG_ENV_OFFSET=0xC0000
|
||||
+CONFIG_ENV_SECT_SIZE=0x20000
|
||||
+CONFIG_ENV_ADDR=0xC0000
|
||||
+CONFIG_CMD_UBI=y
|
||||
+CONFIG_USB=y
|
||||
+CONFIG_USB_EHCI_HCD=y
|
||||
@ -548,7 +556,7 @@ NOTE: this patch is ready for upstream, LEDE-specific parts are in
|
||||
+CONFIG_SYS_LONGHELP=y
|
||||
--- /dev/null
|
||||
+++ b/include/configs/nsa310.h
|
||||
@@ -0,0 +1,117 @@
|
||||
@@ -0,0 +1,103 @@
|
||||
+/* Copyright (C) 2015-2016 bodhi <mibodhi@gmail.com>
|
||||
+ *
|
||||
+ * Based on
|
||||
@ -606,20 +614,6 @@ NOTE: this patch is ready for upstream, LEDE-specific parts are in
|
||||
+#include "mv-common.h"
|
||||
+
|
||||
+/*
|
||||
+ * Environment variables configurations
|
||||
+ */
|
||||
+#ifdef CONFIG_CMD_NAND
|
||||
+#define CONFIG_ENV_SECT_SIZE 0x20000 /* 128K */
|
||||
+#endif
|
||||
+
|
||||
+/* max 4k env size is enough, but in case of nand
|
||||
+ * it has to be rounded to sector size
|
||||
+ */
|
||||
+#define CONFIG_ENV_SIZE 0x20000 /* 128k */
|
||||
+#define CONFIG_ENV_ADDR 0xc0000
|
||||
+#define CONFIG_ENV_OFFSET 0xc0000 /* env starts here */
|
||||
+
|
||||
+/*
|
||||
+ * Default environment variables
|
||||
+ */
|
||||
+#define CONFIG_BOOTCOMMAND \
|
||||
|
@ -1,8 +1,8 @@
|
||||
--- a/arch/arm/mach-kirkwood/Kconfig
|
||||
+++ b/arch/arm/mach-kirkwood/Kconfig
|
||||
@@ -68,6 +68,9 @@ config TARGET_SBx81LIFKW
|
||||
config TARGET_SBx81LIFXCAT
|
||||
bool "Allied Telesis SBx81GP24/SBx81GT24"
|
||||
@@ -68,6 +68,9 @@ config TARGET_SBx81LIFXCAT
|
||||
config TARGET_DB_88F6281_BP
|
||||
bool "Marvell DB-88F6281-BP"
|
||||
|
||||
+config TARGET_NSA325
|
||||
+ bool "Zyxel NSA325 board"
|
||||
@ -17,7 +17,7 @@
|
||||
+source "board/zyxel/nsa325/Kconfig"
|
||||
source "board/alliedtelesis/SBx81LIFKW/Kconfig"
|
||||
source "board/alliedtelesis/SBx81LIFXCAT/Kconfig"
|
||||
|
||||
source "board/Marvell/db-88f6281-bp/Kconfig"
|
||||
--- /dev/null
|
||||
+++ b/board/zyxel/nsa325/Kconfig
|
||||
@@ -0,0 +1,12 @@
|
||||
@ -489,8 +489,10 @@
|
||||
+#endif /* __NSA325_H */
|
||||
--- /dev/null
|
||||
+++ b/configs/nsa325_defconfig
|
||||
@@ -0,0 +1,40 @@
|
||||
@@ -0,0 +1,48 @@
|
||||
+CONFIG_ARM=y
|
||||
+CONFIG_SYS_DCACHE_OFF=y
|
||||
+CONFIG_ARCH_CPU_INIT=y
|
||||
+CONFIG_KIRKWOOD=y
|
||||
+CONFIG_SYS_TEXT_BASE=0x600000
|
||||
+CONFIG_TARGET_NSA325=y
|
||||
@ -518,12 +520,18 @@
|
||||
+CONFIG_CMD_EXT4=y
|
||||
+CONFIG_CMD_FAT=y
|
||||
+CONFIG_CMD_JFFS2=y
|
||||
+CONFIG_MTD=y
|
||||
+CONFIG_MTD_RAW_NAND=y
|
||||
+CONFIG_MTDPARTS_DEFAULT="mtdparts=orion_nand:0x0c0000(uboot),0x80000(uboot_env),0x7ec0000(ubi)"
|
||||
+CONFIG_CMD_MTDPARTS=y
|
||||
+CONFIG_CMD_ENV=y
|
||||
+CONFIG_CMD_NAND=y
|
||||
+CONFIG_EFI_PARTITION=y
|
||||
+CONFIG_ENV_IS_IN_NAND=y
|
||||
+CONFIG_ENV_SIZE=0x20000
|
||||
+CONFIG_ENV_OFFSET=0xC0000
|
||||
+CONFIG_ENV_SECT_SIZE=0x20000
|
||||
+CONFIG_ENV_ADDR=0xC0000
|
||||
+CONFIG_CMD_UBI=y
|
||||
+CONFIG_USB_EHCI_HCD=y
|
||||
+CONFIG_USB_STORAGE=y
|
||||
@ -532,7 +540,7 @@
|
||||
+CONFIG_SYS_LONGHELP=y
|
||||
--- /dev/null
|
||||
+++ b/include/configs/nsa325.h
|
||||
@@ -0,0 +1,120 @@
|
||||
@@ -0,0 +1,106 @@
|
||||
+/*
|
||||
+ * (C) Copyright 2016 bodhi <mibodhi@gmail.com>
|
||||
+ *
|
||||
@ -593,20 +601,6 @@
|
||||
+#include "mv-common.h"
|
||||
+
|
||||
+/*
|
||||
+ * Environment variables configurations
|
||||
+ */
|
||||
+#ifdef CONFIG_CMD_NAND
|
||||
+#define CONFIG_ENV_SECT_SIZE 0x20000 /* 128K */
|
||||
+#endif
|
||||
+/*
|
||||
+ * max 4k env size is enough, but in case of nand
|
||||
+ * it has to be rounded to sector size
|
||||
+ */
|
||||
+#define CONFIG_ENV_SIZE 0x20000 /* 128k */
|
||||
+#define CONFIG_ENV_ADDR 0xc0000
|
||||
+#define CONFIG_ENV_OFFSET 0xc0000 /* env starts here */
|
||||
+
|
||||
+/*
|
||||
+ * Default environment variables
|
||||
+ */
|
||||
+#define CONFIG_BOOTCOMMAND \
|
||||
|
@ -17,7 +17,7 @@
|
||||
+source "board/cloudengines/pogoplugv4/Kconfig"
|
||||
source "board/d-link/dns325/Kconfig"
|
||||
source "board/iomega/iconnect/Kconfig"
|
||||
source "board/keymile/km_arm/Kconfig"
|
||||
source "board/keymile/Kconfig"
|
||||
--- a/arch/arm/mach-kirkwood/include/mach/kw88f6192.h
|
||||
+++ b/arch/arm/mach-kirkwood/include/mach/kw88f6192.h
|
||||
@@ -15,6 +15,6 @@
|
||||
@ -532,8 +532,10 @@
|
||||
+#endif /* __POGOPLUGV4_H */
|
||||
--- /dev/null
|
||||
+++ b/configs/pogoplugv4_defconfig
|
||||
@@ -0,0 +1,43 @@
|
||||
@@ -0,0 +1,51 @@
|
||||
+CONFIG_ARM=y
|
||||
+CONFIG_SYS_DCACHE_OFF=y
|
||||
+CONFIG_ARCH_CPU_INIT=y
|
||||
+CONFIG_KIRKWOOD=y
|
||||
+CONFIG_SYS_TEXT_BASE=0x600000
|
||||
+CONFIG_TARGET_POGOPLUGV4=y
|
||||
@ -561,6 +563,8 @@
|
||||
+CONFIG_CMD_EXT4=y
|
||||
+CONFIG_CMD_FAT=y
|
||||
+CONFIG_CMD_JFFS2=y
|
||||
+CONFIG_MTD=y
|
||||
+CONFIG_MTD_RAW_NAND=y
|
||||
+CONFIG_MTDPARTS_DEFAULT="mtdparts=orion_nand:0x1c0000(uboot),0x40000(uboot_env),0x7e00000(ubi)"
|
||||
+CONFIG_CMD_MTDPARTS=y
|
||||
+CONFIG_CMD_ENV=y
|
||||
@ -569,6 +573,10 @@
|
||||
+CONFIG_CMD_GPIO=y
|
||||
+CONFIG_EFI_PARTITION=y
|
||||
+CONFIG_ENV_IS_IN_NAND=y
|
||||
+CONFIG_ENV_SIZE=0x20000
|
||||
+CONFIG_ENV_OFFSET=0x1C0000
|
||||
+CONFIG_ENV_SECT_SIZE=0x20000
|
||||
+CONFIG_ENV_ADDR=0x1C0000
|
||||
+CONFIG_CMD_UBI=y
|
||||
+CONFIG_USB=y
|
||||
+CONFIG_USB_EHCI_HCD=y
|
||||
@ -617,7 +625,7 @@
|
||||
+}
|
||||
--- a/drivers/mmc/Makefile
|
||||
+++ b/drivers/mmc/Makefile
|
||||
@@ -61,6 +61,7 @@ obj-$(CONFIG_MMC_SDHCI_TANGIER) += tang
|
||||
@@ -66,6 +66,7 @@ obj-$(CONFIG_MMC_SDHCI_TANGIER) += tang
|
||||
obj-$(CONFIG_MMC_SDHCI_TEGRA) += tegra_mmc.o
|
||||
obj-$(CONFIG_MMC_SDHCI_XENON) += xenon_sdhci.o
|
||||
obj-$(CONFIG_MMC_SDHCI_ZYNQ) += zynq_sdhci.o
|
||||
@ -1112,7 +1120,7 @@
|
||||
+}
|
||||
--- a/include/configs/mv-common.h
|
||||
+++ b/include/configs/mv-common.h
|
||||
@@ -77,4 +77,10 @@
|
||||
@@ -75,4 +75,10 @@
|
||||
#define CONFIG_SYS_MAX_NAND_DEVICE 1
|
||||
#endif
|
||||
|
||||
@ -1125,7 +1133,7 @@
|
||||
#endif /* _MV_COMMON_H */
|
||||
--- /dev/null
|
||||
+++ b/include/configs/pogoplugv4.h
|
||||
@@ -0,0 +1,127 @@
|
||||
@@ -0,0 +1,113 @@
|
||||
+/*
|
||||
+ * Copyright (C) 2014-2016 bodhi <mibodhi@gmail.com>
|
||||
+ * Based on
|
||||
@ -1188,20 +1196,6 @@
|
||||
+#include "mv-common.h"
|
||||
+
|
||||
+/*
|
||||
+ * Environment variables configurations
|
||||
+ */
|
||||
+#ifdef CONFIG_CMD_NAND
|
||||
+
|
||||
+#define CONFIG_ENV_SECT_SIZE 0x20000 /* 128K */
|
||||
+
|
||||
+
|
||||
+#endif
|
||||
+
|
||||
+#define CONFIG_ENV_SIZE 0x20000 /* 128k */
|
||||
+#define CONFIG_ENV_ADDR 0x1c0000
|
||||
+#define CONFIG_ENV_OFFSET 0x1c0000 /* env starts here */
|
||||
+
|
||||
+/*
|
||||
+ * Default environment variables
|
||||
+ */
|
||||
+#define CONFIG_BOOTCOMMAND \
|
||||
|
@ -8,16 +8,7 @@
|
||||
|
||||
/*
|
||||
* mv-common.h should be defined after CMD configs since it used them
|
||||
@@ -35,27 +36,22 @@
|
||||
* it has to be rounded to sector size
|
||||
*/
|
||||
#define CONFIG_ENV_SIZE 0x20000 /* 128k */
|
||||
-#define CONFIG_ENV_ADDR 0x80000
|
||||
-#define CONFIG_ENV_OFFSET 0x80000 /* env starts here */
|
||||
+#define CONFIG_ENV_OFFSET 0xe0000 /* env starts here */
|
||||
|
||||
/*
|
||||
* Default environment variables
|
||||
@@ -37,19 +38,15 @@
|
||||
*/
|
||||
#define CONFIG_BOOTCOMMAND \
|
||||
"setenv bootargs ${console} ${mtdparts} ${bootargs_root}; " \
|
||||
@ -46,7 +37,16 @@
|
||||
* Ethernet Driver configuration
|
||||
--- a/configs/dockstar_defconfig
|
||||
+++ b/configs/dockstar_defconfig
|
||||
@@ -18,7 +18,7 @@ CONFIG_CMD_PING=y
|
||||
@@ -5,7 +5,7 @@ CONFIG_KIRKWOOD=y
|
||||
CONFIG_SYS_TEXT_BASE=0x600000
|
||||
CONFIG_TARGET_DOCKSTAR=y
|
||||
CONFIG_ENV_SIZE=0x20000
|
||||
-CONFIG_ENV_OFFSET=0x80000
|
||||
+CONFIG_ENV_OFFSET=0xE0000
|
||||
CONFIG_NR_DRAM_BANKS=2
|
||||
CONFIG_IDENT_STRING="\nSeagate FreeAgent DockStar"
|
||||
CONFIG_BOOTDELAY=3
|
||||
@@ -23,7 +23,7 @@ CONFIG_CMD_EXT2=y
|
||||
CONFIG_CMD_FAT=y
|
||||
CONFIG_CMD_JFFS2=y
|
||||
CONFIG_CMD_MTDPARTS=y
|
||||
|
@ -1,14 +1,6 @@
|
||||
--- a/include/configs/iconnect.h
|
||||
+++ b/include/configs/iconnect.h
|
||||
@@ -42,24 +42,22 @@
|
||||
#define CONFIG_ENV_SECT_SIZE 0x20000
|
||||
#endif
|
||||
#define CONFIG_ENV_SIZE 0x20000
|
||||
-#define CONFIG_ENV_OFFSET 0x80000
|
||||
+#define CONFIG_ENV_OFFSET 0xe0000
|
||||
|
||||
/*
|
||||
* Default environment variables
|
||||
@@ -44,17 +44,15 @@
|
||||
*/
|
||||
#define CONFIG_BOOTCOMMAND \
|
||||
"setenv bootargs ${console} ${mtdparts} ${bootargs_root}; " \
|
||||
@ -32,7 +24,16 @@
|
||||
* Ethernet driver configuration
|
||||
--- a/configs/iconnect_defconfig
|
||||
+++ b/configs/iconnect_defconfig
|
||||
@@ -11,13 +11,14 @@ CONFIG_SYS_PROMPT="iconnect => "
|
||||
@@ -5,7 +5,7 @@ CONFIG_KIRKWOOD=y
|
||||
CONFIG_SYS_TEXT_BASE=0x600000
|
||||
CONFIG_TARGET_ICONNECT=y
|
||||
CONFIG_ENV_SIZE=0x20000
|
||||
-CONFIG_ENV_OFFSET=0x80000
|
||||
+CONFIG_ENV_OFFSET=0xE0000
|
||||
CONFIG_NR_DRAM_BANKS=2
|
||||
CONFIG_IDENT_STRING=" Iomega iConnect"
|
||||
CONFIG_BOOTDELAY=3
|
||||
@@ -16,13 +16,14 @@ CONFIG_SYS_PROMPT="iconnect => "
|
||||
CONFIG_CMD_NAND=y
|
||||
CONFIG_CMD_USB=y
|
||||
# CONFIG_CMD_SETEXPR is not set
|
||||
|
@ -1,6 +1,6 @@
|
||||
--- a/include/configs/ib62x0.h
|
||||
+++ b/include/configs/ib62x0.h
|
||||
@@ -47,21 +47,15 @@
|
||||
@@ -39,21 +39,15 @@
|
||||
*/
|
||||
#define CONFIG_BOOTCOMMAND \
|
||||
"setenv bootargs ${console} ${mtdparts} ${bootargs_root}; " \
|
||||
@ -29,7 +29,7 @@
|
||||
* Ethernet driver configuration
|
||||
--- a/configs/ib62x0_defconfig
|
||||
+++ b/configs/ib62x0_defconfig
|
||||
@@ -21,7 +21,7 @@ CONFIG_CMD_PING=y
|
||||
@@ -26,7 +26,7 @@ CONFIG_CMD_EXT2=y
|
||||
CONFIG_CMD_FAT=y
|
||||
CONFIG_CMD_JFFS2=y
|
||||
CONFIG_CMD_MTDPARTS=y
|
||||
|
@ -1,13 +1,6 @@
|
||||
--- a/include/configs/pogo_e02.h
|
||||
+++ b/include/configs/pogo_e02.h
|
||||
@@ -42,23 +42,23 @@
|
||||
#endif
|
||||
|
||||
#define CONFIG_ENV_SIZE 0x20000 /* 128k */
|
||||
-#define CONFIG_ENV_OFFSET 0x60000 /* env starts here */
|
||||
+#define CONFIG_ENV_OFFSET 0xe0000 /* env starts here */
|
||||
|
||||
/*
|
||||
@@ -42,17 +42,17 @@
|
||||
* Default environment variables
|
||||
*/
|
||||
#define CONFIG_BOOTCOMMAND \
|
||||
@ -36,7 +29,16 @@
|
||||
* Ethernet Driver configuration
|
||||
--- a/configs/pogo_e02_defconfig
|
||||
+++ b/configs/pogo_e02_defconfig
|
||||
@@ -18,6 +18,7 @@ CONFIG_CMD_PING=y
|
||||
@@ -5,7 +5,7 @@ CONFIG_KIRKWOOD=y
|
||||
CONFIG_SYS_TEXT_BASE=0x600000
|
||||
CONFIG_TARGET_POGO_E02=y
|
||||
CONFIG_ENV_SIZE=0x20000
|
||||
-CONFIG_ENV_OFFSET=0x60000
|
||||
+CONFIG_ENV_OFFSET=0xE0000
|
||||
CONFIG_NR_DRAM_BANKS=2
|
||||
CONFIG_IDENT_STRING="\nPogo E02"
|
||||
CONFIG_BOOTDELAY=3
|
||||
@@ -23,6 +23,7 @@ CONFIG_CMD_EXT2=y
|
||||
CONFIG_CMD_FAT=y
|
||||
CONFIG_CMD_JFFS2=y
|
||||
CONFIG_CMD_MTDPARTS=y
|
||||
|
@ -1,6 +1,6 @@
|
||||
--- a/include/configs/goflexhome.h
|
||||
+++ b/include/configs/goflexhome.h
|
||||
@@ -66,17 +66,15 @@
|
||||
@@ -60,17 +60,15 @@
|
||||
*/
|
||||
#define CONFIG_BOOTCOMMAND \
|
||||
"setenv bootargs ${console} ${mtdparts} ${bootargs_root}; " \
|
||||
@ -24,7 +24,7 @@
|
||||
* Ethernet Driver configuration
|
||||
--- a/configs/goflexhome_defconfig
|
||||
+++ b/configs/goflexhome_defconfig
|
||||
@@ -23,7 +23,7 @@ CONFIG_CMD_EXT4=y
|
||||
@@ -28,7 +28,7 @@ CONFIG_CMD_FAT=y
|
||||
CONFIG_CMD_JFFS2=y
|
||||
CONFIG_CMD_MTDPARTS=y
|
||||
CONFIG_MTDIDS_DEFAULT="nand0=orion_nand"
|
||||
|
@ -1,37 +1,37 @@
|
||||
--- a/arch/arm/mach-kirkwood/Kconfig
|
||||
+++ b/arch/arm/mach-kirkwood/Kconfig
|
||||
@@ -102,4 +102,7 @@ source "board/zyxel/nsa310/Kconfig"
|
||||
source "board/alliedtelesis/SBx81LIFKW/Kconfig"
|
||||
@@ -103,4 +103,7 @@ source "board/alliedtelesis/SBx81LIFKW/K
|
||||
source "board/alliedtelesis/SBx81LIFXCAT/Kconfig"
|
||||
|
||||
source "board/Marvell/db-88f6281-bp/Kconfig"
|
||||
|
||||
+config SECOND_STAGE
|
||||
+ bool "OpenWrt second stage hack"
|
||||
+
|
||||
endif
|
||||
--- a/include/configs/dockstar.h
|
||||
+++ b/include/configs/dockstar.h
|
||||
@@ -65,4 +65,6 @@
|
||||
@@ -60,4 +60,6 @@
|
||||
* File system
|
||||
*/
|
||||
|
||||
|
||||
+#include "openwrt-kirkwood-common.h"
|
||||
+
|
||||
#endif /* _CONFIG_DOCKSTAR_H */
|
||||
--- a/include/configs/ib62x0.h
|
||||
+++ b/include/configs/ib62x0.h
|
||||
@@ -85,4 +85,6 @@
|
||||
@@ -77,4 +77,6 @@
|
||||
#define CONFIG_RTC_MV
|
||||
#endif /* CONFIG_CMD_DATE */
|
||||
|
||||
|
||||
+#include "openwrt-kirkwood-common.h"
|
||||
+
|
||||
#endif /* _CONFIG_IB62x0_H */
|
||||
--- a/include/configs/iconnect.h
|
||||
+++ b/include/configs/iconnect.h
|
||||
@@ -72,4 +72,6 @@
|
||||
@@ -67,4 +67,6 @@
|
||||
* File system
|
||||
*/
|
||||
|
||||
|
||||
+#include "openwrt-kirkwood-common.h"
|
||||
+
|
||||
#endif /* _CONFIG_ICONNECT_H */
|
||||
@ -71,34 +71,34 @@
|
||||
+#endif /* __OPENWRT_KIRKWOOD_COMMON_H */
|
||||
--- a/include/configs/pogo_e02.h
|
||||
+++ b/include/configs/pogo_e02.h
|
||||
@@ -72,4 +72,6 @@
|
||||
@@ -66,4 +66,6 @@
|
||||
* File system
|
||||
*/
|
||||
|
||||
|
||||
+#include "openwrt-kirkwood-common.h"
|
||||
+
|
||||
#endif /* _CONFIG_POGO_E02_H */
|
||||
--- a/include/configs/goflexhome.h
|
||||
+++ b/include/configs/goflexhome.h
|
||||
@@ -91,4 +91,6 @@
|
||||
@@ -85,4 +85,6 @@
|
||||
#define CONFIG_SYS_ATA_IDE0_OFFSET MV_SATA_PORT0_OFFSET
|
||||
#endif /*CONFIG_MVSATA_IDE*/
|
||||
|
||||
|
||||
+#include "openwrt-kirkwood-common.h"
|
||||
+
|
||||
#endif /* _CONFIG_GOFLEXHOME_H */
|
||||
--- a/include/configs/nsa310.h
|
||||
+++ b/include/configs/nsa310.h
|
||||
@@ -114,4 +114,6 @@
|
||||
@@ -100,4 +100,6 @@
|
||||
#define CONFIG_RTC_MV
|
||||
#endif /* CONFIG_CMD_DATE */
|
||||
|
||||
|
||||
+#include "openwrt-kirkwood-common.h"
|
||||
+
|
||||
#endif /* _CONFIG_NSA310_H */
|
||||
--- a/configs/dockstar_defconfig
|
||||
+++ b/configs/dockstar_defconfig
|
||||
@@ -31,3 +31,8 @@ CONFIG_USB=y
|
||||
@@ -38,3 +38,8 @@ CONFIG_SYS_NS16550=y
|
||||
CONFIG_USB=y
|
||||
CONFIG_USB_EHCI_HCD=y
|
||||
CONFIG_USB_STORAGE=y
|
||||
@ -109,8 +109,8 @@
|
||||
+CONFIG_LZO=y
|
||||
--- a/configs/goflexhome_defconfig
|
||||
+++ b/configs/goflexhome_defconfig
|
||||
@@ -40,3 +40,8 @@ CONFIG_USB=y
|
||||
CONFIG_USB=y
|
||||
@@ -49,3 +49,8 @@ CONFIG_USB=y
|
||||
CONFIG_DM_USB=y
|
||||
CONFIG_USB_EHCI_HCD=y
|
||||
CONFIG_USB_STORAGE=y
|
||||
+CONFIG_CMD_BOOTZ=y
|
||||
@ -120,30 +120,28 @@
|
||||
+CONFIG_LZO=y
|
||||
--- a/configs/ib62x0_defconfig
|
||||
+++ b/configs/ib62x0_defconfig
|
||||
@@ -35,4 +35,7 @@ CONFIG_SYS_NS16550=y
|
||||
@@ -43,4 +43,7 @@ CONFIG_SYS_NS16550=y
|
||||
CONFIG_USB=y
|
||||
CONFIG_USB_EHCI_HCD=y
|
||||
CONFIG_USB_STORAGE=y
|
||||
-CONFIG_LZMA=y
|
||||
+CONFIG_FIT=y
|
||||
+CONFIG_FIT_VERBOSE=y
|
||||
+CONFIG_LZMA=y
|
||||
CONFIG_LZMA=y
|
||||
+CONFIG_LZO=y
|
||||
--- a/configs/iconnect_defconfig
|
||||
+++ b/configs/iconnect_defconfig
|
||||
@@ -31,4 +31,8 @@ CONFIG_SYS_NS16550=y
|
||||
@@ -39,4 +39,8 @@ CONFIG_SYS_NS16550=y
|
||||
CONFIG_USB=y
|
||||
CONFIG_USB_EHCI_HCD=y
|
||||
CONFIG_USB_STORAGE=y
|
||||
-CONFIG_LZMA=y
|
||||
+CONFIG_CMD_BOOTZ=y
|
||||
+CONFIG_FIT=y
|
||||
+CONFIG_FIT_VERBOSE=y
|
||||
+CONFIG_LZMA=y
|
||||
CONFIG_LZMA=y
|
||||
+CONFIG_LZO=y
|
||||
--- a/configs/nsa310_defconfig
|
||||
+++ b/configs/nsa310_defconfig
|
||||
@@ -35,6 +35,9 @@ CONFIG_CMD_UBI=y
|
||||
@@ -43,6 +43,9 @@ CONFIG_CMD_UBI=y
|
||||
CONFIG_USB=y
|
||||
CONFIG_USB_EHCI_HCD=y
|
||||
CONFIG_USB_STORAGE=y
|
||||
@ -155,7 +153,7 @@
|
||||
CONFIG_SYS_LONGHELP=y
|
||||
--- a/configs/pogo_e02_defconfig
|
||||
+++ b/configs/pogo_e02_defconfig
|
||||
@@ -31,3 +31,8 @@ CONFIG_USB=y
|
||||
@@ -39,3 +39,8 @@ CONFIG_SYS_NS16550=y
|
||||
CONFIG_USB=y
|
||||
CONFIG_USB_EHCI_HCD=y
|
||||
CONFIG_USB_STORAGE=y
|
||||
|
@ -8,13 +8,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=uboot-layerscape
|
||||
PKG_VERSION:=lsdk-1903
|
||||
PKG_VERSION:=LSDK-20.04
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://source.codeaurora.org/external/qoriq/qoriq-components/u-boot
|
||||
PKG_SOURCE_VERSION:=80b2d2bc4cab0a8363c9b7eba8064b1795f12670
|
||||
PKG_MIRROR_HASH:=5c467af40b4479f0ea16697ab54602bed815a23212293184943dca8a3a406d5c
|
||||
PKG_SOURCE_VERSION:=b0833bd0e26c059277f0673c9887b967f1ea5837
|
||||
PKG_MIRROR_HASH:=3cc01d4853ba56d9bcfe5366eddb5f664ae110741146d04f03434d38b4b5b0a0
|
||||
|
||||
include $(INCLUDE_DIR)/u-boot.mk
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
@ -27,6 +27,12 @@ define U-Boot/Default
|
||||
ENV_SIZE:=0x2000
|
||||
endef
|
||||
|
||||
define U-Boot/ls1012afrdm
|
||||
NAME:=NXP LS1012AFRDM
|
||||
UBOOT_CONFIG:=ls1012afrdm_tfa
|
||||
ENV_SIZE:=0x40000
|
||||
endef
|
||||
|
||||
define U-Boot/ls1012ardb
|
||||
NAME:=NXP LS1012ARDB
|
||||
UBOOT_CONFIG:=ls1012ardb_tfa
|
||||
@ -49,7 +55,6 @@ define U-Boot/ls1043ardb-sdboot
|
||||
UBOOT_CONFIG:=ls1043ardb_tfa
|
||||
endef
|
||||
|
||||
|
||||
define U-Boot/ls1046ardb
|
||||
NAME:=NXP LS1046ARDB
|
||||
UBOOT_CONFIG:=ls1046ardb_tfa
|
||||
@ -60,13 +65,11 @@ define U-Boot/ls1046ardb-sdboot
|
||||
UBOOT_CONFIG:=ls1046ardb_tfa
|
||||
endef
|
||||
|
||||
|
||||
define U-Boot/ls1088ardb
|
||||
NAME:=NXP LS1088ARDB
|
||||
UBOOT_CONFIG:=ls1088ardb_tfa
|
||||
endef
|
||||
|
||||
|
||||
define U-Boot/ls1088ardb-sdboot
|
||||
NAME:=NXP LS1088ARDB SD Card Boot
|
||||
UBOOT_CONFIG:=ls1088ardb_tfa
|
||||
@ -100,8 +103,8 @@ define U-Boot/ls1021aiot-sdboot
|
||||
ENV_SIZE:=0x2000
|
||||
endef
|
||||
|
||||
|
||||
UBOOT_TARGETS := \
|
||||
ls1012afrdm \
|
||||
ls1012ardb \
|
||||
ls1012afrwy \
|
||||
ls1043ardb \
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user