forked from len0rd/rockbox
rbutil: Fix ipodpatcher bootloader uninstall.
Fix mountpoint not passed and sectorbuf not initialized properly. Change-Id: Ifa9d9e159767b20a51841ee422be59feca95c757
This commit is contained in:
parent
5c7b0e071f
commit
ce70e34476
2 changed files with 11 additions and 5 deletions
|
@ -42,11 +42,7 @@ BootloaderInstallIpod::~BootloaderInstallIpod()
|
||||||
|
|
||||||
bool BootloaderInstallIpod::install(void)
|
bool BootloaderInstallIpod::install(void)
|
||||||
{
|
{
|
||||||
// initialize sector buffer. The sector buffer is part of the ipod_t
|
ipodInitialize(&ipod);
|
||||||
// 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) {
|
if(ipod.sectorbuf == nullptr) {
|
||||||
emit logItem(tr("Error: can't allocate buffer memory!"), LOGERROR);
|
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)
|
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()) {
|
if(!m_blfile.isEmpty()) {
|
||||||
QString devicename = Utils::resolveDevicename(m_blfile);
|
QString devicename = Utils::resolveDevicename(m_blfile);
|
||||||
if(devicename.isEmpty()) {
|
if(devicename.isEmpty()) {
|
||||||
|
|
|
@ -473,6 +473,11 @@ void RbUtilQt::uninstallBootloader(void)
|
||||||
blfilepath.append(RbSettings::value(RbSettings::Mountpoint).toString()
|
blfilepath.append(RbSettings::value(RbSettings::Mountpoint).toString()
|
||||||
+ blfile.at(a));
|
+ 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->setBlFile(blfilepath);
|
||||||
bl->setLogfile(RbSettings::value(RbSettings::Mountpoint).toString()
|
bl->setLogfile(RbSettings::value(RbSettings::Mountpoint).toString()
|
||||||
+ "/.rockbox/rbutil.log");
|
+ "/.rockbox/rbutil.log");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue