pb-udhcp: Fix MAC-address-based configuration file location
authorJeremy Kerr <jk@ozlabs.org>
Mon, 15 Jul 2013 08:09:09 +0000 (16:09 +0800)
committerGeoff Levand <geoff@infradead.org>
Tue, 23 Jul 2013 16:44:45 +0000 (09:44 -0700)
We're currently requesting a colon-separated MAC address. Instead, we
need it to be hypen-separated, and prefixed with the ethernet type
("01-").

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
utils/pb-udhcpc

index 729de080885247280aa07ee3b82b886292a5989a..252bb11d3ec1cd54ce3572e01e03e7aeb657c1f0 100644 (file)
@@ -38,8 +38,8 @@ do_pxe() {
        params="conf@/net/${interface} method=dhcp"
 
        # first, try by MAC
-       mac=$(cat /sys/class/net/$interface/address)
-       pb-event $params url=$basedir/$mac
+       mac=$(tr ':' '-' < /sys/class/net/$interface/address)
+       pb-event $params url=$basedir/01-$mac
 
        # try decreasing fragments of IP lease
        ip_hex=$(printf '%02X%02X%02X%02X' $(echo $ip | tr '.' ' '))