TheSin- / rpi-img-builder

Scripts to create custom images for RaspberryPi
MIT License
107 stars 30 forks source link

ssh file disappears after first boot #32

Open sgallou opened 6 years ago

sgallou commented 6 years ago

Hi,

I tried to enable ssh by default from a custom plugin, so I added this in my postinst script :

touch /boot/ssh

But after write image on SDCard, the file does not exist in the boot partition.

If I create it manually, it will be erased at first Pi start. I need to recreate it a second time to make SSH work.

What I'm doing wrong ? Is there another mean to enable SSH ?

Thanks, sgallou

TheSin- commented 6 years ago

the pi need to boot twice for ssh to work, and it should do it on it's own, first boot creates the keys, keys aren't created cause every device needs unique keys so they can not be part of the image, once they are created the pi should reboot, and ssh should work. I have no idea what /boot/ssh does?

sgallou commented 6 years ago

Adding a /boot/ssh empty file enable SSH on headless RaspberryPi (see "3. Enable SSH on a headless Raspberry Pi" on this page). Should SSH work without adding this file ?

I let enough time (I hope) for RaspberryPi to make all its initialization, more than 10 minutes. Must I reboot manually to pass the second boot ?