diff mbox series

[U-Boot,1/1] Dockerfile: build GRUB UEFI targets

Message ID 20190727084337.1739-1-xypron.glpk@gmx.de
State Accepted
Delegated to: Tom Rini
Headers show
Series [U-Boot,1/1] Dockerfile: build GRUB UEFI targets | expand

Commit Message

Heinrich Schuchardt July 27, 2019, 8:43 a.m. UTC
Build GRUB UEFI targets grubarm.efi and grubaa64.efi. These are needed for
running test_efi_grub_net().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
This patch applies to
https://gitlab.denx.de/u-boot/gitlab-ci-runner
---
 Dockerfile | 39 ++++++++++++++++++++++++++++++++++++++-
 1 file changed, 38 insertions(+), 1 deletion(-)

--
2.20.1

Comments

Bin Meng July 27, 2019, 2:11 p.m. UTC | #1
On Sat, Jul 27, 2019 at 4:43 PM Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
>
> Build GRUB UEFI targets grubarm.efi and grubaa64.efi. These are needed for
> running test_efi_grub_net().
>
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---
> This patch applies to
> https://gitlab.denx.de/u-boot/gitlab-ci-runner
> ---
>  Dockerfile | 39 ++++++++++++++++++++++++++++++++++++++-
>  1 file changed, 38 insertions(+), 1 deletion(-)
>
> diff --git a/Dockerfile b/Dockerfile
> index e8468ce..23d4042 100644
> --- a/Dockerfile
> +++ b/Dockerfile
> @@ -31,8 +31,10 @@ RUN wget -O - https://github.com/foss-xtensa/toolchain/releases/download/2018.02
>  RUN wget -O - https://github.com/foss-for-synopsys-dwc-arc-processors/toolchain/releases/download/arc-2018.09-release/arc_gnu_2018.09_prebuilt_uclibc_le_archs_linux_install.tar.gz | tar -C /opt -xz
>  RUN wget -O - https://github.com/vincentzwc/prebuilt-nds32-toolchain/releases/download/20180521/nds32le-linux-glibc-v3-upstream.tar.gz | tar -C /opt -xz
>
> -# Updat and install things from apt now
> +# Update and install things from apt now
>  RUN apt-get update && apt-get install -y \
> +       automake \
> +       autopoint \
>         bc \
>         bison \
>         build-essential \
> @@ -77,6 +79,41 @@ RUN apt-get update && apt-get install -y \
>         zip \
>         && rm -rf /var/lib/apt/lists/*
>
> +# Build GRUB UEFI targets grubarm.efi and grubaa64.efi
> +RUN git clone git://git.savannah.gnu.org/grub.git /tmp/grub && \
> +       cd /tmp/grub && \
> +       git checkout grub-2.04 && \
> +       ./bootstrap && \
> +       mkdir -p /opt/grub && \
> +       ./configure --target=aarch64 --with-platform=efi \
> +       CC=gcc \
> +       TARGET_CC=/opt/gcc-7.3.0-nolibc/aarch64-linux/bin/aarch64-linux-gcc \
> +       TARGET_OBJCOPY=/opt/gcc-7.3.0-nolibc/aarch64-linux/bin/aarch64-linux-objcopy \
> +       TARGET_STRIP=/opt/gcc-7.3.0-nolibc/aarch64-linux/bin/aarch64-linux-strip \
> +       TARGET_NM=/opt/gcc-7.3.0-nolibc/aarch64-linux/bin/aarch64-linux-nm \
> +       TARGET_RANLIB=/opt/gcc-7.3.0-nolibc/aarch64-linux/bin/aarch64-linux-ranlib && \
> +       make && \
> +       ./grub-mkimage -O arm64-efi -o /opt/grub/grubaa64.efi --prefix= -d \

Use grub-mkstandalone to simplify the command a little bit?

> +       grub-core cat chain configfile echo efinet ext2 fat halt help linux \
> +       lsefisystab loadenv lvm minicmd normal part_msdos part_gpt reboot \
> +       search search_fs_file search_fs_uuid search_label serial sleep test \
> +       true && \
> +       make clean && \
> +       ./configure --target=arm --with-platform=efi \
> +       CC=gcc \
> +       TARGET_CC=/opt/gcc-7.3.0-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi-gcc \
> +       TARGET_OBJCOPY=/opt/gcc-7.3.0-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi-objcopy \
> +       TARGET_STRIP=/opt/gcc-7.3.0-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi-strip \
> +       TARGET_NM=/opt/gcc-7.3.0-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi-nm \
> +       TARGET_RANLIB=/opt/gcc-7.3.0-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi-ranlib && \
> +       make && \
> +       ./grub-mkimage -O arm-efi -o /opt/grub/grubarm.efi --prefix= -d \
> +       grub-core cat chain configfile echo efinet ext2 fat halt help linux \
> +       lsefisystab loadenv lvm minicmd normal part_msdos part_gpt reboot \
> +       search search_fs_file search_fs_uuid search_label serial sleep test \
> +       true && \
> +       rm -rf /tmp/grub
> +
>  RUN git clone git://git.qemu.org/qemu.git /tmp/qemu && \
>         cd /tmp/qemu && \
>         git submodule update --init dtc && \

Regards,
Bin
Heinrich Schuchardt July 27, 2019, 2:58 p.m. UTC | #2
On 7/27/19 4:11 PM, Bin Meng wrote:
> On Sat, Jul 27, 2019 at 4:43 PM Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
>>
>> Build GRUB UEFI targets grubarm.efi and grubaa64.efi. These are needed for
>> running test_efi_grub_net().
>>
>> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
>> ---
>> This patch applies to
>> https://gitlab.denx.de/u-boot/gitlab-ci-runner
>> ---
>>  Dockerfile | 39 ++++++++++++++++++++++++++++++++++++++-
>>  1 file changed, 38 insertions(+), 1 deletion(-)
>>
>> diff --git a/Dockerfile b/Dockerfile
>> index e8468ce..23d4042 100644
>> --- a/Dockerfile
>> +++ b/Dockerfile
>> @@ -31,8 +31,10 @@ RUN wget -O - https://github.com/foss-xtensa/toolchain/releases/download/2018.02
>>  RUN wget -O - https://github.com/foss-for-synopsys-dwc-arc-processors/toolchain/releases/download/arc-2018.09-release/arc_gnu_2018.09_prebuilt_uclibc_le_archs_linux_install.tar.gz | tar -C /opt -xz
>>  RUN wget -O - https://github.com/vincentzwc/prebuilt-nds32-toolchain/releases/download/20180521/nds32le-linux-glibc-v3-upstream.tar.gz | tar -C /opt -xz
>>
>> -# Updat and install things from apt now
>> +# Update and install things from apt now
>>  RUN apt-get update && apt-get install -y \
>> +       automake \
>> +       autopoint \
>>         bc \
>>         bison \
>>         build-essential \
>> @@ -77,6 +79,41 @@ RUN apt-get update && apt-get install -y \
>>         zip \
>>         && rm -rf /var/lib/apt/lists/*
>>
>> +# Build GRUB UEFI targets grubarm.efi and grubaa64.efi
>> +RUN git clone git://git.savannah.gnu.org/grub.git /tmp/grub && \
>> +       cd /tmp/grub && \
>> +       git checkout grub-2.04 && \
>> +       ./bootstrap && \
>> +       mkdir -p /opt/grub && \
>> +       ./configure --target=aarch64 --with-platform=efi \
>> +       CC=gcc \
>> +       TARGET_CC=/opt/gcc-7.3.0-nolibc/aarch64-linux/bin/aarch64-linux-gcc \
>> +       TARGET_OBJCOPY=/opt/gcc-7.3.0-nolibc/aarch64-linux/bin/aarch64-linux-objcopy \
>> +       TARGET_STRIP=/opt/gcc-7.3.0-nolibc/aarch64-linux/bin/aarch64-linux-strip \
>> +       TARGET_NM=/opt/gcc-7.3.0-nolibc/aarch64-linux/bin/aarch64-linux-nm \
>> +       TARGET_RANLIB=/opt/gcc-7.3.0-nolibc/aarch64-linux/bin/aarch64-linux-ranlib && \
>> +       make && \
>> +       ./grub-mkimage -O arm64-efi -o /opt/grub/grubaa64.efi --prefix= -d \
>
> Use grub-mkstandalone to simplify the command a little bit?

grub-mkstandalone generates a standalone image containing all modules.
The selected modules are enough to test what U-Boot is offering.

Best regards

Heinrich

>
>> +       grub-core cat chain configfile echo efinet ext2 fat halt help linux \
>> +       lsefisystab loadenv lvm minicmd normal part_msdos part_gpt reboot \
>> +       search search_fs_file search_fs_uuid search_label serial sleep test \
>> +       true && \
>> +       make clean && \
>> +       ./configure --target=arm --with-platform=efi \
>> +       CC=gcc \
>> +       TARGET_CC=/opt/gcc-7.3.0-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi-gcc \
>> +       TARGET_OBJCOPY=/opt/gcc-7.3.0-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi-objcopy \
>> +       TARGET_STRIP=/opt/gcc-7.3.0-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi-strip \
>> +       TARGET_NM=/opt/gcc-7.3.0-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi-nm \
>> +       TARGET_RANLIB=/opt/gcc-7.3.0-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi-ranlib && \
>> +       make && \
>> +       ./grub-mkimage -O arm-efi -o /opt/grub/grubarm.efi --prefix= -d \
>> +       grub-core cat chain configfile echo efinet ext2 fat halt help linux \
>> +       lsefisystab loadenv lvm minicmd normal part_msdos part_gpt reboot \
>> +       search search_fs_file search_fs_uuid search_label serial sleep test \
>> +       true && \
>> +       rm -rf /tmp/grub
>> +
>>  RUN git clone git://git.qemu.org/qemu.git /tmp/qemu && \
>>         cd /tmp/qemu && \
>>         git submodule update --init dtc && \
>
> Regards,
> Bin
>
Tom Rini July 29, 2019, 1:07 p.m. UTC | #3
On Sat, Jul 27, 2019 at 10:43:37AM +0200, Heinrich Schuchardt wrote:

> Build GRUB UEFI targets grubarm.efi and grubaa64.efi. These are needed for
> running test_efi_grub_net().
> 
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

Next step, update the CI hook scripts to use these files, and copy them
in the .gitlab-ci.yml file.  Stephen has moved these to the DENX GitLab
as well, btw.

Applied to u-boot-gitlab-ci-runner/master, thanks!
Heinrich Schuchardt July 29, 2019, 6:04 p.m. UTC | #4
On 7/29/19 3:07 PM, Tom Rini wrote:
> On Sat, Jul 27, 2019 at 10:43:37AM +0200, Heinrich Schuchardt wrote:
>
>> Build GRUB UEFI targets grubarm.efi and grubaa64.efi. These are needed for
>> running test_efi_grub_net().
>>
>> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
>
> Next step, update the CI hook scripts to use these files, and copy them
> in the .gitlab-ci.yml file.  Stephen has moved these to the DENX GitLab
> as well, btw.

I guess you refer to https://gitlab.denx.de/u-boot/u-boot-test-hooks.

I think we have to keep Travis CI alive for developers who can not run
anything on GitLab. So will
https://gitlab.denx.de/u-boot/u-boot-test-hooks and
https://github.com/swarren/uboot-test-hooks.git now diverge?

A better idea would be to let .gitlab-ci.yml and .travis.yml use the
same Dockerimage.

We simply have to push our docker image to Dockerhub.

Usage of Docker images with Travis CI is described here:
https://docs.travis-ci.com/user/docker/

Best Regards

Heinrich
Tom Rini July 29, 2019, 11:05 p.m. UTC | #5
On Mon, Jul 29, 2019 at 08:04:15PM +0200, Heinrich Schuchardt wrote:
> On 7/29/19 3:07 PM, Tom Rini wrote:
> >On Sat, Jul 27, 2019 at 10:43:37AM +0200, Heinrich Schuchardt wrote:
> >
> >>Build GRUB UEFI targets grubarm.efi and grubaa64.efi. These are needed for
> >>running test_efi_grub_net().
> >>
> >>Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> >
> >Next step, update the CI hook scripts to use these files, and copy them
> >in the .gitlab-ci.yml file.  Stephen has moved these to the DENX GitLab
> >as well, btw.
> 
> I guess you refer to https://gitlab.denx.de/u-boot/u-boot-test-hooks.
> 
> I think we have to keep Travis CI alive for developers who can not run
> anything on GitLab. So will
> https://gitlab.denx.de/u-boot/u-boot-test-hooks and
> https://github.com/swarren/uboot-test-hooks.git now diverge?

The intention is to leverage our new gitlab instance to make it easier
to find the related parts of the overall project.  Stephen owns the
gitlab repository and I think he intends long term to have his github
one become just a personal repo.  Travis (and GitLab) should get
migrated.

> A better idea would be to let .gitlab-ci.yml and .travis.yml use the
> same Dockerimage.
> 
> We simply have to push our docker image to Dockerhub.
> 
> Usage of Docker images with Travis CI is described here:
> https://docs.travis-ci.com/user/docker/

So, I personally would like to phase out Travis as it's both a bit of a
maintenance burden and the network failures are annoying.  But, it's
good to know that Travis can use a custom Docker image.  We currently
publish the runner image so moving the travis job to use that instead
would be good and I'd appreciate patches.
diff mbox series

Patch

diff --git a/Dockerfile b/Dockerfile
index e8468ce..23d4042 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -31,8 +31,10 @@  RUN wget -O - https://github.com/foss-xtensa/toolchain/releases/download/2018.02
 RUN wget -O - https://github.com/foss-for-synopsys-dwc-arc-processors/toolchain/releases/download/arc-2018.09-release/arc_gnu_2018.09_prebuilt_uclibc_le_archs_linux_install.tar.gz | tar -C /opt -xz
 RUN wget -O - https://github.com/vincentzwc/prebuilt-nds32-toolchain/releases/download/20180521/nds32le-linux-glibc-v3-upstream.tar.gz | tar -C /opt -xz

-# Updat and install things from apt now
+# Update and install things from apt now
 RUN apt-get update && apt-get install -y \
+	automake \
+	autopoint \
 	bc \
 	bison \
 	build-essential \
@@ -77,6 +79,41 @@  RUN apt-get update && apt-get install -y \
 	zip \
 	&& rm -rf /var/lib/apt/lists/*

+# Build GRUB UEFI targets grubarm.efi and grubaa64.efi
+RUN git clone git://git.savannah.gnu.org/grub.git /tmp/grub && \
+	cd /tmp/grub && \
+	git checkout grub-2.04 && \
+	./bootstrap && \
+	mkdir -p /opt/grub && \
+	./configure --target=aarch64 --with-platform=efi \
+	CC=gcc \
+	TARGET_CC=/opt/gcc-7.3.0-nolibc/aarch64-linux/bin/aarch64-linux-gcc \
+	TARGET_OBJCOPY=/opt/gcc-7.3.0-nolibc/aarch64-linux/bin/aarch64-linux-objcopy \
+	TARGET_STRIP=/opt/gcc-7.3.0-nolibc/aarch64-linux/bin/aarch64-linux-strip \
+	TARGET_NM=/opt/gcc-7.3.0-nolibc/aarch64-linux/bin/aarch64-linux-nm \
+	TARGET_RANLIB=/opt/gcc-7.3.0-nolibc/aarch64-linux/bin/aarch64-linux-ranlib && \
+	make && \
+	./grub-mkimage -O arm64-efi -o /opt/grub/grubaa64.efi --prefix= -d \
+	grub-core cat chain configfile echo efinet ext2 fat halt help linux \
+	lsefisystab loadenv lvm minicmd normal part_msdos part_gpt reboot \
+	search search_fs_file search_fs_uuid search_label serial sleep test \
+	true && \
+	make clean && \
+	./configure --target=arm --with-platform=efi \
+	CC=gcc \
+	TARGET_CC=/opt/gcc-7.3.0-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi-gcc \
+	TARGET_OBJCOPY=/opt/gcc-7.3.0-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi-objcopy \
+	TARGET_STRIP=/opt/gcc-7.3.0-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi-strip \
+	TARGET_NM=/opt/gcc-7.3.0-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi-nm \
+	TARGET_RANLIB=/opt/gcc-7.3.0-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi-ranlib && \
+	make && \
+	./grub-mkimage -O arm-efi -o /opt/grub/grubarm.efi --prefix= -d \
+	grub-core cat chain configfile echo efinet ext2 fat halt help linux \
+	lsefisystab loadenv lvm minicmd normal part_msdos part_gpt reboot \
+	search search_fs_file search_fs_uuid search_label serial sleep test \
+	true && \
+	rm -rf /tmp/grub
+
 RUN git clone git://git.qemu.org/qemu.git /tmp/qemu && \
 	cd /tmp/qemu && \
 	git submodule update --init dtc && \