From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: [PATCH RFC OSSTEST 09/19] ts-host-install: Add force-mac-address host flag Date: Fri, 10 Oct 2014 13:02:24 +0100 Message-ID: <1412942554-752-9-git-send-email-ian.campbell@citrix.com> References: <1412942404.27111.12.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1412942404.27111.12.camel@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: ian.jackson@eu.citrix.com Cc: Ian Campbell , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org This causes us to emit udev runes which force the device named in the host's Interface_Force property to have the MAC address given in the host's Ether property. This is the reverse of the behaviour of the Interface_Force property without this flag, which is to rename the device with MAC address Ether to have the requested name. This is necessary because the arndale's USB Ethernet device has no burned in MAC address and there is no mechanism to configure this e.g. via the bootloader in a way which Linux will then notice. Without this change Linux will pick a random mac address when loading the driver, which breaks osstest's attempts to observe when the test host has picked up its preseed file by watching the webserver logs, since DHCP will not map a random mac address to the IP we are expecting. Signed-off-by: Ian Campbell --- ts-host-install | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ts-host-install b/ts-host-install index 7c8d693..e874b98 100755 --- a/ts-host-install +++ b/ts-host-install @@ -181,6 +181,7 @@ sub setup_pxeboot_firstboot($) { my $ipappend = 2; my $wantphysif= get_host_property($ho,'interface force','auto'); + logm("Forcing interface $wantphysif"); if ($wantphysif ne 'auto') { $ipappend = 0; die "need Ether for $ho->{Name} ($wantphysif)" @@ -188,7 +189,9 @@ sub setup_pxeboot_firstboot($) { system_checked(qw(mkdir -p --), "$initrd_overlay.d/etc/udev/rules.d"); file_simple_write_contents ("$initrd_overlay.d/etc/udev/rules.d/70-persistent-net.rules", - <{Flags}{'force-mac-address'} ? <{Ether}", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="$wantphysif" END } -- 2.1.0