makefile improvements: add test_imagesize target, update bump_version target, update versions, fix todo.md path

This commit is contained in:
nodiscc
2020-04-06 19:19:24 +02:00
parent 3e5fa08083
commit 13231ca4e6

View File

@@ -1,4 +1,7 @@
#!/usr/bin/make -f #!/usr/bin/make -f
# Change the default shell /bin/sh which does not implement 'source'
# source is needed to work in a python virtualenv
SHELL := /bin/bash
# remove 'download_extra' to build without third party software/dotfiles # remove 'download_extra' to build without third party software/dotfiles
all: install_buildenv clean download_extra build all: install_buildenv clean download_extra build
@@ -19,7 +22,7 @@ clean:
bump_version: bump_version:
@last_tag=$$(git tag | tail -n1); \ @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" echo "Please set version to $$last_tag in Makefile config/bootloaders/isolinux/live.cfg.in config/bootloaders/isolinux/menu.cfg auto/config doc/md/download-and-installation.md"
build: build:
# Build the live system/ISO image # Build the live system/ISO image
@@ -51,7 +54,14 @@ release_archive:
################################ ################################
tests: download_iso test_kvm_bios test_kvm_uefi tests: test_imagesize download_iso test_kvm_bios test_kvm_uefi
test_imagesize:
@size=$$(du -b iso/*.iso | cut -f 1); \
echo "[INFO] ISO image size: $$size bytes"; \
if [[ "$$size" -gt 2147483648 ]]; then \
echo '[WARNING] ISO image size is larger than 2GB!'; \
fi
download_iso: download_iso:
# download the iso image from a build server # download the iso image from a build server
@@ -59,7 +69,7 @@ download_iso:
test_kvm_bios: test_kvm_bios:
# Run the resulting image in KVM/virt-manager (legacy BIOS mode) # 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 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.2-debian-buster-amd64.hybrid.iso' --memory 2048 --vcpu 2
sudo virsh destroy dlc-test sudo virsh destroy dlc-test
sudo virsh undefine dlc-test sudo virsh undefine dlc-test
sudo rm /dlc-test-disk0.qcow2 sudo rm /dlc-test-disk0.qcow2
@@ -67,7 +77,7 @@ test_kvm_bios:
test_kvm_uefi: test_kvm_uefi:
# Run the resulting image in KVM/virt-manager (UEFI mode) # 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) # 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 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.2-debian-buster-amd64.hybrid.iso' --memory 2048 --vcpu 2
sudo virsh destroy dlc-test sudo virsh destroy dlc-test
sudo virsh undefine dlc-test sudo virsh undefine dlc-test
sudo rm /dlc-test-disk0.qcow2 sudo rm /dlc-test-disk0.qcow2
@@ -79,7 +89,7 @@ test_kvm_uefi:
# gitea-cli config defined in ~/.config/gitearc # gitea-cli config defined in ~/.config/gitearc
update_todo: update_todo:
git clone https://github.com/bashup/gitea-cli gitea-cli git clone https://github.com/bashup/gitea-cli gitea-cli
-rm TODO.md -rm doc/md/TODO.md
echo '<!-- This file is automatically generated by "make update_todo" -->' > TODO.md echo '<!-- This file is automatically generated by "make update_todo" -->' > doc/md/TODO.md
./gitea-cli/bin/gitea issues zerodb/debian-live-config | jq -r '.[] | "- #\(.number) - \(.title)"' >> TODO.md; \ ./gitea-cli/bin/gitea issues zerodb/debian-live-config | jq -r '.[] | "- #\(.number) - \(.title)"' >> doc/md/TODO.md; \
rm -rf gitea-cli rm -rf gitea-cli