diff options
author | Michael Olbrich <m.olbrich@pengutronix.de> | 2019-02-19 10:10:11 +0100 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2019-02-20 16:24:21 +0100 |
commit | bd3c30891b523312c9cb583a179704ca715fad3a (patch) | |
tree | 41dec0a79c946de43fcce7d54247eae6eb27e53f | |
parent | e6be973866406330f3b5c80d96a23d010e871e72 (diff) | |
download | ptxdist-bd3c30891b523312c9cb583a179704ca715fad3a.tar.gz ptxdist-bd3c30891b523312c9cb583a179704ca715fad3a.tar.xz |
ptxdist: add new command 'bsp-info'
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rwxr-xr-x | bin/ptxdist | 6 | ||||
-rw-r--r-- | doc/ref_parameter.inc | 4 | ||||
-rw-r--r-- | rules/post/ptxd_make_world_package_info.make | 12 | ||||
-rw-r--r-- | scripts/lib/ptxd_make_world_package_info.sh | 46 |
4 files changed, 67 insertions, 1 deletions
diff --git a/bin/ptxdist b/bin/ptxdist index 15511e5c7..1a69c3bc7 100755 --- a/bin/ptxdist +++ b/bin/ptxdist @@ -970,6 +970,7 @@ Misc: use 'newpackage help' for a longer description nfsroot run a userspace NFS server and export the nfsroot gdb run cross gdb with configured sysroot etc. + bsp-info print some basic information about the BSP package-info <package> print some basic information about the package print <var> print the contents of a variable, in the way it is known by "make" @@ -1884,6 +1885,11 @@ EOF fi exit ;; + bsp-info) + check_config && + check_deps && + ptxd_make_log bsp-info + ;; clean) check_config && check_deps && diff --git a/doc/ref_parameter.inc b/doc/ref_parameter.inc index 3800db446..0b11563c9 100644 --- a/doc/ref_parameter.inc +++ b/doc/ref_parameter.inc @@ -196,6 +196,10 @@ Misc Actions run the cross gdb from the toolchain. The sysroot and other search paths are configured to ensure that gdb finds all available debug files. +``bsp-info`` + show some basic information about the BSP. The currently used configs, + all layers, the images that are build, etc. + ``package-info <pkg>`` show some basic information about the package. This includes the version, URL and various paths and directories. The paths for menu and rule file diff --git a/rules/post/ptxd_make_world_package_info.make b/rules/post/ptxd_make_world_package_info.make index 56d653da9..70a0a28f4 100644 --- a/rules/post/ptxd_make_world_package_info.make +++ b/rules/post/ptxd_make_world_package_info.make @@ -8,7 +8,7 @@ # see the README file. # -PHONY += ptx-package-info +PHONY += ptx-package-info bsp-info ptx-package-info: world/package-info = \ @@ -29,4 +29,14 @@ $(STATEDIR)/%.package-info: ptx-package-info @$(call world/package-info, $(PTX_MAP_TO_PACKAGE_$(*))) @$(call finish) +ptx/bsp-info = \ + $(ptx/env) \ + bsp_images="$(IMAGE_PACKAGES)" \ + ptxd_make_bsp_info + +bsp-info: + @$(call targetinfo) + @$(call ptx/bsp-info) + @$(call finish) + # vim: syntax=make diff --git a/scripts/lib/ptxd_make_world_package_info.sh b/scripts/lib/ptxd_make_world_package_info.sh index 5c2f997e7..d53eba8dc 100644 --- a/scripts/lib/ptxd_make_world_package_info.sh +++ b/scripts/lib/ptxd_make_world_package_info.sh @@ -60,3 +60,49 @@ ptxd_make_world_package_info() { do_echo "${image_pkgs}" } export -f ptxd_make_world_package_info + +ptxd_make_bsp_info() { + ptxd_make_world_init || return + do_echo() { + if [ -n "${!#}" ]; then + if [ ${#} -gt 1 ]; then + printf "%-17s %s\n" "${1}" "${2}" + else + echo + fi + fi + } + do_echo "vendor:" "$(ptxd_get_ptxconf PTXCONF_PROJECT_VENDOR)" + do_echo "project:" "$(ptxd_get_ptxconf PTXCONF_PROJECT)" + do_echo "version:" "$(ptxd_get_ptxconf PTXCONF_PROJECT_VERSION)" + echo + do_echo "platform:" "$(ptxd_get_ptxconf PTXCONF_PLATFORM)" + do_echo "platform version:" "$(ptxd_get_ptxconf PTXCONF_PLATFORM_VERSION)" + echo + + for layer in "${PTXDIST_LAYERS[@]}"; do + if [ "${layer}" = "${PTXDIST_WORKSPACE}" ]; then + do_echo "BSP:" "${layer}" + elif [ "${layer}" = "${PTXDIST_TOPDIR}" ]; then + do_echo "PTXdist:" "${layer}" + elif [ -h "${layer}" ]; then + do_echo "Layer:" "$(ptxd_print_path "${layer}") -> $(ptxd_print_path "$(readlink "${layer}")")" + else + do_echo "Layer:" "$(ptxd_print_path "${layer}")" + fi + done + echo + + do_echo "ptxconfig:" "$(ptxd_print_path "${PTXDIST_PTXCONFIG}")" + do_echo "platformconfig:" "$(ptxd_print_path "${PTXDIST_PLATFORMCONFIG}")" + do_echo "collectionconfig:" "$(ptxd_print_path "${PTXDIST_COLLECTIONCONFIG}")" + echo + + prefix="images:" + for image in ${bsp_images}; do + do_echo "${prefix}" "${image}" + unset prefix + done + echo +} +export -f ptxd_make_bsp_info |