From 3855baf8d9b5fc1182b38e0214d6203b71896af3 Mon Sep 17 00:00:00 2001 From: patacongo Date: Sat, 15 Nov 2008 19:17:55 +0000 Subject: [PATCH] losetup example git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1244 42af7a65-404d-4744-a932-0658087f49c3 --- Documentation/NuttShell.html | 19 ++++++++++++++++++- examples/nsh/README.txt | 17 +++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/Documentation/NuttShell.html b/Documentation/NuttShell.html index c873c79b95..3db6178674 100644 --- a/Documentation/NuttShell.html +++ b/Documentation/NuttShell.html @@ -953,7 +953,24 @@ losetup [-o ] [-r] <dev-path> <file-path>

Synopsis. - Setup the loop device at <dev-path> to access the file at <file-path> as a block device: + Setup the loop device at <dev-path> to access the file at <file-path> as a block device. + Example: +

Command Syntax 2:

diff --git a/examples/nsh/README.txt b/examples/nsh/README.txt index a34b03da97..840fe73fd9 100644 --- a/examples/nsh/README.txt +++ b/examples/nsh/README.txt @@ -341,6 +341,23 @@ o losetup [-d ] | [[-o ] [-r] ] losetup [-o ] [-r] + Example: + + nsh> dd if=/dev/zero of=/tmp/image bs=512 count=512 + nsh> ls -l /tmp + /tmp: + -rw-rw-rw- 262144 IMAGE + nsh> losetup /dev/loop0 /tmp/image + nsh> ls -l /dev + /dev: + brw-rw-rw- 0 loop0 + nsh> mkfatfs /dev/loop0 + nsh> mount -t vfat /dev/loop0 /mnt/example + nsh> ls -l /mnt + ls -l /mnt + /mnt: + drw-rw-rw- 0 example/ + o ls [-lRs] Show the contents of the directory at . NOTE: