summaryrefslogtreecommitdiffstats
path: root/bootstrap
Commit message (Collapse)AuthorAgeFilesLines
* Remove ocaml/.depend from git.Matthew Booth2010-10-281-0/+4
| | | | ocaml/.depend is automatically generated. This patch removes it from git.
* po: Don't generate po/Makevars file and include Perl keywords (RHBZ#559963).Richard Jones2010-05-121-13/+0
| | | | | | | | | I don't see a reason to autogenerate po/Makevars, and in the earlier commit which changed this file to being autogenerated we accidentally lost the special Perl keywords, copyright notice and bug reporting address. Fix all of that. This partially reverts commit febff9d2a35c4f40abbaf8943146476bdeac671e.
* Mac OS X: Use gnulib setenv module explicitly.Richard Jones2010-03-221-0/+1
| | | | | See: https://www.redhat.com/archives/libguestfs/2010-March/thread.html#00094
* Rewrite libguestfs-supermin-helper in C.Richard Jones2010-03-121-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | libguestfs-supermin-helper was previously a shell script. Although we had steadily optimized it, there were a number of intractable hot spots: (1) cpio still reads input files in 512 byte chunks; this is *very* pessimal behaviour, particularly when SELinux is enabled. (2) the hostfiles globbing was done very inefficiently by the shell, with the shell rereading the same directory over and over again. This is a rewrite of this shell script in C. It is approximately 3 times faster without SELinux, and has an even greater speed difference with SELinux. The main features are: (a) It never frees memory, making it simpler. The program is designed to run and exit in sub-second times, so this is acceptable. (b) It caches directory reads, making the globbing of host files much faster (measured this as ~ 4 x speed up). (c) It doesn't use external cpio, but instead contains code to write newc format cpio files, which is all that the kernel can read. Unlike cpio, this code uses large buffers for reads and writes. (d) Ignores missing or unreadable hostfiles, whereas cpio gave a warning. (e) Checks all return values from system calls. (f) With --verbose flag, it will print messages timing itself. This passes all tests. Updated with feedback from Jim Meyering.
* hivex: Add HIVEX_OPEN_WRITE flag to allow hive to be opened for writing.Richard Jones2010-02-041-0/+1
| | | | | | | | | | | | | | | If this flag is omitted (as in the case for all existing callers) then the hive is still opened read-only. We add a 'writable' flag to the hive handle, and we change the way that the hive file (data) is stored. The data is still mmapped if the file is opened read-only, since that is more efficient and allows us to handle larger hives. However if we need to write to the file then we have to read it all into memory, since if we had to extend the file we need to realloc that data. Note the manpage section L</WRITING TO HIVE FILES> comes in a later commit.
* guestfish: Use xstrtol to parse integers (RHBZ#557655).Richard Jones2010-01-251-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Current code uses atoi to parse the generator Int type and atoll to parse the generator Int64 type. The problem with the ato* functions is that they don't cope with errors very well, and they cannot parse numbers that begin with 0.. or 0x.. for octal and hexadecimal respectively. This replaces the atoi call with a call to Gnulib xstrtol and the atoll call with a call to Gnulib xstrtoll. The generated code looks like this for all Int arguments: { strtol_error xerr; long r; xerr = xstrtol (argv[0], NULL, 0, &r, ""); if (xerr != LONGINT_OK) { fprintf (stderr, _("%s: %s: invalid integer parameter (%s returned %d)\n"), cmd, "memsize", "xstrtol", xerr); return -1; } /* The Int type in the generator is a signed 31 bit int. */ if (r < (-(2LL<<30)) || r > ((2LL<<30)-1)) { fprintf (stderr, _("%s: %s: integer out of range\n"), cmd, "memsize"); return -1; } /* The check above should ensure this assignment does not overflow. */ memsize = r; } and like this for all Int64 arguments (note we don't need the range check for these): { strtol_error xerr; long long r; xerr = xstrtoll (argv[1], NULL, 0, &r, ""); if (xerr != LONGINT_OK) { fprintf (stderr, _("%s: %s: invalid integer parameter (%s returned %d)\n"), cmd, "size", "xstrtoll", xerr); return -1; } size = r; } Note this also fixes an unrelated bug in guestfish handling of RBufferOut. We were using 'fwrite' without checking the return value, and this could have caused silent failures, eg. in the case where there was not enough disk space to store the resulting file, or even if the program was interrupted (but continued) during the write. Replace this with Gnulib 'full-write', and check the return value and report errors.
* lib: Add thread-safety to global list of handles.Richard Jones2009-12-071-0/+1
| | | | | | | | | | | | | | | | This commit uses the Gnulib 'lock' module to implement a mutex on the global list of handles which is stored by the library. Note that Gnulib nicely avoids explicitly linking with -lpthread unless the application program itself links to -lpthread. Locks are only enabled in multithreaded applications. $ ldd src/.libs/libguestfs.so.0.217.0 linux-vdso.so.1 => (0x00007fffcb7ff000) libc.so.6 => /lib64/libc.so.6 (0x00007f96a4e6c000) /lib64/ld-linux-x86-64.so.2 (0x00007f96a544d000) Please enter the commit message for your changes. Lines starting
* FUSE filesystem support.Richard Jones2009-11-031-0/+2
| | | | | | | | | | | | | | | This implements FUSE filesystem support so that any libguestfs- accessible disk image can be mounted as a local filesystem. Note: file writes (ie. write(2) system call) is not yet implemented. The API needs more test coverage, particularly lesser-used system calls. The big unresolved issue is UID/GID mapping between guest filesystem IDs and the host. It's not easy to automate this because you need extra details about the guest itself in order to get to its UID->username map (eg. /etc/passwd from the guest).
* avoid use of all ctype macrosJim Meyering2009-09-241-0/+1
| | | | | | | | | | | | | | | | | | | | * cfg.mk (disable_temporarily): Don't disable sc_avoid_ctype_macros. * fish/tilde.c: Remove unnecessary inclusion of ctype.h. * bootstrap: Add gnulib's c-ctype module to the list. * daemon/m4/gnulib-cache.m4: Likewise. * daemon/ext2.c: Include "c-ctype.h", not <ctype.h>. Use c_isspace, etc, rather than isspace. * daemon/guestfsd.c: Likewise. * daemon/lvm.c: Likewise. * daemon/proto.c: Likewise. * fish/fish.c: Likewise. * fish/tilde.c: Likewise. * src/generator.ml: Likewise. * src/guestfs.c: Likewise. * examples/to-xml.c: Likewise. * examples/Makefile.am (to_xml_CPPFLAGS): Add -I$(top_srcdir)/gnulib/lib so inclusion of "c-ctype.h" works. (to_xml_CPPFLAGS): Rename from to_xml_CFLAGS.
* Gnulib: Add arpa-inet and netinet-in modules.Richard Jones2009-09-221-0/+2
|
* avoid build-from-scratch failure due to missing daemon/configureJim Meyering2009-09-041-2/+1
| | | | | | * bootstrap: Don't use autoreconf's --norecursive option. We require the default --recursive behavior in order to create daemon/configure. Reported by Matthew Booth.
* build: use only one m4/ directoryJim Meyering2009-08-251-1/+5
| | | | | | | | | * Makefile.am (ACLOCAL_AMFLAGS): Specify only one include dir: m4. * bootstrap: Tell gnulib-tool to put .m4 files in m4/, not gnulib/m4. * autogen.sh: Move autoreconf from here into... * bootstrap: ...here, so that it is run only when gnulib-tool is. Also, tell it to skip the usual autopoint and libtoolize runs. * m4/.gitignore: Update.
* build: invoke autopoint with --forceJim Meyering2009-08-251-2/+8
| | | | | | | | * bootstrap: Invoke autopoint with --force, to avoid warning about existing build-aux/config.rpath. Invoke libtoolize before gnulib-tool, to avoid spurious warnings. * autogen.sh: Add comments. Remove build-aux/config.rpath before running autoreconf.
* build: don't define _GNU_SOURCE manuallyJim Meyering2009-08-241-1/+6
| | | | | | | | | | | | Now that we're using gnulib in earnest, any manual definition would provoke a redefinition warning. * fish/fish.c (_GNU_SOURCE): Don't define. * fish/destpaths.c (_GNU_SOURCE): Likewise. * src/guestfs.c (_GNU_SOURCE): Likewise. * bootstrap (modules): Add asprintf, strchrnul, strerror, strndup and vasprintf. * fish/fish.c (main): Set argv[0] to sanitized program_name, so functions like getopt_long that use argv[0] use the clean name.
* guestfish: diagnose stdout write failureJim Meyering2009-08-241-0/+1
| | | | | | | | Use gnulib's closeout module to ensure any failure to write to stdout is detected and reported. * fish/fish.c: Include "closeout.h". (main): Call atexit (close_stdout); * bootstrap (modules): Add closeout.
* guestfish: write --help to stdout, use gnulib's progname moduleJim Meyering2009-08-241-0/+1
| | | | | | | | | | * fish/fish.c: Include "progname.h". (main): Call set_program_name to initialize. Don't hard-code guestfish everywhere. Use program_name. However, be careful when modifying argv[0], since it is used in the hopes that it is an absolute file name. (usage): Don't spew all of --help for a mis-typed option. Split long lines.
* build: suppress an ignored-write-return-value warningJim Meyering2009-08-181-0/+1
| | | | | | | | | * bootstrap (modules): Add ignore-value. * src/guestfs.c: Include "ignore-value.h". (stdout_event): Ignore failure to write to stderr. Also, prefer STDERR_FILENO over the literal "2". * src/Makefile.am (libguestfs_la_CPPFLAGS): Include gnulib's .h files. (libprotocol_la_CFLAGS): Remove -Wall -Wno-unused.
* build: avoid first-time configure-from-clone failureJim Meyering2009-08-101-0/+3
| | | | | | * bootstrap: Run autopoint before using the file it creates, po/Makevars.template. Reported by Richard Jones. Details here: https://www.redhat.com/archives/libguestfs/2009-August/msg00135.html
* build: remove bootstrap's --gnulib-srcdir optionJim Meyering2009-08-061-39/+5
| | | | | | | ...because it probably didn't work, and even if it did, we've discovered that using a separate git repo like that can lead to subtle mix-ups. Also, fix invocation of gnulib-tool in daemon/.
* build: fix build failureJim Meyering2009-08-061-1/+1
| | | | | * bootstrap (gnulib_tool): Create lib and tests directories under daemon/ before running gnulib-tool there.
* daemon: use gnulibJim Meyering2009-08-061-0/+2
| | | | | | | | | | | | | | | | | * daemon/Makefile.am (SUBDIRS): Define. (AM_CPPFLAGS): Define, to include from gnulib's lib/ (LDADD): Define, to link with gnulib's libgnu.a. * daemon/configure.ac: Use AC_CONFIG_AUX_DIR([build-aux]), gl_EARLY and gl_INIT. (AC_CONFIG_FILES): Add lib/Makefile and tests/Makefile * daemon/m4/gnulib-cache.m4: New file, generated by running ../.gnulib/gnulib-tool --import --with-tests hash * daemon/.gitignore: Ignore all of the imported files. build: tell bootstrap about daemon/ * bootstrap: Run gnulib-tool --update in daemon/. Remove bootstrap's --gnulib-srcdir option, because it probably didn't work, and even if it did, we've discovered that using a separate git repo like that can lead to subtle mix-ups.
* build: generate some just-removed files in po/Jim Meyering2009-08-051-0/+15
| | | | * bootstrap: Generate po/Makevars and po/LINGUAS.
* Convert all TABs-as-indentation to spaces.Jim Meyering2009-08-031-1/+1
| | | | | | | | | | | Do it by running this command: [exempted files are matched via .x-sc_TAB_in_indentation] git ls-files \ | pcregrep -vf .x-sc_TAB_in_indentation \ | xargs pcregrep -l '^ *\t' \ | xargs perl -MText::Tabs -ni -le \ '$m=/^( *\t[ \t]*)(.*)/; print $m ? expand($1) . $2 : $_'
* maint: use a git submodule for gnulibJim Meyering2009-08-031-0/+82
* .gitmodules: New file, to track gnulib. * .gnulib: Submodule directory. * Makefile.am (EXTRA_DIST): Don't list config.rpath or gitlog-to-changelog. * autogen.sh: Adapt to use the new submodule. * cfg.mk: New file. (SUBDIRS): Add gnulib/lib and gnulib/tests. (dist-hook): Reflect new location of getlog-to-changelog. * configure.ac: Set build-aux/ as AUX_DIR. Invoke gl_EARLY and gl_INIT. (AC_CONFIG_FILES): Add gnulib/lib/Makefile and gnulib/tests/Makefile.