summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Moreira Magalhaes (andrunko) <andre.magalhaes@collabora.co.uk>2012-05-03 12:02:33 -0300
committerAndre Moreira Magalhaes (andrunko) <andre.magalhaes@collabora.co.uk>2012-05-03 12:03:54 -0300
commit7fea9ebc8a3c33bc81cc0db4d4ad9a8ff0be06af (patch)
tree70891d9be0542ad574fdff7035e887feeca3b9b3
parent9a2131a63ea233eaf1802ceb94332b5e5c072760 (diff)
tools/chroot.sh improvements.
- Consider arch when calling debootstrap - Make sure sudo is installed on debian, required by cerbero bootstrap - Use etc/debian_chroot instead of changing hostname, fixes PS1 and does not have issues with changing my machine hostname
-rwxr-xr-xtools/chroot.sh11
1 files changed, 8 insertions, 3 deletions
diff --git a/tools/chroot.sh b/tools/chroot.sh
index 807fd4c5..8fba6388 100755
--- a/tools/chroot.sh
+++ b/tools/chroot.sh
@@ -28,15 +28,16 @@ fi
cerbero_distro_version="$DISTRO"_"$DISTRO_VERSION"
echo "bootstraping $DISTRO-$DISTRO_VERSION"
-debootstrap $DISTRO_VERSION $CHROOT_PATH $mirror
+debootstrap --arch=$ARCH $DISTRO_VERSION $CHROOT_PATH $mirror
cp /etc/resolv.conf $CHROOT_PATH/etc/resolv.conf
cp /etc/hosts $CHROOT_PATH/etc/hosts
hostname=$USER-$DISTRO-$DISTRO_VERSION-$ARCH-chroot
# hostnames cannot contain _
hostname=$(echo $hostname | sed s/'_'/'-'/g)
-echo $hostname > $CHROOT_PATH/etc/hostname
-chroot $CHROOT_PATH hostname $hostname
+#echo $hostname > $CHROOT_PATH/etc/hostname
+#chroot $CHROOT_PATH hostname $hostname
+echo $hostname > $CHROOT_PATH/etc/debian_chroot
userid=$(grep $USER /etc/passwd | cut -d: -f3)
echo "$USER:x:$userid:$userid:$USER,,,:/home/$USER:/bin/bash" >> $CHROOT_PATH/etc/passwd
@@ -44,6 +45,10 @@ echo "$USER::15460::::::" >> $CHROOT_PATH/etc/shadow
echo "$USER:x:$userid:" >> $CHROOT_PATH/etc/group
echo "$USER ALL=NOPASSWD: ALL" >> $CHROOT_PATH/etc/sudoers
+echo "installing sudo"
+chroot $CHROOT_PATH apt-get -y --force-yes install sudo
+
+echo "copying user git/ssh/gpg configurations"
mkdir -p $CHROOT_PATH/home/$USER
cp -f /home/$USER/.gitconfig $CHROOT_PATH/home/$USER/