summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rwxr-xr-xtools/chroot.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/tools/chroot.sh b/tools/chroot.sh
new file mode 100755
index 00000000..e2b8e70a
--- /dev/null
+++ b/tools/chroot.sh
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+CHROOT_PREFIX=$1
+DISTRO=$2
+USER=$3
+
+CHROOT_PATH=$CHROOT_PREFIX/$DISTRO
+
+debootstrap $DISTRO $CHROOT_PATH http://archive.ubuntu.com/ubuntu
+
+cp /etc/resolv.conf $CHROOT_PATH/etc/resolv.conf
+cp /etc/hosts $CHROOT_PATH/etc/hosts
+
+echo "$USER:x:1000:1000:$USER,,,:/home/$USER:/bin/bash" >> $CHROOT_PATH/etc/passwd
+echo "$USER:x:1000:" >> $CHROOT_PATH/etc/group
+echo "$USER ALL=NOPASSWD: ALL" >>$CHROOT_PATH/etc/sudoers
+
+mkdir $CHROOT_PATH/home/$USER
+cp ~/.gitconfig $CHROOT_PATH/home/$USER/
+mkdir $CHROOT_PATH/home/$USER/.ssh
+cp ~/.ssh/id_rsa $CHROOT_PATH/home/$USER/.ssh/
+chmod -R 600 CHROOT_PATH/home/$USER/.ssh/
+chown $USER:$USER $CHROOT_PATH/home/$USER
+
+mkdir -p $CHROOT_PATH/home/$USER/git/cerbero
+cp -r * $CHROOT_PATH/home/$USER/git/cerbero
+cp -r .git $CHROOT_PATH/home/$USER/git/cerbero