WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: [HOW-TO] Automatic headless setup with SSH  (Read 2828 times)

Offline zharr

  • Newbie
  • *
  • Posts: 29
[HOW-TO] Automatic headless setup with SSH
« on: May 17, 2022, 12:30:06 AM »
Hey,
I've made a script(set) that automatically creates an SD card for you with your desired dependencies, that can autoconnect to known wifi, and has working SSH with zeroconf (so hostname is broadcast).
I've found it very helpful to create a reproducible image and still iterate on it relatively fast.

Ofc it has stuff that could be improved, e.g. it redownloads md5 sums and dependencies every time sequentially so even if the packages are already downloaded, it installs them pretty slowly.

If you already have a workflow and just want the automatic connecting to wifi and SSH:
For wifi, just copy wifi.sh (modified from wifi.tcz's version), it supports autoconnecting to best available known network (just add it to bootlocal.sh).
You still need all normal wifi firmware and wifi.tcz ofc.
For SSH+zeroconf (hostname support), you ofc need openssh.tcz as well as dbus.tcz and avahi.tcz, just start the services in bootlocal.sh.
Check the script for details.

Offline Greg Erskine

  • Sr. Member
  • ****
  • Posts: 404
Re: [HOW-TO] Automatic headless setup with SSH
« Reply #1 on: May 24, 2022, 06:30:51 PM »
Hi zharr,

piCorePlayer, which probably has the latest piCore user base, was written almost completely in sh scripts. Tens of thousands of lines of scripts. We tried to honour TinyCore principles.

We have been through your process of ssh, wifi and zeroconf, so wish you luck.

regards
Greg

Offline Greg Erskine

  • Sr. Member
  • ****
  • Posts: 404
Re: [HOW-TO] Automatic headless setup with SSH
« Reply #2 on: May 24, 2022, 06:55:07 PM »
Only a suggestion....

I couldn't post this directly.

Offline zharr

  • Newbie
  • *
  • Posts: 29
Re: [HOW-TO] Automatic headless setup with SSH
« Reply #3 on: June 04, 2022, 02:36:19 PM »
Hi zharr,

piCorePlayer, which probably has the latest piCore user base, was written almost completely in sh scripts. Tens of thousands of lines of scripts. We tried to honour TinyCore principles.

We have been through your process of ssh, wifi and zeroconf, so wish you luck.

regards
Greg
Sorry, don't get email notifications for some reason

Yep, a lot to read into that you take for given until you need to figure out what exactly makes things work the way you want to.
Luckily it does work now, and for my small embedded application it is just fine.
I can imagine if you add a lot of user interaction ontop, and even more expected features, it'll get even more complicated quickly.

Only a suggestion....

I couldn't post this directly.
Yeah, sounds about right, except in cases were you need wildcard expansion. Am not too strict about it though. Thanks for the suggestion though!