Shell
$ sudo modinfo ./linux-6.1.176/drivers/usb/gadget/legacy/g_mass_storage.ko
filename: /home/user/core/./linux-6.1.176/drivers/usb/gadget/legacy/g_mass_storage.ko
license: GPL
author: Michal Nazarewicz
description: Mass Storage Gadget
depends: usb_f_mass_storage,libcomposite
retpoline: Y
intree: Y
name: g_mass_storage
vermagic: 6.1.176 SMP preempt mod_unload modversions
parm: idVendor:USB Vendor ID (ushort)
parm: idProduct:USB Product ID (ushort)
parm: bcdDevice:USB Device version (BCD) (ushort)
parm: iSerialNumber:SerialNumber string (charp)
parm: iManufacturer:USB Manufacturer string (charp)
parm: iProduct:USB Product string (charp)
parm: file:names of backing files or devices (array of charp)
parm: ro:true to force read-only (array of bool)
parm: removable:true to simulate removable media (array of bool)
parm: cdrom:true to simulate CD-ROM instead of disk (array of bool)
parm: nofua:true to ignore SCSI WRITE(10,12) FUA bit (array of bool)
parm: luns:number of LUNs (uint)
parm: stall:false to prevent bulk stalls (bool)
$Код: Выделить всё
parm: file:names of backing files or devices (array of charp)Shell
$ sudo insmod ./linux-6.1.176/drivers/usb/gadget/legacy/g_mass_storage.ko file="usb"
insmod: ERROR: could not insert module ./linux-6.1.176/drivers/usb/gadget/legacy/g_mass_storage.ko: Invalid parameters
$Shell
$ dd if=/dev/zero of=usb count=15000000
15000000+0 records in
15000000+0 records out
7680000000 bytes (7,7 GB, 7,2 GiB) copied, 56,121 s, 137 MB/s
$
$
$
$ sudo mke2fs -F usb -t ext4
mke2fs 1.47.0 (5-Feb-2023)
Discarding device blocks: done
Creating filesystem with 1875000 4k blocks and 469568 inodes
Filesystem UUID: 2cdec14f-fc58-4cfa-b019-36749691a808
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632
Allocating group tables: done
Writing inode tables: done
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done
$
$
$ file usb
usb: Linux rev 1.0 ext4 filesystem data, UUID=2cdec14f-fc58-4cfa-b019-36749691a808 (extents) (64bit) (large files) (huge files)
$Shell
$ uname -r
6.1.0-50-amd64
$Shell
$ sudo insmod ./linux-6.1.176/drivers/usb/gadget/legacy/g_mass_storage.ko file='u','s','b'
insmod: ERROR: could not insert module ./linux-6.1.176/drivers/usb/gadget/legacy/g_mass_storage.ko: Invalid parameters
$