Ubuntu Pastebin

Paste from zyga at Wed, 25 May 2016 08:13:15 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/sh
if [ "$(id -u)" -ne 0 ]; then
    echo "this script needs to run as root"
    exit 1
fi
arch=$(dpkg --print-architecture)
case "$arch" in
    x86_64)
        arch=amd64
        ;;
esac
if [ ! -f "xenial-base-$arch.tar.gz" ]; then
    echo "Downloading xenial chroot for $arch..."
    wget "http://cdimage.ubuntu.com/ubuntu-base/xenial/daily/current/xenial-base-$arch.tar.gz"
fi
if [ ! -d xenial ]; then
    echo "Uncompressing xenial chroot..."
    tar zxf "xenial-base-$arch.tar.gz"
fi

mount --bind /proc xenial/proc
trap "umount xenial/proc" EXIT
mount --bind /dev xenial/dev
trap "umount xenial/dev" EXIT
mount --bind /sys xenial/sys
trap "umount xenial/sys" EXIT
mount --bind /home xenial/home
trap "umount xenial/home" EXIT

cp /etc/resolv.conf xenial/etc

chroot xenial/
Download as text