kenfallon / fix-ssh-on-pi

Safely enabling ssh in the default Raspberry Pi OS (previously called Raspbian) Image
MIT License
80 stars 36 forks source link

Option to build images for rpis without eth0 #3

Closed danielo515 closed 3 years ago

danielo515 commented 4 years ago

Hello. This line seems to rely on the fact that the eth0 exists:

  echo "sed \"s/raspberrypi/\$( sed 's/://g' /sys/class/net/eth0/address )/g\" -i /etc/hostname /etc/hosts" >> "${sdcard_mount}/firstboot.sh"

But there are some models, like the rpizeroW that only have wlan. It will be cool if we can pass a variable or prompt a yes/no question abut using eth0 or the wireless interface, or maybe provide a custom algorithm to generate.

Thanks

kenfallon commented 3 years ago

Good point. I need to think about that.

danielo515 commented 3 years ago

Thanks! I'll keep an eye on it

kenfallon commented 3 years ago

Finally got to fix this. Sorry it took so long.

I moved it to firstboot.sh, based on the interfaces that are UP at a given time. It will use wired first before wifi. If there is none the name will not be changed.