initial buildroot for linux 5.15
This commit is contained in:
@@ -0,0 +1,85 @@
|
||||
config BR2_TARGET_BAREBOX
|
||||
bool "Barebox"
|
||||
help
|
||||
The Barebox bootloader, formerly known as U-Boot v2.
|
||||
|
||||
http://www.barebox.org
|
||||
|
||||
if BR2_TARGET_BAREBOX
|
||||
choice
|
||||
prompt "version"
|
||||
help
|
||||
Select the specific Barebox version you want to use
|
||||
|
||||
config BR2_TARGET_BAREBOX_LATEST_VERSION
|
||||
bool "2021.10.0"
|
||||
|
||||
config BR2_TARGET_BAREBOX_CUSTOM_VERSION
|
||||
bool "Custom version"
|
||||
help
|
||||
This option allows to use a specific official versions
|
||||
|
||||
config BR2_TARGET_BAREBOX_CUSTOM_TARBALL
|
||||
bool "Custom tarball"
|
||||
|
||||
config BR2_TARGET_BAREBOX_CUSTOM_GIT
|
||||
bool "Custom Git repository"
|
||||
|
||||
endchoice
|
||||
|
||||
config BR2_TARGET_BAREBOX_CUSTOM_VERSION_VALUE
|
||||
string "Barebox version"
|
||||
depends on BR2_TARGET_BAREBOX_CUSTOM_VERSION
|
||||
|
||||
if BR2_TARGET_BAREBOX_CUSTOM_TARBALL
|
||||
|
||||
config BR2_TARGET_BAREBOX_CUSTOM_TARBALL_LOCATION
|
||||
string "URL of custom Barebox tarball"
|
||||
|
||||
endif
|
||||
|
||||
config BR2_TARGET_BAREBOX_VERSION
|
||||
string
|
||||
default "2021.10.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
|
||||
|
||||
config BR2_TARGET_BAREBOX_CUSTOM_PATCH_DIR
|
||||
string "custom patch dir"
|
||||
help
|
||||
If your board requires custom patches, add the path to the
|
||||
directory containing the patches here. The patches must be
|
||||
named barebox-<version>-<something>.patch.
|
||||
|
||||
Most users may leave this empty
|
||||
|
||||
if BR2_TARGET_BAREBOX_CUSTOM_GIT
|
||||
|
||||
config BR2_TARGET_BAREBOX_CUSTOM_GIT_REPO_URL
|
||||
string "URL of custom Git repository"
|
||||
|
||||
config BR2_TARGET_BAREBOX_CUSTOM_GIT_VERSION
|
||||
string "Custom Git version"
|
||||
|
||||
endif
|
||||
|
||||
source boot/barebox/barebox/Config.in
|
||||
|
||||
menuconfig BR2_TARGET_BAREBOX_AUX
|
||||
bool "Build barebox with an auxiliary config"
|
||||
help
|
||||
Build barebox with an auxiliary configuration.
|
||||
|
||||
Useful for building an SPL (Secondary Program Loader) in
|
||||
addition to the traditional TPL (Tertiary Program Loader),
|
||||
such as the X-Loader or MLO for Texas Instruments
|
||||
processors.
|
||||
|
||||
if BR2_TARGET_BAREBOX_AUX
|
||||
|
||||
source boot/barebox/barebox-aux/Config.in
|
||||
|
||||
endif
|
||||
|
||||
endif
|
||||
@@ -0,0 +1,75 @@
|
||||
choice
|
||||
prompt "Barebox configuration"
|
||||
default BR2_TARGET_BAREBOX_AUX_USE_DEFCONFIG
|
||||
|
||||
config BR2_TARGET_BAREBOX_AUX_USE_DEFCONFIG
|
||||
bool "Using a defconfig"
|
||||
|
||||
config BR2_TARGET_BAREBOX_AUX_USE_CUSTOM_CONFIG
|
||||
bool "Using a custom config file"
|
||||
|
||||
endchoice
|
||||
|
||||
config BR2_TARGET_BAREBOX_AUX_BOARD_DEFCONFIG
|
||||
string "board defconfig"
|
||||
depends on BR2_TARGET_BAREBOX_AUX_USE_DEFCONFIG
|
||||
help
|
||||
Name of the board for which Barebox should be built, without
|
||||
the _defconfig suffix.
|
||||
|
||||
config BR2_TARGET_BAREBOX_AUX_CUSTOM_CONFIG_FILE
|
||||
string "Configuration file path"
|
||||
depends on BR2_TARGET_BAREBOX_AUX_USE_CUSTOM_CONFIG
|
||||
help
|
||||
Path to the barebox configuration file
|
||||
|
||||
config BR2_TARGET_BAREBOX_AUX_CONFIG_FRAGMENT_FILES
|
||||
string "Additional configuration fragment files"
|
||||
help
|
||||
A space-separated list of configuration fragment files,
|
||||
that will be merged to the main Barebox configuration file.
|
||||
|
||||
config BR2_TARGET_BAREBOX_AUX_IMAGE_FILE
|
||||
string "Image file names"
|
||||
help
|
||||
Space-separated list of barebox images which will be copied to
|
||||
the images directory.
|
||||
|
||||
If left empty, defaults to:
|
||||
- barebox.bin for barebox versions older than 2012.10.
|
||||
- barebox-flash-image for later versions.
|
||||
|
||||
config BR2_TARGET_BAREBOX_AUX_CUSTOM_ENV
|
||||
bool "Generate an environment image"
|
||||
help
|
||||
Generate a custom environment image. This environment will
|
||||
contain the variables and scripts to be used at boot by
|
||||
barebox.
|
||||
|
||||
config BR2_TARGET_BAREBOX_AUX_CUSTOM_ENV_PATH
|
||||
string "Environment path"
|
||||
depends on BR2_TARGET_BAREBOX_AUX_CUSTOM_ENV
|
||||
help
|
||||
Path to the directory containing the custom barebox
|
||||
environment. Depending on your setup, it will probably be
|
||||
based on either the content of the defaultenv or
|
||||
defaultenv-2 directories in the barebox source code, plus
|
||||
the additions needed. The output will be an image in the
|
||||
barebox devfs format, stored in the images directory, with
|
||||
the same name as the directory name given here.
|
||||
|
||||
config BR2_TARGET_BAREBOX_AUX_CUSTOM_EMBEDDED_ENV_PATH
|
||||
string "Embedded environment path"
|
||||
help
|
||||
If this option is not empty, it is the path to a custom
|
||||
embedded barebox environment. This image will be used when
|
||||
the environment found in the environment sector is
|
||||
invalid. This option sets the barebox Kconfig option
|
||||
CONFIG_DEFAULT_ENVIRONMENT_PATH to the specified path. This
|
||||
way it is possible to use Buildroot variables like
|
||||
TOPDIR etc. to refer to the custom environment.
|
||||
|
||||
Depending on your setup, the custom embedded environment
|
||||
will probably be based on either the content of the
|
||||
defaultenv or defaultenv-2 directories in the barebox source
|
||||
code.
|
||||
@@ -0,0 +1 @@
|
||||
../barebox.hash
|
||||
@@ -0,0 +1,8 @@
|
||||
################################################################################
|
||||
#
|
||||
# barebox-aux
|
||||
#
|
||||
################################################################################
|
||||
|
||||
# Instantiate the auxiliary barebox package
|
||||
$(eval $(barebox-package))
|
||||
@@ -0,0 +1,8 @@
|
||||
# From https://www.barebox.org/download/barebox-2021.10.0.tar.bz2.md5
|
||||
md5 7d79102fd8d45bf3756b4f3a569654a8 barebox-2021.10.0.tar.bz2
|
||||
|
||||
# Locally calculated
|
||||
sha256 4bb077b54d03743b3e8c20751d318dcc3ef03b20abe1a64a79c413ea03de3632 barebox-2021.10.0.tar.bz2
|
||||
|
||||
# License files, locally computed
|
||||
sha256 ab1122aa9f9073ad1ec824edcd970b16a6a7881a34a18fd56c080debb2dca5d4 COPYING
|
||||
@@ -0,0 +1,178 @@
|
||||
################################################################################
|
||||
#
|
||||
# barebox
|
||||
#
|
||||
################################################################################
|
||||
|
||||
################################################################################
|
||||
# inner-barebox-package -- generates the KConfig logic and make targets needed
|
||||
# to support a barebox package. All barebox packages are built from the same
|
||||
# source (origin, version and patches). The remainder of the package
|
||||
# configuration is unique to each barebox package.
|
||||
#
|
||||
# argument 1 is the uppercase package name (used for variable name-space)
|
||||
################################################################################
|
||||
|
||||
define inner-barebox-package
|
||||
|
||||
$(1)_VERSION = $$(call qstrip,$$(BR2_TARGET_BAREBOX_VERSION))
|
||||
|
||||
ifeq ($$($(1)_VERSION),custom)
|
||||
# Handle custom Barebox tarballs as specified by the configuration
|
||||
$(1)_TARBALL = $$(call qstrip,$$(BR2_TARGET_BAREBOX_CUSTOM_TARBALL_LOCATION))
|
||||
$(1)_SITE = $$(patsubst %/,%,$$(dir $$($(1)_TARBALL)))
|
||||
$(1)_SOURCE = $$(notdir $$($(1)_TARBALL))
|
||||
else ifeq ($$(BR2_TARGET_BAREBOX_CUSTOM_GIT),y)
|
||||
$(1)_SITE = $$(call qstrip,$$(BR2_TARGET_BAREBOX_CUSTOM_GIT_REPO_URL))
|
||||
$(1)_SITE_METHOD = git
|
||||
# Override the default value of _SOURCE to 'barebox-*' so that it is not
|
||||
# downloaded a second time for barebox-aux; also alows avoiding the hash
|
||||
# check:
|
||||
$(1)_SOURCE = barebox-$$($(1)_VERSION)$$(BR_FMT_VERSION_git).tar.gz
|
||||
else
|
||||
# Handle stable official Barebox versions
|
||||
$(1)_SOURCE = barebox-$$($(1)_VERSION).tar.bz2
|
||||
$(1)_SITE = https://www.barebox.org/download
|
||||
endif
|
||||
|
||||
$(1)_DL_SUBDIR = barebox
|
||||
|
||||
$(1)_DEPENDENCIES = host-lzop
|
||||
$(1)_LICENSE = GPL-2.0 with exceptions
|
||||
ifeq ($(BR2_TARGET_BAREBOX_LATEST_VERSION),y)
|
||||
$(1)_LICENSE_FILES = COPYING
|
||||
endif
|
||||
|
||||
$(1)_CUSTOM_EMBEDDED_ENV_PATH = $$(call qstrip,$$(BR2_TARGET_$(1)_CUSTOM_EMBEDDED_ENV_PATH))
|
||||
|
||||
ifneq ($$(call qstrip,$$(BR2_TARGET_BAREBOX_CUSTOM_PATCH_DIR)),)
|
||||
define $(1)_APPLY_CUSTOM_PATCHES
|
||||
$$(APPLY_PATCHES) $$(@D) \
|
||||
$$(BR2_TARGET_BAREBOX_CUSTOM_PATCH_DIR) \*.patch
|
||||
endef
|
||||
|
||||
$(1)_POST_PATCH_HOOKS += $(1)_APPLY_CUSTOM_PATCHES
|
||||
endif
|
||||
|
||||
$(1)_INSTALL_IMAGES = YES
|
||||
ifneq ($$(BR2_TARGET_$(1)_BAREBOXENV),y)
|
||||
$(1)_INSTALL_TARGET = NO
|
||||
endif
|
||||
|
||||
ifeq ($$(KERNEL_ARCH),i386)
|
||||
$(1)_ARCH = x86
|
||||
else ifeq ($$(KERNEL_ARCH),x86_64)
|
||||
$(1)_ARCH = x86
|
||||
else ifeq ($$(KERNEL_ARCH),powerpc)
|
||||
$(1)_ARCH = ppc
|
||||
else ifeq ($$(KERNEL_ARCH),arm64)
|
||||
$(1)_ARCH = arm
|
||||
else
|
||||
$(1)_ARCH = $$(KERNEL_ARCH)
|
||||
endif
|
||||
|
||||
$(1)_MAKE_FLAGS = ARCH=$$($(1)_ARCH) CROSS_COMPILE="$$(TARGET_CROSS)"
|
||||
$(1)_MAKE_ENV = $$(TARGET_MAKE_ENV)
|
||||
|
||||
ifeq ($$(BR2_TARGET_$(1)_USE_DEFCONFIG),y)
|
||||
$(1)_KCONFIG_DEFCONFIG = $$(call qstrip,$$(BR2_TARGET_$(1)_BOARD_DEFCONFIG))_defconfig
|
||||
else ifeq ($$(BR2_TARGET_$(1)_USE_CUSTOM_CONFIG),y)
|
||||
$(1)_KCONFIG_FILE = $$(call qstrip,$$(BR2_TARGET_$(1)_CUSTOM_CONFIG_FILE))
|
||||
endif
|
||||
|
||||
$(1)_KCONFIG_FRAGMENT_FILES = $$(call qstrip,$$(BR2_TARGET_$(1)_CONFIG_FRAGMENT_FILES))
|
||||
$(1)_KCONFIG_EDITORS = menuconfig xconfig gconfig nconfig
|
||||
$(1)_KCONFIG_OPTS = $$($(1)_MAKE_FLAGS)
|
||||
|
||||
$(1)_KCONFIG_DEPENDENCIES = \
|
||||
$(BR2_BISON_HOST_DEPENDENCY) \
|
||||
$(BR2_FLEX_HOST_DEPENDENCY)
|
||||
|
||||
ifeq ($$(BR2_TARGET_$(1)_CUSTOM_ENV),y)
|
||||
$(1)_ENV_NAME = $$(notdir $$(call qstrip,\
|
||||
$$(BR2_TARGET_$(1)_CUSTOM_ENV_PATH)))
|
||||
define $(1)_BUILD_CUSTOM_ENV
|
||||
$$(@D)/scripts/bareboxenv -s \
|
||||
$$(call qstrip, $$(BR2_TARGET_$(1)_CUSTOM_ENV_PATH)) \
|
||||
$$(@D)/$$($(1)_ENV_NAME)
|
||||
endef
|
||||
define $(1)_INSTALL_CUSTOM_ENV
|
||||
cp $$(@D)/$$($(1)_ENV_NAME) $$(BINARIES_DIR)
|
||||
endef
|
||||
endif
|
||||
|
||||
ifneq ($$($(1)_CUSTOM_EMBEDDED_ENV_PATH),)
|
||||
define $(1)_KCONFIG_FIXUP_CUSTOM_EMBEDDED_ENV_PATH
|
||||
$$(call KCONFIG_ENABLE_OPT,CONFIG_DEFAULT_ENVIRONMENT)
|
||||
$$(call KCONFIG_SET_OPT,CONFIG_DEFAULT_ENVIRONMENT_PATH,"$$($(1)_CUSTOM_EMBEDDED_ENV_PATH)")
|
||||
endef
|
||||
endif
|
||||
|
||||
define $(1)_KCONFIG_FIXUP_BAREBOXENV
|
||||
$$(if $$(BR2_TARGET_$(1)_BAREBOXENV),\
|
||||
$$(call KCONFIG_ENABLE_OPT,CONFIG_BAREBOXENV_TARGET),\
|
||||
$$(call KCONFIG_DISABLE_OPT,CONFIG_BAREBOXENV_TARGET))
|
||||
endef
|
||||
|
||||
define $(1)_KCONFIG_FIXUP_CMDS
|
||||
$$($(1)_KCONFIG_FIXUP_CUSTOM_EMBEDDED_ENV_PATH)
|
||||
$$($(1)_KCONFIG_FIXUP_BAREBOXENV)
|
||||
endef
|
||||
|
||||
define $(1)_BUILD_CMDS
|
||||
$$($(1)_BUILD_BAREBOXENV_CMDS)
|
||||
$$(TARGET_MAKE_ENV) $$(MAKE) $$($(1)_MAKE_FLAGS) -C $$(@D)
|
||||
$$($(1)_BUILD_CUSTOM_ENV)
|
||||
endef
|
||||
|
||||
$(1)_IMAGE_FILES = $$(call qstrip,$$(BR2_TARGET_$(1)_IMAGE_FILE))
|
||||
|
||||
define $(1)_INSTALL_IMAGES_CMDS
|
||||
if test -n "$$($(1)_IMAGE_FILES)"; then \
|
||||
cp -L $$(foreach image,$$($(1)_IMAGE_FILES),$$(@D)/$$(image)) $$(BINARIES_DIR) ; \
|
||||
elif test -h $$(@D)/barebox-flash-image ; then \
|
||||
cp -L $$(@D)/barebox-flash-image $$(BINARIES_DIR)/barebox.bin ; \
|
||||
else \
|
||||
cp $$(@D)/barebox.bin $$(BINARIES_DIR);\
|
||||
fi
|
||||
$$($(1)_INSTALL_CUSTOM_ENV)
|
||||
endef
|
||||
|
||||
# Starting with barebox v2020.09.0, the kconfig used calls the
|
||||
# cross-compiler to check its capabilities. So we need the
|
||||
# toolchain before we can call the configurators.
|
||||
$(1)_KCONFIG_DEPENDENCIES += toolchain
|
||||
|
||||
ifeq ($$(BR2_TARGET_$(1)_BAREBOXENV),y)
|
||||
define $(1)_INSTALL_TARGET_CMDS
|
||||
cp $$(@D)/scripts/bareboxenv-target $$(TARGET_DIR)/usr/bin/bareboxenv
|
||||
endef
|
||||
endif
|
||||
|
||||
# Checks to give errors that the user can understand
|
||||
# Must be before we call to kconfig-package
|
||||
ifeq ($$(BR2_TARGET_$(1))$$(BR_BUILDING),yy)
|
||||
# We must use the user-supplied kconfig value, because
|
||||
# $(1)_KCONFIG_DEFCONFIG will at least contain the
|
||||
# trailing _defconfig
|
||||
ifeq ($$(or $$($(1)_KCONFIG_FILE),$$(call qstrip,$$(BR2_TARGET_$(1)_BOARD_DEFCONFIG))),)
|
||||
$$(error No Barebox config. Check your BR2_TARGET_$(1)_BOARD_DEFCONFIG or BR2_TARGET_$(1)_CUSTOM_CONFIG_FILE settings)
|
||||
endif
|
||||
endif
|
||||
|
||||
$$(eval $$(kconfig-package))
|
||||
|
||||
endef
|
||||
|
||||
################################################################################
|
||||
# barebox-package -- the target generator macro for barebox packages
|
||||
################################################################################
|
||||
|
||||
barebox-package=$(call inner-barebox-package,$(call UPPERCASE,$(pkgname)))
|
||||
|
||||
include boot/barebox/barebox/barebox.mk
|
||||
include boot/barebox/barebox-aux/barebox-aux.mk
|
||||
|
||||
ifeq ($(BR2_TARGET_BAREBOX)$(BR2_TARGET_BAREBOX_LATEST_VERSION),y)
|
||||
BR_NO_CHECK_HASH_FOR += $(BAREBOX_SOURCE)
|
||||
endif
|
||||
@@ -0,0 +1,80 @@
|
||||
choice
|
||||
prompt "Barebox configuration"
|
||||
default BR2_TARGET_BAREBOX_USE_DEFCONFIG
|
||||
|
||||
config BR2_TARGET_BAREBOX_USE_DEFCONFIG
|
||||
bool "Using a defconfig"
|
||||
|
||||
config BR2_TARGET_BAREBOX_USE_CUSTOM_CONFIG
|
||||
bool "Using a custom config file"
|
||||
|
||||
endchoice
|
||||
|
||||
config BR2_TARGET_BAREBOX_BOARD_DEFCONFIG
|
||||
string "board defconfig"
|
||||
depends on BR2_TARGET_BAREBOX_USE_DEFCONFIG
|
||||
help
|
||||
Name of the board for which Barebox should be built, without
|
||||
the _defconfig suffix.
|
||||
|
||||
config BR2_TARGET_BAREBOX_CUSTOM_CONFIG_FILE
|
||||
string "Configuration file path"
|
||||
depends on BR2_TARGET_BAREBOX_USE_CUSTOM_CONFIG
|
||||
help
|
||||
Path to the barebox configuration file
|
||||
|
||||
config BR2_TARGET_BAREBOX_CONFIG_FRAGMENT_FILES
|
||||
string "Additional configuration fragment files"
|
||||
help
|
||||
A space-separated list of configuration fragment files,
|
||||
that will be merged to the main Barebox configuration file.
|
||||
|
||||
config BR2_TARGET_BAREBOX_IMAGE_FILE
|
||||
string "Image file names"
|
||||
help
|
||||
Space-separated list of barebox images which will be copied to
|
||||
the images directory.
|
||||
|
||||
If left empty, defaults to:
|
||||
- barebox.bin for barebox versions older than 2012.10.
|
||||
- barebox-flash-image for later versions.
|
||||
|
||||
config BR2_TARGET_BAREBOX_BAREBOXENV
|
||||
bool "bareboxenv tool in target"
|
||||
help
|
||||
Install bareboxenv tool in target.
|
||||
|
||||
config BR2_TARGET_BAREBOX_CUSTOM_ENV
|
||||
bool "Generate an environment image"
|
||||
help
|
||||
Generate a custom environment image. This environment will
|
||||
contain the variables and scripts to be used at boot by
|
||||
barebox.
|
||||
|
||||
config BR2_TARGET_BAREBOX_CUSTOM_ENV_PATH
|
||||
string "Environment path"
|
||||
depends on BR2_TARGET_BAREBOX_CUSTOM_ENV
|
||||
help
|
||||
Path to the directory containing the custom barebox
|
||||
environment. Depending on your setup, it will probably be
|
||||
based on either the content of the defaultenv or
|
||||
defaultenv-2 directories in the barebox source code, plus
|
||||
the additions needed. The output will be an image in the
|
||||
barebox devfs format, stored in the images directory, with
|
||||
the same name as the directory name given here.
|
||||
|
||||
config BR2_TARGET_BAREBOX_CUSTOM_EMBEDDED_ENV_PATH
|
||||
string "Embedded environment path"
|
||||
help
|
||||
If this option is not empty, it is the path to a custom
|
||||
embedded barebox environment. This image will be used when
|
||||
the environment found in the environment sector is
|
||||
invalid. This option sets the barebox Kconfig option
|
||||
CONFIG_DEFAULT_ENVIRONMENT_PATH to the specified path. This
|
||||
way it is possible to use Buildroot variables like
|
||||
TOPDIR etc. to refer to the custom environment.
|
||||
|
||||
Depending on your setup, the custom embedded environment
|
||||
will probably be based on either the content of the
|
||||
defaultenv or defaultenv-2 directories in the barebox source
|
||||
code.
|
||||
+1
@@ -0,0 +1 @@
|
||||
../barebox.hash
|
||||
@@ -0,0 +1,8 @@
|
||||
################################################################################
|
||||
#
|
||||
# barebox
|
||||
#
|
||||
################################################################################
|
||||
|
||||
# Instantiate the barebox package
|
||||
$(eval $(barebox-package))
|
||||
Reference in New Issue
Block a user