mirror of
https://codeberg.org/privacy1st/arch
synced 2024-12-23 01:16:04 +01:00
installer script: work in progress (12): user and group
This commit is contained in:
parent
809ffddb50
commit
7f1243213b
@ -276,6 +276,19 @@ ff02::2 ip6-allrouters" >> /mnt/etc/hosts || return $?
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function user_and_pwd() {
|
||||||
|
# -m: create home
|
||||||
|
# -U: Create a group with the same name as the user, and add the user to this group.
|
||||||
|
arch-chroot /mnt useradd -m -s /usr/bin/zsh -g wheel "${USERNAME}" || return $?
|
||||||
|
arch-chroot /mnt chsh -s /usr/bin/zsh || return $?
|
||||||
|
|
||||||
|
# If ROOT_PWD is not given, the use USER_PWD for root user
|
||||||
|
ROOT_PWD="${ROOT_PWD:="${USER_PWD}"}"
|
||||||
|
|
||||||
|
printf "%s:%s" "${USERNAME}" "${USER_PWD}" | chpasswd --root /mnt || return $?
|
||||||
|
printf "%s:%s" "root" "${ROOT_PWD}" | chpasswd --root /mnt || return $?
|
||||||
|
}
|
||||||
|
|
||||||
function main() {
|
function main() {
|
||||||
# @pre
|
# @pre
|
||||||
# bash libraries imported
|
# bash libraries imported
|
||||||
@ -322,6 +335,7 @@ function main() {
|
|||||||
# in: HOSTNAME, FQDN (optional), STATIC_IP (optional), IPV6_CAPABLE (optional)
|
# in: HOSTNAME, FQDN (optional), STATIC_IP (optional), IPV6_CAPABLE (optional)
|
||||||
config_hostname_and_hosts || return $?
|
config_hostname_and_hosts || return $?
|
||||||
|
|
||||||
|
user_and_pwd || return $?
|
||||||
}
|
}
|
||||||
|
|
||||||
main "$@"
|
main "$@"
|
||||||
|
@ -11,6 +11,9 @@ USERNAME=arch
|
|||||||
USER_PWD=test
|
USER_PWD=test
|
||||||
LUKS_PWD=test
|
LUKS_PWD=test
|
||||||
|
|
||||||
|
# if unset, then USER_PWD will be used for ROOT_PWD
|
||||||
|
# ROOT_PWD=test
|
||||||
|
|
||||||
KERNEL=linux
|
KERNEL=linux
|
||||||
|
|
||||||
TARGET_BLOCK_DEVICE=/dev/sda
|
TARGET_BLOCK_DEVICE=/dev/sda
|
||||||
|
Loading…
Reference in New Issue
Block a user