Hi guys. I must admit I am starting to lose it
I have been investigating FreeBSD internals the last week and it really looks like magic to me. First thing I want to state my objectives. I want to build a sort of live/ro/non tamperable installation of FreeBSD. I have investigated NomadBSD to this end and "the magic" has confused me even more.
By reading the handbook, absolute freebsd and the design and implementation of the freebsd os, I have started to understand a bit how it works. So it all starts with Bootx64.efi in the efi partition ( I have uefi ). Then it loads loader.efi. Loader.efi starts the kernel.
But, for it to work ( except in the standard case ) you should set vfs.root.mountfrom variable. But it isn't set in the livecd, nor in the nomadbsd images. So, I suppose the first part is "standard". It just loads /boot/kernel/kernel which, in turn, mounts the "current" freebsd-ufs partition as root filesystem. Then nomadbsd does some things with an image called /uzip/usr.local.uzip and unionfs. The problem is I cannot find where the mounting of the uzip image and of the unionfs happens.
The same goes for the freebsd livecd. It mounts the iso readonly. Ok, that is simple. But to boot, it needs a read-write overlay. Right? Where and when it mounts this overlay? I have watched in /boot. Nothing. I have watched in /etc/rc.d. Nothing. But there must be some script running at some point to mount the rw layer.
Also, what do you think is a good way to reach my objective of having a stateless system image + rw overlay in ram? Maybe just mount the root partition ro? Or maybe is it better to use an uzip image with md?
p.s. why the iso only has 2 partitions, one uefi and the other freebsd-boot? Shouldn't be a freebsd-ufs partition too, with the root fs on it? Instead the "root fileystem" is the entire image. I can access it by mounting the image as cd9660.
I have been investigating FreeBSD internals the last week and it really looks like magic to me. First thing I want to state my objectives. I want to build a sort of live/ro/non tamperable installation of FreeBSD. I have investigated NomadBSD to this end and "the magic" has confused me even more.
By reading the handbook, absolute freebsd and the design and implementation of the freebsd os, I have started to understand a bit how it works. So it all starts with Bootx64.efi in the efi partition ( I have uefi ). Then it loads loader.efi. Loader.efi starts the kernel.
But, for it to work ( except in the standard case ) you should set vfs.root.mountfrom variable. But it isn't set in the livecd, nor in the nomadbsd images. So, I suppose the first part is "standard". It just loads /boot/kernel/kernel which, in turn, mounts the "current" freebsd-ufs partition as root filesystem. Then nomadbsd does some things with an image called /uzip/usr.local.uzip and unionfs. The problem is I cannot find where the mounting of the uzip image and of the unionfs happens.
The same goes for the freebsd livecd. It mounts the iso readonly. Ok, that is simple. But to boot, it needs a read-write overlay. Right? Where and when it mounts this overlay? I have watched in /boot. Nothing. I have watched in /etc/rc.d. Nothing. But there must be some script running at some point to mount the rw layer.
Also, what do you think is a good way to reach my objective of having a stateless system image + rw overlay in ram? Maybe just mount the root partition ro? Or maybe is it better to use an uzip image with md?
p.s. why the iso only has 2 partitions, one uefi and the other freebsd-boot? Shouldn't be a freebsd-ufs partition too, with the root fs on it? Instead the "root fileystem" is the entire image. I can access it by mounting the image as cd9660.