]> xenbits.xensource.com Git - osstest.git/commitdiff
Debian: handle move of ip(8) to /sbin in Jessie
authorIan Campbell <ian.campbell@citrix.com>
Mon, 21 Sep 2015 15:14:33 +0000 (16:14 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Fri, 25 Sep 2015 11:27:44 +0000 (12:27 +0100)
Unfortunately udev treats non-absolute commands as relative to
/lib/udev rather than consulting $PATH, so we have to figure out the
path based on the suite.

Without this the force-mac-address workaround (needed on Arndale)
doesn't work.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
ts-host-install

index 9a46454982159773205a18097fae9555f0f0ea51..1cacd07a92ea9ea759ee32a924a26ad8a65c9750 100755 (executable)
@@ -220,10 +220,12 @@ sub setup_pxeboot_firstboot($) {
        die "need Ether for $ho->{Name} ($wantphysif)"
            unless defined $ho->{Ether};
         system_checked(qw(mkdir -p --), "$initrd_overlay.d/etc/udev/rules.d");
+       # ip(8) moved to /sbin in Jessie
+       my $ipcmd = $ho->{Suite} =~ m/wheezy/ ? "/bin/ip" : "/sbin/ip";
         file_simple_write_contents
             ("$initrd_overlay.d/etc/udev/rules.d/70-persistent-net.rules",
              $ho->{Flags}{'force-mac-address'} ? <<END : <<END);
-SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", KERNEL=="$wantphysif", RUN += "/bin/ip link set $wantphysif address $ho->{Ether}"
+SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", KERNEL=="$wantphysif", RUN += "$ipcmd link set $wantphysif address $ho->{Ether}"
 END
 SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="$ho->{Ether}", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="$wantphysif"
 END