## Copyright (C) 2012 - 2025 ENCRYPTED SUPPORT LLC <adrelanos@whonix.org>
## See the file COPYING for copying conditions.

## Cope up with "set -o nounset".
: "${GRUB_CMDLINE_LINUX_DEFAULT:=""}" || echo "$0: Setting default GRUB_CMDLINE_LINUX_DEFAULT failed! Please report this bug!" >&2
: "${GRUB_CMDLINE_LINUX:=""}" || echo "$0: Setting default GRUB_CMDLINE_LINUX failed! Please report this bug!" >&2

## Want to disable verbose output during boot?
## Feel free to out comment out the following lines.

GRUB_CMDLINE_LINUX_DEFAULT="$(echo "$GRUB_CMDLINE_LINUX_DEFAULT" | sed 's/quiet//g')" || echo "$0: Removing 'quiet' from GRUB_CMDLINE_LINUX_DEFAULT failed! Please report this bug!" >&2

GRUB_CMDLINE_LINUX_DEFAULT="$(echo "$GRUB_CMDLINE_LINUX_DEFAULT" | sed 's/loglevel=0//g')" || echo "$0: Removing 'loglevel=0' from GRUB_CMDLINE_LINUX_DEFAULT failed! Please report this bug!" >&2

GRUB_CMDLINE_LINUX_DEFAULT="$(echo "$GRUB_CMDLINE_LINUX_DEFAULT" | sed 's/rhgb//g')" || echo "$0: Removing 'rhgb' from GRUB_CMDLINE_LINUX_DEFAULT failed! Please report this bug!" >&2

GRUB_CMDLINE_LINUX="$(echo "$GRUB_CMDLINE_LINUX" | sed 's/debugfs=off//g')" || echo "$0: Removing 'debugfs=off' from GRUB_CMDLINE_LINUX failed! Please report this bug!" >&2

GRUB_CMDLINE_LINUX="$(echo "$GRUB_CMDLINE_LINUX" | sed 's/efi_pstore.pstore_disable=1//g')" || echo "$0: Removing 'efi_pstore.pstore_disable=1' from GRUB_CMDLINE_LINUX failed! Please report this bug!" >&2

GRUB_CMDLINE_LINUX="$(echo "$GRUB_CMDLINE_LINUX" | sed 's/erst_disable//g')" || echo "$0: Removing 'erst_disable' from GRUB_CMDLINE_LINUX failed! Please report this bug!" >&2

## dracut
GRUB_CMDLINE_LINUX="$GRUB_CMDLINE_LINUX rd.shell"
GRUB_CMDLINE_LINUX="$GRUB_CMDLINE_LINUX rd.debug"
GRUB_CMDLINE_LINUX="$GRUB_CMDLINE_LINUX log_buf_len=1M"

## https://freedesktop.org/wiki/Software/systemd/Debugging/#diagnosingshutdownproblems
GRUB_CMDLINE_LINUX="$GRUB_CMDLINE_LINUX systemd.log_level=debug systemd.log_target=kmsg printk.devkmsg=on enforcing=0"

## "Only one of vga, efi, serial, or usb debug port can be used at a time."
#GRUB_CMDLINE_LINUX="earlyprintk=vga"
#GRUB_CMDLINE_LINUX="earlyprintk=efi"
#GRUB_CMDLINE_LINUX="earlyprintk=ttyS0,115200"
