V8.00.000.2025.06.17
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 1m36s
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 1m36s
Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
This commit is contained in:
58
func/1081_helper_grub.sh
Normal file
58
func/1081_helper_grub.sh
Normal file
@@ -0,0 +1,58 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-06-17; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-ExternalRef: GIT https://git.coresecret.dev/msw/CISS.debian.installer.git
|
||||
# SPDX-FileContributor: WEIDNER, Marc S.; Centurion Intelligence Consulting Agency
|
||||
# SPDX-FileCopyrightText: 2024-2025; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-FileType: SOURCE
|
||||
# SPDX-License-Identifier: EUPL-1.2 OR LicenseRef-CCLA-1.0
|
||||
# SPDX-LicenseComment: This file is part of the CISS.debian.installer.secure framework.
|
||||
# SPDX-PackageName: CISS.debian.installer
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
|
||||
### Options in "VAR_GRUB_CMDLINE_LINUX" are always effective.
|
||||
### Options in "VAR_GRUB_CMDLINE_LINUX_DEFAULT" are effective ONLY during normal boot (NOT during recovery mode).
|
||||
|
||||
guard_sourcing
|
||||
|
||||
#######################################
|
||||
# Helper module to extract the current GRUB CMDLINE strings.
|
||||
# Globals:
|
||||
# TARGET
|
||||
# VAR_GRUB_CMDLINE_LINUX
|
||||
# VAR_GRUB_CMDLINE_LINUX_DEFAULT
|
||||
# VAR_ORIG_GRUB_CMDLINE_LINUX
|
||||
# VAR_ORIG_GRUB_CMDLINE_LINUX_DEFAULT
|
||||
# Arguments:
|
||||
# None
|
||||
#######################################
|
||||
2040_grub_extract_current_string() {
|
||||
# shellcheck disable=SC2155
|
||||
declare -gx VAR_ORIG_GRUB_CMDLINE_LINUX=$(grep -E 'VAR_GRUB_CMDLINE_LINUX=' "${TARGET}/etc/default/grub")
|
||||
# shellcheck disable=SC2155
|
||||
declare -gx VAR_ORIG_GRUB_CMDLINE_LINUX_DEFAULT=$(grep -E 'VAR_GRUB_CMDLINE_LINUX_DEFAULT=' "${TARGET}/etc/default/grub")
|
||||
# shellcheck disable=SC2155
|
||||
declare -gx VAR_GRUB_CMDLINE_LINUX=$(grep -E 'VAR_GRUB_CMDLINE_LINUX=' "${TARGET}/etc/default/grub" | sed 's/.$//')
|
||||
# shellcheck disable=SC2155
|
||||
declare -gx VAR_GRUB_CMDLINE_LINUX_DEFAULT=$(grep -E 'VAR_GRUB_CMDLINE_LINUX_DEFAULT=' "${TARGET}/etc/default/grub" | sed 's/.$//')
|
||||
}
|
||||
|
||||
#######################################
|
||||
# Helper module to finish the modified GRUB CMDLINE strings.
|
||||
# Globals:
|
||||
# TARGET
|
||||
# VAR_GRUB_CMDLINE_LINUX
|
||||
# VAR_GRUB_CMDLINE_LINUX_DEFAULT
|
||||
# VAR_H
|
||||
# VAR_ORIG_GRUB_CMDLINE_LINUX
|
||||
# VAR_ORIG_GRUB_CMDLINE_LINUX_DEFAULT
|
||||
# Arguments:
|
||||
# None
|
||||
#######################################
|
||||
2040_grub_finalize_string() {
|
||||
VAR_GRUB_CMDLINE_LINUX="${VAR_GRUB_CMDLINE_LINUX}${VAR_H}"
|
||||
VAR_GRUB_CMDLINE_LINUX_DEFAULT="${VAR_GRUB_CMDLINE_LINUX_DEFAULT}${VAR_H}"
|
||||
sed -i "s/$VAR_ORIG_GRUB_CMDLINE_LINUX/$VAR_GRUB_CMDLINE_LINUX/" "${TARGET}/etc/default/grub"
|
||||
sed -i "s/$VAR_ORIG_GRUB_CMDLINE_LINUX_DEFAULT/$VAR_GRUB_CMDLINE_LINUX_DEFAULT/" "${TARGET}/etc/default/grub"
|
||||
}
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
Reference in New Issue
Block a user