hypriot / image-builder-rpi

SD card image for Raspberry Pi with Docker: HypriotOS
http://blog.hypriot.com/post/how-to-get-docker-working-on-your-favourite-arm-board-with-hypriotos/
MIT License
1.07k stars 168 forks source link

Switching SD card between RPi's: eth1: renamed from eth0 #31

Closed StefanScherer closed 8 years ago

StefanScherer commented 8 years ago

When I boot a RPi with the v0.4.0 SD card image, shutdown and plug the SD card into another RPi, then the network does not work.

In /var/log/messages I see a message like

eth1: renamed from eth0

Probably due to the different MAC addresses of the RPi's

DieterReuter commented 8 years ago

Just tested it, booting RPi3 first and then used the same SD card in a RPi2. Here are the messages from dmesg command:

$ dmesg | grep eth
[    3.139465] smsc95xx 1-1.1:1.0 eth0: register 'smsc95xx' at usb-3f980000.usb-1.1, smsc95xx USB 2.0 Ethernet, b8:27:eb:d5:98:5b
[    5.653463] smsc95xx 1-1.1:1.0 eth1: renamed from eth0
[    5.745601] systemd-udevd[112]: renamed network interface eth0 to eth1
DieterReuter commented 8 years ago

This could be easily fixed in /etc/systemd/network/eth0.network, just use

[Match]
Name=eth*

instead of Name=eth1.

DieterReuter commented 8 years ago

Can be fixed with https://github.com/hypriot/os-rootfs/pull/25.