From 3ff66e2b64e3013897276e4e1e492e306d697507 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Thu, 29 Oct 2015 22:22:12 -0400 Subject: ich9_prepare_rom(): Get current MAC address --- diff --git a/src/board/ich9.sh b/src/board/ich9.sh index 35d7e0d..187aafd 100644 --- a/src/board/ich9.sh +++ b/src/board/ich9.sh @@ -22,9 +22,17 @@ ich9_prepare_rom() info 'Generating FD and GbE flash regions for Intel ICH9' - # Get MAC address. + # Get current MAC address. + for iface in /sys/class/net/*; do + [ "x$(cat "${iface}/device/vendor")" = 'x0x8086' ] || continue + [ "x$(cat "${iface}/device/device")" = 'x0x10f5' ] || continue + mac="$(cat "${iface}/address")" + break + done + + # Ask for MAC address. while :; do - mac="$(show_prompt 'Enter MAC address' '' 17)" + mac="$(show_prompt 'Enter MAC address' "${mac}" 17)" case "${mac}" in *[!0-9a-zA-Z:]*) continue -- cgit v0.9.1