From Gentoo Wiki
Jump to:navigation Jump to:search

Build a testing environment for Jami and other software.

I generally work under /srv.

Create the chroots directory:

root #mkdir --parents /srv/chroots

Download fresh stage 3:

Extract somewhere safe as root. In this case, into a BTRFS subvolume (/srv/chroots/stage3-amd64-systemd-vanilla)

root #btrfs subvol create /srv/chroots/stage3-amd64-systemd-vanilla
Create subvolume '/srv/chroots/stage3-amd64-systemd-vanilla'

Extract the stage 3 file into the subvolume:

root #tar xpvf stage3-*.tar.xz --xattrs-include='*.*' --numeric-owner -C /srv/chroots/stage3-amd64-systemd-vanilla

Create a second snapshot of the subvolume to develop the ebuild or software package; be sure to append an identifying name for the designated purpose of the snapshot.

In order to emerge packages in the subvolume snapshot(s), bind mount a copy of host system's gentoo:: ebuild repository:

root #mkdir --parents stage3-amd64-systemd-vanilla/var/db/repos/gentoo
root #mount --bind /var/db/repos/gentoo stage3-amd64-systemd-vanilla/var/db/repos/gentoo

Web development

root #btrfs subvolume snapshot /srv/chroots/stage3-amd64-systemd-vanilla /srv/chroots/stage3-amd64-systemd-www
Create a snapshot of '/srv/chroots/stage3-amd64-systemd-www' in '/srv/chroots/stage3-amd64-systemd-www'

Ebuild development

root #btrfs subvolume snapshot /srv/chroots/stage3-amd64-systemd-vanilla /srv/chroots/stage3-amd64-systemd-jami
Create a snapshot of '/srv/chroots/stage3-amd64-systemd-vanilla' in '/srv/chroots/stage3-amd64-systemd-jami'
root #echo "sys-apps/portage gentoo-dev" >> /srv/chroots/stage3-amd64-systemd-jami/etc/portage/package.use/portage

Copy in the latest checkout of gentoo::

Packages to install in the chroot for testing:

root #echo -e "sys-apps/portage\napp-portage/repoman\ndev-util/pkgdev" >> /srv/chroots/stage3-amd64-systemd-jami/var/lib/portage/world

Maintainer scripts

Script will need to run as root. Create cron and systemd-timer equivalents.

# Verify script is running as root.
# Check for a HTTP get tool (wget/curl)
# Check for btrfs filesystem support (/proc/filesystems)
# Check for btrfs userspace utilities (`btrfs version` then check exit status).
# Check that directory current location is btrfs formatted or fail _gracefully_
# Check for location of gentoo:: ebuild repository `portageq get_repo_path / gentoo`

# Bind mount gentoo:: to make master repo available
# Bind mount local overlay 
# Generate ethereal chroot script based on collected data.

# Generate vanilla chroot maintenance script (`mktemp` [sys-apps/coreutils]/`trap` combo [bash builtin])

Jami packages