Fix detection of disabled console

This commit is contained in:
Lutz Schwarz 2020-09-03 18:07:17 +02:00
parent 9db4e9b68b
commit 53ec477188
1 changed files with 2 additions and 2 deletions

View File

@ -189,7 +189,7 @@ function boot_enable_console () {
local fsroot="$1" local fsroot="$1"
local bootstart="$(echo "$parted_output" | grep '^1:' | cut -d ':' -f 2 | tr -d 'B')" local bootstart="$(echo "$parted_output" | grep '^1:' | cut -d ':' -f 2 | tr -d 'B')"
local boot bootloop bootroot local boot bootloop bootroot
local SEDCMDS='s/console=null/console=tty0/' local SEDCMDS='s/console=\(none\|null\)/console=tty0/'
if [ -z "$fsroot" -o "x$bootstart" != "x$partstart" ] if [ -z "$fsroot" -o "x$bootstart" != "x$partstart" ]
then then
@ -204,7 +204,7 @@ function boot_enable_console () {
logVariables $LINENO fsroot bootstart bootloop bootroot boot logVariables $LINENO fsroot bootstart bootloop bootroot boot
if grep -q console=null "$boot/cmdline.txt" ; then if grep -q 'console=\(none\|null\)' "$boot/cmdline.txt" ; then
info "/boot/cmdline.txt changed to temporarily enable console for autoexpand" info "/boot/cmdline.txt changed to temporarily enable console for autoexpand"
cp -p "$boot/cmdline.txt" "$boot/cmdline.txt.pishrink-bak" cp -p "$boot/cmdline.txt" "$boot/cmdline.txt.pishrink-bak"
sed -i "$boot/cmdline.txt" -e "$SEDCMDS" sed -i "$boot/cmdline.txt" -e "$SEDCMDS"