touch /firstboot
. This is the trigger for those scripts, if that file exists the scripts are run and the firstboot file is removed afterwards.No, they both need to be set. The firstboot_pkgs_enable is to ensure the rc(8) script is executed but the script is only functional if the /firstboot file exists. This file is removed after the first boot. On consecutive boots the script is still active and started (due to the *_enable in rc.conf) but won't do anything because the /firstboot file doesn't exist anymore.it says to set 'firstboot_pkgs_enable="YES" so is that an alternative totouch /firstboot
or in addition to?
touch /firstboot
sysrc firstboot_pkgs_enable=YES
echo 'firstboot_pkgs_list="apache24"' >>/etc/rc.conf
cp firstboot_pkgs /etc/rc.d
Don't copy this, if you install the port or package the script is already in /usr/local/etc/rc.d/.Code:cp firstboot_pkgs /etc/rc.d
Steps to install www/apache24 on first boot...
Is this more or less it? Are any changes to sysutils/firstboot-pkgs required?Code:touch /firstboot sysrc firstboot_pkgs_enable=YES echo 'firstboot_pkgs_list="apache24"' >>/etc/rc.conf cp firstboot_pkgs /etc/rc.d
touch /firstboot
sysrc firstboot_pkgs_enable=YES
echo 'firstboot_pkgs_list="apache24"' >>/etc/rc.conf
cp firstboot_pkgs /etc/rc.d
pkg
has even been installed. It looks like I need something like pkg bootstrap
first but that always causes a prompt which I'm trying to avoid as this is meant to be an automated process.cp firstboot_pkgs /etc/rc.d
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf (in the disk
# image, since this only runs on the first boot) to enable this:
#
# firstboot_pkgs_enable="YES"
#
# and place a list of packages in firstboot_pkgs_list, e.g.,
#
# firstboot_pkgs_list="apache22 php5 mysql56-server"
Obviously, this port is not useful after a system is already running; it is
intended to be included as part of the installation or disk image building
process.
Unattended package installing could be tough because of pkg prompts (Y)
Let us know how you make out.
First off I would start with something small with few dependencies. Get a hang for how it works.
touch /mnt/firstboot
cat <<EOF >> /mnt/etc/rc.d/firstboot
env ASSUME_ALWAYS_YES=YES pkg bootstrap
pkg install -y mc
EOF
That will actually install mc every time you boot the system.
rm /etc/rc.d/firstboot
as the last command in the script, although I'm not sure if you can delete a script which is currently running...The script would be invoked every time regardless if the sentinel exists or not, because there's nothing limiting it to the firstboot only. See rc(8).The script itself - /etc/rc.d/firstboot remains but will not get invoked because the sentinel file no longer exists.
pkg install sysutils/firstboot-pkgs
before the first boot!!!