#!/usr/bin/env bash -xe # This build script is meant to be run from the vroot.x(32|64) directory, as part of the build process # It more-or-less automates the Abigail build process # Make sure appropriate directories have been bind-mounted (sudo sh ../bm.sh) # Update the build chroot, last release published was 20191111 sudo chroot . /bin/bash -c '(xbps-install -Syu && xbps-install -Syu && exit)' # Copy in our RELEASE, etc, files for F in RELEASE .pkgs .svcs .patches .build; do sudo cp -r ../files/"${F}" ./; done # Enter the updated build environment # Install packages, remake the mandoc db, enable services, patch the boot process, and finally remove orphan packages sudo chroot . /bin/bash -xe -c '\ ( \ cd / &&\ for PKG in $(cat .pkgs); do xbps-install -Suy $PKG; done &&\ makewhatis /usr/share/man &&\ for SVC in $(cat .svcs); do ln -s /etc/sv/$SVC /etc/runit/runsvdir/default/$SVC; done &&\ patch -R -p1 /etc/runit/core-services/03-filesystems.sh < /.patches/fix-panic-on-readonly-root.patch &&\ xbps-install -Syu &&\ mkdir -m 755 /rw &&\ cd / &&\ mv etc rw/etc &&\ mv var rw/var &&\ ln -s rw/etc etc &&\ ln -s rw/var var &&\ mkdir -m 0400 /initrd &&\ xbps-remove --remove-orphans &&\ rmdir /opt /media ||: &&\ : )' sudo touch ./initrd/init3.btrfs sudo mkfs.btrfs --shrink --rootdir=../../initrd2 initrd/init3.btrfs sudo chown root:root initrd/init3.btrfs sudo chmod 0400 initrd/init3.btrfs