From patchwork Fri Jul 27 18:59:15 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 173761 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ozlabs.org (Postfix) with ESMTP id F31962C0080 for ; Sat, 28 Jul 2012 05:00:13 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 44F488D042; Fri, 27 Jul 2012 19:00:01 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2hf347qdv2Qy; Fri, 27 Jul 2012 18:59:55 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 271E98FC18; Fri, 27 Jul 2012 18:59:55 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 42C5C8F791 for ; Fri, 27 Jul 2012 18:59:53 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 6ED1889C39 for ; Fri, 27 Jul 2012 18:59:28 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1AwLg0yiaEhY for ; Fri, 27 Jul 2012 18:59:26 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.free-electrons.com (mail.free-electrons.com [88.190.12.23]) by whitealder.osuosl.org (Postfix) with ESMTP id 7D040889B7 for ; Fri, 27 Jul 2012 18:59:26 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 106) id 787F2176; Fri, 27 Jul 2012 20:59:14 +0200 (CEST) Received: from [192.168.40.179] (unknown [213.74.15.106]) by mail.free-electrons.com (Postfix) with ESMTPSA id 947F7169; Fri, 27 Jul 2012 20:59:06 +0200 (CEST) Message-ID: <5012E503.2070005@free-electrons.com> Date: Fri, 27 Jul 2012 20:59:15 +0200 From: Maxime Ripard User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120714 Thunderbird/14.0 MIME-Version: 1.0 To: Fabio Porcedda References: <1342528042-10038-1-git-send-email-maxime.ripard@free-electrons.com> In-Reply-To: X-Enigmail-Version: 1.5a1pre Cc: buildroot@busybox.net, brian@crystalfontz.com Subject: Re: [Buildroot] [PATCHv3 0/6] Add some support for device tree kernels X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net Hi Fabio, Thanks for the reporting. Le 27/07/2012 18:06, Fabio Porcedda a écrit : > Hi Maxime, > thanks for the work, this feature it's very useful for me, > i tried your patches and i tried to build a kernel for arm, but it > failed to build it, > this is the tail of the output log: > > cat /home/fabiopo/porting-pro3/ge863-pro3-linux-3.6/buildroot-dt/output/build/linux-3.5/arch/arm/boot/zImage > /home/fabiopo/porting-pro3/ge863-pro3-linux-3.6/buildroot-dt/output/build/linux-3.5/arch/arm/boot/"usb_a9260".dtb >> /home/fabiopo/porting-pro3/ge863-pro3-linux-3.6/buildroot-dt/output/build/linux-3.5/arch/arm/boot/zImage_dtb > mv /home/fabiopo/porting-pro3/ge863-pro3-linux-3.6/buildroot-dt/output/build/linux-3.5/arch/arm/boot/zImage_dtb > /home/fabiopo/porting-pro3/ge863-pro3-linux-3.6/buildroot-dt/output/build/linux-3.5/arch/arm/boot/zImage > # We need to generate a new u-boot image that takes into > # account the extra-size added by the device tree at the end > # of the image. To do so, we first need to retrieve both load > # address and entry point for the kernel from the already > # generate uboot image before using mkimage -l. > LOAD=` -l /home/fabiopo/porting-pro3/ge863-pro3-linux-3.6/buildroot-dt/output/build/linux-3.5/arch/arm/boot/uImage > | sed -n 's/Load Address: \([0-9]*\)/\1/p'`; ENTRY=` -l > /home/fabiopo/porting-pro3/ge863-pro3-linux-3.6/buildroot-dt/output/build/linux-3.5/arch/arm/boot/uImage > | sed -n 's/Entry Point: \([0-9]*\)/\1/p'`; -A arm -O linux -T kernel > -C none -a ${LOAD} -e ${ENTRY} -n 'Linux Buildroot' -d > /home/fabiopo/porting-pro3/ge863-pro3-linux-3.6/buildroot-dt/output/build/linux-3.5/arch/arm/boot/zImage > /home/fabiopo/porting-pro3/ge863-pro3-linux-3.6/buildroot-dt/output/build/linux-3.5/arch/arm/boot/uImage > /bin/bash: -l: command not found > /bin/bash: -l: command not found > /bin/bash: -A: command not found > make: *** [/home/fabiopo/porting-pro3/ge863-pro3-linux-3.6/buildroot-dt/output/build/linux-3.5/.stamp_built] > Error 127 > > > I've applied your patches on top of the commit > fd08153b9d677d654add6c580b9ccc5c27d672e2, > > My defconfig is: > BR2_arm=y > BR2_arm926t=y > BR2_TOOLCHAIN_EXTERNAL=y > BR2_LINUX_KERNEL=y > BR2_LINUX_KERNEL_CUSTOM_VERSION=y > BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="3.5" > BR2_LINUX_KERNEL_DEFCONFIG="at91_dt" > BR2_LINUX_KERNEL_INTREE_DTS_NAME="usb_a9260" > BR2_LINUX_KERNEL_APPENDED_UIMAGE=y I have seen no such bugs during my testing, but can you try with the attached patch? I've only discovered this simplification of the code recently and didn't take the time to submit a patch for it, I guess I have the opportunity now :) Thanks, Maxime diff --git a/linux/linux.mk b/linux/linux.mk index dd61a04..047fc4a 100644 --- a/linux/linux.mk +++ b/linux/linux.mk @@ -198,22 +198,14 @@ endif ifeq ($(BR2_LINUX_KERNEL_APPENDED_UIMAGE),y) define LINUX_APPEND_DTB - cat $(KERNEL_ARCH_PATH)/boot/zImage $(KERNEL_ARCH_PATH)/boot/$(KERNEL_DTS_NAME).dtb > $(KERNEL_ARCH_PATH)/boot/zImage_dtb - mv $(KERNEL_ARCH_PATH)/boot/zImage_dtb $(KERNEL_ARCH_PATH)/boot/zImage - # We need to generate a new u-boot image that takes into - # account the extra-size added by the device tree at the end - # of the image. To do so, we first need to retrieve both load - # address and entry point for the kernel from the already - # generate uboot image before using mkimage -l. - LOAD=`$(MKIMAGE) -l $(LINUX_IMAGE_PATH) | sed -n 's/Load Address: \([0-9]*\)/\1/p'`; \ - ENTRY=`$(MKIMAGE) -l $(LINUX_IMAGE_PATH) | sed -n 's/Entry Point: \([0-9]*\)/\1/p'`; \ - $(MKIMAGE) -A $(KERNEL_ARCH) -O linux -T kernel -C none -a $${LOAD} -e $${ENTRY} -n 'Linux Buildroot' \ - -d $(KERNEL_ARCH_PATH)/boot/zImage $(KERNEL_ARCH_PATH)/boot/$(LINUX_IMAGE_NAME) + cat $(KERNEL_ARCH_PATH)/boot/$(KERNEL_DTS_NAME).dtb >> $(KERNEL_ARCH_PATH)/boot/zImage + # We need to generate the uImage here after that so that the uImage is + # generated with the right image size. + $(TARGET_MAKE_ENV) $(MAKE) $(LINUX_MAKE_FLAGS) -C $(@D) uImage endef else ifeq ($(BR2_LINUX_KERNEL_APPENDED_ZIMAGE),y) define LINUX_APPEND_DTB - cat $(KERNEL_ARCH_PATH)/boot/zImage $(KERNEL_ARCH_PATH)/boot/$(KERNEL_DTS_NAME).dtb > $(KERNEL_ARCH_PATH)/boot/zImage_dtb - mv $(KERNEL_ARCH_PATH)/boot/zImage_dtb $(KERNEL_ARCH_PATH)/boot/zImage + cat $(KERNEL_ARCH_PATH)/boot/$(KERNEL_DTS_NAME).dtb >> $(KERNEL_ARCH_PATH)/boot/zImage endef endif