Alex Henrie <alexhenri...@gmail.com> [2022-01-20 22:06:07]:

Hi,

it looks like you need just this two variables:

 DEVICE_MODEL := EMG2926-Q10A
 RAS_BOARD := AAVK-EMG2926Q10A

so following copy&pasta seems a bit much against my DRY taste:

> +define Device/zyxel_emg2926_q10a
> +  SOC := qca9558
> +  DEVICE_VENDOR := ZyXEL
> +  DEVICE_MODEL := EMG2926-Q10A
> +  DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k-ct \
> +     ath10k-firmware-qca988x-ct
> +  RAS_BOARD := AAVK-EMG2926Q10A
> +  RAS_ROOTFS_SIZE := 29696k
> +  RAS_VERSION := "OpenWrt Linux-$(LINUX_VERSION)"
> +  KERNEL_SIZE := 4096k
> +  BLOCKSIZE := 128k
> +  PAGESIZE := 2048
> +  LOADER_TYPE := bin
> +  KERNEL := kernel-bin | append-dtb | lzma | loader-kernel | uImage none | \
> +     zyxel-buildkerneljffs | check-size 4096k
> +  IMAGES := sysupgrade.tar sysupgrade-4M-Kernel.bin factory.bin
> +  IMAGE/sysupgrade.tar/squashfs := append-rootfs | pad-to $$$$(BLOCKSIZE) | \
> +     sysupgrade-tar rootfs=$$$$@ | append-metadata
> +  IMAGE/sysupgrade-4M-Kernel.bin/squashfs := append-kernel | \
> +     pad-to $$$$(KERNEL_SIZE) | append-ubi | pad-to 263192576 | gzip
> +  IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi 
> | \
> +     zyxel-factory
> +  UBINIZE_OPTS := -E 5
> +endef
> +TARGET_DEVICES += zyxel_emg2926_q10a

so I would simply abstract the common bits into something like this:

 define Device/zyxel_nand_common
        SOC := qca9558
        DEVICE_VENDOR := ZyXEL
        DEVICE_MODEL := EMG2926-Q10A
        DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k-ct \
                ath10k-firmware-qca988x-ct
        ...
 end

and then do:

 define Device/zyxel_nbg6716
   $(Device/zyxel_nand_common)
   DEVICE_MODEL := NBG6716
   RAS_BOARD := NBG6716
 endef

 define Device/zyxel_emg2926_q10a
   $(Device/zyxel_nand_common)
   DEVICE_MODEL := EMG2926-Q10A
   RAS_BOARD := AAVK-EMG2926Q10A
 endef

Cheers,

Petr

_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to