Logo Espacio Linux Paypal - Acepta pagos con tarjeta en tu negocio      
Portada Manuales Linux Descargas Foros Buscar Mapa del sitio Ayuda BlogEL
   Iniciar sesión | Registrarse    
 
Principal

Patrocinadores

Boletín Espacio Linux
Las novedades del sitio y el mundo Linux en tu email.


Usuarios
Bienvenido, Anónimo

     Miembros:
Último: RubenSilisque
Nuevos hoy: 0
Nuevos ayer: 16
Total: 30396

     Navegando:
Anónimos: 149
Miembros: 1
Total: 150


Miembros conectados:

01: alfonsiyo

Mensajes recientes
 Instalación de distribuciones
 Instalar distribucion
 Como recuperar archivos particion fat32 borrados con linux
 Software
 busco programa para bajar torrent administrable desde web
 Problemas con la instalcion de Ubuntu Server
 Hardware
 CONECTAR LINUX A LA RED
 ¿como puedo mejorar la señal inalambrica?
 Programación
 Scripts
 Cómo saber los archivos de una carpeta en java
 Sistema
 Kernel Panic - Not syncing: VFS: Unable to mount...
 ¿Donde está lo descargado del streaming?
 Seguridad
 usuario y contraseña en ubuntu
 Firewall en Linux
 Redes y Servidores
 Mandriva no encuentra redes wifi
 Wifi en mandriva 2009
 Proyectos
 gestion de memoria
 Hacer distribucion de linux
 Debates
 La peor distro de linux...
 10 cosas linux debería mejorar...
 El Café
 Gmail ahora con themes
 querida abue deb...
 Desarrollo Web
 copia de seguridad de base de deatos
 Ni idea una ayudita
 Documentación
 Publica tus documentos en la nueva sección Manuales Linux
 Donde Puedo Conseguir libro de linux actualizado?
 Screenshots
 Está por llegar el concurso screenshots 2008
 Mi Desktop de Diciembre (beta)
 KDE
 Problema con sesion en KDE 3.5
 Problema con el panel de KDE
 GNOME
 XVNC o control remoto multiusuario
 KDE en Gnome
 Otros escritorios y entornos
 (SOLUCIONADO) Ayuda con fluxbox, no puedo iniciarlo
 quien ocupa menos memoria
 X Window
 Debian Lenny+Compiz= Problemas con los videos
 Ubuntu 8.4+compiz
 Vídeos
 Kill -9
 Lo que las pequeñas hoy en dia hacen!

[ Entrar a los foros ]
Buscar

Sitios amigos

Espacio Linux :: Ver tema - [Espacio Linux] Udev en Slackware
ReglamentoReglamento general de los foros
 FAQFAQ  BuscarBuscar  Grupos de usuariosGrupos de usuarios  Miembros  PerfilPerfil
  Mensajes privadosMensajes privados  

[Espacio Linux] Udev en Slackware

Publicar nuevo tema  Responder al tema  Foros de discusión -> Documentación
Ver tema anterior :: Ver tema siguiente  
Autor Mensaje
Ayax
Administrador
Administrador



Miembro No. 2
Registrado: Abr 26, 2003
Mensajes: 2606
Ubicación: León, Guanajuato; México.

MensajePublicado: Lun Feb 19, 2007 11:46 am    Asunto: [Espacio Linux] Udev en Slackware Responder citando

Hola:

Se abre este post para comentar, exponer dudas o hacer observaciones sobre el documento publicado en el Taller Linux : "Udev en Slackware" bajo la autoria de Meleagro.

Son bienvenidos todos sus mensajes al respecto.

Saludos.
_________________
Ayax
Reglamento del foro | Temas más preguntados | Blog personal
Volver arriba
Ver perfil de usuario Enviar mensaje privado Visitar sitio web del usuario
meleagro
Miembro ETEL
Miembro ETEL



Miembro No. 8209
Registrado: Jun 07, 2005
Mensajes: 1162
Ubicación: En tus pesadillas

MensajePublicado: Lun Feb 19, 2007 1:51 pm    Asunto: Re: [Espacio Linux] Udev en Slackware Responder citando

Ajax creo que te mandé el tutorial con una errata, donde pone:

# Start the udev setup procedure.
if [ -x /etc/rc.d/rc.udev ]; then
. /etc/rc.d/rc.udev
fi

Debeía poner:

# Start the udev setup procedure.
if [ -x /etc/rc.d/rc.udev ]; then
. /etc/rc.d/rc.udev start
fi

Un saludo !!!
_________________
Slack in peace
Usuario Linux # 385639
http://www.meleagro.es.kz
Participa en #espaciolinux - irc.freenode.net
Volver arriba
Ver perfil de usuario Enviar mensaje privado Enviar email Visitar sitio web del usuario
Ayax
Administrador
Administrador



Miembro No. 2
Registrado: Abr 26, 2003
Mensajes: 2606
Ubicación: León, Guanajuato; México.

MensajePublicado: Lun Feb 19, 2007 2:02 pm    Asunto: Re: [Espacio Linux] Udev en Slackware Responder citando

Hola, Meleagro:

Ya está corregido.

Un saludo.
_________________
Ayax
Reglamento del foro | Temas más preguntados | Blog personal
Volver arriba
Ver perfil de usuario Enviar mensaje privado Visitar sitio web del usuario
ponky
Forista Medio
Forista Medio



Miembro No. 19484
Registrado: Feb 12, 2007
Mensajes: 116
Ubicación: Mexico

MensajePublicado: Mar Mar 13, 2007 3:51 am    Asunto: Re: [Espacio Linux] Udev en Slackware Responder citando

ya que se habla de Udev, voy a poner algo que vi en http://esslackware.blogspot.com/
ese blog es uno de los que traen los mejores consejos practicos para slack aunque sea nuevo Bromeando

Cita:
Modificamos /etc/udev/udev.conf

# udev.conf
# The main config file for udev
#
# This file can be used to override some of udev's default values
# for where it looks for files, and where it places device nodes.


# udev_root - where in the filesystem to place the device nodes
udev_root="/dev/"

# udev_db - The name and location of the udev database.
udev_db="/dev/.udev.tdb"

# udev_rules - The name and location of the udev rules dir
udev_rules="/etc/udev/rules.d"

# default_mode - set the default mode for all nodes that have no
# explicit match in the permissions file
default_mode="666"

# default_owner - set the default owner for all nodes that have no
# explicit match in the permissions file
default_owner="root"

# default_group - set the default group for all nodes that have no
# explicit match in the permissions file
default_group="root"

# udev_log - set to "yes" if you want logging, else "no"
udev_log="no"

Creamos /etc/udev/rules.d/20-hotmount.rules

# USB storage devices
KERNEL=="sd*|sr*|ub*", ACTION=="add", SUBSYSTEMS=="usb", ENV{DEVFLAG}="usbdisk", NAME="%k", GROUP="cdrom", MODE="0660", RUN+="/lib/udev/usbmount.sh add /dev/%k"
KERNEL=="sd*|sr*|ub*", ACTION=="remove", ENV{DEVFLAG}=="usbdisk", RUN+="/lib/udev/usbmount.sh remove /dev/%k"


Creamos /lib/udev/usbmount.sh
#!/bin/sh
# This script mounts USB and other mass storage devices when they are plugged in
# and unmounts them when they are removed.
# It also creates mountpoints as needed, and removes them afterward
# Copyright (C) 2006 Jean-Philippe Guillemin and Mark Colclough
#
# This file is free software; the copyright holder gives unlimited
# permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
#
# This file is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
#

# Usage : [hotmount.sh|usbmount.sh|firemount.sh|pcmciamount.sh]  (add|remove) DEVICE [MOUNTPOINT]
# if the variable $NICEMOUNTPOINT is defined it will be used as the first tried mountpoint

# version 1.0 11/06/2006

VERBOSE="no"

# Log a string via the syslog facility.
log()
{
[ "$VERBOSE" = "yes" ] && logger -p user.$1 -t "usbmount[$$]" -- "$2"
}


# Test if the first parameter is in the list given by the second
# parameter.
in_list()
{
for v in $2; do
test "$1" != "$v" || return 0
done
return 1
}

# Test if /lib/udev/vol_id is executable.
test -x /lib/udev/vol_id || { log err "cannnot execute /lib/udev/vol_id"; exit 1; }

# Default mountpoints depend on how we were called
case "${0##*/}" in
firemount.sh)
MOUNTPOINTS="/mnt/fire /mnt/fire1 /mnt/fire2 /mnt/fire3 /mnt/fire4  /mnt/fire5 /mnt/fire6 /mnt/fire7 /mnt/fire8 /mnt/fire9 /mnt/fire10  /mnt/fire11"
;;
pcmciamount.sh)
MOUNTPOINTS="/mnt/pcm /mnt/pcm1 /mnt/pcm2 /mnt/pcm3 /mnt/pcm4  /mnt/pcm5 /mnt/pcm6 /mnt/pcm7 /mnt/pcm8 /mnt/pcm9 /mnt/pcm10  /mnt/pcm11"
;;
mmcmount.sh)
MOUNTPOINTS="/mnt/mmc /mnt/mmc1 /mnt/mmc2 /mnt/mmc3 /mnt/mmc4  /mnt/mmc5 /mnt/mmc6 /mnt/mmc7 /mnt/mmc8 /mnt/mmc9 /mnt/mmc10  /mnt/mmc11"
;;
*)
MOUNTPOINTS="/mnt/usb /mnt/usb1 /mnt/usb2 /mnt/usb3 /mnt/usb4  /mnt/usb5 /mnt/usb6 /mnt/usb7 /mnt/usb8 /mnt/usb9 /mnt/usb10  /mnt/usb11"
;;
esac
MOUNTOPTIONS=" noauto,user,rw,owner,exec"

# The device name MUST be given as 2nd argument
DEVNAME="$2"

# Maybe a user-defined mountpoint in fstab ?
FSTABMOUNTPOINT="$(grep "$DEVNAME[[:space:]]" /etc/fstab | awk '{print $2}' | tail -n1)"
[ "$FSTABMOUNTPOINT" ] && MOUNTPOINTS="$FSTABMOUNTPOINT $MOUNTPOINTS"
FSTABMOUNTOPTIONS="$(grep "$DEVNAME[[:space:]]" /etc/fstab | awk '{print $4}' | tail -n1)"

# The mount point COULD be given as 3rd argument
[ "$3" ] && MOUNTPOINTS="$3 $MOUNTPOINTS"

# if the variable $NICEMOUNTPOINT is defined it will be used as the first tried mountpoint
[ "$NICEMOUNTPOINT" ] && MOUNTPOINTS="$NICEMOUNTPOINT $MOUNTPOINTS"

umask 000

if [ "$1" = add ] ; then

log info "devname == $DEVNAME !!"
# Try to read from the device. Some devices need a few seconds
# initialization time before they can be accessed. Give up after
# 20 seconds (a Markish infinite... Guiñando un ojo.
log info "testing whether $DEVNAME is readable"
read_success=no
for t in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19; do
dd if="$DEVNAME" of=/dev/null bs=512 count=1
if [ "$?" = "0" ] ; then
read_success=yes
break
fi
log info "attempt $t to read from $DEVNAME failed"
sleep 1
done
if [ "$read_success" != "yes" ]; then
log err "cannot read from $DEVNAME"
exit 1
fi

# Test if the device contains a filesystem.
/lib/udev/vol_id "$DEVNAME" | egrep -q '^ID_FS_USAGE=(filesystem|disklabel)$'
if [ "$?" = "0" ] ; then
log info "$DEVNAME contains a filesystem or disklabel"

fstype="$(/lib/udev/vol_id -t $DEVNAME )"
log info "$DEVNAME contains filesystem type $fstype"

# We search for available mountpoint in the list
for mountpoint in $MOUNTPOINTS; do

# Get a lock for the mountpoint under consideration
for t in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19; do
(set -C; echo "$$" > /var/lock/${mountpoint##*/}) && break
log info "waiting for $mountpoint lockfile to be released"
sleep 1
done

if [ -d "$mountpoint" ]; then
log info "mountpoint $mountpoint exists"
if [ ! "$( mount | awk '{print $3}' | grep "$mountpoint" )" ]; then
log info "mountpoint $mountpoint is available for $DEVNAME"
break
else
log info "mountpoint $mountpoint is busy"
rm -f /var/lock/${mountpoint##*/}
continue
fi
else
log info "creating mountpoint $mountpoint for $DEVNAME"
mkdir -p -m0 $mountpoint
umount -l "$mountpoint"
log info "mountpoint $mountpoint is available for $DEVNAME"
break
fi
rm -f /var/lock/${mountpoint##*/}
done

if [ "$mountpoint" ] ; then

# Determine mount options.
options=""
if [ "$FSTABMOUNTOPTIONS" ]; then
options="$FSTABMOUNTOPTIONS"
else
[ "$MOUNTOPTIONS" ] && options="$MOUNTOPTIONS"
[ ! "$fstype" = "vfat" ] && options="${options},sync,dirsync"
[ "$fstype" = "vfat" ] && options="${options},uid=0,gid=100,umask=0"
fi

# Mount the filesystem.
for t in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19; do
[ "$( mount | awk '{print $1}' | grep "$DEVNAME" )" ] && break
log info "executing command: mount -t $fstype -o $options $DEVNAME $mountpoint"
eval "mount -t $fstype -o $options $DEVNAME $mountpoint"
/lib/udev/montaje.sh $DEVNAME $mountpoint
done
rm -f /var/lock/${mountpoint##*/}
else
# No suitable mount point found.
log warning "no mountpoint found for $DEVNAME"
exit 1
fi
else
log info "$DEVNAME does not contain a filesystem or disklabel"
fi

elif [ "$1" = remove ] ; then
/lib/udev/montaje.sh $DEVNAME $DEVNAME $1
# A block or partition device has been removed.
# Test if it is mounted.
while read device mountpoint fstype remainder; do
if [ "$DEVNAME" = "$device" ] ; then
# If the mountpoint and filesystem type are maintained by
# this script, unmount the filesystem.
if in_list "$mountpoint" "$MOUNTPOINTS" ; then
log info "unmounting $mountpoint"
umount -l "$mountpoint"
rmdir $mountpoint && break
log info "cannot remove $mountpoint, maybe not empty"
fi
break
fi
done < /proc/mounts fi exit 0

Por último creamos /lib/udev/montaje.sh

#!/bin/bash
# 06/02/07 SiTuH~
Home_Des="introduce la ruta de tu escritorio"
nombre=`echo $2 | cut -c 6,7,8,9`

if [ "$3" != remove ]
then
echo " [Desktop Entry]
Type=FSDevice
Dev=$1
MountPoint=$2
Encoding=UTF-8
Icon=usbpendrive_mount
UnmountIcon=usbpendrive_unmount
Name=$nombre" > $Home_Des/$nombre.desktop
echo $1 $2 >> /tmp/.puntomontaje.log

else
borra=`cat /tmp/.puntomontaje.log | grep $2 | cut -f 2 -d ' '`
cat /tmp/.puntomontaje.log | grep $2 -v > /tmp/.puntomontaje.log
rmdir $borra
dis=`echo $borra | cut -d / -f 3 | cut -d ' ' -f 1`
rm $Home_Des/$dis.desktop
fi

y con esto lo que conseguimos es que al pinchar nuestra memoria usb aparezca en nuestro escritorio un link a ella, con opcion de desmontarla con un par de clicks, al quitar nuestro usb el link desaparece.

No olvidar dar permiso de ejecucion a los scripts
chmod +x script


saludos
_________________

bla bla bla
Volver arriba
Ver perfil de usuario Enviar mensaje privado Enviar email MSN Messenger
Mostrar mensajes anteriores:   
Publicar nuevo tema  Responder al tema  Foros de discusión -> Documentación Todas las horas son GMT - 6 Horas

Página 1 de 1



No puedes publicar nuevos temas en este foro
No puedes responder a temas en este foro
No puedes editar tus mensajes en este foro
No puedes borrar tus mensajes en este foro
No puedes votar en encuestas en este foro



Powered by phpBB © 2001 phpBB Group
phpBB port v2.1 based on Tom Nitzschner's phpbb2.0.6 upgraded to phpBB 2.0.4 standalone was developed and tested by:
ArtificialIntel, ChatServ, mikem,
sixonetonoffun and Paul Laudanski (aka Zhen-Xjell).

Version 2.1 by Nuke Cops © 2003 http://www.nukecops.com

Forums ©
 

Copyright | Términos de uso | Política de privacidad | Publicidad | Contáctanos | Blog