setup.sh 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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. # fix the configuration
  44. echo "Creating auto.conf"
  45. if [ -e $CONFFILE ]; then
  46. rm -rf $CONFFILE
  47. fi
  48. cat <<EOF > $CONFFILE
  49. MACHINE ?= "${MACHINE}"
  50. #IMAGE_FEATURES += "tools-debug"
  51. #IMAGE_FEATURES += "tools-tweaks"
  52. #IMAGE_FEATURES += "dbg-pkgs"
  53. # rootfs for debugging
  54. #IMAGE_GEN_DEBUGFS = "1"
  55. #IMAGE_FSTYPES_DEBUGFS = "tar.gz"
  56. #EXTRA_IMAGE_FEATURES_append = " ssh-server-dropbear"
  57. EXTRA_IMAGE_FEATURES_append = " package-management"
  58. PACKAGECONFIG_append_pn-qemu-native = " sdl"
  59. PACKAGECONFIG_append_pn-nativesdk-qemu = " sdl"
  60. USER_CLASSES ?= "buildstats buildhistory buildstats-summary image-prelink"
  61. require conf/distro/include/no-static-libs.inc
  62. require conf/distro/include/yocto-uninative.inc
  63. require conf/distro/include/security_flags.inc
  64. INHERIT += "uninative"
  65. DISTRO_FEATURES_append = " largefile opengl ptest multiarch wayland pam systemd "
  66. DISTRO_FEATURES_BACKFILL_CONSIDERED += "sysvinit"
  67. VIRTUAL-RUNTIME_init_manager = "systemd"
  68. ##VIRTUAL-RUNTIME_initscripts = ""
  69. ##VIRTUAL-RUNTIME_syslog = ""
  70. HOSTTOOLS_NONFATAL_append = " ssh"
  71. DISTRO_NAME = "StarFive Linux SDK"
  72. #DISTRO_VERSION = ""
  73. #DISTRO_CODENAME = ""
  74. EOF
  75. echo "---------------------------------------------------"
  76. echo "Example: MACHINE=${MACHINE} bitbake ${BITBAKEIMAGE}"
  77. echo "---------------------------------------------------"
  78. echo ""
  79. echo "Buildable machine info"
  80. echo "---------------------------------------------------"
  81. echo "* starfive-dubhe : The StarFive Dubhe machine"
  82. echo "---------------------------------------------------"
  83. # start build
  84. #echo "Starting build"
  85. #bitbake $BITBAKEIMAGE