diff options
author | Munkyu Im <munkyu.im@samsung.com> | 2017-05-31 14:21:41 +0900 |
---|---|---|
committer | Munkyu Im <munkyu.im@samsung.com> | 2017-05-31 14:21:47 +0900 |
commit | 59727123f9466900db45cd69505930ff2ae4445d (patch) | |
tree | 461574a6c8f76f5c2859a554e675e9fe7dabc837 | |
parent | 5c4b8ae1e072b9b07f2399f1d485e1983979769c (diff) | |
parent | 6ca9395b240883513b16a1875a7080b081612c57 (diff) | |
download | qemu-tizen_studio_1.2_p3.0.tar.gz qemu-tizen_studio_1.2_p3.0.tar.bz2 qemu-tizen_studio_1.2_p3.0.zip |
Merge branch 'develop' into tizen_studio_1.2_p3.0tizen_studio_1.2_p3.0
Change-Id: I632b27a95ce4b72913930faa2f5d52bfbe7f9c63
Signed-off-by: Munkyu Im <munkyu.im@samsung.com>
-rw-r--r-- | package/changelog | 3 | ||||
-rw-r--r-- | package/pkginfo.manifest | 2 | ||||
-rw-r--r-- | tizen/src/ui/menu/sdbhelper.cpp | 24 | ||||
-rw-r--r-- | tizen/src/ui/menu/sdbhelper.h | 5 | ||||
-rw-r--r-- | tizen/src/ui/menu/sdbhelperthread.cpp | 7 | ||||
-rw-r--r-- | tizen/src/ui/menu/sdbhelperthread.h | 1 | ||||
-rw-r--r-- | tizen/src/ui/resource/ui_strings.h | 3 |
7 files changed, 38 insertions, 7 deletions
diff --git a/package/changelog b/package/changelog index 0f32f8a439..6d8c0bf44d 100644 --- a/package/changelog +++ b/package/changelog @@ -1,3 +1,6 @@ +* 2.8.0.6 +- add checking mount system for rpm file +== Munkyu Im <munkyu.im@samsung.com> 2017-05-31 * 2.8.0.5 - modify configure for recent OS == minkee Lee <minkee.lee@samsung.com> 2017-05-15 diff --git a/package/pkginfo.manifest b/package/pkginfo.manifest index 34f46b2555..ef61225ef7 100644 --- a/package/pkginfo.manifest +++ b/package/pkginfo.manifest @@ -1,4 +1,4 @@ -Version: 2.8.0.5 +Version: 2.8.0.6 Maintainer: SeokYeon Hwang <syeon.hwang@samsung.com> Source: emulator diff --git a/tizen/src/ui/menu/sdbhelper.cpp b/tizen/src/ui/menu/sdbhelper.cpp index c1da058892..31d158f16d 100644 --- a/tizen/src/ui/menu/sdbhelper.cpp +++ b/tizen/src/ui/menu/sdbhelper.cpp @@ -123,12 +123,13 @@ void SdbHelper::push(QList<QString> srcList, const QString &dest) SdbHelperThread *thread = new SdbHelperThread(this); thread->setArguments(SDB_PUSH_COMMNAD , program, argList); connect(thread, SIGNAL(started()), this, SLOT(handleThreadStarted())); + connect(thread, SIGNAL(error(QString)), this, SLOT(handleError(QString))); connect(thread, SIGNAL(finished()), this, SLOT(handleThreadFinished())); connect(thread, SIGNAL(finished()), thread, SLOT(deleteLater())); thread->start(); } -void SdbHelper::install(QFileInfo fi) +void SdbHelper::install(QFileInfo &fi) { if (QString::compare(fi.suffix(), FILE_EXTENSION_RPM, Qt::CaseInsensitive) == 0) { installRpm(fi); @@ -152,7 +153,7 @@ void SdbHelper::install(QFileInfo fi) thread->start(); } -void SdbHelper::installRpm(QFileInfo fi) +void SdbHelper::installRpm(QFileInfo &fi) { QString program; QStringList argRootOn; @@ -160,6 +161,7 @@ void SdbHelper::installRpm(QFileInfo fi) QStringList argInstall; QStringList argRemove; QStringList argRootOff; + QStringList argCheckMount; QList<QStringList> argList; QString baseName = fi.fileName(); QString destFileName = QString(GUEST_TMP_PATH + baseName); @@ -172,6 +174,14 @@ void SdbHelper::installRpm(QFileInfo fi) return; } + QProcess process; + + argCheckMount << "-s" << sdbSerialName << "shell" << "mount"; + argCheckMount << "|" << "grep" << "on / type"; + argCheckMount << "|" << "/usr/bin/cut" << "-d" << "\"(\"" << "-f2"; + argCheckMount << "|" << "/usr/bin/cut" << "-d" << "\")\"" << "-f1"; + argList << argCheckMount; + //FIXME: (sdb) cannot check sdb root status argRootOn << "-s" << sdbSerialName << "root" << "on"; argList << argRootOn; @@ -191,12 +201,20 @@ void SdbHelper::installRpm(QFileInfo fi) qDebug() << program << argList; SdbHelperThread *thread = new SdbHelperThread(this); - thread->setArguments(SDB_INSTALL_COMMAND, program, argList); + thread->setArguments(SDB_INSTALL_RPM_COMMAND, program, argList); connect(thread, SIGNAL(started()), this, SLOT(handleThreadStarted())); + connect(thread, SIGNAL(error(QString)), this, SLOT(handleError(QString))); connect(thread, SIGNAL(finished()), this, SLOT(handleThreadFinished())); connect(thread, SIGNAL(finished()), thread, SLOT(deleteLater())); thread->start(); + return; } +void SdbHelper::handleError(QString message) +{ + QMessageBox::warning(mainWindow, EMULATOR_TITLE, message, + QMessageBox::Ok | QMessageBox::Default); +} + void SdbHelper::handleThreadStarted() { diff --git a/tizen/src/ui/menu/sdbhelper.h b/tizen/src/ui/menu/sdbhelper.h index cb16241818..67c2eebcaf 100644 --- a/tizen/src/ui/menu/sdbhelper.h +++ b/tizen/src/ui/menu/sdbhelper.h @@ -44,7 +44,7 @@ public: QString getSdbPath(); QString getGuestDefaultPushPath(); QString getSerialName(); - void install(QFileInfo fi); + void install(QFileInfo &fi); void push(QList<QString> src, const QString &dest); void openShell(QString title); bool isProgressing(); @@ -67,12 +67,13 @@ private: QProcess *process; DisplayBase *displaybase; void setProgressing(bool isProgressing); - void installRpm(QFileInfo fi); + void installRpm(QFileInfo &fi); public slots: void handleThreadStarted(); void handleThreadFinished(); void handleGeometryChanged(QRect rect); + void handleError(QString message); }; #endif // SDBHELPER_H diff --git a/tizen/src/ui/menu/sdbhelperthread.cpp b/tizen/src/ui/menu/sdbhelperthread.cpp index dec4171205..2de9cc8e34 100644 --- a/tizen/src/ui/menu/sdbhelperthread.cpp +++ b/tizen/src/ui/menu/sdbhelperthread.cpp @@ -66,9 +66,14 @@ void SdbHelperThread::run() errorMsg = QString::fromLocal8Bit(process->readAllStandardError()); qDebug() << "errorMsg" << errorMsg; qDebug() << "outMsg" << outMsg; + if (command == SDB_INSTALL_RPM_COMMAND && i == 0 && outMsg.startsWith("ro")) { + qWarning() << "read only platform"; + emit error(QString(MSG_MOUNT_WARNING)); + return; + } //FIXME: (sdb) general sdb installation failure message is printed with stdout */ - if (command == SDB_INSTALL_COMMAND && outMsg.contains(SDB_INSTALL_FAILURE)) { + if (command != SDB_PUSH_COMMNAD && outMsg.contains(SDB_INSTALL_FAILURE)) { emit errorOccured(outMsg, process->exitCode()); return; } diff --git a/tizen/src/ui/menu/sdbhelperthread.h b/tizen/src/ui/menu/sdbhelperthread.h index 162ce1813a..dcdb4f48b1 100644 --- a/tizen/src/ui/menu/sdbhelperthread.h +++ b/tizen/src/ui/menu/sdbhelperthread.h @@ -57,6 +57,7 @@ private: signals: void errorOccured(QString errString, int exitCode); void finished(QString outMsg); + void error(QString message); public slots: void handleErrorOccured(QString errString, int exitCode); diff --git a/tizen/src/ui/resource/ui_strings.h b/tizen/src/ui/resource/ui_strings.h index a17e9aaeed..b7892d70c5 100644 --- a/tizen/src/ui/resource/ui_strings.h +++ b/tizen/src/ui/resource/ui_strings.h @@ -140,6 +140,7 @@ #define SDB_INSTALL_FAILURE "val[fail]" #define SDB_PUSH_COMMNAD 1 #define SDB_INSTALL_COMMAND 2 +#define SDB_INSTALL_RPM_COMMAND 3 #define PROGRESSBAR_DEFAULT_WITDH 100 #define PROGRESSBAR_DEFAULT_HEIGHT 20 @@ -172,6 +173,8 @@ #define MSG_SDB_FAILED_PROCESSING "Failed while processing.\n\nError Message:\n" #define MSG_SDB_ROOT_ON "This job needs root priviledge.\n"\ "Are you sure you want to continue?" +#define MSG_MOUNT_WARNING "Unable to install rpm package!\nRoot filesystem is read-only.\n"\ + "Remount the root filesystem with read-write and retry." #define MSG_EMPTY_DIR "Target directory is empty.\n" /* qFatal messages */ |