From a6cce2293f8dd8ca787e7617d640304b682d5dfe Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Sat, 24 Apr 2021 22:19:12 +0200 Subject: [PATCH 01/10] 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 --- .github/workflows/check-full.yml | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/.github/workflows/check-full.yml b/.github/workflows/check-full.yml index 91d5ab6..4536d0f 100644 --- a/.github/workflows/check-full.yml +++ b/.github/workflows/check-full.yml @@ -15,15 +15,6 @@ jobs: - name: Checkout source uses: actions/checkout@v2 - - name: Install virtualenv + python3-setuptools - run: sudo apt-get install virtualenv python3-setuptools - - - name: Set up Python virtualenv environment - run: virtualenv -p /usr/bin/python3 venv3 - - - name: Activate Python virtualenv environment - run: . ./venv3/bin/activate - - name: pip install wheel (to make install black work) run: pip3 install wheel @@ -41,15 +32,6 @@ jobs: - name: Checkout source uses: actions/checkout@v2 - - name: Install virtualenv + python3-setuptools - run: sudo apt-get install virtualenv python3-setuptools - - - name: Set up Python virtualenv environment - run: virtualenv -p /usr/bin/python3 venv3 - - - name: Activate Python virtualenv environment - run: . ./venv3/bin/activate - - name: Install pytest run: pip3 install pytest -- 2.1.4 From 78ae858b306428eb130c8338d103ba2779c12857 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Fri, 11 Mar 2022 18:20:01 +0100 Subject: [PATCH 02/10] grml2iso: support parallel execution Usage of a static working directory name doesn't make sense, and prevents usage running grml2iso multiple times in parallel. Instead use a temporary working directory. This work was funded by Grml-Forensic. --- grml2iso | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/grml2iso b/grml2iso index 5f32804..b29c4df 100755 --- a/grml2iso +++ b/grml2iso @@ -11,10 +11,8 @@ PATH="${PATH}:/sbin:/usr/local/sbin:/usr/sbin" # adjust variables if necessary through environment {{{ # path to the grml2usb script you'd like to use - [ -n "$GRML2USB" ] || GRML2USB='grml2usb' -# work directory for creating the filesystem - [ -n "$TMPDIR" ] && WRKDIR="${TMPDIR}/grml2iso.tmp" - [ -n "$WRKDIR" ] || WRKDIR='/tmp/grml2iso.tmp' +[ -n "$GRML2USB" ] || GRML2USB='grml2usb' + # support mkisofs as well as genisoimage if which xorriso >/dev/null 2>&1 ; then MKISOFS='xorriso -as mkisofs' @@ -54,7 +52,8 @@ Options: restrictions in the bootprocess only IPs are allowed. Supported protocols are: http and ftp -t Directory Directory that should be used for temporary files - during build. Defaults to /tmp/grml2iso.tmp if unset. + during build, instead of using a temporary directory + created by mktemp(1). Examples: $0 -s http://192.168.23.42:8000/grml/ -o small.iso grml64-small_2018.12.iso @@ -95,10 +94,6 @@ Options: GRML2USB_OPTS+=(--bootoptions="fetch=$URI") fi - if [ -n "$WRKDIR" ] ; then - GRML2USB_OPTS+=(--tmpdir="$WRKDIR") - fi - # make sure -o is specified [ -n "$ISOFILE" ] || usage 1 @@ -143,8 +138,16 @@ Options: esac # }}} -# create necessary stuff under WRKDIR {{{ - [ -d "$WRKDIR" ] && WRKDIR_EXISTED='true' || WRKDIR_EXISTED='false' +# ensure to properly set up working directory {{{ + WRKDIR_EXISTED='false' + if [ -z "$WRKDIR" ] ; then + WRKDIR="$(mktemp -d)" + else + [ -d "$WRKDIR" ] && WRKDIR_EXISTED='true' + fi + + GRML2USB_OPTS+=(--tmpdir="$WRKDIR") + rm -rf "$WRKDIR/cddir" "$WRKDIR/grub_tmp" mkdir -p "$WRKDIR/cddir" # }}}} -- 2.1.4 From 8126bbf87f43e55098d09cd7592a60418ea19d2a Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Fri, 11 Mar 2022 18:25:31 +0100 Subject: [PATCH 03/10] 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. --- grml2iso | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/grml2iso b/grml2iso index b29c4df..3e48688 100755 --- a/grml2iso +++ b/grml2iso @@ -6,6 +6,8 @@ # License: This file is licensed under the GPL v2 or any later version. ################################################################################ +set -e -o pipefail + # make sure we have the sbin directories in our PATH to find grml2usb ootb PATH="${PATH}:/sbin:/usr/local/sbin:/usr/sbin" @@ -32,8 +34,6 @@ fi # }}} # helper stuff {{{ - set -e - usage() { echo >&2 "Usage: $0 [OPTIONS] -o target.iso source1.iso [source2.iso ...]" echo >&2 " @@ -56,7 +56,7 @@ Options: created by mktemp(1). Examples: - $0 -s http://192.168.23.42:8000/grml/ -o small.iso grml64-small_2018.12.iso + $0 -s http://192.168.23.42:8000/grml/ -o small.iso grml64-small_2021.07.iso Will generate a file small.iso which tries to download the squashfs file from http://192.168.23.42:8000/grml/ - the squashfs file is placed in the same -- 2.1.4 From 6a409984ab0316d0a59c5e4ab38dac86a48282ae Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Mon, 21 Mar 2022 16:20:56 +0100 Subject: [PATCH 04/10] Release new version 0.19.0 --- debian/changelog | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/debian/changelog b/debian/changelog index 2389236..f712727 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,17 @@ +grml2usb (0.19.0) unstable; urgency=medium + + [ Manuel Rom ] + * [40221eb] Add Github action workflows for CI/CD + + [ Michael Prokop ] + * [3f77679] Fix vulture usage and add vulture to Build-Depends + * [a6cce22] Github action: do not install virtualenv + + python3-setuptools. Thanks to Chris Hofstaedtler + * [78ae858] grml2iso: support parallel execution + * [8126bbf] grml2iso: execute under pipefail + + -- Michael Prokop Mon, 21 Mar 2022 16:19:54 +0100 + grml2usb (0.18.5) unstable; urgency=medium * [01ed11d] Fix --grub and --syslinux handling. Thanks to Ralf Moll for -- 2.1.4 From 27eba4ace1f4cde430f773c01a629c240b6bf207 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Wed, 7 Sep 2022 13:57:23 +0200 Subject: [PATCH 05/10] Replace egrep usage with grep -E grep 3.8 deprecated support for egrep + fgrep, and now prints a warning on stderr: | egrep: warning: egrep is obsolescent; using grep -E | fgrep: warning: fgrep is obsolescent; using grep -F --- debian/rules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/rules b/debian/rules index f83d809..7d696b5 100755 --- a/debian/rules +++ b/debian/rules @@ -10,7 +10,7 @@ VERSION:=$(shell dpkg-parsechangelog | awk '/Version: / { print $$2 }') override_dh_auto_build: dh_testdir - egrep -q '^PROG_VERSION = "\*\*\*UNKNOWN\*\*\*"' grml2usb || (echo "PROG_VERSION in grml2usb wrong." && exit 2) + grep -qE '^PROG_VERSION = "\*\*\*UNKNOWN\*\*\*"' grml2usb || (echo "PROG_VERSION in grml2usb wrong." && exit 2) $(MAKE) -C mbr $(MAKE) -- 2.1.4 From ec28a5006697e567fbc5496b05da9a50ce42d333 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Wed, 8 Feb 2023 08:27:47 +0100 Subject: [PATCH 06/10] Bump Standards-Version to 4.6.2 --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index d6cac4f..c60f8fb 100644 --- a/debian/control +++ b/debian/control @@ -16,7 +16,7 @@ Build-Depends: isort, vulture, xsltproc, -Standards-Version: 4.5.1 +Standards-Version: 4.6.2 Homepage: https://grml.org/grml2usb/ Vcs-git: git://git.grml.org/grml2usb.git Vcs-Browser: https://git.grml.org/?p=grml2usb.git -- 2.1.4 From 00ce55f518f6abc61c2ede0320bffc90ff3eb09a Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Wed, 8 Feb 2023 08:28:02 +0100 Subject: [PATCH 07/10] Release new version 0.19.1 --- debian/changelog | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/debian/changelog b/debian/changelog index f712727..05f89ef 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +grml2usb (0.19.1) unstable; urgency=medium + + * [27eba4a] Replace egrep usage with grep -E + * [ec28a50] Bump Standards-Version to 4.6.2 + + -- Michael Prokop Wed, 08 Feb 2023 08:27:50 +0100 + grml2usb (0.19.0) unstable; urgency=medium [ Manuel Rom ] -- 2.1.4 From 2955aaf78a680a9c1a96ef5d3a4e03599b2dd670 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Mon, 20 Feb 2023 11:27:09 +0100 Subject: [PATCH 08/10] codecheck: reformat with black, version 23.1.0 Drop empty newline as expected by black >=23.1.0 See https://github.com/psf/black/blob/main/CHANGES.md Closes: #1031466 --- grml2usb | 1 - 1 file changed, 1 deletion(-) diff --git a/grml2usb b/grml2usb index 8f689a9..5ac6e76 100755 --- a/grml2usb +++ b/grml2usb @@ -1614,7 +1614,6 @@ def handle_syslinux_config(grml_flavour, target): new_grml_cfg = "%s/%s_grml.cfg" % (syslinux_target, flavour_filename) if os.path.isfile(defaults_file): - # remove default menu entry in menu remove_default_entry(new_default_with_path) -- 2.1.4 From 4bbd7a8a99e58c13ee09917fcb28caf720d85b86 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Mon, 20 Feb 2023 11:35:14 +0100 Subject: [PATCH 09/10] Release new version 0.19.2 --- debian/changelog | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/debian/changelog b/debian/changelog index 05f89ef..f818fc7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +grml2usb (0.19.2) unstable; urgency=medium + + * [2955aaf] codecheck: reformat with black, version 23.1.0 + (Closes: #1031466) + + -- Michael Prokop Mon, 20 Feb 2023 11:33:34 +0100 + grml2usb (0.19.1) unstable; urgency=medium * [27eba4a] Replace egrep usage with grep -E -- 2.1.4 From 5f40f1c76e15c5de09a8a42fc4700284781f5be5 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Wed, 13 Mar 2024 12:36:30 +0100 Subject: [PATCH 10/10] grml2usb docs: drop references to deprecated grml-medium grml-medium is gone since many years, so there's no point in further referring to it Thanks to Christoph Biedl for spotting --- grml2usb.8.txt | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/grml2usb.8.txt b/grml2usb.8.txt index 8e966ad..ec8a197 100644 --- a/grml2usb.8.txt +++ b/grml2usb.8.txt @@ -214,12 +214,6 @@ Directory layout on USB device | |-- grml64 | | |-- linux26 [Kernel] | | |-- initrd.gz [initramfs] - | |-- grml-medium - | | |-- linux26 [...] - | | |-- initrd.gz - | |-- grml64-medium - | | |-- linux26 - | | |-- initrd.gz | |-- grml-small | | |-- linux26 | | |-- initrd.gz @@ -256,11 +250,8 @@ Directory layout on USB device |-- grml/ | |-- filesystem.module [module specifying which squashfs should be used for grml] | `-- grml.squashfs [squashfs file for grml] - |-- grml-medium/ - | |-- filesystem.module [module specifying which squashfs should be used for grml-medium] - | `-- grml-medium.squashfs [squashfs file for grml-medium] |-- grml-small/ - | |-- filesystem.module [module specifying which squashfs should be used for grml-medium] + | |-- filesystem.module [module specifying which squashfs should be used for grml-small] | `-- grml-small.squashfs [squashfs file for grml-small] `-- ... -- 2.1.4