create-sys 1.1 KB

123456789101112131415161718192021222324252627282930
  1. #!/usr/bin/env bash
  2. topdir=$(readlink -nf $(dirname $0)/.. 2>/dev/null || (cd $(dirname $0)/..; pwd -P))
  3. systems=$(grep -h config target/*/systems/*|cut -d " " -f 2)
  4. echo '' > $topdir/target/config/Config.in.system.default
  5. for j in $systems;do
  6. system=${j#ADK_TARGET_SYSTEM_}
  7. systemu=$(echo $system|tr '[:upper:]' '[:lower:]')
  8. printf "config ADK_$systemu\n" >> $topdir/target/config/Config.in.system.default
  9. printf "\tboolean\n\n" >> $topdir/target/config/Config.in.system.default
  10. done
  11. cat >> $topdir/target/config/Config.in.system.default << EOD
  12. config ADK_TARGET_SYSTEM
  13. string
  14. EOD
  15. for i in $systems;do
  16. system=${i#ADK_TARGET_SYSTEM_}
  17. systemu=$(echo $system|tr '[:upper:]' '[:lower:]')
  18. system=$(echo $system|tr '[:upper:]_' '[:lower:]-')
  19. system=$(echo $system|sed 's#x86-64#x86_64#')
  20. printf "\tdefault \"${system}\" if ADK_$systemu\n" >> $topdir/target/config/Config.in.system.default
  21. done
  22. for i in $(ls $topdir/target/);do
  23. if [ -d "$topdir/target/$i/systems" ];then
  24. cat $topdir/target/$i/systems/* > $topdir/target/$i/Config.in.systems 2>/dev/null
  25. fi
  26. done
  27. exit 0