All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: Laszlo Ersek <lersek@redhat.com>,
	kraxel@redhat.com, mst@redhat.com, Eric Blake <eblake@redhat.com>
Cc: berrange@redhat.com, imammedo@redhat.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 07/10] roms: build edk2 firmware binaries and variable store templates
Date: Sun, 10 Mar 2019 16:10:27 +0100	[thread overview]
Message-ID: <f218fbf9-12c6-96a0-09e7-c496388728a5@redhat.com> (raw)
In-Reply-To: <137d7a76-5d69-6b8c-a048-c296849fec9e@redhat.com>

Hi Laszlo,

On 3/9/19 5:48 PM, Philippe Mathieu-Daudé wrote:
> On 3/9/19 1:48 AM, Laszlo Ersek wrote:
>> Add the "efi" target to "Makefile".
>>
>> Introduce "Makefile.edk2" for building and cleaning the firmware images
>> and varstore templates.
>>
>> Collect the common bits from the recipes in the helper script
>> "edk2-build.sh".
>>
>> Signed-off-by: Laszlo Ersek <lersek@redhat.com>
>> ---
>>  roms/Makefile      |   5 +
>>  roms/Makefile.edk2 | 138 ++++++++++++++++++++
>>  roms/edk2-build.sh |  55 ++++++++
>>  3 files changed, 198 insertions(+)
>>
>> diff --git a/roms/Makefile b/roms/Makefile
>> index 2e83ececa25a..054b432834ba 100644
>> --- a/roms/Makefile
>> +++ b/roms/Makefile
>> @@ -61,6 +61,7 @@ default:
>>  	@echo "  skiboot        -- update skiboot.lid"
>>  	@echo "  u-boot.e500    -- update u-boot.e500"
>>  	@echo "  u-boot.sam460  -- update u-boot.sam460"
>> +	@echo "  efi            -- update UEFI (edk2) platform firmware"
>>  
>>  bios: build-seabios-config-seabios-128k build-seabios-config-seabios-256k
>>  	cp seabios/builds/seabios-128k/bios.bin ../pc-bios/bios.bin
>> @@ -143,6 +144,9 @@ skiboot:
>>  	$(MAKE) -C skiboot CROSS=$(powerpc64_cross_prefix)
>>  	cp skiboot/skiboot.lid ../pc-bios/skiboot.lid
>>  
>> +efi: edk2-basetools
>> +	$(MAKE) -f Makefile.edk2
>> +
>>  clean:
>>  	rm -rf seabios/.config seabios/out seabios/builds
>>  	$(MAKE) -C sgabios clean
>> @@ -153,3 +157,4 @@ clean:
>>  	rm -rf u-boot/build.e500
>>  	$(MAKE) -C u-boot-sam460ex distclean
>>  	$(MAKE) -C skiboot clean
>> +	$(MAKE) -f Makefile.edk2 clean
>> diff --git a/roms/Makefile.edk2 b/roms/Makefile.edk2
>> new file mode 100644
>> index 000000000000..ad6fff044cd6
>> --- /dev/null
>> +++ b/roms/Makefile.edk2
>> @@ -0,0 +1,138 @@
>> +# Makefile for building firmware binaries and variable store templates for a
>> +# number of virtual platforms in edk2.
>> +#
>> +# Copyright (C) 2019, Red Hat, Inc.
>> +#
>> +# This program and the accompanying materials are licensed and made available
>> +# under the terms and conditions of the BSD License that accompanies this
>> +# distribution. The full text of the license may be found at
>> +# <http://opensource.org/licenses/bsd-license.php>.
>> +#
>> +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT
>> +# WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
>> +
>> +toolchain = $(shell source ./edk2-funcs.sh && qemu_edk2_get_toolchain $(1))

Well I finally figured out why building on Ubuntu fails. It default
shell is dash, and 'source' is a bash builtin command. The portable
equivalent is '.' (dot).

The fix is:

-- >8 --
-toolchain = $(shell source ./edk2-funcs.sh && qemu_edk2_get_toolchain $(1))
+toolchain = $(shell . ./edk2-funcs.sh && qemu_edk2_get_toolchain $(1))
---

With this hunk:
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>

>> +
>> +licenses := \
>> +	edk2/License.txt \
>> +	edk2/OvmfPkg/License.txt \
>> +	edk2/CryptoPkg/Library/OpensslLib/openssl/LICENSE
>> +
>> +# The "edk2-arm-vars.fd" varstore template is suitable for aarch64 as well.
>> +# Similarly, the "edk2-i386-vars.fd" varstore template is suitable for x86_64
>> +# as well, independently of "secure" too.
>> +all: \
>> +	../pc-bios/edk2-aarch64-code.fd \
>> +	../pc-bios/edk2-arm-code.fd \
>> +	../pc-bios/edk2-i386-code.fd \
>> +	../pc-bios/edk2-i386-secure-code.fd \
>> +	../pc-bios/edk2-x86_64-code.fd \
>> +	../pc-bios/edk2-x86_64-secure-code.fd \
>> +	\
>> +	../pc-bios/edk2-arm-vars.fd \
>> +	../pc-bios/edk2-i386-vars.fd \
>> +	\
>> +	../pc-bios/edk2-licenses.txt
>> +
>> +submodules:
>> +	cd edk2 && git submodule update --init --force
>> +
>> +# See notes on the ".NOTPARALLEL" target and the "+" indicator in
>> +# "tests/uefi-test-tools/Makefile".
>> +.NOTPARALLEL:
>> +
>> +../pc-bios/edk2-aarch64-code.fd: submodules
>> +	+./edk2-build.sh \
>> +		aarch64 \
>> +		--arch=AARCH64 \
>> +		--platform=ArmVirtPkg/ArmVirtQemu.dsc \
>> +		-D NETWORK_IP6_ENABLE \
>> +		-D HTTP_BOOT_ENABLE
>> +	cp edk2/Build/ArmVirtQemu-AARCH64/DEBUG_$(call toolchain,aarch64)/FV/QEMU_EFI.fd \
>> +		$@
>> +	truncate --size=64M $@
> [...]
> 
> Trying on Ubuntu I get:
> 
> $ make -C roms efi
> [...]
> Fd File Name:QEMU_EFI
> (/home/phil/source/qemu/roms/edk2/Build/ArmVirtQemu-AARCH64/DEBUG_GCC5/FV/QEMU_EFI.fd)
> Fd File Name:QEMU_VARS
> (/home/phil/source/qemu/roms/edk2/Build/ArmVirtQemu-AARCH64/DEBUG_GCC5/FV/QEMU_VARS.fd)
> GUID cross reference file can be found at
> /home/phil/source/qemu/roms/edk2/Build/ArmVirtQemu-AARCH64/DEBUG_GCC5/FV/Guid.xref
> - Done -
> Build end time: 16:33:29, Mar.09 2019
> Build total time: 00:03:35
> cp edk2/Build/ArmVirtQemu-AARCH64/DEBUG_/FV/QEMU_EFI.fd \
> 	../pc-bios/edk2-aarch64-code.fd
> cp: cannot stat 'edk2/Build/ArmVirtQemu-AARCH64/DEBUG_/FV/QEMU_EFI.fd':
> No such file or directory
> Makefile.edk2:45: recipe for target '../pc-bios/edk2-aarch64-code.fd' failed
> make[1]: *** [../pc-bios/edk2-aarch64-code.fd] Error 1
> make[1]: Leaving directory '/home/phil/source/qemu/roms'
> Makefile:148: recipe for target 'efi' failed
> make: *** [efi] Error 2
> make: Leaving directory '/home/phil/source/qemu/roms'
> 
> The edk2-build.sh script source edksetup.sh, then you call the
> 'toolchain' command out of the edk2-build.sh script, but here
> the edksetup.sh setup is no more effective.

I was wrong, it is sourced. See self-reply at top of this post.

Regards,

Phil.

  reply	other threads:[~2019-03-10 15:10 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-09  0:48 [Qemu-devel] [PATCH 00/10] bundle edk2 platform firmware with QEMU Laszlo Ersek
2019-03-09  0:48 ` [Qemu-devel] [PATCH 01/10] roms: lift "edk2-funcs.sh" from "tests/uefi-test-tools/build.sh" Laszlo Ersek
2019-03-10 15:17   ` Philippe Mathieu-Daudé
2019-03-10 17:23     ` Philippe Mathieu-Daudé
2019-03-11 12:07   ` Eric Blake
2019-03-11 12:11     ` Eric Blake
2019-03-09  0:48 ` [Qemu-devel] [PATCH 02/10] roms/edk2-funcs.sh: require gcc-4.8+ for building i386 and x86_64 Laszlo Ersek
2019-03-10 15:11   ` Philippe Mathieu-Daudé
2019-03-09  0:48 ` [Qemu-devel] [PATCH 03/10] tests/uefi-test-tools/build.sh: work around TianoCore#1607 Laszlo Ersek
2019-03-09  0:48 ` [Qemu-devel] [PATCH 04/10] roms/edk2: advance to tag edk2-stable201903 Laszlo Ersek
2019-03-10 22:10   ` Philippe Mathieu-Daudé
2019-03-09  0:48 ` [Qemu-devel] [PATCH 05/10] roms/edk2-funcs.sh: add the qemu_edk2_get_thread_count() function Laszlo Ersek
2019-03-10 15:13   ` Philippe Mathieu-Daudé
2019-03-09  0:48 ` [Qemu-devel] [PATCH 06/10] roms/Makefile: replace the $(EFIROM) target with "edk2-basetools" Laszlo Ersek
2019-03-09  1:32   ` Philippe Mathieu-Daudé
2019-03-09  1:53     ` Philippe Mathieu-Daudé
2019-03-10 15:16       ` Philippe Mathieu-Daudé
2019-03-09  0:48 ` [Qemu-devel] [PATCH 07/10] roms: build edk2 firmware binaries and variable store templates Laszlo Ersek
2019-03-09 16:48   ` Philippe Mathieu-Daudé
2019-03-10 15:10     ` Philippe Mathieu-Daudé [this message]
2019-03-11 12:09       ` Eric Blake
2019-03-10 11:26   ` Philippe Mathieu-Daudé
2019-03-09  0:48 ` [Qemu-devel] [PATCH 08/10] pc-bios: add " Laszlo Ersek
2019-03-09  0:48 ` [Qemu-devel] [PATCH 09/10] pc-bios: document the edk2 firmware images; add firmware descriptors Laszlo Ersek
2019-03-09  0:48 ` [Qemu-devel] [PATCH 10/10] Makefile: install the edk2 firmware images and their descriptors Laszlo Ersek
2019-03-09  1:20 ` [Qemu-devel] [PATCH 00/10] bundle edk2 platform firmware with QEMU Philippe Mathieu-Daudé
2019-03-11 10:28   ` Daniel P. Berrangé
2019-03-11 12:57     ` Michael S. Tsirkin
2019-03-11 13:00       ` Daniel P. Berrangé
2019-03-11 13:04         ` Michael S. Tsirkin
2019-03-11 13:15       ` Philippe Mathieu-Daudé
2019-03-09 13:10 ` Michal Prívozník
2019-03-11 10:23   ` Daniel P. Berrangé
2019-03-10  3:56 ` Michael S. Tsirkin
2019-03-10 11:21   ` Philippe Mathieu-Daudé
2019-03-11 10:35     ` Daniel P. Berrangé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f218fbf9-12c6-96a0-09e7-c496388728a5@redhat.com \
    --to=philmd@redhat.com \
    --cc=berrange@redhat.com \
    --cc=eblake@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=lersek@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.