X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?p=bin.git;a=blobdiff_plain;f=chroot-setup;h=2949cb1c3d29c24e36e4f1566d18196132da6689;hp=5cd1c199ac72e90b0c8c26310cb0bbc220a724b9;hb=8dabab27b9384f2587eee2cdeb3c35644dd7bc36;hpb=bcdb6e4fe8a9206c83822521dbf72da581adaf9b diff --git a/chroot-setup b/chroot-setup index 5cd1c19..2949cb1 100755 --- a/chroot-setup +++ b/chroot-setup @@ -1,5 +1,13 @@ #! /bin/sh -e -# Install keychain xauth x11-xserver-utils in the chroot first. + +# Chroot preparation: +# locale-gen en_GB.UTF-8 +# apt-get --no-install-recommends install keychain xauth x11-xserver-utils +# adduser --disabled-password cjwatson +# addgroup --system admin +# adduser cjwatson admin +# visudo # add '%admin ALL=(ALL) ALL' + if [ -e "$1/proc/cmdline" ]; then exit; fi ensure_dir_mine () { @@ -31,7 +39,7 @@ if [ -d /home/cjwatson/.keychain ]; then ensure_dir_mine "$1/home/cjwatson/.keychain" sudo mount --bind /home/cjwatson/.keychain "$1/home/cjwatson/.keychain" fi -xauth list | sudo chroot "$1" su cjwatson -c 'xargs -l1 xauth add' +xauth list | sudo chroot "$1" su cjwatson -c 'xargs -l1 xauth add' || true rm -f "$1/home/cjwatson/.ICEauthority" iceauth list | sudo chroot "$1" su cjwatson -c 'xargs -l1 iceauth add' sudo cp -a /etc/resolv.conf "$1/etc/"