Openwrt: automatic hot swapping mounting and openwrt hot swapping mounting
- Add USB support
Kernel modules-> USB Support-> <*> kmod-usb-core. # Kernel modules-> USB Support-> <*> kmod-usb-ohci. # default old USB 1.0kernel modules-> usb Support-> <*> kmod-USB-uhci. # usb1.1Kernel modules-> USB Support-> <*> kmod-usb-storage.Kernel modules-> USB Support-> <*> kmod-usb-storage-extras.Kernel modules-> USB Support-> <*> kmod-usb2. # usb2.0 is selected by default.
- Add SCSI support
Kernel modules-> Block Devices-> <*> kmod-scsi-core # usb3.0 is selected by default.
- Add USB Mount
Base system —> <*>block-mount
- Add File System Support
Kernel modules-> Filesystems-> <*> kmod-fs-ext4 (choice of Mobile Disk EXT4 format) Kernel modules-> Filesystems-> <*> kmod-fs-vfat (choice of FAT16/FAT32 format) kernel modules-> Filesystems-> <*> kmod-fs-ntfs (NTFS format selection)
- Exit and save make V = 99
Auto mount USB flash drive: edit/etc/hotplug. d/block/10-mount and write the following content
#!/bin/ashcase "$ACTION" inadd)for i in $(ls /dev/ | grep 'sd[a-z][1-9]')domkdir -p /mnt/$imount -o iocharset=utf8,rw /dev/$i /mnt/$iif [ $? -ne 0 ]thenmount -o rw /dev/$i /mnt/$ifidone;;remove)MOUNT=`mount | grep -o '/mnt/sd[a-z][1-9]'`for i in $MOUNTdoumount $iif [ $? -eq 0 ]thenrm -r $ifidone;;esac