base-files: use get_mac_binary() in mtd_get_mac_binary_ubi()
The actual retrieval of the MAC address in mtd_get_mac_binary_ubi()
is the same as in get_mac_binary(). Thus, use the latter function
in the former to reduce duplicate code.
This will also allow to benefit from the enhanced path check there
and bring mtd_get_mac_binary_ubi() more in line with the similar
mtd_get_mac_binary().
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 45600124fc)
			
			
This commit is contained in:
		 Adrian Schmutzler
					Adrian Schmutzler
				
			
				
					committed by
					
						 Christian Lamparter
						Christian Lamparter
					
				
			
			
				
	
			
			
			 Christian Lamparter
						Christian Lamparter
					
				
			
						parent
						
							39ae849d0d
						
					
				
				
					commit
					28d3afc8d6
				
			| @@ -79,12 +79,7 @@ mtd_get_mac_binary_ubi() { | |||||||
| 	local ubidev=$(nand_find_ubi $CI_UBIPART) | 	local ubidev=$(nand_find_ubi $CI_UBIPART) | ||||||
| 	local part=$(nand_find_volume $ubidev $1) | 	local part=$(nand_find_volume $ubidev $1) | ||||||
|  |  | ||||||
| 	if [ -z "$part" ]; then | 	get_mac_binary "/dev/$part" "$offset" | ||||||
| 		echo "mtd_get_mac_binary: ubi volume $mtdname not found!" >&2 |  | ||||||
| 		return |  | ||||||
| 	fi |  | ||||||
|  |  | ||||||
| 	hexdump -v -n 6 -s $offset -e '5/1 "%02x:" 1/1 "%02x"' /dev/$part 2>/dev/null |  | ||||||
| } | } | ||||||
|  |  | ||||||
| mtd_get_part_size() { | mtd_get_part_size() { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user