1. TZ86
  2. initscripts-fork

Commits

TZ86  committed 2000d26

Prioritize rc.conf. Now systemd configs (such as login.conf) uses only
when the corresponding options in rc.conf is empty/commented.

  • Participants
  • Parent commits 1f36803
  • Branches master

Comments (0)

Files changed (4)

File Makefile

View file
 	/etc/rc.d \
 	/etc/rc.d/functions.d \
 	/etc/logrotate.d \
+	/etc/profile.d \
 	/usr/lib/initscripts \
 	/usr/lib/tmpfiles.d \
 	/usr/lib/systemd/system-generators \
 	install -m644 -t $(DESTDIR)/etc/rc.d functions
 	install -m755 -t $(DESTDIR)/etc/rc.d hwclock network netfs
 	install -m755 -t $(DESTDIR)/usr/sbin rc.d
+	install -m755 -t $(DESTDIR)/etc/profile.d read_locale.sh
 	install -m644 -t $(DESTDIR)/usr/share/man/man5 rc.conf.5
 	install -m644 -t $(DESTDIR)/usr/share/man/man8 rc.d.8 arch-daemons.8
 	install -m755 -t $(DESTDIR)/usr/lib/initscripts arch-tmpfiles arch-sysctl arch-binfmt arch-modules

File functions

View file
 
 RANDOM_SEED=/var/lib/misc/random-seed
 
-. /etc/profile.d/locale.sh
+[[ -z $LANG ]] && . /etc/profile.d/read_locale.sh
 
 if [[ $1 == "start" ]]; then
 	if [[ $STARTING ]]; then

File rc.sysinit

View file
 . /etc/rc.conf
 . /etc/rc.d/functions
 
-if [[ -s /etc/hostname ]]; then
+if [[ -z $HOSTNAME && -s /etc/hostname ]]; then
 	HOSTNAME=$(< /etc/hostname)
 fi
 
 
 # this must be done after udev has loaded the KMS modules
 #status 'Configuring virtual consoles' /usr/lib/systemd/systemd-vconsole-setup
-if [[ ${LOCALE,,} =~ utf ]]; then
+if [[ ${LANG,,} =~ utf ]]; then
         stat_busy "Setting Consoles to UTF-8 mode"
                 # UTF-8 consoles are default since 2.6.24 kernel
                 # this code is needed not only for older kernels,
         stat_done
 fi
 
-if [[ -s /etc/vconsole.conf ]]; then
+if [[ -z $CONSOLEFONT && -z $CONSOLEMAP && -s /etc/vconsole.conf ]]; then
         parse_envfile /etc/vconsole.conf "${vconsolevars[@]}"
         [[ $FONT ]] && CONSOLEFONT=$FONT
         [[ $FONT_MAP ]] && CONSOLEMAP=$FONT_MAP

File read_locale.sh

View file
+#!/bin/sh
+
+unset LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES \
+      LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT LC_IDENTIFICATION
+
+LOCALE=$(. /etc/rc.conf 2>/dev/null; echo "$LOCALE")
+
+if [ -n "$LOCALE" ]; then
+  LANG=$LOCALE
+elif [ -n "$XDG_CONFIG_HOME" ] && [ -r "$XDG_CONFIG_HOME/locale.conf" ]; then
+  . "$XDG_CONFIG_HOME/locale.conf"
+elif [ -n $HOME ] && [ -r $HOME/.config/locale.conf ]; then
+  . "$HOME/.config/locale.conf"
+elif [ -r /etc/locale.conf ]; then
+  . /etc/locale.conf
+fi
+
+export LANG="${LANG:-C}"
+[ -n "$LC_CTYPE" ]          && export LC_CTYPE
+[ -n "$LC_NUMERIC" ]        && export LC_NUMERIC
+[ -n "$LC_TIME" ]           && export LC_TIME
+[ -n "$LC_COLLATE" ]        && export LC_COLLATE
+[ -n "$LC_MONETARY" ]       && export LC_MONETARY
+[ -n "$LC_MESSAGES" ]       && export LC_MESSAGES
+[ -n "$LC_PAPER" ]          && export LC_PAPER
+[ -n "$LC_NAME" ]           && export LC_NAME
+[ -n "$LC_ADDRESS" ]        && export LC_ADDRESS
+[ -n "$LC_TELEPHONE" ]      && export LC_TELEPHONE
+[ -n "$LC_MEASUREMENT" ]    && export LC_MEASUREMENT
+[ -n "$LC_IDENTIFICATION" ] && export LC_IDENTIFICATION