chromium.mk 1.9 KB

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