For people who don't use Void Linux, but want to use Void's xbps-src
or maintain packages in Void's repo.
Create a loop device image. Change the count
number if you want smaller/bigger image file.
sudo dd if=/dev/zero of=void.img bs=100M count=50
sudo losetup -fP void.img
After that, check your newly create loop device. In my case, the device is /dev/loop0
.
losetup -a
/dev/loop0: []: (/path/to/void.img)
Format to ext4
and mount it.
sudo mkfs.ext4 /dev/loop0
sudo mkdir /mnt/void
sudo mount -o loop /dev/loop0 /mnt/void
Download the latest ROOTFS tarball from Void linux repo, extract it.
sudo wget https://alpha.de.repo.voidlinux.org/live/current/void-<your-arch-here>-ROOTFS-20181111.tar.xz
# or download manually here https://alpha.de.repo.voidlinux.org/live/current/
sudo tar xpfv <ROOTFS FILENAME>.tar.xz --xattrs-include='*.*' --numeric-owner
Chroot into /mnt/void
sudo chroot /mnt/void
Setup working DNS
echo 'nameserver 8.8.8.8' > /etc/resolv.conf
Install required stuff.
xbps-install -Su
xbps-install -S git proot eudev
Your Void chroot system is now ready.
I don't know how to get it working, even after adding the user to xbuilder
group. In your void-packages
folder run:
echo XBPS_CHROOT_CMD=proot >> etc/conf
sudo mount -o loop void.img /mnt/void
sudo mkdir /mnt/void/void-packages # if it didn't exist
sudo mount --bind /path/to/void-packages /mnt/void/void-packages
sudo mount --bind /proc /mnt/void/proc
sudo mount --bind /sys /mnt/void/sys
sudo mount --bind /dev /mnt/void/dev
# or just clone the void-repo there, but i don't think that's a good idea since it will make your img file big.
sudo umount --recursive /mnt/void