Commit Graph

200 Commits

Author SHA1 Message Date
Maciej Krüger
e5be1a6b76
buildsystem: allow building custom buildtypes
This adds GLUON_BUILDTYPE, which is an option that allows specifying an alternate
base configuration

Other additions:

- GLUON_PREFIX option to specify the filename prefix, if
  VERSION_DIST is set

- Skip gluon target-definitions if TARGET_ALL_PROFILES is set

- Allow overriding any file in targets/ by adding the file to site/
  - Allow loading the original file using include_gluon() from gluon
2023-02-05 21:35:37 +01:00
Martin Weinelt
c93eb80bbe actions: add editorconfig checker
Adds `lint-editorconfig` make target.

Co-authored-by: Jan-Niklas Burfeind <git@aiyionpri.me>
version bump to 2.6.0
2023-01-15 16:44:17 +01:00
Matthias Schiffer
d20f8d41a0
scripts: target_config_lib: prepend target default package list from openwrt/tmp/.targetinfo
Device-specific package additions could generate `CONFIG_PACKAGE_...=m`
lines, which would override `CONFIG_PACKAGE_...=y` lines inserted by
OpenWrt for default packages (as Gluon did not know about these default
packages). This resulted in the unintended removal of such packages from
other devices that did not contain the same package in their device
package lists.

Avoid this issue by explicitly adding OpenWrt's target default package
list to the front of Gluon's target package list.
2022-08-23 23:35:53 +02:00
Matthias Schiffer
adda317176
build: set GLUON_DEPRECATED = 0 by default
We currently don't have any deprecated devices, so it doesn't make much
sense to force every site to specify this variable. Make it default to 0
instead.
2021-12-31 14:44:47 +01:00
Martin Weinelt
6728c4a103
Add helper to run a containerized build environment (#2292)
Using `make container` or, if you don't have automake/gmake on your host
system, `./scripts/container.sh` will build an image for the current
branch your are on and drop you into a shell running inside a container
using that image.

From there all tooling required to work on Gluon is available.

Supports both podman (preferred) and docker.
2021-12-21 21:40:27 +01:00
Matthias Schiffer
286d07b35f
Makefile: error earlier when site.mk is missing
The site.mk target was only evaluated after the whole makefile was
parsed. This caused the GLUON_DEPRECATED error to be emitted first
(hiding the more helpful message that no site config was found) on Gluon
2021.1.x, where GLUON_DEPRECATED is used in a toplevel if in targets.mk.

By moving the check from recipe context to the toplevel, we ensure that
it is evaluated during parsing.
2021-12-15 20:59:26 +01:00
Matthias Schiffer
caa09e2fae
Makefile: remove duplicate GLUON_RELEASE entry from GLUON_VARS 2021-12-15 20:48:53 +01:00
Matthias Schiffer
b5db6435e5
build: pass GLUON_VERSION and GLUON_SITE_VERSION to build
A helper script is introduced to get the version from `git describe`.
2021-10-05 21:48:07 +02:00
lemoer
27cd003d1b actions: rebuild targets if includes change 2021-09-19 21:24:17 +02:00
Martin Weinelt
66d3b1749b
scripts: add update-modules helper (#2294)
Iterates over all configured modules and checks them for updates.
2021-08-15 01:32:05 +02:00
Martin Weinelt
1f8c5d1c8f
actions: build targets conditionally 2021-08-10 22:16:08 +02:00
David Bauer
7c0408d96d build: add refresh-patches step 2020-10-11 01:40:45 +02:00
Matthias Schiffer
ea2b811a37
build: check for unsynced feeds before build (#2092)
Forgetting to `make update` or leaving uncommitted changes in the
repositories managed by Gluon is a recurring cause of confusion, even
for experienced developers. Let's print an obvious warning message in
this case.
2020-08-15 22:39:17 +02:00
Matthias Schiffer
e6d3d1584c
build: deprecate GLUON_BRANCH Make variable
GLUON_AUTOUPDATER_BRANCH and GLUON_AUTOUPDATER_ENABLED should be set
separately now.
2020-08-15 16:36:27 +02:00
Chrissi^ (Chris Fiege)
1956696da5
openwrt: Store Kernel Debug-Info (#1971)
This change stores a Kernel with Debug-Symbols for the current
architecture in a new output directory '<outputdir>/debug'.
This allows a developer or operator of a network to store the kernel
along with the actual images. In case of a kernel oops the debug
information can be used with the script
'scripts/decode_stacktrace.sh' in the kernel source tree to get the
names to the symbols of the stack trace.

OpenWRT already provides the CONFIG_COLLECT_KERNEL_DEBUG -option that
creates a kernel with debug-symbols in the OpenWRT output directory.
This change enables this option and copies the generated kernel to the
gluon output directory.

Signed-off-by: Chrissi^ <chris@tinyhost.de>
2020-06-04 22:35:58 +02:00
Matthias Schiffer
ab6596115a build: introduce GLUON_AUTOREMOVE flag 2020-05-13 15:48:06 +02:00
lemoer
57516fe4e7
Add GLUON_MINIFY flag to allow skipping the minification process (#1916) 2020-05-13 00:45:06 +02:00
Matthias Schiffer
a3569da164
Revert "build: use .SILENT instead of adding @ to each recipe"
This reverts commit 2a8943e516.

.SILENT gets passed down to OpenWrt make as -s through MAKEFLAGS. This
hides certain messages from the build log with V=s.
2020-05-12 01:00:57 +02:00
Matthias Schiffer
53690d83be
build: move package list generation to target_config_lib.lua, fix precedence
The precedence of different package lists was broken since #1876,
disallowing removal of GLUON_FEATURES packages via GLUON_SITE_PACKAGES.

Including all package selections, both implicit defaults and explicit
handling in Gluon, the order of precedence is now the following:

1.  OpenWrt defaults (including target-specific defaults)
2.  Device-specific packages from OpenWrt
3.  Generic default packages (from target/generic)
4.  Target default packages (target/$(GLUON_TARGET))
5.  Removal of opkg for tiny targets
6.  Packages derived from GLUON_FEATURES + GLUON_FEATURES_$(class)
7.  GLUON_SITE_PACKAGES
8.  GLUON_SITE_PACKAGES_$(class)
9.  Device-specific packages from target/$(GLUON_TARGET)
10. Device-specific packages from GLUON_$(device)_SITE_PACKAGES

This also contains various pieces of cleanup:

- No hardcoded order of device classes for target_config.lua arguments
  anymore (in fact, the Makefile doesn't know anything about device
  classes now)
- target_conifg_lib.lua only hardcodes the fallback class for x86, no
  other occurences of specific class names
- Feature -> package list mapping is moved from Makefile to the Lua code
  as well (still implemented in Shell though)
2020-05-03 22:05:20 +02:00
Matthias Schiffer
2a8943e516 build: use .SILENT instead of adding @ to each recipe 2020-04-09 14:30:44 +02:00
Matthias Schiffer
584d215f56 build: allow overriding the base feed list 2020-04-09 14:30:44 +02:00
Matthias Schiffer
6155bf82c8 build: reduce build environment pollution
Instead of exporting various variables (unintendedly making them
available to the OpenWrt build, possibly bypassing .config), pass the
environment only to commands that need it.
2020-04-09 14:30:44 +02:00
Matthias Schiffer
a180bb8689 build: use .ONESHELL
By using .ONESHELL and adding -e to .SHELLFLAGS, we can simplify complex
shell commands (like manifest generation) and gain a simple way to pass
multi-line environment variables into shell commands.

The @ and + flags for recipe commands are moved to the top of each
recipe.
2020-04-09 14:30:44 +02:00
Matthias Schiffer
47f1509e75 build: indent non-recipe Makefile lines with two spaces 2020-04-09 14:30:44 +02:00
David Bauer
051b275055 build: add class specific GLUON_SITE_PACKAGES
This allows to define a list of packages, which are only installed
for a specific device-class.
2020-03-25 02:05:18 +01:00
David Bauer
88bed04679 build: remove hostapd from default packages 2020-03-25 02:05:18 +01:00
David Bauer
1df243d1b3 build: add class specific GLUON_FEATURES 2020-03-25 02:05:18 +01:00
David Bauer
9c52365077 build: introduce device classes
This commit allows to define a device-class flag in the target
definitions. This way, it is possible to distinguish between groups
of devices in the build-process in terms of package or feature
selection.
2020-03-25 02:05:18 +01:00
Jan-Tarek Butt
a2ced263ab
build: add make targets lint, lint-sh, lint-lua
[Matthias Schiffer: minor script improvements]
2019-12-29 15:18:50 +01:00
Matthias Schiffer
335fae1025 build: drop GLUON_WLAN_MESH variable 2019-11-07 19:48:16 +01:00
Matthias Schiffer
912490c026
Add GLUON_DEPRECATED flag
This new build flag is mandatory for now (it may default to 0 in a future
Gluon version). It may be set to the following values:

* 0 - Do not build any images for deprecated devices.
* upgrade - Only build sysupgrade images for deprecated devices.
* full - Build both sysupgrade and factory images for deprecated devices.

"Other" images are handled like factory images, as they are also used for
the initial installation of Gluon on a device.
2019-06-15 23:34:07 +02:00
Matthias Schiffer
071cf7b20f
Switch to Lua for target definitions
The old bash-based parsing code was way too complex. Replace it with Lua.
2019-06-15 23:34:07 +02:00
Petr Štetiar
9dc1ac7f58
build: replace hardcoded paths with overridable variables
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2019-04-22 22:00:45 +02:00
Matthias Schiffer
134a6460a7
build: move hostapd-mini package from generic target to Makefile
By passing the package name through merge_packages, it becomes possible to
override the package choice in GLUON_SITE_PACKAGES again, for example:

	GLUON_SITE_PACKAGES += -hostapd-mini hostapd
2019-04-19 13:53:09 +02:00
bobcanthelpyou
2c4f022994 build: rename DEVICES to GLUON_DEVICES (#1686) 2019-04-12 01:05:04 +02:00
Matthias Schiffer
210d97c53e
Switch to OpenWrt 18.06 branch 2018-07-10 22:57:40 +02:00
Matthias Schiffer
07dbfea617
gluon-site: disable multidomain support by default 2018-01-26 12:32:46 +01:00
Matthias Schiffer
faceb3932c
config: check if GLUON_DEBUG is 1 rather than nonempty 2018-01-26 12:32:46 +01:00
Matthias Schiffer
020afc856f
gluon-site: install domain configs
The domain configs are not checked yet, and not used for anything.

Based-on-patch-by: lemoer <git@irrelefant.net>
2018-01-19 05:44:25 +01:00
Tata
919dda90b3 build: introduce GLUON_WLAN_MESH build variable (#1298)
defaults to 11s, allowing to build devices without IBSS-support

obsoletes GLUON_ATH10K_MESH
2018-01-10 15:49:33 +01:00
edeso
ab16cea161
build: allow passing relative paths
Allow using relative paths for GLUON_SITEDIR, GLUON_OUTPUTDIR, ...

We also check for whitespace in paths now, as build will not work properly
with whitespace anyways, and Make's abspath would require escaping
otherwise.

[Matthias Schiffer: minor changes, rewrite commit message]
2017-12-25 17:54:42 +01:00
Matthias Schiffer
08cbbf9925
build: move all generic config generation to targets/generic
As the default package list is now handled using the 'packages' directive,
explicit wpad-mini removals in target definitions can be dropped.
2017-09-07 03:21:42 +02:00
Matthias Schiffer
587c5016cb
build: handle generic and target-specific config in the same run of target_config{,_check}.sh
This, together with a new try_config directive, will allow checking the
generic config and make it more flexible.
2017-09-07 00:17:57 +02:00
Matthias Schiffer
b4caa7f766
build: make GLUON_FEATURES error handling compatible with older Make versions
.SHELLSTATUS was not available before Make 4.2.
2017-07-11 04:44:56 +02:00
Matthias Schiffer
6ca841bad5
build: introduce GLUON_FEATURES
To reduce the number of packages that need to be listed in
GLUON_SITE_PACKAGES, this adds a new variable GLUON_FEATURES. Sets of
packages are enabled automatically based on the combination of listed
feature flags.

Site-specified package feeds can provide their own feature flag
definitions.
2017-07-09 02:31:38 +02:00
kb-light
f9f68535aa build: add show-release make target (#1159)
`make show-release` can be used to discover the current release in scripts.
2017-06-26 20:52:22 +02:00
Matthias Schiffer
f9aa784600
build: fix error message in case of missing site repository 2017-02-22 22:40:36 +01:00
Matthias Schiffer
31d3f08f25
treewide: convert all LuCI-based packages to gluon-web 2017-02-22 01:31:25 +01:00
Matthias Schiffer
134ddd411c
build: add list-targets make target
`make list-targets` can be used to discover the available targets in
scripts.
2017-02-16 18:36:20 +01:00
Christof Schulze
b40d94111e build: add GLUON_DEBUG flag, if enabled set CONFIG_DEBUG and do not strip binaries (#1028) 2017-02-11 23:33:07 +01:00