Compare commits

...

2 Commits

Author SHA1 Message Date
3a5b7d74ad builder: build: bootstrap.py: reload user database before filesystem
Signed-off-by: BigfootACA <bigfoot@classfun.cn>
2024-05-31 18:21:28 +08:00
9b621831c4 builder: component: user.py: gid fallback to uid when user is not found
Signed-off-by: BigfootACA <bigfoot@classfun.cn>
2024-05-31 18:20:57 +08:00
2 changed files with 4 additions and 7 deletions

View File

@ -112,12 +112,12 @@ def build_rootfs(ctx: ArchBuilderContext):
# real install all packages # real install all packages
pacman_build.proc_pacman(ctx, pacman) pacman_build.proc_pacman(ctx, pacman)
# running add files hooks (for user settings)
filesystem.add_files_all(ctx, "pre-user")
# reload user databases after install packages # reload user databases after install packages
ctx.reload_passwd() ctx.reload_passwd()
# running add files hooks (for user settings)
filesystem.add_files_all(ctx, "pre-user")
# create custom users and groups # create custom users and groups
user.proc_usergroup(ctx) user.proc_usergroup(ctx)

View File

@ -71,8 +71,5 @@ def parse_user_from(
gid = parse_usergroup_from(ctx, node, True, gid) gid = parse_usergroup_from(ctx, node, True, gid)
if gid == -1: if gid == -1:
user = ctx.passwd.lookup_uid(uid) user = ctx.passwd.lookup_uid(uid)
if user is None: raise ArchBuilderConfigError( gid = user.gid if user else uid
f"user {user} not found"
)
gid = user.gid
return uid, gid return uid, gid