OpenWrt 18.6.4: sync to stable code version
This commit is contained in:
parent
fbc92dcb48
commit
bb53dab94b
74
README
74
README
@ -1,34 +1,60 @@
|
||||
_______ ________ __
|
||||
| |.-----.-----.-----.| | | |.----.| |_
|
||||
| - || _ | -__| || | | || _|| _|
|
||||
|_______|| __|_____|__|__||________||__| |____|
|
||||
|__| W I R E L E S S F R E E D O M
|
||||
-----------------------------------------------------
|
||||
Welcome to Lean's git source of OpenWrt and packages
|
||||
|
||||
This is the buildsystem for the OpenWrt Linux distribution.
|
||||
中文:如何编译自己需要的 OpenWrt 固件
|
||||
|
||||
To build your own firmware you need a Linux, BSD or MacOSX system (case
|
||||
sensitive filesystem required). Cygwin is unsupported because of the lack
|
||||
of a case sensitive file system.
|
||||
注意:
|
||||
1. 不要用 root 用户 git 和编译!!!
|
||||
2. 国内用户编译前最好准备好梯子
|
||||
3. 默认登陆IP 192.168.1.1, 密码 password
|
||||
|
||||
You need gcc, binutils, bzip2, flex, python, perl, make, find, grep, diff,
|
||||
unzip, gawk, getopt, subversion, libz-dev and libc headers installed.
|
||||
编译命令如下:
|
||||
|
||||
1. Run "./scripts/feeds update -a" to obtain all the latest package definitions
|
||||
defined in feeds.conf / feeds.conf.default
|
||||
1. 首先装好 Ubuntu 64bit,推荐 Ubuntu 14 LTS x64
|
||||
|
||||
2. Run "./scripts/feeds install -a" to install symlinks for all obtained
|
||||
packages into package/feeds/
|
||||
2. 命令行输入 sudo apt-get update ,然后输入
|
||||
sudo apt-get -y install build-essential asciidoc binutils bzip2 gawk gettext git libncurses5-dev libz-dev patch unzip zlib1g-dev lib32gcc1 libc6-dev-i386 subversion flex uglifyjs git-core gcc-multilib p7zip p7zip-full msmtp libssl-dev texinfo libglib2.0-dev xmlto qemu-utils upx libelf-dev autoconf automake libtool autopoint
|
||||
|
||||
3. Run "make menuconfig" to select your preferred configuration for the
|
||||
toolchain, target system & firmware packages.
|
||||
3. git clone https://github.com/coolsnowwolf/lede 命令下载好源代码,然后 cd lede 进入目录
|
||||
|
||||
4. Run "make" to build your firmware. This will download all sources, build
|
||||
the cross-compile toolchain and then cross-compile the Linux kernel & all
|
||||
chosen applications for your target system.
|
||||
4. ./scripts/feeds update -a
|
||||
./scripts/feeds install -a
|
||||
make menuconfig
|
||||
|
||||
Sunshine!
|
||||
Your OpenWrt Community
|
||||
http://www.openwrt.org
|
||||
5. 最后选好你要的路由,输入 make -j1 V=s (-j1 后面是线程数。第一次编译推荐用单线程,国内请尽量全局科学上网)即可开始编译你要的固件了。
|
||||
|
||||
本套代码保证肯定可以编译成功。里面包括了 R9 所有源代码,包括 IPK 的。
|
||||
|
||||
你可以自由使用,但源码编译二次发布请注明我的 GitHub 仓库链接。谢谢合作!
|
||||
|
||||
特别提示:
|
||||
1. 源代码中绝不含任何后门和可以监控或者劫持你的 HTTPS 的闭源软件,SSL 安全是互联网最后的壁垒。安全干净才是固件应该做到的。
|
||||
2.如果你自认为 Koolshare 论坛或者其固件的脑残粉,本人不欢迎你使用本源代码。所以如果你是,那么使用过程中遇到任何问题本人概不回应。
|
||||
3.如有问题需要讨论,欢迎加入 QQ 讨论群:Gargoyle OpenWrt 编译大群 ,号码 718010658 ,加群链接 点击链接加入群聊【Op共享技术交流群】:https://jq.qq.com/?_wv=1027&k=5PUGjOG
|
||||
|
||||
Please use "make menuconfig" to choose your preferred
|
||||
configuration for the toolchain and firmware.
|
||||
|
||||
You need to have installed gcc, binutils, bzip2, flex, python, perl, make,
|
||||
find, grep, diff, unzip, gawk, getopt, subversion, libz-dev and libc headers.
|
||||
|
||||
Run "./scripts/feeds update -a" to get all the latest package definitions
|
||||
defined in feeds.conf / feeds.conf.default respectively
|
||||
and "./scripts/feeds install -a" to install symlinks of all of them into
|
||||
package/feeds/.
|
||||
|
||||
Use "make menuconfig" to configure your image.
|
||||
|
||||
Simply running "make" will build your firmware.
|
||||
It will download all sources, build the cross-compile toolchain,
|
||||
the kernel and all choosen applications.
|
||||
|
||||
To build your own firmware you need to have access to a Linux, BSD or MacOSX system
|
||||
(case-sensitive filesystem required). Cygwin will not be supported because of
|
||||
the lack of case sensitiveness in the file system.
|
||||
|
||||
|
||||
|
||||
Note: Addition Lean's private package source code in ./package/lean directory. Use it under GPL v3.
|
||||
|
||||
GPLv3 is compatible with more licenses than GPLv2: it allows you to make combinations with code that has specific kinds of additional requirements that are not in GPLv3 itself. Section 7 has more information about this, including the list of additional requirements that are permitted.
|
||||
|
||||
|
@ -7,6 +7,13 @@
|
||||
|
||||
menu "Global build settings"
|
||||
|
||||
config JSON_ADD_IMAGE_INFO
|
||||
bool "Create JSON info files per build image"
|
||||
default BUILDBOT
|
||||
help
|
||||
The JSON info files contain information about the device and
|
||||
build images, stored next to the firmware images.
|
||||
|
||||
config ALL_NONSHARED
|
||||
bool "Select all target specific packages by default"
|
||||
select ALL_KMODS
|
||||
@ -41,7 +48,7 @@ menu "Global build settings"
|
||||
default n
|
||||
|
||||
config BUILD_PATENTED
|
||||
default n
|
||||
default y
|
||||
bool "Compile with support for patented functionality"
|
||||
help
|
||||
When this option is disabled, software which provides patented functionality
|
||||
@ -234,6 +241,14 @@ menu "Global build settings"
|
||||
bool "Strong"
|
||||
endchoice
|
||||
|
||||
config KERNEL_STACKPROTECTOR
|
||||
bool
|
||||
default KERNEL_CC_STACKPROTECTOR_REGULAR || KERNEL_CC_STACKPROTECTOR_STRONG
|
||||
|
||||
config KERNEL_STACKPROTECTOR_STRONG
|
||||
bool
|
||||
default KERNEL_CC_STACKPROTECTOR_STRONG
|
||||
|
||||
choice
|
||||
prompt "Enable buffer-overflows detection (FORTIFY_SOURCE)"
|
||||
default PKG_FORTIFY_SOURCE_1
|
||||
|
@ -18,6 +18,7 @@ menu "Target Images"
|
||||
default TARGET_INITRAMFS_COMPRESSION_LZMA if TARGET_ramips
|
||||
default TARGET_INITRAMFS_COMPRESSION_LZMA if TARGET_apm821xx
|
||||
default TARGET_INITRAMFS_COMPRESSION_LZMA if TARGET_mpc85xx
|
||||
default TARGET_INITRAMFS_COMPRESSION_LZMA if TARGET_ipq40xx
|
||||
default TARGET_INITRAMFS_COMPRESSION_NONE
|
||||
depends on TARGET_ROOTFS_INITRAMFS
|
||||
help
|
||||
@ -77,7 +78,7 @@ menu "Target Images"
|
||||
|
||||
menuconfig TARGET_ROOTFS_EXT4FS
|
||||
bool "ext4"
|
||||
default y if USES_EXT4
|
||||
default n
|
||||
help
|
||||
Build an ext4 root filesystem.
|
||||
|
||||
@ -149,6 +150,7 @@ menu "Target Images"
|
||||
int "Block size (in KiB)"
|
||||
depends on TARGET_ROOTFS_SQUASHFS
|
||||
default 64 if LOW_MEMORY_FOOTPRINT
|
||||
default 1024 if (SMALL_FLASH && !LOW_MEMORY_FOOTPRINT)
|
||||
default 256
|
||||
|
||||
menuconfig TARGET_ROOTFS_UBIFS
|
||||
@ -192,22 +194,30 @@ menu "Target Images"
|
||||
depends on TARGET_ROOTFS_EXT4FS || TARGET_ROOTFS_ISO || 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)"
|
||||
depends on TARGET_x86
|
||||
depends on TARGET_ROOTFS_EXT4FS || TARGET_ROOTFS_ISO || TARGET_ROOTFS_JFFS2 || TARGET_ROOTFS_SQUASHFS
|
||||
select PACKAGE_grub2
|
||||
select PACKAGE_grub2-efi
|
||||
default n
|
||||
|
||||
config GRUB_CONSOLE
|
||||
bool "Use Console Terminal (in addition to Serial)"
|
||||
depends on GRUB_IMAGES
|
||||
depends on GRUB_IMAGES || EFI_IMAGES
|
||||
default n if (TARGET_x86_generic_Soekris45xx || TARGET_x86_generic_Soekris48xx || TARGET_x86_net5501 || TARGET_x86_geos || TARGET_x86_alix2)
|
||||
default y
|
||||
|
||||
config GRUB_SERIAL
|
||||
string "Serial port device"
|
||||
depends on GRUB_IMAGES
|
||||
depends on GRUB_IMAGES || EFI_IMAGES
|
||||
default "hvc0" if TARGET_x86_xen_domu
|
||||
default "ttyS0" if ! TARGET_x86_xen_domu
|
||||
|
||||
config GRUB_BAUDRATE
|
||||
int "Serial port baud rate"
|
||||
depends on GRUB_IMAGES
|
||||
depends on GRUB_IMAGES || EFI_IMAGES
|
||||
default 38400 if TARGET_x86_generic
|
||||
default 115200
|
||||
|
||||
@ -218,18 +228,26 @@ menu "Target Images"
|
||||
|
||||
config GRUB_BOOTOPTS
|
||||
string "Extra kernel boot options"
|
||||
depends on GRUB_IMAGES
|
||||
depends on GRUB_IMAGES || EFI_IMAGES
|
||||
default "xencons=hvc" if TARGET_x86_xen_domu
|
||||
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
|
||||
default "5"
|
||||
depends on GRUB_IMAGES || EFI_IMAGES
|
||||
default "0"
|
||||
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
|
||||
default "OpenWrt"
|
||||
help
|
||||
This is the title of the GRUB menu entry.
|
||||
If unspecified, it defaults to OpenWrt.
|
||||
|
||||
config VDI_IMAGES
|
||||
bool "Build VirtualBox image files (VDI)"
|
||||
depends on TARGET_x86 || TARGET_x86_64
|
||||
@ -243,15 +261,33 @@ menu "Target Images"
|
||||
select GRUB_IMAGES
|
||||
select TARGET_IMAGES_PAD
|
||||
select PACKAGE_kmod-e1000
|
||||
default y
|
||||
|
||||
config VHD_IMAGES
|
||||
bool "Build Hyper-V image files (VHD)"
|
||||
depends on TARGET_x86 || TARGET_x86_64
|
||||
default n
|
||||
depends on GRUB_IMAGES || EFI_IMAGES
|
||||
select TARGET_IMAGES_PAD
|
||||
select PACKAGE_kmod-tulip
|
||||
|
||||
config QCOW2_IMAGES
|
||||
bool "Build PVE/KVM image files (QCOW2)"
|
||||
depends on TARGET_x86 || TARGET_x86_64
|
||||
default n
|
||||
depends on GRUB_IMAGES || EFI_IMAGES
|
||||
select TARGET_IMAGES_PAD
|
||||
select PACKAGE_kmod-e1000
|
||||
|
||||
config TARGET_IMAGES_PAD
|
||||
bool "Pad images to filesystem size (for JFFS2)"
|
||||
depends on GRUB_IMAGES
|
||||
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
|
||||
default y
|
||||
default n
|
||||
|
||||
comment "Image Options"
|
||||
|
||||
@ -259,19 +295,20 @@ menu "Target Images"
|
||||
|
||||
config TARGET_KERNEL_PARTSIZE
|
||||
int "Kernel partition size (in MB)"
|
||||
depends on GRUB_IMAGES || USES_BOOT_PART
|
||||
depends on GRUB_IMAGES || EFI_IMAGES || USES_BOOT_PART
|
||||
default 8 if TARGET_apm821xx_sata
|
||||
default 16
|
||||
|
||||
config TARGET_ROOTFS_PARTSIZE
|
||||
int "Root filesystem partition size (in MB)"
|
||||
depends on GRUB_IMAGES || USES_ROOTFS_PART || TARGET_ROOTFS_EXT4FS || TARGET_rb532 || TARGET_mvebu || TARGET_uml
|
||||
default 256
|
||||
depends on GRUB_IMAGES || EFI_IMAGES || USES_ROOTFS_PART || TARGET_ROOTFS_EXT4FS || TARGET_mvebu || 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
|
||||
depends on GRUB_IMAGES || 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
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
config KERNEL_BUILD_USER
|
||||
string "Custom Kernel Build User Name"
|
||||
default "builder" if BUILDBOT
|
||||
default ""
|
||||
help
|
||||
Sets the Kernel build user string, which for example will be returned
|
||||
@ -14,6 +15,7 @@ config KERNEL_BUILD_USER
|
||||
|
||||
config KERNEL_BUILD_DOMAIN
|
||||
string "Custom Kernel Build Domain Name"
|
||||
default "buildhost" if BUILDBOT
|
||||
default ""
|
||||
help
|
||||
Sets the Kernel build domain string, which for example will be
|
||||
@ -31,7 +33,7 @@ config KERNEL_CRASHLOG
|
||||
|
||||
config KERNEL_SWAP
|
||||
bool "Support for paging of anonymous memory (swap)"
|
||||
default y
|
||||
default y if !SMALL_FLASH
|
||||
|
||||
config KERNEL_DEBUG_FS
|
||||
bool "Compile the kernel with debug filesystem enabled"
|
||||
@ -52,6 +54,24 @@ config KERNEL_ARM_PMU
|
||||
default n
|
||||
depends on (arm || aarch64)
|
||||
|
||||
config KERNEL_X86_VSYSCALL_EMULATION
|
||||
bool "Enable vsyscall emulation"
|
||||
default n
|
||||
depends on x86_64
|
||||
help
|
||||
This enables emulation of the legacy vsyscall page. Disabling
|
||||
it is roughly equivalent to booting with vsyscall=none, except
|
||||
that it will also disable the helpful warning if a program
|
||||
tries to use a vsyscall. With this option set to N, offending
|
||||
programs will just segfault, citing addresses of the form
|
||||
0xffffffffff600?00.
|
||||
|
||||
This option is required by many programs built before 2013, and
|
||||
care should be used even with newer programs if set to N.
|
||||
|
||||
Disabling this option saves about 7K of kernel size and
|
||||
possibly 4K of additional runtime pagetable memory.
|
||||
|
||||
config KERNEL_PERF_EVENTS
|
||||
bool "Compile the kernel with performance events and counters"
|
||||
default n
|
||||
@ -65,6 +85,27 @@ config KERNEL_PROFILING
|
||||
Enable the extended profiling support mechanisms used by profilers such
|
||||
as OProfile.
|
||||
|
||||
config KERNEL_TASKSTATS
|
||||
bool "Compile the kernel with task resource/io statistics and accounting"
|
||||
default n
|
||||
help
|
||||
Enable the collection and publishing of task/io statistics and
|
||||
accounting. Enable this option to enable i/o monitoring in system
|
||||
monitors.
|
||||
|
||||
if KERNEL_TASKSTATS
|
||||
|
||||
config KERNEL_TASK_DELAY_ACCT
|
||||
def_bool y
|
||||
|
||||
config KERNEL_TASK_IO_ACCOUNTING
|
||||
def_bool y
|
||||
|
||||
config KERNEL_TASK_XACCT
|
||||
def_bool y
|
||||
|
||||
endif
|
||||
|
||||
config KERNEL_KALLSYMS
|
||||
bool "Compile the kernel with symbol table information"
|
||||
default y if !SMALL_FLASH
|
||||
@ -112,7 +153,7 @@ config KERNEL_DEBUG_KERNEL
|
||||
|
||||
config KERNEL_DEBUG_INFO
|
||||
bool "Compile the kernel with debug information"
|
||||
default y
|
||||
default y if !SMALL_FLASH
|
||||
select KERNEL_DEBUG_KERNEL
|
||||
help
|
||||
This will compile your kernel and modules with debug information.
|
||||
@ -171,17 +212,21 @@ config KERNEL_KPROBE_EVENT
|
||||
bool
|
||||
default y if KERNEL_KPROBES
|
||||
|
||||
config KERNEL_KPROBE_EVENTS
|
||||
bool
|
||||
default y if KERNEL_KPROBES
|
||||
|
||||
config KERNEL_AIO
|
||||
bool "Compile the kernel with asynchronous IO support"
|
||||
default n
|
||||
default y if !SMALL_FLASH
|
||||
|
||||
config KERNEL_FHANDLE
|
||||
bool "Compile the kernel with support for fhandle syscalls"
|
||||
default n
|
||||
default y if !SMALL_FLASH
|
||||
|
||||
config KERNEL_FANOTIFY
|
||||
bool "Compile the kernel with modern file notification support"
|
||||
default n
|
||||
default y if !SMALL_FLASH
|
||||
|
||||
config KERNEL_BLK_DEV_BSG
|
||||
bool "Compile the kernel with SCSI generic v4 support for any block device"
|
||||
@ -205,7 +250,7 @@ config KERNEL_COREDUMP
|
||||
config KERNEL_ELF_CORE
|
||||
bool "Enable process core dump support"
|
||||
select KERNEL_COREDUMP
|
||||
default y
|
||||
default y if !SMALL_FLASH
|
||||
|
||||
config KERNEL_PROVE_LOCKING
|
||||
bool "Enable kernel lock checking"
|
||||
@ -295,7 +340,7 @@ config KERNEL_ENCRYPTED_KEYS
|
||||
|
||||
config KERNEL_CGROUPS
|
||||
bool "Enable kernel cgroups"
|
||||
default n
|
||||
default y if !SMALL_FLASH
|
||||
|
||||
if KERNEL_CGROUPS
|
||||
|
||||
@ -334,7 +379,7 @@ if KERNEL_CGROUPS
|
||||
|
||||
config KERNEL_CPUSETS
|
||||
bool "Cpuset support"
|
||||
default n
|
||||
default y if !SMALL_FLASH
|
||||
help
|
||||
This option will let you create and manage CPUSETs which
|
||||
allow dynamically partitioning a system into sets of CPUs and
|
||||
@ -348,14 +393,14 @@ if KERNEL_CGROUPS
|
||||
|
||||
config KERNEL_CGROUP_CPUACCT
|
||||
bool "Simple CPU accounting cgroup subsystem"
|
||||
default n
|
||||
default y if !SMALL_FLASH
|
||||
help
|
||||
Provides a simple Resource Controller for monitoring the
|
||||
total CPU consumed by the tasks in a cgroup.
|
||||
|
||||
config KERNEL_RESOURCE_COUNTERS
|
||||
bool "Resource counters"
|
||||
default n
|
||||
default y if !SMALL_FLASH
|
||||
help
|
||||
This option enables controller independent resource accounting
|
||||
infrastructure that works with cgroups.
|
||||
@ -366,7 +411,7 @@ if KERNEL_CGROUPS
|
||||
|
||||
config KERNEL_MEMCG
|
||||
bool "Memory Resource Controller for Control Groups"
|
||||
default n
|
||||
default y if !SMALL_FLASH
|
||||
depends on KERNEL_RESOURCE_COUNTERS || !LINUX_3_18
|
||||
help
|
||||
Provides a memory resource controller that manages both anonymous
|
||||
@ -424,7 +469,7 @@ if KERNEL_CGROUPS
|
||||
|
||||
config KERNEL_MEMCG_KMEM
|
||||
bool "Memory Resource Controller Kernel Memory accounting (EXPERIMENTAL)"
|
||||
default n
|
||||
default y if !SMALL_FLASH
|
||||
depends on KERNEL_MEMCG
|
||||
help
|
||||
The Kernel Memory extension for Memory Resource Controller can limit
|
||||
@ -445,7 +490,7 @@ if KERNEL_CGROUPS
|
||||
|
||||
menuconfig KERNEL_CGROUP_SCHED
|
||||
bool "Group CPU scheduler"
|
||||
default n
|
||||
default y if !SMALL_FLASH
|
||||
help
|
||||
This feature lets CPU scheduler recognize task groups and control CPU
|
||||
bandwidth allocation to such task groups. It uses cgroups to group
|
||||
@ -455,7 +500,7 @@ if KERNEL_CGROUPS
|
||||
|
||||
config KERNEL_FAIR_GROUP_SCHED
|
||||
bool "Group scheduling for SCHED_OTHER"
|
||||
default n
|
||||
default y if !SMALL_FLASH
|
||||
|
||||
config KERNEL_CFS_BANDWIDTH
|
||||
bool "CPU bandwidth provisioning for FAIR_GROUP_SCHED"
|
||||
@ -470,7 +515,7 @@ if KERNEL_CGROUPS
|
||||
|
||||
config KERNEL_RT_GROUP_SCHED
|
||||
bool "Group scheduling for SCHED_RR/FIFO"
|
||||
default n
|
||||
default y if !SMALL_FLASH
|
||||
help
|
||||
This feature lets you explicitly allocate real CPU bandwidth
|
||||
to task groups. If enabled, it will also make it impossible to
|
||||
@ -498,6 +543,20 @@ if KERNEL_CGROUPS
|
||||
CONFIG_CFQ_GROUP_IOSCHED=y; for enabling throttling policy, set
|
||||
CONFIG_BLK_DEV_THROTTLING=y.
|
||||
|
||||
if KERNEL_BLK_CGROUP
|
||||
|
||||
config KERNEL_CFQ_GROUP_IOSCHED
|
||||
bool "Proportional weight of disk bandwidth in CFQ"
|
||||
|
||||
config KERNEL_BLK_DEV_THROTTLING
|
||||
bool "Enable throttling policy"
|
||||
default y if TARGET_brcm2708
|
||||
|
||||
config KERNEL_BLK_DEV_THROTTLING_LOW
|
||||
bool "Block throttling .low limit interface support (EXPERIMENTAL)"
|
||||
depends on KERNEL_BLK_DEV_THROTTLING
|
||||
endif
|
||||
|
||||
config KERNEL_DEBUG_BLK_CGROUP
|
||||
bool "Enable Block IO controller debugging"
|
||||
default n
|
||||
@ -522,7 +581,7 @@ endif
|
||||
|
||||
config KERNEL_NAMESPACES
|
||||
bool "Enable kernel namespaces"
|
||||
default n
|
||||
default y if !SMALL_FLASH
|
||||
|
||||
if KERNEL_NAMESPACES
|
||||
|
||||
@ -564,41 +623,30 @@ if KERNEL_NAMESPACES
|
||||
|
||||
endif
|
||||
|
||||
#
|
||||
# LXC related symbols
|
||||
#
|
||||
config KERNEL_DEVPTS_MULTIPLE_INSTANCES
|
||||
bool "Support multiple instances of devpts"
|
||||
default y if !SMALL_FLASH
|
||||
help
|
||||
Enable support for multiple instances of devpts filesystem.
|
||||
If you want to have isolated PTY namespaces (eg: in containers),
|
||||
say Y here. Otherwise, say N. If enabled, each mount of devpts
|
||||
filesystem with the '-o newinstance' option will create an
|
||||
independent PTY namespace.
|
||||
|
||||
config KERNEL_LXC_MISC
|
||||
bool "Enable miscellaneous LXC related options"
|
||||
default n
|
||||
config KERNEL_POSIX_MQUEUE
|
||||
bool "POSIX Message Queues"
|
||||
default y if !SMALL_FLASH
|
||||
help
|
||||
POSIX variant of message queues is a part of IPC. In POSIX message
|
||||
queues every message has a priority which decides about succession
|
||||
of receiving it by a process. If you want to compile and run
|
||||
programs written e.g. for Solaris with use of its POSIX message
|
||||
queues (functions mq_*) say Y here.
|
||||
|
||||
if KERNEL_LXC_MISC
|
||||
POSIX message queues are visible as a filesystem called 'mqueue'
|
||||
and can be mounted somewhere if you want to do filesystem
|
||||
operations on message queues.
|
||||
|
||||
config KERNEL_DEVPTS_MULTIPLE_INSTANCES
|
||||
bool "Support multiple instances of devpts"
|
||||
default y
|
||||
help
|
||||
Enable support for multiple instances of devpts filesystem.
|
||||
If you want to have isolated PTY namespaces (eg: in containers),
|
||||
say Y here. Otherwise, say N. If enabled, each mount of devpts
|
||||
filesystem with the '-o newinstance' option will create an
|
||||
independent PTY namespace.
|
||||
|
||||
config KERNEL_POSIX_MQUEUE
|
||||
bool "POSIX Message Queues"
|
||||
default y
|
||||
help
|
||||
POSIX variant of message queues is a part of IPC. In POSIX message
|
||||
queues every message has a priority which decides about succession
|
||||
of receiving it by a process. If you want to compile and run
|
||||
programs written e.g. for Solaris with use of its POSIX message
|
||||
queues (functions mq_*) say Y here.
|
||||
|
||||
POSIX message queues are visible as a filesystem called 'mqueue'
|
||||
and can be mounted somewhere if you want to do filesystem
|
||||
operations on message queues.
|
||||
|
||||
endif
|
||||
|
||||
config KERNEL_SECCOMP_FILTER
|
||||
bool
|
||||
@ -785,3 +833,30 @@ config KERNEL_DEVKMEM
|
||||
Say Y here if you want to support the /dev/kmem device. The
|
||||
/dev/kmem device is rarely used, but can be used for certain
|
||||
kind of kernel debugging operations.
|
||||
|
||||
config KERNEL_SQUASHFS_FRAGMENT_CACHE_SIZE
|
||||
int "Number of squashfs fragments cached"
|
||||
default 2 if (SMALL_FLASH && !LOW_MEMORY_FOOTPRINT)
|
||||
default 3
|
||||
|
||||
#
|
||||
# compile optimiziation setting
|
||||
#
|
||||
choice
|
||||
prompt "Compiler optimization level"
|
||||
default KERNEL_CC_OPTIMIZE_FOR_SIZE if SMALL_FLASH
|
||||
|
||||
config KERNEL_CC_OPTIMIZE_FOR_PERFORMANCE
|
||||
bool "Optimize for performance"
|
||||
help
|
||||
This is the default optimization level for the kernel, building
|
||||
with the "-O2" compiler flag for best performance and most
|
||||
helpful compile-time warnings.
|
||||
|
||||
config KERNEL_CC_OPTIMIZE_FOR_SIZE
|
||||
bool "Optimize for size"
|
||||
help
|
||||
Enabling this option will pass "-Os" instead of "-O2" to
|
||||
your compiler resulting in a smaller kernel.
|
||||
|
||||
endchoice
|
||||
|
@ -19,17 +19,23 @@ endif
|
||||
|
||||
DOWNLOAD_RDEP=$(STAMP_PREPARED) $(HOST_STAMP_PREPARED)
|
||||
|
||||
define dl_method_git
|
||||
$(if $(filter https://github.com/% git://github.com/%,$(1)),github_archive,git)
|
||||
endef
|
||||
|
||||
# Try to guess the download method from the URL
|
||||
define dl_method
|
||||
$(strip \
|
||||
$(if $(2),$(2), \
|
||||
$(if $(filter @APACHE/% @GITHUB/% @GNOME/% @GNU/% @KERNEL/% @SF/% @SAVANNAH/% ftp://% http://% https://% file://%,$(1)),default, \
|
||||
$(if $(filter git://%,$(1)),git, \
|
||||
$(if $(filter svn://%,$(1)),svn, \
|
||||
$(if $(filter cvs://%,$(1)),cvs, \
|
||||
$(if $(filter hg://%,$(1)),hg, \
|
||||
$(if $(filter sftp://%,$(1)),bzr, \
|
||||
unknown \
|
||||
$(if $(filter git,$(2)),$(call dl_method_git,$(1),$(2)),
|
||||
$(if $(2),$(2), \
|
||||
$(if $(filter @APACHE/% @GITHUB/% @GNOME/% @GNU/% @KERNEL/% @SF/% @SAVANNAH/% ftp://% http://% https://% file://%,$(1)),default, \
|
||||
$(if $(filter git://%,$(1)),$(call dl_method_git,$(1),$(2)), \
|
||||
$(if $(filter svn://%,$(1)),svn, \
|
||||
$(if $(filter cvs://%,$(1)),cvs, \
|
||||
$(if $(filter hg://%,$(1)),hg, \
|
||||
$(if $(filter sftp://%,$(1)),bzr, \
|
||||
unknown \
|
||||
) \
|
||||
) \
|
||||
) \
|
||||
) \
|
||||
@ -56,6 +62,10 @@ ifdef CHECK
|
||||
check_escape=$(subst ','\'',$(1))
|
||||
#')
|
||||
|
||||
# $(1): suffix of the F_, C_ variables, e.g. hash_deprecated, hash_mismatch, etc.
|
||||
# $(2): filename
|
||||
# $(3): expected hash value
|
||||
# $(4): var name of the the form: {PKG_,Download/<name>:}{,MIRROR_}{HASH,MIRROR_HASH}
|
||||
check_warn_nofix = $(info $(shell printf "$(_R)WARNING: %s$(_N)" '$(call check_escape,$(call C_$(1),$(2),$(3),$(4)))'))
|
||||
ifndef FIXUP
|
||||
check_warn = $(check_warn_nofix)
|
||||
@ -71,11 +81,17 @@ F_hash_mismatch = $(F_hash_deprecated)
|
||||
F_hash_missing = $(SCRIPT_DIR)/fixup-makefile.pl $(CURDIR)/Makefile add-hash $(3) $(call gen_sha256sum,$(1))
|
||||
endif
|
||||
|
||||
# $(1): filename
|
||||
# $(2): expected hash value
|
||||
# $(3): var name of the the form: {PKG_,Download/<name>:}{,MIRROR_}{HASH,MIRROR_HASH}
|
||||
C_download_missing = $(1) is missing, please run make download before re-running this check
|
||||
C_hash_mismatch = $(3) does not match $(1) hash $(call gen_sha256sum,$(1))
|
||||
C_hash_deprecated = $(3) uses deprecated hash, set to $(call gen_sha256sum,$(1))
|
||||
C_hash_missing = $(3) is missing, set to $(call gen_sha256sum,$(1))
|
||||
|
||||
# $(1): filename
|
||||
# $(2): expected hash value
|
||||
# $(3): var name of the the form: {PKG_,Download/<name>:}{,MIRROR_}{HASH,MIRROR_HASH}
|
||||
check_hash = \
|
||||
$(if $(wildcard $(DL_DIR)/$(1)), \
|
||||
$(if $(filter-out x,$(2)), \
|
||||
@ -116,6 +132,9 @@ define DownloadMethod/default
|
||||
)
|
||||
endef
|
||||
|
||||
# $(1): "check"
|
||||
# $(2): "PKG_" if <name> as in Download/<name> is "default", otherwise "Download/<name>:"
|
||||
# $(3): shell command sequence to do the download
|
||||
define wrap_mirror
|
||||
$(if $(if $(MIRROR),$(filter-out x,$(MIRROR_HASH))),$(SCRIPT_DIR)/download.pl "$(DL_DIR)" "$(FILE)" "$(MIRROR_HASH)" "" || ( $(3) ),$(3)) \
|
||||
$(if $(filter check,$(1)), \
|
||||
@ -159,23 +178,41 @@ endef
|
||||
|
||||
define DownloadMethod/git
|
||||
$(call wrap_mirror,$(1),$(2), \
|
||||
echo "Checking out files from the git repository..."; \
|
||||
mkdir -p $(TMP_DIR)/dl && \
|
||||
cd $(TMP_DIR)/dl && \
|
||||
rm -rf $(SUBDIR) && \
|
||||
[ \! -d $(SUBDIR) ] && \
|
||||
git clone $(OPTS) $(URL) $(SUBDIR) && \
|
||||
(cd $(SUBDIR) && git checkout $(VERSION) && \
|
||||
git submodule update --init --recursive) && \
|
||||
echo "Packing checkout..." && \
|
||||
export TAR_TIMESTAMP=`cd $(SUBDIR) && git log -1 --format='@%ct'` && \
|
||||
rm -rf $(SUBDIR)/.git && \
|
||||
$(call dl_tar_pack,$(TMP_DIR)/dl/$(FILE),$(SUBDIR)) && \
|
||||
mv $(TMP_DIR)/dl/$(FILE) $(DL_DIR)/ && \
|
||||
rm -rf $(SUBDIR); \
|
||||
$(call DownloadMethod/rawgit) \
|
||||
)
|
||||
endef
|
||||
|
||||
define DownloadMethod/github_archive
|
||||
$(call wrap_mirror,$(1),$(2), \
|
||||
$(SCRIPT_DIR)/dl_github_archive.py \
|
||||
--dl-dir="$(DL_DIR)" \
|
||||
--url="$(URL)" \
|
||||
--version="$(VERSION)" \
|
||||
--subdir="$(SUBDIR)" \
|
||||
--source="$(FILE)" \
|
||||
--hash="$(MIRROR_HASH)" \
|
||||
|| ( $(call DownloadMethod/rawgit) ); \
|
||||
)
|
||||
endef
|
||||
|
||||
# Only intends to be called as a submethod from other DownloadMethod
|
||||
define DownloadMethod/rawgit
|
||||
echo "Checking out files from the git repository..."; \
|
||||
mkdir -p $(TMP_DIR)/dl && \
|
||||
cd $(TMP_DIR)/dl && \
|
||||
rm -rf $(SUBDIR) && \
|
||||
[ \! -d $(SUBDIR) ] && \
|
||||
git clone $(OPTS) $(URL) $(SUBDIR) && \
|
||||
(cd $(SUBDIR) && git checkout $(VERSION) && \
|
||||
git submodule update --init --recursive) && \
|
||||
echo "Packing checkout..." && \
|
||||
export TAR_TIMESTAMP=`cd $(SUBDIR) && git log -1 --format='@%ct'` && \
|
||||
rm -rf $(SUBDIR)/.git && \
|
||||
$(call dl_tar_pack,$(TMP_DIR)/dl/$(FILE),$(SUBDIR)) && \
|
||||
mv $(TMP_DIR)/dl/$(FILE) $(DL_DIR)/ && \
|
||||
rm -rf $(SUBDIR);
|
||||
endef
|
||||
|
||||
define DownloadMethod/bzr
|
||||
$(call wrap_mirror,$(1),$(2), \
|
||||
echo "Checking out files from the bzr repository..."; \
|
||||
|
@ -19,7 +19,7 @@ endif
|
||||
ifdef CONFIG_PKG_ASLR_PIE
|
||||
ifeq ($(strip $(PKG_ASLR_PIE)),1)
|
||||
TARGET_CFLAGS += $(FPIC)
|
||||
TARGET_LDFLAGS += -specs=$(INCLUDE_DIR)/hardened-ld-pie.specs
|
||||
TARGET_LDFLAGS += $(FPIC) -specs=$(INCLUDE_DIR)/hardened-ld-pie.specs
|
||||
endif
|
||||
endif
|
||||
ifdef CONFIG_PKG_CC_STACKPROTECTOR_REGULAR
|
||||
|
@ -49,6 +49,31 @@ define Build/eva-image
|
||||
mv $@.new $@
|
||||
endef
|
||||
|
||||
define Build/seama
|
||||
$(STAGING_DIR_HOST)/bin/seama -i $@ \
|
||||
-m "dev=/dev/mtdblock/$(SEAMA_MTDBLOCK)" -m "type=firmware"
|
||||
mv $@.seama $@
|
||||
endef
|
||||
|
||||
define Build/seama-seal
|
||||
$(STAGING_DIR_HOST)/bin/seama -i $@ -s $@.seama \
|
||||
-m "signature=$(SEAMA_SIGNATURE)"
|
||||
mv $@.seama $@
|
||||
endef
|
||||
|
||||
define Build/zyxel-ras-image
|
||||
let \
|
||||
newsize="$(subst k,* 1024,$(RAS_ROOTFS_SIZE))"; \
|
||||
$(STAGING_DIR_HOST)/bin/mkrasimage \
|
||||
-b $(RAS_BOARD) \
|
||||
-v $(RAS_VERSION) \
|
||||
-r $@ \
|
||||
-s $$newsize \
|
||||
-o $@.new \
|
||||
$(if $(findstring separate-kernel,$(word 1,$(1))),-k $(IMAGE_KERNEL)) \
|
||||
&& mv $@.new $@
|
||||
endef
|
||||
|
||||
define Build/netgear-chk
|
||||
$(STAGING_DIR_HOST)/bin/mkchkimg \
|
||||
-o $@.new \
|
||||
@ -77,6 +102,10 @@ define Build/append-squashfs-fakeroot-be
|
||||
cat $@.fakesquashfs >> $@
|
||||
endef
|
||||
|
||||
define Build/append-string
|
||||
echo -n $(1) >> $@
|
||||
endef
|
||||
|
||||
# append a fake/empty uImage header, to fool bootloaders rootfs integrity check
|
||||
# for example
|
||||
define Build/append-uImage-fakehdr
|
||||
@ -102,6 +131,16 @@ define Build/tplink-safeloader
|
||||
$(if $(findstring sysupgrade,$(word 1,$(1))),-S) && mv $@.new $@ || rm -f $@
|
||||
endef
|
||||
|
||||
define Build/mksercommfw
|
||||
-$(STAGING_DIR_HOST)/bin/mksercommfw \
|
||||
$@ \
|
||||
$(KERNEL_OFFSET) \
|
||||
$(HWID) \
|
||||
$(HWVER) \
|
||||
$(SWVER)
|
||||
endef
|
||||
|
||||
|
||||
define Build/append-dtb
|
||||
cat $(KDIR)/image-$(firstword $(DEVICE_DTS)).dtb >> $@
|
||||
endef
|
||||
@ -215,6 +254,11 @@ define Build/pad-offset
|
||||
mv $@.new $@
|
||||
endef
|
||||
|
||||
define Build/xor-image
|
||||
$(STAGING_DIR_HOST)/bin/xorimage -i $@ -o $@.xor $(1)
|
||||
mv $@.xor $@
|
||||
endef
|
||||
|
||||
define Build/check-size
|
||||
@[ $$(($(subst k,* 1024,$(subst m, * 1024k,$(1))))) -ge "$$(stat -c%s $@)" ] || { \
|
||||
echo "WARNING: Image file $@ is too big" >&2; \
|
||||
@ -230,6 +274,13 @@ define Build/combined-image
|
||||
@mv $@.new $@
|
||||
endef
|
||||
|
||||
define Build/linksys-image
|
||||
$(TOPDIR)/scripts/linksys-image.sh \
|
||||
"$(call param_get_default,type,$(1),$(DEVICE_NAME))" \
|
||||
$@ $@.new
|
||||
mv $@.new $@
|
||||
endef
|
||||
|
||||
define Build/openmesh-image
|
||||
$(TOPDIR)/scripts/om-fwupgradecfg-gen.sh \
|
||||
"$(call param_get_default,ce_type,$(1),$(DEVICE_NAME))" \
|
||||
@ -243,6 +294,25 @@ define Build/openmesh-image
|
||||
"$(call param_get_default,rootfs,$(1),$@)" "rootfs"
|
||||
endef
|
||||
|
||||
define Build/qsdk-ipq-factory-nand
|
||||
$(TOPDIR)/scripts/mkits-qsdk-ipq-image.sh \
|
||||
$@.its ubi $@
|
||||
mkimage -f $@.its $@.new
|
||||
@mv $@.new $@
|
||||
endef
|
||||
|
||||
define Build/qsdk-ipq-factory-nor
|
||||
$(TOPDIR)/scripts/mkits-qsdk-ipq-image.sh \
|
||||
$@.its hlos $(IMAGE_KERNEL) rootfs $(IMAGE_ROOTFS)
|
||||
mkimage -f $@.its $@.new
|
||||
@mv $@.new $@
|
||||
endef
|
||||
|
||||
define Build/senao-header
|
||||
$(STAGING_DIR_HOST)/bin/mksenaofw $(1) -e $@ -o $@.new
|
||||
mv $@.new $@
|
||||
endef
|
||||
|
||||
define Build/sysupgrade-tar
|
||||
sh $(TOPDIR)/scripts/sysupgrade-tar.sh \
|
||||
--board $(if $(BOARD_NAME),$(BOARD_NAME),$(DEVICE_NAME)) \
|
||||
@ -296,6 +366,12 @@ metadata_json = \
|
||||
|
||||
define Build/append-metadata
|
||||
$(if $(SUPPORTED_DEVICES),-echo $(call metadata_json,$(SUPPORTED_DEVICES)) | fwtool -I - $@)
|
||||
[ ! -s "$(BUILD_KEY)" -o ! -s "$(BUILD_KEY).ucert" -o ! -s "$@" ] || { \
|
||||
cp "$(BUILD_KEY).ucert" "$@.ucert" ;\
|
||||
usign -S -m "$@" -s "$(BUILD_KEY)" -x "$@.sig" ;\
|
||||
ucert -A -c "$@.ucert" -x "$@.sig" ;\
|
||||
fwtool -S "$@.ucert" "$@" ;\
|
||||
}
|
||||
endef
|
||||
|
||||
define Build/kernel2minor
|
||||
|
167
include/image.mk
167
include/image.mk
@ -42,6 +42,8 @@ IMG_PREFIX_VERNUM:=$(if $(CONFIG_VERSION_FILENAMES),$(call sanitize,$(VERSION_NU
|
||||
IMG_PREFIX_VERCODE:=$(if $(CONFIG_VERSION_CODE_FILENAMES),$(call sanitize,$(VERSION_CODE))-)
|
||||
|
||||
IMG_PREFIX:=$(VERSION_DIST_SANITIZED)-$(IMG_PREFIX_VERNUM)$(IMG_PREFIX_VERCODE)$(IMG_PREFIX_EXTRA)$(BOARD)$(if $(SUBTARGET),-$(SUBTARGET))
|
||||
IMG_ROOTFS:=$(IMG_PREFIX)-rootfs
|
||||
IMG_COMBINED:=$(IMG_PREFIX)-combined
|
||||
|
||||
MKFS_DEVTABLE_OPT := -D $(INCLUDE_DIR)/device_table.txt
|
||||
|
||||
@ -104,7 +106,7 @@ define add_jffs2_mark
|
||||
echo -ne '\xde\xad\xc0\xde' >> $(1)
|
||||
endef
|
||||
|
||||
PROFILE_SANITIZED := $(call sanitize,$(PROFILE))
|
||||
PROFILE_SANITIZED := $(call tolower,$(subst DEVICE_,,$(subst $(space),-,$(PROFILE))))
|
||||
|
||||
define split_args
|
||||
$(foreach data, \
|
||||
@ -152,6 +154,43 @@ ifdef CONFIG_TARGET_IMAGES_GZIP
|
||||
endef
|
||||
endif
|
||||
|
||||
|
||||
# Disable noisy checks by default as in upstream
|
||||
ifeq ($(strip $(call kernel_patchver_ge,4.7.0)),1)
|
||||
DTC_FLAGS += -Wno-unit_address_vs_reg
|
||||
endif
|
||||
ifeq ($(strip $(call kernel_patchver_ge,4.12.0)),1)
|
||||
DTC_FLAGS += \
|
||||
-Wno-unit_address_vs_reg \
|
||||
-Wno-simple_bus_reg \
|
||||
-Wno-unit_address_format \
|
||||
-Wno-pci_bridge \
|
||||
-Wno-pci_device_bus_num \
|
||||
-Wno-pci_device_reg
|
||||
endif
|
||||
ifeq ($(strip $(call kernel_patchver_ge,4.17.0)),1)
|
||||
DTC_FLAGS += \
|
||||
-Wno-avoid_unnecessary_addr_size \
|
||||
-Wno-alias_paths
|
||||
endif
|
||||
ifeq ($(strip $(call kernel_patchver_ge,4.18.0)),1)
|
||||
DTC_FLAGS += \
|
||||
-Wno-graph_child_address \
|
||||
-Wno-graph_port \
|
||||
-Wno-unique_unit_address
|
||||
endif
|
||||
|
||||
define Image/pad-to
|
||||
dd if=$(1) of=$(1).new bs=$(2) conv=sync
|
||||
mv $(1).new $(1)
|
||||
endef
|
||||
|
||||
ROOTFS_PARTSIZE=$(shell echo $$(($(CONFIG_TARGET_ROOTFS_PARTSIZE)*1024*1024)))
|
||||
|
||||
define Image/pad-root-squashfs
|
||||
$(call Image/pad-to,$(KDIR)/root.squashfs,$(if $(1),$(1),$(ROOTFS_PARTSIZE)))
|
||||
endef
|
||||
|
||||
# $(1) source dts file
|
||||
# $(2) target dtb file
|
||||
# $(3) extra CPP flags
|
||||
@ -164,7 +203,7 @@ define Image/BuildDTB
|
||||
-undef -D__DTS__ $(3) \
|
||||
-o $(2).tmp $(1)
|
||||
$(LINUX_DIR)/scripts/dtc/dtc -O dtb \
|
||||
-i$(dir $(1)) $(4) \
|
||||
-i$(dir $(1)) $(DTC_FLAGS) $(4) \
|
||||
-o $(2) $(2).tmp
|
||||
$(RM) $(2).tmp
|
||||
endef
|
||||
@ -203,8 +242,7 @@ define Image/mkfs/squashfs
|
||||
$(STAGING_DIR_HOST)/bin/mksquashfs4 $(call mkfs_target_dir,$(1)) $@ \
|
||||
-nopad -noappend -root-owned \
|
||||
-comp $(SQUASHFSCOMP) $(SQUASHFSOPT) \
|
||||
-processors 1 \
|
||||
$(if $(SOURCE_DATE_EPOCH),-fixed-time $(SOURCE_DATE_EPOCH))
|
||||
-processors 16
|
||||
endef
|
||||
|
||||
# $(1): board name
|
||||
@ -248,11 +286,9 @@ define Image/mkfs/ubifs
|
||||
-o $@ -d $(call mkfs_target_dir,$(1))
|
||||
endef
|
||||
|
||||
E2SIZE=$(shell echo $$(($(CONFIG_TARGET_ROOTFS_PARTSIZE)*1024*1024)))
|
||||
|
||||
define Image/mkfs/ext4
|
||||
$(STAGING_DIR_HOST)/bin/make_ext4fs \
|
||||
-l $(E2SIZE) -b $(CONFIG_TARGET_EXT4_BLOCKSIZE) \
|
||||
-l $(ROOTFS_PARTSIZE) -b $(CONFIG_TARGET_EXT4_BLOCKSIZE) \
|
||||
$(if $(CONFIG_TARGET_EXT4_RESERVED_PCT),-m $(CONFIG_TARGET_EXT4_RESERVED_PCT)) \
|
||||
$(if $(CONFIG_TARGET_EXT4_JOURNAL),,-J) \
|
||||
$(if $(SOURCE_DATE_EPOCH),-T $(SOURCE_DATE_EPOCH)) \
|
||||
@ -264,9 +300,26 @@ define Image/Manifest
|
||||
$(BIN_DIR)/$(IMG_PREFIX)$(if $(PROFILE_SANITIZED),-$(PROFILE_SANITIZED)).manifest
|
||||
endef
|
||||
|
||||
define Image/gzip-ext4-padded-squashfs
|
||||
|
||||
define Image/Build/squashfs
|
||||
$(call Image/pad-root-squashfs)
|
||||
endef
|
||||
|
||||
ifneq ($(CONFIG_TARGET_IMAGES_GZIP),)
|
||||
define Image/Build/gzip/ext4
|
||||
$(call Image/Build/gzip,ext4)
|
||||
endef
|
||||
define Image/Build/gzip/squashfs
|
||||
$(call Image/Build/gzip,squashfs)
|
||||
endef
|
||||
endif
|
||||
|
||||
endef
|
||||
|
||||
ifdef CONFIG_TARGET_ROOTFS_TARGZ
|
||||
define Image/Build/targz
|
||||
$(TAR) -cp --numeric-owner --owner=0 --group=0 --sort=name \
|
||||
$(TAR) -cp --numeric-owner --owner=0 --group=0 --mode=a-s --sort=name \
|
||||
$(if $(SOURCE_DATE_EPOCH),--mtime="@$(SOURCE_DATE_EPOCH)") \
|
||||
-C $(TARGET_DIR)/ . | gzip -9n > $(BIN_DIR)/$(IMG_PREFIX)$(if $(PROFILE_SANITIZED),-$(PROFILE_SANITIZED))-rootfs.tar.gz
|
||||
endef
|
||||
@ -274,13 +327,13 @@ endif
|
||||
|
||||
ifdef CONFIG_TARGET_ROOTFS_CPIOGZ
|
||||
define Image/Build/cpiogz
|
||||
( cd $(TARGET_DIR); find . | cpio -o -H newc -R root:root | gzip -9n >$(BIN_DIR)/$(IMG_PREFIX)-rootfs.cpio.gz )
|
||||
( cd $(TARGET_DIR); find . | cpio -o -H newc -R root:root | gzip -9n >$(BIN_DIR)/$(IMG_ROOTFS).cpio.gz )
|
||||
endef
|
||||
endif
|
||||
|
||||
mkfs_packages = $(filter-out @%,$(PACKAGES_$(call param_get,pkg,pkg=$(target_params))))
|
||||
mkfs_packages_add = $(filter-out -%,$(mkfs_packages))
|
||||
mkfs_packages_remove = $(patsubst -%,%,$(filter -%,$(mkfs_packages)))
|
||||
mkfs_packages_add = $(foreach pkg,$(filter-out -%,$(mkfs_packages)),$(pkg)$(call GetABISuffix,$(pkg)))
|
||||
mkfs_packages_remove = $(foreach pkg,$(patsubst -%,%,$(filter -%,$(mkfs_packages))),$(pkg)$(call GetABISuffix,$(pkg)))
|
||||
mkfs_cur_target_dir = $(call mkfs_target_dir,pkg=$(target_params))
|
||||
|
||||
opkg_target = \
|
||||
@ -308,7 +361,22 @@ $(KDIR)/root.%: kernel_prepare
|
||||
|
||||
define Device/InitProfile
|
||||
PROFILES := $(PROFILE)
|
||||
DEVICE_TITLE :=
|
||||
DEVICE_TITLE = $$(DEVICE_VENDOR) $$(DEVICE_MODEL)$$(if $$(DEVICE_VARIANT), $$(DEVICE_VARIANT))
|
||||
DEVICE_ALT0_TITLE = $$(DEVICE_ALT0_VENDOR) $$(DEVICE_ALT0_MODEL)$$(if $$(DEVICE_ALT0_VARIANT), $$(DEVICE_ALT0_VARIANT))
|
||||
DEVICE_ALT1_TITLE = $$(DEVICE_ALT1_VENDOR) $$(DEVICE_ALT1_MODEL)$$(if $$(DEVICE_ALT1_VARIANT), $$(DEVICE_ALT1_VARIANT))
|
||||
DEVICE_ALT2_TITLE = $$(DEVICE_ALT2_VENDOR) $$(DEVICE_ALT2_MODEL)$$(if $$(DEVICE_ALT2_VARIANT), $$(DEVICE_ALT2_VARIANT))
|
||||
DEVICE_VENDOR :=
|
||||
DEVICE_MODEL :=
|
||||
DEVICE_VARIANT :=
|
||||
DEVICE_ALT0_VENDOR :=
|
||||
DEVICE_ALT0_MODEL :=
|
||||
DEVICE_ALT0_VARIANT :=
|
||||
DEVICE_ALT1_VENDOR :=
|
||||
DEVICE_ALT1_MODEL :=
|
||||
DEVICE_ALT1_VARIANT :=
|
||||
DEVICE_ALT2_VENDOR :=
|
||||
DEVICE_ALT2_MODEL :=
|
||||
DEVICE_ALT2_VARIANT :=
|
||||
DEVICE_PACKAGES :=
|
||||
DEVICE_DESCRIPTION = Build firmware images for $$(DEVICE_TITLE)
|
||||
endef
|
||||
@ -358,15 +426,22 @@ define Device/Init
|
||||
IMAGE_METADATA :=
|
||||
|
||||
FILESYSTEMS := $(TARGET_FILESYSTEMS)
|
||||
|
||||
UBOOT_PATH := $(STAGING_DIR_IMAGE)/uboot-$(1)
|
||||
|
||||
DEFAULT :=
|
||||
endef
|
||||
|
||||
DEFAULT_DEVICE_VARS := \
|
||||
DEVICE_NAME KERNEL KERNEL_INITRAMFS KERNEL_SIZE KERNEL_INITRAMFS_IMAGE \
|
||||
KERNEL_LOADADDR DEVICE_DTS DEVICE_DTS_CONFIG DEVICE_DTS_DIR BOARD_NAME \
|
||||
CMDLINE UBOOTENV_IN_UBI KERNEL_IN_UBI \
|
||||
BLOCKSIZE PAGESIZE SUBPAGESIZE VID_HDR_OFFSET \
|
||||
UBINIZE_OPTS UIMAGE_NAME UBINIZE_PARTS \
|
||||
SUPPORTED_DEVICES IMAGE_METADATA
|
||||
DEVICE_NAME KERNEL KERNEL_INITRAMFS KERNEL_INITRAMFS_IMAGE KERNEL_SIZE \
|
||||
CMDLINE UBOOTENV_IN_UBI KERNEL_IN_UBI BLOCKSIZE PAGESIZE SUBPAGESIZE \
|
||||
VID_HDR_OFFSET UBINIZE_OPTS UBINIZE_PARTS MKUBIFS_OPTS DEVICE_DTS \
|
||||
DEVICE_DTS_CONFIG DEVICE_DTS_DIR BOARD_NAME UIMAGE_NAME SUPPORTED_DEVICES \
|
||||
IMAGE_METADATA KERNEL_ENTRY KERNEL_LOADADDR UBOOT_PATH DEVICE_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
|
||||
|
||||
define Device/ExportVar
|
||||
$(1) : $(2):=$$($(2))
|
||||
@ -496,11 +571,37 @@ 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="$(SUBTARGET)" \
|
||||
VERSION_NUMBER="$(VERSION_NUMBER)" \
|
||||
VERSION_CODE="$(VERSION_CODE)" \
|
||||
SUPPORTED_DEVICES="$(SUPPORTED_DEVICES)" \
|
||||
$(TOPDIR)/scripts/json_add_image_info.py \
|
||||
)
|
||||
endef
|
||||
|
||||
define Device/Build/artifact
|
||||
$$(_TARGET): $(BIN_DIR)/$(IMAGE_PREFIX)-$(1)
|
||||
$(eval $(call Device/Export,$(KDIR)/tmp/$(IMAGE_PREFIX)-$(1)))
|
||||
$(KDIR)/tmp/$(IMAGE_PREFIX)-$(1): $$(KDIR_KERNEL_IMAGE)
|
||||
@rm -f $$@
|
||||
$$(call concat_cmd,$(ARTIFACT/$(1)))
|
||||
@ -513,6 +614,8 @@ 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))
|
||||
|
||||
@ -530,15 +633,35 @@ endef
|
||||
|
||||
define Device/DumpInfo
|
||||
Target-Profile: DEVICE_$(1)
|
||||
Target-Profile-Name: $(DEVICE_TITLE)
|
||||
Target-Profile-Name: $(DEVICE_DISPLAY)
|
||||
Target-Profile-Packages: $(DEVICE_PACKAGES)
|
||||
Target-Profile-hasImageMetadata: $(if $(foreach image,$(IMAGES),$(findstring append-metadata,$(IMAGE/$(image)))),1,0)
|
||||
Target-Profile-SupportedDevices: $(SUPPORTED_DEVICES)
|
||||
$(if $(DEFAULT),Target-Profile-Default: $(DEFAULT))
|
||||
Target-Profile-Description:
|
||||
$(DEVICE_DESCRIPTION)
|
||||
$(if $(strip $(DEVICE_ALT0_TITLE)),Alternative device titles:
|
||||
- $(DEVICE_ALT0_TITLE))
|
||||
$(if $(strip $(DEVICE_ALT1_TITLE)),- $(DEVICE_ALT1_TITLE))
|
||||
$(if $(strip $(DEVICE_ALT2_TITLE)),- $(DEVICE_ALT2_TITLE))
|
||||
@@
|
||||
|
||||
endef
|
||||
|
||||
define Device/Dump
|
||||
ifneq ($$(strip $$(DEVICE_ALT0_TITLE)),)
|
||||
DEVICE_DISPLAY = $$(DEVICE_ALT0_TITLE) ($$(DEVICE_TITLE))
|
||||
$$(info $$(call Device/DumpInfo,$(1)))
|
||||
endif
|
||||
ifneq ($$(strip $$(DEVICE_ALT1_TITLE)),)
|
||||
DEVICE_DISPLAY = $$(DEVICE_ALT1_TITLE) ($$(DEVICE_TITLE))
|
||||
$$(info $$(call Device/DumpInfo,$(1)))
|
||||
endif
|
||||
ifneq ($$(strip $$(DEVICE_ALT2_TITLE)),)
|
||||
DEVICE_DISPLAY = $$(DEVICE_ALT2_TITLE) ($$(DEVICE_TITLE))
|
||||
$$(info $$(call Device/DumpInfo,$(1)))
|
||||
endif
|
||||
DEVICE_DISPLAY = $$(DEVICE_TITLE)
|
||||
$$(eval $$(if $$(DEVICE_TITLE),$$(info $$(call Device/DumpInfo,$(1)))))
|
||||
endef
|
||||
|
||||
@ -581,7 +704,7 @@ define BuildImage
|
||||
$(call Image/Prepare)
|
||||
|
||||
legacy-images-prepare-make: image_prepare
|
||||
$(MAKE) legacy-images-prepare
|
||||
$(MAKE) legacy-images-prepare BIN_DIR="$(BIN_DIR)"
|
||||
|
||||
else
|
||||
image_prepare:
|
||||
@ -605,7 +728,7 @@ define BuildImage
|
||||
|
||||
legacy-images-make: install-images
|
||||
$(call Image/mkfs/ubifs/legacy)
|
||||
$(MAKE) legacy-images
|
||||
$(MAKE) legacy-images BIN_DIR="$(BIN_DIR)"
|
||||
|
||||
install: install-images
|
||||
$(call Image/Manifest)
|
||||
|
@ -21,16 +21,22 @@ export HOST_EXTRACFLAGS=-I$(STAGING_DIR_HOST)/include
|
||||
# defined in quilt.mk
|
||||
Kernel/Patch:=$(Kernel/Patch/Default)
|
||||
|
||||
ifneq (,$(findstring .xz,$(LINUX_SOURCE)))
|
||||
LINUX_CAT:=xzcat
|
||||
else
|
||||
LINUX_CAT:=zcat
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(CONFIG_EXTERNAL_KERNEL_TREE)),"")
|
||||
ifeq ($(strip $(CONFIG_KERNEL_GIT_CLONE_URI)),"")
|
||||
define Kernel/Prepare/Default
|
||||
xzcat $(DL_DIR)/$(LINUX_SOURCE) | $(TAR) -C $(KERNEL_BUILD_DIR) $(TAR_OPTIONS)
|
||||
$(LINUX_CAT) $(DL_DIR)/$(LINUX_SOURCE) | $(TAR) -C $(KERNEL_BUILD_DIR) $(TAR_OPTIONS)
|
||||
$(Kernel/Patch)
|
||||
$(if $(QUILT),touch $(LINUX_DIR)/.quilt_used)
|
||||
endef
|
||||
else
|
||||
define Kernel/Prepare/Default
|
||||
xzcat $(DL_DIR)/$(LINUX_SOURCE) | $(TAR) -C $(KERNEL_BUILD_DIR) $(TAR_OPTIONS)
|
||||
$(LINUX_CAT) $(DL_DIR)/$(LINUX_SOURCE) | $(TAR) -C $(KERNEL_BUILD_DIR) $(TAR_OPTIONS)
|
||||
endef
|
||||
endif
|
||||
else
|
||||
|
@ -2,11 +2,17 @@
|
||||
|
||||
LINUX_RELEASE?=1
|
||||
|
||||
LINUX_VERSION-4.9 = .146
|
||||
LINUX_VERSION-4.14 = .89
|
||||
ifdef CONFIG_TESTING_KERNEL
|
||||
KERNEL_PATCHVER:=$(KERNEL_TESTING_PATCHVER)
|
||||
endif
|
||||
|
||||
LINUX_KERNEL_HASH-4.9.146 = 58195a8be3085d117c83a2ed1caa3b46ea7c1614c75f951b9f13f7adb03f8e59
|
||||
LINUX_KERNEL_HASH-4.14.89 = ce6e16ac44dddd0d6a232bf2ce03e8bf8beca19f9b84503684466d140a1a0b25
|
||||
LINUX_VERSION-4.9 = .196
|
||||
LINUX_VERSION-4.14 = .149
|
||||
LINUX_VERSION-4.19 = .79
|
||||
|
||||
LINUX_KERNEL_HASH-4.9.196 = e0ab12b04a975630ece2142a1ac15cfe45140b8c3359226b035c15ca7c92c6ef
|
||||
LINUX_KERNEL_HASH-4.14.149 = e69dabd2368440ce1650cda0cf043e1ba3f3343f940a43b68e761739fcb3f296
|
||||
LINUX_KERNEL_HASH-4.19.79 = f1143564364f278ba0893a7813afc02da6ecef6d5de147bd5011aa3cc1634b34
|
||||
|
||||
remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1))))
|
||||
sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1)))))))
|
||||
@ -21,6 +27,9 @@ else
|
||||
ifdef KERNEL_PATCHVER
|
||||
LINUX_VERSION:=$(KERNEL_PATCHVER)$(strip $(LINUX_VERSION-$(KERNEL_PATCHVER)))
|
||||
endif
|
||||
ifdef KERNEL_TESTING_PATCHVER
|
||||
LINUX_TESTING_VERSION:=$(KERNEL_TESTING_PATCHVER)$(strip $(LINUX_VERSION-$(KERNEL_TESTING_PATCHVER)))
|
||||
endif
|
||||
endif
|
||||
|
||||
split_version=$(subst ., ,$(1))
|
||||
@ -31,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
|
@ -59,8 +59,15 @@ else
|
||||
|
||||
LINUX_KERNEL:=$(KERNEL_BUILD_DIR)/vmlinux
|
||||
|
||||
LINUX_SOURCE:=linux-$(LINUX_VERSION).tar.xz
|
||||
ifeq ($(call qstrip,$(CONFIG_EXTERNAL_KERNEL_TREE))$(call qstrip,$(CONFIG_KERNEL_GIT_CLONE_URI)),)
|
||||
ifneq (,$(findstring -rc,$(LINUX_VERSION)))
|
||||
LINUX_SOURCE:=linux-$(LINUX_VERSION).tar.gz
|
||||
else
|
||||
LINUX_SOURCE:=linux-$(LINUX_VERSION).tar.xz
|
||||
endif
|
||||
|
||||
ifneq (,$(findstring -rc,$(LINUX_VERSION)))
|
||||
LINUX_SITE:=https://git.kernel.org/torvalds/t
|
||||
else ifeq ($(call qstrip,$(CONFIG_EXTERNAL_KERNEL_TREE))$(call qstrip,$(CONFIG_KERNEL_GIT_CLONE_URI)),)
|
||||
LINUX_SITE:=@KERNEL/linux/kernel/v$(word 1,$(subst ., ,$(KERNEL_BASE))).x
|
||||
else
|
||||
LINUX_UNAME_VERSION:=$(strip $(shell cat $(LINUX_DIR)/include/config/kernel.release 2>/dev/null))
|
||||
@ -252,7 +259,7 @@ $(call KernelPackage/$(1)/config)
|
||||
endif
|
||||
$$(eval $$(call BuildPackage,kmod-$(1)))
|
||||
|
||||
$$(IPKG_kmod-$(1)): $$(wildcard $$(FILES))
|
||||
$$(IPKG_kmod-$(1)): $$(wildcard $$(call version_filter,$$(FILES)))
|
||||
|
||||
endef
|
||||
|
||||
|
@ -80,6 +80,7 @@ $(eval $(call nf_add,IPT_CONNTRACK,CONFIG_NETFILTER_XT_MATCH_CONNTRACK, $(P_XT)x
|
||||
|
||||
$(eval $(call nf_add,IPT_CONNTRACK_EXTRA,CONFIG_NETFILTER_XT_MATCH_CONNBYTES, $(P_XT)xt_connbytes))
|
||||
$(eval $(call nf_add,IPT_CONNTRACK_EXTRA,CONFIG_NETFILTER_XT_MATCH_CONNLIMIT, $(P_XT)xt_connlimit))
|
||||
$(eval $(call nf_add,IPT_CONNTRACK_EXTRA,CONFIG_NETFILTER_CONNCOUNT, $(P_XT)nf_conncount))
|
||||
$(eval $(call nf_add,IPT_CONNTRACK_EXTRA,CONFIG_NETFILTER_XT_CONNMARK, $(P_XT)xt_connmark))
|
||||
$(eval $(call nf_add,IPT_CONNTRACK_EXTRA,CONFIG_NETFILTER_XT_MATCH_HELPER, $(P_XT)xt_helper))
|
||||
$(eval $(call nf_add,IPT_CONNTRACK_EXTRA,CONFIG_NETFILTER_XT_MATCH_RECENT, $(P_XT)xt_recent))
|
||||
@ -156,7 +157,8 @@ $(eval $(if $(NF_KMOD),$(call nf_add,NF_REJECT6,CONFIG_NF_REJECT_IPV6, $(P_V6)nf
|
||||
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NF_IPT6,CONFIG_IP6_NF_IPTABLES, $(P_V6)ip6_tables),))
|
||||
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NF_CONNTRACK6,CONFIG_NF_DEFRAG_IPV6, $(P_V6)nf_defrag_ipv6),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NF_CONNTRACK,CONFIG_NF_DEFRAG_IPV6, $(P_V6)nf_defrag_ipv6, ge 4.19),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NF_CONNTRACK6,CONFIG_NF_DEFRAG_IPV6, $(P_V6)nf_defrag_ipv6, lt 4.19),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NF_CONNTRACK6,CONFIG_NF_CONNTRACK_IPV6, $(P_V6)nf_conntrack_ipv6),))
|
||||
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,IPT_IPV6,CONFIG_IP6_NF_FILTER, $(P_V6)ip6table_filter),))
|
||||
@ -185,10 +187,10 @@ $(eval $(call nf_add,IPT_IPV6_EXTRA,CONFIG_IP6_NF_MATCH_RT, $(P_V6)ip6t_rt))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NF_NAT,CONFIG_NF_NAT, $(P_XT)nf_nat),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NF_NAT,CONFIG_NF_NAT_REDIRECT, $(P_XT)nf_nat_redirect, ge 3.19.0),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NF_NAT,CONFIG_NF_NAT_IPV4, $(P_V4)nf_nat_ipv4),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NF_NAT,CONFIG_NF_NAT_MASQUERADE_IPV4, $(P_V4)nf_nat_masquerade_ipv4),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NF_NAT,CONFIG_NF_NAT_MASQUERADE_IPV4, $(P_V4)nf_nat_masquerade_ipv4, lt 4.18),))
|
||||
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NF_NAT6,CONFIG_NF_NAT_IPV6, $(P_V6)nf_nat_ipv6),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NF_NAT6,CONFIG_NF_NAT_MASQUERADE_IPV6, $(P_V6)nf_nat_masquerade_ipv6),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NF_NAT6,CONFIG_NF_NAT_MASQUERADE_IPV6, $(P_V6)nf_nat_masquerade_ipv6, lt 4.18),))
|
||||
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,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),))
|
||||
@ -258,7 +260,11 @@ $(eval $(call nf_add,IPT_DEBUG,CONFIG_NETFILTER_XT_TARGET_TRACE, $(P_XT)xt_TRACE
|
||||
# tproxy
|
||||
|
||||
$(eval $(call nf_add,IPT_TPROXY,CONFIG_NETFILTER_XT_MATCH_SOCKET, $(P_XT)xt_socket))
|
||||
$(eval $(call nf_add,IPT_TPROXY,CONFIG_NF_SOCKET_IPV4, $(P_V4)nf_socket_ipv4, ge 4.10))
|
||||
$(eval $(call nf_add,IPT_TPROXY,CONFIG_NF_SOCKET_IPV6, $(P_V6)nf_socket_ipv6, ge 4.10))
|
||||
$(eval $(call nf_add,IPT_TPROXY,CONFIG_NETFILTER_XT_TARGET_TPROXY, $(P_XT)xt_TPROXY))
|
||||
$(eval $(call nf_add,IPT_TPROXY,CONFIG_NF_TPROXY_IPV4, $(P_V4)nf_tproxy_ipv4, ge 4.18))
|
||||
$(eval $(call nf_add,IPT_TPROXY,CONFIG_NF_TPROXY_IPV6, $(P_V6)nf_tproxy_ipv6, ge 4.18))
|
||||
|
||||
# led
|
||||
$(eval $(call nf_add,IPT_LED,CONFIG_NETFILTER_XT_TARGET_LED, $(P_XT)xt_LED))
|
||||
@ -328,7 +334,7 @@ $(eval $(call nf_add,EBTABLES_WATCHERS,CONFIG_BRIDGE_EBT_NFQUEUE, $(P_EBT)ebt_nf
|
||||
|
||||
# nftables
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NF_TABLES, $(P_XT)nf_tables),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NF_TABLES_INET, $(P_XT)nf_tables_inet),))
|
||||
$(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),))
|
||||
@ -342,16 +348,16 @@ $(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NFT_LOG, $(P_XT)nft_log),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NFT_LIMIT, $(P_XT)nft_limit),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NFT_REJECT, $(P_XT)nft_reject $(P_V4)nft_reject_ipv4 $(P_V6)nft_reject_ipv6),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NFT_REJECT_INET, $(P_XT)nft_reject_inet),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NF_TABLES_IPV4, $(P_V4)nf_tables_ipv4),))
|
||||
$(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),))
|
||||
$(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_ARP,CONFIG_NF_TABLES_ARP, $(P_V4)nf_tables_arp),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_ARP,CONFIG_NF_TABLES_ARP, $(P_V4)nf_tables_arp, lt 4.17),))
|
||||
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_BRIDGE,CONFIG_NF_TABLES_BRIDGE, $(P_EBT)nf_tables_bridge),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_BRIDGE,CONFIG_NF_TABLES_BRIDGE, $(P_EBT)nf_tables_bridge, lt 4.17),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_BRIDGE,CONFIG_NFT_BRIDGE_META, $(P_EBT)nft_meta_bridge),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_BRIDGE,CONFIG_NFT_BRIDGE_REJECT, $(P_EBT)nft_reject_bridge),))
|
||||
|
||||
@ -365,6 +371,11 @@ $(eval $(if $(NF_KMOD),$(call nf_add,NFT_NAT6,CONFIG_NFT_REDIR_IPV6, $(P_V6)nft_
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_NAT6,CONFIG_NFT_CHAIN_NAT_IPV6, $(P_V6)nft_chain_nat_ipv6),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_NAT6,CONFIG_NFT_MASQ_IPV6, $(P_V6)nft_masq_ipv6),))
|
||||
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_FIB,CONFIG_NFT_FIB, $(P_XT)nft_fib),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_FIB,CONFIG_NFT_FIB_INET, $(P_XT)nft_fib_inet),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_FIB,CONFIG_NFT_FIB_IPV4, $(P_V4)nft_fib_ipv4),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_FIB,CONFIG_NFT_FIB_IPV6, $(P_V6)nft_fib_ipv6),))
|
||||
|
||||
|
||||
# userland only
|
||||
IPT_BUILTIN += $(NF_IPT-y) $(NF_IPT-m)
|
||||
|
@ -13,16 +13,16 @@ __target_inc=1
|
||||
DEVICE_TYPE?=router
|
||||
|
||||
# Default packages - the really basic set
|
||||
DEFAULT_PACKAGES:=base-files libc libgcc busybox dropbear mtd uci opkg netifd fstools uclient-fetch logd block-mount \
|
||||
kmod-nf-nathelper kmod-nf-nathelper-extra kmod-ipt-raw \
|
||||
DEFAULT_PACKAGES:=base-files libc libgcc busybox dropbear mtd uci opkg netifd fstools uclient-fetch logd block-mount coremark \
|
||||
kmod-nf-nathelper kmod-nf-nathelper-extra kmod-ipt-raw wget libustream-openssl ca-certificates \
|
||||
default-settings luci luci-app-ddns luci-app-sqm luci-app-upnp luci-app-adbyby-plus luci-app-autoreboot \
|
||||
luci-app-filetransfer luci-app-ssr-plus luci-app-vsftpd ddns-scripts_aliyun luci-app-xlnetacc \
|
||||
luci-app-filetransfer luci-app-vsftpd ddns-scripts_aliyun luci-app-ssr-plus \
|
||||
luci-app-pptp-server luci-app-arpbind luci-app-vlmcsd luci-app-wifischedule luci-app-wol luci-app-ramfree \
|
||||
luci-app-sfe luci-app-flowoffload luci-app-nlbwmon luci-app-wrtbwmon luci-app-usb-printer luci-app-accesscontrol
|
||||
luci-app-sfe luci-app-flowoffload luci-app-nlbwmon luci-app-usb-printer luci-app-accesscontrol luci-app-zerotier luci-app-xlnetacc
|
||||
# For nas targets
|
||||
DEFAULT_PACKAGES.nas:=block-mount fdisk lsblk mdadm
|
||||
DEFAULT_PACKAGES.nas:=fdisk lsblk mdadm automount autosamba luci-app-usb-printer
|
||||
# For router targets
|
||||
DEFAULT_PACKAGES.router:=dnsmasq-full iptables ppp ppp-mod-pppoe firewall kmod-ipt-offload
|
||||
DEFAULT_PACKAGES.router:=dnsmasq-full iptables ppp ppp-mod-pppoe firewall kmod-ipt-offload kmod-tcp-bbr
|
||||
DEFAULT_PACKAGES.bootloader:=
|
||||
|
||||
ifneq ($(DUMP),)
|
||||
@ -56,7 +56,7 @@ else
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(filter 4.9,$(KERNEL_PATCHVER)),)
|
||||
ifneq ($(filter 3.18 4.9,$(KERNEL_PATCHVER)),)
|
||||
DEFAULT_PACKAGES.router:=$(filter-out kmod-ipt-offload,$(DEFAULT_PACKAGES.router))
|
||||
endif
|
||||
|
||||
@ -64,7 +64,7 @@ endif
|
||||
DEFAULT_PACKAGES += $(DEFAULT_PACKAGES.$(DEVICE_TYPE))
|
||||
|
||||
filter_packages = $(filter-out -% $(patsubst -%,%,$(filter -%,$(1))),$(1))
|
||||
extra_packages = $(if $(filter wpad-mini wpad nas,$(1)),iwinfo)
|
||||
extra_packages = $(if $(filter wpad-mini wpad-basic wpad nas,$(1)),iwinfo)
|
||||
|
||||
define ProfileDefault
|
||||
NAME:=
|
||||
@ -179,7 +179,7 @@ ifeq ($(DUMP),1)
|
||||
CPU_CFLAGS_mips64 = -mips64 -mtune=mips64 -mabi=64
|
||||
CPU_CFLAGS_24kc = -mips32r2 -mtune=24kc
|
||||
CPU_CFLAGS_74kc = -mips32r2 -mtune=74kc
|
||||
CPU_CFLAGS_octeon = -march=octeon -mabi=64
|
||||
CPU_CFLAGS_octeonplus = -march=octeon+ -mabi=64
|
||||
endif
|
||||
ifeq ($(ARCH),i386)
|
||||
CPU_TYPE ?= pentium
|
||||
|
@ -26,13 +26,13 @@ PKG_CONFIG_DEPENDS += \
|
||||
sanitize = $(call tolower,$(subst _,-,$(subst $(space),-,$(1))))
|
||||
|
||||
VERSION_NUMBER:=$(call qstrip,$(CONFIG_VERSION_NUMBER))
|
||||
VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),18.06-SNAPSHOT)
|
||||
VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),SNAPSHOT)
|
||||
|
||||
VERSION_CODE:=$(call qstrip,$(CONFIG_VERSION_CODE))
|
||||
VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),$(REVISION))
|
||||
|
||||
VERSION_REPO:=$(call qstrip,$(CONFIG_VERSION_REPO))
|
||||
VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),http://downloads.openwrt.org/releases/18.06-SNAPSHOT)
|
||||
VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),http://downloads.openwrt.org/snapshots)
|
||||
|
||||
VERSION_DIST:=$(call qstrip,$(CONFIG_VERSION_DIST))
|
||||
VERSION_DIST:=$(if $(VERSION_DIST),$(VERSION_DIST),OpenWrt)
|
||||
|
@ -12,11 +12,11 @@ include $(INCLUDE_DIR)/version.mk
|
||||
include $(INCLUDE_DIR)/feeds.mk
|
||||
|
||||
PKG_NAME:=base-files
|
||||
PKG_RELEASE:=194.1
|
||||
PKG_RELEASE:=196
|
||||
PKG_FLAGS:=nonshared
|
||||
|
||||
PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/
|
||||
PKG_BUILD_DEPENDS:=usign/host
|
||||
PKG_BUILD_DEPENDS:=usign/host ucert/host
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
|
||||
# Extend depends from version.mk
|
||||
@ -103,6 +103,9 @@ ifdef CONFIG_SIGNED_PACKAGES
|
||||
[ -s $(BUILD_KEY) -a -s $(BUILD_KEY).pub ] || \
|
||||
$(STAGING_DIR_HOST)/bin/usign -G -s $(BUILD_KEY) -p $(BUILD_KEY).pub -c "Local build key"
|
||||
|
||||
[ -s $(BUILD_KEY).ucert ] || \
|
||||
$(STAGING_DIR_HOST)/bin/ucert -I -c $(BUILD_KEY).ucert -p $(BUILD_KEY).pub -s $(BUILD_KEY)
|
||||
|
||||
endef
|
||||
|
||||
define Package/base-files/install-key
|
||||
|
@ -366,11 +366,12 @@ generate_led() {
|
||||
;;
|
||||
|
||||
switch)
|
||||
local port_mask speed_mask
|
||||
json_get_vars port_mask speed_mask
|
||||
local port_mask speed_mask mode
|
||||
json_get_vars port_mask speed_mask mode
|
||||
uci -q batch <<-EOF
|
||||
set system.$cfg.port_mask='$port_mask'
|
||||
set system.$cfg.speed_mask='$speed_mask'
|
||||
set system.$cfg.mode='$mode'
|
||||
EOF
|
||||
;;
|
||||
|
||||
|
@ -1,4 +1,50 @@
|
||||
#!/bin/sh
|
||||
# Copyright (C) 2006-2009 OpenWrt.org
|
||||
# Copyright (C) 2006-2019 OpenWrt.org
|
||||
|
||||
set_state() { :; }
|
||||
. /lib/functions/leds.sh
|
||||
|
||||
boot="$(get_dt_led boot)"
|
||||
failsafe="$(get_dt_led failsafe)"
|
||||
running="$(get_dt_led running)"
|
||||
upgrade="$(get_dt_led upgrade)"
|
||||
|
||||
set_led_state() {
|
||||
status_led="$boot"
|
||||
|
||||
case "$1" in
|
||||
preinit)
|
||||
status_led_blink_preinit
|
||||
;;
|
||||
failsafe)
|
||||
status_led_off
|
||||
[ -n "$running" ] && {
|
||||
status_led="$running"
|
||||
status_led_off
|
||||
}
|
||||
status_led="$failsafe"
|
||||
status_led_blink_failsafe
|
||||
;;
|
||||
preinit_regular)
|
||||
status_led_blink_preinit_regular
|
||||
;;
|
||||
upgrade)
|
||||
[ -n "$running" ] && {
|
||||
status_led="$running"
|
||||
status_led_off
|
||||
}
|
||||
status_led="$upgrade"
|
||||
status_led_blink_preinit_regular
|
||||
;;
|
||||
done)
|
||||
status_led_off
|
||||
[ -n "$running" ] && {
|
||||
status_led="$running"
|
||||
status_led_on
|
||||
}
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
set_state() {
|
||||
[ -n "$boot" -o -n "$failsafe" -o -n "$running" -o -n "$upgrade" ] && set_led_state "$1"
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ load_led() {
|
||||
config_get trigger $1 trigger "none"
|
||||
config_get dev $1 dev
|
||||
config_get ports $1 port
|
||||
config_get mode $1 mode "link"
|
||||
config_get mode $1 mode
|
||||
config_get_bool default $1 default "nil"
|
||||
config_get delayon $1 delayon
|
||||
config_get delayoff $1 delayoff
|
||||
@ -71,7 +71,10 @@ load_led() {
|
||||
"netdev")
|
||||
[ -n "$dev" ] && {
|
||||
echo $dev > /sys/class/leds/${sysfs}/device_name
|
||||
echo $mode > /sys/class/leds/${sysfs}/mode
|
||||
for m in $mode; do
|
||||
[ -e "/sys/class/leds/${sysfs}/$m" ] && \
|
||||
echo 1 > /sys/class/leds/${sysfs}/$m
|
||||
done
|
||||
echo $interval > /sys/class/leds/${sysfs}/interval
|
||||
}
|
||||
;;
|
||||
@ -110,6 +113,8 @@ load_led() {
|
||||
config_get speed_mask $1 speed_mask
|
||||
[ -n "$speed_mask" ] && \
|
||||
echo $speed_mask > /sys/class/leds/${sysfs}/speed_mask
|
||||
[ -n "$mode" ] && \
|
||||
echo "$mode" > /sys/class/leds/${sysfs}/mode
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
8
package/base-files/files/etc/iproute2/ematch_map
Normal file
8
package/base-files/files/etc/iproute2/ematch_map
Normal file
@ -0,0 +1,8 @@
|
||||
# lookup table for ematch kinds
|
||||
1 cmp
|
||||
2 nbyte
|
||||
3 u32
|
||||
4 meta
|
||||
7 canid
|
||||
8 ipset
|
||||
9 ipt
|
@ -27,30 +27,33 @@ json_select_object() {
|
||||
json_select "$1"
|
||||
}
|
||||
|
||||
_ucidef_set_interface() {
|
||||
local name="$1"
|
||||
local iface="$2"
|
||||
local proto="$3"
|
||||
ucidef_set_interface() {
|
||||
local network=$1; shift
|
||||
|
||||
json_select_object "$name"
|
||||
json_add_string ifname "$iface"
|
||||
[ -z "$network" ] && return
|
||||
|
||||
if ! json_is_a protocol string || [ -n "$proto" ]; then
|
||||
case "$proto" in
|
||||
static|dhcp|none|pppoe) : ;;
|
||||
*)
|
||||
case "$name" in
|
||||
lan) proto="static" ;;
|
||||
wan) proto="dhcp" ;;
|
||||
*) proto="none" ;;
|
||||
esac
|
||||
;;
|
||||
json_select_object network
|
||||
json_select_object "$network"
|
||||
|
||||
while [ -n "$1" ]; do
|
||||
local opt=$1; shift
|
||||
local val=$1; shift
|
||||
|
||||
[ -n "$opt" -a -n "$val" ] || break
|
||||
|
||||
json_add_string "$opt" "$val"
|
||||
done
|
||||
|
||||
if ! json_is_a protocol string; then
|
||||
case "$network" in
|
||||
lan) json_add_string protocol static ;;
|
||||
wan) json_add_string protocol dhcp ;;
|
||||
*) json_add_string protocol none ;;
|
||||
esac
|
||||
|
||||
json_add_string protocol "$proto"
|
||||
fi
|
||||
|
||||
json_select ..
|
||||
json_select ..
|
||||
}
|
||||
|
||||
ucidef_set_board_id() {
|
||||
@ -66,31 +69,19 @@ ucidef_set_model_name() {
|
||||
}
|
||||
|
||||
ucidef_set_interface_lan() {
|
||||
json_select_object network
|
||||
_ucidef_set_interface lan "$@"
|
||||
json_select ..
|
||||
ucidef_set_interface "lan" ifname "$1" protocol "${2:-static}"
|
||||
}
|
||||
|
||||
ucidef_set_interface_wan() {
|
||||
json_select_object network
|
||||
_ucidef_set_interface wan "$@"
|
||||
json_select ..
|
||||
ucidef_set_interface "wan" ifname "$1" protocol "${2:-dhcp}"
|
||||
}
|
||||
|
||||
ucidef_set_interfaces_lan_wan() {
|
||||
local lan_if="$1"
|
||||
local wan_if="$2"
|
||||
|
||||
json_select_object network
|
||||
_ucidef_set_interface lan "$lan_if"
|
||||
_ucidef_set_interface wan "$wan_if"
|
||||
json_select ..
|
||||
}
|
||||
|
||||
ucidef_set_interface_raw() {
|
||||
json_select_object network
|
||||
_ucidef_set_interface "$@"
|
||||
json_select ..
|
||||
ucidef_set_interface_lan "$lan_if"
|
||||
ucidef_set_interface_wan "$wan_if"
|
||||
}
|
||||
|
||||
_ucidef_add_switch_port() {
|
||||
@ -185,9 +176,9 @@ _ucidef_finish_switch_roles() {
|
||||
devices="${devices:+$devices }$device"
|
||||
fi
|
||||
json_select ..
|
||||
|
||||
_ucidef_set_interface "$role" "$devices"
|
||||
json_select ..
|
||||
|
||||
ucidef_set_interface "$role" ifname "$devices"
|
||||
done
|
||||
}
|
||||
|
||||
@ -300,18 +291,7 @@ ucidef_set_interface_macaddr() {
|
||||
local network="$1"
|
||||
local macaddr="$2"
|
||||
|
||||
json_select_object network
|
||||
|
||||
json_select "$network"
|
||||
[ $? -eq 0 ] || {
|
||||
json_select ..
|
||||
return
|
||||
}
|
||||
|
||||
json_add_string macaddr "$macaddr"
|
||||
json_select ..
|
||||
|
||||
json_select ..
|
||||
ucidef_set_interface "$network" macaddr "$macaddr"
|
||||
}
|
||||
|
||||
ucidef_add_atm_bridge() {
|
||||
@ -462,11 +442,13 @@ ucidef_set_led_switch() {
|
||||
local trigger_name="$4"
|
||||
local port_mask="$5"
|
||||
local speed_mask="$6"
|
||||
local mode="$7"
|
||||
|
||||
_ucidef_set_led_common "$1" "$2" "$3"
|
||||
|
||||
json_add_string trigger "$trigger_name"
|
||||
json_add_string type switch
|
||||
json_add_string mode "$mode"
|
||||
json_add_string port_mask "$port_mask"
|
||||
json_add_string speed_mask "$speed_mask"
|
||||
json_select ..
|
||||
|
@ -82,7 +82,7 @@ fs_wait_for_key () {
|
||||
|
||||
failsafe_wait() {
|
||||
FAILSAFE=
|
||||
[ "$pi_preinit_no_failsafe" == "y" ] && {
|
||||
[ "$pi_preinit_no_failsafe" = "y" ] && {
|
||||
fs_wait_for_key "" "" $fs_failsafe_wait_timeout
|
||||
return
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ do_urandom_seed() {
|
||||
_do_urandom_seed "/etc/urandom.seed"
|
||||
|
||||
SEED="$(uci -q get system.@system[0].urandom_seed)"
|
||||
[ "${SEED:0:1}" == "/" -a "$SEED" != "/etc/urandom.seed" ] && _do_urandom_seed "$SEED"
|
||||
[ "${SEED:0:1}" = "/" -a "$SEED" != "/etc/urandom.seed" ] && _do_urandom_seed "$SEED"
|
||||
}
|
||||
|
||||
boot_hook_add preinit_main do_urandom_seed
|
||||
|
@ -117,6 +117,24 @@ export_bootdevice() {
|
||||
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
|
||||
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}"
|
||||
@ -164,7 +182,7 @@ export_partdevice() {
|
||||
}
|
||||
|
||||
hex_le32_to_cpu() {
|
||||
[ "$(echo 01 | hexdump -v -n 2 -e '/2 "%x"')" == "3031" ] && {
|
||||
[ "$(echo 01 | hexdump -v -n 2 -e '/2 "%x"')" = "3031" ] && {
|
||||
echo "${1:0:2}${1:8:2}${1:6:2}${1:4:2}${1:2:2}"
|
||||
return
|
||||
}
|
||||
@ -211,6 +229,11 @@ jffs2_copy_config() {
|
||||
fi
|
||||
}
|
||||
|
||||
indicate_upgrade() {
|
||||
. /etc/diag.sh
|
||||
set_state upgrade
|
||||
}
|
||||
|
||||
# Flash firmware to MTD partition
|
||||
#
|
||||
# $(1): path to image
|
||||
|
@ -1,3 +1,28 @@
|
||||
fwtool_check_signature() {
|
||||
[ $# -gt 1 ] && return 1
|
||||
|
||||
[ ! -x /usr/bin/ucert ] && {
|
||||
if [ "$REQUIRE_IMAGE_SIGNATURE" = 1 ]; then
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
|
||||
if ! fwtool -q -t -s /tmp/sysupgrade.ucert "$1"; then
|
||||
echo "Image signature not found"
|
||||
[ "$REQUIRE_IMAGE_SIGNATURE" = 1 -a "$FORCE" != 1 ] && {
|
||||
echo "Use sysupgrade -F to override this check when downgrading or flashing to vendor firmware"
|
||||
}
|
||||
[ "$REQUIRE_IMAGE_SIGNATURE" = 1 ] && return 1
|
||||
return 0
|
||||
fi
|
||||
|
||||
ucert -V -m "$1" -c "/tmp/sysupgrade.ucert" -P /etc/opkg/keys
|
||||
|
||||
return $?
|
||||
}
|
||||
|
||||
fwtool_check_image() {
|
||||
[ $# -gt 1 ] && return 1
|
||||
|
||||
|
@ -10,6 +10,9 @@ CI_KERNPART="${CI_KERNPART:-kernel}"
|
||||
# 'ubi' partition on NAND contains UBI
|
||||
CI_UBIPART="${CI_UBIPART:-ubi}"
|
||||
|
||||
# 'rootfs' partition on NAND contains the rootfs
|
||||
CI_ROOTPART="${CI_ROOTPART:-rootfs}"
|
||||
|
||||
ubi_mknod() {
|
||||
local dir="$1"
|
||||
local dev="/dev/$(basename $dir)"
|
||||
@ -99,7 +102,7 @@ nand_restore_config() {
|
||||
local ubidev=$( nand_find_ubi $CI_UBIPART )
|
||||
local ubivol="$( nand_find_volume $ubidev rootfs_data )"
|
||||
[ ! "$ubivol" ] &&
|
||||
ubivol="$( nand_find_volume $ubidev rootfs )"
|
||||
ubivol="$( nand_find_volume $ubidev $CI_ROOTPART )"
|
||||
mkdir /tmp/new_root
|
||||
if ! mount -t ubifs /dev/$ubivol /tmp/new_root; then
|
||||
echo "mounting ubifs $ubivol failed"
|
||||
@ -143,7 +146,7 @@ nand_upgrade_prepare_ubi() {
|
||||
fi
|
||||
|
||||
local kern_ubivol="$( nand_find_volume $ubidev $CI_KERNPART )"
|
||||
local root_ubivol="$( nand_find_volume $ubidev rootfs )"
|
||||
local root_ubivol="$( nand_find_volume $ubidev $CI_ROOTPART )"
|
||||
local data_ubivol="$( nand_find_volume $ubidev rootfs_data )"
|
||||
|
||||
# remove ubiblock device of rootfs
|
||||
@ -158,7 +161,7 @@ nand_upgrade_prepare_ubi() {
|
||||
|
||||
# kill volumes
|
||||
[ "$kern_ubivol" ] && ubirmvol /dev/$ubidev -N $CI_KERNPART || true
|
||||
[ "$root_ubivol" ] && ubirmvol /dev/$ubidev -N rootfs || true
|
||||
[ "$root_ubivol" ] && ubirmvol /dev/$ubidev -N $CI_ROOTPART || true
|
||||
[ "$data_ubivol" ] && ubirmvol /dev/$ubidev -N rootfs_data || true
|
||||
|
||||
# update kernel
|
||||
@ -176,7 +179,7 @@ nand_upgrade_prepare_ubi() {
|
||||
else
|
||||
root_size_param="-s $rootfs_length"
|
||||
fi
|
||||
if ! ubimkvol /dev/$ubidev -N rootfs $root_size_param; then
|
||||
if ! ubimkvol /dev/$ubidev -N $CI_ROOTPART $root_size_param; then
|
||||
echo "cannot create rootfs volume"
|
||||
return 1;
|
||||
fi
|
||||
@ -233,7 +236,7 @@ nand_upgrade_ubifs() {
|
||||
nand_upgrade_prepare_ubi "$rootfs_length" "ubifs" "0" "0"
|
||||
|
||||
local ubidev="$( nand_find_ubi "$CI_UBIPART" )"
|
||||
local root_ubivol="$(nand_find_volume $ubidev rootfs)"
|
||||
local root_ubivol="$(nand_find_volume $ubidev $CI_ROOTPART)"
|
||||
ubiupdatevol /dev/$root_ubivol -s $rootfs_length $1
|
||||
|
||||
nand_do_upgrade_success
|
||||
@ -268,7 +271,7 @@ nand_upgrade_tar() {
|
||||
ubiupdatevol /dev/$kern_ubivol -s $kernel_length -
|
||||
}
|
||||
|
||||
local root_ubivol="$(nand_find_volume $ubidev rootfs)"
|
||||
local root_ubivol="$(nand_find_volume $ubidev $CI_ROOTPART)"
|
||||
tar xf $tar_file ${board_dir}/root -O | \
|
||||
ubiupdatevol /dev/$root_ubivol -s $rootfs_length -
|
||||
|
||||
|
@ -122,6 +122,7 @@ kill_remaining() { # [ <signal> [ <loop> ] ]
|
||||
echo
|
||||
}
|
||||
|
||||
indicate_upgrade
|
||||
|
||||
killall -9 telnetd
|
||||
killall -9 dropbear
|
||||
|
@ -9,7 +9,10 @@ export INTERACTIVE=0
|
||||
export VERBOSE=1
|
||||
export SAVE_CONFIG=1
|
||||
export SAVE_OVERLAY=0
|
||||
export SAVE_OVERLAY_PATH=
|
||||
export SAVE_PARTITIONS=1
|
||||
export SAVE_INSTALLED_PKGS=0
|
||||
export SKIP_UNCHANGED=0
|
||||
export CONF_IMAGE=
|
||||
export CONF_BACKUP_LIST=0
|
||||
export CONF_BACKUP=
|
||||
@ -18,6 +21,7 @@ export NEED_IMAGE=
|
||||
export HELP=0
|
||||
export FORCE=0
|
||||
export TEST=0
|
||||
export UMOUNT_ETCBACKUP_DIR=0
|
||||
|
||||
# parse options
|
||||
while [ -n "$1" ]; do
|
||||
@ -26,17 +30,20 @@ while [ -n "$1" ]; do
|
||||
-v) export VERBOSE="$(($VERBOSE + 1))";;
|
||||
-q) export VERBOSE="$(($VERBOSE - 1))";;
|
||||
-n) export SAVE_CONFIG=0;;
|
||||
-c) export SAVE_OVERLAY=1;;
|
||||
-c) export SAVE_OVERLAY=1 SAVE_OVERLAY_PATH=/etc;;
|
||||
-o) export SAVE_OVERLAY=1 SAVE_OVERLAY_PATH=/;;
|
||||
-p) export SAVE_PARTITIONS=0;;
|
||||
-k) export SAVE_INSTALLED_PKGS=1;;
|
||||
-u) export SKIP_UNCHANGED=1;;
|
||||
-b|--create-backup) export CONF_BACKUP="$2" NEED_IMAGE=1; shift;;
|
||||
-r|--restore-backup) export CONF_RESTORE="$2" NEED_IMAGE=1; shift;;
|
||||
-l|--list-backup) export CONF_BACKUP_LIST=1; break;;
|
||||
-l|--list-backup) export CONF_BACKUP_LIST=1;;
|
||||
-f) export CONF_IMAGE="$2"; shift;;
|
||||
-F|--force) export FORCE=1;;
|
||||
-T|--test) export TEST=1;;
|
||||
-h|--help) export HELP=1; break;;
|
||||
-*)
|
||||
echo "Invalid option: $1"
|
||||
echo "Invalid option: $1" >&2
|
||||
exit 1
|
||||
;;
|
||||
*) break;;
|
||||
@ -46,20 +53,27 @@ done
|
||||
|
||||
export CONFFILES=/tmp/sysupgrade.conffiles
|
||||
export CONF_TAR=/tmp/sysupgrade.tgz
|
||||
export ETCBACKUP_DIR=/etc/backup
|
||||
export INSTALLED_PACKAGES=${ETCBACKUP_DIR}/installed_packages.txt
|
||||
|
||||
IMAGE="$1"
|
||||
|
||||
[ -z "$IMAGE" -a -z "$NEED_IMAGE" -o $HELP -gt 0 ] && {
|
||||
[ -z "$IMAGE" -a -z "$NEED_IMAGE" -a $CONF_BACKUP_LIST -eq 0 -o $HELP -gt 0 ] && {
|
||||
cat <<EOF
|
||||
Usage: $0 [<upgrade-option>...] <image file or URL>
|
||||
$0 [-q] [-i] <backup-command> <file>
|
||||
$0 [-q] [-i] [-c] [-u] [-o] [-k] <backup-command> <file>
|
||||
|
||||
upgrade-option:
|
||||
-f <config> restore configuration from .tar.gz (file or url)
|
||||
-i interactive mode
|
||||
-c attempt to preserve all changed files in /etc/
|
||||
-o attempt to preserve all changed files in /, except those
|
||||
from packages but including changed confs.
|
||||
-u skip from backup files that are equal to those in /rom
|
||||
-n do not save configuration over reflash
|
||||
-p do not attempt to restore the partition table after flash.
|
||||
-k include in backup a list of current installed packages at
|
||||
$INSTALLED_PACKAGES
|
||||
-T | --test
|
||||
Verify image and config .tar.gz but do not actually flash.
|
||||
-F | --force
|
||||
@ -115,47 +129,96 @@ list_changed_conffiles() {
|
||||
done
|
||||
}
|
||||
|
||||
add_uci_conffiles() {
|
||||
add_conffiles() {
|
||||
local file="$1"
|
||||
( find $(sed -ne '/^[[:space:]]*$/d; /^#/d; p' \
|
||||
/etc/sysupgrade.conf /lib/upgrade/keep.d/* 2>/dev/null) \
|
||||
-type f -o -type l 2>/dev/null;
|
||||
\( -type f -o -type l \) $find_filter 2>/dev/null;
|
||||
list_changed_conffiles ) | sort -u > "$file"
|
||||
return 0
|
||||
}
|
||||
|
||||
add_overlayfiles() {
|
||||
local file="$1"
|
||||
find /overlay/upper/etc/ -type f -o -type l | sed \
|
||||
-e 's,^/overlay\/upper/,/,' \
|
||||
-e '\,/META_[a-zA-Z0-9]*$,d' \
|
||||
-e '\,/functions.sh$,d' \
|
||||
|
||||
local packagesfiles=$1.packagesfiles
|
||||
touch "$packagesfiles"
|
||||
|
||||
if [ "$SAVE_OVERLAY_PATH" = / ]; then
|
||||
local conffiles=$1.conffiles
|
||||
local keepfiles=$1.keepfiles
|
||||
|
||||
list_conffiles | cut -f2 -d ' ' | sort -u > "$conffiles"
|
||||
|
||||
# backup files from /etc/sysupgrade.conf and /lib/upgrade/keep.d, but
|
||||
# ignore those aready controlled by opkg conffiles
|
||||
find $(sed -ne '/^[[:space:]]*$/d; /^#/d; p' \
|
||||
/etc/sysupgrade.conf /lib/upgrade/keep.d/* 2>/dev/null) \
|
||||
\( -type f -o -type l \) 2>/dev/null | sort -u |
|
||||
grep -h -v -x -F -f $conffiles > "$keepfiles"
|
||||
|
||||
# backup conffiles, but only those changed if '-u'
|
||||
[ $SKIP_UNCHANGED = 1 ] &&
|
||||
list_changed_conffiles | sort -u > "$conffiles"
|
||||
|
||||
# do not backup files from packages, except those listed
|
||||
# in conffiles and keep.d
|
||||
{
|
||||
find /usr/lib/opkg/info -type f -name "*.list" -exec cat {} \;
|
||||
find /usr/lib/opkg/info -type f -name "*.control" -exec sed \
|
||||
-ne '/^Alternatives/{s/^Alternatives: //;s/, /\n/g;p}' {} \; |
|
||||
cut -f2 -d:
|
||||
} | grep -v -x -F -f $conffiles |
|
||||
grep -v -x -F -f $keepfiles | sort -u > "$packagesfiles"
|
||||
rm -f "$keepfiles" "$conffiles"
|
||||
fi
|
||||
|
||||
# busybox grep bug when file is empty
|
||||
[ -s "$packagesfiles" ] || echo > $packagesfiles
|
||||
|
||||
( cd /overlay/upper/; find .$SAVE_OVERLAY_PATH \( -type f -o -type l \) $find_filter | sed \
|
||||
-e 's,^\.,,' \
|
||||
-e '\,^/etc/board.json$,d' \
|
||||
-e '\,/[^/]*-opkg$,d' \
|
||||
> "$file"
|
||||
-e '\,^/etc/urandom.seed$,d' \
|
||||
-e "\,^$INSTALLED_PACKAGES$,d" \
|
||||
-e '\,^/usr/lib/opkg/.*,d' \
|
||||
) | grep -v -x -F -f $packagesfiles > "$file"
|
||||
|
||||
rm -f "$packagesfiles"
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
# hooks
|
||||
sysupgrade_image_check="fwtool_check_image platform_check_image"
|
||||
sysupgrade_pre_upgrade=""
|
||||
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'"
|
||||
echo "Cannot find '/overlay/upper/etc', required for '-c'" >&2
|
||||
exit 1
|
||||
}
|
||||
sysupgrade_init_conffiles="add_overlayfiles"
|
||||
else
|
||||
sysupgrade_init_conffiles="add_uci_conffiles"
|
||||
sysupgrade_init_conffiles="add_conffiles"
|
||||
fi
|
||||
|
||||
find_filter=""
|
||||
if [ $SKIP_UNCHANGED = 1 ]; then
|
||||
[ ! -d /rom/ ] && {
|
||||
echo "'/rom/' is required by '-u'"
|
||||
exit 1
|
||||
}
|
||||
find_filter='( ( -exec test -e /rom/{} ; -exec cmp -s /{} /rom/{} ; ) -o -print )'
|
||||
fi
|
||||
|
||||
include /lib/upgrade
|
||||
|
||||
do_save_conffiles() {
|
||||
local conf_tar="${1:-$CONF_TAR}"
|
||||
local conf_tar="$1"
|
||||
|
||||
[ -z "$(rootfs_type)" ] && {
|
||||
echo "Cannot save config while running from ramdisk."
|
||||
echo "Cannot save config while running from ramdisk." >&2
|
||||
ask_bool 0 "Abort" && exit
|
||||
rm -f "$conf_tar"
|
||||
return 0
|
||||
@ -163,20 +226,46 @@ do_save_conffiles() {
|
||||
run_hooks "$CONFFILES" $sysupgrade_init_conffiles
|
||||
ask_bool 0 "Edit config file list" && vi "$CONFFILES"
|
||||
|
||||
if [ "$SAVE_INSTALLED_PKGS" -eq 1 ]; then
|
||||
echo "${INSTALLED_PACKAGES}" >> "$CONFFILES"
|
||||
mkdir -p "$ETCBACKUP_DIR"
|
||||
# Avoid touching filesystem on each backup
|
||||
RAMFS="$(mktemp -d -t sysupgrade.XXXXXX)"
|
||||
mkdir -p "$RAMFS/upper" "$RAMFS/work"
|
||||
mount -t overlay overlay -o lowerdir=$ETCBACKUP_DIR,upperdir=$RAMFS/upper,workdir=$RAMFS/work $ETCBACKUP_DIR &&
|
||||
UMOUNT_ETCBACKUP_DIR=1 || {
|
||||
echo "Cannot mount '$ETCBACKUP_DIR' as tmpfs to avoid touching disk while saving the list of installed packages." >&2
|
||||
ask_bool 0 "Abort" && exit
|
||||
}
|
||||
|
||||
# Format: pkg-name<TAB>{rom,overlay,unkown}
|
||||
# rom is used for pkgs in /rom, even if updated later
|
||||
find /usr/lib/opkg/info -name "*.control" \( \
|
||||
\( -exec test -f /rom/{} \; -exec echo {} rom \; \) -o \
|
||||
\( -exec test -f /overlay/upper/{} \; -exec echo {} overlay \; \) -o \
|
||||
\( -exec echo {} unknown \; \) \
|
||||
\) | sed -e 's,.*/,,;s/\.control /\t/' > ${INSTALLED_PACKAGES}
|
||||
fi
|
||||
|
||||
v "Saving config files..."
|
||||
[ "$VERBOSE" -gt 1 ] && TAR_V="v" || TAR_V=""
|
||||
tar c${TAR_V}zf "$conf_tar" -T "$CONFFILES" 2>/dev/null
|
||||
tar c${TAR_V}zpf "$conf_tar" -T "$CONFFILES" 2>/dev/null
|
||||
if [ "$?" -ne 0 ]; then
|
||||
echo "Failed to create the configuration backup."
|
||||
rm -f "$conf_tar"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
[ "$UMOUNT_ETCBACKUP_DIR" -eq 1 ] && {
|
||||
umount "$ETCBACKUP_DIR"
|
||||
rm -rf "$RAMFS"
|
||||
}
|
||||
rm -f "$CONFFILES"
|
||||
}
|
||||
|
||||
if [ $CONF_BACKUP_LIST -eq 1 ]; then
|
||||
run_hooks "$CONFFILES" $sysupgrade_init_conffiles
|
||||
[ "$SAVE_INSTALLED_PKGS" -eq 1 ] && echo ${INSTALLED_PACKAGES} >> "$CONFFILES"
|
||||
cat "$CONFFILES"
|
||||
rm -f "$CONFFILES"
|
||||
exit 0
|
||||
@ -189,7 +278,7 @@ fi
|
||||
|
||||
if [ -n "$CONF_RESTORE" ]; then
|
||||
if [ "$CONF_RESTORE" != "-" ] && [ ! -f "$CONF_RESTORE" ]; then
|
||||
echo "Backup archive '$CONF_RESTORE' not found."
|
||||
echo "Backup archive '$CONF_RESTORE' not found." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@ -199,7 +288,7 @@ if [ -n "$CONF_RESTORE" ]; then
|
||||
fi
|
||||
|
||||
type platform_check_image >/dev/null 2>/dev/null || {
|
||||
echo "Firmware upgrade is not implemented for this platform."
|
||||
echo "Firmware upgrade is not implemented for this platform." >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
@ -215,7 +304,7 @@ IMAGE="$(readlink -f "$IMAGE")"
|
||||
|
||||
case "$IMAGE" in
|
||||
'')
|
||||
echo "Image file not found."
|
||||
echo "Image file not found." >&2
|
||||
exit 1
|
||||
;;
|
||||
/tmp/*) ;;
|
||||
@ -232,10 +321,10 @@ 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!"
|
||||
echo "Image check '$check' failed but --force given - will update anyway!" >&2
|
||||
break
|
||||
else
|
||||
echo "Image check '$check' failed."
|
||||
echo "Image check '$check' failed." >&2
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
@ -246,14 +335,14 @@ if [ -n "$CONF_IMAGE" ]; then
|
||||
# .gz files
|
||||
1f8b) ;;
|
||||
*)
|
||||
echo "Invalid config file. Please use only .tar.gz files"
|
||||
echo "Invalid config file. Please use only .tar.gz files" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
get_image "$CONF_IMAGE" "cat" > "$CONF_TAR"
|
||||
export SAVE_CONFIG=1
|
||||
elif ask_bool $SAVE_CONFIG "Keep config files over reflash"; then
|
||||
[ $TEST -eq 1 ] || do_save_conffiles
|
||||
[ $TEST -eq 1 ] || do_save_conffiles "$CONF_TAR"
|
||||
export SAVE_CONFIG=1
|
||||
else
|
||||
[ $TEST -eq 1 ] || rm -f "$CONF_TAR"
|
||||
@ -270,8 +359,6 @@ else
|
||||
rm -f /tmp/sysupgrade.always.overwrite.bootdisk.partmap
|
||||
fi
|
||||
|
||||
run_hooks "" $sysupgrade_pre_upgrade
|
||||
|
||||
install_bin /sbin/upgraded
|
||||
v "Commencing upgrade. Closing all shell sessions."
|
||||
|
||||
|
@ -13,7 +13,7 @@ save() {
|
||||
}
|
||||
|
||||
SEED="$(uci -q get system.@system[0].urandom_seed || true)"
|
||||
[ "${SEED:0:1}" == "/" ] && save "$SEED"
|
||||
[ "${SEED:0:1}" = "/" ] && save "$SEED"
|
||||
|
||||
SEED=/etc/urandom.seed
|
||||
[ ! -f $SEED ] && save "$SEED"
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
[ "$(uci -q get system.@system[0].ttylogin)" == 1 ] || exec /bin/ash --login
|
||||
[ "$(uci -q get system.@system[0].ttylogin)" = 1 ] || exec /bin/ash --login
|
||||
|
||||
exec /bin/login
|
||||
|
@ -183,7 +183,7 @@ if VERSIONOPT
|
||||
config VERSION_REPO
|
||||
string
|
||||
prompt "Release repository"
|
||||
default "http://downloads.openwrt.org/releases/18.06-SNAPSHOT"
|
||||
default "http://downloads.lede-project.org/snapshots"
|
||||
help
|
||||
This is the repository address embedded in the image, it defaults
|
||||
to the trunk snapshot repo; the url may contain the following placeholders:
|
||||
|
@ -13,7 +13,7 @@ PKG_VERSION:=1.6.9
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=http://downloads.openwrt.org/sources/
|
||||
PKG_SOURCE_URL:=https://downloads.openwrt.org/sources/
|
||||
PKG_HASH:=1d2bc04c2c6bb3d2d6c1916b6dc559cda2b1ecb045d7801fd49af6af4234abeb
|
||||
PKG_TARGETS:=bin
|
||||
|
||||
@ -27,7 +27,6 @@ define Package/apex
|
||||
DEPENDS:=@TARGET_ixp4xx
|
||||
DEFAULT:=y
|
||||
TITLE:=Boot loader for NSLU2, FSG3, NAS100D and others
|
||||
URL:=http://wiki.buici.com/wiki/Apex_Bootloader
|
||||
endef
|
||||
|
||||
define build_apex
|
||||
|
@ -12,9 +12,9 @@ PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL=https://github.com/apritzel/arm-trusted-firmware
|
||||
PKG_SOURCE_DATE:=2018-02-04
|
||||
PKG_SOURCE_VERSION:=ae78724247a01560164d607ed66db111c74d8df0
|
||||
PKG_MIRROR_HASH:=e4ddc3294f86c1e163d683a2322427bbdd5b63762ead4b1792b34df75d7bda28
|
||||
PKG_SOURCE_DATE:=2018-02-10
|
||||
PKG_SOURCE_VERSION:=c9f55c023164a6c8c49f70f7ac6c68c626839d6f
|
||||
PKG_MIRROR_HASH:=94b5338592cf0bcc353b55da5fdd62c91ae8e6263822f73724cb72ecde3dbbf9
|
||||
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
PKG_LICENSE_FILES:=license.md
|
||||
|
@ -12,7 +12,7 @@ PKG_VERSION:=20080329
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=http://andrzejekiert.ovh.org/software/fconfig/
|
||||
PKG_SOURCE_URL:=https://downloads.openwrt.org/sources
|
||||
PKG_HASH:=4ff0e8f07e35e46b705c0dbe9d9544ede01ea092a69e3f7db03e55a3f2bb8eb7
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
|
||||
@ -24,7 +24,6 @@ define Package/fconfig
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=Boot Loaders
|
||||
TITLE:=RedBoot configuration editor
|
||||
URL:=http://andrzejekiert.ovh.org/software.html.en
|
||||
endef
|
||||
|
||||
define Package/fconfig/description
|
||||
|
@ -1,93 +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_NAME:=grub
|
||||
PKG_CPE_ID:=cpe:/a:gnu:grub2
|
||||
PKG_VERSION:=2.02
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:=@GNU/grub
|
||||
PKG_HASH:=810b3798d316394f94096ec2797909dbf23c858e48f7b3830826b8daa06b7b0f
|
||||
|
||||
PKG_FIXUP:=autoreconf
|
||||
HOST_BUILD_PARALLEL:=1
|
||||
PKG_BUILD_DEPENDS:=grub2/host
|
||||
|
||||
PKG_SSP:=0
|
||||
|
||||
PKG_FLAGS:=nonshared
|
||||
|
||||
include $(INCLUDE_DIR)/host-build.mk
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/grub2
|
||||
CATEGORY:=Boot Loaders
|
||||
SECTION:=boot
|
||||
TITLE:=GRand Unified Bootloader
|
||||
URL:=http://www.gnu.org/software/grub/
|
||||
DEPENDS:=@TARGET_x86||TARGET_x86_64
|
||||
endef
|
||||
|
||||
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||TARGET_x86_64
|
||||
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=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
|
||||
|
||||
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))
|
74
package/boot/grub2/common.mk
Normal file
74
package/boot/grub2/common.mk
Normal file
@ -0,0 +1,74 @@
|
||||
#
|
||||
# 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.02
|
||||
PKG_RELEASE:=3
|
||||
|
||||
PKG_SOURCE:=grub-$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:=@GNU/grub
|
||||
PKG_HASH:=810b3798d316394f94096ec2797909dbf23c858e48f7b3830826b8daa06b7b0f
|
||||
|
||||
PKG_FIXUP:=autoreconf
|
||||
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
|
||||
|
23
package/boot/grub2/grub2-efi/Makefile
Normal file
23
package/boot/grub2/grub2-efi/Makefile
Normal file
@ -0,0 +1,23 @@
|
||||
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))
|
33
package/boot/grub2/grub2/Makefile
Normal file
33
package/boot/grub2/grub2/Makefile
Normal file
@ -0,0 +1,33 @@
|
||||
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,71 @@
|
||||
From 563b1da6e6ae7af46cc8354cadb5dab416989f0a Mon Sep 17 00:00:00 2001
|
||||
From: Michael Chang <mchang@suse.com>
|
||||
Date: Mon, 26 Mar 2018 16:52:34 +0800
|
||||
Subject: Fix packed-not-aligned error on GCC 8
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
When building with GCC 8, there are several errors regarding packed-not-aligned.
|
||||
|
||||
./include/grub/gpt_partition.h:79:1: error: alignment 1 of ‘struct grub_gpt_partentry’ is less than 8 [-Werror=packed-not-aligned]
|
||||
|
||||
This patch fixes the build error by cleaning up the ambiguity of placing
|
||||
aligned structure in a packed one. In "struct grub_btrfs_time" and "struct
|
||||
grub_gpt_part_type", the aligned attribute seems to be superfluous, and also
|
||||
has to be packed, to ensure the structure is bit-to-bit mapped to the format
|
||||
laid on disk. I think we could blame to copy and paste error here for the
|
||||
mistake. In "struct efi_variable", we have to use grub_efi_packed_guid_t, as
|
||||
the name suggests. :)
|
||||
|
||||
Signed-off-by: Michael Chang <mchang@suse.com>
|
||||
Tested-by: Michael Chang <mchang@suse.com>
|
||||
Tested-by: Paul Menzel <paulepanter@users.sourceforge.net>
|
||||
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
|
||||
---
|
||||
grub-core/fs/btrfs.c | 2 +-
|
||||
include/grub/efiemu/runtime.h | 2 +-
|
||||
include/grub/gpt_partition.h | 2 +-
|
||||
3 files changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c
|
||||
index 4849c1ceb..be195448d 100644
|
||||
--- a/grub-core/fs/btrfs.c
|
||||
+++ b/grub-core/fs/btrfs.c
|
||||
@@ -175,7 +175,7 @@ struct grub_btrfs_time
|
||||
{
|
||||
grub_int64_t sec;
|
||||
grub_uint32_t nanosec;
|
||||
-} __attribute__ ((aligned (4)));
|
||||
+} GRUB_PACKED;
|
||||
|
||||
struct grub_btrfs_inode
|
||||
{
|
||||
diff --git a/include/grub/efiemu/runtime.h b/include/grub/efiemu/runtime.h
|
||||
index 9b6b729f4..36d2dedf4 100644
|
||||
--- a/include/grub/efiemu/runtime.h
|
||||
+++ b/include/grub/efiemu/runtime.h
|
||||
@@ -29,7 +29,7 @@ struct grub_efiemu_ptv_rel
|
||||
|
||||
struct efi_variable
|
||||
{
|
||||
- grub_efi_guid_t guid;
|
||||
+ grub_efi_packed_guid_t guid;
|
||||
grub_uint32_t namelen;
|
||||
grub_uint32_t size;
|
||||
grub_efi_uint32_t attributes;
|
||||
diff --git a/include/grub/gpt_partition.h b/include/grub/gpt_partition.h
|
||||
index 1b32f6725..9668a68c3 100644
|
||||
--- a/include/grub/gpt_partition.h
|
||||
+++ b/include/grub/gpt_partition.h
|
||||
@@ -28,7 +28,7 @@ struct grub_gpt_part_type
|
||||
grub_uint16_t data2;
|
||||
grub_uint16_t data3;
|
||||
grub_uint8_t data4[8];
|
||||
-} __attribute__ ((aligned(8)));
|
||||
+} GRUB_PACKED;
|
||||
typedef struct grub_gpt_part_type grub_gpt_part_type_t;
|
||||
|
||||
#define GRUB_GPT_PARTITION_TYPE_EMPTY \
|
||||
--
|
||||
cgit v1.1-33-g03f6
|
75
package/boot/grub2/patches/400-R_X86_64_PLT32.patch
Normal file
75
package/boot/grub2/patches/400-R_X86_64_PLT32.patch
Normal file
@ -0,0 +1,75 @@
|
||||
From 02702bdfe14d8a04643a45b03715f734ae34dbac Mon Sep 17 00:00:00 2001
|
||||
From: "H.J. Lu" <hjl.tools@gmail.com>
|
||||
Date: Sat, 17 Feb 2018 06:47:28 -0800
|
||||
Subject: x86-64: Treat R_X86_64_PLT32 as R_X86_64_PC32
|
||||
|
||||
Starting from binutils commit bd7ab16b4537788ad53521c45469a1bdae84ad4a:
|
||||
|
||||
https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=bd7ab16b4537788ad53521c45469a1bdae84ad4a
|
||||
|
||||
x86-64 assembler generates R_X86_64_PLT32, instead of R_X86_64_PC32, for
|
||||
32-bit PC-relative branches. Grub2 should treat R_X86_64_PLT32 as
|
||||
R_X86_64_PC32.
|
||||
|
||||
Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
|
||||
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
|
||||
|
||||
Origin: upstream, https://git.savannah.gnu.org/cgit/grub.git/commit/?id=842c390469e2c2e10b5aa36700324cd3bde25875
|
||||
Last-Update: 2018-07-30
|
||||
|
||||
Patch-Name: R_X86_64_PLT32.patch
|
||||
---
|
||||
grub-core/efiemu/i386/loadcore64.c | 1 +
|
||||
grub-core/kern/x86_64/dl.c | 1 +
|
||||
util/grub-mkimagexx.c | 1 +
|
||||
util/grub-module-verifier.c | 1 +
|
||||
4 files changed, 4 insertions(+)
|
||||
|
||||
diff --git a/grub-core/efiemu/i386/loadcore64.c b/grub-core/efiemu/i386/loadcore64.c
|
||||
index e49d0b6ff..18facf47f 100644
|
||||
--- a/grub-core/efiemu/i386/loadcore64.c
|
||||
+++ b/grub-core/efiemu/i386/loadcore64.c
|
||||
@@ -98,6 +98,7 @@ grub_arch_efiemu_relocate_symbols64 (grub_efiemu_segment_t segs,
|
||||
break;
|
||||
|
||||
case R_X86_64_PC32:
|
||||
+ case R_X86_64_PLT32:
|
||||
err = grub_efiemu_write_value (addr,
|
||||
*addr32 + rel->r_addend
|
||||
+ sym.off
|
||||
diff --git a/grub-core/kern/x86_64/dl.c b/grub-core/kern/x86_64/dl.c
|
||||
index 440690673..3a73e6e6c 100644
|
||||
--- a/grub-core/kern/x86_64/dl.c
|
||||
+++ b/grub-core/kern/x86_64/dl.c
|
||||
@@ -70,6 +70,7 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr,
|
||||
break;
|
||||
|
||||
case R_X86_64_PC32:
|
||||
+ case R_X86_64_PLT32:
|
||||
{
|
||||
grub_int64_t value;
|
||||
value = ((grub_int32_t) *addr32) + rel->r_addend + sym->st_value -
|
||||
diff --git a/util/grub-mkimagexx.c b/util/grub-mkimagexx.c
|
||||
index e63f148e4..f20255a28 100644
|
||||
--- a/util/grub-mkimagexx.c
|
||||
+++ b/util/grub-mkimagexx.c
|
||||
@@ -832,6 +832,7 @@ SUFFIX (relocate_addresses) (Elf_Ehdr *e, Elf_Shdr *sections,
|
||||
break;
|
||||
|
||||
case R_X86_64_PC32:
|
||||
+ case R_X86_64_PLT32:
|
||||
{
|
||||
grub_uint32_t *t32 = (grub_uint32_t *) target;
|
||||
*t32 = grub_host_to_target64 (grub_target_to_host32 (*t32)
|
||||
diff --git a/util/grub-module-verifier.c b/util/grub-module-verifier.c
|
||||
index 9179285a5..a79271f66 100644
|
||||
--- a/util/grub-module-verifier.c
|
||||
+++ b/util/grub-module-verifier.c
|
||||
@@ -19,6 +19,7 @@ struct grub_module_verifier_arch archs[] = {
|
||||
-1
|
||||
}, (int[]){
|
||||
R_X86_64_PC32,
|
||||
+ R_X86_64_PLT32,
|
||||
-1
|
||||
}
|
||||
},
|
@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
|
||||
PKG_NAME:=uboot-envtools
|
||||
PKG_DISTNAME:=u-boot
|
||||
PKG_VERSION:=2018.03
|
||||
PKG_RELEASE:=1
|
||||
PKG_RELEASE:=3
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE:=$(PKG_DISTNAME)-$(PKG_VERSION).tar.xz
|
||||
|
29
package/boot/uboot-envtools/files/apm821xx
Normal file
29
package/boot/uboot-envtools/files/apm821xx
Normal file
@ -0,0 +1,29 @@
|
||||
#!/bin/sh
|
||||
|
||||
[ -e /etc/config/ubootenv ] && exit 0
|
||||
|
||||
touch /etc/config/ubootenv
|
||||
|
||||
. /lib/uboot-envtools.sh
|
||||
. /lib/functions.sh
|
||||
|
||||
board=$(board_name)
|
||||
|
||||
case "$board" in
|
||||
meraki,mr24)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x4000" "0x4000" "4"
|
||||
ubootenv_add_uci_config "/dev/mtd2" "0x0" "0x4000" "0x4000" "4"
|
||||
;;
|
||||
meraki,mx60)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000" "4"
|
||||
;;
|
||||
netgear,wndap620|\
|
||||
netgear,wndap660)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x4000" "0x4000" "4"
|
||||
;;
|
||||
esac
|
||||
|
||||
config_load ubootenv
|
||||
config_foreach ubootenv_add_app_config ubootenv
|
||||
|
||||
exit 0
|
@ -28,6 +28,7 @@ cpe830|\
|
||||
cpe870|\
|
||||
cr3000|\
|
||||
cr5000|\
|
||||
dw33d|\
|
||||
e1700ac-v2|\
|
||||
e600g-v2|\
|
||||
e600gac-v2|\
|
||||
|
34
package/boot/uboot-envtools/files/ath79
Normal file
34
package/boot/uboot-envtools/files/ath79
Normal file
@ -0,0 +1,34 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (C) 2011-2014 OpenWrt.org
|
||||
#
|
||||
|
||||
[ -e /etc/config/ubootenv ] && exit 0
|
||||
|
||||
touch /etc/config/ubootenv
|
||||
|
||||
. /lib/uboot-envtools.sh
|
||||
. /lib/functions.sh
|
||||
|
||||
board=$(board_name)
|
||||
|
||||
case "$board" in
|
||||
buffalo,wzr-hp-ag300h)
|
||||
ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x10000" "0x10000"
|
||||
;;
|
||||
buffalo,bhr-4grv2|\
|
||||
glinet,gl-ar300m-nand|\
|
||||
glinet,gl-ar300m-nor|\
|
||||
librerouter,librerouter-v1|\
|
||||
ocedo,koala|\
|
||||
ocedo,raccoon|\
|
||||
openmesh,om5p-ac-v2|\
|
||||
yuncore,a770)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000"
|
||||
;;
|
||||
esac
|
||||
|
||||
config_load ubootenv
|
||||
config_foreach ubootenv_add_app_config ubootenv
|
||||
|
||||
exit 0
|
@ -31,10 +31,18 @@ ubootenv_mtdinfo () {
|
||||
}
|
||||
|
||||
case "$board" in
|
||||
alfa-network,ap120c-ac |\
|
||||
glinet,gl-b1300 |\
|
||||
openmesh,a42 |\
|
||||
openmesh,a62)
|
||||
ubootenv_add_uci_config "/dev/mtd5" "0x0" "0x10000" "0x10000"
|
||||
;;
|
||||
linksys,ea6350v3)
|
||||
ubootenv_add_uci_config "/dev/mtd7" "0x0" "0x20000" "0x20000"
|
||||
;;
|
||||
zyxel,nbg6617)
|
||||
ubootenv_add_uci_config "/dev/mtd6" "0x0" "0x10000" "0x10000"
|
||||
;;
|
||||
esac
|
||||
|
||||
config_load ubootenv
|
||||
|
@ -34,6 +34,9 @@ case "$board" in
|
||||
linksys,ea8500)
|
||||
ubootenv_add_uci_config "/dev/mtd10" "0x0" "0x20000" "0x20000"
|
||||
;;
|
||||
netgear,r7800)
|
||||
ubootenv_add_uci_config "/dev/mtd2" "0x0" "0x040000" "0x20000"
|
||||
;;
|
||||
qcom,ipq8064-ap148 |\
|
||||
qcom,ipq8064-db149)
|
||||
ubootenv_add_uci_config $(ubootenv_mtdinfo)
|
||||
|
@ -15,6 +15,7 @@ board=$(board_name)
|
||||
case "$board" in
|
||||
cloudengines,pogoe02|\
|
||||
cloudengines,pogoplugv4|\
|
||||
iom,ix2-200|\
|
||||
linksys,viper|\
|
||||
raidsonic,ib-nas62x0|\
|
||||
seagate,dockstar|\
|
||||
|
25
package/boot/uboot-envtools/files/layerscape
Normal file
25
package/boot/uboot-envtools/files/layerscape
Normal file
@ -0,0 +1,25 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (C) 2016 LEDE
|
||||
#
|
||||
|
||||
[ -f /etc/config/ubootenv ] && exit 0
|
||||
|
||||
touch /etc/config/ubootenv
|
||||
|
||||
. /lib/uboot-envtools.sh
|
||||
. /lib/functions.sh
|
||||
|
||||
board=$(board_name)
|
||||
|
||||
case "$board" in
|
||||
traverse,ls1043v | \
|
||||
traverse,ls1043s)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x40000" "0x2000" "0x20000"
|
||||
;;
|
||||
esac
|
||||
|
||||
config_load ubootenv
|
||||
config_foreach ubootenv_add_app_config ubootenv
|
||||
|
||||
exit 0
|
22
package/boot/uboot-envtools/files/mpc85xx
Normal file
22
package/boot/uboot-envtools/files/mpc85xx
Normal file
@ -0,0 +1,22 @@
|
||||
#!/bin/sh
|
||||
|
||||
[ -e /etc/config/ubootenv ] && exit 0
|
||||
|
||||
touch /etc/config/ubootenv
|
||||
|
||||
. /lib/uboot-envtools.sh
|
||||
. /lib/functions.sh
|
||||
|
||||
board=$(board_name)
|
||||
|
||||
case "$board" in
|
||||
ocedo,panda)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
|
||||
ubootenv_add_uci_config "/dev/mtd2" "0x0" "0x20000" "0x20000"
|
||||
;;
|
||||
esac
|
||||
|
||||
config_load ubootenv
|
||||
config_foreach ubootenv_add_app_config ubootenv
|
||||
|
||||
exit 0
|
@ -14,25 +14,31 @@ touch /etc/config/ubootenv
|
||||
board=$(board_name)
|
||||
|
||||
case "$board" in
|
||||
armada-385-linksys-caiman|\
|
||||
armada-385-linksys-cobra|\
|
||||
armada-385-linksys-shelby)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x40000"
|
||||
;;
|
||||
armada-385-linksys-rango|\
|
||||
armada-385-linksys-venom)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
|
||||
;;
|
||||
armada-385-turris-omnia)
|
||||
cznic,turris-omnia)
|
||||
ubootenv_add_uci_config "/dev/mtd0" "0xC0000" "0x10000" "0x40000"
|
||||
;;
|
||||
armada-xp-linksys-mamba)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x40000" "0x20000"
|
||||
;;
|
||||
globalscale,espressobin|\
|
||||
globalscale,espressobin-emmc|\
|
||||
globalscale,espressobin-v7|\
|
||||
globalscale,espressobin-v7-emmc|\
|
||||
marvell,armada8040-mcbin)
|
||||
ubootenv_add_uci_config "/dev/mtd0" "0x3f0000" "0x10000" "0x10000" "1"
|
||||
;;
|
||||
linksys,caiman|\
|
||||
linksys,cobra|\
|
||||
linksys,shelby)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x40000"
|
||||
;;
|
||||
linksys,mamba)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x40000" "0x20000"
|
||||
;;
|
||||
linksys,rango|\
|
||||
linksys,venom)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
|
||||
;;
|
||||
methode,udpu)
|
||||
ubootenv_add_uci_config "/dev/mtd0" "0x180000" "0x10000" "0x10000"
|
||||
;;
|
||||
esac
|
||||
|
||||
config_load ubootenv
|
||||
|
@ -13,7 +13,7 @@ touch /etc/config/ubootenv
|
||||
board=$(board_name)
|
||||
|
||||
case "$board" in
|
||||
duckbill)
|
||||
i2se,duckbill)
|
||||
ubootenv_add_uci_config "/dev/mmcblk0" "0x20000" "0x20000"
|
||||
ubootenv_add_uci_config "/dev/mmcblk0" "0x40000" "0x20000"
|
||||
;;
|
||||
|
@ -13,11 +13,10 @@ touch /etc/config/ubootenv
|
||||
board=$(board_name)
|
||||
|
||||
case "$board" in
|
||||
akitio|\
|
||||
kd20|\
|
||||
stg212)
|
||||
ubootenv_add_uci_config "/dev/ubi0_0" "0x0" "0x4000" "0x1F000" "1"
|
||||
ubootenv_add_uci_config "/dev/ubi0_1" "0x0" "0x4000" "0x1F000" "1"
|
||||
"cloudengines,pogoplug"* | \
|
||||
"mitrastar,stg-212" | \
|
||||
"shuttle,kd20")
|
||||
ubootenv_add_uci_config "/dev/mtd2" "0x0" "0x2000" "0x2000" "1"
|
||||
;;
|
||||
esac
|
||||
|
||||
|
@ -14,10 +14,10 @@ board=$(board_name)
|
||||
|
||||
case "$board" in
|
||||
alfa-network,ac1200rm|\
|
||||
alfa-network,awusfree1)
|
||||
alfa-network,awusfree1|\
|
||||
alfa-network,tube-e4g)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x1000"
|
||||
;;
|
||||
all0239-3g|\
|
||||
all0256n-4M|\
|
||||
all0256n-8M|\
|
||||
all5002)
|
||||
@ -31,6 +31,8 @@ wsr-600|\
|
||||
zbt-wg2626)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x10000"
|
||||
;;
|
||||
xiaomi,mir3p|\
|
||||
xiaomi,miwifi-r3|\
|
||||
mir3g)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000"
|
||||
;;
|
||||
|
@ -10,9 +10,9 @@ include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_SOURCE_URL:=https://github.com/chunkeey/FritzBox-4040-UBOOT
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=6946ebbaf7b12a4a092d763c8f0c87a25984f103
|
||||
PKG_SOURCE_DATE:=2017-01-29
|
||||
PKG_MIRROR_HASH:=5c2394f51a083dca2a2bf9cb36fa717f252112fc792c9eeae64f6383ad08987b
|
||||
PKG_SOURCE_VERSION:=5da78cca60814ea31065a50376d9c905425b03a1
|
||||
PKG_SOURCE_DATE:=2018-12-09
|
||||
PKG_MIRROR_HASH:=ff7bc2498de1066dde24d7ef68e440c3847244a5b8bb35ce4275e3918f230aa3
|
||||
|
||||
PKG_RELEASE:=1
|
||||
|
||||
@ -34,10 +34,9 @@ export DTC
|
||||
|
||||
define Build/Configure
|
||||
$(Build/Configure/U-Boot)
|
||||
$(HOSTCC) -o $(PKG_BUILD_DIR)/fritz/lzma2eva $(PKG_BUILD_DIR)/fritz/src/lzma2eva.c -lz
|
||||
$(HOSTCC) -o $(PKG_BUILD_DIR)/fritz/lzma2eva $(PKG_BUILD_DIR)/fritz/src/lzma2eva.c
|
||||
$(HOSTCC) -o $(PKG_BUILD_DIR)/fritz/tichksum $(PKG_BUILD_DIR)/fritz/src/tichksum.c
|
||||
ln -sf $(STAGING_DIR_HOST)/bin/lzma $(PKG_BUILD_DIR)/fritz
|
||||
ln -sf compiler-gcc5.h $(PKG_BUILD_DIR)/include/linux/compiler-gcc7.h
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
@ -47,7 +46,7 @@ endef
|
||||
|
||||
define Package/u-boot/install
|
||||
$(Package/u-boot/install/default)
|
||||
$(INSTALL_BIN) ./files/upload-to-f4040.sh $(1)/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/upload-to-f4040.sh $(1)/
|
||||
endef
|
||||
|
||||
UBOOT_TARGETS := fritz4040
|
||||
|
@ -1,41 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
die() {
|
||||
echo $1
|
||||
exit 1
|
||||
}
|
||||
|
||||
FRITZBOX='192.168.178.1'
|
||||
USER='adam2'
|
||||
PASSWD='adam2'
|
||||
FILE='uboot-fritz4040.bin'
|
||||
|
||||
ping -q -4 -w 1 -c 1 "$FRITZBOX" &> /dev/null || die "Fritzbox at $FRITZBOX is not reachable. aborting"
|
||||
|
||||
cat << EOS
|
||||
|
||||
This will take ages (2 minutes)! If you want a
|
||||
status bar: Attach a serial to the device and look there.
|
||||
|
||||
Note: If this fails, you need to use AVM\' recover
|
||||
utility to get your box back. However this step
|
||||
should not damage your box....
|
||||
|
||||
Also it doesn't terminate.. :/
|
||||
|
||||
(Note: Make sure that you connected the router on
|
||||
the yellow LAN ports and not the blue WAN).
|
||||
|
||||
EOS
|
||||
|
||||
ftp -n -4 "$FRITZBOX" << END_SCRIPT
|
||||
quote USER $USER
|
||||
quote PASS $PASSWD
|
||||
quote MEDIA FLSH
|
||||
binary
|
||||
passive
|
||||
put $FILE mtd1
|
||||
quote check mtd1
|
||||
bye
|
||||
END_SCRIPT
|
||||
exit 0
|
@ -1,274 +0,0 @@
|
||||
--- a/arch/arm/lib/Makefile
|
||||
+++ b/arch/arm/lib/Makefile
|
||||
@@ -26,7 +26,6 @@ include $(TOPDIR)/config.mk
|
||||
LIB = $(obj)lib$(ARCH).o
|
||||
LIBGCC = $(obj)libgcc.o
|
||||
|
||||
-ifndef CONFIG_SPL_BUILD
|
||||
GLSOBJS += _ashldi3.o
|
||||
GLSOBJS += _ashrdi3.o
|
||||
GLSOBJS += _divsi3.o
|
||||
@@ -34,9 +33,11 @@ GLSOBJS += _lshrdi3.o
|
||||
GLSOBJS += _modsi3.o
|
||||
GLSOBJS += _udivsi3.o
|
||||
GLSOBJS += _umodsi3.o
|
||||
+GLSOBJS += uldivmod.o
|
||||
|
||||
GLCOBJS += div0.o
|
||||
|
||||
+ifndef CONFIG_SPL_BUILD
|
||||
COBJS-y += board.o
|
||||
COBJS-y += bootm.o
|
||||
COBJS-$(CONFIG_SYS_L2_PL310) += cache-pl310.o
|
||||
--- /dev/null
|
||||
+++ b/arch/arm/lib/uldivmod.S
|
||||
@@ -0,0 +1,249 @@
|
||||
+/*
|
||||
+ * Copyright 2010, Google Inc.
|
||||
+ *
|
||||
+ * Brought in from coreboot uldivmod.S
|
||||
+ *
|
||||
+ * SPDX-License-Identifier: GPL-2.0
|
||||
+ */
|
||||
+
|
||||
+#include <linux/linkage.h>
|
||||
+#include <asm/assembler.h>
|
||||
+
|
||||
+/*
|
||||
+ * A, Q = r0 + (r1 << 32)
|
||||
+ * B, R = r2 + (r3 << 32)
|
||||
+ * A / B = Q ... R
|
||||
+ */
|
||||
+
|
||||
+#define ARM(x...) x
|
||||
+#define THUMB(x...)
|
||||
+
|
||||
+A_0 .req r0
|
||||
+A_1 .req r1
|
||||
+B_0 .req r2
|
||||
+B_1 .req r3
|
||||
+C_0 .req r4
|
||||
+C_1 .req r5
|
||||
+D_0 .req r6
|
||||
+D_1 .req r7
|
||||
+
|
||||
+Q_0 .req r0
|
||||
+Q_1 .req r1
|
||||
+R_0 .req r2
|
||||
+R_1 .req r3
|
||||
+
|
||||
+THUMB(
|
||||
+TMP .req r8
|
||||
+)
|
||||
+
|
||||
+.pushsection .text.__aeabi_uldivmod, "ax"
|
||||
+ENTRY(__aeabi_uldivmod)
|
||||
+
|
||||
+ stmfd sp!, {r4, r5, r6, r7, THUMB(TMP,) lr}
|
||||
+ @ Test if B == 0
|
||||
+ orrs ip, B_0, B_1 @ Z set -> B == 0
|
||||
+ beq L_div_by_0
|
||||
+ @ Test if B is power of 2: (B & (B - 1)) == 0
|
||||
+ subs C_0, B_0, #1
|
||||
+ sbc C_1, B_1, #0
|
||||
+ tst C_0, B_0
|
||||
+ tsteq B_1, C_1
|
||||
+ beq L_pow2
|
||||
+ @ Test if A_1 == B_1 == 0
|
||||
+ orrs ip, A_1, B_1
|
||||
+ beq L_div_32_32
|
||||
+
|
||||
+L_div_64_64:
|
||||
+/* CLZ only exists in ARM architecture version 5 and above. */
|
||||
+#ifdef HAVE_CLZ
|
||||
+ mov C_0, #1
|
||||
+ mov C_1, #0
|
||||
+ @ D_0 = clz A
|
||||
+ teq A_1, #0
|
||||
+ clz D_0, A_1
|
||||
+ clzeq ip, A_0
|
||||
+ addeq D_0, D_0, ip
|
||||
+ @ D_1 = clz B
|
||||
+ teq B_1, #0
|
||||
+ clz D_1, B_1
|
||||
+ clzeq ip, B_0
|
||||
+ addeq D_1, D_1, ip
|
||||
+ @ if clz B - clz A > 0
|
||||
+ subs D_0, D_1, D_0
|
||||
+ bls L_done_shift
|
||||
+ @ B <<= (clz B - clz A)
|
||||
+ subs D_1, D_0, #32
|
||||
+ rsb ip, D_0, #32
|
||||
+ movmi B_1, B_1, lsl D_0
|
||||
+ARM( orrmi B_1, B_1, B_0, lsr ip )
|
||||
+THUMB( lsrmi TMP, B_0, ip )
|
||||
+THUMB( orrmi B_1, B_1, TMP )
|
||||
+ movpl B_1, B_0, lsl D_1
|
||||
+ mov B_0, B_0, lsl D_0
|
||||
+ @ C = 1 << (clz B - clz A)
|
||||
+ movmi C_1, C_1, lsl D_0
|
||||
+ARM( orrmi C_1, C_1, C_0, lsr ip )
|
||||
+THUMB( lsrmi TMP, C_0, ip )
|
||||
+THUMB( orrmi C_1, C_1, TMP )
|
||||
+ movpl C_1, C_0, lsl D_1
|
||||
+ mov C_0, C_0, lsl D_0
|
||||
+L_done_shift:
|
||||
+ mov D_0, #0
|
||||
+ mov D_1, #0
|
||||
+ @ C: current bit; D: result
|
||||
+#else
|
||||
+ @ C: current bit; D: result
|
||||
+ mov C_0, #1
|
||||
+ mov C_1, #0
|
||||
+ mov D_0, #0
|
||||
+ mov D_1, #0
|
||||
+L_lsl_4:
|
||||
+ cmp B_1, #0x10000000
|
||||
+ cmpcc B_1, A_1
|
||||
+ cmpeq B_0, A_0
|
||||
+ bcs L_lsl_1
|
||||
+ @ B <<= 4
|
||||
+ mov B_1, B_1, lsl #4
|
||||
+ orr B_1, B_1, B_0, lsr #28
|
||||
+ mov B_0, B_0, lsl #4
|
||||
+ @ C <<= 4
|
||||
+ mov C_1, C_1, lsl #4
|
||||
+ orr C_1, C_1, C_0, lsr #28
|
||||
+ mov C_0, C_0, lsl #4
|
||||
+ b L_lsl_4
|
||||
+L_lsl_1:
|
||||
+ cmp B_1, #0x80000000
|
||||
+ cmpcc B_1, A_1
|
||||
+ cmpeq B_0, A_0
|
||||
+ bcs L_subtract
|
||||
+ @ B <<= 1
|
||||
+ mov B_1, B_1, lsl #1
|
||||
+ orr B_1, B_1, B_0, lsr #31
|
||||
+ mov B_0, B_0, lsl #1
|
||||
+ @ C <<= 1
|
||||
+ mov C_1, C_1, lsl #1
|
||||
+ orr C_1, C_1, C_0, lsr #31
|
||||
+ mov C_0, C_0, lsl #1
|
||||
+ b L_lsl_1
|
||||
+#endif
|
||||
+L_subtract:
|
||||
+ @ if A >= B
|
||||
+ cmp A_1, B_1
|
||||
+ cmpeq A_0, B_0
|
||||
+ bcc L_update
|
||||
+ @ A -= B
|
||||
+ subs A_0, A_0, B_0
|
||||
+ sbc A_1, A_1, B_1
|
||||
+ @ D |= C
|
||||
+ orr D_0, D_0, C_0
|
||||
+ orr D_1, D_1, C_1
|
||||
+L_update:
|
||||
+ @ if A == 0: break
|
||||
+ orrs ip, A_1, A_0
|
||||
+ beq L_exit
|
||||
+ @ C >>= 1
|
||||
+ movs C_1, C_1, lsr #1
|
||||
+ movs C_0, C_0, rrx
|
||||
+ @ if C == 0: break
|
||||
+ orrs ip, C_1, C_0
|
||||
+ beq L_exit
|
||||
+ @ B >>= 1
|
||||
+ movs B_1, B_1, lsr #1
|
||||
+ mov B_0, B_0, rrx
|
||||
+ b L_subtract
|
||||
+L_exit:
|
||||
+ @ Note: A, B & Q, R are aliases
|
||||
+ mov R_0, A_0
|
||||
+ mov R_1, A_1
|
||||
+ mov Q_0, D_0
|
||||
+ mov Q_1, D_1
|
||||
+ ldmfd sp!, {r4, r5, r6, r7, THUMB(TMP,) pc}
|
||||
+
|
||||
+L_div_32_32:
|
||||
+ @ Note: A_0 & r0 are aliases
|
||||
+ @ Q_1 r1
|
||||
+ mov r1, B_0
|
||||
+ bl __aeabi_uidivmod
|
||||
+ mov R_0, r1
|
||||
+ mov R_1, #0
|
||||
+ mov Q_1, #0
|
||||
+ ldmfd sp!, {r4, r5, r6, r7, THUMB(TMP,) pc}
|
||||
+
|
||||
+L_pow2:
|
||||
+#ifdef HAVE_CLZ
|
||||
+ @ Note: A, B and Q, R are aliases
|
||||
+ @ R = A & (B - 1)
|
||||
+ and C_0, A_0, C_0
|
||||
+ and C_1, A_1, C_1
|
||||
+ @ Q = A >> log2(B)
|
||||
+ @ Note: B must not be 0 here!
|
||||
+ clz D_0, B_0
|
||||
+ add D_1, D_0, #1
|
||||
+ rsbs D_0, D_0, #31
|
||||
+ bpl L_1
|
||||
+ clz D_0, B_1
|
||||
+ rsb D_0, D_0, #31
|
||||
+ mov A_0, A_1, lsr D_0
|
||||
+ add D_0, D_0, #32
|
||||
+L_1:
|
||||
+ movpl A_0, A_0, lsr D_0
|
||||
+ARM( orrpl A_0, A_0, A_1, lsl D_1 )
|
||||
+THUMB( lslpl TMP, A_1, D_1 )
|
||||
+THUMB( orrpl A_0, A_0, TMP )
|
||||
+ mov A_1, A_1, lsr D_0
|
||||
+ @ Mov back C to R
|
||||
+ mov R_0, C_0
|
||||
+ mov R_1, C_1
|
||||
+ ldmfd sp!, {r4, r5, r6, r7, THUMB(TMP,) pc}
|
||||
+#else
|
||||
+ @ Note: A, B and Q, R are aliases
|
||||
+ @ R = A & (B - 1)
|
||||
+ and C_0, A_0, C_0
|
||||
+ and C_1, A_1, C_1
|
||||
+ @ Q = A >> log2(B)
|
||||
+ @ Note: B must not be 0 here!
|
||||
+ @ Count the leading zeroes in B.
|
||||
+ mov D_0, #0
|
||||
+ orrs B_0, B_0, B_0
|
||||
+ @ If B is greater than 1 << 31, divide A and B by 1 << 32.
|
||||
+ moveq A_0, A_1
|
||||
+ moveq A_1, #0
|
||||
+ moveq B_0, B_1
|
||||
+ @ Count the remaining leading zeroes in B.
|
||||
+ movs B_1, B_0, lsl #16
|
||||
+ addeq D_0, #16
|
||||
+ moveq B_0, B_0, lsr #16
|
||||
+ tst B_0, #0xff
|
||||
+ addeq D_0, #8
|
||||
+ moveq B_0, B_0, lsr #8
|
||||
+ tst B_0, #0xf
|
||||
+ addeq D_0, #4
|
||||
+ moveq B_0, B_0, lsr #4
|
||||
+ tst B_0, #0x3
|
||||
+ addeq D_0, #2
|
||||
+ moveq B_0, B_0, lsr #2
|
||||
+ tst B_0, #0x1
|
||||
+ addeq D_0, #1
|
||||
+ @ Shift A to the right by the appropriate amount.
|
||||
+ rsb D_1, D_0, #32
|
||||
+ mov Q_0, A_0, lsr D_0
|
||||
+ ARM( orr Q_0, Q_0, A_1, lsl D_1 )
|
||||
+ THUMB( lsl A_1, D_1 )
|
||||
+ THUMB( orr Q_0, A_1 )
|
||||
+ mov Q_1, A_1, lsr D_0
|
||||
+ @ Move C to R
|
||||
+ mov R_0, C_0
|
||||
+ mov R_1, C_1
|
||||
+ ldmfd sp!, {r4, r5, r6, r7, THUMB(TMP,) pc}
|
||||
+#endif
|
||||
+
|
||||
+L_div_by_0:
|
||||
+ bl __div0
|
||||
+ @ As wrong as it could be
|
||||
+ mov Q_0, #0
|
||||
+ mov Q_1, #0
|
||||
+ mov R_0, #0
|
||||
+ mov R_1, #0
|
||||
+ ldmfd sp!, {r4, r5, r6, r7, THUMB(TMP,) pc}
|
||||
+ENDPROC(__aeabi_uldivmod)
|
||||
+.popsection
|
@ -1,32 +0,0 @@
|
||||
Index: u-boot-2017-01-29-6946ebba/fritz/fritzcreator.sh
|
||||
===================================================================
|
||||
--- u-boot-2017-01-29-6946ebba.orig/fritz/fritzcreator.sh
|
||||
+++ u-boot-2017-01-29-6946ebba/fritz/fritzcreator.sh
|
||||
@@ -1,4 +1,4 @@
|
||||
-#!/bin/sh -xe
|
||||
+#!/bin/bash -xe
|
||||
|
||||
# A helpful
|
||||
#
|
||||
@@ -11,6 +11,7 @@ UBOOT_FRITZ4040="uboot-fritz4040.bin"
|
||||
FRITZ_DTS="fritz/fritz4040.dts"
|
||||
FRITZ_DTB="fritz4040.dtb"
|
||||
UBOOT_LOADADDR=0x841FFFF8
|
||||
+DTC="${DTC:-dtc}"
|
||||
|
||||
rm -f "$UBOOT_FRITZ4040"
|
||||
|
||||
@@ -44,11 +45,11 @@ printf "\x00\x00\x00\xea\xf8\x01\x33\xc4
|
||||
cat "$UBOOT_BIN" >> "$UBOOT_FRITZ4040"
|
||||
|
||||
# Pad file to 1M
|
||||
-dd if="$UBOOT_FRITZ4040" of="$UBOOT_FRITZ4040.new" bs=1M count=1 conv=sync
|
||||
+dd if="$UBOOT_FRITZ4040" of="$UBOOT_FRITZ4040.new" bs=1024k count=1 conv=sync
|
||||
mv "$UBOOT_FRITZ4040.new" "$UBOOT_FRITZ4040"
|
||||
|
||||
# Compile DTS
|
||||
-dtc "$FRITZ_DTS" -o "$FRITZ_DTB" --space 49152
|
||||
+$DTC "$FRITZ_DTS" -o "$FRITZ_DTB" --space 49152
|
||||
|
||||
# Append the compiled DTBs
|
||||
cat "$FRITZ_DTB" "$FRITZ_DTB" "$FRITZ_DTB" "$FRITZ_DTB" >> $UBOOT_FRITZ4040
|
@ -7,10 +7,10 @@
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_VERSION:=2014.04
|
||||
PKG_VERSION:=2018.03
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_HASH:=7b6444bd23eb61068c43bd1d44ec7e7bfdbce5cadeca20c833eee186b4d3fd31
|
||||
PKG_HASH:=7e7477534409d5368eb1371ffde6820f0f79780a1a1f676161c48442cb303dfd
|
||||
|
||||
include $(INCLUDE_DIR)/u-boot.mk
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
@ -20,7 +20,15 @@ define U-Boot/Default
|
||||
UBOOT_IMAGE:=u-boot.imx
|
||||
endef
|
||||
|
||||
define U-Boot/mx6qsabresd
|
||||
define U-Boot/mx6cuboxi
|
||||
NAME:=SolidRun Cubox-i boards
|
||||
UBOOT_IMAGE:=SPL u-boot.img
|
||||
UBOOT_MAKE_FLAGS:=SPL u-boot.img
|
||||
BUILD_DEVICES:=cubox-i
|
||||
HIDDEN:=1
|
||||
endef
|
||||
|
||||
define U-Boot/mx6sabresd
|
||||
NAME:=SABRE i.MX6Quad board
|
||||
endef
|
||||
|
||||
@ -48,31 +56,29 @@ define U-Boot/nitrogen6s1g
|
||||
NAME:=Nitrogen6x i.MX6Solo 1GB board
|
||||
endef
|
||||
|
||||
define U-Boot/wandboard_dl
|
||||
NAME:=Wandboard Dual Lite
|
||||
BUILD_DEVICES:=wandboard
|
||||
endef
|
||||
|
||||
define U-Boot/wandboard_quad
|
||||
NAME:=Wandboard Quad
|
||||
BUILD_DEVICES:=wandboard
|
||||
endef
|
||||
|
||||
define U-Boot/wandboard_solo
|
||||
NAME:=Wandboard Solo
|
||||
define U-Boot/wandboard
|
||||
NAME:=Wandboard Dual Lite/Quad/Solo
|
||||
BUILD_DEVICES:=wandboard
|
||||
endef
|
||||
|
||||
UBOOT_TARGETS := \
|
||||
mx6qsabresd \
|
||||
mx6cuboxi \
|
||||
mx6sabresd \
|
||||
nitrogen6dl \
|
||||
nitrogen6dl2g \
|
||||
nitrogen6q \
|
||||
nitrogen6q2g \
|
||||
nitrogen6s \
|
||||
nitrogen6s1g \
|
||||
wandboard_dl \
|
||||
wandboard_quad \
|
||||
wandboard_solo
|
||||
wandboard
|
||||
|
||||
UBOOT_MAKE_FLAGS += u-boot.imx
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(STAGING_DIR_IMAGE)
|
||||
$(foreach img,$(UBOOT_IMAGE), \
|
||||
$(CP) $(PKG_BUILD_DIR)/$(img) $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-$(img); \
|
||||
)
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage/U-Boot))
|
||||
|
@ -1,72 +0,0 @@
|
||||
From: Jeroen Hofstee <jeroen@myspectrum.nl>
|
||||
Date: Sun, 22 Jun 2014 21:10:39 +0000 (+0200)
|
||||
Subject: ARM:asm:io.h use static inline
|
||||
X-Git-Tag: v2014.10-rc2~47
|
||||
X-Git-Url: http://git.denx.de/?p=u-boot.git;a=commitdiff_plain;h=8863aa5c984460ce1112d8db895cbf8b13a6ac9d
|
||||
|
||||
ARM:asm:io.h use static inline
|
||||
|
||||
When compiling u-boot with W=1 the extern inline void for
|
||||
read* is likely causing the most noise. gcc / clang will
|
||||
warn there is never a actual declaration for these functions.
|
||||
Instead of declaring these extern make them static inline so
|
||||
it is actually declared.
|
||||
|
||||
cc: Albert ARIBAUD <albert.u.boot@aribaud.net>
|
||||
Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
|
||||
---
|
||||
|
||||
--- a/arch/arm/include/asm/io.h
|
||||
+++ b/arch/arm/include/asm/io.h
|
||||
@@ -75,7 +75,7 @@ static inline phys_addr_t virt_to_phys(v
|
||||
#define __arch_putw(v,a) (*(volatile unsigned short *)(a) = (v))
|
||||
#define __arch_putl(v,a) (*(volatile unsigned int *)(a) = (v))
|
||||
|
||||
-extern inline void __raw_writesb(unsigned long addr, const void *data,
|
||||
+static inline void __raw_writesb(unsigned long addr, const void *data,
|
||||
int bytelen)
|
||||
{
|
||||
uint8_t *buf = (uint8_t *)data;
|
||||
@@ -83,7 +83,7 @@ extern inline void __raw_writesb(unsigne
|
||||
__arch_putb(*buf++, addr);
|
||||
}
|
||||
|
||||
-extern inline void __raw_writesw(unsigned long addr, const void *data,
|
||||
+static inline void __raw_writesw(unsigned long addr, const void *data,
|
||||
int wordlen)
|
||||
{
|
||||
uint16_t *buf = (uint16_t *)data;
|
||||
@@ -91,7 +91,7 @@ extern inline void __raw_writesw(unsigne
|
||||
__arch_putw(*buf++, addr);
|
||||
}
|
||||
|
||||
-extern inline void __raw_writesl(unsigned long addr, const void *data,
|
||||
+static inline void __raw_writesl(unsigned long addr, const void *data,
|
||||
int longlen)
|
||||
{
|
||||
uint32_t *buf = (uint32_t *)data;
|
||||
@@ -99,21 +99,21 @@ extern inline void __raw_writesl(unsigne
|
||||
__arch_putl(*buf++, addr);
|
||||
}
|
||||
|
||||
-extern inline void __raw_readsb(unsigned long addr, void *data, int bytelen)
|
||||
+static inline void __raw_readsb(unsigned long addr, void *data, int bytelen)
|
||||
{
|
||||
uint8_t *buf = (uint8_t *)data;
|
||||
while(bytelen--)
|
||||
*buf++ = __arch_getb(addr);
|
||||
}
|
||||
|
||||
-extern inline void __raw_readsw(unsigned long addr, void *data, int wordlen)
|
||||
+static inline void __raw_readsw(unsigned long addr, void *data, int wordlen)
|
||||
{
|
||||
uint16_t *buf = (uint16_t *)data;
|
||||
while(wordlen--)
|
||||
*buf++ = __arch_getw(addr);
|
||||
}
|
||||
|
||||
-extern inline void __raw_readsl(unsigned long addr, void *data, int longlen)
|
||||
+static inline void __raw_readsl(unsigned long addr, void *data, int longlen)
|
||||
{
|
||||
uint32_t *buf = (uint32_t *)data;
|
||||
while(longlen--)
|
@ -1,80 +0,0 @@
|
||||
From: Jeroen Hofstee <jeroen@myspectrum.nl>
|
||||
Date: Wed, 8 Oct 2014 20:57:21 +0000 (+0200)
|
||||
Subject: arm: board: use __weak
|
||||
X-Git-Tag: v2015.01-rc1~176
|
||||
X-Git-Url: http://git.denx.de/?p=u-boot.git;a=commitdiff_plain;h=8590c800ee60e46f15d6085e3c1fed0d6881fc62
|
||||
|
||||
arm: board: use __weak
|
||||
|
||||
Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
|
||||
Acked-by: Albert ARIBAUD <albert.u.boot@aribaud.net>
|
||||
---
|
||||
|
||||
--- a/arch/arm/lib/board.c
|
||||
+++ b/arch/arm/lib/board.c
|
||||
@@ -63,25 +63,15 @@ extern void dataflash_print_info(void);
|
||||
************************************************************************
|
||||
* May be supplied by boards if desired
|
||||
*/
|
||||
-inline void __coloured_LED_init(void) {}
|
||||
-void coloured_LED_init(void)
|
||||
- __attribute__((weak, alias("__coloured_LED_init")));
|
||||
-inline void __red_led_on(void) {}
|
||||
-void red_led_on(void) __attribute__((weak, alias("__red_led_on")));
|
||||
-inline void __red_led_off(void) {}
|
||||
-void red_led_off(void) __attribute__((weak, alias("__red_led_off")));
|
||||
-inline void __green_led_on(void) {}
|
||||
-void green_led_on(void) __attribute__((weak, alias("__green_led_on")));
|
||||
-inline void __green_led_off(void) {}
|
||||
-void green_led_off(void) __attribute__((weak, alias("__green_led_off")));
|
||||
-inline void __yellow_led_on(void) {}
|
||||
-void yellow_led_on(void) __attribute__((weak, alias("__yellow_led_on")));
|
||||
-inline void __yellow_led_off(void) {}
|
||||
-void yellow_led_off(void) __attribute__((weak, alias("__yellow_led_off")));
|
||||
-inline void __blue_led_on(void) {}
|
||||
-void blue_led_on(void) __attribute__((weak, alias("__blue_led_on")));
|
||||
-inline void __blue_led_off(void) {}
|
||||
-void blue_led_off(void) __attribute__((weak, alias("__blue_led_off")));
|
||||
+__weak void coloured_LED_init(void) {}
|
||||
+__weak void red_led_on(void) {}
|
||||
+__weak void red_led_off(void) {}
|
||||
+__weak void green_led_on(void) {}
|
||||
+__weak void green_led_off(void) {}
|
||||
+__weak void yellow_led_on(void) {}
|
||||
+__weak void yellow_led_off(void) {}
|
||||
+__weak void blue_led_on(void) {}
|
||||
+__weak void blue_led_off(void) {}
|
||||
|
||||
/*
|
||||
************************************************************************
|
||||
@@ -198,27 +188,21 @@ static int arm_pci_init(void)
|
||||
*/
|
||||
typedef int (init_fnc_t) (void);
|
||||
|
||||
-void __dram_init_banksize(void)
|
||||
+__weak void dram_init_banksize(void)
|
||||
{
|
||||
gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE;
|
||||
gd->bd->bi_dram[0].size = gd->ram_size;
|
||||
}
|
||||
-void dram_init_banksize(void)
|
||||
- __attribute__((weak, alias("__dram_init_banksize")));
|
||||
|
||||
-int __arch_cpu_init(void)
|
||||
+__weak int arch_cpu_init(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
-int arch_cpu_init(void)
|
||||
- __attribute__((weak, alias("__arch_cpu_init")));
|
||||
|
||||
-int __power_init_board(void)
|
||||
+__weak int power_init_board(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
-int power_init_board(void)
|
||||
- __attribute__((weak, alias("__power_init_board")));
|
||||
|
||||
/* Record the board_init_f() bootstage (after arch_cpu_init()) */
|
||||
static int mark_bootstage(void)
|
@ -1,27 +0,0 @@
|
||||
From: Jeroen Hofstee <jeroen@myspectrum.nl>
|
||||
Date: Thu, 26 Jun 2014 18:18:31 +0000 (+0200)
|
||||
Subject: common: main.c: make show_boot_progress __weak
|
||||
X-Git-Tag: v2014.10-rc1~130
|
||||
X-Git-Url: http://git.denx.de/?p=u-boot.git;a=commitdiff_plain;h=3422299dc28fa8257677d03cc1253e3c9bf17e9f
|
||||
|
||||
common: main.c: make show_boot_progress __weak
|
||||
|
||||
This not only looks a bit better it also prevents a
|
||||
warning with W=1 (no previous prototype).
|
||||
|
||||
Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
|
||||
Acked-by: Simon Glass <sjg@chromium.org>
|
||||
---
|
||||
|
||||
--- a/common/main.c
|
||||
+++ b/common/main.c
|
||||
@@ -27,8 +27,7 @@ DECLARE_GLOBAL_DATA_PTR;
|
||||
/*
|
||||
* Board-specific Platform code can reimplement show_boot_progress () if needed
|
||||
*/
|
||||
-void inline __show_boot_progress (int val) {}
|
||||
-void show_boot_progress (int val) __attribute__((weak, alias("__show_boot_progress")));
|
||||
+__weak void show_boot_progress(int val) {}
|
||||
|
||||
#define MAX_DELAY_STOP_STR 32
|
||||
|
@ -1,10 +1,17 @@
|
||||
--- a/include/configs/wandboard.h
|
||||
+++ b/include/configs/wandboard.h
|
||||
@@ -238,4 +238,7 @@
|
||||
#define CONFIG_CMD_CACHE
|
||||
#endif
|
||||
|
||||
+#define CONFIG_FIT
|
||||
+#define CONFIG_FIT_VERBOSE
|
||||
+
|
||||
#endif /* __CONFIG_H * */
|
||||
--- a/configs/wandboard_defconfig
|
||||
+++ b/configs/wandboard_defconfig
|
||||
@@ -27,7 +27,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_DM=y
|
||||
@@ -39,3 +39,5 @@ CONFIG_USB_STORAGE=y
|
||||
CONFIG_VIDEO=y
|
||||
# CONFIG_VIDEO_SW_CURSOR is not set
|
||||
CONFIG_OF_LIBFDT=y
|
||||
+CONFIG_FIT=y
|
||||
+CONFIG_FIT_VERBOSE=y
|
||||
|
@ -1,480 +0,0 @@
|
||||
From fb8ffd7cfc68b3dc44e182356a207d784cb30b34 Mon Sep 17 00:00:00 2001
|
||||
From: Masahiro Yamada <yamada.m@jp.panasonic.com>
|
||||
Date: Thu, 4 Sep 2014 02:40:58 +0900
|
||||
Subject: compiler*.h: sync include/linux/compiler*.h with Linux 3.16
|
||||
|
||||
Copy them from Linux v3.16 tag.
|
||||
My main motivation of this commit is to add compiler-clang.h.
|
||||
|
||||
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
|
||||
Cc: Jeroen Hofstee <jeroen@myspectrum.nl>
|
||||
---
|
||||
include/linux/compiler-clang.h | 12 ++++++
|
||||
include/linux/compiler-gcc.h | 57 ++++++++++++++++++--------
|
||||
include/linux/compiler-gcc3.h | 20 ++++-----
|
||||
include/linux/compiler-gcc4.h | 59 +++++++++++++++++++--------
|
||||
include/linux/compiler-intel.h | 40 ++++++++++++++++++
|
||||
include/linux/compiler.h | 92 +++++++++++++++++++++++++++++++++++++++++-
|
||||
6 files changed, 236 insertions(+), 44 deletions(-)
|
||||
create mode 100644 include/linux/compiler-clang.h
|
||||
create mode 100644 include/linux/compiler-intel.h
|
||||
|
||||
--- /dev/null
|
||||
+++ b/include/linux/compiler-clang.h
|
||||
@@ -0,0 +1,12 @@
|
||||
+#ifndef __LINUX_COMPILER_H
|
||||
+#error "Please don't include <linux/compiler-clang.h> directly, include <linux/compiler.h> instead."
|
||||
+#endif
|
||||
+
|
||||
+/* Some compiler specific definitions are overwritten here
|
||||
+ * for Clang compiler
|
||||
+ */
|
||||
+
|
||||
+#ifdef uninitialized_var
|
||||
+#undef uninitialized_var
|
||||
+#define uninitialized_var(x) x = *(&(x))
|
||||
+#endif
|
||||
--- a/include/linux/compiler-gcc.h
|
||||
+++ b/include/linux/compiler-gcc.h
|
||||
@@ -5,6 +5,9 @@
|
||||
/*
|
||||
* Common definitions for all gcc versions go here.
|
||||
*/
|
||||
+#define GCC_VERSION (__GNUC__ * 10000 \
|
||||
+ + __GNUC_MINOR__ * 100 \
|
||||
+ + __GNUC_PATCHLEVEL__)
|
||||
|
||||
|
||||
/* Optimization barrier */
|
||||
@@ -34,9 +37,15 @@
|
||||
__asm__ ("" : "=r"(__ptr) : "0"(ptr)); \
|
||||
(typeof(ptr)) (__ptr + (off)); })
|
||||
|
||||
+/* Make the optimizer believe the variable can be manipulated arbitrarily. */
|
||||
+#define OPTIMIZER_HIDE_VAR(var) __asm__ ("" : "=r" (var) : "0" (var))
|
||||
+
|
||||
+#ifdef __CHECKER__
|
||||
+#define __must_be_array(arr) 0
|
||||
+#else
|
||||
/* &a[0] degrades to a pointer: a different type from an array */
|
||||
-#define __must_be_array(a) \
|
||||
- BUILD_BUG_ON_ZERO(__builtin_types_compatible_p(typeof(a), typeof(&a[0])))
|
||||
+#define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0]))
|
||||
+#endif
|
||||
|
||||
/*
|
||||
* Force always-inline if the user requests it so via the .config,
|
||||
@@ -44,15 +53,18 @@
|
||||
*/
|
||||
#if !defined(CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING) || \
|
||||
!defined(CONFIG_OPTIMIZE_INLINING) || (__GNUC__ < 4)
|
||||
-# define inline inline __attribute__((always_inline))
|
||||
-# define __inline__ __inline__ __attribute__((always_inline))
|
||||
-# define __inline __inline __attribute__((always_inline))
|
||||
+# define inline inline __attribute__((always_inline)) notrace
|
||||
+# define __inline__ __inline__ __attribute__((always_inline)) notrace
|
||||
+# define __inline __inline __attribute__((always_inline)) notrace
|
||||
+#else
|
||||
+/* A lot of inline functions can cause havoc with function tracing */
|
||||
+# define inline inline notrace
|
||||
+# define __inline__ __inline__ notrace
|
||||
+# define __inline __inline notrace
|
||||
#endif
|
||||
|
||||
#define __deprecated __attribute__((deprecated))
|
||||
-#ifndef __packed
|
||||
-# define __packed __attribute__((packed))
|
||||
-#endif
|
||||
+#define __packed __attribute__((packed))
|
||||
#define __weak __attribute__((weak))
|
||||
|
||||
/*
|
||||
@@ -60,8 +72,12 @@
|
||||
* naked functions because then mcount is called without stack and frame pointer
|
||||
* being set up and there is no chance to restore the lr register to the value
|
||||
* before mcount was called.
|
||||
+ *
|
||||
+ * The asm() bodies of naked functions often depend on standard calling conventions,
|
||||
+ * therefore they must be noinline and noclone. GCC 4.[56] currently fail to enforce
|
||||
+ * this, so we must do so ourselves. See GCC PR44290.
|
||||
*/
|
||||
-#define __naked __attribute__((naked)) notrace
|
||||
+#define __naked __attribute__((naked)) noinline __noclone notrace
|
||||
|
||||
#define __noreturn __attribute__((noreturn))
|
||||
|
||||
@@ -75,13 +91,10 @@
|
||||
* would be.
|
||||
* [...]
|
||||
*/
|
||||
-#ifndef __pure
|
||||
-# define __pure __attribute__((pure))
|
||||
-#endif
|
||||
-#ifndef __aligned
|
||||
-# define __aligned(x) __attribute__((aligned(x)))
|
||||
-#endif
|
||||
-#define __printf(a,b) __attribute__((format(printf,a,b)))
|
||||
+#define __pure __attribute__((pure))
|
||||
+#define __aligned(x) __attribute__((aligned(x)))
|
||||
+#define __printf(a, b) __attribute__((format(printf, a, b)))
|
||||
+#define __scanf(a, b) __attribute__((format(scanf, a, b)))
|
||||
#define noinline __attribute__((noinline))
|
||||
#define __attribute_const__ __attribute__((__const__))
|
||||
#define __maybe_unused __attribute__((unused))
|
||||
@@ -91,3 +104,15 @@
|
||||
#define _gcc_header(x) __gcc_header(linux/compiler-gcc##x.h)
|
||||
#define gcc_header(x) _gcc_header(x)
|
||||
#include gcc_header(__GNUC__)
|
||||
+
|
||||
+#if !defined(__noclone)
|
||||
+#define __noclone /* not needed */
|
||||
+#endif
|
||||
+
|
||||
+/*
|
||||
+ * A trick to suppress uninitialized variable warning without generating any
|
||||
+ * code
|
||||
+ */
|
||||
+#define uninitialized_var(x) x = x
|
||||
+
|
||||
+#define __always_inline inline __attribute__((always_inline))
|
||||
--- a/include/linux/compiler-gcc3.h
|
||||
+++ b/include/linux/compiler-gcc3.h
|
||||
@@ -2,20 +2,22 @@
|
||||
#error "Please don't include <linux/compiler-gcc3.h> directly, include <linux/compiler.h> instead."
|
||||
#endif
|
||||
|
||||
-#if __GNUC_MINOR__ >= 3
|
||||
+#if GCC_VERSION < 30200
|
||||
+# error Sorry, your compiler is too old - please upgrade it.
|
||||
+#endif
|
||||
+
|
||||
+#if GCC_VERSION >= 30300
|
||||
# define __used __attribute__((__used__))
|
||||
#else
|
||||
# define __used __attribute__((__unused__))
|
||||
#endif
|
||||
|
||||
-#if __GNUC_MINOR__ >= 4
|
||||
+#if GCC_VERSION >= 30400
|
||||
#define __must_check __attribute__((warn_unused_result))
|
||||
#endif
|
||||
|
||||
-/*
|
||||
- * A trick to suppress uninitialized variable warning without generating any
|
||||
- * code
|
||||
- */
|
||||
-#define uninitialized_var(x) x = x
|
||||
-
|
||||
-#define __always_inline inline __attribute__((always_inline))
|
||||
+#ifdef CONFIG_GCOV_KERNEL
|
||||
+# if GCC_VERSION < 30400
|
||||
+# error "GCOV profiling support for gcc versions below 3.4 not included"
|
||||
+# endif /* __GNUC_MINOR__ */
|
||||
+#endif /* CONFIG_GCOV_KERNEL */
|
||||
--- a/include/linux/compiler-gcc4.h
|
||||
+++ b/include/linux/compiler-gcc4.h
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
/* GCC 4.1.[01] miscompiles __weak */
|
||||
#ifdef __KERNEL__
|
||||
-# if __GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ <= 1
|
||||
+# if GCC_VERSION >= 40100 && GCC_VERSION <= 40101
|
||||
# error Your version of gcc miscompiles the __weak directive
|
||||
# endif
|
||||
#endif
|
||||
@@ -12,17 +12,12 @@
|
||||
#define __used __attribute__((__used__))
|
||||
#define __must_check __attribute__((warn_unused_result))
|
||||
#define __compiler_offsetof(a,b) __builtin_offsetof(a,b)
|
||||
-#ifndef __always_inline
|
||||
-# define __always_inline inline __attribute__((always_inline))
|
||||
-#endif
|
||||
|
||||
-/*
|
||||
- * A trick to suppress uninitialized variable warning without generating any
|
||||
- * code
|
||||
- */
|
||||
-#define uninitialized_var(x) x = x
|
||||
+#if GCC_VERSION >= 40100 && GCC_VERSION < 40600
|
||||
+# define __compiletime_object_size(obj) __builtin_object_size(obj, 0)
|
||||
+#endif
|
||||
|
||||
-#if __GNUC_MINOR__ >= 3
|
||||
+#if GCC_VERSION >= 40300
|
||||
/* Mark functions as cold. gcc will assume any path leading to a call
|
||||
to them will be unlikely. This means a lot of manual unlikely()s
|
||||
are unnecessary now for any paths leading to the usual suspects
|
||||
@@ -38,8 +33,15 @@
|
||||
the kernel context */
|
||||
#define __cold __attribute__((__cold__))
|
||||
|
||||
+#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
|
||||
|
||||
-#if __GNUC_MINOR__ >= 5
|
||||
+#ifndef __CHECKER__
|
||||
+# define __compiletime_warning(message) __attribute__((warning(message)))
|
||||
+# define __compiletime_error(message) __attribute__((error(message)))
|
||||
+#endif /* __CHECKER__ */
|
||||
+#endif /* GCC_VERSION >= 40300 */
|
||||
+
|
||||
+#if GCC_VERSION >= 40500
|
||||
/*
|
||||
* Mark a position in code as unreachable. This can be used to
|
||||
* suppress control flow warnings after asm blocks that transfer
|
||||
@@ -50,14 +52,37 @@
|
||||
* unreleased. Really, we need to have autoconf for the kernel.
|
||||
*/
|
||||
#define unreachable() __builtin_unreachable()
|
||||
-#endif
|
||||
|
||||
+/* Mark a function definition as prohibited from being cloned. */
|
||||
+#define __noclone __attribute__((__noclone__))
|
||||
+
|
||||
+#endif /* GCC_VERSION >= 40500 */
|
||||
+
|
||||
+#if GCC_VERSION >= 40600
|
||||
+/*
|
||||
+ * Tell the optimizer that something else uses this function or variable.
|
||||
+ */
|
||||
+#define __visible __attribute__((externally_visible))
|
||||
#endif
|
||||
|
||||
-#if __GNUC_MINOR__ > 0
|
||||
-#define __compiletime_object_size(obj) __builtin_object_size(obj, 0)
|
||||
+/*
|
||||
+ * GCC 'asm goto' miscompiles certain code sequences:
|
||||
+ *
|
||||
+ * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670
|
||||
+ *
|
||||
+ * Work it around via a compiler barrier quirk suggested by Jakub Jelinek.
|
||||
+ * Fixed in GCC 4.8.2 and later versions.
|
||||
+ *
|
||||
+ * (asm goto is automatically volatile - the naming reflects this.)
|
||||
+ */
|
||||
+#define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0)
|
||||
+
|
||||
+#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP
|
||||
+#if GCC_VERSION >= 40400
|
||||
+#define __HAVE_BUILTIN_BSWAP32__
|
||||
+#define __HAVE_BUILTIN_BSWAP64__
|
||||
#endif
|
||||
-#if __GNUC_MINOR__ >= 4
|
||||
-#define __compiletime_warning(message) __attribute__((warning(message)))
|
||||
-#define __compiletime_error(message) __attribute__((error(message)))
|
||||
+#if GCC_VERSION >= 40800 || (defined(__powerpc__) && GCC_VERSION >= 40600)
|
||||
+#define __HAVE_BUILTIN_BSWAP16__
|
||||
#endif
|
||||
+#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */
|
||||
--- /dev/null
|
||||
+++ b/include/linux/compiler-intel.h
|
||||
@@ -0,0 +1,40 @@
|
||||
+#ifndef __LINUX_COMPILER_H
|
||||
+#error "Please don't include <linux/compiler-intel.h> directly, include <linux/compiler.h> instead."
|
||||
+#endif
|
||||
+
|
||||
+#ifdef __ECC
|
||||
+
|
||||
+/* Some compiler specific definitions are overwritten here
|
||||
+ * for Intel ECC compiler
|
||||
+ */
|
||||
+
|
||||
+#include <asm/intrinsics.h>
|
||||
+
|
||||
+/* Intel ECC compiler doesn't support gcc specific asm stmts.
|
||||
+ * It uses intrinsics to do the equivalent things.
|
||||
+ */
|
||||
+#undef RELOC_HIDE
|
||||
+#undef OPTIMIZER_HIDE_VAR
|
||||
+
|
||||
+#define RELOC_HIDE(ptr, off) \
|
||||
+ ({ unsigned long __ptr; \
|
||||
+ __ptr = (unsigned long) (ptr); \
|
||||
+ (typeof(ptr)) (__ptr + (off)); })
|
||||
+
|
||||
+/* This should act as an optimization barrier on var.
|
||||
+ * Given that this compiler does not have inline assembly, a compiler barrier
|
||||
+ * is the best we can do.
|
||||
+ */
|
||||
+#define OPTIMIZER_HIDE_VAR(var) barrier()
|
||||
+
|
||||
+/* Intel ECC compiler doesn't support __builtin_types_compatible_p() */
|
||||
+#define __must_be_array(a) 0
|
||||
+
|
||||
+#endif
|
||||
+
|
||||
+#ifndef __HAVE_BUILTIN_BSWAP16__
|
||||
+/* icc has this, but it's called _bswap16 */
|
||||
+#define __HAVE_BUILTIN_BSWAP16__
|
||||
+#define __builtin_bswap16 _bswap16
|
||||
+#endif
|
||||
+
|
||||
--- a/include/linux/compiler.h
|
||||
+++ b/include/linux/compiler.h
|
||||
@@ -5,16 +5,23 @@
|
||||
|
||||
#ifdef __CHECKER__
|
||||
# define __user __attribute__((noderef, address_space(1)))
|
||||
-# define __kernel /* default address space */
|
||||
+# define __kernel __attribute__((address_space(0)))
|
||||
# define __safe __attribute__((safe))
|
||||
# define __force __attribute__((force))
|
||||
# define __nocast __attribute__((nocast))
|
||||
# define __iomem __attribute__((noderef, address_space(2)))
|
||||
+# define __must_hold(x) __attribute__((context(x,1,1)))
|
||||
# define __acquires(x) __attribute__((context(x,0,1)))
|
||||
# define __releases(x) __attribute__((context(x,1,0)))
|
||||
# define __acquire(x) __context__(x,1)
|
||||
# define __release(x) __context__(x,-1)
|
||||
# define __cond_lock(x,c) ((c) ? ({ __acquire(x); 1; }) : 0)
|
||||
+# define __percpu __attribute__((noderef, address_space(3)))
|
||||
+#ifdef CONFIG_SPARSE_RCU_POINTER
|
||||
+# define __rcu __attribute__((noderef, address_space(4)))
|
||||
+#else
|
||||
+# define __rcu
|
||||
+#endif
|
||||
extern void __chk_user_ptr(const volatile void __user *);
|
||||
extern void __chk_io_ptr(const volatile void __iomem *);
|
||||
#else
|
||||
@@ -27,13 +34,20 @@ extern void __chk_io_ptr(const volatile
|
||||
# define __chk_user_ptr(x) (void)0
|
||||
# define __chk_io_ptr(x) (void)0
|
||||
# define __builtin_warning(x, y...) (1)
|
||||
+# define __must_hold(x)
|
||||
# define __acquires(x)
|
||||
# define __releases(x)
|
||||
# define __acquire(x) (void)0
|
||||
# define __release(x) (void)0
|
||||
# define __cond_lock(x,c) (c)
|
||||
+# define __percpu
|
||||
+# define __rcu
|
||||
#endif
|
||||
|
||||
+/* Indirect macros required for expanded argument pasting, eg. __LINE__. */
|
||||
+#define ___PASTE(a,b) a##b
|
||||
+#define __PASTE(a,b) ___PASTE(a,b)
|
||||
+
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#ifdef __GNUC__
|
||||
@@ -49,6 +63,13 @@ extern void __chk_io_ptr(const volatile
|
||||
# include <linux/compiler-intel.h>
|
||||
#endif
|
||||
|
||||
+/* Clang compiler defines __GNUC__. So we will overwrite implementations
|
||||
+ * coming from above header files here
|
||||
+ */
|
||||
+#ifdef __clang__
|
||||
+#include <linux/compiler-clang.h>
|
||||
+#endif
|
||||
+
|
||||
/*
|
||||
* Generic compiler-dependent macros required for kernel
|
||||
* build go below this comment. Actual compiler/compiler version
|
||||
@@ -156,6 +177,15 @@ void ftrace_likely_update(struct ftrace_
|
||||
(typeof(ptr)) (__ptr + (off)); })
|
||||
#endif
|
||||
|
||||
+#ifndef OPTIMIZER_HIDE_VAR
|
||||
+#define OPTIMIZER_HIDE_VAR(var) barrier()
|
||||
+#endif
|
||||
+
|
||||
+/* Not-quite-unique ID. */
|
||||
+#ifndef __UNIQUE_ID
|
||||
+# define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __LINE__)
|
||||
+#endif
|
||||
+
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
@@ -228,7 +258,7 @@ void ftrace_likely_update(struct ftrace_
|
||||
|
||||
/*
|
||||
* Rather then using noinline to prevent stack consumption, use
|
||||
- * noinline_for_stack instead. For documentaiton reasons.
|
||||
+ * noinline_for_stack instead. For documentation reasons.
|
||||
*/
|
||||
#define noinline_for_stack noinline
|
||||
|
||||
@@ -270,11 +300,20 @@ void ftrace_likely_update(struct ftrace_
|
||||
# define __section(S) __attribute__ ((__section__(#S)))
|
||||
#endif
|
||||
|
||||
+#ifndef __visible
|
||||
+#define __visible
|
||||
+#endif
|
||||
+
|
||||
/* Are two types/vars the same type (ignoring qualifiers)? */
|
||||
#ifndef __same_type
|
||||
# define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
|
||||
#endif
|
||||
|
||||
+/* Is this type a native word size -- useful for atomic operations */
|
||||
+#ifndef __native_word
|
||||
+# define __native_word(t) (sizeof(t) == sizeof(int) || sizeof(t) == sizeof(long))
|
||||
+#endif
|
||||
+
|
||||
/* Compile time object size, -1 for unknown */
|
||||
#ifndef __compiletime_object_size
|
||||
# define __compiletime_object_size(obj) -1
|
||||
@@ -284,7 +323,48 @@ void ftrace_likely_update(struct ftrace_
|
||||
#endif
|
||||
#ifndef __compiletime_error
|
||||
# define __compiletime_error(message)
|
||||
+/*
|
||||
+ * Sparse complains of variable sized arrays due to the temporary variable in
|
||||
+ * __compiletime_assert. Unfortunately we can't just expand it out to make
|
||||
+ * sparse see a constant array size without breaking compiletime_assert on old
|
||||
+ * versions of GCC (e.g. 4.2.4), so hide the array from sparse altogether.
|
||||
+ */
|
||||
+# ifndef __CHECKER__
|
||||
+# define __compiletime_error_fallback(condition) \
|
||||
+ do { ((void)sizeof(char[1 - 2 * condition])); } while (0)
|
||||
+# endif
|
||||
#endif
|
||||
+#ifndef __compiletime_error_fallback
|
||||
+# define __compiletime_error_fallback(condition) do { } while (0)
|
||||
+#endif
|
||||
+
|
||||
+#define __compiletime_assert(condition, msg, prefix, suffix) \
|
||||
+ do { \
|
||||
+ bool __cond = !(condition); \
|
||||
+ extern void prefix ## suffix(void) __compiletime_error(msg); \
|
||||
+ if (__cond) \
|
||||
+ prefix ## suffix(); \
|
||||
+ __compiletime_error_fallback(__cond); \
|
||||
+ } while (0)
|
||||
+
|
||||
+#define _compiletime_assert(condition, msg, prefix, suffix) \
|
||||
+ __compiletime_assert(condition, msg, prefix, suffix)
|
||||
+
|
||||
+/**
|
||||
+ * compiletime_assert - break build and emit msg if condition is false
|
||||
+ * @condition: a compile-time constant condition to check
|
||||
+ * @msg: a message to emit if condition is false
|
||||
+ *
|
||||
+ * In tradition of POSIX assert, this macro will break the build if the
|
||||
+ * supplied condition is *false*, emitting the supplied error message if the
|
||||
+ * compiler has support to do so.
|
||||
+ */
|
||||
+#define compiletime_assert(condition, msg) \
|
||||
+ _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
|
||||
+
|
||||
+#define compiletime_assert_atomic_type(t) \
|
||||
+ compiletime_assert(__native_word(t), \
|
||||
+ "Need native word sized stores/loads for atomicity.")
|
||||
|
||||
/*
|
||||
* Prevent the compiler from merging or refetching accesses. The compiler
|
||||
@@ -300,4 +380,12 @@ void ftrace_likely_update(struct ftrace_
|
||||
*/
|
||||
#define ACCESS_ONCE(x) (*(volatile typeof(x) *)&(x))
|
||||
|
||||
+/* Ignore/forbid kprobes attach on very low level functions marked by this attribute: */
|
||||
+#ifdef CONFIG_KPROBES
|
||||
+# define __kprobes __attribute__((__section__(".kprobes.text")))
|
||||
+# define nokprobe_inline __always_inline
|
||||
+#else
|
||||
+# define __kprobes
|
||||
+# define nokprobe_inline inline
|
||||
+#endif
|
||||
#endif /* __LINUX_COMPILER_H */
|
@ -1,69 +0,0 @@
|
||||
From 0a5051ce6ebd5f6fad58fd50d6922493d8447f14 Mon Sep 17 00:00:00 2001
|
||||
From: Jeroen Hofstee <jeroen@myspectrum.nl>
|
||||
Date: Thu, 18 Sep 2014 20:10:27 +0200
|
||||
Subject: compiler_gcc: prevent redefining attributes
|
||||
|
||||
The libc headers on FreeBSD and likely related projects as well contain an
|
||||
header file, cdefs.h which provides similiar functionality as linux/compiler.h.
|
||||
It provides compiler independent defines like __weak __packed, to allow
|
||||
compiling with multiple compilers which might have a different syntax for such
|
||||
extension.
|
||||
|
||||
Since that header file is included in multiple standard headers, like stddef.h
|
||||
and stdarg.h, multiple definitions of those defines will be present if both are
|
||||
included. When compiling u-boot the compiler will warn about it hundreds of
|
||||
times since e.g. common.h will include both files indirectly.
|
||||
|
||||
commit 7ea50d52849fe8ffa5b5b74c979b60b1045d6fc9 "compiler_gcc: do not redefine
|
||||
__gnu_attributes" prevented such redefinitions, but this was undone by commit
|
||||
fb8ffd7cfc68b3dc44e182356a207d784cb30b34 "compiler*.h: sync
|
||||
include/linux/compiler*.h with Linux 3.16".
|
||||
|
||||
Add the checks back where necessary to prevent such warnings.
|
||||
|
||||
As the original patch this checkpatch warning is ignored:
|
||||
"WARNING: Adding new packed members is to be done with care"
|
||||
|
||||
Cc: Masahiro Yamada <yamada.m@jp.panasonic.com>
|
||||
Cc: Tom Rini <trini@ti.com>
|
||||
Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
|
||||
Acked-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
|
||||
---
|
||||
include/linux/compiler-gcc.h | 10 ++++++++++
|
||||
1 file changed, 10 insertions(+)
|
||||
|
||||
--- a/include/linux/compiler-gcc.h
|
||||
+++ b/include/linux/compiler-gcc.h
|
||||
@@ -64,8 +64,12 @@
|
||||
#endif
|
||||
|
||||
#define __deprecated __attribute__((deprecated))
|
||||
+#ifndef __packed
|
||||
#define __packed __attribute__((packed))
|
||||
+#endif
|
||||
+#ifndef __weak
|
||||
#define __weak __attribute__((weak))
|
||||
+#endif
|
||||
|
||||
/*
|
||||
* it doesn't make sense on ARM (currently the only user of __naked) to trace
|
||||
@@ -91,8 +95,12 @@
|
||||
* would be.
|
||||
* [...]
|
||||
*/
|
||||
+#ifndef __pure
|
||||
#define __pure __attribute__((pure))
|
||||
+#endif
|
||||
+#ifndef __aligned
|
||||
#define __aligned(x) __attribute__((aligned(x)))
|
||||
+#endif
|
||||
#define __printf(a, b) __attribute__((format(printf, a, b)))
|
||||
#define __scanf(a, b) __attribute__((format(scanf, a, b)))
|
||||
#define noinline __attribute__((noinline))
|
||||
@@ -115,4 +123,6 @@
|
||||
*/
|
||||
#define uninitialized_var(x) x = x
|
||||
|
||||
+#ifndef __always_inline
|
||||
#define __always_inline inline __attribute__((always_inline))
|
||||
+#endif
|
@ -1,87 +0,0 @@
|
||||
From 478b02f1a7043b673565075ea5016376f3293b23 Mon Sep 17 00:00:00 2001
|
||||
From: Hans de Goede <hdegoede@redhat.com>
|
||||
Date: Sat, 7 Feb 2015 22:52:40 +0100
|
||||
Subject: Add linux/compiler-gcc5.h to fix builds with gcc5
|
||||
|
||||
Add linux/compiler-gcc5/h from the kernel sources at:
|
||||
|
||||
commit 5631b8fba640a4ab2f8a954f63a603fa34eda96b
|
||||
Author: Steven Noonan <steven@uplinklabs.net>
|
||||
Date: Sat Oct 25 15:09:42 2014 -0700
|
||||
|
||||
compiler/gcc4+: Remove inaccurate comment about 'asm goto' miscompiles
|
||||
|
||||
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
||||
---
|
||||
include/linux/compiler-gcc5.h | 65 +++++++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 65 insertions(+)
|
||||
create mode 100644 include/linux/compiler-gcc5.h
|
||||
|
||||
--- /dev/null
|
||||
+++ b/include/linux/compiler-gcc5.h
|
||||
@@ -0,0 +1,65 @@
|
||||
+#ifndef __LINUX_COMPILER_H
|
||||
+#error "Please don't include <linux/compiler-gcc5.h> directly, include <linux/compiler.h> instead."
|
||||
+#endif
|
||||
+
|
||||
+#define __used __attribute__((__used__))
|
||||
+#define __must_check __attribute__((warn_unused_result))
|
||||
+#define __compiler_offsetof(a, b) __builtin_offsetof(a, b)
|
||||
+
|
||||
+/* Mark functions as cold. gcc will assume any path leading to a call
|
||||
+ to them will be unlikely. This means a lot of manual unlikely()s
|
||||
+ are unnecessary now for any paths leading to the usual suspects
|
||||
+ like BUG(), printk(), panic() etc. [but let's keep them for now for
|
||||
+ older compilers]
|
||||
+
|
||||
+ Early snapshots of gcc 4.3 don't support this and we can't detect this
|
||||
+ in the preprocessor, but we can live with this because they're unreleased.
|
||||
+ Maketime probing would be overkill here.
|
||||
+
|
||||
+ gcc also has a __attribute__((__hot__)) to move hot functions into
|
||||
+ a special section, but I don't see any sense in this right now in
|
||||
+ the kernel context */
|
||||
+#define __cold __attribute__((__cold__))
|
||||
+
|
||||
+#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
|
||||
+
|
||||
+#ifndef __CHECKER__
|
||||
+# define __compiletime_warning(message) __attribute__((warning(message)))
|
||||
+# define __compiletime_error(message) __attribute__((error(message)))
|
||||
+#endif /* __CHECKER__ */
|
||||
+
|
||||
+/*
|
||||
+ * Mark a position in code as unreachable. This can be used to
|
||||
+ * suppress control flow warnings after asm blocks that transfer
|
||||
+ * control elsewhere.
|
||||
+ *
|
||||
+ * Early snapshots of gcc 4.5 don't support this and we can't detect
|
||||
+ * this in the preprocessor, but we can live with this because they're
|
||||
+ * unreleased. Really, we need to have autoconf for the kernel.
|
||||
+ */
|
||||
+#define unreachable() __builtin_unreachable()
|
||||
+
|
||||
+/* Mark a function definition as prohibited from being cloned. */
|
||||
+#define __noclone __attribute__((__noclone__))
|
||||
+
|
||||
+/*
|
||||
+ * Tell the optimizer that something else uses this function or variable.
|
||||
+ */
|
||||
+#define __visible __attribute__((externally_visible))
|
||||
+
|
||||
+/*
|
||||
+ * GCC 'asm goto' miscompiles certain code sequences:
|
||||
+ *
|
||||
+ * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670
|
||||
+ *
|
||||
+ * Work it around via a compiler barrier quirk suggested by Jakub Jelinek.
|
||||
+ *
|
||||
+ * (asm goto is automatically volatile - the naming reflects this.)
|
||||
+ */
|
||||
+#define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0)
|
||||
+
|
||||
+#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP
|
||||
+#define __HAVE_BUILTIN_BSWAP32__
|
||||
+#define __HAVE_BUILTIN_BSWAP64__
|
||||
+#define __HAVE_BUILTIN_BSWAP16__
|
||||
+#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */
|
@ -1,790 +0,0 @@
|
||||
From 9b2c282b348dfe966bbba967dc7a45ce817cce50 Mon Sep 17 00:00:00 2001
|
||||
From: Tom Rini <trini@konsulko.com>
|
||||
Date: Mon, 29 Feb 2016 11:34:15 -0500
|
||||
Subject: compiler*.h: sync include/linux/compiler*.h with Linux 4.5-rc6
|
||||
|
||||
Copy these from Linux v4.5-rc6 tag.
|
||||
|
||||
This is needed so that we can keep up with newer gcc versions. Note
|
||||
that we don't have the uapi/ hierarchy from the kernel so continue to
|
||||
use <linux/types.h>
|
||||
|
||||
Signed-off-by: Tom Rini <trini@konsulko.com>
|
||||
---
|
||||
include/linux/compiler-gcc.h | 259 ++++++++++++++++++++++++++++++++---------
|
||||
include/linux/compiler-gcc3.h | 23 ----
|
||||
include/linux/compiler-gcc4.h | 88 --------------
|
||||
include/linux/compiler-gcc5.h | 65 -----------
|
||||
include/linux/compiler-intel.h | 5 +
|
||||
include/linux/compiler.h | 178 ++++++++++++++++++++++++++--
|
||||
6 files changed, 383 insertions(+), 235 deletions(-)
|
||||
delete mode 100644 include/linux/compiler-gcc3.h
|
||||
delete mode 100644 include/linux/compiler-gcc4.h
|
||||
delete mode 100644 include/linux/compiler-gcc5.h
|
||||
|
||||
--- a/include/linux/compiler-gcc.h
|
||||
+++ b/include/linux/compiler-gcc.h
|
||||
@@ -5,14 +5,28 @@
|
||||
/*
|
||||
* Common definitions for all gcc versions go here.
|
||||
*/
|
||||
-#define GCC_VERSION (__GNUC__ * 10000 \
|
||||
- + __GNUC_MINOR__ * 100 \
|
||||
- + __GNUC_PATCHLEVEL__)
|
||||
-
|
||||
+#define GCC_VERSION (__GNUC__ * 10000 \
|
||||
+ + __GNUC_MINOR__ * 100 \
|
||||
+ + __GNUC_PATCHLEVEL__)
|
||||
|
||||
/* Optimization barrier */
|
||||
+
|
||||
/* The "volatile" is due to gcc bugs */
|
||||
#define barrier() __asm__ __volatile__("": : :"memory")
|
||||
+/*
|
||||
+ * This version is i.e. to prevent dead stores elimination on @ptr
|
||||
+ * where gcc and llvm may behave differently when otherwise using
|
||||
+ * normal barrier(): while gcc behavior gets along with a normal
|
||||
+ * barrier(), llvm needs an explicit input variable to be assumed
|
||||
+ * clobbered. The issue is as follows: while the inline asm might
|
||||
+ * access any memory it wants, the compiler could have fit all of
|
||||
+ * @ptr into memory registers instead, and since @ptr never escaped
|
||||
+ * from that, it proofed that the inline asm wasn't touching any of
|
||||
+ * it. This version works well with both compilers, i.e. we're telling
|
||||
+ * the compiler that the inline asm absolutely may see the contents
|
||||
+ * of @ptr. See also: https://llvm.org/bugs/show_bug.cgi?id=15495
|
||||
+ */
|
||||
+#define barrier_data(ptr) __asm__ __volatile__("": :"r"(ptr) :"memory")
|
||||
|
||||
/*
|
||||
* This macro obfuscates arithmetic on a variable address so that gcc
|
||||
@@ -32,58 +46,63 @@
|
||||
* the inline assembly constraint from =g to =r, in this particular
|
||||
* case either is valid.
|
||||
*/
|
||||
-#define RELOC_HIDE(ptr, off) \
|
||||
- ({ unsigned long __ptr; \
|
||||
- __asm__ ("" : "=r"(__ptr) : "0"(ptr)); \
|
||||
- (typeof(ptr)) (__ptr + (off)); })
|
||||
+#define RELOC_HIDE(ptr, off) \
|
||||
+({ \
|
||||
+ unsigned long __ptr; \
|
||||
+ __asm__ ("" : "=r"(__ptr) : "0"(ptr)); \
|
||||
+ (typeof(ptr)) (__ptr + (off)); \
|
||||
+})
|
||||
|
||||
/* Make the optimizer believe the variable can be manipulated arbitrarily. */
|
||||
-#define OPTIMIZER_HIDE_VAR(var) __asm__ ("" : "=r" (var) : "0" (var))
|
||||
+#define OPTIMIZER_HIDE_VAR(var) \
|
||||
+ __asm__ ("" : "=r" (var) : "0" (var))
|
||||
|
||||
#ifdef __CHECKER__
|
||||
-#define __must_be_array(arr) 0
|
||||
+#define __must_be_array(a) 0
|
||||
#else
|
||||
/* &a[0] degrades to a pointer: a different type from an array */
|
||||
-#define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0]))
|
||||
+#define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0]))
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Force always-inline if the user requests it so via the .config,
|
||||
* or if gcc is too old:
|
||||
*/
|
||||
-#if !defined(CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING) || \
|
||||
+#if !defined(CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING) || \
|
||||
!defined(CONFIG_OPTIMIZE_INLINING) || (__GNUC__ < 4)
|
||||
-# define inline inline __attribute__((always_inline)) notrace
|
||||
-# define __inline__ __inline__ __attribute__((always_inline)) notrace
|
||||
-# define __inline __inline __attribute__((always_inline)) notrace
|
||||
+#define inline inline __attribute__((always_inline)) notrace
|
||||
+#define __inline__ __inline__ __attribute__((always_inline)) notrace
|
||||
+#define __inline __inline __attribute__((always_inline)) notrace
|
||||
#else
|
||||
/* A lot of inline functions can cause havoc with function tracing */
|
||||
-# define inline inline notrace
|
||||
-# define __inline__ __inline__ notrace
|
||||
-# define __inline __inline notrace
|
||||
+#define inline inline notrace
|
||||
+#define __inline__ __inline__ notrace
|
||||
+#define __inline __inline notrace
|
||||
#endif
|
||||
|
||||
-#define __deprecated __attribute__((deprecated))
|
||||
-#ifndef __packed
|
||||
-#define __packed __attribute__((packed))
|
||||
-#endif
|
||||
-#ifndef __weak
|
||||
-#define __weak __attribute__((weak))
|
||||
-#endif
|
||||
+#define __always_inline inline __attribute__((always_inline))
|
||||
+#define noinline __attribute__((noinline))
|
||||
+
|
||||
+#define __deprecated __attribute__((deprecated))
|
||||
+#define __packed __attribute__((packed))
|
||||
+#define __weak __attribute__((weak))
|
||||
+#define __alias(symbol) __attribute__((alias(#symbol)))
|
||||
|
||||
/*
|
||||
- * it doesn't make sense on ARM (currently the only user of __naked) to trace
|
||||
- * naked functions because then mcount is called without stack and frame pointer
|
||||
- * being set up and there is no chance to restore the lr register to the value
|
||||
- * before mcount was called.
|
||||
+ * it doesn't make sense on ARM (currently the only user of __naked)
|
||||
+ * to trace naked functions because then mcount is called without
|
||||
+ * stack and frame pointer being set up and there is no chance to
|
||||
+ * restore the lr register to the value before mcount was called.
|
||||
+ *
|
||||
+ * The asm() bodies of naked functions often depend on standard calling
|
||||
+ * conventions, therefore they must be noinline and noclone.
|
||||
*
|
||||
- * The asm() bodies of naked functions often depend on standard calling conventions,
|
||||
- * therefore they must be noinline and noclone. GCC 4.[56] currently fail to enforce
|
||||
- * this, so we must do so ourselves. See GCC PR44290.
|
||||
+ * GCC 4.[56] currently fail to enforce this, so we must do so ourselves.
|
||||
+ * See GCC PR44290.
|
||||
*/
|
||||
-#define __naked __attribute__((naked)) noinline __noclone notrace
|
||||
+#define __naked __attribute__((naked)) noinline __noclone notrace
|
||||
|
||||
-#define __noreturn __attribute__((noreturn))
|
||||
+#define __noreturn __attribute__((noreturn))
|
||||
|
||||
/*
|
||||
* From the GCC manual:
|
||||
@@ -95,34 +114,170 @@
|
||||
* would be.
|
||||
* [...]
|
||||
*/
|
||||
-#ifndef __pure
|
||||
-#define __pure __attribute__((pure))
|
||||
+#define __pure __attribute__((pure))
|
||||
+#define __aligned(x) __attribute__((aligned(x)))
|
||||
+#define __printf(a, b) __attribute__((format(printf, a, b)))
|
||||
+#define __scanf(a, b) __attribute__((format(scanf, a, b)))
|
||||
+#define __attribute_const__ __attribute__((__const__))
|
||||
+#define __maybe_unused __attribute__((unused))
|
||||
+#define __always_unused __attribute__((unused))
|
||||
+
|
||||
+/* gcc version specific checks */
|
||||
+
|
||||
+#if GCC_VERSION < 30200
|
||||
+# error Sorry, your compiler is too old - please upgrade it.
|
||||
+#endif
|
||||
+
|
||||
+#if GCC_VERSION < 30300
|
||||
+# define __used __attribute__((__unused__))
|
||||
+#else
|
||||
+# define __used __attribute__((__used__))
|
||||
+#endif
|
||||
+
|
||||
+#ifdef CONFIG_GCOV_KERNEL
|
||||
+# if GCC_VERSION < 30400
|
||||
+# error "GCOV profiling support for gcc versions below 3.4 not included"
|
||||
+# endif /* __GNUC_MINOR__ */
|
||||
+#endif /* CONFIG_GCOV_KERNEL */
|
||||
+
|
||||
+#if GCC_VERSION >= 30400
|
||||
+#define __must_check __attribute__((warn_unused_result))
|
||||
#endif
|
||||
-#ifndef __aligned
|
||||
-#define __aligned(x) __attribute__((aligned(x)))
|
||||
+
|
||||
+#if GCC_VERSION >= 40000
|
||||
+
|
||||
+/* GCC 4.1.[01] miscompiles __weak */
|
||||
+#ifdef __KERNEL__
|
||||
+# if GCC_VERSION >= 40100 && GCC_VERSION <= 40101
|
||||
+# error Your version of gcc miscompiles the __weak directive
|
||||
+# endif
|
||||
+#endif
|
||||
+
|
||||
+#define __used __attribute__((__used__))
|
||||
+#define __compiler_offsetof(a, b) \
|
||||
+ __builtin_offsetof(a, b)
|
||||
+
|
||||
+#if GCC_VERSION >= 40100 && GCC_VERSION < 40600
|
||||
+# define __compiletime_object_size(obj) __builtin_object_size(obj, 0)
|
||||
#endif
|
||||
-#define __printf(a, b) __attribute__((format(printf, a, b)))
|
||||
-#define __scanf(a, b) __attribute__((format(scanf, a, b)))
|
||||
-#define noinline __attribute__((noinline))
|
||||
-#define __attribute_const__ __attribute__((__const__))
|
||||
-#define __maybe_unused __attribute__((unused))
|
||||
-#define __always_unused __attribute__((unused))
|
||||
-
|
||||
-#define __gcc_header(x) #x
|
||||
-#define _gcc_header(x) __gcc_header(linux/compiler-gcc##x.h)
|
||||
-#define gcc_header(x) _gcc_header(x)
|
||||
-#include gcc_header(__GNUC__)
|
||||
+
|
||||
+#if GCC_VERSION >= 40300
|
||||
+/* Mark functions as cold. gcc will assume any path leading to a call
|
||||
+ * to them will be unlikely. This means a lot of manual unlikely()s
|
||||
+ * are unnecessary now for any paths leading to the usual suspects
|
||||
+ * like BUG(), printk(), panic() etc. [but let's keep them for now for
|
||||
+ * older compilers]
|
||||
+ *
|
||||
+ * Early snapshots of gcc 4.3 don't support this and we can't detect this
|
||||
+ * in the preprocessor, but we can live with this because they're unreleased.
|
||||
+ * Maketime probing would be overkill here.
|
||||
+ *
|
||||
+ * gcc also has a __attribute__((__hot__)) to move hot functions into
|
||||
+ * a special section, but I don't see any sense in this right now in
|
||||
+ * the kernel context
|
||||
+ */
|
||||
+#define __cold __attribute__((__cold__))
|
||||
+
|
||||
+#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
|
||||
+
|
||||
+#ifndef __CHECKER__
|
||||
+# define __compiletime_warning(message) __attribute__((warning(message)))
|
||||
+# define __compiletime_error(message) __attribute__((error(message)))
|
||||
+#endif /* __CHECKER__ */
|
||||
+#endif /* GCC_VERSION >= 40300 */
|
||||
+
|
||||
+#if GCC_VERSION >= 40500
|
||||
+/*
|
||||
+ * Mark a position in code as unreachable. This can be used to
|
||||
+ * suppress control flow warnings after asm blocks that transfer
|
||||
+ * control elsewhere.
|
||||
+ *
|
||||
+ * Early snapshots of gcc 4.5 don't support this and we can't detect
|
||||
+ * this in the preprocessor, but we can live with this because they're
|
||||
+ * unreleased. Really, we need to have autoconf for the kernel.
|
||||
+ */
|
||||
+#define unreachable() __builtin_unreachable()
|
||||
+
|
||||
+/* Mark a function definition as prohibited from being cloned. */
|
||||
+#define __noclone __attribute__((__noclone__))
|
||||
+
|
||||
+#endif /* GCC_VERSION >= 40500 */
|
||||
+
|
||||
+#if GCC_VERSION >= 40600
|
||||
+/*
|
||||
+ * When used with Link Time Optimization, gcc can optimize away C functions or
|
||||
+ * variables which are referenced only from assembly code. __visible tells the
|
||||
+ * optimizer that something else uses this function or variable, thus preventing
|
||||
+ * this.
|
||||
+ */
|
||||
+#define __visible __attribute__((externally_visible))
|
||||
+#endif
|
||||
+
|
||||
+
|
||||
+#if GCC_VERSION >= 40900 && !defined(__CHECKER__)
|
||||
+/*
|
||||
+ * __assume_aligned(n, k): Tell the optimizer that the returned
|
||||
+ * pointer can be assumed to be k modulo n. The second argument is
|
||||
+ * optional (default 0), so we use a variadic macro to make the
|
||||
+ * shorthand.
|
||||
+ *
|
||||
+ * Beware: Do not apply this to functions which may return
|
||||
+ * ERR_PTRs. Also, it is probably unwise to apply it to functions
|
||||
+ * returning extra information in the low bits (but in that case the
|
||||
+ * compiler should see some alignment anyway, when the return value is
|
||||
+ * massaged by 'flags = ptr & 3; ptr &= ~3;').
|
||||
+ */
|
||||
+#define __assume_aligned(a, ...) __attribute__((__assume_aligned__(a, ## __VA_ARGS__)))
|
||||
+#endif
|
||||
+
|
||||
+/*
|
||||
+ * GCC 'asm goto' miscompiles certain code sequences:
|
||||
+ *
|
||||
+ * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670
|
||||
+ *
|
||||
+ * Work it around via a compiler barrier quirk suggested by Jakub Jelinek.
|
||||
+ *
|
||||
+ * (asm goto is automatically volatile - the naming reflects this.)
|
||||
+ */
|
||||
+#define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0)
|
||||
+
|
||||
+#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP
|
||||
+#if GCC_VERSION >= 40400
|
||||
+#define __HAVE_BUILTIN_BSWAP32__
|
||||
+#define __HAVE_BUILTIN_BSWAP64__
|
||||
+#endif
|
||||
+#if GCC_VERSION >= 40800 || (defined(__powerpc__) && GCC_VERSION >= 40600)
|
||||
+#define __HAVE_BUILTIN_BSWAP16__
|
||||
+#endif
|
||||
+#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */
|
||||
+
|
||||
+#if GCC_VERSION >= 50000
|
||||
+#define KASAN_ABI_VERSION 4
|
||||
+#elif GCC_VERSION >= 40902
|
||||
+#define KASAN_ABI_VERSION 3
|
||||
+#endif
|
||||
+
|
||||
+#if GCC_VERSION >= 40902
|
||||
+/*
|
||||
+ * Tell the compiler that address safety instrumentation (KASAN)
|
||||
+ * should not be applied to that function.
|
||||
+ * Conflicts with inlining: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67368
|
||||
+ */
|
||||
+#define __no_sanitize_address __attribute__((no_sanitize_address))
|
||||
+#endif
|
||||
+
|
||||
+#endif /* gcc version >= 40000 specific checks */
|
||||
|
||||
#if !defined(__noclone)
|
||||
#define __noclone /* not needed */
|
||||
#endif
|
||||
|
||||
+#if !defined(__no_sanitize_address)
|
||||
+#define __no_sanitize_address
|
||||
+#endif
|
||||
+
|
||||
/*
|
||||
* A trick to suppress uninitialized variable warning without generating any
|
||||
* code
|
||||
*/
|
||||
#define uninitialized_var(x) x = x
|
||||
-
|
||||
-#ifndef __always_inline
|
||||
-#define __always_inline inline __attribute__((always_inline))
|
||||
-#endif
|
||||
--- a/include/linux/compiler-gcc3.h
|
||||
+++ /dev/null
|
||||
@@ -1,23 +0,0 @@
|
||||
-#ifndef __LINUX_COMPILER_H
|
||||
-#error "Please don't include <linux/compiler-gcc3.h> directly, include <linux/compiler.h> instead."
|
||||
-#endif
|
||||
-
|
||||
-#if GCC_VERSION < 30200
|
||||
-# error Sorry, your compiler is too old - please upgrade it.
|
||||
-#endif
|
||||
-
|
||||
-#if GCC_VERSION >= 30300
|
||||
-# define __used __attribute__((__used__))
|
||||
-#else
|
||||
-# define __used __attribute__((__unused__))
|
||||
-#endif
|
||||
-
|
||||
-#if GCC_VERSION >= 30400
|
||||
-#define __must_check __attribute__((warn_unused_result))
|
||||
-#endif
|
||||
-
|
||||
-#ifdef CONFIG_GCOV_KERNEL
|
||||
-# if GCC_VERSION < 30400
|
||||
-# error "GCOV profiling support for gcc versions below 3.4 not included"
|
||||
-# endif /* __GNUC_MINOR__ */
|
||||
-#endif /* CONFIG_GCOV_KERNEL */
|
||||
--- a/include/linux/compiler-gcc4.h
|
||||
+++ /dev/null
|
||||
@@ -1,88 +0,0 @@
|
||||
-#ifndef __LINUX_COMPILER_H
|
||||
-#error "Please don't include <linux/compiler-gcc4.h> directly, include <linux/compiler.h> instead."
|
||||
-#endif
|
||||
-
|
||||
-/* GCC 4.1.[01] miscompiles __weak */
|
||||
-#ifdef __KERNEL__
|
||||
-# if GCC_VERSION >= 40100 && GCC_VERSION <= 40101
|
||||
-# error Your version of gcc miscompiles the __weak directive
|
||||
-# endif
|
||||
-#endif
|
||||
-
|
||||
-#define __used __attribute__((__used__))
|
||||
-#define __must_check __attribute__((warn_unused_result))
|
||||
-#define __compiler_offsetof(a,b) __builtin_offsetof(a,b)
|
||||
-
|
||||
-#if GCC_VERSION >= 40100 && GCC_VERSION < 40600
|
||||
-# define __compiletime_object_size(obj) __builtin_object_size(obj, 0)
|
||||
-#endif
|
||||
-
|
||||
-#if GCC_VERSION >= 40300
|
||||
-/* Mark functions as cold. gcc will assume any path leading to a call
|
||||
- to them will be unlikely. This means a lot of manual unlikely()s
|
||||
- are unnecessary now for any paths leading to the usual suspects
|
||||
- like BUG(), printk(), panic() etc. [but let's keep them for now for
|
||||
- older compilers]
|
||||
-
|
||||
- Early snapshots of gcc 4.3 don't support this and we can't detect this
|
||||
- in the preprocessor, but we can live with this because they're unreleased.
|
||||
- Maketime probing would be overkill here.
|
||||
-
|
||||
- gcc also has a __attribute__((__hot__)) to move hot functions into
|
||||
- a special section, but I don't see any sense in this right now in
|
||||
- the kernel context */
|
||||
-#define __cold __attribute__((__cold__))
|
||||
-
|
||||
-#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
|
||||
-
|
||||
-#ifndef __CHECKER__
|
||||
-# define __compiletime_warning(message) __attribute__((warning(message)))
|
||||
-# define __compiletime_error(message) __attribute__((error(message)))
|
||||
-#endif /* __CHECKER__ */
|
||||
-#endif /* GCC_VERSION >= 40300 */
|
||||
-
|
||||
-#if GCC_VERSION >= 40500
|
||||
-/*
|
||||
- * Mark a position in code as unreachable. This can be used to
|
||||
- * suppress control flow warnings after asm blocks that transfer
|
||||
- * control elsewhere.
|
||||
- *
|
||||
- * Early snapshots of gcc 4.5 don't support this and we can't detect
|
||||
- * this in the preprocessor, but we can live with this because they're
|
||||
- * unreleased. Really, we need to have autoconf for the kernel.
|
||||
- */
|
||||
-#define unreachable() __builtin_unreachable()
|
||||
-
|
||||
-/* Mark a function definition as prohibited from being cloned. */
|
||||
-#define __noclone __attribute__((__noclone__))
|
||||
-
|
||||
-#endif /* GCC_VERSION >= 40500 */
|
||||
-
|
||||
-#if GCC_VERSION >= 40600
|
||||
-/*
|
||||
- * Tell the optimizer that something else uses this function or variable.
|
||||
- */
|
||||
-#define __visible __attribute__((externally_visible))
|
||||
-#endif
|
||||
-
|
||||
-/*
|
||||
- * GCC 'asm goto' miscompiles certain code sequences:
|
||||
- *
|
||||
- * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670
|
||||
- *
|
||||
- * Work it around via a compiler barrier quirk suggested by Jakub Jelinek.
|
||||
- * Fixed in GCC 4.8.2 and later versions.
|
||||
- *
|
||||
- * (asm goto is automatically volatile - the naming reflects this.)
|
||||
- */
|
||||
-#define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0)
|
||||
-
|
||||
-#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP
|
||||
-#if GCC_VERSION >= 40400
|
||||
-#define __HAVE_BUILTIN_BSWAP32__
|
||||
-#define __HAVE_BUILTIN_BSWAP64__
|
||||
-#endif
|
||||
-#if GCC_VERSION >= 40800 || (defined(__powerpc__) && GCC_VERSION >= 40600)
|
||||
-#define __HAVE_BUILTIN_BSWAP16__
|
||||
-#endif
|
||||
-#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */
|
||||
--- a/include/linux/compiler-gcc5.h
|
||||
+++ /dev/null
|
||||
@@ -1,65 +0,0 @@
|
||||
-#ifndef __LINUX_COMPILER_H
|
||||
-#error "Please don't include <linux/compiler-gcc5.h> directly, include <linux/compiler.h> instead."
|
||||
-#endif
|
||||
-
|
||||
-#define __used __attribute__((__used__))
|
||||
-#define __must_check __attribute__((warn_unused_result))
|
||||
-#define __compiler_offsetof(a, b) __builtin_offsetof(a, b)
|
||||
-
|
||||
-/* Mark functions as cold. gcc will assume any path leading to a call
|
||||
- to them will be unlikely. This means a lot of manual unlikely()s
|
||||
- are unnecessary now for any paths leading to the usual suspects
|
||||
- like BUG(), printk(), panic() etc. [but let's keep them for now for
|
||||
- older compilers]
|
||||
-
|
||||
- Early snapshots of gcc 4.3 don't support this and we can't detect this
|
||||
- in the preprocessor, but we can live with this because they're unreleased.
|
||||
- Maketime probing would be overkill here.
|
||||
-
|
||||
- gcc also has a __attribute__((__hot__)) to move hot functions into
|
||||
- a special section, but I don't see any sense in this right now in
|
||||
- the kernel context */
|
||||
-#define __cold __attribute__((__cold__))
|
||||
-
|
||||
-#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
|
||||
-
|
||||
-#ifndef __CHECKER__
|
||||
-# define __compiletime_warning(message) __attribute__((warning(message)))
|
||||
-# define __compiletime_error(message) __attribute__((error(message)))
|
||||
-#endif /* __CHECKER__ */
|
||||
-
|
||||
-/*
|
||||
- * Mark a position in code as unreachable. This can be used to
|
||||
- * suppress control flow warnings after asm blocks that transfer
|
||||
- * control elsewhere.
|
||||
- *
|
||||
- * Early snapshots of gcc 4.5 don't support this and we can't detect
|
||||
- * this in the preprocessor, but we can live with this because they're
|
||||
- * unreleased. Really, we need to have autoconf for the kernel.
|
||||
- */
|
||||
-#define unreachable() __builtin_unreachable()
|
||||
-
|
||||
-/* Mark a function definition as prohibited from being cloned. */
|
||||
-#define __noclone __attribute__((__noclone__))
|
||||
-
|
||||
-/*
|
||||
- * Tell the optimizer that something else uses this function or variable.
|
||||
- */
|
||||
-#define __visible __attribute__((externally_visible))
|
||||
-
|
||||
-/*
|
||||
- * GCC 'asm goto' miscompiles certain code sequences:
|
||||
- *
|
||||
- * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670
|
||||
- *
|
||||
- * Work it around via a compiler barrier quirk suggested by Jakub Jelinek.
|
||||
- *
|
||||
- * (asm goto is automatically volatile - the naming reflects this.)
|
||||
- */
|
||||
-#define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0)
|
||||
-
|
||||
-#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP
|
||||
-#define __HAVE_BUILTIN_BSWAP32__
|
||||
-#define __HAVE_BUILTIN_BSWAP64__
|
||||
-#define __HAVE_BUILTIN_BSWAP16__
|
||||
-#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */
|
||||
--- a/include/linux/compiler-intel.h
|
||||
+++ b/include/linux/compiler-intel.h
|
||||
@@ -13,9 +13,14 @@
|
||||
/* Intel ECC compiler doesn't support gcc specific asm stmts.
|
||||
* It uses intrinsics to do the equivalent things.
|
||||
*/
|
||||
+#undef barrier
|
||||
+#undef barrier_data
|
||||
#undef RELOC_HIDE
|
||||
#undef OPTIMIZER_HIDE_VAR
|
||||
|
||||
+#define barrier() __memory_barrier()
|
||||
+#define barrier_data(ptr) barrier()
|
||||
+
|
||||
#define RELOC_HIDE(ptr, off) \
|
||||
({ unsigned long __ptr; \
|
||||
__ptr = (unsigned long) (ptr); \
|
||||
--- a/include/linux/compiler.h
|
||||
+++ b/include/linux/compiler.h
|
||||
@@ -17,6 +17,7 @@
|
||||
# define __release(x) __context__(x,-1)
|
||||
# define __cond_lock(x,c) ((c) ? ({ __acquire(x); 1; }) : 0)
|
||||
# define __percpu __attribute__((noderef, address_space(3)))
|
||||
+# define __pmem __attribute__((noderef, address_space(5)))
|
||||
#ifdef CONFIG_SPARSE_RCU_POINTER
|
||||
# define __rcu __attribute__((noderef, address_space(4)))
|
||||
#else
|
||||
@@ -42,6 +43,7 @@ extern void __chk_io_ptr(const volatile
|
||||
# define __cond_lock(x,c) (c)
|
||||
# define __percpu
|
||||
# define __rcu
|
||||
+# define __pmem
|
||||
#endif
|
||||
|
||||
/* Indirect macros required for expanded argument pasting, eg. __LINE__. */
|
||||
@@ -54,7 +56,11 @@ extern void __chk_io_ptr(const volatile
|
||||
#include <linux/compiler-gcc.h>
|
||||
#endif
|
||||
|
||||
+#if defined(CC_USING_HOTPATCH) && !defined(__CHECKER__)
|
||||
+#define notrace __attribute__((hotpatch(0,0)))
|
||||
+#else
|
||||
#define notrace __attribute__((no_instrument_function))
|
||||
+#endif
|
||||
|
||||
/* Intel compiler defines __GNUC__. So we will overwrite implementations
|
||||
* coming from above header files here
|
||||
@@ -138,7 +144,7 @@ void ftrace_likely_update(struct ftrace_
|
||||
*/
|
||||
#define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
|
||||
#define __trace_if(cond) \
|
||||
- if (__builtin_constant_p((cond)) ? !!(cond) : \
|
||||
+ if (__builtin_constant_p(!!(cond)) ? !!(cond) : \
|
||||
({ \
|
||||
int ______r; \
|
||||
static struct ftrace_branch_data \
|
||||
@@ -165,6 +171,10 @@ void ftrace_likely_update(struct ftrace_
|
||||
# define barrier() __memory_barrier()
|
||||
#endif
|
||||
|
||||
+#ifndef barrier_data
|
||||
+# define barrier_data(ptr) barrier()
|
||||
+#endif
|
||||
+
|
||||
/* Unreachable code */
|
||||
#ifndef unreachable
|
||||
# define unreachable() do { } while (1)
|
||||
@@ -186,6 +196,126 @@ void ftrace_likely_update(struct ftrace_
|
||||
# define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __LINE__)
|
||||
#endif
|
||||
|
||||
+#include <linux/types.h>
|
||||
+
|
||||
+#define __READ_ONCE_SIZE \
|
||||
+({ \
|
||||
+ switch (size) { \
|
||||
+ case 1: *(__u8 *)res = *(volatile __u8 *)p; break; \
|
||||
+ case 2: *(__u16 *)res = *(volatile __u16 *)p; break; \
|
||||
+ case 4: *(__u32 *)res = *(volatile __u32 *)p; break; \
|
||||
+ case 8: *(__u64 *)res = *(volatile __u64 *)p; break; \
|
||||
+ default: \
|
||||
+ barrier(); \
|
||||
+ __builtin_memcpy((void *)res, (const void *)p, size); \
|
||||
+ barrier(); \
|
||||
+ } \
|
||||
+})
|
||||
+
|
||||
+static __always_inline
|
||||
+void __read_once_size(const volatile void *p, void *res, int size)
|
||||
+{
|
||||
+ __READ_ONCE_SIZE;
|
||||
+}
|
||||
+
|
||||
+#ifdef CONFIG_KASAN
|
||||
+/*
|
||||
+ * This function is not 'inline' because __no_sanitize_address confilcts
|
||||
+ * with inlining. Attempt to inline it may cause a build failure.
|
||||
+ * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67368
|
||||
+ * '__maybe_unused' allows us to avoid defined-but-not-used warnings.
|
||||
+ */
|
||||
+static __no_sanitize_address __maybe_unused
|
||||
+void __read_once_size_nocheck(const volatile void *p, void *res, int size)
|
||||
+{
|
||||
+ __READ_ONCE_SIZE;
|
||||
+}
|
||||
+#else
|
||||
+static __always_inline
|
||||
+void __read_once_size_nocheck(const volatile void *p, void *res, int size)
|
||||
+{
|
||||
+ __READ_ONCE_SIZE;
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
+static __always_inline void __write_once_size(volatile void *p, void *res, int size)
|
||||
+{
|
||||
+ switch (size) {
|
||||
+ case 1: *(volatile __u8 *)p = *(__u8 *)res; break;
|
||||
+ case 2: *(volatile __u16 *)p = *(__u16 *)res; break;
|
||||
+ case 4: *(volatile __u32 *)p = *(__u32 *)res; break;
|
||||
+ case 8: *(volatile __u64 *)p = *(__u64 *)res; break;
|
||||
+ default:
|
||||
+ barrier();
|
||||
+ __builtin_memcpy((void *)p, (const void *)res, size);
|
||||
+ barrier();
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * Prevent the compiler from merging or refetching reads or writes. The
|
||||
+ * compiler is also forbidden from reordering successive instances of
|
||||
+ * READ_ONCE, WRITE_ONCE and ACCESS_ONCE (see below), but only when the
|
||||
+ * compiler is aware of some particular ordering. One way to make the
|
||||
+ * compiler aware of ordering is to put the two invocations of READ_ONCE,
|
||||
+ * WRITE_ONCE or ACCESS_ONCE() in different C statements.
|
||||
+ *
|
||||
+ * In contrast to ACCESS_ONCE these two macros will also work on aggregate
|
||||
+ * data types like structs or unions. If the size of the accessed data
|
||||
+ * type exceeds the word size of the machine (e.g., 32 bits or 64 bits)
|
||||
+ * READ_ONCE() and WRITE_ONCE() will fall back to memcpy and print a
|
||||
+ * compile-time warning.
|
||||
+ *
|
||||
+ * Their two major use cases are: (1) Mediating communication between
|
||||
+ * process-level code and irq/NMI handlers, all running on the same CPU,
|
||||
+ * and (2) Ensuring that the compiler does not fold, spindle, or otherwise
|
||||
+ * mutilate accesses that either do not require ordering or that interact
|
||||
+ * with an explicit memory barrier or atomic instruction that provides the
|
||||
+ * required ordering.
|
||||
+ */
|
||||
+
|
||||
+#define __READ_ONCE(x, check) \
|
||||
+({ \
|
||||
+ union { typeof(x) __val; char __c[1]; } __u; \
|
||||
+ if (check) \
|
||||
+ __read_once_size(&(x), __u.__c, sizeof(x)); \
|
||||
+ else \
|
||||
+ __read_once_size_nocheck(&(x), __u.__c, sizeof(x)); \
|
||||
+ __u.__val; \
|
||||
+})
|
||||
+#define READ_ONCE(x) __READ_ONCE(x, 1)
|
||||
+
|
||||
+/*
|
||||
+ * Use READ_ONCE_NOCHECK() instead of READ_ONCE() if you need
|
||||
+ * to hide memory access from KASAN.
|
||||
+ */
|
||||
+#define READ_ONCE_NOCHECK(x) __READ_ONCE(x, 0)
|
||||
+
|
||||
+#define WRITE_ONCE(x, val) \
|
||||
+({ \
|
||||
+ union { typeof(x) __val; char __c[1]; } __u = \
|
||||
+ { .__val = (__force typeof(x)) (val) }; \
|
||||
+ __write_once_size(&(x), __u.__c, sizeof(x)); \
|
||||
+ __u.__val; \
|
||||
+})
|
||||
+
|
||||
+/**
|
||||
+ * smp_cond_acquire() - Spin wait for cond with ACQUIRE ordering
|
||||
+ * @cond: boolean expression to wait for
|
||||
+ *
|
||||
+ * Equivalent to using smp_load_acquire() on the condition variable but employs
|
||||
+ * the control dependency of the wait to reduce the barrier on many platforms.
|
||||
+ *
|
||||
+ * The control dependency provides a LOAD->STORE order, the additional RMB
|
||||
+ * provides LOAD->LOAD order, together they provide LOAD->{LOAD,STORE} order,
|
||||
+ * aka. ACQUIRE.
|
||||
+ */
|
||||
+#define smp_cond_acquire(cond) do { \
|
||||
+ while (!(cond)) \
|
||||
+ cpu_relax(); \
|
||||
+ smp_rmb(); /* ctrl + rmb := acquire */ \
|
||||
+} while (0)
|
||||
+
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
@@ -304,6 +434,14 @@ void ftrace_likely_update(struct ftrace_
|
||||
#define __visible
|
||||
#endif
|
||||
|
||||
+/*
|
||||
+ * Assume alignment of return value.
|
||||
+ */
|
||||
+#ifndef __assume_aligned
|
||||
+#define __assume_aligned(a, ...)
|
||||
+#endif
|
||||
+
|
||||
+
|
||||
/* Are two types/vars the same type (ignoring qualifiers)? */
|
||||
#ifndef __same_type
|
||||
# define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
|
||||
@@ -311,7 +449,7 @@ void ftrace_likely_update(struct ftrace_
|
||||
|
||||
/* Is this type a native word size -- useful for atomic operations */
|
||||
#ifndef __native_word
|
||||
-# define __native_word(t) (sizeof(t) == sizeof(int) || sizeof(t) == sizeof(long))
|
||||
+# define __native_word(t) (sizeof(t) == sizeof(char) || sizeof(t) == sizeof(short) || sizeof(t) == sizeof(int) || sizeof(t) == sizeof(long))
|
||||
#endif
|
||||
|
||||
/* Compile time object size, -1 for unknown */
|
||||
@@ -373,12 +511,38 @@ void ftrace_likely_update(struct ftrace_
|
||||
* to make the compiler aware of ordering is to put the two invocations of
|
||||
* ACCESS_ONCE() in different C statements.
|
||||
*
|
||||
- * This macro does absolutely -nothing- to prevent the CPU from reordering,
|
||||
- * merging, or refetching absolutely anything at any time. Its main intended
|
||||
- * use is to mediate communication between process-level code and irq/NMI
|
||||
- * handlers, all running on the same CPU.
|
||||
+ * ACCESS_ONCE will only work on scalar types. For union types, ACCESS_ONCE
|
||||
+ * on a union member will work as long as the size of the member matches the
|
||||
+ * size of the union and the size is smaller than word size.
|
||||
+ *
|
||||
+ * The major use cases of ACCESS_ONCE used to be (1) Mediating communication
|
||||
+ * between process-level code and irq/NMI handlers, all running on the same CPU,
|
||||
+ * and (2) Ensuring that the compiler does not fold, spindle, or otherwise
|
||||
+ * mutilate accesses that either do not require ordering or that interact
|
||||
+ * with an explicit memory barrier or atomic instruction that provides the
|
||||
+ * required ordering.
|
||||
+ *
|
||||
+ * If possible use READ_ONCE()/WRITE_ONCE() instead.
|
||||
*/
|
||||
-#define ACCESS_ONCE(x) (*(volatile typeof(x) *)&(x))
|
||||
+#define __ACCESS_ONCE(x) ({ \
|
||||
+ __maybe_unused typeof(x) __var = (__force typeof(x)) 0; \
|
||||
+ (volatile typeof(x) *)&(x); })
|
||||
+#define ACCESS_ONCE(x) (*__ACCESS_ONCE(x))
|
||||
+
|
||||
+/**
|
||||
+ * lockless_dereference() - safely load a pointer for later dereference
|
||||
+ * @p: The pointer to load
|
||||
+ *
|
||||
+ * Similar to rcu_dereference(), but for situations where the pointed-to
|
||||
+ * object's lifetime is managed by something other than RCU. That
|
||||
+ * "something other" might be reference counting or simple immortality.
|
||||
+ */
|
||||
+#define lockless_dereference(p) \
|
||||
+({ \
|
||||
+ typeof(p) _________p1 = READ_ONCE(p); \
|
||||
+ smp_read_barrier_depends(); /* Dependency order vs. p above. */ \
|
||||
+ (_________p1); \
|
||||
+})
|
||||
|
||||
/* Ignore/forbid kprobes attach on very low level functions marked by this attribute: */
|
||||
#ifdef CONFIG_KPROBES
|
@ -0,0 +1,26 @@
|
||||
--- a/board/solidrun/mx6cuboxi/mx6cuboxi.c
|
||||
+++ b/board/solidrun/mx6cuboxi/mx6cuboxi.c
|
||||
@@ -334,6 +334,12 @@ int board_init(void)
|
||||
return ret;
|
||||
}
|
||||
|
||||
+void board_boot_order(u32 *spl_boot_list)
|
||||
+{
|
||||
+ spl_boot_list[0] = spl_boot_device();
|
||||
+ spl_boot_list[1] = BOOT_DEVICE_MMC1;
|
||||
+}
|
||||
+
|
||||
static bool is_hummingboard(void)
|
||||
{
|
||||
int val1, val2;
|
||||
--- a/arch/arm/mach-imx/spl.c
|
||||
+++ b/arch/arm/mach-imx/spl.c
|
||||
@@ -136,7 +136,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:
|
@ -1,89 +0,0 @@
|
||||
--- a/include/configs/wandboard.h
|
||||
+++ b/include/configs/wandboard.h
|
||||
@@ -49,7 +49,7 @@
|
||||
#define CONFIG_CMD_BMODE
|
||||
#define CONFIG_CMD_SETEXPR
|
||||
|
||||
-#define CONFIG_BOOTDELAY 5
|
||||
+#define CONFIG_BOOTDELAY 3
|
||||
|
||||
#define CONFIG_SYS_MEMTEST_START 0x10000000
|
||||
#define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MEMTEST_START + 500 * SZ_1M)
|
||||
@@ -102,13 +102,15 @@
|
||||
|
||||
#if defined(CONFIG_MX6DL) || defined(CONFIG_MX6S)
|
||||
#define CONFIG_DEFAULT_FDT_FILE "imx6dl-wandboard.dtb"
|
||||
+#define CONFIG_OWRT_NAME "openwrt-imx6-imx6dl-wandboard-fit-uImage.itb"
|
||||
#elif defined(CONFIG_MX6Q)
|
||||
#define CONFIG_DEFAULT_FDT_FILE "imx6q-wandboard.dtb"
|
||||
+#define CONFIG_OWRT_NAME "openwrt-imx6-imx6q-wandboard-fit-uImage.itb"
|
||||
#endif
|
||||
|
||||
#define CONFIG_EXTRA_ENV_SETTINGS \
|
||||
"script=boot.scr\0" \
|
||||
- "image=zImage\0" \
|
||||
+ "image=" CONFIG_OWRT_NAME "\0" \
|
||||
"console=ttymxc0\0" \
|
||||
"splashpos=m,m\0" \
|
||||
"fdt_high=0xffffffff\0" \
|
||||
@@ -137,11 +139,11 @@
|
||||
"mmcargs=setenv bootargs console=${console},${baudrate} " \
|
||||
"root=${mmcroot}\0" \
|
||||
"loadbootscript=" \
|
||||
- "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
|
||||
+ "ext2load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
|
||||
"bootscript=echo Running bootscript from mmc ...; " \
|
||||
"source\0" \
|
||||
- "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
|
||||
- "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
|
||||
+ "loaduimage=ext2load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${uimage}\0" \
|
||||
+ "loadfdt=ext2load mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
|
||||
"mmcboot=echo Booting from mmc ...; " \
|
||||
"run mmcargs; " \
|
||||
"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
|
||||
@@ -155,31 +157,7 @@
|
||||
"fi; " \
|
||||
"fi; " \
|
||||
"else " \
|
||||
- "bootz; " \
|
||||
- "fi;\0" \
|
||||
- "netargs=setenv bootargs console=${console},${baudrate} " \
|
||||
- "root=/dev/nfs " \
|
||||
- "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
|
||||
- "netboot=echo Booting from net ...; " \
|
||||
- "run netargs; " \
|
||||
- "if test ${ip_dyn} = yes; then " \
|
||||
- "setenv get_cmd dhcp; " \
|
||||
- "else " \
|
||||
- "setenv get_cmd tftp; " \
|
||||
- "fi; " \
|
||||
- "${get_cmd} ${image}; " \
|
||||
- "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
|
||||
- "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
|
||||
- "bootz ${loadaddr} - ${fdt_addr}; " \
|
||||
- "else " \
|
||||
- "if test ${boot_fdt} = try; then " \
|
||||
- "bootz; " \
|
||||
- "else " \
|
||||
- "echo WARN: Cannot load the DT; " \
|
||||
- "fi; " \
|
||||
- "fi; " \
|
||||
- "else " \
|
||||
- "bootz; " \
|
||||
+ "bootm; " \
|
||||
"fi;\0"
|
||||
|
||||
#define CONFIG_BOOTCOMMAND \
|
||||
@@ -189,10 +167,10 @@
|
||||
"else " \
|
||||
"if run loadimage; then " \
|
||||
"run mmcboot; " \
|
||||
- "else run netboot; " \
|
||||
+ "else echo WARN: Can not boot the image; " \
|
||||
"fi; " \
|
||||
"fi; " \
|
||||
- "else run netboot; fi"
|
||||
+ "fi"
|
||||
|
||||
/* Miscellaneous configurable options */
|
||||
#define CONFIG_SYS_LONGHELP
|
@ -28,20 +28,20 @@ NOTE: this patch is ready for upstream, LEDE-specific parts are in
|
||||
@@ -56,6 +56,9 @@ config TARGET_GOFLEXHOME
|
||||
config TARGET_NAS220
|
||||
bool "BlackArmor NAS220"
|
||||
|
||||
|
||||
+config TARGET_NSA310
|
||||
+ bool "Zyxel NSA310 Board"
|
||||
+
|
||||
config TARGET_NSA310S
|
||||
bool "Zyxel NSA310S"
|
||||
|
||||
|
||||
@@ -80,6 +83,7 @@ source "board/raidsonic/ib62x0/Kconfig"
|
||||
source "board/Seagate/dockstar/Kconfig"
|
||||
source "board/Seagate/goflexhome/Kconfig"
|
||||
source "board/Seagate/nas220/Kconfig"
|
||||
+source "board/zyxel/nsa310/Kconfig"
|
||||
source "board/zyxel/nsa310s/Kconfig"
|
||||
|
||||
|
||||
endif
|
||||
--- /dev/null
|
||||
+++ b/board/zyxel/nsa310/Kconfig
|
||||
|
@ -3,19 +3,19 @@
|
||||
@@ -62,6 +62,9 @@ config TARGET_NSA310
|
||||
config TARGET_NSA310S
|
||||
bool "Zyxel NSA310S"
|
||||
|
||||
|
||||
+config TARGET_NSA325
|
||||
+ bool "Zyxel NSA325 board"
|
||||
+
|
||||
endchoice
|
||||
|
||||
|
||||
config SYS_SOC
|
||||
@@ -85,5 +88,6 @@ source "board/Seagate/goflexhome/Kconfig
|
||||
source "board/Seagate/nas220/Kconfig"
|
||||
source "board/zyxel/nsa310/Kconfig"
|
||||
source "board/zyxel/nsa310s/Kconfig"
|
||||
+source "board/zyxel/nsa325/Kconfig"
|
||||
|
||||
|
||||
endif
|
||||
--- /dev/null
|
||||
+++ b/board/zyxel/nsa325/Kconfig
|
||||
|
@ -3,13 +3,13 @@
|
||||
@@ -25,6 +25,9 @@ config TARGET_LSXL
|
||||
config TARGET_POGO_E02
|
||||
bool "pogo_e02 Board"
|
||||
|
||||
|
||||
+config TARGET_POGOPLUGV4
|
||||
+ bool "Pogoplug V4 Board"
|
||||
+
|
||||
config TARGET_DNS325
|
||||
bool "dns325 Board"
|
||||
|
||||
|
||||
@@ -77,6 +80,7 @@ source "board/Marvell/guruplug/Kconfig"
|
||||
source "board/Marvell/sheevaplug/Kconfig"
|
||||
source "board/buffalo/lsxl/Kconfig"
|
||||
@ -22,11 +22,11 @@
|
||||
+++ b/arch/arm/mach-kirkwood/include/mach/kw88f6192.h
|
||||
@@ -16,6 +16,6 @@
|
||||
#define KW_REGS_PHY_BASE KW88F6192_REGS_PHYS_BASE
|
||||
|
||||
|
||||
/* TCLK Core Clock defination */
|
||||
-#define CONFIG_SYS_TCLK 166000000 /* 166MHz */
|
||||
+#define CONFIG_SYS_TCLK 166666667 /* 166MHz */
|
||||
|
||||
|
||||
#endif /* _CONFIG_KW88F6192_H */
|
||||
--- a/arch/arm/mach-kirkwood/include/mach/mpp.h
|
||||
+++ b/arch/arm/mach-kirkwood/include/mach/mpp.h
|
||||
@ -35,12 +35,12 @@
|
||||
#define MPP33_TDM_DTX MPP( 33, 0x2, 0, 1, 0, 0, 1, 1 )
|
||||
#define MPP33_GE1_13 MPP( 33, 0x3, 0, 0, 0, 1, 1, 1 )
|
||||
+#define MPP33_SATA1_ACTn MPP( 33, 0x5, 0, 1, 0, 1, 1, 1 )
|
||||
|
||||
|
||||
#define MPP34_GPIO MPP( 34, 0x0, 1, 1, 0, 1, 1, 1 )
|
||||
#define MPP34_TDM_SPI_CS1 MPP( 34, 0x2, 0, 1, 0, 0, 1, 1 )
|
||||
#define MPP34_GE1_14 MPP( 34, 0x3, 0, 0, 0, 1, 1, 1 )
|
||||
+#define MPP34_SATA1_ACTn MPP( 34, 0x5, 0, 1, 0, 1, 1, 1 )
|
||||
|
||||
|
||||
#define MPP35_GPIO MPP( 35, 0x0, 1, 1, 1, 1, 1, 1 )
|
||||
#define MPP35_TDM_CH0_TX_QL MPP( 35, 0x2, 0, 1, 0, 0, 1, 1 )
|
||||
--- /dev/null
|
||||
@ -619,7 +619,7 @@
|
||||
obj-$(CONFIG_MMC_SDHCI_XENON) += xenon_sdhci.o
|
||||
obj-$(CONFIG_MMC_SDHCI_ZYNQ) += zynq_sdhci.o
|
||||
+obj-$(CONFIG_KIRKWOOD_MMC) += kirkwood_mmc.o
|
||||
|
||||
|
||||
obj-$(CONFIG_MMC_SUNXI) += sunxi_mmc.o
|
||||
obj-$(CONFIG_MMC_UNIPHIER) += uniphier-sd.o
|
||||
--- /dev/null
|
||||
@ -1112,7 +1112,7 @@
|
||||
@@ -117,4 +117,10 @@
|
||||
#define CONFIG_MTD_PARTITIONS
|
||||
#endif
|
||||
|
||||
|
||||
+/*
|
||||
+ * Kirkwood MMC
|
||||
+ */
|
||||
|
@ -5,7 +5,7 @@
|
||||
#define CONFIG_KW88F6281 1 /* SOC Name */
|
||||
#define CONFIG_SKIP_LOWLEVEL_INIT /* disable board lowlevel_init */
|
||||
+#define CONFIG_SYS_MVFS
|
||||
|
||||
|
||||
/*
|
||||
* mv-common.h should be defined after CMD configs since it used them
|
||||
@@ -36,27 +37,22 @@
|
||||
@ -15,7 +15,7 @@
|
||||
-#define CONFIG_ENV_ADDR 0x80000
|
||||
-#define CONFIG_ENV_OFFSET 0x80000 /* env starts here */
|
||||
+#define CONFIG_ENV_OFFSET 0xe0000 /* env starts here */
|
||||
|
||||
|
||||
/*
|
||||
* Default environment variables
|
||||
*/
|
||||
@ -29,7 +29,7 @@
|
||||
+ "ubi part ubi; " \
|
||||
+ "ubi read 0x800000 kernel; " \
|
||||
+ "bootm 0x800000"
|
||||
|
||||
|
||||
#define CONFIG_EXTRA_ENV_SETTINGS \
|
||||
- "console=console=ttyS0,115200\0" \
|
||||
- "mtdids=nand0=orion_nand\0" \
|
||||
@ -41,7 +41,7 @@
|
||||
+ "mtdids=nand0=orion_nand\0" \
|
||||
+ "mtdparts="CONFIG_MTDPARTS_DEFAULT "\0" \
|
||||
+ "bootargs_root=\0"
|
||||
|
||||
|
||||
/*
|
||||
* Ethernet Driver configuration
|
||||
--- a/configs/dockstar_defconfig
|
||||
|
@ -6,7 +6,7 @@
|
||||
#define CONFIG_ENV_SIZE 0x20000
|
||||
-#define CONFIG_ENV_OFFSET 0x80000
|
||||
+#define CONFIG_ENV_OFFSET 0xe0000
|
||||
|
||||
|
||||
/*
|
||||
* Default environment variables
|
||||
*/
|
||||
@ -18,7 +18,7 @@
|
||||
+ "ubi part ubi; " \
|
||||
+ "ubi read 0x800000 kernel; " \
|
||||
"bootm 0x800000"
|
||||
|
||||
|
||||
#define CONFIG_EXTRA_ENV_SETTINGS \
|
||||
"console=console=ttyS0,115200\0" \
|
||||
"mtdids=nand0=orion_nand\0" \
|
||||
@ -27,7 +27,7 @@
|
||||
- "bootargs_root=noinitrd ubi.mtd=2 root=ubi0:rootfs rootfstype=ubifs\0"
|
||||
+ "mtdparts="CONFIG_MTDPARTS_DEFAULT "\0" \
|
||||
+ "bootargs_root=\0"
|
||||
|
||||
|
||||
/*
|
||||
* Ethernet driver configuration
|
||||
--- a/configs/iconnect_defconfig
|
||||
|
@ -14,7 +14,7 @@
|
||||
+ "ubi part ubi; " \
|
||||
+ "ubi read 0x800000 kernel; " \
|
||||
+ "bootm 0x800000"
|
||||
|
||||
|
||||
#define CONFIG_EXTRA_ENV_SETTINGS \
|
||||
"console=console=ttyS0,115200\0" \
|
||||
"mtdids=nand0=orion_nand\0" \
|
||||
@ -24,7 +24,7 @@
|
||||
- "bootargs_root=ubi.mtd=2 root=ubi0:rootfs rootfstype=ubifs rw\0"
|
||||
+ "mtdparts="CONFIG_MTDPARTS_DEFAULT "\0" \
|
||||
+ "bootargs_root=\0"
|
||||
|
||||
|
||||
/*
|
||||
* Ethernet driver configuration
|
||||
--- a/configs/ib62x0_defconfig
|
||||
|
@ -2,11 +2,11 @@
|
||||
+++ b/include/configs/pogo_e02.h
|
||||
@@ -44,23 +44,23 @@
|
||||
#endif
|
||||
|
||||
|
||||
#define CONFIG_ENV_SIZE 0x20000 /* 128k */
|
||||
-#define CONFIG_ENV_OFFSET 0x60000 /* env starts here */
|
||||
+#define CONFIG_ENV_OFFSET 0xe0000 /* env starts here */
|
||||
|
||||
|
||||
/*
|
||||
* Default environment variables
|
||||
*/
|
||||
@ -19,7 +19,7 @@
|
||||
+ "ubifsmount ubi:rootfs; " \
|
||||
+ "ubi read 0x800000 kernel; " \
|
||||
+ "bootm 0x800000"
|
||||
|
||||
|
||||
#define CONFIG_EXTRA_ENV_SETTINGS \
|
||||
- "mtdparts=mtdparts=orion_nand:1M(u-boot),4M(uImage)," \
|
||||
- "32M(rootfs),-(data)\0"\
|
||||
@ -31,7 +31,7 @@
|
||||
+ "mtdids=nand0=orion_nand\0" \
|
||||
+ "mtdparts="CONFIG_MTDPARTS_DEFAULT "\0" \
|
||||
+ "bootargs_root=\0"
|
||||
|
||||
|
||||
/*
|
||||
* Ethernet Driver configuration
|
||||
--- a/configs/pogo_e02_defconfig
|
||||
|
@ -10,7 +10,7 @@
|
||||
+ "ubi part ubi; " \
|
||||
+ "ubi read 0x800000 kernel; " \
|
||||
"bootm 0x800000"
|
||||
|
||||
|
||||
#define CONFIG_EXTRA_ENV_SETTINGS \
|
||||
"console=console=ttyS0,115200\0" \
|
||||
"mtdids=nand0=orion_nand\0" \
|
||||
@ -19,7 +19,7 @@
|
||||
- "bootargs_root=ubi.mtd=root root=ubi0:root rootfstype=ubifs ro\0"
|
||||
+ "mtdparts="CONFIG_MTDPARTS_DEFAULT "\0" \
|
||||
+ "bootargs_root=\0"
|
||||
|
||||
|
||||
/*
|
||||
* Ethernet Driver configuration
|
||||
--- a/configs/goflexhome_defconfig
|
||||
|
@ -0,0 +1,19 @@
|
||||
--- a/include/libfdt_env.h
|
||||
+++ b/include/libfdt_env.h
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
#ifndef _LIBFDT_ENV_H
|
||||
#define _LIBFDT_ENV_H
|
||||
+#define LIBFDT_ENV_H
|
||||
|
||||
#include "compiler.h"
|
||||
#include "linux/types.h"
|
||||
--- a/include/libfdt.h
|
||||
+++ b/include/libfdt.h
|
||||
@@ -1,5 +1,6 @@
|
||||
#ifndef _LIBFDT_H
|
||||
#define _LIBFDT_H
|
||||
+#define LIBFDT_H
|
||||
/*
|
||||
* libfdt - Flat Device Tree manipulation
|
||||
* Copyright (C) 2006 David Gibson, IBM Corporation.
|
@ -8,7 +8,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=uboot-layerscape-armv8_32b
|
||||
PKG_SOURCE_DATE:=2018-01-22
|
||||
PKG_VERSION:=lsdk-1806
|
||||
PKG_RELEASE:=1
|
||||
|
||||
# Layerscape ARMv8 platforms use 64-bit u-boot to support both 32-bit and 64-bit
|
||||
@ -17,37 +17,68 @@ PKG_RELEASE:=1
|
||||
# uboot-layerscape's source code.
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/yangbolu1991/u-boot-lede.git
|
||||
PKG_SOURCE_VERSION:=40a40dfd8136fcc314dd442a3b24a41b1e5652dd
|
||||
PKG_MIRROR_HASH:=3dde5a33d19c573cbdce74f5d7edb6c5ca2a26a39d503c3efe5d5ad06f01e9f5
|
||||
|
||||
PKG_MAINTAINER:=Yangbo Lu <yangbo.lu@nxp.com>
|
||||
PKG_SOURCE_VERSION:=a2a01facee0918bf724b4f0aec6746e2f1271519
|
||||
PKG_MIRROR_HASH:=5fcb58c14cdc934793ff315e178ad1d9d2ff55fcaac394b48ec116d1b11ca324
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
define Package/uboot-layerscape-armv8_32b
|
||||
SECTION:=boot
|
||||
CATEGORY:=Boot Loaders
|
||||
DEPENDS:=@TARGET_layerscape_armv8_32b
|
||||
TITLE:=U-Boot for ARMv8 32-bit based Layerscape boards
|
||||
DEFAULT:=y
|
||||
HIDDEN:=1
|
||||
define Package/uboot-layerscape-armv8_32b/Config
|
||||
define Package/u-boot-$(1)-image
|
||||
SECTION:=boot
|
||||
CATEGORY:=Boot Loaders
|
||||
TITLE:=$(2)
|
||||
DEPENDS:=@TARGET_layerscape_armv8_32b
|
||||
CONFIG:=$(3)
|
||||
ENV_SIZE:=$(4)
|
||||
endef
|
||||
endef
|
||||
|
||||
define Build/Configure
|
||||
define Package/uboot-layerscape-armv8_32b/ls1012ardb
|
||||
TITLE:=U-Boot image for NXP LS1012ARDB
|
||||
CONFIG:=ls1012ardb-uboot.bin
|
||||
ENV_SIZE:=0x40000
|
||||
endef
|
||||
|
||||
define Package/uboot-layerscape-armv8_32b/ls1012afrwy
|
||||
TITLE:=U-Boot image for NXP LS1012FRWY
|
||||
CONFIG:=ls1012afrwy-uboot.bin
|
||||
ENV_SIZE:=0x10000
|
||||
endef
|
||||
|
||||
define Package/uboot-layerscape-armv8_32b/ls1043ardb
|
||||
TITLE:=U-Boot image for NXP LS1043ARDB
|
||||
CONFIG:=ls1043ardb-uboot.bin
|
||||
ENV_SIZE:=0x20000
|
||||
endef
|
||||
|
||||
define Package/uboot-layerscape-armv8_32b/ls1046ardb
|
||||
TITLE:=U-Boot image for NXP LS1046ARDB
|
||||
CONFIG:=ls1046ardb-uboot.bin
|
||||
ENV_SIZE:=0x2000
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
define Package/uboot-layerscape-armv8_32b/Install
|
||||
define Package/u-boot-$(1)-image/install
|
||||
$(INSTALL_DIR) $(STAGING_DIR_IMAGE)
|
||||
$(CP) $(PKG_BUILD_DIR)/ls1043ardb-uboot.bin $(STAGING_DIR_IMAGE)/ls1043ardb-armv8_32b-uboot.bin
|
||||
$(CP) $(PKG_BUILD_DIR)/ls1046ardb-uboot.bin $(STAGING_DIR_IMAGE)/ls1046ardb-armv8_32b-uboot.bin
|
||||
$(CP) $(PKG_BUILD_DIR)/ls1012ardb-uboot.bin $(STAGING_DIR_IMAGE)/ls1012ardb-armv8_32b-uboot.bin
|
||||
$(CP) $(PKG_BUILD_DIR)/ls1012afrdm-uboot.bin $(STAGING_DIR_IMAGE)/ls1012afrdm-armv8_32b-uboot.bin
|
||||
$(CP) $(PKG_BUILD_DIR)/$(CONFIG) $(STAGING_DIR_IMAGE)/
|
||||
$(PKG_BUILD_DIR)/tools/mkenvimage -s $(ENV_SIZE) \
|
||||
-o $(STAGING_DIR_IMAGE)/$(1)-uboot-env.bin \
|
||||
../uboot-layerscape/files/$(1)-uEnv.txt
|
||||
endef
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,uboot-layerscape-armv8_32b))
|
||||
UBOOTS := \
|
||||
ls1012ardb \
|
||||
ls1012afrwy \
|
||||
ls1043ardb \
|
||||
ls1046ardb
|
||||
|
||||
$(foreach u,$(UBOOTS), \
|
||||
$(eval $(Package/uboot-layerscape-armv8_32b/$(u))) \
|
||||
$(eval $(call Package/uboot-layerscape-armv8_32b/Config,$(u),$(TITLE),$(CONFIG),$(ENV_SIZE))) \
|
||||
$(eval $(call Package/uboot-layerscape-armv8_32b/Install,$(u))) \
|
||||
$(eval $(call BuildPackage,u-boot-$(u)-image)) \
|
||||
)
|
||||
|
@ -6,16 +6,15 @@
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=uboot-layerscape
|
||||
PKG_SOURCE_DATE:=2017-12-07
|
||||
PKG_VERSION:=lsdk-1806
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/qoriq-open-source/u-boot.git
|
||||
PKG_SOURCE_VERSION:=9f7df1b406ff11409021cd2112beedd6b57bb600
|
||||
PKG_MIRROR_HASH:=b3756f814b731af2d03b0582ece90b2de564955b778f341fbfc34fa9bd849819
|
||||
PKG_SOURCE_URL:=https://source.codeaurora.org/external/qoriq/qoriq-components/u-boot
|
||||
PKG_SOURCE_VERSION:=b3f98d438eefd1b355efdec0b50af5813ff8d0e1
|
||||
PKG_MIRROR_HASH:=59e35957055658e7fdefb16b92f954356985a8191942d93f254861c75c47b32b
|
||||
|
||||
include $(INCLUDE_DIR)/u-boot.mk
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
@ -25,49 +24,104 @@ define U-Boot/Default
|
||||
BUILD_SUBTARGET:=armv8_64b
|
||||
BUILD_DEVICES:=$(1)
|
||||
UBOOT_IMAGE:=u-boot-dtb.bin
|
||||
HIDDEN:=y
|
||||
endef
|
||||
|
||||
define U-Boot/ls1043ardb
|
||||
NAME:=NXP ls1043ardb 64b Dev Board
|
||||
endef
|
||||
|
||||
define U-Boot/ls1046ardb
|
||||
NAME:=NXP ls1046ardb 64b Dev Board
|
||||
UBOOT_CONFIG:=ls1046ardb_qspi
|
||||
ENV_SIZE:=0x2000
|
||||
endef
|
||||
|
||||
define U-Boot/ls1012ardb
|
||||
NAME:=NXP ls1012ardb 64b Dev Board
|
||||
NAME:=NXP LS1012ARDB
|
||||
UBOOT_CONFIG:=ls1012ardb_qspi
|
||||
ENV_SIZE:=0x40000
|
||||
endef
|
||||
|
||||
define U-Boot/ls1012afrwy
|
||||
NAME:=NXP LS1012AFRWY
|
||||
UBOOT_CONFIG:=ls1012afrwy_qspi
|
||||
ENV_SIZE:=0x10000
|
||||
endef
|
||||
|
||||
define U-Boot/ls1043ardb
|
||||
NAME:=NXP LS1043ARDB
|
||||
ENV_SIZE:=0x20000
|
||||
endef
|
||||
|
||||
define U-Boot/ls1043ardb-sdboot
|
||||
NAME:=NXP LS1043ARDB SD Card Boot
|
||||
UBOOT_CONFIG:=ls1043ardb_sdcard
|
||||
UBOOT_IMAGE:=u-boot-with-spl-pbl.bin
|
||||
endef
|
||||
|
||||
define U-Boot/ls1046ardb
|
||||
NAME:=NXP LS1046ARDB
|
||||
UBOOT_CONFIG:=ls1046ardb_qspi
|
||||
endef
|
||||
|
||||
define U-Boot/ls1046ardb-sdboot
|
||||
NAME:=NXP LS1046ARDB SD Card Boot
|
||||
UBOOT_CONFIG:=ls1046ardb_sdcard
|
||||
UBOOT_IMAGE:=u-boot-with-spl-pbl.bin
|
||||
endef
|
||||
|
||||
define U-Boot/ls1088ardb
|
||||
NAME:=NXP ls1088ardb 64b Dev Board
|
||||
NAME:=NXP LS1088ARDB
|
||||
UBOOT_CONFIG:=ls1088ardb_qspi
|
||||
endef
|
||||
|
||||
define U-Boot/ls1088ardb-sdboot
|
||||
NAME:=NXP LS1088ARDB SD Card Boot
|
||||
UBOOT_CONFIG:=ls1088ardb_sdcard_qspi
|
||||
UBOOT_IMAGE:=u-boot-with-spl.bin
|
||||
endef
|
||||
|
||||
define U-Boot/ls2088ardb
|
||||
NAME:=NXP ls2088ardb 64b Dev Board
|
||||
NAME:=NXP LS2088ARDB
|
||||
UBOOT_CONFIG:=ls2080ardb
|
||||
endef
|
||||
|
||||
define U-Boot/ls1012afrdm
|
||||
NAME:=NXP ls1012afrdm 64b Dev Board
|
||||
UBOOT_CONFIG:=ls1012afrdm_qspi
|
||||
define U-Boot/ls1021atwr
|
||||
NAME:=NXP LS1021ATWR
|
||||
BUILD_SUBTARGET:=armv7
|
||||
UBOOT_CONFIG:=ls1021atwr_nor
|
||||
ENV_SIZE:=0x20000
|
||||
endef
|
||||
|
||||
define U-Boot/ls1021atwr-sdboot
|
||||
NAME:=NXP LS1021ATWR SD Card Boot
|
||||
BUILD_SUBTARGET:=armv7
|
||||
UBOOT_CONFIG:=ls1021atwr_sdcard_ifc
|
||||
UBOOT_IMAGE:=u-boot-with-spl-pbl.bin
|
||||
ENV_SIZE:=0x20000
|
||||
endef
|
||||
|
||||
define U-Boot/ls1021aiot-sdboot
|
||||
NAME:=NXP LS1021AIOT SD Card Boot
|
||||
BUILD_SUBTARGET:=armv7
|
||||
UBOOT_CONFIG:=ls1021aiot_sdcard
|
||||
UBOOT_IMAGE:=u-boot-with-spl-pbl.bin
|
||||
ENV_SIZE:=0x2000
|
||||
endef
|
||||
|
||||
|
||||
UBOOT_TARGETS := \
|
||||
ls1043ardb \
|
||||
ls1046ardb \
|
||||
ls1012ardb \
|
||||
ls1088ardb \
|
||||
ls2088ardb \
|
||||
ls1012afrdm
|
||||
ls1012ardb \
|
||||
ls1012afrwy \
|
||||
ls1043ardb \
|
||||
ls1043ardb-sdboot \
|
||||
ls1046ardb \
|
||||
ls1046ardb-sdboot \
|
||||
ls1088ardb \
|
||||
ls1088ardb-sdboot \
|
||||
ls2088ardb \
|
||||
ls1021atwr \
|
||||
ls1021atwr-sdboot \
|
||||
ls1021aiot-sdboot
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(STAGING_DIR_IMAGE)
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(UBOOT_IMAGE) $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-$(BUILD_SUBTARGET)-uboot.bin
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(UBOOT_IMAGE) \
|
||||
$(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-uboot.bin
|
||||
$(PKG_BUILD_DIR)/tools/mkenvimage -s $(ENV_SIZE) \
|
||||
-o $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-uboot-env.bin \
|
||||
files/$(BUILD_VARIANT)-uEnv.txt
|
||||
endef
|
||||
|
||||
define Package/u-boot/install/default
|
||||
|
8
package/boot/uboot-layerscape/files/ls1012afrwy-uEnv.txt
Normal file
8
package/boot/uboot-layerscape/files/ls1012afrwy-uEnv.txt
Normal file
@ -0,0 +1,8 @@
|
||||
fdtaddr=0x8f000000
|
||||
loadaddr=0x81000000
|
||||
fdt_high=0xffffffffffffffff
|
||||
initrd_high=0xffffffffffffffff
|
||||
sd_boot=mmc read $fdtaddr 7800 800;mmc read $loadaddr 8000 8000;bootm $loadaddr - $fdtaddr
|
||||
bootargs=root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200
|
||||
bootcmd=echo starting openwrt ...;pfe stop;run sd_boot
|
||||
bootdelay=3
|
8
package/boot/uboot-layerscape/files/ls1012ardb-uEnv.txt
Normal file
8
package/boot/uboot-layerscape/files/ls1012ardb-uEnv.txt
Normal file
@ -0,0 +1,8 @@
|
||||
fdtaddr=0x8f000000
|
||||
loadaddr=0x81000000
|
||||
fdt_high=0xffffffffffffffff
|
||||
initrd_high=0xffffffffffffffff
|
||||
qspi_boot=sf probe 0:0;sf read $fdtaddr f00000 100000;sf read $loadaddr 1000000 1000000;bootm $loadaddr - $fdtaddr
|
||||
bootargs=ubi.mtd=9 root=ubi0:rootfs rw rootfstype=ubifs noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=1550000.quadspi:1m(rcw),2m(u-boot),1m(u-boot-env),2m(ppa),4m(reserved-1),3m(pfe),2m(reserved-2),1m(dtb),16m(kernel),32m(ubifs)
|
||||
bootcmd=echo starting openwrt ...;pfe stop;run qspi_boot
|
||||
bootdelay=3
|
@ -0,0 +1,8 @@
|
||||
fdtaddr=0x8f000000
|
||||
loadaddr=0x81000000
|
||||
fdt_high=0xffffffff
|
||||
initrd_high=0xffffffff
|
||||
sd_boot=mmc read ${fdtaddr} 7800 800;mmc read ${loadaddr} 8000 8000;bootm ${loadaddr} - ${fdtaddr}
|
||||
bootargs=root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200
|
||||
bootcmd=echo starting openwrt ...;run sd_boot
|
||||
bootdelay=3
|
@ -0,0 +1,8 @@
|
||||
fdtaddr=0x8f000000
|
||||
loadaddr=0x81000000
|
||||
fdt_high=0xffffffff
|
||||
initrd_high=0xffffffff
|
||||
sd_boot=mmc read $fdtaddr 7800 800;mmc read $loadaddr 8000 8000;bootm $loadaddr - $fdtaddr
|
||||
bootargs=root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200
|
||||
bootcmd=echo starting openwrt ...;run sd_boot
|
||||
bootdelay=3
|
8
package/boot/uboot-layerscape/files/ls1021atwr-uEnv.txt
Normal file
8
package/boot/uboot-layerscape/files/ls1021atwr-uEnv.txt
Normal file
@ -0,0 +1,8 @@
|
||||
fdtaddr=0x8f000000
|
||||
loadaddr=0x81000000
|
||||
fdt_high=0xffffffff
|
||||
initrd_high=0xffffffff
|
||||
nor_boot=cp.b 60f00000 $fdtaddr 100000;cp.b 61000000 $loadaddr 1000000;bootm $loadaddr - $fdtaddr
|
||||
bootargs=root=/dev/mtdblock6 rootfstype=squashfs,jffs2 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=60000000.nor:1m(rcw),2m(u-boot),1m(u-boot-env),11m(reserved-1),1m(dtb),16m(kernel),32m(rootfs)
|
||||
bootcmd=echo starting openwrt ...;run nor_boot
|
||||
bootdelay=3
|
@ -0,0 +1,9 @@
|
||||
fdtaddr=0x8f000000
|
||||
loadaddr=0x81000000
|
||||
fdt_high=0xffffffffffffffff
|
||||
initrd_high=0xffffffffffffffff
|
||||
hwconfig=fsl_ddr:bank_intlv=auto
|
||||
sd_boot=mmc read $fdtaddr 7800 800;mmc read $loadaddr 8000 8000;bootm $loadaddr - $fdtaddr
|
||||
bootargs=root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200
|
||||
bootcmd=echo starting openwrt ...;run sd_boot
|
||||
bootdelay=3
|
9
package/boot/uboot-layerscape/files/ls1043ardb-uEnv.txt
Normal file
9
package/boot/uboot-layerscape/files/ls1043ardb-uEnv.txt
Normal file
@ -0,0 +1,9 @@
|
||||
fdtaddr=0x8f000000
|
||||
loadaddr=0x81000000
|
||||
fdt_high=0xffffffffffffffff
|
||||
initrd_high=0xffffffffffffffff
|
||||
hwconfig=fsl_ddr:bank_intlv=auto
|
||||
nor_boot=cp.b 60f00000 $fdtaddr 100000;cp.b 61000000 $loadaddr 1000000;bootm $loadaddr - $fdtaddr
|
||||
bootargs=root=/dev/mtdblock9 rootfstype=squashfs,jffs2 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=60000000.nor:1m(rcw),2m(u-boot),1m(u-boot-env),2m(ppa),3m(reserved-1),256k(fman),5888k(reserved-2),1m(dtb),16m(kernel),32m(rootfs)
|
||||
bootcmd=echo starting openwrt ...;run nor_boot
|
||||
bootdelay=3
|
@ -0,0 +1,9 @@
|
||||
fdtaddr=0x8f000000
|
||||
loadaddr=0x81000000
|
||||
fdt_high=0xffffffffffffffff
|
||||
initrd_high=0xffffffffffffffff
|
||||
hwconfig=fsl_ddr:bank_intlv=auto
|
||||
sd_boot=mmc read $fdtaddr 7800 800;mmc read $loadaddr 8000 8000;bootm $loadaddr - $fdtaddr
|
||||
bootargs=root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200
|
||||
bootcmd=echo starting openwrt ...;run sd_boot
|
||||
bootdelay=3
|
9
package/boot/uboot-layerscape/files/ls1046ardb-uEnv.txt
Normal file
9
package/boot/uboot-layerscape/files/ls1046ardb-uEnv.txt
Normal file
@ -0,0 +1,9 @@
|
||||
fdtaddr=0x8f000000
|
||||
loadaddr=0x81000000
|
||||
fdt_high=0xffffffffffffffff
|
||||
initrd_high=0xffffffffffffffff
|
||||
hwconfig=fsl_ddr:bank_intlv=auto
|
||||
qspi_boot=sf probe 0:0;sf read $fdtaddr f00000 100000;sf read $loadaddr 1000000 1000000;bootm $loadaddr - $fdtaddr
|
||||
bootargs=ubi.mtd=10 root=ubi0:rootfs rw rootfstype=ubifs noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=1550000.quadspi:1m(rcw),2m(u-boot),1m(u-boot-env),2m(ppa),3m(reserved-1),256k(fman),5888k(reserved-2),1m(dtb),16m(kernel),32m(ubifs)
|
||||
bootcmd=echo starting openwrt ...;run qspi_boot
|
||||
bootdelay=3
|
@ -0,0 +1,10 @@
|
||||
fdtaddr=0x8f000000
|
||||
loadaddr=0x81000000
|
||||
fdt_high=0xa0000000
|
||||
initrd_high=0xffffffffffffffff
|
||||
hwconfig=fsl_ddr:bank_intlv=auto
|
||||
mc_init=mmc read 80000000 5000 1800;mmc read 80300000 7000 800;fsl_mc start mc 80000000 80300000;mmc read 80400000 6800 800;fsl_mc apply dpl 80400000
|
||||
sd_boot=mmc read $fdtaddr 7800 800;mmc read $loadaddr 8000 8000;bootm $loadaddr - $fdtaddr
|
||||
bootargs=root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200
|
||||
bootcmd=echo starting openwrt ...;run mc_init;run sd_boot
|
||||
bootdelay=3
|
10
package/boot/uboot-layerscape/files/ls1088ardb-uEnv.txt
Normal file
10
package/boot/uboot-layerscape/files/ls1088ardb-uEnv.txt
Normal file
@ -0,0 +1,10 @@
|
||||
fdtaddr=0x8f000000
|
||||
loadaddr=0x81000000
|
||||
fdt_high=0xa0000000
|
||||
initrd_high=0xffffffffffffffff
|
||||
hwconfig=fsl_ddr:bank_intlv=auto
|
||||
mc_init=sf probe 0:0;sf read 80000000 a00000 300000;sf read 80300000 e00000 100000;fsl_mc start mc 80000000 80300000;sf read 80400000 d00000 100000;fsl_mc apply dpl 80400000
|
||||
qspi_boot=sf probe 0:0;sf read $fdtaddr f00000 100000;sf read $loadaddr 1000000 1000000;bootm $loadaddr - $fdtaddr
|
||||
bootargs=ubi.mtd=11 root=ubi0:rootfs rw rootfstype=ubifs noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=20c0000.quadspi:1m(rcw),2m(u-boot),1m(u-boot-env),2m(ppa),4m(reserved-1),3m(mc),1m(dpl),1m(dpc),1m(dtb),16m(kernel),32m(ubifs)
|
||||
bootcmd=echo starting openwrt ...;run mc_init;run qspi_boot
|
||||
bootdelay=3
|
10
package/boot/uboot-layerscape/files/ls2088ardb-uEnv.txt
Normal file
10
package/boot/uboot-layerscape/files/ls2088ardb-uEnv.txt
Normal file
@ -0,0 +1,10 @@
|
||||
fdtaddr=0x8f000000
|
||||
loadaddr=0x81000000
|
||||
fdt_high=0xa0000000
|
||||
initrd_high=0xffffffffffffffff
|
||||
hwconfig=fsl_ddr:bank_intlv=auto
|
||||
mc_init=fsl_mc start mc 580a00000 580e00000;fsl_mc apply dpl 580d00000
|
||||
nor_boot=cp.b 580f00000 $fdtaddr 100000;cp.b 581000000 $loadaddr 1000000;bootm $loadaddr - $fdtaddr
|
||||
bootargs=root=/dev/mtdblock10 rootfstype=squashfs,jffs2 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS1,115200 mtdparts=580000000.nor:1m(rcw),2m(u-boot),1m(u-boot-env),2m(ppa),4m(reserved-1),3m(mc),1m(dpl),1m(dpc),1m(dtb),16m(kernel),32m(rootfs)
|
||||
bootcmd=echo starting openwrt ...;run mc_init;run nor_boot
|
||||
bootdelay=3
|
@ -1,51 +0,0 @@
|
||||
From d1b42455f62baefe7fb782d0d7100715b0fdb41f Mon Sep 17 00:00:00 2001
|
||||
From: Yangbo Lu <yangbo.lu@nxp.com>
|
||||
Date: Fri, 19 Jan 2018 10:16:57 +0800
|
||||
Subject: [PATCH] armv8: ls1043a: add LEDE boot support in environment
|
||||
|
||||
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
|
||||
---
|
||||
include/configs/ls1043a_common.h | 20 +++++++++++++++++++-
|
||||
1 files changed, 19 insertions(+), 1 deletions(-)
|
||||
|
||||
diff --git a/include/configs/ls1043a_common.h b/include/configs/ls1043a_common.h
|
||||
index c437ce5..48ecff5 100644
|
||||
--- a/include/configs/ls1043a_common.h
|
||||
+++ b/include/configs/ls1043a_common.h
|
||||
@@ -341,7 +341,19 @@
|
||||
"env exists secureboot && mmc read $kernelheader_addr_r " \
|
||||
"$kernelhdr_addr_sd $kernelhdr_size_sd " \
|
||||
" && esbc_validate ${kernelheader_addr_r};" \
|
||||
- " bootm $load_addr#$board\0"
|
||||
+ " bootm $load_addr#$board\0" \
|
||||
+ "lede_setenv=setenv loadaddr 82000000 && " \
|
||||
+ "setenv fdtaddr 8f000000 && " \
|
||||
+ "setenv bootargs root=/dev/mtdblock8 " \
|
||||
+ "rootfstype=squashfs,jffs2 noinitrd " \
|
||||
+ "earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 " \
|
||||
+ "mtdparts=60000000.nor:1M(rcw),2M(u-boot),1M(u-boot-env)," \
|
||||
+ "5M(reserved-1),256k(fman),5888k(reserved-2),1M(dtb)," \
|
||||
+ "16M(kernel),32M(rootfs),64M(otherbank)\0" \
|
||||
+ "lede_run=cp.b 60f00000 $fdtaddr 100000 && " \
|
||||
+ "cp.b 61000000 $loadaddr 1000000 && " \
|
||||
+ "bootm $loadaddr - $fdtaddr\0" \
|
||||
+ "lede_boot=run lede_setenv;run lede_run\0"
|
||||
|
||||
|
||||
#undef CONFIG_BOOTCOMMAND
|
||||
@@ -356,6 +368,12 @@
|
||||
"env exists secureboot && esbc_halt;"
|
||||
#endif
|
||||
|
||||
+#undef CONFIG_BOOTCOMMAND
|
||||
+#define CONFIG_BOOTCOMMAND "run lede_boot"
|
||||
+
|
||||
+#undef CONFIG_BOOTDELAY
|
||||
+#define CONFIG_BOOTDELAY 3
|
||||
+
|
||||
#define CONFIG_BOOTARGS "console=ttyS0,115200 root=/dev/ram0 " \
|
||||
"earlycon=uart8250,mmio,0x21c0500 " \
|
||||
MTDPARTS_DEFAULT
|
||||
--
|
||||
1.7.1
|
||||
|
@ -1,57 +0,0 @@
|
||||
From a5293c6d5fdacf84fdd4772d0532aa5478df4d3c Mon Sep 17 00:00:00 2001
|
||||
From: Yangbo Lu <yangbo.lu@nxp.com>
|
||||
Date: Fri, 19 Jan 2018 10:18:47 +0800
|
||||
Subject: [PATCH] armv8: ls1046ardb: add LEDE boot support in environment
|
||||
|
||||
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
|
||||
---
|
||||
include/configs/ls1046a_common.h | 15 ++++++++++++++-
|
||||
include/configs/ls1046ardb.h | 6 ++++++
|
||||
2 files changed, 20 insertions(+), 1 deletions(-)
|
||||
|
||||
diff --git a/include/configs/ls1046a_common.h b/include/configs/ls1046a_common.h
|
||||
index d163347..d26147b 100644
|
||||
--- a/include/configs/ls1046a_common.h
|
||||
+++ b/include/configs/ls1046a_common.h
|
||||
@@ -281,7 +281,20 @@
|
||||
"env exists secureboot && mmc read $kernelheader_addr_r " \
|
||||
"$kernelhdr_addr_sd $kernelhdr_size_sd " \
|
||||
" && esbc_validate ${kernelheader_addr_r};" \
|
||||
- " bootm $load_addr#$board\0"
|
||||
+ " bootm $load_addr#$board\0" \
|
||||
+ "lede_setenv=setenv loadaddr 82000000 && " \
|
||||
+ "setenv fdtaddr 8f000000 && " \
|
||||
+ "setenv bootargs ubi.mtd=9 root=ubi0:rootfs rw " \
|
||||
+ "rootfstype=ubifs noinitrd " \
|
||||
+ "earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 " \
|
||||
+ "mtdparts=1550000.quadspi:1M(rcw),2M(u-boot),1M(u-boot-env)," \
|
||||
+ "5M(reserved-1),256k(fman),5888k(reserved-2),1M(dtb)," \
|
||||
+ "16M(kernel),32M(ubifs)\0" \
|
||||
+ "lede_run=sf probe 0:0 && " \
|
||||
+ "sf read $fdtaddr f00000 100000 && " \
|
||||
+ "sf read $loadaddr 1000000 1000000 && " \
|
||||
+ "bootm $loadaddr - $fdtaddr\0" \
|
||||
+ "lede_boot=run lede_setenv;run lede_run\0"
|
||||
|
||||
|
||||
#define CONFIG_BOOTARGS "console=ttyS0,115200 root=/dev/ram0 " \
|
||||
diff --git a/include/configs/ls1046ardb.h b/include/configs/ls1046ardb.h
|
||||
index 4475ac7..15e7858 100644
|
||||
--- a/include/configs/ls1046ardb.h
|
||||
+++ b/include/configs/ls1046ardb.h
|
||||
@@ -253,6 +253,12 @@
|
||||
"env exists secureboot && esbc_halt;"
|
||||
#endif
|
||||
|
||||
+#undef CONFIG_BOOTCOMMAND
|
||||
+#define CONFIG_BOOTCOMMAND "run lede_boot"
|
||||
+
|
||||
+#undef CONFIG_BOOTDELAY
|
||||
+#define CONFIG_BOOTDELAY 3
|
||||
+
|
||||
#define MTDPARTS_DEFAULT "mtdparts=1550000.quadspi:1m(rcw)," \
|
||||
"15m(u-boot),48m(kernel.itb);" \
|
||||
"7e800000.flash:16m(nand_uboot)," \
|
||||
--
|
||||
1.7.1
|
||||
|
@ -1,51 +0,0 @@
|
||||
From 8d6efca7eb2de012b98493206c87f31ee9b9e967 Mon Sep 17 00:00:00 2001
|
||||
From: Yangbo Lu <yangbo.lu@nxp.com>
|
||||
Date: Thu, 28 Sep 2017 11:25:58 +0800
|
||||
Subject: [PATCH 3/3] armv8: ls1012ardb: add LEDE boot support in environment
|
||||
|
||||
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
|
||||
---
|
||||
include/configs/ls1012ardb.h | 21 ++++++++++++++++++++-
|
||||
1 file changed, 20 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/include/configs/ls1012ardb.h b/include/configs/ls1012ardb.h
|
||||
index 5fe3218..242cdf0 100644
|
||||
--- a/include/configs/ls1012ardb.h
|
||||
+++ b/include/configs/ls1012ardb.h
|
||||
@@ -127,13 +127,32 @@
|
||||
"$kernel_addr $kernel_size; env exists secureboot " \
|
||||
"&& sf read $kernelheader_addr_r $kernelheader_addr " \
|
||||
"$kernelheader_size && esbc_validate ${kernelheader_addr_r}; " \
|
||||
- "bootm $load_addr#$board\0"
|
||||
+ "bootm $load_addr#$board\0" \
|
||||
+ "lede_setenv=setenv loadaddr 82000000 && " \
|
||||
+ "setenv fdtaddr 8f000000 && " \
|
||||
+ "setenv bootargs ubi.mtd=8 root=ubi0:rootfs rw " \
|
||||
+ "rootfstype=ubifs noinitrd " \
|
||||
+ "earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 " \
|
||||
+ "mtdparts=1550000.quadspi:1M(rcw),2M(u-boot),1M(u-boot-env)," \
|
||||
+ "5M(reserved-1),256k(fman),5888k(reserved-2),1M(dtb)," \
|
||||
+ "16M(kernel),32M(ubifs)\0" \
|
||||
+ "lede_run=pfe stop && sf probe 0:0 && " \
|
||||
+ "sf read $fdtaddr f00000 100000 && " \
|
||||
+ "sf read $loadaddr 1000000 1000000 && " \
|
||||
+ "bootm $loadaddr - $fdtaddr\0" \
|
||||
+ "lede_boot=run lede_setenv;run lede_run\0"
|
||||
|
||||
#undef CONFIG_BOOTCOMMAND
|
||||
#if defined(CONFIG_QSPI_BOOT) || defined(CONFIG_SD_BOOT_QSPI)
|
||||
#define CONFIG_BOOTCOMMAND "run distro_bootcmd; run qspi_bootcmd; " \
|
||||
"env exists secureboot && esbc_halt;"
|
||||
#endif
|
||||
+#undef CONFIG_BOOTCOMMAND
|
||||
+#define CONFIG_BOOTCOMMAND "run lede_boot"
|
||||
+
|
||||
+#undef CONFIG_BOOTDELAY
|
||||
+#define CONFIG_BOOTDELAY 3
|
||||
+
|
||||
|
||||
#include <asm/fsl_secure_boot.h>
|
||||
|
||||
--
|
||||
2.7.4
|
||||
|
@ -1,58 +0,0 @@
|
||||
From 479bf0c0bec2e99442214facf0f414c2c737ac7b Mon Sep 17 00:00:00 2001
|
||||
From: Yangbo Lu <yangbo.lu@nxp.com>
|
||||
Date: Mon, 16 Oct 2017 11:57:36 +0800
|
||||
Subject: [PATCH] armv8: ls1088ardb: add LEDE boot support in environment
|
||||
|
||||
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
|
||||
---
|
||||
include/configs/ls1088ardb.h | 27 ++++++++++++++++++++++++++-
|
||||
1 file changed, 26 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/include/configs/ls1088ardb.h b/include/configs/ls1088ardb.h
|
||||
index 7bd152d..4cefa40 100644
|
||||
--- a/include/configs/ls1088ardb.h
|
||||
+++ b/include/configs/ls1088ardb.h
|
||||
@@ -404,7 +404,20 @@
|
||||
"env exists secureboot && mmc read $kernelheader_addr_r " \
|
||||
"$kernelhdr_addr_sd $kernelhdr_size_sd " \
|
||||
" && esbc_validate ${kernelheader_addr_r};" \
|
||||
- "bootm $load_addr#$BOARD\0"
|
||||
+ "bootm $load_addr#$BOARD\0" \
|
||||
+ "lede_setenv=setenv loadaddr 82000000 && " \
|
||||
+ "setenv fdtaddr 8f000000 && " \
|
||||
+ "setenv bootargs ubi.mtd=10 root=ubi0:rootfs rw " \
|
||||
+ "rootfstype=ubifs noinitrd " \
|
||||
+ "earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 " \
|
||||
+ "mtdparts=20c0000.quadspi:1M(rcw),2M(u-boot),1M(u-boot-env)," \
|
||||
+ "6M(reserved-1),3M(mc),1M(dpl),1M(dpc),1M(dtb)," \
|
||||
+ "16M(kernel),32M(ubifs)\0" \
|
||||
+ "lede_run=sf probe 0:0 && " \
|
||||
+ "sf read $fdtaddr f00000 100000 && " \
|
||||
+ "sf read $loadaddr 1000000 1000000 && " \
|
||||
+ "bootm $loadaddr - $fdtaddr\0" \
|
||||
+ "lede_boot=run lede_setenv;run lede_run\0"
|
||||
|
||||
#undef CONFIG_BOOTCOMMAND
|
||||
#if defined(CONFIG_QSPI_BOOT)
|
||||
@@ -429,6 +442,18 @@
|
||||
"run distro_bootcmd;run sd_bootcmd;" \
|
||||
"env exists secureboot && esbc_halt;"
|
||||
#endif
|
||||
+
|
||||
+#undef CONFIG_BOOTCOMMAND
|
||||
+#define CONFIG_BOOTCOMMAND \
|
||||
+ "sf probe 0:0;sf read 0x80000000 0xA00000 0x300000;" \
|
||||
+ "sf read 0x80300000 0xE00000 0x100000;" \
|
||||
+ "fsl_mc start mc 0x80000000 0x80300000;" \
|
||||
+ "sf read 0x80400000 0xd00000 0x100000;" \
|
||||
+ "fsl_mc apply dpl 0x80400000;" \
|
||||
+ "run lede_boot;"
|
||||
+#undef CONFIG_BOOTDELAY
|
||||
+#define CONFIG_BOOTDELAY 3
|
||||
+
|
||||
/* MAC/PHY configuration */
|
||||
#ifdef CONFIG_FSL_MC_ENET
|
||||
#define CONFIG_PHYLIB_10G
|
||||
--
|
||||
2.7.4
|
||||
|
@ -1,54 +0,0 @@
|
||||
From 20f270670d1d5e14f3fd128f359535300a955ac8 Mon Sep 17 00:00:00 2001
|
||||
From: Yangbo Lu <yangbo.lu@nxp.com>
|
||||
Date: Mon, 16 Oct 2017 12:37:05 +0800
|
||||
Subject: [PATCH] armv8: ls2088ardb: add LEDE boot support in environment
|
||||
|
||||
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
|
||||
---
|
||||
include/configs/ls2080ardb.h | 23 ++++++++++++++++++++++-
|
||||
1 file changed, 22 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/include/configs/ls2080ardb.h b/include/configs/ls2080ardb.h
|
||||
index 8a34990..8ae3944 100644
|
||||
--- a/include/configs/ls2080ardb.h
|
||||
+++ b/include/configs/ls2080ardb.h
|
||||
@@ -432,7 +432,19 @@ unsigned long get_board_sys_clk(void);
|
||||
"env exists secureboot && mmc read $kernelheader_addr_r " \
|
||||
"$kernelhdr_addr_sd $kernelhdr_size_sd " \
|
||||
" && esbc_validate ${kernelheader_addr_r};" \
|
||||
- "bootm $load_addr#$board\0"
|
||||
+ "bootm $load_addr#$board\0" \
|
||||
+ "lede_setenv=setenv loadaddr 82000000 && " \
|
||||
+ "setenv fdtaddr 8f000000 && " \
|
||||
+ "setenv bootargs root=/dev/mtdblock9 " \
|
||||
+ "rootfstype=squashfs,jffs2 noinitrd " \
|
||||
+ "earlycon=uart8250,mmio,0x21c0500 console=ttyS1,115200 " \
|
||||
+ "mtdparts=580000000.nor:1M(rcw),2M(u-boot),1M(u-boot-env)," \
|
||||
+ "6M(reserved-1),3M(mc),1M(dpl),1M(dpc),1M(dtb)," \
|
||||
+ "16M(kernel),32M(rootfs),64M(otherbank)\0" \
|
||||
+ "lede_run=cp.b 580f00000 $fdtaddr 100000 && " \
|
||||
+ "cp.b 581000000 $loadaddr 1000000 && " \
|
||||
+ "bootm $loadaddr - $fdtaddr\0" \
|
||||
+ "lede_boot=run lede_setenv;run lede_run\0"
|
||||
|
||||
#undef CONFIG_BOOTCOMMAND
|
||||
#ifdef CONFIG_QSPI_BOOT
|
||||
@@ -463,6 +475,15 @@ unsigned long get_board_sys_clk(void);
|
||||
"env exists secureboot && esbc_halt;"
|
||||
#endif
|
||||
|
||||
+#undef CONFIG_BOOTCOMMAND
|
||||
+#define CONFIG_BOOTCOMMAND \
|
||||
+ "fsl_mc start mc 0x580a00000 0x580e00000;" \
|
||||
+ "fsl_mc apply dpl 0x580d00000;" \
|
||||
+ "run lede_boot;"
|
||||
+
|
||||
+#undef CONFIG_BOOTDELAY
|
||||
+#define CONFIG_BOOTDELAY 3
|
||||
+
|
||||
#undef CONFIG_BOOTARGS
|
||||
#define CONFIG_BOOTARGS "console=ttyS1,115200 root=/dev/ram0 " \
|
||||
"earlycon=uart8250,mmio,0x21c0600 " \
|
||||
--
|
||||
2.7.4
|
||||
|
@ -1,49 +0,0 @@
|
||||
From a5e454a3bb33a456655f08592606e4df34e40110 Mon Sep 17 00:00:00 2001
|
||||
From: Yangbo Lu <yangbo.lu@nxp.com>
|
||||
Date: Tue, 24 Oct 2017 17:48:08 +0800
|
||||
Subject: [PATCH] armv8: ls1012afrdm: add LEDE boot support in environment
|
||||
|
||||
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
|
||||
---
|
||||
include/configs/ls1012afrdm.h | 19 +++++++++++++++++++
|
||||
1 file changed, 19 insertions(+)
|
||||
|
||||
diff --git a/include/configs/ls1012afrdm.h b/include/configs/ls1012afrdm.h
|
||||
index a3f8824d27..36dff19bdd 100644
|
||||
--- a/include/configs/ls1012afrdm.h
|
||||
+++ b/include/configs/ls1012afrdm.h
|
||||
@@ -73,12 +73,31 @@
|
||||
"qspi_bootcmd=echo Trying load from qspi..;" \
|
||||
"sf probe && sf read $load_addr " \
|
||||
"$kernel_addr $kernel_size && bootm $load_addr#$board\0" \
|
||||
+ "lede_setenv=setenv loadaddr 82000000 && " \
|
||||
+ "setenv fdtaddr 8f000000 && " \
|
||||
+ "setenv bootargs ubi.mtd=8 root=ubi0:rootfs rw " \
|
||||
+ "rootfstype=ubifs noinitrd " \
|
||||
+ "earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 " \
|
||||
+ "mtdparts=1550000.quadspi:1M(rcw),2M(u-boot),1M(u-boot-env)," \
|
||||
+ "5M(reserved-1),256k(fman),5888k(reserved-2),1M(dtb)," \
|
||||
+ "16M(kernel),32M(ubifs)\0" \
|
||||
+ "lede_run=pfe stop && sf probe 0:0 && " \
|
||||
+ "sf read $fdtaddr f00000 100000 && " \
|
||||
+ "sf read $loadaddr 1000000 1000000 && " \
|
||||
+ "bootm $loadaddr - $fdtaddr\0" \
|
||||
+ "lede_boot=run lede_setenv;run lede_run\0"
|
||||
|
||||
#undef CONFIG_BOOTCOMMAND
|
||||
#if defined(CONFIG_QSPI_BOOT) || defined(CONFIG_SD_BOOT_QSPI)
|
||||
#define CONFIG_BOOTCOMMAND "run distro_bootcmd;run qspi_bootcmd"
|
||||
#endif
|
||||
|
||||
+#undef CONFIG_BOOTCOMMAND
|
||||
+#define CONFIG_BOOTCOMMAND "run lede_boot"
|
||||
+
|
||||
+#undef CONFIG_BOOTDELAY
|
||||
+#define CONFIG_BOOTDELAY 3
|
||||
+
|
||||
/*
|
||||
* USB
|
||||
*/
|
||||
--
|
||||
2.14.1
|
||||
|
@ -8,10 +8,10 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_VERSION:=2017.11
|
||||
PKG_VERSION:=2018.09
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_HASH:=6a018fd3caf58f3dcfa23ee989a82bd35df03af71872b9dca8c6d758a0d26c05
|
||||
PKG_HASH:=839bf23cfe8ce613a77e583a60375179d0ad324e92c82fbdd07bebf0fd142268
|
||||
|
||||
include $(INCLUDE_DIR)/u-boot.mk
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
@ -1,6 +1,6 @@
|
||||
From 25de6430219d3f3698d709c10358fbea17b24cf1 Mon Sep 17 00:00:00 2001
|
||||
From 7b919a74c562ca33ae28c9214f225a79b57209e4 Mon Sep 17 00:00:00 2001
|
||||
From: Michael Heimpold <mhei@heimpold.de>
|
||||
Date: Fri, 21 Apr 2017 11:08:19 +0200
|
||||
Date: Thu, 13 Sep 2018 21:40:19 +0200
|
||||
Subject: [PATCH] arm: mxs: add support for I2SE's Duckbill boards
|
||||
|
||||
The Duckbill devices are small, pen-drive sized boards based on
|
||||
@ -8,7 +8,7 @@ NXP's i.MX28 SoC. While the initial variants (Duckbill series) were
|
||||
equipped with a micro SD card slot only, the latest generation
|
||||
(Duckbill 2 series) have an additional internal eMMC onboard.
|
||||
|
||||
Both device generations consists of four "family members":
|
||||
Both device generations consist of four "family members":
|
||||
|
||||
- Duckbill/Duckbill 2: generic board, intended to be used as
|
||||
baseboard for custom designs and/or as development board
|
||||
@ -26,15 +26,15 @@ Both device generations consists of four "family members":
|
||||
Signed-off-by: Michael Heimpold <mhei@heimpold.de>
|
||||
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
|
||||
---
|
||||
arch/arm/Kconfig | 9 +-
|
||||
arch/arm/mach-imx/mxs/Kconfig | 5 +
|
||||
board/i2se/duckbill/Kconfig | 15 +++
|
||||
board/i2se/duckbill/MAINTAINERS | 6 ++
|
||||
board/i2se/duckbill/Makefile | 12 +++
|
||||
board/i2se/duckbill/duckbill.c | 181 ++++++++++++++++++++++++++++++++++++
|
||||
board/i2se/duckbill/iomux.c | 157 +++++++++++++++++++++++++++++++
|
||||
configs/duckbill_defconfig | 31 +++++++
|
||||
include/configs/duckbill.h | 199 ++++++++++++++++++++++++++++++++++++++++
|
||||
8 files changed, 609 insertions(+), 1 deletion(-)
|
||||
board/i2se/duckbill/Makefile | 10 ++
|
||||
board/i2se/duckbill/duckbill.c | 186 ++++++++++++++++++++++++++++++++
|
||||
board/i2se/duckbill/iomux.c | 156 +++++++++++++++++++++++++++
|
||||
configs/duckbill_defconfig | 38 +++++++
|
||||
include/configs/duckbill.h | 179 ++++++++++++++++++++++++++++++
|
||||
8 files changed, 595 insertions(+)
|
||||
create mode 100644 board/i2se/duckbill/Kconfig
|
||||
create mode 100644 board/i2se/duckbill/MAINTAINERS
|
||||
create mode 100644 board/i2se/duckbill/Makefile
|
||||
@ -43,38 +43,27 @@ Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
|
||||
create mode 100644 configs/duckbill_defconfig
|
||||
create mode 100644 include/configs/duckbill.h
|
||||
|
||||
--- a/arch/arm/Kconfig
|
||||
+++ b/arch/arm/Kconfig
|
||||
@@ -373,6 +373,12 @@ config TARGET_MX28EVK
|
||||
select SUPPORT_SPL
|
||||
select BOARD_EARLY_INIT_F
|
||||
--- a/arch/arm/mach-imx/mxs/Kconfig
|
||||
+++ b/arch/arm/mach-imx/mxs/Kconfig
|
||||
@@ -50,6 +50,10 @@ config TARGET_APX4DEVKIT
|
||||
config TARGET_BG0900
|
||||
bool "Support bg0900"
|
||||
|
||||
+config TARGET_DUCKBILL
|
||||
+ bool "Support duckbill"
|
||||
+ select CPU_ARM926EJS
|
||||
+ select SUPPORT_SPL
|
||||
+ select BOARD_EARLY_INIT_F
|
||||
+
|
||||
config TARGET_MX23_OLINUXINO
|
||||
bool "Support mx23_olinuxino"
|
||||
select CPU_ARM926EJS
|
||||
@@ -1250,6 +1256,7 @@ source "board/gumstix/pepper/Kconfig"
|
||||
source "board/h2200/Kconfig"
|
||||
source "board/hisilicon/hikey/Kconfig"
|
||||
source "board/hisilicon/poplar/Kconfig"
|
||||
config TARGET_MX28EVK
|
||||
bool "Support mx28evk"
|
||||
select BOARD_EARLY_INIT_F
|
||||
@@ -67,6 +71,7 @@ config SYS_SOC
|
||||
|
||||
source "board/bluegiga/apx4devkit/Kconfig"
|
||||
source "board/freescale/mx28evk/Kconfig"
|
||||
+source "board/i2se/duckbill/Kconfig"
|
||||
source "board/imx31_phycore/Kconfig"
|
||||
source "board/isee/igep003x/Kconfig"
|
||||
source "board/olimex/mx23_olinuxino/Kconfig"
|
||||
@@ -1279,7 +1286,7 @@ source "arch/arm/Kconfig.debug"
|
||||
endmenu
|
||||
|
||||
config SPL_LDSCRIPT
|
||||
- default "arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds" if TARGET_APX4DEVKIT || TARGET_BG0900 || TARGET_M28EVK || TARGET_MX23_OLINUXINO || TARGET_MX23EVK || TARGET_MX28EVK || TARGET_SANSA_FUZE_PLUS || TARGET_SC_SPS_1 || TARGET_TS4600 || TARGET_XFI3
|
||||
+ default "arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds" if TARGET_APX4DEVKIT || TARGET_BG0900 || TARGET_M28EVK || TARGET_MX23_OLINUXINO || TARGET_MX23EVK || TARGET_MX28EVK || TARGET_DUCKBILL || TARGET_SANSA_FUZE_PLUS || TARGET_SC_SPS_1 || TARGET_TS4600 || TARGET_XFI3
|
||||
default "arch/arm/cpu/arm1136/u-boot-spl.lds" if CPU_ARM1136
|
||||
default "arch/arm/cpu/armv8/u-boot-spl.lds" if ARM64
|
||||
|
||||
source "board/ppcag/bg0900/Kconfig"
|
||||
source "board/schulercontrol/sc_sps_1/Kconfig"
|
||||
source "board/technologic/ts4600/Kconfig"
|
||||
--- /dev/null
|
||||
+++ b/board/i2se/duckbill/Kconfig
|
||||
@@ -0,0 +1,15 @@
|
||||
@ -104,13 +93,11 @@ Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
|
||||
+F: configs/duckbill_defconfig
|
||||
--- /dev/null
|
||||
+++ b/board/i2se/duckbill/Makefile
|
||||
@@ -0,0 +1,12 @@
|
||||
@@ -0,0 +1,10 @@
|
||||
+# SPDX-License-Identifier: GPL-2.0+
|
||||
+#
|
||||
+# (C) Copyright 2014-2017
|
||||
+# (C) Copyright 2014-2018
|
||||
+# Michael Heimpold, mhei@heimpold.de.
|
||||
+#
|
||||
+# SPDX-License-Identifier: GPL-2.0+
|
||||
+#
|
||||
+
|
||||
+ifndef CONFIG_SPL_BUILD
|
||||
+obj-y := duckbill.o
|
||||
@ -119,13 +106,12 @@ Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
|
||||
+endif
|
||||
--- /dev/null
|
||||
+++ b/board/i2se/duckbill/duckbill.c
|
||||
@@ -0,0 +1,181 @@
|
||||
@@ -0,0 +1,186 @@
|
||||
+// SPDX-License-Identifier: GPL-2.0+
|
||||
+/*
|
||||
+ * I2SE Duckbill board
|
||||
+ *
|
||||
+ * (C) Copyright 2014-2017 Michael Heimpold <mhei@heimpold.de>
|
||||
+ *
|
||||
+ * SPDX-License-Identifier: GPL-2.0+
|
||||
+ * (C) Copyright 2014-2018 Michael Heimpold <mhei@heimpold.de>
|
||||
+ */
|
||||
+
|
||||
+#include <common.h>
|
||||
@ -205,7 +191,7 @@ Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
|
||||
+ /* give PHY some time to get out of the reset */
|
||||
+ udelay(10000);
|
||||
+
|
||||
+ ret = fecmxc_initialize(bis);
|
||||
+ ret = fecmxc_initialize_multi(bis, 0, 0, MXS_ENET0_BASE);
|
||||
+ if (ret) {
|
||||
+ puts("FEC MXS: Unable to init FEC\n");
|
||||
+ return ret;
|
||||
@ -228,22 +214,20 @@ Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
|
||||
+ uint8_t enetaddr[6];
|
||||
+ u32 mac = 0;
|
||||
+
|
||||
+ enetaddr[0] = 0x00;
|
||||
+ enetaddr[1] = 0x01;
|
||||
+ enetaddr[2] = 0x87;
|
||||
+
|
||||
+#ifdef CONFIG_MXS_OCOTP
|
||||
+ /* only Duckbill SPI has a MAC for the QCA7k */
|
||||
+ fuse_read(0, 1, &mac);
|
||||
+#endif
|
||||
+
|
||||
+ if (mac != 0) {
|
||||
+ enetaddr[0] = 0x00;
|
||||
+ enetaddr[1] = 0x01;
|
||||
+ enetaddr[2] = 0x87;
|
||||
+ enetaddr[3] = (mac >> 16) & 0xff;
|
||||
+ enetaddr[4] = (mac >> 8) & 0xff;
|
||||
+ enetaddr[5] = mac & 0xff;
|
||||
+
|
||||
+ fdt_find_and_setprop(blob,
|
||||
+ "/apb@80000000/apbh@80000000/ssp@80014000/ethernet@0",
|
||||
+ fdt_find_and_setprop(blob, "spi1/ethernet@0",
|
||||
+ "local-mac-address", enetaddr, 6, 1);
|
||||
+ }
|
||||
+
|
||||
@ -279,6 +263,14 @@ Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
|
||||
+ gpio_get_value(MX28_PAD_LCD_D17__GPIO_1_17);
|
||||
+ system_rev += 1;
|
||||
+
|
||||
+ /* guess DT blob if not set in environment */
|
||||
+ if (!env_get("fdt_file")) {
|
||||
+ if (system_rev == 1)
|
||||
+ env_set("fdt_file", "imx28-duckbill.dtb");
|
||||
+ else
|
||||
+ env_set("fdt_file", "imx28-duckbill-2.dtb");
|
||||
+ }
|
||||
+
|
||||
+ /* enable red LED to indicate a running bootloader */
|
||||
+ if (system_rev == 1)
|
||||
+ led_red_gpio = MX28_PAD_AUART1_RX__GPIO_3_4;
|
||||
@ -303,13 +295,12 @@ Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
|
||||
+}
|
||||
--- /dev/null
|
||||
+++ b/board/i2se/duckbill/iomux.c
|
||||
@@ -0,0 +1,157 @@
|
||||
@@ -0,0 +1,156 @@
|
||||
+// SPDX-License-Identifier: GPL-2.0+
|
||||
+/*
|
||||
+ * I2SE Duckbill IOMUX setup
|
||||
+ *
|
||||
+ * Copyright (C) 2013-2017 Michael Heimpold <mhei@heimpold.de>
|
||||
+ *
|
||||
+ * SPDX-License-Identifier: GPL-2.0+
|
||||
+ * Copyright (C) 2013-2018 Michael Heimpold <mhei@heimpold.de>
|
||||
+ */
|
||||
+
|
||||
+#include <common.h>
|
||||
@ -463,63 +454,64 @@ Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
|
||||
+}
|
||||
--- /dev/null
|
||||
+++ b/configs/duckbill_defconfig
|
||||
@@ -0,0 +1,31 @@
|
||||
@@ -0,0 +1,38 @@
|
||||
+CONFIG_ARM=y
|
||||
+CONFIG_TARGET_DUCKBILL=y
|
||||
+CONFIG_ARCH_MX28=y
|
||||
+CONFIG_SYS_TEXT_BASE=0x40002000
|
||||
+CONFIG_SPL_GPIO_SUPPORT=y
|
||||
+CONFIG_SPL_LIBCOMMON_SUPPORT=y
|
||||
+CONFIG_SPL_LIBGENERIC_SUPPORT=y
|
||||
+CONFIG_TARGET_DUCKBILL=y
|
||||
+CONFIG_SPL_SERIAL_SUPPORT=y
|
||||
+CONFIG_SPL=y
|
||||
+CONFIG_NR_DRAM_BANKS=1
|
||||
+CONFIG_BOOTDELAY=1
|
||||
+# CONFIG_CONSOLE_MUX is not set
|
||||
+CONFIG_SYS_CONSOLE_IS_IN_ENV=y
|
||||
+CONFIG_VERSION_VARIABLE=y
|
||||
+# CONFIG_DISPLAY_BOARDINFO is not set
|
||||
+# CONFIG_EFI_LOADER is not set
|
||||
+CONFIG_ARCH_MISC_INIT=y
|
||||
+CONFIG_SPL=y
|
||||
+# CONFIG_SPL_FRAMEWORK is not set
|
||||
+CONFIG_HUSH_PARSER=y
|
||||
+CONFIG_CMD_BOOTZ=y
|
||||
+# CONFIG_CMD_IMLS is not set
|
||||
+# CONFIG_CMD_ELF is not set
|
||||
+CONFIG_CMD_UNZIP=y
|
||||
+# CONFIG_CMD_FLASH is not set
|
||||
+CONFIG_CMD_MMC=y
|
||||
+CONFIG_CMD_FUSE=y
|
||||
+CONFIG_CMD_GPIO=y
|
||||
+CONFIG_CMD_MMC=y
|
||||
+CONFIG_CMD_MMC_SWRITE=y
|
||||
+CONFIG_CMD_DHCP=y
|
||||
+CONFIG_CMD_MII=y
|
||||
+CONFIG_CMD_PING=y
|
||||
+CONFIG_CMD_CACHE=y
|
||||
+CONFIG_CMD_EXT4=y
|
||||
+CONFIG_CMD_EXT4_WRITE=y
|
||||
+CONFIG_CMD_FAT=y
|
||||
+CONFIG_CMD_FS_GENERIC=y
|
||||
+CONFIG_DOS_PARTITION=y
|
||||
+CONFIG_ENV_IS_IN_MMC=y
|
||||
+CONFIG_MMC_MXS=y
|
||||
+CONFIG_MII=y
|
||||
+CONFIG_CONS_INDEX=0
|
||||
+CONFIG_OF_LIBFDT=y
|
||||
+# CONFIG_EFI_LOADER is not set
|
||||
--- /dev/null
|
||||
+++ b/include/configs/duckbill.h
|
||||
@@ -0,0 +1,199 @@
|
||||
@@ -0,0 +1,179 @@
|
||||
+/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
+/*
|
||||
+ * Copyright (C) 2014-2015 Michael Heimpold <mhei@heimpold.de>
|
||||
+ * Copyright (C) 2014-2018 Michael Heimpold <mhei@heimpold.de>
|
||||
+ *
|
||||
+ * SPDX-License-Identifier: GPL-2.0+
|
||||
+ */
|
||||
+#ifndef __CONFIGS_DUCKBILL_H__
|
||||
+#define __CONFIGS_DUCKBILL_H__
|
||||
+
|
||||
+/* System configurations */
|
||||
+#define CONFIG_MX28 /* i.MX28 SoC */
|
||||
+#define CONFIG_MACH_TYPE MACH_TYPE_DUCKBILL
|
||||
+
|
||||
+#define CONFIG_MISC_INIT_R
|
||||
+
|
||||
+#define CONFIG_SYS_MXS_VDD5V_ONLY
|
||||
+
|
||||
+/* U-Boot Commands */
|
||||
+#define CONFIG_CMD_FUSE
|
||||
+#define CONFIG_CMD_UNZIP
|
||||
+
|
||||
+/* Memory configuration */
|
||||
+#define CONFIG_NR_DRAM_BANKS 1 /* 1 bank of DRAM */
|
||||
+#define PHYS_SDRAM_1 0x40000000 /* Base address */
|
||||
+#define PHYS_SDRAM_1_SIZE 0x40000000 /* Max 1 GB RAM */
|
||||
+#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1
|
||||
@ -533,12 +525,10 @@ Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
|
||||
+#define CONFIG_SYS_REDUNDAND_ENVIRONMENT
|
||||
+
|
||||
+/* FEC Ethernet on SoC */
|
||||
+#ifdef CONFIG_CMD_NET
|
||||
+#ifdef CONFIG_CMD_NET
|
||||
+#define CONFIG_FEC_MXC
|
||||
+#define CONFIG_NET_MULTI
|
||||
+#define CONFIG_MX28_FEC_MAC_IN_OCOTP
|
||||
+#define CONFIG_FEC_MXC_PHYADDR 1
|
||||
+#define IMX_FEC_BASE MXS_ENET0_BASE
|
||||
+#define CONFIG_FEC_MXC_MDIO_BASE MXS_ENET0_BASE
|
||||
+#endif
|
||||
+
|
||||
+#define CONFIG_IPADDR 192.168.1.10
|
||||
@ -546,17 +536,6 @@ Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
|
||||
+#define CONFIG_NETMASK 255.255.255.0
|
||||
+#define CONFIG_GATEWAYIP 192.168.1.254
|
||||
+
|
||||
+/* BOOTP options */
|
||||
+#define CONFIG_BOOTP_SUBNETMASK
|
||||
+#define CONFIG_BOOTP_GATEWAY
|
||||
+#define CONFIG_BOOTP_HOSTNAME
|
||||
+
|
||||
+/* SPI */
|
||||
+#ifdef CONFIG_CMD_SPI
|
||||
+#define CONFIG_DEFAULT_SPI_BUS 2
|
||||
+#define CONFIG_DEFAULT_SPI_MODE SPI_MODE_0
|
||||
+#endif
|
||||
+
|
||||
+/* Boot Linux */
|
||||
+#define CONFIG_BOOTDELAY 1
|
||||
+#define CONFIG_BOOTFILE "zImage"
|
||||
@ -596,7 +575,7 @@ Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
|
||||
+ "setexpr i ${update_fw_parts}; setexpr error 0; " \
|
||||
+ "while itest ${i} -gt 0; do " \
|
||||
+ "echo Transfering firmware image part ${i} of ${update_fw_parts}; " \
|
||||
+ "if itest ${i} -le 9; then " \
|
||||
+ "if itest ${i} -le f; then " \
|
||||
+ "setenv j 0${i}; " \
|
||||
+ "else " \
|
||||
+ "setenv j ${i}; " \
|
||||
@ -625,7 +604,6 @@ Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
|
||||
+ "erase_env2=mmc erase 200 100\0" \
|
||||
+ "image=zImage\0" \
|
||||
+ "console=ttyAMA0\0" \
|
||||
+ "fdt_file=imx28-duckbill-2.dtb\0" \
|
||||
+ "fdt_addr=0x41000000\0" \
|
||||
+ "boot_fdt=try\0" \
|
||||
+ "ip_dyn=yes\0" \
|
||||
|
@ -1,36 +0,0 @@
|
||||
From c5b0bca4c3ca5c3d1d8ee99fdbf3b494a3986dbd Mon Sep 17 00:00:00 2001
|
||||
From: Hauke Mehrtens <hauke@hauke-m.de>
|
||||
Date: Sun, 18 Mar 2018 16:03:47 +0100
|
||||
Subject: [PATCH] tools/mxsimage: Support building with LibreSSL
|
||||
|
||||
The mxsimage utility fails to compile against LibreSSL version < 2.7.0
|
||||
because LibreSSL says it is OpenSSL 2.0, but it does not support the
|
||||
complete OpenSSL 1.1 interface.
|
||||
|
||||
LibreSSL defines OPENSSL_VERSION_NUMBER with 0x20000000L and therefor
|
||||
claims to have an API compatible with OpenSSL 2.0, but it implements
|
||||
EVP_MD_CTX_new(), EVP_MD_CTX_free() and EVP_CIPHER_CTX_reset() only
|
||||
starting with version 2.7.0, which is not yet released. OpenSSL
|
||||
implements this function since version 1.1.0.
|
||||
|
||||
This commit will activate the compatibility code meant for
|
||||
OpenSSL < 1.1.0 also for LibreSSL version < 2.7.0.
|
||||
|
||||
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
|
||||
Reviewed-by: Jonathan Gray <jsg@jsg.id.au>
|
||||
---
|
||||
tools/mxsimage.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/tools/mxsimage.c
|
||||
+++ b/tools/mxsimage.c
|
||||
@@ -26,7 +26,8 @@
|
||||
* OpenSSL 1.1.0 and newer compatibility functions:
|
||||
* https://wiki.openssl.org/index.php/1.1_API_Changes
|
||||
*/
|
||||
-#if OPENSSL_VERSION_NUMBER < 0x10100000L
|
||||
+#if OPENSSL_VERSION_NUMBER < 0x10100000L || \
|
||||
+ (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x2070000fL)
|
||||
static void *OPENSSL_zalloc(size_t num)
|
||||
{
|
||||
void *ret = OPENSSL_malloc(num);
|
@ -3,7 +3,7 @@ needed dependencies are added too.
|
||||
|
||||
--- a/tools/Makefile
|
||||
+++ b/tools/Makefile
|
||||
@@ -163,7 +163,7 @@ endif
|
||||
@@ -147,7 +147,7 @@ endif
|
||||
# MXSImage needs LibSSL
|
||||
ifneq ($(CONFIG_MX23)$(CONFIG_MX28)$(CONFIG_ARMADA_38X)$(CONFIG_ARMADA_39X)$(CONFIG_FIT_SIGNATURE),)
|
||||
HOSTLOADLIBES_mkimage += \
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user