diff options
-rw-r--r-- | src/board/ich9.sh | 12 |
1 files changed, 10 insertions, 2 deletions
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 |