1
0
Fork 0
forked from len0rd/rockbox

rbutil: allow checking bootloader installer capabilities

Instead of checking for certain hardcoded strings, fetch
the actual capability bitmask by instantiating an installer
and querying it.

Change-Id: I7883d9c1e90da37ee7c0189732ac626685adbfa1
This commit is contained in:
Aidan MacDonald 2021-12-29 00:26:47 +00:00
parent 42999913ba
commit cbb57fe714
6 changed files with 44 additions and 22 deletions

View file

@ -28,10 +28,6 @@
BootloaderInstallIpod::BootloaderInstallIpod(QObject *parent)
: BootloaderInstallBase(parent)
{
(void)parent;
// initialize sector buffer. The sector buffer is part of the ipod_t
// structure, so a second instance of this class will have its own buffer.
ipod_alloc_buffer(&ipod, BUFFER_SIZE);
}
@ -45,11 +41,18 @@ BootloaderInstallIpod::~BootloaderInstallIpod()
bool BootloaderInstallIpod::install(void)
{
// initialize sector buffer. The sector buffer is part of the ipod_t
// structure, so a second instance of this class will have its own buffer.
if(ipod.sectorbuf == nullptr) {
ipod_alloc_buffer(&ipod, BUFFER_SIZE);
}
if(ipod.sectorbuf == nullptr) {
emit logItem(tr("Error: can't allocate buffer memory!"), LOGERROR);
emit done(true);
return false;
}
// save buffer pointer before cleaning up ipod_t structure
unsigned char* sb = ipod.sectorbuf;
memset(&ipod, 0, sizeof(struct ipod_t));