From 379cc1660330ffea12f8495e9adcd0eff777755b Mon Sep 17 00:00:00 2001 From: kiddin9 <48883331+kiddin9@users.noreply.github.com> Date: Mon, 19 Aug 2024 20:47:10 +0800 Subject: [PATCH] update --- .github/workflows/Openwrt-AutoBuild.yml | 9 +++-- devices/amlogic_meson8b/.config | 2 ++ devices/common/diy.sh | 19 +---------- devices/common/kernel_6.1.sh | 3 +- devices/common/patches/imagebuilder.patch | 6 ++-- devices/rockchip_rk35xx/.config | 18 ++++++++++ devices/rockchip_rk35xx/README.md | 1 + devices/rockchip_rk35xx/diy.sh | 34 +++++++++++++++++++ .../patches/add_extra_CPU_FLAGS.b | 22 ++++++++++++ devices/rockchip_rk35xx/patches/h28k.patch | 19 +++++++++++ 10 files changed, 109 insertions(+), 24 deletions(-) create mode 100644 devices/rockchip_rk35xx/.config create mode 100644 devices/rockchip_rk35xx/README.md create mode 100644 devices/rockchip_rk35xx/diy.sh create mode 100644 devices/rockchip_rk35xx/patches/add_extra_CPU_FLAGS.b create mode 100644 devices/rockchip_rk35xx/patches/h28k.patch diff --git a/.github/workflows/Openwrt-AutoBuild.yml b/.github/workflows/Openwrt-AutoBuild.yml index 94aa3cb9d732..6e9d174c02e4 100644 --- a/.github/workflows/Openwrt-AutoBuild.yml +++ b/.github/workflows/Openwrt-AutoBuild.yml @@ -113,7 +113,7 @@ jobs: run: | sudo -E apt-get -qq update sudo -E apt-get -qq install build-essential clang llvm flex g++ gawk gcc-multilib gettext \ - git libncurses5-dev libssl-dev python3-distutils python3-pyelftools python3-setuptools \ + git libncurses5-dev libssl-dev python2.7 python3-distutils python3-pyelftools python3-setuptools \ 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 @@ -121,6 +121,7 @@ jobs: 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 + sudo ln -sf /usr/bin/python2.7 /usr/bin/python2 sudo timedatectl set-timezone "$TZ" git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" git config --global user.name "github-actions[bot]" @@ -220,9 +221,13 @@ jobs: run: | cd openwrt make defconfig - if [[ ! "${{matrix.target}}" =~ (armsr_armv8|bcm27xx_*|rockchip_*|sunxi_*|x86_*) ]]; then + if [[ ! "${{matrix.target}}" =~ (armsr_armv8|bcm27xx_*|rockchip_armv8|sunxi_*|x86_*) ]]; then sed -n '/# Wireless Drivers/,/# end of Wireless Drivers/p' .config | sed -e 's/=m/=n/' >>.config sed -i "s/\(kmod-qca.*\)=m/\1=n/" .config + if [[ "${{matrix.target}}" =~ (amlogic_*|rockchip_rk35xx) ]]; then + sed -i "s/CONFIG_PACKAGE_kmod-\(.*u|.*-usb\)=n/CONFIG_PACKAGE_kmod-\1=m/g" .config + sed -n '/# Video Support/,/# end of Video Support/p' .config | sed -e 's/=m/=n/' >>.config + fi make defconfig fi cat .config diff --git a/devices/amlogic_meson8b/.config b/devices/amlogic_meson8b/.config index a44dcfc0d7e4..8b6a95b698e5 100644 --- a/devices/amlogic_meson8b/.config +++ b/devices/amlogic_meson8b/.config @@ -3,6 +3,8 @@ CONFIG_TARGET_amlogic=y CONFIG_TARGET_amlogic_meson8b=y CONFIG_TARGET_amlogic_meson8b_DEVICE_thunder-onecloud=y +CONFIG_PACKAGE_kmod-rt2x00-pci=n + CONFIG_TARGET_ROOTFS_SQUASHFS=n CONFIG_TARGET_ROOTFS_EXT4FS=y diff --git a/devices/common/diy.sh b/devices/common/diy.sh index 7169f00912c8..dbd63f341bf8 100644 --- a/devices/common/diy.sh +++ b/devices/common/diy.sh @@ -39,7 +39,6 @@ mv -f feeds/kiddin9/r81* tmp/ wget -N https://raw.githubusercontent.com/openwrt/packages/master/lang/golang/golang/Makefile -P feeds/packages/lang/golang/golang/ sed -i "s/192.168.1/10.0.0/" package/feeds/kiddin9/base-files/files/bin/config_generate -sed -i "s/192.168.1/10.0.0/" package/base-files/files/bin/config_generate #sed -i "/call Build\/check-size,\$\$(KERNEL_SIZE)/d" include/image.mk @@ -53,7 +52,6 @@ sed -i "s/CONFIG_WERROR=y/CONFIG_WERROR=n/" target/linux/generic/config-5.15 sed -i "s/no-lto,$/no-lto no-mold,$/" include/package.mk [ -d package/kernel/mt76 ] && { -mkdir package/kernel/mt76/patches wget -N https://raw.githubusercontent.com/immortalwrt/immortalwrt/master/package/kernel/mt76/patches/0001-mt76-allow-VHT-rate-on-2.4GHz.patch -P package/kernel/mt76/patches/ } @@ -82,19 +80,4 @@ sed -i \ -e 's?../../lang?$(TOPDIR)/feeds/packages/lang?' \ package/feeds/kiddin9/*/Makefile -( -if [ -f sdk.tar.xz ]; then - sed -i 's,$(STAGING_DIR_HOST)/bin/upx,upx,' package/feeds/kiddin9/*/Makefile - mkdir sdk - tar -xJf sdk.tar.xz -C sdk - cp -rf sdk/*/staging_dir/* ./staging_dir/ - rm -rf sdk.tar.xz sdk - sed -i '/\(tools\|toolchain\)\/Makefile/d' Makefile - if [ -f /usr/bin/python ]; then - ln -sf /usr/bin/python staging_dir/host/bin/python - else - ln -sf /usr/bin/python3 staging_dir/host/bin/python - fi - ln -sf /usr/bin/python3 staging_dir/host/bin/python3 -fi -) & +sed -i "s/OpenWrt/KWrt/g" feeds/kiddin9/base-files/files/bin/config_generate feeds/kiddin9/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 diff --git a/devices/common/kernel_6.1.sh b/devices/common/kernel_6.1.sh index af41532e2ec5..8a516680c255 100644 --- a/devices/common/kernel_6.1.sh +++ b/devices/common/kernel_6.1.sh @@ -29,7 +29,6 @@ rm -rf target/linux/generic/hack-6.1/{410-block-fit-partition-parser.patch,724-n wget -N https://raw.githubusercontent.com/openwrt/openwrt/main/include/u-boot.mk -P include/ -mkdir package/kernel/mt76/patches wget -N https://raw.githubusercontent.com/immortalwrt/immortalwrt/master/package/kernel/mt76/patches/0001-mt76-allow-VHT-rate-on-2.4GHz.patch -P package/kernel/mt76/patches/ cd feeds/packages @@ -44,3 +43,5 @@ sed -i 's/=bbr/=cubic/' package/kernel/linux/files/sysctl-tcp-bbr.conf sed -i "s/tty\(0\|1\)::askfirst/tty\1::respawn/g" target/linux/*/base-files/etc/inittab sed -i "s/no-lto,/no-lto no-mold,/" include/package.mk + +sed -i "s/OpenWrt/KWrt/g" feeds/kiddin9/base-files/files/bin/config_generate feeds/kiddin9/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 \ No newline at end of file diff --git a/devices/common/patches/imagebuilder.patch b/devices/common/patches/imagebuilder.patch index b9d30b02a35d..67f8dc540c9b 100644 --- a/devices/common/patches/imagebuilder.patch +++ b/devices/common/patches/imagebuilder.patch @@ -76,7 +76,7 @@ + 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/OpenWrt .* by/OpenWrt $$DATE by/\" /etc/banner \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))'; \ @@ -87,7 +87,7 @@ + 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 openwrt_kiddin9 $(TOPDIR)/repositories.conf | sed -e 's/kiddin9/small_flash/g'`" >>$(TOPDIR)/repositories.conf; \ ++ 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; \ @@ -128,7 +128,7 @@ ) $(call prepare_rootfs,$(TARGET_DIR),$(USER_FILES),$(DISABLED_SERVICES)) + if [[ "$(IMAGE_SIZE)" && ! "`echo "$(IMAGE_SIZE)" | grep "m"`" && $(IMAGE_SIZE) -lt 20480 ]]; then \ -+ echo "`grep openwrt_kiddin9 $(TOPDIR)/repositories.conf | sed -e 's/kiddin9/small_flash/g'`" >>$(BUILD_DIR)/root-*/etc/opkg/distfeeds.conf; \ ++ echo "`grep kwrt_kiddin9 $(TOPDIR)/repositories.conf | sed -e 's/kiddin9/small_flash/g'`" >>$(BUILD_DIR)/root-*/etc/opkg/distfeeds.conf; \ + fi build_image: FORCE diff --git a/devices/rockchip_rk35xx/.config b/devices/rockchip_rk35xx/.config new file mode 100644 index 000000000000..37f3cbfb6929 --- /dev/null +++ b/devices/rockchip_rk35xx/.config @@ -0,0 +1,18 @@ + +CONFIG_TARGET_rockchip=y +CONFIG_TARGET_rockchip_rk35xx=y +CONFIG_TARGET_MULTI_PROFILE=y +CONFIG_TARGET_ALL_PROFILES=y + +CONFIG_TARGET_KERNEL_PARTSIZE=32 + +CONFIG_PACKAGE_kmod-pcie_mhi=m + +CONFIG_PACKAGE_kmod-dma-buf=n + +CONFIG_PACKAGE_kmod-fs-virtiofs=n + +CONFIG_PACKAGE_luci-ssl=n # uhttpd服务 +CONFIG_PACKAGE_luci-ssl-nginx=y # nginx + + diff --git a/devices/rockchip_rk35xx/README.md b/devices/rockchip_rk35xx/README.md new file mode 100644 index 000000000000..e4ea699c7b68 --- /dev/null +++ b/devices/rockchip_rk35xx/README.md @@ -0,0 +1 @@ +Kernel等部分源码来源 https://github.com/coolsnowwolf/lede 感谢 \ No newline at end of file diff --git a/devices/rockchip_rk35xx/diy.sh b/devices/rockchip_rk35xx/diy.sh new file mode 100644 index 000000000000..dc187f171a7a --- /dev/null +++ b/devices/rockchip_rk35xx/diy.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +shopt -s extglob +SHELL_FOLDER=$(dirname $(readlink -f "$0")) + +rm -rf package/boot package/feeds/kiddin9/accel-ppp package/devel/perf package/devel/kselftests-bpf package/feeds/routing/batman-adv package/kernel/ksmbd + +rm -rf target/linux/generic/!(*-5.15) target/linux/rockchip package/kernel devices/common/patches/usb-audio.patch + +git_clone_path master https://github.com/coolsnowwolf/lede package/boot target/linux/rockchip package/kernel + +git_clone_path master https://github.com/coolsnowwolf/lede mv target/linux/generic + +wget -N https://github.com/coolsnowwolf/lede/raw/master/include/kernel-5.10 -P include/ +wget -N https://github.com/coolsnowwolf/lede/raw/master/include/kernel-6.1 -P include/ +wget -N https://github.com/coolsnowwolf/lede/raw/master/include/kernel-6.6 -P include/ + +sed -i "/KernelPackage,ptp/d" package/kernel/linux/modules/other.mk + +mv -f tmp/r8125 feeds/kiddin9/ + +sed -i -e 's,kmod-r8168,kmod-r8169,g' target/linux/rockchip/image/rk35xx.mk +sed -i -e 's,wpad-openssl,wpad-basic-mbedtls,g' target/linux/rockchip/image/rk35xx.mk + +wget -N https://github.com/coolsnowwolf/lede/raw/master/include/netfilter.mk -P include/ + + +sed -i 's/DEFAULT_PACKAGES +=/DEFAULT_PACKAGES += fdisk lsblk/' target/linux/rockchip/Makefile + +cp -Rf $SHELL_FOLDER/diy/* ./ + +echo ' +CONFIG_SENSORS_PWM_FAN=y +' >> ./target/linux/rockchip/rk35xx/config-5.10 diff --git a/devices/rockchip_rk35xx/patches/add_extra_CPU_FLAGS.b b/devices/rockchip_rk35xx/patches/add_extra_CPU_FLAGS.b new file mode 100644 index 000000000000..799a6c1757a8 --- /dev/null +++ b/devices/rockchip_rk35xx/patches/add_extra_CPU_FLAGS.b @@ -0,0 +1,22 @@ +--- a/include/target.mk ++++ b/include/target.mk +@@ -259,9 +259,18 @@ ifeq ($(DUMP),1) + CPU_CFLAGS_arc700 = -mcpu=arc700 + CPU_CFLAGS_archs = -mcpu=archs + endif ++ ifeq ($(BOARD),rockchip) ++ CPU_CFLAGS = -O3 -pipe ++ CPU_CFLAGS_cortex-a53 = -mcpu=cortex-a53 ++ CPU_CFLAGS_cortex-a55 = -march=armv8-a+crypto+crc -mcpu=cortex-a55+crypto+crc -mtune=cortex-a55 ++ CPU_CFLAGS_cortex-a73 = -march=armv8-a+crypto+crc -mcpu=cortex-a73.cortex-a53+crypto+crc -mtune=cortex-a73.cortex-a53 ++ ifneq ($(SOC_CFLAGS),) ++ CPU_CFLAGS_generic = $(SOC_CFLAGS) ++ endif ++ endif + ifneq ($(CPU_TYPE),) + ifndef CPU_CFLAGS_$(CPU_TYPE) +- $(warning CPU_TYPE "$(CPU_TYPE)" doesn't correspond to a known type) ++ $(warning CPU_TYPE "$(CPU_TYPE)" "doesn't correspond to a known type") + endif + endif + DEFAULT_CFLAGS=$(strip $(CPU_CFLAGS) $(CPU_CFLAGS_$(CPU_TYPE)) $(CPU_CFLAGS_$(CPU_SUBTYPE))) \ No newline at end of file diff --git a/devices/rockchip_rk35xx/patches/h28k.patch b/devices/rockchip_rk35xx/patches/h28k.patch new file mode 100644 index 000000000000..5ecca49432b0 --- /dev/null +++ b/devices/rockchip_rk35xx/patches/h28k.patch @@ -0,0 +1,19 @@ +--- a/target/linux/rockchip/image/rk35xx.mk ++++ b/target/linux/rockchip/image/rk35xx.mk +@@ -78,6 +78,16 @@ $(call Device/rk3528) + endef + TARGET_DEVICES += radxa_e20c + ++define Device/hlink_h28k ++$(call Device/rk3528) ++ DEVICE_VENDOR := Hlink ++ DEVICE_MODEL := H28K ++ SUPPORTED_DEVICES += hlink,h28k ++ DEVICE_DTS := rk3528-h28k ++ DEVICE_PACKAGES := kmod-r8169 kmod-r8125 kmod-thermal ++endef ++TARGET_DEVICES += hlink_h28k ++ + define Device/radxa_rock-5c + $(call Device/rk3588) + DEVICE_VENDOR := Radxa