3 ncpus=$(getconf _NPROCESSORS_ONLN)
6 chome=${chr}/home/vapier
8 -e '/^set speller/s:^:#:' \
10 ~/.nanorc > ${chome}/.nanorc
11 cp ~/.inputrc ${chome}/
12 cp ~/.gdbinit ${chome}/
14 cat ~/.profile.d/aliases.sh
15 grep ^export ~/.bashrc
16 echo "export USE='-cros-debug'"
18 sudo mkdir -p ${chr}/etc/profile.d ${chr}/etc/portage/package.{mask,unmask,use,keywords}
20 cat ~/.profile.d/PS1.sh
21 sed -e '1{/PS1=/d}' ${chr}/etc/profile.d/chromiumos-niceties.sh 2>/dev/null || \
22 echo 'PS1="(cr) ${PS1}"'
24 sudo sh -c 'echo export LANG=en_US.UTF8 > '"${chr}/etc/profile.d/LANG.sh"
25 sudo sh -c 'echo PATH+=:/sbin:/usr/sbin:/usr/local/sbin > '"${chr}/etc/profile.d/sbin.sh"
26 sudo sh -c "cat > '${chr}/etc/make.conf.user'" <<-\EOF
27 FEATURES="${FEATURES} noauto"
28 EMERGE_DEFAULT_OPTS="--color y"
29 ACCEPT_LICENSE="${ACCEPT_LICENSE} Google-TOS"
31 sudo sh -c 'echo -g > '"${chr}/etc/ps1_append"
32 sudo mv ${chome}/.ps1.sh ${chr}/etc/profile.d/chromiumos-niceties.sh
33 for f in .nanorc .gdbinit .gitconfig ; do
34 sudo ln -f ${chome}/$f ${chr}/root/
37 sudo sh -c "echo app-portage/esearch > ${chr}/etc/portage/package.keywords/vapier"
39 [[ -x ${chr}/bin/nano ]] || pkgs+=( nano )
40 [[ -x ${chr}/usr/bin/pcalc ]] || pkgs+=( sci-calculators/pcalc )
41 [[ -x ${chr}/usr/bin/tree ]] || pkgs+=( app-text/tree )
42 [[ -L ${chr}/usr/bin/esearch ]] || pkgs+=( esearch )
43 [[ -x ${chr}/usr/bin/strace ]] || pkgs+=( strace )
44 [[ -x ${chr}/usr/bin/time ]] || pkgs+=( sys-process/time )
45 [[ -x ${chr}/usr/bin/gdb ]] || pkgs+=( sys-devel/gdb )
46 [[ -x ${chr}/usr/bin/diffstat ]] || pkgs+=( diffstat )
47 [[ ${#pkgs[@]} -eq 0 ]] || cros_sdk -- sudo emerge -1q --jobs ${ncpus} ${pkgs[@]}
48 cros_sdk -- sudo eupdatedb -q &
50 sudo sed -i -e '/^# inc/s:^# *::' ${chr}/etc/nanorc