git: nrelease: Improve 'etc.hdd' creation to eliminate inconsistency

Aaron LI aly at crater.dragonflybsd.org
Sat Feb 25 03:12:46 PST 2023


commit 3f84c424c7a4c0033330ff959d8950c6cc74c9fc
Author: Aaron LI <aly at aaronly.me>
Date:   Wed Feb 8 22:39:47 2023 +0800

    nrelease: Improve 'etc.hdd' creation to eliminate inconsistency
    
    Previously, the 'etc.hdd' was created during the 'buildiso' target and
    then updated in the 'pkgs' target.  However, in the 'pkgs' target, only
    the password files (i.e., master.passwd, passwd, group) were copied but
    the password DBs (i.e., pwd.db, spwd.db) were not rebuild.  This caused
    an inconsistency in 'etc.hdd'.  When a user tried manual installation
    and forgot to run 'pwd_mkdb', the installed system would fail to add new
    users and generate errors like:
    
    > pw: user 'myuser' disappeared during update.
    > adduser: ERROR: There was an error adding user (myuser).
    
    This commit improves the creation of 'etc.hdd'.  Reorder the 'customiso'
    target *after* the 'pkgs' target, so we can simply copy the 'etc' to
    'etc.hdd' and be done, without any further changes, and the resulting
    password files and DBs are in consistency.  In addition, this avoids
    adding the 'installer' user to the 'etc.hdd' and so we get a cleaner
    system by default.
    
    See also: https://lists.dragonflybsd.org/pipermail/users/2023-February/428576.html
    (Regenerating the password databases on new installs)

Summary of changes:
 nrelease/Makefile | 23 ++++++++++-------------
 1 file changed, 10 insertions(+), 13 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/3f84c424c7a4c0033330ff959d8950c6cc74c9fc


-- 
DragonFly BSD source repository


More information about the Commits mailing list