Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Silence efi helpers #3419

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,23 @@
EFI_GLOBAL_VARIABLE_GUID="8be4df61-93ca-11d2-aa0d-00e098032b8c"

parse_efivar_val() {
od --address-radix=n --format=u1 "$1" \
od --address-radix=n --format=u1 "$1" 2>/dev/null \
| tr -s "' '" \
| cut -d ' ' -f6
}

# return zero if secure boot is enabled
secureboot_enabled() {
test "$(parse_efivar_val \
/sys/firmware/efi/efivars/SecureBoot-${EFI_GLOBAL_VARIABLE_GUID})" -eq 1
/sys/firmware/efi/efivars/SecureBoot-${EFI_GLOBAL_VARIABLE_GUID})" -eq 1 \
2>/dev/null
}

# return zero if system is in setup mode
setup_mode_enabled() {
test "$(parse_efivar_val \
/sys/firmware/efi/efivars/SetupMode-${EFI_GLOBAL_VARIABLE_GUID})" -eq 1
/sys/firmware/efi/efivars/SetupMode-${EFI_GLOBAL_VARIABLE_GUID})" -eq 1 \
2>/dev/null
}

# return zero if system is in user mode
Expand Down
Loading