This commit is contained in:
Liangbin Lian 2023-11-08 17:12:15 +08:00
parent 66b75b71de
commit 37eae66594
3 changed files with 106 additions and 0 deletions

50
.github/workflows/ci.yml vendored Normal file
View File

@ -0,0 +1,50 @@
name: iStore Intl Builder
on:
workflow_dispatch:
env:
IB_NAME: openwrt-imagebuilder-22.03.5-x86-64.Linux-x86_64
MF_NAME: openwrt-22.03.5-x86-64.manifest
IB_URL: https://downloads.openwrt.org/releases/22.03.5/targets/x86/64/
TZ: Asia/Shanghai
jobs:
build:
runs-on: ubuntu-latest
name: iStore Intl Builder
steps:
- name: Checkout
uses: actions/checkout@main
with:
fetch-depth: 1
- name: Initialization environment
env:
DEBIAN_FRONTEND: noninteractive
run: |
sudo -E apt-get -qq update
sudo -E apt-get -qq install binutils bzip2 xz-utils unzip git wget patch device-tree-compiler
sudo -E apt-get -qq clean
sudo timedatectl set-timezone "$TZ"
- name: Download IB
run: |
wget -O dl/${IB_NAME}.tar.xz ${IB_URL}${IB_NAME}.tar.xz
wget -O dl/${MF_NAME} ${IB_URL}${MF_NAME}
wget -O dl/sha256sums ${IB_URL}sha256sums
cd dl && sha256sum -c sha256sums
- name: Unpack IB
run: |
mkdir ib
tar -C ib --strip-components=1 -xJf ../dl/${IB_NAME}.tar.xz
cp -a src/* ib/
ls patches/ | sort | xargs -n1 sh -c 'patch -p1 -d ib -i ../patches/$0'
sed -i 's/ unofficial/ oversea/' ib/Makefile
- name: Build
run: |
cp dl/${MF_NAME} ib/target.manifest
cd ib && make -f multi.mk image_multi

View File

@ -0,0 +1,18 @@
diff --git a/include/image.mk b/include/image.mk
index ba1bd3c03f..16a7b0a443 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -438,10 +438,11 @@ define Device/Export
$(1) : FILESYSTEM:=$(2)
endef
+DEVICE_CHECK_PROFILE = $(CONFIG_TARGET_$(if $(CONFIG_TARGET_MULTI_PROFILE),DEVICE_)$(call target_conf,$(BOARD)$(if $(SUBTARGET),_$(SUBTARGET)))_$(1))
ifdef IB
+ifneq ($(PROFILE),)
DEVICE_CHECK_PROFILE = $(filter $(1),DEVICE_$(PROFILE) $(PROFILE))
-else
- DEVICE_CHECK_PROFILE = $(CONFIG_TARGET_$(if $(CONFIG_TARGET_MULTI_PROFILE),DEVICE_)$(call target_conf,$(BOARD)$(if $(SUBTARGET),_$(SUBTARGET)))_$(1))
+endif
endif
DEVICE_EXTRA_PACKAGES = $(call qstrip,$(CONFIG_TARGET_DEVICE_PACKAGES_$(call target_conf,$(BOARD)$(if $(SUBTARGET),_$(SUBTARGET)))_DEVICE_$(1)))

38
src/multi.mk Normal file
View File

@ -0,0 +1,38 @@
# build image as .config
# make -f multi.mk image_multi
# by jjm2473@gmail.com
include Makefile
package_install_multi: FORCE
@echo
@echo Installing manifest packages...
$(OPKG) install $(firstword $(wildcard $(LINUX_DIR)/libc_*.ipk $(PACKAGE_DIR)/libc_*.ipk))
$(OPKG) install $(firstword $(wildcard $(LINUX_DIR)/kernel_*.ipk $(PACKAGE_DIR)/kernel_*.ipk))
cut -d' ' -f1 target.manifest >$(TMP_DIR)/opkg_install_list
$(OPKG) install $$(cat $(TMP_DIR)/opkg_install_list)
build_image_multi: FORCE
@echo
@echo Building multi images...
$(NO_TRACE_MAKE) -C target/linux/$(BOARD)/image install TARGET_BUILD=1 IB=1 EXTRA_IMAGE_NAME="$(EXTRA_IMAGE_NAME)"
_call_image_multi: staging_dir/host/.prereq-build
echo 'Building images for $(BOARD)'
echo
rm -rf $(TARGET_DIR) $(TARGET_DIR_ORIG)
mkdir -p $(TARGET_DIR) $(BIN_DIR) $(TMP_DIR) $(DL_DIR)
$(MAKE) package_reload
$(MAKE) -f multi.mk package_install_multi
$(MAKE) -s prepare_rootfs
$(MAKE) -f multi.mk build_image_multi
$(MAKE) -s checksum
image_multi:
$(MAKE) -s _check_profile
$(MAKE) -s _check_keys
(unset PROFILE FILES PACKAGES MAKEFLAGS; \
$(MAKE) -f multi.mk -s _call_image_multi
profiles_multi:
$(STAGING_DIR_HOST)/bin/sed -n 's/^CONFIG_TARGET_$(if $(CONFIG_TARGET_MULTI_PROFILE),DEVICE_)$(call target_conf,$(BOARD)$(if $(SUBTARGET),_$(SUBTARGET)))_\(.*\)=y/\1/p' .config