Update Buildroot to 2019.02.3 (#415)
* Update Buildroot to 2019-02.3 * Fix enter script * Update ova_defconfig * Fix network manager * Remove runc patches * Use same docker version * Fix build * Fix vmtools * Fix depens * Fix handling with tempfiles * Fix permission handling * Fix cp * Cleanup * Fix mounts
This commit is contained in:
@@ -15,6 +15,7 @@ source "boot/mv-ddr-marvell/Config.in"
|
||||
source "boot/mxs-bootlets/Config.in"
|
||||
source "boot/riscv-pk/Config.in"
|
||||
source "boot/s500-bootloader/Config.in"
|
||||
source "boot/shim/Config.in"
|
||||
source "boot/syslinux/Config.in"
|
||||
source "boot/ts4800-mbrboot/Config.in"
|
||||
source "boot/uboot/Config.in"
|
||||
|
||||
@@ -6,13 +6,15 @@
|
||||
|
||||
AFBOOT_STM32_VERSION = v0.1
|
||||
AFBOOT_STM32_SITE = $(call github,mcoquelin-stm32,afboot-stm32,$(AFBOOT_STM32_VERSION))
|
||||
AFBOOT_STM32_INSTALL_IMAGES = YES
|
||||
AFBOOT_STM32_INSTALL_TARGET = NO
|
||||
|
||||
define AFBOOT_STM32_BUILD_CMDS
|
||||
$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) CROSS_COMPILE=$(TARGET_CROSS) all
|
||||
endef
|
||||
|
||||
define AFBOOT_STM32_INSTALL_TARGET_CMDS
|
||||
$(INSTALL) -m 0755 $(@D)/stm32*.bin $(BINARIES_DIR)
|
||||
define AFBOOT_STM32_INSTALL_IMAGES_CMDS
|
||||
$(INSTALL) -m 0755 -t $(BINARIES_DIR) -D $(@D)/stm32*.bin
|
||||
endef
|
||||
|
||||
$(eval $(generic-package))
|
||||
|
||||
@@ -16,6 +16,11 @@ choice
|
||||
config BR2_TARGET_ARM_TRUSTED_FIRMWARE_LATEST_VERSION
|
||||
bool "v1.4"
|
||||
|
||||
config BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION
|
||||
bool "Custom version"
|
||||
help
|
||||
This option allows to use a specific official versions
|
||||
|
||||
config BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_TARBALL
|
||||
bool "Custom tarball"
|
||||
|
||||
@@ -31,12 +36,18 @@ config BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_TARBALL_LOCATION
|
||||
|
||||
endif
|
||||
|
||||
config BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION_VALUE
|
||||
string "ATF version"
|
||||
depends on BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION
|
||||
|
||||
config BR2_TARGET_ARM_TRUSTED_FIRMWARE_VERSION
|
||||
string
|
||||
default "v1.4" if BR2_TARGET_ARM_TRUSTED_FIRMWARE_LATEST_VERSION
|
||||
default "custom" if BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_TARBALL
|
||||
default BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_REPO_VERSION \
|
||||
if BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_GIT
|
||||
default BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION_VALUE \
|
||||
if BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION
|
||||
|
||||
if BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_GIT
|
||||
|
||||
|
||||
@@ -13,15 +13,18 @@ ifeq ($(ARM_TRUSTED_FIRMWARE_VERSION),custom)
|
||||
ARM_TRUSTED_FIRMWARE_TARBALL = $(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_TARBALL_LOCATION))
|
||||
ARM_TRUSTED_FIRMWARE_SITE = $(patsubst %/,%,$(dir $(ARM_TRUSTED_FIRMWARE_TARBALL)))
|
||||
ARM_TRUSTED_FIRMWARE_SOURCE = $(notdir $(ARM_TRUSTED_FIRMWARE_TARBALL))
|
||||
BR_NO_CHECK_HASH_FOR += $(ARM_TRUSTED_FIRMWARE_SOURCE)
|
||||
else ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_GIT),y)
|
||||
ARM_TRUSTED_FIRMWARE_SITE = $(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_REPO_URL))
|
||||
ARM_TRUSTED_FIRMWARE_SITE_METHOD = git
|
||||
BR_NO_CHECK_HASH_FOR += $(ARM_TRUSTED_FIRMWARE_SOURCE)
|
||||
else
|
||||
# Handle stable official ATF versions
|
||||
ARM_TRUSTED_FIRMWARE_SITE = $(call github,ARM-software,arm-trusted-firmware,$(ARM_TRUSTED_FIRMWARE_VERSION))
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE)$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_LATEST_VERSION),y)
|
||||
BR_NO_CHECK_HASH_FOR += $(ARM_TRUSTED_FIRMWARE_SOURCE)
|
||||
endif
|
||||
|
||||
ARM_TRUSTED_FIRMWARE_INSTALL_IMAGES = YES
|
||||
|
||||
ARM_TRUSTED_FIRMWARE_PLATFORM = $(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM))
|
||||
@@ -94,6 +97,13 @@ ARM_TRUSTED_FIRMWARE_MAKE_OPTS += RESET_TO_BL31=1
|
||||
ARM_TRUSTED_FIRMWARE_DEPENDENCIES += host-uboot-tools
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_TARGET_UBOOT_NEEDS_ATF_BL31_ELF),y)
|
||||
define ARM_TRUSTED_FIRMWARE_BL31_UBOOT_INSTALL_ELF
|
||||
$(INSTALL) -D -m 0644 $(ARM_TRUSTED_FIRMWARE_IMG_DIR)/bl31/bl31.elf \
|
||||
$(BINARIES_DIR)/bl31.elf
|
||||
endef
|
||||
endif
|
||||
|
||||
define ARM_TRUSTED_FIRMWARE_BUILD_CMDS
|
||||
$(ARM_TRUSTED_FIRMWARE_BUILD_FIPTOOL)
|
||||
$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) $(ARM_TRUSTED_FIRMWARE_MAKE_OPTS) \
|
||||
@@ -104,6 +114,7 @@ endef
|
||||
define ARM_TRUSTED_FIRMWARE_INSTALL_IMAGES_CMDS
|
||||
cp -dpf $(ARM_TRUSTED_FIRMWARE_IMG_DIR)/*.bin $(BINARIES_DIR)/
|
||||
$(ARM_TRUSTED_FIRMWARE_BL31_UBOOT_INSTALL)
|
||||
$(ARM_TRUSTED_FIRMWARE_BL31_UBOOT_INSTALL_ELF)
|
||||
endef
|
||||
|
||||
# Configuration check
|
||||
|
||||
@@ -12,7 +12,7 @@ choice
|
||||
Select the specific Barebox version you want to use
|
||||
|
||||
config BR2_TARGET_BAREBOX_LATEST_VERSION
|
||||
bool "2018.10.0"
|
||||
bool "2018.12.0"
|
||||
|
||||
config BR2_TARGET_BAREBOX_CUSTOM_VERSION
|
||||
bool "Custom version"
|
||||
@@ -40,7 +40,7 @@ endif
|
||||
|
||||
config BR2_TARGET_BAREBOX_VERSION
|
||||
string
|
||||
default "2018.10.0" if BR2_TARGET_BAREBOX_LATEST_VERSION
|
||||
default "2018.12.0" if BR2_TARGET_BAREBOX_LATEST_VERSION
|
||||
default BR2_TARGET_BAREBOX_CUSTOM_VERSION_VALUE if BR2_TARGET_BAREBOX_CUSTOM_VERSION
|
||||
default "custom" if BR2_TARGET_BAREBOX_CUSTOM_TARBALL
|
||||
default BR2_TARGET_BAREBOX_CUSTOM_GIT_VERSION if BR2_TARGET_BAREBOX_CUSTOM_GIT
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# http://www.barebox.org/download/barebox-2018.10.0.tar.bz2.md5
|
||||
md5 f4c89bc92903425c960aa41e997b2251 barebox-2018.10.0.tar.bz2
|
||||
# From https://www.barebox.org/download/barebox-2018.12.0.tar.bz2.md5
|
||||
md5 f84d7d3562055c80c3eedce0b14d4a0d barebox-2018.12.0.tar.bz2
|
||||
|
||||
# Locally calculated
|
||||
sha256 c25bfeaff7dda8862defd8d9011e7e6d23216ee4fc4e8bb5b91a1efd833a6d1c barebox-2018.10.0.tar.bz2
|
||||
sha256 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 barebox-2018.12.0.tar.bz2
|
||||
|
||||
@@ -28,7 +28,7 @@ $(1)_SITE_METHOD = git
|
||||
else
|
||||
# Handle stable official Barebox versions
|
||||
$(1)_SOURCE = barebox-$$($(1)_VERSION).tar.bz2
|
||||
$(1)_SITE = http://www.barebox.org/download
|
||||
$(1)_SITE = https://www.barebox.org/download
|
||||
endif
|
||||
|
||||
$(1)_DEPENDENCIES = host-lzop
|
||||
|
||||
@@ -2,6 +2,9 @@ config BR2_TARGET_GRUB2_ARCH_SUPPORTS
|
||||
bool
|
||||
default y if BR2_i386
|
||||
default y if BR2_x86_64
|
||||
default y if BR2_arm
|
||||
default y if BR2_aarch64
|
||||
depends on BR2_USE_MMU
|
||||
|
||||
config BR2_TARGET_GRUB2
|
||||
bool "grub2"
|
||||
@@ -29,12 +32,14 @@ choice
|
||||
|
||||
config BR2_TARGET_GRUB2_I386_PC
|
||||
bool "i386-pc"
|
||||
depends on BR2_i386 || BR2_x86_64
|
||||
help
|
||||
Select this option if the platform you're targetting is a
|
||||
x86 or x86-64 legacy BIOS based platform.
|
||||
|
||||
config BR2_TARGET_GRUB2_I386_EFI
|
||||
bool "i386-efi"
|
||||
depends on BR2_i386 || BR2_x86_64
|
||||
help
|
||||
Select this option if the platform you're targetting has a
|
||||
32 bits EFI BIOS. Note that some x86-64 platforms use a 32
|
||||
@@ -42,14 +47,38 @@ config BR2_TARGET_GRUB2_I386_EFI
|
||||
|
||||
config BR2_TARGET_GRUB2_X86_64_EFI
|
||||
bool "x86-64-efi"
|
||||
depends on BR2_ARCH_IS_64
|
||||
depends on BR2_x86_64
|
||||
help
|
||||
Select this option if the platform you're targetting has a
|
||||
64 bits EFI BIOS.
|
||||
|
||||
config BR2_TARGET_GRUB2_ARM_UBOOT
|
||||
bool "arm-uboot"
|
||||
depends on BR2_arm
|
||||
help
|
||||
Select this option if the platform you're targetting is an
|
||||
ARM u-boot platform, and you want to boot Grub 2 as an u-boot
|
||||
compatible image.
|
||||
|
||||
config BR2_TARGET_GRUB2_ARM_EFI
|
||||
bool "arm-efi"
|
||||
depends on BR2_arm
|
||||
help
|
||||
Select this option if the platform you're targetting is an
|
||||
ARM platform and you want to boot Grub 2 as an EFI
|
||||
application.
|
||||
|
||||
config BR2_TARGET_GRUB2_ARM64_EFI
|
||||
bool "arm64-efi"
|
||||
depends on BR2_aarch64
|
||||
help
|
||||
Select this option if the platform you're targetting is an
|
||||
Aarch64 platform and you want to boot Grub 2 as an EFI
|
||||
application.
|
||||
|
||||
endchoice
|
||||
|
||||
if BR2_TARGET_GRUB2_I386_PC
|
||||
if BR2_TARGET_GRUB2_I386_PC || BR2_TARGET_GRUB2_ARM_UBOOT
|
||||
|
||||
config BR2_TARGET_GRUB2_BOOT_PARTITION
|
||||
string "boot partition"
|
||||
@@ -60,13 +89,15 @@ config BR2_TARGET_GRUB2_BOOT_PARTITION
|
||||
first disk if using a legacy partition table, or 'hd0,gpt1'
|
||||
if using GPT partition table.
|
||||
|
||||
endif # BR2_TARGET_GRUB2_I386_PC
|
||||
endif # BR2_TARGET_GRUB2_I386_PC || BR2_TARGET_GRUB2_ARM_UBOOT
|
||||
|
||||
config BR2_TARGET_GRUB2_BUILTIN_MODULES
|
||||
string "builtin modules"
|
||||
default "boot linux ext2 fat squash4 part_msdos part_gpt normal biosdisk" if BR2_TARGET_GRUB2_I386_PC
|
||||
default "boot linux ext2 fat squash4 part_msdos part_gpt normal efi_gop" \
|
||||
if BR2_TARGET_GRUB2_I386_EFI || BR2_TARGET_GRUB2_X86_64_EFI
|
||||
if BR2_TARGET_GRUB2_I386_EFI || BR2_TARGET_GRUB2_X86_64_EFI || \
|
||||
BR2_TARGET_GRUB2_ARM_EFI || BR2_TARGET_GRUB2_ARM64_EFI
|
||||
default "linux ext2 fat part_msdos normal" if BR2_TARGET_GRUB2_ARM_UBOOT
|
||||
|
||||
config BR2_TARGET_GRUB2_BUILTIN_CONFIG
|
||||
string "builtin config"
|
||||
@@ -76,6 +107,15 @@ config BR2_TARGET_GRUB2_BUILTIN_CONFIG
|
||||
device and other configuration parameters, but however menu
|
||||
entries cannot be described in this embedded configuration.
|
||||
|
||||
config BR2_TARGET_GRUB2_INSTALL_TOOLS
|
||||
bool "install tools"
|
||||
help
|
||||
Install support tools to interact with GNU GRUB Multiboot
|
||||
boot loader.
|
||||
|
||||
This will also install the Grub 2 loadable modules to the
|
||||
target.
|
||||
|
||||
endif # BR2_TARGET_GRUB2
|
||||
|
||||
comment "grub2 needs a toolchain w/ wchar"
|
||||
|
||||
@@ -9,7 +9,15 @@ GRUB2_SITE = http://ftp.gnu.org/gnu/grub
|
||||
GRUB2_SOURCE = grub-$(GRUB2_VERSION).tar.xz
|
||||
GRUB2_LICENSE = GPL-3.0+
|
||||
GRUB2_LICENSE_FILES = COPYING
|
||||
GRUB2_DEPENDENCIES = host-bison host-flex
|
||||
GRUB2_DEPENDENCIES = host-bison host-flex host-grub2
|
||||
HOST_GRUB2_DEPENDENCIES = host-bison host-flex
|
||||
GRUB2_INSTALL_IMAGES = YES
|
||||
|
||||
ifeq ($(BR2_TARGET_GRUB2_INSTALL_TOOLS),y)
|
||||
GRUB2_INSTALL_TARGET = YES
|
||||
else
|
||||
GRUB2_INSTALL_TARGET = NO
|
||||
endif
|
||||
|
||||
GRUB2_BUILTIN_MODULES = $(call qstrip,$(BR2_TARGET_GRUB2_BUILTIN_MODULES))
|
||||
GRUB2_BUILTIN_CONFIG = $(call qstrip,$(BR2_TARGET_GRUB2_BUILTIN_CONFIG))
|
||||
@@ -36,29 +44,48 @@ GRUB2_PREFIX = /EFI/BOOT
|
||||
GRUB2_TUPLE = x86_64-efi
|
||||
GRUB2_TARGET = x86_64
|
||||
GRUB2_PLATFORM = efi
|
||||
else ifeq ($(BR2_TARGET_GRUB2_ARM_UBOOT),y)
|
||||
GRUB2_IMAGE = $(BINARIES_DIR)/boot-part/grub/grub.img
|
||||
GRUB2_CFG = $(BINARIES_DIR)/boot-part/grub/grub.cfg
|
||||
GRUB2_PREFIX = ($(GRUB2_BOOT_PARTITION))/boot/grub
|
||||
GRUB2_TUPLE = arm-uboot
|
||||
GRUB2_TARGET = arm
|
||||
GRUB2_PLATFORM = uboot
|
||||
else ifeq ($(BR2_TARGET_GRUB2_ARM_EFI),y)
|
||||
GRUB2_IMAGE = $(BINARIES_DIR)/efi-part/EFI/BOOT/bootarm.efi
|
||||
GRUB2_CFG = $(BINARIES_DIR)/efi-part/EFI/BOOT/grub.cfg
|
||||
GRUB2_PREFIX = /EFI/BOOT
|
||||
GRUB2_TUPLE = arm-efi
|
||||
GRUB2_TARGET = arm
|
||||
GRUB2_PLATFORM = efi
|
||||
else ifeq ($(BR2_TARGET_GRUB2_ARM64_EFI),y)
|
||||
GRUB2_IMAGE = $(BINARIES_DIR)/efi-part/EFI/BOOT/bootaa64.efi
|
||||
GRUB2_CFG = $(BINARIES_DIR)/efi-part/EFI/BOOT/grub.cfg
|
||||
GRUB2_PREFIX = /EFI/BOOT
|
||||
GRUB2_TUPLE = arm64-efi
|
||||
GRUB2_TARGET = aarch64
|
||||
GRUB2_PLATFORM = efi
|
||||
endif
|
||||
|
||||
# Grub2 is kind of special: it considers CC, LD and so on to be the
|
||||
# tools to build the native tools (i.e to be executed on the build
|
||||
# machine), and uses TARGET_CC, TARGET_CFLAGS, TARGET_CPPFLAGS,
|
||||
# TARGET_LDFLAGS to build the bootloader itself. However, to add to
|
||||
# the confusion, it also uses NM, OBJCOPY and STRIP to build the
|
||||
# bootloader itself; none of these are used to build the native
|
||||
# tools.
|
||||
# tools to build the host programs and uses TARGET_CC, TARGET_CFLAGS,
|
||||
# TARGET_CPPFLAGS, TARGET_LDFLAGS to build the bootloader itself.
|
||||
#
|
||||
# NOTE: TARGET_STRIP is overridden by !BR2_STRIP_strip, so always
|
||||
# use the cross compile variant to ensure grub2 builds
|
||||
|
||||
HOST_GRUB2_CONF_ENV = \
|
||||
CPP="$(HOSTCC) -E"
|
||||
|
||||
GRUB2_CONF_ENV = \
|
||||
$(HOST_CONFIGURE_OPTS) \
|
||||
CPP="$(HOSTCC) -E" \
|
||||
CPP="$(TARGET_CC) -E" \
|
||||
TARGET_CC="$(TARGET_CC)" \
|
||||
TARGET_CFLAGS="$(TARGET_CFLAGS)" \
|
||||
TARGET_CPPFLAGS="$(TARGET_CPPFLAGS) -fno-stack-protector" \
|
||||
TARGET_LDFLAGS="$(TARGET_LDFLAGS)" \
|
||||
NM="$(TARGET_NM)" \
|
||||
OBJCOPY="$(TARGET_OBJCOPY)" \
|
||||
STRIP="$(TARGET_CROSS)strip"
|
||||
TARGET_NM="$(TARGET_NM)" \
|
||||
TARGET_OBJCOPY="$(TARGET_OBJCOPY)" \
|
||||
TARGET_STRIP="$(TARGET_CROSS)strip"
|
||||
|
||||
GRUB2_CONF_OPTS = \
|
||||
--target=$(GRUB2_TARGET) \
|
||||
@@ -72,12 +99,13 @@ GRUB2_CONF_OPTS = \
|
||||
--enable-libzfs=no \
|
||||
--disable-werror
|
||||
|
||||
# We don't want all the native tools and Grub2 modules to be installed
|
||||
# in the target. So we in fact install everything into the host
|
||||
# directory, and the image generation process (below) will use the
|
||||
# grub-mkimage tool and Grub2 modules from the host directory.
|
||||
|
||||
GRUB2_INSTALL_TARGET_OPTS = DESTDIR=$(HOST_DIR) install
|
||||
HOST_GRUB2_CONF_OPTS = \
|
||||
--disable-grub-mkfont \
|
||||
--enable-efiemu=no \
|
||||
ac_cv_lib_lzma_lzma_code=no \
|
||||
--enable-device-mapper=no \
|
||||
--enable-libzfs=no \
|
||||
--disable-werror
|
||||
|
||||
ifeq ($(BR2_TARGET_GRUB2_I386_PC),y)
|
||||
define GRUB2_IMAGE_INSTALL_ELTORITO
|
||||
@@ -86,10 +114,10 @@ define GRUB2_IMAGE_INSTALL_ELTORITO
|
||||
endef
|
||||
endif
|
||||
|
||||
define GRUB2_IMAGE_INSTALLATION
|
||||
define GRUB2_INSTALL_IMAGES_CMDS
|
||||
mkdir -p $(dir $(GRUB2_IMAGE))
|
||||
$(HOST_DIR)/bin/grub-mkimage \
|
||||
-d $(HOST_DIR)/lib/grub/$(GRUB2_TUPLE) \
|
||||
$(HOST_DIR)/usr/bin/grub-mkimage \
|
||||
-d $(@D)/grub-core/ \
|
||||
-O $(GRUB2_TUPLE) \
|
||||
-o $(GRUB2_IMAGE) \
|
||||
-p "$(GRUB2_PREFIX)" \
|
||||
@@ -99,14 +127,14 @@ define GRUB2_IMAGE_INSTALLATION
|
||||
$(INSTALL) -D -m 0644 boot/grub2/grub.cfg $(GRUB2_CFG)
|
||||
$(GRUB2_IMAGE_INSTALL_ELTORITO)
|
||||
endef
|
||||
GRUB2_POST_INSTALL_TARGET_HOOKS += GRUB2_IMAGE_INSTALLATION
|
||||
|
||||
ifeq ($(GRUB2_PLATFORM),efi)
|
||||
define GRUB2_EFI_STARTUP_NSH
|
||||
echo $(notdir $(GRUB2_IMAGE)) > \
|
||||
$(BINARIES_DIR)/efi-part/startup.nsh
|
||||
endef
|
||||
GRUB2_POST_INSTALL_TARGET_HOOKS += GRUB2_EFI_STARTUP_NSH
|
||||
GRUB2_POST_INSTALL_IMAGES_HOOKS += GRUB2_EFI_STARTUP_NSH
|
||||
endif
|
||||
|
||||
$(eval $(autotools-package))
|
||||
$(eval $(host-autotools-package))
|
||||
|
||||
@@ -53,8 +53,8 @@ To test your BIOS image in Qemu
|
||||
|
||||
qemu-system-{i386,x86-64} -hda disk.img
|
||||
|
||||
Notes on using Grub2 for EFI-based platforms
|
||||
============================================
|
||||
Notes on using Grub2 for x86/x86_64 EFI-based platforms
|
||||
=======================================================
|
||||
|
||||
1. Create a disk image
|
||||
dd if=/dev/zero of=disk.img bs=1M count=32
|
||||
@@ -83,16 +83,108 @@ Notes on using Grub2 for EFI-based platforms
|
||||
sudo losetup -d /dev/loop0
|
||||
7. Your disk.img is ready!
|
||||
|
||||
To test your EFI image in Qemu
|
||||
------------------------------
|
||||
To test your i386/x86-64 EFI image in Qemu
|
||||
------------------------------------------
|
||||
|
||||
1. Download the EFI BIOS for Qemu
|
||||
Version IA32 or X64 depending on the chosen Grub2
|
||||
platform (i386-efi vs. x86-64-efi)
|
||||
http://sourceforge.net/projects/edk2/files/OVMF/
|
||||
https://www.kraxel.org/repos/jenkins/edk2/
|
||||
(or use one provided by your distribution as OVMF)
|
||||
2. Extract, and rename OVMF.fd to bios.bin and
|
||||
CirrusLogic5446.rom to vgabios-cirrus.bin.
|
||||
3. qemu-system-{i386,x86-64} -L ovmf-dir/ -hda disk.img
|
||||
4. Make sure to pass pci=nocrs to the kernel command line,
|
||||
to workaround a bug in the EFI BIOS regarding the
|
||||
EFI framebuffer.
|
||||
|
||||
Notes on using Grub2 for ARM u-boot-based platforms
|
||||
===================================================
|
||||
|
||||
The following steps show how to use the Grub2 arm-uboot platform
|
||||
support in the simplest way possible and with a single
|
||||
buildroot-generated filesystem.
|
||||
|
||||
1. Load qemu_arm_vexpress_defconfig
|
||||
|
||||
2. Enable u-boot with the vexpress_ca9x4 board name and with
|
||||
u-boot.elf image format.
|
||||
|
||||
3. Enable grub2 for the arm-uboot platform.
|
||||
|
||||
4. Enable "Install kernel image to /boot in target" in the kernel
|
||||
menu to populate a /boot directory with zImage in it.
|
||||
|
||||
5. The upstream u-boot vexpress_ca9x4 doesn't have CONFIG_API enabled
|
||||
by default, which is required.
|
||||
|
||||
Before building, patch u-boot (for example, make u-boot-extract to
|
||||
edit the source before building) file
|
||||
include/configs/vexpress_common.h to define:
|
||||
|
||||
#define CONFIG_API
|
||||
#define CONFIG_SYS_MMC_MAX_DEVICE 1
|
||||
|
||||
6. Create a custom grub2 config file with the following contents and
|
||||
set its path in BR2_TARGET_GRUB2_CFG:
|
||||
|
||||
set default="0"
|
||||
set timeout="5"
|
||||
|
||||
menuentry "Buildroot" {
|
||||
set root='(hd0)'
|
||||
linux /boot/zImage root=/dev/mmcblk0 console=ttyAMA0
|
||||
devicetree /boot/vexpress-v2p-ca9.dtb
|
||||
}
|
||||
|
||||
7. Create a custom builtin config file with the following contents
|
||||
and set its path in BR2_TARGET_GRUB2_BUILTIN_CONFIG:
|
||||
|
||||
set root=(hd0)
|
||||
set prefix=/boot/grub
|
||||
|
||||
8. Create a custom post-build script which copies files from
|
||||
${BINARIES_DIR}/boot-part to $(TARGET_DIR)/boot (set its path in
|
||||
BR2_ROOTFS_POST_BUILD_SCRIPT):
|
||||
|
||||
#!/bin/sh
|
||||
cp -r ${BINARIES_DIR}/boot-part/* ${TARGET_DIR}/boot/
|
||||
|
||||
9. make
|
||||
|
||||
10. Run qemu with:
|
||||
|
||||
qemu-system-arm -M vexpress-a9 -kernel output/images/u-boot -m 1024 \
|
||||
-nographic -sd output/images/rootfs.ext2
|
||||
|
||||
11. In u-boot, stop at the prompt and run grub2 with:
|
||||
|
||||
=> ext2load mmc 0:0 ${loadaddr} /boot/grub/grub.img
|
||||
=> bootm
|
||||
|
||||
12. This should bring the grub2 menu, upon which selecting the "Buildroot"
|
||||
entry should boot Linux.
|
||||
|
||||
|
||||
Notes on using Grub2 for Aarch64 EFI-based platforms
|
||||
====================================================
|
||||
|
||||
The following steps show how to use the Grub2 arm64-efi platform,
|
||||
using qemu and EFI firmware built for qemu.
|
||||
|
||||
1. Load aarch64_efi_defconfig
|
||||
|
||||
2. make
|
||||
|
||||
3. Download the EFI firmware for qemu aarch64
|
||||
https://www.kraxel.org/repos/jenkins/edk2/
|
||||
(or use one provided by your distribution as OVMF-aarch64 or AAVMF)
|
||||
|
||||
4. Run qemu with:
|
||||
|
||||
qemu-system-aarch64 -M virt -cpu cortex-a57 -m 512 -nographic \
|
||||
-bios <path/to/EDK2>/QEMU_EFI.fd -hda output/images/disk.img \
|
||||
-netdev user,id=eth0 -device virtio-net-device,netdev=eth0
|
||||
|
||||
5. This should bring the grub2 menu, upon which selecting the
|
||||
"Buildroot" entry should boot Linux.
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
config BR2_TARGET_GUMMIBOOT
|
||||
bool "gummiboot"
|
||||
depends on BR2_i386 || BR2_x86_64
|
||||
depends on BR2_PACKAGE_GNU_EFI_ARCH_SUPPORTS
|
||||
select BR2_PACKAGE_GNU_EFI
|
||||
select BR2_PACKAGE_UTIL_LINUX
|
||||
select BR2_PACKAGE_UTIL_LINUX_LIBBLKID
|
||||
|
||||
19
buildroot/boot/shim/Config.in
Normal file
19
buildroot/boot/shim/Config.in
Normal file
@@ -0,0 +1,19 @@
|
||||
config BR2_TARGET_SHIM
|
||||
bool "shim"
|
||||
depends on BR2_PACKAGE_GNU_EFI_ARCH_SUPPORTS
|
||||
# ARM32 build currently broken
|
||||
depends on !BR2_ARM_CPU_HAS_ARM
|
||||
select BR2_PACKAGE_GNU_EFI
|
||||
help
|
||||
Boot loader to chain-load signed boot loaders under Secure
|
||||
Boot.
|
||||
|
||||
This package provides a minimalist boot loader which allows
|
||||
verifying signatures of other UEFI binaries against either
|
||||
the Secure Boot DB/DBX or against a built-in signature
|
||||
database. Its purpose is to allow a small,
|
||||
infrequently-changing binary to be signed by the UEFI CA,
|
||||
while allowing an OS distributor to revision their main
|
||||
bootloader independently of the CA.
|
||||
|
||||
https://github.com/rhboot/shim
|
||||
3
buildroot/boot/shim/shim.hash
Normal file
3
buildroot/boot/shim/shim.hash
Normal file
@@ -0,0 +1,3 @@
|
||||
# locally computed hash
|
||||
sha256 279d19cc95b9974ea2379401a6a0653d949c3fa3d61f0c4bd6a7b9e840bdc425 shim-15.tar.gz
|
||||
sha256 15edf527919ddcb2f514ab9d16ad07ef219e4bb490e0b79560be510f0c159cc2 COPYRIGHT
|
||||
31
buildroot/boot/shim/shim.mk
Normal file
31
buildroot/boot/shim/shim.mk
Normal file
@@ -0,0 +1,31 @@
|
||||
################################################################################
|
||||
#
|
||||
# shim
|
||||
#
|
||||
################################################################################
|
||||
|
||||
SHIM_VERSION = 15
|
||||
SHIM_SITE = $(call github,rhboot,shim,$(SHIM_VERSION))
|
||||
SHIM_LICENSE = BSD-2-Clause
|
||||
SHIM_LICENSE_FILES = COPYRIGHT
|
||||
SHIM_DEPENDENCIES = gnu-efi
|
||||
SHIM_INSTALL_TARGET = NO
|
||||
SHIM_INSTALL_IMAGES = YES
|
||||
|
||||
SHIM_MAKE_OPTS = \
|
||||
ARCH="$(GNU_EFI_PLATFORM)" \
|
||||
CROSS_COMPILE="$(TARGET_CROSS)" \
|
||||
DASHJ="-j$(PARALLEL_JOBS)" \
|
||||
EFI_INCLUDE="$(STAGING_DIR)/usr/include/efi" \
|
||||
EFI_PATH="$(STAGING_DIR)/usr/lib" \
|
||||
LIBDIR="$(STAGING_DIR)/usr/lib"
|
||||
|
||||
define SHIM_BUILD_CMDS
|
||||
$(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) $(SHIM_MAKE_OPTS)
|
||||
endef
|
||||
|
||||
define SHIM_INSTALL_IMAGES_CMDS
|
||||
$(INSTALL) -m 0755 -t $(BINARIES_DIR) $(@D)/*.efi
|
||||
endef
|
||||
|
||||
$(eval $(generic-package))
|
||||
@@ -0,0 +1,45 @@
|
||||
From 44a1b42e561b9a257209300e2860b901b100cc17 Mon Sep 17 00:00:00 2001
|
||||
From: Carlos Santos <casantos@datacom.com.br>
|
||||
Date: Tue, 26 Feb 2019 08:07:22 -0300
|
||||
Subject: [PATCH] Fix build with gnu-efi version 3.0.9
|
||||
|
||||
Adapt a patch already applied upstream to prevent multiple definitions
|
||||
of 'memset' and 'memcpy'.
|
||||
|
||||
Signed-off-by: Carlos Santos <casantos@datacom.com.br>
|
||||
(adapted from commit 363d61c4f112b972649b19d67e96b9321f738f00)
|
||||
---
|
||||
mk/lib.mk | 9 +++++++--
|
||||
1 file changed, 7 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/mk/lib.mk b/mk/lib.mk
|
||||
index ceb95bd0..c9b6eaf3 100644
|
||||
--- a/mk/lib.mk
|
||||
+++ b/mk/lib.mk
|
||||
@@ -186,9 +186,9 @@ MINLIBOBJS = \
|
||||
# $(LIBVESA_OBJS)
|
||||
|
||||
CORELIBOBJS = \
|
||||
- memcpy.o memset.o memcmp.o printf.o strncmp.o vfprintf.o \
|
||||
+ memcmp.o printf.o strncmp.o vfprintf.o \
|
||||
strlen.o vsnprintf.o snprintf.o stpcpy.o strcmp.o strdup.o \
|
||||
- strcpy.o strncpy.o setjmp.o fopen.o fread.o fread2.o puts.o \
|
||||
+ strcpy.o strncpy.o fopen.o fread.o fread2.o puts.o \
|
||||
strtoul.o strntoumax.o strcasecmp.o \
|
||||
sprintf.o strlcat.o strchr.o strlcpy.o strncasecmp.o ctypes.o \
|
||||
fputs.o fwrite2.o fwrite.o fgetc.o fclose.o lmalloc.o \
|
||||
@@ -203,6 +203,11 @@ CORELIBOBJS = \
|
||||
$(LIBENTRY_OBJS) \
|
||||
$(LIBMODULE_OBJS)
|
||||
|
||||
+ifndef EFI_BUILD
|
||||
+# For EFI, these are part of gnu-efi
|
||||
+CORELIBOBJS += setjmp.o memcpy.o memset.o
|
||||
+endif
|
||||
+
|
||||
LDFLAGS = -m elf_$(ARCH) --hash-style=gnu -T $(com32)/lib/$(ARCH)/elf.ld
|
||||
|
||||
.SUFFIXES: .c .o .a .so .lo .i .S .s .ls .ss .lss
|
||||
--
|
||||
2.14.5
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
From beb526ca925983c7da229043790ecd552d910650 Mon Sep 17 00:00:00 2001
|
||||
From: Christian Stewart <christian@paral.in>
|
||||
Date: Thu, 4 Apr 2019 23:24:31 -0700
|
||||
Subject: [PATCH] Fix build with binutils note gnu property section
|
||||
|
||||
This fixes the following build error with newer binutils:
|
||||
|
||||
objcopy -O binary mbr.elf mbr.bin
|
||||
perl /build/syslinux/src/syslinux/mbr/checksize.pl mbr.bin
|
||||
mbr.bin: too big (452 > 440)
|
||||
|
||||
Corresponding bug reports:
|
||||
|
||||
- https://bugs.archlinux.org/task/60405
|
||||
- https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=906414
|
||||
|
||||
Strips the .note.gnu.property in the linker scripts for the MBRs.
|
||||
|
||||
Signed-off-by: Christian Stewart <christian@paral.in>
|
||||
---
|
||||
mbr/i386/mbr.ld | 1 +
|
||||
mbr/x86_64/mbr.ld | 1 +
|
||||
2 files changed, 2 insertions(+)
|
||||
|
||||
diff --git a/mbr/i386/mbr.ld b/mbr/i386/mbr.ld
|
||||
index d14ba802..53683461 100644
|
||||
--- a/mbr/i386/mbr.ld
|
||||
+++ b/mbr/i386/mbr.ld
|
||||
@@ -70,4 +70,5 @@ SECTIONS
|
||||
.debug_typenames 0 : { *(.debug_typenames) }
|
||||
.debug_varnames 0 : { *(.debug_varnames) }
|
||||
/DISCARD/ : { *(.note.GNU-stack) }
|
||||
+ /DISCARD/ : { *(.note.gnu.property) }
|
||||
}
|
||||
diff --git a/mbr/x86_64/mbr.ld b/mbr/x86_64/mbr.ld
|
||||
index ae27d49a..b8c0d895 100644
|
||||
--- a/mbr/x86_64/mbr.ld
|
||||
+++ b/mbr/x86_64/mbr.ld
|
||||
@@ -69,4 +69,5 @@ SECTIONS
|
||||
.debug_typenames 0 : { *(.debug_typenames) }
|
||||
.debug_varnames 0 : { *(.debug_varnames) }
|
||||
/DISCARD/ : { *(.note.GNU-stack) }
|
||||
+ /DISCARD/ : { *(.note.gnu.property) }
|
||||
}
|
||||
--
|
||||
2.21.0
|
||||
|
||||
@@ -44,6 +44,7 @@ config BR2_TARGET_SYSLINUX_MBR
|
||||
|
||||
config BR2_TARGET_SYSLINUX_EFI
|
||||
bool "install efi"
|
||||
depends on BR2_PACKAGE_GNU_EFI_ARCH_SUPPORTS
|
||||
select BR2_PACKAGE_GNU_EFI
|
||||
help
|
||||
Install the 'efi' image, to boot from an EFI environment.
|
||||
|
||||
@@ -179,6 +179,19 @@ config BR2_TARGET_UBOOT_NEEDS_ATF_BL31
|
||||
variable pointing to ATF's BL31 binary, is passed during the
|
||||
Buildroot build.
|
||||
|
||||
choice
|
||||
prompt "U-Boot ATF BL31 format"
|
||||
default BR2_TARGET_UBOOT_NEEDS_ATF_BL31_BIN
|
||||
depends on BR2_TARGET_UBOOT_NEEDS_ATF_BL31
|
||||
|
||||
config BR2_TARGET_UBOOT_NEEDS_ATF_BL31_BIN
|
||||
bool "bl31.bin"
|
||||
|
||||
config BR2_TARGET_UBOOT_NEEDS_ATF_BL31_ELF
|
||||
bool "bl31.elf"
|
||||
|
||||
endchoice
|
||||
|
||||
menu "U-Boot binary format"
|
||||
|
||||
config BR2_TARGET_UBOOT_FORMAT_AIS
|
||||
|
||||
@@ -137,8 +137,12 @@ UBOOT_MAKE_OPTS += \
|
||||
|
||||
ifeq ($(BR2_TARGET_UBOOT_NEEDS_ATF_BL31),y)
|
||||
UBOOT_DEPENDENCIES += arm-trusted-firmware
|
||||
ifeq ($(BR2_TARGET_UBOOT_NEEDS_ATF_BL31_ELF),y)
|
||||
UBOOT_MAKE_OPTS += BL31=$(BINARIES_DIR)/bl31.elf
|
||||
else
|
||||
UBOOT_MAKE_OPTS += BL31=$(BINARIES_DIR)/bl31.bin
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_TARGET_UBOOT_NEEDS_DTC),y)
|
||||
UBOOT_DEPENDENCIES += host-dtc
|
||||
@@ -227,8 +231,9 @@ UBOOT_KCONFIG_EDITORS = menuconfig xconfig gconfig nconfig
|
||||
# (which is typically wchar) but link with
|
||||
# $(HOST_DIR)/lib/libncurses.so (which is not). We don't actually
|
||||
# need any host-package for kconfig, so remove the HOSTCC/HOSTLDFLAGS
|
||||
# override again.
|
||||
UBOOT_KCONFIG_OPTS = $(UBOOT_MAKE_OPTS) HOSTCC="$(HOSTCC)" HOSTLDFLAGS=""
|
||||
# override again. In addition, host-ccache is not ready at kconfig
|
||||
# time, so use HOSTCC_NOCCACHE.
|
||||
UBOOT_KCONFIG_OPTS = $(UBOOT_MAKE_OPTS) HOSTCC="$(HOSTCC_NOCCACHE)" HOSTLDFLAGS=""
|
||||
define UBOOT_HELP_CMDS
|
||||
@echo ' uboot-menuconfig - Run U-Boot menuconfig'
|
||||
@echo ' uboot-savedefconfig - Run U-Boot savedefconfig'
|
||||
|
||||
Reference in New Issue
Block a user