From 7fea9ebc8a3c33bc81cc0db4d4ad9a8ff0be06af Mon Sep 17 00:00:00 2001 From: "Andre Moreira Magalhaes (andrunko)" Date: Thu, 3 May 2012 12:02:33 -0300 Subject: 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 --- tools/chroot.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'tools') 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/ -- cgit v1.2.3