mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
Added rpmqa example.
This commit is contained in:
14
recipes/rpmqa.example
Normal file
14
recipes/rpmqa.example
Normal file
@@ -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
|
||||
19
recipes/rpmqa.html
Normal file
19
recipes/rpmqa.html
Normal file
@@ -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>
|
||||
8
recipes/rpmqa.sh
Executable file
8
recipes/rpmqa.sh
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/bin/sh -
|
||||
|
||||
guestfish <<EOF
|
||||
add "$1"
|
||||
run
|
||||
mount-ro "$2" /
|
||||
command "rpm -qa"
|
||||
EOF
|
||||
1
recipes/rpmqa.title
Normal file
1
recipes/rpmqa.title
Normal file
@@ -0,0 +1 @@
|
||||
List the RPMs installed inside a Fedora or RHEL virtual machine
|
||||
Reference in New Issue
Block a user