Blame view

software/nayuos/instance.cfg 4.51 KB
Tomáš Peterka committed
1 2 3 4 5 6
# Jinja2 template of a buildout file to create runnable scripts
#
# Received variables
# -  software_dir: location where this repository was cloned to
# -  instance_dir: location where this 'instance.cfg' is gettin rendered (same as ${buildout:directory})

iv committed
7 8 9
[buildout]
parts =
  parameters
iv committed
10
  promise-sudo-on-host
iv committed
11
  template-full-build-script
iv committed
12 13
  template-sudo-wrapper
  template-cros-sdk-wrapper
iv committed
14

iv committed
15
# standard declaration of eggs directories
iv committed
16 17 18 19 20
eggs-directory = {{ eggs_directory }}
develop-eggs-directory = {{ develop_eggs_directory }}

#################################### Tools, sources getter ##################################

iv committed
21
[depot-tools]
iv committed
22 23 24 25
# needed for the "repo" command (to download many git repositories)
recipe = slapos.recipe.build:gitclone
repository = https://chromium.googlesource.com/chromium/tools/depot_tools.git
branch = master
Tomáš Peterka committed
26
git-executable = {{ git_path }}/bin/git
iv committed
27

iv committed
28 29 30
[customize-path]
# add depot tools directory (for cros_sdk binary among others) and git directory to the path
command =
Tomáš Peterka committed
31
  export PATH="${directory:wrapper_dir}":"{{ git_path }}/bin":"{{ curl_path }}/bin":"${depot-tools:location}":"{{thin_provisioning_tools}}/sbin":"$PATH";
iv committed
32 33 34 35

[nayuos-ebuilds]
recipe = slapos.recipe.build:gitclone
repository = https://lab.nexedi.com/nexedi/nayuos-ebuilds.git
iv committed
36
branch = master
Tomáš Peterka committed
37
git-executable = {{ git_path }}/bin/git
iv committed
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52

############################################################################################

[parameters]
# for use of the "parameters" XML configuration given from the
# webrunner interface
# if needed, .serialized => json (more complex structures are OK, but need another 
# jinja template for reading the content of the parameters)
recipe = slapos.cookbook:slapconfiguration
computer = ${slap_connection:computer_id}
partition = ${slap_connection:partition_id}
url = ${slap_connection:server_url}
key = ${slap_connection:key_file}
cert = ${slap_connection:cert_file}

iv committed
53 54 55 56
[directory]
recipe = slapos.cookbook:mkdirectory
log = ${buildout:directory}/var/log
run = ${buildout:directory}/etc/run
iv committed
57
promise = ${buildout:directory}/etc/promise
iv committed
58
wrapper_dir = ${buildout:directory}/wrapper_bin
iv committed
59
cros_location = ${buildout:directory}/parts/chromiumos
iv committed
60

iv committed
61
[bin]
Tomáš Peterka committed
62
# dummy section to hold references to frequently used binaries
iv committed
63 64 65 66
wrapper_cros_sdk=${directory:wrapper_dir}/wrapper_cros_sdk
bash=/bin/bash
sudo=/usr/bin/sudo

iv committed
67
[promise-sudo-on-host]
Tomáš Peterka committed
68
# assert sudo is installed, as it is required to enter the chroot 'cros_sdk'
iv committed
69
recipe  = slapos.cookbook:wrapper
Tomáš Peterka committed
70
wrapper-path = ${directory:promise}/${:_buildout_section_name_}
iv committed
71 72
command-line = sudo -V

iv committed
73 74
[template-sudo-wrapper]
recipe = slapos.recipe.template:jinja2
Tomáš Peterka committed
75
template = {{ software_dir }}/scripts/wrapper_sudo.in
iv committed
76 77 78 79 80 81 82 83 84 85
rendered = ${directory:wrapper_dir}/sudo
md5sum = ded5a92be4e37ec32eb9d3087d3e19bd
mode = 0700
context =
  key fake_cros_sdk_path bin:wrapper_cros_sdk
  key bash_path bin:bash
  key host_sudo_path bin:sudo

[template-cros-sdk-wrapper]
recipe = slapos.recipe.template:jinja2
Tomáš Peterka committed
86
template = {{ software_dir }}/scripts/wrapper_cros_sdk.in
iv committed
87 88 89 90 91 92
rendered = ${bin:wrapper_cros_sdk}
md5sum = 7159fe3d5b85a283733cf686c4ee0a74
mode = 0700
context =
# XXX bash path is the one from the host
  key bash_path bin:bash
Tomáš Peterka committed
93 94
  raw git_path  {{ git_path }}/bin
  raw curl_path {{ curl_path }}/bin
iv committed
95

iv committed
96
[template-full-build-script]
iv committed
97
# create the rendered script in the buildout-directory/etc/run
iv committed
98 99
# (use jinja for templating)
recipe = slapos.recipe.template:jinja2
Tomáš Peterka committed
100
template = {{ software_dir }}/scripts/cros_full_build.in
iv committed
101
rendered = ${directory:run}/cros_full_build
Tomáš Peterka committed
102
md5sum = 2a64b5cc0314ec2221a949928956f5c0
iv committed
103
mode = 0700
iv committed
104
context =
iv committed
105 106 107 108 109 110 111
  key bash_path                         bin:bash
  key instance_log_dir                  directory:log
  key cros_location                     directory:cros_location
  key export_path_cmd                   customize-path:command
  key branch                            parameters:configuration.branch
  key boards_list                       parameters:configuration.boards
  key keep_cache                        parameters:configuration.keep_cache
Tomáš Peterka committed
112 113 114 115 116
  key ebuilds_dir                       nayuos-ebuilds:location
  raw scripts_dir                       {{ software_dir }}/scripts
  raw logo_dir                          {{ software_dir }}/logo
# packages to be copied from our overlay into ChromiuOS' overlay
# those packages will be marked as dependency of root filesystem
iv committed
117
  raw nayu_dev_rootfs_packages          app-misc/nayuos-chromium-policy
Tomáš Peterka committed
118
# those packages will be marked as dependency of the chromium build itself
Tomáš Peterka committed
119
  raw nayu_dev_packages                 net-misc/re6stnet dev-vcs/git dev-python/flask dev-python/virtualenv sys-fs/cryptsetup