When bumping buildroot to Python 3, we need to assure, that Python
symlink in staging bin directory points to Python >= 3.5 as well.
We can't rely completly just on SetupHostCommand as its executed only in
cases when the $(STAGING_DIR_HOST)/bin/python doesn't already exist, so
we need to remove it before running SetupHostCommand.
Acked-by: Yousong Zhou <yszhou4tech@gmail.com>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
This patch switches Python used in buildroot to Python 3 as Python 2.x
series is going to be EOL relatively soon[1].
"Being the last of the Python 2.x series, 2.7 will have an extended
period of maintenance. Specifically, 2.7 will receive bugfix support
until January 1, 2020. After the last release, 2.7 will receive no
support."
It seems like Python 3 is going to be needed in order to support Meson
build system which has gained some traction recently.
Build tested on following targets:
ath79/generic
imx6/generic
ipq40xx/generic
lantiq/xway
layerscape/armv7 (broken)
layerscape/armv8_32b (broken)
layerscape/armv8_64b (broken)
mvebu/cortexa72
ramips/mt7621
ramips/mt7620
sunxi/cortexa7
x86/64
Layerscape targets are unfortunately left broken as their ls-rcw
firmware package uses Python 2 and converting it to Python 3 would take
more then reasoanble amount of time (I've tried to fix it already) and
would be better fixed by someone who can even run test it.
Run tested on ath79 (Archer C7 v5), ipq40xx (nbg6617) and x86_64 (QEMU
and apu2).
1. https://www.python.org/dev/peps/pep-0373/
Ref: PR#1937
Cc: Yangbo Lu <yangbo.lu@nxp.com>
Cc: Mathew McBride <matt@traverse.com.au>
Acked-by: Yousong Zhou <yszhou4tech@gmail.com>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
Python 2.7 will not be maintained past 2020. Let's convert
to python3 for rcw. Also drop byte swapping since TF-A had
been already used which handled byte swapping instead.
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
Build tested on ath79 with following packages from packages feed which
build depends on scons. None of them build anymore as it seems, that the
SConscripts are written for Python2.
* packages/net/iotivity (KO, doesn't build even with latest 1.3.1 release)
SyntaxError: invalid syntax
File "/openwrt/build_dir/target-mips_24kc_musl/iotivity-1.2.1/build_common/SConscript", line 40
print "\nError: Current system (%s) isn't supported\n" % host
LookupError: unknown encoding: string_escape:
File "/home/petr/testing/openwrt/build_dir/target-mips_24kc_musl/iotivity-1.3.1/SConstruct", line 28:
SConscript('build_common/SConscript')
* packages/net/smartsnmpd (KO, seems dead, no commit since 2015):
SyntaxError: Missing parentheses in call to 'print'
File "/openwrt/build_dir/target-mips_24kc_musl/smartsnmpd-2014-08-13/SConstruct", line 156
print "Can't find liblua or liblua5.1!"
* packages/utils/gpsd (KO, doesn't build even with latest 3.18.1 release):
AttributeError: 'list' object has no attribute 'keys':
File "/openwrt/build_dir/target-mips_24kc_musl/gpsd-3.18.1/SConstruct", line 1758:
all_manpages = list(base_manpages.keys()) + list(python_manpages.keys())
Signed-off-by: Petr Štetiar <ynezz@true.cz>
The lines-initial-states property was an early attempt to set the latch
bit of the shift register on driver probe. It is not implemented in the
driver and was rejected upstream. The latch bit was always set by a GPIO
hog, so this property is safe to drop.
Signed-off-by: David Bauer <mail@david-bauer.net>
There's an empty case in 02_network introduced by last commit. Drop it.
Fixes: ee650ba46c ("ramips: remove needless setting of lan_mac to eth0 in 02_network")
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
This removes superfluous lines like
lan_mac=$(cat /sys/class/net/eth0/address)
Since lan_mac only sets the MAC address for eth0.1, these lines
can be safely removed as the address will be inherited from eth0
anyway.
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
The vast majority of devices labels "factory" partition with lower
case. Convert the small fraction with capital letter to that and
merge another case in 02_network.
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
This just merges some duplicate definitions and consolidates lines.
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Signed-off-by: Chuanhong Guo <gch981213@gmail.com> [merge duplicated
cases for phicomm k2p]
This cosmetical patch is just meant to make comparing/checking
IMAGE_SIZE values easier.
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
There are frequent examples of the ralink_default_fw_size_xxx
variables being used to "roughly" set flash size without caring
about the actual size of the firmware partition.
To discourage this behavior, this patch removes the variables and
just sets IMAGE_SIZE by its numeric value for each target.
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Currently, ramips target defines 0x7b0000 as default IMAGE_SIZE
for all devices in ramips target, i.e. this will be set if a
device does not specify IMAGE_SIZE itself.
From 92 devices using that default due to a "missing" IMAGE_SIZE,
14 were incorrect by a small amount (i.e. still "8M" flash) and
12 were completely off ("16M", "4M", ...).
This patch thus removes the _default_ IMAGE_SIZE and defines
IMAGE_SIZE for each device individually. This should indicate to
people supporting new devices that this parameter has to be cared
about.
For the present code, this patch is cosmetical.
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
This fixes IMAGE_SIZE for all devices based on the partition size
given in DTS:
DEVICE *.MK *.DTS VERDICT
airlink101_ar670w (4M) 0x3c0000 wrong
airlink101_ar725w - 0x3B0000 wrong
asus_rt-n15 (4M) 0x3b0000
belkin_f5d8235-v1 7744k 0x7b0000 wrong
buffalo_wli-tx4-ag300n (4M) 0x3b0000
buffalo_wzr-agl300nh (4M) 0x3b0000
dlink_dap-1522-a1 3801088 0x3a0000
ralink_v11st-fe (4M) 0x003b0000
asus_rt-n56u - 0x007b0000 default
belkin_f9k1109v1 7224k 0x7a0000 wrong
dlink_dir-645 - 0x7b0000 default
edimax_br-6475nd 7744k 0x00790000
loewe_wmdr-143n - 0x7b0000 default
omnima_hpm 16064k 0x00fb0000
samsung_cy-swr1100 - 0x7b0000 default
sitecom_wlr-6000 7244k 0x713000
trendnet_tew-691gr - 0x007b0000 default
trendnet_tew-692gr - 0x007b0000 default
No verdict means that the device is correctly set.
Legend:
( ): Value is set via ralink_default_fw_size_xxM
[ ]: Value is derived from parent definition
- : Value is not set and derived from default definition
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
In ramips, there are the following predefined values for IMAGE_SIZE
ralink_default_fw_size_4M 3866624 3776k 0x3B0000
ralink_default_fw_size_8M 8060928 7872k 0x7B0000
ralink_default_fw_size_16M 16121856 15744k 0xF60000
ralink_default_fw_size_32M 33226752 32448k 0x1FB0000
Out of those, the "16M" value is obviously odd, as it provides more
room for the remaining partitions than the tree others.
Of the devices in all subtargets, there are actually > 50 that have
a firmware partition with 0xFB0000 size, while only 5 (!) have
0xF60000. From the former, many are set to
ralink_default_fw_size_16M anyway, although it is wrong at the
present point.
Consequently, it makes sense to change ralink_default_fw_size_16M
to 0xFB0000, and to update IMAGE_SIZE for the 5 devices with
0xF60000.
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
allnet_all0256n-4m, tenda_w150m and unbranded_wr512-3gn-4m have
their firmware partition set to reg = <0x50000 0x3c8000>.
However, based on the 4MB flash, the size should be 0x3b0000.
After some research in the target's history, it looks like the
changed size has been a mistake when transferring device
partitions from Makefile to DTS in 770b28f146.
This patch changes the named three devices back to 0x3b0000.
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Like most mt7621 boards, Phicomm K2P stores LAN/WAN mac addresses
at 0xe000/0xe006 of factory partition.
Phicomm uses lan_mac-1 as wan_mac, while our default case in 02_network
uses lan_mac+1.
Add a special case reading lan/wan mac address for Phicomm K2P.
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
Backport upstream patches pre 2.81rc for testing purposes.
Let's see what falls out!
Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
Now that the mt76 driver supports the MT7615D chip found on these
devices, use it.
Also add the wpad-basic package.
Note: the driver supports operation on both the 2.4 GHz and the
5 GHz bands, but not yet concurrently.
Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
savedscp is a method of storing the DSCP of an ip packet into conntrack
mark. In combination with a suitable tc filter action (conndscp but may
end up being integrated into connmark) DSCP values are able to be stored
on egress and restored on ingress across links that otherwise alter or
bleach DSCP.
This is useful for qdiscs such as CAKE which are able to shape according
to policies based on DSCP.
Ingress classification is traditionally a challenging task since
iptables rules haven't yet run and tc filter/eBPF programs are pre-NAT
lookups, hence are unable to see internal IPv4 addresses as used on the
typical home masquerading gateway.
The ingress problem is solved by the tc filter, but the tc people didn't
like the idea of tc setting conntrack mark values, though they are ok
with reading conntrack values and hence restoring DSCP from conntrack
marks.
x_tables CONNMARK with the new savedscp action solves the problem of
storing the DSCP to the conntrack mark.
It accepts 2 parameters. The mark is a 32bit value with usually one 1
bit set. This bit is set when savedscp saves the DSCP to the mark.
This is useful to implement a 'one shot'
iptables based classification where the 'complicated' iptables rules are
only run once to classify the connection on initial (egress) packet and
subsequent packets are all marked/restored with the same DSCP. A mark
of zero disables the setting of a status bit/s.
The mask is a 32bit value of at least 6 contiguous bits and represents
the area where the DSCP will be stored.
e.g.
iptables -A QOS_MARK_eth0 -t mangle -j CONNMARK --savedscp-mark 0xfc000000/0x01000000
Would store the DSCP in the top 6 bits of the 32bit mark field, and use
the LSB of the top byte as the 'DSCP has been stored' marker.
Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
iptables: connmark - add savedscp option
Naive user space front end to xt_connmark 'savedscp' option.
e.g.
iptables -A QOS_MARK_eth0 -t mangle -j CONNMARK --savedscp-mark 0xfc000000/0x01000000
Will save DSCP into the top 6 bits and OR 0x01 (ie set) the least
significant bit of most significant byte.
Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
This reverts commit fe928c7a81 as it seems
to introduce build breakage when local.mk doesn't exist.
make --trace
toplevel.mk:216: target 'local.mk' does not exist
Signed-off-by: Petr Štetiar <ynezz@true.cz>
All leds on these boards are green. v1 has RFKILL GPIO 23 for production
units (it had GPIO 13 only for test phase units, and these are rather
very rare to find). As for the previous attempt to fix this and revert
due to WDR boards have blue leds, it was wrong: WDR board does not use
common setup (false).
Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
Base address for USB0 has changed from 0x18116c94 on AR934X
to 0x18116d94 on QCA9558. CP Typo remained for years here...
Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
fiptool is a host tool, used in a firmware generation pipeline, but it's
not treated as such, leading to the build breakage on the hosts which
don't have {Open,Libre}SSL dev package installed:
In file included from fiptool.h:16:0,
from fiptool.c:19:
fiptool_platform.h:18:27: fatal error: openssl/sha.h:
No such file or directory
# include <openssl/sha.h>
So this patch promotes fiptool into the host tool with proper host
include and library paths under STAGING_DIR.
Ref: https://github.com/openwrt/openwrt/pull/2267
Signed-off-by: Petr Štetiar <ynezz@true.cz>
I tend to automate most of the boring and repetitive tasks like firmware
flashing, build config reconfiguration etc., so I always end up adding
`include local.mk` as a last line in my Makefile, where local.mk is
usually symlink to some other place, just to not accidentally delete it
during `git clean`.
Carrying this single uncommited modification along in the development
process is quite PITA, because it's causing problems during Git
workflow, while rebasing etc.
I hope, that I'm not alone using similar workflow, so I believe, that
this modification might be useful for others as well.
Signed-off-by: Petr Štetiar <ynezz@true.cz>
Change capitalization from spaces to tabs in order to match
the style of the file.
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
[fix capitalization in commit title, add short description]
Signed-off-by: David Bauer <mail@david-bauer.net>
Hardware spec of DIR-842 C2:
SoC: QCA9563
DRAM: 128MB DDR2
Flash: 16MB SPI-NOR
Switch: QCA8337N
WiFi 5.8GHz: QCA9888
WiFi 2.4Ghz: QCA9563
USB: 2.0
Flash instructions:
1. Upgrade the factory.bin through the factory web interface or
the u-boot failsafe interface.
The firmware will boot up correctly for the first time.
Do not power off the device after OpenWrt has booted.
Otherwise the u-boot will enter failsafe mode as the checksum
of the firmware has been changed.
2. Upgrade the sysupgrade.bin in OpenWrt.
After upgrading completes the u-boot won't complain about the
firmware checksum and it's OK to use now.
3. If you powered off the device before upgrading the sysupgrade.bin,
just upgrade the factory.bin through the u-boot failsafe interface
and then goto step 2.
Signed-off-by: Jackson Lim <jackcolentern@gmail.com>
[Reword reset-hog comment, fix formatting]
Signed-off-by: David Bauer <mail@david-bauer.net>
Newifi D1 is shipped with an 8GB microSD card in its SD slot
Without SD driver users would not be able to use it unless manually installed
Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
Making all in tests
depbase=`echo handshake_table.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -DPACKAGE_NAME=\"libressl\" -DPACKAGE_TARNAME=\"libressl\" -DPACKAGE_VERSION=\"2.9.2\" -DPACKAGE_STRING=\"libressl\ 2.9.2\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"libressl\" -DVERSION=\"2.9.2\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE_SYMLINK=1 -DHAVE_ERR_H=1 -DHAVE_READPASSPHRASE_H=1 -DHAVE_ASPRINTF=1 -DHAVE_MEMMEM=1 -DHAVE_READPASSPHRASE=1 -DHAVE_STRLCAT=1 -DHAVE_STRLCPY=1 -DHAVE_STRNDUP=1 -DHAVE_STRNLEN=1 -DHAVE_STRSEP=1 -DHAVE_TIMEGM=1 -DHAVE_GETPROGNAME=1 -DHAVE_SYSLOG=1 -DHAVE_POLL=1 -DHAVE_SOCKETPAIR=1 -DHAVE_ARC4RANDOM=1 -DHAVE_ARC4RANDOM_BUF=1 -DHAVE_ARC4RANDOM_UNIFORM=1 -DHAVE_TIMINGSAFE_BCMP=1 -DHAVE_CLOCK_GETTIME=1 -DHAVE_VA_COPY=1 -DHAVE___VA_COPY=1 -DSIZEOF_TIME_T=8 -I. -I../include -I../include/compat -DLIBRESSL_INTERNAL -D__BEGIN_HIDDEN_DECLS= -D__END_HIDDEN_DECLS= -I ../crypto/modes -I ../crypto/asn1 -I ../ssl -I ../tls -I ../apps/openssl -I ../apps/openssl/compat -D_PATH_SSL_CA_FILE=\"../apps/openssl/cert.pem\" -I/Users/kevin/wrt/staging_dir/host/include -D__STRICT_ALIGNMENT -O2 -I/Users/kevin/wrt/staging_dir/host/include -fpic -Wall -std=gnu99 -fno-strict-aliasing -fno-strict-overflow -D_FORTIFY_SOURCE=2 -fstack-protector-strong -Qunused-arguments -Wno-pointer-sign -MT handshake_table.o -MD -MP -MF $depbase.Tpo -c -o handshake_table.o handshake_table.c &&\
mv -f $depbase.Tpo $depbase.Po
make[4]: *** No rule to make target `/Users/kevin/wrt/build_dir/host/libressl-2.9.2/crypto/.libs/libcrypto_la-cpuid-macosx-x86_64.o', needed by `handshake_table'. Stop.
make[3]: *** [all-recursive] Error 1
A similar error & clues from
e783d60473
"
LibreSSL 2.9.1 now has a test that requires libtls.a, however, when building a
shared library only build, the --disable-static flag is passed to libressl,
which prevents the building of libtls.a.
With libtls.a not being built, the following error occurs:
libressl-2.9.1/tls/.libs/libtls.a', needed by 'handshake_table'. Stop.
There are three options to fix this:
1) Stick with autotools, and provide a patch that removes building anything in
the tests folder.
2) Pass --enable-static to LIBRESSL_CONF_OPTS
3) Change the package type to cmake, as a cmake build does not have this issue."
It appears we cannot change to cmake because cmake has a dependency on
an ssl library.
Take option 1 and do not build the tests.
Also take the opportunity to remove man page building as well.
Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
1) nand_do_upgrade() is always called by a target code
2) nand_do_upgrade() starts with calling platform_nand_pre_upgrade()
It means there is no need for the platform_nand_pre_upgrade() callback
at all. All code that was present there could bo moved & simplly called
by a target right before the nand_do_upgrade().
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
1) RAMFS_COPY_BIN and RAMFS_COPY_DATA can be defined at top of the file
like it's done for all other targets.
2) fw_printenv.lock can be created one step later in the
platform_do_upgrade(). It seems to be working well on many other
targets.
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
This doesn't include 9ff8614a3dbe ("brcmfmac: use separate Kconfig file
for brcmfmac") due to a few conflicts with backports changes.
An important change is:
[PATCH 2/7] brcmfmac: change the order of things in brcmf_detach()
which fixes a rmmod crash in the brcmf_txfinalize().
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>