Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
kiddin9 committed May 23, 2023
1 parent 7e714c8 commit af7fa86
Show file tree
Hide file tree
Showing 30 changed files with 928 additions and 215 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/Openwrt-AutoBuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ jobs:
echo "MTARGET=mipsel_24kc" >> $GITHUB_ENV
elif [[ ${{matrix.target}} == "ath79_nand" ]]; then
echo "MTARGET=mips_24kc" >> $GITHUB_ENV
elif [[ ${{matrix.target}} == "ipq50xx_arm" ]]; then
echo "MTARGET=arm_cortex-a7" >> $GITHUB_ENV
elif [[ ${{matrix.target}} =~ (ipq40xx_generic|bcm27xx_bcm2709|sunxi_cortexa7) ]]; then
echo "MTARGET=arm_cortex-a7_neon-vfpv4" >> $GITHUB_ENV
elif [[ ${{matrix.target}} == "meson_meson8b" ]]; then
Expand Down Expand Up @@ -148,11 +150,13 @@ jobs:
python3 setup.py -c configs/config-mt798x-7.6.6.1.yml
ln -sf gl-infra-builder/mt7981 ../openwrt
cd -
elif [ ! "${{ env.REPO_BRANCH }}" ]; then
elif [[ ! "${{ env.REPO_BRANCH }}" && "$REPO_URL" == "https://github.com/openwrt/openwrt" ]]; then
REPO_BRANCH="$((curl -gs -H 'Content-Type: application/json' \
-H "Authorization: Bearer ${{ secrets.REPO_TOKEN }}" \
-X POST -d '{ "query": "query {repository(owner: \"openwrt\", name: \"openwrt\") {refs(refPrefix: \"refs/tags/\", last: 4, orderBy: {field: TAG_COMMIT_DATE, direction: ASC}) {edges {node {name}}}}}"}' https://api.github.com/graphql) | jq -r '.data.repository.refs.edges[].node.name' | grep v22 | tail -n 1)"
git clone $REPO_URL -b $REPO_BRANCH openwrt
elif [[ ! "${{ env.REPO_BRANCH }}" ]]; then
git clone $REPO_URL openwrt
else
git clone $REPO_URL -b ${{ env.REPO_BRANCH }} openwrt
echo "git clone $REPO_URL -b ${{ env.REPO_BRANCH }} openwrt"
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/repo-dispatcher.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@ jobs:
-X POST https://api.github.com/repos/${{ github.repository }}/dispatches \
-H "Accept: application/vnd.github.everest-preview+json" \
-H "Authorization: token ${{ secrets.REPO_TOKEN }}" \
-d '{"event_type": "ipq50xx_arm ${{ github.event.inputs.param }}", "client_payload": {"target": "ipq50xx_arm"}}'
curl \
-X POST https://api.github.com/repos/${{ github.repository }}/dispatches \
-H "Accept: application/vnd.github.everest-preview+json" \
-H "Authorization: token ${{ secrets.REPO_TOKEN }}" \
-d '{"event_type": "mediatek_mt7986 ${{ github.event.inputs.param }}", "client_payload": {"target": "mediatek_mt7986"}}'
curl \
-X POST https://api.github.com/repos/${{ github.repository }}/dispatches \
Expand Down
7 changes: 3 additions & 4 deletions devices/armvirt_64/.config
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
CONFIG_TARGET_armvirt=y
CONFIG_TARGET_armvirt_64=y
CONFIG_TARGET_armvirt_64_DEVICE_n1=y
CONFIG_TARGET_ROOTFS_EXT4FS=y
CONFIG_TARGET_ROOTFS_SQUASHFS=n
CONFIG_TARGET_armvirt_64_DEVICE_box=y
CONFIG_PACKAGE_kmod-brcmfmac=y
CONFIG_BRCMFMAC_SDIO=y
CONFIG_TARGET_ROOTFS_TARGZ=y

CONFIG_TARGET_ROOTFS_INITRAMFS=n
CONFIG_TARGET_ROOTFS_EXT4FS=y
CONFIG_TARGET_ROOTFS_SQUASHFS=n

CONFIG_PACKAGE_luci-ssl=n # uhttpd服务
CONFIG_PACKAGE_luci-ssl-nginx=y # nginx
Expand Down
37 changes: 0 additions & 37 deletions devices/armvirt_64/diy/target/linux/armvirt/image/Makefile

This file was deleted.

38 changes: 37 additions & 1 deletion devices/armvirt_64/patches/rootfs.patch
Original file line number Diff line number Diff line change
@@ -1,11 +1,47 @@
--- a/include/image.mk
+++ b/include/image.mk
@@ -770,5 +770,7 @@
@@ -728,8 +769,10 @@ endef
define Device
$(call Device/InitProfile,$(1))
$(call Device/Init,$(1))
+ $(call Device/Init,$(PROFILE_SANITIZED))
$(call Device/Default,$(1))
$(call Device/$(1),$(1))
+ $(call Device/$(PROFILE_SANITIZED),$(1))
$(call Device/Check,$(1))
$(call Device/$(if $(DUMP),Dump,Build),$(1))


--- a/target/linux/armvirt/image/Makefile
+++ b/target/linux/armvirt/image/Makefile
@@ -23,10 +23,30 @@ endef

$(eval $(call Image/gzip-ext4-padded-squashfs))

+define Device/box
+ DEVICE_VENDOR :=
+ DEVICE_MODEL := 电视盒子全系列 / N1
+ DEVICE_PACKAGES :=
+endef
+TARGET_DEVICES += box
+
+define Device/armvirt
+ DEVICE_MODEL := QEMU ARM virt machine
+ DEVICE_PACKAGES :=
+endef
+TARGET_DEVICES += armvirt
+
define Image/Build
$(call Image/Build/$(1))
$(CP) $(KDIR)/root.$(1) $(BIN_DIR)/$(IMG_ROOTFS)-$(1).img
$(call Image/Build/gzip/$(1))
+ if [ "$(PROFILE_SANITIZED)" == "box" ]; then \
+ export BIN_DIR=$(BIN_DIR); \
+ export DATE=$(DATE); \
+ cd /www/wwwroot/op.supes.top/bcache/armvirt/64/amlogic-s9xxx-openwrt; \
+ . ../modify_amlogic.sh; \
+ ./make -k 5.15.100 -b $(MORE) -s $(shell echo $$(($(ROOTFS_PARTSIZE)/1024/1024))) || true; \
+ fi
endef

$(eval $(call BuildImage))
2 changes: 2 additions & 0 deletions devices/common/.config
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ CONFIG_PACKAGE_kmod-sprd_pcie=n

CONFIG_PACKAGE_kmod-pcie_mhi=n

CONFIG_PACKAGE_kmod-mii=n




Expand Down
4 changes: 3 additions & 1 deletion devices/common/kernel_5.15.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@ svn export --force https://github.com/openwrt/packages/trunk/net/xtables-addons
svn co https://github.com/coolsnowwolf/lede/trunk/target/linux/generic/hack-5.15 target/linux/generic/hack-5.15
svn co https://github.com/coolsnowwolf/lede/trunk/target/linux/generic/backport-5.15 target/linux/generic/backport-5.15
find target/linux/generic/backport-5.15 -name "[0-9][0-9][0-9]-[a-z][a-z]*" -exec rm -f {} \;
rm -rf target/linux/generic/backport-5.15/{802-v6.1-nvmem*,803-v5.19-nvmem*,733-v6.2-02-net-mediatek-sgmii-ensure*,733-v6.2-03-net-mediatek*,733-v6.2-04-mtk_sgmii-enable*,730-11-v6.3-net-ethernet-mtk_eth*,775-v5.16-net-phylink*,776-v5.16-net-ethernet-*,612-v6.3-skbuff-Fix*}
rm -rf target/linux/generic/backport-5.15/{799-v6.0-net-mii*,802-v6.1-nvmem*,803-v5.19-nvmem*,733-v6.2-02-net-mediatek-sgmii-ensure*,733-v6.2-03-net-mediatek*,733-v6.2-04-mtk_sgmii-enable*,730-11-v6.3-net-ethernet-mtk_eth*,775-v5.16-net-phylink*,776-v5.16-net-ethernet-*,612-v6.3-skbuff-Fix*}
curl -sfL https://raw.githubusercontent.com/coolsnowwolf/lede/master/target/linux/generic/pending-5.15/613-netfilter_optional_tcp_window_check.patch -o target/linux/generic/pending-5.15/613-netfilter_optional_tcp_window_check.patch

sed -i "s/tty\(0\|1\)::askfirst/tty\1::respawn/g" target/linux/*/base-files/etc/inittab

sed -i "s/CONFIG_WERROR=y/CONFIG_WERROR=n/" target/linux/generic/config-5.15

echo "
CONFIG_TESTING_KERNEL=y
CONFIG_PACKAGE_kmod-ipt-coova=n
Expand Down
58 changes: 21 additions & 37 deletions devices/common/patches/fix.patch
Original file line number Diff line number Diff line change
Expand Up @@ -45,49 +45,14 @@
ifdef CONFIG_TARGET_ROOTFS_CPIOGZ
define Image/Build/cpiogz
( cd $(TARGET_DIR); find . | $(STAGING_DIR_HOST)/bin/cpio -o -H newc -R 0:0 | gzip -9n >$(BIN_DIR)/$(IMG_ROOTFS).cpio.gz )
@@ -367,12 +405,13 @@ define Device/Init
@@ -367,6 +405,7 @@ define Device/Init
DEVICE_IMG_PREFIX := $(IMG_PREFIX)-$(1)
DEVICE_IMG_NAME = $$(DEVICE_IMG_PREFIX)-$$(1)-$$(2)
IMAGE_SIZE :=
+ ROOTFSTZ = $$(DEVICE_IMG_PREFIX)-rootfs.tar.gz
KERNEL_PREFIX = $$(DEVICE_IMG_PREFIX)
KERNEL_SUFFIX := -kernel.bin
KERNEL_INITRAMFS_SUFFIX = $$(KERNEL_SUFFIX)
KERNEL_IMAGE = $$(KERNEL_PREFIX)$$(KERNEL_SUFFIX)
KERNEL_INITRAMFS_PREFIX = $$(DEVICE_IMG_PREFIX)-initramfs
- KERNEL_INITRAMFS_IMAGE = $$(KERNEL_INITRAMFS_PREFIX)$$(KERNEL_INITRAMFS_SUFFIX)
+ KERNEL_INITRAMFS_IMAGE = $(subst $(IMG_PREFIX_EXTRA),,$(IMG_PREFIX))-$(1)-initramfs$$(KERNEL_INITRAMFS_SUFFIX)
KERNEL_INITRAMFS_NAME = $$(KERNEL_NAME)-initramfs
KERNEL_INSTALL :=
KERNEL_NAME := vmlinux
@@ -472,7 +511,6 @@ define Device/Check
endif
endef

-ifndef IB
define Device/Build/initramfs
$(call Device/Export,$(KDIR)/tmp/$$(KERNEL_INITRAMFS_IMAGE),$(1))
$$(_TARGET): $$(if $$(KERNEL_INITRAMFS),$(BIN_DIR)/$$(KERNEL_INITRAMFS_IMAGE) \
@@ -483,9 +521,11 @@ define Device/Build/initramfs
$(BIN_DIR)/$$(KERNEL_INITRAMFS_IMAGE): $(KDIR)/tmp/$$(KERNEL_INITRAMFS_IMAGE)
cp $$^ $$@

+ ifndef IB
$(KDIR)/tmp/$$(KERNEL_INITRAMFS_IMAGE): $(KDIR)/$$(KERNEL_INITRAMFS_NAME) $(CURDIR)/Makefile $$(KERNEL_DEPENDS) image_prepare
@rm -f $$@
$$(call concat_cmd,$$(KERNEL_INITRAMFS))
+ endif

$(call Device/Export,$(BUILD_DIR)/json_info_files/$$(KERNEL_INITRAMFS_IMAGE).json,$(1))

@@ -519,7 +559,6 @@ define Device/Build/initramfs
SUPPORTED_DEVICES="$$(SUPPORTED_DEVICES)" \
$(TOPDIR)/scripts/json_add_image_info.py $$@
endef
-endif

define Device/Build/compile
$$(_COMPILE_TARGET): $(KDIR)/$(1)
@@ -568,7 +607,7 @@ define Device/Build/kernel
endef

Expand All @@ -97,7 +62,15 @@
$$(_TARGET): $(if $(CONFIG_JSON_OVERVIEW_IMAGE_INFO), \
$(BUILD_DIR)/json_info_files/$(call DEVICE_IMG_NAME,$(1),$(2)).json, \
$(BIN_DIR)/$(call DEVICE_IMG_NAME,$(1),$(2))$$(GZ_SUFFIX))
@@ -678,6 +717,8 @@ define Device/Build
@@ -606,6 +645,7 @@ define Device/Build/image
FILE_TYPE=$(word 1,$(subst ., ,$(2))) \
FILE_FILESYSTEM="$(1)" \
DEVICE_IMG_PREFIX="$(DEVICE_IMG_PREFIX)" \
+ KERNEL_INITRAMFS_IMAGE="$(subst $(IMG_PREFIX_EXTRA),,$(KERNEL_INITRAMFS_IMAGE))" \
DEVICE_VENDOR="$(DEVICE_VENDOR)" \
DEVICE_MODEL="$(DEVICE_MODEL)" \
DEVICE_VARIANT="$(DEVICE_VARIANT)" \
@@ -678,6 +718,8 @@ define Device/Build
$(if $(CONFIG_TARGET_ROOTFS_INITRAMFS),$(call Device/Build/initramfs,$(1)))
$(call Device/Build/kernel,$(1))

Expand Down Expand Up @@ -126,3 +99,14 @@
],
stdout=PIPE,
stderr=PIPE,

--- a/scripts/json_add_image_info.py
+++ b/scripts/json_add_image_info.py
@@ -55,6 +55,7 @@ def get_titles():
"profiles": {
device_id: {
"image_prefix": getenv("DEVICE_IMG_PREFIX"),
+ "image_initramfs": getenv("KERNEL_INITRAMFS_IMAGE"),
"images": [
{
"type": getenv("FILE_TYPE"),
21 changes: 2 additions & 19 deletions devices/common/patches/imagebuilder.patch
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
--- a/target/imagebuilder/Makefile
+++ b/target/imagebuilder/Makefile
@@ -26,7 +26,7 @@ all: compile

$(BIN_DIR)/$(IB_NAME).tar.xz: clean
rm -rf $(PKG_BUILD_DIR)
- mkdir -p $(IB_KDIR) $(IB_LDIR) $(PKG_BUILD_DIR)/staging_dir/host/lib \
+ mkdir -p $(IB_KDIR)/tmp $(IB_LDIR) $(PKG_BUILD_DIR)/staging_dir/host/lib \
$(PKG_BUILD_DIR)/target $(PKG_BUILD_DIR)/scripts $(IB_DTSDIR)
-cp $(TOPDIR)/.config $(PKG_BUILD_DIR)/.config
$(SED) 's/^CONFIG_BINARY_FOLDER=.*/# CONFIG_BINARY_FOLDER is not set/' $(PKG_BUILD_DIR)/.config
@@ -38,13 +38,16 @@ $(BIN_DIR)/$(IB_NAME).tar.xz: clean
./files/repositories.conf \
$(TMP_DIR)/.targetinfo \
Expand All @@ -29,14 +20,6 @@

$(INSTALL_DIR) $(PKG_BUILD_DIR)/packages
# create an empty package index so `opkg` doesn't report an error
@@ -79,6 +82,7 @@ ifneq ($(CONFIG_SIGNATURE_CHECK),)
endif

$(CP) -L $(TOPDIR)/target/linux $(PKG_BUILD_DIR)/target/
+ $(CP) -L $(KERNEL_BUILD_DIR)/tmp/*initramfs* $(IB_KDIR)/tmp/ || true
if [ -d $(TOPDIR)/staging_dir/host/lib/grub ]; then \
$(CP) $(TOPDIR)/staging_dir/host/lib/grub/ $(PKG_BUILD_DIR)/staging_dir/host/lib; \
fi

--- a/target/imagebuilder/files/Makefile
+++ b/target/imagebuilder/files/Makefile
Expand Down Expand Up @@ -68,7 +51,7 @@
$(MAKE) -s build_image
$(MAKE) -s json_overview_image_info
$(MAKE) -s checksum
+ rm -rf $(KERNEL_BUILD_DIR)/tmp/openwrt-20.*
+ rm -rf $(KERNEL_BUILD_DIR)/tmp
+ rm -rf $(KERNEL_BUILD_DIR)/root.*

_call_manifest: FORCE
Expand Down Expand Up @@ -105,4 +88,4 @@
+ nice -n 19 $(NO_TRACE_MAKE) -C target/linux/$(BOARD)/image install TARGET_BUILD=1 IB=1 EXTRA_IMAGE_NAME="$(EXTRA_IMAGE_NAME)" \
$(if $(USER_PROFILE),PROFILE="$(USER_PROFILE)")

$(BIN_DIR)/profiles.json: FORCE
$(BIN_DIR)/profiles.json: FORCE
47 changes: 47 additions & 0 deletions devices/ipq50xx_arm/.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@

CONFIG_TARGET_ipq50xx=y
CONFIG_TARGET_ipq50xx_arm=y
CONFIG_TARGET_MULTI_PROFILE=y
CONFIG_TARGET_ALL_PROFILES=y

CONFIG_PACKAGE_luci-ssl=y # uhttpd服务

CONFIG_PACKAGE_kmod-mdio-netlink=n
CONFIG_PACKAGE_kmod-jool-netfilter=n
CONFIG_PACKAGE_perf=n

CONFIG_PACKAGE_kmod-netem=n
CONFIG_PACKAGE_kmod-sched=n
CONFIG_PACKAGE_kmod-sched-act-vlan=n
CONFIG_PACKAGE_kmod-sched-bpf=n
CONFIG_PACKAGE_kmod-sched-cake=n
CONFIG_PACKAGE_kmod-sched-connmark=n
CONFIG_PACKAGE_kmod-sched-core=n
CONFIG_PACKAGE_kmod-sched-ctinfo=n
CONFIG_PACKAGE_kmod-sched-flower=n
CONFIG_PACKAGE_kmod-sched-ipset=n
CONFIG_PACKAGE_kmod-sched-mqprio=n

CONFIG_PACKAGE_kmod-qca-nss-drv-igs=n
CONFIG_PACKAGE_kmod-qca-nss-drv-mirror=n
CONFIG_PACKAGE_kmod-qca-nss-drv-qdisc=n

CONFIG_PACKAGE_kmod-qca-nss-drv-capwapmgr=n
CONFIG_PACKAGE_kmod-qca-nss-drv-clmapmgr=n
CONFIG_PACKAGE_kmod-qca-nss-drv-dtlsmgr=n
CONFIG_PACKAGE_kmod-qca-nss-drv-eogremgr=n
CONFIG_PACKAGE_kmod-qca-nss-drv-gre=n
CONFIG_PACKAGE_kmod-qca-nss-drv-ipsecmgr=n
CONFIG_PACKAGE_kmod-qca-nss-drv-l2tpv2=n
CONFIG_PACKAGE_kmod-qca-nss-drv-lag-mgr=n
CONFIG_PACKAGE_kmod-qca-nss-drv-map-t=n
CONFIG_PACKAGE_kmod-qca-nss-drv-match=n
CONFIG_PACKAGE_kmod-qca-nss-drv-netlink=n
CONFIG_PACKAGE_kmod-qca-nss-drv-pppoe=n
CONFIG_PACKAGE_kmod-qca-nss-drv-pptp=n
CONFIG_PACKAGE_kmod-qca-nss-drv-profile=n
CONFIG_PACKAGE_kmod-qca-nss-drv-pvxlanmgr=n
CONFIG_PACKAGE_kmod-qca-nss-drv-tun6rd=n
CONFIG_PACKAGE_kmod-qca-nss-drv-tunipip6=n
CONFIG_PACKAGE_kmod-qca-nss-drv-vxlanmgr=n

21 changes: 21 additions & 0 deletions devices/ipq50xx_arm/diy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

shopt -s extglob

SHELL_FOLDER=$(dirname $(readlink -f "$0"))

sed -i '/postgres=5432/d' feeds/packages.index
sed -i '/postgres=5432/d' feeds/packages/net/gnunet/Makefile
./scripts/feeds install -a

sed -i "s/make-ext4fs missing-macros/make-ext4fs meson missing-macros/" tools/Makefile
curl -sfL https://raw.githubusercontent.com/openwrt/openwrt/openwrt-22.03/include/meson.mk -o include/meson.mk
svn co https://github.com/openwrt/openwrt/branches/openwrt-22.03/tools/meson tools/meson

rm -rf package/feeds/kiddin9/rtl* feeds/kiddin9/{shortcut-fe,fullconenat-nft} package/kernel/mt76 package/kernel/exfat package/feeds/packages/fuse*

rm -rf devices/common/patches/{fix.patch,iptables.patch,kernel-defaults.patch,targets.patch}

rm -rf toolchain/musl

svn co https://github.com/openwrt/openwrt/branches/openwrt-22.03/toolchain/musl toolchain/musl
4 changes: 4 additions & 0 deletions devices/ipq50xx_arm/feeds.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
src-git packages https://git.openwrt.org/feed/packages.git;openwrt-22.03
src-git luci https://git.openwrt.org/project/luci.git;openwrt-22.03
src-git routing https://git.openwrt.org/feed/routing.git;openwrt-22.03
src-git kiddin9 https://github.com/kiddin9/openwrt-packages.git;master
11 changes: 11 additions & 0 deletions devices/ipq50xx_arm/patches/cr880x.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/target/linux/ipq50xx/image/Makefile
+++ b/target/linux/ipq50xx/image/Makefile
@@ -35,6 +35,8 @@ define Device/redmi_ax3000
SOC := ipq5000
DEVICE_VENDOR := Redmi
DEVICE_MODEL := AX3000
+ DEVICE_ALT0_VENDOR := Xiaomi
+ DEVICE_ALT0_MODEL := CR880X
BLOCKSIZE := 128k
PAGESIZE := 2048
DEVICE_DTS_CONFIG := [email protected]
Loading

0 comments on commit af7fa86

Please sign in to comment.