From 5abae435f0cb239b70878968e040d61a6730b897 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Fri, 29 May 2009 16:12:51 +0100 Subject: [PATCH] Squashfs recipe. --- recipes/README | 4 ++-- recipes/squashfs.example | 37 +++++++++++++++++++++++++++++++++++++ recipes/squashfs.html | 16 ++++++++++++++++ recipes/squashfs.sh | 12 ++++++++++++ recipes/squashfs.title | 1 + recipes/tar2vm.html | 4 ++++ 6 files changed, 72 insertions(+), 2 deletions(-) create mode 100644 recipes/squashfs.example create mode 100644 recipes/squashfs.html create mode 100755 recipes/squashfs.sh create mode 100644 recipes/squashfs.title diff --git a/recipes/README b/recipes/README index 6f7e255..88b3919 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

..

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 0000000..9dae930 --- /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 0000000..6b989a0 --- /dev/null +++ b/recipes/squashfs.html @@ -0,0 +1,16 @@ +

+You can use squashfs to import large amounts of data +into a guest. First you prepare the squashfs image: +

+ +
+/sbin/mksquashfs data [...] data.sqsh
+
+ +

+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 +(/usr/share/man/man8 in this example) +and then make that appear in the guest. +

diff --git a/recipes/squashfs.sh b/recipes/squashfs.sh new file mode 100755 index 0000000..3daaf2e --- /dev/null +++ b/recipes/squashfs.sh @@ -0,0 +1,12 @@ +#!/bin/sh - + +datadir=/usr/share/man/man8 +/sbin/mksquashfs $datadir test.sqsh + +guestfish < + +

+Alternatively use a squashfs. +

-- 1.8.3.1