45 Commits

Author SHA1 Message Date
Richard W.M. Jones
50aa9533e4 build: Define builddir and abs_srcdir when they are missing.
RHEL 5-era autoconf did not define these, so define them manually
when they are missing.

Define builddir as '.'  The scripts require this.  It won't work
in the srcdir != builddir case, but we don't care about that for
RHEL 5.

This commit also moves the builddir / abs_srcdir variable setting
above the include of subdir-rules.mk, in case that include uses
these variables.

Useful script:

  for f in $(find -name Makefile.am | xargs fgrep '$(abs_srcdir)' -l) ; do
    if ! grep -q '^abs_srcdir' $f; then
      echo missing in $f
    fi
  done
2012-06-18 15:32:47 +01:00
Richard W.M. Jones
dd216fedbd ocaml: Use OCAMLOPTFLAGS when compiling .cmx (ie. native code) files. 2012-06-18 15:32:38 +01:00
Wanlong Gao
3936412e33 sysprep: remove the data and log files of puppet
Remove the data(keys) and log files of puppet.

Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
2012-05-25 08:34:03 +01:00
Richard W.M. Jones
a119e057d1 sysprep: Credit Wanlong Gao, Fujitsu under 'AUTHORS' section. 2012-05-18 11:15:39 +01:00
Wanlong Gao
f5e0c0e3ee sysprep: remove kerberos data in the guest
Remove the generated kerberos data in the guest.

Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
2012-05-18 11:12:07 +01:00
Wanlong Gao
b6d4c29212 sysprep: remove ca certificates in the guest
Remove the ca certificates.

Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
2012-05-18 11:12:03 +01:00
Richard W.M. Jones
2040a15ac7 sysprep: Add missing 'utils.mli' to SOURCES.
Consequently this file was also missing from the tarball.
2012-05-14 23:03:54 +01:00
Wanlong Gao
1581dbe79f sysprep: remove blkid tab in the guest
Remove blkid tab cache in the guest.

Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
2012-05-10 16:27:59 +01:00
Wanlong Gao
a79b22a613 sysprep: remove pam data
Remove the generated pam data in the guest.

Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
2012-05-08 12:31:12 +01:00
Richard W.M. Jones
027fefd517 Add gettext support for OCaml tools (virt-resize, virt-sparsify, virt-sysprep).
Note that this support is optional: To enable it, install the
ocaml-gettext library from
http://forge.ocamlcore.org/projects/ocaml-gettext .  If this library
is not installed, then configure detects this and inserts dummy
gettext functions that do nothing.
2012-05-01 09:39:35 +01:00
Wanlong Gao
23f8cab1e8 sysprep: Remove the data of dovecot
Remove the data of dovecot.

Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
2012-04-27 08:51:03 +01:00
Wanlong Gao
ac75e46c5a sysprep: remove the logfiles configured by logrotate
Remove the logfiles configured by /etc/logrotate.d/*.
Omit the logfile of "samba" and "sssd" which we removed
them separately .

Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
2012-04-27 08:49:07 +01:00
Wanlong Gao
046d6c20e7 sysprep: fix typo of the object
Fix the typo of the OBJECT.
I'm sorry for the copy and paste typo.

Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
2012-04-25 11:53:04 +01:00
Wanlong Gao
303b159134 sysprep: remove the db and log of samba
Remove the db and log of samba.

Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
2012-04-25 11:53:01 +01:00
Wanlong Gao
580ae3297a sysprep: remove the db and log of sssd
Remove the db and log of sssd.

Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
2012-04-25 11:52:56 +01:00
Wanlong Gao
7fc7c3aa5b sysprep: remove the cache of package manager
Remove the cache of package manager like yum and apt.

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

RWMJ:
- Small code cleanup.
2012-04-24 08:32:08 +01:00
Wanlong Gao
95515c4576 sysprep: flag the system for reconfiguration
Flag the system for reconfiguration by touching /.unconfigured .

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

RWMJ:
- Updated so this is disabled by default, since it requires
  user intervention at next boot.
2012-04-23 15:37:28 +01:00
Wanlong Gao
148b51fe0b sysprep: remove user accounts
Remove user accounts from /etc/passwd, /etc/group,
/etc/shadow, and the home directory of the user,
except the root user.

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

RWMJ:
- Updated to use Augeas to delete accounts.
- Disable this by default, since it is very invasive.
2012-04-23 15:37:24 +01:00
Richard W.M. Jones
8d41470b6f sysprep: Don't enable every option by default.
All current operations are enabled by default.

Also:

* The POD description is split into a heading and the description body.

* An 'enabled_by_default' flag is added to the structure.
2012-04-21 22:28:15 +01:00
Richard W.M. Jones
2a5a5e15e2 sysprep: Make the tests run quietly. 2012-04-13 09:35:08 +01:00
Wanlong Gao
1f373aa246 sysprep: bash_history: fix copyright
Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
2012-04-13 09:00:35 +01:00
Wanlong Gao
ecdfd2c8cc sysprep: remove .ssh directory in users' directory
Remove the .ssh directory of user "root" and any other
users who have a .ssh directory in their home directory.

Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
2012-04-13 08:59:25 +01:00
Wanlong Gao
6c276606d7 sysprep: remove the bash history of users
Remove the bash history of users in home directory,
and history of root.

Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
2012-04-12 09:38:35 +01:00
Richard W.M. Jones
4ee518508f sysprep: Sort and align all arguments (thanks Wanlong Gao). 2012-04-11 16:27:00 +01:00
Richard W.M. Jones
16b2ffa97e sysprep: Make a common Utils.compare_command_line_args function.
This isn't quite code motion, since the new function also ignores case
(which previously we didn't ignore).
2012-04-11 16:26:32 +01:00
Richard W.M. Jones
a3d6629a0b sysprep: Move skip_dashes function into Utils module.
This is mostly code motion, but I also changed the function to use
String.unsafe_get and raise Invalid_argument on failure.
2012-04-11 16:22:58 +01:00
Richard W.M. Jones
edca57b49e sysprep: Add utils.mli (interface) file. 2012-04-11 16:14:57 +01:00
Richard W.M. Jones
b8fbbcf791 sysprep: Print some logging by default.
It can be disabled using the --quiet option.

The logging looks like:

Examining the guest ...
Performing "cron-spool" ...
Performing "dhcp-client-state" ...
Performing "dhcp-server-state" ...
Performing "hostname" ...
Performing "logfiles" ...
Performing "mail-spool" ...
Performing "net-hwaddr" ...
Performing "random-seed" ...
Performing "rhn-systemid" ...
Performing "script" ...
Performing "smolt-uuid" ...
Performing "ssh-hostkeys" ...
Performing "udev-persistent-net" ...
Performing "utmp" ...
Performing "yum-uuid" ...

Reviewed-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
2012-04-11 13:50:53 +01:00
Qin Guan
5e054f8731 sysprep: Allow hwaddr to be removed on other Red Hat derivatives (RHBZ#811117). 2012-04-10 14:15:18 +01:00
Qin Guan
60b87d0a5c sysprep: Allow hostname to be set on other Red Hat derivatives (RHBZ#811112). 2012-04-10 14:15:08 +01:00
Richard W.M. Jones
04ddf3cfa2 sysprep: Add GDM and session preferences to logfiles. 2012-04-03 09:54:50 +01:00
Richard W.M. Jones
25d156f262 sysprep: Remove installation logfiles in /root. 2012-04-03 09:48:45 +01:00
Richard W.M. Jones
a1d88b60e3 sysprep: Include logfile glob list in the man page. 2012-04-03 09:43:12 +01:00
Richard W.M. Jones
95123a9144 sysprep: Add a test of the --script option. 2012-04-01 20:02:25 +01:00
Richard W.M. Jones
6282d92b1b sysprep: Simplify and tidy up the test. 2012-04-01 20:01:08 +01:00
Richard W.M. Jones
9cb976ab5f sysprep: script: Documentation fix. 2012-04-01 20:00:36 +01:00
Richard W.M. Jones
b1f997164e sysprep: script: Miscellaneous fixes and cleanups to shell script. 2012-04-01 20:00:28 +01:00
Richard W.M. Jones
de656448f7 sysprep: script: Wait for child process to exit. 2012-04-01 20:00:06 +01:00
Richard W.M. Jones
6c88ae851f sysprep: script: Remove useless check that script is executable.
This check will fail if the script is on the path.  Also document
that script must be on the path or else the full path to the script
must be given.
2012-04-01 19:59:32 +01:00
Richard W.M. Jones
65e20e34dd sysprep: Add some debug code when performing operations. 2012-04-01 19:57:41 +01:00
Richard W.M. Jones
94e94550ed sysprep: Add more files to CLEANFILES. 2012-04-01 13:17:32 +01:00
Richard W.M. Jones
7ed21d9a5c sysprep: When generating man pages, use 'run' script. 2012-04-01 13:15:56 +01:00
Richard W.M. Jones
6e3de76278 Ensure that SOURCES are always in EXTRA_DIST, even if OCaml not available. 2012-03-31 23:17:41 +01:00
Richard W.M. Jones
ad43dde9c8 sysprep: Implement 'script' operation for running general scripts against the guest. 2012-03-31 23:02:47 +01:00
Richard W.M. Jones
026f616650 Rewrite virt-sysprep. 2012-03-31 22:55:33 +01:00