Skip to content

Commit

Permalink
installer: don't show groups from pkgs/live iso, default locale to C.…
Browse files Browse the repository at this point in the history
…UTF-8

the locale default prevents an error from the second sed command
  • Loading branch information
classabbyamp authored and the-maldridge committed Feb 20, 2023
1 parent 30701cf commit b6edd40
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions installer.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,8 @@ menu_locale() {

set_locale() {
if [ -f $TARGETDIR/etc/default/libc-locales ]; then
local LOCALE=$(get_option LOCALE)
local LOCALE="$(get_option LOCALE)"
: "${LOCALE:=C.UTF-8}"
sed -i -e "s|LANG=.*|LANG=$LOCALE|g" $TARGETDIR/etc/locale.conf
# Uncomment locale from /etc/default/libc-locales and regenerate it.
sed -e "/${LOCALE}/s/^\#//" -i $TARGETDIR/etc/default/libc-locales
Expand Down Expand Up @@ -742,6 +743,10 @@ menu_useraccount() {
else
_status=on
fi
# ignore the groups of existing users and package groups
if [[ "${_gid}" -ge 1000 || "${_group}" = "_"* ]]; then
continue
fi
if [ -z "${_checklist}" ]; then
_checklist="${_group} ${_group}:${_gid} ${_status}"
else
Expand All @@ -764,8 +769,8 @@ set_useraccount() {
[ -z "$USERPASSWORD_DONE" ] && return
[ -z "$USERNAME_DONE" ] && return
[ -z "$USERGROUPS_DONE" ] && return
useradd -R $TARGETDIR -m -G $(get_option USERGROUPS) \
-c "$(get_option USERNAME)" $(get_option USERLOGIN)
useradd -R "$TARGETDIR" -m -G "$(get_option USERGROUPS)" \
-c "$(get_option USERNAME)" "$(get_option USERLOGIN)"
echo "$(get_option USERLOGIN):$(get_option USERPASSWORD)" | \
chpasswd -R $TARGETDIR -c SHA512
}
Expand Down

0 comments on commit b6edd40

Please sign in to comment.