grml2iso: execute under pipefail Quoting from bash(1): | The return status of a pipeline is the exit status of the last | command, unless the pipefail option is enabled. If pipefail is enabled, | the pipeline's return status is the value of the last (rightmost) | command to exit with a non-zero status, or zero if all commands exit | successfully. Furthermore, move the "set -e" to the beginning of the file, to ensure it's active as soon as possible. While at it, drop trailing whitespace and update ISO name to a more recent one. This work was funded by Grml-Forensic.
Github action: do not install virtualenv + python3-setuptools pip3 and python3-setuptools are available out of the box on ubuntu-latest. By not having to install python3-virtualenv we gain ~6 seconds in each of of the codecheck and unit tests runs. So instead let's rely on system wide pip3, given that we're running in a throw-away VM anyway. Thanks: Chris Hofstaedtler
Fix vulture usage and add vulture to Build-Depends * grml2iso is a shell script, executing vulture doesn't work on it * the Debian package build process executes 'make codecheck:', so everything what's needed for its execution needs to be covered through the Build-Dependencies, accordingly add add vulture to Build-Depends
Fix --grub and --syslinux handling With commit 3664e4ae we removed an argument from the grub_option() and syslinux_warning() callback functions, which was reported as false positives by vulture tool. Fixes regression from 3664e4ae, failing grml2usb execution with --grub (and deprecated --syslinux) command line option with: | TypeError: grub_option() takes 3 positional arguments but 4 were given Thanks: Ralf Moll for the bugreport
Fix race condition with blockdev/BLKRRPART due to lack of fsync Quoting dann frazier from Debian's #975015: | grml2usb autopkgtest frequently fail in Ubuntu's CI. | [...] | 2020-11-17 14:14:49,433 Probing device via 'blockdev --rereadpt /dev/loop0' | blockdev: ioctl error on BLKRRPART: Device or resource busy | 2020-11-17 14:14:49,452 Execution failed: ("Couldn't execute blockdev on '%s' (install util-linux?)", '/dev/loop0') | | I am able to reproduce this on an OpenStack instance with a failure rate of | 33% (36 failures, 110 passes). My theory is that the sync is not sufficient, | and that we really need to do a targeted fsync of the file. With the | attached patch, I've yet to see a failure in 42 iterations. Thanks: dann frazier <dannf@dannf.org> for bug report and patch Closes: #975015
codecheck: reformat with black, version 20.8b1 The formatting of grml2usb that was done with black, version 18.9b0 triggers changes with black 20.8b1-3 as present in current Debian/unstable: | black --check grml2usb | would reformat grml2usb | Oh no! 💥 💔 💥 | 1 file would be reformatted. | make[2]: *** [Makefile:44: codecheck] Error 1 Applying the change via modern black though doesn't lead to any changes with black, version 18.9b0, so let's use this. Gbp-Dch: Ignore