Minimal FreeBSD based system, or how can I manually install FreeBSD... minimally... without internet connectivity

decuser

Active Member

Reaction score: 74
Messages: 216

I realize that I have asked a question that isn't artful. I'm trying to learn a bit more about how things work, so I may not have asked this correctly. Help me out. What I think I want to do is something along the lines of:

1. In a VM running 12.1 w/root on ZFS (or alternatively w/UFS)
2. Add a drive to the system and put a filesystem on it
3. Install just enough FreeBSD to the new drive to boot off it

How I'm thinking this might work is that no installer is involved and 1 is already running and 2 is straightforward, but 3 is where the work comes in. I have two scenarios in mind, one is to copy a bootloader file onto the bootsector of the drive and unpack the kernel and userland onto it (how do I boot it?), and the second is to put the bootloader where it belongs and then cross-compile basic programs (bash, cc, and so on) in some mysterious order so that the system is useable when I boot into it. Option two, seems uber-challenging, but option one seems challenging but doable.

What do y'all think? Has manual installs using the tarballs and bootloader stuff been written up somewhere?
 

mark_j

Aspiring Daemon

Reaction score: 484
Messages: 883

What host is running the VM?

Adding a drive is simple. You connect the disk to the host machine and look in the appropriate sections of the manual. If you're using ZFS you don't have to worry about partitions because it's best to use an entire disk.

Your option 3 is a bit confusing. What defines enough? The OS is the OS is the OS, you can't pick and choose what to install (in reality you can pick options like installing compat layers or games). Install the OS gets you the kernel, the init system and the userland utilities like ls, cat, find etc. That's it.

Is there a manual for all your proposals? Not that I'm aware of, because frankly, what you're proposing is ... silly. In simplistic terms, how are you going to determine what programs are needed? What libraries to include? What parts of the init system are you going to remove, how this will work etc etc. You could do it, but I'm willing to bet a lot of money it will be unusable.

So it all begs the question, what are you trying to achieve?
 

hruodr

Aspiring Daemon

Reaction score: 205
Messages: 770

What do y'all think? Has manual installs using the tarballs and bootloader stuff been written up somewhere?

Perhaps here:

 
OP
decuser

decuser

Active Member

Reaction score: 74
Messages: 216

What host is running the VM?

snip...

Is there a manual for all your proposals? Not that I'm aware of, because frankly, what you're proposing is ... silly. In simplistic terms, how are you going to determine what programs are needed? What libraries to include? What parts of the init system are you going to remove, how this will work etc etc. You could do it, but I'm willing to bet a lot of money it will be unusable.

So it all begs the question, what are you trying to achieve?

What host is running the VM? That's an interesting question. Not that it matters, but FreeBSD 8+... or Mac OS El Capitan+... or Windows 8+... or Linux Mint 18+..., Debian 8+, and so on I have used all of these and more and they all run any VM I ask them to. Honestly, I've never seen any significant difference in the 20 or so OSes I've run them on for the 20 or mor OSes I've run on them. Perhaps your experience is different?

I take it you are commenting about the second option... Contrary to your belief, it's definitely not silly, and for exactly the reasons you have given: how am I going to determine what programs are needed? What libraries to include? What parts of the init system am I going to remove, how this will work etc etc. As I stated in the original question, it's a learning exercise. Difficult?, perhaps. Unattainable?, unlikely.
 
OP
decuser

decuser

Active Member

Reaction score: 74
Messages: 216

Perhaps here:


This looks like a great start on what I'm shooting for. getopt's NanoBSD referenced Howto looks promising too. I'll give it a shot this weekend and let you know how it goes.
 

T-Daemon

Daemon

Reaction score: 661
Messages: 1,377

Perhaps here:


You can skip the following steps from the linked posting:
Code:
fetch ftp.freebsd.org/pub/FreeBSD/releases/ISO-IMAGES/11.2/FreeBSD-11.2-RELEASE-amd64-disc1.iso

mkdir mnt
mdconfig -u md0 FreeBSD-11.2-RELEASE-amd64-disc1.iso
mount_cd9660 -o noatime /dev/md0 mnt
cp -R mnt/usr/freebsd-dist/ freebsd-dist
umount mnt/
mdconfig -du md0

Just download from https://download.freebsd.org/ftp/releases/amd64/12.1-RELEASE/ base.txz and kernel.txz. No need to download a whole installation image to extract some dist files.
 
OP
decuser

decuser

Active Member

Reaction score: 74
Messages: 216

You can skip the following steps from the linked posting:
Code:
fetch ftp.freebsd.org/pub/FreeBSD/releases/ISO-IMAGES/11.2/FreeBSD-11.2-RELEASE-amd64-disc1.iso

mkdir mnt
mdconfig -u md0 FreeBSD-11.2-RELEASE-amd64-disc1.iso
mount_cd9660 -o noatime /dev/md0 mnt
cp -R mnt/usr/freebsd-dist/ freebsd-dist
umount mnt/
mdconfig -du md0

Just download from https://download.freebsd.org/ftp/releases/amd64/12.1-RELEASE/ base.txz and kernel.txz. No need to download a whole installation image to extract some dist files.

Yup. I figured. Thanks for the clarification.
 

mark_j

Aspiring Daemon

Reaction score: 484
Messages: 883

What host is running the VM? That's an interesting question. Not that it matters, but FreeBSD 8+... or Mac OS El Capitan+... or Windows 8+... or Linux Mint 18+..., Debian 8+, and so on I have used all of these and more and they all run any VM I ask them to. Honestly, I've never seen any significant difference in the 20 or so OSes I've run them on for the 20 or mor OSes I've run on them. Perhaps your experience is different?

I take it you are commenting about the second option... Contrary to your belief, it's definitely not silly, and for exactly the reasons you have given: how am I going to determine what programs are needed? What libraries to include? What parts of the init system am I going to remove, how this will work etc etc. As I stated in the original question, it's a learning exercise. Difficult?, perhaps. Unattainable?, unlikely.
No I was commenting about the 3rd point but then again, I think you're as confused as I am.
I have nothing more to contribute.
 
OP
decuser

decuser

Active Member

Reaction score: 74
Messages: 216

No I was commenting about the 3rd point but then again, I think you're as confused as I am.
I have nothing more to contribute.

No worries. The other responses were on point. Thanks for trying.
 

ekvz

Well-Known Member

Reaction score: 278
Messages: 431

sysutils/busybox - https://busybox.net/downloads/BusyBox.html (or maybe https://github.com/landley/toybox if you feel a little more adventurous or strictly require BSD licensed code)

At least in theory (i am not all that much into the internals of FreeBSD yet) this should be all you need beyond a bootloader and a kernel. I am not sure how up to date / complete the port is but https://git.busybox.net/busybox/tree/init/init.c#n1237 could be a good start and since busybox is a static executable you don't need any libraries. Well, at least until you add other binaries. Busybox on it's own already supplies a whole lot while taking very little space though. If that suits your requirements i would very much recommend building your own busybox executable customized for your actual needs to trim down even more.
 
Top