diff options
author | Marc Kleine-Budde <mkl@pengutronix.de> | 2009-06-10 00:17:26 +0000 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2009-06-10 00:17:26 +0000 |
commit | e975e4d085e9a02411880ab7f206c3f4373794ca (patch) | |
tree | 1d8808a50e656870b80f11c0e13a4d4899ae50a0 /bin | |
parent | 886ec7825c3314c72b609965c84ec16e8a38234d (diff) | |
download | ptxdist-e975e4d085e9a02411880ab7f206c3f4373794ca.tar.gz ptxdist-e975e4d085e9a02411880ab7f206c3f4373794ca.tar.xz |
[ptxdist] make menu more dynamic
kernel and platformconfig are now dynamic, too
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
git-svn-id: https://svn.pengutronix.de/svn/ptxdist/trunks/ptxdist-trunk@10684 33e552b5-05e3-0310-8538-816dae2090ed
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/ptxdist | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/bin/ptxdist b/bin/ptxdist index 1520c6563..1a7c7cde1 100755 --- a/bin/ptxdist +++ b/bin/ptxdist @@ -38,21 +38,25 @@ menu_select() { # le menu # menu() { - local kernel_version="$(ptxd_get_ptxconf PTXCONF_KERNEL_VERSION)" - local u_boot_v2_version="$(ptxd_get_ptxconf PTXCONF_U_BOOT_V2_VERSION)" - declare -a u_boot_v2_string - local platform="$(ptxd_get_ptxconf PTXCONF_PLATFORM)" - local ptxconfig cmd + local ptxconfig="$(readlink -e "${PTXDIST_PTXCONFIG}")" + ptxconfig="${ptxconfig#${PTXDIST_WORKSPACE}/}" - kernel_version="${kernel_version:-none}" + declare -a menu + if ! ptxd_get_ptxconf PTXCONF_NO_PLATFORM > /dev/null; then + menu=( "${menu[@]}" "platformconfig" "Configure Hardware Platform" ) + fi - if [ -n "${u_boot_v2_version}" ]; then - u_boot_v2_string=("u-boot-v2" "Configure U-Boot-v2 (${u_boot_v2_version})") + local kernel_version="$(ptxd_get_ptxconf PTXCONF_KERNEL_VERSION)" + if [ -n "${kernel_version}" ]; then + menu=( "${menu[@]}" "kernel" "Configure Kernel (${kernel_version})" ) fi - ptxconfig="$(readlink -e "${PTXDIST_PTXCONFIG}")" - ptxconfig="${ptxconfig#${PTXDIST_WORKSPACE}/}" + local u_boot_v2_version="$(ptxd_get_ptxconf PTXCONF_U_BOOT_V2_VERSION)" + if [ -n "${u_boot_v2_version}" ]; then + menu=( "${menu[@]}" "u-boot-v2" "Configure U-Boot-v2 (${u_boot_v2_version})" ) + fi + local platform="$(ptxd_get_ptxconf PTXCONF_PLATFORM)" if [ -z "${platform}" -a -e "${PTXDIST_PLATFORMCONFIG}" ]; then platform="$(readlink -e "${PTXDIST_PLATFORMCONFIG}")" platform="${platform#${PTXDIST_WORKSPACE}/}" @@ -60,6 +64,7 @@ menu() { exec 3>&1 exec 4>&1 + local cmd cmd="$(${PTX_DIALOG} \ --clear \ --title "PTXdist Main Menu" \ @@ -69,9 +74,7 @@ menu() { --menu "" 0 0 0 \ -- \ "menuconfig" "Configure Software Platform" \ - "platformconfig" "Configure Hardware Platform" \ - "kernel" "Configure Kernel (${kernel_version})" \ - "${u_boot_v2_string[@]}" \ + "${menu[@]}" \ "--------------" "--------------------------------------------" \ "select" "Select Software Platform (${ptxconfig})" \ "platform" "Select Hardware Platform (${platform})" \ |