bootargs 之 mtdparts
来源:互联网 发布:linux yum命令找不到 编辑:程序博客网 时间:2024/05/21 10:22
Uboot: bootargs mtdparts=4m(kernel:0),25856k(rootfs:0) 设置分区Uboot传给内核mtdparts分区表优先级高于在flash在设备树中的分区表/** * mtd_device_parse_register - parse partitions and register an MTD device. * * @mtd: the MTD device to register * @types: the list of MTD partition probes to try, see * 'parse_mtd_partitions()' for more information * @parser_data: MTD partition parser-specific data * @parts: fallback partition information to register, if parsing fails; * only valid if %nr_parts > %0 * @nr_parts: the number of partitions in parts, if zero then the full * MTD device is registered if no partition info is found * * This function aggregates MTD partitions parsing (done by * 'parse_mtd_partitions()') and MTD device and partitions registering. It * basically follows the most common pattern found in many MTD drivers: * * * It first tries to probe partitions on MTD device @mtd using parsers * specified in @types (if @types is %NULL, then the default list of parsers * is used, see 'parse_mtd_partitions()' for more information). If none are * found this functions tries to fallback to information specified in * @parts/@nr_parts. * * If any partitioning info was found, this function registers the found * partitions. * * If no partitions were found this function just registers the MTD device * @mtd and exits. * * Returns zero in case of success and a negative error code in case of failure. */int mtd_device_parse_register(struct mtd_info *mtd, const char * const *types, struct mtd_part_parser_data *parser_data, const struct mtd_partition *parts, int nr_parts){int err;struct mtd_partition *real_parts;//首先尝试从mtdparts获取分区表err = parse_mtd_partitions(mtd, types, &real_parts, parser_data);if (err <= 0 && nr_parts && parts) {//其次从flash所在设备树结点获取分区表real_parts = kmemdup(parts, sizeof(*parts) * nr_parts, GFP_KERNEL);if (!real_parts)err = -ENOMEM;elseerr = nr_parts;}//建立分区设备if (err > 0) {err = add_mtd_partitions(mtd, real_parts, err);kfree(real_parts);} else if (err == 0) {err = add_mtd_device(mtd);if (err == 1)err = -ENODEV;}return err;}
阅读全文
0 0
- bootargs 之 mtdparts
- MTD和 uboot中的bootargs 下属 mtdparts
- bootargs
- bootargs
- 移植u-boot-2015.07-rc3之修改代码支持mtdparts命令(八)
- uboot,mtdparts与mtd
- Bootargs使用
- uboot bootargs
- Uboot bootargs
- U-boot中mtdparts命令添加
- 2012-08-03 16:03 U-boot 之bootargs(转)
- bootcmd 和bootargs
- bootcmd和bootargs参数
- bootcmd 和bootargs【转】
- bootcmd 和bootargs
- uboot bootargs环境变量 .
- bootcmd和bootargs参数
- uboot bootargs bootcmd bootm
- Android 平台 Binder 机制 简介
- sql server 2008分布式查询
- 7天学会Spring Cloud
- android studio下导出jar(java.lang.IllegalAccessError: Class ref in pre-verified class resolved to unex)
- SSM多数据源和动态数据源切换
- bootargs 之 mtdparts
- MFC中的DC,CDC和HDC
- nginx 动态增加/删除upstream及upstream下的server ip
- tomcat7+redis(单个) session共享
- Ubuntu16.04 x64服务器安装配置OpenVPN教程
- jsonp,用ajax和php实现跨域
- MongoDB 副本集
- 多个JS文件性能优化
- maven项目 pom.xml中添加jar包