Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6f908cef authored by Mark Salyzyn's avatar Mark Salyzyn
Browse files

adb: fix adb remount -R

A regression from commit 8c2198c8
("adb: use shell for remount to forward return codes.") where the
optional argv[1] got missed for the remount command.  This change
hands off _all_ the arguments if to a shell and activates some of
the extra features in the remount command.

$ adb remount --help
remount [-h] [-R] [-T fstab_file] [partition]...
	-h --help	this help
	-R --reboot	disable verity & reboot to facilitate remount
	-T --fstab	custom fstab file location
	partition	specific partition(s) (empty does all)

Remount specified partition(s) read-write, by name or mount point.
-R notwithstanding, verity must be disabled on partition(s).
$

SideEffects: adb remount [-h] [-R] [-T fstab_file] [partition]...
Test: adb-remount-test.sh
Bug: 138577868
Bug: 139283818
Bug: 139226412
Change-Id: I8223d4000ab20857e9b634e4d4a326eed530d7be
parent b0321c1d
Loading
Loading
Loading
Loading
+6 −2
Original line number Original line Diff line number Diff line
@@ -1713,8 +1713,12 @@ int adb_commandline(int argc, const char** argv) {
        }
        }


        if (CanUseFeature(features, kFeatureRemountShell)) {
        if (CanUseFeature(features, kFeatureRemountShell)) {
            const char* arg[2] = {"shell", "remount"};
            std::vector<const char*> args = {"shell"};
            return adb_shell(2, arg);
            args.insert(args.cend(), argv, argv + argc);
            return adb_shell(args.size(), args.data());
        } else if (argc > 1) {
            auto command = android::base::StringPrintf("%s:%s", argv[0], argv[1]);
            return adb_connect_command(command);
        } else {
        } else {
            return adb_connect_command("remount:");
            return adb_connect_command("remount:");
        }
        }