setup.sh 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. #!/bin/bash
  2. # Bootstrapper for buildbot slave
  3. DIR="build"
  4. MACHINE="qemuriscv64"
  5. CONFFILE="conf/auto.conf"
  6. BITBAKEIMAGE="core-image-full-cmdline"
  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-multimedia
  38. bitbake-layers add-layer ../meta-openembedded/meta-python
  39. bitbake-layers add-layer ../meta-openembedded/meta-networking
  40. bitbake-layers add-layer ../meta-riscv
  41. # fix the configuration
  42. echo "Creating auto.conf"
  43. if [ -e $CONFFILE ]; then
  44. rm -rf $CONFFILE
  45. fi
  46. cat <<EOF > $CONFFILE
  47. MACHINE = "${MACHINE}"
  48. #IMAGE_FEATURES += "tools-debug"
  49. #IMAGE_FEATURES += "tools-tweaks"
  50. #IMAGE_FEATURES += "dbg-pkgs"
  51. # rootfs for debugging
  52. #IMAGE_GEN_DEBUGFS = "1"
  53. #IMAGE_FSTYPES_DEBUGFS = "tar.gz"
  54. EXTRA_IMAGE_FEATURES_append = " ssh-server-dropbear"
  55. EXTRA_IMAGE_FEATURES_append = " package-management"
  56. PACKAGECONFIG_append_pn-qemu-native = " sdl"
  57. PACKAGECONFIG_append_pn-nativesdk-qemu = " sdl"
  58. USER_CLASSES ?= "buildstats buildhistory buildstats-summary image-mklibs image-prelink"
  59. require conf/distro/include/no-static-libs.inc
  60. require conf/distro/include/yocto-uninative.inc
  61. require conf/distro/include/security_flags.inc
  62. INHERIT += "uninative"
  63. DISTRO_FEATURES_append = " largefile opengl ptest multiarch wayland pam systemd "
  64. DISTRO_FEATURES_BACKFILL_CONSIDERED += "sysvinit"
  65. VIRTUAL-RUNTIME_init_manager = "systemd"
  66. HOSTTOOLS_NONFATAL_append = " ssh"
  67. EOF
  68. echo "To build an image run"
  69. echo "-------------------------------"
  70. echo "bitbake core-image-full-cmdline"
  71. echo "-------------------------------"
  72. # start build
  73. #echo "Starting build"
  74. #bitbake $BITBAKEIMAGE