diff options
Diffstat (limited to 'init.d')
-rw-r--r-- | init.d/.gitignore | 2 | ||||
-rw-r--r-- | init.d/Makefile | 4 | ||||
-rw-r--r-- | init.d/keymaps.in | 9 | ||||
-rw-r--r-- | init.d/save-keymaps.in | 28 | ||||
-rw-r--r-- | init.d/save-termencoding.in | 35 | ||||
-rw-r--r-- | init.d/termencoding.in | 3 |
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() |