Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
kiddin9 committed Sep 17, 2024
1 parent d9c59ab commit 10c200f
Show file tree
Hide file tree
Showing 30 changed files with 599 additions and 530 deletions.
13 changes: 12 additions & 1 deletion .github/workflows/Openwrt-AutoBuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,17 @@ jobs:
--data '{"event_type": "update"}'
fi
- name: Free disk space
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true

- name: Initialization environment
env:
DEBIAN_FRONTEND: noninteractive
Expand All @@ -117,7 +128,6 @@ jobs:
python3-dev python3-pip rsync unzip zlib1g-dev swig aria2 jq subversion qemu-utils ccache rename \
libelf-dev device-tree-compiler libgnutls28-dev coccinelle libgmp3-dev libmpc-dev libfuse-dev gcc-multilib
pip3 install --user -U pylibfdt
sudo -E apt-get -qq purge azure-cli ghc* zulu* firefox powershell openjdk* dotnet* google* mysql* php* android*
sudo rm -rf /etc/apt/sources.list.d/* /usr/share/dotnet /usr/local/lib/android /opt/ghc
sudo -E apt-get -qq autoremove --purge
sudo -E apt-get -qq clean
Expand Down Expand Up @@ -364,6 +374,7 @@ jobs:
uses: GitRML/delete-workflow-runs@main
continue-on-error: true
with:
token: ${{ secrets.TOKEN_KIDDIN9 }}
retain_days: 100
keep_minimum_runs: 0

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/repo-dispatcher.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ env:

jobs:
build:
runs-on: Ubuntu-22.04
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@main
Expand All @@ -37,7 +37,7 @@ jobs:
if: contains(github.event.inputs.param, 'cw')
with:
workflow_id: all
access_token: ${{ github.token }}
access_token: ${{ secrets.TOKEN_KIDDIN9 }}

- name: Load Settings.ini
run: |
Expand Down
4 changes: 0 additions & 4 deletions devices/amlogic_meson8b/.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ CONFIG_TARGET_amlogic=y
CONFIG_TARGET_amlogic_meson8b=y
CONFIG_TARGET_amlogic_meson8b_DEVICE_thunder-onecloud=y

CONFIG_PACKAGE_kmod-rt2x00-pci=n
CONFIG_PACKAGE_kmod-r8101=n

CONFIG_TARGET_ROOTFS_SQUASHFS=n
CONFIG_TARGET_ROOTFS_EXT4FS=y

CONFIG_PACKAGE_perf=n
9 changes: 5 additions & 4 deletions devices/amlogic_meson8b/diy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ SHELL_FOLDER=$(dirname $(readlink -f "$0"))

bash $SHELL_FOLDER/../common/kernel_6.1.sh

git_clone_path master https://github.com/coolsnowwolf/lede target/linux/amlogic package/boot/uboot-amlogic

rm -rf package/kernel/mac80211

git_clone_path c640f7b93736621b4d56627e4f6ab824093f9c3d https://github.com/openwrt/openwrt package/kernel/mac80211

sed -i "s/wpad-openssl/wpad-basic-mbedtls/" target/linux/amlogic/image/meson8b.mk
git_clone_path main https://github.com/shiyu1314/openwrt-onecloud kernel/6.1/amlogic && mv -f kernel/6.1/amlogic target/linux/

sed -i "s/CPU_SUBTYPE:=neon-vfpv4/CPU_SUBTYPE:=vfpv4/" target/linux/amlogic/meson8b/target.mk

sed -i "s/wpad-openssl/wpad-basic-mbedtls/" target/linux/amlogic/image/Makefile

rm -rf package/kernel/r8125 package/kernel/r8126 package/kernel/r8168

24 changes: 4 additions & 20 deletions devices/amlogic_meson8b/patches/onecloud.patch
Original file line number Diff line number Diff line change
@@ -1,28 +1,12 @@
--- a/target/linux/amlogic/image/meson8b.mk
+++ b/target/linux/amlogic/image/meson8b.mk
@@ -11,7 +11,8 @@ endef
--- a/target/linux/amlogic/image/Makefile
+++ b/target/linux/amlogic/image/Makefile
@@ -49,7 +49,8 @@ endef

define Device/thunder-onecloud
DEVICE_DTS := meson8b-onecloud
- DEVICE_TITLE := Thunder OneCloud
+ DEVICE_TITLE := OneCloud 玩客云
+ DEVICE_PACKAGES += kmod-usb-net-rtl8152
KERNEL_LOADADDR := 0x00208000
IMAGE/emmc.img := boot-script onecloud | emmc-common $$(DEVICE_NAME)
IMAGE/emmc_burn.img := boot-script onecloud | emmc-common $$(DEVICE_NAME)
endef

--- a/target/linux/amlogic/image/Makefile
+++ b/target/linux/amlogic/image/Makefile
@@ -88,4 +88,12 @@ endef

include $(SUBTARGET).mk

+define Image/Build
+ if [ "$(PROFILE_SANITIZED)" == "thunder-onecloud" ]; then \
+ export BIN_DIR=$(BIN_DIR); \
+ cd /data/packit/openwrt-onecloud || true; \
+ . ~/packit/packit_onecloud1.sh || true; \
+ fi
+endef
+
$(eval $(call BuildImage))
8 changes: 5 additions & 3 deletions devices/common/diy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ mv -f feeds/kiddin9/base-files package/

echo "$(date +"%s")" >version.date
sed -i '/$(curdir)\/compile:/c\$(curdir)/compile: package/opkg/host/compile' package/Makefile
sed -i "s/DEFAULT_PACKAGES:=/DEFAULT_PACKAGES:=luci-app-advancedplus luci-app-firewall luci-app-opkg luci-app-upnp luci-app-autoreboot \
sed -i "s/DEFAULT_PACKAGES:=/DEFAULT_PACKAGES:=luci-app-advancedplus luci-app-firewall luci-app-opkg luci-app-upnp \
luci-app-wizard luci-base luci-compat luci-lib-ipkg luci-lib-fs \
coremark wget-ssl curl autocore htop nano zram-swap kmod-lib-zstd kmod-tcp-bbr bash openssh-sftp-server block-mount resolveip ds-lite swconfig luci-app-fan luci-app-fileassistant /" include/target.mk

Expand All @@ -35,7 +35,7 @@ while [[ "$status" == "in_progress" || "$status" == "queued" ]];do
status=$(curl -H "Authorization: token $REPO_TOKEN" -s "https://api.github.com/repos/kiddin9/openwrt-packages/actions/runs" | jq -r '.workflow_runs[0].status')
done

rm -rf package/feeds/packages/v4l2loopback
rm -rf package/feeds/packages/v4l2loopback package/feeds/kiddin9/accel-ppp

mv -f feeds/kiddin9/r81* tmp/

Expand Down Expand Up @@ -73,6 +73,8 @@ sed -i 's/max_requests 3/max_requests 20/g' package/network/services/uhttpd/file
#rm -rf ./feeds/packages/lang/{golang,node}
sed -i "s/tty\(0\|1\)::askfirst/tty\1::respawn/g" target/linux/*/base-files/etc/inittab

sed -i 's/$$(call concat_cmd,$$(KERNEL_INITRAMFS))/-$$(call concat_cmd,$$(KERNEL_INITRAMFS))/' include/image.mk

date=`date +%m.%d.%Y`
sed -i -e "/\(# \)\?REVISION:=/c\REVISION:=$date" -e '/VERSION_CODE:=/c\VERSION_CODE:=$(REVISION)' include/version.mk

Expand All @@ -83,4 +85,4 @@ sed -i \
-e 's?../../lang?$(TOPDIR)/feeds/packages/lang?' \
package/feeds/kiddin9/*/Makefile

sed -i "s/OpenWrt/KWrt/g" package/base-files/files/bin/config_generate package/base-files/image-config.in config/Config-images.in Config.in include/u-boot.mk include/version.mk package/network/config/wifi-scripts/files/lib/wifi/mac80211.sh package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh || true
sed -i "s/OpenWrt/Kwrt/g" package/base-files/files/bin/config_generate package/base-files/image-config.in config/Config-images.in Config.in include/u-boot.mk include/version.mk package/network/config/wifi-scripts/files/lib/wifi/mac80211.sh package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh || true
2 changes: 1 addition & 1 deletion devices/common/kernel_6.1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ sed -i "s/tty\(0\|1\)::askfirst/tty\1::respawn/g" target/linux/*/base-files/etc/

sed -i "s/no-lto,/no-lto no-mold,/" include/package.mk

sed -i "s/OpenWrt/KWrt/g" package/base-files/files/bin/config_generate package/base-files/image-config.in config/Config-images.in Config.in include/u-boot.mk include/version.mk package/network/config/wifi-scripts/files/lib/wifi/mac80211.sh || true
sed -i "s/OpenWrt/Kwrt/g" package/base-files/files/bin/config_generate package/base-files/image-config.in config/Config-images.in Config.in include/u-boot.mk include/version.mk package/network/config/wifi-scripts/files/lib/wifi/mac80211.sh || true
112 changes: 62 additions & 50 deletions devices/common/patches/imagebuilder.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
--- a/include/image.mk
+++ b/include/image.mk
@@ -504,7 +504,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) \
@@ -557,7 +556,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)
@@ -623,7 +621,7 @@ define Device/Build/kernel
endef

define Device/Build/image
- GZ_SUFFIX := $(if $(filter %dtb %gz,$(2)),,$(if $(and $(findstring ext4,$(1)),$(CONFIG_TARGET_IMAGES_GZIP)),.gz))
+ GZ_SUFFIX := $(if $(filter %dtb %gz,$(2)),,$(if $(and $(findstring ext4,$(1)),$(findstring img,$(2)),$(CONFIG_TARGET_IMAGES_GZIP)),.gz))
$$(_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))
@@ -761,6 +761,7 @@ define Device/DumpInfo
Target-Profile: DEVICE_$(1)
Target-Profile-Name: $(DEVICE_DISPLAY)
Expand Down Expand Up @@ -55,47 +80,34 @@

--- a/target/imagebuilder/files/Makefile
+++ b/target/imagebuilder/files/Makefile
@@ -131,21 +131,47 @@ BUILD_PACKAGES:=$(sort $(DEFAULT_PACKAGES) $($(USER_PROFILE)_PACKAGES) kernel)
@@ -131,6 +131,26 @@ BUILD_PACKAGES:=$(sort $(DEFAULT_PACKAGES) $($(USER_PROFILE)_PACKAGES) kernel)
# "-pkgname" in the package list means remove "pkgname" from the package list
BUILD_PACKAGES:=$(filter-out $(filter -%,$(BUILD_PACKAGES)) $(patsubst -%,%,$(filter -%,$(BUILD_PACKAGES))),$(BUILD_PACKAGES))
BUILD_PACKAGES:=$(USER_PACKAGES) $(BUILD_PACKAGES)
+IMAGE_SIZE:="$(shell echo $$(echo $($(USER_PROFILE)_IMAGE_SIZE) | cut -d k -f1))"
+BUILD_PACKAGES:=$(shell if [[ "$(IMAGE_SIZE)" && ! "`echo "$(IMAGE_SIZE)" | grep "m"`" && $(IMAGE_SIZE) -lt 20480 ]]; then \
+echo "$(BUILD_PACKAGES) -coremark -htop -bash -openssh-sftp-server "; \
+else \
+echo "$(BUILD_PACKAGES)"; \
+fi \
+)
+IMAGE_SIZE_VALUE := $(shell echo $($(USER_PROFILE)_IMAGE_SIZE) | sed 's/k$$//')
+ifdef IMAGE_SIZE_VALUE
+ ifeq ($(shell test $(IMAGE_SIZE_VALUE) -lt 20480 && echo true),true)
+ SMALL_FLASH := true
+ endif
+endif
+ifneq ($(findstring usb,$(BUILD_PACKAGES)),)
+ BUILD_PACKAGES += automount luci-app-diskman
+endif
+ifeq ($(SMALL_FLASH),true)
+ BUILD_PACKAGES += -coremark -htop -bash -openssh-sftp-server -luci-app-diskman
+ ifeq ($(shell grep -q small_flash $(TOPDIR)/repositories.conf || echo "not_found"),not_found)
+ $(shell echo "`grep kwrt_kiddin9 $(TOPDIR)/repositories.conf | sed -e 's/kiddin9/small_flash/g'`" >>$(TOPDIR)/repositories.conf)
+ endif
+else
+ $(shell sed -i "/small_flash/d" $(TOPDIR)/repositories.conf)
+endif
+define add_zh_cn_packages
+$(eval BUILD_PACKAGES += $(foreach pkg,$(BUILD_PACKAGES),$(if $(and $(filter luci-app-%,$(pkg)),$(shell $(OPKG) list | grep -q "^luci-i18n-$(patsubst luci-app-%,%,$(pkg))-zh-cn" && echo 1)),luci-i18n-$(patsubst luci-app-%,%,$(pkg))-zh-cn)))
+endef
BUILD_PACKAGES:=$(filter-out $(filter -%,$(BUILD_PACKAGES)) $(patsubst -%,%,$(filter -%,$(BUILD_PACKAGES))),$(BUILD_PACKAGES))
PACKAGES:=

_call_image: staging_dir/host/.prereq-build
- echo 'Building images for $(BOARD)$(if $($(USER_PROFILE)_NAME), - $($(USER_PROFILE)_NAME))'
+ [ "$(DATE)" ] && DATE="$(DATE)" || DATE="`date +'%m.%d.%Y'`"; \
+ mkdir -p $(USER_FILES)/etc/uci-defaults || true; \
+ echo -e " \
+ sed -i \"s/[0-9]\+.[0-9]\+.[0-9]\{4\}/$$DATE/\" /etc/openwrt_release \n \
+ sed -i \"s/DISTRIB_ID=.*/DISTRIB_ID='$(ROOTFS_PARTSIZE)'/\" /etc/openwrt_release \n \
+ sed -i \"s/KWrt .* by/Kwrt $$DATE by/\" /etc/banner \n \
+ echo \"$$DATE\" >/etc/openwrt_version \n \
+ "> $(USER_FILES)/etc/uci-defaults/99-version; \
+ echo 'Building images for $(BOARD)$(if $($(USER_PROFILE)_NAME), - $($(USER_PROFILE)_NAME))'; \
echo 'Packages: $(BUILD_PACKAGES)'
echo
rm -rf $(TARGET_DIR) $(TARGET_DIR_ORIG)
mkdir -p $(TARGET_DIR) $(BIN_DIR) $(TMP_DIR) $(DL_DIR)
+ if [[ "$(IMAGE_SIZE)" && ! "`echo "$(IMAGE_SIZE)" | grep "m"`" ]]; then \
+ if [[ $(IMAGE_SIZE) -lt 20480 ]]; then \
+ if [[ ! "`grep "small_flash" $(TOPDIR)/repositories.conf`" ]]; then \
+ echo "`grep kwrt_kiddin9 $(TOPDIR)/repositories.conf | sed -e 's/kiddin9/small_flash/g'`" >>$(TOPDIR)/repositories.conf; \
+ fi \
+ else \
+ sed -i "/small_flash/d" $(TOPDIR)/repositories.conf; \
+ fi \
+ fi
$(MAKE) package_reload
$(MAKE) package_install
$(MAKE) -s prepare_rootfs
@@ -146,6 +166,8 @@ _call_image: staging_dir/host/.prereq-build
$(MAKE) -s build_image
$(MAKE) -s json_overview_image_info
$(MAKE) -s checksum
Expand All @@ -104,32 +116,32 @@

_call_manifest: FORCE
rm -rf $(TARGET_DIR)
@@ -186,7 +212,17 @@ package_install: FORCE
@@ -184,9 +206,17 @@ package_list: FORCE
package_install: FORCE
@echo
@echo Installing packages...
+ $(eval $(call add_zh_cn_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))
- $(OPKG) install $(BUILD_PACKAGES)
+ for p in $(BUILD_PACKAGES); do \
+ if [[ $$p == luci-app-* && "`$(OPKG) list | grep luci-i18n-\`echo $$p | cut -d - -f 3-\`-zh-cn`" ]]; then \
+ packages+="luci-i18n-`echo $$p | cut -d - -f 3-`-zh-cn "; \
+ fi \
+ $(OPKG) install $(BUILD_PACKAGES) luci-i18n-base-zh-cn || true
+ $(if $(USER_FILES), \
+ find $(USER_FILES) -name "*.ipk" -print0 | \
+ while IFS= read -r -d '' ipk; do \
+ $(OPKG) install "$$ipk" && rm -f "$$ipk" || true; \
+ done; \
+ if [[ "`echo "$(BUILD_PACKAGES)" | grep "usb"`" ]]; then \
+ packages+="automount "; \
+ fi; \
+ $(OPKG) install $(BUILD_PACKAGES) luci-i18n-base-zh-cn luci-i18n-base-en; \
+ $(OPKG) install $$packages || true
+ )
+ $(OPKG) install --force-maintainer --force-reinstall my-default-settings

prepare_rootfs: FORCE
@echo
@@ -200,12 +236,15 @@ prepare_rootfs: FORCE
@@ -200,12 +230,15 @@ prepare_rootfs: FORCE
) \
)
$(call prepare_rootfs,$(TARGET_DIR),$(USER_FILES),$(DISABLED_SERVICES))
+ if [[ "$(IMAGE_SIZE)" && ! "`echo "$(IMAGE_SIZE)" | grep "m"`" && $(IMAGE_SIZE) -lt 20480 ]]; then \
+ echo "`grep kwrt_kiddin9 $(TOPDIR)/repositories.conf | sed -e 's/kiddin9/small_flash/g'`" >>$(BUILD_DIR)/root-*/etc/opkg/distfeeds.conf; \
+ fi
+ $(if $(SMALL_FLASH), \
+ $(shell echo "`grep kwrt_kiddin9 $(TOPDIR)/repositories.conf | sed -e 's/kiddin9/small_flash/g'`" >>$(BUILD_DIR)/root-*/etc/opkg/distfeeds.conf) \
+ )

build_image: FORCE
@echo
Expand All @@ -139,4 +151,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
81 changes: 0 additions & 81 deletions devices/common/patches/rootfstargz.patch

This file was deleted.

Loading

0 comments on commit 10c200f

Please sign in to comment.