Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
problem after update, corrupted keymaps and udev error
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
roger_lf
n00b
n00b


Joined: 05 Jul 2011
Posts: 12

PostPosted: Thu Feb 02, 2012 3:14 pm    Post subject: problem after update, corrupted keymaps and udev error Reply with quote

Hi,

I think I corrupted my "keymaps" init script... :(

Here is what happened: after a long time, yesterday I made an update world. Because it pulled KDE 4.8 (I am using the kde overlay), the compilation took some time, so I made it yesterday night and left it compiling the whole night.

Today at morning, I went on with the update process (emerge --depclean, revdep--rebuild...) The problem was when I ran etc-update, I think I did something wrong and half updated the "keymaps" (remember seeing this as one of the files to update).

Now, when I reboot my system, there is an error message when the init.d scripts are running. It is very quick, but I could see that there was some error in the 50th line of the "keymaps" file. The other scripts kept loading. At the end, insted of appearing the KDM login screen, it appeared an X login screen and it was a frozen screen, it did not receive any input from the keyboard or mouse. Not even Ctrl+Alt+(F1---[/code]F12)

So, I reset the laptop and booted in a Kubuntu LiveCD. I accessed my hard drive and opened the /etc/init.d/keymaps, it was like this:
Code:
#!/sbin/runscript
# Copyright (c) 2007-2008 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.

description="Applies a keymap for the consoles."

depend()
{
   need localmount termencoding
   after bootmisc
   keyword -openvz -prefix -uml -vserver -xenu -lxc
}

start()
{
   ttyn=${rc_tty_number:-${RC_TTY_NUMBER:-12}}
   : ${unicode:=$UNICODE}
   : ${keymap:=$KEYMAP}
   : ${extended_keymaps:=$EXTENDED_KEYMAPS}
   : ${windowkeys:=$SET_WINDOWSKEYS}
   : ${fix_euro:=$FIX_EURO}
   : ${dumpkeys_charset:=${DUMPKEYS_CHARSET}}

   if [ -z "$keymap" ]; then
      eerror "You need to setup keymap in /etc/conf.d/keymaps first"
      return 1
   fi

   local ttydev=/dev/tty n=
   [ -d /dev/vc ] && ttydev=/dev/vc/

   # Force linux keycodes for PPC.
   if [ -f /proc/sys/dev/mac_hid/keyboard_sends_linux_keycodes ]; then
      echo 1 > /proc/sys/dev/mac_hid/keyboard_sends_linux_keycodes
   fi

   local wkeys= kmode="-a" msg="ASCII"
   if yesno $unicode; then
      kmode="-u"
      msg="UTF-8"
   fi
   yesno $windowkeys && wkeys="windowkeys"

   # Set terminal encoding to either ASCII or UNICODE.
   # See utf-8(7) for more information.
   ebegin "Setting keyboard mode [$msg]"
   n=1
   while [ $n -le $ttyn ]; do
      kbd_mode $kmode -C $ttydev$n


I don't understand scripting, but I notice that it was missing the final close bracket "}", so I added it. When I rebooted the system, the same problem happened again, I guess there is something missing from this script.

Any help is appreciated!


Last edited by roger_lf on Thu Feb 02, 2012 5:48 pm; edited 1 time in total
Back to top
View user's profile Send private message
avx
Advocate
Advocate


Joined: 21 Jun 2004
Posts: 2070

PostPosted: Thu Feb 02, 2012 4:05 pm    Post subject: Reply with quote

Don't know how that should have happened, but for reference, here's my (unmodified) file
Code:
#!/sbin/runscript
# Copyright (c) 2007-2008 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.

description="Applies a keymap for the consoles."

depend()
{
        need localmount termencoding
        after bootmisc
        keyword -openvz -prefix -uml -vserver -xenu -lxc
}

start()
{
        ttyn=${rc_tty_number:-${RC_TTY_NUMBER:-12}}
        : ${unicode:=$UNICODE}
        : ${keymap:=$KEYMAP}
        : ${extended_keymaps:=$EXTENDED_KEYMAPS}
        : ${windowkeys:=$SET_WINDOWSKEYS}
        : ${fix_euro:=$FIX_EURO}
        : ${dumpkeys_charset:=${DUMPKEYS_CHARSET}}

        if [ -z "$keymap" ]; then
                eerror "You need to setup keymap in /etc/conf.d/keymaps first"
                return 1
        fi

        local ttydev=/dev/tty n=
        [ -d /dev/vc ] && ttydev=/dev/vc/

        # Force linux keycodes for PPC.
        if [ -f /proc/sys/dev/mac_hid/keyboard_sends_linux_keycodes ]; then
                echo 1 > /proc/sys/dev/mac_hid/keyboard_sends_linux_keycodes
        fi

        local wkeys= kmode="-a" msg="ASCII"
        if yesno $unicode; then
                kmode="-u"
                msg="UTF-8"
        fi
        yesno $windowkeys && wkeys="windowkeys"

        # Set terminal encoding to either ASCII or UNICODE.
        # See utf-8(7) for more information.
        ebegin "Setting keyboard mode [$msg]"
        n=1
        while [ $n -le $ttyn ]; do
                kbd_mode $kmode -C $ttydev$n
                : $(( n += 1 ))
        done
        eend 0

        ebegin "Loading key mappings [$keymap]"
        loadkeys -q $wkeys $keymap $extended_keymaps
        eend $? "Error loading key mappings" || return $?

        if yesno $fix_euro; then
                ebegin "Fixing font for euro symbol"
                # Fix some fonts displaying the Euro, #173528.
                echo "altgr keycode 18 = U+20AC" | loadkeys -q
                eend $?
        fi

        # Save the keymapping for use immediately at boot
        if [ -w "$RC_LIBEXECDIR" ]; then
                mkdir -p "$RC_LIBEXECDIR"/console
                dumpkeys >"$RC_LIBEXECDIR"/console/keymap
        fi
}
hope that helps.
_________________
++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.
Back to top
View user's profile Send private message
roger_lf
n00b
n00b


Joined: 05 Jul 2011
Posts: 12

PostPosted: Thu Feb 02, 2012 5:45 pm    Post subject: Reply with quote

Thanks! A section of the end of the script was missing, so I used your to replace it.

The good news is that this error message is gone.

The bad news is that the problem persists. Now that the error message about the keymaps is gone, I notice there is a second error message, about udev failing to execute some files:
Code:
 udev[1466]: failed to execute '/usr/sbin/alsactl' '/usr/sbin/alsactl restore 0': No such file or directory
udev[1470]: failed to execute '/lib/udev/pci-db' 'pci-db /devices/pci0000:00/0000:00:1f.1' : No such file or directory
udev[1471]: failed to execute '/lib/udev/pci-db' 'pci-db /devices/pci0000:00/0000:00:1f.2': No such file or directory

Those are the error messages that I was able to see while the scripts where going through to screen.

What can this be?
Back to top
View user's profile Send private message
Acidphase
n00b
n00b


Joined: 15 Jul 2011
Posts: 21

PostPosted: Fri Feb 03, 2012 6:22 am    Post subject: Hmmz Reply with quote

roger_lf wrote:
Thanks! A section of the end of the script was missing, so I used your to replace it.

The good news is that this error message is gone.

The bad news is that the problem persists. Now that the error message about the keymaps is gone, I notice there is a second error message, about udev failing to execute some files:
Code:
 udev[1466]: failed to execute '/usr/sbin/alsactl' '/usr/sbin/alsactl restore 0': No such file or directory
udev[1470]: failed to execute '/lib/udev/pci-db' 'pci-db /devices/pci0000:00/0000:00:1f.1' : No such file or directory
udev[1471]: failed to execute '/lib/udev/pci-db' 'pci-db /devices/pci0000:00/0000:00:1f.2': No such file or directory

Those are the error messages that I was able to see while the scripts where going through to screen.

What can this be?


It's a longs hot have you tried to re-emerge udev ? Also future reference I had allot of problems with etc-update dispatch-conf is nicer IMO.
There is another app out there too called cfg-update but I haven't used it too much you can heck it out as well.
_________________
-Acidphase
Back to top
View user's profile Send private message
Aquous
l33t
l33t


Joined: 08 Jan 2011
Posts: 645

PostPosted: Fri Feb 03, 2012 2:17 pm    Post subject: Reply with quote

It looks like your /etc/init.d/keymaps file had been truncated. Perhaps the same has happened to udev & alsa.
Time for an fsck?
Afterwards, you can see if 'emerge -1 udev alsa-utils' helps.
Back to top
View user's profile Send private message
sebB
Apprentice
Apprentice


Joined: 02 Mar 2011
Posts: 229
Location: S.O. France

PostPosted: Fri Feb 03, 2012 2:48 pm    Post subject: Reply with quote

You use what profile?

Try compiling udev with USE="extras"
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo 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