Created
December 13, 2024 21:39
-
-
Save dch/b9bad6a727a1675eb0e49c771ec089f9 to your computer and use it in GitHub Desktop.
builder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh -eu | |
# echo 'WITH_CCACHE_BUILD=yes' > /etc/src.conf | |
# echo 'WITH_META_MODE=yes' > /etc/src-env.conf | |
# echo 'WITH_DIRDEPS_BUILD=yes' >> /etc/src-env.conf | |
umask 0022 | |
cd /usr/src | |
NOW=$(date -u +%Y%m%d-%H%M) | |
# NCPU=$(sysctl -n hw.ncpu) | |
NCPU=3.0 | |
GIT=g$(git rev-parse --verify --short=7 HEAD) | |
SVN=r$(git notes show HEAD | rg -o '\d+$' || /usr/bin/true) | |
if [ "${SVN}" = "r" ]; then | |
COMMIT=${GIT} | |
else | |
COMMIT=${SVN} | |
fi | |
STASH=/downloads/FreeBSD/current/${COMMIT} | |
echo STASH $STASH | |
RELEASE=/usr/obj/usr/src/amd64.amd64/release | |
mkdir -p -m0775 ${STASH}/amd64 || /usr/bin/true | |
#zfs rollback -r zroot/usr/obj@empty | |
#zfs rollback -rRf zroot/usr/obj/release@empty | |
chflags -R noschg ${RELEASE} || /usr/bin/true | |
chown -R dch:wheel ${RELEASE} || /usr/bin/true | |
rm -rf ${RELEASE} | |
# mount -t tmpfs tmpfs ${RELEASE} | |
git reset --hard | |
git clean -fdx | |
doas zfs snapshot \ | |
-r zroot/usr/src@${NOW}:bebuild-${COMMIT} \ | |
|| /usr/bin/true | |
time make -j${NCPU} buildworld -s | |
echo DONE BW | |
date -u +%Y%m%d-%H%M | |
time make -j${NCPU} buildkernel -s | |
echo DONE BK | |
date -u +%Y%m%d-%H%M | |
# grab latest makefs | |
#cd /usr/src/usr.sbin/makefs | |
#make depend all install | |
cd /usr/src/release | |
time make -DNOPORTS -DNOSRC -DNOTEST -s ftp | |
cd ${RELEASE} | |
cp -av ftp/* ${STASH}/amd64 | |
echo DONE IMG | |
date -u +%Y%m%d-%H%M | |
cd /usr/src | |
rm ${STASH}/../latest | |
ln -s ${STASH} ${STASH}/../latest | |
# chmod 0644 ${STASH}/amd64/* | |
# chmod 0755 ${STASH} ${STASH}/latest ${STASH}/amd64 | |
echo DONE SRC $STASH $RELEASE | wall | |
cd /usr/src | |
time /usr/bin/env NO_PKG_UPGRADE=1 /usr/src/tools/build/beinstall.sh | |
# time /usr/bin/env NO_PKG_UPGRADE=1 NO_CLEANUP_BE=1 /usr/src/tools/build/beinstall.sh | |
cp /boot/efi/EFI/FreeBSD/current.efi /boot/efi/EFI/FreeBSD/lastgood.efi | |
cp -av /usr/obj/usr/src/amd64.amd64/release/dist/base/boot/loader.efi /boot/efi/EFI/FreeBSD/current.efi | |
echo DONE BE | wall | |
yes | poudriere jail -d -C all -j current_x64 \ | |
|| /usr/bin/true | |
rm -rf /usr/local/poudriere/jails/current_x64 \ | |
|| /usr/bin/true | |
poudriere jail -c \ | |
-j current_x64 \ | |
-v 15.0-CURRENT | |
# -a amd64 \ | |
# -S /usr/src \ | |
# -K GENERIC \ | |
# -m tar=${RELEASE}/base.txz \ | |
# || /usr/bin/true | |
echo DONE POUDRIERE | wall | |
date -u +%Y%m%d-%H%M | |
echo DONE ALL | wall |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment