Skip to content

Instantly share code, notes, and snippets.

@higebu
Last active August 29, 2015 14:18
Show Gist options
  • Save higebu/d03619d989b5fc5dded6 to your computer and use it in GitHub Desktop.
Save higebu/d03619d989b5fc5dded6 to your computer and use it in GitHub Desktop.
#!/bin/bash
# ./build_coreos.sh Alpha 494
CHANNEL=$1
VERSION=$2
git config --global color.ui false
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
export PATH="$PATH":`pwd`/depot_tools
mkdir coreos
pushd coreos
repo init -u ssh://[email protected]/higebu/manifest.git \
-b niftycloud-${VERSION} \
-g minilayout \
--repo-url https://chromium.googlesource.com/external/repo.git -m release.xml
repo sync
cros_sdk --download
cros_sdk -- "./set_shared_user_password.sh" "core"
echo "amd64-usr" > src/scripts/.default_board
cros_sdk -- "./setup_board"
cros_sdk -- "./build_packages"
cros_sdk -- "./build_image" "prod" "--group" "${CHANNEL,,}"
cros_sdk -- "./image_to_vm.sh" "--from=../build/images/amd64-usr/latest" "--board=amd64-usr" "--prod_image" "--format" "niftycloud"
VERSION=$(cros_sdk -- 'cat' '/etc/os-release' | grep VERSION_ID | awk -F'=' '{print $2}')
popd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment