X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=input%2Fhowto%2Fdchroot.creole;h=4db4160d8f4f56e2b9b19c75b31b0f5f246d4b96;hb=8a442609eb3f4b305eb6389e27eed835efaf79f6;hp=a543ac47113f6bda9dac218c8a01fad38c64e4c9;hpb=bd28731ebe2657d50d74914e389e3ab98fa7d327;p=mirror%2Fdsa-wiki.git diff --git a/input/howto/dchroot.creole b/input/howto/dchroot.creole index a543ac4..4db4160 100644 --- a/input/howto/dchroot.creole +++ b/input/howto/dchroot.creole @@ -1,6 +1,21 @@ == HOWTO set up a porting dchroot on a debian.org machine == +The script 'upgrade-porter-chroots' has expectations about naming conventions +for new porter chroots. The current list it searches for are: + +{{{ +lenny squeeze wheezy sid \ +lenny_i386 squeeze_i386 wheezy_i386 sid_i386 \ +lenny_amd64 squeeze_amd64 wheezy_amd64 sid_amd64 \ +sid_s390x \ +}}} + +Please make sure that new chroots meet the expectations of the script, or update +the script accordingly (it lives in the debian.org.git repo) + + + This example is for setting up a $DIST dchroot on paer.debian.org, adjust accordingly. @@ -8,37 +23,31 @@ 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 + echo 'Acquire::Languages "none";' > /etc/apt/apt.conf.d/local-no-lang # # not sure this one's a good idea, -- weasel 20080829 # ##echo 'DPkg::Post-Invoke { "(sleep 1; apt-get clean) &"; };' > /etc/apt/apt.conf.d/local-cleanup # @@ -72,15 +81,15 @@ EOF # least "en_US.UTF-8 UTF-8" and "en_US ISO-8859-1".) # #*) 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/' \ - /etc/nsswitch.conf + # [dchroot]: 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/' \ + # /etc/nsswitch.conf # # # *) - 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 @@ -94,15 +103,13 @@ EOF ) > /etc/apt/sources.list apt-get update && apt-get upgrade # -# *) - mount /proc && debfoster && umount /proc # # *) # exit the chroot exit }}} -* edit /etc/fstab on the system root and add entries to mount /proc and /home +* [dchroot only] edit /etc/fstab on the system root and add entries to mount /proc and /home in the chroot, there will be existing ones for the other chroots, just copy and adjust. Then mount them (from the system root). {{{ @@ -128,14 +135,12 @@ adjust. Then mount them (from the system root). : tmp /srv/albeniz.debian.org/chroot/sid/tmp none bind,defaults }}} -* edit /etc/dchroot.conf in the system root, add an entry for $DIST, and -update the stable and testing pointers +* [schroot] set up /etc/schroot/chroot.d/ correctly. + [dchroot]: edit /etc/dchroot.conf in the system root, add an entry for $DIST, and update the stable and testing pointers -* run ud-replicate so the new chroot is setup (this would happen via cron eventually, this is just to speed things up) +* [dchroot]: run ud-replicate so the new chroot is setup (this would happen via cron eventually, this is just to speed things up) {{{ ud-replicate }}} -* as a normal user, test that the new chroot works: "dchroot $DIST", test that the stable and testing pointers work. - --- taggart 2007, slightly modified by weasel 2007, 2008, ported to wiki 2010. +* as a normal user, test that the new chroot works: "dchroot $DIST" or "schroot $DIST", test that the stable and testing pointers work.