setup.sh 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. #!/bin/bash
  2. # Bootstrapper for buildbot slave
  3. DIR="build"
  4. MACHINE="starfive-dubhe"
  5. CONFFILE="conf/auto.conf"
  6. BITBAKEIMAGE="virtual/kernel"
  7. # clean up the output dir
  8. #echo "Cleaning build dir"
  9. #rm -rf $DIR
  10. # make sure sstate is there
  11. #echo "Creating sstate directory"
  12. #mkdir -p ~/sstate/$MACHINE
  13. # fix permissions set by buildbot
  14. #echo "Fixing permissions for buildbot"
  15. #umask -S u=rwx,g=rx,o=rx
  16. #chmod -R 755 .
  17. # Reconfigure dash on debian-like systems
  18. which aptitude > /dev/null 2>&1
  19. ret=$?
  20. if [ "$(readlink /bin/sh)" = "dash" -a "$ret" = "0" ]; then
  21. sudo aptitude install expect -y
  22. expect -c 'spawn sudo dpkg-reconfigure -freadline dash; send "n\n"; interact;'
  23. elif [ "${0##*/}" = "dash" ]; then
  24. echo "dash as default shell is not supported"
  25. return
  26. fi
  27. # bootstrap OE
  28. echo "Init OE"
  29. export BASH_SOURCE="openembedded-core/oe-init-build-env"
  30. . ./openembedded-core/oe-init-build-env $DIR
  31. # Symlink the cache
  32. #echo "Setup symlink for sstate"
  33. #ln -s ~/sstate/${MACHINE} sstate-cache
  34. # add the missing layers
  35. echo "Adding layers"
  36. bitbake-layers add-layer ../meta-openembedded/meta-oe
  37. bitbake-layers add-layer ../meta-openembedded/meta-python
  38. bitbake-layers add-layer ../meta-openembedded/meta-multimedia
  39. bitbake-layers add-layer ../meta-openembedded/meta-filesystems
  40. bitbake-layers add-layer ../meta-openembedded/meta-networking
  41. bitbake-layers add-layer ../meta-riscv
  42. bitbake-layers add-layer ../meta-starfive
  43. bitbake-layers add-layer ../meta-clang
  44. # fix the configuration
  45. echo "Creating auto.conf"
  46. if [ -e $CONFFILE ]; then
  47. rm -rf $CONFFILE
  48. fi
  49. cat <<EOF > $CONFFILE
  50. MACHINE ?= "${MACHINE}"
  51. #IMAGE_FEATURES += "tools-debug"
  52. #IMAGE_FEATURES += "tools-tweaks"
  53. #IMAGE_FEATURES += "dbg-pkgs"
  54. # rootfs for debugging
  55. #IMAGE_GEN_DEBUGFS = "1"
  56. #IMAGE_FSTYPES_DEBUGFS = "tar.gz"
  57. #EXTRA_IMAGE_FEATURES:append = " ssh-server-dropbear"
  58. EXTRA_IMAGE_FEATURES:append = " package-management"
  59. PACKAGECONFIG:append:pn-qemu-native = " sdl"
  60. PACKAGECONFIG:append:pn-nativesdk-qemu = " sdl"
  61. USER_CLASSES ?= "buildstats buildhistory buildstats-summary image-prelink"
  62. require conf/distro/include/no-static-libs.inc
  63. require conf/distro/include/yocto-uninative.inc
  64. require conf/distro/include/security_flags.inc
  65. INHERIT += "uninative"
  66. DISTRO_FEATURES:append = " largefile opengl ptest multiarch wayland pam systemd "
  67. DISTRO_FEATURES_BACKFILL_CONSIDERED += "sysvinit"
  68. VIRTUAL-RUNTIME_init_manager = "systemd"
  69. ##VIRTUAL-RUNTIME_initscripts = ""
  70. ##VIRTUAL-RUNTIME_syslog = ""
  71. HOSTTOOLS_NONFATAL:append = " ssh"
  72. DISTRO_NAME = "StarFive Linux SDK"
  73. #DISTRO_VERSION = ""
  74. #DISTRO_CODENAME = ""
  75. EOF
  76. echo "---------------------------------------------------"
  77. echo "Example: MACHINE=${MACHINE} bitbake ${BITBAKEIMAGE}"
  78. echo "---------------------------------------------------"
  79. echo ""
  80. echo "Buildable machine info"
  81. echo "---------------------------------------------------"
  82. echo "* qemuriscv64 : The 64-bit RISC-V machine"
  83. echo "* starfive-dubhe : The StarFive Dubhe machine"
  84. echo "---------------------------------------------------"
  85. # start build
  86. #echo "Starting build"
  87. #bitbake $BITBAKEIMAGE