FOGProject / fogproject

An open source computer cloning & management system
https://fogproject.org
GNU General Public License v3.0
1.09k stars 221 forks source link

FOG reads wrong MAC address #518

Closed JlnWntr closed 1 year ago

JlnWntr commented 1 year ago

If you are using a Dell Docking Station with a Dell Latitude 7430, FOG and iPXE retrieve two different MACs. At startup iPXE reads the correct (passthrough) MAC of the Latitude: Screenshot 2022-11-28 112211

But FOG reads the Docking Station's MAC: Screenshot 2022-11-28 112241

Now if you connect two different laptops on a single Docking Station one by one, FOG thinks that the second laptop is already registered: Screenshot 2022-11-28 112128

Sebastian-Roth commented 1 year ago

@JlnWntr FOG uses the Linux kernel. Please boot up any kind of Linux live OS to see if you get the passthrough MAC showing up. Best if you can try different ones to see if it makes a difference.

JlnWntr commented 1 year ago

I tested this with Ubuntu 22.04.1 and it works. I get the correct MACs, depending on the passthrough-option.

Sebastian-Roth commented 1 year ago

@JlnWntr Well that's a good start. Please run the following command on Ubuntu live and post the fill output (or a picture) here:

lspci -vnn | grep -e "^[0-9a-f]" -e "Kernel module" | grep -i net -A1
JlnWntr commented 1 year ago

It's only two lines:

Network Controller [0208]: Intel Corporation Alder Lake-P PCH CNVi Wifi [8086:51f0] (rev 01) 
Kernel modules: iwlwifi
Sebastian-Roth commented 1 year ago

@JlnWntr That would mean Ubuntu does not recognize the ethernet NIC at all. Please leave out the last "grep" and post the full output here:

lspci -vnn | grep -e "^[0-9a-f]" -e "Kernel module"
JlnWntr commented 1 year ago

But why can Ubuntu use it then?

There you go:

lspci -vnn | grep -e "^[0-9a-f]" -e "Kernel module"
00:00.0 Host bridge [0600]: Intel Corporation Device [8086:4601] (rev 04)
    Kernel modules: igen6_edac
00:02.0 VGA compatible controller [0300]: Intel Corporation Device [8086:46a8] (rev 0c) (prog-if 00 [VGA controller])
    Kernel modules: i915
00:04.0 Signal processing controller [1180]: Intel Corporation Alder Lake Innovation Platform Framework Processor Participant [8086:461d] (rev 04)
    Kernel modules: processor_thermal_device_pci
00:06.0 PCI bridge [0604]: Intel Corporation 12th Gen Core Processor PCI Express x4 Controller #0 [8086:464d] (rev 04) (prog-if 00 [Normal decode])
00:07.0 PCI bridge [0604]: Intel Corporation Alder Lake-P Thunderbolt 4 PCI Express Root Port #0 [8086:466e] (rev 04) (prog-if 00 [Normal decode])
00:07.1 PCI bridge [0604]: Intel Corporation Alder Lake-P Thunderbolt 4 PCI Express Root Port #1 [8086:463f] (rev 04) (prog-if 00 [Normal decode])
00:08.0 System peripheral [0880]: Intel Corporation 12th Gen Core Processor Gaussian & Neural Accelerator [8086:464f] (rev 04)
00:0d.0 USB controller [0c03]: Intel Corporation Alder Lake-P Thunderbolt 4 USB Controller [8086:461e] (rev 04) (prog-if 30 [XHCI])
    Kernel modules: xhci_pci
00:0d.2 USB controller [0c03]: Intel Corporation Alder Lake-P Thunderbolt 4 NHI #0 [8086:463e] (rev 04) (prog-if 40 [USB4 Host Interface])
    Kernel modules: thunderbolt
00:12.0 Serial controller [0700]: Intel Corporation Device [8086:51fc] (rev 01) (prog-if 00 [8250])
    Kernel modules: intel_ish_ipc
00:14.0 USB controller [0c03]: Intel Corporation Alder Lake PCH USB 3.2 xHCI Host Controller [8086:51ed] (rev 01) (prog-if 30 [XHCI])
    Kernel modules: xhci_pci
00:14.2 RAM memory [0500]: Intel Corporation Alder Lake PCH Shared SRAM [8086:51ef] (rev 01)
00:14.3 Network controller [0280]: Intel Corporation Alder Lake-P PCH CNVi WiFi [8086:51f0] (rev 01)
    Kernel modules: iwlwifi
00:15.0 Serial bus controller [0c80]: Intel Corporation Alder Lake PCH Serial IO I2C Controller #0 [8086:51e8] (rev 01)
    Kernel modules: intel_lpss_pci
00:15.1 Serial bus controller [0c80]: Intel Corporation Alder Lake PCH Serial IO I2C Controller #1 [8086:51e9] (rev 01)
    Kernel modules: intel_lpss_pci
00:16.0 Communication controller [0780]: Intel Corporation Alder Lake PCH HECI Controller [8086:51e0] (rev 01)
    Kernel modules: mei_me
00:1f.0 ISA bridge [0601]: Intel Corporation Alder Lake PCH eSPI Controller [8086:5182] (rev 01)
00:1f.3 Audio device [0403]: Intel Corporation Alder Lake PCH-P High Definition Audio Controller [8086:51c8] (rev 01) (prog-if 80)
    Kernel modules: snd_hda_intel, snd_sof_pci_intel_tgl
00:1f.4 SMBus [0c05]: Intel Corporation Alder Lake PCH-P SMBus Host Controller [8086:51a3] (rev 01)
    Kernel modules: i2c_i801
00:1f.5 Serial bus controller [0c80]: Intel Corporation Alder Lake-P PCH SPI Controller [8086:51a4] (rev 01)
01:00.0 Non-Volatile memory controller [0108]: Sandisk Corp WD PC SN810 / Black SN850 NVMe SSD [15b7:5011] (rev 01) (prog-if 02 [NVM Express])
    Kernel modules: nvme
02:00.0 PCI bridge [0604]: Intel Corporation JHL7540 Thunderbolt 3 Bridge [Titan Ridge DD 2018] [8086:15ef] (rev 06) (prog-if 00 [Normal decode])
03:02.0 PCI bridge [0604]: Intel Corporation JHL7540 Thunderbolt 3 Bridge [Titan Ridge DD 2018] [8086:15ef] (rev 06) (prog-if 00 [Normal decode])
03:04.0 PCI bridge [0604]: Intel Corporation JHL7540 Thunderbolt 3 Bridge [Titan Ridge DD 2018] [8086:15ef] (rev 06) (prog-if 00 [Normal decode])
04:00.0 USB controller [0c03]: Intel Corporation JHL7540 Thunderbolt 3 USB Controller [Titan Ridge DD 2018] [8086:15f0] (rev 06) (prog-if 30 [XHCI])
    Kernel modules: xhci_pci
Sebastian-Roth commented 1 year ago

@JlnWntr THat is really strange. I can't find a network card (other than wireless LAN) in that output either. Can you please run the following command on Ubuntu and post output here:

ls -al /sys/class/net/*/device/driver
JlnWntr commented 1 year ago

Sure

ls -al /sys/class/net/*/device/driver
lrwxrwxrwx 1 root root 0 Dez  6 11:39 /sys/class/net/enx0892048d1442/device/driver -> ../../../../../../../../../../bus/usb/drivers/r8152
lrwxrwxrwx 1 root root 0 Dez  6 11:39 /sys/class/net/wlp0s20f3/device/driver -> ../../../bus/pci/drivers/iwlwifi
Sebastian-Roth commented 1 year ago

@Piotr86PL Here we seem to have another Realtek NIC candidate causing us grieve. It's surely different to your WOL issue but I can see a connection here :-)

First I thought Ubuntu 22.04.1 might come with a newer kernel but turns out they use 5.15.x just as we do. So it's probably some extra kernel patch added.

@JlnWntr Anyhow I think it's worth building a newer kernel (6.0.x) and see if MAC passthrough works with that one. Are you able to build your own FOS kernel (following the docs)?

JlnWntr commented 1 year ago

I'm so glad to say that this worked!! I built kernel 6.0.12 manually (following the docs). Now I get the correct MAC!!!

On the other hand, the build script did not work: I ran into some problems while running ./build.sh --kernel-only --arch x64. First, I needed some additional packages on my Ubuntu. (See my recent pull request.) Then I get errors like these:

scripts/Kconfig.include:39: compiler 'aarch64-linux-gnu-gcc' not found.

But thank you so much for helping me!!

Sebastian-Roth commented 1 year ago

@JlnWntr Great the 6.x kernel makes it work!!

scripts/Kconfig.include:39: compiler 'aarch64-linux-gnu-gcc' not found

I can only imagine you ran into the ARM64 cross compile branch somehow: https://github.com/FOGProject/fos/blob/9580f3cff4df745fb58c4373f64ebd452fdebd4a/build.sh#L197

I use the short-hand command line parameters usually (.. -k -a x64) - not sure if there is an issue with the long parameters?!

Edit: Quite possibly the long parameter does not work. If $arch is not set it will build for all three architectures (code ref).