From patchwork Wed Oct 29 10:41:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Campbell X-Patchwork-Id: 39745 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f71.google.com (mail-wg0-f71.google.com [74.125.82.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 882E724073 for ; Wed, 29 Oct 2014 10:42:44 +0000 (UTC) Received: by mail-wg0-f71.google.com with SMTP id b13sf535696wgh.10 for ; Wed, 29 Oct 2014 03:42:43 -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=HLC7+LnPB+iDfr/yib002KLPFPYaYkOkIzv23M29lI4=; b=hfQPxpSG8xu4Q76N7fAj61I+ebsPD1ixfYKa9FKdew4oIfQZcGDliAzdy/6jhhRc65 TXObjoon0AFfF1XCFQWYu7IUZHLFBvFdEe3x/EakjODrNOMNLZeBobsuOU5SlPKPZmwo EBP8A113y1EsVepf3eSRazIfpwApkTWDMhfFy7ZJQBohKkgS+2tCLbcrDb5JabLYUS0v xySN3+3R0zxmBchgSXi9+xBdcEWK2o7Ozo/pR1pDoXYLZjxqhjZ0FwBDkkV7pTOUqq+B ZicwPe+U7zRw23FwDexx3P09xa7hadP67XaaUSWDq6UYvCyjTA7u5sJcp6iZYO1Hi0Yv iy2g== X-Gm-Message-State: ALoCoQk5lKqMyApu0b2FuONE2RkfSCgcwWIvSr0LvvOWazDCRHgve6QC+TqdgSMnGp1Zg/81BYAP X-Received: by 10.112.26.82 with SMTP id j18mr35618lbg.16.1414579363544; Wed, 29 Oct 2014 03:42:43 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.43.1 with SMTP id s1ls180960lal.30.gmail; Wed, 29 Oct 2014 03:42:43 -0700 (PDT) X-Received: by 10.152.234.227 with SMTP id uh3mr10157720lac.69.1414579363370; Wed, 29 Oct 2014 03:42:43 -0700 (PDT) Received: from mail-lb0-f178.google.com (mail-lb0-f178.google.com. [209.85.217.178]) by mx.google.com with ESMTPS id qj5si6585897lbb.89.2014.10.29.03.42.43 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 29 Oct 2014 03:42:43 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.178 as permitted sender) client-ip=209.85.217.178; Received: by mail-lb0-f178.google.com with SMTP id f15so2474058lbj.9 for ; Wed, 29 Oct 2014 03:42:43 -0700 (PDT) X-Received: by 10.153.8.164 with SMTP id dl4mr10423566lad.29.1414579363236; Wed, 29 Oct 2014 03:42:43 -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 c5csp633452lbz; Wed, 29 Oct 2014 03:42:42 -0700 (PDT) X-Received: by 10.224.16.135 with SMTP id o7mr14200821qaa.37.1414579361463; Wed, 29 Oct 2014 03:42:41 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id p77si6800741qgd.26.2014.10.29.03.42.40 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 29 Oct 2014 03:42:41 -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 1XjQhU-0002S4-9X; Wed, 29 Oct 2014 10:42:00 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XjQhR-0002Nf-HD for xen-devel@lists.xen.org; Wed, 29 Oct 2014 10:41:57 +0000 Received: from [193.109.254.147] by server-5.bemta-14.messagelabs.com id 26/6A-08051-474C0545; Wed, 29 Oct 2014 10:41:56 +0000 X-Env-Sender: Ian.Campbell@citrix.com X-Msg-Ref: server-5.tower-27.messagelabs.com!1414579314!8540327!2 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.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 21667 invoked from network); 29 Oct 2014 10:41:56 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-5.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 29 Oct 2014 10:41:56 -0000 X-IronPort-AV: E=Sophos;i="5.04,809,1406592000"; d="scan'208";a="186004725" Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com (10.13.107.79) with Microsoft SMTP Server id 14.3.181.6; Wed, 29 Oct 2014 06:41:51 -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 1XjQhK-00014b-G3; Wed, 29 Oct 2014 10:41:51 +0000 Received: by zakaz.uk.xensource.com (sSMTP sendmail emulation); Wed, 29 Oct 2014 10:41:50 +0000 From: Ian Campbell To: Date: Wed, 29 Oct 2014 10:41:30 +0000 Message-ID: <1414579302-6692-8-git-send-email-ian.campbell@citrix.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1414579268.29975.13.camel@citrix.com> References: <1414579268.29975.13.camel@citrix.com> MIME-Version: 1.0 X-DLP: MIA2 Cc: Ian Campbell , xen-devel@lists.xen.org Subject: [Xen-devel] [PATCH OSSTEST v2 08/20] 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.217.178 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. This is only useful on systems which have exactly one Ethernet device, otherwise there is no reliable way to determine which device is which. Signed-off-by: Ian Campbell Acked-by: Ian Jackson --- v2; Added final para to commit log. --- ts-host-install | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ts-host-install b/ts-host-install index 2f72b5f..b954e53 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 }