Solved setup keyboard language post-install process

vince66

Well-Known Member

Reaction score: 11
Messages: 398

Hi !

Probably, installing FreeBSD I have not setup the keyboard.
Now, everytime I reboot the machine, I need to type kbdmap -K to enter the italian keyboard.

Please, can you tell me ho to fix this problem and definively setup my keyboard ?

I apologize with you for the question. Surely this topic has been posted; however, searching "setup keyboard reset" I haven't found anything.

Regards.

Vincenzo.
 
OP
OP
vince66

vince66

Well-Known Member

Reaction score: 11
Messages: 398

Dear guys,

I apologize with you for my questions related to the base knowledge of FreeBSD.
I've downloaded from the FreeBSD homepage the Handbook and other bibliography.
My knowdlege are related to the Unix BSD 4.3, but I worked with it many years ago (when mailing lists and forums there wasn't).
Obviously i remember the foundamental concepts, and obviously i could look for replies to my questions on the Handbook.
I do it, but sometimes, I prefer to write to the forum to learn eventual different approaches by long time expert people as you.

So, I again apologize with you if my questions appear duplicated,but an online forum gives the possibility to better discuss some mechanism.

I wish to thank you for the help online because it allowed me to understand and solve speedly the problems.

Please, if some of my questions seems stupid or duplicated, I appreciate the administrator if he delete it.

Regards.

Vincenzo.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 6,970
Messages: 28,968

A wise man learns more from asking a dumb question than a dumb man learns from a wise answer ;)

That said, we do expect people to investigate for themselves. The documentation is quite good so you're definitely advised to read it. But even our excellent documentation can be a bit difficult to understand. So if you have any specific problems and don't quite understand the documentation feel free to ask. That's what we're here for.
 
OP
OP
vince66

vince66

Well-Known Member

Reaction score: 11
Messages: 398

Thanks, thanks very much !

Have you a nice day.

Regards.

Vincenzo.
 
OP
OP
vince66

vince66

Well-Known Member

Reaction score: 11
Messages: 398

Dear guys,
I've read the localization chapter on the handbook, then I've tried to ways:

1 - I've modify my /etc/rc.conf, adding the line: keyboard=it.kbd as k.jacker wrote me.

2 - More, I've changed the /etc/login.conf file, with the lines:
Code:
:charset=ISO8859-1:\
:lang=it_CH.ISO8859-1:\
:tc=default:
but, rebooting, the keyboard layout doesn't switch to Italian keyboard.

Please, tips are welcome.

Thanks in advance.

Regards.

Vincenzo
 
Last edited by a moderator:

chrbr

Aspiring Daemon

Reaction score: 240
Messages: 668

Hello vince66,
to make the changes available you need to run cap_mkdb login.conf in the etc directory. This will update /etc/login.conf.db with your changes. The cap_mkdb() procedure is required for many configurations. I am not sure if you have to login or to reboot to make the system read that file.
EDIT: The advise of sidetone is correct. You need the correct /etc/rc.conf, too.
 
OP
OP
vince66

vince66

Well-Known Member

Reaction score: 11
Messages: 398

Thanks very much.

I forgot to write here the quotes; but I put them in the /etc/rc.conf.
However, I forgot to run cap_mkdb login.conf ... probably is this the mistake.

Please, can you tell me if the two ways (modify of /etc/rc.conf and modify of /etc/login.conf) are equivalent? If no, what is the difference in between them?

Many thanks!

Vincenzo.
 
Last edited by a moderator:
OP
OP
vince66

vince66

Well-Known Member

Reaction score: 11
Messages: 398

Ok jacker ... I'll try to modify /etc/rc.conf avoiding the kbd postfix. Thanks !! Vincenzo.
 

k.jacker

Aspiring Daemon

Reaction score: 331
Messages: 567

Hei Vince66,
:charset=ISO8859-1:\
:lang=it_CH.ISO8859-1:\
:tc=default:
Since you have special characters in italy like à, è, ì, ò, ù i think you'd better use
Code:
:charset=it_CH.UTF-8:\
:lang=it_CH.UTF-8:\
:tc=default:
Setting the keymap="it" in /etc/rc.conf is necessary and has to be set to map the keys of your italien keyboard to an italien keyboard layout.
Setting lang in /etc/rc.conf or alternatively in your home directory ~/.login_conf, sets the environment variable LANG to that value.
Check it out by typing env.
Same could be done by setting the following in your ~/.cshrc
Code:
setenv LANG it_CH.UTF-8
If you make changes to /etc/login.conf the are globally and affect everybody using the system.
Would be useful if you use your computer with your familiy members, where everybody speaks italien.
Per user settings are done via the files in your home directory~/.login_conf or~/.cshrc .

One advantage on a system with only single (or few) user is use the per user settings.
Because you avoid changing a system file (/etc/login.conf) and you have one less file to deal with when your updating FreeBSD.
That's not how you have to handle it, but how I handle it, just to give you an idea ;)
 
OP
OP
vince66

vince66

Well-Known Member

Reaction score: 11
Messages: 398

Hi Jacker !
Thanks ! I've understood now the difference beetwen changes in /etc/login.conf and changes in .cshrc.
However, tell me please, if changes in /etc/login.conf and changes in .cshrc are independent ... I think so .... but doing only changes in /etc/login.conf and typing cap_mkdb login.conf has no effect. And rebooting the layout of my keyboard doesn't change.

I hope to hear you soon.

Bye !
 
OP
OP
vince66

vince66

Well-Known Member

Reaction score: 11
Messages: 398

Another thing.
How can see if I have a VT console ? It seems the UTF-8 works with VT console. At login I have ttyv0, so I should have a VT console.

More: the login.conf file has several fields
defaults:\
standars:\
xuser:\
.....
.....

root:\

I've modify it in the root:\ field, adding the lines
:charset=it_CH.UTF-8:\
:lang=it_CH.UTF-8:\
:tc=default:

updating the database with: cap_mkdb login.conf
and setting the keymap="it" in /etc/rc.conf

Rebooting, my keyboard doesn't switch to italian layout.

Bye !
 

k.jacker

Aspiring Daemon

Reaction score: 331
Messages: 567

Ok, Vincenzo. A few things to think about.

1. You shouldn't touch the root:\ entry in /etc/login.conf. Everytime you upgrgrade FreeBSD you will have to deal with these change you made. Chances are you ruin the database for root, which i can imagine will give a lot of headache.

2. In general, don't use the root account for everyday work, create an user-account with adduser.

3. If you want the root account to have italien keyboard add this to /root/.cshrc
Same could be done by setting the following in your ~/.cshrc
Code:
setenv LANG it_CH.UTF-8
4. Restore back the changes you made to root:\ in /etc/login_conf and cap_mkdb /etc/login.conf.
It is important that every line but the last ends with :\
It is also important to give cap_mkdp the pass to the right login.conf file.
Every user directory contains a .login_conf. So making changes to /etc/login.conf and then running cap_mkdp .login_conf will only rebuild the database for that user and the changes in /etc/rc.conf will not take effekt. That's maybe what you are experiencing or you made a mistake with the :\ explained above.

5. If you still only use the root account, create a user account now and change /home/vincenzo/.login_conf
Code:
me:\
:charset=it_CH.UTF-8:\
:lang=it_CH.UTF-8:
Run % cap_mkdb /home/vinzenco/.login_conf (as vincenzo, not as root)

6. check /etc/rc.conf that there is only one keymap="whatever" entry. Maybe your ="it" gets overwritten by another entry made by the installer.

7. check if you are on VT: sysctl kern.vty should give you
Code:
kern.vty: vt
P.S. I can confirm that italian layout and letters on the console work for me, I tried it out.
 
OP
OP
vince66

vince66

Well-Known Member

Reaction score: 11
Messages: 398

Hi !
I've done a new installation of the 11.1 stable freeBSD OS, and during the installation, I've choosen to only create the root user and the italian keyboard layout. Now the italian keyboard works properly.
Please, can you tell me in which files has the installer defined the information about the italian keyboard layout ?
No information I see in the /home/.cshrc, /home/.profile, /etc/login.conf and the env command no LANG setting shows.

More, only in /etc/rc.conf I see the line: keyboard= "it.iso.kbd". Where is defined this type of keyboard ? In /usr/share/vt/keyboards is it.kbd. Is it the same ?

How can I change this type to UFT ?

Thanks in advance.

Vincenzo.
 

k.jacker

Aspiring Daemon

Reaction score: 331
Messages: 567

No the installer isn't up to date, so even the console driver default to vt, the installer still installs a keymap for the old sc console.
sc keymaps are read from /usr/share/syscons/keymaps and have slightly different names (and don't work in vt console).
change the entry in /etc/rc.con to keymap="it".
Simply add to root's .cshrc
Code:
setenv LANG it_CH.UTF-8
Reboot and then you should see the LANG variable is set to it_CH.UTF-8 and also italien special character should work.
 
OP
OP
vince66

vince66

Well-Known Member

Reaction score: 11
Messages: 398

Setting the keymap="it" in /etc/rc.conf

Simply add to root's .cshrc
setenv LANG it_CH.UTF-8

Reboot and then you should see the LANG variable is set to it_CH.UTF-8 and also italien special character should work.
Perfect ! It works !!
Thanks very much !
 
Top