minor dchroot updates
authorPeter Palfrader <peter@palfrader.org>
Sat, 2 Mar 2013 19:26:02 +0000 (20:26 +0100)
committerPeter Palfrader <peter@palfrader.org>
Sat, 2 Mar 2013 19:26:02 +0000 (20:26 +0100)
input/howto/dchroot.creole

index f6733f1..4db4160 100644 (file)
@@ -23,34 +23,27 @@ Do the following as root:
 
 {{{
   echo -n 'Dist: ' && read DIST && export DIST &&
-  echo -n 'Mirror: ' && read MIRROR && export MIRROR 
+  echo -n 'Mirror: ' && read MIRROR && export MIRROR &&
+  default_arch="$(dpkg --print-architecture)" &&
+  echo -n "Arch [$default_arch]: " && read ARCH &&
+  if [ -z "$ARCH" ]; then ARCH="$default_arch"; fi &&
+  export ARCH
 }}}
 
 
 * create the chroot
 {{{
   cd /srv/chroot &&
-  mkdir $DIST &&
-  debootstrap --keyring /usr/share/keyrings/debian-archive-keyring.gpg --include="apt" --variant=buildd $DIST ./$DIST http://$MIRROR/debian &&
-  cp /etc/hosts $DIST/etc/
-}}} 
+  mkdir "${DIST}_${ARCH}" &&
+  debootstrap --keyring /usr/share/keyrings/debian-archive-keyring.gpg --include="apt" --variant=buildd $DIST ./"${DIST}_${ARCH}" http://$MIRROR/debian &&
+  cp /etc/hosts "${DIST}_${ARCH}"/etc/
+}}}
 
 * enter the chroot and create the chroot tag:
 {{{
-chroot $DIST
+chroot "${DIST}_${ARCH}"
 echo $DIST > /etc/debian_chroot
 
-# change root's .bashrc:
- grep -q debian.chroot /etc/bash.bashrc || patch /root/.bashrc << 'EOF'
-@@ -3,2 +3,6 @@
- export PS1='\h:\w\$ '
-+if [ -e /etc/debian_chroot ]; then
-+       debian_chroot=$(cat /etc/debian_chroot)
-+       PS1="[$debian_chroot] $PS1"
-+fi
- umask 022
-EOF
-#
 #*)
  echo 'Acquire::PDiffs "false";' > /etc/apt/apt.conf.d/local-pdiff
  echo 'APT::Install-Recommends 0;' > /etc/apt/apt.conf.d/local-recommends
@@ -96,7 +89,7 @@ EOF
 #
 #
 # *)
-   apt-get install vim fakeroot devscripts gdb zsh dialog tcsh debfoster
+   apt-get install vim fakeroot devscripts gdb zsh dialog tcsh
 #  edit the sources.list in the chroot and add contrib/non-free to the
 #  primary source, a security updates source, and deb-src entries for both.
 #  It should end up looking something like
@@ -110,8 +103,6 @@ EOF
    ) > /etc/apt/sources.list
    apt-get update && apt-get upgrade
 #
-# *)
-  mount -t proc none /proc && debfoster ; umount /proc
 #
 # *)
 #  exit the chroot