aboutsummaryrefslogtreecommitdiff
path: root/init.d
diff options
context:
space:
mode:
authorWilliam Hubbs <w.d.hubbs@gmail.com>2018-11-06 16:34:14 -0600
committerWilliam Hubbs <w.d.hubbs@gmail.com>2018-11-07 08:55:44 -0600
commit7eb3975543eafd44c6946ca5a76812aa0d7a7303 (patch)
tree5b8e855a6a14f51af20873bfc8ae1ec19416702b /init.d
parent60e60dc9bbf0e3a18d897861367d9289ae8006d6 (diff)
Create save-keymaps and save-ktermencoding services
These services represent the parts of the keymaps and termencoding services which saved the settings back to the root file system so they can be loaded very early in the boot process. These are needed to allow keymaps and termencoding to run earlier in the boot sequence. X-Gentoo-Bug: 446018 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=446018
Diffstat (limited to 'init.d')
-rw-r--r--init.d/.gitignore2
-rw-r--r--init.d/Makefile4
-rw-r--r--init.d/keymaps.in9
-rw-r--r--init.d/save-keymaps.in28
-rw-r--r--init.d/save-termencoding.in35
-rw-r--r--init.d/termencoding.in3
6 files changed, 70 insertions, 11 deletions
diff --git a/init.d/.gitignore b/init.d/.gitignore
index 90abdbbe..8e03e3b9 100644
--- a/init.d/.gitignore
+++ b/init.d/.gitignore
@@ -41,6 +41,8 @@ rc-enabled
rpcbind
runsvdir
savecore
+save-keymaps
+save-termencoding
swap-blk
swclock
syslogd
diff --git a/init.d/Makefile b/init.d/Makefile
index e18f7a9f..c97aeda9 100644
--- a/init.d/Makefile
+++ b/init.d/Makefile
@@ -23,8 +23,8 @@ SRCS-FreeBSD+= adjkerntz.in devd.in dumpon.in encswap.in ipfw.in \
SRCS-Linux= agetty.in binfmt.in devfs.in cgroups.in dmesg.in hwclock.in \
consolefont.in keymaps.in killprocs.in modules.in \
- mount-ro.in mtab.in numlock.in procfs.in net-online.in sysfs.in \
-termencoding.in
+ mount-ro.in mtab.in numlock.in procfs.in net-online.in save-keymaps.in \
+ save-termencoding.in sysfs.in termencoding.in
# Generic BSD scripts
SRCS-NetBSD= hostid.in moused.in newsyslog.in pf.in rarpd.in rc-enabled.in \
diff --git a/init.d/keymaps.in b/init.d/keymaps.in
index 4bece821..16ddcc96 100644
--- a/init.d/keymaps.in
+++ b/init.d/keymaps.in
@@ -14,7 +14,7 @@ description="Applies a keymap for the consoles."
depend()
{
need termencoding
- after bootmisc clock
+ after devfs
keyword -docker -lxc -openvz -prefix -systemd-nspawn -uml -vserver -xenu
}
@@ -68,10 +68,5 @@ start()
echo "altgr keycode 18 = U+20AC" | loadkeys -q -
eend $?
fi
-
- # Save the keymapping for use immediately at boot
- if checkpath -W "$RC_LIBEXECDIR"; then
- mkdir -p "$RC_LIBEXECDIR"/console
- dumpkeys >"$RC_LIBEXECDIR"/console/keymap
- fi
+ return 0
}
diff --git a/init.d/save-keymaps.in b/init.d/save-keymaps.in
new file mode 100644
index 00000000..f35097ce
--- /dev/null
+++ b/init.d/save-keymaps.in
@@ -0,0 +1,28 @@
+#!@SBINDIR@/openrc-run
+# Copyright (c) 2018 Sony Interactive Entertainment, Inc.
+#
+# This file is part of OpenRC. It is subject to the license terms in
+# the LICENSE file found in the top-level directory of this
+# distribution and at https://github.com/OpenRC/openrc/blob/master/LICENSE
+# This file may not be copied, modified, propagated, or distributed
+# except according to the terms contained in the LICENSE file.
+
+description="Save the keymap for use as early as possible"
+
+depend()
+{
+ need termencoding
+ after bootmisc clock keymaps
+ keyword -docker -lxc -openvz -prefix -systemd-nspawn -uml -vserver -xenu
+}
+
+start()
+{
+ # Save the keymapping for use immediately at boot
+ ebegin "Saving key mapping"
+ if checkpath -W "$RC_LIBEXECDIR"; then
+ mkdir -p "$RC_LIBEXECDIR"/console
+ dumpkeys >"$RC_LIBEXECDIR"/console/keymap
+ fi
+ eend $? "Unable to save keymapping"
+}
diff --git a/init.d/save-termencoding.in b/init.d/save-termencoding.in
new file mode 100644
index 00000000..9e640dcc
--- /dev/null
+++ b/init.d/save-termencoding.in
@@ -0,0 +1,35 @@
+#!@SBINDIR@/openrc-run
+# Copyright (c) 2018 Sony Interactive Entertainment, Inc.
+#
+# This file is part of OpenRC. It is subject to the license terms in
+# the LICENSE file found in the top-level directory of this
+# distribution and at https://github.com/OpenRC/openrc/blob/master/LICENSE
+# This file may not be copied, modified, propagated, or distributed
+# except according to the terms contained in the LICENSE file.
+
+description="Configures terminal encoding."
+
+ttyn=${rc_tty_number:-${RC_TTY_NUMBER:-12}}
+: ${unicode:=${UNICODE}}
+
+depend()
+{
+ keyword -docker -lxc -openvz -prefix -systemd-nspawn -uml -vserver -xenu
+ use root
+ after bootmisc clock termencoding
+}
+
+start()
+{
+ ebegin "Saving terminal encoding"
+ # Save the encoding for use immediately at boot
+ if checkpath -W "$RC_LIBEXECDIR"; then
+ mkdir -p "$RC_LIBEXECDIR"/console
+ if yesno ${unicode:-${UNICODE}}; then
+ echo "" > "$RC_LIBEXECDIR"/console/unicode
+ else
+ rm -f "$RC_LIBEXECDIR"/console/unicode
+ fi
+ fi
+ eend 0
+}
diff --git a/init.d/termencoding.in b/init.d/termencoding.in
index 86f5b588..41ddc342 100644
--- a/init.d/termencoding.in
+++ b/init.d/termencoding.in
@@ -17,8 +17,7 @@ ttyn=${rc_tty_number:-${RC_TTY_NUMBER:-12}}
depend()
{
keyword -docker -lxc -openvz -prefix -systemd-nspawn -uml -vserver -xenu
- use root
- after bootmisc clock
+ after devfs
}
start()