Re: [OpenWrt-Devel] [PATCH 1/2] mtd_get_mac_ascii bugfix

2013-11-08 Thread Gabor Juhos
2013.11.07. 17:23 keltezéssel, Daniel Gimpelevich írta:
 The mtd_get_mac_ascii utility function was broken. This fixes it.
 
 Signed-off-by: Daniel Gimpelevich dan...@gimpelevich.san-francisco.ca.us
 Index: package/base-files/files/lib/functions.sh
 ===
 --- a/package/base-files/files/lib/functions.sh   (revision 38679)
 +++ b/package/base-files/files/lib/functions.sh   (working copy)
 @@ -248,15 +248,13 @@
   local part
   local mac_dirty
  
 - . /lib/functions.sh
 -
   part=$(find_mtd_part $mtdname)
   if [ -z $part ]; then
   echo mtd_get_mac_ascii: partition $mtdname not found! 2
   return
   fi
  
 - mac_dirty=$(strings $part | sed -n 's/'$key'=//p')
 + mac_dirty=$(strings $part | sed -n 's/^'$key'=//p')
   # canonicalize mac
   printf %02x:%02x:%02x:%02x:%02x:%02x 0x${mac_dirty//:/ 0x}
  }
 ___
 openwrt-devel mailing list
 openwrt-devel@lists.openwrt.org
 https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
 
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 1/2] mtd_get_mac_ascii bugfix

2013-11-08 Thread Gabor Juhos
2013.11.08. 13:20 keltezéssel, Gabor Juhos írta:
 2013.11.07. 17:23 keltezéssel, Daniel Gimpelevich írta:
 The mtd_get_mac_ascii utility function was broken. This fixes it.

 Signed-off-by: Daniel Gimpelevich dan...@gimpelevich.san-francisco.ca.us

Applied.

Thanks,
Gabor
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 1/2] mtd_get_mac_ascii bugfix

2013-11-08 Thread Daniel Gimpelevich
On Fri, 2013-11-08 at 13:24 +0100, Gabor Juhos wrote: 
 2013.11.08. 13:20 keltezéssel, Gabor Juhos írta:
  2013.11.07. 17:23 keltezéssel, Daniel Gimpelevich írta:
  The mtd_get_mac_ascii utility function was broken. This fixes it.
 
  Signed-off-by: Daniel Gimpelevich dan...@gimpelevich.san-francisco.ca.us
 
 Applied.
 
 Thanks,
 Gabor

You changed it from using printf to using tr, which might not be good if
colons are missing.
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 1/2] mtd_get_mac_ascii bugfix

2013-11-07 Thread Daniel Gimpelevich
The mtd_get_mac_ascii utility function was broken. This fixes it.

Signed-off-by: Daniel Gimpelevich dan...@gimpelevich.san-francisco.ca.us
Index: package/base-files/files/lib/functions.sh
===
--- a/package/base-files/files/lib/functions.sh (revision 38679)
+++ b/package/base-files/files/lib/functions.sh (working copy)
@@ -248,15 +248,13 @@
local part
local mac_dirty
 
-   . /lib/functions.sh
-
part=$(find_mtd_part $mtdname)
if [ -z $part ]; then
echo mtd_get_mac_ascii: partition $mtdname not found! 2
return
fi
 
-   mac_dirty=$(strings $part | sed -n 's/'$key'=//p')
+   mac_dirty=$(strings $part | sed -n 's/^'$key'=//p')
# canonicalize mac
printf %02x:%02x:%02x:%02x:%02x:%02x 0x${mac_dirty//:/ 0x}
 }
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel