cros_full_build.sh.in 2.43 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
#!/bin/bash
#XXX: should not depend on the host's bash ^

#################mo####### Download of 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 ##############################################
BOARDS="{{ boards_list }}"
for board in ${BOARDS}; do
  echo ${board}
  if [ ${board} == daisy ]; then
    echo "daisy board: accepting license for Mali drivers..."
    cros_sdk -- sudo sh -c "cp /etc/make.conf.user /etc/make.conf.user.save"
    cros_sdk -- sudo sh -c "echo 'ACCEPT_LICENSE=\"*\"' >> /etc/make.conf.user"
  fi
  
  {{ depot_tools_export_path_cmd }}
  cd {{ cros_location }}
  IMAGE_LOCATION=${board}.chromiumos.img
  NAYU_IMAGE_LOCATION=${board}.nayuos.img
  BUILD_LOG={{ instance_log_dir }}/cros_build.log
  
  # preparing packages (for chroot and image)
iv's avatar
iv committed
29
  date >> $BUILD_LOG
30 31 32 33
  echo "building packages for a ${board}-flavoured Chromium OS..." >> $BUILD_LOG
  cros_sdk -- ./build_packages --board=${board} >> $BUILD_LOG
  
  # Chromium original dev image
iv's avatar
iv committed
34
  date >> $BUILD_LOG
35 36 37 38 39 40 41
  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 $IMAGE_LOCATION..." >> $BUILD_LOG \
    && cros_sdk -- rm -f $IMAGE_LOCATION && cros_sdk -- touch $IMAGE_LOCATION \
    && cros_sdk -- cros flash --board=${board} file://$IMAGE_LOCATION >> $BUILD_LOG
  
  # NayuOS
iv's avatar
iv committed
42
  date >> $BUILD_LOG
43
  echo "rebuilding image with noenable_rootfs_verification and modifying image" >> $BUILD_LOG
iv's avatar
iv committed
44
  cros_sdk -- ./build_image --noenable_rootfs_verification --board=${board} >> $BUILD_LOG \
45
    && echo "modifying image, removing old image if any and creating image file $NAYU_IMAGE_LOCATION..." >> $BUILD_LOG \
iv's avatar
iv committed
46
    && cros_sdk -- ./modify_image.sh ${board} \
47 48 49 50 51 52 53 54 55
    && cros_sdk -- rm -f $NAYU_IMAGE_LOCATION && cros_sdk -- touch $NAYU_IMAGE_LOCATION \
    && cros_sdk -- cros flash --board=${board} file://$NAYU_IMAGE_LOCATION >> $BUILD_LOG
  
  if [ ${board} == daisy ]; then
    echo "daisy board: removing accepted license for the next builds..."
    cros_sdk -- sudo sh -c "cp /etc/make.conf.user.save /etc/make.conf.user"
  fi
done
exit 0