diff options
author | Sylvain Pineau <sylvain.pineau@canonical.com> | 2020-10-20 14:27:12 +0200 |
---|---|---|
committer | Sylvain Pineau <sylvain.pineau@canonical.com> | 2020-10-22 09:48:27 +0200 |
commit | c09ca46a279eba2a4632e88509c7229d43cd3c49 (patch) | |
tree | af6138d9b2a96da60c1781e5dbca63ab1e5cf0f4 /units | |
parent | 3aff1bc30d67185f1cecaaf1d2d17e0af2ed68ec (diff) |
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
Diffstat (limited to 'units')
-rw-r--r-- | units/submission/jobs.pxu | 4 |
1 files changed, 3 insertions, 1 deletions
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 |