cloud_init.yaml 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. ## template: jinja
  2. #cloud-config
  3. #
  4. # This file is responsible for setting up the test VM when it is first booted.
  5. # See https://cloudinit.readthedocs.io/ for details.
  6. users:
  7. - name: crosvm
  8. sudo: ALL=(ALL) NOPASSWD:ALL
  9. lock_passwd: False
  10. shell: /bin/bash
  11. # Hashed password is 'crosvm'
  12. passwd: $6$rounds=4096$os6Q9Ok4Y9a8hKvG$EwQ1bbS0qd4IJyRP.bnRbyjPbSS8BwxEJh18PfhsyD0w7a4GhTwakrmYZ6KuBoyP.cSjYYSW9wYwko4oCPoJr.
  13. # Pubkey for `id_rsa`
  14. ssh_authorized_keys:
  15. - ssh-rsa
  16. AAAAB3NzaC1yc2EAAAADAQABAAABgQCYan8oXtUm6WTIClGMsfEf3hmJe+T8p08t9O8StuuDHyAtl1lC+8hOcuXTNvbc52/HNdZ5EO4ZpP3n+N6XftfXFWQanI8OrIHVpsMATMnofHE9RBHWcR/gH0V3xKnXcTvo3S0T3ennfCYxjtL7l7EvHDMdacX8NFOaARH92qJd/YdFp73mqykmc81OCZ4ToQ5s+20T7xvRzedksfSj/wIx3z8BJK9iovkQhNGFd1o557Vq1g3Bxk1PbcIUAvFPl0SwwlFfHBi2M9kZgCVa8UfokBzu77zvxWFud+MXVrfralwKV88k9Cy9FL5QGbtCiZ7RDP5pf69xapKBK+z2L+zuVlSkvaB1CcXuqqVDjD84LXEA+io0peXQcsqbAfbLo0666P7JsweCyQ07qc4AM8gv52SzFuQTIuHLciYxbPgkZTieKgmQLJ1EgfJelOG/+60XC24LbzPIAQxcO83erC/SQ3mTUizu6BueJt7LD1V6vXHcjLfE19FecIJ8U0XDaDU=
  17. crosvm@localhost
  18. groups: kvm, disk, tty
  19. preserve_hostname: true
  20. # Runtime dependencies of crosvm binaries.
  21. # Note: Keep in sync with ./install-[aarch64-]deps.sh
  22. packages:
  23. - e2fsprogs
  24. - gcc
  25. - libavcodec60
  26. - libavutil58
  27. - libcap2
  28. - libdbus-1-3
  29. - libdrm2
  30. - libepoxy0
  31. - libssl3
  32. - libswscale7
  33. - libva2
  34. - libwayland-client0
  35. - libx11-6
  36. - libxext6
  37. - nasm
  38. - ncat
  39. - rsync
  40. # Commands to run once during setup
  41. runcmd:
  42. # Append arch to hostname to make the VM easier to identify.
  43. - echo "testvm-$(arch)" > /etc/hostname
  44. - echo 127.0.0.1 testvm-$(arch) >> /etc/hosts
  45. - mkdir /var/empty
  46. # Install cargo-nextest using prebuilt binaries and validate checksum.
  47. {% if v1.machine == 'aarch64' %}
  48. - curl -LsSf https://get.nexte.st/0.9.43/linux-arm | tar zxf - -C /usr/bin
  49. - echo "59374b208807b5002f96c815a04f6bcc80d16707c2e8046471bb41043324363e /usr/bin/cargo-nextest" | sha256sum -c -
  50. {% else %}
  51. - curl -LsSf https://get.nexte.st/0.9.43/linux | tar zxf - -C /usr/bin
  52. - echo "0b100bd45bbae6e7a4fa05f8f2cee0ca231997875ec43f984cd5ffaa2e6e9a98 /usr/bin/cargo-nextest" | sha256sum -c -
  53. {% endif %}
  54. # Enable core dumps for debugging crashes
  55. - echo "* soft core unlimited" > /etc/security/limits.conf
  56. # Trim some fat
  57. {% if v1.machine == 'aarch64' %}
  58. - [apt-get, remove, --yes, --allow-remove-essential, vim-runtime, grub-common]
  59. {% else %}
  60. - [apt-get, remove, --yes, --allow-remove-essential, vim-runtime, grub-common, grub-efi-amd64-signed]
  61. {% endif %}
  62. - [apt-get, autoremove, --yes]
  63. - [apt-get, clean, --yes]
  64. - [rm, -rf, /var/lib/apt/lists]
  65. # Fill empty space with zeros, so the image can be sparsified.
  66. - [dd, if=/dev/zero, of=/mytempfile]
  67. - [rm, /mytempfile]
  68. # And shut down after first boot setup is done.
  69. - [poweroff]