Commit Graph

347 Commits

Author SHA1 Message Date
Richard W.M. Jones
ba8e8d277d Revert "appliance: init: run ldconfig"
Running ldconfig adds about 100ms to the boot time.  I would prefer
that we understood which libraries need ldconfig to be run, and fix
that.  We could also consider running ldconfig in parallel, but since
it might be required by just about any binary that the init script
runs it's not clear what benefit that gives.

This reverts commit 66aa98265d.
2016-05-13 13:30:39 +01:00
Pino Toscano
4760d80c93 appliance: move btrfs-progs as common package
Recently Debian switched to btrfs-progs, so almost all the distributions
(except openSUSE) have btrfs-progs which is then moved as common
package.
The old btrfs-tools name is left there, to support Debian Jessie and
older, and Ubuntu Xenial and older.
2016-05-03 13:03:45 +02:00
Richard W.M. Jones
03e2d00036 appliance: Add pciutils to the appliance.
This adds the 'lspci' program, useful for debugging
appliance / qemu problems.
2016-04-30 12:49:28 +01:00
Pino Toscano
807433bc23 appliance: init: generate /etc/machine-id
Some of the systemd-tmpfiles snippets need the machine ID of the running
system; the current lack of this file produces warning messages during
the appliance boot like:

[/usr/lib/tmpfiles.d/systemd.conf:26] Failed to replace specifiers: /run/log/journal/%m
[/usr/lib/tmpfiles.d/systemd.conf:28] Failed to replace specifiers: /run/log/journal/%m
[/usr/lib/tmpfiles.d/systemd.conf:29] Failed to replace specifiers: /run/log/journal/%m

Thus create a new randomly-generated /etc/machine-id on boot.
2016-03-30 10:15:49 +02:00
Richard W.M. Jones
0ba59db611 tests/qemu: Add program for tracing and analyzing boot times. 2016-03-23 13:25:46 +00:00
Richard W.M. Jones
f36ba38886 appliance: init: Don't run hwclock command.
This command alone took 0.3 seconds which is about 10% of the current
launch time.  It appears to be unnecessary.

This reverts commit 508f1ee87e.
2016-03-23 12:58:15 +00:00
Richard W.M. Jones
705b721b42 appliance: init: Mount selinuxfs along with other special filesystems.
Move this earlier.
2016-03-23 12:58:15 +00:00
Richard W.M. Jones
cb8f69e959 appliance: init: Move cmdline parsing earlier.
Since commit bb5d30ab2a, we don't
require any external programs like grep to parse the command line.  We
only use bash intrinsics.

Therefore we can do it early (but after /proc is mounted).

This allows verbose mode to enable set -x early on, so we can trace
most things that the init script does.
2016-03-23 12:58:15 +00:00
Richard W.M. Jones
d368fa0895 appliance: When using verbose mode, 'set -x' in the appliance init script. 2016-03-23 12:58:15 +00:00
Pino Toscano
bb5d30ab2a appliance: use bash features for string matching in files
Read the content of /proc/cmdline using bash features, and use its
[[ ... ]] expression to find texts in a variable.

This shaves off 5 grep invocations.
2016-03-22 22:30:59 +00:00
Richard W.M. Jones
5897b3bbad appliance: Quiet some warnings about missing files.
Try to make the appliance script as quiet as possible along
the fast path.
2016-03-18 13:18:13 +00:00
Richard W.M. Jones
23028cb30d appliance: Make it clear that the init script is a bash script.
We have used /bin/sh here since 2009.  However this is a bash
script and probably won't work well with other shells.
2016-03-18 13:18:13 +00:00
Richard W.M. Jones
1129cbba3d docs: Fix cross-reference to fixed appliance section.
The fixed appliance documentation moved from guestfs(3) to
guestfs-internals(1).

Thanks: Mark Pictor (mark999 on IRC)
2016-03-15 19:13:59 +00:00
Pino Toscano
43dd545e46 appliance: pick sleuthkit on all the distros
It looks like it has the same name everywhere, so move it in the common
packages section.

This updates commit 3bb65458ff.
2016-03-08 09:47:30 +01:00
Matteo Cafasso
3bb65458ff added The Sleuth Kit package to the appliance
Signed-off-by: Matteo Cafasso <noxdafox@gmail.com>
2016-03-07 19:33:53 +00:00
Richard W.M. Jones
b2877dc34f appliance: Add comment and clean-supermin-appliance rule.
Add a comment to appliance/Makefile.am describing the purpose of this
directory.

Add a 'make clean-supermin-appliance' rule which forces the supermin
appliance to be reprepared from scratch.  See the discussion here:
https://www.redhat.com/archives/libguestfs/2016-February/msg00264.html
2016-02-28 15:57:51 +00:00
Richard W.M. Jones
446f7794e0 podwrapper: Add --warning flag for manual pages of CLI tools (RHBZ#1293527).
This doesn't add --warning flags to the translated pages,
which is a bug to be fixed at some point.
2016-01-11 13:42:49 +00:00
Richard W.M. Jones
307c83177c Update copyright dates for 2016.
Run the following command over the source:

  perl -pi.bak -e 's/(20[01][0-9])-2015/$1-2016/g' `git ls-files`
2016-01-02 21:19:51 +00:00
Richard W.M. Jones
a2edda266e build: Make 'make clean' remove more files.
Remove man pages and other pages which 'make clean' did not remove
before.

To evaluate which pages could be removed, I did a full build and
check, and then ran 'make clean' followed by 'git clean -xdf'.  By
examining the output of the git clean command I could see which files
were being missed.

Files that are _not_ removed by make clean or make distclean:

 - generator-built files

 - Makefile, Makefile.in, .deps, .depend

 - any ./configure output files (maybe they should be?)
2015-11-03 13:53:37 +00:00
Richard W.M. Jones
47b095b928 website: Put website into a separate directory.
Move the random set of HTML files we build from html/ into
the website/ directory.

Also in the website/ directory, put the index.html file from
http://libguestfs.org, which was previously not under version control.
It is generated from index.html.in so we can automatically add the
current version and release date.

Also in the website/ directory, put various CSS file, images, etc.
which are required by the website and were also previously not under
version control.

Change the 'make website' rule to 'make maintainer-upload-website'.
As the name suggests, it is only useful for the maintainer, and will
fail with an error for anyone else.
2015-10-31 17:09:29 +00:00
Richard W.M. Jones
8554dbbc03 Remove multiple hacks that only apply to RHEL 5.
We don't support RHEL 5 upstream (see the 'oldlinux' branch for a
version that works with RHEL 5).  Therefore remove a bunch of hacks
that were only needed on RHEL 5.
2015-10-05 14:32:28 +01:00
Richard W.M. Jones
7bc6fb2451 build: Remove ./configure --enable-valgrind-daemon.
If you've ever tried to use this option, you'll know that it didn't
work well.  It broke random things (probably RHBZ#1020216, definitely
RHBZ#1023630), and caused random failures generally, while often not
actually failing when valgrind itself found problems.
2015-10-01 15:32:49 +01:00
Pino Toscano
e6dd9b5d6b appliance: explicitly add libyajl on Mageia
It seems yajl was bringing it, but seems not on Mageia 5.  Leave yajl
for older versions.
2015-08-19 14:46:39 +02:00
Cédric Bosdonnat
2d2a65504d appliance init: find NIC name for dhcpcd
dhcpcd requires an interface name as parameter to work. We are now
getting it from /proc/sys/net/ipv4/conf/ folder children. dhclient
on Debian also has the problem, thus use the guessed interface name
for it too.
2015-07-29 17:31:33 +01:00
Richard W.M. Jones
7eed43da6c appliance: Exclude /usr/lib/modules as well as /lib/modules.
It normally makes no difference to the final size of the appliance,
because 'supermin --build' will copy back the host kernel modules.
2015-07-23 16:41:06 +01:00
Richard W.M. Jones
0c7b957c13 appliance: exclude /lib/firmware
Brings the size of the appliance down to 95 MB [xz-compressed], which
is the same as for libguestfs 1.28.
2015-07-23 16:40:52 +01:00
Richard W.M. Jones
46600019b1 appliance: exclude /usr/share/fonts and /usr/share/icons.
I also sorted the list.

Between libguestfs 1.28 and 1.30, the appliance grew from 95MB to 213MB.

Using guestmount and filelight (see link below) I could see that the
main contributor was these two directories, which should not be
necessary.

With this change, the size goes down to 119MB.

See also:
https://rwmj.wordpress.com/2015/07/23/why-has-the-libguestfs-appliance-grown-by-118-mb/
2015-07-23 14:47:33 +01:00
Pino Toscano
19020ea3f8 appliance: adding qemu-img and which dependencies for more distros
In particular, add them for Archlinux, openSUSE, Frugalware, and Mageia.
2015-07-21 09:38:11 +02:00
Richard W.M. Jones
95bb1916eb appliance: Exclude more log files (RHBZ#1239154).
This removes further possible log files from the appliance, but
without removing any subdirectories.
2015-07-09 15:36:31 +01:00
Richard W.M. Jones
2080f4b0dd appliance: Remove typo $@ at beginning of line.
This fixes commit 82b486a908.
2015-07-09 15:36:31 +01:00
Richard W.M. Jones
c238a9caa1 appliance: Rebuild appliance if excludefiles changes. 2015-07-09 15:36:31 +01:00
Pino Toscano
85fe0abdd0 New tool: virt-dib
virt-dib is a new tool to run the elements of diskimage-builder using
libguestfs.
2015-07-09 14:55:43 +02:00
Chen Hanxiao
d0c067df87 daemon: add get_random_uuid
Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2015-06-30 15:54:57 +02:00
Richard W.M. Jones
8cb1a35d75 daemon: Move all the kernel command line parsing to the init script.
Instead of parsing /proc/cmdline from the daemon, move all of that
parsing into the init script, and pass the argument via the daemon
command line.

For example, previously the daemon and init script both looked for
guestfs_network=1 in /proc/cmdline.  Now the init script still looks
for it, and if found it runs `guestfsd --network'.
2015-06-29 23:08:43 +01:00
Pino Toscano
993140219c Improve fixed appliance documentation
Move the "FIXED APPLIANCE" section from
libguestfs-make-fixed-appliance(1) to the "INTERNALS" section of
guestfs(3), so it's more visible and less hidden in the documentation
of a rarely-used tool.  Also slightly improve it.

Expand the FAQ question about libguestfs without supermin, mentioning
the build options needed and pointing to the aforementioned new section.
2015-06-16 14:57:19 +02:00
Richard W.M. Jones
533901409e pod: Use F<> for filenames instead of C<>.
Done using a sequence of regular expressions like this:

  perl -pi.bak -e 's{C</}{F</}g' `git ls-files \*.pod` generator/actions.ml
  perl -pi.bak -e 's{C<C:\\}{F<C:\\}g' `git ls-files \*.pod` generator/actions.ml
  [etc]

and then tediously checking every change by hand.
2015-06-15 15:42:46 +01:00
Richard W.M. Jones
34439a04f1 appliance: Make sure /tmp and /var/tmp are real directories.
Currently if /tmp (on the host) is a symlink, then the symlink is
copied into the appliance, probably pointing to a non-existent
directory, and everything goes downhill from there.

Avoid this by making sure that /tmp and /var/tmp are real directories.
2015-06-06 14:04:40 +01:00
Richard W.M. Jones
4e9bda4598 appliance: Create /etc/mtab in init script to work around util-linux nuttiness. 2015-02-28 11:10:31 +00:00
Richard W.M. Jones
c5800dc97d Update copyright dates for 2015. 2015-01-17 09:08:15 +00:00
Richard W.M. Jones
3dabc7a7ba appliance: When running systemd-tmpfiles, pass --boot option (RHBZ#1165785).
This causes all tmpfiles to be created.
2014-11-20 13:05:26 +00:00
Richard W.M. Jones
8e78a83067 appliance: Create tmpfiles before running udev.
This is the same order as systemd would run them.
2014-11-20 13:04:45 +00:00
Pino Toscano
643162a61a appliance: explicitly add libyajl2 on openSUSE
While it has always been needed, it has been implicitly pulled in by
some other package. Hence, make it sure to always have it.
2014-11-14 18:04:12 +01:00
Pino Toscano
75b45143f0 appliance: remove few duplicates from Mageia's list 2014-10-10 15:09:27 +02:00
Pino Toscano
8f3a2ca535 appliance: add dhcp-client on Mageia
dhcp-client replaces the non-existing dhclient.
2014-10-09 14:53:53 +02:00
Pino Toscano
979e7a4914 appliance: add dhcpcd and gptfdisk on Archlinux
dhcpcd replaces the non-existing dhclient.
2014-10-09 14:53:10 +02:00
Richard W.M. Jones
07c0926b58 appliance: Change example ping lines to ping 8.8.8.8.
This are commented out (still) so this change does nothing.
2014-10-02 15:31:50 +01:00
Richard W.M. Jones
67e6f32a24 appliance: Use dhclient or dhcpcd instead of hard-coding IP address of appliance.
qemu in SLIRP mode offers DHCP services to the appliance.  We don't
use them, but use a fixed IP address intead.  This changes the
appliance to get its IP address using DHCP.

Note: This is only used when the network is enabled.  dhclient is
somewhat slower, but the penalty (a few seconds) is only paid for
network users.

On SuSE or other distros, dhcpcd could be used if available.
2014-10-02 15:31:49 +01:00
Hilko Bengen
a36dde9889 appliance: Add libsystemd0 (and systemd as an alternative for sysvinit) on Debian-based systems 2014-09-19 20:52:43 +02:00
Pino Toscano
7d9db86cab appliance: move e2fsprogs as common for all distros
All distro-specific sections have it, so just make it really common.
2014-09-19 13:33:21 +02:00
Pino Toscano
70768239fd appliance: remove duplicate packages in OpenSUSE, Frugalware, Mageia
From some lists of distro-specific packages, remove the ones that
appear already in the common list.
2014-09-19 13:26:37 +02:00