Wednesday, August 31, 2005
Sunday, June 12, 2005
Microsoft, you're so funny!
Old article, but I saw it only a few minutes ago... it's worth a look: click here! To have a laugh, obviously! ROTFLMAO!!!
Tuesday, June 07, 2005
Using udev
After solving the problem with usb devices as explained in the previous post, now I'm going to talk about udev. As depicted from kernel.org
Following the guide from Slacky.it I managed to configure my usb devices (two pendrives and a digital camera), and also setting the automount (autounmount) when devices are plugged (unplugged).
Requirements:
Follow the instructions of the guide to prepare the kernel and install udev.
Now the udev configuration: let's go to the udev configuration directory /etc/udev and open udev.conf with a text editor, for example
Set the udev_rules and udev_root variables, changing the corresponding lines, as follows
Now we have to define the rules for our devices. To do it we need to know some additional informations about our devices, something to identify them. Plug then a device, with dmesg find out what's the node it's linked to (let's say it's /dev/sda) and with the utility udevinfo we can find informations about the device. Type
(if your device is linked to node /dev/uba then replace sda with uba).
This is the output of udevinfo when I plug in my pendrive:
I wrote only the part using the ehci_hcd driver, because I know that my pendrive uses that one. Now I have to find ``identifiers'' for my device, in order to write its own rule. I used the SYSFS{device} and SYSFS{vendor} identifiers, I think they are common to the most of the pendrives (but it works and for me it's enough ^_^).
Now we can write the rule for it. Open the /etc/udev/udev.rules file with an editor and type the rule (all in a line)
pendrive is the name assigned to this device, and, when the device is plugged, the node /udev/pendrive will be created.
Now we have to edit our /etc/fstab, adding the line to define the mount point of the device:
That's it! Once the pendrive is plugged it's possible to mount it in the usual way
It would be even nicer if the camera would be automounted when plugged in. Udev allows to do that, too! When a device named ``dev0'' is plugged, udev looks into the directory /etc/dev.d/dev0/ looking for executable *.dev files and executes them. For the pendrive I can write the /etc/dev.d/pendrive/automount.dev file:
Then
and now, when the pendrive is plugged, it's automatically mounted on /mnt/pendrive and, when unplugged, it's automatically unmounted.
It works fine for me, hope the same for you. :)
References:
udev allows Linux users to have a dynamic /dev directory and it provides the ability to have persistent device names
Following the guide from Slacky.it I managed to configure my usb devices (two pendrives and a digital camera), and also setting the automount (autounmount) when devices are plugged (unplugged).
Requirements:
- a Linux distribution (obviously) :)
- kernel 2.6.x
- hotplug
- udev
Follow the instructions of the guide to prepare the kernel and install udev.
Now the udev configuration: let's go to the udev configuration directory /etc/udev and open udev.conf with a text editor, for example
# vi udev.conf
Set the udev_rules and udev_root variables, changing the corresponding lines, as follows
udev_rules="/etc/udev/udev.rules"
udev_root="/udev/"
Now we have to define the rules for our devices. To do it we need to know some additional informations about our devices, something to identify them. Plug then a device, with dmesg find out what's the node it's linked to (let's say it's /dev/sda) and with the utility udevinfo we can find informations about the device. Type
udevinfo -a -p /sys/block/sda
(if your device is linked to node /dev/uba then replace sda with uba).
This is the output of udevinfo when I plug in my pendrive:
udevinfo starts with the device the node belongs to and then walks up the
device chain, to print for every device found, all possibly useful attributes
in the udev key format.
Only attributes within one device section may be used together in one rule,
to match the device for which the node will be created.
...
looking at the device chain at '/sys/devices/pci0000:00/0000:00:10.3':
BUS="pci"
ID="0000:00:10.3"
DRIVER="ehci_hcd"
SYSFS{class}="0x0c0320"
SYSFS{detach_state}="0"
SYSFS{device}="0x3104"
SYSFS{irq}="11"
SYSFS{local_cpus}="1"
SYSFS{subsystem_device}="0x0033"
SYSFS{subsystem_vendor}="0x1025"
SYSFS{vendor}="0x1106"
...
I wrote only the part using the ehci_hcd driver, because I know that my pendrive uses that one. Now I have to find ``identifiers'' for my device, in order to write its own rule. I used the SYSFS{device} and SYSFS{vendor} identifiers, I think they are common to the most of the pendrives (but it works and for me it's enough ^_^).
Now we can write the rule for it. Open the /etc/udev/udev.rules file with an editor and type the rule (all in a line)
BUS="pci", SYSFS{vendor}="0x1106", SYSFS{device}="0x3104", NAME="pendrive"pendrive is the name assigned to this device, and, when the device is plugged, the node /udev/pendrive will be created.
Now we have to edit our /etc/fstab, adding the line to define the mount point of the device:
/udev/pendrive /mnt/pendrive vfat noauto,sync,user,umask=0000 0 0
That's it! Once the pendrive is plugged it's possible to mount it in the usual way
$ mount /mnt/pendrive
It would be even nicer if the camera would be automounted when plugged in. Udev allows to do that, too! When a device named ``dev0'' is plugged, udev looks into the directory /etc/dev.d/dev0/ looking for executable *.dev files and executes them. For the pendrive I can write the /etc/dev.d/pendrive/automount.dev file:
#!/bin/bash
if [ "$ACTION" == "add" ] ; then
logger -t dev.d "Mounting pendrive"
mkdir /mnt/pendrive
/bin/mount /mnt/pendrive
fi
if [ "$ACTION" == "remove" ] ; then
logger -t dev.d "Unmounting pendrive"
/bin/umount /mnt/pendrive
rmdir /mnt/pendrive
fi
Then
# chmod +x /etc/dev.d/pendrive/automount.dev
and now, when the pendrive is plugged, it's automatically mounted on /mnt/pendrive and, when unplugged, it's automatically unmounted.
It works fine for me, hope the same for you. :)
References:
- guide on Slacky.it (italian)
- other guide (english) thanks webkiller71
Monday, June 06, 2005
USB on Kernel 2.6.10
My brand new DERI-Korea pendrive finally works on my slack running kernel 2.6.10. It was so frustrating to have a 512 MB pendrive and not being able to use it, so, after a lot of googling, I found something I can call a ``solution'': boot the 2.6.10 kernel appending ``pci=noacpi'' string or edit lilo.conf adding the line
in the section relative to kernel 2.6.10 and then issue a `lilo -v`.
It worked for me and for my pendrive, now I can't try with my other usb devices (an mp3-player pendrive and a camera), I hope it won't give more troubles.
append="pci=noacpi"
in the section relative to kernel 2.6.10 and then issue a `lilo -v`.
It worked for me and for my pendrive, now I can't try with my other usb devices (an mp3-player pendrive and a camera), I hope it won't give more troubles.
Saturday, May 21, 2005
ATI Radeon - 3D rendering
Finally, after lots and lots of failed attempts I managed to install the correct drivers for my ATI Mobility Radeon 9200, and to enable 3D rendering.
System: Slackware 10.1 running kernel 2.6.10, Xorg 6.8.1
Note: this ``tutorial'' is provided as is, it worked for me on the system described above; in any case I won't be responsible for any loss of data or system failure.
First, get your kernel sources and put them in /usr/src/linux (a symlink is also fine). Get the unofficial drivers from http://www.schneider-digital.de/html/download_ati.php. Exit X if it was running. Convert the downloaded rpm package to tgz with rpm2tgz and install the generated package with installpkg. Then log in as root and type the following commands
Now the drivers should be correctly installed and the module loaded. Test it (first run X with startx)
Try also
If you have problems running the last command then you have to add a line to your /etc/fstab
and mount it
Now everything should work correctly.
Run
to check the installed drivers. The output for me is
Hope this will help as it helped me :)
Thanks a lot to the tutorial on www.slacky.it
System: Slackware 10.1 running kernel 2.6.10, Xorg 6.8.1
Note: this ``tutorial'' is provided as is, it worked for me on the system described above; in any case I won't be responsible for any loss of data or system failure.
First, get your kernel sources and put them in /usr/src/linux (a symlink is also fine). Get the unofficial drivers from http://www.schneider-digital.de/html/download_ati.php. Exit X if it was running. Convert the downloaded rpm package to tgz with rpm2tgz and install the generated package with installpkg. Then log in as root and type the following commands
# cd /lib/modules/fglrx/build_mod
# chmod +x make.sh
# ./make.sh
# cd ..
# chmod +x make_install.sh
# ./make_install.sh
# modprobe fglrx
Now the drivers should be correctly installed and the module loaded. Test it (first run X with startx)
$ glxgears
Try also
$ fgl_glxgears
If you have problems running the last command then you have to add a line to your /etc/fstab
tmpfs /dev/shm tmpfs defaults 0 0
and mount it
# mount /dev/shm
Now everything should work correctly.
Run
$ fglrxinfo
to check the installed drivers. The output for me is
OpenGL vendor string: ATI Technologies Inc.
OpenGL renderer string: MOBILITY RADEON 9000 DDR Generic
OpenGL version string: 1.3.5010 (X4.3.0-8.12.10)
Hope this will help as it helped me :)
Thanks a lot to the tutorial on www.slacky.it
My passion
Every day I'm getting more and more involved in Linux, I guess this is a non-return (to Windows) point. I simply love how it works, it doesn't treat me as an idiot like Microsoft software does, it makes me feel free, because I can build it exactly as I want it.
Windows closed my mind for too long time, luckily Linux is opening it again.
I think that if someone really likes computers he/she can't stop to what market imposes him/her (to be read as: Microsoft software). I know loads of people working in IT and using Windows; maybe they prefer it, maybe they never had a chance to try something else. I don't blame anyone, however I'll try to convert as many people as possible to the penguin side :)
Ina, you will be the first one, get ready!! :)
Note:
Windows closed my mind for too long time, luckily Linux is opening it again.
I think that if someone really likes computers he/she can't stop to what market imposes him/her (to be read as: Microsoft software). I know loads of people working in IT and using Windows; maybe they prefer it, maybe they never had a chance to try something else. I don't blame anyone, however I'll try to convert as many people as possible to the penguin side :)
Ina, you will be the first one, get ready!! :)
Note:
writing commands, a line starting with # indicates a command issued by root, while a line starting with $ idicates a command issued by a non-root user.
Example:
# ifconfig eth0 up
$ ls -l ~