Commit Graph

109 Commits

Author SHA1 Message Date
Richard W.M. Jones
93f8baeb9a sysprep: Add "notes" field for notes on shortcomings, bugs, etc.
Instead of keeping this information as comments in the source, put it
into the virt-sysprep(1) man page.
2013-08-03 10:59:48 +01:00
Richard W.M. Jones
4cdbae926b sysprep: Various code refactorings of the operations.
- Use 'op' instead of 'xxx_op' for operation table.
 - Add a 'defaults' for the operation table and remove any default
   values.

This is just code motion and there is no functional change.
2013-08-03 10:25:19 +01:00
Richard W.M. Jones
44df867382 sysprep: Allow root and non-root passwords to be set.
This adds a virt-sysprep 'password' operation which adds the
following command line options:

  --root-password     Set the guest's root password.
  --password          Set any guest password.
2013-08-02 15:37:30 +01:00
Richard W.M. Jones
5deea7fce6 sysprep: Disable fs-uuids operation by default.
Disable this operation because it is more likely than not to break
Linux guests.

To fix this properly will involve finding all the places in the guest
where the UUIDs are used to locate and mount filesystems,
eg. /etc/fstab and possibly initramfs.

This updates commit 8965368eb8.
2013-08-02 15:17:24 +01:00
Nicholas Strugnell
94e5ea6b5e sysprep: rhn_systemid: delete osad-auth.conf file in RHN configuration 2013-07-31 16:33:17 +01:00
Richard W.M. Jones
b65c1c667b sysprep: Allow -a URI options to be used (RHBZ#968875).
This allows you to sysprep a remote guest by doing eg:

  virt-sysprep -a ssh://remote.example.com/disk.img
2013-07-30 15:37:16 +01:00
Richard W.M. Jones
44c5026d9e sysprep: On RHEL, firstboot script should be called S99... not 99.
Thanks: Nicholas Strugnell
2013-07-26 15:42:36 +01:00
Richard W.M. Jones
8965368eb8 sysprep: Add new fs-uuids operation.
This creates new random UUIDs for all filesystems in a guest.
2013-07-22 13:52:23 +01:00
Richard W.M. Jones
dd21bec400 sysprep: New operation to remove RPM database files.
See:
https://lists.fedoraproject.org/pipermail/devel/2013-June/184389.html
2013-06-24 21:06:58 +01:00
Richard W.M. Jones
ef107448e8 Add followsymlinks flag to is-file, is-dir, is-blockdev, is-chardev, is-fifo and is-socket APIs.
This adds an extra optional boolean 'followsymlinks' flag to those 6
is-* APIs.  If the flag is true, then symlinks are followed, ie. we
use stat instead of lstat in the test.

For the rationale behind this change, see:
https://bugzilla.redhat.com/show_bug.cgi?id=974489
2013-06-14 10:53:17 +01:00
Richard W.M. Jones
49bdaabc7d build: Add common-rules.mk, common rules for all Makefiles.
This file is mainly a central place to:

 - include localenv if it exists, and

 - define the RHEL 5 backwards compatibility macros, instead of
   spreading them over every other file.
2013-06-04 12:41:11 +01:00
Richard W.M. Jones
5a69428f5e sysprep: Be prepared for CentOS etc. 7 which will act the same way as RHEL 7. 2013-05-21 13:59:54 +01:00
Richard W.M. Jones
d2abdddf61 sysprep: Update /etc/machine-info on Fedora 18+, RHEL 7+ (RHBZ#890027). 2013-05-21 13:59:54 +01:00
Richard W.M. Jones
0daa83cc91 sysprep: Refactor code, introducing a function to replace a line in a file. 2013-05-21 13:59:54 +01:00
Richard W.M. Jones
333337b6a9 debian: Add OCaml .depend files to DISTCLEANFILES.
Otherwise debuild complains that these files have been created after
it does a 'make distclean'.
2013-05-02 13:18:12 +01:00
Richard W.M. Jones
fecc74e080 tests: sysprep: Specify list of operations explicitly.
This commit makes no functional change on its own, but it allows us to
filter out failing operations on Ubuntu.
2013-04-22 16:18:19 +01:00
Richard W.M. Jones
6185aa4e38 ocaml tools: Enable parallel builds.
In particular, building virt-sysprep is slow because there are so many
modules.  Enable parallel builds.  If it breaks, we should fix it, not
work around it.
2013-03-28 20:15:51 +00:00
Richard W.M. Jones
6c9a7fe561 Add --long-options option to most tools.
For example:

$ guestfish --long-options
--add
--cmd-help
--connect
--csh
--domain
--echo-keys
[etc.]

The idea of this is to make it easier to write a bash completion
script that accurately expands --<TAB> options for each command.
2013-03-28 14:46:20 +00:00
Richard W.M. Jones
05ba393724 OCaml tools: Use Common_gettext and Common_utils modules.
Share these modules across all three tools virt-resize, virt-sparsify
and virt-sysprep.

This is mostly code motion.
2013-03-28 14:00:42 +00:00
Richard W.M. Jones
3e9e40aee3 fuse: Add guestunmount program to handle unmounting (RHBZ#916780). 2013-03-05 13:12:25 +00:00
Richard W.M. Jones
d1ad89520e tests: Skip windows.img tests if it is zero-sized.
If ntfs-3g is not installed, then tests/guests creates a 'windows.img'
file which is zero-sized.

This is problematical because other tests which use this image will
fail at best, or hit RHBZ#847549 (qemu/virtio-scsi bug) at worst.

Change the tests which use windows.img so they skip if 'windows.img'
has zero size.
2012-12-18 17:35:51 +00:00
Richard W.M. Jones
5a2e320ec9 configure: Add --enable-code-profiling and --enable-code-coverage flags.
These configure flags enable code profiling (with gprof) and code
coverage (with gcov) respectively.

Although this is a nice idea, it's not currently very useful.

Libtool mangles filenames in such a way that gcov cannot locate its
datafiles.

Profiling is of dubious utility with libguestfs which is not CPU-bound
and relies extensively on running external programs (oprofile-like
system profiling that took into account libguestfs + qemu or
libguestfs + qemu + the appliance + filesystem tools *would* be
useful).

Also neither flag will help in capturing data from the appliance.
2012-12-04 14:11:14 +00:00
Richard W.M. Jones
b57ab59b8e doc: Document problems with hibernated Windows guests and Windows 8 "fast startup" (RHBZ#882299). 2012-12-01 13:25:56 +00:00
Richard W.M. Jones
f5ae46dca7 inspection, virt-sysprep: Use /etc/hostname on F18+, RHEL7+ (RHBZ#881953, RHBZ#858696). 2012-11-30 12:37:48 +00:00
Wanlong Gao
9fb5a3ceaf sysprep: remove crash data generated by kexec-tools
Remove the kdump generated kernel crash data.

Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>

RWMJ:
 - Added /var/log/dump/* path for SLES (thanks Olaf Hering).
 - Update po/POTFILES-ml.
2012-11-22 08:30:21 +00:00
Richard W.M. Jones
3636c5fcff tests: Replace 'make extra-tests' with individual tests.
'make extra-tests' was a monolithic set of tests that did all sorts of
things: valgrind, tests over local guests, tests with upstream qemu,
tests with upstream libvirt, tests with the appliance attach method.

This made it hard to perform individual tests, eg. just valgrind
testing.  It was also hard to maintain because the tests were not
located in the same directories as the programs and sometimes
duplicated tests that were run elsewhere.

This commit splits up 'make extra-tests' into 5 separate targets:

 make check-valgrind              # run a subset of tests under valgrind
 make check-valgrind-local-guests # test under valgrind with local guests
 make check-with-appliance        # test with attach-method == appliance
 make check-with-upstream-qemu    # test with an alternate/upstream qemu
 make check-with-upstream-libvirt # test with an alternate/upstream libvirt

(You can also still run 'make extra-tests' which is now simply
a rule that runs the above 5 targets in order).

This replaces everything that was in the tests/extra directory,
so that has now gone.
2012-11-13 15:26:29 +00:00
Richard W.M. Jones
226457de3d sysprep: Don't fail when trying to remove /var/spool/at/spool (directory).
This fixes commit 1949016e89.
2012-11-01 19:31:17 +00:00
Richard W.M. Jones
ccf5c6ae56 sysprep: Move a comment.
No change.
2012-10-30 08:31:38 +00:00
Wanlong Gao
f491f3a958 sysprep: remove man pages cache
Remove the cache files generated by man-db.

Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
2012-10-30 07:59:49 +00:00
Wanlong Gao
3884bc7d7a sysprep: remove fontconfig cache
Remove the cache files generated by fontconfig.

Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
2012-10-30 07:59:49 +00:00
Richard W.M. Jones
4a4ca0c01d syntax: Use __PATTERNS__ instead of @PATTERNS@ in podwrapper man pages.
It is slightly dangerous to use @PATTERNS@, since these might
be substituted by autoconf when they appear in Makefile.am files.
2012-10-03 09:22:45 +01:00
Richard W.M. Jones
8d63edaa93 sysprep: Typo in man page: resets -> reset. 2012-09-26 21:16:14 +01:00
Olaf Hering
1949016e89 sysprep: handle at jobs in cron-spool operation
cron-spool claims to remove at jobs, but it has no code to actually do
that. Add patterns to remove files in known at spool locations.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
2012-09-22 12:58:13 +01:00
Olaf Hering
55fef0e4e6 sysprep: handle distro specific sysv scripts
Currently firstboot would only work on redhat-based images.
Handle redhat-based, suse-based and debian guests, error out in case of an
unknown distro.
Update firstboot.sh:
 - make sure scripts exists and can be executed
 - add LSB header to avoid insserv warnings later on
 - run script only if called with "start"
Update functions, pass only required options.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
2012-09-22 12:58:08 +01:00
Olaf Hering
0e7d3de002 sysprep: handle suse-based in hostname operation
Signed-off-by: Olaf Hering <olaf@aepfle.de>
2012-09-21 14:09:10 +01:00
Olaf Hering
181de70feb sysprep: handle SuSE in random-seed operation
Signed-off-by: Olaf Hering <olaf@aepfle.de>
2012-09-19 21:05:29 +01:00
Olaf Hering
d6c11b0a3d sysprep: add zypper to package-manager-cache operation
libzypp and zypper store their cache files in
/var/cache/zypp/{packages,raw,solv}/ and /var/cache/zypper/RPMS/
Add a single pattern to match both cases.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
2012-09-19 21:05:29 +01:00
Olaf Hering
245608a735 sysprep: remove apache2, audit and ntp in logfile operation
Add more entries to the dump ground of logfile patterns.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
2012-09-19 21:05:29 +01:00
Olaf Hering
ae0f60744b sysprep: handle SuSE in hostname operation
SuSE based installations store the hostname in /etc/HOSTNAME.
Add code to handle both opensuse and sles. Code to properly detect
the latter will be added with another patch.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
2012-09-19 18:18:29 +01:00
Richard W.M. Jones
88c406feba sysprep: Create /etc/sysconfig/network file if it doesn't exist (RHBZ#858696). 2012-09-19 17:34:58 +01:00
Wanlong Gao
98bf41d80d sysprep: remove hostname from ifcfg-*
Remove hostname from network interface configuration.

Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
2012-09-03 09:39:48 +01:00
Richard W.M. Jones
2f97bf873b podwrapper: Add --license parameter, which is required.
This adds standard LICENSE and BUGS sections to all of the man pages
that are processed by podwrapper.

Modify all the calls to $(PODWRAPPER) to add the right --license
parameter according to the content.  Note that this relaxes the
license on some code example pages, making them effectively BSD-style
licensed.
2012-08-21 20:33:21 +01:00
Richard W.M. Jones
f1d98bbc79 man pages: Ensure consistent copyright/author sections, remove license
section.

Ensure each man page contains consistent COPYRIGHT and AUTHOR
sections.

Remove the LICENSE section.  We will add that back in podwrapper in a
later commit.
2012-08-21 20:16:29 +01:00
Richard W.M. Jones
8f3c0fd98d sysprep: docs: virt-sysprep can now be used to customize a guest. 2012-08-18 11:47:23 +01:00
Richard W.M. Jones
99cfc1f36e sysprep: Add --firstboot functionality.
This allows you to add scripts that run in the context of
the guest the first time it boots.
2012-08-18 11:47:19 +01:00
Richard W.M. Jones
0f33a1d90c sysprep: Improve error messages. 2012-08-16 18:21:07 +01:00
Wanlong Gao
159b1479cc sysprep: remove the process accounting log files
We just remove the process accounting files previously without
touch a empty file, this will cause psacct runs error.
Restart the service can't help us create this file auto.

couldn't open file '/var/account/pacct': No such file or directory

Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
2012-08-11 14:18:42 +01:00
Richard W.M. Jones
b61a8a50bc sysprep: Describe more directly how to use qemu-img for snapshotting. 2012-07-28 21:28:23 +01:00
Richard W.M. Jones
590774ed9e build: Use $(top_builddir)/run in Makefile.am's.
Not necessary, but this makes all invocations of 'run' consistent.
There is no functional change.
2012-07-26 21:58:17 +01:00
Richard W.M. Jones
42bf3274e4 sysprep: Generate new random UUIDs for LVM2 PVs and VGs (thanks Kazuo Moriwaka). 2012-07-25 14:47:15 +01:00