diff options
-rw-r--r-- | Makefile | 20 | ||||
-rw-r--r-- | PKGBUILD | 1 | ||||
-rwxr-xr-x | arch-daemons | 66 | ||||
-rwxr-xr-x | arch-modules-load | 15 | ||||
-rw-r--r-- | arch-modules-load.service | 10 | ||||
-rw-r--r-- | archlinux.7.txt | 80 | ||||
-rw-r--r-- | functions | 81 | ||||
-rwxr-xr-x | network | 34 | ||||
-rw-r--r-- | rc-local-shutdown.service | 12 | ||||
-rw-r--r-- | rc-local.service | 10 | ||||
-rw-r--r-- | rc.conf | 48 | ||||
-rw-r--r-- | rc.conf.5.txt | 245 | ||||
-rwxr-xr-x | rc.shutdown | 21 | ||||
-rwxr-xr-x | rc.sysinit | 29 |
14 files changed, 427 insertions, 245 deletions
@@ -2,15 +2,19 @@ VER := $(shell git describe) DIRS := \ /etc/rc.d \ - /etc/conf.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 \ + /usr/lib/systemd/system/shutdown.target.wants \ + /usr/lib/systemd/system/sysinit.target.wants \ /usr/sbin \ /usr/share/bash-completion/completions \ /usr/share/zsh/site-functions \ /usr/share/man/man5 \ + /usr/share/man/man7 \ /usr/share/man/man8 all: doc @@ -27,21 +31,31 @@ install: installdirs doc 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 + install -m755 -t $(DESTDIR)/usr/lib/systemd/system-generators arch-daemons + install -m755 -t $(DESTDIR)/usr/lib/systemd arch-modules-load + install -m644 -t $(DESTDIR)/usr/lib/systemd/system arch-modules-load.service rc-local.service rc-local-shutdown.service install -m644 tmpfiles.conf $(DESTDIR)/usr/lib/tmpfiles.d/initscripts.conf install -m644 -T bash-completion $(DESTDIR)/usr/share/bash-completion/completions/rc.d install -m644 -T zsh-completion $(DESTDIR)/usr/share/zsh/site-functions/_rc.d + ln -s ../rc-local.service ${DESTDIR}/usr/lib/systemd/system/multi-user.target.wants/ + ln -s ../rc-local-shutdown.service ${DESTDIR}/usr/lib/systemd/system/shutdown.target.wants/ + ln -s ../arch-modules-load.service ${DESTDIR}/usr/lib/systemd/system/sysinit.target.wants/ %.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 rc.d.8 +doc: rc.conf.5 archlinux.7 rc.d.8 clean: - rm -f rc.conf.5 rc.d.8 + rm -f rc.conf.5 archlinux.7 rc.d.8 tar: git archive HEAD --prefix=initscripts-$(VER)/ | xz > initscripts-$(VER).tar.xz @@ -8,6 +8,7 @@ license=('GPL') groups=('base') conflicts=('initscripts') provides=('initscripts=9999') +replaces=('initscripts-systemd') backup=(etc/inittab etc/rc.conf etc/rc.local etc/rc.local.shutdown) makedepends=('asciidoc') depends=('glibc' 'bash' 'coreutils' 'systemd-tools' 'iproute2' diff --git a/arch-daemons b/arch-daemons new file mode 100755 index 0000000..ffe4289 --- /dev/null +++ b/arch-daemons @@ -0,0 +1,66 @@ +#!/bin/bash +# +# /usr/lib/systemd/system-generators/arch-daemons +# + +. /etc/rc.conf + +[[ $1 ]] || exit 1 + +# when called at boot, this is /run/systemd/generator.late +dest=$3 + +# list of services that have to be started before the next one +deps=() + +# Check if $1 is a valid daemon name +have_daemon() { + [[ -f /etc/rc.d/$1 && -x /etc/rc.d/$1 ]] +} + +# Make service file +create_unit() { + local deps= daemon=${1%.service} + + if ! have_daemon $daemon; then + return + fi + + (( $# > 1 )) && printf -v deps 'After=%s\n' "${*:2}" + + printf \ +'[Unit] +SourcePath=/etc/rc.conf +Documentation=https://raw.github.com/falconindy/initscripts-systemd/master/README +Description=Legacy unit for %s +%s +[Service] +ExecStart=/etc/rc.d/%s start +ExecStop=/etc/rc.d/%s stop +RemainAfterExit=yes +Type=forking +' "$daemon" "$deps" "$daemon" "$daemon" > "$dest/$1" + +} + +for daemon in /etc/rc.d/*; do + create_unit "${daemon##*/}".service +done + +[[ -d $dest/multi-user.target.wants ]] || /bin/mkdir -p "$dest/multi-user.target.wants" + +for daemon in "${DAEMONS[@]}"; do + service="$daemon.service" + case ${daemon:0:1} in + '!') continue ;; + '@') create_unit "${service:1}" "${deps[@]}" + ln -s "../${service:1}" "$dest/multi-user.target.wants" + ;; + *) create_unit "$service" "${deps[@]}" + deps+=("$service") + ln -s "../$service" "$dest/multi-user.target.wants" + ;; + esac +done + +# vim: et sw=2: diff --git a/arch-modules-load b/arch-modules-load new file mode 100755 index 0000000..e522c2b --- /dev/null +++ b/arch-modules-load @@ -0,0 +1,15 @@ +#!/bin/bash +# +# /usr/lib/systemd/arch-modules-load +# + +. /etc/rc.conf + +# generate list of modules to be loaded by systemd-module-load in /run/modules-load.d/ +if [[ $MODULES ]]; then + mkdir /run/modules-load.d + echo "# Autogenerated by /usr/lib/systemd/arch-modules-load" > /run/modules-load.d/rc.conf + printf '%s\n' "${MODULES[@]}" >> /run/modules-load.d/rc.conf +fi + +# vim: set noet ts=2 sw=2: diff --git a/arch-modules-load.service b/arch-modules-load.service new file mode 100644 index 0000000..f400d48 --- /dev/null +++ b/arch-modules-load.service @@ -0,0 +1,10 @@ +[Unit] +SourcePath=/etc/rc.conf +Documentation=https://raw.github.com/falconindy/initscripts-systemd/master/README +Description=Load modules defined in rc.conf +DefaultDependencies=no +Before=systemd-modules-load.service + +[Service] +ExecStart=/usr/lib/systemd/arch-modules-load +Type=oneshot diff --git a/archlinux.7.txt b/archlinux.7.txt new file mode 100644 index 0000000..9cf1857 --- /dev/null +++ b/archlinux.7.txt @@ -0,0 +1,80 @@ +///// +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.conf + +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. @@ -171,13 +171,22 @@ stat_die() { } status() { - [[ $1 = '-v' ]] && { local v=1; shift; } + local quiet + case $1 in + -q) + quiet=1 + ;;& + -v) + # NOOP: supported for backwards compat + shift + ;; + esac stat_busy "$1" shift - if (( v )); then - "$@" - else + if (( quiet )); then "$@" &>/dev/null + else + "$@" fi local ret=$? (( ret == 0 )) && stat_done || stat_fail @@ -335,6 +344,16 @@ kill_all() { fi } +print_welcome() { + # see os-release(5) + . /etc/os-release + + echo " " + printhl "${PRETTY_NAME}\n" + printhl "${C_H2}${HOME_URL}" + printsep +} + load_modules() { local rc=0 @@ -363,7 +382,7 @@ udevd_modprobe() { stat_done # Load modules from the MODULES array and modules-load.d - status -v "Loading user-specified modules" load_modules + status "Loading user-specified modules" load_modules status "Waiting for udev uevents to be processed" \ udevadm settle @@ -386,8 +405,7 @@ do_unlock_legacy() { # $2 = source device # $3 = password # $4 = options - stat_append "${1}.." - printf "${C_FAIL}Using legacy crypttab format. This will stop working in the future. See crypttab(5).${C_OTHER}\n" + printf "${C_FAIL}Using legacy crypttab format. This will stop working in the future. See crypttab(5).${C_CLEAR}\n" local open=create a=$1 b=$2 failed=0 # Ordering of options is different if you are using LUKS vs. not. # Use ugly swizzling to deal with it. @@ -416,7 +434,7 @@ do_unlock_legacy() { if (( _overwriteokay == 0 )); then false elif cryptsetup -d /dev/urandom $4 $open "$a" "$b" >/dev/null; then - stat_append "creating swapspace.." + printf "creating swapspace..\n" mkswap -f -L $1 /dev/mapper/$1 >/dev/null fi;; ASK) @@ -451,43 +469,38 @@ do_unlock_legacy() { *) echo "$3" | cryptsetup $4 $open "$a" "$b" >/dev/null;; esac - if (( $? )); then - failed=1 - stat_append "failed " - else - stat_append "ok " - fi - return $failed + return $? } do_unlock_systemd() { - stat_append "${1}.." - local failed=0 - if ! /usr/lib/systemd/systemd-cryptsetup attach "$1" "$2" "$3" $4; then + local name=$1 device=$2 password=$3 options=$4 failed=0 + + if ! /usr/lib/systemd/systemd-cryptsetup attach "$name" "$device" "$password" $options; then failed=1 else - IFS=, + options=${options//,/ } if in_array swap ${options[@]}; then - if ! mkswap /dev/mapper/$name >/dev/null; then + # create swap on the device only if no fs signature exists + blkid -p "$2" &>/dev/null + if (( $? != 2 )) || ! mkswap -f /dev/mapper/$name >/dev/null; then failed=1 fi elif in_array tmp ${options[@]}; then - if ! mke2fs /dev/mapper/$name >/dev/null; then + # create fs on the device only if no fs signature exists + blkid -p "$2" &>/dev/null + if (( $? != 2 )) || ! mke2fs /dev/mapper/$name >/dev/null; then failed=1 fi fi fi - if (( $failed )); then - stat_append "failed " - else - stat_append "ok " - fi return $failed } do_unlock() { local name=$1 device=$2 password=$3 options=$4 + printf "${C_MAIN}Unlocking $1${C_CLEAR}\n" + if [[ ${options:0:2} =~ -. ]]; then do_unlock_legacy "$name" "$device" "$password" "$options" return $? @@ -511,9 +524,17 @@ do_unlock() { do_unlock_legacy "$name" "$device" "$password" "$options" ;; esac + failed=$? + if (( $failed )); then + printf "${C_FAIL}Unlocking of $1 failed.${C_CLEAR}\n" + fi return $? } +do_lock() { + status "Detaching encrypted device ${1}" /usr/lib/systemd/systemd-cryptsetup detach "$1" >/dev/null +} + read_crypttab() { # $1 = function to call with the split out line from the crypttab local line nspo failed=0 @@ -599,7 +620,7 @@ fsck_reboot() { } mount_all() { - mount -a -t "nosysfs,no${NETFS//,/,no}" -O no_netdev + mount -a -t "no${NETFS//,/,no}" -O no_netdev } umount_all() { @@ -634,7 +655,7 @@ umount_all() { } remove_leftover() { - status -v 'Removing leftover files' systemd-tmpfiles --create --remove --clean + status 'Removing leftover files' systemd-tmpfiles --create --remove --clean } bootlogd_stop() { @@ -702,7 +723,7 @@ if (( RC_FUNCTIONS_HOOK_FUNCS_DEFINED != 1 )); then declare -r RC_FUNCTIONS_HOOK_FUNCS_DEFINED=1 fi -if [[ $DAEMON_LOCALE = [yY][eE][sS] ]]; then +if [[ $DAEMON_LOCALE != [nN][oO] ]]; then export LANG=${LOCALE:-C} if [[ -r /etc/locale.conf ]]; then parse_envfile /etc/locale.conf "${localevars[@]}" @@ -712,7 +733,7 @@ else fi # set colors -if [[ $USECOLOR = [yY][eE][sS] ]]; then +if [[ $USECOLOR != [nN][oO] ]]; then if tput setaf 0 &>/dev/null; then C_CLEAR=$(tput sgr0) # clear text C_MAIN=${C_CLEAR}$(tput bold) # main text @@ -23,24 +23,9 @@ deprecated() { printf " connection, or use a utility such as netcfg.\n" } -have_interface() { - if [[ -z $1 ]]; then - printf "\n${C_FAIL}Error:${C_CLEAR} \`interface' is undefined in /etc/rc.conf\n" - return 1 - fi - - if [[ ! -d /sys/class/net/$1 ]]; then - printf "\n${C_FAIL}Error:${C_CLEAR} unknown interface in /etc/rc.conf: \`%s'\n" "$1" - return 1 - fi -} - network_up() { - have_interface "$interface" || return 1 - - ip link set dev $interface up || return 1 - if [[ $address ]]; then + ip link set dev $interface up || return 1 ip addr add $address/${netmask:-24} broadcast ${broadcast:-+} dev $interface || return 1 [[ $gateway ]] && { ip route add default via $gateway || return 1; } else @@ -49,15 +34,18 @@ network_up() { } network_down() { - have_interface "$interface" || return 1 - - if [[ -f /run/dhcpcd-$interface.pid ]]; then - dhcpcd -qk $interface || return 1 + if [[ ! -n $interface ]]; then + if [[ -f /run/dhcpcd.pid ]]; then + dhcpcd -qk || return 1 + fi else - ip addr flush dev $interface || return 1 + if [[ ! -n $address && -f /run/dhcpcd-$interface.pid ]]; then + dhcpcd -qk $interface || return 1 + else + ip addr flush dev $interface || return 1 + fi + ip link set dev $interface down || return 1 fi - - ip link set dev $interface down || return 1 } ifup() { diff --git a/rc-local-shutdown.service b/rc-local-shutdown.service new file mode 100644 index 0000000..5f672f7 --- /dev/null +++ b/rc-local-shutdown.service @@ -0,0 +1,12 @@ +[Unit] +Description=/etc/rc.local.shutdown Compatibility +ConditionPathIsExecutable=/etc/rc.local.shutdown +DefaultDependencies=no +After=rc-local.service basic.target +Before=shutdown.target + +[Service] +Type=oneshot +ExecStart=/etc/rc.local.shutdown +StandardInput=tty +RemainAfterExit=yes diff --git a/rc-local.service b/rc-local.service new file mode 100644 index 0000000..6c4c412 --- /dev/null +++ b/rc-local.service @@ -0,0 +1,10 @@ +[Unit] +Description=/etc/rc.local Compatibility +ConditionPathIsExecutable=/etc/rc.local + +[Service] +Type=oneshot +ExecStart=/etc/rc.local +TimeoutSec=0 +StandardInput=tty +RemainAfterExit=yes @@ -1,40 +1,22 @@ # -# /etc/rc.conf - Main Configuration for Parabola GNU/Linux-Libre +# /etc/rc.conf - configuration file for initscripts # -# See 'man 5 rc.conf' for more details +# Most of rc.conf has been replaced by various other configuration +# files. See archlinux(7) for details. +# +# For more details on rc.conf see rc.conf(5). # -# LOCALIZATION -# ------------ -HARDWARECLOCK= -TIMEZONE= -KEYMAP= -CONSOLEFONT= -CONSOLEMAP= -LOCALE= -DAEMON_LOCALE="yes" -USECOLOR="yes" - -# HARDWARE -# -------- -MODULES=() -USEDMRAID="no" -USEBTRFS="no" -USELVM="no" - -# NETWORKING -# ---------- -HOSTNAME= - -interface= -address= -netmask= -broadcast= -gateway= +DAEMONS=(metalog network crond) -NETWORK_PERSIST="no" +# Storage +# +# USEDMRAID="no" +# USELVM="no" -# DAEMONS -# ------- +# Network # -DAEMONS=(metalog network crond) +# interface= +# address= +# netmask= +# gateway= diff --git a/rc.conf.5.txt b/rc.conf.5.txt index 25b0f6e..556d223 100644 --- a/rc.conf.5.txt +++ b/rc.conf.5.txt @@ -20,210 +20,211 @@ as time zone, keymap, kernel modules, daemons to load at start-up, etc. It is split up in a few sections to categorize configuration settings: localization, hardware, networking, and daemons. -LOCALIZATION[[L]] ------------------ -*TIMEZONE=* +DAEMONS[[D]] +------------ +*DAEMONS=* -Specifies the time zone. The setting takes effect on boot by ensuring that /etc/localtime is a symlink -to the correct zoneinfo file. Possible time zones are the relative path to a zoneinfo file starting -from the directory /usr/share/zoneinfo. For example, a German time zone would be Europe/Berlin, -which refers to the file /usr/share/zoneinfo/Europe/Berlin. +Daemons to start at boot-up (in this order) -Note: If empty, /etc/localtime is not changed. This is useful if /etc/localtime is maintained manually -or by a third-party tool, or if there is no reason to change it from what was set during install. + - prefix a daemon with a ! to disable it + - prefix a daemon with a @ to start it up in the background -Default: empty +If you are sure nothing else touches your hardware clock (such as ntpd or +by dual-booting), you might want to enable 'hwclock'. Note that this will only +make a difference if the hwclock program has been calibrated correctly. -*HARDWARECLOCK=* +If you use a network filesystem, you should enable 'netfs'. -How to interpret/update the hardware clock. (used by hwclock) + DAEMONS=('syslog-ng' 'network' 'crond') -Options: +STORAGE[[S]] +------------ +*USEDMRAID=* - - empty: fall back to the value in /var/lib/hwclock/adjtime, which defaults to UTC. This is recommended - as other users of hwclock might change the adjtime file and hence cause rc.conf and adjtime to be out of sync. - - "UTC": most robust, allows operating systems to abstract local time and ease DST. - - "localtime": apply time zone (and DST) in hardwareclock: discouraged. - Choose this if you dual-boot with an OS which cannot handle UTC BIOS times correctly, like Windows (note - that recent Windows versions can use UTC, which is preferable). - - any other value will result in the hardware clock being left untouched (useful for virtualization) +Scan for FakeRAID (dmraid) volumes at start-up. -Default: empty +Default: 'no' -*KEYMAP=* + USEDMRAID="yes" -Defines the keymap to load with the loadkeys program on boot. Possible keymaps are -found in /usr/share/kbd/keymaps. Please note that this setting is only valid for -your TTYs, not any graphical window managers or X. KEYMAP in /etc/vconsole.conf takes -precedence. +*USELVM=* -Default: empty +Scan for LVM volume groups at start-up. This is required if you use LVM. -*CONSOLEFONT=* +Default: 'no' -Defines the console font to load with the setfont program on boot. -Possible fonts are found in /usr/share/kbd/consolefonts (only needed for non-US). -FONT in /etc/vconsole.conf takes precedence. + USELVM="yes" -Default: empty +NETWORKING[[N]] +--------------- -*CONSOLEMAP=* +*HOSTNAME=* -Defines the console map to load with the setfont program on boot. Possible maps are found in -/usr/share/kbd/consoletrans. Set this to a map suitable for the appropriate locale (8859-1 for Latin1, -for example) if you're using an UTF-8 locale and use programs that generate 8-bit output. If you're -using X11 for everyday work, don't bother, as it only affects the output of Linux console applications. -FONT_MAP in /etc/vconsole.conf takes precedence. +Hostname of machine. Unless nss-myhostname is used, this should also be set in /etc/hosts. -Default: empty +The contents of /etc/hostname (if not empty) takes precedence (see hostname(5)), and is recommended. -*LOCALE=* + HOSTNAME="arch1" -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. -If unset, it falls back to the C locale. +The following settings are used by the 'network' daemon. -Default: empty +*interface=* -*DAEMON_LOCALE=* +Name of device. Use `ip addr` or `ls /sys/class/net/` to see all available interfaces. - - If set to 'yes', use $LOCALE as the locale during daemon start-up and during the boot process. - - If set to 'no', the C locale is used. +Required for manual configuration. If using DHCP, it can be left unset, see dhcpcd(5) for details. -Default: "yes" +*address=* -*USECOLOR=* +IP address. -Use ANSI color sequences in start-up messages +Required for manual configuration. If left empty, DHCP will be used. -Default: "yes" +*netmask=* -HARDWARE[[H]] -------------- -*MODULES=* +Subnet mask. -Modules to load at boot-up. To blacklist modules, see 'man 5 modprobe.d'. See also -'man 5 modules-load.d'. +Defaults to 255.255.255.0. Ignored when using DHCP. -Default: (). +*broadcast=* -*USEDMRAID=* +Broadcast address. -Scan for FakeRAID (dmraid) volumes at start-up. +Optional for manual configuration, ignored for DHCP. -Default: "no" +*gateway=* -*USEBTRFS=* +Default route. -Scan for Btrfs volumes at start-up. +Required for manual configuration, ignored for DHCP. -Default: "no" +*Static IP example* -*USELVM=* + interface=eth0 + address=192.168.0.2 + netmask=255.255.255.0 + broadcast=192.168.0.255 + gateway=192.168.0.1 -Scan for LVM volume groups at start-up. This is required if you use LVM. +*DHCP example* -Default: "no" + interface= + address= + netmask= + gateway= -NETWORKING[[N]] ---------------- -*HOSTNAME=* +*NETWORK_PERSIST=* -Hostname of machine. Should also be put in /etc/hosts. The contents of -/etc/hostname (if not empty) takes precedence. +Setting this to "yes" will skip network shutdown. This is required if your root device is on NFS. -Default: empty +Default: 'no' -The following settings help you setting up a wired network. + NETWORK_PERSIST="yes" -*interface=* +LOCALIZATION[[L]] +----------------- +*TIMEZONE=* -Name of device. Use `ip addr` or `ls /sys/class/net/` to see all available interfaces. +Specifies the time zone. The setting takes effect on boot by ensuring that /etc/localtime is a symlink +to the correct zoneinfo file. Possible time zones are the relative path to a zoneinfo file starting +from the directory /usr/share/zoneinfo. For example, a German time zone would be Europe/Berlin, +which refers to the file /usr/share/zoneinfo/Europe/Berlin. -Default: empty +It is recommended to leave this unset, and rather maintain the /etc/localtime symlink manually, or via +third party tools. The reason for this is to avoid the symlink and the TIMEZONE variable to be out of sync, +as they are only synchronized at boot. Also, most third-party applications that could maintain +/etc/localtime do not know to also write to /etc/rc.conf. -Required for manual configuration as well as DHCP. + TIMEZONE="Europe/Berlin" -*address=* +*HARDWARECLOCK=* -IP address. +How to interpret/update the hardware clock. -Default: empty +Options: -Required for manual configuration, empty for DHCP. + - empty: fall back to the value in /etc/adjtime, which defaults to UTC. + - "UTC": allows the operating systems to abstract away local time and ease DST. + - "localtime": apply time zone (and DST) in hardwareclock: strongly discouraged. + Choose this if you dual-boot with an OS which cannot handle UTC BIOS times correctly, like Windows (note + that recent Windows versions can use UTC, which is preferable). -*netmask=* +It is strongly recommended to leave this unset, and rather maintain /etc/adjtime (see hwclock(8)). The reason for +this is that calls to hwclock outside of initscripts are not aware of the HARDWARECLOCK variable and will always +use /etc/adjtime. These two configuration sources being out-of-sync is a common source of timezone problems. -Subnet mask. + HARDWARECLOCK="UTC" -Default: empty (which means 255.255.255.0) +*KEYMAP=* -Optional for manual configuration, ignored for DHCP. +Defines the keymap to load with the loadkeys program on boot. Possible keymaps are +found in /usr/share/kbd/keymaps. Please note that this setting is only valid for +your TTYs, not any graphical window managers or X. -*broadcast=* +KEYMAP in /etc/vconsole.conf takes precedence (see vconsole.conf(5)), and is recommended. -Broadcast address. + KEYMAP="no-latin1" -Default: empty +*CONSOLEFONT=* -Optional for manual configuration, ignored for DHCP. +Defines the console font to load with the setfont program on boot. +Possible fonts are found in /usr/share/kbd/consolefonts (only needed for non-US). -*gateway=* +FONT in /etc/vconsole.conf takes precedence (see vconsole.conf(5)), and is recommended. -Default route. + CONSOLEFONT="LatArCyrHeb-16" -Default: empty +*CONSOLEMAP=* -Required for manual configuration, ignored for DHCP. +Defines the console map to load with the setfont program on boot. Possible maps are found in +/usr/share/kbd/consoletrans. Set this to a map suitable for the appropriate locale (8859-1 for Latin1, +for example) if you're using an UTF-8 locale and use programs that generate 8-bit output. If you're +using X11 for everyday work, don't bother, as it only affects the output of Linux console applications. -*Static IP example* +FONT_MAP in /etc/vconsole.conf takes precedence (see vconsole.conf(5)), and is recommended. - interface=eth0 - address=192.168.0.2 - netmask=255.255.255.0 - broadcast=192.168.0.255 - gateway=192.168.0.1 + CONSOLEMAP="8859-1" -*DHCP example* +*LOCALE=* - interface=eth0 - address= - netmask= - gateway= +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. -The following options might be needed for advanced use cases. +LANG in /etc/locale.conf takes precedence (see locale.conf(5)), and is recommended. -*NETWORK_PERSIST=* +If unset, it falls back to the C locale. -Setting this to "yes" will skip network shutdown. This is required if your root device is on NFS. + LOCALE="en_US.UTF-8" -Default: "no" +*DAEMON_LOCALE=* -*NETWORKS=* + - 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). -This functionality is deprecated; please refer to 'man 8 netcfg'. +Leave this unset, unless you have a specific reason to set it to 'no'. -DAEMONS[[D]] ------------- -*DAEMONS=* + DAEMON_LOCALE="yes" -Daemons to start at boot-up (in this order) +*USECOLOR=* - - prefix a daemon with a ! to disable it - - prefix a daemon with a @ to start it up in the background +Use ANSI color sequences in start-up messages, unless set to 'no'. -If you are sure nothing else touches your hardware clock (such as ntpd or -by dual-booting), you might want to enable 'hwclock'. Note that this will only -make a difference if the hwclock program has been calibrated correctly. + USECOLOR="yes" -If you use a network filesystem, you should enable 'netfs'. +HARDWARE[[H]] +------------- +*MODULES=* + +Modules to load at boot-up. To blacklist modules, see modprobe.d(5). + +Configuration files in /etc/modules-load.d/ are recommended instead (see modules-load.d(5)). -Default: (syslog-ng network crond) + MODULES=('kvm') SEE ALSO -------- -hostname(5), vconsole.conf(5), locale.conf(5), hwclock(8) +hostname(5), vconsole.conf(5), locale.conf(5), hwclock(8), modules-load.d(5), modprobe.d(5), ip(8), dhcpcd(8) AUTHORS ------- diff --git a/rc.shutdown b/rc.shutdown index 2d79379..d569dd2 100755 --- a/rc.shutdown +++ b/rc.shutdown @@ -6,6 +6,9 @@ . /etc/rc.conf . /etc/rc.d/functions +# don't let all the systemd tools be too verbose +export SYSTEMD_LOG_LEVEL="notice" + # avoid staircase effect stty onlcr @@ -55,20 +58,10 @@ run_hook shutdown_postumount # Kill non-root encrypted partition mappings if [[ -f /etc/crypttab ]] && type -p cryptsetup >/dev/null; then - stat_busy "Deactivating encrypted volumes" - # Maybe someone has LVM on an encrypted block device - # executing an extra vgchange is errorless - [[ $USELVM = [Yy][Ee][Ss] ]] && vgchange --sysinit -a n &>/dev/null - do_lock() { - stat_append "${1}.." - if cryptsetup remove "$1" &>/dev/null; then - stat_append "ok " - else - stat_append "failed " - fi - } - read_crypttab do_lock - stat_done + # Maybe someone has LVM on an encrypted block device + # executing an extra vgchange is errorless + [[ $USELVM = [Yy][Ee][Ss] ]] && vgchange --sysinit -a n &>/dev/null + read_crypttab do_lock fi [[ $USELVM = [Yy][Ee][Ss] && -x $(type -P lvm) ]] && @@ -6,16 +6,11 @@ . /etc/rc.conf . /etc/rc.d/functions -if [[ -s /etc/locale.conf ]]; then - parse_envfile /etc/locale.conf "LANG" -elif [[ $LOCALE ]]; then - export LANG=$LOCALE -fi +# don't let all the systemd tools be too verbose +export SYSTEMD_LOG_LEVEL="notice" -echo " " -printhl "Parabola GNU/Linux-Libre\n" -printhl "${C_H2}https://parabolagnulinux.org" -printsep +# Prints distro name and URL +print_welcome # mount the API filesystems # /proc, /sys, /run, /dev, /run/lock, /dev/pts, /dev/shm @@ -27,9 +22,6 @@ mkdir -p /dev/{pts,shm} mountpoint -q /dev/pts || mount -t devpts devpts /dev/pts -o mode=0620,gid=5,nosuid,noexec mountpoint -q /dev/shm || mount -t tmpfs shm /dev/shm -o mode=1777,nosuid,nodev -# log all console messages -bootlogd -p /run/bootlogd.pid - if [[ ! -e /run/initramfs/root-fsck ]]; then # remount root ro to allow for fsck later on, we remount now to # make sure nothing can open files rw on root which would block a remount @@ -37,6 +29,9 @@ if [[ ! -e /run/initramfs/root-fsck ]]; then status "Mounting root read-only" mount -o remount,ro / fi +# log all console messages +bootlogd -p /run/bootlogd.pid + run_hook sysinit_start HWCLOCK_PARAMS="--systz" @@ -78,20 +73,14 @@ status 'Configuring virtual consoles' /usr/lib/systemd/systemd-vconsole-setup [[ $USEDMRAID = [Yy][Ee][Ss] && -x $(type -P dmraid) ]] && status "Activating FakeRAID arrays" dmraid -i -ay -# Btrfs devices detection -[[ $USEBTRFS = [Yy][Ee][Ss] && -x $(type -P btrfs) ]] && - status "Activating Btrfs volumes" btrfs device scan - # Activate LVM2 groups, if any activate_vgs # Set up non-root encrypted partition mappings if [[ -f /etc/crypttab ]] && type -p cryptsetup >/dev/null; then - stat_busy "Unlocking encrypted volumes" - crypto_unlocked=0 - read_crypttab do_unlock && stat_done || stat_fail + read_crypttab do_unlock # Maybe someone has LVM on an encrypted block device - (( crypto_unlocked )) && activate_vgs + (( $? )) && activate_vgs fi # Check filesystems |