From patchwork Fri Oct 10 12:02:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Campbell X-Patchwork-Id: 38576 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f197.google.com (mail-lb0-f197.google.com [209.85.217.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6EF8A202DB for ; Fri, 10 Oct 2014 12:03:53 +0000 (UTC) Received: by mail-lb0-f197.google.com with SMTP id p9sf2031534lbv.0 for ; Fri, 10 Oct 2014 05:03:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:mime-version:cc:subject:precedence:list-id :list-unsubscribe:list-post:list-help:list-subscribe:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list:list-archive:content-type:content-transfer-encoding; bh=C+clXx8il8PwvnJIO3iLKLgeWcsz07f6SNYgJOfL5/I=; b=Wb2kx16TnSTPxvxMsKsfCKki4x8wcLBlzxSg98lRH1R+UNWOmb8aetBgtzcQLyqiHs vgKHOeF5mMMJnqA0OvffesrTACcUfSeWU/fBQl1/8ZN7bfNG/JN2OR25GKqTG15X5xpu 2+8Z1rYXFfxPIn3Is795BIiF++8efdV8NaBiXoBv6n7t8IO6ZyeZR6vS9N2wqccLEqkt uKZespsLCgPrU5+itWD791veO3ddptuE+t4n+JUg9INMlUFDlVIRVB2nR7+HSE5KUSmP /0iUHz7WMV3qBY0TNvKVRQm+I/idjnqkzzAMJozURGHf0iqwKQAGSUkyQLpTiR/VjdsS VwMg== X-Gm-Message-State: ALoCoQmSPq2pg4p59XtRqgmFMKvrPfpkRT7xi1NI41o28jOWzY6lBI2hFdb+jXlQF4wT9/uAq1e4 X-Received: by 10.180.82.74 with SMTP id g10mr2090446wiy.0.1412942632276; Fri, 10 Oct 2014 05:03:52 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.9.168 with SMTP id a8ls266539lab.55.gmail; Fri, 10 Oct 2014 05:03:52 -0700 (PDT) X-Received: by 10.152.2.41 with SMTP id 9mr4272579lar.79.1412942632146; Fri, 10 Oct 2014 05:03:52 -0700 (PDT) Received: from mail-la0-f44.google.com (mail-la0-f44.google.com [209.85.215.44]) by mx.google.com with ESMTPS id u7si8949014lau.44.2014.10.10.05.03.52 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 10 Oct 2014 05:03:52 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.44 as permitted sender) client-ip=209.85.215.44; Received: by mail-la0-f44.google.com with SMTP id hs14so3085646lab.3 for ; Fri, 10 Oct 2014 05:03:52 -0700 (PDT) X-Received: by 10.152.28.167 with SMTP id c7mr4296163lah.27.1412942632059; Fri, 10 Oct 2014 05:03:52 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.84.229 with SMTP id c5csp414364lbz; Fri, 10 Oct 2014 05:03:51 -0700 (PDT) X-Received: by 10.221.62.133 with SMTP id xa5mr722094vcb.41.1412942630846; Fri, 10 Oct 2014 05:03:50 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id vc5si6612983vcb.63.2014.10.10.05.03.50 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 10 Oct 2014 05:03:50 -0700 (PDT) Received-SPF: none (google.com: xen-devel-bounces@lists.xen.org does not designate permitted sender hosts) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XcYua-0002hV-NA; Fri, 10 Oct 2014 12:03:08 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XcYuZ-0002e5-0C for xen-devel@lists.xen.org; Fri, 10 Oct 2014 12:03:07 +0000 Received: from [85.158.137.68:38446] by server-2.bemta-3.messagelabs.com id 74/40-09149-AFAC7345; Fri, 10 Oct 2014 12:03:06 +0000 X-Env-Sender: Ian.Campbell@citrix.com X-Msg-Ref: server-11.tower-31.messagelabs.com!1412942579!12742925!6 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n X-StarScan-Received: X-StarScan-Version: 6.12.2; banners=-,-,- X-VirusChecked: Checked Received: (qmail 3727 invoked from network); 10 Oct 2014 12:03:05 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-11.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 10 Oct 2014 12:03:05 -0000 X-IronPort-AV: E=Sophos;i="5.04,691,1406592000"; d="scan'208";a="180116979" Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com (10.13.107.78) with Microsoft SMTP Server id 14.3.181.6; Fri, 10 Oct 2014 08:02:44 -0400 Received: from kazak.uk.xensource.com ([10.80.2.80] helo=zakaz.uk.xensource.com) by ukmail1.uk.xensource.com with smtp (Exim 4.69) (envelope-from ) id 1XcYuB-0008Tl-8B; Fri, 10 Oct 2014 13:02:44 +0100 Received: by zakaz.uk.xensource.com (sSMTP sendmail emulation); Fri, 10 Oct 2014 13:02:43 +0100 From: Ian Campbell To: Date: Fri, 10 Oct 2014 13:02:24 +0100 Message-ID: <1412942554-752-9-git-send-email-ian.campbell@citrix.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1412942404.27111.12.camel@citrix.com> References: <1412942404.27111.12.camel@citrix.com> MIME-Version: 1.0 X-DLP: MIA1 Cc: Ian Campbell , xen-devel@lists.xen.org Subject: [Xen-devel] [PATCH RFC OSSTEST 09/19] ts-host-install: Add force-mac-address host flag X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ian.campbell@citrix.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.44 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Archive: 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 Acked-by: Ian Jackson --- 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 }