Install without monitor and keyboard?

I have need to install FreeBSD, in this case on Pi 4, without connecting a monitor and keyboard. Obviously, I expect to complete the process over ssh. So, I'm asking if there's a way to copy a script to the install media - preferable an usb ssd drive. If this is possible, are there any instructions for this?
 
There's something called mfsBSD, but it's for amd64 and I would need an arm64 version. Does anyone know if this has been recompiled?
 
I think you would be able to install FreeBSD because you are going to connect a monitor and a keyboard. I think that's enough.
 
I think you would be able to install FreeBSD because you are going to connect a monitor and a keyboard. I think that's enough.
I'm so sorry for not checking the title and text before posting. I intended to say WITHOUT instead of with. I've edited the original accordingly.
 
I'm so sorry for not checking the title and text before posting. I intended to say WITHOUT instead of with. I've edited the original accordingly.
Oh, I see. What about using pre-made RPI images, you would have ssh access for freebsd user after it boots. If you are going to use ethernet cable, this may work. The password was freebsd, too, i guess.
 
Yes so for FreeBSD 14.2 use the SD Card Images.
FreeBSD-14.2-RELEASE-arm64-aarch64-RPI.img.xz

Uncompress and dd to USB-SSD medium. Then mount and add your script.

The real problem is some RPi4 did not work gracefully. So you almost need a monitor to work that out, then you can do your ssh into OS.
You could consider using EDK2 for RPI in ports and that is a steady booter. Try the stock RPi image first it may just work fine for you.
pkg install edk2-rpi4
 
I suggest using a micro-SD card first with that image flashed to it. Get it booting off micro-SD to ensure everything is OK with your board then try for USB-SSD.
You may need bootloader on micro-SD for this and everything else on USB-SSD.
 
I dived in at the deep end and went for it...

# installing freebsd

## on the iMac
- from: https://download.freebsd.org/releases/arm64/aarch64/ISO-IMAGES/14.2/
- download: FreeBSD-14.2-RELEASE-arm64-aarch64-RPI.img.xz
- using Raspberry Pi Imager v1.8.5
- burn to a SanDisk 64GB Ultra Fit Flash Drive
- insert into Pi 4 and power up
- wait a couple of minutes
- consult the router for a new ip address
- I see 192.168.1.50 but without a name
- using Terminal
- ssh freebsd@192.168.1.50
- accept new fingerprint using password freebsd

## Terminal messages...
```
Last login: Fri Nov 29 08:14:30 2024
FreeBSD 14.2-RELEASE (GENERIC) releng/14.2-n269506-c8918d6c7412

Welcome to FreeBSD!

Release Notes, Errata: https://www.freebsd.org/releases/
Security Advisories: https://www.freebsd.org/security/
FreeBSD Handbook: https://www.freebsd.org/handbook/
FreeBSD FAQ: https://www.freebsd.org/faq/
Questions List: https://www.freebsd.org/lists/questions/
FreeBSD Forums: https://forums.freebsd.org/

Documents installed with the system are in the /usr/local/share/doc/freebsd/
directory, or can be installed later with: pkg install en-freebsd-doc
For other languages, replace "en" with a language code like de or fr.

Show the version of FreeBSD installed: freebsd-version ; uname -a
Please include that output and any error messages when posting questions.
Introduction to manual pages: man man
FreeBSD directory layout: man hier

To change this login announcement, see motd(5).
When you want your users to be able to reboot or shutdown FreeBSD, add them
to the group "operator" and they are allowed to use shutdown(8) and poweroff(8).
```
HOWEVER and with little to no knowledge of BSD:
I appear to be logged in with user name freebsd and can't su to poweroff as I don't know the root password, but I'm delighted to get this far so easily - with you help.
 
Try "root": https://cgit.freebsd.org/src/tree/release/tools/arm.subr
Rich (BB code):
92 arm_create_user() {
93    # Create a default user account 'freebsd' with the password 'freebsd',
94    # and set the default password for the 'root' user to 'root'.
Thanks, but I don't understand what that file is about. Is it something to do with the script Phishfry mentioned. If so, then we're getting closer to my goal. IE: "a way to copy a script to the install media" - and how to write said a script. I'm wanting a remote install, without needing a monitor & keyboard connected to the remote target. I expect to be able to ssh, presumably as root, into the target and be presented with a text screen to complete the installation. This is how I've bee installing piOS Lite (Debian without GUI). Constant updates to the Linux kernel is driving me away an to migrate all my headless Pi s to headless BSD servers. The Sandisks I use are USB 3.1 which piOS magically uses the entire space during the install process.
 
Here are some suggestions.
Now that you know everything is working you can modify the microSD card contents. Add some script you want.

We have a facility called firstboot that is used to expand the FreeBSD installation to the full size of the microSD.
You could use firstboot facility to fire off a script on initial boot.

I highly recommend you strengthen root password. Delete freebsd user/password and make your own user.

Copying your work to USB-SSD device might take some trial and error. U-Boot on Pi works differently than I am used to.

The gist is you want Bootloader on microSD or SPI flash and the Operating System on USB-SSD.
I am Pi ignorant. Someone else might want to explain thier disk setup. EFI on microSD with bootloader rest on USB-SSD??? That would be my first attempt.

Pi puts u-boot files in directory instead of flashing to disk. So I am dumb about Pi methods. It works totally different than most Arm platforms.
 
Very good. I wasn't using the su command correctly, so I now have the # prompt in my iMac Terminal.

Summary so far:
  • A Pi 4 v1.2 will boot from a USB 3.1 stick, without a monitor & keyboard.
  • I can ssh from an iMac as freebsd@<ip addres> with password freebsd.
  • I can su to root by entering: su followed by password: root.
  • I can reboot the Pi and log back in as freebsd over ssh.
I'll need to do a lot more reading before moving on.
 
Fo now, I've given up trying without a monitor and keyboard and spent hours trying to install the "conventional" way. On the way I think the EPROM became corrupt, so reinstalled piOS which seems to fixed that. My current attempt with FreeBSD is underway as I type. This time I unplugged the 500GB USB SSD and booted from an SD card using the .img file. After all the expected console messages, it topped with login prompt. I refrained from logging in and instead reconnect the 500GB SSD where I hope to install FreeBSD. It was instantly recognised as umass0:0:0: Attached to scbus0 and appears to be available a db0. However, it now appears to be stuck as da0: quicks=0x2<NO_6_BYTE>.

I've no idea what any of this means, so I'm off to bed - leaving it as is just incase it's simply taking a long time to format the SSD. I'm hoping to see the install menu in the morning. Morning for me here in Spain will be no sooner than 09:00 UTC.
 
9 hours later and still stuck at quicks=0x2<NO_6_BYTE>, so I pressed enter - which gave a login prompt, so I logged in as root and started bsdinstall. At no point during the past few days have I ever seen the colourful welcome install screen.

I proceeded to answer all the question and felt confident the 500GB SSD would become a working FreeBSD. After confirming , I entered poweroff, disconnected the power, removed the SD card, and then reconnected the power. The system booted into the Raspberry network install screen with absolutely no sign of FreeBSD. One of the many condsole messages says "Firmware not found".

Summary updated:
  1. Raspberry Pi is unsupported or FreeBSD needs a better installer.
  2. I should trying or give up and stick with piOS.
  3. I should replace all my Raspberry Pi s with AMD or Intel mini-pc s.
Option 3 is expensive and there's very little up-to-date information on which ones will work,

I started with a Commodore Pet, followed by a Northstar Horizon, then various x86 boxes with System V - later moving to SCO Unix. Life was much easier and predictable back then. Oh, I did suffer Windows XP and NT Server for few years, before being consumed by Apple. I'm retired now and write software for amateur television.

Any suggestions will be most welcome.
 
I would imagine you need some sort of bootloader. You have two choices. u-boot or EDK2 UEFI. Both in ports tree.

pkg search rpi4
Code:
edk2-rpi4-g202308_5            EDK2 Firmware for rpi4
u-boot-rpi4-2024.07            Cross-build das u-boot for model rpi4

You will need to follow the instructions from the port for installation on your FreeBSD Arm boot medium.
/usr/local/share/u-boot/u-boot-rpi4/README
 
OK looking at the directory it is only one file.
u-boot.bin

You can scrape that from your FreeBSD RPI Image we started with on your USB Flash drive that worked already.

Just look at file structure of FreeBSD RPi image and look for u-boot.bin.
Then copy to the same location on your bsdinstall created installation.
I have a feeling it resides in the EFI partition root.
 
OK - I've been away for a few days and now successfully installed a Pi 4 - at last. I did this by writing
FreeBSD-14.2-RELEASE-arm64-aarch64-RPI.img to a USB SanDisk 64GB Ultra Fit Flash Drive - WITHOUT using an SD-Card !

So I tried doing the same, but with a USB SanDisk 500GB Portable SSD Media. It booted, but stopped with a prompt expecting me to type something to do with what disk to mount - so I gave up and powered off. 10 minutes later I switched the Pi back on. It booted all the way, enabling me to login as root. df showed I had almost 500GB of disk space - job done !

I'm delighted, but baffled. Please could someone explain why this happened?
 
Back
Top