fastboot: Stop if setting NVME value fails

Change-Id: I34d4dbece53411c5cceaecc724cc04f1b64577cb
Signed-off-by: Woomymy <woomy@woomy.be>
This commit is contained in:
Woomymy 2023-11-04 15:57:16 +01:00 committed by Andrey Smirnoff
parent 7fecc60958
commit b3ca559853

View file

@ -24,8 +24,11 @@ class Fastboot:
def write_nvme(self, prop: str, data: bytes): def write_nvme(self, prop: str, data: bytes):
cmd = f"getvar:nve:{prop}@".encode('UTF-8') cmd = f"getvar:nve:{prop}@".encode('UTF-8')
cmd += data cmd += data
ui.debug(f"Sending command: {cmd}")
ui.info(f"Writing {prop}")
result = self.fb_dev.send(cmd) result = self.fb_dev.send(cmd)
ui.info(f"Getvar result: {result}") if not "set nv ok" in result:
ui.error(f"Failed to write {prop}: {result}", critical=True)
def reboot(self): def reboot(self):
result = self.fb_dev.reboot() result = self.fb_dev.reboot()