> For the complete documentation index, see [llms.txt](https://kysonlok.gitbook.io/blog/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kysonlok.gitbook.io/blog/openwrt/make_usb_storage_work.md).

# 配置DTS支持USB存储

## Support USB on LEDE

### Step 1: Ensure dts file has enabled ehci and ohci

```
&ehci {
    status = "okay";
};

&ohci {
    status = "okay";
};
```

### Step 2: Enable usb support on linux kernel

`$ make kernel_menuconfig`

Select in turn:

```
Device Drivers  --->
    [*] USB support  --->
```

### Step 3: Select usb kernel module and dependency libraries

`$ make menuconfig`

Select in turn:

```
Kernel modules  --->
    USB Support  --->  
        -*- kmod-usb-core  
        <*> kmod-usb-ledtrig-usbport  
        <*> kmod-usb-ohci 
        <*> kmod-usb-storage 
        <*> kmod-usb2
    Filesystems  --->
        <*> kmod-fs-exfat  
        <*> kmod-fs-ext4  
        <*> kmod-fs-vfat  
Utilities  --->  
    Filesystem  --->  
        -*- ntfs-3g  
        <*> ntfs-3g-utils
Libraries  --->  
    <*> libblkid  
    -*- libuuid
```

### Step 4: Support automatic mount and led indicator

Related files on the toplevel directory of the buildroot, as follow:

```
files/
├── etc
│   ├── config
│   │   └── system
│   └── hotplug.d
│       └── block
│           └── 10-mount
└── usr
    └── sbin
        └── blkid
```

### Step 5: Rebuild firmware

`$ make V=s`

## Support SD Card on LEDE

### Step 1: Ensure dts file has enabled sdhci

```
&sdhci {
    status = "okay";
};
```

### Step 2: Select SD card kernel module

```
Kernel modules  --->
    Other modules  ---> 
        -*- kmod-mmc  
         -*- kmod-sdhci  
        <*> kmod-sdhci-mt7620
```

Besides, it also needs to add filesystem module and dependency libraries and so on which has done on supported USB of *Step 3* and *Step 4*. If you have done supported USB, then you should rebuild the firmware directly, otherwise, please repeat the above *Step 3* and *Step 4*.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://kysonlok.gitbook.io/blog/openwrt/make_usb_storage_work.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
