chromium.mk 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. DTS_DIR := $(DTS_DIR)/qcom
  2. define Device/dsa-migration
  3. DEVICE_COMPAT_VERSION := 1.1
  4. DEVICE_COMPAT_MESSAGE := Config cannot be migrated from swconfig to DSA
  5. endef
  6. define Build/cros-gpt
  7. cp $@ [email protected] 2>/dev/null || true
  8. ptgen -o [email protected] -g \
  9. -T cros_kernel -N kernel -p $(CONFIG_TARGET_KERNEL_PARTSIZE)m \
  10. -N rootfs -p $(CONFIG_TARGET_ROOTFS_PARTSIZE)m \
  11. -N rootfs_data -p \
  12. $$((3687-$(CONFIG_TARGET_ROOTFS_PARTSIZE)-\
  13. $(CONFIG_TARGET_KERNEL_PARTSIZE)))m
  14. cat [email protected] >> $@
  15. rm [email protected]
  16. endef
  17. define Build/append-kernel-part
  18. dd if=$(IMAGE_KERNEL) bs=$(CONFIG_TARGET_KERNEL_PARTSIZE)M conv=sync >> $@
  19. endef
  20. # NB: Chrome OS bootloaders replace the '%U' in command lines with the UUID of
  21. # the kernel partition it chooses to boot from. This gives a flexible way to
  22. # consistently build and sign kernels that always use the subsequent
  23. # (PARTNROFF=1) partition as their rootfs.
  24. define Build/cros-vboot
  25. $(STAGING_DIR_HOST)/bin/cros-vbutil \
  26. -k $@ \
  27. -c "root=PARTUUID=%U/PARTNROFF=1 rootwait fstools_partname_fallback_scan=1" \
  28. -o [email protected]
  29. @mv [email protected] $@
  30. endef
  31. define Device/OnhubImage
  32. KERNEL_LOADADDR = 0x44208000
  33. SOC := qcom-ipq8064
  34. KERNEL_SUFFIX := -fit-zImage.itb.vboot
  35. KERNEL_NAME := zImage
  36. KERNEL = kernel-bin | fit none $$(KDIR)/image-$$(DEVICE_DTS).dtb | cros-vboot
  37. IMAGES := factory.bin sysupgrade.bin
  38. IMAGE/factory.bin := cros-gpt | append-kernel-part | append-rootfs
  39. IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
  40. # Note: Chromium/Depthcharge-based bootloaders insert a reserved-memory
  41. # ramoops node into the Device Tree automatically, so we can use
  42. # kmod-ramoops.
  43. DEVICE_PACKAGES := ath10k-firmware-qca988x-ct e2fsprogs kmod-fs-ext4 losetup \
  44. partx-utils mkf2fs kmod-fs-f2fs \
  45. ucode kmod-google-firmware kmod-tpm-i2c-infineon \
  46. kmod-sound-soc-ipq8064-storm kmod-usb-storage \
  47. kmod-ramoops
  48. endef
  49. define Device/asus_onhub
  50. $(call Device/OnhubImage)
  51. $(Device/dsa-migration)
  52. DEVICE_VENDOR := ASUS
  53. DEVICE_MODEL := OnHub SRT-AC1900
  54. DEVICE_DTS := $$(SOC)-asus-onhub
  55. BOARD_NAME := asus-onhub
  56. endef
  57. TARGET_DEVICES += asus_onhub
  58. define Device/tplink_onhub
  59. $(call Device/OnhubImage)
  60. $(Device/dsa-migration)
  61. DEVICE_VENDOR := TP-Link
  62. DEVICE_MODEL := OnHub AC1900 Cloud Router
  63. DEVICE_DTS := $$(SOC)-tplink-onhub
  64. BOARD_NAME := tplink-onhub
  65. endef
  66. TARGET_DEVICES += tplink_onhub