From 2a56c5e7d64fdac1c94c7bfd0df723a4dcb07354 Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Sat, 6 Jun 2020 00:57:21 -0500 Subject: hscript: Update for console-setup -> kbd change --- hscript/meta.cc | 19 +++++++------------ hscript/script_e.cc | 2 ++ hscript/script_i.hh | 1 + 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/hscript/meta.cc b/hscript/meta.cc index ff39d4a..c3308d2 100644 --- a/hscript/meta.cc +++ b/hscript/meta.cc @@ -377,30 +377,25 @@ bool Keymap::validate() const { } bool Keymap::execute() const { - const std::string conf("# KEYBOARD CONFIGURATION FILE\n\ -\n\ -# Consult the keyboard(5) manual page.\n\ -\n\ -XKBMODEL=pc105\n\ -XKBLAYOUT=" + _value + "\n\ -XKBVARIANT=\n\ -XKBOPTIONS=\n\ -\n\ -BACKSPACE=guess" + const std::string conf("keymap=\"" + _value + "\"\n\ +windowkeys=\"NO\"\n\ +extended_keymaps=\"\"\n\ +dumpkeys_charset=\"\"\n\ +fix_euro=\"NO\"" ); output_info(pos, "keymap: setting system keyboard map to " + _value); if(script->options().test(Simulate)) { std::cout << "cat >" << script->targetDirectory() - << "/etc/default/keyboard <<-KEYCONF" << std::endl; + << "/etc/conf.d/keymaps <<-KEYCONF" << std::endl; std::cout << conf << std::endl; std::cout << "KEYCONF" << std::endl; return true; } #ifdef HAS_INSTALL_ENV - std::ofstream keyconf(script->targetDirectory() + "/etc/default/keyboard", + std::ofstream keyconf(script->targetDirectory() + "/etc/conf.d/keymaps", std::ios_base::trunc); if(!keyconf) { output_error(pos, "keymap: cannot write target keyboard configuration"); diff --git a/hscript/script_e.cc b/hscript/script_e.cc index a05d41e..a58338e 100644 --- a/hscript/script_e.cc +++ b/hscript/script_e.cc @@ -628,6 +628,8 @@ bool Script::execute() const { if(internal->keymap) { EXECUTE_OR_FAIL("keymap", internal->keymap) + fs::create_symlink("/etc/init.d/keymaps", + targ_etc + "/runlevels/default/keymaps", ec); } for(auto &acct : internal->accounts) { diff --git a/hscript/script_i.hh b/hscript/script_i.hh index b219579..c6dbb54 100644 --- a/hscript/script_i.hh +++ b/hscript/script_i.hh @@ -236,6 +236,7 @@ struct Script::ScriptPrivate { } std::unique_ptr k(dynamic_cast(obj)); keymap = std::move(k); + packages.insert("kbd-keymaps"); return true; } -- cgit v1.2.3-70-g09d2