proc mount stuff
[mirror/dsa-wiki.git] / input / howto / dchroot.creole
index d2128dc..044888c 100644 (file)
@@ -16,7 +16,7 @@ Do the following as root:
 {{{
   cd /srv/chroot &&
   mkdir $DIST &&
-  debootstrap --keyring /usr/share/keyrings/debian-archive-keyring.gpg --variant=buildd $DIST ./$DIST http://$MIRROR/debian &&
+  debootstrap --keyring /usr/share/keyrings/debian-archive-keyring.gpg --include="apt" --variant=buildd $DIST ./$DIST http://$MIRROR/debian &&
   cp /etc/hosts $DIST/etc/
 }}} 
 
@@ -26,7 +26,7 @@ chroot $DIST
 echo $DIST > /etc/debian_chroot
 
 # change root's .bashrc:
- patch /root/.bashrc << 'EOF'
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
@@ -73,9 +73,9 @@ EOF
 #
 #*) setup nsswitch.conf to properly use the ldap stuff
   apt-get install libnss-db &&
-  sed -i -e 's/^passwd:[[:space:]]\+compat$/passwd:         compat db/;
-             s/^group:[[:space:]]\+compat$/group:          db compat/;
-             s/^shadow:[[:space:]]\+compat$/shadow:         compat db/' \
+  sed -i -e 's/^passwd:\[[:space:]]\+compat$/passwd:         compat db/;
+             s/^group:\[[:space:]]\+compat$/group:          db compat/;
+             s/^shadow:\[[:space:]]\+compat$/shadow:         compat db/' \
     /etc/nsswitch.conf
 #
 #
@@ -95,7 +95,7 @@ EOF
    apt-get update && apt-get upgrade
 #
 # *)
-  mount /proc && debfoster && umount /proc
+  mount -t proc none /proc && debfoster ; umount /proc
 #
 # *)
 #  exit the chroot