Page MenuHomeFreeBSD

nanobsd: Add a NO_ROOT build option
Needs ReviewPublic

Authored by jlduran on Sat, Feb 1, 4:26 AM.

Details

Reviewers
emaste
imp
Summary

Add a -U option to build NanoBSD images without root privileges. It
relies on makefs/mkimg and metalog (mtree) files, similar to what
release engineering uses to build images.

Keep the current way to build NanoBSD images untouched. Once this
method gets battle tested, it may be used to build images as root as
well.

TODO:

  • Unify a tgt_echo function that does echo and writes to the metalog?
  • Gather suggestions regarding metalog handling. Specifically debate makefs -F vs. makefs <metalog last argument>
Test Plan
  1. The default, two (almost) identical code slices:

    $ sh nanobsd.sh -U
  1. Two code slices, with the second code slice zeroed (better compression):

    $ mkdir -p ~/nanobsd/test $ echo "NANO_INIT_IMG2=0" > ~/nanobsd/test/config.nano $ sh nanobsd.sh -U -c ~/nanobsd/test/config.nano
  1. A single code slice (no ping-pong):

    $ mkdir -p ~/nanobsd/test $ echo "NANO_IMAGES=1" > ~/nanobsd/test/config.nano $ sh nanobsd.sh -U -c ~/nanobsd/test/config.nano
  1. An image with a custom media size:

    $ mkdir -p ~/nanobsd/test $ echo "NANO_MEDIASIZE=16000000" > ~/nanobsd/test/config.nano $ sh nanobsd.sh -U -c ~/nanobsd/test/config.nano

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 62204
Build 59088: arc lint + arc unit