diff --git a/0002-guestfs-tools-adapt-virt-customize-for-openEuler-ima.patch b/0002-guestfs-tools-adapt-virt-customize-for-openEuler-ima.patch new file mode 100644 index 0000000000000000000000000000000000000000..fe961532882268018b22e28dbc8f9d0a998c6a27 --- /dev/null +++ b/0002-guestfs-tools-adapt-virt-customize-for-openEuler-ima.patch @@ -0,0 +1,65 @@ +From 4706c7d842c5a06daa3871a9eb2a6b5aaf097808 Mon Sep 17 00:00:00 2001 +From: Wang Guoquan +Date: Wed, 11 Sep 2024 09:51:34 +0800 +Subject: [PATCH] guestfs-tools: adapt virt-customize for openEuler image + +enable virt-customize options, such as first-boot, hostname, password. + +Signed-off-by: Wang Guoquan +--- + common/mlcustomize/firstboot.ml | 2 +- + customize/hostname.ml | 4 ++-- + customize/password.ml | 2 +- + 3 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/common/mlcustomize/firstboot.ml b/common/mlcustomize/firstboot.ml +index 0c76283..73a336d 100644 +--- a/common/mlcustomize/firstboot.ml ++++ b/common/mlcustomize/firstboot.ml +@@ -152,7 +152,7 @@ WantedBy=%s + and install_sysvinit_service g root distro major = + match distro with + | "fedora"|"rhel"|"centos"|"scientificlinux"|"oraclelinux"|"rocky"| +- "redhat-based" -> ++ "redhat-based" |"openeuler" -> + install_sysvinit_redhat g + | "opensuse"|"sles"|"suse-based" -> + install_sysvinit_suse g +diff --git a/customize/hostname.ml b/customize/hostname.ml +index fabba3c..b301a3e 100644 +--- a/customize/hostname.ml ++++ b/customize/hostname.ml +@@ -37,7 +37,7 @@ let rec set_hostname (g : Guestfs.guestfs) root hostname = + true + + | "linux", ("rhel"|"centos"|"scientificlinux"|"oraclelinux"|"rocky"| +- "redhat-based"), v ++ "redhat-based"| "openeuler"), v + when v >= 7 -> + update_etc_hostname g hostname; + update_etc_machine_info g hostname; +@@ -49,7 +49,7 @@ let rec set_hostname (g : Guestfs.guestfs) root hostname = + replace_host_in_etc_hosts g old_hostname hostname; + true + +- | "linux", ("fedora"|"rhel"|"centos"|"scientificlinux"|"oraclelinux"|"redhat-based"), _ -> ++ | "linux", ("fedora"|"rhel"|"centos"|"scientificlinux"|"oraclelinux"|"redhat-based"|"openeuler"), _ -> + replace_line_in_file g "/etc/sysconfig/network" "HOSTNAME" hostname; + true + +diff --git a/customize/password.ml b/customize/password.ml +index b37b31f..094bfb6 100644 +--- a/customize/password.ml ++++ b/customize/password.ml +@@ -186,7 +186,7 @@ and default_crypto g root = + + (* Rolling distributions, which hopefully should be updated enough. *) + | ("archlinux"|"kalilinux"), _ -> `YESCRYPT +- | ("voidlinux"), _ -> `SHA512 ++ | ("voidlinux"|"openeuler"), _ -> `SHA512 + + | _, _ -> + let minor = g#inspect_get_minor_version root in +-- +2.43.0 + diff --git a/guestfs-tools.spec b/libguestfs-tools.spec similarity index 97% rename from guestfs-tools.spec rename to libguestfs-tools.spec index 54e938bdc4e24f2b8f7626b60251084ea444ddac..9a006a6218b7d1bb99f13f4ed631a570fed1d5db 100644 --- a/guestfs-tools.spec +++ b/libguestfs-tools.spec @@ -13,7 +13,7 @@ Summary: Tools to access and modify virtual machine disk images Name: guestfs-tools Version: 1.49.5 -Release: 1%{?dist} +Release: 3%{?dist} License: GPLv2+ ExcludeArch: %{power64} @@ -26,6 +26,7 @@ Source1: http://download.libguestfs.org/guestfs-tools/%{source_directory}/ %endif Patch1: 0001-customize-timezone.ml-Add-gettext-f_-call-around-an-.patch +Patch2: 0002-guestfs-tools-adapt-virt-customize-for-openEuler-ima.patch %if 0%{patches_touch_autotools} BuildRequires: autoconf, automake, libtool, gettext-devel @@ -377,6 +378,8 @@ end %changelog +* Tue Sep 17 2024 Wang Guoquan - 1.49.5-3 +- guestfs-tools-adapt-virt-customize-for-openEuler-ima * Wed Apr 24 2024 Wei Jiangang - 1.49.5-2 - Fix error message by adding gettext f_ call around it. * Tue Mar 23 2021 Wei Jiangang - 1.49.5-1