diff --git a/0001-RHEL-5-tests-Use-gnulib.patch b/0001-RHEL-5-tests-Use-gnulib.patch deleted file mode 100644 index 8e62061..0000000 --- a/0001-RHEL-5-tests-Use-gnulib.patch +++ /dev/null @@ -1,66 +0,0 @@ -From d75fb430169050f781d1772b88495d398022c6b2 Mon Sep 17 00:00:00 2001 -From: Richard W.M. Jones -Date: Sun, 10 Mar 2013 20:08:06 +0000 -Subject: [PATCH] RHEL 5: tests: Use gnulib. - -Gnulib defines O_CLOEXEC which is missing on RHEL 5. ---- - tests/c-api/Makefile.am | 13 ++++++++++--- - 1 files changed, 10 insertions(+), 3 deletions(-) - -diff --git a/tests/c-api/Makefile.am b/tests/c-api/Makefile.am -index fe2c05d..5eb33b8 100644 ---- a/tests/c-api/Makefile.am -+++ b/tests/c-api/Makefile.am -@@ -70,11 +70,14 @@ TESTS_ENVIRONMENT = \ - tests_SOURCES = tests.c - tests_CPPFLAGS = \ - -DGUESTFS_PRIVATE=1 \ -+ -I$(top_srcdir)/gnulib/lib -I$(top_builddir)/gnulib/lib \ - -I$(top_srcdir)/src -I$(top_builddir)/src - tests_CFLAGS = \ - $(WARN_CFLAGS) $(WERROR_CFLAGS) \ - $(GPROF_CFLAGS) $(GCOV_CFLAGS) --tests_LDADD = $(top_builddir)/src/libguestfs.la -+tests_LDADD = \ -+ $(top_builddir)/src/libguestfs.la \ -+ $(top_builddir)/gnulib/lib/libgnu.la - - # This binary must be statically linked. It is used for testing - # the "guestfs_command" and "guestfs_command_lines" functions. -@@ -133,12 +136,14 @@ test_add_drive_opts_LDADD = \ - - test_last_errno_SOURCES = test-last-errno.c - test_last_errno_CPPFLAGS = \ -+ -I$(top_srcdir)/gnulib/lib -I$(top_builddir)/gnulib/lib \ - -I$(top_srcdir)/src -I$(top_builddir)/src - test_last_errno_CFLAGS = \ - $(WARN_CFLAGS) $(WERROR_CFLAGS) \ - $(GPROF_CFLAGS) $(GCOV_CFLAGS) - test_last_errno_LDADD = \ -- $(top_builddir)/src/libguestfs.la -+ $(top_builddir)/src/libguestfs.la \ -+ $(top_builddir)/gnulib/lib/libgnu.la - - test_private_data_SOURCES = test-private-data.c - test_private_data_CPPFLAGS = \ -@@ -151,13 +156,15 @@ test_private_data_LDADD = \ - - test_user_cancel_SOURCES = test-user-cancel.c - test_user_cancel_CPPFLAGS = \ -+ -I$(top_srcdir)/gnulib/lib -I$(top_builddir)/gnulib/lib \ - -I$(top_srcdir)/src -I$(top_builddir)/src - test_user_cancel_CFLAGS = \ - -pthread \ - $(WARN_CFLAGS) $(WERROR_CFLAGS) \ - $(GPROF_CFLAGS) $(GCOV_CFLAGS) - test_user_cancel_LDADD = \ -- $(top_builddir)/src/libguestfs.la -lm -+ $(top_builddir)/src/libguestfs.la -lm \ -+ $(top_builddir)/gnulib/lib/libgnu.la - - test_debug_to_file_SOURCES = test-debug-to-file.c - test_debug_to_file_CPPFLAGS = \ --- -1.7.4.1 - diff --git a/0001-gnulib-Use-module-mkstemps-for-RHEL-5-glibc-which-la.patch b/0001-gnulib-Use-module-mkstemps-for-RHEL-5-glibc-which-la.patch index 01e7213..f762a9a 100644 --- a/0001-gnulib-Use-module-mkstemps-for-RHEL-5-glibc-which-la.patch +++ b/0001-gnulib-Use-module-mkstemps-for-RHEL-5-glibc-which-la.patch @@ -1,7 +1,7 @@ From 5706aaf0542fb67ba9398076f2531911bdd95dd3 Mon Sep 17 00:00:00 2001 From: Richard W.M. Jones Date: Sat, 9 Mar 2013 18:36:09 +0000 -Subject: [PATCH 01/36] gnulib: Use module mkstemps for RHEL 5 glibc which lacked this function. +Subject: [PATCH 01/37] gnulib: Use module mkstemps for RHEL 5 glibc which lacked this function. --- bootstrap | 1 + diff --git a/0002-RHEL-5-inspect-Add-macro-for-be32toh-if-one-is-not-d.patch b/0002-RHEL-5-inspect-Add-macro-for-be32toh-if-one-is-not-d.patch index 90131ba..42de648 100644 --- a/0002-RHEL-5-inspect-Add-macro-for-be32toh-if-one-is-not-d.patch +++ b/0002-RHEL-5-inspect-Add-macro-for-be32toh-if-one-is-not-d.patch @@ -1,7 +1,7 @@ From 1fe7310e8564915508158f68e9d2f3187f7bdfbe Mon Sep 17 00:00:00 2001 From: Richard W.M. Jones Date: Fri, 8 Mar 2013 20:16:04 +0000 -Subject: [PATCH 02/36] RHEL 5: inspect: Add macro for be32toh if one is not defined in the header files. +Subject: [PATCH 02/37] RHEL 5: inspect: Add macro for be32toh if one is not defined in the header files. --- configure.ac | 1 + diff --git a/0003-Move-Ruby-related-checks-from-autoconf-to-extconf.rb.patch b/0003-Move-Ruby-related-checks-from-autoconf-to-extconf.rb.patch index 9d35657..9281483 100644 --- a/0003-Move-Ruby-related-checks-from-autoconf-to-extconf.rb.patch +++ b/0003-Move-Ruby-related-checks-from-autoconf-to-extconf.rb.patch @@ -1,7 +1,7 @@ From d736ed25f446fdf5544b36f5139c69b2cbce961b Mon Sep 17 00:00:00 2001 From: Hilko Bengen Date: Thu, 7 Mar 2013 19:59:26 +0100 -Subject: [PATCH 03/36] Move Ruby-related checks from autoconf to extconf.rb; add extra check for rb_alloc_func_t +Subject: [PATCH 03/37] Move Ruby-related checks from autoconf to extconf.rb; add extra check for rb_alloc_func_t Ruby ships its own config.h which may or may not define the same relevant constants as our autoconf-generated config.h. Instead of diff --git a/0004-EPEL-5-Remove-checks-which-fail-with-ancient-qemu.patch b/0004-EPEL-5-Remove-checks-which-fail-with-ancient-qemu.patch deleted file mode 100644 index 6b45790..0000000 --- a/0004-EPEL-5-Remove-checks-which-fail-with-ancient-qemu.patch +++ /dev/null @@ -1,120 +0,0 @@ -From b1c9301708b4e4d456ef45ccb2afbd22f38d0584 Mon Sep 17 00:00:00 2001 -From: Richard W.M. Jones -Date: Sat, 16 Jun 2012 10:19:39 +0100 -Subject: [PATCH 04/36] EPEL 5: Remove checks which fail with ancient qemu. - -Note that g->app.qemu_version and g->app.qemu_devices will both -be empty strings. ---- - configure.ac | 57 ------------------------------------------------ - src/launch-appliance.c | 23 +----------------- - 2 files changed, 2 insertions(+), 78 deletions(-) - -diff --git a/configure.ac b/configure.ac -index 897e303..c1388ff 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -677,63 +677,6 @@ This could be a very old version of qemu, or qemu might not be - working. - ]) - fi -- -- AC_MSG_CHECKING([that $QEMU -version works]) -- if $QEMU -version >&AS_MESSAGE_LOG_FD 2>&1; then -- AC_MSG_RESULT([yes]) -- else -- AC_MSG_RESULT([no]) -- AC_MSG_FAILURE( --[$QEMU -version: command failed. -- --This could be a very old version of qemu, or qemu might not be --working. --]) -- fi -- -- AC_MSG_CHECKING([for $QEMU version >= 1]) -- if $QEMU -version | grep -sq 'version @<:@1-@:>@'; then -- AC_MSG_RESULT([yes]) -- else -- AC_MSG_RESULT([no]) -- AC_MSG_FAILURE([$QEMU version must be >= 1.0.]) -- fi -- -- AC_MSG_CHECKING([that $QEMU -nographic -machine accel=kvm:tcg -device ? works]) -- if $QEMU -nographic -machine accel=kvm:tcg -device \? >&AS_MESSAGE_LOG_FD 2>&1; then -- AC_MSG_RESULT([yes]) -- else -- AC_MSG_RESULT([no]) -- AC_MSG_FAILURE([$QEMU -nographic -machine accel=kvm:tcg -device ? doesn't work.]) -- fi -- -- AC_MSG_CHECKING([for virtio-serial support in $QEMU]) -- if $QEMU $QEMU_OPTIONS -nographic -machine accel=kvm:tcg -device \? 2>&1 | grep -sq virtio-serial; then -- AC_MSG_RESULT([yes]) -- else -- AC_MSG_RESULT([no]) -- AC_MSG_FAILURE( --[I did not find virtio-serial support in --$QEMU. -- --virtio-serial support in qemu or KVM is essential for libguestfs --to operate. -- --Usually this means that you have to install a newer version of qemu --and/or KVM. Please read the relevant section in the README file for --more information about this. -- --You can override this test by setting the environment variable --vmchannel_test=no -- --However if you don't have the right support in your qemu, then this --just delays the pain. -- --If I am using the wrong qemu or you want to compile qemu from source --and install it in another location, then you should configure with --the --with-qemu option. --]) -- fi - fi - - dnl Enable packet dumps when in verbose mode. This generates lots -diff --git a/src/launch-appliance.c b/src/launch-appliance.c -index a86a8cc..10f63f1 100644 ---- a/src/launch-appliance.c -+++ b/src/launch-appliance.c -@@ -767,30 +767,11 @@ test_qemu (guestfs_h *g) - if (r == -1 || !WIFEXITED (r) || WEXITSTATUS (r) != 0) - goto error; - -- guestfs___cmd_add_arg (cmd2, g->qemu); -- guestfs___cmd_add_arg (cmd2, "-nographic"); -- guestfs___cmd_add_arg (cmd2, "-version"); -- guestfs___cmd_set_stdout_callback (cmd2, read_all, &g->app.qemu_version, -- CMD_STDOUT_FLAG_WHOLE_BUFFER); -- r = guestfs___cmd_run (cmd2); -- if (r == -1 || !WIFEXITED (r) || WEXITSTATUS (r) != 0) -- goto error; -+ g->app.qemu_version = safe_strdup (g, ""); - - parse_qemu_version (g); - -- guestfs___cmd_add_arg (cmd3, g->qemu); -- guestfs___cmd_add_arg (cmd3, "-nographic"); -- guestfs___cmd_add_arg (cmd3, "-machine"); -- guestfs___cmd_add_arg (cmd3, "accel=kvm:tcg"); -- guestfs___cmd_add_arg (cmd3, "-device"); -- guestfs___cmd_add_arg (cmd3, "?"); -- guestfs___cmd_clear_capture_errors (cmd3); -- guestfs___cmd_set_stderr_to_stdout (cmd3); -- guestfs___cmd_set_stdout_callback (cmd3, read_all, &g->app.qemu_devices, -- CMD_STDOUT_FLAG_WHOLE_BUFFER); -- r = guestfs___cmd_run (cmd3); -- if (r == -1 || !WIFEXITED (r) || WEXITSTATUS (r) != 0) -- goto error; -+ g->app.qemu_devices = safe_strdup (g, ""); - - return 0; - --- -1.7.4.1 - diff --git a/0004-RHEL-5-tests-Use-gnulib.patch b/0004-RHEL-5-tests-Use-gnulib.patch new file mode 100644 index 0000000..fd9a164 --- /dev/null +++ b/0004-RHEL-5-tests-Use-gnulib.patch @@ -0,0 +1,66 @@ +From e3dea245858bb856930815ad52c9b2485bd60ab7 Mon Sep 17 00:00:00 2001 +From: Richard W.M. Jones +Date: Sun, 10 Mar 2013 20:08:06 +0000 +Subject: [PATCH 04/37] RHEL 5: tests: Use gnulib. + +Gnulib defines O_CLOEXEC which is missing on RHEL 5. +--- + tests/c-api/Makefile.am | 13 ++++++++++--- + 1 files changed, 10 insertions(+), 3 deletions(-) + +diff --git a/tests/c-api/Makefile.am b/tests/c-api/Makefile.am +index fe2c05d..5eb33b8 100644 +--- a/tests/c-api/Makefile.am ++++ b/tests/c-api/Makefile.am +@@ -70,11 +70,14 @@ TESTS_ENVIRONMENT = \ + tests_SOURCES = tests.c + tests_CPPFLAGS = \ + -DGUESTFS_PRIVATE=1 \ ++ -I$(top_srcdir)/gnulib/lib -I$(top_builddir)/gnulib/lib \ + -I$(top_srcdir)/src -I$(top_builddir)/src + tests_CFLAGS = \ + $(WARN_CFLAGS) $(WERROR_CFLAGS) \ + $(GPROF_CFLAGS) $(GCOV_CFLAGS) +-tests_LDADD = $(top_builddir)/src/libguestfs.la ++tests_LDADD = \ ++ $(top_builddir)/src/libguestfs.la \ ++ $(top_builddir)/gnulib/lib/libgnu.la + + # This binary must be statically linked. It is used for testing + # the "guestfs_command" and "guestfs_command_lines" functions. +@@ -133,12 +136,14 @@ test_add_drive_opts_LDADD = \ + + test_last_errno_SOURCES = test-last-errno.c + test_last_errno_CPPFLAGS = \ ++ -I$(top_srcdir)/gnulib/lib -I$(top_builddir)/gnulib/lib \ + -I$(top_srcdir)/src -I$(top_builddir)/src + test_last_errno_CFLAGS = \ + $(WARN_CFLAGS) $(WERROR_CFLAGS) \ + $(GPROF_CFLAGS) $(GCOV_CFLAGS) + test_last_errno_LDADD = \ +- $(top_builddir)/src/libguestfs.la ++ $(top_builddir)/src/libguestfs.la \ ++ $(top_builddir)/gnulib/lib/libgnu.la + + test_private_data_SOURCES = test-private-data.c + test_private_data_CPPFLAGS = \ +@@ -151,13 +156,15 @@ test_private_data_LDADD = \ + + test_user_cancel_SOURCES = test-user-cancel.c + test_user_cancel_CPPFLAGS = \ ++ -I$(top_srcdir)/gnulib/lib -I$(top_builddir)/gnulib/lib \ + -I$(top_srcdir)/src -I$(top_builddir)/src + test_user_cancel_CFLAGS = \ + -pthread \ + $(WARN_CFLAGS) $(WERROR_CFLAGS) \ + $(GPROF_CFLAGS) $(GCOV_CFLAGS) + test_user_cancel_LDADD = \ +- $(top_builddir)/src/libguestfs.la -lm ++ $(top_builddir)/src/libguestfs.la -lm \ ++ $(top_builddir)/gnulib/lib/libgnu.la + + test_debug_to_file_SOURCES = test-debug-to-file.c + test_debug_to_file_CPPFLAGS = \ +-- +1.7.4.1 + diff --git a/0005-EPEL-5-Remove-AS_ECHO_N-for-ancient-autoconf.patch b/0005-EPEL-5-Remove-AS_ECHO_N-for-ancient-autoconf.patch deleted file mode 100644 index dab321b..0000000 --- a/0005-EPEL-5-Remove-AS_ECHO_N-for-ancient-autoconf.patch +++ /dev/null @@ -1,64 +0,0 @@ -From bb3f18070e589c6be3e6a8d9e20cbf88cf9a8cdb Mon Sep 17 00:00:00 2001 -From: Richard W.M. Jones -Date: Sat, 16 Jun 2012 10:23:19 +0100 -Subject: [PATCH 05/36] EPEL 5: Remove AS_ECHO_N for ancient autoconf. - ---- - configure.ac | 28 ++++++++++++++-------------- - 1 files changed, 14 insertions(+), 14 deletions(-) - -diff --git a/configure.ac b/configure.ac -index c1388ff..38998ee 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -1525,33 +1525,33 @@ echo "Appliance ........................... $enable_appliance" - echo "QEMU ................................ $QEMU $QEMU_OPTIONS" - echo "guestfish and C-based virt tools .... yes" - echo "FUSE filesystem ..................... $enable_fuse" --AS_ECHO_N(["GNU gettext for i18n ................ "]) -+echo -n "GNU gettext for i18n ................ " - if test "x$HAVE_GNU_GETTEXT_TRUE" = "x"; then echo "yes"; else echo "no"; fi --AS_ECHO_N(["OCaml bindings ...................... "]) -+echo -n "OCaml bindings ...................... " - if test "x$HAVE_OCAML_TRUE" = "x"; then echo "yes"; else echo "no"; fi --AS_ECHO_N(["OCaml-based virt tools .............. "]) -+echo -n "OCaml-based virt tools .............. " - if test "x$HAVE_OCAML_TRUE" = "x"; then echo "yes"; else echo "no"; fi --AS_ECHO_N(["Perl bindings ....................... "]) -+echo -n "Perl bindings ....................... " - if test "x$HAVE_PERL_TRUE" = "x"; then echo "yes"; else echo "no"; fi --AS_ECHO_N(["Perl-based virt tools ............... "]) -+echo -n "Perl-based virt tools ............... " - if test "x$HAVE_TOOLS_TRUE" = "x"; then echo "yes"; else echo "no"; fi --AS_ECHO_N(["Python bindings ..................... "]) -+echo -n "Python bindings ..................... " - if test "x$HAVE_PYTHON_TRUE" = "x"; then echo "yes"; else echo "no"; fi --AS_ECHO_N(["Ruby bindings ....................... "]) -+echo -n "Ruby bindings ....................... " - if test "x$HAVE_RUBY_TRUE" = "x"; then echo "yes"; else echo "no"; fi --AS_ECHO_N(["Java bindings ....................... "]) -+echo -n "Java bindings ....................... " - if test "x$HAVE_JAVA_TRUE" = "x"; then echo "yes"; else echo "no"; fi --AS_ECHO_N(["Haskell bindings .................... "]) -+echo -n "Haskell bindings .................... " - if test "x$HAVE_HASKELL_TRUE" = "x"; then echo "yes"; else echo "no"; fi --AS_ECHO_N(["PHP bindings ........................ "]) -+echo -n "PHP bindings ........................ " - if test "x$HAVE_PHP_TRUE" = "x"; then echo "yes"; else echo "no"; fi --AS_ECHO_N(["Erlang bindings ..................... "]) -+echo -n "Erlang bindings ..................... " - if test "x$HAVE_ERLANG_TRUE" = "x"; then echo "yes"; else echo "no"; fi --AS_ECHO_N(["Lua bindings ........................ "]) -+echo -n "Lua bindings ........................ " - if test "x$HAVE_LUA_TRUE" = "x"; then echo "yes"; else echo "no"; fi --AS_ECHO_N(["gobject bindings .................... "]) -+echo -n "gobject bindings .................... " - if test "x$HAVE_GOBJECT_TRUE" = "x"; then echo "yes"; else echo "no"; fi --AS_ECHO_N(["gobject introspection ............... "]) -+echo -n "gobject introspection ............... " - if test "x$HAVE_INTROSPECTION_TRUE" = "x"; then echo "yes"; else echo "no"; fi - echo - echo "If any optional component is configured 'no' when you expected 'yes'" --- -1.7.4.1 - diff --git a/0005-EPEL-5-Remove-checks-which-fail-with-ancient-qemu.patch b/0005-EPEL-5-Remove-checks-which-fail-with-ancient-qemu.patch new file mode 100644 index 0000000..e5232bc --- /dev/null +++ b/0005-EPEL-5-Remove-checks-which-fail-with-ancient-qemu.patch @@ -0,0 +1,120 @@ +From eab32a7781af5012b11face2eb675bebc65a5b41 Mon Sep 17 00:00:00 2001 +From: Richard W.M. Jones +Date: Sat, 16 Jun 2012 10:19:39 +0100 +Subject: [PATCH 05/37] EPEL 5: Remove checks which fail with ancient qemu. + +Note that g->app.qemu_version and g->app.qemu_devices will both +be empty strings. +--- + configure.ac | 57 ------------------------------------------------ + src/launch-appliance.c | 23 +----------------- + 2 files changed, 2 insertions(+), 78 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 897e303..c1388ff 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -677,63 +677,6 @@ This could be a very old version of qemu, or qemu might not be + working. + ]) + fi +- +- AC_MSG_CHECKING([that $QEMU -version works]) +- if $QEMU -version >&AS_MESSAGE_LOG_FD 2>&1; then +- AC_MSG_RESULT([yes]) +- else +- AC_MSG_RESULT([no]) +- AC_MSG_FAILURE( +-[$QEMU -version: command failed. +- +-This could be a very old version of qemu, or qemu might not be +-working. +-]) +- fi +- +- AC_MSG_CHECKING([for $QEMU version >= 1]) +- if $QEMU -version | grep -sq 'version @<:@1-@:>@'; then +- AC_MSG_RESULT([yes]) +- else +- AC_MSG_RESULT([no]) +- AC_MSG_FAILURE([$QEMU version must be >= 1.0.]) +- fi +- +- AC_MSG_CHECKING([that $QEMU -nographic -machine accel=kvm:tcg -device ? works]) +- if $QEMU -nographic -machine accel=kvm:tcg -device \? >&AS_MESSAGE_LOG_FD 2>&1; then +- AC_MSG_RESULT([yes]) +- else +- AC_MSG_RESULT([no]) +- AC_MSG_FAILURE([$QEMU -nographic -machine accel=kvm:tcg -device ? doesn't work.]) +- fi +- +- AC_MSG_CHECKING([for virtio-serial support in $QEMU]) +- if $QEMU $QEMU_OPTIONS -nographic -machine accel=kvm:tcg -device \? 2>&1 | grep -sq virtio-serial; then +- AC_MSG_RESULT([yes]) +- else +- AC_MSG_RESULT([no]) +- AC_MSG_FAILURE( +-[I did not find virtio-serial support in +-$QEMU. +- +-virtio-serial support in qemu or KVM is essential for libguestfs +-to operate. +- +-Usually this means that you have to install a newer version of qemu +-and/or KVM. Please read the relevant section in the README file for +-more information about this. +- +-You can override this test by setting the environment variable +-vmchannel_test=no +- +-However if you don't have the right support in your qemu, then this +-just delays the pain. +- +-If I am using the wrong qemu or you want to compile qemu from source +-and install it in another location, then you should configure with +-the --with-qemu option. +-]) +- fi + fi + + dnl Enable packet dumps when in verbose mode. This generates lots +diff --git a/src/launch-appliance.c b/src/launch-appliance.c +index a86a8cc..10f63f1 100644 +--- a/src/launch-appliance.c ++++ b/src/launch-appliance.c +@@ -767,30 +767,11 @@ test_qemu (guestfs_h *g) + if (r == -1 || !WIFEXITED (r) || WEXITSTATUS (r) != 0) + goto error; + +- guestfs___cmd_add_arg (cmd2, g->qemu); +- guestfs___cmd_add_arg (cmd2, "-nographic"); +- guestfs___cmd_add_arg (cmd2, "-version"); +- guestfs___cmd_set_stdout_callback (cmd2, read_all, &g->app.qemu_version, +- CMD_STDOUT_FLAG_WHOLE_BUFFER); +- r = guestfs___cmd_run (cmd2); +- if (r == -1 || !WIFEXITED (r) || WEXITSTATUS (r) != 0) +- goto error; ++ g->app.qemu_version = safe_strdup (g, ""); + + parse_qemu_version (g); + +- guestfs___cmd_add_arg (cmd3, g->qemu); +- guestfs___cmd_add_arg (cmd3, "-nographic"); +- guestfs___cmd_add_arg (cmd3, "-machine"); +- guestfs___cmd_add_arg (cmd3, "accel=kvm:tcg"); +- guestfs___cmd_add_arg (cmd3, "-device"); +- guestfs___cmd_add_arg (cmd3, "?"); +- guestfs___cmd_clear_capture_errors (cmd3); +- guestfs___cmd_set_stderr_to_stdout (cmd3); +- guestfs___cmd_set_stdout_callback (cmd3, read_all, &g->app.qemu_devices, +- CMD_STDOUT_FLAG_WHOLE_BUFFER); +- r = guestfs___cmd_run (cmd3); +- if (r == -1 || !WIFEXITED (r) || WEXITSTATUS (r) != 0) +- goto error; ++ g->app.qemu_devices = safe_strdup (g, ""); + + return 0; + +-- +1.7.4.1 + diff --git a/0006-EPEL-5-Remove-AS_ECHO_N-for-ancient-autoconf.patch b/0006-EPEL-5-Remove-AS_ECHO_N-for-ancient-autoconf.patch new file mode 100644 index 0000000..3636261 --- /dev/null +++ b/0006-EPEL-5-Remove-AS_ECHO_N-for-ancient-autoconf.patch @@ -0,0 +1,64 @@ +From 120acb40d674957a3b4cfe8a88877430cdc50493 Mon Sep 17 00:00:00 2001 +From: Richard W.M. Jones +Date: Sat, 16 Jun 2012 10:23:19 +0100 +Subject: [PATCH 06/37] EPEL 5: Remove AS_ECHO_N for ancient autoconf. + +--- + configure.ac | 28 ++++++++++++++-------------- + 1 files changed, 14 insertions(+), 14 deletions(-) + +diff --git a/configure.ac b/configure.ac +index c1388ff..38998ee 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1525,33 +1525,33 @@ echo "Appliance ........................... $enable_appliance" + echo "QEMU ................................ $QEMU $QEMU_OPTIONS" + echo "guestfish and C-based virt tools .... yes" + echo "FUSE filesystem ..................... $enable_fuse" +-AS_ECHO_N(["GNU gettext for i18n ................ "]) ++echo -n "GNU gettext for i18n ................ " + if test "x$HAVE_GNU_GETTEXT_TRUE" = "x"; then echo "yes"; else echo "no"; fi +-AS_ECHO_N(["OCaml bindings ...................... "]) ++echo -n "OCaml bindings ...................... " + if test "x$HAVE_OCAML_TRUE" = "x"; then echo "yes"; else echo "no"; fi +-AS_ECHO_N(["OCaml-based virt tools .............. "]) ++echo -n "OCaml-based virt tools .............. " + if test "x$HAVE_OCAML_TRUE" = "x"; then echo "yes"; else echo "no"; fi +-AS_ECHO_N(["Perl bindings ....................... "]) ++echo -n "Perl bindings ....................... " + if test "x$HAVE_PERL_TRUE" = "x"; then echo "yes"; else echo "no"; fi +-AS_ECHO_N(["Perl-based virt tools ............... "]) ++echo -n "Perl-based virt tools ............... " + if test "x$HAVE_TOOLS_TRUE" = "x"; then echo "yes"; else echo "no"; fi +-AS_ECHO_N(["Python bindings ..................... "]) ++echo -n "Python bindings ..................... " + if test "x$HAVE_PYTHON_TRUE" = "x"; then echo "yes"; else echo "no"; fi +-AS_ECHO_N(["Ruby bindings ....................... "]) ++echo -n "Ruby bindings ....................... " + if test "x$HAVE_RUBY_TRUE" = "x"; then echo "yes"; else echo "no"; fi +-AS_ECHO_N(["Java bindings ....................... "]) ++echo -n "Java bindings ....................... " + if test "x$HAVE_JAVA_TRUE" = "x"; then echo "yes"; else echo "no"; fi +-AS_ECHO_N(["Haskell bindings .................... "]) ++echo -n "Haskell bindings .................... " + if test "x$HAVE_HASKELL_TRUE" = "x"; then echo "yes"; else echo "no"; fi +-AS_ECHO_N(["PHP bindings ........................ "]) ++echo -n "PHP bindings ........................ " + if test "x$HAVE_PHP_TRUE" = "x"; then echo "yes"; else echo "no"; fi +-AS_ECHO_N(["Erlang bindings ..................... "]) ++echo -n "Erlang bindings ..................... " + if test "x$HAVE_ERLANG_TRUE" = "x"; then echo "yes"; else echo "no"; fi +-AS_ECHO_N(["Lua bindings ........................ "]) ++echo -n "Lua bindings ........................ " + if test "x$HAVE_LUA_TRUE" = "x"; then echo "yes"; else echo "no"; fi +-AS_ECHO_N(["gobject bindings .................... "]) ++echo -n "gobject bindings .................... " + if test "x$HAVE_GOBJECT_TRUE" = "x"; then echo "yes"; else echo "no"; fi +-AS_ECHO_N(["gobject introspection ............... "]) ++echo -n "gobject introspection ............... " + if test "x$HAVE_INTROSPECTION_TRUE" = "x"; then echo "yes"; else echo "no"; fi + echo + echo "If any optional component is configured 'no' when you expected 'yes'" +-- +1.7.4.1 + diff --git a/0006-EPEL-5-Replace-macro-AC_STRUCT_DIRENT_D_TYPE-for-anc.patch b/0006-EPEL-5-Replace-macro-AC_STRUCT_DIRENT_D_TYPE-for-anc.patch deleted file mode 100644 index ddf6e97..0000000 --- a/0006-EPEL-5-Replace-macro-AC_STRUCT_DIRENT_D_TYPE-for-anc.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 21e884d68eefc155a07eb184e650637b90b4780b Mon Sep 17 00:00:00 2001 -From: Richard W.M. Jones -Date: Sat, 16 Jun 2012 10:46:20 +0100 -Subject: [PATCH 06/36] EPEL 5: Replace macro AC_STRUCT_DIRENT_D_TYPE for ancient autoconf. - ---- - configure.ac | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/configure.ac b/configure.ac -index 38998ee..ad2897d 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -251,7 +251,7 @@ The code will still compile, but is likely to leak memory and other - resources when it runs.])]) - - dnl Check if dirent (readdir) supports d_type member. --AC_STRUCT_DIRENT_D_TYPE -+AC_DEFINE([HAVE_STRUCT_DIRENT_D_TYPE],[1],[Define to 1 if 'struct dirent' has member 'd_type']) - - dnl Check if stat has the required fields. - AC_STRUCT_ST_BLOCKS --- -1.7.4.1 - diff --git a/0007-EPEL-5-Don-t-use-C99-style-variable-decls-in-for-loo.patch b/0007-EPEL-5-Don-t-use-C99-style-variable-decls-in-for-loo.patch deleted file mode 100644 index 3c74034..0000000 --- a/0007-EPEL-5-Don-t-use-C99-style-variable-decls-in-for-loo.patch +++ /dev/null @@ -1,130 +0,0 @@ -From a0be4e9a2503869dd90e94f4cfa4dbde7e85a1ee Mon Sep 17 00:00:00 2001 -From: Richard W.M. Jones -Date: Sat, 16 Jun 2012 13:55:44 +0100 -Subject: [PATCH 07/36] EPEL 5: Don't use C99-style variable decls in for-loop. - ---- - daemon/btrfs.c | 3 ++- - daemon/md.c | 6 ++++-- - generator/bindtests.ml | 3 ++- - src/inspect-fs-unix.c | 17 +++++++++++------ - 4 files changed, 19 insertions(+), 10 deletions(-) - -diff --git a/daemon/btrfs.c b/daemon/btrfs.c -index 81ce5f5..7053642 100644 ---- a/daemon/btrfs.c -+++ b/daemon/btrfs.c -@@ -388,7 +388,8 @@ do_btrfs_subvolume_list (const char *fs) - goto error; - } - -- for (size_t i = 0; i < nr_subvolumes; ++i) { -+ size_t i; -+ for (i = 0; i < nr_subvolumes; ++i) { - /* To avoid allocations, reuse the 'line' buffer to store the - * path. Thus we don't need to free 'line', since it will be - * freed by the calling (XDR) code. -diff --git a/daemon/md.c b/daemon/md.c -index b302a8c..d106783 100644 ---- a/daemon/md.c -+++ b/daemon/md.c -@@ -201,7 +201,8 @@ do_list_md_devices (void) - goto error; - } - -- for (size_t i = 0; i < mds.gl_pathc; i++) { -+ size_t i; -+ for (i = 0; i < mds.gl_pathc; i++) { - size_t len = strlen (mds.gl_pathv[i]) - strlen (PREFIX) - strlen (SUFFIX); - - #define DEV "/dev/md" -@@ -277,7 +278,8 @@ do_md_detail(const char *md) - * case */ - if (STRPREFIX (line, "MD_")) { - line += 3; -- for (char *j = line; *j != '\0'; j++) { -+ char *j; -+ for (j = line; *j != '\0'; j++) { - *j = c_tolower (*j); - } - } -diff --git a/generator/bindtests.ml b/generator/bindtests.ml -index 55c39cb..6650547 100644 ---- a/generator/bindtests.ml -+++ b/generator/bindtests.ml -@@ -250,7 +250,8 @@ print_strings (guestfs_h *g, char *const *argv) - pr " r = safe_calloc (g, sizeof *r, 1);\n"; - pr " r->len = len;\n"; - pr " r->val = safe_calloc (g, r->len, sizeof *r->val);\n"; -- pr " for (size_t i = 0; i < r->len; i++) {\n"; -+ pr " size_t i;\n"; -+ pr " for (i = 0; i < r->len; i++) {\n"; - pr " r->val[i].pv_size = i;\n"; - pr " }\n"; - pr " return r;\n" -diff --git a/src/inspect-fs-unix.c b/src/inspect-fs-unix.c -index 40f797d..0917a8d 100644 ---- a/src/inspect-fs-unix.c -+++ b/src/inspect-fs-unix.c -@@ -994,7 +994,8 @@ uuid_hash(const void *x, size_t table_size) - const md_uuid *a = x; - - size_t h = a->uuid[0]; -- for (size_t i = 1; i < 4; i++) { -+ size_t i; -+ for (i = 1; i < 4; i++) { - h ^= a->uuid[i]; - } - -@@ -1007,7 +1008,8 @@ uuid_cmp(const void *x, const void *y) - const md_uuid *a = x; - const md_uuid *b = y; - -- for (size_t i = 0; i < 1; i++) { -+ size_t i; -+ for (i = 0; i < 1; i++) { - if (a->uuid[i] != b->uuid[i]) return 0; - } - -@@ -1071,7 +1073,8 @@ map_app_md_devices (guestfs_h *g, Hash_table **map) - mds = guestfs_list_md_devices(g); - if (mds == NULL) goto error; - -- for (char **md = mds; *md != NULL; md++) { -+ char **md; -+ for (md = mds; *md != NULL; md++) { - CLEANUP_FREE_STRING_LIST char **detail = guestfs_md_detail (g, *md); - if (detail == NULL) goto error; - -@@ -1182,7 +1185,8 @@ map_md_devices(guestfs_h *g, Hash_table **map) - mdadm_app_free); - if (!*map) g->abort_cb(); - -- for (char **m = matches; *m != NULL; m++) { -+ char **m; -+ for (m = matches; *m != NULL; m++) { - /* Get device name and uuid for each array */ - CLEANUP_FREE char *dev_path = safe_asprintf (g, "%s/devicename", *m); - char *dev = guestfs_aug_get (g, dev_path); -@@ -1475,7 +1479,8 @@ inspect_with_augeas (guestfs_h *g, struct inspect_fs *fs, - int (*f) (guestfs_h *, struct inspect_fs *)) - { - /* Security: Refuse to do this if a config file is too large. */ -- for (const char **i = configfiles; *i != NULL; i++) { -+ const char **i; -+ for (i = configfiles; *i != NULL; i++) { - if (guestfs_exists(g, *i) == 0) continue; - - int64_t size = guestfs_filesize (g, *i); -@@ -1514,7 +1519,7 @@ inspect_with_augeas (guestfs_h *g, struct inspect_fs *fs, - - #define EXCL " and . != \"" - #define EXCL_LEN (strlen(EXCL)) -- for (const char **i = &configfiles[1]; *i != NULL; i++) { -+ for (i = &configfiles[1]; *i != NULL; i++) { - size_t orig_buflen = buflen; - conflen = strlen(*i); - buflen += EXCL_LEN + conflen + 1 /* Closing " */; --- -1.7.4.1 - diff --git a/0007-EPEL-5-Replace-macro-AC_STRUCT_DIRENT_D_TYPE-for-anc.patch b/0007-EPEL-5-Replace-macro-AC_STRUCT_DIRENT_D_TYPE-for-anc.patch new file mode 100644 index 0000000..d29fb33 --- /dev/null +++ b/0007-EPEL-5-Replace-macro-AC_STRUCT_DIRENT_D_TYPE-for-anc.patch @@ -0,0 +1,25 @@ +From 03263b3a4fe4abce8dcdd53fb1880eca64ef46ef Mon Sep 17 00:00:00 2001 +From: Richard W.M. Jones +Date: Sat, 16 Jun 2012 10:46:20 +0100 +Subject: [PATCH 07/37] EPEL 5: Replace macro AC_STRUCT_DIRENT_D_TYPE for ancient autoconf. + +--- + configure.ac | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 38998ee..ad2897d 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -251,7 +251,7 @@ The code will still compile, but is likely to leak memory and other + resources when it runs.])]) + + dnl Check if dirent (readdir) supports d_type member. +-AC_STRUCT_DIRENT_D_TYPE ++AC_DEFINE([HAVE_STRUCT_DIRENT_D_TYPE],[1],[Define to 1 if 'struct dirent' has member 'd_type']) + + dnl Check if stat has the required fields. + AC_STRUCT_ST_BLOCKS +-- +1.7.4.1 + diff --git a/0008-EPEL-5-Don-t-use-C99-style-variable-decls-in-for-loo.patch b/0008-EPEL-5-Don-t-use-C99-style-variable-decls-in-for-loo.patch new file mode 100644 index 0000000..8113a1f --- /dev/null +++ b/0008-EPEL-5-Don-t-use-C99-style-variable-decls-in-for-loo.patch @@ -0,0 +1,130 @@ +From 4cfbf4f295a06897329d20037efe66ee35c92b62 Mon Sep 17 00:00:00 2001 +From: Richard W.M. Jones +Date: Sat, 16 Jun 2012 13:55:44 +0100 +Subject: [PATCH 08/37] EPEL 5: Don't use C99-style variable decls in for-loop. + +--- + daemon/btrfs.c | 3 ++- + daemon/md.c | 6 ++++-- + generator/bindtests.ml | 3 ++- + src/inspect-fs-unix.c | 17 +++++++++++------ + 4 files changed, 19 insertions(+), 10 deletions(-) + +diff --git a/daemon/btrfs.c b/daemon/btrfs.c +index 81ce5f5..7053642 100644 +--- a/daemon/btrfs.c ++++ b/daemon/btrfs.c +@@ -388,7 +388,8 @@ do_btrfs_subvolume_list (const char *fs) + goto error; + } + +- for (size_t i = 0; i < nr_subvolumes; ++i) { ++ size_t i; ++ for (i = 0; i < nr_subvolumes; ++i) { + /* To avoid allocations, reuse the 'line' buffer to store the + * path. Thus we don't need to free 'line', since it will be + * freed by the calling (XDR) code. +diff --git a/daemon/md.c b/daemon/md.c +index b302a8c..d106783 100644 +--- a/daemon/md.c ++++ b/daemon/md.c +@@ -201,7 +201,8 @@ do_list_md_devices (void) + goto error; + } + +- for (size_t i = 0; i < mds.gl_pathc; i++) { ++ size_t i; ++ for (i = 0; i < mds.gl_pathc; i++) { + size_t len = strlen (mds.gl_pathv[i]) - strlen (PREFIX) - strlen (SUFFIX); + + #define DEV "/dev/md" +@@ -277,7 +278,8 @@ do_md_detail(const char *md) + * case */ + if (STRPREFIX (line, "MD_")) { + line += 3; +- for (char *j = line; *j != '\0'; j++) { ++ char *j; ++ for (j = line; *j != '\0'; j++) { + *j = c_tolower (*j); + } + } +diff --git a/generator/bindtests.ml b/generator/bindtests.ml +index 55c39cb..6650547 100644 +--- a/generator/bindtests.ml ++++ b/generator/bindtests.ml +@@ -250,7 +250,8 @@ print_strings (guestfs_h *g, char *const *argv) + pr " r = safe_calloc (g, sizeof *r, 1);\n"; + pr " r->len = len;\n"; + pr " r->val = safe_calloc (g, r->len, sizeof *r->val);\n"; +- pr " for (size_t i = 0; i < r->len; i++) {\n"; ++ pr " size_t i;\n"; ++ pr " for (i = 0; i < r->len; i++) {\n"; + pr " r->val[i].pv_size = i;\n"; + pr " }\n"; + pr " return r;\n" +diff --git a/src/inspect-fs-unix.c b/src/inspect-fs-unix.c +index 40f797d..0917a8d 100644 +--- a/src/inspect-fs-unix.c ++++ b/src/inspect-fs-unix.c +@@ -994,7 +994,8 @@ uuid_hash(const void *x, size_t table_size) + const md_uuid *a = x; + + size_t h = a->uuid[0]; +- for (size_t i = 1; i < 4; i++) { ++ size_t i; ++ for (i = 1; i < 4; i++) { + h ^= a->uuid[i]; + } + +@@ -1007,7 +1008,8 @@ uuid_cmp(const void *x, const void *y) + const md_uuid *a = x; + const md_uuid *b = y; + +- for (size_t i = 0; i < 1; i++) { ++ size_t i; ++ for (i = 0; i < 1; i++) { + if (a->uuid[i] != b->uuid[i]) return 0; + } + +@@ -1071,7 +1073,8 @@ map_app_md_devices (guestfs_h *g, Hash_table **map) + mds = guestfs_list_md_devices(g); + if (mds == NULL) goto error; + +- for (char **md = mds; *md != NULL; md++) { ++ char **md; ++ for (md = mds; *md != NULL; md++) { + CLEANUP_FREE_STRING_LIST char **detail = guestfs_md_detail (g, *md); + if (detail == NULL) goto error; + +@@ -1182,7 +1185,8 @@ map_md_devices(guestfs_h *g, Hash_table **map) + mdadm_app_free); + if (!*map) g->abort_cb(); + +- for (char **m = matches; *m != NULL; m++) { ++ char **m; ++ for (m = matches; *m != NULL; m++) { + /* Get device name and uuid for each array */ + CLEANUP_FREE char *dev_path = safe_asprintf (g, "%s/devicename", *m); + char *dev = guestfs_aug_get (g, dev_path); +@@ -1475,7 +1479,8 @@ inspect_with_augeas (guestfs_h *g, struct inspect_fs *fs, + int (*f) (guestfs_h *, struct inspect_fs *)) + { + /* Security: Refuse to do this if a config file is too large. */ +- for (const char **i = configfiles; *i != NULL; i++) { ++ const char **i; ++ for (i = configfiles; *i != NULL; i++) { + if (guestfs_exists(g, *i) == 0) continue; + + int64_t size = guestfs_filesize (g, *i); +@@ -1514,7 +1519,7 @@ inspect_with_augeas (guestfs_h *g, struct inspect_fs *fs, + + #define EXCL " and . != \"" + #define EXCL_LEN (strlen(EXCL)) +- for (const char **i = &configfiles[1]; *i != NULL; i++) { ++ for (i = &configfiles[1]; *i != NULL; i++) { + size_t orig_buflen = buflen; + conflen = strlen(*i); + buflen += EXCL_LEN + conflen + 1 /* Closing " */; +-- +1.7.4.1 + diff --git a/0008-EPEL-5-Remove-Erlang-bindings.patch b/0008-EPEL-5-Remove-Erlang-bindings.patch deleted file mode 100644 index 951f864..0000000 --- a/0008-EPEL-5-Remove-Erlang-bindings.patch +++ /dev/null @@ -1,89 +0,0 @@ -From 55d66110bf342aa05c54cf1ee5c3f83bbd98bb3f Mon Sep 17 00:00:00 2001 -From: Richard W.M. Jones -Date: Sat, 16 Jun 2012 14:34:25 +0100 -Subject: [PATCH 08/36] EPEL 5: Remove Erlang bindings. - ---- - Makefile.am | 3 --- - configure.ac | 23 ----------------------- - po/POTFILES | 2 -- - 3 files changed, 0 insertions(+), 28 deletions(-) - -diff --git a/Makefile.am b/Makefile.am -index 842008a..340a6d6 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -91,9 +91,6 @@ endif - if HAVE_PHP - SUBDIRS += php - endif --if HAVE_ERLANG --SUBDIRS += erlang erlang/examples --endif - if HAVE_LUA - SUBDIRS += lua lua/examples - endif -diff --git a/configure.ac b/configure.ac -index ad2897d..6f72688 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -1290,25 +1290,6 @@ AS_IF([test "x$enable_php" != "xno"],[ - ]) - AM_CONDITIONAL([HAVE_PHP], [test "x$PHP" != "xno" && test "x$PHPIZE" != "xno"]) - --dnl Erlang --ERLANG=no --AC_ARG_ENABLE([erlang], -- AS_HELP_STRING([--disable-erlang], [disable Erlang language bindings]), -- [], -- [enable_erlang=yes]) --# NB: Don't use AS_IF here: it doesn't work. --if test "x$enable_erlang" != "xno"; then -- ERLANG= -- AC_ERLANG_PATH_ERLC([no]) -- -- if test "x$ERLC" != "xno"; then -- AC_ERLANG_CHECK_LIB([erl_interface], [], -- [AC_MSG_FAILURE([Erlang erl_interface library not installed. Use --disable-erlang to disable.])]) -- AC_ERLANG_SUBST_LIB_DIR -- fi --fi --AM_CONDITIONAL([HAVE_ERLANG], [test "x$ERLANG" != "xno" && test "x$ERLC" != "xno"]) -- - dnl Lua - AC_ARG_ENABLE([lua], - AS_HELP_STRING([--disable-lua], [disable Lua language bindings]), -@@ -1442,8 +1423,6 @@ AC_CONFIG_FILES([Makefile - daemon/Makefile - df/Makefile - edit/Makefile -- erlang/Makefile -- erlang/examples/Makefile - examples/Makefile - fish/Makefile - format/Makefile -@@ -1545,8 +1524,6 @@ echo -n "Haskell bindings .................... " - if test "x$HAVE_HASKELL_TRUE" = "x"; then echo "yes"; else echo "no"; fi - echo -n "PHP bindings ........................ " - if test "x$HAVE_PHP_TRUE" = "x"; then echo "yes"; else echo "no"; fi --echo -n "Erlang bindings ..................... " --if test "x$HAVE_ERLANG_TRUE" = "x"; then echo "yes"; else echo "no"; fi - echo -n "Lua bindings ........................ " - if test "x$HAVE_LUA_TRUE" = "x"; then echo "yes"; else echo "no"; fi - echo -n "gobject bindings .................... " -diff --git a/po/POTFILES b/po/POTFILES -index 1c272b8..e51d543 100644 ---- a/po/POTFILES -+++ b/po/POTFILES -@@ -101,8 +101,6 @@ df/domains.c - df/main.c - df/output.c - edit/virt-edit.c --erlang/erl-guestfs-proto.c --erlang/erl-guestfs.c - fish/alloc.c - fish/cmds-gperf.c - fish/cmds.c --- -1.7.4.1 - diff --git a/0009-EPEL-5-Remove-Erlang-bindings.patch b/0009-EPEL-5-Remove-Erlang-bindings.patch new file mode 100644 index 0000000..726d6fc --- /dev/null +++ b/0009-EPEL-5-Remove-Erlang-bindings.patch @@ -0,0 +1,89 @@ +From ec782cc14643e71bb5d7cc07647a369a95fb005b Mon Sep 17 00:00:00 2001 +From: Richard W.M. Jones +Date: Sat, 16 Jun 2012 14:34:25 +0100 +Subject: [PATCH 09/37] EPEL 5: Remove Erlang bindings. + +--- + Makefile.am | 3 --- + configure.ac | 23 ----------------------- + po/POTFILES | 2 -- + 3 files changed, 0 insertions(+), 28 deletions(-) + +diff --git a/Makefile.am b/Makefile.am +index 842008a..340a6d6 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -91,9 +91,6 @@ endif + if HAVE_PHP + SUBDIRS += php + endif +-if HAVE_ERLANG +-SUBDIRS += erlang erlang/examples +-endif + if HAVE_LUA + SUBDIRS += lua lua/examples + endif +diff --git a/configure.ac b/configure.ac +index ad2897d..6f72688 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1290,25 +1290,6 @@ AS_IF([test "x$enable_php" != "xno"],[ + ]) + AM_CONDITIONAL([HAVE_PHP], [test "x$PHP" != "xno" && test "x$PHPIZE" != "xno"]) + +-dnl Erlang +-ERLANG=no +-AC_ARG_ENABLE([erlang], +- AS_HELP_STRING([--disable-erlang], [disable Erlang language bindings]), +- [], +- [enable_erlang=yes]) +-# NB: Don't use AS_IF here: it doesn't work. +-if test "x$enable_erlang" != "xno"; then +- ERLANG= +- AC_ERLANG_PATH_ERLC([no]) +- +- if test "x$ERLC" != "xno"; then +- AC_ERLANG_CHECK_LIB([erl_interface], [], +- [AC_MSG_FAILURE([Erlang erl_interface library not installed. Use --disable-erlang to disable.])]) +- AC_ERLANG_SUBST_LIB_DIR +- fi +-fi +-AM_CONDITIONAL([HAVE_ERLANG], [test "x$ERLANG" != "xno" && test "x$ERLC" != "xno"]) +- + dnl Lua + AC_ARG_ENABLE([lua], + AS_HELP_STRING([--disable-lua], [disable Lua language bindings]), +@@ -1442,8 +1423,6 @@ AC_CONFIG_FILES([Makefile + daemon/Makefile + df/Makefile + edit/Makefile +- erlang/Makefile +- erlang/examples/Makefile + examples/Makefile + fish/Makefile + format/Makefile +@@ -1545,8 +1524,6 @@ echo -n "Haskell bindings .................... " + if test "x$HAVE_HASKELL_TRUE" = "x"; then echo "yes"; else echo "no"; fi + echo -n "PHP bindings ........................ " + if test "x$HAVE_PHP_TRUE" = "x"; then echo "yes"; else echo "no"; fi +-echo -n "Erlang bindings ..................... " +-if test "x$HAVE_ERLANG_TRUE" = "x"; then echo "yes"; else echo "no"; fi + echo -n "Lua bindings ........................ " + if test "x$HAVE_LUA_TRUE" = "x"; then echo "yes"; else echo "no"; fi + echo -n "gobject bindings .................... " +diff --git a/po/POTFILES b/po/POTFILES +index 1c272b8..e51d543 100644 +--- a/po/POTFILES ++++ b/po/POTFILES +@@ -101,8 +101,6 @@ df/domains.c + df/main.c + df/output.c + edit/virt-edit.c +-erlang/erl-guestfs-proto.c +-erlang/erl-guestfs.c + fish/alloc.c + fish/cmds-gperf.c + fish/cmds.c +-- +1.7.4.1 + diff --git a/0009-EPEL-5-Remove-GObject-GObject-Introspection-GJS-bind.patch b/0009-EPEL-5-Remove-GObject-GObject-Introspection-GJS-bind.patch deleted file mode 100644 index d2e0129..0000000 --- a/0009-EPEL-5-Remove-GObject-GObject-Introspection-GJS-bind.patch +++ /dev/null @@ -1,187 +0,0 @@ -From f31016c7d8e57fa6cdb22506c7fadf0a408fbbfe Mon Sep 17 00:00:00 2001 -From: Richard W.M. Jones -Date: Sat, 16 Jun 2012 14:35:06 +0100 -Subject: [PATCH 09/36] EPEL 5: Remove GObject / GObject Introspection / GJS bindings. - ---- - Makefile.am | 3 -- - configure.ac | 60 ------------------------------------------------------- - po/POTFILES | 63 ---------------------------------------------------------- - 3 files changed, 0 insertions(+), 126 deletions(-) - -diff --git a/Makefile.am b/Makefile.am -index 340a6d6..ee680dc 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -94,9 +94,6 @@ endif - if HAVE_LUA - SUBDIRS += lua lua/examples - endif --if HAVE_GOBJECT --SUBDIRS += gobject --endif - - # Unconditional because nothing is built yet. - SUBDIRS += csharp -diff --git a/configure.ac b/configure.ac -index 6f72688..d596c52 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -1341,58 +1341,6 @@ AS_IF([test "x$PERL" != "xno"],[ - AM_CONDITIONAL([HAVE_TOOLS], - [test "x$PERL" != "xno" && test "x$missing_perl_modules" != "xyes"]) - --dnl gobject library --AC_ARG_ENABLE([gobject], -- AS_HELP_STRING([--disable-gobject], [disable GObject bindings]), -- [], -- [enable_gobject=yes]) --AS_IF([test "x$enable_gobject" != "xno"],[ -- PKG_CHECK_MODULES([GOBJECT], [gobject-2.0 >= 2.26.0],[ -- AC_SUBST([GOBJECT_CFLAGS]) -- AC_SUBST([GOBJECT_LIBS]) -- AC_DEFINE([HAVE_GOBJECT],[1], -- [GObject library found at compile time.]) -- ], -- [AC_MSG_WARN([gobject library not found, gobject binding will be disabled])]) -- -- PKG_CHECK_MODULES([GIO], [gio-2.0 >= 2.26.0],[ -- AC_SUBST([GIO_CFLAGS]) -- AC_SUBST([GIO_LIBS]) -- AC_DEFINE([HAVE_GIO],[1], -- [gio library found at compile time.]) -- ], -- [AC_MSG_WARN([gio library not found, gobject binding will be disabled])]) --]) --AM_CONDITIONAL([HAVE_GOBJECT], -- [test "x$GOBJECT_LIBS" != "x" -a "x$GIO_LIBS" != "x"]) -- --AC_CHECK_PROG([GJS],[gjs],[gjs]) --AS_IF([test "x$GJS" = "x"], -- [AC_MSG_WARN([gjs not found, gobject bindtests will not run])]) -- --dnl gobject introspection --m4_ifdef([GOBJECT_INTROSPECTION_CHECK], [ -- GOBJECT_INTROSPECTION_CHECK([1.30.0]) -- -- dnl The above check automatically sets HAVE_INTROSPECTION, but we -- dnl want this to be conditional on gobject also being -- dnl available. We can't move the above check inside the gobject if -- dnl block above or HAVE_INTROSPECTION ends up undefined, so we -- dnl recheck it here. -- AM_CONDITIONAL([HAVE_INTROSPECTION], -- [test "x$HAVE_INTROSPECTION_TRUE" = "x" && -- test "x$HAVE_GOBJECT_TRUE" = "x"]) --],[ -- AM_CONDITIONAL([HAVE_INTROSPECTION], [false]) --]) -- --# check for gtk-doc --m4_ifdef([GTK_DOC_CHECK], [ -- GTK_DOC_CHECK([1.14],[--flavour no-tmpl]) --],[ -- AM_CONDITIONAL([ENABLE_GTK_DOC], false) --]) -- - dnl Library versioning. - MAX_PROC_NR=`cat $srcdir/src/MAX_PROC_NR` - AC_SUBST(MAX_PROC_NR) -@@ -1430,10 +1378,6 @@ AC_CONFIG_FILES([Makefile - generator/Makefile - gnulib/lib/Makefile - gnulib/tests/Makefile -- gobject/libguestfs-gobject-1.0.pc -- gobject/Makefile -- gobject/docs/Makefile -- gobject/docs/guestfs-docs.sgml - haskell/Makefile - inspector/Makefile - java/Makefile -@@ -1526,10 +1470,6 @@ echo -n "PHP bindings ........................ " - if test "x$HAVE_PHP_TRUE" = "x"; then echo "yes"; else echo "no"; fi - echo -n "Lua bindings ........................ " - if test "x$HAVE_LUA_TRUE" = "x"; then echo "yes"; else echo "no"; fi --echo -n "gobject bindings .................... " --if test "x$HAVE_GOBJECT_TRUE" = "x"; then echo "yes"; else echo "no"; fi --echo -n "gobject introspection ............... " --if test "x$HAVE_INTROSPECTION_TRUE" = "x"; then echo "yes"; else echo "no"; fi - echo - echo "If any optional component is configured 'no' when you expected 'yes'" - echo "then you should check the preceding messages." -diff --git a/po/POTFILES b/po/POTFILES -index e51d543..1d6227c 100644 ---- a/po/POTFILES -+++ b/po/POTFILES -@@ -140,69 +140,6 @@ fish/tilde.c - fish/time.c - format/format.c - fuse/guestmount.c --gobject/src/optargs-add_domain.c --gobject/src/optargs-add_drive.c --gobject/src/optargs-btrfs_filesystem_resize.c --gobject/src/optargs-btrfs_fsck.c --gobject/src/optargs-compress_device_out.c --gobject/src/optargs-compress_out.c --gobject/src/optargs-copy_device_to_device.c --gobject/src/optargs-copy_device_to_file.c --gobject/src/optargs-copy_file_to_device.c --gobject/src/optargs-copy_file_to_file.c --gobject/src/optargs-e2fsck.c --gobject/src/optargs-fstrim.c --gobject/src/optargs-grep.c --gobject/src/optargs-hivex_open.c --gobject/src/optargs-inspect_get_icon.c --gobject/src/optargs-internal_test.c --gobject/src/optargs-internal_test_63_optargs.c --gobject/src/optargs-internal_test_only_optargs.c --gobject/src/optargs-md_create.c --gobject/src/optargs-mke2fs.c --gobject/src/optargs-mkfs.c --gobject/src/optargs-mkfs_btrfs.c --gobject/src/optargs-mkswap.c --gobject/src/optargs-mktemp.c --gobject/src/optargs-mount_9p.c --gobject/src/optargs-mount_local.c --gobject/src/optargs-ntfsclone_out.c --gobject/src/optargs-ntfsfix.c --gobject/src/optargs-ntfsresize.c --gobject/src/optargs-rsync.c --gobject/src/optargs-rsync_in.c --gobject/src/optargs-rsync_out.c --gobject/src/optargs-set_e2attrs.c --gobject/src/optargs-tar_in.c --gobject/src/optargs-tar_out.c --gobject/src/optargs-tune2fs.c --gobject/src/optargs-umount.c --gobject/src/optargs-umount_local.c --gobject/src/optargs-xfs_admin.c --gobject/src/optargs-xfs_growfs.c --gobject/src/optargs-xfs_repair.c --gobject/src/session.c --gobject/src/struct-application.c --gobject/src/struct-application2.c --gobject/src/struct-btrfssubvolume.c --gobject/src/struct-dirent.c --gobject/src/struct-hivex_node.c --gobject/src/struct-hivex_value.c --gobject/src/struct-inotify_event.c --gobject/src/struct-int_bool.c --gobject/src/struct-isoinfo.c --gobject/src/struct-lvm_lv.c --gobject/src/struct-lvm_pv.c --gobject/src/struct-lvm_vg.c --gobject/src/struct-mdstat.c --gobject/src/struct-partition.c --gobject/src/struct-stat.c --gobject/src/struct-statvfs.c --gobject/src/struct-utsname.c --gobject/src/struct-version.c --gobject/src/struct-xattr.c --gobject/src/struct-xfsinfo.c --gobject/src/tristate.c - inspector/virt-inspector.c - java/com_redhat_et_libguestfs_GuestFS.c - lua/lua-guestfs.c --- -1.7.4.1 - diff --git a/0010-EPEL-5-Remove-GObject-GObject-Introspection-GJS-bind.patch b/0010-EPEL-5-Remove-GObject-GObject-Introspection-GJS-bind.patch new file mode 100644 index 0000000..9a9619b --- /dev/null +++ b/0010-EPEL-5-Remove-GObject-GObject-Introspection-GJS-bind.patch @@ -0,0 +1,187 @@ +From 01d681c8be082b4d44845f34c51cc4f07e6ffa80 Mon Sep 17 00:00:00 2001 +From: Richard W.M. Jones +Date: Sat, 16 Jun 2012 14:35:06 +0100 +Subject: [PATCH 10/37] EPEL 5: Remove GObject / GObject Introspection / GJS bindings. + +--- + Makefile.am | 3 -- + configure.ac | 60 ------------------------------------------------------- + po/POTFILES | 63 ---------------------------------------------------------- + 3 files changed, 0 insertions(+), 126 deletions(-) + +diff --git a/Makefile.am b/Makefile.am +index 340a6d6..ee680dc 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -94,9 +94,6 @@ endif + if HAVE_LUA + SUBDIRS += lua lua/examples + endif +-if HAVE_GOBJECT +-SUBDIRS += gobject +-endif + + # Unconditional because nothing is built yet. + SUBDIRS += csharp +diff --git a/configure.ac b/configure.ac +index 6f72688..d596c52 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1341,58 +1341,6 @@ AS_IF([test "x$PERL" != "xno"],[ + AM_CONDITIONAL([HAVE_TOOLS], + [test "x$PERL" != "xno" && test "x$missing_perl_modules" != "xyes"]) + +-dnl gobject library +-AC_ARG_ENABLE([gobject], +- AS_HELP_STRING([--disable-gobject], [disable GObject bindings]), +- [], +- [enable_gobject=yes]) +-AS_IF([test "x$enable_gobject" != "xno"],[ +- PKG_CHECK_MODULES([GOBJECT], [gobject-2.0 >= 2.26.0],[ +- AC_SUBST([GOBJECT_CFLAGS]) +- AC_SUBST([GOBJECT_LIBS]) +- AC_DEFINE([HAVE_GOBJECT],[1], +- [GObject library found at compile time.]) +- ], +- [AC_MSG_WARN([gobject library not found, gobject binding will be disabled])]) +- +- PKG_CHECK_MODULES([GIO], [gio-2.0 >= 2.26.0],[ +- AC_SUBST([GIO_CFLAGS]) +- AC_SUBST([GIO_LIBS]) +- AC_DEFINE([HAVE_GIO],[1], +- [gio library found at compile time.]) +- ], +- [AC_MSG_WARN([gio library not found, gobject binding will be disabled])]) +-]) +-AM_CONDITIONAL([HAVE_GOBJECT], +- [test "x$GOBJECT_LIBS" != "x" -a "x$GIO_LIBS" != "x"]) +- +-AC_CHECK_PROG([GJS],[gjs],[gjs]) +-AS_IF([test "x$GJS" = "x"], +- [AC_MSG_WARN([gjs not found, gobject bindtests will not run])]) +- +-dnl gobject introspection +-m4_ifdef([GOBJECT_INTROSPECTION_CHECK], [ +- GOBJECT_INTROSPECTION_CHECK([1.30.0]) +- +- dnl The above check automatically sets HAVE_INTROSPECTION, but we +- dnl want this to be conditional on gobject also being +- dnl available. We can't move the above check inside the gobject if +- dnl block above or HAVE_INTROSPECTION ends up undefined, so we +- dnl recheck it here. +- AM_CONDITIONAL([HAVE_INTROSPECTION], +- [test "x$HAVE_INTROSPECTION_TRUE" = "x" && +- test "x$HAVE_GOBJECT_TRUE" = "x"]) +-],[ +- AM_CONDITIONAL([HAVE_INTROSPECTION], [false]) +-]) +- +-# check for gtk-doc +-m4_ifdef([GTK_DOC_CHECK], [ +- GTK_DOC_CHECK([1.14],[--flavour no-tmpl]) +-],[ +- AM_CONDITIONAL([ENABLE_GTK_DOC], false) +-]) +- + dnl Library versioning. + MAX_PROC_NR=`cat $srcdir/src/MAX_PROC_NR` + AC_SUBST(MAX_PROC_NR) +@@ -1430,10 +1378,6 @@ AC_CONFIG_FILES([Makefile + generator/Makefile + gnulib/lib/Makefile + gnulib/tests/Makefile +- gobject/libguestfs-gobject-1.0.pc +- gobject/Makefile +- gobject/docs/Makefile +- gobject/docs/guestfs-docs.sgml + haskell/Makefile + inspector/Makefile + java/Makefile +@@ -1526,10 +1470,6 @@ echo -n "PHP bindings ........................ " + if test "x$HAVE_PHP_TRUE" = "x"; then echo "yes"; else echo "no"; fi + echo -n "Lua bindings ........................ " + if test "x$HAVE_LUA_TRUE" = "x"; then echo "yes"; else echo "no"; fi +-echo -n "gobject bindings .................... " +-if test "x$HAVE_GOBJECT_TRUE" = "x"; then echo "yes"; else echo "no"; fi +-echo -n "gobject introspection ............... " +-if test "x$HAVE_INTROSPECTION_TRUE" = "x"; then echo "yes"; else echo "no"; fi + echo + echo "If any optional component is configured 'no' when you expected 'yes'" + echo "then you should check the preceding messages." +diff --git a/po/POTFILES b/po/POTFILES +index e51d543..1d6227c 100644 +--- a/po/POTFILES ++++ b/po/POTFILES +@@ -140,69 +140,6 @@ fish/tilde.c + fish/time.c + format/format.c + fuse/guestmount.c +-gobject/src/optargs-add_domain.c +-gobject/src/optargs-add_drive.c +-gobject/src/optargs-btrfs_filesystem_resize.c +-gobject/src/optargs-btrfs_fsck.c +-gobject/src/optargs-compress_device_out.c +-gobject/src/optargs-compress_out.c +-gobject/src/optargs-copy_device_to_device.c +-gobject/src/optargs-copy_device_to_file.c +-gobject/src/optargs-copy_file_to_device.c +-gobject/src/optargs-copy_file_to_file.c +-gobject/src/optargs-e2fsck.c +-gobject/src/optargs-fstrim.c +-gobject/src/optargs-grep.c +-gobject/src/optargs-hivex_open.c +-gobject/src/optargs-inspect_get_icon.c +-gobject/src/optargs-internal_test.c +-gobject/src/optargs-internal_test_63_optargs.c +-gobject/src/optargs-internal_test_only_optargs.c +-gobject/src/optargs-md_create.c +-gobject/src/optargs-mke2fs.c +-gobject/src/optargs-mkfs.c +-gobject/src/optargs-mkfs_btrfs.c +-gobject/src/optargs-mkswap.c +-gobject/src/optargs-mktemp.c +-gobject/src/optargs-mount_9p.c +-gobject/src/optargs-mount_local.c +-gobject/src/optargs-ntfsclone_out.c +-gobject/src/optargs-ntfsfix.c +-gobject/src/optargs-ntfsresize.c +-gobject/src/optargs-rsync.c +-gobject/src/optargs-rsync_in.c +-gobject/src/optargs-rsync_out.c +-gobject/src/optargs-set_e2attrs.c +-gobject/src/optargs-tar_in.c +-gobject/src/optargs-tar_out.c +-gobject/src/optargs-tune2fs.c +-gobject/src/optargs-umount.c +-gobject/src/optargs-umount_local.c +-gobject/src/optargs-xfs_admin.c +-gobject/src/optargs-xfs_growfs.c +-gobject/src/optargs-xfs_repair.c +-gobject/src/session.c +-gobject/src/struct-application.c +-gobject/src/struct-application2.c +-gobject/src/struct-btrfssubvolume.c +-gobject/src/struct-dirent.c +-gobject/src/struct-hivex_node.c +-gobject/src/struct-hivex_value.c +-gobject/src/struct-inotify_event.c +-gobject/src/struct-int_bool.c +-gobject/src/struct-isoinfo.c +-gobject/src/struct-lvm_lv.c +-gobject/src/struct-lvm_pv.c +-gobject/src/struct-lvm_vg.c +-gobject/src/struct-mdstat.c +-gobject/src/struct-partition.c +-gobject/src/struct-stat.c +-gobject/src/struct-statvfs.c +-gobject/src/struct-utsname.c +-gobject/src/struct-version.c +-gobject/src/struct-xattr.c +-gobject/src/struct-xfsinfo.c +-gobject/src/tristate.c + inspector/virt-inspector.c + java/com_redhat_et_libguestfs_GuestFS.c + lua/lua-guestfs.c +-- +1.7.4.1 + diff --git a/0010-EPEL-5-Remove-PHP-bindings.patch b/0010-EPEL-5-Remove-PHP-bindings.patch deleted file mode 100644 index 457d761..0000000 --- a/0010-EPEL-5-Remove-PHP-bindings.patch +++ /dev/null @@ -1,81 +0,0 @@ -From 1671ac91128a3f54b9a3761aa8583f0fa07d7a6f Mon Sep 17 00:00:00 2001 -From: Richard W.M. Jones -Date: Sun, 17 Jun 2012 23:01:43 +0100 -Subject: [PATCH 10/36] EPEL 5: Remove PHP bindings. - ---- - Makefile.am | 3 --- - configure.ac | 16 ---------------- - po/POTFILES | 1 - - 3 files changed, 0 insertions(+), 20 deletions(-) - -diff --git a/Makefile.am b/Makefile.am -index ee680dc..d263c0d 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -88,9 +88,6 @@ endif - if HAVE_HASKELL - SUBDIRS += haskell - endif --if HAVE_PHP --SUBDIRS += php --endif - if HAVE_LUA - SUBDIRS += lua lua/examples - endif -diff --git a/configure.ac b/configure.ac -index d596c52..944df72 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -1277,19 +1277,6 @@ AS_IF([test "x$enable_haskell" != "xno"],[ - ]) - AM_CONDITIONAL([HAVE_HASKELL],[test "x$GHC" != "xno"]) - --dnl PHP --PHP=no --AC_ARG_ENABLE([php], -- AS_HELP_STRING([--disable-php], [disable PHP language bindings]), -- [], -- [enable_php=yes]) --AS_IF([test "x$enable_php" != "xno"],[ -- PHP= -- AC_CHECK_PROG([PHP],[php],[php],[no]) -- AC_CHECK_PROG([PHPIZE],[phpize],[phpize],[no]) --]) --AM_CONDITIONAL([HAVE_PHP], [test "x$PHP" != "xno" && test "x$PHPIZE" != "xno"]) -- - dnl Lua - AC_ARG_ENABLE([lua], - AS_HELP_STRING([--disable-lua], [disable Lua language bindings]), -@@ -1390,7 +1377,6 @@ AC_CONFIG_FILES([Makefile - perl/Makefile - perl/Makefile.PL - perl/examples/Makefile -- php/Makefile - po-docs/Makefile - po-docs/ja/Makefile - po-docs/uk/Makefile -@@ -1466,8 +1452,6 @@ echo -n "Java bindings ....................... " - if test "x$HAVE_JAVA_TRUE" = "x"; then echo "yes"; else echo "no"; fi - echo -n "Haskell bindings .................... " - if test "x$HAVE_HASKELL_TRUE" = "x"; then echo "yes"; else echo "no"; fi --echo -n "PHP bindings ........................ " --if test "x$HAVE_PHP_TRUE" = "x"; then echo "yes"; else echo "no"; fi - echo -n "Lua bindings ........................ " - if test "x$HAVE_LUA_TRUE" = "x"; then echo "yes"; else echo "no"; fi - echo -diff --git a/po/POTFILES b/po/POTFILES -index 1d6227c..eda59e1 100644 ---- a/po/POTFILES -+++ b/po/POTFILES -@@ -149,7 +149,6 @@ perl/Guestfs.c - perl/bindtests.pl - perl/lib/Sys/Guestfs.pm - perl/lib/Sys/Guestfs/Lib.pm --php/extension/guestfs_php.c - python/guestfs-py-byhand.c - python/guestfs-py.c - rescue/test-virt-rescue.pl --- -1.7.4.1 - diff --git a/0011-EPEL-5-Define-le64toh-le32toh-if-not-defined.patch b/0011-EPEL-5-Define-le64toh-le32toh-if-not-defined.patch deleted file mode 100644 index dcb2cab..0000000 --- a/0011-EPEL-5-Define-le64toh-le32toh-if-not-defined.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 90271bd375465a71437724287d814c0ca7237d18 Mon Sep 17 00:00:00 2001 -From: Richard W.M. Jones -Date: Sun, 17 Jun 2012 22:17:06 +0100 -Subject: [PATCH 11/36] EPEL 5: Define le64toh, le32toh if not defined. - ---- - src/inspect-fs-windows.c | 16 ++++++++++++++++ - 1 files changed, 16 insertions(+), 0 deletions(-) - -diff --git a/src/inspect-fs-windows.c b/src/inspect-fs-windows.c -index a979775..1afaf26 100644 ---- a/src/inspect-fs-windows.c -+++ b/src/inspect-fs-windows.c -@@ -44,6 +44,22 @@ - #include "guestfs-internal-actions.h" - #include "guestfs_protocol.h" - -+#if __BYTE_ORDER == __LITTLE_ENDIAN -+#ifndef le64toh -+#define le64toh(x) (x) -+#endif -+#ifndef le32toh -+#define le32toh(x) (x) -+#endif -+#else /* __BYTE_ORDER == __BIG_ENDIAN */ -+#ifndef le64toh -+#define le64toh(x) bswap_64 (x) -+#endif -+#ifndef le32toh -+#define le32toh(x) bswap_32 (x) -+#endif -+#endif -+ - /* Compile all the regular expressions once when the shared library is - * loaded. PCRE is thread safe so we're supposedly OK here if - * multiple threads call into the libguestfs API functions below --- -1.7.4.1 - diff --git a/0011-EPEL-5-Remove-PHP-bindings.patch b/0011-EPEL-5-Remove-PHP-bindings.patch new file mode 100644 index 0000000..3c0a88d --- /dev/null +++ b/0011-EPEL-5-Remove-PHP-bindings.patch @@ -0,0 +1,81 @@ +From 40b7aaec13ed51f0876ab26ff264a8caba90f6ed Mon Sep 17 00:00:00 2001 +From: Richard W.M. Jones +Date: Sun, 17 Jun 2012 23:01:43 +0100 +Subject: [PATCH 11/37] EPEL 5: Remove PHP bindings. + +--- + Makefile.am | 3 --- + configure.ac | 16 ---------------- + po/POTFILES | 1 - + 3 files changed, 0 insertions(+), 20 deletions(-) + +diff --git a/Makefile.am b/Makefile.am +index ee680dc..d263c0d 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -88,9 +88,6 @@ endif + if HAVE_HASKELL + SUBDIRS += haskell + endif +-if HAVE_PHP +-SUBDIRS += php +-endif + if HAVE_LUA + SUBDIRS += lua lua/examples + endif +diff --git a/configure.ac b/configure.ac +index d596c52..944df72 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1277,19 +1277,6 @@ AS_IF([test "x$enable_haskell" != "xno"],[ + ]) + AM_CONDITIONAL([HAVE_HASKELL],[test "x$GHC" != "xno"]) + +-dnl PHP +-PHP=no +-AC_ARG_ENABLE([php], +- AS_HELP_STRING([--disable-php], [disable PHP language bindings]), +- [], +- [enable_php=yes]) +-AS_IF([test "x$enable_php" != "xno"],[ +- PHP= +- AC_CHECK_PROG([PHP],[php],[php],[no]) +- AC_CHECK_PROG([PHPIZE],[phpize],[phpize],[no]) +-]) +-AM_CONDITIONAL([HAVE_PHP], [test "x$PHP" != "xno" && test "x$PHPIZE" != "xno"]) +- + dnl Lua + AC_ARG_ENABLE([lua], + AS_HELP_STRING([--disable-lua], [disable Lua language bindings]), +@@ -1390,7 +1377,6 @@ AC_CONFIG_FILES([Makefile + perl/Makefile + perl/Makefile.PL + perl/examples/Makefile +- php/Makefile + po-docs/Makefile + po-docs/ja/Makefile + po-docs/uk/Makefile +@@ -1466,8 +1452,6 @@ echo -n "Java bindings ....................... " + if test "x$HAVE_JAVA_TRUE" = "x"; then echo "yes"; else echo "no"; fi + echo -n "Haskell bindings .................... " + if test "x$HAVE_HASKELL_TRUE" = "x"; then echo "yes"; else echo "no"; fi +-echo -n "PHP bindings ........................ " +-if test "x$HAVE_PHP_TRUE" = "x"; then echo "yes"; else echo "no"; fi + echo -n "Lua bindings ........................ " + if test "x$HAVE_LUA_TRUE" = "x"; then echo "yes"; else echo "no"; fi + echo +diff --git a/po/POTFILES b/po/POTFILES +index 1d6227c..eda59e1 100644 +--- a/po/POTFILES ++++ b/po/POTFILES +@@ -149,7 +149,6 @@ perl/Guestfs.c + perl/bindtests.pl + perl/lib/Sys/Guestfs.pm + perl/lib/Sys/Guestfs/Lib.pm +-php/extension/guestfs_php.c + python/guestfs-py-byhand.c + python/guestfs-py.c + rescue/test-virt-rescue.pl +-- +1.7.4.1 + diff --git a/0012-EPEL-5-Add-gnulib-utimensat-module.patch b/0012-EPEL-5-Add-gnulib-utimensat-module.patch deleted file mode 100644 index 413ac45..0000000 --- a/0012-EPEL-5-Add-gnulib-utimensat-module.patch +++ /dev/null @@ -1,38 +0,0 @@ -From fae035aa5c616179c1c6b638ac14f5f268bf41c2 Mon Sep 17 00:00:00 2001 -From: Richard W.M. Jones -Date: Sun, 17 Jun 2012 22:58:58 +0100 -Subject: [PATCH 12/36] EPEL 5: Add gnulib utimensat module. - -This function is missing in RHEL 5-era kernels. ---- - bootstrap | 1 + - m4/.gitignore | 1 + - 2 files changed, 2 insertions(+), 0 deletions(-) - -diff --git a/bootstrap b/bootstrap -index 931646b..da650ca 100755 ---- a/bootstrap -+++ b/bootstrap -@@ -89,6 +89,7 @@ strndup - symlinkat - sys_select - sys_wait -+utimensat - vasprintf - vc-list-files - warnings -diff --git a/m4/.gitignore b/m4/.gitignore -index b827552..a76d36f 100644 ---- a/m4/.gitignore -+++ b/m4/.gitignore -@@ -239,6 +239,7 @@ - /usleep.m4 - /utimbuf.m4 - /utimecmp.m4 -+/utimensat.m4 - /utimens.m4 - /utimes.m4 - /vasnprintf.m4 --- -1.7.4.1 - diff --git a/0012-EPEL-5-Define-le64toh-le32toh-if-not-defined.patch b/0012-EPEL-5-Define-le64toh-le32toh-if-not-defined.patch new file mode 100644 index 0000000..a0adfb7 --- /dev/null +++ b/0012-EPEL-5-Define-le64toh-le32toh-if-not-defined.patch @@ -0,0 +1,39 @@ +From 937bcc4cf2fc038dd3acff7a6dbb8c497513a627 Mon Sep 17 00:00:00 2001 +From: Richard W.M. Jones +Date: Sun, 17 Jun 2012 22:17:06 +0100 +Subject: [PATCH 12/37] EPEL 5: Define le64toh, le32toh if not defined. + +--- + src/inspect-fs-windows.c | 16 ++++++++++++++++ + 1 files changed, 16 insertions(+), 0 deletions(-) + +diff --git a/src/inspect-fs-windows.c b/src/inspect-fs-windows.c +index a979775..1afaf26 100644 +--- a/src/inspect-fs-windows.c ++++ b/src/inspect-fs-windows.c +@@ -44,6 +44,22 @@ + #include "guestfs-internal-actions.h" + #include "guestfs_protocol.h" + ++#if __BYTE_ORDER == __LITTLE_ENDIAN ++#ifndef le64toh ++#define le64toh(x) (x) ++#endif ++#ifndef le32toh ++#define le32toh(x) (x) ++#endif ++#else /* __BYTE_ORDER == __BIG_ENDIAN */ ++#ifndef le64toh ++#define le64toh(x) bswap_64 (x) ++#endif ++#ifndef le32toh ++#define le32toh(x) bswap_32 (x) ++#endif ++#endif ++ + /* Compile all the regular expressions once when the shared library is + * loaded. PCRE is thread safe so we're supposedly OK here if + * multiple threads call into the libguestfs API functions below +-- +1.7.4.1 + diff --git a/0013-EPEL-5-Add-gnulib-utimensat-module.patch b/0013-EPEL-5-Add-gnulib-utimensat-module.patch new file mode 100644 index 0000000..893b649 --- /dev/null +++ b/0013-EPEL-5-Add-gnulib-utimensat-module.patch @@ -0,0 +1,38 @@ +From 8f367f478a1219252ff2ed77d55f831f7b1a4889 Mon Sep 17 00:00:00 2001 +From: Richard W.M. Jones +Date: Sun, 17 Jun 2012 22:58:58 +0100 +Subject: [PATCH 13/37] EPEL 5: Add gnulib utimensat module. + +This function is missing in RHEL 5-era kernels. +--- + bootstrap | 1 + + m4/.gitignore | 1 + + 2 files changed, 2 insertions(+), 0 deletions(-) + +diff --git a/bootstrap b/bootstrap +index 931646b..da650ca 100755 +--- a/bootstrap ++++ b/bootstrap +@@ -89,6 +89,7 @@ strndup + symlinkat + sys_select + sys_wait ++utimensat + vasprintf + vc-list-files + warnings +diff --git a/m4/.gitignore b/m4/.gitignore +index b827552..a76d36f 100644 +--- a/m4/.gitignore ++++ b/m4/.gitignore +@@ -239,6 +239,7 @@ + /usleep.m4 + /utimbuf.m4 + /utimecmp.m4 ++/utimensat.m4 + /utimens.m4 + /utimes.m4 + /vasnprintf.m4 +-- +1.7.4.1 + diff --git a/0013-EPEL-5-Old-ocamlopt-didn-t-support-debugging-g-optio.patch b/0013-EPEL-5-Old-ocamlopt-didn-t-support-debugging-g-optio.patch deleted file mode 100644 index 34fa3f5..0000000 --- a/0013-EPEL-5-Old-ocamlopt-didn-t-support-debugging-g-optio.patch +++ /dev/null @@ -1,67 +0,0 @@ -From c7a9bdeeb7f3ae457c384cf62b664b978502932f Mon Sep 17 00:00:00 2001 -From: Richard W.M. Jones -Date: Sun, 17 Jun 2012 23:00:16 +0100 -Subject: [PATCH 13/36] EPEL 5: Old ocamlopt didn't support debugging (-g option). - ---- - ocaml/Makefile.am | 2 +- - resize/Makefile.am | 2 +- - sparsify/Makefile.am | 2 +- - sysprep/Makefile.am | 2 +- - 4 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/ocaml/Makefile.am b/ocaml/Makefile.am -index 5e8cba5..48ddc2c 100644 ---- a/ocaml/Makefile.am -+++ b/ocaml/Makefile.am -@@ -44,7 +44,7 @@ CLEANFILES += t/*.cmi t/*.cmo t/*.cmx t/*.o t/*.a t/*.so - if HAVE_OCAML - - OCAMLCFLAGS = -g -warn-error CDEFLMPSUVYZX --OCAMLOPTFLAGS = $(OCAMLCFLAGS) -+OCAMLOPTFLAGS = -warn-error CDEFLMPSUVYZX - - noinst_DATA = mlguestfs.cma mlguestfs.cmxa META - -diff --git a/resize/Makefile.am b/resize/Makefile.am -index c69ab44..542ae9a 100644 ---- a/resize/Makefile.am -+++ b/resize/Makefile.am -@@ -62,7 +62,7 @@ OCAMLPACKAGES += -package gettext-stub - endif - - OCAMLCFLAGS = -g -warn-error CDEFLMPSUVYZX $(OCAMLPACKAGES) --OCAMLOPTFLAGS = $(OCAMLCFLAGS) -+OCAMLOPTFLAGS = -warn-error CDEFLMPSUVYZX $(OCAMLPACKAGES) - - virt-resize: $(OBJECTS) - $(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) \ -diff --git a/sparsify/Makefile.am b/sparsify/Makefile.am -index b5eba63..329d801 100644 ---- a/sparsify/Makefile.am -+++ b/sparsify/Makefile.am -@@ -58,7 +58,7 @@ OCAMLPACKAGES += -package gettext-stub - endif - - OCAMLCFLAGS = -g -warn-error CDEFLMPSUVYZX $(OCAMLPACKAGES) --OCAMLOPTFLAGS = $(OCAMLCFLAGS) -+OCAMLOPTFLAGS = -warn-error CDEFLMPSUVYZX $(OCAMLPACKAGES) - - virt-sparsify: $(OBJECTS) - $(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) \ -diff --git a/sysprep/Makefile.am b/sysprep/Makefile.am -index e16a19d..392dd91 100644 ---- a/sysprep/Makefile.am -+++ b/sysprep/Makefile.am -@@ -108,7 +108,7 @@ OCAMLPACKAGES += -package gettext-stub - endif - - OCAMLCFLAGS = -g -warn-error CDEFLMPSUVYZX $(OCAMLPACKAGES) --OCAMLOPTFLAGS = $(OCAMLCFLAGS) -+OCAMLOPTFLAGS = -warn-error CDEFLMPSUVYZX $(OCAMLPACKAGES) - - virt-sysprep: $(OBJECTS) - $(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) \ --- -1.7.4.1 - diff --git a/0014-EPEL-5-Old-ocamlopt-didn-t-support-debugging-g-optio.patch b/0014-EPEL-5-Old-ocamlopt-didn-t-support-debugging-g-optio.patch new file mode 100644 index 0000000..b4e077b --- /dev/null +++ b/0014-EPEL-5-Old-ocamlopt-didn-t-support-debugging-g-optio.patch @@ -0,0 +1,67 @@ +From b597ef3e655bbc3d44972baab83800b9e50261d5 Mon Sep 17 00:00:00 2001 +From: Richard W.M. Jones +Date: Sun, 17 Jun 2012 23:00:16 +0100 +Subject: [PATCH 14/37] EPEL 5: Old ocamlopt didn't support debugging (-g option). + +--- + ocaml/Makefile.am | 2 +- + resize/Makefile.am | 2 +- + sparsify/Makefile.am | 2 +- + sysprep/Makefile.am | 2 +- + 4 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/ocaml/Makefile.am b/ocaml/Makefile.am +index 5e8cba5..48ddc2c 100644 +--- a/ocaml/Makefile.am ++++ b/ocaml/Makefile.am +@@ -44,7 +44,7 @@ CLEANFILES += t/*.cmi t/*.cmo t/*.cmx t/*.o t/*.a t/*.so + if HAVE_OCAML + + OCAMLCFLAGS = -g -warn-error CDEFLMPSUVYZX +-OCAMLOPTFLAGS = $(OCAMLCFLAGS) ++OCAMLOPTFLAGS = -warn-error CDEFLMPSUVYZX + + noinst_DATA = mlguestfs.cma mlguestfs.cmxa META + +diff --git a/resize/Makefile.am b/resize/Makefile.am +index c69ab44..542ae9a 100644 +--- a/resize/Makefile.am ++++ b/resize/Makefile.am +@@ -62,7 +62,7 @@ OCAMLPACKAGES += -package gettext-stub + endif + + OCAMLCFLAGS = -g -warn-error CDEFLMPSUVYZX $(OCAMLPACKAGES) +-OCAMLOPTFLAGS = $(OCAMLCFLAGS) ++OCAMLOPTFLAGS = -warn-error CDEFLMPSUVYZX $(OCAMLPACKAGES) + + virt-resize: $(OBJECTS) + $(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) \ +diff --git a/sparsify/Makefile.am b/sparsify/Makefile.am +index b5eba63..329d801 100644 +--- a/sparsify/Makefile.am ++++ b/sparsify/Makefile.am +@@ -58,7 +58,7 @@ OCAMLPACKAGES += -package gettext-stub + endif + + OCAMLCFLAGS = -g -warn-error CDEFLMPSUVYZX $(OCAMLPACKAGES) +-OCAMLOPTFLAGS = $(OCAMLCFLAGS) ++OCAMLOPTFLAGS = -warn-error CDEFLMPSUVYZX $(OCAMLPACKAGES) + + virt-sparsify: $(OBJECTS) + $(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) \ +diff --git a/sysprep/Makefile.am b/sysprep/Makefile.am +index e16a19d..392dd91 100644 +--- a/sysprep/Makefile.am ++++ b/sysprep/Makefile.am +@@ -108,7 +108,7 @@ OCAMLPACKAGES += -package gettext-stub + endif + + OCAMLCFLAGS = -g -warn-error CDEFLMPSUVYZX $(OCAMLPACKAGES) +-OCAMLOPTFLAGS = $(OCAMLCFLAGS) ++OCAMLOPTFLAGS = -warn-error CDEFLMPSUVYZX $(OCAMLPACKAGES) + + virt-sysprep: $(OBJECTS) + $(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) \ +-- +1.7.4.1 + diff --git a/0014-EPEL-5-Replace-format6-with-format4-in-OCaml-gettext.patch b/0014-EPEL-5-Replace-format6-with-format4-in-OCaml-gettext.patch deleted file mode 100644 index c117981..0000000 --- a/0014-EPEL-5-Replace-format6-with-format4-in-OCaml-gettext.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 154de10cc6f0b318d120523ca97306bcce6de872 Mon Sep 17 00:00:00 2001 -From: Richard W.M. Jones -Date: Mon, 18 Jun 2012 08:35:14 +0100 -Subject: [PATCH 14/36] EPEL 5: Replace format6 with format4 in OCaml gettext routines. - ---- - configure.ac | 10 +++++----- - 1 files changed, 5 insertions(+), 5 deletions(-) - -diff --git a/configure.ac b/configure.ac -index 944df72..c72038c 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -961,14 +961,14 @@ EOF - cat <>$output - module Gettext = struct - external s_ : string -> string = "%identity" -- external f_ : ('a, 'b, 'c, 'd, 'e, 'f) format6 -- -> ('a, 'b, 'c, 'd, 'e, 'f) format6 -+ external f_ : ('a, 'b, 'c, 'd) format4 -+ -> ('a, 'b, 'c, 'd) format4 - = "%identity" - let sn_ : string -> string -> int -> string - = fun s p n -> if n = 1 then s else p -- let fn_ : ('a, 'b, 'c, 'd, 'e, 'f) format6 -- -> ('a, 'b, 'c, 'd, 'e, 'f) format6 -- -> int -> ('a, 'b, 'c, 'd, 'e, 'f) format6 -+ let fn_ : ('a, 'b, 'c, 'd) format4 -+ -> ('a, 'b, 'c, 'd) format4 -+ -> int -> ('a, 'b, 'c, 'd) format4 - = fun s p n -> if n = 1 then s else p - end - EOF --- -1.7.4.1 - diff --git a/0015-EPEL-5-Pass-preserve-dup-deps-explicitly-to-libtool.patch b/0015-EPEL-5-Pass-preserve-dup-deps-explicitly-to-libtool.patch deleted file mode 100644 index ec78af4..0000000 --- a/0015-EPEL-5-Pass-preserve-dup-deps-explicitly-to-libtool.patch +++ /dev/null @@ -1,27 +0,0 @@ -From fedc248bd1f29c608530e81cbf39aa36e056c85b Mon Sep 17 00:00:00 2001 -From: Richard W.M. Jones -Date: Mon, 18 Jun 2012 12:18:35 +0100 -Subject: [PATCH 15/36] EPEL 5: Pass --preserve-dup-deps explicitly to libtool. - -See this thread: -https://lists.gnu.org/archive/html/bug-gnulib/2012-06/msg00162.html ---- - configure.ac | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/configure.ac b/configure.ac -index c72038c..d26b815 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -1334,7 +1334,7 @@ AC_SUBST(MAX_PROC_NR) - - dnl Replace libtool with a wrapper that clobbers dependency_libs in *.la files - dnl http://lists.fedoraproject.org/pipermail/devel/2010-November/146343.html --LIBTOOL='bash $(top_srcdir)/libtool-kill-dependency_libs.sh $(top_builddir)/libtool' -+LIBTOOL='bash $(top_srcdir)/libtool-kill-dependency_libs.sh $(top_builddir)/libtool --preserve-dup-deps' - AC_SUBST([LIBTOOL]) - - dnl Produce output files. --- -1.7.4.1 - diff --git a/0015-EPEL-5-Replace-format6-with-format4-in-OCaml-gettext.patch b/0015-EPEL-5-Replace-format6-with-format4-in-OCaml-gettext.patch new file mode 100644 index 0000000..883dcd6 --- /dev/null +++ b/0015-EPEL-5-Replace-format6-with-format4-in-OCaml-gettext.patch @@ -0,0 +1,36 @@ +From 50048d8ed4e6ca760d475c5f7e712f1ef7989ac0 Mon Sep 17 00:00:00 2001 +From: Richard W.M. Jones +Date: Mon, 18 Jun 2012 08:35:14 +0100 +Subject: [PATCH 15/37] EPEL 5: Replace format6 with format4 in OCaml gettext routines. + +--- + configure.ac | 10 +++++----- + 1 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 944df72..c72038c 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -961,14 +961,14 @@ EOF + cat <>$output + module Gettext = struct + external s_ : string -> string = "%identity" +- external f_ : ('a, 'b, 'c, 'd, 'e, 'f) format6 +- -> ('a, 'b, 'c, 'd, 'e, 'f) format6 ++ external f_ : ('a, 'b, 'c, 'd) format4 ++ -> ('a, 'b, 'c, 'd) format4 + = "%identity" + let sn_ : string -> string -> int -> string + = fun s p n -> if n = 1 then s else p +- let fn_ : ('a, 'b, 'c, 'd, 'e, 'f) format6 +- -> ('a, 'b, 'c, 'd, 'e, 'f) format6 +- -> int -> ('a, 'b, 'c, 'd, 'e, 'f) format6 ++ let fn_ : ('a, 'b, 'c, 'd) format4 ++ -> ('a, 'b, 'c, 'd) format4 ++ -> int -> ('a, 'b, 'c, 'd) format4 + = fun s p n -> if n = 1 then s else p + end + EOF +-- +1.7.4.1 + diff --git a/0016-EPEL-5-Pass-preserve-dup-deps-explicitly-to-libtool.patch b/0016-EPEL-5-Pass-preserve-dup-deps-explicitly-to-libtool.patch new file mode 100644 index 0000000..ce7aa56 --- /dev/null +++ b/0016-EPEL-5-Pass-preserve-dup-deps-explicitly-to-libtool.patch @@ -0,0 +1,27 @@ +From bcbd094830abf6431d2cc6c54909ec04313409b7 Mon Sep 17 00:00:00 2001 +From: Richard W.M. Jones +Date: Mon, 18 Jun 2012 12:18:35 +0100 +Subject: [PATCH 16/37] EPEL 5: Pass --preserve-dup-deps explicitly to libtool. + +See this thread: +https://lists.gnu.org/archive/html/bug-gnulib/2012-06/msg00162.html +--- + configure.ac | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/configure.ac b/configure.ac +index c72038c..d26b815 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1334,7 +1334,7 @@ AC_SUBST(MAX_PROC_NR) + + dnl Replace libtool with a wrapper that clobbers dependency_libs in *.la files + dnl http://lists.fedoraproject.org/pipermail/devel/2010-November/146343.html +-LIBTOOL='bash $(top_srcdir)/libtool-kill-dependency_libs.sh $(top_builddir)/libtool' ++LIBTOOL='bash $(top_srcdir)/libtool-kill-dependency_libs.sh $(top_builddir)/libtool --preserve-dup-deps' + AC_SUBST([LIBTOOL]) + + dnl Produce output files. +-- +1.7.4.1 + diff --git a/0016-EPEL-5-Remove-id-from-drive-parameter-on-qemu-comman.patch b/0016-EPEL-5-Remove-id-from-drive-parameter-on-qemu-comman.patch deleted file mode 100644 index f568c67..0000000 --- a/0016-EPEL-5-Remove-id-from-drive-parameter-on-qemu-comman.patch +++ /dev/null @@ -1,41 +0,0 @@ -From ad25114b2b3f996d476b6fd22608a811f86eb92f Mon Sep 17 00:00:00 2001 -From: Richard W.M. Jones -Date: Mon, 18 Jun 2012 17:21:30 +0100 -Subject: [PATCH 16/36] EPEL 5: Remove id= from -drive parameter on qemu command line. - ---- - src/launch-appliance.c | 5 ++--- - 1 files changed, 2 insertions(+), 3 deletions(-) - -diff --git a/src/launch-appliance.c b/src/launch-appliance.c -index 10f63f1..62ab76e 100644 ---- a/src/launch-appliance.c -+++ b/src/launch-appliance.c -@@ -339,7 +339,7 @@ launch_appliance (guestfs_h *g, const char *arg) - size_t buf2_len = strlen (appliance) + 64; - char buf2[buf2_len]; - add_cmdline (g, "-drive"); -- snprintf (buf2, buf2_len, "file=%s,snapshot=on,id=appliance,if=%s%s", -+ snprintf (buf2, buf2_len, "file=%s,snapshot=on,if=%s%s", - appliance, virtio_scsi ? "none" : "virtio", cachemode); - add_cmdline (g, buf2); - -@@ -957,14 +957,13 @@ qemu_drive_param (guestfs_h *g, const struct drive *drv, size_t index) - else - iface = "virtio"; - -- snprintf (&r[i], len-i, "%s%s%s%s%s%s,id=hd%zu,if=%s", -+ snprintf (&r[i], len-i, "%s%s%s%s%s%s,if=%s", - drv->readonly ? ",snapshot=on" : "", - drv->use_cache_none ? ",cache=none" : "", - drv->format ? ",format=" : "", - drv->format ? drv->format : "", - drv->disk_label ? ",serial=" : "", - drv->disk_label ? drv->disk_label : "", -- index, - iface); - - return r; /* caller frees */ --- -1.7.4.1 - diff --git a/0017-EPEL-5-Add-null-vmchannel-back-for-qemu-without-virt.patch b/0017-EPEL-5-Add-null-vmchannel-back-for-qemu-without-virt.patch deleted file mode 100644 index d0fe18c..0000000 --- a/0017-EPEL-5-Add-null-vmchannel-back-for-qemu-without-virt.patch +++ /dev/null @@ -1,509 +0,0 @@ -From 16a1d7d70609283c75ddcfd59b2289d4411519ba Mon Sep 17 00:00:00 2001 -From: Richard W.M. Jones -Date: Mon, 18 Jun 2012 16:06:34 +0100 -Subject: [PATCH 17/36] EPEL 5: Add "null vmchannel" back for qemu without virtio-serial support. - ---- - appliance/init | 4 +- - daemon/guestfsd.c | 99 ++++++++++++++++++++++-- - src/guestfs-internal.h | 2 +- - src/launch-appliance.c | 196 ++++++++++++++++++++++++++++++++++-------------- - src/launch.c | 4 +- - 5 files changed, 236 insertions(+), 69 deletions(-) - -diff --git a/appliance/init b/appliance/init -index dee4efc..813cd20 100755 ---- a/appliance/init -+++ b/appliance/init -@@ -77,10 +77,10 @@ hwclock -u -s - ip addr add 127.0.0.1/8 brd + dev lo scope host - ip link set dev lo up - --ip addr add 169.254.2.10/16 brd + dev eth0 scope global -+ip addr add 10.0.2.0/24 brd + dev eth0 scope global - ip link set dev eth0 up - --ip route add default via 169.254.2.2 -+ip route add default via 10.0.2.2 - - # Scan for MDs. - mdadm -As --auto=yes --run -diff --git a/daemon/guestfsd.c b/daemon/guestfsd.c -index 254e0ea..bcb836a 100644 ---- a/daemon/guestfsd.c -+++ b/daemon/guestfsd.c -@@ -118,9 +118,6 @@ int autosync_umount = 1; - /* Not used explicitly, but required by the gnulib 'error' module. */ - const char *program_name = "guestfsd"; - --/* Name of the virtio-serial channel. */ --#define VIRTIO_SERIAL_CHANNEL "/dev/virtio-ports/org.libguestfs.channel.0" -- - static void - usage (void) - { -@@ -139,6 +136,7 @@ main (int argc, char *argv[]) - }; - int c; - char *cmdline; -+ char *vmchannel = NULL; - - ignore_value (chdir ("/")); - -@@ -210,8 +208,6 @@ main (int argc, char *argv[]) - printf ("could not read linux command line\n"); - } - -- free (cmdline); -- - #ifndef WIN32 - /* Make sure SIGPIPE doesn't kill us. */ - struct sigaction sa; -@@ -253,9 +249,94 @@ main (int argc, char *argv[]) - */ - copy_lvm (); - -- /* Connect to virtio-serial channel. */ -- int sock = open (VIRTIO_SERIAL_CHANNEL, O_RDWR|O_CLOEXEC); -+ /* Get the vmchannel string. -+ * -+ * Sources: -+ * --channel/-c option on the command line -+ * guestfs_vmchannel=... from the kernel command line -+ * guestfs=... from the kernel command line -+ * built-in default -+ * -+ * At the moment we expect this to contain "tcp:ip:port" but in -+ * future it might contain a device name, eg. "/dev/vcon4" for -+ * virtio-console vmchannel. -+ */ -+ if (cmdline) { -+ char *p; -+ size_t len; -+ -+ p = strstr (cmdline, "guestfs_vmchannel="); -+ if (p) { -+ len = strcspn (p + 18, " \t\n"); -+ vmchannel = strndup (p + 18, len); -+ if (!vmchannel) { -+ perror ("strndup"); -+ exit (EXIT_FAILURE); -+ } -+ } -+ } -+ -+ /* Default vmchannel. */ -+ if (vmchannel == NULL) -+ goto no_vmchannel; -+ -+ if (verbose) -+ printf ("vmchannel: %s\n", vmchannel); -+ -+ /* Connect to vmchannel. */ -+ int sock = -1; -+ -+ if (STREQLEN (vmchannel, "tcp:", 4)) { -+ /* Resolve the hostname. */ -+ struct addrinfo *res, *rr; -+ struct addrinfo hints; -+ int r; -+ char *host, *port; -+ -+ host = vmchannel+4; -+ port = strchr (host, ':'); -+ if (port) { -+ port[0] = '\0'; -+ port++; -+ } else { -+ fprintf (stderr, "vmchannel: expecting \"tcp::\": %s\n", -+ vmchannel); -+ exit (EXIT_FAILURE); -+ } -+ -+ memset (&hints, 0, sizeof hints); -+ hints.ai_socktype = SOCK_STREAM; -+ hints.ai_flags = AI_ADDRCONFIG; -+ r = getaddrinfo (host, port, &hints, &res); -+ if (r != 0) { -+ fprintf (stderr, "%s:%s: %s\n", -+ host, port, gai_strerror (r)); -+ exit (EXIT_FAILURE); -+ } -+ -+ /* Connect to the given TCP socket. */ -+ for (rr = res; rr != NULL; rr = rr->ai_next) { -+ sock = socket (rr->ai_family, rr->ai_socktype, rr->ai_protocol); -+ if (sock != -1) { -+ if (connect (sock, rr->ai_addr, rr->ai_addrlen) == 0) -+ break; -+ perror ("connect"); -+ -+ close (sock); -+ sock = -1; -+ } -+ } -+ freeaddrinfo (res); -+ } else { -+ fprintf (stderr, -+ "unknown vmchannel connection type: %s\n" -+ "expecting \"tcp::\"\n", -+ vmchannel); -+ exit (EXIT_FAILURE); -+ } -+ - if (sock == -1) { -+ no_vmchannel: - fprintf (stderr, - "\n" - "Failed to connect to virtio-serial channel.\n" -@@ -269,7 +350,7 @@ main (int argc, char *argv[]) - "output to the libguestfs developers, either in a bug report\n" - "or on the libguestfs redhat com mailing list.\n" - "\n"); -- perror (VIRTIO_SERIAL_CHANNEL); -+ perror ("last error"); - exit (EXIT_FAILURE); - } - -@@ -300,6 +381,8 @@ main (int argc, char *argv[]) - - xdr_destroy (&xdr); - -+ free (cmdline); -+ - /* Enter the main loop, reading and performing actions. */ - main_loop (sock); - -diff --git a/src/guestfs-internal.h b/src/guestfs-internal.h -index dab8224..a40682a 100644 ---- a/src/guestfs-internal.h -+++ b/src/guestfs-internal.h -@@ -510,7 +510,7 @@ extern void guestfs___rollback_drives (guestfs_h *g, size_t); - extern void guestfs___launch_failed_error (guestfs_h *g); - extern void guestfs___add_dummy_appliance_drive (guestfs_h *g); - extern void guestfs___free_drives (guestfs_h *g); --extern char *guestfs___appliance_command_line (guestfs_h *g, const char *appliance_dev, int flags); -+extern char *guestfs___appliance_command_line (guestfs_h *g, const char *appliance_dev, int flags, const char *vmchannel); - #define APPLIANCE_COMMAND_LINE_IS_TCG 1 - - /* launch-appliance.c */ -diff --git a/src/launch-appliance.c b/src/launch-appliance.c -index 62ab76e..570f6cf 100644 ---- a/src/launch-appliance.c -+++ b/src/launch-appliance.c -@@ -74,12 +74,16 @@ free_regexps (void) - pcre_free (re_major_minor); - } - -+#define NETWORK "10.0.2.0/24" -+#define ROUTER "10.0.2.2" -+ - static int is_openable (guestfs_h *g, const char *path, int flags); - static void print_qemu_command_line (guestfs_h *g, char **argv); - static int qemu_supports (guestfs_h *g, const char *option); - static int qemu_supports_device (guestfs_h *g, const char *device_name); - static int qemu_supports_virtio_scsi (guestfs_h *g); - static char *qemu_drive_param (guestfs_h *g, const struct drive *drv, size_t index); -+static int check_peer_euid (guestfs_h *g, int sock, uid_t *rtn); - - /* Functions to build up the qemu command line. These are only run - * in the child process so no clean-up is required. -@@ -169,7 +173,9 @@ launch_appliance (guestfs_h *g, const char *arg) - int r; - int wfd[2], rfd[2]; - char guestfsd_sock[256]; -- struct sockaddr_un addr; -+ struct sockaddr_in addr; -+ socklen_t addrlen = sizeof addr; -+ int null_vmchannel_port; - CLEANUP_FREE char *kernel = NULL, *initrd = NULL, *appliance = NULL; - int has_appliance_drive; - uint32_t size; -@@ -203,37 +209,43 @@ launch_appliance (guestfs_h *g, const char *arg) - if (qemu_supports (g, NULL) == -1) - goto cleanup0; - -- /* Using virtio-serial, we need to create a local Unix domain socket -- * for qemu to connect to. -+ /* "Null vmchannel" implementation: We allocate a random port -+ * number on the host, and the daemon connects back to it. To -+ * make this secure, we check that the peer UID is the same as our -+ * UID. This requires SLIRP (user mode networking in qemu). - */ -- snprintf (guestfsd_sock, sizeof guestfsd_sock, "%s/guestfsd.sock", g->tmpdir); -- unlink (guestfsd_sock); -- -- g->sock = socket (AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC, 0); -+ g->sock = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP); - if (g->sock == -1) { - perrorf (g, "socket"); - goto cleanup0; - } - -- if (fcntl (g->sock, F_SETFL, O_NONBLOCK) == -1) { -- perrorf (g, "fcntl"); -+ addr.sin_family = AF_INET; -+ addr.sin_port = htons (0); -+ addr.sin_addr.s_addr = htonl (INADDR_LOOPBACK); -+ if (bind (g->sock, (struct sockaddr *) &addr, addrlen) == -1) { -+ perrorf (g, "bind"); - goto cleanup0; - } - -- addr.sun_family = AF_UNIX; -- strncpy (addr.sun_path, guestfsd_sock, UNIX_PATH_MAX); -- addr.sun_path[UNIX_PATH_MAX-1] = '\0'; -+ if (listen (g->sock, 256) == -1) { -+ perrorf (g, "listen"); -+ goto cleanup0; -+ } - -- if (bind (g->sock, &addr, sizeof addr) == -1) { -- perrorf (g, "bind"); -+ if (getsockname (g->sock, (struct sockaddr *) &addr, &addrlen) == -1) { -+ perrorf (g, "getsockname"); - goto cleanup0; - } - -- if (listen (g->sock, 1) == -1) { -- perrorf (g, "listen"); -+ if (fcntl (g->sock, F_SETFL, O_NONBLOCK) == -1) { -+ perrorf (g, "fcntl"); - goto cleanup0; - } - -+ null_vmchannel_port = ntohs (addr.sin_port); -+ debug (g, "null_vmchannel_port = %d", null_vmchannel_port); -+ - if (!g->direct) { - if (pipe (wfd) == -1 || pipe (rfd) == -1) { - perrorf (g, "pipe"); -@@ -412,23 +424,9 @@ launch_appliance (guestfs_h *g, const char *arg) - if (qemu_supports (g, "-rtc-td-hack")) - add_cmdline (g, "-rtc-td-hack"); - -- /* Create the virtio serial bus. */ -- add_cmdline (g, "-device"); -- add_cmdline (g, "virtio-serial"); -- --#if 0 -- /* Use virtio-console (a variant form of virtio-serial) for the -- * guest's serial console. -- */ -- add_cmdline (g, "-chardev"); -- add_cmdline (g, "stdio,id=console"); -- add_cmdline (g, "-device"); -- add_cmdline (g, "virtconsole,chardev=console,name=org.libguestfs.console.0"); --#else -- /* When the above works ... until then: */ -+ /* Serial console. */ - add_cmdline (g, "-serial"); - add_cmdline (g, "stdio"); --#endif - - if (qemu_supports_device (g, "Serial Graphics Adapter")) { - /* Use sgabios instead of vgabios. This means we'll see BIOS -@@ -441,12 +439,16 @@ launch_appliance (guestfs_h *g, const char *arg) - add_cmdline (g, "sga"); - } - -- /* Set up virtio-serial for the communications channel. */ -- add_cmdline (g, "-chardev"); -- snprintf (buf, sizeof buf, "socket,path=%s,id=channel0", guestfsd_sock); -- add_cmdline (g, buf); -- add_cmdline (g, "-device"); -- add_cmdline (g, "virtserialport,chardev=channel0,name=org.libguestfs.channel.0"); -+ /* Null vmchannel. */ -+ add_cmdline (g, "-net"); -+ add_cmdline (g, "user,vlan=0,net=" NETWORK); -+ add_cmdline (g, "-net"); -+ add_cmdline (g, "nic,model=virtio,vlan=0"); -+ -+ snprintf (buf, sizeof buf, -+ "guestfs_vmchannel=tcp:" ROUTER ":%d", -+ null_vmchannel_port); -+ char *vmchannel = strdup (buf); - - #ifdef VALGRIND_DAEMON - /* Set up virtio-serial channel for valgrind messages. */ -@@ -458,14 +460,6 @@ launch_appliance (guestfs_h *g, const char *arg) - add_cmdline (g, "virtserialport,chardev=valgrind,name=org.libguestfs.valgrind"); - #endif - -- /* Enable user networking. */ -- if (g->enable_network) { -- add_cmdline (g, "-netdev"); -- add_cmdline (g, "user,id=usernet,net=169.254.0.0/16"); -- add_cmdline (g, "-device"); -- add_cmdline (g, "virtio-net-pci,netdev=usernet"); -- } -- - add_cmdline (g, "-kernel"); - add_cmdline (g, kernel); - add_cmdline (g, "-initrd"); -@@ -473,7 +467,7 @@ launch_appliance (guestfs_h *g, const char *arg) - - add_cmdline (g, "-append"); - CLEANUP_FREE char *cmdline = -- guestfs___appliance_command_line (g, appliance_dev, 0); -+ guestfs___appliance_command_line (g, appliance_dev, 0, vmchannel); - add_cmdline (g, cmdline); - - /* Finish off the command line. */ -@@ -617,19 +611,30 @@ launch_appliance (guestfs_h *g, const char *arg) - - g->state = LAUNCHING; - -- /* Wait for qemu to start and to connect back to us via -- * virtio-serial and send the GUESTFS_LAUNCH_FLAG message. -+ /* Null vmchannel implementation: We listen on g->sock for a -+ * connection. The connection could come from any local process -+ * so we must check it comes from the appliance (or at least -+ * from our UID) for security reasons. - */ -- r = guestfs___accept_from_daemon (g); -- if (r == -1) -- goto cleanup1; -+ r = -1; -+ while (r == -1) { -+ uid_t uid; - -- /* NB: We reach here just because qemu has opened the socket. It -- * does not mean the daemon is up until we read the -- * GUESTFS_LAUNCH_FLAG below. Failures in qemu startup can still -- * happen even if we reach here, even early failures like not being -- * able to open a drive. -- */ -+ r = guestfs___accept_from_daemon (g); -+ if (r == -1) -+ goto cleanup1; -+ -+ if (check_peer_euid (g, r, &uid) == -1) -+ goto cleanup1; -+ if (uid != geteuid ()) { -+ fprintf (stderr, -+ "libguestfs: warning: unexpected connection from UID %d to port %d\n", -+ uid, null_vmchannel_port); -+ close (r); -+ r = -1; -+ continue; -+ } -+ } - - /* Close the listening socket. */ - if (close (g->sock) != 0) { -@@ -981,6 +986,83 @@ guestfs___drive_name (size_t index, char *ret) - return ret; - } - -+/* Check the peer effective UID for a TCP socket. Ideally we'd like -+ * SO_PEERCRED for a loopback TCP socket. This isn't possible on -+ * Linux (but it is on Solaris!) so we read /proc/net/tcp instead. -+ */ -+static int -+check_peer_euid (guestfs_h *g, int sock, uid_t *rtn) -+{ -+ struct sockaddr_in peer; -+ socklen_t addrlen = sizeof peer; -+ -+ if (getpeername (sock, (struct sockaddr *) &peer, &addrlen) == -1) { -+ perrorf (g, "getpeername"); -+ return -1; -+ } -+ -+ if (peer.sin_family != AF_INET || -+ ntohl (peer.sin_addr.s_addr) != INADDR_LOOPBACK) { -+ error (g, "check_peer_euid: unexpected connection from non-IPv4, non-loopback peer (family = %d, addr = %s)", -+ peer.sin_family, inet_ntoa (peer.sin_addr)); -+ return -1; -+ } -+ -+ struct sockaddr_in our; -+ addrlen = sizeof our; -+ if (getsockname (sock, (struct sockaddr *) &our, &addrlen) == -1) { -+ perrorf (g, "getsockname"); -+ return -1; -+ } -+ -+ FILE *fp = fopen ("/proc/net/tcp", "r"); -+ if (fp == NULL) { -+ perrorf (g, "/proc/net/tcp"); -+ return -1; -+ } -+ -+ char line[256]; -+ if (fgets (line, sizeof line, fp) == NULL) { /* Drop first line. */ -+ error (g, "unexpected end of file in /proc/net/tcp"); -+ fclose (fp); -+ return -1; -+ } -+ -+ while (fgets (line, sizeof line, fp) != NULL) { -+ unsigned line_our_addr, line_our_port, line_peer_addr, line_peer_port; -+ int dummy0, dummy1, dummy2, dummy3, dummy4, dummy5, dummy6; -+ int line_uid; -+ -+ if (sscanf (line, "%d:%08X:%04X %08X:%04X %02X %08X:%08X %02X:%08X %08X %d", -+ &dummy0, -+ &line_our_addr, &line_our_port, -+ &line_peer_addr, &line_peer_port, -+ &dummy1, &dummy2, &dummy3, &dummy4, &dummy5, &dummy6, -+ &line_uid) == 12) { -+ /* Note about /proc/net/tcp: local_address and rem_address are -+ * always in network byte order. However the port part is -+ * always in host byte order. -+ * -+ * The sockname and peername that we got above are in network -+ * byte order. So we have to byte swap the port but not the -+ * address part. -+ */ -+ if (line_our_addr == our.sin_addr.s_addr && -+ line_our_port == ntohs (our.sin_port) && -+ line_peer_addr == peer.sin_addr.s_addr && -+ line_peer_port == ntohs (peer.sin_port)) { -+ *rtn = line_uid; -+ fclose (fp); -+ return 0; -+ } -+ } -+ } -+ -+ error (g, "check_peer_euid: no matching TCP connection found in /proc/net/tcp"); -+ fclose (fp); -+ return -1; -+} -+ - static int - shutdown_appliance (guestfs_h *g, int check_for_errors) - { -diff --git a/src/launch.c b/src/launch.c -index 7c37667..b634b32 100644 ---- a/src/launch.c -+++ b/src/launch.c -@@ -809,7 +809,7 @@ guestfs__get_state (guestfs_h *g) - - char * - guestfs___appliance_command_line (guestfs_h *g, const char *appliance_dev, -- int flags) -+ int flags, const char *vmchannel) - { - char *term = getenv ("TERM"); - char *ret; -@@ -837,12 +837,14 @@ guestfs___appliance_command_line (guestfs_h *g, const char *appliance_dev, - " cgroup_disable=memory" /* saves us about 5 MB of RAM */ - " root=%s" /* root (appliance_dev) */ - " %s" /* selinux */ -+ " %s" /* vmchannel */ - "%s" /* verbose */ - " TERM=%s" /* TERM environment variable */ - "%s%s", /* append */ - lpj_s, - appliance_dev, - g->selinux ? "selinux=1 enforcing=0" : "selinux=0", -+ vmchannel, - g->verbose ? " guestfs_verbose=1" : "", - term ? term : "linux", - g->append ? " " : "", g->append ? g->append : ""); --- -1.7.4.1 - diff --git a/0017-EPEL-5-Remove-id-from-drive-parameter-on-qemu-comman.patch b/0017-EPEL-5-Remove-id-from-drive-parameter-on-qemu-comman.patch new file mode 100644 index 0000000..c1872c4 --- /dev/null +++ b/0017-EPEL-5-Remove-id-from-drive-parameter-on-qemu-comman.patch @@ -0,0 +1,41 @@ +From dd6987286760d8423b8cc7f5fba5b9720adc85a2 Mon Sep 17 00:00:00 2001 +From: Richard W.M. Jones +Date: Mon, 18 Jun 2012 17:21:30 +0100 +Subject: [PATCH 17/37] EPEL 5: Remove id= from -drive parameter on qemu command line. + +--- + src/launch-appliance.c | 5 ++--- + 1 files changed, 2 insertions(+), 3 deletions(-) + +diff --git a/src/launch-appliance.c b/src/launch-appliance.c +index 10f63f1..62ab76e 100644 +--- a/src/launch-appliance.c ++++ b/src/launch-appliance.c +@@ -339,7 +339,7 @@ launch_appliance (guestfs_h *g, const char *arg) + size_t buf2_len = strlen (appliance) + 64; + char buf2[buf2_len]; + add_cmdline (g, "-drive"); +- snprintf (buf2, buf2_len, "file=%s,snapshot=on,id=appliance,if=%s%s", ++ snprintf (buf2, buf2_len, "file=%s,snapshot=on,if=%s%s", + appliance, virtio_scsi ? "none" : "virtio", cachemode); + add_cmdline (g, buf2); + +@@ -957,14 +957,13 @@ qemu_drive_param (guestfs_h *g, const struct drive *drv, size_t index) + else + iface = "virtio"; + +- snprintf (&r[i], len-i, "%s%s%s%s%s%s,id=hd%zu,if=%s", ++ snprintf (&r[i], len-i, "%s%s%s%s%s%s,if=%s", + drv->readonly ? ",snapshot=on" : "", + drv->use_cache_none ? ",cache=none" : "", + drv->format ? ",format=" : "", + drv->format ? drv->format : "", + drv->disk_label ? ",serial=" : "", + drv->disk_label ? drv->disk_label : "", +- index, + iface); + + return r; /* caller frees */ +-- +1.7.4.1 + diff --git a/0018-EPEL-5-Add-null-vmchannel-back-for-qemu-without-virt.patch b/0018-EPEL-5-Add-null-vmchannel-back-for-qemu-without-virt.patch new file mode 100644 index 0000000..e177c5e --- /dev/null +++ b/0018-EPEL-5-Add-null-vmchannel-back-for-qemu-without-virt.patch @@ -0,0 +1,509 @@ +From 37048556d6e2a0179b8344956875c5a64efb6904 Mon Sep 17 00:00:00 2001 +From: Richard W.M. Jones +Date: Mon, 18 Jun 2012 16:06:34 +0100 +Subject: [PATCH 18/37] EPEL 5: Add "null vmchannel" back for qemu without virtio-serial support. + +--- + appliance/init | 4 +- + daemon/guestfsd.c | 99 ++++++++++++++++++++++-- + src/guestfs-internal.h | 2 +- + src/launch-appliance.c | 196 ++++++++++++++++++++++++++++++++++-------------- + src/launch.c | 4 +- + 5 files changed, 236 insertions(+), 69 deletions(-) + +diff --git a/appliance/init b/appliance/init +index dee4efc..813cd20 100755 +--- a/appliance/init ++++ b/appliance/init +@@ -77,10 +77,10 @@ hwclock -u -s + ip addr add 127.0.0.1/8 brd + dev lo scope host + ip link set dev lo up + +-ip addr add 169.254.2.10/16 brd + dev eth0 scope global ++ip addr add 10.0.2.0/24 brd + dev eth0 scope global + ip link set dev eth0 up + +-ip route add default via 169.254.2.2 ++ip route add default via 10.0.2.2 + + # Scan for MDs. + mdadm -As --auto=yes --run +diff --git a/daemon/guestfsd.c b/daemon/guestfsd.c +index 254e0ea..bcb836a 100644 +--- a/daemon/guestfsd.c ++++ b/daemon/guestfsd.c +@@ -118,9 +118,6 @@ int autosync_umount = 1; + /* Not used explicitly, but required by the gnulib 'error' module. */ + const char *program_name = "guestfsd"; + +-/* Name of the virtio-serial channel. */ +-#define VIRTIO_SERIAL_CHANNEL "/dev/virtio-ports/org.libguestfs.channel.0" +- + static void + usage (void) + { +@@ -139,6 +136,7 @@ main (int argc, char *argv[]) + }; + int c; + char *cmdline; ++ char *vmchannel = NULL; + + ignore_value (chdir ("/")); + +@@ -210,8 +208,6 @@ main (int argc, char *argv[]) + printf ("could not read linux command line\n"); + } + +- free (cmdline); +- + #ifndef WIN32 + /* Make sure SIGPIPE doesn't kill us. */ + struct sigaction sa; +@@ -253,9 +249,94 @@ main (int argc, char *argv[]) + */ + copy_lvm (); + +- /* Connect to virtio-serial channel. */ +- int sock = open (VIRTIO_SERIAL_CHANNEL, O_RDWR|O_CLOEXEC); ++ /* Get the vmchannel string. ++ * ++ * Sources: ++ * --channel/-c option on the command line ++ * guestfs_vmchannel=... from the kernel command line ++ * guestfs=... from the kernel command line ++ * built-in default ++ * ++ * At the moment we expect this to contain "tcp:ip:port" but in ++ * future it might contain a device name, eg. "/dev/vcon4" for ++ * virtio-console vmchannel. ++ */ ++ if (cmdline) { ++ char *p; ++ size_t len; ++ ++ p = strstr (cmdline, "guestfs_vmchannel="); ++ if (p) { ++ len = strcspn (p + 18, " \t\n"); ++ vmchannel = strndup (p + 18, len); ++ if (!vmchannel) { ++ perror ("strndup"); ++ exit (EXIT_FAILURE); ++ } ++ } ++ } ++ ++ /* Default vmchannel. */ ++ if (vmchannel == NULL) ++ goto no_vmchannel; ++ ++ if (verbose) ++ printf ("vmchannel: %s\n", vmchannel); ++ ++ /* Connect to vmchannel. */ ++ int sock = -1; ++ ++ if (STREQLEN (vmchannel, "tcp:", 4)) { ++ /* Resolve the hostname. */ ++ struct addrinfo *res, *rr; ++ struct addrinfo hints; ++ int r; ++ char *host, *port; ++ ++ host = vmchannel+4; ++ port = strchr (host, ':'); ++ if (port) { ++ port[0] = '\0'; ++ port++; ++ } else { ++ fprintf (stderr, "vmchannel: expecting \"tcp::\": %s\n", ++ vmchannel); ++ exit (EXIT_FAILURE); ++ } ++ ++ memset (&hints, 0, sizeof hints); ++ hints.ai_socktype = SOCK_STREAM; ++ hints.ai_flags = AI_ADDRCONFIG; ++ r = getaddrinfo (host, port, &hints, &res); ++ if (r != 0) { ++ fprintf (stderr, "%s:%s: %s\n", ++ host, port, gai_strerror (r)); ++ exit (EXIT_FAILURE); ++ } ++ ++ /* Connect to the given TCP socket. */ ++ for (rr = res; rr != NULL; rr = rr->ai_next) { ++ sock = socket (rr->ai_family, rr->ai_socktype, rr->ai_protocol); ++ if (sock != -1) { ++ if (connect (sock, rr->ai_addr, rr->ai_addrlen) == 0) ++ break; ++ perror ("connect"); ++ ++ close (sock); ++ sock = -1; ++ } ++ } ++ freeaddrinfo (res); ++ } else { ++ fprintf (stderr, ++ "unknown vmchannel connection type: %s\n" ++ "expecting \"tcp::\"\n", ++ vmchannel); ++ exit (EXIT_FAILURE); ++ } ++ + if (sock == -1) { ++ no_vmchannel: + fprintf (stderr, + "\n" + "Failed to connect to virtio-serial channel.\n" +@@ -269,7 +350,7 @@ main (int argc, char *argv[]) + "output to the libguestfs developers, either in a bug report\n" + "or on the libguestfs redhat com mailing list.\n" + "\n"); +- perror (VIRTIO_SERIAL_CHANNEL); ++ perror ("last error"); + exit (EXIT_FAILURE); + } + +@@ -300,6 +381,8 @@ main (int argc, char *argv[]) + + xdr_destroy (&xdr); + ++ free (cmdline); ++ + /* Enter the main loop, reading and performing actions. */ + main_loop (sock); + +diff --git a/src/guestfs-internal.h b/src/guestfs-internal.h +index dab8224..a40682a 100644 +--- a/src/guestfs-internal.h ++++ b/src/guestfs-internal.h +@@ -510,7 +510,7 @@ extern void guestfs___rollback_drives (guestfs_h *g, size_t); + extern void guestfs___launch_failed_error (guestfs_h *g); + extern void guestfs___add_dummy_appliance_drive (guestfs_h *g); + extern void guestfs___free_drives (guestfs_h *g); +-extern char *guestfs___appliance_command_line (guestfs_h *g, const char *appliance_dev, int flags); ++extern char *guestfs___appliance_command_line (guestfs_h *g, const char *appliance_dev, int flags, const char *vmchannel); + #define APPLIANCE_COMMAND_LINE_IS_TCG 1 + + /* launch-appliance.c */ +diff --git a/src/launch-appliance.c b/src/launch-appliance.c +index 62ab76e..570f6cf 100644 +--- a/src/launch-appliance.c ++++ b/src/launch-appliance.c +@@ -74,12 +74,16 @@ free_regexps (void) + pcre_free (re_major_minor); + } + ++#define NETWORK "10.0.2.0/24" ++#define ROUTER "10.0.2.2" ++ + static int is_openable (guestfs_h *g, const char *path, int flags); + static void print_qemu_command_line (guestfs_h *g, char **argv); + static int qemu_supports (guestfs_h *g, const char *option); + static int qemu_supports_device (guestfs_h *g, const char *device_name); + static int qemu_supports_virtio_scsi (guestfs_h *g); + static char *qemu_drive_param (guestfs_h *g, const struct drive *drv, size_t index); ++static int check_peer_euid (guestfs_h *g, int sock, uid_t *rtn); + + /* Functions to build up the qemu command line. These are only run + * in the child process so no clean-up is required. +@@ -169,7 +173,9 @@ launch_appliance (guestfs_h *g, const char *arg) + int r; + int wfd[2], rfd[2]; + char guestfsd_sock[256]; +- struct sockaddr_un addr; ++ struct sockaddr_in addr; ++ socklen_t addrlen = sizeof addr; ++ int null_vmchannel_port; + CLEANUP_FREE char *kernel = NULL, *initrd = NULL, *appliance = NULL; + int has_appliance_drive; + uint32_t size; +@@ -203,37 +209,43 @@ launch_appliance (guestfs_h *g, const char *arg) + if (qemu_supports (g, NULL) == -1) + goto cleanup0; + +- /* Using virtio-serial, we need to create a local Unix domain socket +- * for qemu to connect to. ++ /* "Null vmchannel" implementation: We allocate a random port ++ * number on the host, and the daemon connects back to it. To ++ * make this secure, we check that the peer UID is the same as our ++ * UID. This requires SLIRP (user mode networking in qemu). + */ +- snprintf (guestfsd_sock, sizeof guestfsd_sock, "%s/guestfsd.sock", g->tmpdir); +- unlink (guestfsd_sock); +- +- g->sock = socket (AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC, 0); ++ g->sock = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP); + if (g->sock == -1) { + perrorf (g, "socket"); + goto cleanup0; + } + +- if (fcntl (g->sock, F_SETFL, O_NONBLOCK) == -1) { +- perrorf (g, "fcntl"); ++ addr.sin_family = AF_INET; ++ addr.sin_port = htons (0); ++ addr.sin_addr.s_addr = htonl (INADDR_LOOPBACK); ++ if (bind (g->sock, (struct sockaddr *) &addr, addrlen) == -1) { ++ perrorf (g, "bind"); + goto cleanup0; + } + +- addr.sun_family = AF_UNIX; +- strncpy (addr.sun_path, guestfsd_sock, UNIX_PATH_MAX); +- addr.sun_path[UNIX_PATH_MAX-1] = '\0'; ++ if (listen (g->sock, 256) == -1) { ++ perrorf (g, "listen"); ++ goto cleanup0; ++ } + +- if (bind (g->sock, &addr, sizeof addr) == -1) { +- perrorf (g, "bind"); ++ if (getsockname (g->sock, (struct sockaddr *) &addr, &addrlen) == -1) { ++ perrorf (g, "getsockname"); + goto cleanup0; + } + +- if (listen (g->sock, 1) == -1) { +- perrorf (g, "listen"); ++ if (fcntl (g->sock, F_SETFL, O_NONBLOCK) == -1) { ++ perrorf (g, "fcntl"); + goto cleanup0; + } + ++ null_vmchannel_port = ntohs (addr.sin_port); ++ debug (g, "null_vmchannel_port = %d", null_vmchannel_port); ++ + if (!g->direct) { + if (pipe (wfd) == -1 || pipe (rfd) == -1) { + perrorf (g, "pipe"); +@@ -412,23 +424,9 @@ launch_appliance (guestfs_h *g, const char *arg) + if (qemu_supports (g, "-rtc-td-hack")) + add_cmdline (g, "-rtc-td-hack"); + +- /* Create the virtio serial bus. */ +- add_cmdline (g, "-device"); +- add_cmdline (g, "virtio-serial"); +- +-#if 0 +- /* Use virtio-console (a variant form of virtio-serial) for the +- * guest's serial console. +- */ +- add_cmdline (g, "-chardev"); +- add_cmdline (g, "stdio,id=console"); +- add_cmdline (g, "-device"); +- add_cmdline (g, "virtconsole,chardev=console,name=org.libguestfs.console.0"); +-#else +- /* When the above works ... until then: */ ++ /* Serial console. */ + add_cmdline (g, "-serial"); + add_cmdline (g, "stdio"); +-#endif + + if (qemu_supports_device (g, "Serial Graphics Adapter")) { + /* Use sgabios instead of vgabios. This means we'll see BIOS +@@ -441,12 +439,16 @@ launch_appliance (guestfs_h *g, const char *arg) + add_cmdline (g, "sga"); + } + +- /* Set up virtio-serial for the communications channel. */ +- add_cmdline (g, "-chardev"); +- snprintf (buf, sizeof buf, "socket,path=%s,id=channel0", guestfsd_sock); +- add_cmdline (g, buf); +- add_cmdline (g, "-device"); +- add_cmdline (g, "virtserialport,chardev=channel0,name=org.libguestfs.channel.0"); ++ /* Null vmchannel. */ ++ add_cmdline (g, "-net"); ++ add_cmdline (g, "user,vlan=0,net=" NETWORK); ++ add_cmdline (g, "-net"); ++ add_cmdline (g, "nic,model=virtio,vlan=0"); ++ ++ snprintf (buf, sizeof buf, ++ "guestfs_vmchannel=tcp:" ROUTER ":%d", ++ null_vmchannel_port); ++ char *vmchannel = strdup (buf); + + #ifdef VALGRIND_DAEMON + /* Set up virtio-serial channel for valgrind messages. */ +@@ -458,14 +460,6 @@ launch_appliance (guestfs_h *g, const char *arg) + add_cmdline (g, "virtserialport,chardev=valgrind,name=org.libguestfs.valgrind"); + #endif + +- /* Enable user networking. */ +- if (g->enable_network) { +- add_cmdline (g, "-netdev"); +- add_cmdline (g, "user,id=usernet,net=169.254.0.0/16"); +- add_cmdline (g, "-device"); +- add_cmdline (g, "virtio-net-pci,netdev=usernet"); +- } +- + add_cmdline (g, "-kernel"); + add_cmdline (g, kernel); + add_cmdline (g, "-initrd"); +@@ -473,7 +467,7 @@ launch_appliance (guestfs_h *g, const char *arg) + + add_cmdline (g, "-append"); + CLEANUP_FREE char *cmdline = +- guestfs___appliance_command_line (g, appliance_dev, 0); ++ guestfs___appliance_command_line (g, appliance_dev, 0, vmchannel); + add_cmdline (g, cmdline); + + /* Finish off the command line. */ +@@ -617,19 +611,30 @@ launch_appliance (guestfs_h *g, const char *arg) + + g->state = LAUNCHING; + +- /* Wait for qemu to start and to connect back to us via +- * virtio-serial and send the GUESTFS_LAUNCH_FLAG message. ++ /* Null vmchannel implementation: We listen on g->sock for a ++ * connection. The connection could come from any local process ++ * so we must check it comes from the appliance (or at least ++ * from our UID) for security reasons. + */ +- r = guestfs___accept_from_daemon (g); +- if (r == -1) +- goto cleanup1; ++ r = -1; ++ while (r == -1) { ++ uid_t uid; + +- /* NB: We reach here just because qemu has opened the socket. It +- * does not mean the daemon is up until we read the +- * GUESTFS_LAUNCH_FLAG below. Failures in qemu startup can still +- * happen even if we reach here, even early failures like not being +- * able to open a drive. +- */ ++ r = guestfs___accept_from_daemon (g); ++ if (r == -1) ++ goto cleanup1; ++ ++ if (check_peer_euid (g, r, &uid) == -1) ++ goto cleanup1; ++ if (uid != geteuid ()) { ++ fprintf (stderr, ++ "libguestfs: warning: unexpected connection from UID %d to port %d\n", ++ uid, null_vmchannel_port); ++ close (r); ++ r = -1; ++ continue; ++ } ++ } + + /* Close the listening socket. */ + if (close (g->sock) != 0) { +@@ -981,6 +986,83 @@ guestfs___drive_name (size_t index, char *ret) + return ret; + } + ++/* Check the peer effective UID for a TCP socket. Ideally we'd like ++ * SO_PEERCRED for a loopback TCP socket. This isn't possible on ++ * Linux (but it is on Solaris!) so we read /proc/net/tcp instead. ++ */ ++static int ++check_peer_euid (guestfs_h *g, int sock, uid_t *rtn) ++{ ++ struct sockaddr_in peer; ++ socklen_t addrlen = sizeof peer; ++ ++ if (getpeername (sock, (struct sockaddr *) &peer, &addrlen) == -1) { ++ perrorf (g, "getpeername"); ++ return -1; ++ } ++ ++ if (peer.sin_family != AF_INET || ++ ntohl (peer.sin_addr.s_addr) != INADDR_LOOPBACK) { ++ error (g, "check_peer_euid: unexpected connection from non-IPv4, non-loopback peer (family = %d, addr = %s)", ++ peer.sin_family, inet_ntoa (peer.sin_addr)); ++ return -1; ++ } ++ ++ struct sockaddr_in our; ++ addrlen = sizeof our; ++ if (getsockname (sock, (struct sockaddr *) &our, &addrlen) == -1) { ++ perrorf (g, "getsockname"); ++ return -1; ++ } ++ ++ FILE *fp = fopen ("/proc/net/tcp", "r"); ++ if (fp == NULL) { ++ perrorf (g, "/proc/net/tcp"); ++ return -1; ++ } ++ ++ char line[256]; ++ if (fgets (line, sizeof line, fp) == NULL) { /* Drop first line. */ ++ error (g, "unexpected end of file in /proc/net/tcp"); ++ fclose (fp); ++ return -1; ++ } ++ ++ while (fgets (line, sizeof line, fp) != NULL) { ++ unsigned line_our_addr, line_our_port, line_peer_addr, line_peer_port; ++ int dummy0, dummy1, dummy2, dummy3, dummy4, dummy5, dummy6; ++ int line_uid; ++ ++ if (sscanf (line, "%d:%08X:%04X %08X:%04X %02X %08X:%08X %02X:%08X %08X %d", ++ &dummy0, ++ &line_our_addr, &line_our_port, ++ &line_peer_addr, &line_peer_port, ++ &dummy1, &dummy2, &dummy3, &dummy4, &dummy5, &dummy6, ++ &line_uid) == 12) { ++ /* Note about /proc/net/tcp: local_address and rem_address are ++ * always in network byte order. However the port part is ++ * always in host byte order. ++ * ++ * The sockname and peername that we got above are in network ++ * byte order. So we have to byte swap the port but not the ++ * address part. ++ */ ++ if (line_our_addr == our.sin_addr.s_addr && ++ line_our_port == ntohs (our.sin_port) && ++ line_peer_addr == peer.sin_addr.s_addr && ++ line_peer_port == ntohs (peer.sin_port)) { ++ *rtn = line_uid; ++ fclose (fp); ++ return 0; ++ } ++ } ++ } ++ ++ error (g, "check_peer_euid: no matching TCP connection found in /proc/net/tcp"); ++ fclose (fp); ++ return -1; ++} ++ + static int + shutdown_appliance (guestfs_h *g, int check_for_errors) + { +diff --git a/src/launch.c b/src/launch.c +index 7c37667..b634b32 100644 +--- a/src/launch.c ++++ b/src/launch.c +@@ -809,7 +809,7 @@ guestfs__get_state (guestfs_h *g) + + char * + guestfs___appliance_command_line (guestfs_h *g, const char *appliance_dev, +- int flags) ++ int flags, const char *vmchannel) + { + char *term = getenv ("TERM"); + char *ret; +@@ -837,12 +837,14 @@ guestfs___appliance_command_line (guestfs_h *g, const char *appliance_dev, + " cgroup_disable=memory" /* saves us about 5 MB of RAM */ + " root=%s" /* root (appliance_dev) */ + " %s" /* selinux */ ++ " %s" /* vmchannel */ + "%s" /* verbose */ + " TERM=%s" /* TERM environment variable */ + "%s%s", /* append */ + lpj_s, + appliance_dev, + g->selinux ? "selinux=1 enforcing=0" : "selinux=0", ++ vmchannel, + g->verbose ? " guestfs_verbose=1" : "", + term ? term : "linux", + g->append ? " " : "", g->append ? g->append : ""); +-- +1.7.4.1 + diff --git a/0018-EPEL-5-Disable-libvirt-attach-method.patch b/0018-EPEL-5-Disable-libvirt-attach-method.patch deleted file mode 100644 index 852aa80..0000000 --- a/0018-EPEL-5-Disable-libvirt-attach-method.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 4285778047a444c8f5fb09c09d4e5ea59a7c0c33 Mon Sep 17 00:00:00 2001 -From: Richard W.M. Jones -Date: Thu, 30 Aug 2012 17:57:46 +0100 -Subject: [PATCH 18/36] EPEL 5: Disable libvirt attach method. - ---- - src/launch-libvirt.c | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/src/launch-libvirt.c b/src/launch-libvirt.c -index e549ae8..c013dee 100644 ---- a/src/launch-libvirt.c -+++ b/src/launch-libvirt.c -@@ -72,7 +72,7 @@ - MIN_LIBVIRT_MINOR * 1000 + \ - MIN_LIBVIRT_MICRO) - --#if defined(HAVE_LIBVIRT) && \ -+#if 0 && defined(HAVE_LIBVIRT) && \ - LIBVIR_VERSION_NUMBER >= MIN_LIBVIRT_VERSION && \ - defined(HAVE_LIBXML2) - --- -1.7.4.1 - diff --git a/0019-EPEL-5-Disable-libvirt-attach-method.patch b/0019-EPEL-5-Disable-libvirt-attach-method.patch new file mode 100644 index 0000000..631082e --- /dev/null +++ b/0019-EPEL-5-Disable-libvirt-attach-method.patch @@ -0,0 +1,25 @@ +From 5e79cdd4edfcf8a50c4c1454c6fcacbdf33e0e75 Mon Sep 17 00:00:00 2001 +From: Richard W.M. Jones +Date: Thu, 30 Aug 2012 17:57:46 +0100 +Subject: [PATCH 19/37] EPEL 5: Disable libvirt attach method. + +--- + src/launch-libvirt.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/src/launch-libvirt.c b/src/launch-libvirt.c +index e549ae8..c013dee 100644 +--- a/src/launch-libvirt.c ++++ b/src/launch-libvirt.c +@@ -72,7 +72,7 @@ + MIN_LIBVIRT_MINOR * 1000 + \ + MIN_LIBVIRT_MICRO) + +-#if defined(HAVE_LIBVIRT) && \ ++#if 0 && defined(HAVE_LIBVIRT) && \ + LIBVIR_VERSION_NUMBER >= MIN_LIBVIRT_VERSION && \ + defined(HAVE_LIBXML2) + +-- +1.7.4.1 + diff --git a/0019-EPEL-5-Fix-blkid-to-return-LVM2_member-for-PVs.patch b/0019-EPEL-5-Fix-blkid-to-return-LVM2_member-for-PVs.patch deleted file mode 100644 index 64f8c5a..0000000 --- a/0019-EPEL-5-Fix-blkid-to-return-LVM2_member-for-PVs.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 33bfbbf0f983f6c84131c3ae96d71cad6665dc37 Mon Sep 17 00:00:00 2001 -From: Richard W.M. Jones -Date: Fri, 22 Jun 2012 10:06:47 +0100 -Subject: [PATCH 19/36] EPEL 5: Fix blkid to return "LVM2_member" for PVs. - -Old blkid in RHEL 5 didn't return the right thing for PVs. ---- - daemon/blkid.c | 20 ++++++++++++++++++++ - 1 files changed, 20 insertions(+), 0 deletions(-) - -diff --git a/daemon/blkid.c b/daemon/blkid.c -index 64919dd..6d94a38 100644 ---- a/daemon/blkid.c -+++ b/daemon/blkid.c -@@ -51,6 +51,26 @@ get_blkid_tag (const char *device, const char *tag) - } - - if (r == 2) { /* means UUID etc not found */ -+ if (STREQ (tag, "TYPE") && STREQ (out, "")) { -+ /* RHEL 5 blkid doesn't return "LVM2_member" for PVs. Instead we -+ * get to this point. Detect if the device is really a PV and return -+ * the right thing instead. -+ */ -+ free (out); -+ if (command (&out, &err, "file", "-bsL", device, NULL) == -1) { -+ reply_with_error ("file: %s", err); -+ free (out); -+ free (err); -+ return NULL; -+ } -+ free (err); -+ if (STRPREFIX (out, "LVM2 (Linux Logical Volume Manager)")) { -+ strcpy (out, "LVM2_member"); -+ return out; -+ } -+ /*FALLTHROUGH*/ -+ } -+ - free (out); - out = strdup (""); - if (out == NULL) --- -1.7.4.1 - diff --git a/0020-EPEL-5-Fix-blkid-to-return-LVM2_member-for-PVs.patch b/0020-EPEL-5-Fix-blkid-to-return-LVM2_member-for-PVs.patch new file mode 100644 index 0000000..69c5b54 --- /dev/null +++ b/0020-EPEL-5-Fix-blkid-to-return-LVM2_member-for-PVs.patch @@ -0,0 +1,42 @@ +From 45eb8e29c1b9f9bb92ce17cbc1d2fbc1c40c7f6b Mon Sep 17 00:00:00 2001 +From: Richard W.M. Jones +Date: Fri, 22 Jun 2012 10:06:47 +0100 +Subject: [PATCH 20/37] EPEL 5: Fix blkid to return "LVM2_member" for PVs. + +Old blkid in RHEL 5 didn't return the right thing for PVs. +--- + daemon/blkid.c | 18 ++++++++++++++++++ + 1 files changed, 18 insertions(+), 0 deletions(-) + +diff --git a/daemon/blkid.c b/daemon/blkid.c +index 64919dd..cbd9b1f 100644 +--- a/daemon/blkid.c ++++ b/daemon/blkid.c +@@ -51,6 +51,24 @@ get_blkid_tag (const char *device, const char *tag) + } + + if (r == 2) { /* means UUID etc not found */ ++ if (STREQ (tag, "TYPE") && STREQ (out, "")) { ++ /* RHEL 5 blkid doesn't return "LVM2_member" for PVs. Instead we ++ * get to this point. Detect if the device is really a PV and return ++ * the right thing instead. ++ */ ++ free (out); ++ if (command (&out, &err, "file", "-bsL", device, NULL) == -1) { ++ reply_with_error ("file: %s", err); ++ free (out); ++ return NULL; ++ } ++ if (STRPREFIX (out, "LVM2 (Linux Logical Volume Manager)")) { ++ strcpy (out, "LVM2_member"); ++ return out; ++ } ++ /*FALLTHROUGH*/ ++ } ++ + free (out); + out = strdup (""); + if (out == NULL) +-- +1.7.4.1 + diff --git a/0020-EPEL-5-sparsify-Fix-command-line-options-for-old-qem.patch b/0020-EPEL-5-sparsify-Fix-command-line-options-for-old-qem.patch deleted file mode 100644 index 473d58d..0000000 --- a/0020-EPEL-5-sparsify-Fix-command-line-options-for-old-qem.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 158e74b852d369d83fa194bd6329d7a82d47fa8c Mon Sep 17 00:00:00 2001 -From: Richard W.M. Jones -Date: Fri, 22 Jun 2012 10:24:48 +0100 -Subject: [PATCH 20/36] EPEL 5: sparsify: Fix command line options for old qemu-img. - -This didn't have -o backing_file etc. Use old -b and -F options instead. ---- - sparsify/sparsify.ml | 18 ++++++------------ - 1 files changed, 6 insertions(+), 12 deletions(-) - -diff --git a/sparsify/sparsify.ml b/sparsify/sparsify.ml -index f77f4eb..5ee2adb 100644 ---- a/sparsify/sparsify.ml -+++ b/sparsify/sparsify.ml -@@ -228,18 +228,12 @@ let overlaydisk = - - (* Create it with the indisk as the backing file. *) - let cmd = -- let options = -- let backing_file_option = -- [sprintf "backing_file=%s" (replace_str indisk "," ",,")] in -- let backing_fmt_option = -- match format with -- | None -> [] -- | Some fmt -> [sprintf "backing_fmt=%s" fmt] in -- let version3 = -- if qemu_img_version >= 1.1 then ["compat=1.1"] else [] in -- backing_file_option @ backing_fmt_option @ version3 in -- sprintf "qemu-img create -f qcow2 -o %s %s > /dev/null" -- (Filename.quote (String.concat "," options)) (Filename.quote tmp) in -+ sprintf "qemu-img create -f qcow2%s -b %s %s > /dev/null" -+ (match format with -+ | None -> "" -+ | Some fmt -> sprintf " -F %s" fmt) -+ (replace_str indisk "," ",,") -+ (Filename.quote tmp) in - if verbose then - printf "%s\n%!" cmd; - if Sys.command cmd <> 0 then --- -1.7.4.1 - diff --git a/0021-EPEL-5-Remove-Fedora-MD-test-images.patch b/0021-EPEL-5-Remove-Fedora-MD-test-images.patch deleted file mode 100644 index 187cb21..0000000 --- a/0021-EPEL-5-Remove-Fedora-MD-test-images.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 61d883225c87a58f8df1ab9d6e17cdb7a7425d97 Mon Sep 17 00:00:00 2001 -From: Richard W.M. Jones -Date: Fri, 22 Jun 2012 13:15:49 +0100 -Subject: [PATCH 21/36] EPEL 5: Remove Fedora MD test images. - -On RHEL 5, mdadm is not able to create md devices with aliases, -eg. '/dev/md/boot'. ---- - tests/guests/Makefile.am | 12 ------------ - 1 files changed, 0 insertions(+), 12 deletions(-) - -diff --git a/tests/guests/Makefile.am b/tests/guests/Makefile.am -index f5570e9..3e8443f 100644 ---- a/tests/guests/Makefile.am -+++ b/tests/guests/Makefile.am -@@ -47,8 +47,6 @@ check_DATA = \ - blank-bootrootlv.img \ - debian.img \ - fedora.img \ -- fedora-md1.img \ -- fedora-md2.img \ - ubuntu.img \ - windows.img - -@@ -70,16 +68,6 @@ fedora.img: guest-aux/make-fedora-img.pl \ - guest-aux/fedora-packages.db - SRCDIR=$(srcdir) LAYOUT=partitions $(top_builddir)/run --test $< - --# Make a (dummy) Fedora image using md devices --fedora-md1.img fedora-md2.img: stamp-fedora-md.img -- --stamp-fedora-md.img: guest-aux/make-fedora-img.pl \ -- guest-aux/fedora-name.db \ -- guest-aux/fedora-packages.db -- rm -f $@ -- SRCDIR=$(srcdir) LAYOUT=partitions-md $(top_builddir)/run --test $< -- touch $@ -- - guest-aux/fedora-name.db: guest-aux/fedora-name.db.txt - rm -f $@ $@-t - mkdir -p guest-aux --- -1.7.4.1 - diff --git a/0021-EPEL-5-sparsify-Fix-command-line-options-for-old-qem.patch b/0021-EPEL-5-sparsify-Fix-command-line-options-for-old-qem.patch new file mode 100644 index 0000000..73ad7fd --- /dev/null +++ b/0021-EPEL-5-sparsify-Fix-command-line-options-for-old-qem.patch @@ -0,0 +1,42 @@ +From dbb535379a5d301954fd0363f4aa3cdccb2f6ea8 Mon Sep 17 00:00:00 2001 +From: Richard W.M. Jones +Date: Fri, 22 Jun 2012 10:24:48 +0100 +Subject: [PATCH 21/37] EPEL 5: sparsify: Fix command line options for old qemu-img. + +This didn't have -o backing_file etc. Use old -b and -F options instead. +--- + sparsify/sparsify.ml | 18 ++++++------------ + 1 files changed, 6 insertions(+), 12 deletions(-) + +diff --git a/sparsify/sparsify.ml b/sparsify/sparsify.ml +index f77f4eb..5ee2adb 100644 +--- a/sparsify/sparsify.ml ++++ b/sparsify/sparsify.ml +@@ -228,18 +228,12 @@ let overlaydisk = + + (* Create it with the indisk as the backing file. *) + let cmd = +- let options = +- let backing_file_option = +- [sprintf "backing_file=%s" (replace_str indisk "," ",,")] in +- let backing_fmt_option = +- match format with +- | None -> [] +- | Some fmt -> [sprintf "backing_fmt=%s" fmt] in +- let version3 = +- if qemu_img_version >= 1.1 then ["compat=1.1"] else [] in +- backing_file_option @ backing_fmt_option @ version3 in +- sprintf "qemu-img create -f qcow2 -o %s %s > /dev/null" +- (Filename.quote (String.concat "," options)) (Filename.quote tmp) in ++ sprintf "qemu-img create -f qcow2%s -b %s %s > /dev/null" ++ (match format with ++ | None -> "" ++ | Some fmt -> sprintf " -F %s" fmt) ++ (replace_str indisk "," ",,") ++ (Filename.quote tmp) in + if verbose then + printf "%s\n%!" cmd; + if Sys.command cmd <> 0 then +-- +1.7.4.1 + diff --git a/0022-EPEL-5-Add-mkisofs-to-package-list.patch b/0022-EPEL-5-Add-mkisofs-to-package-list.patch deleted file mode 100644 index 53125b4..0000000 --- a/0022-EPEL-5-Add-mkisofs-to-package-list.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 80df69f2d15f83bd748c4eb592bf7c0e4462c985 Mon Sep 17 00:00:00 2001 -From: Richard W.M. Jones -Date: Fri, 22 Jun 2012 14:46:43 +0100 -Subject: [PATCH 22/36] EPEL 5: Add mkisofs to package list. - -This package contains the 'isoinfo' program which is required -to implement the corresponding API and for tests to pass. ---- - appliance/packagelist.in | 1 + - 1 files changed, 1 insertions(+), 0 deletions(-) - -diff --git a/appliance/packagelist.in b/appliance/packagelist.in -index d7c2639..803a694 100644 ---- a/appliance/packagelist.in -+++ b/appliance/packagelist.in -@@ -129,6 +129,7 @@ lsscsi - lvm2 - lzop - mdadm -+mkisofs - module-init-tools - /* - Enabling this pulls out 140 extra packages --- -1.7.4.1 - diff --git a/0022-EPEL-5-Remove-Fedora-MD-test-images.patch b/0022-EPEL-5-Remove-Fedora-MD-test-images.patch new file mode 100644 index 0000000..15b0cae --- /dev/null +++ b/0022-EPEL-5-Remove-Fedora-MD-test-images.patch @@ -0,0 +1,44 @@ +From 6fade02acfac987837c928ef47ab7d380764297e Mon Sep 17 00:00:00 2001 +From: Richard W.M. Jones +Date: Fri, 22 Jun 2012 13:15:49 +0100 +Subject: [PATCH 22/37] EPEL 5: Remove Fedora MD test images. + +On RHEL 5, mdadm is not able to create md devices with aliases, +eg. '/dev/md/boot'. +--- + tests/guests/Makefile.am | 12 ------------ + 1 files changed, 0 insertions(+), 12 deletions(-) + +diff --git a/tests/guests/Makefile.am b/tests/guests/Makefile.am +index f5570e9..3e8443f 100644 +--- a/tests/guests/Makefile.am ++++ b/tests/guests/Makefile.am +@@ -47,8 +47,6 @@ check_DATA = \ + blank-bootrootlv.img \ + debian.img \ + fedora.img \ +- fedora-md1.img \ +- fedora-md2.img \ + ubuntu.img \ + windows.img + +@@ -70,16 +68,6 @@ fedora.img: guest-aux/make-fedora-img.pl \ + guest-aux/fedora-packages.db + SRCDIR=$(srcdir) LAYOUT=partitions $(top_builddir)/run --test $< + +-# Make a (dummy) Fedora image using md devices +-fedora-md1.img fedora-md2.img: stamp-fedora-md.img +- +-stamp-fedora-md.img: guest-aux/make-fedora-img.pl \ +- guest-aux/fedora-name.db \ +- guest-aux/fedora-packages.db +- rm -f $@ +- SRCDIR=$(srcdir) LAYOUT=partitions-md $(top_builddir)/run --test $< +- touch $@ +- + guest-aux/fedora-name.db: guest-aux/fedora-name.db.txt + rm -f $@ $@-t + mkdir -p guest-aux +-- +1.7.4.1 + diff --git a/0023-EPEL-5-Add-1-second-pause-after-unmounting-any-files.patch b/0023-EPEL-5-Add-1-second-pause-after-unmounting-any-files.patch deleted file mode 100644 index bff4e50..0000000 --- a/0023-EPEL-5-Add-1-second-pause-after-unmounting-any-files.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 999fad1fc600a50e51dc019b7d9c53cb735734cd Mon Sep 17 00:00:00 2001 -From: Richard W.M. Jones -Date: Fri, 22 Jun 2012 21:58:32 +0100 -Subject: [PATCH 23/36] EPEL 5: Add 1 second pause after unmounting any filesystem. - -This fixes the test-charset-fidelity test case. A simpler example -which fails without this is: - - guestfish < +Date: Fri, 22 Jun 2012 14:46:43 +0100 +Subject: [PATCH 23/37] EPEL 5: Add mkisofs to package list. + +This package contains the 'isoinfo' program which is required +to implement the corresponding API and for tests to pass. +--- + appliance/packagelist.in | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +diff --git a/appliance/packagelist.in b/appliance/packagelist.in +index d7c2639..803a694 100644 +--- a/appliance/packagelist.in ++++ b/appliance/packagelist.in +@@ -129,6 +129,7 @@ lsscsi + lvm2 + lzop + mdadm ++mkisofs + module-init-tools + /* + Enabling this pulls out 140 extra packages +-- +1.7.4.1 + diff --git a/0024-EPEL-5-Add-1-second-pause-after-unmounting-any-files.patch b/0024-EPEL-5-Add-1-second-pause-after-unmounting-any-files.patch new file mode 100644 index 0000000..eaa851d --- /dev/null +++ b/0024-EPEL-5-Add-1-second-pause-after-unmounting-any-files.patch @@ -0,0 +1,52 @@ +From 01115314a3c12073e5e6d4e02970867527c66e86 Mon Sep 17 00:00:00 2001 +From: Richard W.M. Jones +Date: Fri, 22 Jun 2012 21:58:32 +0100 +Subject: [PATCH 24/37] EPEL 5: Add 1 second pause after unmounting any filesystem. + +This fixes the test-charset-fidelity test case. A simpler example +which fails without this is: + + guestfish < -Date: Thu, 30 Aug 2012 18:01:00 +0100 -Subject: [PATCH 24/36] EPEL 5: podwrapper: Remove HTML output. - -It requires perl Pod::Simple::XHTML which did not exist in -RHEL 5 era. ---- - podwrapper.pl.in | 92 ------------------------------------------------------ - 1 files changed, 0 insertions(+), 92 deletions(-) - -diff --git a/podwrapper.pl.in b/podwrapper.pl.in -index cb6e9b2..53a13cd 100755 ---- a/podwrapper.pl.in -+++ b/podwrapper.pl.in -@@ -25,7 +25,6 @@ use Getopt::Long; - use Pod::Man; - use Pod::Simple; - use Pod::Simple::Text; --use Pod::Simple::XHTML; - use File::Basename; - - =encoding utf8 -@@ -417,97 +416,6 @@ if ($man) { - print "$progname: wrote $man\n"; - } - --# Output HTML. --SUBHTML: { -- # Subclass Pod::Simple::XHTML. See the documentation. -- package Podwrapper::XHTML; -- -- use vars qw(@ISA $VERSION); -- @ISA = qw(Pod::Simple::XHTML); -- $VERSION = $package_version; -- -- # Pod::Simple::XHTML returns uppercase identifiers, whereas the -- # old pod2html returns lowercase ones. -- sub idify -- { -- my $self = shift; -- my $id = $self->SUPER::idify (@_); -- lc ($id); -- } -- -- sub is_a_libguestfs_page -- { -- local $_ = shift; -- -- return 1 if /^Sys::Guestfs/; -- return 1 if /^virt-/; -- return 1 if /^libguestf/; -- return 1 if /^guestf/; -- return 1 if /^guestmount/; -- return 1 if /^hivex/; -- return 1 if /^febootstrap/; -- return 1 if /^supermin/; -- return 0; -- } -- -- sub resolve_pod_page_link -- { -- my $self = shift; -- my $podname = $_[0]; # eg. "Sys::Guestfs", can be undef -- my $anchor = $_[1]; # eg. "SYNOPSIS", can be undef -- my $r = ""; -- if (defined $podname) { -- return $self->SUPER::resolve_pod_page_link (@_) -- unless is_a_libguestfs_page ($podname); -- $r .= "$podname.3.html" -- } -- $r .= "#" . $self->idify ($anchor, 1) if defined $anchor; -- $r; -- } -- -- sub resolve_man_page_link -- { -- my $self = shift; -- my $name = $_[0]; # eg. "virt-make-fs(1)", can be undef -- my $anchor = $_[1]; # eg. "SYNOPSIS", can be undef -- my $r = ""; -- if (defined $name) { -- return $self->SUPER::resolve_man_page_link (@_) -- unless is_a_libguestfs_page ($name); -- $name =~ s/\((.*)\)$/.$1/; -- $r .= "$name.html"; -- } -- $r .= "#" . $self->idify ($anchor, 1) if defined $anchor; -- $r; -- } -- -- # For some reason Pod::Simple::XHTML usually cannot find a -- # title for the page. This defaults the HTML field -- # to the same as the man page name. -- sub default_title { $name } --} -- --if ($html) { -- mkdir "$abs_top_builddir/html"; -- -- my $parser = Podwrapper::XHTML->new; -- my $output; -- $parser->output_string (\$output); -- # Added in Pod::Simple 3.16, 2011-03-14. -- eval { $parser->html_charset ("UTF-8") }; -- $parser->html_css ("pod.css"); -- $parser->index (1); -- $parser->parse_string_document ($content); -- -- # Hack for Perl 5.16. -- $output =~ s{/>pod.css<}{/>\n<}; -- -- open OUT, ">$html" or die "$progname: $html: $!"; -- print OUT $output or die "$progname: $html: $!"; -- close OUT or die "$progname: $html: $!"; -- print "$progname: wrote $html\n"; --} -- - # Output text. - if ($text) { - my $parser = Pod::Simple::Text->new; --- -1.7.4.1 - diff --git a/0025-EPEL-5-podwrapper-Don-t-use-Pod-Man.patch b/0025-EPEL-5-podwrapper-Don-t-use-Pod-Man.patch deleted file mode 100644 index 57c58a8..0000000 --- a/0025-EPEL-5-podwrapper-Don-t-use-Pod-Man.patch +++ /dev/null @@ -1,28 +0,0 @@ -From deedfc2c5b28d95bd4d305034379fa584e939cb9 Mon Sep 17 00:00:00 2001 -From: Richard W.M. Jones <rjones@redhat.com> -Date: Thu, 30 Aug 2012 18:16:18 +0100 -Subject: [PATCH 25/36] EPEL 5: podwrapper: Don't use Pod::Man. - -This unfortunately means the man pages are generated as plain text. -However that's necessary as Pod::Man does not have an output_string -method. ---- - podwrapper.pl.in | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/podwrapper.pl.in b/podwrapper.pl.in -index 53a13cd..415fa67 100755 ---- a/podwrapper.pl.in -+++ b/podwrapper.pl.in -@@ -387,7 +387,7 @@ SUBMAN: { - package Podwrapper::Man; - - use vars qw(@ISA $VERSION); -- @ISA = qw(Pod::Man); -+ @ISA = qw(Pod::Simple::Text); - $VERSION = $package_version; - - # Override the L<> method. --- -1.7.4.1 - diff --git a/0025-EPEL-5-podwrapper-Remove-HTML-output.patch b/0025-EPEL-5-podwrapper-Remove-HTML-output.patch new file mode 100644 index 0000000..4585df7 --- /dev/null +++ b/0025-EPEL-5-podwrapper-Remove-HTML-output.patch @@ -0,0 +1,124 @@ +From b770d0ba1ae9bdd44b7aa5ae1f934d8fb6dd9143 Mon Sep 17 00:00:00 2001 +From: Richard W.M. Jones <rjones@redhat.com> +Date: Thu, 30 Aug 2012 18:01:00 +0100 +Subject: [PATCH 25/37] EPEL 5: podwrapper: Remove HTML output. + +It requires perl Pod::Simple::XHTML which did not exist in +RHEL 5 era. +--- + podwrapper.pl.in | 92 ------------------------------------------------------ + 1 files changed, 0 insertions(+), 92 deletions(-) + +diff --git a/podwrapper.pl.in b/podwrapper.pl.in +index cb6e9b2..53a13cd 100755 +--- a/podwrapper.pl.in ++++ b/podwrapper.pl.in +@@ -25,7 +25,6 @@ use Getopt::Long; + use Pod::Man; + use Pod::Simple; + use Pod::Simple::Text; +-use Pod::Simple::XHTML; + use File::Basename; + + =encoding utf8 +@@ -417,97 +416,6 @@ if ($man) { + print "$progname: wrote $man\n"; + } + +-# Output HTML. +-SUBHTML: { +- # Subclass Pod::Simple::XHTML. See the documentation. +- package Podwrapper::XHTML; +- +- use vars qw(@ISA $VERSION); +- @ISA = qw(Pod::Simple::XHTML); +- $VERSION = $package_version; +- +- # Pod::Simple::XHTML returns uppercase identifiers, whereas the +- # old pod2html returns lowercase ones. +- sub idify +- { +- my $self = shift; +- my $id = $self->SUPER::idify (@_); +- lc ($id); +- } +- +- sub is_a_libguestfs_page +- { +- local $_ = shift; +- +- return 1 if /^Sys::Guestfs/; +- return 1 if /^virt-/; +- return 1 if /^libguestf/; +- return 1 if /^guestf/; +- return 1 if /^guestmount/; +- return 1 if /^hivex/; +- return 1 if /^febootstrap/; +- return 1 if /^supermin/; +- return 0; +- } +- +- sub resolve_pod_page_link +- { +- my $self = shift; +- my $podname = $_[0]; # eg. "Sys::Guestfs", can be undef +- my $anchor = $_[1]; # eg. "SYNOPSIS", can be undef +- my $r = ""; +- if (defined $podname) { +- return $self->SUPER::resolve_pod_page_link (@_) +- unless is_a_libguestfs_page ($podname); +- $r .= "$podname.3.html" +- } +- $r .= "#" . $self->idify ($anchor, 1) if defined $anchor; +- $r; +- } +- +- sub resolve_man_page_link +- { +- my $self = shift; +- my $name = $_[0]; # eg. "virt-make-fs(1)", can be undef +- my $anchor = $_[1]; # eg. "SYNOPSIS", can be undef +- my $r = ""; +- if (defined $name) { +- return $self->SUPER::resolve_man_page_link (@_) +- unless is_a_libguestfs_page ($name); +- $name =~ s/\((.*)\)$/.$1/; +- $r .= "$name.html"; +- } +- $r .= "#" . $self->idify ($anchor, 1) if defined $anchor; +- $r; +- } +- +- # For some reason Pod::Simple::XHTML usually cannot find a +- # title for the page. This defaults the HTML <title> field +- # to the same as the man page name. +- sub default_title { $name } +-} +- +-if ($html) { +- mkdir "$abs_top_builddir/html"; +- +- my $parser = Podwrapper::XHTML->new; +- my $output; +- $parser->output_string (\$output); +- # Added in Pod::Simple 3.16, 2011-03-14. +- eval { $parser->html_charset ("UTF-8") }; +- $parser->html_css ("pod.css"); +- $parser->index (1); +- $parser->parse_string_document ($content); +- +- # Hack for Perl 5.16. +- $output =~ s{/>pod.css<}{/>\n<}; +- +- open OUT, ">$html" or die "$progname: $html: $!"; +- print OUT $output or die "$progname: $html: $!"; +- close OUT or die "$progname: $html: $!"; +- print "$progname: wrote $html\n"; +-} +- + # Output text. + if ($text) { + my $parser = Pod::Simple::Text->new; +-- +1.7.4.1 + diff --git a/0026-EPEL-5-Revert-Mac-OS-X-Use-libtool-mode-execute-inst.patch b/0026-EPEL-5-Revert-Mac-OS-X-Use-libtool-mode-execute-inst.patch deleted file mode 100644 index c407135..0000000 --- a/0026-EPEL-5-Revert-Mac-OS-X-Use-libtool-mode-execute-inst.patch +++ /dev/null @@ -1,89 +0,0 @@ -From e08f04f9c508fa0748453a0a2631d3373d7c67b4 Mon Sep 17 00:00:00 2001 -From: Richard W.M. Jones <rjones@redhat.com> -Date: Thu, 30 Aug 2012 18:19:28 +0100 -Subject: [PATCH 26/36] EPEL 5: Revert "Mac OS X: Use libtool --mode=execute instead of LD_LIBRARY_PATH" - -This reverts commit 61c9ea496e0579bb7d1bcf496595d66c3f08cfec. ---- - ocaml/Makefile.am | 16 ++++++++-------- - 1 files changed, 8 insertions(+), 8 deletions(-) - -diff --git a/ocaml/Makefile.am b/ocaml/Makefile.am -index 48ddc2c..b5dbd5f 100644 ---- a/ocaml/Makefile.am -+++ b/ocaml/Makefile.am -@@ -114,7 +114,7 @@ noinst_DATA += \ - - bindtests.bc: bindtests.cmo mlguestfs.cma - mkdir -p t -- $(top_builddir)/libtool -dlopen $(top_builddir)/src/.libs/libguestfs.la --mode=execute \ -+ LD_LIBRARY_PATH=../src/.libs \ - $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -I . -package unix -linkpkg mlguestfs.cma $< -o $@ - - bindtests.opt: bindtests.cmx mlguestfs.cmxa -@@ -123,7 +123,7 @@ bindtests.opt: bindtests.cmx mlguestfs.cmxa - - t/guestfs_005_load.bc: t/guestfs_005_load.cmo mlguestfs.cma - mkdir -p t -- $(top_builddir)/libtool -dlopen $(top_builddir)/src/.libs/libguestfs.la --mode=execute \ -+ LD_LIBRARY_PATH=../src/.libs \ - $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -I . -package unix -linkpkg mlguestfs.cma $< -o $@ - - t/guestfs_005_load.opt: t/guestfs_005_load.cmx mlguestfs.cmxa -@@ -132,7 +132,7 @@ t/guestfs_005_load.opt: t/guestfs_005_load.cmx mlguestfs.cmxa - - t/guestfs_010_basic.bc: t/guestfs_010_basic.cmo mlguestfs.cma - mkdir -p t -- $(top_builddir)/libtool -dlopen $(top_builddir)/src/.libs/libguestfs.la --mode=execute \ -+ LD_LIBRARY_PATH=../src/.libs \ - $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -I . -package unix -linkpkg mlguestfs.cma $< -o $@ - - t/guestfs_010_basic.opt: t/guestfs_010_basic.cmx mlguestfs.cmxa -@@ -141,7 +141,7 @@ t/guestfs_010_basic.opt: t/guestfs_010_basic.cmx mlguestfs.cmxa - - t/guestfs_070_threads.bc: t/guestfs_070_threads.cmo mlguestfs.cma - mkdir -p t -- $(top_builddir)/libtool -dlopen $(top_builddir)/src/.libs/libguestfs.la --mode=execute \ -+ LD_LIBRARY_PATH=../src/.libs \ - $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -I . -package unix,threads -thread -linkpkg mlguestfs.cma $< -o $@ - - t/guestfs_070_threads.opt: t/guestfs_070_threads.cmx mlguestfs.cmxa -@@ -150,7 +150,7 @@ t/guestfs_070_threads.opt: t/guestfs_070_threads.cmx mlguestfs.cmxa - - t/guestfs_080_optargs.bc: t/guestfs_080_optargs.cmo mlguestfs.cma - mkdir -p t -- $(top_builddir)/libtool -dlopen $(top_builddir)/src/.libs/libguestfs.la --mode=execute \ -+ LD_LIBRARY_PATH=../src/.libs \ - $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -I . -package unix -linkpkg mlguestfs.cma $< -o $@ - - t/guestfs_080_optargs.opt: t/guestfs_080_optargs.cmx mlguestfs.cmxa -@@ -159,7 +159,7 @@ t/guestfs_080_optargs.opt: t/guestfs_080_optargs.cmx mlguestfs.cmxa - - t/guestfs_400_events.bc: t/guestfs_400_events.cmo mlguestfs.cma - mkdir -p t -- $(top_builddir)/libtool -dlopen $(top_builddir)/src/.libs/libguestfs.la --mode=execute \ -+ LD_LIBRARY_PATH=../src/.libs \ - $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -I . -package unix -linkpkg mlguestfs.cma $< -o $@ - - t/guestfs_400_events.opt: t/guestfs_400_events.cmx mlguestfs.cmxa -@@ -168,7 +168,7 @@ t/guestfs_400_events.opt: t/guestfs_400_events.cmx mlguestfs.cmxa - - t/guestfs_400_progress.bc: t/guestfs_400_progress.cmo mlguestfs.cma - mkdir -p t -- $(top_builddir)/libtool -dlopen $(top_builddir)/src/.libs/libguestfs.la --mode=execute \ -+ LD_LIBRARY_PATH=../src/.libs \ - $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -I . -package unix -linkpkg mlguestfs.cma $< -o $@ - - t/guestfs_400_progress.opt: t/guestfs_400_progress.cmx mlguestfs.cmxa -@@ -177,7 +177,7 @@ t/guestfs_400_progress.opt: t/guestfs_400_progress.cmx mlguestfs.cmxa - - t/guestfs_500_mount_local.bc: t/guestfs_500_mount_local.cmo mlguestfs.cma - mkdir -p t -- $(top_builddir)/libtool -dlopen $(top_builddir)/src/.libs/libguestfs.la --mode=execute \ -+ LD_LIBRARY_PATH=../src/.libs \ - $(OCAMLFIND) ocamlc -custom $(OCAMLCFLAGS) -I . -package unix -linkpkg mlguestfs.cma $< -o $@ - - t/guestfs_500_mount_local.opt: t/guestfs_500_mount_local.cmx mlguestfs.cmxa --- -1.7.4.1 - diff --git a/0026-EPEL-5-podwrapper-Don-t-use-Pod-Man.patch b/0026-EPEL-5-podwrapper-Don-t-use-Pod-Man.patch new file mode 100644 index 0000000..589e07e --- /dev/null +++ b/0026-EPEL-5-podwrapper-Don-t-use-Pod-Man.patch @@ -0,0 +1,28 @@ +From 350478ca7dae7a742d2b9154f8922bbc33a612a7 Mon Sep 17 00:00:00 2001 +From: Richard W.M. Jones <rjones@redhat.com> +Date: Thu, 30 Aug 2012 18:16:18 +0100 +Subject: [PATCH 26/37] EPEL 5: podwrapper: Don't use Pod::Man. + +This unfortunately means the man pages are generated as plain text. +However that's necessary as Pod::Man does not have an output_string +method. +--- + podwrapper.pl.in | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/podwrapper.pl.in b/podwrapper.pl.in +index 53a13cd..415fa67 100755 +--- a/podwrapper.pl.in ++++ b/podwrapper.pl.in +@@ -387,7 +387,7 @@ SUBMAN: { + package Podwrapper::Man; + + use vars qw(@ISA $VERSION); +- @ISA = qw(Pod::Man); ++ @ISA = qw(Pod::Simple::Text); + $VERSION = $package_version; + + # Override the L<> method. +-- +1.7.4.1 + diff --git a/0027-EPEL-5-Don-t-use-sgabios.patch b/0027-EPEL-5-Don-t-use-sgabios.patch deleted file mode 100644 index 2528eb1..0000000 --- a/0027-EPEL-5-Don-t-use-sgabios.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 84c0abdf9bd1cc84dc3cd6d0fcd85ffd8a33f7e5 Mon Sep 17 00:00:00 2001 -From: Richard W.M. Jones <rjones@redhat.com> -Date: Fri, 31 Aug 2012 10:24:06 +0100 -Subject: [PATCH 27/36] EPEL 5: Don't use sgabios. - -Old qemu doesn't support '-device' parameter. ---- - src/launch-appliance.c | 11 ----------- - 1 files changed, 0 insertions(+), 11 deletions(-) - -diff --git a/src/launch-appliance.c b/src/launch-appliance.c -index 570f6cf..ee815aa 100644 ---- a/src/launch-appliance.c -+++ b/src/launch-appliance.c -@@ -428,17 +428,6 @@ launch_appliance (guestfs_h *g, const char *arg) - add_cmdline (g, "-serial"); - add_cmdline (g, "stdio"); - -- if (qemu_supports_device (g, "Serial Graphics Adapter")) { -- /* Use sgabios instead of vgabios. This means we'll see BIOS -- * messages on the serial port, and also works around this bug -- * in qemu 1.1.0: -- * https://bugs.launchpad.net/qemu/+bug/1021649 -- * QEmu has included sgabios upstream since just before 1.0. -- */ -- add_cmdline (g, "-device"); -- add_cmdline (g, "sga"); -- } -- - /* Null vmchannel. */ - add_cmdline (g, "-net"); - add_cmdline (g, "user,vlan=0,net=" NETWORK); --- -1.7.4.1 - diff --git a/0027-EPEL-5-Revert-Mac-OS-X-Use-libtool-mode-execute-inst.patch b/0027-EPEL-5-Revert-Mac-OS-X-Use-libtool-mode-execute-inst.patch new file mode 100644 index 0000000..bdebe6b --- /dev/null +++ b/0027-EPEL-5-Revert-Mac-OS-X-Use-libtool-mode-execute-inst.patch @@ -0,0 +1,89 @@ +From 92682dfc73b9a0c2e21d5d4311bfd350af496ad8 Mon Sep 17 00:00:00 2001 +From: Richard W.M. Jones <rjones@redhat.com> +Date: Thu, 30 Aug 2012 18:19:28 +0100 +Subject: [PATCH 27/37] EPEL 5: Revert "Mac OS X: Use libtool --mode=execute instead of LD_LIBRARY_PATH" + +This reverts commit 61c9ea496e0579bb7d1bcf496595d66c3f08cfec. +--- + ocaml/Makefile.am | 16 ++++++++-------- + 1 files changed, 8 insertions(+), 8 deletions(-) + +diff --git a/ocaml/Makefile.am b/ocaml/Makefile.am +index 48ddc2c..b5dbd5f 100644 +--- a/ocaml/Makefile.am ++++ b/ocaml/Makefile.am +@@ -114,7 +114,7 @@ noinst_DATA += \ + + bindtests.bc: bindtests.cmo mlguestfs.cma + mkdir -p t +- $(top_builddir)/libtool -dlopen $(top_builddir)/src/.libs/libguestfs.la --mode=execute \ ++ LD_LIBRARY_PATH=../src/.libs \ + $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -I . -package unix -linkpkg mlguestfs.cma $< -o $@ + + bindtests.opt: bindtests.cmx mlguestfs.cmxa +@@ -123,7 +123,7 @@ bindtests.opt: bindtests.cmx mlguestfs.cmxa + + t/guestfs_005_load.bc: t/guestfs_005_load.cmo mlguestfs.cma + mkdir -p t +- $(top_builddir)/libtool -dlopen $(top_builddir)/src/.libs/libguestfs.la --mode=execute \ ++ LD_LIBRARY_PATH=../src/.libs \ + $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -I . -package unix -linkpkg mlguestfs.cma $< -o $@ + + t/guestfs_005_load.opt: t/guestfs_005_load.cmx mlguestfs.cmxa +@@ -132,7 +132,7 @@ t/guestfs_005_load.opt: t/guestfs_005_load.cmx mlguestfs.cmxa + + t/guestfs_010_basic.bc: t/guestfs_010_basic.cmo mlguestfs.cma + mkdir -p t +- $(top_builddir)/libtool -dlopen $(top_builddir)/src/.libs/libguestfs.la --mode=execute \ ++ LD_LIBRARY_PATH=../src/.libs \ + $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -I . -package unix -linkpkg mlguestfs.cma $< -o $@ + + t/guestfs_010_basic.opt: t/guestfs_010_basic.cmx mlguestfs.cmxa +@@ -141,7 +141,7 @@ t/guestfs_010_basic.opt: t/guestfs_010_basic.cmx mlguestfs.cmxa + + t/guestfs_070_threads.bc: t/guestfs_070_threads.cmo mlguestfs.cma + mkdir -p t +- $(top_builddir)/libtool -dlopen $(top_builddir)/src/.libs/libguestfs.la --mode=execute \ ++ LD_LIBRARY_PATH=../src/.libs \ + $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -I . -package unix,threads -thread -linkpkg mlguestfs.cma $< -o $@ + + t/guestfs_070_threads.opt: t/guestfs_070_threads.cmx mlguestfs.cmxa +@@ -150,7 +150,7 @@ t/guestfs_070_threads.opt: t/guestfs_070_threads.cmx mlguestfs.cmxa + + t/guestfs_080_optargs.bc: t/guestfs_080_optargs.cmo mlguestfs.cma + mkdir -p t +- $(top_builddir)/libtool -dlopen $(top_builddir)/src/.libs/libguestfs.la --mode=execute \ ++ LD_LIBRARY_PATH=../src/.libs \ + $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -I . -package unix -linkpkg mlguestfs.cma $< -o $@ + + t/guestfs_080_optargs.opt: t/guestfs_080_optargs.cmx mlguestfs.cmxa +@@ -159,7 +159,7 @@ t/guestfs_080_optargs.opt: t/guestfs_080_optargs.cmx mlguestfs.cmxa + + t/guestfs_400_events.bc: t/guestfs_400_events.cmo mlguestfs.cma + mkdir -p t +- $(top_builddir)/libtool -dlopen $(top_builddir)/src/.libs/libguestfs.la --mode=execute \ ++ LD_LIBRARY_PATH=../src/.libs \ + $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -I . -package unix -linkpkg mlguestfs.cma $< -o $@ + + t/guestfs_400_events.opt: t/guestfs_400_events.cmx mlguestfs.cmxa +@@ -168,7 +168,7 @@ t/guestfs_400_events.opt: t/guestfs_400_events.cmx mlguestfs.cmxa + + t/guestfs_400_progress.bc: t/guestfs_400_progress.cmo mlguestfs.cma + mkdir -p t +- $(top_builddir)/libtool -dlopen $(top_builddir)/src/.libs/libguestfs.la --mode=execute \ ++ LD_LIBRARY_PATH=../src/.libs \ + $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -I . -package unix -linkpkg mlguestfs.cma $< -o $@ + + t/guestfs_400_progress.opt: t/guestfs_400_progress.cmx mlguestfs.cmxa +@@ -177,7 +177,7 @@ t/guestfs_400_progress.opt: t/guestfs_400_progress.cmx mlguestfs.cmxa + + t/guestfs_500_mount_local.bc: t/guestfs_500_mount_local.cmo mlguestfs.cma + mkdir -p t +- $(top_builddir)/libtool -dlopen $(top_builddir)/src/.libs/libguestfs.la --mode=execute \ ++ LD_LIBRARY_PATH=../src/.libs \ + $(OCAMLFIND) ocamlc -custom $(OCAMLCFLAGS) -I . -package unix -linkpkg mlguestfs.cma $< -o $@ + + t/guestfs_500_mount_local.opt: t/guestfs_500_mount_local.cmx mlguestfs.cmxa +-- +1.7.4.1 + diff --git a/0028-EPEL-5-Don-t-use-sgabios.patch b/0028-EPEL-5-Don-t-use-sgabios.patch new file mode 100644 index 0000000..6ac08c0 --- /dev/null +++ b/0028-EPEL-5-Don-t-use-sgabios.patch @@ -0,0 +1,35 @@ +From d4180d13c025f66f2b9b853b7a6277dfae52e2b9 Mon Sep 17 00:00:00 2001 +From: Richard W.M. Jones <rjones@redhat.com> +Date: Fri, 31 Aug 2012 10:24:06 +0100 +Subject: [PATCH 28/37] EPEL 5: Don't use sgabios. + +Old qemu doesn't support '-device' parameter. +--- + src/launch-appliance.c | 11 ----------- + 1 files changed, 0 insertions(+), 11 deletions(-) + +diff --git a/src/launch-appliance.c b/src/launch-appliance.c +index 570f6cf..ee815aa 100644 +--- a/src/launch-appliance.c ++++ b/src/launch-appliance.c +@@ -428,17 +428,6 @@ launch_appliance (guestfs_h *g, const char *arg) + add_cmdline (g, "-serial"); + add_cmdline (g, "stdio"); + +- if (qemu_supports_device (g, "Serial Graphics Adapter")) { +- /* Use sgabios instead of vgabios. This means we'll see BIOS +- * messages on the serial port, and also works around this bug +- * in qemu 1.1.0: +- * https://bugs.launchpad.net/qemu/+bug/1021649 +- * QEmu has included sgabios upstream since just before 1.0. +- */ +- add_cmdline (g, "-device"); +- add_cmdline (g, "sga"); +- } +- + /* Null vmchannel. */ + add_cmdline (g, "-net"); + add_cmdline (g, "user,vlan=0,net=" NETWORK); +-- +1.7.4.1 + diff --git a/0028-EPEL-5-Revert-daemon-Remove-e2prog-hack-only-needed-.patch b/0028-EPEL-5-Revert-daemon-Remove-e2prog-hack-only-needed-.patch deleted file mode 100644 index 79a227e..0000000 --- a/0028-EPEL-5-Revert-daemon-Remove-e2prog-hack-only-needed-.patch +++ /dev/null @@ -1,388 +0,0 @@ -From 437b53bab6f8594ea4b84c881fc75cb86df29490 Mon Sep 17 00:00:00 2001 -From: Richard W.M. Jones <rjones@redhat.com> -Date: Fri, 31 Aug 2012 13:48:18 +0100 -Subject: [PATCH 28/36] EPEL 5: Revert "daemon: Remove e2prog hack (only needed for RHEL 5)." - -This reverts commit 163e030ee13644ad9efe1e078aff47b879657333. ---- - daemon/daemon.h | 2 + - daemon/ext2.c | 113 +++++++++++++++++++++++++++++++++++++++++++++++------- - daemon/labels.c | 6 ++- - daemon/mkfs.c | 8 +++- - 4 files changed, 111 insertions(+), 18 deletions(-) - -diff --git a/daemon/daemon.h b/daemon/daemon.h -index a7371ea..ec0fa3d 100644 ---- a/daemon/daemon.h -+++ b/daemon/daemon.h -@@ -185,6 +185,8 @@ extern int filesystem_available (const char *filesystem); - extern int sync_disks (void); - - /*-- in ext2.c --*/ -+extern int e2prog (char *name); /* Massive hack for RHEL 5. */ -+ - /* Confirmed this is true up to ext4 from the Linux sources. */ - #define EXT2_LABEL_MAX 16 - -diff --git a/daemon/ext2.c b/daemon/ext2.c -index e4548d6..297c477 100644 ---- a/daemon/ext2.c -+++ b/daemon/ext2.c -@@ -31,6 +31,7 @@ - - #define MAX_ARGS 128 - -+ - GUESTFSD_EXT_CMD(str_tune2fs, tune2fs); - GUESTFSD_EXT_CMD(str_e2fsck, e2fsck); - GUESTFSD_EXT_CMD(str_resize2fs, resize2fs); -@@ -38,6 +39,32 @@ GUESTFSD_EXT_CMD(str_mke2fs, mke2fs); - GUESTFSD_EXT_CMD(str_lsattr, lsattr); - GUESTFSD_EXT_CMD(str_chattr, chattr); - -+/* Choose which tools like mke2fs to use. For RHEL 5 (only) there -+ * is a special set of tools which support ext2/3/4. eg. On RHEL 5, -+ * mke2fs only supports ext2/3, but mke4fs supports ext2/3/4. -+ * -+ * We specify e4fsprogs in the package list to ensure it is loaded -+ * if it exists. -+ */ -+int -+e2prog (char *name) -+{ -+ char *p = strstr (name, "e2"); -+ if (!p) return 0; -+ p++; -+ -+ *p = '4'; -+ if (prog_exists (name)) -+ return 0; -+ -+ *p = '2'; -+ if (prog_exists (name)) -+ return 0; -+ -+ reply_with_error ("cannot find required program %s", name); -+ return -1; -+} -+ - char ** - do_tune2fs_l (const char *device) - { -@@ -46,7 +73,11 @@ do_tune2fs_l (const char *device) - char *p, *pend, *colon; - DECLARE_STRINGSBUF (ret); - -- r = command (&out, &err, str_tune2fs, "-l", device, NULL); -+ char prog[] = "tune2fs"; -+ if (e2prog (prog) == -1) -+ return NULL; -+ -+ r = command (&out, &err, prog, "-l", device, NULL); - if (r == -1) { - reply_with_error ("%s", err); - return NULL; -@@ -131,7 +162,11 @@ do_set_e2uuid (const char *device, const char *uuid) - int r; - CLEANUP_FREE char *err = NULL; - -- r = command (NULL, &err, str_tune2fs, "-U", uuid, device, NULL); -+ char prog[] = "tune2fs"; -+ if (e2prog (prog) == -1) -+ return -1; -+ -+ r = command (NULL, &err, prog, "-U", uuid, device, NULL); - if (r == -1) { - reply_with_error ("%s", err); - return -1; -@@ -152,6 +187,10 @@ if_not_mounted_run_e2fsck (const char *device) - { - CLEANUP_FREE char *err = NULL; - int r, mounted; -+ char prog[] = "e2fsck"; -+ -+ if (e2prog (prog) == -1) -+ return -1; - - mounted = is_device_mounted (device); - if (mounted == -1) -@@ -160,7 +199,7 @@ if_not_mounted_run_e2fsck (const char *device) - if (!mounted) { - r = commandf (NULL, &err, - COMMAND_FLAG_FOLD_STDOUT_ON_STDERR, -- str_e2fsck, "-fy", device, NULL); -+ prog, "-fy", device, NULL); - if (r == -1) { - reply_with_error ("%s", err); - return -1; -@@ -176,10 +215,14 @@ do_resize2fs (const char *device) - CLEANUP_FREE char *err = NULL; - int r; - -+ char prog[] = "resize2fs"; -+ if (e2prog (prog) == -1) -+ return -1; -+ - if (if_not_mounted_run_e2fsck (device) == -1) - return -1; - -- r = command (NULL, &err, str_resize2fs, device, NULL); -+ r = command (NULL, &err, prog, device, NULL); - if (r == -1) { - reply_with_error ("%s", err); - return -1; -@@ -194,6 +237,10 @@ do_resize2fs_size (const char *device, int64_t size) - CLEANUP_FREE char *err = NULL; - int r; - -+ char prog[] = "resize2fs"; -+ if (e2prog (prog) == -1) -+ return -1; -+ - /* resize2fs itself may impose additional limits. Since we are - * going to use the 'K' suffix however we can only work with whole - * kilobytes. -@@ -211,7 +258,7 @@ do_resize2fs_size (const char *device, int64_t size) - char buf[32]; - snprintf (buf, sizeof buf, "%" PRIi64 "K", size); - -- r = command (NULL, &err, str_resize2fs, device, buf, NULL); -+ r = command (NULL, &err, prog, device, buf, NULL); - if (r == -1) { - reply_with_error ("%s", err); - return -1; -@@ -226,10 +273,14 @@ do_resize2fs_M (const char *device) - CLEANUP_FREE char *err = NULL; - int r; - -+ char prog[] = "resize2fs"; -+ if (e2prog (prog) == -1) -+ return -1; -+ - if (if_not_mounted_run_e2fsck (device) == -1) - return -1; - -- r = command (NULL, &err, str_resize2fs, "-M", device, NULL); -+ r = command (NULL, &err, prog, "-M", device, NULL); - if (r == -1) { - reply_with_error ("%s", err); - return -1; -@@ -248,6 +299,10 @@ do_e2fsck (const char *device, - CLEANUP_FREE char *err = NULL; - size_t i = 0; - int r; -+ char prog[] = "e2fsck"; -+ -+ if (e2prog (prog) == -1) -+ return -1; - - /* Default if not selected. */ - if (!(optargs_bitmask & GUESTFS_E2FSCK_CORRECT_BITMASK)) -@@ -260,7 +315,7 @@ do_e2fsck (const char *device, - return -1; - } - -- ADD_ARG (argv, i, str_e2fsck); -+ ADD_ARG (argv, i, prog); - ADD_ARG (argv, i, "-f"); - - if (correct) -@@ -303,13 +358,17 @@ do_mke2journal (int blocksize, const char *device) - CLEANUP_FREE char *err = NULL; - int r; - -+ char prog[] = "mke2fs"; -+ if (e2prog (prog) == -1) -+ return -1; -+ - char blocksize_s[32]; - snprintf (blocksize_s, sizeof blocksize_s, "%d", blocksize); - - wipe_device_before_mkfs (device); - - r = command (NULL, &err, -- str_mke2fs, "-F", "-O", "journal_dev", "-b", blocksize_s, -+ prog, "-F", "-O", "journal_dev", "-b", blocksize_s, - device, NULL); - if (r == -1) { - reply_with_error ("%s", err); -@@ -325,6 +384,10 @@ do_mke2journal_L (int blocksize, const char *label, const char *device) - CLEANUP_FREE char *err = NULL; - int r; - -+ char prog[] = "mke2fs"; -+ if (e2prog (prog) == -1) -+ return -1; -+ - if (strlen (label) > EXT2_LABEL_MAX) { - reply_with_error ("%s: ext2 labels are limited to %d bytes", - label, EXT2_LABEL_MAX); -@@ -337,7 +400,7 @@ do_mke2journal_L (int blocksize, const char *label, const char *device) - wipe_device_before_mkfs (device); - - r = command (NULL, &err, -- str_mke2fs, "-F", "-O", "journal_dev", "-b", blocksize_s, -+ prog, "-F", "-O", "journal_dev", "-b", blocksize_s, - "-L", label, - device, NULL); - if (r == -1) { -@@ -354,13 +417,17 @@ do_mke2journal_U (int blocksize, const char *uuid, const char *device) - CLEANUP_FREE char *err = NULL; - int r; - -+ char prog[] = "mke2fs"; -+ if (e2prog (prog) == -1) -+ return -1; -+ - char blocksize_s[32]; - snprintf (blocksize_s, sizeof blocksize_s, "%d", blocksize); - - wipe_device_before_mkfs (device); - - r = command (NULL, &err, -- str_mke2fs, "-F", "-O", "journal_dev", "-b", blocksize_s, -+ prog, "-F", "-O", "journal_dev", "-b", blocksize_s, - "-U", uuid, - device, NULL); - if (r == -1) { -@@ -378,6 +445,10 @@ do_mke2fs_J (const char *fstype, int blocksize, const char *device, - CLEANUP_FREE char *err = NULL; - int r; - -+ char prog[] = "mke2fs"; -+ if (e2prog (prog) == -1) -+ return -1; -+ - char blocksize_s[32]; - snprintf (blocksize_s, sizeof blocksize_s, "%d", blocksize); - -@@ -388,7 +459,7 @@ do_mke2fs_J (const char *fstype, int blocksize, const char *device, - wipe_device_before_mkfs (device); - - r = command (NULL, &err, -- str_mke2fs, "-F", "-t", fstype, "-J", jdev, "-b", blocksize_s, -+ prog, "-F", "-t", fstype, "-J", jdev, "-b", blocksize_s, - device, NULL); - if (r == -1) { - reply_with_error ("%s", err); -@@ -405,6 +476,10 @@ do_mke2fs_JL (const char *fstype, int blocksize, const char *device, - CLEANUP_FREE char *err = NULL; - int r; - -+ char prog[] = "mke2fs"; -+ if (e2prog (prog) == -1) -+ return -1; -+ - if (strlen (label) > EXT2_LABEL_MAX) { - reply_with_error ("%s: ext2 labels are limited to %d bytes", - label, EXT2_LABEL_MAX); -@@ -421,7 +496,7 @@ do_mke2fs_JL (const char *fstype, int blocksize, const char *device, - wipe_device_before_mkfs (device); - - r = command (NULL, &err, -- str_mke2fs, "-F", "-t", fstype, "-J", jdev, "-b", blocksize_s, -+ prog, "-F", "-t", fstype, "-J", jdev, "-b", blocksize_s, - device, NULL); - if (r == -1) { - reply_with_error ("%s", err); -@@ -438,6 +513,10 @@ do_mke2fs_JU (const char *fstype, int blocksize, const char *device, - CLEANUP_FREE char *err = NULL; - int r; - -+ char prog[] = "mke2fs"; -+ if (e2prog (prog) == -1) -+ return -1; -+ - char blocksize_s[32]; - snprintf (blocksize_s, sizeof blocksize_s, "%d", blocksize); - -@@ -448,7 +527,7 @@ do_mke2fs_JU (const char *fstype, int blocksize, const char *device, - wipe_device_before_mkfs (device); - - r = command (NULL, &err, -- str_mke2fs, "-F", "-t", fstype, "-J", jdev, "-b", blocksize_s, -+ prog, "-F", "-t", fstype, "-J", jdev, "-b", blocksize_s, - device, NULL); - if (r == -1) { - reply_with_error ("%s", err); -@@ -476,6 +555,7 @@ do_tune2fs (const char *device, /* only required parameter */ - size_t i = 0; - int r; - CLEANUP_FREE char *err = NULL; -+ char prog[] = "tune2fs"; - char maxmountcount_s[64]; - char mountcount_s[64]; - char group_s[64]; -@@ -484,7 +564,10 @@ do_tune2fs (const char *device, /* only required parameter */ - char reservedblockscount_s[64]; - char user_s[64]; - -- ADD_ARG (argv, i, str_tune2fs); -+ if (e2prog (prog) == -1) -+ return -1; -+ -+ ADD_ARG (argv, i, prog); - - if (optargs_bitmask & GUESTFS_TUNE2FS_FORCE_BITMASK) { - if (force) -@@ -592,7 +675,7 @@ do_tune2fs (const char *device, /* only required parameter */ - - r = commandv (NULL, &err, argv); - if (r == -1) { -- reply_with_error ("%s: %s", device, err); -+ reply_with_error ("%s: %s: %s", prog, device, err); - return -1; - } - -diff --git a/daemon/labels.c b/daemon/labels.c -index 2fda354..9f08a07 100644 ---- a/daemon/labels.c -+++ b/daemon/labels.c -@@ -36,13 +36,17 @@ e2label (const char *device, const char *label) - int r; - CLEANUP_FREE char *err = NULL; - -+ char prog[] = "e2label"; -+ if (e2prog (prog) == -1) -+ return -1; -+ - if (strlen (label) > EXT2_LABEL_MAX) { - reply_with_error ("%s: ext2 labels are limited to %d bytes", - label, EXT2_LABEL_MAX); - return -1; - } - -- r = command (NULL, &err, str_e2label, device, label, NULL); -+ r = command (NULL, &err, prog, device, label, NULL); - if (r == -1) { - reply_with_error ("%s", err); - return -1; -diff --git a/daemon/mkfs.c b/daemon/mkfs.c -index ff0f2fc..88dea8b 100644 ---- a/daemon/mkfs.c -+++ b/daemon/mkfs.c -@@ -45,6 +45,7 @@ do_mkfs (const char *fstype, const char *device, int blocksize, - char sectorsize_str[32]; - int r; - CLEANUP_FREE char *err = NULL; -+ char mke2fs[] = "mke2fs"; - int extfs = 0; - - if (STREQ (fstype, "ext2") || STREQ (fstype, "ext3") || -@@ -55,8 +56,11 @@ do_mkfs (const char *fstype, const char *device, int blocksize, - * the mkfs program "eats" some options, in particular the -F - * option. - */ -- if (extfs) -- ADD_ARG (argv, i, str_mke2fs); -+ if (extfs) { -+ if (e2prog (mke2fs) == -1) -+ return -1; -+ ADD_ARG (argv, i, mke2fs); -+ } - else - ADD_ARG (argv, i, str_mkfs); - --- -1.7.4.1 - diff --git a/0029-EPEL-5-Disable-tar-xz-test.patch b/0029-EPEL-5-Disable-tar-xz-test.patch deleted file mode 100644 index e6bb6e4..0000000 --- a/0029-EPEL-5-Disable-tar-xz-test.patch +++ /dev/null @@ -1,26 +0,0 @@ -From e1a657f74be5dc3f349732112e68c7f2064a95b8 Mon Sep 17 00:00:00 2001 -From: Richard W.M. Jones <rjones@redhat.com> -Date: Fri, 31 Aug 2012 14:59:25 +0100 -Subject: [PATCH 29/36] EPEL 5: Disable tar --xz test. - -Although xz is available, ancient tar didn't have the --xz option. ---- - generator/actions.ml | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/generator/actions.ml b/generator/actions.ml -index 06e4211..aa69db3 100644 ---- a/generator/actions.ml -+++ b/generator/actions.ml -@@ -4105,7 +4105,7 @@ To get the checksums for many files, use C<guestfs_checksums_out>." }; - [["mkdir"; "/tar_in_gz"]; - ["tar_in"; "../data/helloworld.tar.gz"; "/tar_in_gz"; "gzip"]; - ["cat"; "/tar_in_gz/hello"]], "hello\n"); -- InitScratchFS, IfAvailable "xz", TestOutput ( -+ InitScratchFS, Disabled, TestOutput ( - [["mkdir"; "/tar_in_xz"]; - ["tar_in"; "../data/helloworld.tar.xz"; "/tar_in_xz"; "xz"]; - ["cat"; "/tar_in_xz/hello"]], "hello\n") --- -1.7.4.1 - diff --git a/0029-EPEL-5-Revert-daemon-Remove-e2prog-hack-only-needed-.patch b/0029-EPEL-5-Revert-daemon-Remove-e2prog-hack-only-needed-.patch new file mode 100644 index 0000000..dd0df1d --- /dev/null +++ b/0029-EPEL-5-Revert-daemon-Remove-e2prog-hack-only-needed-.patch @@ -0,0 +1,388 @@ +From b4c66073b348c95e01ef743ee8e15a891ba41725 Mon Sep 17 00:00:00 2001 +From: Richard W.M. Jones <rjones@redhat.com> +Date: Fri, 31 Aug 2012 13:48:18 +0100 +Subject: [PATCH 29/37] EPEL 5: Revert "daemon: Remove e2prog hack (only needed for RHEL 5)." + +This reverts commit 163e030ee13644ad9efe1e078aff47b879657333. +--- + daemon/daemon.h | 2 + + daemon/ext2.c | 113 +++++++++++++++++++++++++++++++++++++++++++++++------- + daemon/labels.c | 6 ++- + daemon/mkfs.c | 8 +++- + 4 files changed, 111 insertions(+), 18 deletions(-) + +diff --git a/daemon/daemon.h b/daemon/daemon.h +index a7371ea..ec0fa3d 100644 +--- a/daemon/daemon.h ++++ b/daemon/daemon.h +@@ -185,6 +185,8 @@ extern int filesystem_available (const char *filesystem); + extern int sync_disks (void); + + /*-- in ext2.c --*/ ++extern int e2prog (char *name); /* Massive hack for RHEL 5. */ ++ + /* Confirmed this is true up to ext4 from the Linux sources. */ + #define EXT2_LABEL_MAX 16 + +diff --git a/daemon/ext2.c b/daemon/ext2.c +index e4548d6..297c477 100644 +--- a/daemon/ext2.c ++++ b/daemon/ext2.c +@@ -31,6 +31,7 @@ + + #define MAX_ARGS 128 + ++ + GUESTFSD_EXT_CMD(str_tune2fs, tune2fs); + GUESTFSD_EXT_CMD(str_e2fsck, e2fsck); + GUESTFSD_EXT_CMD(str_resize2fs, resize2fs); +@@ -38,6 +39,32 @@ GUESTFSD_EXT_CMD(str_mke2fs, mke2fs); + GUESTFSD_EXT_CMD(str_lsattr, lsattr); + GUESTFSD_EXT_CMD(str_chattr, chattr); + ++/* Choose which tools like mke2fs to use. For RHEL 5 (only) there ++ * is a special set of tools which support ext2/3/4. eg. On RHEL 5, ++ * mke2fs only supports ext2/3, but mke4fs supports ext2/3/4. ++ * ++ * We specify e4fsprogs in the package list to ensure it is loaded ++ * if it exists. ++ */ ++int ++e2prog (char *name) ++{ ++ char *p = strstr (name, "e2"); ++ if (!p) return 0; ++ p++; ++ ++ *p = '4'; ++ if (prog_exists (name)) ++ return 0; ++ ++ *p = '2'; ++ if (prog_exists (name)) ++ return 0; ++ ++ reply_with_error ("cannot find required program %s", name); ++ return -1; ++} ++ + char ** + do_tune2fs_l (const char *device) + { +@@ -46,7 +73,11 @@ do_tune2fs_l (const char *device) + char *p, *pend, *colon; + DECLARE_STRINGSBUF (ret); + +- r = command (&out, &err, str_tune2fs, "-l", device, NULL); ++ char prog[] = "tune2fs"; ++ if (e2prog (prog) == -1) ++ return NULL; ++ ++ r = command (&out, &err, prog, "-l", device, NULL); + if (r == -1) { + reply_with_error ("%s", err); + return NULL; +@@ -131,7 +162,11 @@ do_set_e2uuid (const char *device, const char *uuid) + int r; + CLEANUP_FREE char *err = NULL; + +- r = command (NULL, &err, str_tune2fs, "-U", uuid, device, NULL); ++ char prog[] = "tune2fs"; ++ if (e2prog (prog) == -1) ++ return -1; ++ ++ r = command (NULL, &err, prog, "-U", uuid, device, NULL); + if (r == -1) { + reply_with_error ("%s", err); + return -1; +@@ -152,6 +187,10 @@ if_not_mounted_run_e2fsck (const char *device) + { + CLEANUP_FREE char *err = NULL; + int r, mounted; ++ char prog[] = "e2fsck"; ++ ++ if (e2prog (prog) == -1) ++ return -1; + + mounted = is_device_mounted (device); + if (mounted == -1) +@@ -160,7 +199,7 @@ if_not_mounted_run_e2fsck (const char *device) + if (!mounted) { + r = commandf (NULL, &err, + COMMAND_FLAG_FOLD_STDOUT_ON_STDERR, +- str_e2fsck, "-fy", device, NULL); ++ prog, "-fy", device, NULL); + if (r == -1) { + reply_with_error ("%s", err); + return -1; +@@ -176,10 +215,14 @@ do_resize2fs (const char *device) + CLEANUP_FREE char *err = NULL; + int r; + ++ char prog[] = "resize2fs"; ++ if (e2prog (prog) == -1) ++ return -1; ++ + if (if_not_mounted_run_e2fsck (device) == -1) + return -1; + +- r = command (NULL, &err, str_resize2fs, device, NULL); ++ r = command (NULL, &err, prog, device, NULL); + if (r == -1) { + reply_with_error ("%s", err); + return -1; +@@ -194,6 +237,10 @@ do_resize2fs_size (const char *device, int64_t size) + CLEANUP_FREE char *err = NULL; + int r; + ++ char prog[] = "resize2fs"; ++ if (e2prog (prog) == -1) ++ return -1; ++ + /* resize2fs itself may impose additional limits. Since we are + * going to use the 'K' suffix however we can only work with whole + * kilobytes. +@@ -211,7 +258,7 @@ do_resize2fs_size (const char *device, int64_t size) + char buf[32]; + snprintf (buf, sizeof buf, "%" PRIi64 "K", size); + +- r = command (NULL, &err, str_resize2fs, device, buf, NULL); ++ r = command (NULL, &err, prog, device, buf, NULL); + if (r == -1) { + reply_with_error ("%s", err); + return -1; +@@ -226,10 +273,14 @@ do_resize2fs_M (const char *device) + CLEANUP_FREE char *err = NULL; + int r; + ++ char prog[] = "resize2fs"; ++ if (e2prog (prog) == -1) ++ return -1; ++ + if (if_not_mounted_run_e2fsck (device) == -1) + return -1; + +- r = command (NULL, &err, str_resize2fs, "-M", device, NULL); ++ r = command (NULL, &err, prog, "-M", device, NULL); + if (r == -1) { + reply_with_error ("%s", err); + return -1; +@@ -248,6 +299,10 @@ do_e2fsck (const char *device, + CLEANUP_FREE char *err = NULL; + size_t i = 0; + int r; ++ char prog[] = "e2fsck"; ++ ++ if (e2prog (prog) == -1) ++ return -1; + + /* Default if not selected. */ + if (!(optargs_bitmask & GUESTFS_E2FSCK_CORRECT_BITMASK)) +@@ -260,7 +315,7 @@ do_e2fsck (const char *device, + return -1; + } + +- ADD_ARG (argv, i, str_e2fsck); ++ ADD_ARG (argv, i, prog); + ADD_ARG (argv, i, "-f"); + + if (correct) +@@ -303,13 +358,17 @@ do_mke2journal (int blocksize, const char *device) + CLEANUP_FREE char *err = NULL; + int r; + ++ char prog[] = "mke2fs"; ++ if (e2prog (prog) == -1) ++ return -1; ++ + char blocksize_s[32]; + snprintf (blocksize_s, sizeof blocksize_s, "%d", blocksize); + + wipe_device_before_mkfs (device); + + r = command (NULL, &err, +- str_mke2fs, "-F", "-O", "journal_dev", "-b", blocksize_s, ++ prog, "-F", "-O", "journal_dev", "-b", blocksize_s, + device, NULL); + if (r == -1) { + reply_with_error ("%s", err); +@@ -325,6 +384,10 @@ do_mke2journal_L (int blocksize, const char *label, const char *device) + CLEANUP_FREE char *err = NULL; + int r; + ++ char prog[] = "mke2fs"; ++ if (e2prog (prog) == -1) ++ return -1; ++ + if (strlen (label) > EXT2_LABEL_MAX) { + reply_with_error ("%s: ext2 labels are limited to %d bytes", + label, EXT2_LABEL_MAX); +@@ -337,7 +400,7 @@ do_mke2journal_L (int blocksize, const char *label, const char *device) + wipe_device_before_mkfs (device); + + r = command (NULL, &err, +- str_mke2fs, "-F", "-O", "journal_dev", "-b", blocksize_s, ++ prog, "-F", "-O", "journal_dev", "-b", blocksize_s, + "-L", label, + device, NULL); + if (r == -1) { +@@ -354,13 +417,17 @@ do_mke2journal_U (int blocksize, const char *uuid, const char *device) + CLEANUP_FREE char *err = NULL; + int r; + ++ char prog[] = "mke2fs"; ++ if (e2prog (prog) == -1) ++ return -1; ++ + char blocksize_s[32]; + snprintf (blocksize_s, sizeof blocksize_s, "%d", blocksize); + + wipe_device_before_mkfs (device); + + r = command (NULL, &err, +- str_mke2fs, "-F", "-O", "journal_dev", "-b", blocksize_s, ++ prog, "-F", "-O", "journal_dev", "-b", blocksize_s, + "-U", uuid, + device, NULL); + if (r == -1) { +@@ -378,6 +445,10 @@ do_mke2fs_J (const char *fstype, int blocksize, const char *device, + CLEANUP_FREE char *err = NULL; + int r; + ++ char prog[] = "mke2fs"; ++ if (e2prog (prog) == -1) ++ return -1; ++ + char blocksize_s[32]; + snprintf (blocksize_s, sizeof blocksize_s, "%d", blocksize); + +@@ -388,7 +459,7 @@ do_mke2fs_J (const char *fstype, int blocksize, const char *device, + wipe_device_before_mkfs (device); + + r = command (NULL, &err, +- str_mke2fs, "-F", "-t", fstype, "-J", jdev, "-b", blocksize_s, ++ prog, "-F", "-t", fstype, "-J", jdev, "-b", blocksize_s, + device, NULL); + if (r == -1) { + reply_with_error ("%s", err); +@@ -405,6 +476,10 @@ do_mke2fs_JL (const char *fstype, int blocksize, const char *device, + CLEANUP_FREE char *err = NULL; + int r; + ++ char prog[] = "mke2fs"; ++ if (e2prog (prog) == -1) ++ return -1; ++ + if (strlen (label) > EXT2_LABEL_MAX) { + reply_with_error ("%s: ext2 labels are limited to %d bytes", + label, EXT2_LABEL_MAX); +@@ -421,7 +496,7 @@ do_mke2fs_JL (const char *fstype, int blocksize, const char *device, + wipe_device_before_mkfs (device); + + r = command (NULL, &err, +- str_mke2fs, "-F", "-t", fstype, "-J", jdev, "-b", blocksize_s, ++ prog, "-F", "-t", fstype, "-J", jdev, "-b", blocksize_s, + device, NULL); + if (r == -1) { + reply_with_error ("%s", err); +@@ -438,6 +513,10 @@ do_mke2fs_JU (const char *fstype, int blocksize, const char *device, + CLEANUP_FREE char *err = NULL; + int r; + ++ char prog[] = "mke2fs"; ++ if (e2prog (prog) == -1) ++ return -1; ++ + char blocksize_s[32]; + snprintf (blocksize_s, sizeof blocksize_s, "%d", blocksize); + +@@ -448,7 +527,7 @@ do_mke2fs_JU (const char *fstype, int blocksize, const char *device, + wipe_device_before_mkfs (device); + + r = command (NULL, &err, +- str_mke2fs, "-F", "-t", fstype, "-J", jdev, "-b", blocksize_s, ++ prog, "-F", "-t", fstype, "-J", jdev, "-b", blocksize_s, + device, NULL); + if (r == -1) { + reply_with_error ("%s", err); +@@ -476,6 +555,7 @@ do_tune2fs (const char *device, /* only required parameter */ + size_t i = 0; + int r; + CLEANUP_FREE char *err = NULL; ++ char prog[] = "tune2fs"; + char maxmountcount_s[64]; + char mountcount_s[64]; + char group_s[64]; +@@ -484,7 +564,10 @@ do_tune2fs (const char *device, /* only required parameter */ + char reservedblockscount_s[64]; + char user_s[64]; + +- ADD_ARG (argv, i, str_tune2fs); ++ if (e2prog (prog) == -1) ++ return -1; ++ ++ ADD_ARG (argv, i, prog); + + if (optargs_bitmask & GUESTFS_TUNE2FS_FORCE_BITMASK) { + if (force) +@@ -592,7 +675,7 @@ do_tune2fs (const char *device, /* only required parameter */ + + r = commandv (NULL, &err, argv); + if (r == -1) { +- reply_with_error ("%s: %s", device, err); ++ reply_with_error ("%s: %s: %s", prog, device, err); + return -1; + } + +diff --git a/daemon/labels.c b/daemon/labels.c +index 2fda354..9f08a07 100644 +--- a/daemon/labels.c ++++ b/daemon/labels.c +@@ -36,13 +36,17 @@ e2label (const char *device, const char *label) + int r; + CLEANUP_FREE char *err = NULL; + ++ char prog[] = "e2label"; ++ if (e2prog (prog) == -1) ++ return -1; ++ + if (strlen (label) > EXT2_LABEL_MAX) { + reply_with_error ("%s: ext2 labels are limited to %d bytes", + label, EXT2_LABEL_MAX); + return -1; + } + +- r = command (NULL, &err, str_e2label, device, label, NULL); ++ r = command (NULL, &err, prog, device, label, NULL); + if (r == -1) { + reply_with_error ("%s", err); + return -1; +diff --git a/daemon/mkfs.c b/daemon/mkfs.c +index ff0f2fc..88dea8b 100644 +--- a/daemon/mkfs.c ++++ b/daemon/mkfs.c +@@ -45,6 +45,7 @@ do_mkfs (const char *fstype, const char *device, int blocksize, + char sectorsize_str[32]; + int r; + CLEANUP_FREE char *err = NULL; ++ char mke2fs[] = "mke2fs"; + int extfs = 0; + + if (STREQ (fstype, "ext2") || STREQ (fstype, "ext3") || +@@ -55,8 +56,11 @@ do_mkfs (const char *fstype, const char *device, int blocksize, + * the mkfs program "eats" some options, in particular the -F + * option. + */ +- if (extfs) +- ADD_ARG (argv, i, str_mke2fs); ++ if (extfs) { ++ if (e2prog (mke2fs) == -1) ++ return -1; ++ ADD_ARG (argv, i, mke2fs); ++ } + else + ADD_ARG (argv, i, str_mkfs); + +-- +1.7.4.1 + diff --git a/0030-EPEL-5-Disable-tar-xz-test.patch b/0030-EPEL-5-Disable-tar-xz-test.patch new file mode 100644 index 0000000..c20e11d --- /dev/null +++ b/0030-EPEL-5-Disable-tar-xz-test.patch @@ -0,0 +1,26 @@ +From 3c027d28c1de034ecdb5cc5837944dfebe5d769a Mon Sep 17 00:00:00 2001 +From: Richard W.M. Jones <rjones@redhat.com> +Date: Fri, 31 Aug 2012 14:59:25 +0100 +Subject: [PATCH 30/37] EPEL 5: Disable tar --xz test. + +Although xz is available, ancient tar didn't have the --xz option. +--- + generator/actions.ml | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/generator/actions.ml b/generator/actions.ml +index 06e4211..aa69db3 100644 +--- a/generator/actions.ml ++++ b/generator/actions.ml +@@ -4105,7 +4105,7 @@ To get the checksums for many files, use C<guestfs_checksums_out>." }; + [["mkdir"; "/tar_in_gz"]; + ["tar_in"; "../data/helloworld.tar.gz"; "/tar_in_gz"; "gzip"]; + ["cat"; "/tar_in_gz/hello"]], "hello\n"); +- InitScratchFS, IfAvailable "xz", TestOutput ( ++ InitScratchFS, Disabled, TestOutput ( + [["mkdir"; "/tar_in_xz"]; + ["tar_in"; "../data/helloworld.tar.xz"; "/tar_in_xz"; "xz"]; + ["cat"; "/tar_in_xz/hello"]], "hello\n") +-- +1.7.4.1 + diff --git a/0030-EPEL-5-Ignore-sparsify-error-if-qemu-img-help-is-kil.patch b/0030-EPEL-5-Ignore-sparsify-error-if-qemu-img-help-is-kil.patch deleted file mode 100644 index c273275..0000000 --- a/0030-EPEL-5-Ignore-sparsify-error-if-qemu-img-help-is-kil.patch +++ /dev/null @@ -1,26 +0,0 @@ -From aeb92a6862d385ece1280baabb5bc03214a2ed4f Mon Sep 17 00:00:00 2001 -From: Richard W.M. Jones <rjones@redhat.com> -Date: Fri, 31 Aug 2012 22:12:59 +0100 -Subject: [PATCH 30/36] EPEL 5: Ignore sparsify error if qemu-img --help is killed by a signal. - ---- - sparsify/sparsify.ml | 3 +-- - 1 files changed, 1 insertions(+), 2 deletions(-) - -diff --git a/sparsify/sparsify.ml b/sparsify/sparsify.ml -index 5ee2adb..0606ebe 100644 ---- a/sparsify/sparsify.ml -+++ b/sparsify/sparsify.ml -@@ -168,8 +168,7 @@ let qemu_img_version = - let stat = close_process_in chan in - (match stat with - | WEXITED _ -> () -- | WSIGNALED i -> -- error (f_"external command '%s' killed by signal %d") cmd i -+ | WSIGNALED i -> () - | WSTOPPED i -> - error (f_"external command '%s' stopped by signal %d") cmd i - ); --- -1.7.4.1 - diff --git a/0031-EPEL-5-Ignore-sparsify-error-if-qemu-img-help-is-kil.patch b/0031-EPEL-5-Ignore-sparsify-error-if-qemu-img-help-is-kil.patch new file mode 100644 index 0000000..29ad623 --- /dev/null +++ b/0031-EPEL-5-Ignore-sparsify-error-if-qemu-img-help-is-kil.patch @@ -0,0 +1,26 @@ +From 59d5706d06a71e624670c10c8286fad76c04c386 Mon Sep 17 00:00:00 2001 +From: Richard W.M. Jones <rjones@redhat.com> +Date: Fri, 31 Aug 2012 22:12:59 +0100 +Subject: [PATCH 31/37] EPEL 5: Ignore sparsify error if qemu-img --help is killed by a signal. + +--- + sparsify/sparsify.ml | 3 +-- + 1 files changed, 1 insertions(+), 2 deletions(-) + +diff --git a/sparsify/sparsify.ml b/sparsify/sparsify.ml +index 5ee2adb..0606ebe 100644 +--- a/sparsify/sparsify.ml ++++ b/sparsify/sparsify.ml +@@ -168,8 +168,7 @@ let qemu_img_version = + let stat = close_process_in chan in + (match stat with + | WEXITED _ -> () +- | WSIGNALED i -> +- error (f_"external command '%s' killed by signal %d") cmd i ++ | WSIGNALED i -> () + | WSTOPPED i -> + error (f_"external command '%s' stopped by signal %d") cmd i + ); +-- +1.7.4.1 + diff --git a/0031-EPEL-5-Revert-daemon-remove-call-to-obsolete-udevset.patch b/0031-EPEL-5-Revert-daemon-remove-call-to-obsolete-udevset.patch deleted file mode 100644 index f3c20d7..0000000 --- a/0031-EPEL-5-Revert-daemon-remove-call-to-obsolete-udevset.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 5d30392d9083428a4ad64cc7389cd9adc18979d9 Mon Sep 17 00:00:00 2001 -From: Richard W.M. Jones <rjones@redhat.com> -Date: Mon, 3 Sep 2012 11:04:39 +0100 -Subject: [PATCH 31/36] EPEL 5: Revert "daemon: remove call to obsolete udevsettle" - -This reverts commit b6413f8dbef92c46c4baf9499366716a166f2163. ---- - daemon/guestfsd.c | 8 ++++++++ - 1 files changed, 8 insertions(+), 0 deletions(-) - -diff --git a/daemon/guestfsd.c b/daemon/guestfsd.c -index bcb836a..44d7f77 100644 ---- a/daemon/guestfsd.c -+++ b/daemon/guestfsd.c -@@ -54,6 +54,7 @@ - #include "daemon.h" - - GUESTFSD_EXT_CMD(str_udevadm, udevadm); -+GUESTFSD_EXT_CMD(str_udevsettle, udevsettle); - - static char *read_cmdline (void); - -@@ -1392,11 +1393,18 @@ random_name (char *template) - * - * Use 'udevadm settle' after certain commands, but don't be too - * fussed if it fails. -+ * -+ * 'udevsettle' was the old name for this command (RHEL 5). This was -+ * deprecated in favour of 'udevadm settle'. The old 'udevsettle' -+ * command was left as a symlink. Then in Fedora 13 the old symlink -+ * remained but it stopped working (RHBZ#548121), so we have to be -+ * careful not to assume that we can use 'udevsettle' if it exists. - */ - void - udev_settle (void) - { - (void) command (NULL, NULL, str_udevadm, "settle", NULL); -+ (void) command (NULL, NULL, str_udevsettle, NULL); - } - - /* Use by the CLEANUP_* macros. Do not call these directly. */ --- -1.7.4.1 - diff --git a/0032-EPEL-5-No-libtoolize-install-option.patch b/0032-EPEL-5-No-libtoolize-install-option.patch deleted file mode 100644 index e9add75..0000000 --- a/0032-EPEL-5-No-libtoolize-install-option.patch +++ /dev/null @@ -1,25 +0,0 @@ -From f941916d6d765a1afae4c0d2e833c4d10fd5c39c Mon Sep 17 00:00:00 2001 -From: Richard W.M. Jones <rjones@redhat.com> -Date: Fri, 8 Mar 2013 19:09:21 +0000 -Subject: [PATCH 32/36] EPEL 5: No libtoolize --install option. - ---- - bootstrap | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/bootstrap b/bootstrap -index da650ca..4de0c0e 100755 ---- a/bootstrap -+++ b/bootstrap -@@ -29,7 +29,7 @@ GNULIB_SRCDIR=.gnulib - # Autoreconf runs aclocal before libtoolize, which causes spurious - # warnings if the initial aclocal is confused by the libtoolized - # (or worse out-of-date) macro directory. --libtoolize --copy --install -+libtoolize --copy - - gnulib_tool=$GNULIB_SRCDIR/gnulib-tool - <$gnulib_tool || exit --- -1.7.4.1 - diff --git a/0032-EPEL-5-Revert-daemon-remove-call-to-obsolete-udevset.patch b/0032-EPEL-5-Revert-daemon-remove-call-to-obsolete-udevset.patch new file mode 100644 index 0000000..b27584a --- /dev/null +++ b/0032-EPEL-5-Revert-daemon-remove-call-to-obsolete-udevset.patch @@ -0,0 +1,44 @@ +From c5c98b399e2353c05253ab7a606fda74424243b4 Mon Sep 17 00:00:00 2001 +From: Richard W.M. Jones <rjones@redhat.com> +Date: Mon, 3 Sep 2012 11:04:39 +0100 +Subject: [PATCH 32/37] EPEL 5: Revert "daemon: remove call to obsolete udevsettle" + +This reverts commit b6413f8dbef92c46c4baf9499366716a166f2163. +--- + daemon/guestfsd.c | 8 ++++++++ + 1 files changed, 8 insertions(+), 0 deletions(-) + +diff --git a/daemon/guestfsd.c b/daemon/guestfsd.c +index bcb836a..44d7f77 100644 +--- a/daemon/guestfsd.c ++++ b/daemon/guestfsd.c +@@ -54,6 +54,7 @@ + #include "daemon.h" + + GUESTFSD_EXT_CMD(str_udevadm, udevadm); ++GUESTFSD_EXT_CMD(str_udevsettle, udevsettle); + + static char *read_cmdline (void); + +@@ -1392,11 +1393,18 @@ random_name (char *template) + * + * Use 'udevadm settle' after certain commands, but don't be too + * fussed if it fails. ++ * ++ * 'udevsettle' was the old name for this command (RHEL 5). This was ++ * deprecated in favour of 'udevadm settle'. The old 'udevsettle' ++ * command was left as a symlink. Then in Fedora 13 the old symlink ++ * remained but it stopped working (RHBZ#548121), so we have to be ++ * careful not to assume that we can use 'udevsettle' if it exists. + */ + void + udev_settle (void) + { + (void) command (NULL, NULL, str_udevadm, "settle", NULL); ++ (void) command (NULL, NULL, str_udevsettle, NULL); + } + + /* Use by the CLEANUP_* macros. Do not call these directly. */ +-- +1.7.4.1 + diff --git a/0033-EPEL-5-Disable-valgrind.patch b/0033-EPEL-5-Disable-valgrind.patch deleted file mode 100644 index 321878b..0000000 --- a/0033-EPEL-5-Disable-valgrind.patch +++ /dev/null @@ -1,28 +0,0 @@ -From e4ac2bc51e0ef216f57e961414f13a3be6c1fbdd Mon Sep 17 00:00:00 2001 -From: Richard W.M. Jones <rjones@redhat.com> -Date: Fri, 8 Mar 2013 19:19:43 +0000 -Subject: [PATCH 33/36] EPEL 5: Disable valgrind. - -Ancient automake didn't have AM_SUBST_NOTMAKE. ---- - configure.ac | 4 ++-- - 1 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/configure.ac b/configure.ac -index d26b815..7978cad 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -848,8 +848,8 @@ AS_IF([test "x$VALGRIND" != "xno"],[ - # No valgrind, so substitute VG with something that will break. - VG=VALGRIND_IS_NOT_INSTALLED - ]) --AC_SUBST([VG]) --AM_SUBST_NOTMAKE([VG]) -+dnl AC_SUBST([VG]) -+dnl AM_SUBST_NOTMAKE([VG]) - - dnl Enable profiling? - AC_ARG_ENABLE([code-profiling], --- -1.7.4.1 - diff --git a/0033-EPEL-5-No-libtoolize-install-option.patch b/0033-EPEL-5-No-libtoolize-install-option.patch new file mode 100644 index 0000000..918917d --- /dev/null +++ b/0033-EPEL-5-No-libtoolize-install-option.patch @@ -0,0 +1,25 @@ +From 880785a2d52495c7ca010242e32cab5f5714e698 Mon Sep 17 00:00:00 2001 +From: Richard W.M. Jones <rjones@redhat.com> +Date: Fri, 8 Mar 2013 19:09:21 +0000 +Subject: [PATCH 33/37] EPEL 5: No libtoolize --install option. + +--- + bootstrap | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/bootstrap b/bootstrap +index da650ca..4de0c0e 100755 +--- a/bootstrap ++++ b/bootstrap +@@ -29,7 +29,7 @@ GNULIB_SRCDIR=.gnulib + # Autoreconf runs aclocal before libtoolize, which causes spurious + # warnings if the initial aclocal is confused by the libtoolized + # (or worse out-of-date) macro directory. +-libtoolize --copy --install ++libtoolize --copy + + gnulib_tool=$GNULIB_SRCDIR/gnulib-tool + <$gnulib_tool || exit +-- +1.7.4.1 + diff --git a/0034-EPEL-5-Disable-valgrind.patch b/0034-EPEL-5-Disable-valgrind.patch new file mode 100644 index 0000000..53353bd --- /dev/null +++ b/0034-EPEL-5-Disable-valgrind.patch @@ -0,0 +1,28 @@ +From ac0ae2bfb19668e8de48902e553ff318a8825f1b Mon Sep 17 00:00:00 2001 +From: Richard W.M. Jones <rjones@redhat.com> +Date: Fri, 8 Mar 2013 19:19:43 +0000 +Subject: [PATCH 34/37] EPEL 5: Disable valgrind. + +Ancient automake didn't have AM_SUBST_NOTMAKE. +--- + configure.ac | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/configure.ac b/configure.ac +index d26b815..7978cad 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -848,8 +848,8 @@ AS_IF([test "x$VALGRIND" != "xno"],[ + # No valgrind, so substitute VG with something that will break. + VG=VALGRIND_IS_NOT_INSTALLED + ]) +-AC_SUBST([VG]) +-AM_SUBST_NOTMAKE([VG]) ++dnl AC_SUBST([VG]) ++dnl AM_SUBST_NOTMAKE([VG]) + + dnl Enable profiling? + AC_ARG_ENABLE([code-profiling], +-- +1.7.4.1 + diff --git a/0034-EPEL-5-Remove-Linux-capabilities.patch b/0034-EPEL-5-Remove-Linux-capabilities.patch deleted file mode 100644 index 31cac4b..0000000 --- a/0034-EPEL-5-Remove-Linux-capabilities.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 24654a3936d14c985776ef7264fc57a3553d7328 Mon Sep 17 00:00:00 2001 -From: Richard W.M. Jones <rjones@redhat.com> -Date: Fri, 8 Mar 2013 20:20:23 +0000 -Subject: [PATCH 34/36] EPEL 5: Remove Linux capabilities. - -Linux file capabilities are not supported in RHEL 5, and the -cap_*_file functions don't exist in the libcap library (although -confusingly they are in the header file). ---- - configure.ac | 8 -------- - 1 files changed, 0 insertions(+), 8 deletions(-) - -diff --git a/configure.ac b/configure.ac -index 7978cad..0150d4e 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -731,14 +731,6 @@ AC_CHECK_LIB([acl],[acl_from_text],[ - ], []) - ],[AC_MSG_WARN([POSIX acl library not found])]) - --dnl Linux capabilities library (libcap) (highly recommended) --AC_CHECK_LIB([cap],[cap_from_text],[ -- AC_CHECK_HEADER([sys/capability.h],[ -- AC_SUBST([CAP_LIBS], [-lcap]) -- AC_DEFINE([HAVE_CAP], [1], [Define to 1 if the Linux capabilities library (libcap) is available.]) -- ], []) --],[AC_MSG_WARN([Linux capabilities library (libcap) not found])]) -- - dnl libvirt (highly recommended) - AC_ARG_WITH([libvirt],[ - AS_HELP_STRING([--without-libvirt], --- -1.7.4.1 - diff --git a/0035-EPEL-5-Remove-Linux-capabilities.patch b/0035-EPEL-5-Remove-Linux-capabilities.patch new file mode 100644 index 0000000..06bc54c --- /dev/null +++ b/0035-EPEL-5-Remove-Linux-capabilities.patch @@ -0,0 +1,34 @@ +From bf562086eaee769c13cfe4673ede68b03cb03070 Mon Sep 17 00:00:00 2001 +From: Richard W.M. Jones <rjones@redhat.com> +Date: Fri, 8 Mar 2013 20:20:23 +0000 +Subject: [PATCH 35/37] EPEL 5: Remove Linux capabilities. + +Linux file capabilities are not supported in RHEL 5, and the +cap_*_file functions don't exist in the libcap library (although +confusingly they are in the header file). +--- + configure.ac | 8 -------- + 1 files changed, 0 insertions(+), 8 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 7978cad..0150d4e 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -731,14 +731,6 @@ AC_CHECK_LIB([acl],[acl_from_text],[ + ], []) + ],[AC_MSG_WARN([POSIX acl library not found])]) + +-dnl Linux capabilities library (libcap) (highly recommended) +-AC_CHECK_LIB([cap],[cap_from_text],[ +- AC_CHECK_HEADER([sys/capability.h],[ +- AC_SUBST([CAP_LIBS], [-lcap]) +- AC_DEFINE([HAVE_CAP], [1], [Define to 1 if the Linux capabilities library (libcap) is available.]) +- ], []) +-],[AC_MSG_WARN([Linux capabilities library (libcap) not found])]) +- + dnl libvirt (highly recommended) + AC_ARG_WITH([libvirt],[ + AS_HELP_STRING([--without-libvirt], +-- +1.7.4.1 + diff --git a/0035-EPEL-5-ruby-Use-old-rake-rdoctask-and-rake-gempackag.patch b/0035-EPEL-5-ruby-Use-old-rake-rdoctask-and-rake-gempackag.patch deleted file mode 100644 index d195538..0000000 --- a/0035-EPEL-5-ruby-Use-old-rake-rdoctask-and-rake-gempackag.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 1b46d0a8391a4a643df3a35c7310eb4cd21fb2c1 Mon Sep 17 00:00:00 2001 -From: Richard W.M. Jones <rjones@redhat.com> -Date: Sat, 9 Mar 2013 19:24:29 +0000 -Subject: [PATCH 35/36] EPEL 5: ruby: Use old rake/rdoctask and rake/gempackagetask. - -The 'begin ... rescue' code is supposed to ensure these old packages -are required, but for reasons not understood this doesn't work on -ancient Ruby 1.8.5 in RHEL 5. ---- - ruby/Rakefile.in | 15 +++------------ - 1 files changed, 3 insertions(+), 12 deletions(-) - -diff --git a/ruby/Rakefile.in b/ruby/Rakefile.in -index f832abd..76f00ec 100644 ---- a/ruby/Rakefile.in -+++ b/ruby/Rakefile.in -@@ -20,21 +20,12 @@ require 'rake/clean' - require 'rake/testtask' - - # Used to be rake/rdoctask. Now it's rdoc/task. --begin -- require 'rdoc/task' --rescue -- require 'rake/rdoctask' --end -+require 'rake/rdoctask' - - # Used to be rake/gempackagetask. Now it's rubygems/package_task. Also - # we need to use the appropriate class name below. --begin -- require 'rubygems/package_task' -- gempackagetask='Gem::PackageTask' --rescue -- require 'rake/gempackagetask' -- gempackagetask='Rake::GemPackageTask' --end -+require 'rake/gempackagetask' -+gempackagetask='Rake::GemPackageTask' - - PKG_NAME='@PACKAGE_NAME@' - PKG_VERSION='@PACKAGE_VERSION@' --- -1.7.4.1 - diff --git a/0036-EPEL-5-Custom-replacement-for-Unix.isatty-stdout.patch b/0036-EPEL-5-Custom-replacement-for-Unix.isatty-stdout.patch deleted file mode 100644 index dfd9918..0000000 --- a/0036-EPEL-5-Custom-replacement-for-Unix.isatty-stdout.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 8421edcf024f7328da721a8ac52f349290ed5714 Mon Sep 17 00:00:00 2001 -From: Richard W.M. Jones <rjones@redhat.com> -Date: Sat, 9 Mar 2013 19:25:33 +0000 -Subject: [PATCH 36/36] EPEL 5: Custom replacement for 'Unix.isatty stdout'. - -Unix.isatty missing on RHEL 5-era OCaml. ---- - resize/progress-c.c | 10 ++++++++++ - resize/progress.ml | 3 ++- - 2 files changed, 12 insertions(+), 1 deletions(-) - -diff --git a/resize/progress-c.c b/resize/progress-c.c -index 2f25bbc..2813d0c 100644 ---- a/resize/progress-c.c -+++ b/resize/progress-c.c -@@ -22,6 +22,7 @@ - #include <stdlib.h> - #include <stdint.h> - #include <string.h> -+#include <unistd.h> - #include <locale.h> - - #include <caml/alloc.h> -@@ -103,3 +104,12 @@ virt_resize_progress_bar_set (value barv, - - CAMLreturn (Val_unit); - } -+ -+/* RHEL 5-era ocaml didn't have Unix.isatty. */ -+value -+virt_resize_isatty_stdout (value unitv) -+{ -+ CAMLparam1 (unitv); -+ -+ CAMLreturn (isatty(1) ? Val_true : Val_false); -+} -diff --git a/resize/progress.ml b/resize/progress.ml -index 7a94c6c..1ff73c2 100644 ---- a/resize/progress.ml -+++ b/resize/progress.ml -@@ -28,12 +28,13 @@ external progress_bar_reset : progress_bar -> unit - = "virt_resize_progress_bar_reset" - external progress_bar_set : progress_bar -> int64 -> int64 -> unit - = "virt_resize_progress_bar_set" -+external isatty_stdout : unit -> bool = "virt_resize_isatty_stdout" - - let set_up_progress_bar ?(machine_readable = false) (g : Guestfs.guestfs) = - (* Only display progress bars if the machine_readable flag is set or - * the output is a tty. - *) -- if machine_readable || isatty stdout then ( -+ if machine_readable || isatty_stdout () then ( - (* Initialize the C mini library. *) - let bar = progress_bar_init ~machine_readable in - --- -1.7.4.1 - diff --git a/0036-EPEL-5-ruby-Use-old-rake-rdoctask-and-rake-gempackag.patch b/0036-EPEL-5-ruby-Use-old-rake-rdoctask-and-rake-gempackag.patch new file mode 100644 index 0000000..1ab8cf1 --- /dev/null +++ b/0036-EPEL-5-ruby-Use-old-rake-rdoctask-and-rake-gempackag.patch @@ -0,0 +1,44 @@ +From 18d8e9d4f6ee7b2273077f91d0ba5f564d1d582a Mon Sep 17 00:00:00 2001 +From: Richard W.M. Jones <rjones@redhat.com> +Date: Sat, 9 Mar 2013 19:24:29 +0000 +Subject: [PATCH 36/37] EPEL 5: ruby: Use old rake/rdoctask and rake/gempackagetask. + +The 'begin ... rescue' code is supposed to ensure these old packages +are required, but for reasons not understood this doesn't work on +ancient Ruby 1.8.5 in RHEL 5. +--- + ruby/Rakefile.in | 15 +++------------ + 1 files changed, 3 insertions(+), 12 deletions(-) + +diff --git a/ruby/Rakefile.in b/ruby/Rakefile.in +index f832abd..76f00ec 100644 +--- a/ruby/Rakefile.in ++++ b/ruby/Rakefile.in +@@ -20,21 +20,12 @@ require 'rake/clean' + require 'rake/testtask' + + # Used to be rake/rdoctask. Now it's rdoc/task. +-begin +- require 'rdoc/task' +-rescue +- require 'rake/rdoctask' +-end ++require 'rake/rdoctask' + + # Used to be rake/gempackagetask. Now it's rubygems/package_task. Also + # we need to use the appropriate class name below. +-begin +- require 'rubygems/package_task' +- gempackagetask='Gem::PackageTask' +-rescue +- require 'rake/gempackagetask' +- gempackagetask='Rake::GemPackageTask' +-end ++require 'rake/gempackagetask' ++gempackagetask='Rake::GemPackageTask' + + PKG_NAME='@PACKAGE_NAME@' + PKG_VERSION='@PACKAGE_VERSION@' +-- +1.7.4.1 + diff --git a/0037-EPEL-5-Custom-replacement-for-Unix.isatty-stdout.patch b/0037-EPEL-5-Custom-replacement-for-Unix.isatty-stdout.patch new file mode 100644 index 0000000..589d4f7 --- /dev/null +++ b/0037-EPEL-5-Custom-replacement-for-Unix.isatty-stdout.patch @@ -0,0 +1,58 @@ +From a511d139e98dbab61f84bee513f0221ba98e1c39 Mon Sep 17 00:00:00 2001 +From: Richard W.M. Jones <rjones@redhat.com> +Date: Sat, 9 Mar 2013 19:25:33 +0000 +Subject: [PATCH 37/37] EPEL 5: Custom replacement for 'Unix.isatty stdout'. + +Unix.isatty missing on RHEL 5-era OCaml. +--- + resize/progress-c.c | 10 ++++++++++ + resize/progress.ml | 3 ++- + 2 files changed, 12 insertions(+), 1 deletions(-) + +diff --git a/resize/progress-c.c b/resize/progress-c.c +index 2f25bbc..2813d0c 100644 +--- a/resize/progress-c.c ++++ b/resize/progress-c.c +@@ -22,6 +22,7 @@ + #include <stdlib.h> + #include <stdint.h> + #include <string.h> ++#include <unistd.h> + #include <locale.h> + + #include <caml/alloc.h> +@@ -103,3 +104,12 @@ virt_resize_progress_bar_set (value barv, + + CAMLreturn (Val_unit); + } ++ ++/* RHEL 5-era ocaml didn't have Unix.isatty. */ ++value ++virt_resize_isatty_stdout (value unitv) ++{ ++ CAMLparam1 (unitv); ++ ++ CAMLreturn (isatty(1) ? Val_true : Val_false); ++} +diff --git a/resize/progress.ml b/resize/progress.ml +index 7a94c6c..1ff73c2 100644 +--- a/resize/progress.ml ++++ b/resize/progress.ml +@@ -28,12 +28,13 @@ external progress_bar_reset : progress_bar -> unit + = "virt_resize_progress_bar_reset" + external progress_bar_set : progress_bar -> int64 -> int64 -> unit + = "virt_resize_progress_bar_set" ++external isatty_stdout : unit -> bool = "virt_resize_isatty_stdout" + + let set_up_progress_bar ?(machine_readable = false) (g : Guestfs.guestfs) = + (* Only display progress bars if the machine_readable flag is set or + * the output is a tty. + *) +- if machine_readable || isatty stdout then ( ++ if machine_readable || isatty_stdout () then ( + (* Initialize the C mini library. *) + let bar = progress_bar_init ~machine_readable in + +-- +1.7.4.1 + diff --git a/libguestfs.spec b/libguestfs.spec index 2eccb44..9e8d3f2 100644 --- a/libguestfs.spec +++ b/libguestfs.spec @@ -22,7 +22,7 @@ Summary: Access and modify virtual machine disk images Name: libguestfs Epoch: 1 Version: 1.20.3 -Release: 2%{?dist} +Release: 3%{?dist} License: LGPLv2+ Group: Development/Libraries URL: http://libguestfs.org/ @@ -44,41 +44,40 @@ BuildRequires: autoconf, automake, libtool Patch0001: 0001-gnulib-Use-module-mkstemps-for-RHEL-5-glibc-which-la.patch Patch0002: 0002-RHEL-5-inspect-Add-macro-for-be32toh-if-one-is-not-d.patch Patch0003: 0003-Move-Ruby-related-checks-from-autoconf-to-extconf.rb.patch -Patch0004: 0004-EPEL-5-Remove-checks-which-fail-with-ancient-qemu.patch -Patch0005: 0005-EPEL-5-Remove-AS_ECHO_N-for-ancient-autoconf.patch -Patch0006: 0006-EPEL-5-Replace-macro-AC_STRUCT_DIRENT_D_TYPE-for-anc.patch -Patch0007: 0007-EPEL-5-Don-t-use-C99-style-variable-decls-in-for-loo.patch -Patch0008: 0008-EPEL-5-Remove-Erlang-bindings.patch -Patch0009: 0009-EPEL-5-Remove-GObject-GObject-Introspection-GJS-bind.patch -Patch0010: 0010-EPEL-5-Remove-PHP-bindings.patch -Patch0011: 0011-EPEL-5-Define-le64toh-le32toh-if-not-defined.patch -Patch0012: 0012-EPEL-5-Add-gnulib-utimensat-module.patch -Patch0013: 0013-EPEL-5-Old-ocamlopt-didn-t-support-debugging-g-optio.patch -Patch0014: 0014-EPEL-5-Replace-format6-with-format4-in-OCaml-gettext.patch -Patch0015: 0015-EPEL-5-Pass-preserve-dup-deps-explicitly-to-libtool.patch -Patch0016: 0016-EPEL-5-Remove-id-from-drive-parameter-on-qemu-comman.patch -Patch0017: 0017-EPEL-5-Add-null-vmchannel-back-for-qemu-without-virt.patch -Patch0018: 0018-EPEL-5-Disable-libvirt-attach-method.patch -Patch0019: 0019-EPEL-5-Fix-blkid-to-return-LVM2_member-for-PVs.patch -Patch0020: 0020-EPEL-5-sparsify-Fix-command-line-options-for-old-qem.patch -Patch0021: 0021-EPEL-5-Remove-Fedora-MD-test-images.patch -Patch0022: 0022-EPEL-5-Add-mkisofs-to-package-list.patch -Patch0023: 0023-EPEL-5-Add-1-second-pause-after-unmounting-any-files.patch -Patch0024: 0024-EPEL-5-podwrapper-Remove-HTML-output.patch -Patch0025: 0025-EPEL-5-podwrapper-Don-t-use-Pod-Man.patch -Patch0026: 0026-EPEL-5-Revert-Mac-OS-X-Use-libtool-mode-execute-inst.patch -Patch0027: 0027-EPEL-5-Don-t-use-sgabios.patch -Patch0028: 0028-EPEL-5-Revert-daemon-Remove-e2prog-hack-only-needed-.patch -Patch0029: 0029-EPEL-5-Disable-tar-xz-test.patch -Patch0030: 0030-EPEL-5-Ignore-sparsify-error-if-qemu-img-help-is-kil.patch -Patch0031: 0031-EPEL-5-Revert-daemon-remove-call-to-obsolete-udevset.patch -Patch0032: 0032-EPEL-5-No-libtoolize-install-option.patch -Patch0033: 0033-EPEL-5-Disable-valgrind.patch -Patch0034: 0034-EPEL-5-Remove-Linux-capabilities.patch -Patch0035: 0035-EPEL-5-ruby-Use-old-rake-rdoctask-and-rake-gempackag.patch -Patch0036: 0036-EPEL-5-Custom-replacement-for-Unix.isatty-stdout.patch - -Patch1001: 0001-RHEL-5-tests-Use-gnulib.patch +Patch0004: 0004-RHEL-5-tests-Use-gnulib.patch +Patch0005: 0005-EPEL-5-Remove-checks-which-fail-with-ancient-qemu.patch +Patch0006: 0006-EPEL-5-Remove-AS_ECHO_N-for-ancient-autoconf.patch +Patch0007: 0007-EPEL-5-Replace-macro-AC_STRUCT_DIRENT_D_TYPE-for-anc.patch +Patch0008: 0008-EPEL-5-Don-t-use-C99-style-variable-decls-in-for-loo.patch +Patch0009: 0009-EPEL-5-Remove-Erlang-bindings.patch +Patch0010: 0010-EPEL-5-Remove-GObject-GObject-Introspection-GJS-bind.patch +Patch0011: 0011-EPEL-5-Remove-PHP-bindings.patch +Patch0012: 0012-EPEL-5-Define-le64toh-le32toh-if-not-defined.patch +Patch0013: 0013-EPEL-5-Add-gnulib-utimensat-module.patch +Patch0014: 0014-EPEL-5-Old-ocamlopt-didn-t-support-debugging-g-optio.patch +Patch0015: 0015-EPEL-5-Replace-format6-with-format4-in-OCaml-gettext.patch +Patch0016: 0016-EPEL-5-Pass-preserve-dup-deps-explicitly-to-libtool.patch +Patch0017: 0017-EPEL-5-Remove-id-from-drive-parameter-on-qemu-comman.patch +Patch0018: 0018-EPEL-5-Add-null-vmchannel-back-for-qemu-without-virt.patch +Patch0019: 0019-EPEL-5-Disable-libvirt-attach-method.patch +Patch0020: 0020-EPEL-5-Fix-blkid-to-return-LVM2_member-for-PVs.patch +Patch0021: 0021-EPEL-5-sparsify-Fix-command-line-options-for-old-qem.patch +Patch0022: 0022-EPEL-5-Remove-Fedora-MD-test-images.patch +Patch0023: 0023-EPEL-5-Add-mkisofs-to-package-list.patch +Patch0024: 0024-EPEL-5-Add-1-second-pause-after-unmounting-any-files.patch +Patch0025: 0025-EPEL-5-podwrapper-Remove-HTML-output.patch +Patch0026: 0026-EPEL-5-podwrapper-Don-t-use-Pod-Man.patch +Patch0027: 0027-EPEL-5-Revert-Mac-OS-X-Use-libtool-mode-execute-inst.patch +Patch0028: 0028-EPEL-5-Don-t-use-sgabios.patch +Patch0029: 0029-EPEL-5-Revert-daemon-Remove-e2prog-hack-only-needed-.patch +Patch0030: 0030-EPEL-5-Disable-tar-xz-test.patch +Patch0031: 0031-EPEL-5-Ignore-sparsify-error-if-qemu-img-help-is-kil.patch +Patch0032: 0032-EPEL-5-Revert-daemon-remove-call-to-obsolete-udevset.patch +Patch0033: 0033-EPEL-5-No-libtoolize-install-option.patch +Patch0034: 0034-EPEL-5-Disable-valgrind.patch +Patch0035: 0035-EPEL-5-Remove-Linux-capabilities.patch +Patch0036: 0036-EPEL-5-ruby-Use-old-rake-rdoctask-and-rake-gempackag.patch +Patch0037: 0037-EPEL-5-Custom-replacement-for-Unix.isatty-stdout.patch # Basic build requirements: BuildRequires: /usr/bin/pod2man @@ -904,8 +903,9 @@ rm -rf $RPM_BUILD_ROOT %changelog -* Sun Mar 10 2013 Richard W.M. Jones <rjones@redhat.com> - 1:1.20.3-2 +* Sun Mar 10 2013 Richard W.M. Jones <rjones@redhat.com> - 1:1.20.3-3 - Add patch to define O_CLOEXEC in tests. +- Fix double-free bug in EPEL5-specific patch. * Sat Mar 9 2013 Richard W.M. Jones <rjones@redhat.com> - 1:1.20.3-1 - Rebase to upstream stable branch version 1.20.3.