Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Selecting a specific keyboard layout for genkernel's initram
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
GSnake
Tux's lil' helper
Tux's lil' helper


Joined: 10 Sep 2012
Posts: 120
Location: Italy

PostPosted: Wed Feb 11, 2015 9:18 am    Post subject: Selecting a specific keyboard layout for genkernel's initram Reply with quote

Hello guys!
How do I set a SPECIFIC keyboard layout for genkernel's initramfs?

This is my actual config file:

Code:
# Configuration file for genkernel

# This file is sourced by genkernel at startup and determines which options
# we will be using to compile our kernel.  The order of precidence is simple,
# with the internal settings being least important, configuration file
# settings next, and command line options being most important.

# =========Common Command Line Option Defaults=========

# Should we install to $BOOTDIR?  Default is "no" because genkernel is used in
# catalyst and stage building.
#INSTALL="yes"

# Run 'make oldconfig' before compiling this kernel?
OLDCONFIG="yes"

# Run 'make menuconfig' before compiling this kernel?
MENUCONFIG="yes"

# Run 'make nconfig' (ncurses 'menuconfig') before compiling this kernel?
NCONFIG="no"

# Note, that two previous lines are mutual exclusive (logically), while
# MENUCONFIG has a higher priority if both them is enabled.

# Run 'make clean' before compilation?
# If set to NO, implies MRPROPER WILL NOT be run
# Also, if clean is NO, it won't copy over any configuration
# file, it will use what's there.
CLEAN="yes"

# Run 'make mrproper' before configuration/compilation?
MRPROPER="no"

# Override the arch detection?
#ARCH_OVERRIDE="x86"

# Mount BOOTDIR automatically if it isn't mounted?
MOUNTBOOT="yes"

# Make symlinks in BOOTDIR automatically?
#SYMLINK="no"

# Save the new configuration in /etc/kernels upon
# successfull compilation
SAVE_CONFIG="yes"

# Use Color output in Genkernel?
USECOLOR="yes"

# Clear build cache dir
#CLEAR_CACHE_DIR="yes"

# Clear all tmp files and caches after genkernel has run
#POSTCLEAR="1"

# Genkernel uses an independent configuration for MAKEOPTS, and does not source
# /etc/make.conf . You can override the default setting by uncommenting and
# tweaking the following line. Default setting is set up by
# ${GK_SHARE}/${ARCH_OVERRIDE}/config.sh . The recommended value for -j
# argument is: <number of processors>*<number of cores per processor>+1
MAKEOPTS="-j5"

# Add in LVM support from static binaries if they exist on the system, or
# compile static LVM binaries if static ones do not exist.
LVM="yes"

# Add in Luks support. Needs sys-fs/cryptsetup with -dynamic installed.
LUKS="yes"

# Add in GnuPG support
#GPG="no"

# Add DMRAID support.
#DMRAID="no"

# Include (or suppresses the inclusion of) busybox in the initrd or initramfs.
# If included, busybox is rebuilt if the cached copy is out of date.
#BUSYBOX="yes"

# Use udev instead of mdev as the default device manager for the initramfs.
# If you use systemd and perhaps lvm, you _must_ keep this turned on.
#UDEV="yes"

# Includes mdadm/mdmon binaries in initramfs.
# Without sys-fs/mdadm[static] installed, this will build a static mdadm.
#MDADM="no"

# Specify a custom mdadm.conf.
# By default the ramdisk will be built *without* an mdadm.conf and will auto-detect
# arrays during bootup.  Usually, this should not be needed.
#MDADM_CONFIG="/etc/mdadm.conf"

# Add Multipath support.
#MULTIPATH="no"

# Add iSCSI support.
#ISCSI="no"

# Add e2fsprogs support.
#E2FSPROGS="no"

# Enable copying of firmware into initramfs
FIRMWARE="yes"
# Specify directory to pull from
FIRMWARE_DIR="/lib/firmware"
# Specify specific firmware files to include. This overrides FIRMWARE_DIR
#FIRMWARE_FILES=""

# Add new kernel to grub?
#BOOTLOADER="grub"

# Enable splashutils in early space (initrd). Default is "no".
#SPLASH="yes"

# Use this splash theme. If commented out - the "default" name theme is used.
# Also, SPLASH="yes" needs to be enabled for this one to one work.
# This supersedes the "SPLASH_THEME" option of /etc/conf.d/splash (in early space).
#SPLASH_THEME="gentoo"

# Installs, or not, plymouth into the initramfs. If "splash" will be
# passed at boot, plymouth will be activated.
PLYMOUTH="yes"

# Embeds the given plymouth theme into the initramfs.
PLYMOUTH_THEME="solar"

# =========Keymap Settings=========
#
# Force keymap selection at boot
DOKEYMAPAUTO="yes"


# Disables keymap selection support
#KEYMAP="it"


# =========Low Level Compile Settings=========
#
# GNU Make to use for kernel.  See also the --kernel-make command line option.
#KERNEL_MAKE="make"

# Compiler to use for the kernel (e.g. distcc).  See also the --kernel-cc
# command line option.
#KERNEL_CC="gcc"

# Assembler to use for the kernel.  See also the --kernel-as command line
# option.
#KERNEL_AS="as"

# Linker to use for the kernel.  See also the --kernel-ld command line option.
#KERNEL_LD="ld"

# GNU Make to use for the utilities.  See also the --utils-make command line
# option.
#UTILS_MAKE="make"

# Compiler to use for the utilities (e.g. distcc).  See also the --utils-cc
# command line option.
#UTILS_CC="gcc"

# Assembler to use for the utilities.  See also the --utils-as command line
# option.
#UTILS_AS="as"

# Linker to use for the utilities.  See also the --utils-ld command line
# option.
#UTILS_LD="ld"

# =========GENKERNEL LOCATION CONFIGURATION============
# Variables:
#   %%ARCH%%  - Final determined architecture
#   %%CACHE%% - Final determined cache location

# Set genkernel's temporary work directory.  Default is /var/tmp/genkernel
#TMPDIR="/var/tmp/genkernel"

# Set the boot directory, default is /boot
#BOOTDIR="/boot"

# Default share directory location
GK_SHARE="${GK_SHARE:-/usr/share/genkernel}"

# Location of the default cache
CACHE_DIR="/var/cache/genkernel"
# Location of DISTDIR, where our source tarballs are stored
DISTDIR="${CACHE_DIR}/src"
# Log output file
LOGFILE="/var/log/genkernel.log"
# Debug Level
LOGLEVEL=1

# =========COMPILED UTILS CONFIGURATION============
#
# Default location of kernel source
DEFAULT_KERNEL_SOURCE="/usr/src/linux"
# Default kernel config (only use to override using
# arch/%%ARCH%%/kernel-config-${VER}.${PAT} !)
#DEFAULT_KERNEL_CONFIG="${GK_SHARE}/arch/%%ARCH%%/kernel-config"

# Specifies a user created busybox config
#BUSYBOX_CONFIG="/path/to/file"
#BUSYBOX_APPLETS="[ ash sh mount uname echo cut cat"

# NOTE: Since genkernel 3.4.41 the version of
#   busybox, lvm, mdadm, .. have been moved to
#   /usr/share/genkernel/defaults/software.sh in order to
#   reduce the merging you have to do during etc-update.
#   You can still override these settings in here.


# =========MISC KERNEL CONFIGURATION============
#
# Tag the kernel and ramdisk with a name:
# If not defined the option defaults to
# 'genkernel'
#KNAME="genkernel"


# This option is only valid if kerncache is
# defined. If there is a valid kerncache no checks
# will be made against a kernel source tree
#KERNEL_SOURCES="0"


# Build a static (monolithic kernel)
#BUILD_STATIC="1"


# Make and install kernelz image (PowerPC)
#GENZIMAGE="1"


# File to output a .tar.bz2'd kernel contents
# of /lib/modules/ and the kernel config
# NOTE: This is created before the callbacks
# are run!
#KERNCACHE="/path/to/file"


# Prefix to kernel module destination, modules
# will be installed in <prefix>/lib/modules
# (.conf equivalent of --module-prefix=<dir>)
#INSTALL_MOD_PATH=""


# =========MISC INITRD CONFIGURATION============
#
# Copy all kernel modules to the ramdisk
#ALLRAMDISKMODULES="1"


# Don't copy any modules to the ramdisk
#RAMDISKMODULES="0"


# File to output a .tar.bz2'd kernel and ramdisk:
# No modules outside of the ramdisk will be
# included...
#MINKERNPACKAGE="/path/to/file.bz2"


# File to output a .tar.bz2'd modules after the
# callbacks have run
#MODULESPACKAGE="/path/to/file.bz2"


# Directory structure to include in the initramfs,
# only available on >=2.6 kernels
#INITRAMFS_OVERLAY=""


# Build the generated initramfs into the kernel instead of
# keeping it as a separate file
#INTEGRATED_INITRAMFS="1"


# Compress generated initramfs
#COMPRESS_INITRD="yes"
# Types of compression: best, xz, lzma, bzip2, gzip, lzop, fastest
# "best" selects the best available compression method
# "fastest" selects the fastest available compression method
#COMPRESS_INITRD_TYPE="best"


# Create a self-contained env in the initramfs
#NETBOOT="1"


# =========MISC BOOT CONFIGURATION============
#
# Specify a default for real_root=
#REAL_ROOT="/dev/one/two/gentoo"


I already tried setting the KEYMAP setting but it doesn't work (the keymap selected is not the used at boot).
Code:
KEYMAP="it"


Thanks!
Back to top
View user's profile Send private message
tclover
Guru
Guru


Joined: 10 Apr 2011
Posts: 516

PostPosted: Wed Feb 11, 2015 11:09 am    Post subject: Reply with quote

It seems `KEYMAP=<layout>' would do what you want... although I have no idea if it will do what... you want.
It _seems_ that there is no means to actually select a particular keymap layout on the cmdline... disappointing if it's the case.
If you want to be able to switch and set a particular keymap on the cmdline easily and feel a little adventurous to switch initramfs generating tool, follow my sig. bellow.

Good luck.
_________________
home/:mkinitramfs-ll/:supervision/:e-gtk-theme/:overlay/
Back to top
View user's profile Send private message
GSnake
Tux's lil' helper
Tux's lil' helper


Joined: 10 Sep 2012
Posts: 120
Location: Italy

PostPosted: Wed Feb 11, 2015 11:29 am    Post subject: Reply with quote

As you can see in my post above yours, I already tried KEYMAP="it" without success. :-(
_________________
Still learning... still learning...
Back to top
View user's profile Send private message
Fitzcarraldo
Veteran
Veteran


Joined: 30 Aug 2008
Posts: 1654
Location: United Kingdom

PostPosted: Wed Feb 11, 2015 12:16 pm    Post subject: Reply with quote

Code:
man 1 loadkeys

British English keyboard:
Code:
loadkeys --console=/dev/tty2 /usr/share/keymaps/i386/qwerty/uk

US English keyboard:
Code:
loadkeys --console=/dev/tty2 /usr/share/keymaps/i386/qwerty/us

Have a look in /usr/share/keymaps/i386/qwerty/ for the available keymaps.
_________________
Clevo W230SS: amd64 OpenRC elogind nvidia-drivers & xf86-video-intel.
Compal NBLB2: ~amd64 OpenRC elogind xf86-video-ati. Dual boot Win 7 Pro 64-bit.
KDE on both.

Fitzcarraldo's blog
Back to top
View user's profile Send private message
GSnake
Tux's lil' helper
Tux's lil' helper


Joined: 10 Sep 2012
Posts: 120
Location: Italy

PostPosted: Wed Feb 11, 2015 12:18 pm    Post subject: Reply with quote

Fitzcarraldo wrote:
Code:
man 1 loadkeys

British English keyboard:
Code:
loadkeys --console=/dev/tty2 /usr/share/keymaps/i386/qwerty/uk

US English keyboard:
Code:
loadkeys --console=/dev/tty2 /usr/share/keymaps/i386/qwerty/us

Have a look in /usr/share/keymaps/i386/qwerty/ for the available keymaps.


I know that I can load the keymap afterwards... I need it while initramfs is setting up my drive (I use LUKS).
Where should I put those commands?
_________________
Still learning... still learning...
Back to top
View user's profile Send private message
Roman_Gruber
Advocate
Advocate


Joined: 03 Oct 2006
Posts: 3806
Location: Austro Bavaria

PostPosted: Wed Feb 11, 2015 12:40 pm    Post subject: Reply with quote

just edit your initramfs or

check where the keys are on the us keyboard and type your pass with the us keyboard. I do type my pass with the us keyboard and with my native keyboard too.
Back to top
View user's profile Send private message
chithanh
Developer
Developer


Joined: 05 Aug 2006
Posts: 2152
Location: Berlin, Germany

PostPosted: Wed Feb 11, 2015 2:05 pm    Post subject: Reply with quote

Add --keymap to genkernel parameters when building the initramfs.
You can then add keymap=... kernel parameter to use the specified keymap.

See the genkernel man page for more information.
Back to top
View user's profile Send private message
GSnake
Tux's lil' helper
Tux's lil' helper


Joined: 10 Sep 2012
Posts: 120
Location: Italy

PostPosted: Wed Feb 11, 2015 2:07 pm    Post subject: Reply with quote

chithanh wrote:
Add --keymap to genkernel parameters when building the initramfs.
You can then add keymap=... kernel parameter to use the specified keymap.

See the genkernel man page for more information.


What about genkernel.conf? Should I uncomment KEYMAP="it"?

EDIT:

I think I should edit genkernel.conf KEYMAP to KEYMAP="yes" and then add the boot paramenter "keymap=it". Right? (Testing this asap)

EDIT EDIT:

I confirm. It works now! :-D
_________________
Still learning... still learning...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum