From 988a63311fe3f1c7516395a53656dde1d2cc122e Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Tue, 7 Jun 2022 15:59:41 +0200 Subject: [PATCH 01/11] Release new version 2.11.1 --- debian/changelog | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/debian/changelog b/debian/changelog index 00e3d13..8018981 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +grml-scripts (2.11.1) unstable; urgency=medium + + * [40ec66c] Drop debian/compat and switch to debhelper-compat approach + * [3b7f948] grml_chroot: fix broken mount argument handling + + -- Michael Prokop Tue, 07 Jun 2022 15:59:26 +0200 + grml-scripts (2.11.0) unstable; urgency=medium [ Darshaka Pathirana ] -- 2.1.4 From 454a3e508881316131b82651fd11a3aaf4648c52 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Wed, 7 Sep 2022 13:56:57 +0200 Subject: [PATCH 02/11] iimage: 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 --- usr_bin/iimage | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr_bin/iimage b/usr_bin/iimage index 9b210d0..b2f81f7 100755 --- a/usr_bin/iimage +++ b/usr_bin/iimage @@ -1004,7 +1004,7 @@ function update_description_names() { find_all_images for i in $ALL_IMAGES ; do - if ! egrep "$i=" ./description >/dev/null ; then + if ! grep -E "$i=" ./description >/dev/null ; then echo "$i=`description $i`" >> ./description fi -- 2.1.4 From c1231da0db59f3cb545d9ef8e446a287b7618a3c Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Fri, 11 Nov 2022 17:01:51 +0100 Subject: [PATCH 03/11] Release new version 2.11.2 --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index 8018981..3938a61 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +grml-scripts (2.11.2) unstable; urgency=medium + + * [454a3e5] iimage: replace egrep usage with grep -E + + -- Michael Prokop Fri, 11 Nov 2022 17:01:40 +0100 + grml-scripts (2.11.1) unstable; urgency=medium * [40ec66c] Drop debian/compat and switch to debhelper-compat approach -- 2.1.4 From 570d9599584feb8ff7ccc8a9abe346c356f62c45 Mon Sep 17 00:00:00 2001 From: Darshaka Pathirana Date: Sat, 12 Nov 2022 17:18:35 +0100 Subject: [PATCH 04/11] Set SHELL variable in run-welcome + run-screen By default login(1) is called by agetty(8) and sets the SHELL variable "according to the appropriate fields in the password entry". Our tty1 calls run-welcome, tty2 - tty4 call run-screen and tty5 - tty7 call agetty (with autologin grml). So, our tty1 - tty4 bypass agetty(8) + login(1) and (should) end in a the zsh shell (via the welcome-screen or GNU/screen) without the SHELL variable set. run-welcome is designed to be started (only) on tty(1) and starts zsh anyway. But as we bypass login(1) the SHELL variable is not set. The same is true for run-screen, but instead of starting the zsh as login-shell, `screen` is called and runs the shell defined by the SHELL variable or /bin/sh if not defined. So, we ended up using the systemd "Environment"-option to set the SHELL variable (grml/grml-live@6871972 + grml/grml-live@7422d31). Although this is a working solution, setting the SHELL variable in run-welcome + run-screen makes it more transparent, that the script is actually responsible to set the SHELL variable. While debugging this problem, also noticed that screen should start the shell as login-shell (like all other ttys). To do so the given shell command needs to be prefixed with the '-' character. grml/grml-live@6871972 + grml/grml-live@7422d31 can/should be reverted after this change has been applied. Issues: grml/grml#135 + grml/grml#14 --- usr_share/run-screen | 7 ++++--- usr_share/run-welcome | 4 +++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/usr_share/run-screen b/usr_share/run-screen index 4832feb..d04543f 100755 --- a/usr_share/run-screen +++ b/usr_share/run-screen @@ -6,6 +6,7 @@ # License: This file is licensed under the GPL v2. ################################################################################ +export SHELL=/bin/zsh # try to mitigate raceconditions from screen SCREENDIR_="/var/run/screen" mkdir -m 700 "${SCREENDIR_}/S-$USER" >/dev/null 2>&1 @@ -13,11 +14,11 @@ mkdir -m 700 "${SCREENDIR_}/S-$USER" >/dev/null 2>&1 # now run screen with config if [ "$(id -u)" = 0 ] ; then - exec screen -U -c /etc/grml/screenrc + exec screen -U -c /etc/grml/screenrc -s "-$SHELL" elif [ -r "$HOME/.screenrc" ] ; then - exec screen -U -c "$HOME/.screenrc" + exec screen -U -c "$HOME/.screenrc" -s "-$SHELL" else - exec screen -U -c /etc/grml/screenrc_generic + exec screen -U -c /etc/grml/screenrc_generic -s "-$SHELL" fi ## END OF FILE ################################################################# diff --git a/usr_share/run-welcome b/usr_share/run-welcome index 265301e..d8d694a 100755 --- a/usr_share/run-welcome +++ b/usr_share/run-welcome @@ -9,6 +9,8 @@ # shellcheck disable=SC1091 . /etc/grml/sh-lib +export SHELL=/bin/zsh + [ -r /etc/grml_version ] && GRMLVERSION=$(cat /etc/grml_version) || GRMLVERSION='(no version information available)' PATH=$HOME/bin:/bin:/sbin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/usr/games:/home/grml/bin CMDLINE=$(cat /proc/cmdline) @@ -82,6 +84,6 @@ Happy hacking! http://grml.org/ " fi -exec /bin/zsh -l +exec "$SHELL" -l ## END OF FILE ################################################################# -- 2.1.4 From 168953e791d6fe6dd0203fe1fda085fba33a033d Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Fri, 25 Nov 2022 09:51:01 +0100 Subject: [PATCH 05/11] Release new version 2.12.0 --- debian/changelog | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/debian/changelog b/debian/changelog index 3938a61..e369b61 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +grml-scripts (2.12.0) unstable; urgency=medium + + [ Darshaka Pathirana ] + * [570d959] Set SHELL variable in run-welcome + run-screen + + -- Michael Prokop Fri, 25 Nov 2022 09:50:44 +0100 + grml-scripts (2.11.2) unstable; urgency=medium * [454a3e5] iimage: replace egrep usage with grep -E -- 2.1.4 From b3825665c6b20c495e6964bc1fa1a23aa0b30ed9 Mon Sep 17 00:00:00 2001 From: Darshaka Pathirana Date: Sun, 27 Nov 2022 13:29:51 +0100 Subject: [PATCH 06/11] grml-resolution: Quick 'n dirty xrandr output parser fix The xrandr output parser of grml-resolution seems to be broken since at least Grml 2014.11: grml-resolution does not list possible resolutions but its corresponding refresh rates. It seems like once upon a time xrandr had a 'size-index' in front of each resolution. This is not the case anymore and there does not seem to be an option to add that behaviour back to xrandr. So, CURRENT_NUM did not receive the 'size-index' of the current resolution, therefor I dropped that variable which was used to detect if the user had chosen the current resolution (nothing bad happens if xrandr sets the current resolution). We now list the possible resolutions and refresh rates, separated by an underscore because `dialog` does not like spaces. xrandr -s works fine with the chosen 'index' from dialog. Closes: grml/grml-scripts#14 --- usr_bin/grml-resolution | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/usr_bin/grml-resolution b/usr_bin/grml-resolution index 5b334d7..08d075a 100755 --- a/usr_bin/grml-resolution +++ b/usr_bin/grml-resolution @@ -23,11 +23,10 @@ COUNTER=0 STRING="" # current mode -CURRENT_NUM=$(xrandr | awk '/\*/ {print $1}' | tr -d '*') -CURRENT_RESOLUTION=$(xrandr | awk '/\*/ {print $2 $3 $4}') +CURRENT_RESOLUTION=$(xrandr | awk '/\*/ {print $1"_"$2}') # menu -for i in $(xrandr | awk '{print $2$3$4}' | grep "^[0-9]") ; do +for i in $(xrandr | awk '{print $1"_"$2}' | grep "^[0-9]") ; do STRING="$STRING $COUNTER $i" ((COUNTER++)) done @@ -43,9 +42,7 @@ esac CHOSE=$(cat "$RESOLUTION") -if [ "$CHOSE" = "$CURRENT_NUM" ] ; then - dialog --title "$PN" --msgbox "Chosen resolution corresponds to current resolution. No changes needed." 0 0 -elif [ -n "$CHOSE" ] ; then +if [ -n "$CHOSE" ] ; then # shellcheck disable=SC2015 xrandr -s "$CHOSE" 2>"$ERROR" && \ dialog --title "$PN" --msgbox "Running xrandr with resolution was succesful." 0 0 || \ -- 2.1.4 From 0ac4551b01b478003597737ae214a763144a3b98 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Mon, 28 Nov 2022 08:35:28 +0100 Subject: [PATCH 07/11] Release new version 2.12.1 --- debian/changelog | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/debian/changelog b/debian/changelog index e369b61..c43e09c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +grml-scripts (2.12.1) unstable; urgency=medium + + [ Darshaka Pathirana ] + * [b382566] grml-resolution: Quick 'n dirty xrandr output parser fix + + -- Michael Prokop Mon, 28 Nov 2022 08:35:17 +0100 + grml-scripts (2.12.0) unstable; urgency=medium [ Darshaka Pathirana ] -- 2.1.4 From 099f921c3368735a4162d07d6c4d8e324b524b72 Mon Sep 17 00:00:00 2001 From: Michael Schierl Date: Sat, 14 Jan 2023 21:56:38 +0100 Subject: [PATCH 08/11] Fix `grml2ram` when booted via `loopback.cfg` When booted from a multiboot USB stick via loopback.cfg (or when using `findiso=` kernel option manually), `/dev/loop0` is used for the ISO file and `/dev/loop1` for the squashfs image. Therefore, changing backing file descriptor of `/dev/loop0` will fail. Call `losetup` to find the name of the loop device associaed to the squashfs image instead. --- usr_sbin/grml2ram | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usr_sbin/grml2ram b/usr_sbin/grml2ram index a4e119e..0806383 100755 --- a/usr_sbin/grml2ram +++ b/usr_sbin/grml2ram @@ -65,6 +65,7 @@ fi GRMLSIZE="$(du $IMAGE | awk '{print $1}')" RAM=$(/usr/bin/gawk '/MemFree/{print $2}' /proc/meminfo) +LOOPDEV=$(/sbin/losetup -j "${IMAGE}" -n -O NAME) case "$*" in -f|--force) ewarn "Forcing copy process for grml-image (${GRMLSIZE}kB) as requested via force option." ; eend 0 @@ -80,7 +81,7 @@ esac einfo "Copying $IMAGE to RAM, this might take a while." rsync -a --progress $IMAGE /tmp/GRML LANGUAGE=C LANG=C LC_ALL=C perl << EOF -open LOOP, ' Date: Fri, 3 Feb 2023 17:26:33 +0100 Subject: [PATCH 09/11] Release new version 2.12.2 --- debian/changelog | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/debian/changelog b/debian/changelog index c43e09c..1eda2a6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +grml-scripts (2.12.2) unstable; urgency=medium + + [ Michael Schierl ] + * [099f921] Fix `grml2ram` when booted via `loopback.cfg` + + -- Michael Prokop Fri, 03 Feb 2023 17:26:26 +0100 + grml-scripts (2.12.1) unstable; urgency=medium [ Darshaka Pathirana ] -- 2.1.4 From 0c1cd5d0cbee79178dba78483b4d082b9e60a263 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Fri, 1 Sep 2023 13:20:55 +0200 Subject: [PATCH 10/11] Drop broken and deprecated vmware-detect MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit It was reported that this tool no longer works as expected, though virt-what and systemd-detect-virt exist nowadays. Thanks: András Korn --- compile/.gitignore | 1 - compile/Makefile | 5 +- compile/vmware-detect.c | 143 ------------------------------------------------ debian/overrides | 1 - debian/rules | 3 +- 5 files changed, 2 insertions(+), 151 deletions(-) delete mode 100644 compile/vmware-detect.c diff --git a/compile/.gitignore b/compile/.gitignore index 5f8d282..c6f80a9 100644 --- a/compile/.gitignore +++ b/compile/.gitignore @@ -1,4 +1,3 @@ align dpkg_not_running -vmware-detect grml-runtty diff --git a/compile/Makefile b/compile/Makefile index a5d42c3..964ae3c 100644 --- a/compile/Makefile +++ b/compile/Makefile @@ -1,4 +1,4 @@ -PROGS = vmware-detect dpkg_not_running grml-runtty +PROGS = dpkg_not_running grml-runtty #ifndef CFLAGS CFLAGS = -O2 -Wall -s @@ -14,9 +14,6 @@ CC = gcc all: $(PROGS) -vmware-detect: vmware-detect.c - diet $(CC) $(CFLAGS) -o $@ $^ - dpkg_not_running: dpkg_not_running.c diet $(CC) $(CFLAGS) -o $@ $^ diff --git a/compile/vmware-detect.c b/compile/vmware-detect.c deleted file mode 100644 index c99e36f..0000000 --- a/compile/vmware-detect.c +++ /dev/null @@ -1,143 +0,0 @@ -/* Filename: vmware-detect.c -* Purpose: Detect if running inside vmware -* Authors: grml-team (grml.org), (c) Michael Gebetsroither -* Bug-Reports: see http://grml.org/bugs/ -* License: This file is licensed under the GPL v2. -*******************************************************************************/ -// return 0 if running inside vmware, 1 otherwise - -#include "string.h" -#include "unistd.h" -#include "stdio.h" -#include "stdlib.h" -#include "signal.h" - -#define WRITE(x) write(1, x, strlen(x)) -#define DWRITE(x) do{ \ - if(debug) { \ - WRITE(x); \ - } \ -} while(0); -#define FALSE 0 -#define TRUE !FALSE - -/* doc: - * vmware IO backdoor: http://chitchat.at.infoseek.co.jp/vmware/backdoor.html - * http://www.honeynet.org/papers/bots/botnet-code.html - * http://www.codegurus.be/codegurus/Programming/virtualpc&vmware_en.htm - */ - -// from libowfat {{{ -static inline char tohex(char c) { - return c>=10?c-10+'a':c+'0'; -} - -unsigned int fmt_xlong(char *dest,unsigned long i) { - register unsigned long len,tmp; - /* first count the number of bytes needed */ - for (len=1, tmp=i; tmp>15; ++len) tmp>>=4; - if (dest) - for (tmp=i, dest+=len; ; ) { - *--dest = tohex(tmp&15); - if (!(tmp>>=4)) break; - } - return len; -} -// }}} - -void printIdtr(const unsigned char* idtr, unsigned size) -{ - unsigned i; - for(i=0; i Date: Wed, 6 Sep 2023 17:26:11 +0200 Subject: [PATCH 11/11] Release new version 2.13.0 --- debian/changelog | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/debian/changelog b/debian/changelog index 1eda2a6..7f7a132 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +grml-scripts (2.13.0) unstable; urgency=medium + + * [0c1cd5d] Drop broken and deprecated vmware-detect. + Thanks to András Korn + + -- Michael Prokop Wed, 06 Sep 2023 17:24:49 +0200 + grml-scripts (2.12.2) unstable; urgency=medium [ Michael Schierl ] -- 2.1.4