Commit Graph

2231 Commits (c61a2395140d92cdd37d3d6ee43a765427e8e318)

Author SHA1 Message Date
Felix Fietkau bfdc56d3a2 build: remove mips16 feature flag from target makefiles
It can be implicitly derived from the MIPS32 revision support in the
kernel configuration

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau cbbd71b6e5 build: remove obsolete mips32r2 CPU_TYPE
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 053dc3b77a build: do not auto-clean packages where the autoremove step has not run
This avoids repeatedly unpacking and rebuilding packages that are
failing the build. Re-running the failing step should be much faster.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 6699f58fdb build: use if-then to avoid non-zero return codes in bin/ packaging code
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau fb07085218 build: fix bin/ package empty check
$(wildcard) is evaluated too early in the build process

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau afd2827c5c build: do not create empty directories in bin/
Some packages may not install any files

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 0e22d63775 build: fix CONFIG_AUTOREMOVE for packages with multiple variants
Calling the clean target removes all .ipk files and un-stages the
package. Add a new target just for clearing the build dir and call that
one instead of the full clean target

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau f784b3e195 build: fix regression in handling ABI_VERSION
The code was updated without changing $$@ into the proper target
filename

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 5aa03e16a7 build: disable CONFIG_AUTOREMOVE for packages/tools where QUILT is used
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau bc73a7fd98 build: include CONFIG_AUTOREMOVE in HOST_STAMP_PREPARED
Fixes build issues when changing the CONFIG_AUTOREMOVE setting

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 86a72765b9 build: include CONFIG_AUTOREMOVE in STAMP_PREPARED
Fixes build issues when changing the CONFIG_AUTOREMOVE setting

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau d98bb7e6b9 build: extend CONFIG_AUTOREMOVE to tools/
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 131db366a3 build: remove separate /install step for host builds
Reduces the number of recursive make invocations

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 7a523569f7 build: add support for automatically removing build dir contents during build
This is used to save space on buildbot instances.
If any part of a package needs to be rebuild, the whole package is
rebuilt from scratch. Stamp files are preserved to allow dependency
checks to work

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau c150a190f5 build: stage bin/ packages inside PKG_BUILD_DIR
This makes the build slightly more efficient by avoiding the need to
re-stage packages on every full build run.

It is also necessary for the upcoming CONFIG_AUTOREMOVE feature

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 87d9e3462d build: stage unstripped packages inside PKG_BUILD_DIR
This makes the build slightly more efficient by avoiding the need to
re-stage packages on every full build run.

It is also necessary for the upcoming CONFIG_AUTOREMOVE feature

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 8aa93dafc8 build: write ABI_VERSION file when staging the package
The make target does not rewrite the file if the contents didn't
change. This causes make to always consider the target old.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 9228d1c066 build: introduce extra targets that contain only proper dependencies
This can be used to check if targets like prepare or compile are up to date

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 6cf067d084 build: define common subdir targets in rules.mk
Reduce build system clutter and enable further rework

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Mirko Vogt c99f881568 git-kernel: $(SUBDIR) should always be $(LINUX_VERSION)
Before SUBDIR was set to $(PATCHVER) which may
or may not include the minor version number of
the linux kernel version. Usually it doesn't.

So the git-clone'd linux kernel was packed without
the minor version number taken into account, which
broke further processing, as it expected the
extracted dir being named linux-$(LINUX_VERSION)
(=with minor version) rather than linux-$(PATCHVER)
(=without minor version).

Changing SUBDIR to $(LINUX_VERSION) creates
consistent behaviour here.

Signed-off-by: Mirko Vogt <mirko-openwrt@nanl.de>
7 years ago
Matthias Schiffer 3d71786154
build: move STAGING_DIR_HOSTPKG and BUILD_DIR_HOST back to a common directory for all targets
Using a single host package staging dir (and build dir) significantly speeds up
builds when multiple targets are built in succession, especially for large host
packages like NodeJS.

$(STAGING_DIR)/host is kept in addition to $(STAGING_DIR_HOSTPKG) in most
places; it is still used as destination for host files in Build/InstallDev.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
7 years ago
Jo-Philipp Wich 5faad30d5d build: properly pass CPP and CXX flags in HOST_MAKE_VARS
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years ago
Alexandru Ardelean e9d20f1f87 build: introduce default HOST_MAKE_VARS for host-builds
Inspired/adapted from `package-defaults.mk` MAKE_VARS.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
7 years ago
Andrej Vlasic 5c20a4fec9 ubox: turn logd into a separate package
Currently system log is always included as a part of ubox. Add logd as a
seperate package and add it to default packages list.

Signed-off-by: Andrej Vlasic <andrej.vlasic@sartura.hr>
Signed-off-by: Luka Perkov <luka.perkov@sartura.hr>
7 years ago
Matthias Schiffer 9c55dede26
include/feeds.mk: base list of enabled feeds on available instead of installed feeds
This fixes handling of CONFIG_FEED_* options for uninstalled feeds.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
7 years ago
Matthias Schiffer 12d0a66942
include/autotools.mk: use STAGING_DIR_HOSTPKG where appropriate
Make sure binaries install to STAGING_DIR_HOSTPKG are still found when
this variable is eventually modified.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
7 years ago
Hauke Mehrtens 5b089e45a6 kernel: update 4.4 kernel to 4.4.42
Refresh patches on all 4.4 supported platforms.
Compile & run tested: lantiq/xrx200

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
7 years ago
Felix Fietkau 8af5e5751d image.mk: add generic function for gzipping images if enabled
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 87b668765e image: when using the new image build code, gzip ext4 images by default
This reduces the amount of hacks in the makefile code.

Remove the apm821xx code to do the same - it was broken and left both
compressed and uncompressed images in $(BIN_DIR)

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Ian Pozella 859693509f image.mk: use LINUX_KARCH rather than ARCH for mkits
The generated 'its' is passed to mkimage which expects linux arch
strings rather than the full arch (e.g. mips not mipsel).

It currently works in some cases where LINUX_KARCH == ARCH but
otherwise you get an unknown arch build error.

Signed-off-by: Ian Pozella <Ian.Pozella@imgtec.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 5919cc2dc4 build: let make check warn about use of legacy PKG_MD5SUM variable in feeds
The variable rename change has been merged in OpenWrt now, so it's
possible to convert the feeds as well.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau b7bee2858b kernel: remove linux 4.1 support
The only target still referencing it is omap24xx, and it is marked as
broken.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Jo-Philipp Wich 90ed0aa859 build: scan.mk: consider KernelPackage pattern as well
The removal of the ".+Package" pattern in scan.mk also caused the build
system to skip over Makefiles defining only kmods. Adjust the grep pattern
to consider packages with "call KernelPackage" signatures as well.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years ago
Jo-Philipp Wich a891e5e14f build: scan.mk: remove overlay broad grep pattern
Commit af0b91c "allow scan.mk to find python packages introduced in [8639]"
added some special casing to scan.mk to accomodate some nonstandard python
packages.

Nowadays this pattern is not needed anymore and produces false positives
when using the LEDE source repository as feed within the SDK since the
metadata scanning wrongly picks up target/imagebuilder/Makefile as package,
leading to an  "ERROR: please fix feeds/base/target/imagebuilder/Makefile"
message.

Remove the now uneeded pattern to fix such stray errors during metadata
scanning.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years ago
Jo-Philipp Wich 83b6bfc235 build: fix HOST_CONFIGURE_VARS placement
Instead of passing HOST_CONFIGURE_VARS as arguments to the configure script,
pass it as environment variables which brings the logic in line with the
behaviour of package-defaults.mk.

The change is needed since passing environment variables as configure
parameters only works with GNU autoconf which evaluates command line arguments
looking like variable assignments. Doing the same with non-autoconf configure
scripts is not guaranteed to work since such scripts might terminate due to
unknown argument errors.

One example case is the cmake configure script which bails out when called
as "./configure LDFLAGS=..." but not when called as "LDFLAGS=... ./configure".

Also change the SHELL override to CONFIG_SHELL in the default
HOST_CONFIGURE_VARS as the former is not properly propagated through the
various GNU configure invocations since it gets lost when configure re-
executes itself.

A prior attempt to change the variable placement had to be reverted due to
the missing SHELL -> CONFIG_SHELL change, leading to misgenerated libtool
executables in various packages.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years ago
Felix Fietkau 1e1d735e52 build: remove obsolete parallel build related options
Always use the main make jobserver, which has been the default for ages

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 5903c46ef8 build: fix build of ubifs images
--force-compr was added by the xz compression patch, which is gone now.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau c2e6ca26e5 build: add image command for calling kernel2minor
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Hauke Mehrtens 88ca6390ea kernel: bump to 4.4.40
Refresh patches on all 4.4 supported platforms.
Compile & run tested: lantiq/xrx200

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
7 years ago
Jo-Philipp Wich 267b05f273 Revert "build: fix HOST_CONFIGURE_VARS placement"
This reverts commit 8395b63aac616f72fd835c59240fc2a4a6b28106.

Various host builds currently rely on the broken behaviour of
HOST_CONFIGURE_VARS so roll back to the previous state.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years ago
Jo-Philipp Wich 28f9df62f5 build: fix HOST_CONFIGURE_VARS placement
Ensure that HOST_CONFIGURE_VARS are set before the actual configure command
instead of passing them as configure command arguments.

This change brings host-build.mk in line with package-defaults.mk and makes
host configure environment variables work as expected.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years ago
Felix Fietkau d2ddda691e build: ensure that prereq-build is run before metadata scan from feeds (FS#367)
Fixes ./scripts/feeds update

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Yousong Zhou 4ebb13a0ef build: unzip: perform operations quietly
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
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
Felix Fietkau bdaa138c0d host-build: remove openssl include path from host cflags
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau f6e6341d89 tools: build libressl on all systems
Useful for having a more consistent build environment and finding API
issues faster

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Stijn Tintel a93accd73d kernel: allow subtarget specific KernelPackage
Add a call to KernelPackage/$(1)/$(BOARD)/$(SUBTARGET) to the
KernelPackage macro. This allows to add kernel packages for x86/64,
without breaking x86. It's not possible to do this with BOARD, as
BOARD=x86 for x86_64.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
7 years ago
Alexandru Ardelean 15d8d9c271 build: drop `trapret` function from non-Linux HOST_TAR variant
Looks like this was meant to workaround some limitations with
non-GNU tar variants (like BSD-tar which are present on Mac os BSD hosts).

Though, I cannot find any use of that `+s` option that's mentioned
in the comment.

Last hash of this I found was 24faf55360

In my case, it now this fails for `python-setuptools` on Mac OS X (the host-build with):
```
trapret 2 tar -C <home-dir>/work/sources-work/lede/build_dir/target-i386_pentium4_musl-1.1.15/python-setuptools-27.2.0 --strip-components=1 -xzf <home-dir>/work/sources-work/lede/dl/setuptools-27.2.0.tar.gz
bash: trapret: command not found
```

So, I was thinking maybe it's time to remove this workaround (9 years later).
I could also fix the `python-setuptools` host build. If that's more preferred.

[ Btw, I just recently transitioned to a Mac machine for dev-ing,
  so a lot of (this Mac) stuff I'm finding out is new to me too. ]

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
7 years ago
Felix Fietkau ffb0181a87 build: add defaults for PKG_SOURCE, PKG_SOURCE_SUBDIR, PKG_VERSION
This makes it easier to unify versioning of git based package downloads.
PKG_SOURCE_DATE along with an 8-character abbreviation of the git hash
is used as PKG_VERSION, PKG_RELEASE should be used like normal packages.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Rafał Miłecki b522292405 base-files: add support for overlaying rootfs content
This adds support for install-overlay define. When used in package it
allows installing files to a special directory that gets copied to the
root when installing it.
It allows overwriting files provided by other packages.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
8 years ago
Kevin Darbyshire-Bryant 79abb8f140 kernel: bump to 4.4.39
Bump & refresh patches for all 4.4 targets.

Compile & run tested: ar71xx Archer C7 v2

Signed-off-by: Kevin Darbyshire-Bryant <kevin@darbyshire-bryant.me.uk>
8 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>
8 years ago
Felix Fietkau 7a315b0b5d build: implement make check and make package/X/check
This is intended to be used for a wide array of package sanity checks.

The first check that is implemented is for the hash of downloaded files.
It checks:
  - Missing hash
  - Use of SHA256 instead of MD5
  - dl/<file> hash not matching hash in makefile
  - deprecated MD5SUM variable

The deprecated MD5SUM variable check is skipped for feeds/ until OpenWrt
is updated as well

Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau 720b99215d treewide: clean up download hashes
Replace *MD5SUM with *HASH, replace MD5 hashes with SHA256

Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau 6a5cc2d085 include/package.mk: sync default value for hash fallback with mirror hash
Simplifies dealing with PKG_HASH vs PKG_MD5SUM

Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau 881c5b47ec build: remove duplicate Download/default definition from include/host-build.mk
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau 7416d2e046 build: replace MD5SUM variables with HASH
Since we've switched to preferring SHA256 over MD5, the old variable
name is misleading. Packages using the old name remain compatible.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Jo-Philipp Wich a4232cd4bf build: use SNAPSHOT instead of CURRENT to designate untagged branch builds
Calling a build ##.##-CURRENT might mislead users into thinking that this
build is the most current release of a branch.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
8 years ago
Felix Fietkau 970dd4dd58 kernel: netfilter: split out iptable_raw into a separate package
This will avoid loading it in the default configuration, which reduces
image size a bit, and (more importantly) improves performance by
avoiding some unnecessary netfilter hooks

Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Jo-Philipp Wich e2f8d200f5 netfilter: drop proprietary xt_id match
The xt_id match was used by the firewall3 package to track its own rules but
the approach has been changed to use xt_comment instead now, so we can drop
this nonstandard extension.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
8 years ago
Felix Fietkau 1b9a39c528 download.mk: improve download tarball reproducibility
Store only numeric user/group id. Group 0 is 'root' on linux and 'wheel' on
BSD and Mac OS X.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau 19d3b78304 download.mk: remove code duplication in $(TAR) call
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau dbbfd41118 download.mk: use $(error) instead of a regular shell error
Useful for further rework

Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Kevin Darbyshire-Bryant f5b833b8fe kernel: bump to 4.4.38
Bump & refresh patches for all 4.4 supported targets.

Compile & run tested: ar71xx - Archer C7 v2

Signed-off-by: Kevin Darbyshire-Bryant <kevin@darbyshire-bryant.me.uk>
8 years ago
Jo-Philipp Wich 9791fb2ac2 build: support adding version code to file names (FS#323)
Now that the VERSION_NUMBER variable holds the human friendly name and not
the commit ID anymore, we need to support adding the revision ID as well.

Introduce a new config variable CONFIG_VERSION_CODE_FILENAMES which, if set,
causes the resulting file names to contain a commit ID designation as printed
by scripts/getver.sh.

Also sanitize the input variables to ensure that the resulting strings are
lowercased and no not contain spaces.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
8 years ago
Álvaro Fernández Rojas 758ef7aa99 kernel: bump to 4.4.36
Refresh patches on all 4.4 supported platforms.
Compile & run tested: brcm2708/bcm2710 - Raspberry Pi 3

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
8 years ago
Florian Fainelli 9a08c0ba80 include/kernel: Switch to git download method
Utilize the existing git download logic from include/download.mk and migrate
the kernel download over to it. This avoids repeatedly cloning kernel sources
after a make target/linux/clean for instance.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name> [fix build error]
8 years ago
Florian Fainelli b9aab34eb4 include/download.mk: Allow specify DownloadMethod specific options
This is going to be used to migrate the hand rolled git clone for the kernel
into using the git download method. The kernel uses custom options that we may
have to pass down.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
8 years ago
Jo-Philipp Wich 5f3c96c285 build: adjust version number handling
Move the revision info to the VERSION_CODE variable and default VERSION_NUMBER
to CURRENT for master branch builds.

Also introduce a new menuconfig option CONFIG_VERSION_CODE which allows users
to override the revision value put into VERSION_CODE and adjust the template
files used by the base-files package to accomodate for the changed semantics.

While we're at it, also adjust the various URLs to match the current web site.

After this commit, the relevent files will look like the examples given below:

    # cat /etc/openwrt_version
    r2398+1

    # cat /etc/openwrt_release
    DISTRIB_ID='LEDE'
    DISTRIB_RELEASE='CURRENT'
    DISTRIB_REVISION='r2398+1'
    DISTRIB_CODENAME='reboot'
    DISTRIB_TARGET='x86/64'
    DISTRIB_DESCRIPTION='LEDE Reboot CURRENT r2398+1'
    DISTRIB_TAINTS='no-all override'

    # cat /usr/lib/os-release
    NAME="LEDE"
    VERSION="CURRENT, Reboot"
    ID="lede"
    ID_LIKE="lede openwrt"
    PRETTY_NAME="LEDE Reboot CURRENT"
    VERSION_ID="current"
    HOME_URL="http://lede-project.org/"
    BUG_URL="http://bugs.lede-project.org/"
    SUPPORT_URL="http://forum.lede-project.org/"
    BUILD_ID="r2398+1"
    LEDE_BOARD="x86/64"
    LEDE_TAINTS="no-all override"
    LEDE_DEVICE_MANUFACTURER="LEDE"
    LEDE_DEVICE_MANUFACTURER_URL="http://lede-project.org/"
    LEDE_DEVICE_PRODUCT="Generic"
    LEDE_DEVICE_REVISION="v0"
    LEDE_RELEASE="LEDE Reboot CURRENT r2398+1"

On a release branch, those files would look like:

    # cat /etc/openwrt_version
    r2399

    # cat /etc/openwrt_release
    DISTRIB_ID='LEDE'
    DISTRIB_RELEASE='16.12-CURRENT'
    DISTRIB_REVISION='r2399'
    DISTRIB_CODENAME='test_release'
    DISTRIB_TARGET='x86/64'
    DISTRIB_DESCRIPTION='LEDE Test Release 16.12-CURRENT r2399'
    DISTRIB_TAINTS='no-all override'

    # cat /usr/lib/os-release
    NAME="LEDE"
    VERSION="16.12-CURRENT, Test Release"
    ID="lede"
    ID_LIKE="lede openwrt"
    PRETTY_NAME="LEDE Test Release 16.12-CURRENT"
    VERSION_ID="16.12-current"
    HOME_URL="http://lede-project.org/"
    BUG_URL="http://bugs.lede-project.org/"
    SUPPORT_URL="http://forum.lede-project.org/"
    BUILD_ID="r2399"
    LEDE_BOARD="x86/64"
    LEDE_TAINTS="no-all override"
    LEDE_DEVICE_MANUFACTURER="LEDE"
    LEDE_DEVICE_MANUFACTURER_URL="http://lede-project.org/"
    LEDE_DEVICE_PRODUCT="Generic"
    LEDE_DEVICE_REVISION="v0"
    LEDE_RELEASE="LEDE Test Release 16.12-CURRENT r2399"

On a release tag, those files would look like:

    # cat /etc/openwrt_version
    r2500

    # cat /etc/openwrt_release
    DISTRIB_ID='LEDE'
    DISTRIB_RELEASE='17.02.1'
    DISTRIB_REVISION='r2500'
    DISTRIB_CODENAME='mighty_unicorn'
    DISTRIB_TARGET='x86/64'
    DISTRIB_DESCRIPTION='LEDE Mighty Unicorn 17.02.1 r2500'
    DISTRIB_TAINTS='no-all override'

    # cat /usr/lib/os-release
    NAME="LEDE"
    VERSION="17.02.1, Mighty Unicorn"
    ID="lede"
    ID_LIKE="lede openwrt"
    PRETTY_NAME="LEDE Mighty Unicorn 17.02.1"
    VERSION_ID="17.02.1"
    HOME_URL="http://lede-project.org/"
    BUG_URL="http://bugs.lede-project.org/"
    SUPPORT_URL="http://forum.lede-project.org/"
    BUILD_ID="r2500"
    LEDE_BOARD="x86/64"
    LEDE_TAINTS="no-all override"
    LEDE_DEVICE_MANUFACTURER="LEDE"
    LEDE_DEVICE_MANUFACTURER_URL="http://lede-project.org/"
    LEDE_DEVICE_PRODUCT="Generic"
    LEDE_DEVICE_REVISION="v0"
    LEDE_RELEASE="LEDE Mighty Unicorn 17.02.1 r2500"

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Acked-by: Felix Fietkau <nbd@nbd.name>
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
Kevin Darbyshire-Bryant 102cb4742c kernel: bump to 4.4.35
Refresh patches on all 4.4 supported platforms.

077-0005-bgmac-stop-clearing-DMA-receive-control-register-rig.patch
removed as now upstream.

Compile & run tested: ar71xx - Archer C7 v2

Signed-off-by: Kevin Darbyshire-Bryant <kevin@darbyshire-bryant.me.uk>
8 years ago
Yousong Zhou f66cb6f810 build: find_md5: ignore non-existent files or directories
Targets like malta can have no patches/ directory available and this
commit tries quash "no such file or directory" messages from `find`

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
8 years ago
Yousong Zhou 62da60b220 build: scan.mk: remove not used variable SCAN_STAMP
It was left behind since rewrite of metadata scanning done with commit
bdc9419 in July 2007

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
8 years ago
Felix Fietkau 77265e00c7 build: add support code for appending metadata to images
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Stijn Tintel 8e47655d4e kernel: update kernel 4.4 to version 4.4.32
Refresh patches for all targets that support kernel 4.4.
Compile-tested on all targets that use kernel 4.4 and aren't marked broken.
Runtime-tested on ar71xx, octeon.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
8 years ago
Koen Vandeputte 3bbc3bd1bd kernel: update kernel 4.4 to version 4.4.31
+ Refresh patches
compile/run-tested on cns3xxx & imx6.

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
8 years ago
Felix Fietkau 64c386c566 build: remove stale .ipk files if package dir changes
If a package nonshared status is changed, a stale .ipk file might still
be present in the old package directory. Remove the .ipk file from all
package directories when building a new one (or explicitly running
clean)

Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Florian Fainelli 57fb5c08f5 include: Cortex-A53 is also an AArch64 CPU
Specifying a mtune option with cortex-a53 is also valid for an aarch64
toolchain

Fixes: SVN 48964
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
8 years ago
Stijn Segers 2f2ea7b44c kernel: update kernel 4.4 to version 4.4.30
This patch bumps the 4.4 kernel from .28 to .30 and refreshes the patches.
Compile-tested on ar71xx, x86/64, ramips/mt7621, brcm47xx and kirkwood.

Run-tested on ar71xx & ramips/mt7621, brcm47xx and kirkwood (last two confirmed
by P. Wassi).

Signed-off-by: Stijn Segers <francesco.borromini@inventati.org>
8 years ago
Jo-Philipp Wich 317b3556a4 include: properly update .install stamp files
Right now the $(PKG_INSTALL_STAMP) files are only written if a package is
selected as <*> but never deleted or emptied if the corresponding package
is getting deselected.

For ordinary packages this usually is no problem as the package/install
recipe performs its own check for enabled packages when assembling the
list of install stamp files to consider, but this logic might fail under
certain circumstances for packages providing multiple build variants.

In case of a multi-variant package, the buildroot first checks if any
of the variants is enabled, then resolves all variants of the common
source package and finally processes the corresponding .install stamp
files of all variants, relying on the assumption that only the selected
.install stamp file exists.

When an initially selected variant is getting deselected or changed from
<*> to <m> and another variant is marked as <*> instead, the .install
stamp file of the deselected variant remains unchanged and a second
.install stamp file for the newly selected variant is getting created,
causing the package/install recipe to pick up two .install stamps with
conflicting variants, leading to opkg file clashes.

This issue happens for example if package "ip" is set to <m> and package
"ip-full" to <*> -  the install command will eventually fail with:

     * check_conflicts_for: The following packages conflict with ip:
     * check_conflicts_for: 	ip-full *
     * opkg_install_cmd: Cannot install package ip.

In order to fix the problem, always process the removal requests or the
.install stamp files, even for deselected packages but only write the
package base name into the stamp file if the corresponding package is
marked as builtin.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
8 years ago
Jo-Philipp Wich b7f7e9fe42 include/host-build.mk: use STAGING_DIR_HOSTPKG
Instead of hardcoding $(STAGING_DIR)/host, use the new $(STAGING_DIR_HOSTPKG)
variable to refer to the directory.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
8 years ago
Paul Wassi a569354481 kernel: update kernel 4.4 to version 4.4.28
Refresh patches for all targets that support kernel 4.4.
compile/run-tested on ar71xx, brcm47xx, kirkwood.

Signed-off-by: Paul Wassi <p.wassi@gmx.at>
Tested-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
8 years ago
Jo-Philipp Wich d1ae4c4958 config: ext4: drop option to set maximum number of inodes
There is very little practical use to limit the number of available inodes on
an ext4 filesystem and the make_ext4fs utility is able to calculate useful
defaults by itself.

Drop the option to make resulting ext4 filesystems more flexible by default.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Acked-by: Michael Heimpold <mhei@heimpold.de>
8 years ago
Jo-Philipp Wich 244955de16 include: image.mk: make ext4 reserved blocks percentage optional
Allow CONFIG_TARGET_EXT4_RESERVED_PCT to be empty as make_ext4fs is usually
able to figure out a suitable default.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Reviewed-by: Michael Heimpold <mhei@heimpold.de>
8 years ago
Stijn Tintel 75e63c2494 kernel: update kernel 3.18 to version 3.18.43
Refresh patches for all targets supporting 3.18 and not marked broken.
Compile-tested on all targets using 3.18 and not marked broken.

Changes to generic/610-netfilter_match_bypass_default_checks.patch based
on 84d489f64f.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
8 years ago
Stijn Tintel 2fc3680dd0 kernel: update kernel 4.1 to version 4.1.34
Refresh patches for all targets supporting 4.1 and not marked broken.
Compile-tested on all targets using 4.1 and not marked broken.

Changes to generic/610-netfilter_match_bypass_default_checks.patch based
on 84d489f64f.
Changes to generic/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch based
on a90ee92337.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
8 years ago
Álvaro Fernández Rojas 920f922652 kernel: update kernel 4.4 to version 4.4.27
Refresh patches for all targets that support kernel 4.4.
compile/run-tested on brcm2708/bcm2710 only.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
8 years ago
Koen Vandeputte 32c28a78f7 kernel: update kernel 4.4 to version 4.4.26
Refresh patches for all targets that support kernel 4.4.
compile/run-tested on cns3xxx & imx6.

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
8 years ago
Jo-Philipp Wich 8cc9224115 sdk: predefine SOURCE_DATE_EPOCH
When building packages within the SDK, there is no Git revision history
available so prepopulate SOURCE_DATE_EPOCH in version.mk, similar to
how we handle REVISION already.

Acked-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
8 years ago
Koen Vandeputte 7f87f82753 kernel: update kernel 4.4 to version 4.4.25
Refresh patches for all targets that support kernel 4.4.
compile/run-tested on cns3xxx & imx6.

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
8 years ago
Alexandru Ardelean 7c8c3226dc build: copy contents of 'src' folder to build dirs (if present)
The normal Prepare step for a build is unpack, apply patches.
But for certain packages, patches contain whole files, which
would be nice to have separately and copied over as a last step
in the Prepare phase.

We need it for some other packages + patches, but I think
the 'hostapd' package can be used as a test for this.

As a quick note:
the reason the condition is being evaluated as
`[ ! -d ./src/ ] || $(CP) ./src/* $(HOST_BUILD_DIR)`
and not with
`[ -d ./src/ ] && $(CP) ./src/* $(HOST_BUILD_DIR)`
is that the latter would translate in a build failure if the `src`
folder is not present (the exit code would be 1).
The first one, succeeds for both cases (if `src` present or not).

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
8 years ago
Yousong Zhou 4eb371e363 build: fix cleaning configured stamp file
We have packages with their own parts appended to standard STAMP_CONFIGURED
(mostly with an underscore character).  This will render the current
STAMP_CONFIGURED_WILD setting invalid and the build system may miss a rebuild
on config change

 1. Build with config A
 2. Build with config B, yet .configured_A_xx did not get cleaned
 3. Return to config A, but rebuild will not happen because stamp file
    of config A still exists

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
8 years ago
Dirk Neukirchen 336e277e8b autotools: use correct version for gettext FIXUP
0.19.8.1 gettext-full uses "archive-version" of 0.19.8
to replace makros, leading to breakage of PKG_FIXUP:=gettext-version

Signed-off-by: Dirk Neukirchen <dirkneukirchen@web.de>
8 years ago
Hauke Mehrtens 559fb537d8 build: use CXXFLAGS if defined
Instead of using TARGET_CFLAGS and EXTRA_CFLAGS in cmake and scons
build use the TARGET_CXXFLAGS and EXTRA_CXXFLAGS like it is done for
normal make and configure. configure used TARGET_CXXFLAGS and
EXTRA_CFLAGS for the CXXFLAGS. The package-default.mk sets
"EXTRA_CXXFLAGS = $(EXTRA_CFLAGS)" so using EXTRA_CXXFLAGS flags should
be save.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
8 years ago
Jo-Philipp Wich b81fc29123 include: prereq-build.mk: improve gcp check
Adjust the check for gcp (GNU copy command) to rule out false positives
with "Goffi's CoPier" a python copy command.

Fixes FS#218.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
8 years ago
Álvaro Fernández Rojas 7cc89af937 kernel: update kernel 4.4 to version 4.4.24
Refresh patches for all targets that support kernel 4.4.
compile/run-tested on brcm2708/bcm2710 only.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
8 years ago
Jo-Philipp Wich 7694c5cf0e include: remove XZ host prereq
We build XZ as part of tools/, so no need to require it to be available
on the host system.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
8 years ago
Matthias Schiffer ec041920b7
include/package-ipkg.mk: use TARGET_PATH_PKG in Package/*/install steps
Package/*/install was using a different PATH than all other steps like
Build/Install, which was confusing and easily led to mistakes.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
8 years ago
Matthias Schiffer cb718eb34b
include/host-build.mk: set Host/Exports for Host/Install step
Having a different PATH in Host/Install than in other steps like Host/Build
is confusing and easily leads to mistakes. Setting all of Host/Exports
makes host builds match target builds (Build/Install is part of
$(STAMP_BUILT), which has Build/Exports set).

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
8 years ago
Matthias Schiffer 4ada2fd276
include/host-build.mk: fix ACLOCAL_INCLUDE
It seems the intention was to add both $(STAGING_DIR_HOST)/... and
$(STAGING_DIR)/host/... instead of passing $(STAGING_DIR_HOST) twice. This
makes the definition match HOST_CPPFLAGS and HOST_LDFLAGS.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
8 years ago
Matthias Schiffer 7064a849ce
include/host-build.mk: pass HOST_BUILD_PREFIX to Host/install
Using HOST_BUILD_PREFIX instead of STAGING_DIR_HOST will make the argument
work as expected from packages.

Nothing changes for tools, for which HOST_BUILD_PREFIX and STAGING_DIR_HOST
are equivalent.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
8 years ago
Daniel Engberg cbc80805bd include/download.mk: Use -7e compression instead of -6 by default
Adds a slightly higher compression level to xz by default which roughly raises memory usage from 100MiB to about 200MiB during compression, about 10MiB for decompression. (Source: xz manpage)

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
8 years ago
Daniel Engberg ed768ae4b2 include/prereq-build.mk: Add xz-utils to make prereq
Add xz-utils to make prereq

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
8 years ago
Jo-Philipp Wich 5d86dc791e include/download.mk: generate reproducable SCM tarballs
Apply a number of changes to the tarball generation in order to produce
identical files on different systems:

1) Use an explicit `gzip -cn` to avoid storing file mtime in the gzip header
2) Instruct `tar` to unconditionally use uid and gid 0 for archive members
3) Instruct `tar` to sort archive members by file name
4) For SCMs that do not preserve file modification times like Git or Mercurial,
   use the date of the last commit to the repository and pass it as `--mtime`
   value to `tar`

After these changes, locally produced tarballs generated from SCM checkouts
should be identical on any system, simplifying the mirroring of cache archives.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
8 years ago
Felix Fietkau 86c966a8ae build: fix regression on running make kernel_menuconfig
The build system overrides HOST_LOADLIBES to add the staging dir to the
library search path. menuconfig needs -lncurses, add another override
for it.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau 934901fb3e build: leaving behind incomplete metadata files on cancelled builds
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Jo-Philipp Wich be6f836841 include: relax umask check
For now we only want to ensure that the group permission mask is permissive
enough to not clobber required permissions on the rootfs, so allow less
strict masks as well.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
8 years ago
Jo-Philipp Wich 5f80315634 include: add umask prereq check
When building LEDE with umask values other than 022, the resulting packages
will embed improper permissions, which may lead to random errors or non-
functional scripts on the target.

In order to make users aware of this problem, add a build-prereq check to
assert a correct umask setting before starting the build.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
8 years ago
Matthias Schiffer cea09329e5
netfilter: fix file conflicts between kmod-ipt- and kmod-nft- packages
The nf_reject_* and nf_nat_masquerade_* modules are moved into the
corresponding kmod-nf- packages. Appropriate dependencies are added to the
kmod-nft- packages.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
8 years ago
Álvaro Fernández Rojas 7d559169c5 kernel: update to v4.4.23
Refresh patches for all targets that support kernel 4.4.
compile/run-tested on brcm2708/bcm2710 only.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
8 years ago
Stijn Segers 949cfbb243 kernel: update kernel 4.4 to version 4.4.22
Forgot to update kernel-version.mk, so updated patch. Compile-tested on x86/64 and ar71xx; run-tested on x86/64 and ar71xx.

Signed-off-by: Stijn Segers <francesco.borromini@inventati.org>
8 years ago
Felix Fietkau 685ed1e072 kernel: add STAGING_DIR_HOST/lib to host library search path
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Matthias Schiffer 5b99693832
rootfs: fail on errors in postinst scripts
The Gluon firmware framework [1] uses postinst scripts for sanity checks.
Make the build fail when a postinst script exits with an error to make
these sanity checks effective.

All postinst scripts in packages from the LEDE core and the packages feed
seem to work correctly with this change and will always return 0 unless
something is very broken.

[1] https://github.com/freifunk-gluon/gluon

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
8 years ago
Matthias Schiffer 021b96d7c5
rootfs: remove unnecessary and potentially harmful force flags from opkg call
Especially --force-overwrite and --force-depends will often lead to broken
images; it's better to fail the build in such cases than to silently ignore
the errors.

Instead, ignore errors in the per-device rootfs opkg remove command, so
the build doesn't break when packages can't be removed because of
dependencies.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
8 years ago
Matthias Schiffer 593dfac909
image: per-device rootfs: first remove, then install packages
Some DEVICE_PACKAGES definitions replace one package variant with another
(e.g. wpad-mini is replaced with wpad). To avoid file conflicts, first
remove, then install packages.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
8 years ago
Matthias Schiffer a16a8814ea
image: don't modify file permissions before rootfs generation
Modifying the file permissions can be harmful, as it would make files
world-readable even if they weren't in the ipk packages. The
Image/mkfs/prepare step is removed completely, as it is redundant now (/tmp
and /overlay are already provided by base-files with the correct
permissions).

It has been verified that this change does not affect any permissions of
files in the default package set except /etc/ppp/chap-secrets, which was
world-readable before. All packages not in the default set are more likely
to be installed via opkg than being part of a base image and thus were
usually not affected by the permission modification anyways.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
8 years ago
Matthias Schiffer 663145e419
image: fix CONFIG_CLEAN_IPKG with CONFIG_TARGET_PER_DEVICE_ROOTFS
Running prepare_rootfs on TARGET_DIR deletes the opkg state when
CONFIG_CLEAN_IPKG is enabled, making the per-device rootfs package install
fail.

To avoid this, create a copy of the TARGET_DIR before prepare_rootfs is run
and use this as basis for per-device rootfs generation.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
8 years ago
Matthias Schiffer 3675e657ed
image: per-device rootfs: don't fail without opkg
Ignore errors caused by /etc/opkg not existing (i.e. when opkg is not
selected).

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
8 years ago
Matthias Schiffer e916579340
image: allow specifying additional packages for device-specific rootfs
Add a new option to each device in multi-profile mode, allowing to provide
a list of packages to add or remove. In case of added packages, the user
must take care that these are selected to be built.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
8 years ago
Matthias Schiffer c15d70c6d6
image: don't override opkg list directory in per-device rootfs mode
opkg's -l option is always interpreted relative to the installation root.
This leads to very weird paths inside the rootfs (containing the whole path
to the LEDE tree on the build machine) and causes the subsequent deletion
of the list directory to fail (cluttering the resulting images).

Instead, use the default list directory and remove its contents in
prepare_rootfs.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
8 years ago
Álvaro Fernández Rojas 41eab9048b kernel: update kernel 4.4 to version 4.4.21
Refresh patches for all targets that support kernel 4.4.
Compile-tested on brcm2708 only.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
8 years ago
Álvaro Fernández Rojas d14c28fc80 kernel: update kernel 4.4 to version 4.4.20
Refresh patches for all targets that support kernel 4.4.
Compile-tested on brcm2708 only.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
8 years ago
Mathias Kresin 61c2a7339a image: remove padding parameter from append-kernel/append-rootfs
Using pad-to instead of passing the optional padding to append-kernel
or append-rootfs. It could be that the value of a variable is passed.
In case the variable is empty no error is thrown.

Furthermore the purpose of the extra parameter is hard to get without
reading the code.

Signed-off-by: Mathias Kresin <dev@kresin.me>
8 years ago
Mathias Kresin 14b40d61e1 image: use check-size from new image build code
Use the new image build code and deduplicate the code.

Signed-off-by: Mathias Kresin <dev@kresin.me>
8 years ago
Mathias Kresin 1cd0a4c688 image: add KERNEL_SIZE to the default device vars
This reverts commit ec37a56587 and fixes
the underlying issue.
8 years ago
Felix Fietkau d27bce8d28 build: drop UBI EOF marker from images by default
Only add them where they are actually required.
Should help with compatibility issues with stock U-Boot images that
access UBI

Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau d2a7df0792 octeon: use new ext4/f2fs overlay support
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Mathias Kresin ddd259b0d5 image: pass device blocksize to padjffs2
At the moment the padding steps are hardcoded. Especially images for
devices with a 4K sector size can be unnecessarily bloated using the
hardcoded padding steps.

It has been observed that 192Kb of padding was added to the image of a
4MB device, albeit due to the 4K sector size the minimum required extra
padding for the jffs2 rootfs_data is 20Kb.

In worst case it means that the image-size check could fail albeit
there is enough space for all selected packages

For device build code not exposing the blocksize, use the hardcoded
padding further on.

Signed-off-by: Mathias Kresin <dev@kresin.me>
8 years ago
Mathias Kresin 3e7524c184 image: add support for k unit suffix to append-ubi
Allows to use the same unit for all definitions of the blocksize to be
consistent regardless of the used filesystem.

Signed-off-by: Mathias Kresin <dev@kresin.me>
8 years ago
Mathias Kresin b99a93ebaf image: add support for k unit suffix to pad-offset
Allows to specificy the padding and offset in kilobytes to be
consistent with pad-to.

Signed-off-by: Mathias Kresin <dev@kresin.me>
8 years ago
Pushpal Sidhu 4fd043b95b image.mk: Create a manifest file of installed packages as a build artifact
A few linux BSP's create a manifest file of installed packages for a given
target in order to help them understand exactly what's on their images. Create
one here as well as a build artifact since many users have an affinity to
prune down on packages to save valuable flash space.

Signed-off-by: Pushpal Sidhu <psidhu@gateworks.com>
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
8 years ago
Felix Fietkau a84a74f618 scripts/ubinize-image.sh: add support for adding custom partitions
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau 223c124db8 ubox: move logd into ubox package
Preparation for further build rework

Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau f5860f898a build: use perl instead of GNU date for KBUILD_BUILD_TIMESTAMP
Fixes warning on non-Linux systems

Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau 4170267f5a build: pass $(STAGING_DIR_HOST) to Host/Install
makes it more consistent with package builds

Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Jonas Gorski b962da4d92 ramips: mt7621: switch to 24kc
1004kc is just a SMP capable 34kc, and GCC treats 24kc and 34kc exactly
the same and will generate identical code, so there is no need to tune
to 1004kc instead of 24kc.

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
8 years ago
Jonas Gorski a11843b62e include: remove 34k distinction
Now that there are no users anymore, drop the 34kc CPU_FLAGS.

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
8 years ago
Stijn Tintel 8072264b96 kernel: update kernel 4.4 to version 4.4.19
Refresh patches for all targets that support kernel 4.4.
Compile-tested on all targets that use kernel 4.4 and aren't marked broken.
Runtime-tested on ar71xx, octeon and x86/64.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
8 years ago
Jonas Gorski f3923dab7b kernel: check the right directories for rebuild
Pass KERNEL_FILE_DEPENDS to rdep instead of PKG_FILE_DEPENDS, which is
empty. Also don't pass $(CURDIR) as the directory to timestamp, as it
would also pick up non kernel related changes like image building code.

Should fix kernel being rebuild for unrelated changes, as well as not
being rebuild for changes in target/linux/generic.

Fixes: 22ef1c83b3 ("kernel: make the kernel build auto-clean the build dir like package build")
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
8 years ago
Josua Mayer 57ef81d78f kernel: prevent adding custom string to localversion
When the kernel build picks up a localversion file in the source tree,
that string is unconditionally appended to LOCALVERSION and affects the
uname string.
Make sure to delete any such file.

Signed-off-by: Josua Mayer <josua.mayer97@gmail.com>
8 years ago
Josua Mayer 0df2c6563a kernel: prevent addition of scm marker to localversion
When building the kernel from a git repository, the kernel build appends
either a + or a short commit hash to localversion.
This behaviour can be prevented by passing the empty LOCALVERSION variable
to make.

Signed-off-by: Josua Mayer <josua.mayer97@gmail.com>
8 years ago
Jonas Gorski 86ec410418 kernel: check SOURCE_DATE_EPOCH before setting KBUILD_BUILD_TIMESTAMP
Make sure SOURCE_DATE_EPOCH actually contains something.

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
8 years ago
Jonas Gorski 5fe923b15d kernel: allow reproducable builds
Similar how we fix the file times in the filesystems, fix the build time
of the kernel, and make the build number static. This should allow the
kernel build to be reproducable when combined with setting the
KERNEL_BUILD_USER and _DOMAIN in case of different machines.

The reproducability only applies to non-initramfs kernels, those still
require additional changes.

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
8 years ago
Matteo Croce 1645abffea kernel: add plan 9 fs package
9pfs is used by kvm to share files between host and guest,
add proper config option to enable it.

Signed-off-by: Matteo Croce <matteo.croce@canonical.com>
8 years ago
Jonas Gorski bebcb81da5 ramips: switch from 24kec to 24kc
Since the only difference between 24Kec and 24Kc is the addition of DSP
ASE support, and we don't use it anymore, there is no need to keep 24Kec
as a separate cpu type.

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
8 years ago
Felix Fietkau 22ef1c83b3 kernel: make the kernel build auto-clean the build dir like package builds
Previous behavior can be restored by using QUILT=1 on target/prepare

Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau 2180b715c1 image: fix per-device rootfs build error when not all opkg package files are found
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
John Crispin 4df2011794 include/image.mk: allow image code to override uImage name
Signed-off-by: John Crispin <john@phrozen.org>
8 years ago
Felix Fietkau 9abbaa9539 build: remove MIPS dsp/dsp2 CPU_SUBTYPE
There does not seem to be any meaningful difference in generated code.
This will save some time and space on snapshot builds

Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau f2de33b2c9 build: move merged package directory from bin/ to staging_dir
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Jo-Philipp Wich 83175687c8 build: remove image specific checksum code
Now that we globally calculate sha256sums over the bin/ directory we can remove
the target image specific checksum handling.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
8 years ago
Felix Fietkau 905e50d2fb image: use the merged package directory to resolve dependencies for per-device rootfs
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau 180465c38f build: create a package feed directory containing all packages
Needed for proper dependency handling for per-device rootfs

Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau e351f7c695 build: fix tabs vs whitespace issue
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau 94dec60d75 build: add template for installing device .dtb files
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Hauke Mehrtens 1448501558 build: do not depend on svn any more
LEDE does not need svn to build any more, remove the prerequisite check.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
8 years ago
Felix Fietkau 14488469d5 image: fix build issue with per-device rootfs and legacy devices
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau 63b525dd6b image: add a helper variable for getting kernel/rootfs from within image Build/* templates
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau baeda5d31d image.mk: add CMDLINE to DEVICE_VARS
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau 84718d8736 image: add support for overriding kernel/rootfs images in sysupgrade-tar template
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau 50e7c1f79d include/cmake.mk: fix host builds
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Luke McKee eadf5fb7f8 cmake: include/cmake.mk add CMAKE_BINARY_SUBDIR to allow out of source tree builds
Some packages need out of source tree building with cmake, for example
when building kernel modules.
See an example here:
https://sourceforge.net/p/accel-ppp/code/ci/master/tree/README

Signed-off-by: Luke McKee <hojuruku@gmail.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name> [cleanup, rework]
8 years ago
Felix Fietkau c5a9a08f1e image.mk: remove leftover variable from a previous rework
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Jo-Philipp Wich db49dd894e build: rename sysupgrade-nand to sysupgrade-tar
Now that the "sysupgrade-nand" step is used by non-NAND targets as well,
rename it to "sysupgrade-tar" to make it more generic.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
8 years ago
Felix Fietkau 76341cfc5f build: add support for per-device rootfs based on device profile packges
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau c0dceae4bb build: minor cleanup of redundant code
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau 653cb2594d build: set TMPDIR for opkg calls
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau c792c7512c build: add target_params variable for getting root filesystem image parameters
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau 731b166528 build: add template for getting opkg package files from package names
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau 5d30bf8303 build: rework opkg command invocation
Drop included $(XARGS), add support for passing target dir via parameter

Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau 37e82e4e42 build: remove obsolete variables from opkg command
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau 7dffc32ffa build: rework prepare_rootfs to pass target dir via parameter
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau c5ca181d12 image: add wrapper variable to get the target dir for mkfs commands
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau 4fed7a60f9 image: make mkfs template output to $@
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau 973e6e1d71 build: move rootfs processing code to include/rootfs.mk so it can be reused later
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau b47f438d98 build: remove image prefix from kernel files in KDIR
This allows the image builder to change EXTRA_IMAGE_NAME at a later
point in time without breaking the build

Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau 9945a1dca5 build: remove cpio.gz and tar.gz from regular filesystem types
They are not used to produce regular firmware images anyway. Instead,
call their build templates directly if enabled in the config

Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau 33c8d35375 image: remove shell calls from legacy ubi/ubifs image code
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau 11fc0cd1b1 image.mk: create default ubifs before calling legacy image build code
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Chris Blake 3827ce2c3d apm821xx: add support for the apm821xx device target
This adds a new target for PowerPC APM82181 and APM82161
(464-based) boards, as well as adds support for the booke-wdt
watchdog package.

Signed-off-by: Chris Blake <chrisrblake93@gmail.com>
8 years ago
Felix Fietkau 8265fdcc4d imagebuilder: strip DEVICE_ prefix from profiles (FS#55)
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau ed90d50bc4 build: fix image builder profile override (FS#55)
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau b5b2425cba image.mk: initialize BOARD_NAME and IMAGES, add it to DEVICE_VARS
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau 9a50a213d2 image.mk: add support for specifying the VID header offset for UBI
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau 9497a23ecb build: add support for parameter passing to mkfs from devices
Will be used to support different ubifs parameters per device

Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau 4added6692 build: split legacy image mkfs.ubifs command from the one used for the new image building code
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau ebd0b2d0b1 build: split legacy image building code out of image.mk
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau 1c1244193a image.mk: replace some template abstraction with make pattern rules
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau efdf7f6499 image.mk: remove obsolete Build/mkfs overrides
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau 7bdc21de72 image.mk: fix append-dtb race when multiple devices use the same .dts
Call Image/BuildDTB unconditionally to keep things consistent

Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau f021ea47d3 target.mk: change CPU_CFLAGS to better suit target CPUs
-march forces the compiler to generate generic code, whereas -mcpu
allows it to target the specific CPU variant and use instructions that
the generic architecture may not have

Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau 11d496d156 target.mk: rework arm architecture level detection
Use kernel config as input instead of -march CFLAGS.
With this change, -march can be dropped and replaced with more specific
optimization flags for better code generation.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau 8e2764ce9b image.mk: clean up redundant code related to DEVICE_DTS
It is used by a core build template, so the variable should be
initialized and added to DEVICE_VARS in the core.
Same for DEVICE_DTS_DIR

Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau b8fddb8912 image: allow devices to override the -E 5 ubinize option
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau e0ed6ec667 image: clean up UBI related device variable definitions
Move UBI related variable export to core, since the variables are used
by a core Build/ template

Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Hauke Mehrtens efa1960abb kernel: update kernel 4.4 to version 4.4.15
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
8 years ago
Felix Fietkau 2f2d1829be target.mk: fix ARM architecture feature flag detection
Move feature flag checks below CFLAGS handling, use CPU_TYPE CFLAGS for
architecture detection.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
John Crispin 1b13b35231 include/toplevel.mk: fix defconfig when ~/.openwrt/defconfig exists - take 2
commit 5b72807416 ("include/toplevel.mk: fix defconfig when
~/.openwrt/defconfig exists") was missing a !

Signed-off-by: John Crispin <john@phrozen.org>
8 years ago
John Crispin 5b72807416 include/toplevel.mk: fix defconfig when ~/.openwrt/defconfig exists
./scripts/feeds update will reset the .config file if ~/.openwrt/defconfig
exists, thus resetting the target to ar71xx.

Signed-off-by: John Crispin <john@phrozen.org>
8 years ago