]> git.wh0rd.org Git - home.git/commitdiff
more cros helpers
authorMike Frysinger <vapier@gentoo.org>
Sat, 17 Dec 2011 19:29:00 +0000 (14:29 -0500)
committerMike Frysinger <vapier@gentoo.org>
Sat, 28 Apr 2012 19:36:42 +0000 (15:36 -0400)
.bin/cros-sdk [new file with mode: 0755]
.bin/cros-setup-chroot [new file with mode: 0755]

diff --git a/.bin/cros-sdk b/.bin/cros-sdk
new file mode 100755 (executable)
index 0000000..df74267
--- /dev/null
@@ -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 (executable)
index 0000000..0d8cb11
--- /dev/null
@@ -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