From 2915407c58c4c9cc91ae778f9565e45e8466824e Mon Sep 17 00:00:00 2001 From: Tom Gundersen Date: Fri, 11 May 2012 02:54:58 +0200 Subject: console: configure console after modules have been loaded This should probably be fixed elsewhere, but for now only configure the console once the KMS drivers have been loaded to avoid the settings getting lost. Signed-off-by: Tom Gundersen --- rc.sysinit | 70 +++++++++++++++++++++++++++++++------------------------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/rc.sysinit b/rc.sysinit index f91190c..32313ab 100755 --- a/rc.sysinit +++ b/rc.sysinit @@ -36,6 +36,41 @@ run_hook sysinit_start # log all console messages bootlogd -p /run/bootlogd.pid +if [[ ! -a /usr/lib ]] ; then + printf "${C_FAIL}/usr is not mounted. This is not supported.${C_OTHER}\n" +fi + +if ! grep -q devtmpfs /proc/filesystems; then + printf "${C_FAIL}Your kernel does not have devtmpfs support. This is not supported.${C_OTHER}\n" +fi + +HWCLOCK_PARAMS="--systz" +case $HARDWARECLOCK in + "") ;; + UTC) HWCLOCK_PARAMS+=" --utc --noadjfile";; + localtime) HWCLOCK_PARAMS+=" --localtime --noadjfile";; + *) HWCLOCK_PARAMS="";; +esac + +if [[ $HWCLOCK_PARAMS ]]; then + stat_busy "Adjusting system time and setting kernel timezone" + + # Adjust the system time for timezone offset if rtc is not in UTC + # 1. Make creation time on device nodes sane (FS#8665) + # 2. Filesystem checks can depend on system time + # 3. This also sets the kernel time zone, used by e.g. vfat + # If TIMEZONE is not set in rc.conf, the timezone stored in /etc/localtime + # is used. If HARDWARECLOCK is not set in rc.conf, the value in + # /var/lib/hwclock/adjfile is used (in this case /var can not be a separate + # partition). + [[ $TIMEZONE ]] && export TZ=$TIMEZONE + hwclock $HWCLOCK_PARAMS && stat_done || stat_fail + unset TZ +fi + +# Start/trigger UDev, load MODULES and settle UDev +udevd_modprobe sysinit + if [[ -s /etc/locale.conf ]]; then parse_envfile /etc/locale.conf "LANG" [[ $LANG ]] && LOCALE=$LANG @@ -73,41 +108,6 @@ fi # Set console font if required set_consolefont -if [[ ! -a /usr/lib ]] ; then - printf "${C_FAIL}/usr is not mounted. This is not supported.${C_OTHER}\n" -fi - -if ! grep -q devtmpfs /proc/filesystems; then - printf "${C_FAIL}Your kernel does not have devtmpfs support. This is not supported.${C_OTHER}\n" -fi - -HWCLOCK_PARAMS="--systz" -case $HARDWARECLOCK in - "") ;; - UTC) HWCLOCK_PARAMS+=" --utc --noadjfile";; - localtime) HWCLOCK_PARAMS+=" --localtime --noadjfile";; - *) HWCLOCK_PARAMS="";; -esac - -if [[ $HWCLOCK_PARAMS ]]; then - stat_busy "Adjusting system time and setting kernel timezone" - - # Adjust the system time for timezone offset if rtc is not in UTC - # 1. Make creation time on device nodes sane (FS#8665) - # 2. Filesystem checks can depend on system time - # 3. This also sets the kernel time zone, used by e.g. vfat - # If TIMEZONE is not set in rc.conf, the timezone stored in /etc/localtime - # is used. If HARDWARECLOCK is not set in rc.conf, the value in - # /var/lib/hwclock/adjfile is used (in this case /var can not be a separate - # partition). - [[ $TIMEZONE ]] && export TZ=$TIMEZONE - hwclock $HWCLOCK_PARAMS && stat_done || stat_fail - unset TZ -fi - -# Start/trigger UDev, load MODULES and settle UDev -udevd_modprobe sysinit - # bring up the loopback interface [[ -d /sys/class/net/lo ]] && status "Bringing up loopback interface" ip link set up dev lo -- cgit v1.2.3 From 6f3ad111dd2dc18e0d393d59e3a1b383e69d0741 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Luttringer?= Date: Sun, 20 May 2012 05:12:52 +0200 Subject: fix /forcefsck logic with initcpio fsck hook MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently, using "shutdown -F -r now" with fsck initcpio hook doesn't make a full fsck on reboot. Initscripts hook check if /run/initramfs/root-fsck is present to add -M option to fsck which disable check of mounted filesystem. Initcpio doesn't check /forcefsck file and create root-fsck file with a simple fsck check. Signed-off-by: Sébastien Luttringer --- functions | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/functions b/functions index 7516345..b9bfffc 100644 --- a/functions +++ b/functions @@ -494,13 +494,11 @@ NETFS="nfs,nfs4,smbfs,cifs,codafs,ncpfs,shfs,fuse,fuseblk,glusterfs,davfs,fuse.g # Check local filesystems fsck_all() { - [[ -f /forcefsck ]] || in_array forcefsck $(< /proc/cmdline) && FORCEFSCK="-f" - - if [[ ! -n $FORCEFSCK ]] && { [[ -f /fastboot ]] || in_array fastboot $(< /proc/cmdline); }; then + if [[ -f /forcefsck ]] || in_array forcefsck $(< /proc/cmdline); then + FORCEFSCK="-f" + elif [[ -f /fastboot ]] || in_array fastboot $(< /proc/cmdline); then return 0 - fi - - if [[ -e /run/initramfs/root-fsck ]]; then + elif [[ -e /run/initramfs/root-fsck ]]; then IGNORE_MOUNTED="-M" fi -- cgit v1.2.3 From 6aae67af18fcb9af1ab47c7dd4bfd9c265f0203b Mon Sep 17 00:00:00 2001 From: Tom Gundersen Date: Tue, 15 May 2012 01:44:52 +0200 Subject: tmpfiles,sysctl,binfmt: use the systemd tools No point in reinventing the wheel. These and other tools are shipped in the systemd-tools package. Functionality should be unchanged, but we no longer have to maintain the code. Signed-off-by: Tom Gundersen --- Makefile | 9 +- PKGBUILD | 2 +- arch-binfmt | 45 --------- arch-sysctl | 29 ------ arch-tmpfiles | 297 ---------------------------------------------------------- functions | 3 +- rc.multi | 4 +- rc.sysinit | 6 +- 8 files changed, 9 insertions(+), 386 deletions(-) delete mode 100755 arch-binfmt delete mode 100755 arch-sysctl delete mode 100755 arch-tmpfiles diff --git a/Makefile b/Makefile index a2e5e04..7497f1c 100644 --- a/Makefile +++ b/Makefile @@ -6,14 +6,8 @@ DIRS := \ /etc/rc.d/functions.d \ /etc/logrotate.d \ /etc/profile.d \ - /usr/sbin \ - /etc/tmpfiles.d \ /usr/lib/tmpfiles.d \ - /etc/binfmt.d \ - /usr/lib/binfmt.d \ - /etc/sysctl.d \ - /usr/lib/sysctl.d \ - /usr/lib/initscripts \ + /usr/sbin \ /usr/share/bash-completion/completions \ /usr/share/zsh/site-functions \ /usr/share/man/man5 \ @@ -41,7 +35,6 @@ install: installdirs doc install -m755 -t $(DESTDIR)/usr/sbin rc.d install -m644 -t $(DESTDIR)/usr/share/man/man5 $(filter %.5, $(MAN_PAGES)) install -m644 -t $(DESTDIR)/usr/share/man/man8 $(filter %.8, $(MAN_PAGES)) - install -m755 -t $(DESTDIR)/usr/lib/initscripts arch-tmpfiles arch-sysctl arch-binfmt install -m644 tmpfiles.conf $(DESTDIR)/usr/lib/tmpfiles.d/arch.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 diff --git a/PKGBUILD b/PKGBUILD index 3130e5e..6186de5 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -10,7 +10,7 @@ conflicts=('initscripts') provides=('initscripts=9999') backup=(etc/inittab etc/rc.conf etc/rc.local etc/rc.local.shutdown) makedepends=('asciidoc') -depends=('glibc' 'bash' 'grep' 'coreutils' 'udev>=182' 'iproute2' +depends=('glibc' 'bash' 'grep' 'coreutils' 'systemd-tools' 'iproute2' 'ncurses' 'kbd' 'findutils' 'sysvinit') optdepends=('net-tools: legacy networking support' 'bridge-utils: Network bridging support' diff --git a/arch-binfmt b/arch-binfmt deleted file mode 100755 index 91468ef..0000000 --- a/arch-binfmt +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash -# -# /usr/lib/initscripts/arch-binfmt -# -# Configure additional binary formats at boot -# - -shopt -s nullglob - -declare -a binfmt_d -# files given has argv supersede config files -if (( $# > 0 )); then - for arg; do [[ -r "$arg" ]] && binfmt_d+=("$arg"); done -else - binfmt_d=( - /usr/lib/binfmt.d/*.conf - /etc/binfmt.d/*.conf - /run/binfmt.d/*.conf - ) -fi - -# check there is file to load -(( ${#binfmt_d[@]} > 0 )) || exit 1 - -# mount binfmt_misc if api filesystem is missing -mountpoint -q /proc/sys/fs/binfmt_misc || - mount -t binfmt_misc binfmt /proc/sys/fs/binfmt_misc - -# files declared later in the binfmt_d array will override earlier -# Example: `/etc/binfmt.d/foo.conf' supersedes `/usr/lib/binfmt.d/foo.conf'. -declare -A fragments -for path in "${binfmt_d[@]}"; do - [[ -f $path ]] && fragments[${path##*/}]=$path -done - -for path in "${fragments[@]}"; do - while read -r line; do - [[ ${line:0:1} == '#' ]] && continue - printf "%s" "$line" > /proc/sys/fs/binfmt_misc/register - done < "$path" -done - -: - -# vim: set ts=2 sw=2 noet: diff --git a/arch-sysctl b/arch-sysctl deleted file mode 100755 index f73f1f0..0000000 --- a/arch-sysctl +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash -# -# /usr/lib/initscripts/arch-sysctl -# -# Load sysctl configuration files following -# http://0pointer.de/public/systemd-man/sysctl.d.html -# - -shopt -s nullglob - -declare -a sysctl_d=( - /usr/lib/sysctl.d/*.conf - /etc/sysctl.d/*.conf - /run/sysctl.d/*.conf - /etc/sysctl.conf -) -declare -A fragments - -# files declared later in the sysctl_d array will override earlier -# Example: `/etc/sysctl.d/foo.conf' supersedes `/usr/lib/sysctl.d/foo.conf'. -for path in "${@:-${sysctl_d[@]}}"; do - [[ -f $path ]] && fragments[${path##*/}]=$path -done - -for path in "${fragments[@]}"; do - sysctl -q -p"$path" -done - -# vim: set ts=2 sw=2 noet: diff --git a/arch-tmpfiles b/arch-tmpfiles deleted file mode 100755 index 9355fdc..0000000 --- a/arch-tmpfiles +++ /dev/null @@ -1,297 +0,0 @@ -#!/bin/bash -# -# /usr/lib/initscripts/arch-tmpfiles -# -# Control creation, deletion, and cleaning of volatile and temporary files -# - -warninvalid() { - printf "arch-tmpfiles: ignoring invalid entry on line %d of \`%s'\n" "$LINENUM" "$FILE" - (( ++error )) -} >&2 - -checkparams() { - local parmreq=$1; shift - local path=$1 mode=$2 uid=$3 gid=$4 - - # parmcount must be >= parmreq - if (( $# < parmreq )); then - return 1 - fi - - # mode must be valid octal and 3 or 4 digits - if [[ $mode && ! $mode =~ ^[0-7]{3,4}$ ]]; then - return 1 - fi - - # uid must be numeric or a valid user name - # don't try to resolve numeric IDs in case they don't exist - if [[ $uid ]]; then - if [[ $uid != +([0-9]) ]] && ! getent passwd "$uid" >/dev/null; then - return 1 - fi - fi - - # gid must be numeric or a valid group name - # don't try to resolve numeric IDs in case they don't exist - if [[ $gid ]]; then - if [[ $gid != +([0-9]) ]] && ! getent group "$gid" >/dev/null; then - return 1 - fi - fi - - return 0 -} - -relabel() { - local -a paths=($1) - local mode=$2 uid=$3 gid=$4 - - if ! checkparams 4 "$@"; then - warninvalid - return - fi - - for path in "${paths[@]}"; do - if [[ -e $path ]]; then - [[ $uid != '-' ]] && chown $CHOPTS "$uid" "$path" - [[ $gid != '-' ]] && chgrp $CHOPTS "$gid" "$path" - [[ $mode != '-' ]] && chmod $CHOPTS "$mode" "$path" - fi - done -} - -_f() { - # Create a file if it doesn't exist yet - local path=$1 mode=$2 uid=$3 gid=$4 - - (( CREATE )) || return 0 - - if ! checkparams 4 "$@"; then - warninvalid - return - fi - - if [[ ! -e $path ]]; then - install -m"$mode" -o"$uid" -g"$gid" /dev/null "$path" - fi -} - -_F() { - # Create or truncate a file - local path=$1 mode=$2 uid=$3 gid=$4 - - (( CREATE )) || return 0 - - if ! checkparams 4 "$@"; then - warninvalid - return - fi - - install -m"$mode" -o"$uid" -g"$gid" /dev/null "$path" -} - -_d() { - # Create a directory if it doesn't exist yet - local path=$1 mode=$2 uid=$3 gid=$4 - - (( CREATE )) || return 0 - - if ! checkparams 4 "$@"; then - warninvalid - return - fi - - if [[ ! -d "$path" ]]; then - install -d -m"$mode" -o"$uid" -g"$gid" "$path" - fi -} - -_D() { - # Create or empty a directory - local path=$1 mode=$2 uid=$3 gid=$4 - - if ! checkparams 4 "$@"; then - warninvalid - return - fi - - if [[ -d $path ]] && (( REMOVE )); then - find "$path" -mindepth 1 -maxdepth 1 -xdev -exec rm -rf {} + - fi - - if (( CREATE )); then - install -d -m"$mode" -o"$uid" -g"$gid" "$path" - fi -} - -_p() { - # Create a named pipe (FIFO) if it doesn't exist yet - local path=$1 mode=$2 uid=$3 gid=$4 - - (( CREATE )) || return 0 - - if ! checkparams 4 "$@"; then - warninvalid - return - fi - - if [[ ! -p "$path" ]]; then - mkfifo -m$mode "$path" - chown "$uid:$gid" "$path" - fi -} - -_x() { - # Ignore a path during cleaning. Use this type to exclude paths from clean-up as - # controlled with the Age parameter. Note that lines of this type do not - # influence the effect of r or R lines. Lines of this type accept shell-style - # globs in place of of normal path names. - : - # XXX: we don't implement this -} - -_r() { - # Remove a file or directory if it exists. This may not be used to remove - # non-empty directories, use R for that. Lines of this type accept shell-style - # globs in place of normal path names. - local path - local -a paths=($1) - - (( REMOVE )) || return 0 - - if ! checkparams 1 "$@"; then - warninvalid - return - fi - - for path in "${paths[@]}"; do - if [[ -f $path ]]; then - rm -f "$path" - elif [[ -d $path ]]; then - rmdir "$path" - fi - done -} - -_R() { - # Recursively remove a path and all its subdirectories (if it is a directory). - # Lines of this type accept shell-style globs in place of normal path names. - local path - local -a paths=($1) - - (( REMOVE )) || return 0 - - if ! checkparams 1 "$@"; then - warninvalid - return - fi - - for path in "${paths[@]}"; do - [[ -d $path ]] && rm -rf --one-file-system "$path" - done -} - -_z() { - # Set ownership, access mode and relabel security context of a file or - # directory if it exists. Lines of this type accept shell-style globs in - # place of normal path names. - local -a paths=($1) - local mode=$2 uid=$3 gid=$4 - - (( CREATE )) || return 0 - - relabel "$@" -} - -_Z() { - # Recursively set ownership, access mode and relabel security context of a - # path and all its subdirectories (if it is a directory). Lines of this type - # accept shell-style globs in place of normal path names. - - (( CREATE )) || return 0 - - CHOPTS=-R relabel "$@" -} - -shopt -s nullglob - -declare -i CREATE=0 REMOVE=0 CLEAN=0 error=0 LINENO=0 -declare FILE= -declare -A fragments -declare -a tmpfiles_d=( - /usr/lib/tmpfiles.d/*.conf - /etc/tmpfiles.d/*.conf - /run/tmpfiles.d/*.conf -) - -while (( $# )); do - case $1 in - --create) CREATE=1 ;; - --remove) REMOVE=1 ;; - esac - shift -done - -if (( !(CREATE + REMOVE) )); then - printf 'usage: %s [--create] [--remove]\n' "${0##*/}" - exit 1 -fi - -# directories declared later in the tmpfiles_d array will override earlier -# directories, on a per file basis. -# Example: `/etc/tmpfiles.d/foo.conf' supersedes `/usr/lib/tmpfiles.d/foo.conf'. -for path in "${@:-${tmpfiles_d[@]}}"; do - [[ -f $path ]] && fragments[${path##*/}]=${path%/*} -done - -# catch errors in functions so we can exit with something meaningful -set -E -trap '(( ++error ))' ERR - -# loop through the gathered fragments, sorted globally by filename. -# `/run/tmpfiles/foo.conf' will always be read after `/etc/tmpfiles.d/bar.conf' -while read -d '' fragment; do - LINENUM=0 - - printf -v FILE '%s/%s' "${fragments[$fragment]}" "$fragment" - - ### FILE FORMAT ### - # XXX: We ignore the final 'Age' parameter - # 0 1 2 3 4 5 - # Type Path Mode UID GID Age - # d /run/user 0755 root root 10d - - # omit read's -r flag to honor escapes here, so that whitespace can be - # escaped for paths. We will _not_ honor quoted paths. - while read -a line; do - (( ++LINENUM )) - - # skip over comments and empty lines - if (( ! ${#line[*]} )) || [[ ${line[0]:0:1} = '#' ]]; then - continue - fi - - # whine about invalid entries - if ! type -t _${line[0]} >/dev/null; then - warninvalid - continue - fi - - # fall back on defaults when parameters are passed as '-' - if [[ ${line[2]} = '-' ]]; then - case ${line[0]} in - p|f|F) line[2]=0644 ;; - d|D) line[2]=0755 ;; - esac - fi - [[ ${line[3]} = '-' ]] && line[3]='root' - [[ ${line[4]} = '-' ]] && line[4]='root' - - "_${line[@]}" - done <"$FILE" -done < <(printf '%s\0' "${!fragments[@]}" | sort -z) - -exit $error - -# vim: set ts=2 sw=2 noet: diff --git a/functions b/functions index b9bfffc..fcbe402 100644 --- a/functions +++ b/functions @@ -576,8 +576,7 @@ umount_all() { } remove_leftover() { - stat_busy "Removing Leftover Files" - /usr/lib/initscripts/arch-tmpfiles --create --remove && stat_done || stat_fail + status -v 'Removing Leftover Files' /usr/lib/systemd/systemd-tmpfiles --create --remove # move from static /var/{run,lock} to /run if [[ ! -L /var/lock ]]; then rm -rf /var/lock diff --git a/rc.multi b/rc.multi index 20ed9bc..d558753 100755 --- a/rc.multi +++ b/rc.multi @@ -9,10 +9,10 @@ run_hook multi_start # Load sysctl config files -[[ -x /usr/lib/initscripts/arch-sysctl ]] && /usr/lib/initscripts/arch-sysctl +/usr/lib/systemd/systemd-sysctl # Load additional binary formats -[[ -x /usr/lib/initscripts/arch-binfmt ]] && /usr/lib/initscripts/arch-binfmt +/usr/lib/systemd/systemd-binfmt # Start daemons for daemon in "${DAEMONS[@]}"; do diff --git a/rc.sysinit b/rc.sysinit index 32313ab..53f0130 100755 --- a/rc.sysinit +++ b/rc.sysinit @@ -20,9 +20,11 @@ mountpoint -q /dev || mount -t devtmpfs dev /dev -o mode=0755,nosuid mkdir -p -m 1777 /run/lock mkdir -p /dev/{pts,shm} mountpoint -q /dev/pts || mount /dev/pts &>/dev/null || - mount -n -t devpts devpts /dev/pts -o mode=0620,gid=5,nosuid,noexec + mount -t devpts devpts /dev/pts -o mode=0620,gid=5,nosuid,noexec mountpoint -q /dev/shm || mount /dev/shm &>/dev/null || - mount -n -t tmpfs shm /dev/shm -o mode=1777,nosuid,nodev + mount -t tmpfs shm /dev/shm -o mode=1777,nosuid,nodev +mountpoint -q /proc/sys/fs/binfmt_misc || mount /proc/sys/fs/binfmt_misc &>/dev/null || + mount -t binfmt_misc binfmt /proc/sys/fs/binfmt_misc if [[ ! -e /run/initramfs/fsck-root ]]; then # remount root ro to allow for fsck later on, we remount now to -- cgit v1.2.3 From 854aa04187d4f65607f9b4525ca6645a0db7c9f8 Mon Sep 17 00:00:00 2001 From: Tom Gundersen Date: Tue, 15 May 2012 01:54:25 +0200 Subject: vconsole: use the systemd tool Signed-off-by: Tom Gundersen --- functions | 18 ------------------ rc.sysinit | 32 +------------------------------- 2 files changed, 1 insertion(+), 49 deletions(-) diff --git a/functions b/functions index fcbe402..99bc43b 100644 --- a/functions +++ b/functions @@ -655,24 +655,6 @@ if (( RC_FUNCTIONS_HOOK_FUNCS_DEFINED != 1 )); then declare -r RC_FUNCTIONS_HOOK_FUNCS_DEFINED=1 fi -# Function for setting console font if required -set_consolefont() { - [[ $CONSOLEFONT ]] || return 0 - stat_busy "Loading Console Font: $CONSOLEFONT" - #CONSOLEMAP in UTF-8 shouldn't be used - [[ $CONSOLEMAP && ${LOCALE,,} =~ utf ]] && CONSOLEMAP="" - local i - for i in /dev/tty[0-9]*; do - setfont ${CONSOLEMAP:+-m "${CONSOLEMAP}"} \ - "$CONSOLEFONT" -C ${i} &>/dev/null - done - if (( $? )); then - stat_fail - else - stat_done - fi -} - if [[ $DAEMON_LOCALE = [yY][eE][sS] ]]; then export LANG=${LOCALE:-C} if [[ -r /etc/locale.conf ]]; then diff --git a/rc.sysinit b/rc.sysinit index 53f0130..5696d89 100755 --- a/rc.sysinit +++ b/rc.sysinit @@ -77,38 +77,8 @@ if [[ -s /etc/locale.conf ]]; then parse_envfile /etc/locale.conf "LANG" [[ $LANG ]] && LOCALE=$LANG fi -if [[ ${LOCALE,,} =~ 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, - # but also when user has set vt.default_utf8=0 but LOCALE is *.UTF-8. - for i in /dev/tty[0-9]*; do - kbd_mode -u < ${i} - printf "\e%%G" > ${i} - done - echo 1 >| /sys/module/vt/parameters/default_utf8 - stat_done -else - stat_busy "Setting Consoles to legacy mode" - # make non-UTF-8 consoles work on 2.6.24 and newer kernels - for i in /dev/tty[0-9]*; do - kbd_mode -a < ${i} - printf "\e%%@" > ${i} - done - echo 0 >| /sys/module/vt/parameters/default_utf8 - stat_done -fi - -if [[ -s /etc/vconsole.conf ]]; then - parse_envfile /etc/vconsole.conf "${vconsolevars[@]}" - [[ $FONT ]] && CONSOLEFONT=$FONT - [[ $FONT_MAP ]] && CONSOLEMAP=$FONT_MAP -fi -[[ $KEYMAP ]] && - status "Loading Keyboard Map: $KEYMAP" loadkeys -q $KEYMAP -# Set console font if required -set_consolefont +status 'Configuring Virtual Consoles' /usr/lib/systemd/systemd-vconsole-setup # bring up the loopback interface [[ -d /sys/class/net/lo ]] && -- cgit v1.2.3 From e09c66ded0f2d4888aafeca812dc972e52eb3972 Mon Sep 17 00:00:00 2001 From: Tom Gundersen Date: Mon, 28 May 2012 22:00:55 +0200 Subject: random-seed: use the systemd tool Signed-off-by: Tom Gundersen --- rc.shutdown | 13 +------------ rc.sysinit | 5 +---- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/rc.shutdown b/rc.shutdown index ec30d56..d0d8405 100755 --- a/rc.shutdown +++ b/rc.shutdown @@ -19,18 +19,7 @@ run_hook shutdown_start stop_all_daemons -stat_busy "Saving Random Seed" - RANDOM_SEED=/var/lib/misc/random-seed - install -TDm 0600 /dev/null $RANDOM_SEED - POOL_FILE=/proc/sys/kernel/random/poolsize - if [[ -r $POOL_FILE ]]; then - read POOL_SIZE < $POOL_FILE - (( POOL_SIZE /= 8 )) - else - POOL_SIZE=512 - fi - dd if=/dev/urandom of=$RANDOM_SEED count=1 bs=$POOL_SIZE &>/dev/null -stat_done +status 'Saving Random Seed' /usr/lib/systemd/systemd-random-seed save [[ $TIMEZONE ]] && status "Configuring Time Zone" set_timezone "$TIMEZONE" diff --git a/rc.sysinit b/rc.sysinit index 5696d89..876542a 100755 --- a/rc.sysinit +++ b/rc.sysinit @@ -137,10 +137,7 @@ status "Activating Swap" swapon -a [[ $TIMEZONE ]] && status "Configuring Time Zone" set_timezone "$TIMEZONE" -RANDOM_SEED=/var/lib/misc/random-seed -[[ -f $RANDOM_SEED ]] && - status "Initializing Random Seed" \ - cp $RANDOM_SEED /dev/urandom +status 'Initializing Random Seed' /usr/lib/systemd/systemd-random-seed load # Remove leftover files remove_leftover -- cgit v1.2.3 From 9882b6ac728255b9e17c042b3c0d57cddd0d60d8 Mon Sep 17 00:00:00 2001 From: Tom Gundersen Date: Mon, 28 May 2012 22:34:55 +0200 Subject: tmpfiles: let systemd-tools ship most tmpfiles.d entries We only have one that is initsrcipts specific. Rename the tmpfiles snippet from arch.conf to initscripts.conf as this is more accurate. Signed-off-by: Tom Gundersen --- Makefile | 2 +- tmpfiles.conf | 16 ---------------- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/Makefile b/Makefile index 7497f1c..14a4cb2 100644 --- a/Makefile +++ b/Makefile @@ -35,7 +35,7 @@ install: installdirs doc install -m755 -t $(DESTDIR)/usr/sbin rc.d install -m644 -t $(DESTDIR)/usr/share/man/man5 $(filter %.5, $(MAN_PAGES)) install -m644 -t $(DESTDIR)/usr/share/man/man8 $(filter %.8, $(MAN_PAGES)) - install -m644 tmpfiles.conf $(DESTDIR)/usr/lib/tmpfiles.d/arch.conf + 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 diff --git a/tmpfiles.conf b/tmpfiles.conf index a63ca07..8f99a99 100644 --- a/tmpfiles.conf +++ b/tmpfiles.conf @@ -2,20 +2,4 @@ # /usr/lib/tmpfiles.d/arch.conf # -D /tmp 1777 root root 10d d /run/daemons 0755 root root - - -d /tmp/.X11-unix 1777 root root 10d -d /tmp/.ICE-unix 1777 root root 10d -d /tmp/.XIM-unix 1777 root root 10d -d /tmp/.font-unix 1777 root root 10d -d /tmp/.Test-unix 1777 root root 10d - -F /run/utmp 0664 root utmp - - -r /tmp/.X[0-9]-lock -r /etc/nologin -r /etc/shutdownpid -r /forcefsck -r /fastboot - -- cgit v1.2.3 From 4826ad0747f9caa8e685f819102e71845905a6a1 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Mon, 28 May 2012 10:58:43 -0400 Subject: add support for modules-load.d directories Signed-off-by: Dave Reisner --- functions | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/functions b/functions index 99bc43b..8105a5e 100644 --- a/functions +++ b/functions @@ -344,6 +344,20 @@ kill_all() { fi } +load_modules() { + local rc=0 + + /usr/lib/systemd/systemd-load-modules + rc=$? + + if (( ${#MODULES[*]} )); then + modprobe -ab "${MODULES[@]}" + (( rc += $? )) + fi + + return $rc +} + # Start/trigger UDev, load MODULES and settle UDev udevd_modprobe() { # $1 = where we are being called from. @@ -357,9 +371,8 @@ udevd_modprobe() { udevadm trigger --action=add --type=devices stat_done - # Load modules from the MODULES array defined in rc.conf - (( ${#MODULES[*]} )) && - status -v "Loading User-specified Modules" modprobe -ab "${MODULES[@]}" + # Load modules from the MODULES array and modules-load.d + status -v "Loading User-specified Modules" load_modules status "Waiting for UDev uevents to be processed" \ udevadm settle -- cgit v1.2.3 From 496fab1fd454b6f8422c2c05db787977dc9d1071 Mon Sep 17 00:00:00 2001 From: Tom Gundersen Date: Tue, 29 May 2012 13:38:56 +0200 Subject: systemd: correct some paths Signed-off-by: Tom Gundersen --- functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions b/functions index 8105a5e..df1ba33 100644 --- a/functions +++ b/functions @@ -589,7 +589,7 @@ umount_all() { } remove_leftover() { - status -v 'Removing Leftover Files' /usr/lib/systemd/systemd-tmpfiles --create --remove + status -v 'Removing Leftover Files' systemd-tmpfiles --create --remove # move from static /var/{run,lock} to /run if [[ ! -L /var/lock ]]; then rm -rf /var/lock -- cgit v1.2.3 From fb88ea7f023439cb66f7ba79c0271d0660e1c7fb Mon Sep 17 00:00:00 2001 From: Tom Gundersen Date: Tue, 29 May 2012 20:17:56 +0200 Subject: man: drop duplicate manpages These are now shipped with systemd-tools. Signed-off-by: Tom Gundersen --- Makefile | 11 ++-------- binfmt.d.5.txt | 57 ---------------------------------------------------- hostname.5.txt | 34 ------------------------------- locale.conf.5.txt | 40 ------------------------------------ rc.conf.5.txt | 8 +++++++- vconsole.conf.5.txt | 58 ----------------------------------------------------- 6 files changed, 9 insertions(+), 199 deletions(-) delete mode 100644 binfmt.d.5.txt delete mode 100644 hostname.5.txt delete mode 100644 locale.conf.5.txt delete mode 100644 vconsole.conf.5.txt diff --git a/Makefile b/Makefile index 14a4cb2..c989789 100644 --- a/Makefile +++ b/Makefile @@ -13,13 +13,6 @@ DIRS := \ /usr/share/man/man5 \ /usr/share/man/man8 -MAN_PAGES := \ - rc.d.8 \ - rc.conf.5 \ - locale.conf.5 \ - vconsole.conf.5 \ - hostname.5 - all: doc installdirs: @@ -33,8 +26,8 @@ install: installdirs doc 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 $(filter %.5, $(MAN_PAGES)) - install -m644 -t $(DESTDIR)/usr/share/man/man8 $(filter %.8, $(MAN_PAGES)) + install -m644 -t $(DESTDIR)/usr/share/man/man5 rc.conf.5 + install -m644 -t $(DESTDIR)/usr/share/man/man8 rc.d.8 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 diff --git a/binfmt.d.5.txt b/binfmt.d.5.txt deleted file mode 100644 index 2925256..0000000 --- a/binfmt.d.5.txt +++ /dev/null @@ -1,57 +0,0 @@ -///// -vim:set ts=4 sw=4 syntax=asciidoc noet: -///// -binfmt.d(5) -=========== - -NAME ----- -binfmt.d - Configure additional binary formats at boot - -SYNOPSIS --------- -/usr/lib/binfmt.d/*.conf - -/etc/binfmt.d/*.conf - -/run/binfmt.d/*.conf - -DESCRIPTION ------------ -*initscripts* uses files from the above directories to configure additional -binary formats to register during boot in the kernel. - -CONFIGURATION FORMAT --------------------- -Each file contains a list of binfmt_misc kernel binary format rules. -Consult *binfmt_misc.txt*[1] for more information on registration of -additional binary formats and how to write rules. - -Empty lines and lines beginning with ; and # are ignored. Note that this -means you may not use ; and # as delimiter in binary format rules. - -Each configuration file is named in the style of .conf. Files in -/etc/ overwrite files with the same name in /usr/lib/. Files in /run -overwrite files with the same name in /etc/ and /usr/lib/. Packages -should install their configuration files in /usr/lib/, files in /etc/ are -reserved for the local administration, which possibly decides to -overwrite the configurations installed from packages. All files are -sorted by filename in alphabetical order, regardless in which of the -directories they reside, to ensure that a specific configuration file -takes precedence over another file with an alphabetically later name. - -EXAMPLE -------- -*Example 1. /etc/binfmt.d/wine.conf example:* - - # Start WINE on Windows executables - :DOSWin:M::MZ::/usr/bin/wine: - -NOTES ------ -*1. binfmt_misc.txt:* - http://www.kernel.org/doc/Documentation/binfmt_misc.txt - -AUTHORS -------- -Original by Lennart Poettering, adapted to Arch Linux by Sébastien Luttringer. diff --git a/hostname.5.txt b/hostname.5.txt deleted file mode 100644 index f141768..0000000 --- a/hostname.5.txt +++ /dev/null @@ -1,34 +0,0 @@ -///// -vim:set ts=4 sw=4 syntax=asciidoc noet: -///// -hostname(5) -=========== - -NAME ----- -hostname - Local host name configuration file - -SYNOPSIS --------- -*/etc/hostname* - -DESCRIPTION ------------ -The /etc/hostname file configures the name of the local system that is set during boot. It -should contain a single newline-terminated host name string. The host name may be a free-form string up to 64 characters in length, -however it is recommended that it consists only of 7bit ASCII lower-case characters and no spaces or dots, and limits itself to the -format allowed for DNS domain name labels, even though this is not a strict requirement. - -In Arch Linux the HOSTNAME variable in /etc/rc.conf is checked for the host name as well, however only as fallback. - -HISTORY -------- -The simple configuration file format of /etc/hostname originates from Debian GNU/Linux. - -SEE ALSO --------- -systemd.hostname(5), hostname(1), hostname(7), rc.conf(5) - -AUTHORS -------- -Original by Lennart Poettering, adapted to Arch Linux by Tom Gundersen. diff --git a/locale.conf.5.txt b/locale.conf.5.txt deleted file mode 100644 index 15f1e5f..0000000 --- a/locale.conf.5.txt +++ /dev/null @@ -1,40 +0,0 @@ -///// -vim:set ts=4 sw=4 syntax=asciidoc noet: -///// -locale.conf(5) -============== - -NAME ----- -locale.conf - configuration file for locale settings - -SYNOPSIS --------- -*/etc/locale.conf* - -DESCRIPTION ------------ -The /etc/locale.conf file configures system-wide locale settings. - -The basic file format of locale.conf is a newline-separated list of environment-like shell-compatible variable assignments. It is -possible to source the configuration from shell scripts, however, beyond mere variable assignments no shell features are supported, -allowing applications to read the file without implementing a shell compatible execution engine. - -The locale settings configured in /etc/locale.conf are system-wide and are inherited by every service or user, unless overridden or -unset by individual programs or individual users. To avoid services inheriting the locale settings on sysvinit systems, the -DAEMON_LOCALE variable in rc.conf can be set to "no". - -In Arch /etc/rc.conf is checked for locale configuration as well, however only as fallback. - -OPTIONS -------- -The following locale settings may be set using /etc/locale.conf: *LANG=*, *LANGUAGE=*, *LC_CTYPE=*, *LC_NUMERIC=*, *LC_TIME=*, *LC_COLLATE=*, -*LC_MONETARY=*, *LC_MESSAGES=*, *LC_PAPER=*, *LC_NAME=*, *LC_ADDRESS=*, *LC_TELEPHONE=*, *LC_MEASUREMENT=*, *LC_IDENTIFICATION=*. Note that *LC_ALL* may not be be configured in this file. For details about the meaning and semantics of these settings, refer to locale(7). The LANG variable overrides LOCALE from /etc/rc.conf. - -SEE ALSO --------- -systemd.locale.conf(5), locale(7), rc.conf(5) - -AUTHORS -------- -Original by Lennart Poettering, adapted to Arch Linux by Tom Gundersen. diff --git a/rc.conf.5.txt b/rc.conf.5.txt index b979f45..726ba23 100644 --- a/rc.conf.5.txt +++ b/rc.conf.5.txt @@ -102,7 +102,8 @@ HARDWARE[[H]] ------------- *MODULES=* -Modules to load at boot-up. To blacklist modules, see "man modprobe.d". +Modules to load at boot-up. To blacklist modules, see "man modprobe.d". See also +"man modules-load.d". Default: (). @@ -218,6 +219,11 @@ If you use a network filesystem you should enable 'netfs'. Default: (syslog-ng network crond) +SEE ALSO +-------- + +hostname(5), vconsole.conf(5), locale.conf(5), hwclock(8) + AUTHORS ------- Written by Dieter Plaetinck, Tom Gundersen and others. diff --git a/vconsole.conf.5.txt b/vconsole.conf.5.txt deleted file mode 100644 index 456db58..0000000 --- a/vconsole.conf.5.txt +++ /dev/null @@ -1,58 +0,0 @@ -///// -vim:set ts=4 sw=4 syntax=asciidoc noet: -///// -vconsole.conf(5) -================ - -NAME ----- -vconsole.conf - configuration file for the virtual console - -SYNOPSIS --------- -*/etc/vconsole.conf* - -DESCRIPTION ------------ -The /etc/vconsole.conf file configures the virtual console, i.e. keyboard mapping and console font. - -The basic file format of the vconsole.conf is a newline-separated list environment-like shell-compatible variable assignments. It is -possible to source the configuration from shell scripts, however, beyond mere variable assignments no shell features are supported, -allowing applications to read the file without implementing a shell compatible execution engine. - -In Arch /etc/rc.conf is checked for vconsole configuration as well as described below, however only as fallback. - -OPTIONS -------- -The following options are understood: - -*KEYMAP=* -//, KEYMAP_TOGGLE= -//The KEYMAP_TOGGLE= can be used to configured a second toggle keymap and is by default unset. -// KEYMAP= defaults to us if not set. - - Configures the key mapping table of for they keyboard. Overriding KEYMAP from rc.conf. - -*FONT=*, *FONT_MAP=* -//, FONT_UNIMAP= -// the unicode font map -// FONT= defaults to latarcyrheb-sun16. - - Configures the console font and the console map. Overriding respectively CONSOLEFONT and CONSOLEMAP from rc.conf. - -EXAMPLE -------- -*Example 1. German keyboard and console* - -/etc/vconsole.conf: - - KEYMAP=de-latin1 - FONT=latarcyrheb-sun16 - -SEE ALSO --------- -systemd.vconsole.conf(5), loadkeys(1), setfont(8), rc.conf(5) - -AUTHORS -------- -Original by Lennart Poettering, adapted to Arch Linux by Tom Gundersen. -- cgit v1.2.3 From c92270d34def149ed74a3202b1ffed056c0151d0 Mon Sep 17 00:00:00 2001 From: Tom Gundersen Date: Tue, 29 May 2012 20:27:39 +0200 Subject: fix another wrong path Signed-off-by: Tom Gundersen --- functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions b/functions index df1ba33..d62cc20 100644 --- a/functions +++ b/functions @@ -347,7 +347,7 @@ kill_all() { load_modules() { local rc=0 - /usr/lib/systemd/systemd-load-modules + /usr/lib/systemd/systemd-modules-load rc=$? if (( ${#MODULES[*]} )); then -- cgit v1.2.3 From a20ce0e666b5c97080a880eee9d8301c3d48b177 Mon Sep 17 00:00:00 2001 From: Tom Gundersen Date: Tue, 29 May 2012 20:42:58 +0200 Subject: udev: fix path so systemd can drop a symlink Signed-off-by: Tom Gundersen --- functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions b/functions index d62cc20..c498f8a 100644 --- a/functions +++ b/functions @@ -362,7 +362,7 @@ load_modules() { udevd_modprobe() { # $1 = where we are being called from. # This is used to determine which hooks to run. - status "Starting UDev Daemon" /usr/lib/udev/udevd --daemon + status "Starting UDev Daemon" /usr/lib/systemd/systemd-udevd --daemon run_hook "$1_udevlaunched" -- cgit v1.2.3