Skip to content

Instantly share code, notes, and snippets.

@yzgyyang
Last active December 1, 2022 09:20
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yzgyyang/c9f599169dc741de2550772bb8c21a1b to your computer and use it in GitHub Desktop.
Save yzgyyang/c9f599169dc741de2550772bb8c21a1b to your computer and use it in GitHub Desktop.
Build Chromium OS from Ubuntu curl -fsSL URL_HERE | sh
#!/bin/sh
set -xe
sudo apt-get install git-core gitk git-gui subversion curl lvm2 thin-provisioning-tools python-pkg-resources python-virtualenv python-oauth2client
# install depot tools
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
PATH=$PATH:/path/to/depot_tools
# Making sudo a little more permissive
cd /tmp
cat > ./sudo_editor <<EOF
#!/bin/sh
echo Defaults \!tty_tickets > \$1 # Entering your password in one shell affects all shells
echo Defaults timestamp_timeout=180 >> \$1 # Time between re-requesting your password, in minutes
EOF
chmod +x ./sudo_editor
sudo EDITOR=./sudo_editor visudo -f /etc/sudoers.d/relax_requirements
# Get source
mkdir ~/chromium_os_source
SOURCE_REPO=~/chromium_os_source
cd ${SOURCE_REPO}
repo init -u https://chromium.googlesource.com/chromiumos/manifest.git
# Optional: Make any changes to .repo/local_manifests/local_manifest.xml before syncing
repo sync
# Build for amd64
export BOARD=amd64-generic
cros_sdk -- ./build_packages --board=${BOARD}
# Build an image
cros_sdk -- ./build_image --board=${BOARD}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment