FS#10100: Wait for the system to remount the player after bootloader installation.

OS X requires to unmount the player during bootloader installation on Sansas / Ipods. The system remounts the player automatically after a short while.
Not waiting for the system to remount the player will result in a changed mount point, making the small / full install write the main build to the wrong
 location.
This currently waits up to 60 seconds for the player to get remounted until it errors out. This value seems to be sufficient, if it's not please report
so we can adjust it. Also, the waiting can't be interrupted right now.



git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23716 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Dominik Riebeling 2009-11-22 22:13:25 +00:00
parent 46e56582b0
commit 38dde55c27
7 changed files with 116 additions and 7 deletions

View file

@ -129,10 +129,14 @@ void BootloaderInstallIpod::installStage2(void)
m_tempfile.close();
if(add_bootloader(&ipod, blfile.toLatin1().data(), FILETYPE_DOT_IPOD) == 0) {
emit logItem(tr("Successfull added bootloader"), LOGOK);
logInstall(LogAdd);
emit done(false);
ipod_close(&ipod);
return;
#if defined(Q_OS_MACX)
m_remountDevice = ipod.diskname;
connect(this, SIGNAL(remounted(bool)), this, SLOT(installStage3(bool)));
waitRemount();
#else
installStage3(true);
#endif
}
else {
emit logItem(tr("Failed to add bootloader"), LOGERROR);
@ -140,6 +144,21 @@ void BootloaderInstallIpod::installStage2(void)
emit done(true);
return;
}
}
void BootloaderInstallIpod::installStage3(bool mounted)
{
if(mounted) {
logInstall(LogAdd);
emit logItem(tr("Bootloader Installation complete."), LOGINFO);
emit done(false);
return;
}
else {
emit logItem(tr("Writing log aborted"), LOGERROR);
emit done(true);
}
qDebug() << "[BootloaderInstallIpod] version installed:" << m_blversion.toString(Qt::ISODate);
}
@ -248,6 +267,8 @@ bool BootloaderInstallIpod::ipodInitialize(struct ipod_t *ipod)
}
else {
ipod_scan(ipod);
qDebug() << "[BootloaderInstallIpod] ipodpatcher: scanning, found device"
<< ipod->diskname;
}
if(ipod_open(ipod, 0) < 0) {
emit logItem(tr("Could not open Ipod"), LOGERROR);