CRUX : Home

Home :: Documentation :: Download :: Development :: Community :: Wiki :: Ports :: Bugs :: Links :: About

Back to wiki start page

Categories: Ports

How to test your ports on a prerelease using a chroot environment

Step 1: prepare target chroot

# CHROOT=/crux-2.4
# mkdir $CHROOT
# mkdir -p $CHROOT/var/lib/pkg
# touch $CHROOT/var/lib/pkg/db

Step 2: install core packages

On a host with a pkgadd binary (typically when doing this on a CRUX host):

# mount -o loop crux-2.4.iso /mnt
# cd /mnt/crux
# for p in core/* ; do pkgadd -r $CHROOT $p; done

On a host without pkgadd binary:

# mount -o loop crux-2.4.iso /mnt
# cd /mnt/crux
# tar xvf /mnt/crux/core/pkgutils#5.31.0-1.pkg.tar.gz usr/bin/pkgadd -O > /tmp/pkgadd
# for p in core/* ; do /tmp/pkgadd -r $CHROOT $p; done

Step 3: copy DNS settings

# cp /etc/resolv.conf $CHROOT/etc

Step 4: Activate your chroot

# mount -t proc proc $CHROOT/proc
# mount --bind /dev $CHROOT/dev
# mount --bind /sys $CHROOT/sys
# chroot $CHROOT /bin/bash

This step (#4) has to be repeated after every reboot

Step 5: Verify

# crux
CRUX version 2.4
# gcc -v
 ...
gcc version 4.2.2
# ports -u
...

Step 6: test ports

# cd /usr/ports/opt # adjust to your liking
# for p in `grep -l <your name> */Pkgfile`;
# do prt-get depinst ${p%*/} --log; done
# cd /var/log/pkgbuild

Bold: It may be wise to share the ccache cache dir with the "outside" environment