summaryrefslogtreecommitdiffstats
path: root/rbutil/rbutilqt/base/bootloaderinstallsansa.cpp
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2009-11-22 22:13:25 +0000
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2009-11-22 22:13:25 +0000
commit38dde55c27a3f5171a1b7235c8729c4bc8502779 (patch)
tree2a5b32aea0a122ac0d3276b3d5638870296636cc /rbutil/rbutilqt/base/bootloaderinstallsansa.cpp
parent46e56582b02f833983c7c9244f3b597424089559 (diff)
downloadrockbox-38dde55c27a3f5171a1b7235c8729c4bc8502779.tar.gz
rockbox-38dde55c27a3f5171a1b7235c8729c4bc8502779.tar.bz2
rockbox-38dde55c27a3f5171a1b7235c8729c4bc8502779.zip
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
Diffstat (limited to 'rbutil/rbutilqt/base/bootloaderinstallsansa.cpp')
-rw-r--r--rbutil/rbutilqt/base/bootloaderinstallsansa.cpp26
1 files changed, 23 insertions, 3 deletions
diff --git a/rbutil/rbutilqt/base/bootloaderinstallsansa.cpp b/rbutil/rbutilqt/base/bootloaderinstallsansa.cpp
index e57a7f9c24..48bd0053ee 100644
--- a/rbutil/rbutilqt/base/bootloaderinstallsansa.cpp
+++ b/rbutil/rbutilqt/base/bootloaderinstallsansa.cpp
@@ -134,10 +134,14 @@ void BootloaderInstallSansa::installStage2(void)
if(sansa_add_bootloader(&sansa, blfile.toLatin1().data(),
FILETYPE_MI4) == 0) {
emit logItem(tr("Successfully installed bootloader"), LOGOK);
- logInstall(LogAdd);
- emit done(false);
sansa_close(&sansa);
- return;
+#if defined(Q_OS_MACX)
+ m_remountDevice = sansa.diskname;
+ connect(this, SIGNAL(remounted(bool)), this, SLOT(installStage3(bool)));
+ waitRemount();
+#else
+ installStage3(true);
+#endif
}
else {
emit logItem(tr("Failed to install bootloader"), LOGERROR);
@@ -149,6 +153,22 @@ void BootloaderInstallSansa::installStage2(void)
}
+void BootloaderInstallSansa::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() << "version installed:" << m_blversion.toString(Qt::ISODate);
+}
+
+
/** Uninstall the bootloader.
*/
bool BootloaderInstallSansa::uninstall(void)