Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement Gluon build-framework #765

Draft
wants to merge 82 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
1095594
rename packages folder to imagetypes
SvenRoederer Feb 17, 2020
01a0b58
assemble_firmware.sh: adapt to renamed packages folder
SvenRoederer Feb 17, 2020
2fe7a19
README: short description of this branch
SvenRoederer Feb 23, 2020
2678494
import basic files from gluon (15. Feb. 2020)
SvenRoederer Feb 19, 2020
be75b80
gluon: (partial) add FLAG "GLUON_FOREIGN" to make the framework usabl…
SvenRoederer Oct 28, 2019
652a0c4
adapt gluon: Makefile improve
SvenRoederer Oct 26, 2019
5b49767
Makefile: gluon import more definitions
SvenRoederer Feb 19, 2020
5502a64
scripts: fix permissions
SvenRoederer Feb 19, 2020
522c465
Makefile: gluon import setup of LANG and LC_ALL
SvenRoederer Feb 19, 2020
14b8844
MAkefile: [gluon] add target gluon-all which acts as all from origina…
SvenRoederer Feb 19, 2020
bcd4e96
extend FOREIGN_BUILD to include different target/generic
SvenRoederer Feb 19, 2020
81c3a42
Update upstream repos to openwrt-19.07.2 tag
SvenRoederer Feb 29, 2020
24ad7e5
profiles: add some NanoStation M devices to ath79
SvenRoederer Feb 21, 2020
6272624
configs: remove explicit activation of ASLR
SvenRoederer Mar 1, 2020
c24780e
targets: update gerneric_ffberlin to pass CONFIG_settings check not f…
SvenRoederer Feb 20, 2020
6810144
debug: add some debug to the scripts
SvenRoederer Feb 20, 2020
4a14111
targets: remove some settings leftover from gloun
SvenRoederer Feb 23, 2020
5cc9e0a
targets: remove "kmod-usb-net" from generic_ffberlin
SvenRoederer Feb 23, 2020
46bf5db
Makefile: have gluon-config also depend on .stamp-feeds-updated $(OPE…
SvenRoederer Feb 24, 2020
b0ecf57
targets/generic_ffberlin: add some more required packages
SvenRoederer Feb 24, 2020
5bbf0ae
targets/generic_fberlin: keep up with renamed CONFIGs of BATMAN-adv
SvenRoederer Feb 25, 2020
398223c
targets/generic_ffberlin: fix "CONFIG_ATH_USER_REGD"
SvenRoederer Feb 25, 2020
05f1519
targets/generic_ffberlin: same for "CONFIG_PACKAGE_ATH_DFS"
SvenRoederer Feb 25, 2020
ce75736
targets/generic_ffberlin: shorten package-list by moving to site-config
SvenRoederer Feb 25, 2020
382a77f
targets/generic_ffberlin: move ordinary packages form config() to pac…
SvenRoederer Feb 25, 2020
3e31737
Makefile: [gluon] also import GLUON_SITEDIR
SvenRoederer Feb 25, 2020
af9709b
targets/generic_ffberlin: wrap ALFRED config-parameters in try_config()
SvenRoederer Feb 28, 2020
a6f8812
targets/generic_ffberlin: add freifunk-berlin-system-defaults to pack…
SvenRoederer Feb 28, 2020
e71bdb1
scripts: improve debug-output of F.config(...)
SvenRoederer Feb 28, 2020
382f37b
scripts: add F.config_m(...) as template from F.config()
SvenRoederer Feb 28, 2020
1506d3b
scripts: improve debug-output of site_packages(image)
SvenRoederer Feb 28, 2020
4ac1fcd
scripts: mark lib.target_packages as "m" modular
SvenRoederer Feb 28, 2020
bb9d38d
Makefile: [gluon] rename target gluon-all to gluon-compile
SvenRoederer Feb 29, 2020
bf91a7c
targets/generic_ffberlin: change version-string to "gluon1907"
SvenRoederer Feb 29, 2020
79de752
Revert "scripts: mark lib.target_packages as "m" modular"
SvenRoederer Feb 29, 2020
424f334
scripts: improve debug-output
SvenRoederer Feb 29, 2020
11ea0b5
Makefile: [gluon] align debug-output
SvenRoederer Feb 29, 2020
94b492f
scripts/target_config_lib.lua: rename extra_packages to default_packages
SvenRoederer Feb 29, 2020
be30af9
patches: add https://github.com/openwrt/luci/pull/2637
SvenRoederer Dec 26, 2019
855218f
patches/luci: update PR2637 for upstream-changes
Jan 2, 2020
8c80059
patches/luci: update PR2637 to adapt to upstream changes
SvenRoederer Mar 1, 2020
bf4909d
patches/packages_berlin: let freifunk-generic-berlin.mk use luci-comm…
SvenRoederer Dec 26, 2019
54b1069
scripts: improve debug-output
SvenRoederer Mar 1, 2020
6f26980
scripts: implement parsing of "EXTRA_PACKAGES"
SvenRoederer Mar 1, 2020
6d9354d
Makefile: [gluon] - implement "EXTRA_PACKAGES" and disable check-imag…
SvenRoederer Mar 1, 2020
9b3abdb
patches/openwrt: backport "build: have scripts/feeds honor all toplev…
SvenRoederer Dec 27, 2019
cd0820f
targets/generic_ffberlin: set CONFIG_kmod_usb_net as it's a predepend…
SvenRoederer Mar 2, 2020
7ced58b
scripts/target_config_check.lua:add some debug
SvenRoederer Mar 2, 2020
cf933e6
Makefile: [gluon] reenable target_check.lua and supply EXTRA_PACKAGES
SvenRoederer Mar 2, 2020
8f1f1e3
scripts/target_config_lib.lua: make arg[3] optional
SvenRoederer Mar 3, 2020
91452d9
scripts/target_config_lib.lua: add debug-output for profile and packa…
SvenRoederer Mar 3, 2020
31b60ff
targets/generic_ffberlin: move more usb-networking packages to site-conf
SvenRoederer Mar 4, 2020
5239bd8
targets/generic_ffberlin: drop explicit setup of kmod_crc*
SvenRoederer Mar 4, 2020
1cfbdc3
targets/generic_ffberlin: BATMAN_ADV_BLA depends on kmod-lib-crc16
SvenRoederer Mar 4, 2020
2a445c9
scrtips/target_config_lib: add new function devpkgs(dev)
SvenRoederer Mar 4, 2020
2368233
scripts/target_config_lib.lua: add new function get_pkglist()
SvenRoederer Mar 4, 2020
fd3ebf2
scripts/target_config_lib.lua: improve debug
SvenRoederer Mar 4, 2020
6dba8c3
scripts: add new script target_config_profile.lua
SvenRoederer Mar 4, 2020
668914d
Makefile: [gluon] add new target gluon-profiles
SvenRoederer Mar 4, 2020
651118d
assemble_firmware.sh: adapt to new packagelist
SvenRoederer Oct 29, 2019
11bc4b8
Makefile: [gluon] add new target gluon-images
SvenRoederer Mar 4, 2020
a16fbfb
remove unneeded "configs", "profiles" and "image-types"
SvenRoederer Mar 4, 2020
020713e
Makefile: adapt tests for valid target
SvenRoederer Mar 4, 2020
a3b0073
partially revert "add FLAG "GLUON_FOREIGN" ot make the frmework usabl…
SvenRoederer Mar 5, 2020
c223b14
patches/packages_berlin: fix after split of luci.mk
SvenRoederer Mar 5, 2020
63cb34c
targets: add NanoStation Loco (XM) to ath79-generic
SvenRoederer Mar 5, 2020
67ebdf9
Makefile: [gluon] make gluon.packages depend on the relating target-d…
SvenRoederer Mar 6, 2020
d6b6757
Makefile: remove deprecated stuff
SvenRoederer Mar 6, 2020
51e5446
Revert "Makefile: remove deprecated stuff"
SvenRoederer Mar 6, 2020
bc5920f
[gluon] switch from feeds.conf to modules
SvenRoederer Mar 6, 2020
aeafec1
patches: rename directory "packages_berlin" to ffberlin
SvenRoederer Mar 6, 2020
26fd40f
Revert "targets: add NanoStation Loco (XM) to ath79-generic"
SvenRoederer Mar 6, 2020
5656893
targets/generic_ffberlin: add network-defaults package to default image
SvenRoederer Mar 7, 2020
c794f4e
features: drop unneeded gluon features from file
SvenRoederer Mar 7, 2020
e5f7bc1
scripts/features.sh: fallback to "freifunk-berlin" prefix for features
SvenRoederer Mar 7, 2020
a208e6e
Makefile: remove hardcoded "luci-app-ffwizard-berlin"
SvenRoederer Mar 7, 2020
910f5ee
Makefile: use GLUON_FEATURES to build packages
SvenRoederer Mar 7, 2020
0904ff2
modules: update packages_berlin
SvenRoederer Mar 7, 2020
75c9aaa
patches/ffberlin: fix patch name
SvenRoederer Mar 7, 2020
6dbf8b1
patches/ffberlin: update package Makefiles after luci.mk split
SvenRoederer Mar 7, 2020
da61b1b
modules: update berlin_packages
SvenRoederer Mar 7, 2020
5d9abcd
targets/ath79-generic: add ath10k-based boards to sync with recent list
SvenRoederer Mar 8, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ bin
^openwrt
firmwares
dl
/packages
137 changes: 90 additions & 47 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ $(info special actions apply to builds on this host ...)
endif

# test for existing $TARGET-config or abort
ifeq ($(wildcard $(FW_DIR)/configs/$(TARGET).config),)
ifeq ($(wildcard $(FW_DIR)/targets/$(TARGET)),)
$(error config for $(TARGET) not defined)
endif

Expand All @@ -40,17 +40,17 @@ PROFILES=$(shell cat $(FW_DIR)/profiles/$(MAINTARGET)-$(SUBTARGET).profiles)

FW_REVISION=$(shell $(REVISION))

define FEEDS
$(shell ./scripts/ffberlin_feeds.sh)
endef

default: firmwares

## Gluon - Begin
# compatibility to Gluon.buildsystem
# * setup required makros and variables
# * create the modules-file from config.mk and feeds.conf

LC_ALL:=C
LANG:=C
export LC_ALL LANG

# check for spaces & resolve possibly relative paths
define mkabspath
ifneq (1,$(words [$($(1))]))
Expand All @@ -61,53 +61,96 @@ endef

# initialize (possibly already user set) directory variables
GLUON_TMPDIR ?= tmp
GLUON_TARGETSDIR ?= targets
GLUON_PATCHESDIR ?= patches

$(eval $(call mkabspath,GLUON_TMPDIR))
$(eval $(call mkabspath,GLUON_TARGETSDIR))
$(eval $(call mkabspath,GLUON_PATCHESDIR))

export GLUON_TMPDIR GLUON_PATCHESDIR

# use .stamp-gluon-module-openwrt and .stamp-gluon-module- of each feed to create modules-file
$(FW_DIR)/modules: $(addprefix .stamp-gluon-module-,$(FEEDS)) .stamp-gluon-module-openwrt
rm -f $@
cat >>$@ .stamp-gluon-module-openwrt
cat >>$@ $(addprefix .stamp-gluon-module-,$(FEEDS))
echo >>$@ GLUON_FEEDS=\'$(FEEDS)\'

.stamp-gluon-module-openwrt: $(FW_DIR)/config.mk
rm -f $@
echo >>$@ "OPENWRT_REPO=$(OPENWRT_SRC)"
echo >>$@ "OPENWRT_COMMIT=$(OPENWRT_COMMIT)"
# set the $FEED-Branch
git clone $$(grep _REPO $@ | cut -d "=" -f 2) $(GLUON_TMPDIR)/gluon_$@
cd $(GLUON_TMPDIR)/gluon_$@; git name-rev --refs openwrt-* $$(grep _COMMIT $(FW_DIR)/$@ | \
cut -d "=" -f 2) | cut -d / -f 2 | cut -d \~ -f 1 >branchname.txt
cd $(GLUON_TMPDIR)/gluon_$@; grep -q master branchname.txt || \
printf >>$(FW_DIR)/$@ "OPENWRT_BRANCH=%s\n" \
$$(echo $* | tr '[:lower:]' '[:upper:]') \
$$(cat branchname.txt)
rm -rf $(GLUON_TMPDIR)/gluon_$@

.stamp-gluon-module-%: $(FW_DIR)/feeds.conf
rm -f $@
# set the $FEED-REPO
@echo -n "PACKAGES_$*_REPO=" | tr '[:lower:]' '[:upper:]' >>$@
@grep -E "^src-(git|svn)[[:space:]]$*[[:space:]].*" $(FW_DIR)/feeds.conf | \
awk -F '([[:space:]|^])' '{ print $$3 }' >>$@
# set the $FEED-COMMIT
@echo -n "PACKAGES_$*_COMMIT=" | tr '[:lower:]' '[:upper:]' >>$@
@grep -E "^src-(git|svn)[[:space:]]$*[[:space:]].*" $(FW_DIR)/feeds.conf | \
awk -F '([[:space:]|^])' '{ print $$4 }' >>$@
# set the $FEED-Branch
git clone $$(grep _REPO $@ | cut -d "=" -f 2) $(GLUON_TMPDIR)/gluon_$@
cd $(GLUON_TMPDIR)/gluon_$@; git name-rev $$(grep _COMMIT $(FW_DIR)/$@ | \
cut -d "=" -f 2) | cut -d / -f 3 | cut -d \~ -f 1 >branchname.txt
cd $(GLUON_TMPDIR)/gluon_$@; grep -q master branchname.txt || \
printf >>$(FW_DIR)/$@ "PACKAGES_%s_BRANCH=%s\n" \
$$(echo $* | tr '[:lower:]' '[:upper:]') \
$$(cat branchname.txt)
rm -rf $(GLUON_TMPDIR)/gluon_$@
GLUON_SITEDIR ?= site
$(eval $(call mkabspath,GLUON_SITEDIR))

$(GLUON_SITEDIR)/site.mk:
$(error No site configuration was found. Please check out a site configuration to $(GLUON_SITEDIR))

include $(GLUON_SITEDIR)/site.mk

export GLUON_RELEASE GLUON_DEBUG GLUON_DEPRECATED GLUON_DEVICES \
GLUON_TARGETSDIR GLUON_PATCHESDIR GLUON_TMPDIR GLUON_IMAGEDIR GLUON_PACKAGEDIR

GLUON_CONFIG_VARS := \
GLUON_SITEDIR='$(GLUON_SITEDIR)' \
GLUON_RELEASE='$(GLUON_RELEASE)' \
GLUON_BRANCH='$(GLUON_BRANCH)' \
GLUON_LANGS='$(GLUON_LANGS)' \
BOARD='$(MAINTARGET)' \
SUBTARGET='$(SUBTARGET)'


CheckTarget := [ '$(BOARD)' ] \
|| (echo 'Please set GLUON_TARGET to a valid target. Gluon supports the following targets:'; $(foreach target,$(GLUON_TARGETS),echo ' * $(target)';) false)

GLUON_TARGET := $(TARGET)


OPENWRTMAKE = $(MAKE) -C openwrt

GLUON_DEFAULT_PACKAGES := hostapd-mini

GLUON_FEATURE_PACKAGES := $(shell scripts/features.sh '$(GLUON_FEATURES)' || echo '__ERROR__')
ifneq ($(filter __ERROR__,$(GLUON_FEATURE_PACKAGES)),)
$(error Error while evaluating GLUON_FEATURES)
endif


GLUON_PACKAGES :=
define merge_packages
$(foreach pkg,$(1),
GLUON_PACKAGES := $$(strip $$(filter-out -$$(patsubst -%,%,$(pkg)) $$(patsubst -%,%,$(pkg)),$$(GLUON_PACKAGES)) $(pkg))
)
endef
#$(eval $(call merge_packages,$(GLUON_DEFAULT_PACKAGES) $(GLUON_FEATURE_PACKAGES) $(GLUON_SITE_PACKAGES)))
$(eval $(call merge_packages,$(GLUON_DEFAULT_PACKAGES) $(GLUON_SITE_PACKAGES)))

$(info package-src: $(GLUON_DEFAULT_PACKAGES) $(GLUON_FEATURE_PACKAGES) $(GLUON_SITE_PACKAGES))
$(info packages : $(GLUON_PACKAGES))

LUA := openwrt/staging_dir/hostpkg/bin/lua

$(LUA):
@$(CheckExternal)
@$(CheckTarget)

+@[ -e openwrt/.config ] || $(OPENWRTMAKE) defconfig
+@$(OPENWRTMAKE) tools/install
+@$(OPENWRTMAKE) package/lua/host/compile

gluon-config: $(LUA) .stamp-feeds-updated $(OPENWRT_DIR)/dl
@$(CheckExternal)
@$(GLUON_CONFIG_VARS) FOREIGN_BUILD=ffberlin \
$(LUA) scripts/target_config.lua '$(GLUON_TARGET)' '$(GLUON_PACKAGES)' '$(GLUON_EXTRA_PACKAGES) $(GLUON_FEATURE_PACKAGES)'\
> openwrt/.config
+@$(OPENWRTMAKE) defconfig

@$(GLUON_CONFIG_VARS) FOREIGN_BUILD=ffberlin \
$(LUA) scripts/target_config_check.lua '$(GLUON_TARGET)' '$(GLUON_PACKAGES)' '$(GLUON_EXTRA_PACKAGES)'

gluon-compile: gluon-config
+@$(OPENWRTMAKE)

gluon-profiles: $(GLUON_TMPDIR)/$(GLUON_TARGET).packages
$(GLUON_TMPDIR)/$(GLUON_TARGET).packages: $(LUA) .stamp-feeds-updated $(GLUON_TARGETSDIR)/$(GLUON_TARGET) $(GLUON_SITEDIR/site.mk)
@$(CheckExternal)
@$(GLUON_CONFIG_VARS) FOREIGN_BUILD=ffberlin \
$(LUA) scripts/target_config_profile.lua '$(GLUON_TARGET)' '$(GLUON_PACKAGES) $(GLUON_FEATURE_PACKAGES)'

gluon-images: $(GLUON_TMPDIR)/$(GLUON_TARGET).packages
# taken from original images target
$(eval IB_FILE := $(shell ls -tr $(OPENWRT_DIR)/bin/targets/$(MAINTARGET)/$(SUBTARGET)/*-imagebuilder-*.tar.xz | tail -n1))
mkdir -p $(FW_TARGET_DIR)
./scripts/assemble_firmware.sh -b "$(GLUON_TMPDIR)/$(GLUON_TARGET).packages" -i $(IB_FILE) \
-e $(FW_DIR)/embedded-files -t $(FW_TARGET_DIR)

## Gluon - End

Expand Down
Loading