Squashfs recipe.

This commit is contained in:
Richard W.M. Jones
2009-05-29 16:12:51 +01:00
parent afa6f05e2e
commit 5abae435f0
6 changed files with 72 additions and 2 deletions

View File

@@ -7,8 +7,8 @@ http://et.redhat.com/~rjones/libguestfs/recipes.html
The format for each recipe is:
foo.sh Shell script, using guestfish.
foo.html HTML snippet describing the recipe (should start
with <h2>..</h2> giving the title of the recipe)
foo.title The title of the recipe.
foo.html HTML snippet describing the recipe.
foo.example Plain text snippet showing example output.
Everything in the recipes/ directory may be used and distributed

37
recipes/squashfs.example Normal file
View File

@@ -0,0 +1,37 @@
$ squashfs.sh
Parallel mksquashfs: Using 2 processors
Creating 4.0 filesystem on test.sqsh, block size 131072.
[===============================================================|] 663/663 100%
Exportable Squashfs 4.0 filesystem, data block size 131072
compressed data, compressed metadata, compressed fragments
duplicates are removed
Filesystem size 1518.07 Kbytes (1.48 Mbytes)
98.41% of uncompressed filesystem size (1542.53 Kbytes)
Inode table size 8095 bytes (7.91 Kbytes)
35.59% of uncompressed inode table size (22748 bytes)
Directory table size 7612 bytes (7.43 Kbytes)
49.11% of uncompressed directory table size (15499 bytes)
Number of duplicate files found 6
Number of inodes 701
Number of files 663
Number of fragments 13
Number of symbolic links 37
Number of device nodes 0
Number of fifo nodes 0
Number of socket nodes 0
Number of directories 1
Number of ids (unique uids + gids) 1
Number of uids 1
root (0)
Number of gids 1
root (0)
total 1732
drwxr-xr-x 2 root root 15498 May 27 10:34 .
drwxr-xr-x 18 root root 0 May 29 08:44 ..
-rw-r--r-- 1 root root 345 Mar 3 17:53 Kobil_mIDentity_switch.8.gz
-rw-r--r-- 1 root root 4878 Mar 8 14:50 MAKEDEV.8.gz
-rw-r--r-- 1 root root 1278 May 5 11:36 NetworkManager.8.gz
-rw-r--r-- 1 root root 2938 Apr 10 12:15 PAM.8.gz
-rw-r--r-- 1 root root 736 Feb 24 20:25 PolicyKit.8.gz
lrwxrwxrwx 1 root root 15 May 14 06:41 accept.8.gz -> cupsaccept.8.gz

16
recipes/squashfs.html Normal file
View File

@@ -0,0 +1,16 @@
<p>
You can use squashfs to import large amounts of data
into a guest. First you prepare the squashfs image:
</p>
<pre>
/sbin/mksquashfs data <i>[...]</i> data.sqsh
</pre>
<p>
and then you can add it to the guest as an extra data
drive. In the example below, we show how to make a
squashfs from the contents of some local directory
(<code>/usr/share/man/man8</code> in this example)
and then make that appear in the guest.
</p>

12
recipes/squashfs.sh Executable file
View File

@@ -0,0 +1,12 @@
#!/bin/sh -
datadir=/usr/share/man/man8
/sbin/mksquashfs $datadir test.sqsh
guestfish <<EOF
alloc test.img 10M
add test.sqsh
run
mount /dev/sdb /
ll /
EOF

1
recipes/squashfs.title Normal file
View File

@@ -0,0 +1 @@
Mount data in a guest using squashfs

View File

@@ -19,3 +19,7 @@ the contents of the tarball, but not too large that there is too much
wasted space (unless you want to give the VM extra working space of
course).
</p>
<p>
Alternatively use <a href="#squashfs">a squashfs</a>.
</p>