1      Scope of Document

This document describes tf card bootup auto do file system check when mount tf card

2      Requiremen

2.1     Function Requirement

Auto do fsch and  mount tf card.

2.2     Performance Requirement

NA

3      Hardware Overview

NA

4      Functional Description

4.1     Functional Block Diagram

NA

5      Porting

5.1     Kernel configure

CONFIG_TARGET_ramips=y

CONFIG_TARGET_ramips_mt7628=y

CONFIG_TARGET_ramips_mt7628_Default=y

CONFIG_BUSYBOX_CUSTOM=y

CONFIG_BUSYBOX_CONFIG_FDISK=y

CONFIG_BUSYBOX_CONFIG_FEATURE_AIX_LABEL=y

CONFIG_BUSYBOX_CONFIG_FEATURE_FDISK_ADVANCED=y

CONFIG_BUSYBOX_CONFIG_FEATURE_FDISK_WRITABLE=y

CONFIG_BUSYBOX_CONFIG_FEATURE_GPT_LABEL=y

CONFIG_BUSYBOX_CONFIG_FEATURE_OSF_LABEL=y

CONFIG_BUSYBOX_CONFIG_FEATURE_SGI_LABEL=y

CONFIG_BUSYBOX_CONFIG_FEATURE_SUN_LABEL=y

CONFIG_BUSYBOX_CONFIG_MICROCOM=y

CONFIG_PACKAGE_block-mount=y

CONFIG_PACKAGE_chat=y

CONFIG_PACKAGE_comgt=y

CONFIG_PACKAGE_e2fsprogs=y

CONFIG_PACKAGE_kmod-crypto-core=y

CONFIG_PACKAGE_kmod-crypto-hash=y

CONFIG_PACKAGE_kmod-fs-ext4=y

CONFIG_PACKAGE_kmod-fs-vfat=y

CONFIG_PACKAGE_kmod-lib-crc16=y

CONFIG_PACKAGE_kmod-mmc=y

CONFIG_PACKAGE_kmod-nls-cp437=y

CONFIG_PACKAGE_kmod-nls-iso8859-1=y

CONFIG_PACKAGE_kmod-nls-utf8=y

CONFIG_PACKAGE_kmod-scsi-core=y

CONFIG_PACKAGE_kmod-scsi-generic=y

CONFIG_PACKAGE_kmod-sdhci=y

CONFIG_PACKAGE_kmod-sdhci-mt7620=y

CONFIG_PACKAGE_kmod-usb-serial=y

CONFIG_PACKAGE_kmod-usb-serial-option=y

CONFIG_PACKAGE_kmod-usb-serial-wwan=y

CONFIG_PACKAGE_libext2fs=y

CONFIG_PACKAGE_libuuid=y

CONFIG_PACKAGE_luci-proto-3g=y

[    5.140000] MTK MSDC device init.

[    5.180000] mtk-sd: MediaTek MT6575 MSDC Driver

[    5.180000] sdhci: Secure Digital Host Controller Interface driver

[    5.180000] sdhci: Copyright(c) Pierre Ossman

[    5.180000] sdhci-pltfm: SDHCI platform and OF driver helper

[    5.290000] mmc0: new high speed SDHC card at address 0007

[    5.290000] mmcblk mmc0:0007: no of_node; not parsing pinctrl DT

[    5.290000] mmcblk0: mmc0:0007 SD16G 14.5 GiB

[    5.300000]  mmcblk0: p1

5.2     System configure

Reference: https://openwrt.org/docs/techref/block_ mount?s[]=auto&s[]=mount

root@OpenWrt:~# cat /etc/config/fstab

config global

option anon_swap '0'

option anon_mount '0'

option auto_swap '1'

option auto_mount '1'

option delay_root '5'

option check_fs '0'

config mount

option target '/mnt/'

option device '/dev/mmcblk0p1'

option enabled '1'

option enabled_fsck '1'

Create patch for auto mount tfcard and do fsck when mount tf card.

Trunk/package/system/fstools/patches/001-support-auto-mount-and-fsck-tf-card.patch

@@ -542,6 +542,7 @@ static int print_block_info(struct blkid

return 0;

}

+#if   0

static int print_block_uci(struct blkid_struct_probe *pr)

{

if (!strcmp(pr->id->name, "swap")) {

@@ -558,6 +559,7 @@ static int print_block_uci(struct blkid_

return 0;

}

+#endif

static struct blkid_struct_probe* find_block_info(char *uuid, char *label, char *path)

{

@@ -1230,9 +1232,9 @@ static int main_umount(int argc, char **

static int main_detect(int argc, char **argv)

{

-      struct blkid_struct_probe *pr;

+     //struct blkid_struct_probe *pr;

-      cache_load(0);

+     //cache_load(0);

printf("config 'global'\n");

printf("\toption\tanon_swap\t'0'\n");

printf("\toption\tanon_mount\t'0'\n");

@@ -1240,8 +1242,13 @@ static int main_detect(int argc, char **

printf("\toption\tauto_mount\t'1'\n");

printf("\toption\tdelay_root\t'5'\n");

printf("\toption\tcheck_fs\t'0'\n\n");

-      list_for_each_entry(pr, &devices, list)

-             print_block_uci(pr);

+     //list_for_each_entry(pr, &devices, list)

+     //     print_block_uci(pr);

+     printf("config 'mount'\n");

+        printf("\toption\ttarget\t'/mnt/'\n");

+        printf("\toption\tdevice\t'%s'\n", "/dev/mmcblk0p1");

+        printf("\toption\tenabled\t'1'\n");

+        printf("\toption\tenable_fsck\t'1'\n\n");

return 0;

}

Equivalently add follow option in /etc/config/fstab

option target /mnt/                       à set  mount point

option device /dev/mmcblk0p1    à set tf card device interface

option enabled 1                              ­-> default enable auto mount function

option enable_fsck 1                       à default enable fsck function

Openwrt TF Card Auto Mount&Check (4)的更多相关文章

  1. mdev USB disk auto mount demo

    /********************************************************************* * mdev USB disk auto mount de ...

  2. ubuntu auto mount自动挂载硬盘

    Ubuntu 挂载的文章在网上也不少,推荐一个: http://wenku.baidu.com/link?url=N2c7axijp_KYaYkt2CrZFNZPzzS8xBHLQSTUcI2F85I ...

  3. OpenWrt中开启usb存储和samba服务

    在从官网安装的WNDR3800 15.05.1版本OpenWrt中, 不带usb存储支持以及samba, 需要另外安装 1. 启用usb支持 USB Basic Support https://wik ...

  4. am335x system upgrade kernel tf(五)

    1      Scope of Document This document describes TF hardware design 2      Requiremen 2.1     Functi ...

  5. openwrt补丁

    http://wiki.openwrt.org/doc/devel/patches 中文文档:http://andelf.diandian.com/post/2013-05-22/4005067737 ...

  6. Centos6下编译LEDE/OpenWrt

    准备工作 1. 安装依赖软件 这是官方文档提供的依赖列表 yum install subversion binutils bzip2 gcc gcc-c++ gawk gettext flex ncu ...

  7. linux存储管理之mount挂载

    Mount 挂载详解 ====================================================================================本节内容: ...

  8. Tf中的SGDOptimizer学习【转载】

    转自:https://www.tensorflow.org/api_docs/python/tf/train/GradientDescentOptimizer 1.tf.train.GradientD ...

  9. Flash OS images to SD cards & USB drives & TF cards safely and easily using etcher

    install tools: wget https://github.com/resin-io/etcher/releases/download/v1.4.5/etcher-cli-1.4.5-lin ...

随机推荐

  1. linux内核分析 1、2章读书笔记

    一.linux历史 20世纪60年代,MIT开发分时操作系统(Compatible TIme-Sharing System),支持30台终端访问主机: 1965年,Bell实验室.MIT.GE(通用电 ...

  2. poj 1274 The Prefect Stall - 二分匹配

    Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 22736   Accepted: 10144 Description Far ...

  3. ssh服务的最佳实践

    工作中ssh的最佳实践: 不要使用默认端口 禁止使用protocol version 1 (默认centos6/7已经禁止使用第一版了,但是centos5可能还有在用第一版本) 限制可登陆用户 设定空 ...

  4. 递增三元组|2018年蓝桥杯B组题解析第六题-fishers

    标题:递增三元组 给定三个整数数组 A = [A1, A2, ... AN], B = [B1, B2, ... BN], C = [C1, C2, ... CN], 请你统计有多少个三元组(i, j ...

  5. LightOJ 1296 Again Stone Game(sg函数)题解

    题意:每次必须拿且只能拿不超过一半的石头,不能拿为败 思路:显然算出每个的sg函数,但是范围1e9显然不能直接打表.所以先打表找规律,发现偶数一直是自己的一半,奇数好像没规律.偶数x的sg函数值是x/ ...

  6. Java8新特性:Function接口和Lambda表达式参考

    Lambda基本:https://blog.csdn.net/wargon/article/details/80656575 https://www.cnblogs.com/hyyq/p/742566 ...

  7. UVa 1625 颜色的长度

    https://vjudge.net/problem/UVA-1625 题意: 输入两个长度分别为n和m的颜色序列,要求按顺序合并成同一个序列,即每次可以把一个序列开头的颜色放到新序列的尾部.对于每个 ...

  8. C# asp.net 比较两个时间的差求天数

    string str1 = "2017-2-13 23:59:59"; string str2 = "2017-2-14 0:00:01"; DateTime ...

  9. 【BZOJ】[HNOI2015]菜肴制作

    题目链接:http://www.lydsy.com/JudgeOnline/problem.php?id=4010 要是考场上想不出,但是还是有一个分治的做法的嘛 做法就是反向连边,然后再反向输出字典 ...

  10. HDU2017新生赛 友好整数

    思路: 很简单的一个状态压缩,比赛时没想出来. 最多只有2^10个状态,n^2暴力一下也就1e6. 代码: #include<bits/stdc++.h> using namespace ...