This shows you the differences between two versions of the page.
— | wiki:schroot-centos [2013/07/09 10:52] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Setup a CentOS schroot on Debian ====== | ||
+ | |||
+ | Inspired by the setup of Debian chroot for sbuild: | ||
+ | * http:// | ||
+ | * http:// | ||
+ | |||
+ | <code bash> | ||
+ | $ apt-get install schroot sbuild btrfs-tools | ||
+ | </ | ||
+ | |||
+ | We will use the btrfs flavor of schroot. | ||
+ | |||
+ | Since btrfs is still experimental, | ||
+ | |||
+ | <code bash> | ||
+ | $ cat <EOF >> /etc/fstab | ||
+ | / | ||
+ | EOF | ||
+ | |||
+ | / | ||
+ | </ | ||
+ | |||
+ | Create the centos6 schroot configuration file: | ||
+ | |||
+ | <code bash> | ||
+ | $ cat < ' | ||
+ | [centos6-amd64] | ||
+ | type=btrfs-snapshot | ||
+ | description=CentOS 6/amd64 autobuilder | ||
+ | groups=root, | ||
+ | root-groups=root, | ||
+ | profile=sbuildrpm | ||
+ | btrfs-source-subvolume=/ | ||
+ | btrfs-snapshot-directory=/ | ||
+ | EOF | ||
+ | </ | ||
+ | |||
+ | Setup the filesystem subvolume and snapshots | ||
+ | |||
+ | <code bash> | ||
+ | $ btrfs subvolume create / | ||
+ | |||
+ | $ mkdir -p / | ||
+ | </ | ||
+ | |||
+ | Bootstrap the centos system: | ||
+ | |||
+ | <code bash> | ||
+ | $ cat EOF >> / | ||
+ | [centos-6] | ||
+ | mirror | ||
+ | mirror.amd64 = http:// | ||
+ | EOF | ||
+ | |||
+ | $ rinse --distribution centos-6 --arch amd64 --directory / | ||
+ | </ | ||
+ | |||
+ | We copy the /dev from a Debian schroot (rinse' | ||
+ | <code bash> | ||
+ | $ cp -a / | ||
+ | </ | ||
+ | |||
+ | Finally, we do some customizations to make the centos system schroot friendly | ||
+ | |||
+ | <code bash> | ||
+ | $ echo centos6-amd64 > / | ||
+ | $ cat << ' | ||
+ | # set variable identifying the chroot you work in (used in the prompt below) | ||
+ | if [ -z " | ||
+ | debian_chroot=$(cat / | ||
+ | fi | ||
+ | |||
+ | # set a fancy prompt (non-color, overwrite the one in / | ||
+ | PS1=' | ||
+ | |||
+ | EOF | ||
+ | </ | ||
+ | |||
+ | |||
+ | Test | ||
+ | <code bash> | ||
+ | $ sudo adduser < | ||
+ | </ | ||
+ | (logout and login again) | ||
+ | |||
+ | Enter the snapshoted chroot: | ||
+ | <code bash> | ||
+ | $ schroot -c chroot: | ||
+ | </ | ||
+ | |||
+ | Enter the source chroot (to upgrade the base system for instance) | ||
+ | <code bash> | ||
+ | $ sudo schroot -c source: | ||
+ | </ | ||
+ | |||
+ | You can then use sbuildrpm or any other test in the CentOS schroot environement... | ||