Http://blog.chinaunix.net/uid-23141914-id-5754416.html
Recently on the new version of Android 7.0, it was found that filesystem's remount always reported "Device or resource Busy" errors.
Finally found on Android 7.0, switch from original toolbox to Toybox.
- :/$ ls-al/system/bin/mount
- Lrwxr-xr-x 1 root Shell 6 2016-09-02 16:23/system/bin/mount-Toybox
And then look closely at the relevant code for mount in Toybox, which is a pit.
- For remount we need _last_ match (in case of overmounts), so traverse
- In reverse order. (Yes I ' m using Remount as a Boolean for a bit here,
- The double cast is to get GCC to shut up about it.)
- Remount = (void *) (long) Comma_scan (opts, "remount", 1);
- if ((Toys.optflags & flag_a) &&!access ("/proc/mounts", R_OK)) | | remount) {
- MM = dlist_terminate (MTL = MTL2 = xgetmountlist (0));
- if (remount) remount = mm;
- }
The key is the last parameter of the Comma_scan clean
- Check all instances of opt and "no" opt in optlist, return true if opt
- Found and last instance wasn ' t. If clean, remove the from list for each instance.
- int Comma_scan (char *optlist, char *opt, int clean)
- {
- int optlen = strlen (opt), Len, no, got = 0;
- if (optlist) for (;;) {
- Char *s = comma_iterate (&optlist, &len);
- if (!s) break;
- No = (*s = = ' n ' && s[1] = = ' O ');
- if (Optlen = = Len-no &&!strncmp (opt, s+no, Optlen)) {
- got =!no;
- if (clean && optlist) memmove (S, Optlist, strlen (optlist) +1);
- }
- }
- return got;
- }
If Remount is not the last parameter of-O (_last_ match), then it will be erased. When the final call Syscall mount, the REMOUNT flag is gone.
It would be nice to change the order to mount-t Vfat-o Rw,remount/firmware.
The description of remount is not at all in Help, it's a pit!
Remount Issue on Android 7.0