diff --git a/0001-test-launch-race-Add-comment.patch b/0001-test-launch-race-Add-comment.patch new file mode 100644 index 0000000..c62c98d --- /dev/null +++ b/0001-test-launch-race-Add-comment.patch @@ -0,0 +1,25 @@ +From 09c372ea250e8241d62e9fde70eabe7bdca83050 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Sat, 22 Sep 2012 10:47:11 +0100 +Subject: [PATCH 1/3] test-launch-race: Add comment. + +--- + tests/protocol/test-launch-race.pl | 2 +- + 1 Datei geändert, 1 Zeile hinzugefügt(+), 1 Zeile entfernt(-) + +diff --git a/tests/protocol/test-launch-race.pl b/tests/protocol/test-launch-race.pl +index 7a1e836..f933bfe 100755 +--- a/tests/protocol/test-launch-race.pl ++++ b/tests/protocol/test-launch-race.pl +@@ -39,7 +39,7 @@ if ($pid == 0) { + my $g = Sys::Guestfs->new (); + $g->add_drive ("/dev/null"); + $g->launch (); +- _exit (0); ++ _exit (0); # So the tmpdir is not removed. + } + + my $g = Sys::Guestfs->new (); +-- +1.7.12 + diff --git a/0002-sysprep-handle-distro-specific-sysv-scripts.patch b/0002-sysprep-handle-distro-specific-sysv-scripts.patch new file mode 100644 index 0000000..badf34b --- /dev/null +++ b/0002-sysprep-handle-distro-specific-sysv-scripts.patch @@ -0,0 +1,151 @@ +From 55fef0e4e607b1d447a0a0804acd69481f7613e4 Mon Sep 17 00:00:00 2001 +From: Olaf Hering +Date: Fri, 21 Sep 2012 20:00:34 +0200 +Subject: [PATCH 2/3] sysprep: handle distro specific sysv scripts + +Currently firstboot would only work on redhat-based images. +Handle redhat-based, suse-based and debian guests, error out in case of an +unknown distro. +Update firstboot.sh: + - make sure scripts exists and can be executed + - add LSB header to avoid insserv warnings later on + - run script only if called with "start" +Update functions, pass only required options. + +Signed-off-by: Olaf Hering +--- + sysprep/firstboot.ml | 81 +++++++++++++++++++++++++++++++++++++++++++++------- + 1 Datei geändert, 70 Zeilen hinzugefügt(+), 11 Zeilen entfernt(-) + +diff --git a/sysprep/firstboot.ml b/sysprep/firstboot.ml +index 97cd8a9..1b92d74 100644 +--- a/sysprep/firstboot.ml ++++ b/sysprep/firstboot.ml +@@ -28,14 +28,35 @@ let firstboot_dir = "/usr/lib/virt-sysprep" + let firstboot_sh = sprintf "\ + #!/bin/sh - + ++### BEGIN INIT INFO ++# Provides: virt-sysprep ++# Required-Start: $null ++# Should-Start: $all ++# Required-Stop: $null ++# Should-Stop: $all ++# Default-Start: 2 3 5 ++# Default-Stop: 0 1 6 ++# Short-Description: Start scripts to run once at next boot ++# Description: Start scripts to run once at next boot ++# These scripts run the first time the guest boots, ++# and then are deleted. Output or errors from the scripts ++# are written to ~root/virt-sysprep-firstboot.log. ++### END INIT INFO ++ + d=%s/scripts + logfile=~root/virt-sysprep-firstboot.log + +-for f in $d/* ; do +- echo '=== Running' $f '===' >>$logfile +- $f >>$logfile 2>&1 +- rm $f +-done ++if test \"$1\" = \"start\" ++then ++ for f in $d/* ; do ++ if test -x \"$f\" ++ then ++ echo '=== Running' $f '===' >>$logfile ++ $f >>$logfile 2>&1 ++ rm -f $f ++ fi ++ done ++fi + " firstboot_dir + + let firstboot_service = sprintf "\ +@@ -56,7 +77,7 @@ WantedBy=default.target + let failed fs = + ksprintf (fun msg -> failwith (s_"firstboot: failed: " ^ msg)) fs + +-let rec install_service g root = ++let rec install_service g distro = + g#mkdir_p firstboot_dir; + g#mkdir_p (sprintf "%s/scripts" firstboot_dir); + g#write (sprintf "%s/firstboot.sh" firstboot_dir) firstboot_sh; +@@ -64,18 +85,28 @@ let rec install_service g root = + + (* systemd, else assume sysvinit *) + if g#is_dir "/etc/systemd" then +- install_systemd_service g root ++ install_systemd_service g + else +- install_sysvinit_service g root ++ install_sysvinit_service g distro + + (* Install the systemd firstboot service, if not installed already. *) +-and install_systemd_service g root = ++and install_systemd_service g = + g#write (sprintf "%s/firstboot.service" firstboot_dir) firstboot_service; + g#mkdir_p "/etc/systemd/system/default.target.wants"; + g#ln_sf (sprintf "%s/firstboot.service" firstboot_dir) + "/etc/systemd/system/default.target.wants" + +-and install_sysvinit_service g root = ++and install_sysvinit_service g = function ++ | "fedora"|"rhel"|"centos"|"scientificlinux"|"redhat-based" -> ++ install_sysvinit_redhat g ++ | "opensuse"|"sles"|"suse-based" -> ++ install_sysvinit_suse g ++ | "debian" -> ++ install_sysvinit_debian g ++ | distro -> ++ failed "guest type %s is not supported" distro ++ ++and install_sysvinit_redhat g = + g#mkdir_p "/etc/rc.d/rc2.d"; + g#mkdir_p "/etc/rc.d/rc3.d"; + g#mkdir_p "/etc/rc.d/rc5.d"; +@@ -86,12 +117,40 @@ and install_sysvinit_service g root = + g#ln_sf (sprintf "%s/firstboot.sh" firstboot_dir) + "/etc/rc.d/rc5.d/99virt-sysprep-firstboot" + ++(* Make firstboot.sh look like a runlevel script to avoid insserv warnings. *) ++and install_sysvinit_suse g = ++ g#mkdir_p "/etc/init.d/rc2.d"; ++ g#mkdir_p "/etc/init.d/rc3.d"; ++ g#mkdir_p "/etc/init.d/rc5.d"; ++ g#ln_sf (sprintf "%s/firstboot.sh" firstboot_dir) ++ "/etc/init.d/virt-sysprep-firstboot"; ++ g#ln_sf "../virt-sysprep-firstboot" ++ "/etc/init.d/rc2.d/S99virt-sysprep-firstboot"; ++ g#ln_sf "../virt-sysprep-firstboot" ++ "/etc/init.d/rc3.d/S99virt-sysprep-firstboot"; ++ g#ln_sf "../virt-sysprep-firstboot" ++ "/etc/init.d/rc5.d/S99virt-sysprep-firstboot" ++ ++and install_sysvinit_debian g = ++ g#mkdir_p "/etc/init.d"; ++ g#mkdir_p "/etc/rc2.d"; ++ g#mkdir_p "/etc/rc3.d"; ++ g#mkdir_p "/etc/rc5.d"; ++ g#ln_sf (sprintf "%s/firstboot.sh" firstboot_dir) ++ "/etc/init.d/virt-sysprep-firstboot"; ++ g#ln_sf "/etc/init.d/virt-sysprep-firstboot" ++ "/etc/rc2.d/S99virt-sysprep-firstboot"; ++ g#ln_sf "/etc/init.d/virt-sysprep-firstboot" ++ "/etc/rc3.d/S99virt-sysprep-firstboot"; ++ g#ln_sf "/etc/init.d/virt-sysprep-firstboot" ++ "/etc/rc5.d/S99virt-sysprep-firstboot" ++ + let add_firstboot_script g root id content = + let typ = g#inspect_get_type root in + let distro = g#inspect_get_distro root in + match typ, distro with + | "linux", _ -> +- install_service g root; ++ install_service g distro; + let t = Int64.of_float (Unix.time ()) in + let r = string_random8 () in + let filename = sprintf "%s/scripts/%Ld-%s-%s" firstboot_dir t r id in +-- +1.7.12 + diff --git a/0003-sysprep-handle-at-jobs-in-cron-spool-operation.patch b/0003-sysprep-handle-at-jobs-in-cron-spool-operation.patch new file mode 100644 index 0000000..6027c6d --- /dev/null +++ b/0003-sysprep-handle-at-jobs-in-cron-spool-operation.patch @@ -0,0 +1,33 @@ +From 1949016e899b2737525fdc9b6dda451ad9ecbd66 Mon Sep 17 00:00:00 2001 +From: Olaf Hering +Date: Fri, 21 Sep 2012 21:04:43 +0200 +Subject: [PATCH 3/3] sysprep: handle at jobs in cron-spool operation + +cron-spool claims to remove at jobs, but it has no code to actually do +that. Add patterns to remove files in known at spool locations. + +Signed-off-by: Olaf Hering +--- + sysprep/sysprep_operation_cron_spool.ml | 6 ++++++ + 1 Datei geändert, 6 Zeilen hinzugefügt(+) + +diff --git a/sysprep/sysprep_operation_cron_spool.ml b/sysprep/sysprep_operation_cron_spool.ml +index 5284660..e96832c 100644 +--- a/sysprep/sysprep_operation_cron_spool.ml ++++ b/sysprep/sysprep_operation_cron_spool.ml +@@ -23,6 +23,12 @@ module G = Guestfs + + let cron_spool_perform g root = + Array.iter g#rm_rf (g#glob_expand "/var/spool/cron/*"); ++ Array.iter g#rm (g#glob_expand "/var/spool/atjobs/*"); ++ Array.iter g#rm (g#glob_expand "/var/spool/atjobs/.SEQ"); ++ Array.iter g#rm (g#glob_expand "/var/spool/atspool/*"); ++ Array.iter g#rm (g#glob_expand "/var/spool/at/*"); ++ Array.iter g#rm (g#glob_expand "/var/spool/at/.SEQ"); ++ Array.iter g#rm (g#glob_expand "/var/spool/at/spool/*"); + [] + + let cron_spool_op = { +-- +1.7.12 + diff --git a/0001-force-virtio_blk-in-old-guest-kernel.patch b/1000-force-virtio_blk-in-old-guest-kernel.patch similarity index 100% rename from 0001-force-virtio_blk-in-old-guest-kernel.patch rename to 1000-force-virtio_blk-in-old-guest-kernel.patch diff --git a/libguestfs-1.19.42.tar.gz b/libguestfs-1.19.42.tar.gz deleted file mode 100644 index d85f7a4..0000000 --- a/libguestfs-1.19.42.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:62c6b4f60611782fc29f2084c599d5e84867637b7568d93e0fd722e2365f7ece -size 8367215 diff --git a/libguestfs-1.19.43.tar.gz b/libguestfs-1.19.43.tar.gz new file mode 100644 index 0000000..e42e01c --- /dev/null +++ b/libguestfs-1.19.43.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a2f00208be03e64a37e6cf0c8583a114b9b288cc13758eabfedc3506190a7137 +size 8375089 diff --git a/libguestfs.changes b/libguestfs.changes index b931777..5295742 100644 --- a/libguestfs.changes +++ b/libguestfs.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Sat Sep 22 15:33:31 CEST 2012 - ohering@suse.de + +- Update to version 1.19.43 + ------------------------------------------------------------------- Fri Sep 21 20:03:21 CEST 2012 - ohering@suse.de diff --git a/libguestfs.spec b/libguestfs.spec index 7ace0d7..34fc876 100644 --- a/libguestfs.spec +++ b/libguestfs.spec @@ -73,10 +73,13 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build Summary: Compatibility package for guestfs-tools License: LGPL-2.1 Group: System/Filesystems -Version: 1.19.42 +Version: 1.19.43 Release: 0 +Patch0001: 0001-test-launch-race-Add-comment.patch +Patch0002: 0002-sysprep-handle-distro-specific-sysv-scripts.patch +Patch0003: 0003-sysprep-handle-at-jobs-in-cron-spool-operation.patch Patch5: libguestfs-1.13.14-ruby.patch -Patch100: 0001-force-virtio_blk-in-old-guest-kernel.patch +Patch1000: 1000-force-virtio_blk-in-old-guest-kernel.patch Source0: %{name}-%{version}.tar.gz Source10: libguestfs.mkinitrd.boot.sh Source11: libguestfs.mkinitrd.setup.sh @@ -342,8 +345,11 @@ virtual machines. %prep %setup -q +%patch0001 -p1 +%patch0002 -p1 +%patch0003 -p1 %patch5 -p1 -%patch100 -p1 +%patch1000 -p1 %build # disable qemu test.