Skip to content

Instantly share code, notes, and snippets.

Last active Mar 13, 2018
What would you like to do?
chrome os startup
# chr -- wrapper for enter-chroot to run setup after reboot
set -e
main() {
declare name
case $1 in
-n) name=$2; shift 2 ;;
*) name=$(sudo edit-chroot -a | head -n1) ;;
mount | grep -Fq "crouton/chroots/$name" || first
enter "$@"
exit # in case script changes
first() {
sudo sh -c '
mkdir -p /usr/local/etc
echo "chronos ALL=(ALL) NOPASSWD:ALL" > /usr/local/etc/95_cros_nopasswd
mount -o bind /usr/local/etc/95_cros_nopasswd /etc/sudoers.d/95_cros_base
enter -b sleep 365d
enter -b /usr/bin/syncthing -no-browser -no-restart -logflags=0
enter -b /usr/bin/syncthing-inotify -logflags=0
enter -b dropbox start
enter() {
sudo enter-chroot -n "$name" "$@"
main "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment