Solved How is bsdinstall started

Still getting the same error after reducing the freebsd-dist to those three files.

bsderr.png
 
There's definitely something different going on but I haven't pinned it down yet:

Code:
~/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
 
Last edited by a moderator:
Looks like for whatever reason my `Makefile` was using `CUSTOMFILESDIR ?= customfiles` - which is where it was trying to grab `User files` from (the MANIFEST and .txz's) - I changed the line to `CUSTOMFILESDIR?=${BASE}` and it grabbed them.
 
Code:
-rw-r--r--  1 root  wheel  281952256  8 Jun 16:00 mfsbsd-12.2-RELEASE-p7-amd64.iso
Note the image size.
My file size is now closer to yours, but still not the same: 287772672.

My build output is:
Code:
~/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
 
Definitely getting there - looks like it's dumping the contents of the `freebsd13-dist` (`CUSTOMFILESDIR`/`BASE`) into `/` instead of `/usr/freebsd-dist` where it belongs, so I think that's user error on my part - still not sure what to make of the `CUSTOMFILESDIR`/`BASE` pieces but it's workable.
 
I changed the line to `CUSTOMFILESDIR?=${BASE}` and it grabbed them.
looks like it's dumping the contents of the `freebsd13-dist` (`CUSTOMFILESDIR`/`BASE`) into `/` instead of `/usr/freebsd-dist` where it belongs
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 the customfiles code from the 'Makefile' (see lines 454 - 461).

With the CUSTOMFILESDIR?= ${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:
Code:
CUSTOMFILESDIR?=        customfiles
and create customfiles/usr/freebsd-dist dir in the 'mfsbsd' directory.

My file size is now closer to yours, but still not the same: 287772672.
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.
 
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 the customfiles code from the 'Makefile' (see lines 454 - 461).

With the CUSTOMFILESDIR?= ${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:
Code:
CUSTOMFILESDIR?=        customfiles
and create customfiles/usr/freebsd-dist dir in the 'mfsbsd' directory.


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.
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.)

Also changed my build command to:
make iso BASE=/root/mfsbsd/customfiles/usr/freebsd-dist RELEASE=13.0-RELEASE ARCH=amd64
(I know root is bad, but I'm bootstrapping an LDAP-based network and don't want artifacts from users created along the way hanging around, haven't gotten the LDAP server functioning correctly yet since switching from CentOS.)

Current output is:

Code:
~/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.

Have you tried 13.0-RELEASE?

I wasn't even able to PXE boot that version of the ISO. In fact it crashes at the loader prompt with a msg saying

BIOS CD is cd0

Maybe the format of the ISO has changed... I've always just copied the ISO to my PXE server repository and it has worked without any problem.
 
Have you tried 13.0-RELEASE?
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.

CoryG's mfsbsd 13.0-RELEASE image seems to PXE-boot just fine, see post #58.

Is this a normal image or a minimal edition? You asked in another thread how to include mount_nfs(8) to a minimal edition?
 
Do you have a full write up on this somewhere? I'm trying to achieve this with cobbler. I was able to get the mfsbsd.iso to boot. But I don't know how to trigger a installation script. Also i'm still trying 12.2 since that is what cobbler supports currently.
 
I was able to get the mfsbsd.iso to boot. But I don't know how to trigger a installation script.
You can trigger a automatic installation by creating file /etc/installerconfig. See bsdinstall(8) SCRIPTING.

If that file is present and functional it will override the menu guided FreeBSD installer and start a automatic installation (see /etc/rc.local on installation media or /usr/src/release/rc.local).
 
Getting this erro when trying to run bsdinstall -D name-of-file auto autopart
Why are you running the auto target?

The auto target runs "the standard interactive installation, including disk partitioning". Didn't you say you wanted to perform a scripted installation?

There seems to be a misunderstanding.

I assume you want to boot the image and let it install the new system automatically without interaction. To achieve this, the /etc/installerconfig itself can be used, or pointed from there to another script.

I suggested in my previous post to look in the SCRIPTING section of bsdinstall(8). There are examples how a bsdinstall script should look.

Taking the error message from the image, you are trying to install the system on ZFS. There is an example for it how to set the options:
Code:
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
Addition options can be found under ENVIRONMENT VARIABLES. For ZFS obviously those with ZFSBOOT_* in name.

I suggest you create a VM ( it might be already the case from the look of the image you posted). There it's much easier to test the installation script. One other suggestion (this works with normal memstick installer images, not with mfsbsd or ISO images) : When testing in a VM, don't reboot the machine. That takes to long. Drop to single user mode by executing 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.

To avoid setting the file system repeatedly read/write, set in /etc/fstab to rw (it's ro by default) and edit the script in multi-user mode.
 
Last edited:
Hi,
So I was running it in a VM. One that I didn't care about. I guess i'm a little confused on getting this working as well. Does this file get generated upon install? I'm coming from a Redhat environment. I've manged to get Ubuntu working for PXE boot install. I'm managed to find some cloud-init isntall scripts. Could those be used as well?
 
Does this file get generated upon install?
No, the /etc/installerconfig file needs to be created manually by a user.

I'm managed to find some cloud-init isntall scripts. Could those be used as well?
Without seeing those I can't tell.

To resolve the current situation, let's start creating a working /etc/installerconfig file in a VM with a normal installer. The mfsbsd image is not particularly suitable for this task. It needs to be rebuild each time the file is modified, which extends the testing process time.

The following is a example for VirtualBox. Similar can be proceed with other virtualization software.
Code:
% VBoxManage convertdd FreeBSD-13.0-RELEASE-amd64-memstick.img FreeBSD-13.0-RELEASE-amd64-memstick.vdi

Create VM, add installer VDI disk to VM, boot installer into single user-mode, mount file system read/write ( 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.

Execute shutdown now (this will drop the system into single-user mode), then exit. The automatic installation starts. Eventually re-edit installerconfig.

After you are satisfied with the result, copy and integrate the installerconfig file in mfsbsd.

Three components are necessary to create from the mfsbsd image a automatic FreeBSD installer.
  1. The /etc/installerconfig file
  2. The FreeBSD installer images /etc/rc.local file
  3. The FreeBSD distribution sets under /usr/freebsd-dist, minimum base.txz, kernel.txz and MANIFEST. Additional sets can be added (kernel-dbg.txz, lib32.txz, ports.txz, src.txz, tests.tx)
The last two components can be extracted from the normal installer image.

Create under the mfsbsd root directory following directories:
Code:
customfiles/etc
customfiles/usr/freebsd-dist

Place files under the appropriate directories:
Code:
customfiles/etc/installerconfig
customfiles/etc/rc.local
customfiles/usr/freebsd-dist/{base.txz, kernel.txz, MANIFEST}

Make sure to increase the 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.
 
Last edited:
You need to use a memstick FreeBSD installer image [1] to mount its file system read/write.

[1] Installer images with the .img suffix, i.e FreeBSD-13.0-RELEASE-amd64-memstick.img

Optical disks like DVD's, CD's can't be mounted write.
 
Ok I think I know what needs to be added to the /etc/installerconfig but want to make sure i'm correct.

filesystem layout?

1643165662113.png
 
No, there is no need to set a file system layout. The layout will be taken care of automatically by the environment variables set in /etc/installerconfig.

Please post your installerconfig file.
 
I took from other examples I found while searching. I have not fully tested this yet. Trying to convert the vmdk back to an ISO which is proving to be a big mistake...
Bash:
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
 
Back
Top