04-stock.patch 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. --- a/target/linux/qualcommax/image/ipq807x.mk
  2. +++ b/target/linux/qualcommax/image/ipq807x.mk
  3. @@ -256,12 +256,7 @@ define Device/xiaomi_ax3600
  4. PAGESIZE := 2048
  5. DEVICE_DTS_CONFIG := config@ac04
  6. SOC := ipq8071
  7. - KERNEL_SIZE := 36608k
  8. DEVICE_PACKAGES := ipq-wifi-xiaomi_ax3600 kmod-ath10k-ct-smallbuffers ath10k-firmware-qca9887-ct
  9. -ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
  10. - ARTIFACTS := initramfs-factory.ubi
  11. - ARTIFACT/initramfs-factory.ubi := append-image-stage initramfs-uImage.itb | ubinize-kernel
  12. -endif
  13. endef
  14. TARGET_DEVICES += xiaomi_ax3600
  15. @@ -274,13 +269,8 @@ define Device/xiaomi_ax9000
  16. PAGESIZE := 2048
  17. DEVICE_DTS_CONFIG := config@hk14
  18. SOC := ipq8072
  19. - KERNEL_SIZE := 57344k
  20. DEVICE_PACKAGES := ipq-wifi-xiaomi_ax9000 kmod-ath11k-pci ath11k-firmware-qcn9074 \
  21. kmod-ath10k-ct ath10k-firmware-qca9887-ct
  22. -ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
  23. - ARTIFACTS := initramfs-factory.ubi
  24. - ARTIFACT/initramfs-factory.ubi := append-image-stage initramfs-uImage.itb | ubinize-kernel
  25. -endif
  26. endef
  27. TARGET_DEVICES += xiaomi_ax9000
  28. --- a/target/linux/qualcommax/ipq807x/base-files/etc/init.d/bootcount
  29. +++ b/target/linux/qualcommax/ipq807x/base-files/etc/init.d/bootcount
  30. @@ -9,5 +9,13 @@ boot() {
  31. # Unset changed flag after sysupgrade complete
  32. fw_setenv changed
  33. ;;
  34. + redmi,ax6|\
  35. + xiaomi,ax3600|\
  36. + xiaomi,ax9000)
  37. + # OTA handling should not be used. Reset it just in case.
  38. + fw_setenv flag_ota_reboot 0
  39. + # Not strictly needed but useful to handle partition crash condition
  40. + fw_setenv flag_boot_success 1
  41. + ;;
  42. esac
  43. }
  44. --- a/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh
  45. +++ b/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh
  46. @@ -83,20 +83,29 @@ platform_do_upgrade() {
  47. redmi,ax6|\
  48. xiaomi,ax3600|\
  49. xiaomi,ax9000)
  50. - # Make sure that UART is enabled
  51. - fw_setenv boot_wait on
  52. - fw_setenv uart_en 1
  53. + part_num="$(fw_printenv -n flag_boot_rootfs)"
  54. + if [ "$part_num" -eq "1" ]; then
  55. + CI_UBIPART="rootfs_1"
  56. + target_num=1
  57. + # Reset fail flag for the current partition
  58. + # With both partition set to fail, the partition 2 (bit 1)
  59. + # is loaded
  60. + fw_setenv flag_try_sys2_failed 0
  61. + else
  62. + CI_UBIPART="rootfs"
  63. + target_num=0
  64. + # Reset fail flag for the current partition
  65. + # or uboot will skip the loading of this partition
  66. + fw_setenv flag_try_sys1_failed 0
  67. + fi
  68. +
  69. + # Tell uboot to switch partition
  70. + fw_setenv flag_boot_rootfs "$target_num"
  71. + fw_setenv flag_last_success "$target_num"
  72. - # Enforce single partition.
  73. - fw_setenv flag_boot_rootfs 0
  74. - fw_setenv flag_last_success 0
  75. - fw_setenv flag_boot_success 1
  76. - fw_setenv flag_try_sys1_failed 8
  77. - fw_setenv flag_try_sys2_failed 8
  78. + # Reset success flag
  79. + fw_setenv flag_boot_success 0
  80. - # Kernel and rootfs are placed in 2 different UBI
  81. - CI_KERN_UBIPART="ubi_kernel"
  82. - CI_ROOT_UBIPART="rootfs"
  83. nand_do_upgrade "$1"
  84. ;;
  85. *)