virt-sysprep: add the hostname and net_hwaddr support for rhel

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

Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
This commit is contained in:
Wanlong Gao
2012-02-29 14:37:37 +08:00
committed by Richard W.M. Jones
parent 48a5cb2a2c
commit d6f736ab18

View File

@@ -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 ()
{