diff --git a/SOURCES/0241-sysprep-machine_id-simplify-implementation.patch b/SOURCES/0241-sysprep-machine_id-simplify-implementation.patch new file mode 100644 index 0000000..45344f5 --- /dev/null +++ b/SOURCES/0241-sysprep-machine_id-simplify-implementation.patch @@ -0,0 +1,44 @@ +From 2711e86de854290af855e2acfcab8ac7699cc560 Mon Sep 17 00:00:00 2001 +From: Pino Toscano +Date: Wed, 29 Jul 2015 13:36:23 +0200 +Subject: [PATCH] sysprep: machine_id: simplify implementation + +Instead of rm + touch, just truncate the file if existing. +In case there was no file previously, now nothing is created, as most +probably the system was fine even without it. + +Also, turn the single path into a list, so more machine-id files can be +handled at once. + +(cherry picked from commit bc598ff52af415d8acc923402bd6dcfd462f2e4d) +--- + sysprep/sysprep_operation_machine_id.ml | 11 ++++------- + 1 file changed, 4 insertions(+), 7 deletions(-) + +diff --git a/sysprep/sysprep_operation_machine_id.ml b/sysprep/sysprep_operation_machine_id.ml +index acf8757..1409876 100644 +--- a/sysprep/sysprep_operation_machine_id.ml ++++ b/sysprep/sysprep_operation_machine_id.ml +@@ -21,15 +21,12 @@ open Common_gettext.Gettext + + module G = Guestfs + +-let machine_id_perform ~verbose ~quiet g root side_effects = ++let machine_id_perform ~verbose ~quiet (g : Guestfs.guestfs) root side_effects = + let typ = g#inspect_get_type root in + if typ <> "windows" then ( +- let path = "/etc/machine-id" in +- (try g#rm path with G.Error _ -> ()); +- (try +- g#touch path; +- side_effects#created_file () +- with G.Error _ -> ()); ++ let paths = [ "/etc/machine-id"; ] in ++ let paths = List.filter g#is_file paths in ++ List.iter g#truncate paths + ) + + let op = { +-- +1.8.3.1 + diff --git a/SPECS/libguestfs.spec b/SPECS/libguestfs.spec index 111b2f6..0dbd3a1 100644 --- a/SPECS/libguestfs.spec +++ b/SPECS/libguestfs.spec @@ -20,7 +20,7 @@ Summary: Access and modify virtual machine disk images Name: libguestfs Epoch: 1 Version: 1.28.1 -Release: 1.55%{?dist}.2 +Release: 1.55%{?dist}.4 License: LGPLv2+ # Source and patches. @@ -275,6 +275,7 @@ Patch0237: 0237-v2v-Use-libvirt-supplied-vmware-datacenterpath-if-av.patch Patch0238: 0238-v2v-update-URL-with-glance-metadata.patch Patch0239: 0239-v2v-glance-Add-OUTPUT-TO-GLANCE-section-to-the-docum.patch Patch0240: 0240-v2v-glance-Allow-Glance-backend-to-import-multiple-d.patch +Patch0241: 0241-sysprep-machine_id-simplify-implementation.patch # Use git for patch management. BuildRequires: git @@ -466,7 +467,7 @@ guest filesystem that Linux and qemu can, including but not limited to: ext2/3/4, btrfs, FAT and NTFS, LVM, many different disk partition schemes, qcow, qcow2, vmdk. -Libguestfs for CentOS Linux is split into several subpackages. +Libguestfs for Red Hat Enterprise Linux is split into several subpackages. The basic subpackages are: libguestfs C library @@ -1350,8 +1351,9 @@ cp %{SOURCE7} $RPM_BUILD_ROOT%{_datadir}/virt-tools/rhev-apt.exe %changelog -* Tue Apr 5 2016 Johnny Hughes - 1:1.28.1-1.55.el7_2.3 -- Manual Debranding +* Wed Apr 27 2016 Richard W.M. Jones - 1:1.28.1-1.55.el7_2.4 +- virt-sysprep: Fix incorrect SELinux context on /etc/machine-id + resolves: rhbz#1330644 * Thu Mar 10 2016 Richard W.M. Jones - 1:1.28.1-1.55.el7_2.3 - v2v: Copy additional disks to Glance