chromium.mk 2.3 KB

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