Instead of doing all firstboot actions in a single script, take the advantage of the firstboot infrastructure and store and run unrelated actions as individual steps. This facilitates troubleshooting and fault recovery; besides it makes adding more actions easier. Signed-off-by: Roman Kagan <firstname.lastname@example.org>
The firstboot infrastructure used to give the firstboot scripts some cryptic names which were impossible to relate to the actions they were supposed to take. This patch reworks the scheme such that the caller registering a firstboot script has to provide a descriptive name for the action. That name, with non-alphanumeric characters replaced with dashes, prefixed by the serial number, is then used as the name of the script, e.g. 0004-install-gcc or 0002-msiexec--i-foo-msi.bat OTOH the numbering becomes internal to the API, i.e. the scripts are numbered and executed in the order they are registered. This greatly facilitates debugging and troubleshooting in case when there are multiple firstboot scripts. Signed-off-by: Roman Kagan <email@example.com>
This patch is an attempt to enhance the firstboot driver script for Windows, and make it somewhat closer in functionality to what is done for Linux guests. Specifically, for every firstboot script it now will log its exit status, and, if the script reported success, move it to -done directory. Signed-off-by: Roman Kagan <firstname.lastname@example.org>
This patch moves line ending conversion for windows scripts into a separate helper function. This simplifies code a bit, and fixes the problem that actual firstboot scripts used to remain with unix-style line endings. Signed-off-by: Roman Kagan <email@example.com>
Make sure that -x enables tracing and -v enables verbose mode, just like other tools do. Kind of followup of commit b6b9b90.
This is at the request of the Fedora localization team. For further information see: https://www.redhat.com/archives/libguestfs/2015-February/msg00168.html
…237) When the user chooses to not verify the signatures on the indexes (using --no-check-signature), there is no point in requiring as many --fingerprint as --source (or even just one), as they will not be used anyway. In this case just ignore all the values of the specified --fingerprint arguments.
This fixes commit 5809a5a.
Ensure the arch string is sane before using it in the following XPath expression. Since the arch string can be derived from untrusted guest data [see src/filearch.c], this prevents a possible XPath injection vulnerability.
…ngs. We also need to be more careful about PyString_FromString and similar functions returning NULL on failure. Currently we don't check this every time. This commit adds more checks, but is still not complete.
libguestfs has used double and triple underscores in identifiers. These aren't valid for global names in C++. The second step is to replace all guestfs__* (2 underscores) with guestfs_impl_*. These functions are used where a libguestfs API call is implemented on the library side. The generator creates a wrapper function which calls guestfs_impl_* to do the work. (Libguestfs APIs which are passed directly by the daemon work differently and don't require a guestfs_impl_* function). This is an entirely mechanical change done using: git ls-files | xargs perl -pi.bak -e 's/guestfs___/guestfs_impl_/g' Reference: http://stackoverflow.com/a/228797
libguestfs has used double and triple underscores in identifiers. These aren't valid for global names in C++. The first step is to replace all guestfs___* (3 underscores) with guestfs_int_*. We've used guestfs_int_* elsewhere already as a prefix for internal identifiers. This is an entirely mechanical change done using: git ls-files | xargs perl -pi.bak -e 's/guestfs___/guestfs_int_/g' Reference: http://stackoverflow.com/a/228797
* fusermount is Linux-only; on BSD and OS X umount should be used * fuser has no -v flag on BSD/OSX, and -c is the POSIX-compatible equivalent of -m * Does not solve the lack of pretty output of fuser -v, but does make it work on Mac OS X.
The wrong partition was being expanded. This fixes commit 5809a5a.
This fixes commit 56732ed.
Add a bash function 'prepend' for intelligently prepending elements to paths. eg: prepend PYTHONPATH "/foo" would set PYTHONPATH to "/foo" or "/foo:<previous-contents-of-PYTHONPATH>" Tested by: (1) Building and testing libguestfs twice: first without libguestfs installed as a system library, and then with it installed. (2) Examining the output of './run printenv' by hand and comparing environment variables to the expected values.
Mac OS X includes crypt() in libc.
Mac OS X uses DYLD_LIBRARY_PATH rather than LD_LIBRARY_PATH.