Re: [OpenWrt-Devel] [PATCH 1/2] sunxi: fix uboot install location

2015-08-02 Thread Matthias Schiffer
On 07/31/2015 06:06 PM, Zoltan HERPAI wrote:
 On Sun, 26 Jul 2015, Zoltan HERPAI wrote:
 
 On Fri, 24 Jul 2015, John Crispin wrote:

 On 16/07/2015 22:20, Matthias Schiffer wrote:
 -BOARDS:= \
 -sun4i-a10-cubieboard \
 -sun4i-a10-olinuxino-lime \
 -sun4i-a10-pcduino \
 -sun5i-a13-olinuxino \
 -sun6i-a31-colombus \
 -sun6i-a31-m9 \
 -sun7i-a20-bananapi \
 -sun7i-a20-bananapro \
 -sun7i-a20-cubieboard2 \
 -sun7i-a20-cubietruck \
 -sun7i-a20-olinuxino-lime \
 -sun7i-a20-olinuxino-micro \
 -sun7i-a20-pcduino3 \
 -sun7i-a20-lamobo-r1
 -
  define Image/BuildKernel
  mkimage -A arm -O linux -T kernel -C none \
  -a 0x40008000 -e 0x40008000 \
  -n 'ARM OpenWrt Linux-$(LINUX_VERSION)' \
  -d $(KDIR)/zImage $(BIN_DIR)/$(IMG_PREFIX)-uImage
 -
 +
  ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
  $(CP) $(KDIR)/zImage-initramfs
 $(BIN_DIR)/$(IMG_PREFIX)-zImage-initramfs
  echo -ne '\x00\x00\x00\x00' 
 $(BIN_DIR)/$(IMG_PREFIX)-zImage-initramfs
 @@ -42,27 +26,23 @@ define Image/BuildKernel
  $(BIN_DIR)/$(IMG_PREFIX)-uImage-initramfs \
  )
  endif
 -
 -$(foreach board,$(BOARDS),
 -$(CP) $(DTS_DIR)/$(board).dtb $(BIN_DIR)/
 -)
  endef

 not sure about this change. maybe just stage the dtb file of the
 selected profile. i am not sure if zoltan added this for a reason.

 Thanks John and Matthias for checking on this. I'm offline until the
 30th, will get back on this at that time.
 
 Before the sdcard imagebuilder, the dtb files for the supported boards
 were copied to BIN_DIR so the user could pick the correct dtb for the
 board. When the imagebuilder was rolled out, this was not removed from
 the Makefile - now it can go away, so I'm OK with removing this part.
 Although it's a good place to see which boards are supported, there are
 much better ways to do this.
 
 Building boot.img is probably fine to stay in KDIR - that's an interim
 file and not the final image. If you want that changed, please send a v2
 - if not, I'm happy to apply the series in its current form.
 
 Thanks,
 -w-

I think KDIR should be considered read-only for the Image Builder, it
should not put files there (please correct me if I'm wrong, I'm only
deducing this from how it's done on other targets...).

My updated patch will build the boot image in KDIR_TMP instead, which is
more appropriate in my opinion.

Matthias





signature.asc
Description: OpenPGP digital signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 1/2] sunxi: fix uboot install location

2015-07-31 Thread Zoltan HERPAI

On Sun, 26 Jul 2015, Zoltan HERPAI wrote:


On Fri, 24 Jul 2015, John Crispin wrote:


On 16/07/2015 22:20, Matthias Schiffer wrote:

-BOARDS:= \
-   sun4i-a10-cubieboard \
-   sun4i-a10-olinuxino-lime \
-   sun4i-a10-pcduino \
-   sun5i-a13-olinuxino \
-   sun6i-a31-colombus \
-   sun6i-a31-m9 \
-   sun7i-a20-bananapi \
-   sun7i-a20-bananapro \
-   sun7i-a20-cubieboard2 \
-   sun7i-a20-cubietruck \
-   sun7i-a20-olinuxino-lime \
-   sun7i-a20-olinuxino-micro \
-   sun7i-a20-pcduino3 \
-   sun7i-a20-lamobo-r1
-
 define Image/BuildKernel
mkimage -A arm -O linux -T kernel -C none \
-a 0x40008000 -e 0x40008000 \
-n 'ARM OpenWrt Linux-$(LINUX_VERSION)' \
-d $(KDIR)/zImage $(BIN_DIR)/$(IMG_PREFIX)-uImage
-
+
 ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
 	$(CP) $(KDIR)/zImage-initramfs 
$(BIN_DIR)/$(IMG_PREFIX)-zImage-initramfs
 	echo -ne '\x00\x00\x00\x00'  
$(BIN_DIR)/$(IMG_PREFIX)-zImage-initramfs

@@ -42,27 +26,23 @@ define Image/BuildKernel
$(BIN_DIR)/$(IMG_PREFIX)-uImage-initramfs \
)
 endif
-
-   $(foreach board,$(BOARDS),
-   $(CP) $(DTS_DIR)/$(board).dtb $(BIN_DIR)/
-   )
 endef


not sure about this change. maybe just stage the dtb file of the
selected profile. i am not sure if zoltan added this for a reason.


Thanks John and Matthias for checking on this. I'm offline until the 30th, 
will get back on this at that time.


Before the sdcard imagebuilder, the dtb files for the supported 
boards were copied to BIN_DIR so the user could pick the correct dtb for 
the board. When the imagebuilder was rolled out, this was not removed 
from the Makefile - now it can go away, so I'm OK with removing this part. 
Although it's a good place to see which boards are supported, there are 
much better ways to do this.


Building boot.img is probably fine to stay in KDIR - that's an interim 
file and not the final image. If you want that changed, please send a v2 - 
if not, I'm happy to apply the series in its current form.


Thanks,
-w-
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 1/2] sunxi: fix uboot install location

2015-07-26 Thread Zoltan HERPAI

On Fri, 24 Jul 2015, John Crispin wrote:


On 16/07/2015 22:20, Matthias Schiffer wrote:

-BOARDS:= \
-   sun4i-a10-cubieboard \
-   sun4i-a10-olinuxino-lime \
-   sun4i-a10-pcduino \
-   sun5i-a13-olinuxino \
-   sun6i-a31-colombus \
-   sun6i-a31-m9 \
-   sun7i-a20-bananapi \
-   sun7i-a20-bananapro \
-   sun7i-a20-cubieboard2 \
-   sun7i-a20-cubietruck \
-   sun7i-a20-olinuxino-lime \
-   sun7i-a20-olinuxino-micro \
-   sun7i-a20-pcduino3 \
-   sun7i-a20-lamobo-r1
-
 define Image/BuildKernel
mkimage -A arm -O linux -T kernel -C none \
-a 0x40008000 -e 0x40008000 \
-n 'ARM OpenWrt Linux-$(LINUX_VERSION)' \
-d $(KDIR)/zImage $(BIN_DIR)/$(IMG_PREFIX)-uImage
-
+
 ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
$(CP) $(KDIR)/zImage-initramfs $(BIN_DIR)/$(IMG_PREFIX)-zImage-initramfs
echo -ne '\x00\x00\x00\x00'  $(BIN_DIR)/$(IMG_PREFIX)-zImage-initramfs
@@ -42,27 +26,23 @@ define Image/BuildKernel
$(BIN_DIR)/$(IMG_PREFIX)-uImage-initramfs \
)
 endif
-
-   $(foreach board,$(BOARDS),
-   $(CP) $(DTS_DIR)/$(board).dtb $(BIN_DIR)/
-   )
 endef


not sure about this change. maybe just stage the dtb file of the
selected profile. i am not sure if zoltan added this for a reason.


Thanks John and Matthias for checking on this. I'm offline until the 30th, 
will get back on this at that time.


Regards,
-w-
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 1/2] sunxi: fix uboot install location

2015-07-24 Thread John Crispin


On 16/07/2015 22:20, Matthias Schiffer wrote:
 -BOARDS:= \
 - sun4i-a10-cubieboard \
 - sun4i-a10-olinuxino-lime \
 - sun4i-a10-pcduino \
 - sun5i-a13-olinuxino \
 - sun6i-a31-colombus \
 - sun6i-a31-m9 \
 - sun7i-a20-bananapi \
 - sun7i-a20-bananapro \
 - sun7i-a20-cubieboard2 \
 - sun7i-a20-cubietruck \
 - sun7i-a20-olinuxino-lime \
 - sun7i-a20-olinuxino-micro \
 - sun7i-a20-pcduino3 \
 - sun7i-a20-lamobo-r1
 -
  define Image/BuildKernel
   mkimage -A arm -O linux -T kernel -C none \
   -a 0x40008000 -e 0x40008000 \
   -n 'ARM OpenWrt Linux-$(LINUX_VERSION)' \
   -d $(KDIR)/zImage $(BIN_DIR)/$(IMG_PREFIX)-uImage
 - 
 +
  ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
   $(CP) $(KDIR)/zImage-initramfs $(BIN_DIR)/$(IMG_PREFIX)-zImage-initramfs
   echo -ne '\x00\x00\x00\x00'  $(BIN_DIR)/$(IMG_PREFIX)-zImage-initramfs
 @@ -42,27 +26,23 @@ define Image/BuildKernel
   $(BIN_DIR)/$(IMG_PREFIX)-uImage-initramfs \
   )
  endif
 -
 - $(foreach board,$(BOARDS),
 - $(CP) $(DTS_DIR)/$(board).dtb $(BIN_DIR)/
 - )
  endef

not sure about this change. maybe just stage the dtb file of the
selected profile. i am not sure if zoltan added this for a reason.

John
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 1/2] sunxi: fix uboot install location

2015-07-24 Thread Matthias Schiffer
On 07/24/2015 09:30 AM, John Crispin wrote:
 
 
 On 16/07/2015 22:20, Matthias Schiffer wrote:
 -BOARDS:= \
 -sun4i-a10-cubieboard \
 -sun4i-a10-olinuxino-lime \
 -sun4i-a10-pcduino \
 -sun5i-a13-olinuxino \
 -sun6i-a31-colombus \
 -sun6i-a31-m9 \
 -sun7i-a20-bananapi \
 -sun7i-a20-bananapro \
 -sun7i-a20-cubieboard2 \
 -sun7i-a20-cubietruck \
 -sun7i-a20-olinuxino-lime \
 -sun7i-a20-olinuxino-micro \
 -sun7i-a20-pcduino3 \
 -sun7i-a20-lamobo-r1
 -
  define Image/BuildKernel
  mkimage -A arm -O linux -T kernel -C none \
  -a 0x40008000 -e 0x40008000 \
  -n 'ARM OpenWrt Linux-$(LINUX_VERSION)' \
  -d $(KDIR)/zImage $(BIN_DIR)/$(IMG_PREFIX)-uImage
 -
 +
  ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
  $(CP) $(KDIR)/zImage-initramfs $(BIN_DIR)/$(IMG_PREFIX)-zImage-initramfs
  echo -ne '\x00\x00\x00\x00'  $(BIN_DIR)/$(IMG_PREFIX)-zImage-initramfs
 @@ -42,27 +26,23 @@ define Image/BuildKernel
  $(BIN_DIR)/$(IMG_PREFIX)-uImage-initramfs \
  )
  endif
 -
 -$(foreach board,$(BOARDS),
 -$(CP) $(DTS_DIR)/$(board).dtb $(BIN_DIR)/
 -)
  endef
 
 not sure about this change. maybe just stage the dtb file of the
 selected profile. i am not sure if zoltan added this for a reason.
 
   John

I don't see why anyone would care, but I'll send a v2 anyways (I also
want to fix that the boot.img is generated in $(KDIR) instead of
$(KDIR_TMP) or $(BIN_DIR), even in the ImageBuilder). If you want, I can
also include copying the profile's DTB file to $(BIN_DIR).

Matthias



signature.asc
Description: OpenPGP digital signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 1/2] sunxi: fix uboot install location

2015-07-16 Thread Matthias Schiffer
Install uboot files to KERNEL_BUILD_DIR instead of BIN_DIR to fix the
ImageBuilder. Similar fixes are necessary for many (all?) other uboot
targets.

Also remove the DTS copy command, BIN_DIR was unnecessarily cluttered with
DTS files unrelated to the chosen profile.

Signed-off-by: Matthias Schiffer mschif...@universe-factory.net
---
 package/boot/uboot-sunxi/Makefile | 15 ---
 target/linux/sunxi/image/Makefile | 34 +++---
 2 files changed, 15 insertions(+), 34 deletions(-)

Please also backport to CC.

Regards,
Matthias


diff --git a/package/boot/uboot-sunxi/Makefile 
b/package/boot/uboot-sunxi/Makefile
index 14ba922..9032600 100644
--- a/package/boot/uboot-sunxi/Makefile
+++ b/package/boot/uboot-sunxi/Makefile
@@ -6,6 +6,7 @@
 #
 
 include $(TOPDIR)/rules.mk
+include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=u-boot
 PKG_VERSION:=2015.01
@@ -16,7 +17,7 @@ PKG_SOURCE_URL:= \
 
 PKG_MD5SUM:=7f08dc9e98a71652bd696ed6ec95
 
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
+PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
 
 PKG_LICENSE:=GPL-2.0 GPL-2.0+
 PKG_LICENSE_FILES:=Licenses/README
@@ -136,16 +137,16 @@ define Build/Compile
 endef
 
 define Package/uboot/install/default
-   $(INSTALL_DIR) $(BIN_DIR)/uboot-$(BOARD)-$(1)
$(CP) $(PKG_BUILD_DIR)/u-boot.bin \
-   $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.bin
+   $(KERNEL_BUILD_DIR)/uboot-$(BOARD)-$(1)-u-boot.bin
$(CP) $(PKG_BUILD_DIR)/spl/sunxi-spl.bin \
-   $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-spl.bin
+   $(KERNEL_BUILD_DIR)/uboot-$(BOARD)-$(1)-spl.bin
$(CP) $(PKG_BUILD_DIR)/u-boot-sunxi-with-spl.bin \
-   
$(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot-with-spl.bin
+   $(KERNEL_BUILD_DIR)/uboot-$(BOARD)-$(1)-u-boot-with-spl.bin
$(CP) uEnv.txt \
-   $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-uEnv.txt
-   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
+   $(KERNEL_BUILD_DIR)/uboot-$(BOARD)-$(1)-uEnv.txt
+   mkimage -C none -A arm -T script -d 
$(KERNEL_BUILD_DIR)/uboot-$(BOARD)-$(1)-uEnv.txt \
+   $(KERNEL_BUILD_DIR)/uboot-$(BOARD)-$(1)-boot.scr
 endef
 
 define Package/uboot/install/template
diff --git a/target/linux/sunxi/image/Makefile 
b/target/linux/sunxi/image/Makefile
index 6fcd61f..19ab935 100644
--- a/target/linux/sunxi/image/Makefile
+++ b/target/linux/sunxi/image/Makefile
@@ -11,28 +11,12 @@ include $(INCLUDE_DIR)/host.mk
 FAT32_BLOCK_SIZE=1024
 FAT32_BLOCKS=$(shell echo 
$$(($(CONFIG_SUNXI_SD_BOOT_PARTSIZE)*1024*1024/$(FAT32_BLOCK_SIZE
 
-BOARDS:= \
-   sun4i-a10-cubieboard \
-   sun4i-a10-olinuxino-lime \
-   sun4i-a10-pcduino \
-   sun5i-a13-olinuxino \
-   sun6i-a31-colombus \
-   sun6i-a31-m9 \
-   sun7i-a20-bananapi \
-   sun7i-a20-bananapro \
-   sun7i-a20-cubieboard2 \
-   sun7i-a20-cubietruck \
-   sun7i-a20-olinuxino-lime \
-   sun7i-a20-olinuxino-micro \
-   sun7i-a20-pcduino3 \
-   sun7i-a20-lamobo-r1
-
 define Image/BuildKernel
mkimage -A arm -O linux -T kernel -C none \
-a 0x40008000 -e 0x40008000 \
-n 'ARM OpenWrt Linux-$(LINUX_VERSION)' \
-d $(KDIR)/zImage $(BIN_DIR)/$(IMG_PREFIX)-uImage
-   
+
 ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
$(CP) $(KDIR)/zImage-initramfs $(BIN_DIR)/$(IMG_PREFIX)-zImage-initramfs
echo -ne '\x00\x00\x00\x00'  $(BIN_DIR)/$(IMG_PREFIX)-zImage-initramfs
@@ -42,27 +26,23 @@ define Image/BuildKernel
$(BIN_DIR)/$(IMG_PREFIX)-uImage-initramfs \
)
 endif
-
-   $(foreach board,$(BOARDS),
-   $(CP) $(DTS_DIR)/$(board).dtb $(BIN_DIR)/
-   )
 endef
 
 define Image/Build/SDCard
rm -f $(KDIR)/boot.img
mkdosfs $(KDIR)/boot.img -C $(FAT32_BLOCKS)
-   
-   mcopy -i $(KDIR)/boot.img 
$(BIN_DIR)/uboot-sunxi-$(PROFILE)/$(IMG_PREFIX)-$(PROFILE)-boot.scr ::boot.scr
-   mcopy -i $(KDIR)/boot.img $(BIN_DIR)/$(2).dtb ::dtb
+
+   mcopy -i $(KDIR)/boot.img $(KDIR)/uboot-sunxi-$(PROFILE)-boot.scr 
::boot.scr
+   mcopy -i $(KDIR)/boot.img $(DTS_DIR)/$(2).dtb ::dtb
mcopy -i $(KDIR)/boot.img $(BIN_DIR)/$(IMG_PREFIX)-uImage ::uImage
-   
+
./gen_sunxi_sdcard_img.sh \
$(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-sdcard-vfat-$(1).img \
$(KDIR)/boot.img \
$(KDIR)/root.$(1) \
$(CONFIG_SUNXI_SD_BOOT_PARTSIZE) \
$(CONFIG_TARGET_ROOTFS_PARTSIZE) \
-   
$(BIN_DIR)/uboot-sunxi-$(PROFILE)/$(IMG_PREFIX)-$(PROFILE)-u-boot-with-spl.bin
+