1
0
Fork 0
forked from mirror/openwrt

build: add Mikrotik NOR RouterBOOT v7 image build

Signed-off-by: John Thomson <git@johnthomson.fastmail.com.au>
This commit is contained in:
John Thomson 2023-01-22 21:34:43 +10:00 committed by Arne Zachlod
parent 3b42f2f4c3
commit ddc389fa49
3 changed files with 39 additions and 0 deletions

View file

@ -530,6 +530,11 @@ define Build/gl-qsdk-factory
$(KDIR_TMP)/$(notdir $(BOOT_SCRIPT))
endef
define Build/kernel-pack-npk
sh -c '. $(STAGING_DIR_HOST)/share/npkpy-venv/bin/activate; python $(STAGING_DIR_HOST)/share/npkpy-venv/bin/pack_npk_kernel.py --kernel $@ --output $@.npk'
mv $@.npk $@
endef
define Build/linksys-image
let \
size="$$(stat -c%s $@)" \

View file

@ -87,6 +87,7 @@ tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(CONFIG_USES_MINOR),y) += yafut
tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(CONFIG_USE_SPARSE),y) += sparse
tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(CONFIG_USE_LLVM_BUILD),y) += llvm-bpf
tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(CONFIG_USE_MOLD),y) += mold
tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(CONFIG_USES_MINOR),y) += npkpy
# builddir dependencies
$(curdir)/autoconf/compile := $(curdir)/m4/compile

33
tools/npkpy/Makefile Normal file
View file

@ -0,0 +1,33 @@
#
# Copyright (C) 2023 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=npkpy
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/john-tho/npkpy.git
PKG_SOURCE_DATE:=2023-01-22
PKG_SOURCE_VERSION:=771dddc5aaaff95a9b4160d6867152cfa1a9255f
PKG_MIRROR_HASH:=4c0596218e8c1f78b38c0583c18a574da18ff4c000ecdd5fbf50c62a62a1fb03
include $(INCLUDE_DIR)/host-build.mk
define Host/Compile
python -m venv $(STAGING_DIR_HOST)/share/npkpy-venv
sh -c '. $(STAGING_DIR_HOST)/share/npkpy-venv/bin/activate; pip install --editable $(HOST_BUILD_DIR)'
endef
define Host/Install
$(CP) $(HOST_BUILD_DIR)/tools/demo_pack_kernel/poc_pack_kernel.py $(STAGING_DIR_HOST)/share/npkpy-venv/bin/pack_npk_kernel.py
endef
define Host/Clean
rm -rf $(STAGING_DIR_HOST)/share/npkpy-venv
endef
$(eval $(call HostBuild))