mmatuska/mfsbsd

Steps to make the mini (27MB) iso?

Closed this issue · 11 comments

Hello,

I am trying to learn my way through building the "mini" (about 27MB) mfsBSD (64-bit AMD) for FeeBSD RELEASE 12.1 and came across these instructions:

https://hashbang0.com/2019/02/07/setting-up-mfsbsd-for-receiving-zfs-snapshots-on-systems-with-low-memory/


root@bil-bsd # cd /var/tmp

Fetch the FreeBSD ISO

root@bil-bsd # fetch https://download.freebsd.org/ftp/releases/ISO-IMAGES/12.1/FreeBSD-12.1-RELEASE-amd64-disc1.iso

Mount the ISO

root@bil-bsd # mdconfig -a -t vnode -u 10 -f /var/tmp/FreeBSD-12.1-RELEASE-amd64-disc1.iso
root@bil-bsd # mount_cd9660 /dev/md10 /mnt/

Clone the mfsbsd repo

root@bil-bsd # git clone https://github.com/mmatuska/mfsbsd.git
root@bil-bsd # cd mfsbsd

root@bil-bsd # cd conf
root@bil-bsd # cp loader.conf.sample loader.conf
root@bil-bsd # cat << EOF >> loader.conf
vm.kmem_size="330M"
vm.kmem_size_max="330M"
vfs.zfs.arc_max="40M"
vfs.zfs.vdev.cache.size="5M"
EOF

root@bil-bsd # cd ..
root@bil-bsd # make iso BASE=/mnt/usr/freebsd-dist RELEASE=12.1-RELEASE


The catch is that they do not seem to be for the mini distro, but for the full mfsBSD distro.

The current pre-built mini edition on the Project home page (https://mfsbsd.vx.sk/) seem to have a problem with my builtin Broadcom wireless and gets stuck in an "Error 5" loop so I want to try and be able to build a new "mini" with the proper module for the Boradcom wireless, or find a way that it will over-step that part and continue to boot up since the booting process does not complete right now on my real hardware.

What is the step call in the "make iso ..." above to produce the mini iso (27 MB)?

Do I call it from the main directory or from within the "mini" sub-directory?
Thanks

Any help would be apprecited

You need to call make iso from the mini sub-directory

Thanks, but I actually tried that and got an error:


root@vmi206647 /var/tmp/mfsbsd/mini]# make iso BASE=/mnt/usr/freebsd-dist RELEASE=12.1-RELEASE

Creating directory hierarchy ...mtree: /var/tmp/mfsbsd/mini/../work/mfs/rw/etc/mtree/BSD.root.dist: No such file or directory
*** Error code 1


Everything is mounted exactly the same as when I as able to build the 90MB image from the higher directory.

NOTE: I did not setup and configuration files as I want to initially recreate your 27MB Mini iso.

If you could please share with me the steps that you use to make the "mini" then I would greatly appreciate it.

Cheers

You need to run a make extract in the parent directory first.

Sorry to have trouble on this but it did not seem to work.

I did:

[root@vmi206647 /var/tmp/mfsbsd]# make extract

[root@vmi206647 /var/tmp/mfsbsd]# cd mini

[root@vmi206647 /var/tmp/mfsbsd/mini]# make iso BASE=/mnt/usr/freebsd-dist RELEASE=12.1-RELEASE

Creating directory hierarchy ...mtree: /var/tmp/mfsbsd/mini/../work/mfs/rw/etc/mtree/BSD.root.dist: No such file or directory
*** Error code 1

Stop.
make: stopped in /var/tmp/mfsbsd/mini


I am sure that it has something to do with the "make extract" not being complete as I do not see any documentation on the site regarding its use.

Cheers

Sorry if the posts make larger and bold fonts as I just copied and pasted from my terminal and have no idea how to keep all of the fonts the same when posting on github.

Hi,

Just has a little success.

I started by performing

"make clean" in the mfsbsd directory
"cd mini"
"

but now I get the errors:

======================

[root@vmi206647 /var/tmp/mfsbsd]# make clean

[root@vmi206647 /var/tmp/mfsbsd]# make extract BASE=/mnt/usr/freebsd-dist
Extracting base and kernel ... done

[root@vmi206647 /var/tmp/mfsbsd]# cd mini/

[root@vmi206647 /var/tmp/mfsbsd/mini]# make iso BASE=/mnt/usr/freebsd-dist RELEASE=12.1-RELEASE
Creating directory hierarchy ... done
Installing rescue with linking script ... done
Installing base files ... done
Creating tar of base libraries and binaries ... done
Creating local files tar ...tar: bin/cpdup: Cannot stat: No such file or directory
tar: bin/dbclient: Cannot stat: No such file or directory
tar: bin/dropbearconvert: Cannot stat: No such file or directory
tar: bin/dropbearkey: Cannot stat: No such file or directory
tar: bin/ipmitool: Cannot stat: No such file or directory
tar: bin/rsync: Cannot stat: No such file or directory
tar: bin/nano: Cannot stat: No such file or directory
tar: bin/tmux: Cannot stat: No such file or directory
tar: lib/libevent-2.1.so*: Cannot stat: No such file or directory
tar: lib/libiconv.so.: Cannot stat: No such file or directory
tar: lib/libintl.so.
: Cannot stat: No such file or directory
tar: lib/libreadline.so.: Cannot stat: No such file or directory
tar: lib/libutf8proc.so.
: Cannot stat: No such file or directory
tar: sbin/dropbear: Cannot stat: No such file or directory
tar: sbin/dmidecode: Cannot stat: No such file or directory
tar: Error exit delayed from previous errors.
*** Error code 1

======================

Would it be possible if you were to post your configuration files or other required files that you use to make the

12.1-RELEASE-amd64 mini edition (27MB)

Any ideas from here?
Thanks

I have to rework this to be reproducible. You need to locally install all the required packages like dropbear, ipmitool, rsync, nano, tmux, etc. to your LOCALBASE first (e.g. with pkg or ports).

Thanks, I'm working on it now to see if I can get it to come together.

If would be able to do a step-be-step procedure to reproduce your mini mfsBSD (64-bit) ISO then that would really be helpful since the size is perfect but just need to see about getting it to work past the SCSI problem that I also reported and I would also like to add Bhyve, but that seems to be installed in the normal FreeBSD by default, but not in your mfsBSD.

By the way, I think that mfsBSD is really AWESOME and perfect for what I am trying to accomplish. It will get take some time to work through all of the steps to get there.

Thanks for a great distro.

Martin,

I think that I have solved it.

Steps to generate the mini mfsBSD (27 MB) ISO


In the "mfsBSD" directory:

$ make clean

$ make extract BASE=/mnt/usr/freebsd-dist RELEASE=12.1-RELEASE

$ make prepare-mini

$ cd mini

$ make iso BASE=/mnt/usr/freebsd-dist RELEASE=12.1-RELEASE


Wow, that was a challenge, but now at least, I can generate the mini mfsBSD ISO.

Can you please now help me to figure out the SCSI problem that I reported in the other thread?
Cheers