~/mfsbsd # make iso BASE=/root/freebsd13-dist
Extracting base and kernel ... done
Removing selected files from distribution ... done
Installing configuration scripts and files ... done
Generating SSH host keys ... done
Configuring boot environment ...x ./
x ./kernel
x ./linker.hints
done
Installing pkgng ... done
Installing user packages ...
Updating FreeBSD repository catalogue...
Fetching meta.conf: 100% 163 B 0.2kB/s 00:01
Fetching packagesite.txz: 100% 6 MiB 3.3MB/s 00:02
Processing entries: 100%
FreeBSD repository update completed. 30368 packages processed.
All repositories are up to date.
The following 17 package(s) will be affected (of 0 checked):
New packages to be INSTALLED:
cpdup: 1.22
dmidecode: 3.3
gettext-runtime: 0.21
indexinfo: 0.3.1
ipmitool: 1.8.18_3
libevent: 2.1.12
libiconv: 1.16
liblz4: 1.9.3,1
nano: 5.5
perl5: 5.32.1_1
readline: 8.1.0
rsync: 3.2.3
smartmontools: 7.2_1
tmux: 3.1c
utf8proc: 2.6.1
xxhash: 0.8.0
zstd: 1.4.8
Number of packages to be installed: 17
The process will require 78 MiB more space.
19 MiB to be downloaded.
[1/17] Fetching cpdup-1.22.txz: 100% 28 KiB 28.9kB/s 00:01
[2/17] Fetching dmidecode-3.3.txz: 100% 66 KiB 67.5kB/s 00:01
[3/17] Fetching indexinfo-0.3.1.txz: 100% 6 KiB 5.7kB/s 00:01
[4/17] Fetching ipmitool-1.8.18_3.txz: 100% 392 KiB 401.0kB/s 00:01
[5/17] Fetching libevent-2.1.12.txz: 100% 322 KiB 329.3kB/s 00:01
[6/17] Fetching libiconv-1.16.txz: 100% 606 KiB 620.2kB/s 00:01
[7/17] Fetching nano-5.5.txz: 100% 542 KiB 554.8kB/s 00:01
[8/17] Fetching readline-8.1.0.txz: 100% 361 KiB 369.5kB/s 00:01
[9/17] Fetching rsync-3.2.3.txz: 100% 355 KiB 363.2kB/s 00:01
[10/17] Fetching smartmontools-7.2_1.txz: 100% 470 KiB 481.3kB/s 00:01
[11/17] Fetching tmux-3.1c.txz: 100% 320 KiB 327.4kB/s 00:01
[12/17] Fetching utf8proc-2.6.1.txz: 100% 64 KiB 65.2kB/s 00:01
[13/17] Fetching gettext-runtime-0.21.txz: 100% 166 KiB 169.8kB/s 00:01
[14/17] Fetching xxhash-0.8.0.txz: 100% 73 KiB 75.1kB/s 00:01
[15/17] Fetching zstd-1.4.8.txz: 100% 489 KiB 501.2kB/s 00:01
[16/17] Fetching liblz4-1.9.3,1.txz: 100% 131 KiB 134.6kB/s 00:01
[17/17] Fetching perl5-5.32.1_1.txz: 100% 14 MiB 5.0MB/s 00:03
Checking integrity... done (0 conflicting)
[1/17] Installing indexinfo-0.3.1...
[1/17] Extracting indexinfo-0.3.1: 100%
[2/17] Installing liblz4-1.9.3,1...
[2/17] Extracting liblz4-1.9.3,1: 100%
[3/17] Installing libevent-2.1.12...
[3/17] Extracting libevent-2.1.12: 100%
[4/17] Installing libiconv-1.16...
[4/17] Extracting libiconv-1.16: 100%
[5/17] Installing readline-8.1.0...
[5/17] Extracting readline-8.1.0: 100%
[6/17] Installing gettext-runtime-0.21...
[6/17] Extracting gettext-runtime-0.21: 100%
[7/17] Installing xxhash-0.8.0...
[7/17] Extracting xxhash-0.8.0: 100%
[8/17] Installing zstd-1.4.8...
[8/17] Extracting zstd-1.4.8: 100%
[9/17] Installing perl5-5.32.1_1...
[9/17] Extracting perl5-5.32.1_1: 100%
[10/17] Installing cpdup-1.22...
[10/17] Extracting cpdup-1.22: 100%
[11/17] Installing dmidecode-3.3...
[11/17] Extracting dmidecode-3.3: 100%
[12/17] Installing ipmitool-1.8.18_3...
[12/17] Extracting ipmitool-1.8.18_3: 100%
[13/17] Installing nano-5.5...
[13/17] Extracting nano-5.5: 100%
[14/17] Installing rsync-3.2.3...
[14/17] Extracting rsync-3.2.3: 100%
[15/17] Installing smartmontools-7.2_1...
[15/17] Extracting smartmontools-7.2_1: 100%
[16/17] Installing tmux-3.1c...
[16/17] Extracting tmux-3.1c: 100%
[17/17] Installing utf8proc-2.6.1...
[17/17] Extracting utf8proc-2.6.1: 100%
=====
Message from smartmontools-7.2_1:
--
smartmontools has been installed
To check the status of drives, use the following:
/usr/local/sbin/smartctl -a /dev/ad0 for first ATA/SATA drive
/usr/local/sbin/smartctl -a /dev/da0 for first SCSI drive
/usr/local/sbin/smartctl -a /dev/ada0 for first SATA drive
To include drive health information in your daily status reports,
add a line like the following to /etc/periodic.conf:
daily_status_smart_devices="/dev/ad0 /dev/da0"
substituting the appropriate device names for your SMART-capable disks.
To enable drive monitoring, you can use /usr/local/sbin/smartd.
A sample configuration file has been installed as
/usr/local/etc/smartd.conf.sample
Copy this file to /usr/local/etc/smartd.conf and edit appropriately
To have smartd start at boot
echo 'smartd_enable="YES"' >> /etc/rc.conf
--- % 21.4 MiB / 84.3 MiB = 0.254 2.0 MiB/s 0:41
*** Signal 2
My file size is now closer to yours, but still not the same: 287772672.Note the image size.Code:-rw-r--r-- 1 root wheel 281952256 8 Jun 16:00 mfsbsd-12.2-RELEASE-p7-amd64.iso
~/mfsbsd # make iso BASE=/root/freebsd13-dist
Extracting base and kernel ... done
Removing selected files from distribution ... done
Installing configuration scripts and files ... done
Generating SSH host keys ... done
Copying user files ...
/root/freebsd13-dist/ -> /root/mfsbsd/work/mfs/rw
/root/freebsd13-dist/MANIFEST -> /root/mfsbsd/work/mfs/rw/MANIFEST
/root/freebsd13-dist/base.txz -> /root/mfsbsd/work/mfs/rw/base.txz
/root/freebsd13-dist/kernel.txz -> /root/mfsbsd/work/mfs/rw/kernel.txz
done
Configuring boot environment ...x ./
x ./kernel
x ./linker.hints
done
Installing pkgng ... done
Installing user packages ...
100 % 258.8 MiB / 424.1 MiB = 0.610 2.3 MiB/s 3:06
done
echo roothack.full: /usr/lib/libc.a >> .depend
cc -O2 -pipe -g -MD -MF.depend.roothack.o -MTroothack.o -std=gnu99 -Wno-format-zero-length -nobuiltininc -idirafter /usr/lib/clang/11.0.1/include -fstack-protector-strong -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -Wmissing-variable-declarations -Wthread-safety -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Qunused-arguments -c /root/mfsbsd/tools/roothack/roothack.c -o roothack.o
cc -O2 -pipe -g -std=gnu99 -Wno-format-zero-length -nobuiltininc -idirafter /usr/lib/clang/11.0.1/include -fstack-protector-strong -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -Wmissing-variable-declarations -Wthread-safety -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Qunused-arguments -static -o roothack.full roothack.o -larchive -lbz2 -lz -llzma -lcrypto -lbsdxml -lmd -lprivatezstd
objcopy --only-keep-debug roothack.full roothack.debug
objcopy --strip-debug --add-gnu-debuglink=roothack.debug roothack.full roothack
Installing roothack ... done
Creating and compressing mfsroot ... done
Creating ISO image ... done
-rw-r--r-- 1 root wheel 287772672 Jun 9 02:41 mfsbsd-13.0-RELEASE-amd64.iso
I changed the line to `CUSTOMFILESDIR?=${BASE}` and it grabbed them.
For those distribution files to be placed in /usr/freebsd-dist on the image, that directory needs to be created first in the work subdirectory. This is done by thelooks like it's dumping the contents of the `freebsd13-dist` (`CUSTOMFILESDIR`/`BASE`) into `/` instead of `/usr/freebsd-dist` where it belongs
customfiles
code from the 'Makefile' (see lines 454 - 461).CUSTOMFILESDIR?= ${BASE}
setting you need to create a /root/freebsd13-dist/usr/freebsd-dist directory and put there the distribution sets (base, kernel, etc).CUSTOMFILESDIR?= customfiles
It doesn't have to be the same, yours is 13.0-RELEASE, mine 12.2-RELEASE, there will be a difference in size.My file size is now closer to yours, but still not the same: 287772672.
I agree I over-complicated it a bit for the directory structure, I'll try your solution there to clean it up a bit - still running into some oddities but I got it passed the installer, now it seems to dislike booting post-installation via GPT on a 27TB drive - not sure if this is because the installer did something off or if it's due to the large RAID 6 drive. I also took your advice on the packages.sample file (actually, moments after posting the output and realizing how massively off it was, then re-reading the thread more closely.)For those distribution files to be placed in /usr/freebsd-dist on the image, that directory needs to be created first in the work subdirectory. This is done by thecustomfiles
code from the 'Makefile' (see lines 454 - 461).
With theCUSTOMFILESDIR?= ${BASE}
setting you need to create a /root/freebsd13-dist/usr/freebsd-dist directory and put there the distribution sets (base, kernel, etc).
You are making things unnecessarily complicated, why deviate from the default setting here?
Or create the above mentioned directory or revert in the 'Makefile' the custom files dir to original state:
and create customfiles/usr/freebsd-dist dir in the 'mfsbsd' directory.Code:CUSTOMFILESDIR?= customfiles
It doesn't have to be the same, yours is 13.0-RELEASE, mine 12.2-RELEASE, there will be a difference in size.
I see from your post #52 there are packages installed to be included to the image. If you don't need them, since this will be a FreeBSD installer image, rename tools/packages.sample. By renaming that file no package will be included to the image.
~/mfsbsd # make iso BASE=/root/mfsbsd/customfiles/usr/freebsd-dist RELEASE=13.0-RELEASE ARCH=amd64
Extracting base and kernel ... done
Removing selected files from distribution ... done
Installing configuration scripts and files ... done
Generating SSH host keys ... done
Copying user files ...
customfiles/ -> /root/mfsbsd/work/mfs/rw
customfiles/usr -> /root/mfsbsd/work/mfs/rw/usr
customfiles/usr/freebsd-dist -> /root/mfsbsd/work/mfs/rw/usr/freebsd-dist
customfiles/usr/freebsd-dist/MANIFEST -> /root/mfsbsd/work/mfs/rw/usr/freebsd-dist/MANIFEST
customfiles/usr/freebsd-dist/base.txz -> /root/mfsbsd/work/mfs/rw/usr/freebsd-dist/base.txz
customfiles/usr/freebsd-dist/kernel.txz -> /root/mfsbsd/work/mfs/rw/usr/freebsd-dist/kernel.txz
done
Configuring boot environment ...x ./
x ./kernel
x ./linker.hints
done
Installing pkgng ... done
Installing user packages ...
100 % 258.8 MiB / 424.1 MiB = 0.610 2.4 MiB/s 2:56
done
echo roothack.full: /usr/lib/libc.a >> .depend
cc -O2 -pipe -g -MD -MF.depend.roothack.o -MTroothack.o -std=gnu99 -Wno-format-zero-length -nobuiltininc -idirafter /usr/lib/clang/11.0.1/include -fstack-protector-strong -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -Wmissing-variable-declarations -Wthread-safety -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Qunused-arguments -c /root/mfsbsd/tools/roothack/roothack.c -o roothack.o
cc -O2 -pipe -g -std=gnu99 -Wno-format-zero-length -nobuiltininc -idirafter /usr/lib/clang/11.0.1/include -fstack-protector-strong -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -Wmissing-variable-declarations -Wthread-safety -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Qunused-arguments -static -o roothack.full roothack.o -larchive -lbz2 -lz -llzma -lcrypto -lbsdxml -lmd -lprivatezstd
objcopy --only-keep-debug roothack.full roothack.debug
objcopy --strip-debug --add-gnu-debuglink=roothack.debug roothack.full roothack
Installing roothack ... done
Creating and compressing mfsroot ... done
Creating ISO image ... done
-rw-r--r-- 1 root wheel 287772672 Jun 9 21:01 mfsbsd-13.0-RELEASE-amd64.iso
It doesn't have to be the same, yours is 13.0-RELEASE, mine 12.2-RELEASE, there will be a difference in size.
BIOS CD is cd0
Sorry, I can't test the mfsbsd images in a PXE, I just build them out of curiosity but don't use them. At most I can test the ISO images in VirtualBox.Have you tried 13.0-RELEASE?
It was this one:-Is this a normal image or a minimal edition? You asked in another thread how to include mount_nfs(8) to a minimal edition?
You can trigger a automatic installation by creating file /etc/installerconfig. See bsdinstall(8) SCRIPTING.I was able to get the mfsbsd.iso to boot. But I don't know how to trigger a installation script.
Why are you running theGetting this erro when trying to run bsdinstall -D name-of-file auto autopart
auto
target?auto
target runs "the standard interactive installation, including disk partitioning". Didn't you say you wanted to perform a scripted installation?For a ZFS scripted installation, the script looks like this:
DISTRIBUTIONS="kernel.txz base.txz"
export ZFSBOOT_VDEV_TYPE=stripe
export ZFSBOOT_DISKS=ada0
export nonInteractive="YES"
#!/bin/sh
# I modified this part to update to current practice
sysrc ifconfig_em0=DHCP
sysrc sshd_enable=YES
shutdown now
. From there mount the file system read/write, edit the script, then boot the system to multi-user, to execute the script again. If the script fails or you want try other options, repeat steps.rw
(it's ro
by default) and edit the script in multi-user mode.No, the /etc/installerconfig file needs to be created manually by a user.Does this file get generated upon install?
Without seeing those I can't tell.I'm managed to find some cloud-init isntall scripts. Could those be used as well?
% VBoxManage convertdd FreeBSD-13.0-RELEASE-amd64-memstick.img FreeBSD-13.0-RELEASE-amd64-memstick.vdi
mount -uw /
), edit /etc/fstab, change root from ro to rw, boot into multi-user mode, drop to "Shell" at the installer menu dialog, create and edit /etc/installerconfig. Example configuration see post #65. shutdown now
(this will drop the system into single-user mode), then exit
. The automatic installation starts. Eventually re-edit installerconfig.customfiles/etc
customfiles/usr/freebsd-dist
customfiles/etc/installerconfig
customfiles/etc/rc.local
customfiles/usr/freebsd-dist/{base.txz, kernel.txz, MANIFEST}
MFSROOT_MAXSIZE?=
in the Makefile to fit the distribution sets and rename tools/packages.sample to disable it (there is no need to install those packages for an automatic system installer), build ISO.I couldn't remount the DVD install to rw when in single user mode.
cd9660
, this is expected.Genius, thanks @T-Daemon. I would never have guessed that it's a different file system.
ufs
.DISTRIBUTIONS="base.txz lib32.txz kernel.txz src.txz"
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
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"
EOT
# 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
# Fetch and install binary updates. Ensures we have the latest security fixes.
echo "==> Running freebsd-update fetch and freebsd-update install"
# 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
ServerName update.freebsd.org
# zfs doesn't use an fstab, but some rc scripts expect one
touch /etc/fstab
echo "==> Installing packages"
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
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"
# Create MOTD
echo "Creating /etc/motd"
mv /etc/motd /etc/motd-backup
cat << MOTD > /etc/motd
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
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"
reboot