mrc0mmand / rpms / libguestfs

Forked from rpms/libguestfs 3 years ago
Clone
Blob Blame History Raw
From 1b565df653cff8421e7af40728e27c79d563d474 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Fri, 10 Oct 2014 17:46:02 +0100
Subject: [PATCH] RHEL 7: Revert "appliance: Use dhclient or dhcpcd instead of
 hard-coding IP address of appliance."

This reverts commit 67e6f32a240c7c234e6af637c1cd324b36a82cd3.
---
 appliance/init           | 15 ++++++---------
 appliance/packagelist.in |  7 -------
 2 files changed, 6 insertions(+), 16 deletions(-)

diff --git a/appliance/init b/appliance/init
index 624e20fa6..2e18be4fe 100755
--- a/appliance/init
+++ b/appliance/init
@@ -118,15 +118,12 @@ shopt -u nullglob
 ip addr add 127.0.0.1/8 brd + dev lo scope host
 ip link set dev lo up
 
-if test "$guestfs_network" = 1; then
-    iface=$(ls -I all -I default -I lo /proc/sys/net/ipv4/conf)
-    touch /etc/fstab   # Workaround for Ubuntu.
-    if dhclient --version >/dev/null 2>&1; then
-        dhclient $iface
-    else
-        dhcpcd $iface
-    fi
-fi
+ip addr add 169.254.2.10/16 brd + dev eth0 scope global
+ip link set dev eth0 up
+
+ip route add default via 169.254.2.2
+
+echo nameserver 169.254.2.3 > /etc/resolv.conf
 
 # Scan for MDs.
 mdadm -As --auto=yes --run
diff --git a/appliance/packagelist.in b/appliance/packagelist.in
index 961a2a3b1..b437b02e0 100644
--- a/appliance/packagelist.in
+++ b/appliance/packagelist.in
@@ -26,7 +26,6 @@ ifelse(REDHAT,1,
   augeas-libs
   cryptsetup
   cryptsetup-luks      dnl old name used before Fedora 17
-  dhclient
   genisoimage
   gfs-utils
   gfs2-utils
@@ -73,7 +72,6 @@ dnl iproute has been renamed to iproute2
   iputils-ping
   iputils-arping
   iputils-tracepath
-  isc-dhcp-client
   ldmtool
   libaugeas0
   libc-bin
@@ -105,7 +103,6 @@ ifelse(ARCHLINUX,1,
   cdrkit
   cdrtools
   cryptsetup
-  dhclient
   grub
   hivex
   iproute2
@@ -133,8 +130,6 @@ ifelse(SUSE,1,
   augeas-lenses
   btrfsprogs
   cryptsetup
-  dhcpcd
-  dhcp-client
   genisoimage
   glibc-locale
   gptfdisk
@@ -160,7 +155,6 @@ ifelse(FRUGALWARE,1,
   augeas
   cryptsetup-luks
   cdrkit
-  dhclient
   grub2
   hfsplus
   iproute2
@@ -187,7 +181,6 @@ ifelse(MAGEIA,1,
   chkconfig /* for /etc/init.d */
   cdrkit-genisoimage
   cdrkit-isotools
-  dhclient
   extlinux
   gfs2-utils
   grub
-- 
2.13.4