aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2012-08-11 02:29:29 (GMT)
committerTom Gundersen <teg@jklm.no>2012-08-27 20:48:29 (GMT)
commitb603bf95b18c60fba4d6aa3ad2cb597c197ca6b5 (patch)
tree94419b728ae699c6456fed23b8ded7fa42a839fe
parentac6b435d40c8295fcc0fc4cb751ccd092a77e433 (diff)
downloadinitscripts-b603bf95b18c60fba4d6aa3ad2cb597c197ca6b5.tar.xz
move archlinux(7) and locale.sh to filesystem
The new locale.sh makes DAEMON_LOCALE redundant, so we remove that functionality. A post-upgrade notice will be added. The new functionality will apply the settings to /etc/locale.conf system-wide, and allow each user to override it in $HOME/.config/locale.conf. Signed-off-by: Tom Gundersen <teg@jklm.no>
-rw-r--r--Makefile11
-rw-r--r--archlinux.7.txt80
-rw-r--r--functions22
-rw-r--r--locale.sh83
-rw-r--r--rc.conf.5.txt13
5 files changed, 8 insertions, 201 deletions
diff --git a/Makefile b/Makefile
index ac307e2..2ef9703 100644
--- a/Makefile
+++ b/Makefile
@@ -4,7 +4,6 @@ DIRS := \
/etc/rc.d \
/etc/rc.d/functions.d \
/etc/logrotate.d \
- /etc/profile.d \
/usr/lib/tmpfiles.d \
/usr/lib/systemd/system-generators \
/usr/lib/systemd/system/multi-user.target.wants \
@@ -14,7 +13,6 @@ DIRS := \
/usr/share/bash-completion/completions \
/usr/share/zsh/site-functions \
/usr/share/man/man5 \
- /usr/share/man/man7 \
/usr/share/man/man8
all: doc
@@ -28,10 +26,8 @@ install: installdirs doc
install -m644 -t $(DESTDIR)/etc/logrotate.d bootlog
install -m644 -t $(DESTDIR)/etc/rc.d functions
install -m755 -t $(DESTDIR)/etc/rc.d hwclock network netfs
- install -m755 -t $(DESTDIR)/etc/profile.d locale.sh
install -m755 -t $(DESTDIR)/usr/sbin rc.d
install -m644 -t $(DESTDIR)/usr/share/man/man5 rc.conf.5
- install -m644 -t $(DESTDIR)/usr/share/man/man7 archlinux.7
install -m644 -t $(DESTDIR)/usr/share/man/man8 rc.d.8 arch-modules-load.8 arch-daemons.8
install -m755 -t $(DESTDIR)/usr/lib/systemd/system-generators arch-daemons
install -m755 -t $(DESTDIR)/usr/lib/systemd arch-modules-load
@@ -47,16 +43,13 @@ install: installdirs doc
%.5: %.5.txt
a2x -d manpage -f manpage $<
-%.7: %.7.txt
- a2x -d manpage -f manpage $<
-
%.8: %.8.txt
a2x -d manpage -f manpage $<
-doc: rc.conf.5 archlinux.7 rc.d.8 arch-modules-load.8 arch-daemons.8
+doc: rc.conf.5 rc.d.8 arch-modules-load.8 arch-daemons.8
clean:
- rm -f rc.conf.5 archlinux.7 rc.d.8 arch-modules-load.8 arch-daemons.8
+ rm -f rc.conf.5 rc.d.8 arch-modules-load.8 arch-daemons.8
tar:
git archive HEAD --prefix=initscripts-$(VER)/ | xz > initscripts-$(VER).tar.xz
diff --git a/archlinux.7.txt b/archlinux.7.txt
deleted file mode 100644
index 32517fb..0000000
--- a/archlinux.7.txt
+++ /dev/null
@@ -1,80 +0,0 @@
-/////
-vim:set ts=4 sw=4 syntax=asciidoc noet:
-/////
-archlinux(7)
-============
-
-NAME
-----
-archlinux - basic configuration
-
-SYNOPSIS
---------
-Overview of the basic configuration of Arch Linux.
-
-DESCRIPTION
------------
-Arch Linux exposes the user to the system without hiding any details. This manpage gives a
-brief overview of the configuration files that should be set up on a fresh install.
-
-INITSCRIPTS[[I]]
-----------------
-The initscripts are configured in rc.conf. Here you configure what daemons to start on boot, what storage
-technologies should be enabled and, optionally, a basic network setup.
-
-HOSTNAME[[H]]
--------------
-The hostname of the machine should be set in /etc/hostname. Additionally, either /etc/hosts should be
-configured accordingly, or nss-myhostname should be used. This is needed so the hostname can always
-be resolved to the current machine, which is required by some programs.
-
-LOCALIZATION[[L]]
------------------
-Various locales may be enabled in /etc/locale.gen, and generated by locale-gen. The system-wide locale to be used
-can be configured in /etc/locale.conf
-
-VIRTUAL CONSOLE[[V]]
---------------------
-The virtual console is configured in /etc/vconsole.conf. It allows you to set a font and a keyboard layout, among
-other things. Note that these settings only apply to the console, and not if you use X.
-
-TIME[[T]]
----------
-The local timezone is configured by *symlinking* /etc/localtime to the correct zoneinfo file under
-/usr/share/zoneinfo/. E.g.,
-
- /etc/localtime -> /usr/share/zoneinfo/Europe/Paris
-
-The real-time clock, which keeps track of time when the computer is off, can be configured to either
-be in UTC or in localtime in /etc/adjtime. The default is UTC.
-
-FILESYSTEMS[[F]]
-----------------
-Filesystems are configured in /etc/fstab, and encryption mappings are configured in /etc/crypttab.
-
-INITRAMFS[[R]]
---------------
-The initramfs is generated by mkinitcpio, and can be configured in /etc/mkinitcpio.conf.
-
-PACKAGE MANAGER[[P]]
---------------------
-The package manager, pacman, is configured in /etc/pacman.conf.
-
-BOOTLOADER[[B]]
----------------
-GRUB's configuration is generated from /etc/default/grub by grub-mkconfig. Syslinux is configured in /boot/syslinux/syslinux.cfg
-
-MODULES[[M]]
-------------
-Most modules should be loaded on-demand. Modules to be unconditionally loaded at boot can be specified in /etc/modules-load.d/,
-and modules to be blacklisted from auto-loading can be configured in /etc/modprobe.d/.
-
-SEE ALSO
---------
-
-rc.conf(5), hostname(5), hosts(5), nsswitch.conf(5), locale.conf(5), vconsole.conf(5), timezone(3), hwclock(8), fstab(5), crypttab(5),
-mkinitcpio(8), pacman(8), pacman.conf(5), grub-mkconfig(8), syslinux(1), modules-load.d(5), modprobe.d(5)
-
-AUTHORS
--------
-Written by Tom Gundersen.
diff --git a/functions b/functions
index e8ff7b8..448d2d1 100644
--- a/functions
+++ b/functions
@@ -5,11 +5,10 @@
# sanitize PATH (will be overridden later when /etc/profile is sourced but is useful for udev)
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
-localevars=(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 LC_ALL)
+# clear the TZ envvar, so daemons always respect /etc/localtime
+unset TZ
-vconsolevars=(KEYMAP KEYMAP_TOGGLE FONT FONT_MAP FONT_UNIMAP)
+. /etc/profile.d/locale.sh
if [[ $1 == "start" ]]; then
if [[ $STARTING ]]; then
@@ -66,12 +65,6 @@ if (( $? != 3 )); then
fi
unset TERM_COLORS
-# clear the TZ envvar, so daemons always respect /etc/localtime
-unset TZ
-
-# sanitize the locale settings
-unset "${localevars[@]}"
-
parse_envfile() {
local file=$1 validkeys=("${@:2}") ret=0 lineno=0 key= val=
local -r quotes=$'[\'"]' comments=$'[;#]*'
@@ -723,15 +716,6 @@ if (( RC_FUNCTIONS_HOOK_FUNCS_DEFINED != 1 )); then
declare -r RC_FUNCTIONS_HOOK_FUNCS_DEFINED=1
fi
-if [[ $DAEMON_LOCALE != [nN][oO] ]]; then
- export LANG=${LOCALE:-C}
- if [[ -r /etc/locale.conf ]]; then
- parse_envfile /etc/locale.conf "${localevars[@]}"
- fi
-else
- export LANG=C
-fi
-
# set colors
if [[ $USECOLOR != [nN][oO] ]]; then
if tput setaf 0 &>/dev/null; then
diff --git a/locale.sh b/locale.sh
deleted file mode 100644
index c465f6f..0000000
--- a/locale.sh
+++ /dev/null
@@ -1,83 +0,0 @@
-unset LANG
-
-if [ -s /etc/locale.conf ]; then
- . /etc/locale.conf
-fi
-
-if [ -z "$LANG" ] && [ -s /etc/rc.conf ]; then
- LANG=$(. /etc/rc.conf 2>/dev/null; echo "$LOCALE")
-fi
-
-export LANG=${LANG:-C}
-
-if [ -n "$LC_CTYPE" ]; then
- export LC_CTYPE
-else
- unset LC_CTYPE
-fi
-
-if [ -n "$LC_NUMERIC" ]; then
- export LC_NUMERIC
-else
- unset LC_NUMERIC
-fi
-
-if [ -n "$LC_TIME" ]; then
- export LC_TIME
-else
- unset LC_TIME
-fi
-
-if [ -n "$LC_COLLATE" ]; then
- export LC_COLLATE
-else
- unset LC_COLLATE
-fi
-
-if [ -n "$LC_MONETARY" ]; then
- export LC_MONETARY
-else
- unset LC_MONETARY
-fi
-
-if [ -n "$LC_MESSAGES" ]; then
- export LC_MESSAGES
-else
- unset LC_MESSAGES
-fi
-
-if [ -n "$LC_PAPER" ]; then
- export LC_PAPER
-else
- unset LC_PAPER
-fi
-
-if [ -n "$LC_NAME" ]; then
- export LC_NAME
-else
- unset LC_NAME
-fi
-
-if [ -n "$LC_ADDRESS" ]; then
- export LC_ADDRESS
-else
- unset LC_ADDRESS
-fi
-
-if [ -n "$LC_TELEPHONE" ]; then
- export LC_TELEPHONE
-else
- unset LC_TELEPHONE
-fi
-
-if [ -n "$LC_MEASUREMENT" ]; then
- export LC_MEASUREMENT
-else
- unset LC_MEASUREMENT
-fi
-
-if [ -n "$LC_IDENTIFICATION" ]; then
- export LC_IDENTIFICATION
-else
- unset LC_IDENTIFICATION
-fi
diff --git a/rc.conf.5.txt b/rc.conf.5.txt
index 73c2423..8983871 100644
--- a/rc.conf.5.txt
+++ b/rc.conf.5.txt
@@ -190,21 +190,14 @@ FONT_MAP in /etc/vconsole.conf takes precedence (see vconsole.conf(5)), and is r
This sets your system language, which will be used by all i18n-friendly applications and utilities.
See `locale -a` (or locale.gen) for available options.
-LANG in /etc/locale.conf takes precedence (see locale.conf(5)), and is recommended.
+LANG in /etc/locale.conf takes precedence (see locale.conf(5)), and is recommended. User-specific
+locale settings which override both /etc/locale.conf and /etc/rc.conf are set in
+$XDG_CONFIG_HOME/locale.conf using the same syntax as /etc/locale.conf.
If unset, it falls back to the C locale.
LOCALE="en_US.UTF-8"
-*DAEMON_LOCALE=*
-
- - If set to 'no', export the C locale to daemons and during the boot process.
- - Otherwise, export LANG (or LOCALE) as configured in /etc/locale.conf (or /etc/rc.conf).
-
-Leave this unset, unless you have a specific reason to set it to 'no'.
-
- DAEMON_LOCALE="yes"
-
*USECOLOR=*
Use ANSI color sequences in start-up messages, unless set to 'no'.