Difference between revisions of "Udev"

From gr0x0rd
Jump to navigation Jump to search
Line 13: Line 13:
 
  '''$''' sudo nano -w /etc/portage/package.mask
 
  '''$''' sudo nano -w /etc/portage/package.mask
 
Add the line  
 
Add the line  
   
+
  sys-apps/hal
Sync portage before getting started with emerging packages.
 
'''$''' sudo emerge --sync
 
 
Next you will want to perform the following emerge.
 
Next you will want to perform the following emerge.
  '''$''' sudo emerge -av gnome-base/gvfs sys-fs/udisks sys-power/upower sys-auth/polkit
+
  '''$''' sudo emerge -av gnome-base/gvfs sys-fs/udisks sys-power/upower sys-auth/polkit polkit-gnome  
While the emerge is being performed, we will need to made a few modifications to the kernel.
 
'''$''' cd /usr/src/linux
 
'''$''' sudo make menuconfig
 
Ensure the following settings are enabled or disabled:
 
-> General setup
 
  -> Auditing support
 
    [*] Enable system-call auditing support
 
 
-> Power management and ACPI options
 
  [*] Run-time PM core functionality 
 
 
-> Device Drivers
 
  [ ] ATA/ATAPI/MFM/RLL support (DEPRECATED)
 
  -> USB support
 
      -> Support for Host-side USB
 
            [*]    USB runtime power management
 
When done, save your kernel config and build the new kernel.
 
'''$''' sudo make && sudo make modules_install
 
While your new kernel is being built, you'll need to update your system with the new USE flags.
 
'''$''' sudo emerge -avuDNt world
 
Once your new kernel is ready, copy it to your boot partition.
 
'''$''' sudo cp /usr/src/linux/arch/x86/boot/bzImage /boot/kernel
 
If you have a gtk based desktop such as xfce, you'll need to emerge a new policy kit.
 
'''$''' sudo emerge -av polkit-gnome  
 
Once your world update has completed, it's time to stop HAL, remove it from startup and unmerge it.
 
'''$''' sudo /etc/init.d/hald stop
 
'''$''' sudo rc-update del hald
 
'''$''' sudo emerge -C hal policykit devicekit devicekit-disks devicekit-power
 
 
Next, start the daemons needed to complete the migration and add them to startup.
 
Next, start the daemons needed to complete the migration and add them to startup.
 
  '''$''' sudo rc-update add dbus default
 
  '''$''' sudo rc-update add dbus default
 
  '''$''' sudo rc-update add consolekit default
 
  '''$''' sudo rc-update add consolekit default
 
  '''$''' sudo /etc/init.d/consolekit start  
 
  '''$''' sudo /etc/init.d/consolekit start  
If you are using slim to start X, you'll need to adjust the ''/etc/pam.d/system-login'' file.
+
Next, issue the command  
'''$''' sudo nano -w /etc/pam.d/system-login
 
Change the line
 
session  optional  pam_ck_connector.so nox11
 
to
 
session  optional  pam_ck_connector.so
 
We will also need to change the ''/etc/slim.conf'' file.
 
'''$''' sudo nano -w /etc/slim.conf
 
Ensure the file contains the following directive:
 
login_cmd    exec ck-launch-session startxfce4
 
Finally, re-emerge your video drivers and driver packages for xorg. Substitute ''nvidia-drivers'' with your video driver. If you are using virtualbox, you will also need to reinstall the ''virtualbox-modules'' package.
 
'''$''' sudo emerge $(qlist -IC x11-drivers) nvidia-drivers virtualbox-modules
 
Reboot your system into the new kernel. Once you have booted, issue the command  
 
 
  '''$''' ck-list-sessions
 
  '''$''' ck-list-sessions
You should see something like this:
+
If you have configured your kernel correctly, you should see something like this:
 
<pre>
 
<pre>
 
Session2:
 
Session2:
Line 71: Line 29:
 
seat = 'Seat1'
 
seat = 'Seat1'
 
session-type = ''
 
session-type = ''
'''active = TRUE'''
+
<b>active = TRUE</b>
 
x11-display = ':0.0'
 
x11-display = ':0.0'
 
x11-display-device = '/dev/tty7'
 
x11-display-device = '/dev/tty7'

Revision as of 08:37, 10 May 2011

Configuring hardware - udev

After trying on a few occasions to do this myself, I was forced to finally commit with the release of xfce 4.8. The steps here are based on the instructions outlined by ssuominen on the gentoo forums and with contributions from others in the gentoo community. First, make the necessary modifications to your /etc/make.conf.

$ sudo nano -w /etc/make.conf

Ensure the following USE flags are set:

USE="-hal consolekit dbus pam policykit udev" 

Next we will make some modifications to /etc/portage/package.use .

$ sudo nano -w /etc/portage/package.use

Ensure the following directives are set. You may also want to ensure the hal USE flag is removed if you've added it to any package in the file.

gnome-base/gvfs gdu
sys-block/parted device-mapper 

Next we will mask hal so it doesn't get pulled in by other packages.

$ sudo nano -w /etc/portage/package.mask

Add the line

sys-apps/hal

Next you will want to perform the following emerge.

$ sudo emerge -av gnome-base/gvfs sys-fs/udisks sys-power/upower sys-auth/polkit polkit-gnome 

Next, start the daemons needed to complete the migration and add them to startup.

$ sudo rc-update add dbus default
$ sudo rc-update add consolekit default
$ sudo /etc/init.d/consolekit start 

Next, issue the command

$ ck-list-sessions

If you have configured your kernel correctly, you should see something like this:

Session2:
	unix-user = '1000'
	realname = '(null)'
	seat = 'Seat1'
	session-type = ''
	<b>active = TRUE</b>
	x11-display = ':0.0'
	x11-display-device = '/dev/tty7'
	display-device = ''
	remote-host-name = ''
	is-local = TRUE
	on-since = '2011-03-14T05:50:56.403353Z'
	login-session-id = '1'
Session1:
	unix-user = '1000'
	realname = '(null)'
	seat = 'Seat2'
	session-type = ''
	active = FALSE
	x11-display = ':0.0'
	x11-display-device = ''
	display-device = ''
	remote-host-name = ''
	is-local = TRUE
	on-since = '2011-03-14T05:50:56.177323Z'
	login-session-id = '1'

If you see something similar to the above, you're in business. The key item is the bolded value above.