create-sys 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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/*/sys-available/*|cut -d " " -f 2)
  4. while read arch; do
  5. count=1
  6. mkdir -p $topdir/target/$arch/sys-enabled &&
  7. cd $topdir/target/$arch/sys-enabled &&
  8. ln -sf ../sys-available/toolchain 0-toolchain
  9. for i in $(ls $topdir/target/$arch/sys-available/|grep -v toolchain);do
  10. cd $topdir/target/$arch/sys-enabled/ &&
  11. ln -sf ../sys-available/$i $count-$i
  12. count=$((count+1))
  13. done
  14. done <${topdir}/target/arch.lst
  15. cat > $topdir/target/config/Config.in.system.default << EOD
  16. config ADK_qemu
  17. boolean
  18. config ADK_toolchain
  19. boolean
  20. EOD
  21. for j in $systems;do
  22. system=${j#ADK_TARGET_SYSTEM_}
  23. systemu=$(echo $system|tr '[:upper:]' '[:lower:]')
  24. printf "config ADK_$systemu\n" >> $topdir/target/config/Config.in.system.default
  25. printf "\tboolean\n\n" >> $topdir/target/config/Config.in.system.default
  26. done
  27. cat >> $topdir/target/config/Config.in.system.default << EOD
  28. config ADK_TARGET_SYSTEM
  29. string
  30. default "toolchain" if ADK_toolchain
  31. default "qemu" if ADK_qemu
  32. EOD
  33. for i in $systems;do
  34. system=${i#ADK_TARGET_SYSTEM_}
  35. systemu=$(echo $system|tr '[:upper:]' '[:lower:]')
  36. system=$(echo $system|tr '[:upper:]_' '[:lower:]-')
  37. system=$(echo $system|sed 's#x86-64#x86_64#')
  38. printf "\tdefault \"$system\" if ADK_$systemu\n" >> $topdir/target/config/Config.in.system.default
  39. done
  40. exit 0