Make firmware upgrade configurable (#739)

This change adds an option, firmware.upgrade, that if set to `false`
only checks for and displays available firmware updates. If set to `true`
(default) the user is offered to run the firmware upgrade.
This commit is contained in:
Eberhard Beilharz
2021-06-30 11:15:18 +02:00
committed by GitHub
parent 5ec1f4d2d6
commit 74292ef6d2
3 changed files with 30 additions and 5 deletions

View File

@@ -521,13 +521,17 @@ pub fn run_fwupdmgr(ctx: &ExecutionContext) -> Result<()> {
.arg("refresh")
.check_run_with_codes(&[2])?;
let mut upgrade = ctx.run_type().execute(&fwupdmgr);
let mut updmgr = ctx.run_type().execute(&fwupdmgr);
upgrade.arg("update");
if ctx.config().yes() {
upgrade.arg("-y");
if ctx.config().firmware_upgrade() {
updmgr.arg("update");
if ctx.config().yes() {
updmgr.arg("-y");
}
} else {
updmgr.arg("get-updates");
}
upgrade.check_run_with_codes(&[2])
updmgr.check_run_with_codes(&[2])
}
pub fn flatpak_update(run_type: RunType) -> Result<()> {