summaryrefslogtreecommitdiffstats
path: root/meta-xilinx-standalone-experimental
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@xilinx.com>2022-03-07 11:56:24 -0800
committerMark Hatle <mark.hatle@xilinx.com>2022-03-28 13:53:49 -0700
commit9fbdad432a9b31aaf4d09473ba83eacd5f67f8ed (patch)
treeff4ff397eb07dd62f160b422f2c753c24095705a /meta-xilinx-standalone-experimental
parent515d31f7b5f4c9b132e0735c1fcda27e067012a9 (diff)
downloadmeta-xilinx-9fbdad432a9b31aaf4d09473ba83eacd5f67f8ed.tar.gz
dt-processor.sh: Add -l argument to write local.conf to a file
The -l argument will write the local.conf fragment to a file of the user's choice. This can help automation that uses the dt-processor.sh. Signed-off-by: Mark Hatle <mark.hatle@xilinx.com>
Diffstat (limited to 'meta-xilinx-standalone-experimental')
-rwxr-xr-xmeta-xilinx-standalone-experimental/recipes-core/meta/files/dt-processor.sh76
1 files changed, 46 insertions, 30 deletions
diff --git a/meta-xilinx-standalone-experimental/recipes-core/meta/files/dt-processor.sh b/meta-xilinx-standalone-experimental/recipes-core/meta/files/dt-processor.sh
index d0b719cb..4dc9a3e7 100755
--- a/meta-xilinx-standalone-experimental/recipes-core/meta/files/dt-processor.sh
+++ b/meta-xilinx-standalone-experimental/recipes-core/meta/files/dt-processor.sh
@@ -39,6 +39,7 @@ $0
39 [-o <overlay_dtb>] Generate overlay dts 39 [-o <overlay_dtb>] Generate overlay dts
40 [-e <external_fpga>] Apply a partial overlay 40 [-e <external_fpga>] Apply a partial overlay
41 [-m <machine>] zynqmp or versal 41 [-m <machine>] zynqmp or versal
42 [-l <config_file>] write local.conf changes to this file
42 43
43EOF 44EOF
44 exit 45 exit
@@ -47,7 +48,7 @@ EOF
47parse_args() { 48parse_args() {
48 [ $# -eq 0 ] && usage 49 [ $# -eq 0 ] && usage
49 50
50 while getopts ":c:s:d:o:e:m:h" opt; do 51 while getopts ":c:s:d:o:e:m:l:h" opt; do
51 case ${opt} in 52 case ${opt} in
52 c) config_dir=$OPTARG ;; 53 c) config_dir=$OPTARG ;;
53 s) system_dtb=$OPTARG ;; 54 s) system_dtb=$OPTARG ;;
@@ -55,6 +56,7 @@ parse_args() {
55 d) domain_file=$OPTARG ;; 56 d) domain_file=$OPTARG ;;
56 e) external_fpga=$OPTARG ;; 57 e) external_fpga=$OPTARG ;;
57 m) machine=$OPTARG ;; 58 m) machine=$OPTARG ;;
59 l) localconf=$OPTARG ;;
58 h) usage ;; 60 h) usage ;;
59 :) error "Missing argument for -$OPTARG" ;; 61 :) error "Missing argument for -$OPTARG" ;;
60 \?) error "Invalid option -$OPTARG" 62 \?) error "Invalid option -$OPTARG"
@@ -75,7 +77,7 @@ detect_machine() {
75 pmc-microblaze | psm-microblaze) 77 pmc-microblaze | psm-microblaze)
76 machine="versal" ;; 78 machine="versal" ;;
77 esac 79 esac
78 done <cpu-list.tmp 80 done <${cpulist}
79 fi 81 fi
80 82
81 # Machine not provided and we cannot identify.. 83 # Machine not provided and we cannot identify..
@@ -811,44 +813,41 @@ parse_cpus() {
811 warn "Unknown CPU ${cpu}" 813 warn "Unknown CPU ${cpu}"
812 814
813 esac 815 esac
814 done <cpu-list.tmp 816 done <${cpulist}
815} 817}
816 818
817gen_local_conf() { 819gen_local_conf() {
818 echo 820 echo "# Adjust BASE_TMPDIR if you want to move the tmpdirs elsewhere" >> $1
819 echo "To enable this, add the following to your local.conf:" 821 echo "BASE_TMPDIR = \"\${TOPDIR}\"" >> $1
820 echo 822 [ -n "${system_conf}" ] && echo "require ${system_conf}" >> $1
821 echo "# Adjust BASE_TMPDIR if you want to move the tmpdirs elsewhere" 823 echo "SYSTEM_DTFILE = \"${system_dtb}\"" >> $1
822 echo "BASE_TMPDIR = \"\${TOPDIR}\"" 824 echo "BBMULTICONFIG += \"${multiconf}\"" >> $1
823 [ -n "${system_conf}" ] && echo "require ${system_conf}"
824 echo "SYSTEM_DTFILE = \"${system_dtb}\""
825 echo "BBMULTICONFIG += \"${multiconf}\""
826 if [ -n "${fsbl_mcdepends}" ]; then 825 if [ -n "${fsbl_mcdepends}" ]; then
827 echo "FSBL_DEPENDS = \"\"" 826 echo "FSBL_DEPENDS = \"\"" >> $1
828 echo "FSBL_MCDEPENDS = \"${fsbl_mcdepends}\"" 827 echo "FSBL_MCDEPENDS = \"${fsbl_mcdepends}\"" >> $1
829 echo "FSBL_DEPLOY_DIR = \"${fsbl_deploy_dir}\"" 828 echo "FSBL_DEPLOY_DIR = \"${fsbl_deploy_dir}\"" >> $1
830 fi 829 fi
831 if [ -n "${r5fsbl_mcdepends}" ]; then 830 if [ -n "${r5fsbl_mcdepends}" ]; then
832 echo "R5FSBL_DEPENDS = \"\"" 831 echo "R5FSBL_DEPENDS = \"\"" >> $1
833 echo "R5FSBL_MCDEPENDS = \"${r5fsbl_mcdepends}\"" 832 echo "R5FSBL_MCDEPENDS = \"${r5fsbl_mcdepends}\"" >> $1
834 echo "R5FSBL_DEPLOY_DIR = \"${r5fsbl_deploy_dir}\"" 833 echo "R5FSBL_DEPLOY_DIR = \"${r5fsbl_deploy_dir}\"" >> $1
835 fi 834 fi
836 if [ -n "${pmu_mcdepends}" ]; then 835 if [ -n "${pmu_mcdepends}" ]; then
837 echo "PMU_DEPENDS = \"\"" 836 echo "PMU_DEPENDS = \"\"" >> $1
838 echo "PMU_MCDEPENDS = \"${pmu_mcdepends}\"" 837 echo "PMU_MCDEPENDS = \"${pmu_mcdepends}\"" >> $1
839 echo "PMU_FIRMWARE_DEPLOY_DIR = \"${pmu_firmware_deploy_dir}\"" 838 echo "PMU_FIRMWARE_DEPLOY_DIR = \"${pmu_firmware_deploy_dir}\"" >> $1
840 fi 839 fi
841 if [ -n "${plm_mcdepends}" ]; then 840 if [ -n "${plm_mcdepends}" ]; then
842 echo "PLM_DEPENDS = \"\"" 841 echo "PLM_DEPENDS = \"\"" >> $1
843 echo "PLM_MCDEPENDS = \"${plm_mcdepends}\"" 842 echo "PLM_MCDEPENDS = \"${plm_mcdepends}\"" >> $1
844 echo "PLM_DEPLOY_DIR = \"${plm_deploy_dir}\"" 843 echo "PLM_DEPLOY_DIR = \"${plm_deploy_dir}\"" >> $1
845 fi 844 fi
846 if [ -n "${psm_mcdepends}" ]; then 845 if [ -n "${psm_mcdepends}" ]; then
847 echo "PSM_DEPENDS = \"\"" 846 echo "PSM_DEPENDS = \"\"" >> $1
848 echo "PSM_MCDEPENDS = \"${psm_mcdepends}\"" 847 echo "PSM_MCDEPENDS = \"${psm_mcdepends}\"" >> $1
849 echo "PSM_FIRMWARE_DEPLOY_DIR = \"${psm_firmware_deploy_dir}\"" 848 echo "PSM_FIRMWARE_DEPLOY_DIR = \"${psm_firmware_deploy_dir}\"" >> $1
850 fi 849 fi
851 [ "${machine}" = "versal" ] && echo "PDI_PATH = \"__PATH TO PDI FILE HERE__\"" 850 [ "${machine}" = "versal" ] && echo "PDI_PATH = \"__PATH TO PDI FILE HERE__\"" >> $1
852 echo 851 echo
853} 852}
854 853
@@ -863,13 +862,16 @@ multiconf=""
863 862
864[ -z "${lopper}" ] && error "Unable to find lopper, please source the prestep environment" 863[ -z "${lopper}" ] && error "Unable to find lopper, please source the prestep environment"
865 864
865cpulist=$(mktemp)
866
867priordir=$(pwd)
866# Generate CPU list 868# Generate CPU list
867cd "${config_dir}" || exit 869cd "${config_dir}" || exit
868mkdir -p dtb multiconfig/includes 870mkdir -p dtb multiconfig/includes
869( 871(
870 cd dtb || error "Unable to cd to dtb dir" 872 cd dtb || error "Unable to cd to dtb dir"
871 ${lopper} -f --enhanced -i "${lops_dir}/lop-xilinx-id-cpus.dts" "${system_dtb}" \ 873 ${lopper} -f --enhanced -i "${lops_dir}/lop-xilinx-id-cpus.dts" "${system_dtb}" \
872 /dev/null >"../cpu-list.tmp" || error "lopper failed" 874 /dev/null > ${cpulist} || error "lopper failed"
873 rm -f "lop-xilinx-id-cpus.dts.dtb" 875 rm -f "lop-xilinx-id-cpus.dts.dtb"
874) 876)
875 877
@@ -877,7 +879,21 @@ detect_machine
877 879
878parse_cpus 880parse_cpus
879 881
880gen_local_conf 882cd ${priordir}
883if [ -z "${localconf}" ]; then
884 echo
885 echo "To enable this, add the following to your local.conf:"
886 echo
887 tmpfile=$(mktemp)
888 gen_local_conf ${tmpfile}
889 cat $tmpfile
890 rm $tmpfile
891else
892 echo
893 echo "Configuration for local.conf written to ${localconf}"
894 echo
895 gen_local_conf ${localconf}
896fi
881 897
882# Cleanup our temp file 898# Cleanup our temp file
883rm cpu-list.tmp 899rm ${cpulist}