randconfig.sh 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #!/bin/sh
  2. # build random configurations
  3. # Usage:
  4. # ARCH=i386 nohup ./extra/scripts/randconfig.sh & sleep 1800 && touch STOP
  5. #
  6. # The above builds random i386 configs and automatically stops after 30 minutes
  7. test "x$AWK" = "x" && AWK=awk
  8. test "x$ARCH" = "x" && ARCH=`uname -m`
  9. KCONFIG_ALLCONFIG=.config.allconfig
  10. (echo TARGET_$ARCH=y
  11. echo '# UCLIBC_PREGENERATED_LOCALE_DATA is not set'
  12. echo '# DOMULTI is not set'
  13. echo '# UCLIBC_DOWNLOAD_PREGENERATED_LOCALE_DATA is not set'
  14. ) > $KCONFIG_ALLCONFIG
  15. export KCONFIG_ALLCONFIG
  16. if test "x$NCPU" = "x"
  17. then
  18. test -r /proc/cpuinfo && \
  19. eval `$AWK 'BEGIN{NCPU=0}
  20. /processor/{let NCPU++}
  21. END{if (NCPU<1) {NCPU=1}; print("NCPU="NCPU);}' /proc/cpuinfo` || \
  22. NCPU=1
  23. fi
  24. MAKELEVEL="-j$NCPU"
  25. i=0
  26. while test ! -f STOP
  27. do
  28. ARCH=$ARCH make $* randconfig > /dev/null
  29. ARCH=$ARCH make $* silentoldconfig > /dev/null
  30. if (make $MAKELEVEL $*) 2>&1 >& mk.log
  31. then
  32. :
  33. else
  34. i=`expr $i + 1`
  35. num=`printf "%.5d" $i`
  36. mv .config FAILED.$num.config
  37. mv mk.log FAILED.$num.log
  38. fi
  39. make distclean > /dev/null || true
  40. done
  41. rm -f STOP