mirror of
https://github.com/motioneye-project/motioneyeos.git
synced 2025-07-28 21:56:31 +00:00
core: support description for br2-external trees
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
This commit is contained in:
parent
339e1c9500
commit
49117c1028
5
Makefile
5
Makefile
@ -980,7 +980,7 @@ define list-defconfigs
|
|||||||
[ -f "$${defconfig}" ] || continue; \
|
[ -f "$${defconfig}" ] || continue; \
|
||||||
if $${first}; then \
|
if $${first}; then \
|
||||||
if [ "$(2)" ]; then \
|
if [ "$(2)" ]; then \
|
||||||
printf "External configs in $(2):\n"; \
|
printf 'External configs in "$(call qstrip,$(2))":\n'; \
|
||||||
else \
|
else \
|
||||||
printf "Built-in configs:\n"; \
|
printf "Built-in configs:\n"; \
|
||||||
fi; \
|
fi; \
|
||||||
@ -997,7 +997,8 @@ endef
|
|||||||
list-defconfigs:
|
list-defconfigs:
|
||||||
$(call list-defconfigs,$(TOPDIR))
|
$(call list-defconfigs,$(TOPDIR))
|
||||||
$(foreach name,$(BR2_EXTERNAL_NAMES),\
|
$(foreach name,$(BR2_EXTERNAL_NAMES),\
|
||||||
$(call list-defconfigs,$(BR2_EXTERNAL_$(name)_PATH),$(name))$(sep))
|
$(call list-defconfigs,$(BR2_EXTERNAL_$(name)_PATH),\
|
||||||
|
$(BR2_EXTERNAL_$(name)_DESC))$(sep))
|
||||||
|
|
||||||
release: OUT = buildroot-$(BR2_VERSION)
|
release: OUT = buildroot-$(BR2_VERSION)
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@ set -e
|
|||||||
# The names and locations of the br2-external trees, once validated.
|
# The names and locations of the br2-external trees, once validated.
|
||||||
declare -a BR2_EXT_NAMES
|
declare -a BR2_EXT_NAMES
|
||||||
declare -A BR2_EXT_PATHS
|
declare -A BR2_EXT_PATHS
|
||||||
|
declare -A BR2_EXT_DESCS
|
||||||
|
|
||||||
# URL to manual for help in converting old br2-external trees.
|
# URL to manual for help in converting old br2-external trees.
|
||||||
# Escape '#' so that make does not consider it a comment.
|
# Escape '#' so that make does not consider it a comment.
|
||||||
@ -67,7 +68,7 @@ do_validate() {
|
|||||||
|
|
||||||
do_validate_one() {
|
do_validate_one() {
|
||||||
local br2_ext="${1}"
|
local br2_ext="${1}"
|
||||||
local br2_name n
|
local br2_name br2_desc n
|
||||||
|
|
||||||
if [ ! -d "${br2_ext}" ]; then
|
if [ ! -d "${br2_ext}" ]; then
|
||||||
error "'%s': no such file or directory\n" "${br2_ext}"
|
error "'%s': no such file or directory\n" "${br2_ext}"
|
||||||
@ -94,6 +95,7 @@ do_validate_one() {
|
|||||||
error "'%s': name '%s' is already used in '%s'\n" \
|
error "'%s': name '%s' is already used in '%s'\n" \
|
||||||
"${br2_ext}" "${br2_name}" "${BR2_EXT_PATHS["${br2_name}"]}"
|
"${br2_ext}" "${br2_name}" "${BR2_EXT_PATHS["${br2_name}"]}"
|
||||||
fi
|
fi
|
||||||
|
br2_desc="$(sed -r -e '/^desc: +(.*)$/!d; s//\1/' "${br2_ext}/external.desc")"
|
||||||
if [ ! -f "${br2_ext}/external.mk" ]; then
|
if [ ! -f "${br2_ext}/external.mk" ]; then
|
||||||
error "'%s/external.mk': no such file or directory\n" "${br2_ext}"
|
error "'%s/external.mk': no such file or directory\n" "${br2_ext}"
|
||||||
fi
|
fi
|
||||||
@ -104,6 +106,7 @@ do_validate_one() {
|
|||||||
# Register this br2-external tree
|
# Register this br2-external tree
|
||||||
BR2_EXT_NAMES+=( "${br2_name}" )
|
BR2_EXT_NAMES+=( "${br2_name}" )
|
||||||
BR2_EXT_PATHS["${br2_name}"]="${br2_ext}"
|
BR2_EXT_PATHS["${br2_name}"]="${br2_ext}"
|
||||||
|
BR2_EXT_DESCS["${br2_name}"]="${br2_desc:-${br2_name}}"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Generate the .mk snippet that defines makefile variables
|
# Generate the .mk snippet that defines makefile variables
|
||||||
@ -135,10 +138,12 @@ do_mk() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
for br2_name in "${BR2_EXT_NAMES[@]}"; do
|
for br2_name in "${BR2_EXT_NAMES[@]}"; do
|
||||||
|
br2_desc="${BR2_EXT_DESCS["${br2_name}"]}"
|
||||||
br2_ext="${BR2_EXT_PATHS["${br2_name}"]}"
|
br2_ext="${BR2_EXT_PATHS["${br2_name}"]}"
|
||||||
printf '\n'
|
printf '\n'
|
||||||
printf 'BR2_EXTERNAL_NAMES += %s\n' "${br2_name}"
|
printf 'BR2_EXTERNAL_NAMES += %s\n' "${br2_name}"
|
||||||
printf 'BR2_EXTERNAL_%s_PATH = %s\n' "${br2_name}" "${br2_ext}"
|
printf 'BR2_EXTERNAL_%s_PATH = %s\n' "${br2_name}" "${br2_ext}"
|
||||||
|
printf 'BR2_EXTERNAL_%s_DESC = %s\n' "${br2_name}" "${br2_desc}"
|
||||||
printf 'BR2_EXTERNAL_DIRS += %s\n' "${br2_ext}"
|
printf 'BR2_EXTERNAL_DIRS += %s\n' "${br2_ext}"
|
||||||
printf 'BR2_EXTERNAL_MKS += %s/external.mk\n' "${br2_ext}"
|
printf 'BR2_EXTERNAL_MKS += %s/external.mk\n' "${br2_ext}"
|
||||||
done
|
done
|
||||||
@ -160,11 +165,12 @@ do_kconfig() {
|
|||||||
printf '\n'
|
printf '\n'
|
||||||
|
|
||||||
for br2_name in "${BR2_EXT_NAMES[@]}"; do
|
for br2_name in "${BR2_EXT_NAMES[@]}"; do
|
||||||
|
br2_desc="${BR2_EXT_DESCS["${br2_name}"]}"
|
||||||
br2_ext="${BR2_EXT_PATHS["${br2_name}"]}"
|
br2_ext="${BR2_EXT_PATHS["${br2_name}"]}"
|
||||||
if [ ${#BR2_EXT_NAMES[@]} -gt 1 ]; then
|
if [ ${#BR2_EXT_NAMES[@]} -gt 1 ]; then
|
||||||
printf 'menu "%s"\n' "${br2_name}"
|
printf 'menu "%s"\n' "${br2_desc}"
|
||||||
fi
|
fi
|
||||||
printf 'comment "%s (in %s)"\n' "${br2_name}" "${br2_ext}"
|
printf 'comment "%s (in %s)"\n' "${br2_desc}" "${br2_ext}"
|
||||||
printf 'config BR2_EXTERNAL_%s_PATH\n' "${br2_name}"
|
printf 'config BR2_EXTERNAL_%s_PATH\n' "${br2_name}"
|
||||||
printf '\tstring\n'
|
printf '\tstring\n'
|
||||||
printf '\tdefault "%s"\n' "${br2_ext}"
|
printf '\tdefault "%s"\n' "${br2_ext}"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user