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.
 
 
 
 
 
 

99 lines
3.1 KiB

  1. #!/bin/bash
  2. # syntax ./boundary_insert_if CONFIG_1 CONFIG_2
  3. #insert CONFIG_1 if CONFIG_2 is already present in .h file, and remove from .h file
  4. #i.e. ./boundary_move CONFIG_PHY_MICREL CONFIG_PHY_MICREL_KSZ9021
  5. insert_configs=$1;
  6. check_config=$2;
  7. boards=`ls -d board/boundary/* | sed 's.board/boundary/..'`;
  8. numboards=0;
  9. numsuccess=0;
  10. numfailures=0;
  11. skipped=0;
  12. for board in ${boards} ; do
  13. update_cnt=0;
  14. already_there=0;
  15. target="";
  16. defconfigs="";
  17. hfile="";
  18. if [ -e board/boundary/${board}/Kconfig ] ; then
  19. target=`grep '^if TARGET_' board/boundary/${board}/Kconfig | sed 's.if ..'`;
  20. echo board=${board} target=${target};
  21. hfile=`grep -A1 SYS_CONFIG_NAME board/boundary/${board}/Kconfig | grep default | sed 's.default "..' | sed 's."..' | sed 's/[ \x09]*//'`;
  22. defconfigs=`git grep -w CONFIG_${target} configs/ | sed 's.configs/..'| sed 's/_defconfig:.*$//'`;
  23. fi
  24. board_cfgs=":"
  25. for defconfig in ${defconfigs} ; do
  26. cfgs=""
  27. for insert_config in ${insert_configs} ; do
  28. if [[ ${insert_config} == *=* ]] ; then
  29. cnt=`sed -n "/${insert_config}/=" configs/${defconfig}_defconfig`
  30. else
  31. cnt=`sed -n "/${insert_config}=/=" configs/${defconfig}_defconfig`
  32. fi
  33. if [ "${cnt}" != "" ] ; then
  34. already_there=`expr $already_there + 1`;
  35. else
  36. cfgs="${cfgs} ${insert_config}"
  37. fi
  38. done
  39. cnt=`sed -n "/${check_config}/=" include/configs/${hfile}.h`
  40. if [ "${cnt}" == "" ] ; then
  41. cfgs=""
  42. fi
  43. if [ "${cfgs}" != "" ] ; then
  44. make ${defconfig}_defconfig;
  45. for insert_config in ${cfgs} ; do
  46. if [[ ${insert_config} == *=* ]] ; then
  47. echo "${insert_config}" >>.config;
  48. else
  49. echo "${insert_config}=y" >>.config;
  50. fi
  51. done
  52. make savedefconfig;
  53. diff -q defconfig configs/${defconfig}_defconfig;
  54. if [ $? -eq 0 ] ; then
  55. already_there=`expr $already_there + 1`;
  56. else
  57. if [ $? -eq 1 ] ; then
  58. cp defconfig configs/${defconfig}_defconfig;
  59. echo updated ${defconfig}_defconfig;
  60. # git update-index configs/${defconfig}_defconfig;
  61. update_cnt=`expr $update_cnt + 1`;
  62. for insert_config in ${cfgs} ; do
  63. if [ `expr "${board_cfgs}" : "[A-Z0-9_:]*:${insert_config}:"` -eq 0 ] ; then
  64. cnt=`sed -n "/${insert_config}=/=" configs/${defconfig}_defconfig`
  65. if [ "${cnt}" != "" ] ; then
  66. board_cfgs="${board_cfgs}:${insert_config}:"
  67. fi
  68. fi
  69. done
  70. else
  71. numfailures=`expr $numfailures + 1`;
  72. echo -e "\n\n\n!!!!!!!! insert failure for ${defconfig}_defconfig !!!!!!!!!!!!\n\n";
  73. read line;
  74. fi
  75. fi
  76. fi
  77. done
  78. sed -i "/${check_config}/d" include/configs/${hfile}.h
  79. if [ ${update_cnt} != "0" ] ; then
  80. echo "${board}: ${update_cnt} defconfigs updated, ${already_there} already there";
  81. numsuccess=`expr $numsuccess + 1`;
  82. if [ ${board_cfgs} != ":" ] ; then
  83. # git c -m"${board}: add ${board_cfgs//::/ } to defconfigs";
  84. echo updating ${board} ${board_cfgs//::/ }
  85. else
  86. # git c -m"${board}: reorder defconfigs";
  87. echo reorder ${board} ${board_cfgs//::/ }
  88. fi
  89. else
  90. skipped=`expr $skipped + 1`;
  91. fi
  92. numboards=`expr $numboards + 1`;
  93. done
  94. echo -e "\n\ninsert for ${numboards} boards. ${numsuccess} succeeded and ${numfailures} failed, ${skipped} skipped";