Utilities/mount: Automatically mount regular files with loop devices

Check if the source fd is not a block device file using the fstat
syscall and if that's the case, try to mount the file using a temporary
loop device.
This commit is contained in:
Liav A 2024-02-09 17:17:14 +02:00 committed by Andrew Kaster
commit 0739b5df11
Notes: sideshowbarker 2024-07-17 06:54:15 +09:00
2 changed files with 24 additions and 1 deletions

View file

@ -44,6 +44,9 @@ Additionally, the name `defaults` is accepted and ignored.
```sh
# mount devpts /dev/pts -t devpts -o noexec,nosuid
# mount /home/anon/myfile.txt /tmp/foo -o bind
# mount a regular file using a temporary loop device
$ mount /home/anon/myfilesystem.bin /mnt
```
## See also