0012-sunxi-fix-uboot-install-location.patch 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. From: Matthias Schiffer <mschiffer@universe-factory.net>
  2. Date: Thu, 16 Jul 2015 22:01:02 +0200
  3. Subject: sunxi: fix uboot install location
  4. Install uboot files to KERNEL_BUILD_DIR instead of BIN_DIR to fix the
  5. ImageBuilder. Similar fixes are necessary for many (all?) other uboot
  6. targets.
  7. Also remove the DTS copy command, BIN_DIR was unnecessarily cluttered with
  8. DTS files unrelated to the chosen profile.
  9. diff --git a/package/boot/uboot-sunxi/Makefile b/package/boot/uboot-sunxi/Makefile
  10. index 14ba922..9032600 100644
  11. --- a/package/boot/uboot-sunxi/Makefile
  12. +++ b/package/boot/uboot-sunxi/Makefile
  13. @@ -6,6 +6,7 @@
  14. #
  15. include $(TOPDIR)/rules.mk
  16. +include $(INCLUDE_DIR)/kernel.mk
  17. PKG_NAME:=u-boot
  18. PKG_VERSION:=2015.01
  19. @@ -16,7 +17,7 @@ PKG_SOURCE_URL:= \
  20. PKG_MD5SUM:=7f08dc9e98a71652bd6968888ed6ec95
  21. -PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
  22. +PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
  23. PKG_LICENSE:=GPL-2.0 GPL-2.0+
  24. PKG_LICENSE_FILES:=Licenses/README
  25. @@ -136,16 +137,16 @@ define Build/Compile
  26. endef
  27. define Package/uboot/install/default
  28. - $(INSTALL_DIR) $(BIN_DIR)/uboot-$(BOARD)-$(1)
  29. $(CP) $(PKG_BUILD_DIR)/u-boot.bin \
  30. - $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.bin
  31. + $(KERNEL_BUILD_DIR)/uboot-$(BOARD)-$(1)-u-boot.bin
  32. $(CP) $(PKG_BUILD_DIR)/spl/sunxi-spl.bin \
  33. - $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-spl.bin
  34. + $(KERNEL_BUILD_DIR)/uboot-$(BOARD)-$(1)-spl.bin
  35. $(CP) $(PKG_BUILD_DIR)/u-boot-sunxi-with-spl.bin \
  36. - $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot-with-spl.bin
  37. + $(KERNEL_BUILD_DIR)/uboot-$(BOARD)-$(1)-u-boot-with-spl.bin
  38. $(CP) uEnv.txt \
  39. - $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-uEnv.txt
  40. - mkimage -C none -A arm -T script -d $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-uEnv.txt $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-boot.scr
  41. + $(KERNEL_BUILD_DIR)/uboot-$(BOARD)-$(1)-uEnv.txt
  42. + mkimage -C none -A arm -T script -d $(KERNEL_BUILD_DIR)/uboot-$(BOARD)-$(1)-uEnv.txt \
  43. + $(KERNEL_BUILD_DIR)/uboot-$(BOARD)-$(1)-boot.scr
  44. endef
  45. define Package/uboot/install/template
  46. diff --git a/target/linux/sunxi/image/Makefile b/target/linux/sunxi/image/Makefile
  47. index 6fcd61f..19ab935 100644
  48. --- a/target/linux/sunxi/image/Makefile
  49. +++ b/target/linux/sunxi/image/Makefile
  50. @@ -11,28 +11,12 @@ include $(INCLUDE_DIR)/host.mk
  51. FAT32_BLOCK_SIZE=1024
  52. FAT32_BLOCKS=$(shell echo $$(($(CONFIG_SUNXI_SD_BOOT_PARTSIZE)*1024*1024/$(FAT32_BLOCK_SIZE))))
  53. -BOARDS:= \
  54. - sun4i-a10-cubieboard \
  55. - sun4i-a10-olinuxino-lime \
  56. - sun4i-a10-pcduino \
  57. - sun5i-a13-olinuxino \
  58. - sun6i-a31-colombus \
  59. - sun6i-a31-m9 \
  60. - sun7i-a20-bananapi \
  61. - sun7i-a20-bananapro \
  62. - sun7i-a20-cubieboard2 \
  63. - sun7i-a20-cubietruck \
  64. - sun7i-a20-olinuxino-lime \
  65. - sun7i-a20-olinuxino-micro \
  66. - sun7i-a20-pcduino3 \
  67. - sun7i-a20-lamobo-r1
  68. -
  69. define Image/BuildKernel
  70. mkimage -A arm -O linux -T kernel -C none \
  71. -a 0x40008000 -e 0x40008000 \
  72. -n 'ARM OpenWrt Linux-$(LINUX_VERSION)' \
  73. -d $(KDIR)/zImage $(BIN_DIR)/$(IMG_PREFIX)-uImage
  74. -
  75. +
  76. ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
  77. $(CP) $(KDIR)/zImage-initramfs $(BIN_DIR)/$(IMG_PREFIX)-zImage-initramfs
  78. echo -ne '\x00\x00\x00\x00' >> $(BIN_DIR)/$(IMG_PREFIX)-zImage-initramfs
  79. @@ -42,27 +26,23 @@ define Image/BuildKernel
  80. $(BIN_DIR)/$(IMG_PREFIX)-uImage-initramfs \
  81. )
  82. endif
  83. -
  84. - $(foreach board,$(BOARDS),
  85. - $(CP) $(DTS_DIR)/$(board).dtb $(BIN_DIR)/
  86. - )
  87. endef
  88. define Image/Build/SDCard
  89. rm -f $(KDIR)/boot.img
  90. mkdosfs $(KDIR)/boot.img -C $(FAT32_BLOCKS)
  91. -
  92. - mcopy -i $(KDIR)/boot.img $(BIN_DIR)/uboot-sunxi-$(PROFILE)/$(IMG_PREFIX)-$(PROFILE)-boot.scr ::boot.scr
  93. - mcopy -i $(KDIR)/boot.img $(BIN_DIR)/$(2).dtb ::dtb
  94. +
  95. + mcopy -i $(KDIR)/boot.img $(KDIR)/uboot-sunxi-$(PROFILE)-boot.scr ::boot.scr
  96. + mcopy -i $(KDIR)/boot.img $(DTS_DIR)/$(2).dtb ::dtb
  97. mcopy -i $(KDIR)/boot.img $(BIN_DIR)/$(IMG_PREFIX)-uImage ::uImage
  98. -
  99. +
  100. ./gen_sunxi_sdcard_img.sh \
  101. $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-sdcard-vfat-$(1).img \
  102. $(KDIR)/boot.img \
  103. $(KDIR)/root.$(1) \
  104. $(CONFIG_SUNXI_SD_BOOT_PARTSIZE) \
  105. $(CONFIG_TARGET_ROOTFS_PARTSIZE) \
  106. - $(BIN_DIR)/uboot-sunxi-$(PROFILE)/$(IMG_PREFIX)-$(PROFILE)-u-boot-with-spl.bin
  107. + $(KDIR)/uboot-sunxi-$(PROFILE)-u-boot-with-spl.bin
  108. endef
  109. define Image/Build/Profile/A10-OLinuXino-Lime
  110. @@ -124,7 +104,7 @@ endef
  111. define Image/Build
  112. $(call Image/Build/$(1),$(1))
  113. $(call Image/Build/Profile/$(PROFILE),$(1))
  114. -
  115. +
  116. dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/$(IMG_PREFIX)-root.$(1) bs=128k conv=sync
  117. endef