setup-config 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #!/bin/sh
  2. # Convenience script for setting up a default buildroot config
  3. # for Xtensa processor targets..
  4. usage() {
  5. echo "Usage (invoke from top of buildroot tree):"
  6. echo " ./target/xtensa/setup-config <corename>"
  7. #echo " ./target/xtensa/setup-config <corename> [<overlaypath>]"
  8. echo "where:"
  9. echo " <corename> is the Xtensa core overlay name, as specified in the -c option"
  10. echo " of the ./target/xtensa/xt-buildroot-overlay-install script."
  11. echo ""
  12. echo "For example:"
  13. echo " ./target/xtensa/setup-config dc232b"
  14. echo ""
  15. echo "Currently installed (available) core overlay names are:"
  16. echo " " `ls toolchain/binutils/binutils-xtensa_*.tgz | sed -e 's,toolchain\/binutils\/binutils-xtensa_\(.*\)\.tgz,\1,g'`
  17. exit 1
  18. }
  19. if [ $# -ne 1 ]; then
  20. usage
  21. fi
  22. core=$1 ; shift
  23. if [ ! -f toolchain/binutils/binutils-xtensa_${core}.tgz \
  24. -o ! -f toolchain/gcc/gcc-xtensa_${core}.tgz \
  25. -o ! -f toolchain/gdb/gdb-xtensa_${core}.tgz ]; then
  26. echo "ERROR: Did not find an installed Xtensa core overlay named '${core}'."
  27. echo "ERROR: Please install it first with ./target/xtensa/xt-buildroot-overlay-install"
  28. echo ""
  29. usage
  30. fi
  31. # Use preset buildroot config:
  32. cp target/xtensa/defconfig .defconfig-xtensa
  33. # Set core name:
  34. sed -i -e 's,^BR2_xtensa_\(.*\)=y,BR2_xtensa_custom=y\nBR2_xtensa_custom_name="'${core}'",' .defconfig-xtensa
  35. ## sed -i -e 's,^.*BR2_xtensa_core_name.*,BR_xtensa_core_name="'${core}'",' .defconfig-xtensa
  36. # Create full .config with defaults:
  37. make clean defconfig CONFIG_DEFCONFIG=.defconfig-xtensa || exit 1
  38. # Busybox adjustments: turn off 'ar' (can't create archives yet overrides real one)
  39. # and turn on NFS mounting (Xtensa defconfig turns on RPC so this can work):
  40. #
  41. bborig=`grep '^BR2_PACKAGE_BUSYBOX_CONFIG=' .config | sed -e 's,.*"\(.*\)".*,\1,'`
  42. bbconf=target/xtensa/busybox-config
  43. cp $bborig $bbconf
  44. sed -i -e 's,^CONFIG_AR=y,# CONFIG_AR is not set,' $bbconf
  45. sed -i -e 's,^.*CONFIG_FEATURE_MOUNT_NFS.*,CONFIG_FEATURE_MOUNT_NFS=y,' $bbconf
  46. # Make use of above busybox adjustments:
  47. sed -i -e 's,.*\(BR2_PACKAGE_BUSYBOX_CONFIG\).*,\1="'$bbconf'",' .config
  48. echo "Done."