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.
 
 
 
 
 
 

94 lines
2.9 KiB

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