Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4921

Raspberry Pi OS • Current procedure for manual (without rpi-imager) headless install

$
0
0
Hi,

Today I was attempting to do a headless install of latest RPiOS Lite on a 3B+ and as it's been a while I had to re-skill a bit. For background, I run Gentoo Linux so rpi-imager wasn't an option for me (even were it available, I find it overkill when the much simpler needed tools are only a console away). I got most of what I needed but not all, and couldn't locate any current authoritative info on this procedure.*

I'm sure there used to be instructions on the main website (or linked form it) on how to write a distribution .img.xz directly to SD using tar and dd, but there's no trace now: only rpi-imager instructions. Also AWOL are the details on the "cheatcodes" for pre-enabling SSH and so forth by dropping files in the boot partition. I found some old writeups on these on external sites, but my experience showed that at least some of that info is outdated.

What still works:
ssh empty file to pre-enable SSH
userconf file containing username:passwordhash to predefine user account(s)

What doesn't:
wpa_supplicant.conf to supply wireless credentials and country-code. And if you are relying on wifi, that's a headless install pretty well stuffed :(

I recall that this method superseded the earlier method using a file called simply wifi, but I've assumed that method no longer works (and I forget the syntax of it anyway).

I reckon (yet to test it) that I could make wifi work by copying a NetworkManager .nmconnection file from my own machine to /etc/NetworkManager/system-connections/ plus adding the wireless reg domain cfg80211.ieee80211_regdom=GB (in my case) to /boot/firmware/cmdline.txt. If there's still a "supported" method different from this, I'd like to know about it. I certainly think it's better from an accessibility POV if only the FAT32 partition needs to be accessed, and if the file's format can easily be created freehand (the .nmconnection file, if you don't have an existing NetworkManager config to borrow from, requires you to generate a GUID, which is not trivial).

What would also be nice to have:
- A way to prevent root partition expansion on first run, or at least to set a limit. Small SDs are a rare beast these days, but if you leave aside user data the bare OS will almost never need even 16GB. If partitions are only the size they need to be, you don't need to clone the whole card and your backup image can be 1/4 the size. I'm guessing that auto-expansion could be prevented by creating a dummy third partition in the unused space, but it'd be nice if this wasn't necessary.

TL;DR - I get that I am in a minority of a minority, and shouldn't expect much, but I find it a shame that these methods are (a) not comprehensively documented in a prominent, discoverable location on the RPF/RpiOS website; (b) considered so superfluous that they may be suddenly rescinded without warning. We can't all use rpi-imager, and some of us have valid reasons for not wanting to (scripting the whole process is one I've considered). Will the remaining methods also disappear in future?

[* Feel free to call me names if it was there and I just overlooked it.]

Statistics: Posted by Havinit — Wed Jan 08, 2025 6:26 pm



Viewing all articles
Browse latest Browse all 4921

Trending Articles