From c2bde8eb2b1cd92abbfb9483fa257803f7f47d0b Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sat, 17 Dec 2011 14:29:00 -0500 Subject: [PATCH] more cros helpers --- .bin/cros-sdk | 12 ++++++++++++ .bin/cros-setup-chroot | 25 +++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100755 .bin/cros-sdk create mode 100755 .bin/cros-setup-chroot diff --git a/.bin/cros-sdk b/.bin/cros-sdk new file mode 100755 index 0000000..df74267 --- /dev/null +++ b/.bin/cros-sdk @@ -0,0 +1,12 @@ +#!/bin/bash -e + +for cros_dir in "${HOME}/chromiumos" "/usr/local/src/chromiumos" ; do + [[ -d ${cros_dir} ]] && break || : +done +depot_dir="${cros_dir}/depot_tools" +cros_sdk="${depot_dir}/cros_sdk" + +cd "${cros_dir}" +rsync -a ~/.bin/cros-* "${depot_dir}"/ + +exec "${cros_sdk}" "$@" diff --git a/.bin/cros-setup-chroot b/.bin/cros-setup-chroot new file mode 100755 index 0000000..0d8cb11 --- /dev/null +++ b/.bin/cros-setup-chroot @@ -0,0 +1,25 @@ +#!/bin/bash +set -ex +cd ~/chromiumos +chr=${PWD}/chroot +chome=${chr}/home/vapier +sed \ + -e '/^set speller/s:^:#:' \ + -e '/^unbind/s:^:#:' \ + ~/.nanorc > ${chome}/.nanorc +cat ~/.profile.d/aliases.sh > ${chome}/.bashrc +( +cat ~/.profile.d/PS1.sh +sed -e '1{/PS1=/d}' ${chr}/etc/profile.d/chromiumos-niceties.sh +) > ${chome}/.ps1.sh +sudo mv ${chome}/.ps1.sh ${chr}/etc/profile.d/chromiumos-niceties.sh +sudo ln -f ${chome}/.nanorc ${chr}/root/ + +pkgs=() +[[ -x ${chr}/bin/nano ]] || pkgs+=( nano ) +[[ -x ${chr}/usr/bin/tree ]] || pkgs+=( app-text/tree ) +[[ -L ${chr}/usr/bin/esearch ]] || pkgs+=( esearch ) +[[ -x ${chr}/usr/bin/strace ]] || pkgs+=( strace ) +[[ ${#pkgs[@]} -eq 0 ]] || cros_sdk -- sudo emerge -1u ${pkgs[@]} + +sudo sed -i -e '/^# inc/s:^# *::' ${chr}/etc/nanorc -- 2.39.5