minor cleanups, improve error handling

gracefully handle UFS_BSG not being enabled in the kernel, rather than
putting the device into a semi-bricked state (oops).
This commit is contained in:
Caleb Connolly
2022-06-10 19:18:13 +01:00
parent 487a96f663
commit 50ef0328af
5 changed files with 29 additions and 49 deletions

View File

@@ -33,6 +33,7 @@
#include "utils.h"
#include "gpt-utils.h"
#include "ufs-bsg.h"
#include "bootctrl.h"
@@ -607,6 +608,10 @@ int set_active_boot_slot(unsigned slot)
goto error;
}
if (ufs_bsg_dev_open() < 0) {
goto error;
}
//The partition list just contains prefixes(without the _a/_b) of the
//partitions that support A/B. In order to get the layout we need the
//actual names. To do this we append the slot suffix to every member