Add ode-fota input argument for mount path 31/183431/4 accepted/tizen/4.0/unified/20180706.091439 submit/tizen_4.0/20180705.094417
authorseolheui kim <s414.kim@samsung.com>
Thu, 5 Jul 2018 09:11:23 +0000 (18:11 +0900)
committerseolheui kim <s414.kim@samsung.com>
Thu, 5 Jul 2018 09:33:53 +0000 (18:33 +0900)
Change-Id: If6249abe4c5bb79293b4b7fcd69fc9fc0644f99d
Signed-off-by: seolheui kim <s414.kim@samsung.com>
fota/fota.cpp

index 8ea9967..b71f6d9 100644 (file)
@@ -126,8 +126,8 @@ void usage()
                "Usage: ode-fota [Operation]" << std::endl <<
                std::endl <<
                "Operations :" << std::endl <<
-               "  mount   Mount internal memory using stored master key" << std::endl <<
-               "  remove  Remove stored internal memory master key" << std::endl;
+               "  mount [path]  Mount internal memory using stored master key" << std::endl <<
+               "  remove        Remove stored internal memory master key" << std::endl;
 }
 
 } // anonymous namespace
@@ -137,7 +137,7 @@ int main(int argc, char* argv[])
        try {
                using namespace ode;
 
-               if (argc < 2) {
+               if (argc < 2 || argc > 3) {
                        usage();
                        return EXIT_FAILURE;
                }
@@ -147,8 +147,11 @@ int main(int argc, char* argv[])
 
                if (MOUNT == argv[1]) {
                        auto masterKey = UpgradeSupport::loadMasterKey(devpath);
+                       std::string path = INTERNAL_PATH;
+                       if (argc == 3)
+                               path = argv[2];
 
-                       DMCryptEngine dmcrypt(devpath, INTERNAL_PATH, ProgressBar([](int){}));
+                       DMCryptEngine dmcrypt(devpath, path, ProgressBar([](int){}));
 
                        // mount options are ignored by mount()
                        dmcrypt.mount(masterKey, 0);