[Libguestfs] [PATCH] virt-sysprep: add the hostname and net_hwaddr support for rhel

Wanlong Gao gaowanlong at cn.fujitsu.com
Wed Feb 29 06:37:37 UTC 2012


Add the support for rhel.
Change the hostname and delete the HWADDR for rhel.

Signed-off-by: Wanlong Gao <gaowanlong at cn.fujitsu.com>
---
 clone/virt-sysprep.in |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/clone/virt-sysprep.in b/clone/virt-sysprep.in
index 833a31d..d505532 100644
--- a/clone/virt-sysprep.in
+++ b/clone/virt-sysprep.in
@@ -273,7 +273,7 @@ fi
 
 if [ "$hostname" = "yes" ]; then
     case "$type/$distro" in
-        linux/fedora)
+        linux/fedora|linux/rhel)
             echo "HOSTNAME=$hostname_param" > $mnt/etc/sysconfig/network.new
             sed '/^HOSTNAME=/d' < $mnt/etc/sysconfig/network >> $mnt/etc/sysconfig/network.new
             mv -f $mnt/etc/sysconfig/network.new $mnt/etc/sysconfig/network
@@ -313,7 +313,7 @@ fi
 
 if [ "$net_hwaddr" = "yes" ]; then
     case "$type/$distro" in
-        linux/fedora)
+        linux/fedora|linux/rhel)
             if [ -d $mnt/etc/sysconfig/network-scripts ]; then
                 rm_hwaddr ()
                 {
-- 
1.7.9




More information about the Libguestfs mailing list