From c09ca46a279eba2a4632e88509c7229d43cd3c49 Mon Sep 17 00:00:00 2001 From: Sylvain Pineau Date: Tue, 20 Oct 2020 14:27:12 +0200 Subject: submission:raw_devices_dmi_json: Add the boot mode info to the BIOS dict This new property comes from inxi which can take the following values: - BIOS - UEFI - UEFI [Legacy] The last one is legacy BIOS boot mode in a system using UEFI but booted as BIOS/Legacy. It is added to the existing json directly into the BIOS dict. Fixes: lp:1854862 --- units/submission/jobs.pxu | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'units/submission') diff --git a/units/submission/jobs.pxu b/units/submission/jobs.pxu index 892d4e6..a8c8c7f 100644 --- a/units/submission/jobs.pxu +++ b/units/submission/jobs.pxu @@ -22,8 +22,10 @@ requires: dmi_present.state == 'supported' user: root command: + BOOT_MODE=$(inxi_snapshot -M --output json --output-file print | grep -oP '(?<=\d#)(UEFI|BIOS)(\s+\[Legacy\])?') + # shellcheck disable=SC2016 dmidecode | python3 -m plainbox dev parse dmidecode | \ - jq '[.[] | ._attributes + {"category": .category}]' + jq --arg BOOT_MODE "$BOOT_MODE" '[.[] | ._attributes + {"category": .category} + (if .category == "BIOS" then {boot_mode: $BOOT_MODE} else {} end)]' estimated_duration: 1 _description: Attaches dmidecode output _summary: Attaches json dumps of raw dmi devices -- cgit v1.2.3