Commit Graph

670 Commits (34bbbbf9c3b39e7b2d81df590aad5cdbd00280d6)

Author SHA1 Message Date
Zoltan HERPAI 34bbbbf9c3 merge: base: update base-files and basic config
Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
6 years ago
Alif M. Ahmad b1501a684b scripts/config: add qconf files to .gitignore
This commit adds qconf related files to .gitignore.
The files to be tracked are qconf.cc, qconf.h, and images.c.
The files to be ignored are qconf*.o, qconf*, qconf.moc, and
.tmp_qtcheck.

Signed-off-by: Alif M. Ahmad <alive4ever@live.com>
7 years ago
Alif M. Ahmad ff43c03c14 scripts/config: Add qconf target to Makefile
qconf is kconfig UI utilizing QT toolkit. This makes it possible to use
graphical interface interaction to configure LEDE build target.

This commit adds qconf target to ./script/config/Makefile to be used by
toplevel ``make xconfig`` later.

Signed-off-by: Alif M. Ahmad <alive4ever@live.com>
7 years ago
Felix Fietkau 349bb6e663 scripts/config: add -DKBUILD_NO_NLS to CXXFLAGS
Preparation for adding C++ code which needs the same flag

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Alif M. Ahmad 96eb96c3f0 scripts/config: import qconf
Import qconf.cc, qconf.h, and images.c from linux kernel 4.9.13 archive.

Signed-off-by: Alif M. Ahmad <alive4ever@live.com>
7 years ago
Lorenzo Santina fd84ecda7d treewide: fix shellscript syntax errors/typos
Fix multiple syntax errors in shelscripts (of packages only)
These errors were causing many conditions to not working properly

Signed-off-by: Lorenzo Santina <lorenzo.santina@edu.unito.it>
[increase PKG_RELEASE, drop command substitution from directip.sh]
Signed-off-by: Mathias Kresin <dev@kresin.em>
7 years ago
Baptiste Jonglez b30ba14e2a scripts/download.pl: fail loudly if provided hash is unsupported
Currently, if the provided hash is unsupported (length different from 32
or 64 bytes), we happily download the requested file without any kind of
checksum verification.

This is quite dangerous and may provide a false sense of security, because
a single typo in the hash (e.g. one character deleted by mistake) may skip
checksum verification entirely.

Instead, fail immediately if we don't support the provided hash.
In particular, if an external package repository decides to change the
hash algorithm one day, we will now fail loudly instead of skipping
checksum verification without complaints.

Note: if some users of scripts/download.pl knowingly provide an empty hash
because they don't need checksum verification, this change will break
them.  This does not seem to be the case currently, but if this feature is
ever needed, an option should be added to download.pl instead of relying
on the hash being empty.

Fixes: eaa4eba10a ("scripts/download.pl: add SHA-256 support")

Signed-off-by: Baptiste Jonglez <git@bitsofnetworks.org>
7 years ago
Zoltan Gyarmati 0a761fe8ef scripts/dowload.pl: use glob to expand target dir
If CONFIG_DOWNLOAD_FOLDER is set to for example "~/dl", the download
script fails to create the .hash and .dl files with the following
errors:
 Cannot create file ~/dl/dropbear-2017.75.tar.bz2.dl: No such file or directory
 sh: 1: cannot create ~/dl/dropbear-2017.75.tar.bz2.hash: Directory nonexistent

If the tarball already exists in the ~/dl dir, it's properly found and
used, so this issue only affects the download.pl script.
 This patch calls glob() on the target dir parameter, which will expand `~`.

Signed-off-by: Zoltan Gyarmati <mr.zoltan.gyarmati@gmail.com>
7 years ago
Jo-Philipp Wich bf5d32af2a scripts/package-metadata.pl: inhibit compile deps on missing build types
When a package declares a PKG_BUILD_DEPENDENCY or HOST_BUILD_DEPENDENCY on
a not existing build type, the metadata script will emit a reference to an
unresolvable build target in tmp/.packagedeps, causing the make process to
fail hard in a way not catchable by the IGNORE_ERRORS mechanism.

In a situation where a package "test-a" declares a build dependency
"PKG_BUILD_DEPENDS:=test-b/host" while the Makefile of "test-b" does not
implement a HostBuild, make fails with an unrecoverable error in the form:

    make[1]: Entering directory '...'
    make[1]: *** No rule to make target 'package/test-b/host/compile',
                 needed by 'package/test-a/compile'.  Stop.
    make[1]: Leaving directory '...'
    .../toplevel.mk:200: recipe for target 'package/test-a/compile' failed
    make: *** [package/test-a/compile] Error 2

Extend the metadata generation script to catch such unresolved references
and emit a visable warning upon detection.

After this change, the script will emit a warning similar to:

    WARNING: Makefile "package/test-a/Makefile" has a build dependency on
    "test-b/host" but "package/test-b/Makefile" does not implement a
    "host" build type

Fixes a global build cluster outage which occured after the "python-cffi"
feed package removed its HostBuild which the "python-cryptography" package
build-depended on.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years ago
Jo-Philipp Wich 9e64874fb2 build: bundle-libraries.sh: do not override argv[0] in inner exec calls
Only mangle argv[0] of the first executed process and leave the argument
vector of subsequent invocations as-is to allow child programs to properly
discover resources relative to their binary locations.

Fixes "cc1" discovery when executing the host gcc through the bundled
"ccache" executable.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years ago
Daniel Engberg 99c4295126 scripts/download.pl: Adjust URLs
Internet2 isn't considered a trusted issuer meaning that https links to
rit.edu will fail.

The host mirror.csclub.uwaterloo.ca has a trusted SSL cert and peering
is good so it can replace rit.edu without performance issues.

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
[Jo-Philipp Wich: rewrapped commit message]
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years ago
Jo-Philipp Wich ef1cafa736 build: fix invocation of bundled ld.so in SDK and Imagebuilder
Commit 72d751cba9 "build: rework library bundling" introduced a new helper
binary "runas" whose sole purpose was mangling the argv vector passed to
the actual called ELF image so that the renamed executable could obtain the
proper name from argv[0].

This approach, however totally defeated the purpose of calling bundled ELF
executables through the shipped ld.so loader since the execv() invocation
performed by "runas" would cause the kernel the interprete the final program
image through the system ELF loader again.

To solve the problem, use an alternative approach of shipping a shared object
"runas.so" which uses an ELF ".init_array" function pointer to obtain the
argv[] vector of the to-be-executed main() function and mangle it in-place.

The actual argv[0] value to use is communicated out-of-band using an
environment variable "RUNAS_ARG0" by the shell wrapper script. The wrapper
script also takes care of setting LD_PRELOAD to instruct the shipped ELF
loader to preload the actual ELF program image with the "runas.so" helper
library.

Fixes FS#909.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years ago
Stijn Tintel 6a8cbc08c0 scripts/gen_image_generic.sh: drop NOGRUB variable
It's not used since commit 816a9b30f6.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
7 years ago
Stijn Tintel a576ed5437 scripts/gen_image_generic.sh: move from x86/image
The script can also be useful for other targets.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
7 years ago
Stijn Tintel c2a11bc8e4 scripts: make all scripts executable
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
7 years ago
Stijn Tintel cf96453ac9 scripts/openbsd.sh: remove script
Commit 6f5f328003 removed freebsd.sh
because it was outdated and bad practice. Let's be consistent and remove
openbsd.sh as well.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
7 years ago
Yousong Zhou 80d9ec5d3d scripts/package-metadata.pl: parse and validate field Require-User
The script will now detect uid/gid collision and can generate a table of
current allocation

    ./scripts/package-metadata.pl usergroup tmp/.packageinfo \
	| sort -k 1,1r -k 3,3n \
	| column -t

This should ensure that no collision will happen for each single build

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
7 years ago
Felix Fietkau cbe0a7ecc0 scripts/download.pl: print the command used to download files
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Florian Fainelli 6704410b15 scripts: Probe external toolchains for libthread-db
libthread-db is a package that can be configured for external
toolchains, so let's have the script probe for it.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
7 years ago
Florian Fainelli 08fb61d316 scripts: Probe external toolchains for libgomp
Now that libgomp can be a package, probe external toolchains for that
library.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
7 years ago
Bastian Köcher 5378c85677 build: remove absolute path to perl and replace with /usr/bin/env perl
Signed-off-by: Bastian Köcher <git@kchr.de>
7 years ago
Yousong Zhou 50fcfd4b65 scripts/qemustart: initial version
The script can be used to quickly spin up QEMU virtual machines with lan
and wan network.  Please read the initial part of the script for
instructions about how to configure host machine

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
7 years ago
Felix Fietkau 2fd1503378 scripts/download.pl: fix error message on hash mismatch
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Hauke Mehrtens d5a770f2c1 scripts: only generate config from feature flag if fully match
Without this change the code checked if the string was contained in the
feature option and not if the string matches the complete word. This only
removes the nand option from the omap24xx target, the other changes are
only removing options which were added twice.

Signed-off-by: Hauke Mehrtens <hauke.mehrtens@intel.com>
7 years ago
Michal Sojka b1f102b03e scripts/feeds: Reuse TOPDIR if defined in environment
The feeds script sets value of TOPDIR in a way that is inconsistent
with how toplevel Makefile sets it. The inconsistency manifests when I
use a "build directory" with symlinks to LEDE source (see below).

When make is invoked in such a directory, make's TOPDIR variable is
set to that directory, whereas scripts/feeds sets TOPDIR to the top of
LEDE source, which results in creating feeds directory inside the LEDE
source instead of in the build directory.

This patch changes the script so that it reuses the TOPDIR value form
the environment if it exists. The result is that 'make
package/symlinks' correctly fetches feeds to the build directory
instead in the source.

I use the following commands to create the build directory:

    ln -s $SRC/config config
    ln -s $SRC/Config.in Config.in
    ln -s $SRC/feeds.conf.default feeds.conf.default
    ln -s $SRC/include include
    ln -s $SRC/Makefile Makefile
    mkdir package
    ln -s $SRC/package/base-files package/base-files
    ln -s $SRC/package/boot package/boot
    ln -s $SRC/package/devel package/devel
    ln -s $SRC/package/firmware package/firmware
    ln -s $SRC/package/kernel package/kernel
    ln -s $SRC/package/libs package/libs
    ln -s $SRC/package/Makefile package/Makefile
    ln -s $SRC/package/network package/network
    ln -s $SRC/package/system package/system
    ln -s $SRC/package/utils package/utils
    ln -s $SRC/rules.mk rules.mk
    ln -s $SRC/scripts scripts
    ln -s $SRC/target target
    ln -s $SRC/toolchain toolchain
    ln -s $SRC/tools tools

This allows me to easily test changes in LEDE on multiple targets.

Signed-off-by: Michal Sojka <sojkam1@fel.cvut.cz>
7 years ago
Felix Fietkau 663f2a0864 gen-dependencies.sh: fix handling variations in "file" output
On some systems, file adds ", with debug info" after "not stripped"

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau b9b681c067 rstrip.sh: fix handling variations in "file" output
On some systems, file adds ", with debug info" after "not stripped"

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Jo-Philipp Wich 3bfcd21e4b feeds: add option to force feed update despite modified files
Implement a new flag "-f" for the feeds update command which causes the
script to fall back to a more agressive git update strategy in case there
are locally modified files in the feeds directory.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years ago
Felix Fietkau 9dcb921d90 build: add buildbot specific config option for setting defaults
This can be used to tweak the buildbot behavior without having to change
buildbot's configuration.
It will also allow us to add more aggressive clean steps (e.g. on
toolchain changes), which would break developers' workflows if enable
by default.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Sven Eckelmann 8cc4d1e27b scripts/om-fwupgradecfg-gen.sh: add support for the A60
Signed-off-by: Sven Eckelmann <sven.eckelmann@open-mesh.com>
7 years ago
Felix Fietkau f55c29e4c7 build: remove libc version suffix from build/staging directories
Our supported libcs are ABI compatible across version upgrades

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Jo-Philipp Wich 68bef935d5 scripts: get_source_date_epoch.sh: fix mercurial support, add mtime fallback
Add a fallback case to get_source_date_epoch.sh which reports the modification
time of the script itself in case there is no SCM information available, e.g.
when downloading .tar.gz or .zip tarballs produced by Github.

Also fix the mercurial case while we're at it.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years ago
Magnus Kroken 289f2a8ce3 scripts/getver.sh: append short git hash based on upstream commit
The short git hash suffix printed by getver.sh is taken from the
latest local commit, change this to use the hash from latest
upstream commit if available. This is considered the intended
behavior based on commit message a642a11fac,
introducing getver.sh.

Signed-off-by: Magnus Kroken <mkroken@gmail.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 74c09e714e download.pl: fix detecting download errors with curl
Avoid treating error pages as successfully downloaded content

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau cfd83555fc scripts/package-metadata.pl: fix overriding conditional dependencies with conditional select
Conditional dependencies use the '(!cond) || dep' syntax, whereas
conditional select uses 'dep if cond'.
Add an extra check to suppress emitting a conditional if an equal
conditional select already exists.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Jo-Philipp Wich 72d751cba9 build: rework library bundling
Rework the bundle-libraries.sh implementation to use a more robust approach
for executing host binaries through the shipped ELF loader and libraries.

The previous approach relied on symlinks pointing to a wrapper script which
caused various issues, especially with multicall binaries as the original
argv[0] name was not preserved through the ld.so invocation. Another down-
side was the fact that the actual binaries got moved into another directory
which caused executables to fail looking up resources with paths relative
to the executable location.

The new library wrapper implements the following improvements:

 - Instead of symlinks pointing to a common wrapper, each ELF executable
   is now replaced by a unqiue shell script which retains the original
   program name getting called

 - Instead of letting ld.so invoke the ELF executable directly, launch
   the final ELF binary through a helper program which fixes up the argv[0]
   argument for the target program

 - Support sharing a common location for the bundled libraries instead of
   having one copy in each directory containing wrapped binaries

Finally modify the SDK build to wrap the staging_dir and toolchain binaries
which allows to use the SDK on systems with a different glibc version.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years ago
Felix Fietkau 84bd74057f build: use mkhash to replace various quirky md5sum/openssl calls
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau dad48c6438 build: add a small standalone utility for calculating md5/sha256 hash
This will be used to simplify the build system code for checking hashes.
Instead of using various variants of md5sum / openssl, use one simple
utility for all of them

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Brian J. Murrell fc6b6f4583 download.pl: use curl in preference to wget
Because wget doesn't know how to do Negotiate authentication with a proxy
and curl does, use curl if it's present. The user is expected to have a
~/.curlrc that sets the options necessary for any proxy authentication.

A ~/.curlrc is completely optional however and curl will work in exactly
the same manner as wget without one.

Signed-off-by: Brian J. Murrell <brian@interlinx.bc.ca>
[Jo-Philipp Wich: Rework code to detect curl usability by checking --version,
                  Use vararg style open() to bypass the shell when downloading,
                  Use Text::ParseWords to decompose env vars into arguments]
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years ago
Alberto Bursi c24172cad1 package/Makefile & ipkg-make-index.sh: add full package data list
The external script used to generate the package lists for the
LEDE wiki's table of packages [1] and package indexes [2] requires
a "Source:" field in the package lists to find package makefiles.
The package makefiles are used to read the package's Category and Submenu.

The "Source:" field was removed in commit
b4aa3c899c
to reduce package list sizes and lessen opkg issues in low ram devices.

Add a separate package list file with full data to be used by the wiki's script.
It's called Packages.manifest and isn't compressed as it's not necessary.

1. https://lede-project.org/packages/start
2. https://lede-project.org/packages/index/start

Signed-off-by: Alberto Bursi <alberto.bursi@outlook.it>
7 years ago
Felix Fietkau 78a1b6e880 scripts/update-package-md5sum: remove file, it is obsoleted by make check FIXUP=1
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau d49059693b build: add FIXUP option for make check
This will attempt to automatically fix common mistakes like using MD5
instead of SHA256, using the MD5SUM variable instead of HASH, or even a
missing mirror file hash.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 651bc94df4 download.pl: check for existing file before the first download attempt
In the build system, flock will prevent multiple concurrent downloads
for the same file. However, if one download request for the same file is
waiting for another one to finish, it will result in downloading the
same file twice consecutively.

Prevent this issue by exiting immediately if the file has already been
downloaded

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau b4aa3c899c ipkg-make-index.sh: drop a few non-essential fields
Saves some more space on the package index

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 34c2b3de66 ipkg-make-index.sh: drop md5sum from package index
We have switched opkg to sha256 a long time ago, and shrinking package
lists is useful for systems that are running low on RAM

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Jo-Philipp Wich a642a11fac scripts: getver.sh: append Git short hash to revision
Change getver.sh to append a short Git commit hash to the end of the artifical
revision number. This way we still have order- and comparable commit numbers
but also a direct relation to the Git commit.

The new output format will look like "r2400+2-882472e" for dirty trees or like
"r2402-882472e" for clean ones.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
8 years ago
Mathias Kresin 59261cbf38 docs: remove all refrences in Makefiles/scripts
The SDK Makefile still trys to copy the docs folder which was removed
with 882f4d2d63. This causes an SDK build
error.

All other removals are just cleanup.

Signed-off-by: Mathias Kresin <dev@kresin.me>
8 years ago
Rafał Miłecki bf3d92f0cd scripts/getver.sh: treat all commits as local if can't find upstream
If something goes wrong and script can't find upstream revision it will
return something like:
r2220
which looks like a valid upstream revision 2220. We cant' distinguish it
from e.g. 2200 upstream commits and 20 local ones.

The new format still provides revision number but also points clearly
that is may be not the upstream one:
r0+2220

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Acked-by: John Crispin < john@phrozen.org>
8 years ago
Rafał Miłecki 0a6439154a scripts/feeds: use git rev-parse for getting revision
It provides simpler output so we don't need extra head and cut commands.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
8 years ago
Rafał Miłecki 4f7947dab8 scripts/feeds: display "X" as revision of uninitialized feeds
So far we were displaying "local" which could be misinterpreted. It
wasn't possible e.g. to say if src-link feed was initialized or not.
Hopefully "X" makes (a bit) more sense.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
8 years ago