From: Mike Frysinger Date: Mon, 17 Aug 2009 03:07:58 +0000 (+0000) Subject: update chroot X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=36c3082a9a75e75fb1c609a481132e2cf7ce34a3;p=home.git update chroot --- diff --git a/.bin/custom-chroot b/.bin/custom-chroot old mode 100644 new mode 100755 index 6ad7bb6..60da7af --- a/.bin/custom-chroot +++ b/.bin/custom-chroot @@ -1,10 +1,13 @@ -!/bin/bash -e +#!/bin/bash -e [[ -w / ]] || exec sudo "$0" "$@" -[[ $# -eq 0 ]] && set -- /bin/bash -l +[[ $# -eq 0 ]] && set -- env HOME=/root /bin/bash -l mounts="proc sys dev dev/pts" chroot=${0%/*} +case ${chroot} in + .) chroot=${PWD} ;; +esac cd "${chroot}" maybe_mount() { @@ -30,7 +33,7 @@ else setarch="setarch ${bin_dst}" fi -if [[ ! -L /etc/mtab ]] ; then +if [[ ! -L etc/mtab ]] ; then rm -f etc/mtab ln -sf /proc/mounts etc/mtab fi @@ -40,16 +43,21 @@ etc=" localtime resolv.conf " -root=" +home=" .inputrc .nanorc " for f in \ $(printf 'etc/%s ' ${etc}) \ - $(printf 'root/%s ' ${root}) \ ; do cp /${f} ${f} done +for f in ${home} ; do + cp ~/${f} root/${f} +done unset LS_COLORS # format changes over time -exec ${setarch} chroot "${chroot}" "$@" +exec \ + ${setarch} \ + chroot "${chroot}" \ + "$@"