Commit 6f16963d authored by iv's avatar iv

nayuos: Adding a script to /etc/run for downloading Chromium OS sources +...

nayuos: Adding a script to /etc/run for downloading Chromium OS sources + building instead of doing it during instanciation.
parent 83be4842
#!/bin/sh
#XXX: should not depend on the host's sh ^
# Download sources using the "repo" command
DL_LOG={{ instance_log_dir }}/cros_sources_dl.log
echo "getting Chromium OS sources..." >> $DL_LOG
{{ depot_tools_export_path_cmd }}
cd {{ cros_location }}
repo init -u https://chromium.googlesource.com/chromiumos/manifest.git -b {{ branch }} >> $DL_LOG
repo sync >> $DL_LOG
# Build
{{ depot_tools_export_path_cmd }}
cd {{ cros_location }}
IMAGE_LOCATION={{ board }}.img
BUILD_LOG={{ instance_log_dir }}/cros_build.log
echo "building packages for a {{ board }}-flavoured Chromium OS..." >> $BUILD_LOG \
&& cros_sdk -- ./build_packages --board={{ board }} >> $BUILD_LOG \
&& echo "building image for a {{ board }}-flavoured Chromium OS..." >> $BUILD_LOG \
&& cros_sdk -- ./build_image --board={{ board }} >> $BUILD_LOG \
&& echo "removing old image if any and creating image file {{ board }}.img..." >> $BUILD_LOG \
&& cros_sdk -- rm -f $IMAGE_LOCATION \
&& cros_sdk -- touch $IMAGE_LOCATION \
&& cros_sdk -- cros flash --board={{ board }} file://$IMAGE_LOCATION >> $BUILD_LOG
[buildout]
parts =
parameters
get-chromium-sources
build-chromiumos
template-full-build-script
# eggs given by software.cfg
eggs-directory = {{ eggs_directory }}
......@@ -20,11 +19,6 @@ branch = master
export-path =
export PATH=${clone-depot-tools:location}:"$PATH";
[build-commands]
env =
${depot-tools:export-path}
cd ${get-chromium-sources:location};
############################################################################################
[parameters]
......@@ -39,31 +33,24 @@ url = ${slap_connection:server_url}
key = ${slap_connection:key_file}
cert = ${slap_connection:cert_file}
[get-chromium-sources]
recipe = plone.recipe.command
stop-on-error = true
location = ${clone-depot-tools:location}/../chromiumos
command =
echo "getting Chromium OS sources..."
${depot-tools:export-path}
mkdir ${:location}
cd ${:location}
repo init -u https://chromium.googlesource.com/chromiumos/manifest.git -b ${parameters:configuration.branch}
repo sync
update-command =
${depot-tools:export-path}
cd ${:location}
repo sync
[build-chromiumos]
recipe = plone.recipe.command
stop-on-error = true
command =
${build-commands:env}
# cros_sdk --delete
echo "building packages for Chromium OS..."
cros_sdk -- ./build_packages --board=${parameters:configuration.board}
&& cros_sdk -- ./build_image --board=${parameters:configuration.board}
&& touch $(pwd)/${parameters:configuration.board}.img
&& cros flash --board=${parameters:configuration.board} file://$(pwd)/${parameters:configuration.board}.img
\ No newline at end of file
[directory]
recipe = slapos.cookbook:mkdirectory
log = ${buildout:directory}/var/log
run = ${buildout:directory}/etc/run
cros_location = ${buildout:directory}/parts/chromiumos
[template-full-build-script]
# create the instance.cfg file in the buildout directory
# (use jinja for templating)
recipe = slapos.recipe.template:jinja2
template = {{ script_dir }}/cros_full_build.sh.in
rendered = ${directory:run}/cros_full_build.sh
# md5sum =
mode = 0770
context =
# for access to the eggs from the instance
key instance_log_dir directory:log
key cros_location directory:cros_location
key depot_tools_export_path_cmd depot-tools:export-path
key branch parameters:configuration.branch
key board parameters:configuration.board
\ No newline at end of file
......@@ -35,12 +35,13 @@ command = sudo -V
recipe = slapos.recipe.template:jinja2
template = ${:_profile_base_location_}/instance.cfg
rendered = ${buildout:directory}/instance.cfg
md5sum = 2e8558f042d6790a0245c292888b35fc
md5sum = 0b1a50348c080b280f95dab1817e1033
mode = 0644
context =
# for access to the eggs from the instance
key eggs_directory buildout:eggs-directory
key develop_eggs_directory buildout:develop-eggs-directory
key script_dir :_profile_base_location_
[install-eggs-for-the-instance]
# after installation of the eggs, the recipes
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment