Files
ToolDisks_ISO-WipeStation/Makefile
nodiscc e95fa28f98 tools: Makefile: move 3rd party downloads to separate file
- adds an easy way to disable third party downloads before build
2020-03-15 20:50:45 +01:00

85 lines
3.0 KiB
Makefile

#!/usr/bin/make -f
# remove 'download_extra' to build without third party software/dotfiles
all: install_buildenv clean download_extra build
download_extra:
make -f Makefile.extra
install_buildenv:
# Install packages required to build the image
sudo apt install live-build make build-essential wget git xmlstarlet unzip colordiff shellcheck apt-transport-https rename ovmf rsync
##############################
# clear all caches, only required when changing the mirrors/architecture config
clean:
sudo lb clean --purge
bump_version:
@last_tag=$$(git tag | tail -n1); \
echo "Please set version to $$last_tag in Makefile config/bootloaders/isolinux/live.cfg.in config/bootloaders/isolinux/menu.cfg auto/config"
build:
# Build the live system/ISO image
sudo lb clean --all
sudo lb config
sudo lb build
##############################
release: checksums sign_checksums release_archive
checksums:
# Generate checksums of the resulting ISO image
@mkdir -p iso/
mv *.iso iso/
last_tag=$$(git tag | tail -n1); \
cd iso/; \
rename "s/live-image/dlc-$$last_tag-debian-buster/" *; \
sha512sum *.iso > SHA512SUMS; \
sign_checksums:
# Sign checksums with a GPG private key
cd iso; \
gpg --detach-sign --armor SHA512SUMS; \
mv SHA512SUMS.asc SHA512SUMS.sign
release_archive:
git archive --format=zip -9 HEAD -o $$(basename $$PWD)-$$(git rev-parse HEAD).zip
################################
tests: download_iso test_kvm_bios test_kvm_uefi
download_iso:
# download the iso image from a build server
rsync -avP buildbot.xinit.se:/var/debian-live-config/debian-live-config/iso ./
test_kvm_bios:
# Run the resulting image in KVM/virt-manager (legacy BIOS mode)
sudo virt-install --name dlc-test --boot cdrom --disk path=/dlc-test-disk0.qcow2,format=qcow2,size=20,device=disk,bus=virtio,cache=none --cdrom 'iso/dlc-2.2-debian-buster-amd64.hybrid.iso' --memory 2048 --vcpu 2
sudo virsh destroy dlc-test
sudo virsh undefine dlc-test
sudo rm /dlc-test-disk0.qcow2
test_kvm_uefi:
# Run the resulting image in KVM/virt-manager (UEFI mode)
# UEFI support must be enabled in QEMU config for EFI install tests https://wiki.archlinux.org/index.php/Libvirt#UEFI_Support (/usr/share/OVMF/*.fd)
sudo virt-install --name dlc-test --boot loader=/usr/share/OVMF/OVMF_CODE.fd --disk path=/dlc-test-disk0.qcow2,format=qcow2,size=20,device=disk,bus=virtio,cache=none --cdrom 'iso/dlc-2.2-debian-buster-amd64.hybrid.iso' --memory 2048 --vcpu 2
sudo virsh destroy dlc-test
sudo virsh undefine dlc-test
sudo rm /dlc-test-disk0.qcow2
#################################
# Update TODO.md by fetching issues from the main gitea instance API
# requirements: sudo apt install git jq
# gitea-cli config defined in ~/.config/gitearc
update_todo:
git clone https://github.com/bashup/gitea-cli gitea-cli
-rm TODO.md
echo '<!-- This file is automatically generated by "make update_todo" -->' > TODO.md
./gitea-cli/bin/gitea issues zerodb/debian-live-config | jq -r '.[] | "- #\(.number) - \(.title)"' >> TODO.md; \
rm -rf gitea-cli