cros_full_build.sh.in 1.06 KB
#!/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