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.2KB

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