From 36dd3ab7db0dfa6ea769f49983142a522ec15994 Mon Sep 17 00:00:00 2001 From: Maximilian Weinmann Date: Mon, 8 May 2023 01:54:29 +0700 Subject: [PATCH 01/17] ramips: fix dts file name for SNR-CPE-ME1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rename file mt7621_snr_snr-spe-me-1.dts Fixes: #12562 Fixes: ecdb248 ("ramips: add support for SNR-CPE-ME1") Tested-by: Rafał Miłecki Signed-off-by: Maximilian Weinmann --- .../dts/{mt7621_snr-cpe-me1.dts => mt7621_snr_snr-cpe-me1.dts} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename target/linux/ramips/dts/{mt7621_snr-cpe-me1.dts => mt7621_snr_snr-cpe-me1.dts} (100%) diff --git a/target/linux/ramips/dts/mt7621_snr-cpe-me1.dts b/target/linux/ramips/dts/mt7621_snr_snr-cpe-me1.dts similarity index 100% rename from target/linux/ramips/dts/mt7621_snr-cpe-me1.dts rename to target/linux/ramips/dts/mt7621_snr_snr-cpe-me1.dts From 91e3419a33f3f0baa2fb25680f5c9a7b2240102b Mon Sep 17 00:00:00 2001 From: Paul Spooren Date: Sun, 5 Feb 2023 19:38:09 +0100 Subject: [PATCH 02/17] ath79: add empty squashfs-lzma filesystem The filesystem is currently created on every build to trick the boot loader of some FRITZ! devices into accepting the image. Sadly the resulting squashfs-lzma filesystem is not reproducible. To fix this, create a squashfs filesystem once and include it into the repository. Creation happend as shown below rm -rf empty_dir mkdir empty_dir ./staging_dir/host/bin/mksquashfs-lzma \ empty_dir/ empty-squashfs-lzma \ -noappend -root-owned -be -nopad -b 65536 -fixed-time 0 Signed-off-by: Paul Spooren --- include/image-commands.mk | 10 ---------- target/linux/ath79/image/Makefile | 3 +++ target/linux/ath79/image/empty-squashfs-lzma | Bin 0 -> 150 bytes 3 files changed, 3 insertions(+), 10 deletions(-) create mode 100755 target/linux/ath79/image/empty-squashfs-lzma diff --git a/include/image-commands.mk b/include/image-commands.mk index 0c13f30fef6..e1951672e64 100644 --- a/include/image-commands.mk +++ b/include/image-commands.mk @@ -103,16 +103,6 @@ define Build/append-rootfs dd if=$(IMAGE_ROOTFS) >> $@ endef -define Build/append-squashfs-fakeroot-be - rm -rf $@.fakefs $@.fakesquashfs - mkdir $@.fakefs - $(STAGING_DIR_HOST)/bin/mksquashfs3-lzma \ - $@.fakefs $@.fakesquashfs \ - -noappend -root-owned -be -nopad -b 65536 \ - $(if $(SOURCE_DATE_EPOCH),-fixed-time $(SOURCE_DATE_EPOCH)) - cat $@.fakesquashfs >> $@ -endef - define Build/append-squashfs4-fakeroot rm -rf $@.fakefs $@.fakesquashfs mkdir $@.fakefs diff --git a/target/linux/ath79/image/Makefile b/target/linux/ath79/image/Makefile index 8328be7667c..02fd26bfd8b 100644 --- a/target/linux/ath79/image/Makefile +++ b/target/linux/ath79/image/Makefile @@ -60,6 +60,9 @@ define Build/relocate-kernel rm -rf $@.relocate endef +define Build/append-squashfs-fakeroot-be + cat ./empty-squashfs-lzma >> $@ +endef define Device/Default DEVICE_DTS_DIR := ../dts diff --git a/target/linux/ath79/image/empty-squashfs-lzma b/target/linux/ath79/image/empty-squashfs-lzma new file mode 100755 index 0000000000000000000000000000000000000000..803a7661a7bd2a04ae08b73d4a12d68a2b53d265 GIT binary patch literal 150 zcmXReEY4tHU|?jL?g*q97(oOaFoRhF4ydANia=_nLA6YR(lDwVO?=XSC}5Ce;MkqS cU%=Dr_D@KO?WyONE9VY;z5mw_ Date: Sun, 7 May 2023 19:33:40 -0400 Subject: [PATCH 03/17] sdk: do not exclude all doc directories Some packages which are using local gnulib source are expecting files to exist in the directory: staging_dir/host/share/gnulib/doc so delete the other doc directories directly instead of excluding all of them. Fixes: d167adbc4 ("gettext-full: bootstrap to local gnulib source") Signed-off-by: Michael Pratt --- target/sdk/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target/sdk/Makefile b/target/sdk/Makefile index d9f67dae9ef..b688eb4cba0 100644 --- a/target/sdk/Makefile +++ b/target/sdk/Makefile @@ -32,7 +32,6 @@ EXCLUDE_DIRS:= \ *.install.clean \ *.install.flags \ *.install \ - */doc \ */share/locale SDK_DIRS = \ @@ -158,6 +157,8 @@ $(BIN_DIR)/$(SDK_NAME).tar.xz: clean $(SDK_BUILD_DIR)/package/kernel/ -rm -rf $(SDK_BUILD_DIR)/$(STAGING_SUBDIR_HOST)/.prereq-build + -rm -rf $(SDK_BUILD_DIR)/$(STAGING_SUBDIR_HOST)/doc + -rm -rf $(SDK_BUILD_DIR)/$(STAGING_SUBDIR_HOST)/share/doc -rm -f $(SDK_BUILD_DIR)/feeds.conf.default $(if $(BASE_FEED),echo "$(BASE_FEED)" > $(SDK_BUILD_DIR)/feeds.conf.default) From b95c2146838403b68fb8b487e7f890ddefb4fb8d Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Fri, 7 Apr 2023 23:46:43 +0800 Subject: [PATCH 04/17] uboot-rockchip: add ROC-RK3328-CC support Add support for the Firefly ROC-RK3328-CC. Manually generated of-platdata files to avoid swig dependency. Signed-off-by: Tianling Shen --- package/boot/uboot-rockchip/Makefile | 13 +- .../src/of-platdata/roc-cc-rk3328/dt-decl.h | 24 +++ .../src/of-platdata/roc-cc-rk3328/dt-plat.c | 189 ++++++++++++++++++ .../roc-cc-rk3328/dt-structs-gen.h | 55 +++++ 4 files changed, 280 insertions(+), 1 deletion(-) create mode 100644 package/boot/uboot-rockchip/src/of-platdata/roc-cc-rk3328/dt-decl.h create mode 100644 package/boot/uboot-rockchip/src/of-platdata/roc-cc-rk3328/dt-plat.c create mode 100644 package/boot/uboot-rockchip/src/of-platdata/roc-cc-rk3328/dt-structs-gen.h diff --git a/package/boot/uboot-rockchip/Makefile b/package/boot/uboot-rockchip/Makefile index 441028fe7f1..e22a7cf0378 100644 --- a/package/boot/uboot-rockchip/Makefile +++ b/package/boot/uboot-rockchip/Makefile @@ -35,6 +35,16 @@ define U-Boot/nanopi-r2s-rk3328 OF_PLATDATA:=$(1) endef +define U-Boot/roc-cc-rk3328 + BUILD_SUBTARGET:=armv8 + NAME:=ROC-RK3328-CC + BUILD_DEVICES:= \ + firefly_roc-rk3328-cc + DEPENDS:=+PACKAGE_u-boot-roc-cc-rk3328:arm-trusted-firmware-rockchip + PKG_BUILD_DEPENDS:=arm-trusted-firmware-rockchip + ATF:=rk3328_bl31.elf + OF_PLATDATA:=$(1) +endef # RK3399 boards @@ -72,7 +82,8 @@ UBOOT_TARGETS := \ nanopi-r4s-rk3399 \ rock-pi-4-rk3399 \ rockpro64-rk3399 \ - nanopi-r2s-rk3328 + nanopi-r2s-rk3328 \ + roc-cc-rk3328 UBOOT_CONFIGURE_VARS += USE_PRIVATE_LIBGCC=yes diff --git a/package/boot/uboot-rockchip/src/of-platdata/roc-cc-rk3328/dt-decl.h b/package/boot/uboot-rockchip/src/of-platdata/roc-cc-rk3328/dt-decl.h new file mode 100644 index 00000000000..72675609cd2 --- /dev/null +++ b/package/boot/uboot-rockchip/src/of-platdata/roc-cc-rk3328/dt-decl.h @@ -0,0 +1,24 @@ +/* + * DO NOT MODIFY + * + * Declares externs for all device/uclass instances. + * This was generated by dtoc from a .dtb (device tree binary) file. + */ + +#include +#include + +/* driver declarations - these allow DM_DRIVER_GET() to be used */ +extern U_BOOT_DRIVER(rockchip_rk3328_cru); +extern U_BOOT_DRIVER(rockchip_rk3328_dmc); +extern U_BOOT_DRIVER(rockchip_rk3288_dw_mshc); +extern U_BOOT_DRIVER(rockchip_rk3288_dw_mshc); +extern U_BOOT_DRIVER(ns16550_serial); +extern U_BOOT_DRIVER(rockchip_rk3328_grf); + +/* uclass driver declarations - needed for DM_UCLASS_DRIVER_REF() */ +extern UCLASS_DRIVER(clk); +extern UCLASS_DRIVER(mmc); +extern UCLASS_DRIVER(ram); +extern UCLASS_DRIVER(serial); +extern UCLASS_DRIVER(syscon); diff --git a/package/boot/uboot-rockchip/src/of-platdata/roc-cc-rk3328/dt-plat.c b/package/boot/uboot-rockchip/src/of-platdata/roc-cc-rk3328/dt-plat.c new file mode 100644 index 00000000000..aa03298e584 --- /dev/null +++ b/package/boot/uboot-rockchip/src/of-platdata/roc-cc-rk3328/dt-plat.c @@ -0,0 +1,189 @@ +/* + * DO NOT MODIFY + * + * Declares the U_BOOT_DRIVER() records and platform data. + * This was generated by dtoc from a .dtb (device tree binary) file. + */ + +/* Allow use of U_BOOT_DRVINFO() in this file */ +#define DT_PLAT_C + +#include +#include +#include + +/* + * driver_info declarations, ordered by 'struct driver_info' linker_list idx: + * + * idx driver_info driver + * --- -------------------- -------------------- + * 0: clock_controller_at_ff440000 rockchip_rk3328_cru + * 1: dmc rockchip_rk3328_dmc + * 2: mmc_at_ff500000 rockchip_rk3288_dw_mshc + * 3: mmc_at_ff520000 rockchip_rk3288_dw_mshc + * 4: serial_at_ff130000 ns16550_serial + * 5: syscon_at_ff100000 rockchip_rk3328_grf + * --- -------------------- -------------------- + */ + +/* + * Node /clock-controller@ff440000 index 0 + * driver rockchip_rk3328_cru parent None + */ +static struct dtd_rockchip_rk3328_cru dtv_clock_controller_at_ff440000 = { + .reg = {0xff440000, 0x1000}, + .rockchip_grf = 0x3a, +}; +U_BOOT_DRVINFO(clock_controller_at_ff440000) = { + .name = "rockchip_rk3328_cru", + .plat = &dtv_clock_controller_at_ff440000, + .plat_size = sizeof(dtv_clock_controller_at_ff440000), + .parent_idx = -1, +}; + +/* + * Node /dmc index 1 + * driver rockchip_rk3328_dmc parent None + */ +static struct dtd_rockchip_rk3328_dmc dtv_dmc = { + .reg = {0xff400000, 0x1000, 0xff780000, 0x3000, 0xff100000, 0x1000, 0xff440000, 0x1000, + 0xff720000, 0x1000, 0xff798000, 0x1000}, + .rockchip_sdram_params = {0x1, 0xa, 0x2, 0x1, 0x0, 0x0, 0x11, 0x0, + 0x11, 0x0, 0x0, 0x94291288, 0x0, 0x27, 0x462, 0x15, + 0x242, 0xff, 0x14d, 0x0, 0x1, 0x0, 0x0, 0x0, + 0x43049010, 0x64, 0x28003b, 0xd0, 0x20053, 0xd4, 0x220000, 0xd8, + 0x100, 0xdc, 0x40000, 0xe0, 0x0, 0xe4, 0x110000, 0xe8, + 0x420, 0xec, 0x400, 0xf4, 0xf011f, 0x100, 0x9060b06, 0x104, + 0x20209, 0x108, 0x505040a, 0x10c, 0x40400c, 0x110, 0x5030206, 0x114, + 0x3030202, 0x120, 0x3030b03, 0x124, 0x20208, 0x180, 0x1000040, 0x184, + 0x0, 0x190, 0x7030003, 0x198, 0x5001100, 0x1a0, 0xc0400003, 0x240, + 0x6000604, 0x244, 0x201, 0x250, 0xf00, 0x490, 0x1, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0x4, 0xc, 0x28, 0xa, 0x2c, + 0x0, 0x30, 0x9, 0xffffffff, 0xffffffff, 0x77, 0x88, 0x79, + 0x79, 0x87, 0x97, 0x87, 0x78, 0x77, 0x78, 0x87, + 0x88, 0x87, 0x87, 0x77, 0x78, 0x78, 0x78, 0x78, + 0x78, 0x78, 0x78, 0x78, 0x78, 0x69, 0x9, 0x77, + 0x78, 0x77, 0x78, 0x77, 0x78, 0x77, 0x78, 0x77, + 0x79, 0x9, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, + 0x78, 0x78, 0x78, 0x69, 0x9, 0x77, 0x78, 0x77, + 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x79, 0x9, + 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, + 0x78, 0x69, 0x9, 0x77, 0x78, 0x77, 0x78, 0x77, + 0x78, 0x77, 0x78, 0x77, 0x79, 0x9, 0x78, 0x78, + 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x69, + 0x9, 0x77, 0x78, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x79, 0x9}, +}; +U_BOOT_DRVINFO(dmc) = { + .name = "rockchip_rk3328_dmc", + .plat = &dtv_dmc, + .plat_size = sizeof(dtv_dmc), + .parent_idx = -1, +}; + +/* + * Node /mmc@ff500000 index 2 + * driver rockchip_rk3288_dw_mshc parent None + */ +static struct dtd_rockchip_rk3288_dw_mshc dtv_mmc_at_ff500000 = { + .bus_width = 0x4, + .cap_mmc_highspeed = true, + .cap_sd_highspeed = true, + .clocks = { + {0, {317}}, + {0, {33}}, + {0, {74}}, + {0, {78}},}, + .disable_wp = true, + .fifo_depth = 0x100, + .interrupts = {0x0, 0xc, 0x4}, + .max_frequency = 0x8f0d180, + .pinctrl_0 = {0x47, 0x48, 0x49, 0x4a}, + .pinctrl_names = "default", + .reg = {0xff500000, 0x4000}, + .sd_uhs_sdr104 = true, + .sd_uhs_sdr12 = true, + .sd_uhs_sdr25 = true, + .sd_uhs_sdr50 = true, + .u_boot_spl_fifo_mode = true, + .vmmc_supply = 0x4b, + .vqmmc_supply = 0x1e, +}; +U_BOOT_DRVINFO(mmc_at_ff500000) = { + .name = "rockchip_rk3288_dw_mshc", + .plat = &dtv_mmc_at_ff500000, + .plat_size = sizeof(dtv_mmc_at_ff500000), + .parent_idx = -1, +}; + +/* + * Node /mmc@ff520000 index 3 + * driver rockchip_rk3288_dw_mshc parent None + */ +static struct dtd_rockchip_rk3288_dw_mshc dtv_mmc_at_ff520000 = { + .bus_width = 0x8, + .cap_mmc_highspeed = true, + .clocks = { + {0, {319}}, + {0, {35}}, + {0, {76}}, + {0, {80}},}, + .fifo_depth = 0x100, + .interrupts = {0x0, 0xe, 0x4}, + .max_frequency = 0x8f0d180, + .mmc_ddr_1_8v = true, + .mmc_hs200_1_8v = true, + .non_removable = true, + .pinctrl_0 = {0x4c, 0x4d, 0x4e, 0x0}, + .pinctrl_names = "default", + .reg = {0xff520000, 0x4000}, + .u_boot_spl_fifo_mode = true, + .vmmc_supply = 0x1c, + .vqmmc_supply = 0x1d, +}; +U_BOOT_DRVINFO(mmc_at_ff520000) = { + .name = "rockchip_rk3288_dw_mshc", + .plat = &dtv_mmc_at_ff520000, + .plat_size = sizeof(dtv_mmc_at_ff520000), + .parent_idx = -1, +}; + +/* + * Node /serial@ff130000 index 4 + * driver ns16550_serial parent None + */ +static struct dtd_ns16550_serial dtv_serial_at_ff130000 = { + .clock_frequency = 0x16e3600, + .clocks = { + {0, {40}}, + {0, {212}},}, + .dma_names = {"tx", "rx"}, + .dmas = {0x10, 0x6, 0x10, 0x7}, + .interrupts = {0x0, 0x39, 0x4}, + .pinctrl_0 = 0x26, + .pinctrl_names = "default", + .reg = {0xff130000, 0x100}, + .reg_io_width = 0x4, + .reg_shift = 0x2, +}; +U_BOOT_DRVINFO(serial_at_ff130000) = { + .name = "ns16550_serial", + .plat = &dtv_serial_at_ff130000, + .plat_size = sizeof(dtv_serial_at_ff130000), + .parent_idx = -1, +}; + +/* + * Node /syscon@ff100000 index 5 + * driver rockchip_rk3328_grf parent None + */ +static struct dtd_rockchip_rk3328_grf dtv_syscon_at_ff100000 = { + .reg = {0xff100000, 0x1000}, +}; +U_BOOT_DRVINFO(syscon_at_ff100000) = { + .name = "rockchip_rk3328_grf", + .plat = &dtv_syscon_at_ff100000, + .plat_size = sizeof(dtv_syscon_at_ff100000), + .parent_idx = -1, +}; + diff --git a/package/boot/uboot-rockchip/src/of-platdata/roc-cc-rk3328/dt-structs-gen.h b/package/boot/uboot-rockchip/src/of-platdata/roc-cc-rk3328/dt-structs-gen.h new file mode 100644 index 00000000000..5b729fc57f5 --- /dev/null +++ b/package/boot/uboot-rockchip/src/of-platdata/roc-cc-rk3328/dt-structs-gen.h @@ -0,0 +1,55 @@ +/* + * DO NOT MODIFY + * + * Defines the structs used to hold devicetree data. + * This was generated by dtoc from a .dtb (device tree binary) file. + */ + +#include +#include +struct dtd_ns16550_serial { + fdt32_t clock_frequency; + struct phandle_1_arg clocks[2]; + const char * dma_names[2]; + fdt32_t dmas[4]; + fdt32_t interrupts[3]; + fdt32_t pinctrl_0; + const char * pinctrl_names; + fdt64_t reg[2]; + fdt32_t reg_io_width; + fdt32_t reg_shift; +}; +struct dtd_rockchip_rk3288_dw_mshc { + fdt32_t bus_width; + bool cap_mmc_highspeed; + bool cap_sd_highspeed; + struct phandle_1_arg clocks[4]; + bool disable_wp; + fdt32_t fifo_depth; + fdt32_t interrupts[3]; + fdt32_t max_frequency; + bool mmc_ddr_1_8v; + bool mmc_hs200_1_8v; + bool non_removable; + fdt32_t pinctrl_0[4]; + const char * pinctrl_names; + fdt64_t reg[2]; + bool sd_uhs_sdr104; + bool sd_uhs_sdr12; + bool sd_uhs_sdr25; + bool sd_uhs_sdr50; + bool u_boot_spl_fifo_mode; + fdt32_t vmmc_supply; + fdt32_t vqmmc_supply; +}; +struct dtd_rockchip_rk3328_cru { + fdt64_t reg[2]; + fdt32_t rockchip_grf; +}; +struct dtd_rockchip_rk3328_dmc { + fdt64_t reg[12]; + fdt32_t rockchip_sdram_params[196]; +}; +struct dtd_rockchip_rk3328_grf { + fdt64_t reg[2]; +}; From a7d6cf0bb3504cb0e81b2a4c484fed4dc3a5b4c5 Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Fri, 7 Apr 2023 23:50:49 +0800 Subject: [PATCH 05/17] rockchip: add Firefly ROC-RK3328-CC support Hardware -------- RockChip RK3328 ARM64 (4 cores) 4GB DDR4 RAM 1x 1000 Base-T 2 LEDs (POWER / USER) HDMI 2.0 3.5mm TRRS AV jack Micro-SD slot eMMC slot 1x USB 3.0 Port 2x USB 2.0 Port Installation ------------ Uncompress the OpenWrt sysupgrade and write it to a micro SD card using dd. Signed-off-by: Tianling Shen --- target/linux/rockchip/image/armv8.mk | 10 +++++++ ...-rockchip-use-system-LED-for-OpenWrt.patch | 28 +++++++++++++------ ...dd-OF-node-for-USB-eth-on-NanoPi-R2S.patch | 2 +- 3 files changed, 31 insertions(+), 9 deletions(-) diff --git a/target/linux/rockchip/image/armv8.mk b/target/linux/rockchip/image/armv8.mk index f95416323dd..86e7cec9799 100644 --- a/target/linux/rockchip/image/armv8.mk +++ b/target/linux/rockchip/image/armv8.mk @@ -5,6 +5,16 @@ # FIT will be loaded at 0x02080000. Leave 16M for that, align it to 2M and load the kernel after it. KERNEL_LOADADDR := 0x03200000 +define Device/firefly_roc-rk3328-cc + DEVICE_VENDOR := Firefly + DEVICE_MODEL := ROC-RK3328-CC + SOC := rk3328 + DEVICE_DTS := rockchip/rk3328-roc-cc + UBOOT_DEVICE_NAME := roc-cc-rk3328 + IMAGE/sysupgrade.img.gz := boot-common | boot-script nanopi-r2s | pine64-img | gzip | append-metadata +endef +TARGET_DEVICES += firefly_roc-rk3328-cc + define Device/friendlyarm_nanopi-r2s DEVICE_VENDOR := FriendlyARM DEVICE_MODEL := NanoPi R2S diff --git a/target/linux/rockchip/patches-5.15/100-rockchip-use-system-LED-for-OpenWrt.patch b/target/linux/rockchip/patches-5.15/100-rockchip-use-system-LED-for-OpenWrt.patch index 5ec7952bfea..4b963f33483 100644 --- a/target/linux/rockchip/patches-5.15/100-rockchip-use-system-LED-for-OpenWrt.patch +++ b/target/linux/rockchip/patches-5.15/100-rockchip-use-system-LED-for-OpenWrt.patch @@ -15,17 +15,29 @@ Signed-off-by: David Bauer --- a/arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts +++ b/arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts -@@ -18,6 +18,13 @@ +@@ -16,6 +16,11 @@ + aliases { + ethernet1 = &rtl8153; mmc0 = &sdmmc; - }; - -+ aliases { ++ + led-boot = &sys_led; + led-failsafe = &sys_led; + led-running = &sys_led; + led-upgrade = &sys_led; -+ }; -+ - chosen { - stdout-path = "serial2:1500000n8"; }; + + chosen { +--- a/arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts +@@ -13,6 +13,11 @@ + aliases { + mmc0 = &sdmmc; + mmc1 = &emmc; ++ ++ led-boot = &power_led; ++ led-failsafe = &power_led; ++ led-running = &power_led; ++ led-upgrade = &power_led; + }; + + chosen { diff --git a/target/linux/rockchip/patches-5.15/103-arm64-rockchip-add-OF-node-for-USB-eth-on-NanoPi-R2S.patch b/target/linux/rockchip/patches-5.15/103-arm64-rockchip-add-OF-node-for-USB-eth-on-NanoPi-R2S.patch index 5fe60d1adec..2221077c97c 100644 --- a/target/linux/rockchip/patches-5.15/103-arm64-rockchip-add-OF-node-for-USB-eth-on-NanoPi-R2S.patch +++ b/target/linux/rockchip/patches-5.15/103-arm64-rockchip-add-OF-node-for-USB-eth-on-NanoPi-R2S.patch @@ -14,7 +14,7 @@ Signed-off-by: David Bauer --- a/arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts +++ b/arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts -@@ -404,6 +404,7 @@ +@@ -402,6 +402,7 @@ rtl8153: device@2 { compatible = "usbbda,8153"; reg = <2>; From 395de5103af867d6c4954c71929ecacb1c70f9a2 Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Mon, 24 Apr 2023 01:00:04 +0800 Subject: [PATCH 06/17] rockchip: enable rk805 pinctrl driver This is required for ROC-RK3328-CC to light up the LED-s which are connected to rk805's gpio. Signed-off-by: Tianling Shen --- target/linux/rockchip/armv8/config-5.15 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target/linux/rockchip/armv8/config-5.15 b/target/linux/rockchip/armv8/config-5.15 index 51a14055f31..87715789c7d 100644 --- a/target/linux/rockchip/armv8/config-5.15 +++ b/target/linux/rockchip/armv8/config-5.15 @@ -243,6 +243,7 @@ CONFIG_GPIO_DWAPB=y CONFIG_GPIO_GENERIC=y CONFIG_GPIO_GENERIC_PLATFORM=y CONFIG_GPIO_ROCKCHIP=y +CONFIG_GPIO_SYSCON=y CONFIG_HANDLE_DOMAIN_IRQ=y CONFIG_HARDIRQS_SW_RESEND=y CONFIG_HAS_DMA=y @@ -431,7 +432,7 @@ CONFIG_PHY_ROCKCHIP_PCIE=y CONFIG_PHY_ROCKCHIP_TYPEC=y CONFIG_PHY_ROCKCHIP_USB=y CONFIG_PINCTRL=y -# CONFIG_PINCTRL_RK805 is not set +CONFIG_PINCTRL_RK805=y CONFIG_PINCTRL_ROCKCHIP=y # CONFIG_PINCTRL_SINGLE is not set CONFIG_PL330_DMA=y From b0e869501a6944bb91a2f2020a78df39bd4e9195 Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Mon, 24 Apr 2023 01:03:25 +0800 Subject: [PATCH 07/17] rockchip: disable UHS speed for ROC-RK3328-CC The previously stated speed of sdr-104 in is too high for the hardware to reliably communicate with some fast SD cards. Rockchip boards have a common bug when operating uhs speed, which will hang the system during a soft reboot. To be on the safe side, lower the speed to workaround. Signed-off-by: Tianling Shen --- .../patches-5.15/105-nanopi-r4s-sd-signalling.patch | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/target/linux/rockchip/patches-5.15/105-nanopi-r4s-sd-signalling.patch b/target/linux/rockchip/patches-5.15/105-nanopi-r4s-sd-signalling.patch index a04c14b70a7..856970738aa 100644 --- a/target/linux/rockchip/patches-5.15/105-nanopi-r4s-sd-signalling.patch +++ b/target/linux/rockchip/patches-5.15/105-nanopi-r4s-sd-signalling.patch @@ -10,6 +10,16 @@ userspace or following a kernel panic is always working. Signed-off-by: David Bauer +--- a/arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts +@@ -335,7 +335,6 @@ + sd-uhs-sdr12; + sd-uhs-sdr25; + sd-uhs-sdr50; +- sd-uhs-sdr104; + vmmc-supply = <&vcc_sd>; + vqmmc-supply = <&vcc_sdio>; + status = "okay"; --- a/arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts +++ b/arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts @@ -121,6 +121,11 @@ From 9207c728509e73c193efe7bbe74026edf9cef949 Mon Sep 17 00:00:00 2001 From: Linhui Liu Date: Sun, 7 May 2023 18:43:43 +0800 Subject: [PATCH 08/17] tools/pkgconf: update to 1.9.5 Release Notes: https://github.com/pkgconf/pkgconf/blob/master/NEWS Signed-off-by: Linhui Liu --- tools/pkgconf/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/pkgconf/Makefile b/tools/pkgconf/Makefile index c6e11edaf2b..d0a8a271d93 100644 --- a/tools/pkgconf/Makefile +++ b/tools/pkgconf/Makefile @@ -7,11 +7,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=pkgconf -PKG_VERSION:=1.9.4 +PKG_VERSION:=1.9.5 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://distfiles.dereferenced.org/pkgconf -PKG_HASH:=daccf1bbe5a30d149b556c7d2ffffeafd76d7b514e249271abdd501533c1d8ae +PKG_HASH:=1ac1656debb27497563036f7bffc281490f83f9b8457c0d60bcfb638fb6b6171 PKG_CPE_ID:=cpe:/a:pkgconf:pkgconf From 3636b06b2d05de0d5a29c68f390d10bc52666f3c Mon Sep 17 00:00:00 2001 From: Linhui Liu Date: Sun, 7 May 2023 15:28:32 +0800 Subject: [PATCH 09/17] tools/cpio: update to 2.14 Noteworthy changes in this release: * New option --ignore-dirnlink Valid in copy-out mode, it instructs cpio to ignore the actual number of links reported for each directory member and always store 2 instead. * Changes in --reproducible option The --reproducible option implies --ignore-dirlink. In other words, it is equivalent to --ignore-devno --ignore-dirnlink --renumber-inodes. * Use GNU ls algorithm for deciding timestamp format in -tv mode * Bugfixes ** Fix cpio header verification. ** Fix handling of device numbers on copy out. ** Fix calculation of CRC in copy-out mode. ** Rewrite the fix for CVE-2015-1197. ** Fix combination of --create --append --directory. ** Fix appending to archives bigger than 2G. Removed upstreamed: - 001-duplicate-program-name.patch - 010-clang.patch Signed-off-by: Linhui Liu --- tools/cpio/Makefile | 4 ++-- .../patches/001-duplicate-program-name.patch | 18 ------------------ tools/cpio/patches/010-clang.patch | 11 ----------- 3 files changed, 2 insertions(+), 31 deletions(-) delete mode 100644 tools/cpio/patches/001-duplicate-program-name.patch delete mode 100644 tools/cpio/patches/010-clang.patch diff --git a/tools/cpio/Makefile b/tools/cpio/Makefile index 82b5aa83652..1550785ddc5 100644 --- a/tools/cpio/Makefile +++ b/tools/cpio/Makefile @@ -3,11 +3,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=cpio PKG_CPE_ID:=cpe:/a:gnu:cpio -PKG_VERSION:=2.13 +PKG_VERSION:=2.14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=@GNU/cpio -PKG_HASH:=eab5bdc5ae1df285c59f2a4f140a98fc33678a0bf61bdba67d9436ae26b46f6d +PKG_HASH:=fcdc15d60f7267a6fc7efcd6b9db7b6c8966c4f2fbbb964c24d41336fd3f2c12 include $(INCLUDE_DIR)/host-build.mk diff --git a/tools/cpio/patches/001-duplicate-program-name.patch b/tools/cpio/patches/001-duplicate-program-name.patch deleted file mode 100644 index a7c3fbc8aee..00000000000 --- a/tools/cpio/patches/001-duplicate-program-name.patch +++ /dev/null @@ -1,18 +0,0 @@ -author Sergey Poznyakoff - -https://git.savannah.gnu.org/cgit/cpio.git/commit/?id=641d3f489cf6238bb916368d4ba0d9325a235afb - -* src/global.c: Remove superfluous declaration of program_name - ---- a/src/global.c -+++ b/src/global.c -@@ -184,9 +184,6 @@ unsigned int warn_option = 0; - /* Extract to standard output? */ - bool to_stdout_option = false; - --/* The name this program was run with. */ --char *program_name; -- - /* A pointer to either lstat or stat, depending on whether - dereferencing of symlinks is done for input files. */ - int (*xstat) (); diff --git a/tools/cpio/patches/010-clang.patch b/tools/cpio/patches/010-clang.patch deleted file mode 100644 index 89c7a8149ef..00000000000 --- a/tools/cpio/patches/010-clang.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/gnu/xalloc-oversized.h -+++ b/gnu/xalloc-oversized.h -@@ -52,7 +52,7 @@ typedef size_t __xalloc_count_type; - #elif ((5 <= __GNUC__ \ - || (__has_builtin (__builtin_mul_overflow) \ - && __has_builtin (__builtin_constant_p))) \ -- && !__STRICT_ANSI__) -+ && !__STRICT_ANSI__) && !defined(__clang__) - # define xalloc_oversized(n, s) \ - (__builtin_constant_p (n) && __builtin_constant_p (s) \ - ? __xalloc_oversized (n, s) \ From 1827b313f72aad1fe18d41a91f6596f186007880 Mon Sep 17 00:00:00 2001 From: Aleksander Jan Bajkowski Date: Fri, 2 Dec 2022 23:42:22 +0100 Subject: [PATCH 10/17] kernel: i2c: limit i2c-designware-pci to devices with PCI support Kmod-i2c-designware-pci supports Synopsys I2C over PCIe bus. On targets without PCI support, this package is empty. Symbol CONFIG_I2C_DESIGNWARE_PCI depends on CONFIG_PCI. Signed-off-by: Aleksander Jan Bajkowski --- package/kernel/linux/modules/i2c.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/kernel/linux/modules/i2c.mk b/package/kernel/linux/modules/i2c.mk index 15fd1ccddc4..6b3cf98345c 100644 --- a/package/kernel/linux/modules/i2c.mk +++ b/package/kernel/linux/modules/i2c.mk @@ -103,7 +103,7 @@ I2C_DWPCI_MODULES:= \ define KernelPackage/i2c-designware-pci $(call i2c_defaults,$(I2C_DWPCI_MODULES),59) TITLE:=Synopsys DesignWare PCI - DEPENDS:=+kmod-i2c-designware-core + DEPENDS:=@PCI_SUPPORT +kmod-i2c-designware-core endef define KernelPackage/i2c-designware-pci/description From e51dd7738628acaf8f2160175ed10f4a69f995ab Mon Sep 17 00:00:00 2001 From: Aleksander Jan Bajkowski Date: Fri, 2 Dec 2022 23:48:02 +0100 Subject: [PATCH 11/17] kernel: other: limit serial-8250-exar to devices with PCI support Kmod-serial-8250-exar supports Serial cards connected via PCIe bus. On targets without PCI support, this package is empty. Signed-off-by: Aleksander Jan Bajkowski --- package/kernel/linux/modules/other.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/kernel/linux/modules/other.mk b/package/kernel/linux/modules/other.mk index 262aca43242..75e978085b4 100644 --- a/package/kernel/linux/modules/other.mk +++ b/package/kernel/linux/modules/other.mk @@ -901,7 +901,7 @@ define KernelPackage/serial-8250-exar KCONFIG:= CONFIG_SERIAL_8250_EXAR FILES:=$(LINUX_DIR)/drivers/tty/serial/8250/8250_exar.ko AUTOLOAD:=$(call AutoProbe,8250 8250_base 8250_exar) - DEPENDS:=+kmod-serial-8250 + DEPENDS:=@PCI_SUPPORT +kmod-serial-8250 endef define KernelPackage/serial-8250-exar/description From f34887170004fd4503ca992baf1f6321baa74059 Mon Sep 17 00:00:00 2001 From: Aleksander Jan Bajkowski Date: Sun, 7 May 2023 11:08:03 +0200 Subject: [PATCH 12/17] kernel: other: limit mhi-pci-generic to devices with PCI support Kmod-mhi-pci-generic supports Qualcomm modems over PCIe bus. On targets without PCI support, this package is empty. Symbol CONFIG_MHI_BUS_PCI_GENERIC depends on CONFIG_PCI. Signed-off-by: Aleksander Jan Bajkowski --- package/kernel/linux/modules/other.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/kernel/linux/modules/other.mk b/package/kernel/linux/modules/other.mk index 75e978085b4..e8b4ea54fea 100644 --- a/package/kernel/linux/modules/other.mk +++ b/package/kernel/linux/modules/other.mk @@ -1352,7 +1352,7 @@ $(eval $(call KernelPackage,mhi-bus)) define KernelPackage/mhi-pci-generic SUBMENU:=$(OTHER_MENU) TITLE:=MHI PCI controller driver - DEPENDS:=@LINUX_5_15 +kmod-mhi-bus + DEPENDS:=@LINUX_5_15 @PCI_SUPPORT +kmod-mhi-bus KCONFIG:=CONFIG_MHI_BUS_PCI_GENERIC FILES:=$(LINUX_DIR)/drivers/bus/mhi/mhi_pci_generic.ko AUTOLOAD:=$(call AutoProbe,mhi_pci_generic) From e882af2850ff7077f610eaf0ecee18c371ddf98f Mon Sep 17 00:00:00 2001 From: Christoph Krapp Date: Sun, 12 Mar 2023 10:40:45 +0100 Subject: [PATCH 13/17] ramips: add support for Linksys RE7000 Hardware specification: - SoC: MediaTek MT7621AT (880 MHz) - Flash: 16 MB (Macronix MX25L12835FM2I-10G) - RAM: 128 MB (Nanya NT5CC64M16GP-DI) - WLAN 2.4 GHz: 2x2 MediaTek MT7603EN - WLAN 5 GHz: 2x2 MediaTek MT7615N - Ethernet: 1x 10/100/1000 Mbps - LED: Power, Wifi, WPS - Button: Reset, WPS - UART: 1:VCC, 2:GND, 3:TX, 4:RX (from LAN port) Serial console @ 57600,8n1 Flash instructions: Connect to serial console and start up the device. As the bootloader got locked you need to type in a password to unlock U-Boot access. When you see the following output on the console: relocate_code Pointer at: 87f1c000 type in the super secure password: 1234567890 Then select TFTP boot from RAM by selecting option 1 in the boot menu. As Linksys decided to leave out a basic TFTP configuration you need to set server- & client ip as well as the image filename the device will search for. You need to use the initramfs openwrt image for the TFTP boot process. Once openwrt has booted up, upload the sysupgrade image via scp and run sysupgrade as normal. Signed-off-by: Christoph Krapp --- package/boot/uboot-envtools/files/ramips | 1 + .../ramips/dts/mt7621_linksys_re7000.dts | 154 ++++++++++++++++++ target/linux/ramips/image/mt7621.mk | 9 + .../mt7621/base-files/etc/board.d/02_network | 1 + 4 files changed, 165 insertions(+) create mode 100644 target/linux/ramips/dts/mt7621_linksys_re7000.dts diff --git a/package/boot/uboot-envtools/files/ramips b/package/boot/uboot-envtools/files/ramips index f981fc73efc..6f351af2122 100644 --- a/package/boot/uboot-envtools/files/ramips +++ b/package/boot/uboot-envtools/files/ramips @@ -19,6 +19,7 @@ alfa-network,r36m-e4g|\ alfa-network,tube-e4g|\ engenius,epg600|\ engenius,esr600h|\ +linksys,re7000|\ sitecom,wlr-4100-v1-002|\ zyxel,keenetic-lite-iii-a) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x1000" diff --git a/target/linux/ramips/dts/mt7621_linksys_re7000.dts b/target/linux/ramips/dts/mt7621_linksys_re7000.dts new file mode 100644 index 00000000000..5e33f489159 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_linksys_re7000.dts @@ -0,0 +1,154 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7621.dtsi" + +#include +#include + +/ { + compatible = "linksys,re7000", "mediatek,mt7621-soc"; + model = "Linksys RE7000"; + + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + }; + + leds { + compatible = "gpio-leds"; + + wifi { + label = "orange:wifi"; + gpios = <&gpio 9 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "phy0tpt"; + }; + + wps { + label = "orange:wps"; + gpios = <&gpio 24 GPIO_ACTIVE_HIGH>; + }; + + led_power: power { + label = "green:power"; + gpios = <&gpio 25 GPIO_ACTIVE_HIGH>; + }; + }; + + keys { + compatible = "gpio-keys"; + + wps { + label = "wps"; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + reset { + label = "reset"; + gpios = <&gpio 10 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <10000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "u-boot-env"; + reg = <0x30000 0x1000>; + }; + + partition@32000 { + label = "config"; + reg = <0x32000 0xe000>; + read-only; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x50000 0xfb0000>; + }; + }; + }; +}; + +&state_default { + gpio { + groups = "i2c", "uart2", "rgmii2"; + function = "gpio"; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + mt76@0,0 { + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x0000>; + ieee80211-freq-limit = <2400000 2500000>; + }; +}; + +&pcie1 { + mt76@0,0 { + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x8000>; + ieee80211-freq-limit = <5000000 6000000>; + }; +}; + +&gmac0 { + nvmem-cells = <&macaddr_factory_2e>; + nvmem-cell-names = "mac-address"; +}; + +ðernet { + pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>; +}; + +&switch0 { + ports { + port@0 { + status = "okay"; + label = "lan"; + }; + }; +}; + +&factory { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_2e: macaddr@2e { + reg = <0x2e 0x6>; + }; +}; diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index d33937a8d74..582d53c4230 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -1541,6 +1541,15 @@ define Device/linksys_re6500 endef TARGET_DEVICES += linksys_re6500 +define Device/linksys_re7000 + $(Device/uimage-lzma-loader) + IMAGE_SIZE := 16064k + DEVICE_VENDOR := Linksys + DEVICE_MODEL := RE7000 + DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615-firmware +endef +TARGET_DEVICES += linksys_re7000 + define Device/mediatek_ap-mt7621a-v60 $(Device/dsa-migration) IMAGE_SIZE := 7872k diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network index a986e9bac91..5b7cc7f2ca9 100644 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network @@ -17,6 +17,7 @@ ramips_setup_interfaces() dlink,dap-1620-b1|\ dlink,dap-x1860-a1|\ edimax,re23s|\ + linksys,re7000|\ mikrotik,ltap-2hnd|\ mikrotik,routerboard-m11g|\ netgear,ex6150|\ From e6aa1a70e6c870cfeac838b52ad57b6888e6629d Mon Sep 17 00:00:00 2001 From: Paul Spooren Date: Tue, 9 May 2023 19:06:23 +0200 Subject: [PATCH 14/17] scripts: run ipkg-make-index through shellcheck Use quotes and replace `` by $() to pass the shellcheck tests. Signed-off-by: Paul Spooren --- scripts/ipkg-make-index.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/ipkg-make-index.sh b/scripts/ipkg-make-index.sh index 8965d0aa183..7b209dca8ec 100755 --- a/scripts/ipkg-make-index.sh +++ b/scripts/ipkg-make-index.sh @@ -3,25 +3,25 @@ set -e pkg_dir=$1 -if [ -z $pkg_dir ] || [ ! -d $pkg_dir ]; then +if [ -z "$pkg_dir" ] || [ ! -d "$pkg_dir" ]; then echo "Usage: ipkg-make-index " >&2 exit 1 fi empty=1 -for pkg in `find $pkg_dir -name '*.ipk' | sort`; do +for pkg in $(find "$pkg_dir" -name '*.ipk' | sort); do empty= name="${pkg##*/}" name="${name%%_*}" [[ "$name" = "kernel" ]] && continue [[ "$name" = "libc" ]] && continue echo "Generating index for package $pkg" >&2 - file_size=$(stat -L -c%s $pkg) - sha256sum=$($MKHASH sha256 $pkg) + file_size=$(stat -L -c%s "$pkg") + sha256sum=$($MKHASH sha256 "$pkg") # Take pains to make variable value sed-safe - sed_safe_pkg=`echo $pkg | sed -e 's/^\.\///g' -e 's/\\//\\\\\\//g'` - tar -xzOf $pkg ./control.tar.gz | tar xzOf - ./control | sed -e "s/^Description:/Filename: $sed_safe_pkg\\ + sed_safe_pkg=$(echo "$pkg" | sed -e 's/^\.\///g' -e 's/\\//\\\\\\//g') + tar -xzOf "$pkg" ./control.tar.gz | tar xzOf - ./control | sed -e "s/^Description:/Filename: $sed_safe_pkg\\ Size: $file_size\\ SHA256sum: $sha256sum\\ Description:/" From 7611b330bb613409ae4e92ad63dbcc095676468f Mon Sep 17 00:00:00 2001 From: Paul Spooren Date: Tue, 9 May 2023 21:32:26 +0200 Subject: [PATCH 15/17] Revert "scripts: run ipkg-make-index through shellcheck" This reverts commit e6aa1a70e6c870cfeac838b52ad57b6888e6629d. --- scripts/ipkg-make-index.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/ipkg-make-index.sh b/scripts/ipkg-make-index.sh index 7b209dca8ec..8965d0aa183 100755 --- a/scripts/ipkg-make-index.sh +++ b/scripts/ipkg-make-index.sh @@ -3,25 +3,25 @@ set -e pkg_dir=$1 -if [ -z "$pkg_dir" ] || [ ! -d "$pkg_dir" ]; then +if [ -z $pkg_dir ] || [ ! -d $pkg_dir ]; then echo "Usage: ipkg-make-index " >&2 exit 1 fi empty=1 -for pkg in $(find "$pkg_dir" -name '*.ipk' | sort); do +for pkg in `find $pkg_dir -name '*.ipk' | sort`; do empty= name="${pkg##*/}" name="${name%%_*}" [[ "$name" = "kernel" ]] && continue [[ "$name" = "libc" ]] && continue echo "Generating index for package $pkg" >&2 - file_size=$(stat -L -c%s "$pkg") - sha256sum=$($MKHASH sha256 "$pkg") + file_size=$(stat -L -c%s $pkg) + sha256sum=$($MKHASH sha256 $pkg) # Take pains to make variable value sed-safe - sed_safe_pkg=$(echo "$pkg" | sed -e 's/^\.\///g' -e 's/\\//\\\\\\//g') - tar -xzOf "$pkg" ./control.tar.gz | tar xzOf - ./control | sed -e "s/^Description:/Filename: $sed_safe_pkg\\ + sed_safe_pkg=`echo $pkg | sed -e 's/^\.\///g' -e 's/\\//\\\\\\//g'` + tar -xzOf $pkg ./control.tar.gz | tar xzOf - ./control | sed -e "s/^Description:/Filename: $sed_safe_pkg\\ Size: $file_size\\ SHA256sum: $sha256sum\\ Description:/" From 3da70c64697aa6ebe4e81b162523d68fcff97b32 Mon Sep 17 00:00:00 2001 From: Olliver Schinagl Date: Thu, 22 Sep 2022 12:05:00 +0200 Subject: [PATCH 16/17] base-files: Do not break on non-eth ports When using OpenWRT with DSA and 'lan' ports, we could get an empty `next_eth`. This is of course not desirable, as this causes `sh: out of range` errors when trying to determine which one would be greater. It turns out, that we don't even need this check at all because, when looking for all existin eth*s on a system, and take the highest index and then iterate a set of devices and rename to eth${highest_index+n}, it is guaranteed that there will be no conflict. Fixes: b688bf83f9d6 ("base-files: rename ethernet devs on known boards") Signed-off-by: Olliver Schinagl --- package/base-files/files/lib/preinit/10_indicate_preinit | 2 -- 1 file changed, 2 deletions(-) diff --git a/package/base-files/files/lib/preinit/10_indicate_preinit b/package/base-files/files/lib/preinit/10_indicate_preinit index 87a4f4da3e0..a8f7758c841 100644 --- a/package/base-files/files/lib/preinit/10_indicate_preinit +++ b/package/base-files/files/lib/preinit/10_indicate_preinit @@ -95,8 +95,6 @@ preinit_config_board() { json_select "network_device" json_select "$netdev" json_get_vars path path - next_eth="$(echo "$netdev" | grep 'eth[0-9]*' | tr -dc '[0-9]')" - [ "$next_eth" -gt "$max_eth" ] && max_eth=$next_eth if [ -n "$path" -a -h "/sys/class/net/$netdev" ]; then ip link set "$netdev" down ip link set "$netdev" name eth$((++max_eth)) From 218ce40cd738f3373438aab82467807a8707fb9c Mon Sep 17 00:00:00 2001 From: Paul Spooren Date: Tue, 9 May 2023 21:39:58 +0200 Subject: [PATCH 17/17] build: generate index.json The index.json file lies next to Packages index files and contains a json dict with the package architecture and a dict of package names and versions. This can be used for downstream project to know what packages in which versions are available. Signed-off-by: Paul Spooren --- package/Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/package/Makefile b/package/Makefile index 209be346747..4b8df7f484d 100644 --- a/package/Makefile +++ b/package/Makefile @@ -92,6 +92,10 @@ $(curdir)/index: FORCE $(call ERROR_MESSAGE,WARNING: Applying padding in $$d/Packages to workaround usign SHA-512 bug!); \ { echo ""; echo ""; } >> Packages;; \ esac; \ + echo -n '{"architecture": "$(ARCH_PACKAGES)", "packages":{' > index.json; \ + sed -n -e 's/^Package: \(.*\)$$/"\1":/p' -e 's/^Version: \(.*\)$$/"\1",/p' Packages | tr '\n' ' ' >> index.json; \ + echo '}}' >> index.json; \ + sed -i 's/, }}/}}/' index.json; \ gzip -9nc Packages > Packages.gz; \ ); done ifdef CONFIG_SIGNED_PACKAGES