rbutil: Fix ipodpatcher bootloader uninstall.

Fix mountpoint not passed and sectorbuf not initialized properly.

Change-Id: Ifa9d9e159767b20a51841ee422be59feca95c757
This commit is contained in:
Dominik Riebeling 2022-03-12 21:45:07 +01:00
parent 5c7b0e071f
commit ce70e34476
2 changed files with 11 additions and 5 deletions

View file

@ -42,11 +42,7 @@ 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);
}
ipodInitialize(&ipod);
if(ipod.sectorbuf == nullptr) {
emit logItem(tr("Error: can't allocate buffer memory!"), LOGERROR);
@ -227,6 +223,11 @@ BootloaderInstallBase::Capabilities BootloaderInstallIpod::capabilities(void)
*/
bool BootloaderInstallIpod::ipodInitialize(struct ipod_t *ipod)
{
// 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(!m_blfile.isEmpty()) {
QString devicename = Utils::resolveDevicename(m_blfile);
if(devicename.isEmpty()) {

View file

@ -473,6 +473,11 @@ void RbUtilQt::uninstallBootloader(void)
blfilepath.append(RbSettings::value(RbSettings::Mountpoint).toString()
+ blfile.at(a));
}
// on devices without a bootloader file we use the mointpoint. The
// installer will use that to determine the correct device.
if(blfile.isEmpty()) {
blfilepath.append(RbSettings::value(RbSettings::Mountpoint).toString());
}
bl->setBlFile(blfilepath);
bl->setLogfile(RbSettings::value(RbSettings::Mountpoint).toString()
+ "/.rockbox/rbutil.log");