Commit c00f508b authored by Anton Midyukov's avatar Anton Midyukov

deflogin: Added SPECIAL_USER

Variable SPECIAL_USER must have the following format: user:group:uid:gid:homedir:shell Example: @$(call set,SPEC_USER,user:user:500:500:/home/user:/bin/bash)
parent 1d6f12bf
......@@ -58,7 +58,8 @@ vm/regular-jeos-systemd: vm/systemd-net \
mixin/regular-vm-jeos mixin/vm-archdep
@$(call add,THE_PACKAGES,glibc-locales)
vm/regular-jeos-sysv: vm/net mixin/regular-vm-jeos mixin/vm-archdep +power; @:
vm/regular-jeos-sysv: vm/net mixin/regular-vm-jeos mixin/vm-archdep +power
@$(call set,SPEC_USER,officer:officer:64:64:/bin/bash)
vm/regular-builder: vm/regular-jeos-sysv mixin/regular-builder
@$(call set,VM_SIZE,10737418240)
......
......@@ -62,6 +62,7 @@ distro/.regular-jeos-base: distro/.regular-bare \
@$(call add,THE_BRANDING,alterator) # just to be cleaned up later on
@$(call add,THE_PACKAGES,apt basesystem dhcpcd vim-console su agetty)
@$(call add,THE_LISTS,openssh)
@$(call set,SPEC_USER,officer:officer:64:64:/bin/bash)
# ...and for somewhat bare distros
distro/.regular-jeos: distro/.regular-jeos-base use/stage2/kms \
......
......@@ -6,6 +6,7 @@ use/deflogin:
@$(call xport,ROOTPW)
@$(call xport,USERS)
@$(call xport,GROUPS)
@$(call xport,SPEC_USER)
# some presets
# USERS variable chunk format is "login:passwd:admin:sudo"
......
#!/bin/sh
#!/bin/sh -x
# add regular user(s) assigning passwords and attributes of power
# NB: care that the utilities exist; shadow-utils is warranted
......@@ -34,3 +34,13 @@ set_sudo() {
[ -z "$admin" ] || set_admin "$login"
[ -z "$sudo" ] || set_sudo "$login"
done
# create special user
[ -z "$GLOBAL_SPEC_USER" ] ||
echo "$GLOBAL_SPEC_USER" \
| tr ' ' '\n' \
| while IFS=':' read login group uid gid homedir shell; do
groupadd -g $gid $group >/dev/null 2>&1 || :
useradd -g $gid -u $uid -d $homedir -s $shell $login >/dev/null 2>&1 || :
usermod -G $group $login || :
done
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment