{
#ifdef HAVE_LIBREADLINE
- if (line_read) {
- free (line_read);
- line_read = NULL;
- }
+ if (prompt) {
+ if (line_read) {
+ free (line_read);
+ line_read = NULL;
+ }
- line_read = readline (prompt ? FISH : "");
+ line_read = readline (prompt ? FISH : "");
- if (prompt && line_read && *line_read)
- add_history_line (line_read);
+ if (line_read && *line_read)
+ add_history_line (line_read);
-#else /* !HAVE_LIBREADLINE */
+ return line_read;
+ }
+
+#endif /* HAVE_LIBREADLINE */
static char buf[8192];
int len;
if (len > 0 && buf[len-1] == '\n') buf[len-1] = '\0';
}
-#endif /* !HAVE_LIBREADLINE */
-
return line_read;
}
204800+0 records in
204800+0 records out
104857600 bytes (105 MB) copied, 2.02821 s, 51.7 MB/s
-write-file /etc/resolv.conf "nameserver 192.168.1.1" 0
-write-file /etc/HOSTNAME "newmachine" 0
-sync
$ guestfish -a /tmp/new.img -m /dev/sda1
$ ./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
+-rw-rw-r--. 1 rjones rjones 17228 2009-04-26 07:02 /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
+glibc-2.5-34
+popt-1.10.2.3-9.el5
+libart_lgpl-2.3.17-4
+audit-libs-1.7.7-6.el5
$ show-devices.sh /dev/mapper/Guests-RHEL53PV32
-run
-list-devices
/dev/sda
-list-partitions
/dev/sda1
/dev/sda2
-pvs
/dev/sda2
-vgs
VolGroup00
-lvs
/dev/VolGroup00/LogVol00
/dev/VolGroup00/LogVol01
-tar2vm.sh ../libguestfs-1.0.10.tar.gz /tmp/test.img 10M
-alloc /tmp/test.img 10M
-run
-sfdisk /dev/sda 0 0 0 ,
-mkfs ext3 /dev/sda1
-mount /dev/sda1 /
-tgz-in ../libguestfs-1.0.10.tar.gz /
-umount-all
+$ ./tar2vm.sh ../libguestfs-1.0.10.tar.gz /tmp/test.img 10M