remount issue on android 7.0
http://blog.chinaunix.net/uid-23141914-id-5754416.html
最近在新版本的android 7.0上,发现filesystem的remount老是报“ Device or resource busy”的错误。
最终发现,android 7.0上,从原来的toolbox切换到toybox。
- :/ $ ls -al
/system/bin/mount - lrwxr-xr-x 1 root shell 6 2016-09-02 16:23 /system/bin/mount
->
toybox
然后仔细查看了一下toybox中关于mount的相关代码,果然是一个坑。
- // 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; - }
关键就是这个comma_scan的最后一个参数clean
- // check all instances of opt and "no"opt
in optlist, return true
if opt - //
found and last instance wasn't no. If clean,
remove each instance from list. - 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 = 2*(*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;
- }
如果remount不是-o的最后一个参数(_last_
match ),那么就会被清除掉。最终调用syscall mount的时候,这个remount的flag就没了。
把命令重新改为 mount
-t vfat -o rw,remount /firmware 就好了。
关于remount的说明在help里面根本没有,真是坑!
remount issue on android 7.0的更多相关文章
- Android 6.0 M userdebug版本执行adb remount失败
[FAQ18076]Android 6.0 M版本默认会打开system verified boot,即在userdebug和user版本会把system映射到dm-0设备,然后再挂载.挂载前会检查s ...
- [Bug] 解决透明 Activity 在 Android 6.0 背景不透明
如何复现 连续启动两个 Activity ,其中 Activity 1 为 不透明 的 Activity Activity 2 为 透明 的 Activity 通常用于引导页面,例如:豌豆夹锁屏引导用 ...
- android 7.0带来的
Android 7.0 给开发者带来了什么 新的 Andorid N (Andorid 7.0)预览版发布了,但是新的Android预览版需要我们在已存在的APP上测试几乎全部内容,包括不同种类的屏幕 ...
- 为 Android 8.0 添加开机启动脚本【转】
本文转载自:https://zhuanlan.zhihu.com/p/32868074 本人对于 SELinux for Android 理解不深,下文中的各文件及安全规则虽都是我所编写,但也是一边查 ...
- 【转】Ubuntu 14.04.3上配置并成功编译Android 6.0 r1源码
http://www.linuxidc.com/Linux/2016-01/127292.htm 终于成功把Android 6.0 r1源码的源码编译.先上图,这是在Ubuntu中运行的Android ...
- 【转】Android 6.0 Marsmallow BLE : Connection Parameters
原文网址:http://stackoverflow.com/questions/34617061/android-6-0-marsmallow-ble-connection-parameters Th ...
- Android 5.0 怎样正确启用isLoggable(二)__原理分析
前置文章 <Android 5.0 怎样正确启用isLoggable(一)__使用具体解释> 概要 在上文<Android 5.0 怎样正确启用isLoggable(一)__使用具体 ...
- Windows下Nexus 5的Android 5.0以上版本官方ROM的刷机教程
博客链接:http://blog.csdn.net/qq1084283172/article/details/52334452 折腾Android逆向的时候,经常需要给Nexus 5刷机.最近给Nex ...
- Android 9.0 默认输入法的设置流程分析
Android 输入法设置文章 Android 9.0 默认输入法的设置流程分析 Android 9.0 添加预置第三方输入法/设置默认输入法(软键盘) 前言 在上一篇文章 Android 9.0 ...
随机推荐
- 编译boost程序出现如下错误fatal error LNK1104: cannot open file 'libboost_system-vc100-mt-gd-1_54.lib'的解决方法
对于如下程序: #include <iostream> #include <boost/asio.hpp> #include <boost/date_time/posix ...
- Linux 启动文件、设置环境变量的位置
系统级启动文件 ==================================== 1./etc/rc 主启动文件,不要修改它 2./etc/rc.conf 决定启动哪些系统自带的守护进程 ...
- CSS-布局样式之筛选条件右边线的处理方法(no CSS3)
先上图:
- 【Android N 7.1.1】 屏幕亮和灭的处理地方
frameworks/base/services/core/java/com/android/server/display/DisplayPowerController.java private vo ...
- System.Threading.Tasks.Task引起的IIS应用程序池崩溃
问题现象 IIS应用程序池崩溃(Crash)的特征如下: 1. 从客户端看,浏览器一直处于连接状态,Web服务器无响应. 2. 从服务器端看(Windows Server 2008 + IIS 7.0 ...
- SQL取某个字符串最后一次出现的位置后面的字符串方法
--sql怎么取某个字符串最后一次出现的位置后面的字符串 declare @s varchar(max); set @s = 'fj/2016815/2016081553677565.pdf'; se ...
- 焦作网络赛L-Poor God Water【矩阵快速幂】
God Water likes to eat meat, fish and chocolate very much, but unfortunately, the doctor tells him t ...
- Spring Boot - Building RESTful Web Services
Spring Boot Building RESTful Web Services https://www.tutorialspoint.com/spring_boot/spring_boot_bui ...
- python提取相对路径
原理: 用绝对路径,截断根目录的路径,就得到了相对路径. 代码 方法1:字符串替换(用字符串函数)推荐 import os print('==========1===========') abspat ...
- Mirror--镜像用户同步
--=========================================--在镜像搭建后,在主库服务器上创建登录,并在数据库上建立对应用户,--数据库中用户被同步到镜像数据库中,但登录是 ...