Solved How is bsdinstall started

Let me check the script. Is this 12.2-RELEASE? If so, be advised, expected EOL is March 31 2022, better use 12.3-RELEASE.

Also could I drop the isntallerconfig in an mfsbsd.iso and achieve the same results?

Sure, see post #67, but I would would test it first in a VM, make sure it's working as expected, then move it to mfsbsd.
 
Ok testing this out using mfsbsd 13.0. I edited the ISO and added the files and folders. However it has been sitting here for like 10+ min.
1643234510730.png
 
When you say
added the files and folders
I assume
Code:
customfiles/etc/{rc.local, installerconfig}
customfile/usr/freebsd-dist/{kernel.txz, base.txz, src.txz, lib32.txz}

Try without the freebsd-dist files.

Also there are some objections to your installerconfig. See comments in file:
Code:
DISTRIBUTIONS="base.txz lib32.txz kernel.txz src.txz"

########################################
# No need to specify the DISTSITE. It's automatic determined to the
# closest mirror.

#BSDINSTALL_DISTSITE=ftp://ftp.freebsd.org/pub/FreeBSD/releases/amd64/13.0-RELEASE

#PARTITIONS="$DISKSLICE gpt { 3G freebsd-ufs /, 8G freebsd-ufs /usr, 8G freebsd-ufs /var, 10GB freebsd-ufs /home, 4G freebsd-ufs /var/log, 5G freebsd-ufs /opt, 5G freebsd-ufs /tmp, 4G freebsd-swap }"

# for variations in the root disk device name between VMware and Virtualbox
if [ -e /dev/ada0 ]; then
  DISKSLICE=ada0
elif [ -e /dev/da0 ]; then
  DISKSLICE=da0
elif [ -e /dev/vtbd0 ]; then
  DISKSLICE=vtbd0
else
  echo "Unknown disk for install.sh to work with!"
  exit -1
fi
 
export ZFSBOOT_VDEV_TYPE=stripe
export ZFSBOOT_DISKS="$DISKSLICE"
export ZFSBOOT_CONFIRM_LAYOUT=0
 
# Workaround for https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=203777
export nonInteractive="YES"
 
 
#!/bin/sh -x
set -o xtrace
#gpart bootcode -b /boot/pmbr   -p /boot/gptboot -i 1 ada0

#########################################
# All echoed terminal messages are useless. The installation process
# is to fast to read the printed terminal output.

#echo "==> Running installerconfig"
 
ifdev=$(ifconfig | grep '^[a-z]' | cut -d: -f1 | head -n 1)
# Enable required services
cat >> /etc/rc.conf << EOT
ifconfig_${ifdev}="dhcp"
sshd_enable="YES"
ntpd_enable="YES"
ntpd_sync_on_start="YES"
firstboot_freebsd_update_enable="YES"
EOT

########################################
# for firstboot_freebsd_update_enable="YES" see pkg install down below.

# Tune and boot from zfs
cat >> /boot/loader.conf << EOT
vm.kmem_size="200M"
vm.kmem_size_max="200M"
vfs.zfs.arc_max="40M"
vfs.zfs.vdev.cache.size="5M"
autoboot_delay=3
EOT
 
#########################################
# Use for system update sysutils/firstboot-freebsd-update. See pkg install down below.
# Message useless, can't be read.

# Fetch and install binary updates. Ensures we have the latest security fixes.
#echo "==> Running freebsd-update fetch and freebsd-update install"

#########################################
# This section is useless too, since one of the specified distribution files
# is src.txz

# Remove src from update since it's not installed
# See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=198030
#sed -i.bak -e s/Components\ src\ world\ kernel/Components\ world\ kernel/g /etc/freebsd-update.conf

#########################################
# This must get there by accident

#ServerName update.freebsd.org
 
#########################################
# This is dangerous. Remove it or it will render the boot process to stop,
# because in the automatic installation process fstab is populated with
# the swap entry on 12.2 and ESP's mount entry and swap on 13.0:
#
# Device        Mountpoint    FStype    Options        Dump    Pass#
#/dev/ada0p1    /boot/efi    msdosfs    rw        2    2
#/dev/ada0p3    none            swap            sw        0    0

# The statement ZFS doesn't use fstab is wrong.
# zfs doesn't use an fstab, but some rc scripts expect one
#touch /etc/fstab

#########################################
# Message useless, can't be read.

#echo "==> Installing packages"

#########################################
# Because this is a scripted automatic installation no network is configured
# from within the FreeBSD installer as it would have been in a menu guided
# installation.
#
# To install packages from the installerconfig script the FreeBSD installer needs
# the network interface configured first before the script is run.
#
# For this mount the installer medias file system read/write from single user mode,
# edit /etc/rc.conf, add  ifconfig_DEFAULT="DHCP"  .  See rc.conf(5) for the variable.
#
# 'pkg update' is not necessary to be run separately. Running 'pkg install ..' will
# update the local repository catalogue automatic. 'pkg upgrade' is useless,
# there is nothing installed, except pkg, which doesn't need an upgrade, it's
# already the latest package from the specified package repository. Also 'pkg
# autoremove' is unnecessary, there are no any orphaned packages yet.
#
# Alternatively, to install packages see sysutils/firstboot-pkgs.

export ASSUME_ALWAYS_YES=YES

pkg bootstrap -f
pkg install -q bash curl node npm vim-lite wget firstboot-freebsd-update
pkg clean -a

#env ASSUME_ALWAYS_YES=YES pkg update -f
#env ASSUME_ALWAYS_YES=YES pkg upgrade -q -y
#env ASSUME_ALWAYS_YES=YES pkg install -q -y bash curl node npm vim-lite wget
#env ASSUME_ALWAYS_YES=YES pkg autoremove
#env ASSUME_ALWAYS_YES=YES pkg clean -a
 
#########################################
# Message useless, can't be read.

#echo "== Enable root login via ssh"

sed -i.bak -e s/#PermitRootLogin\ no/PermitRootLogin\ without-password/g /etc/ssh/sshd_config
 
## Build date used for motd and product file
BUILDDATE=$(date +%Y%m%d)
RELEASE="13.0-RELEASE"
DOC_URL="https://docs.joyent.com/images/kvm/freebsd"

#########################################
# On 13.0 motd changed to /etc/motd.template
 
# Create MOTD
#echo "Creating /etc/motd"
mv /etc/motd.template /etc/motd.template-backup
cat << MOTD > /etc/motd.template
Something here
MOTD
 
# Create product file
echo "Creating /etc/product file"
cat << PRODUCT > /etc/product
Name: Meyer Instance
Image: FreeBSD $RELEASE $BUILDDATE
Documentation: $DOC_URL
Description: FreeBSD $RELEASE 64-bit image with just essential packages \
installed. Ideal for users who are comfortable with setting up their \
own environment and tools.
PRODUCT

#########################################
# Not sure where you found those. They are all useless.

#echo "Cleaning up"
#rm -rf /tmp/installscript
#rm -rf /var/db/freebsd-update/*
#rm -rf /tmp/freebsd-update.conf
#rm -rf /boot/kernel/*.symbols
 
#echo "End of installerconfig"

#########################################
# On 13.0 due to a bug no EFI loader is installed in the ESP on UEFI systems,
# Root-on-ZFS installerconfig installations.
#
# See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=255824
# https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=255081
#
# There seems to be a regression on the committed fix.  stable/13 (20211223)
# fails to copy efi loader to the ESP, no UEFI boot entry is created and 14.0-CURRENT
# fails to unmount /mnt where the new system is mounted, therefore fails to reboot,
# also no UEFI entry is created.
#
# This is a workaround for 13.0-RELEASE. If this script is targeted for different firmware
# systems (BIOS, UEFI) and changing device names (adaX, daX, vtbdX) it needs some coding.

mount_msdosfs /dev/ada0p1 /boot/efi
mkdir -p /boot/efi/efi/boot
cp /boot/loader.efi /boot/efi/efi/boot/bootx64.efi
umount /boot/efi

# Create UEFI boot entry

efibootmgr -c -a -L FreeBSD -l ada0p1:/efi/boot/bootx64.efi

reboot
 
Top