User Accounts on the BBC

The BBC now supports the inclusion of user accounts on a CD. When the CD boots, part of the system initialization process involves looking for user tarballs, unpacking them in /home, and performing various operations on their contents.

User tarballs

A user tarball contains three things which, combined together, completely describe a user account. Using the username "beeb" as an example, the tarball beeb.tar.gz should contain these:

  • a file called beeb.passwd containing the line from /etc/passwd for the user "beeb"
  • a file called beeb.group containing the line from /etc/group for the user "beeb"
  • a directory called beeb which will be beeb's home directory, in /home, when the BBC boots

A user tarball may also contain a file called .bootstrap in the user's home directory with execute permission. This file will be executed with the user's uid at boot time as the last step in initialized the account.

Building a BBC containing user tarballs

First, create a directory containing all of the things you would like to have in the home directory on the BBC.

Then, after you've gotten a copy of GAR and before you begin building your LNX-BBC ISO, run the command "make -C special/accounts adduser" and answer its questions. It will create your user tarball automatically and include it in the next ISO you build.

Including user tarballs from within another package

A package can also build a user account on a BBC. To do so, it is necessary to manually create appropriate .passwd, .group, and .bootstrap files and put them in the files/ directory of the package. Be sure to prepend the username to all three files ($(username).bootstrap will later be copied to $(username)/.bootstrap in the work/ directory). In the Makefile, add the files to your DISTFILES variable and enumerate the users that your package will build using the GARUSERS variable (see net/openssh for an example of a package which does this).

If you need to put things into the user's home directory that will appear there at runtime, simply install them to $(WORKDIR)/$(username)/.