OSDN Git Service

fs_config: introduce passwd generator
authorWilliam Roberts <william.c.roberts@intel.com>
Mon, 25 Apr 2016 22:00:34 +0000 (15:00 -0700)
committerDan Albert <danalbert@google.com>
Wed, 30 Nov 2016 00:21:17 +0000 (16:21 -0800)
commit316f9462afc6c0e72a2d047782f78ba55848dad8
treebb3974f817f53b6094482bfd3426a3de4ed75799
parent8f42ce71aceef823176c7bc14e60791be1b12f64
fs_config: introduce passwd generator

Introduce a generator that outputs passwd files per man(5) passwd.

Succinctly, the output is a colon delimited string containing the following
fields:

  * login name
  * encrypted password (optional)
  * uid (int)
  * gid (int)
  * User name or comment field
  * home directory
  * interpreter (optional)

Multiple colon delimited lines may exist, but will not be separated
across lines.

When run, produces:

foo::2900:2900::/:/system/bin/sh
foo_bar::2901:2901::/:/system/bin/sh
custom_oem1::2902:2902::/:/system/bin/sh

Note that this generator allows for 0 or more config.fs files. This allows for:
  * Unconditional inclusion of /system/etc/passwd in the generated image
  * A blank passwd file if no config.fs files are specified.

This ensures that when OEMs add config.fs files, there is no additional steps
for proper functionality (simpler for OEMs).

The one draw back is the additional inode consumption on system for a possible
blank file.

Test: That it produces a valid passwd file.
Change-Id: I19691c8260f02147ed861f8a319aeab3f5b1738e
Signed-off-by: William Roberts <william.c.roberts@intel.com>
tools/fs_config/Android.mk
tools/fs_config/fs_config_generator.py