summaryrefslogtreecommitdiffstats
path: root/recipes
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2009-05-29 16:12:51 +0100
committerRichard W.M. Jones <rjones@redhat.com>2009-05-29 16:12:51 +0100
commit5abae435f0cb239b70878968e040d61a6730b897 (patch)
treeb133279e7be6ce161267f458c65a8bec5f1243d8 /recipes
parentafa6f05e2e0d784250ab6408ff13152920d74495 (diff)
downloadlibguestfs-5abae435f0cb239b70878968e040d61a6730b897.tar.gz
libguestfs-5abae435f0cb239b70878968e040d61a6730b897.tar.xz
libguestfs-5abae435f0cb239b70878968e040d61a6730b897.zip
Squashfs recipe.
Diffstat (limited to 'recipes')
-rw-r--r--recipes/README4
-rw-r--r--recipes/squashfs.example37
-rw-r--r--recipes/squashfs.html16
-rwxr-xr-xrecipes/squashfs.sh12
-rw-r--r--recipes/squashfs.title1
-rw-r--r--recipes/tar2vm.html4
6 files changed, 72 insertions, 2 deletions
diff --git a/recipes/README b/recipes/README
index 6f7e2558..88b3919e 100644
--- a/recipes/README
+++ b/recipes/README
@@ -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
diff --git a/recipes/squashfs.example b/recipes/squashfs.example
new file mode 100644
index 00000000..9dae930b
--- /dev/null
+++ b/recipes/squashfs.example
@@ -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
+
diff --git a/recipes/squashfs.html b/recipes/squashfs.html
new file mode 100644
index 00000000..6b989a01
--- /dev/null
+++ b/recipes/squashfs.html
@@ -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>
diff --git a/recipes/squashfs.sh b/recipes/squashfs.sh
new file mode 100755
index 00000000..3daaf2e8
--- /dev/null
+++ b/recipes/squashfs.sh
@@ -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
diff --git a/recipes/squashfs.title b/recipes/squashfs.title
new file mode 100644
index 00000000..b2701c64
--- /dev/null
+++ b/recipes/squashfs.title
@@ -0,0 +1 @@
+Mount data in a guest using squashfs \ No newline at end of file
diff --git a/recipes/tar2vm.html b/recipes/tar2vm.html
index a0ad29cf..7350549f 100644
--- a/recipes/tar2vm.html
+++ b/recipes/tar2vm.html
@@ -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>