Archive for the ‘Linux’ Category
* purge removed debian packages
Posted on August 23rd, 2010 by jitu. Filed under Linux.
The package manager on Debian based systems differs between removing a package and purging it. When a package is removed, the executable files and libraries (if not shared by others) are deleted from the hard disk. However the configuration files remain so that, if you reconsider your decision and reinstall a package, it does not need to be configured anymore. If a package is purged, all files belonging to the package are removed.
For many years I used to remove packages only. The recent problem was that over the time some changes were done to udev and it started to complain about an old format of a configuration file.
udevd[8055]: SYSFS{}= will be removed in a future udev version, please use ATTR{}= to match the event device, or ATTRS{}= to match a parent device, in /lib/udev/rules.d/someFile.conf
However this file belonged to a package that was removed a long time ago and hence not updated along with udev. I wanted to clean up my system and purge all removed packages. This can be time consuming task, if the package count of removed packages crosses some hundreds. Use
dpkg --get-selections | grep deinstall
to show removed packages and use
dpkg --get-selections | grep deinstall | wc -l
to count them.
Fortunately the package manager provides an easy command to purge all removed packages at once:
aptitude purge ~c
* installation of ati hd 3650 in lenny
Posted on March 7th, 2010 by jitu. Filed under Linux.
I replaced my nVidia GT8600M with an ATI Radeon HD 3650. The installation of the fglrx driver is a complete mess. Maybe this posting will help you to enable the driver in your Debian/Lenny box.
My setup
At my workplace I have a external monitor (max resolution: 1280 x 1024@60Hz). However the DDC database reports this monitor to also support 1400 x something, which results in the display of “Cannot support current resolution” on the screen.
The LCD of my laptop has a resolution of up to 1680×1050 (Lovely, isn’t it?
Btw, 15.4″, nice NON-glossy screen etc.)
At work I have to give a presentation sometimes, so the LCD screen should be mirrored at a resolution of 1024×768. Otherwise I would like to have a big desktop stretched over 2 screens, so that I can move windows from one side to the other.
At my home there is no external monitor and I rely only on the LCD.
Installation
I installed the proprietary drivers downloaded from ATI (fglrx, version 10.2). I tried to use kernel 2.6.33 (which was released a week ago), but despite a patch, the compiled module did not load due to some missing symbols. So I downgraded to 2.6.32.9. But even then, the installation failed. As far as I remember, the ati-installer script was complaining about a missing directory in /usr/X11R6/lib/modules or similar.
Soon I found a description which resulted in a flawless packaging and kernel module compilation. Despite the fact, the fglrx is in version 10.2, following the steps mentioned for 10.1 lead to success.
Configuration
The configuration was pretty easy and straight forward. However fglrx is heavily using xrandr and since I had nVidia earlier, I was not used to that nor did I know. The nVidia configuration relied heavily in xorg.conf and I thought the same about fglrx.
Issues
There are some issues with fglrx.
- The external monitor does not show the proper resolution despite the fact Modeline etc are mentioned in xorg.conf.
Solution: The problem seems to be that fglrx is not interested in the data reported by the monitor at all. Even if a
ModeLineis forced byUseMode, it is completely ignored by fglrx and the highest reported resolution is used (which is incompatible with this monitor as mentioned earlier). Here is an example of that section.Section "Monitor"
Identifier "Monitor1"
HorizSync 30.0 - 80.0
VertRefresh 50.0 - 76.0
Option "VendorName" "Dell"
Option "ModelName" "E177FP"
Option "DPMS" "true"
ModeLine "1280x1024_60.00" 108.9 1280 1360 1496 1712 1024 1025 1028 1060 -hsync +vsync
Option "PreferredMode" "1280x1024_60.00"
UseModes "1280x1024_60.00"
EndSectionThe solution is to alter the resolution bt
xrandrwhile GDM is loaded. For that I added the lines
EXTERNAL_OUTPUT="CRT1"
INTERNAL_OUTPUT="LCD"
xrandr |grep $EXTERNAL_OUTPUT | grep " connected "
if [ $? -eq 0 ]; then
xrandr --output $INTERNAL_OUTPUT --auto --output $EXTERNAL_OUTPUT --off
fibefore
gdmwhich ()(right at the beginning) in/etc/gdm/Init/Default. These additional lines switch off the external monitor (anyway it does not have to show anything) only if it is connected. Myxorg.confis available at the end of this post. - After the user logged in, the attached monitor should be automatically detected and switched on.
Solution: Thanks ThinkWiki there is a solution for doing so. To ease the switch between externalMonitorOff, mirror and bigScreen I created 3 executable files in
/usr/local/bin/xrandrthat allow me to switch the mode instantly. To access the files, you have to create starters in Gnome (e.g. right click on desktop -> “Create Launcher”) - After suspend to RAM and resume, the external monitor is switched off and I have to execute something like
xrandr --output LCD --auto --output CRT1 --off
xrandr --output LCD --auto --output CRT1 --left-of LCD --mode 1280x1024
to reinitialize my desktop and to power up my external monitor.Solution: A post in the Ubuntu forum leads to the solution. Put the commands into a file in
/etc/pm/sleep.d/. - Now the fglrx driver is installed, what about Compiz?
Compiz should work without any problem, however the resize issue (nVidia, but nevertheless same issue) resurfaced here again. It is very much annoying and I do not use compiz and the moment. I really look forward for the driver radeonhd to support 3D acceleration so that I can discard the whole fragile installation of fglrx.
Download
The zip file contains
- my
xorg.conf. This also includes the oldxorg.confof the nVidia card. Thexorg.confcan be found in/etc/X11/. - the scripts that allow me to switch between the modes rapidly. Depending, what is executed, I get a my desktop stretched of 2 displays, a mode with the external VGA port switched off or with the content displayed on my LCD mirrored. To figure out the names of the
--outputparameter, usexrandrin the console. /etc/gdm/Init/Default/etc/X11/Xsession.d/45custom_xrandr-settings. Do not forget to make this file executable. It is called by the next file./etc/pm/sleep.d/restoreScreen.sh. This file also needs to be executable.
* 2.6.33, debian lenny, nvidia and vbox
Posted on February 25th, 2010 by jitu. Filed under Linux.
Today kernel 2.6.33 became stable. This post describes, how to get 2.6.33 running on a Debian box running on Lenny (the stable version).
- If you use make-kpkg (like me) to compile the kernel, you have to get a newer version of the the package “kernel-package”. In Lenny the current version is 11.015. The compilation works with the version that is shipped with testing (currently 12.032). So download the package from a server of your choice and install it with
dpkg -i <packageName>. All dependencies are already met. - Obviously the nvidia-kernel-source will create problems as usual:
/usr/src/modules/nvidia-kernel/nvacpi.c: In function ‘nv_acpi_methods_init’:
/usr/src/modules/nvidia-kernel/nvacpi.c:511: error: too few arguments to function ‘acpi_walk_namespace’
make[5]: *** [/usr/src/modules/nvidia-kernel/nvacpi.o] Error 1
make[4]: *** [_module_/usr/src/modules/nvidia-kernel] Error 2
make[4]: Leaving directory `/usr/src/linux-2.6.33′
make[3]: *** [modules] Error 2
make[3]: Leaving directory `/usr/src/modules/nvidia-kernel’
make[2]: *** [binary-modules] Error 2
make[2]: Leaving directory `/usr/src/modules/nvidia-kernel’
make[1]: *** [kdist_build] Error 2
make[1]: Leaving directory `/usr/src/modules/nvidia-kernel’
Module /usr/src/modules/nvidia-kernel failed.The patch from this thread in the nVidia forum helped and it works without any problems (apart from all the warning during compilation).
- The kernel module for VirtualBox is quite aged and currently at version 1.6.6. The compilation process complains about missing files:
In file included from /usr/src/modules/virtualbox-ose/include/VBox/types.h:34,
from /usr/src/modules/virtualbox-ose/SUPDRV.h:39,
from /usr/src/modules/virtualbox-ose/linux/SUPDrv-linux.c:35:
/usr/src/modules/virtualbox-ose/include/iprt/types.h:87:30: error: linux/autoconf.h: No such file or directory
/usr/src/modules/virtualbox-ose/linux/SUPDrv-linux.c: In function ‘VBoxDrvLinuxCreate’:
/usr/src/modules/virtualbox-ose/linux/SUPDrv-linux.c:734: error: ‘struct task_struct’ has no member named ‘euid’
/usr/src/modules/virtualbox-ose/linux/SUPDrv-linux.c:735: error: ‘struct task_struct’ has no member named ‘egid’
kmk[2]: *** [/usr/src/modules/virtualbox-ose/linux/SUPDrv-linux.o] Error 1
kmk[2]: Leaving directory `/usr/src/linux-2.6.33′
kmk[1]: *** [_module_/usr/src/modules/virtualbox-ose] Error 2
kmk[1]: Leaving directory `/usr/src/linux-2.6.33′
kmk: *** [binary-modules] Error 2
kmk: Leaving directory `/usr/src/modules/virtualbox-ose’
make[1]: *** [kdist_build] Error 2
make[1]: Leaving directory `/usr/src/modules/virtualbox-ose’
Module /usr/src/modules/virtualbox-ose failed.Fortunately it is easy and fast to be fixed either by applying virtualbox-ose-2.6.33.patch.zip or by replacing
#include <linux/autoconf.h>by
#include <generated/autoconf.h>in the files
SUPDRV.h,r0drv/linux/the-linux-kernel.h andinclude/iprt/types.h.
* shuffled characters in console, no x
Posted on December 24th, 2009 by jitu. Filed under Linux.
On 22nd of December I did an apt-get update & dist-upgrade. Since then I faced strange problems with the output of my graphics adapter. First I thought, it aged (there is a bug in the packaging of my model: nVidia GT8600M) and I have to replace it. But sometimes it worked after a reboot without any problems. The output showed mixed up characters in tty starting from the boot of the kernel or even earlier during the loading of GRUB. Some characters got replaced by other symbols.
The X server aborted with:
(II) NVIDIA(0): Support for GLX with the Damage and Composite X extensions is
(II) NVIDIA(0): enabled.
(EE) NVIDIA(0): Failed to initialize the NVIDIA graphics device PCI:1:0:0.
(EE) NVIDIA(0): Please check your system’s kernel log for additional error
(EE) NVIDIA(0): messages and refer to Chapter 8: Common Problems in the
(EE) NVIDIA(0): README for additional information.
(EE) NVIDIA(0): Failed to initialize the NVIDIA graphics device!
(II) UnloadModule: “nvidia”
(II) UnloadModule: “wfb”
(II) UnloadModule: “fb”
and the kernel log told me something like this:
Dec 23 12:48:23 jitu kernel: [ 32.945818] nvidia: module license ‘NVIDIA’ taints kernel.
Dec 23 12:48:23 jitu kernel: [ 32.945827] Disabling lock debugging due to kernel taint
Dec 23 12:48:23 jitu kernel: [ 33.205990] nvidia 0000:01:00.0: power state changed by ACPI to D0
Dec 23 12:48:23 jitu kernel: [ 33.206017] nvidia 0000:01:00.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16
Dec 23 12:48:23 jitu kernel: [ 33.206573] NVRM: loading NVIDIA UNIX x86 Kernel Module 185.18.36 Fri Aug 14 17:18:04 PDT 2009
Dec 23 12:48:24 jitu kernel: [ 34.051075] ACPI Exception: AE_TIME, Returned by Handler for [EmbeddedControl] 20090521 evregion-424
Dec 23 12:48:24 jitu kernel: [ 34.051092] ACPI Error (psparse-0537): Method parse/execution failed [\_GPE._L02] (Node f702ee64), AE_TIME
Dec 23 12:48:24 jitu kernel: [ 34.051145] ACPI Exception: AE_TIME, while evaluating GPE method [_L02] 20090521 evgpe-568
Dec 23 12:48:24 jitu kernel: [ 34.051386] NVRM: RmInitAdapter failed! (0×26:0xffffffff:1096)
Dec 23 12:48:24 jitu kernel: [ 34.051392] NVRM: rm_init_adapter(0) failed
Dec 23 12:48:29 jitu kernel: [ 39.355725] NVRM: RmInitAdapter failed! (0×26:0xffffffff:1096)
Dec 23 12:48:29 jitu kernel: [ 39.355740] NVRM: rm_init_adapter(0) failed
Dec 23 12:48:35 jitu kernel: [ 44.665717] NVRM: RmInitAdapter failed! (0×26:0xffffffff:1096)
Dec 23 12:48:35 jitu kernel: [ 44.665732] NVRM: rm_init_adapter(0) failed
If the machine was booted in Windows, the graphics adapter was not recognized and a standard driver was loaded.
The following packages and version numbers have been updated:
- acpid 1.0.8-1lenny2
- libldap-2.4-2 2.4.11-1+lenny1
- libexpat1 2.0.1-4+lenny2
- libexpat1-dev 2.0.1-4+lenny2
- libmozjs1d 1.9.0.16-1
- xulrunner-1.9 1.9.0.16-1
- xulrunner-1.9-gnome-support 1.9.0.16-1
Currently I suspect ACPI for the problem and it seems that somehow the IRQs get messed up. Since I added pci=routeirq to the boot parameter of my kernel in /boot/grub/menu.lst, I do not experience this behavior anymore. It took several reboots and retries by the X server to bring back the IRQs in order.
[Update 20/01/2010]: Even pci=routeirq did not work. Sometimes it was right there from the start. Sometimes it happened after 3 days of continues execution of a simulation. Although I reverted to the previous version of acpid, the problem still persisted. Currently I am trying out an older kernel and nvidia-glx version (2.6.31.2 instead of 2.6.32.2 and 185.18.36-2_i386 instead of 190.42-3_i386). Today it is the fourth day without that the problem occurred again. Let’s see. I am sure, my graphics adapter is getting ready to fail just after updating the post. Threatening it to be replaced (the laptop has a standardized MXM interface between mainboard and graphics adapter), will make it to work again (at least it seems so)
[Update 21/01/2010]: As I stated above: A few hours after I wrote updated this post, the graphics adapter failed again. Let’s see, where I can get a replacement from.
* convert ogg files to mp3
Posted on November 28th, 2009 by jitu. Filed under Linux.

Unfortunatley and despite of its advantages the majority of handheld devices do not support ogg format so far. Music collections have to be converted into mp3 before copying them to the handheld device. However many devices read out the ID3 tag in the mp3 files to sort them internally into a library. Most conversion methods and tools convert the ogg file into mp3 format flawlessly, but they do not transfer the tag information that is eventually stored in the ogg file.
The little script (copyIDOgg2MP3.pl) attached to this post, helps in that case. It also contains an shell script example (ogg2mp3.sh), how a whole folder can be processed in a single shot.
Usage/Installation
There is no installation as such. Untar the downloaded archive and execute copyIDOgg2MP3.pl OggFile MP3File
Both audio files must exist. So far only ID3 tags in the version 1.1 are supported.
License
The script is published under GPLv3 and comes without any warranty.
Download
* slow usb pen drive in linux
Posted on November 16th, 2009 by jitu. Filed under Linux.
I experienced slow USB mass storage devices such as USB pen drives, attached to a USB2.0 port. The writing speed usually did not cross 600KB/sec. To solve the problem I am mounting the pen drive with the async option set.
The manual of mount in NetBSD says about async:
All I/O to the file system should be done asynchronously. In the event of a crash, it is impossible for the system to verify the integrity of data on a file system mounted with this option. You should only use this option if you have an application-specific data recovery mechanism, or are willing to recreate the file system from scratch.
Since I am using pen drives to move data only e.g. for a presentation, it is no big issue to reformat the pen drive in case of a crash. With async set the writing speed increases to around 8MB/sec. To make the change persistent, add async in your fstab:
/dev/sdb1 /media/usb0 auto noauto,noatime,nodiratime,user,rw,exec,suid,async,uid=1000,gid=1000,umask=0072 0 0
Or, if you use usbmount to mount the pen drives automatically add async to the MOUNTOPTIONS in /etc/usbmount/usbmount.conf
It is always a good idea to sync or to umount the drives before you unplug them.
* bluetooth segfaulting in debian
Posted on October 14th, 2009 by jitu. Filed under Linux.
In my Debian box the Bluetooth Applet segfaulted whenever a USB Bluetooth dongle was inserted. The relevant log entry (e.g. dmesg|tail) looked like this:
Oct 6 14:04:41 jitu kernel: [ 90.400199] usb 7-2: new full speed USB device using uhci_hcd and address 3
Oct 6 14:04:41 jitu kernel: [ 90.686465] usb 7-2: New USB device found, idVendor=0a12, idProduct=0001
Oct 6 14:04:41 jitu kernel: [ 90.686473] usb 7-2: New USB device strings: Mfr=0, Product=0, SerialNumber=0
Oct 6 14:04:41 jitu kernel: [ 90.686646] usb 7-2: configuration #1 chosen from 1 choice
Oct 6 14:04:41 jitu hcid[3085]: HCI dev 0 registered
Oct 6 14:04:41 jitu hcid[3085]: HCI dev 0 up
Oct 6 14:04:41 jitu hcid[3085]: Device hci0 has been added
Oct 6 14:04:41 jitu hcid[3085]: Starting security manager 0
Oct 6 14:04:42 jitu hcid[3085]: Device hci0 has been activated
Oct 6 14:04:42 jitu kernel: [ 91.208984] bluetooth-apple[3333]: segfault at 0 ip b70e2e18 sp bfffbefc error 4 in libc-2.7.so[b706d000+155000]
Here the bluetooth-apple(t), a part of gnome-bluetooth, crashed. Hence no user friendly symbol showed up next to the clock allowing the easy transfer of files to a Bluetooth device. However in the console hcitool scan and sdptool browse worked and displayed the correct data.
The solution was to include the current user into the group netdev. You can check your membership of the groups by typing groups in the console. If netdev is not listed, execute a adduser as root and restart the x-server to update this information.
* bitbake and proxy
Posted on June 20th, 2009 by jitu. Filed under Linux, openmoko.
Currently interns are trying to use bitbake to create an openembedded image for the beagle board. After setting up everything according to the step-by-step instructions, they run into a major problem: the proxy of the Indian Institute of Science.
bitbake uses wget to download the necessary packages. To tell wget that is has to send all requests to the proxy, environment variable are set:
export http_proxy=”http://proxy.example.com:8080″
export ftp_proxy=”http://proxy.example.com:8080″
However if wget is executed by bitbake to download a missing package, the environment variables are gone and wget tries to connect to the HTTP servers directly. A search in the Internet for that particular problem was not successful. A workaround (and not a solution) is to export the variables again, before wget is executed. Changing the recipes might be a never ending task. An easier way is to change the wget executable itself:
- Open a terminal and type
cd /usr/bin/. If the file is not there, you can usewhich wgetto figure out, where it is hidden. mv wget wget.executable(for this you need root permission, getting them by either executingsudo(Ubuntu) or by becoming root withsu).- Open an editor of your choice and type:
#!/bin/bash
echo “Using alternative wget…”
export http_proxy=”http://proxy.example.com:8080″
export ftp_proxy=”http://proxy.example.com:8080″/usr/bin/wget.executable $@
- Save this file as
wgetin/usr/bin/(for that you need to be root again). - Change the permission for this file by entering
chmod +x wgetin the terminal (also as root). - Execute
bitbakeas usual. Theechodirective just prints out a message, so you can check, ifbitbakeis taking the right executable.
I hope, it helps and saves you some time.
Pages:
Categories:
Archives:
- August 2010
- July 2010
- May 2010
- April 2010
- March 2010
- February 2010
- January 2010
- December 2009
- November 2009
- October 2009
- August 2009
- July 2009
- June 2009
- May 2009
- April 2009
- March 2009
- February 2009
- January 2009
- December 2008
- November 2008
- October 2008
- September 2008
- May 2008
- April 2008
- March 2008
- January 2008
- November 2007
- October 2007
- August 2007
- July 2007
- June 2007
- May 2007
- April 2007
- March 2007
- February 2007
- January 2007
- December 2006
- November 2006
- October 2006