2021-01-08 12:32:37 +00:00
|
|
|
# SPDX-License-Identifier: GPL-2.0-only
|
|
|
|
|
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
include $(INCLUDE_DIR)/image.mk
|
|
|
|
|
2021-01-23 12:24:28 +00:00
|
|
|
DEVICE_VARS += ASUS_PRODUCTID ASUS_BUILD_NO ASUS_FW_REV ASUS_EXT_NO
|
2021-04-07 12:38:45 +00:00
|
|
|
DEVICE_VARS += NETGEAR_BOARD_ID NETGEAR_REGION
|
2021-11-19 13:32:58 +00:00
|
|
|
DEVICE_VARS += PKGTB_ITS
|
2021-01-08 12:32:37 +00:00
|
|
|
|
2021-11-03 17:12:05 +00:00
|
|
|
define Image/Prepare
|
|
|
|
cp bootfs-generic.its $(KDIR)/
|
2021-11-19 13:32:58 +00:00
|
|
|
sed -i "s=\$$$${dts_dir}=$(DTS_DIR)=" $(KDIR)/bootfs-generic.its
|
2021-11-03 17:12:05 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Build/bootfs
|
|
|
|
cat $@ | $(STAGING_DIR_HOST)/bin/lzma e -eos -si -so > $@.tmp
|
|
|
|
mv $@.tmp $@
|
|
|
|
sed -i "s=\$${kernel}=$@=" $(KDIR)/bootfs-generic.its
|
|
|
|
PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $(KDIR)/bootfs-generic.its $(KDIR)/bootfs-generic.itb
|
|
|
|
endef
|
|
|
|
|
2021-01-23 12:24:28 +00:00
|
|
|
define Build/bcm4908asus
|
|
|
|
$(STAGING_DIR_HOST)/bin/bcm4908asus create -i $@ \
|
|
|
|
-p $(ASUS_PRODUCTID) -b $(ASUS_BUILD_NO) -f $(ASUS_FW_REV) \
|
|
|
|
-e $(ASUS_EXT_NO)
|
2021-01-13 08:16:46 +00:00
|
|
|
endef
|
|
|
|
|
2021-01-20 08:21:21 +00:00
|
|
|
define Build/bcm4908img
|
|
|
|
rm -fr $@-bootfs
|
|
|
|
mkdir -p $@-bootfs
|
|
|
|
cp -r $(DEVICE_NAME)/* $@-bootfs/
|
2021-04-05 22:03:31 +00:00
|
|
|
touch $@-bootfs/1-openwrt
|
2021-01-20 08:21:21 +00:00
|
|
|
cp $(DTS_DIR)/$(firstword $(DEVICE_DTS)).dtb $@-bootfs/94908.dtb
|
|
|
|
cp $(KDIR)/bcm63xx-cfe/$(subst _,$(comma),$(DEVICE_NAME))/cferam.000 $@-bootfs/
|
|
|
|
cp $(IMAGE_KERNEL) $@-bootfs/vmlinux.lz
|
|
|
|
|
2021-04-07 07:30:30 +00:00
|
|
|
$(STAGING_DIR_HOST)/bin/mkfs.jffs2 --pad=0x800000 --little-endian --squash-uids \
|
2021-01-23 12:24:28 +00:00
|
|
|
-v -e 128KiB -o $@-bootfs.jffs2 -d $@-bootfs -m none -n
|
|
|
|
$(STAGING_DIR_HOST)/bin/bcm4908img create $@.new -f $@-bootfs.jffs2 \
|
|
|
|
-a 0x20000 -f $@
|
2021-01-21 12:23:56 +00:00
|
|
|
mv $@.new $@
|
2021-01-20 08:21:21 +00:00
|
|
|
endef
|
|
|
|
|
2021-01-23 12:24:28 +00:00
|
|
|
define Build/bcm4908kernel
|
|
|
|
$(STAGING_DIR_HOST)/bin/bcm4908kernel -i $@ -o $@.new
|
|
|
|
mv $@.new $@
|
2021-01-21 15:07:49 +00:00
|
|
|
endef
|
|
|
|
|
2021-01-23 12:24:28 +00:00
|
|
|
define Build/bcm4908lzma
|
|
|
|
$(STAGING_DIR_HOST)/bin/lzma e -lc1 -lp2 -pb2 -d22 $@ $@.new
|
|
|
|
mv $@.new $@
|
|
|
|
endef
|
2021-01-21 15:07:49 +00:00
|
|
|
|
2021-11-19 13:32:58 +00:00
|
|
|
define Build/pkgtb
|
|
|
|
mv $@ $@.rootfs
|
|
|
|
cp $(PKGTB_ITS) $@.its
|
|
|
|
sed -i "s=\$${bootfs}=$(KDIR)/bootfs-generic.itb=" $@.its
|
|
|
|
sed -i "s=\$${rootfs}=$@.rootfs=" $@.its
|
|
|
|
PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $@.its $@
|
|
|
|
endef
|
|
|
|
|
2021-01-08 12:32:37 +00:00
|
|
|
define Device/Default
|
2021-01-13 08:16:46 +00:00
|
|
|
KERNEL := kernel-bin | bcm4908lzma | bcm4908kernel
|
2021-01-08 12:32:37 +00:00
|
|
|
KERNEL_DEPENDS = $$(wildcard $(DTS_DIR)/$$(DEVICE_DTS).dts)
|
|
|
|
KERNEL_INITRAMFS_SUFFIX := .bin
|
2021-01-13 08:16:46 +00:00
|
|
|
KERNEL_INITRAMFS := kernel-bin | bcm4908lzma | bcm4908kernel
|
2021-01-08 12:32:37 +00:00
|
|
|
FILESYSTEMS := squashfs
|
|
|
|
KERNEL_NAME := Image
|
2021-02-22 14:55:43 +00:00
|
|
|
DEVICE_IMG_NAME = $$(DEVICE_IMG_PREFIX)-$$(1).$$(2)
|
2021-01-08 12:32:37 +00:00
|
|
|
BLOCKSIZE := 128k
|
|
|
|
PAGESIZE := 2048
|
2021-04-08 08:39:56 +00:00
|
|
|
IMAGE/bin := append-ubi | bcm4908img
|
2021-01-08 12:32:37 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Device/asus_gt-ac5300
|
|
|
|
DEVICE_VENDOR := Asus
|
|
|
|
DEVICE_MODEL := GT-AC5300
|
|
|
|
DEVICE_DTS := broadcom/bcm4908/bcm4908-asus-gt-ac5300
|
|
|
|
IMAGES := bin
|
2021-01-21 15:07:49 +00:00
|
|
|
IMAGE/bin := append-ubi | bcm4908img | bcm4908asus
|
|
|
|
ASUS_PRODUCTID := GT-AC5300
|
|
|
|
ASUS_BUILD_NO := 384
|
|
|
|
ASUS_FW_REV := 3.0.0.4
|
|
|
|
ASUS_EXT_NO := 21140
|
2021-01-08 12:32:37 +00:00
|
|
|
endef
|
|
|
|
TARGET_DEVICES += asus_gt-ac5300
|
|
|
|
|
|
|
|
define Device/netgear_r8000p
|
|
|
|
DEVICE_VENDOR := Netgear
|
|
|
|
DEVICE_MODEL := R8000P
|
|
|
|
DEVICE_DTS := broadcom/bcm4908/bcm4906-netgear-r8000p
|
2021-04-08 08:39:56 +00:00
|
|
|
IMAGES := bin
|
2021-04-07 12:38:45 +00:00
|
|
|
IMAGE/chk := append-ubi | bcm4908img | netgear-chk
|
|
|
|
NETGEAR_BOARD_ID := U12H359T00_NETGEAR
|
|
|
|
NETGEAR_REGION := 1
|
2021-01-08 12:32:37 +00:00
|
|
|
endef
|
|
|
|
TARGET_DEVICES += netgear_r8000p
|
|
|
|
|
2021-03-05 13:38:41 +00:00
|
|
|
define Device/tplink_archer-c2300-v1
|
|
|
|
DEVICE_VENDOR := TP-Link
|
|
|
|
DEVICE_MODEL := Archer C2300
|
|
|
|
DEVICE_VARIANT := v1
|
|
|
|
DEVICE_DTS := broadcom/bcm4908/bcm4906-tplink-archer-c2300-v1
|
|
|
|
IMAGES := bin
|
|
|
|
IMAGE/bin := append-ubi | bcm4908img
|
2021-04-08 07:12:43 +00:00
|
|
|
BROKEN := y
|
2021-03-05 13:38:41 +00:00
|
|
|
endef
|
|
|
|
TARGET_DEVICES += tplink_archer-c2300-v1
|
|
|
|
|
2021-11-19 13:32:59 +00:00
|
|
|
define Device/netgear
|
|
|
|
DEVICE_VENDOR := NETGEAR
|
|
|
|
KERNEL := kernel-bin | bootfs
|
|
|
|
IMAGES := chk
|
2021-11-19 13:48:20 +00:00
|
|
|
IMAGE/chk := append-rootfs | pkgtb | netgear-chk
|
2021-11-19 13:32:59 +00:00
|
|
|
NETGEAR_REGION := 1
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Device/netgear_raxe500
|
|
|
|
DEVICE_MODEL := RAXE500
|
|
|
|
$(Device/netgear)
|
|
|
|
PKGTB_ITS := pkgtb-bcm4908.its
|
|
|
|
NETGEAR_BOARD_ID := U12H449T00_NETGEAR
|
|
|
|
endef
|
|
|
|
# TARGET_DEVICES += netgear_raxe500
|
|
|
|
|
2021-01-08 12:32:37 +00:00
|
|
|
$(eval $(call BuildImage))
|