Page MenuHomeFreeBSD

Add pkg_bootstrap firstboot script.
AbandonedPublic

Authored by jonathan on Feb 9 2018, 2:32 AM.

Details

Reviewers
bapt
jmg
cperciva
Summary

This script allows a system to bootstrap the package system and a set of
initial packages on first boot. To enable pkg(8) bootstrapping, add the
following to /etc/rc.conf:

pkg_bootstrap_enable="YES"

A list of packages to be installed at bootstrap time can be specified with:

pkg_bootstrap_list="sudo tmux git kyua"

The environment for the pkg(8) bootstrap commands can be influenced using
the pkg_bootstrap_env variable. This can be helpful for overriding
environment variables such as ABI or OSVERSION:

pkg_bootstrap_env="OSVERSION=1200056"

Diff Detail

Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 14890
Build 15002: arc lint + arc unit

Event Timeline

jonathan created this revision.Feb 9 2018, 2:32 AM

You're aware of sysutils/firstboot-pkgs in the ports tree, right? Wouldn't it make sense to migrate that into the base system rather than adding a new script?

I wasn't aware of that port, no... thanks for pointing it out! I'll definitely take a look at that and see if it might make more sense to pull that into base than to duplicate the work.

lwhsu added a subscriber: lwhsu.Feb 16 2018, 10:09 PM
jonathan abandoned this revision.Feb 28 2018, 6:40 PM

So, @cperciva , do you mind if I pull your firstboot-pkgs work into the base system? This would help tidy up a VM-building workflow that I'm using in which I can't run pkg(8) on the VM-building host.

Absolutely fine with me. When I wrote this (and also firstboot-freebsd-update) I was anticipating that it might end up in the base system if people found it useful -- I have a long history of using the ports tree as a staging area like this. :-)

If you go ahead with importing this to the base system, we will need to (a) bump __FreeBSD_version, (b) mark the port as IGNORE for relevant values, and (c) update the EC2 build to not install the port any more. Feel free to do as many or as few of these as you're comfortable with, but please send me an email when you're done so I can do the rest (if any) and make sure everything looks right.