從 lk 傳送到 kerel 的 cmdline 會放在開機後的

adb

/proc/cmdline

開到 android 後,又會被讀出來

/system/core/init/util.cpp

275void import_kernel_cmdline(bool in_qemu,
276 const std::function<void(const std::string&, const std::string&, bool)>& fn) {
277 std::string cmdline;
278 android::base::ReadFileToString("/proc/cmdline", &cmdline);
279
280 for (const auto& entry : android::base::Split(android::base::Trim(cmdline), " ")) {
281 std::vector<std::string> pieces = android::base::Split(entry, "=");
282 if (pieces.size() == 2) {
283 fn(pieces[0], pieces[1], in_qemu);
284 }
285 }
286}

/system/core/init/init.cpp

391static void import_kernel_nv(const std::string& key, const std::string& value, bool for_emulator) {
392 if (key.empty()) return;
393
394 if (for_emulator) {
395 // In the emulator, export any kernel option with the "ro.kernel." prefix.
396 property_set(android::base::StringPrintf("ro.kernel.%s", key.c_str()).c_str(), value.c_str());
397 return;
398 }
399
400 if (key == "qemu") {
401 strlcpy(qemu, value.c_str(), sizeof(qemu));
402 } else if (android::base::StartsWith(key, "androidboot.")) {
403 property_set(android::base::StringPrintf("ro.boot.%s", key.c_str() + 12).c_str(),
404 value.c_str());
405 }
406}

kernel cmdline的更多相关文章

  1. u-boot 2011.09 调用kernel 的流程

    这段时候我总是觉得有个问题,u-boot 的存在是不是就是为了调用kernel 而存在的. 所以,粗浅的跟了一下这个流程,还有很多细节上的东西没有做好,往指正. u-boot-2011.9 调用内核代 ...

  2. JZ2440支持设备树(1)-添加设备树之后kernel的启动参数跟dts里面不一致

    在做之前参考了如下博客文章,再次非常感谢: http://www.cnblogs.com/pengdonglin137/p/6241895.html Uboot中需要在config中添加如下宏: #d ...

  3. u-boot bootz 加载kernel 流程分析

    u-boot 加载 kernel 的流程分析. image重要结构体头文件 // include/image.h * * Legacy and FIT format headers used by d ...

  4. Android ANR 分析解决方法

    一:什么是ANR ANR:Application Not Responding,即应用无响应 二:ANR的类型 ANR一般有三种类型: 1. KeyDispatchTimeout(5 seconds) ...

  5. android ANR产生原因和解决办法【转】

    ANR (Application Not Responding) ANR定义:在Android上,如果你的应用程序有一段时间响应不够灵敏,系统会向用户显示一个对话框,这个对话框称作应用程序无响应(AN ...

  6. 如何分析解决Android ANR

    来自: http://blog.csdn.net/tjy1985/article/details/6777346 http://blog.csdn.net/tjy1985/article/detail ...

  7. 【Android】[转] ANR的分析和问题处理

    一:什么是ANR ANR:Application Not Responding,即应用无响应 二:ANR的类型 ANR一般有三种类型: 1. KeyDispatchTimeout(5 seconds) ...

  8. Android ANR分析(1)

    转自:http://blog.csdn.net/itachi85/article/details/6918761 一:什么是ANR ANR:Application Not Responding,即应用 ...

  9. android anr分析方法

    目录(?)[+] 案例1关键词ContentResolver in AsyncTask onPostExecute high iowait 案例2关键词在UI线程进行网络数据的读写   一:什么是AN ...

随机推荐

  1. 【EF】Entity Framework Core 2.0 特性介绍和使用指南

    阅读目录 前言 获取和使用 新特性 项目升级和核心API变化 下一步计划 遗憾的地方 回到目录 前言 这是.Net Core 2.0生态生态介绍的最后一篇,EF一直是我喜欢的一个ORM框架,随着版本升 ...

  2. CF311B Cats Transport 斜率优化DP

    题面:CF311B Cats Transport 题解: 首先我们观察到山与距离其实是没有什么用的,因为对于任意一只猫,我们都可以直接算出如果有一个人要恰好接走它,需要在哪一时刻出发,我们设第i只猫对 ...

  3. BZOJ4514:[SDOI2016]数字配对——题解

    https://www.lydsy.com/JudgeOnline/problem.php?id=4514 有 n 种数字,第 i 种数字是 ai.有 bi 个,权值是 ci. 若两个数字 ai.aj ...

  4. Windows系统中Xshell与Linux连接时遇到的问题

    前提条件:在Windows系统中已经安装了Xshell,并且安装了虚拟机软件和Linux系统 步骤1.在Linux系统中root用户下,使用ifconfig命令查看虚拟系统Linux的IP地址.如图1 ...

  5. [学习笔记]Segment Tree Beats!九老师线段树

    对于这样一类问题: 区间取min,区间求和. N<=100000 要求O(nlogn)级别的算法 直观体会一下,区间取min,还要维护区间和 增加的长度很不好求.... 然鹅, 从前有一个来自杭 ...

  6. Linux之根文件系统的构建20160611

    说一下LINUX根文件系统的构建: 制作文件系统 1. 交叉编译busybox 安装:make install CONFIG_PREFIX=/work/nfs_root/fs_mini_mdev_ne ...

  7. train val test区别

    train是训练集,val是训练过程中的测试集,是为了让你在边训练边看到训练的结果,及时判断学习状态.test就是训练模型结束后,用于评价模型结果的测试集.只有train就可以训练,val不是必须的, ...

  8. POJ_2112_Optimal Milking 这里有超级快的网络流板子

    Description FJ has moved his K (1 <= K <= 30) milking machines out into the cow pastures among ...

  9. spring事务的一些注意点

    参考文章 http://blog.csdn.net/qq_34021712/article/details/75949779   ©王赛超 1.在需要事务管理的地方加@Transactional 注解 ...

  10. [USACO06NOV] Roadblocks

    https://www.luogu.org/problem/show?pid=2865 题目描述 Bessie has moved to a small farm and sometimes enjo ...