Emidio Planamente 's Homepage

Home GNU/Linux Programming Technology Sport Others Contact

Search

  Google linux


Debian

  Apt-get
  Debian Anatomy
  Debian Backports
  Debian Help
  Debian Planet
  Debian Swiss
  History of Debian
  Getdeb
  Kernel
  Kernel 2.6
  Packages
  Refcard for newbie
  Reference book
  SATA raid
  Weekly News


Official Docs

  Distrowatch
  Firewire
  Gimp
  Gimp Photo Archive
  Linuxdoc
  Linuxdoc Reference
  Linux Focus
  Linux From Scratch
  Linux Hacks
  Linux Hardware
  Linux Printing
  MySQL
  O'Reilly
  Rute
  Source Forge
  USB guide


Installation

  Instalinux
  Preseed


Laptop

  Linux on Laptops
  Linux Toshiba
  Tux Mobil


Live-CDs

  Create it Your self
  Knoppix
  Kororaa XGL 3


Pictures

  Bay13
  Gnomelook
  Kuznetsov


Security

  GNU/Linux
  PortsDB


Linux based product

  Dreambox


Free web service

  S5 presents


Against Micro$oft

  Combatti Micro$oft
  Microsuck


HTML validator CSS validator

 

UDEV micro howto


1. UDEV

2. DEVFS


1. UDEV


1.1. Introduction


UDEV seems to replace DEVFS. Actualy, DEVFS is not really supported anymore.


1.2. Requirements


Kernel 2.6 with udev support.


1.3. Installation


Just call


  apt-get install udev gnome-volume-manager


1.4. Configuration


Add sysfs in fstab


  none /sys sysfs defaults 0 0


and mount it


  mount /sys


1.5. Device configuration


Each device seems to be identified by a model and vendor. Here how to find out these values.


Plug in your USB device and get the device name:


  tail -n 20 /var/log/message


You should find sda or sdb or something like this.


In the next steps, replace sda with what you have found before.


Call


  udevinfo -q path -n /dev/sda


  udevinfo -a -p /sys/block/sda | grep BUS

  udevinfo -a -p /sys/block/sda | grep model

  udevinfo -a -p /sys/block/sda | grep vendor


You should find something like:


  BUS="scsi"

  SYSFS{model}="..."

  SYSFS{vendor}="Apacer  "


Add and entry in /etc/udev/udev.rules:


  BUS="scsi", SYSFS{vendor}="Apacer  ", NAME="apacer%n", SYMLINK="%k"


Create directory for script to be called (replace apacer with your vendor name)


  mkdir /etc/dev.d/apacer-1


and copy the following script in /etc/dev.d/apacer-1/mount


  #!/bin/sh


  if [ "$ACTION" == "add" ]

  then

    USER=`ps -elf | grep x-session-manager | cut -d " " -f 3 | head -n 1`

    su -c "mount /media/palmint-1" $USER

  fi


Create mountpoint:


    mkdir /media/apacer-1


add following line in your /etc/fstab:


  /dev/apacer-1   /media/apacer-1    auto    user,noauto,noatime,sync,defaults



Hal-volume-manager can show a lot informations about your hardware, but I couldn't find a package providing it.


2. DEVFS


2.1. What it was?


DEVFS is the old implementation of the dynamic device allocation. It has been replaced by UDEV.



Emidio Planamente

Last modified on 2024-08-02