diff options
author | Richard Jones <rjones@redhat.com> | 2009-04-26 06:48:31 +0100 |
---|---|---|
committer | Richard Jones <rjones@redhat.com> | 2009-04-26 06:48:31 +0100 |
commit | 0583c8c2c3500715fe5757d2e2fcb0fdc019c2ae (patch) | |
tree | 23edd9099e1b4192d54bb40558726f0277d5761a /recipes | |
parent | 027897d4ddaf886a309a032b488f64512d2dc873 (diff) | |
download | libguestfs-0583c8c2c3500715fe5757d2e2fcb0fdc019c2ae.tar.gz libguestfs-0583c8c2c3500715fe5757d2e2fcb0fdc019c2ae.tar.xz libguestfs-0583c8c2c3500715fe5757d2e2fcb0fdc019c2ae.zip |
Added rpmqa example.
Diffstat (limited to 'recipes')
-rw-r--r-- | recipes/rpmqa.example | 14 | ||||
-rw-r--r-- | recipes/rpmqa.html | 19 | ||||
-rwxr-xr-x | recipes/rpmqa.sh | 8 | ||||
-rw-r--r-- | recipes/rpmqa.title | 1 |
4 files changed, 42 insertions, 0 deletions
diff --git a/recipes/rpmqa.example b/recipes/rpmqa.example new file mode 100644 index 00000000..44eb6492 --- /dev/null +++ b/recipes/rpmqa.example @@ -0,0 +1,14 @@ +$ ./rpmqa.sh RHEL53PV32.img /dev/VolGroup00/LogVol00 > /tmp/rpms +$ ls -l /tmp/rpms +-rw-rw-r--. 1 rjones rjones 17324 2009-04-26 06:47 /tmp/rpms +$ head /tmp/rpms +add "RHEL53PV32.img" +run +mount-ro "/dev/VolGroup00/LogVol00" / +command "rpm -qa" +tzdata-2008i-1.el5 +nash-5.1.19.6-44 +gnome-mime-data-2.4.2-3.1 +dump-0.4b41-2.fc6 +emacs-leim-21.4-20.el5 +rootfiles-8.1-1.1.1 diff --git a/recipes/rpmqa.html b/recipes/rpmqa.html new file mode 100644 index 00000000..d5a36768 --- /dev/null +++ b/recipes/rpmqa.html @@ -0,0 +1,19 @@ +<p> +The command lists the RPMs installed inside a Fedora / RHEL / CentOS +or other RPM-based virtual machine. It does this by running the +<code>rpm -qa</code> command directly inside the machine. +</p> + +<p> +To use it you need to know the partition or LV <i>inside</i> the +VM that contains the root filesystem, so for example: +</p> + +<pre> +rpmqa.sh guest.img /dev/VolGroup00/LogVol00 | less +</pre> + +<p> +You can write a similar command for Debian-based virtual machines +very easily. +</p> diff --git a/recipes/rpmqa.sh b/recipes/rpmqa.sh new file mode 100755 index 00000000..ed759532 --- /dev/null +++ b/recipes/rpmqa.sh @@ -0,0 +1,8 @@ +#!/bin/sh - + +guestfish <<EOF +add "$1" +run +mount-ro "$2" / +command "rpm -qa" +EOF diff --git a/recipes/rpmqa.title b/recipes/rpmqa.title new file mode 100644 index 00000000..b50b9b47 --- /dev/null +++ b/recipes/rpmqa.title @@ -0,0 +1 @@ +List the RPMs installed inside a Fedora or RHEL virtual machine
\ No newline at end of file |