Fork of the vendor (Boundary Devices) u-boot for Reform 2, with minor tweaks. The goal is to migrate to mainstream u-boot or barebox ASAP. The main impediment so far is the 4GB RAM config.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

43 lines
1.0 KiB

  1. #! /bin/bash
  2. # SPDX-License-Identifier: GPL-2.0+
  3. #
  4. # Copyright (C) 2016, Lukasz Majewski <l.majewski@majess.pl>
  5. #
  6. # This file extracts default envs from built u-boot
  7. # usage: get_default_envs.sh [build dir] > u-boot-env-default.txt
  8. set -ue
  9. : "${OBJCOPY:=${CROSS_COMPILE:-}objcopy}"
  10. ENV_OBJ_FILE="built-in.o"
  11. ENV_OBJ_FILE_COPY="copy_${ENV_OBJ_FILE}"
  12. echoerr() { echo "$@" 1>&2; }
  13. if [ "$#" -eq 1 ]; then
  14. path=${1}
  15. else
  16. path=$(readlink -f $0)
  17. path=${path%/scripts*}
  18. fi
  19. env_obj_file_path=$(find ${path} -path "*/env/*" -not -path "*/spl/*" \
  20. -not -path "*/tools/*" -name "${ENV_OBJ_FILE}")
  21. [ -z "${env_obj_file_path}" ] && \
  22. { echoerr "File '${ENV_OBJ_FILE}' not found!"; exit 1; }
  23. cp ${env_obj_file_path} ${ENV_OBJ_FILE_COPY}
  24. # NOTE: objcopy saves its output to file passed in
  25. # (copy_${ENV_OBJ_FILE} in this case)
  26. ${OBJCOPY} -O binary -j ".rodata.default_environment" ${ENV_OBJ_FILE_COPY}
  27. # Replace default '\0' with '\n' and sort entries
  28. tr '\0' '\n' < ${ENV_OBJ_FILE_COPY} | sort -u
  29. rm ${ENV_OBJ_FILE_COPY}
  30. exit 0