Use site_config loader from gluon packages

This commit is contained in:
Matthias Schiffer 2014-05-13 20:19:32 +02:00
parent 78dc654314
commit 1b520c6856
4 changed files with 8 additions and 12 deletions

View File

@ -240,10 +240,9 @@ prepare-image: FORCE
cp $(KERNEL_BUILD_DIR)/vmlinux $(KERNEL_BUILD_DIR)/vmlinux.elf $(BOARD_KDIR)/
+$(SUBMAKE) -C $(TOPDIR)/target/linux/$(BOARD)/image -f $(GLUONDIR)/include/Makefile.image prepare KDIR="$(BOARD_KDIR)"
CheckSite := $(STAGING_DIR_HOST)/bin/lua $(GLUONDIR)/scripts/load_site.lua || (echo 'Your site configuration did not pass validation.';false)
prepare: FORCE
@$(CheckSite)
@$(STAGING_DIR_HOST)/bin/lua $(GLUONDIR)/packages/gluon/gluon/gluon-core/files/usr/lib/lua/gluon/site_config.lua \
|| (echo 'Your site configuration did not pass validation.'; false)
mkdir -p $(GLUON_IMAGEDIR) $(BOARD_BUILDDIR)
echo 'src packages file:../openwrt/bin/$(BOARD)/packages' > $(BOARD_BUILDDIR)/opkg.conf

View File

@ -3,6 +3,7 @@ __gluon_inc=1
GLUON_ORIGOPENWRTDIR := $(GLUONDIR)/openwrt
GLUON_SITEDIR := $(GLUONDIR)/site
GLUON_SITE_CONFIG := $(GLUON_SITEDIR)/site.conf
GLUON_IMAGEDIR ?= $(GLUONDIR)/images
GLUON_BUILDDIR ?= $(GLUONDIR)/build
@ -12,7 +13,7 @@ GLUON_OPENWRTDIR = $(GLUON_BUILDDIR)/$(GLUON_TARGET)/openwrt
BOARD_BUILDDIR = $(GLUON_BUILDDIR)/$(BOARD)$(if $(SUBTARGET),-$(SUBTARGET))
BOARD_KDIR = $(BOARD_BUILDDIR)/kernel
export GLUONDIR GLUON_SITEDIR GLUON_IMAGEDIR GLUON_OPENWRTDIR GLUON_BUILDDIR
export GLUONDIR GLUON_SITEDIR GLUON_SITE_CONFIG GLUON_IMAGEDIR GLUON_OPENWRTDIR GLUON_BUILDDIR
$(GLUON_SITEDIR)/site.mk:
$(error There was no site configuration found. Please check out a site configuration to $(GLUON_SITEDIR))

View File

@ -1,7 +0,0 @@
local function loader()
coroutine.yield('return ')
coroutine.yield(io.open(os.getenv('GLUONDIR') .. '/site/site.conf'):read('*a'))
end
-- setfenv doesn't work with Lua 5.2 anymore, but we're using 5.1
config = setfenv(assert(load(coroutine.wrap(loader), 'site.conf')), {})()

View File

@ -1,5 +1,8 @@
#!/bin/sh
export GLUONDIR="$(dirname "$0")/.."
export GLUON_SITE_CONFIG="$GLUONDIR/site/site.conf"
"$GLUONDIR"/openwrt/staging_dir/host/bin/lua -e "dofile(os.getenv('GLUONDIR') .. '/scripts/load_site.lua') print(assert(config.$1))" 2>/dev/null
SITE_CONFIG_LUA=packages/gluon/gluon/gluon-core/files/usr/lib/lua/gluon/site_config.lua
"$GLUONDIR"/openwrt/staging_dir/host/bin/lua -e "print(assert(dofile(os.getenv('GLUONDIR') .. '/${SITE_CONFIG_LUA}').$1))" 2>/dev/null