Saturday, 27 November 2010

Gentoo DVD drive setup problems

This is not meant as a guide that will fix everybodies DVD/CD problems, it was the solution that worked for me, if you still have issues then I recommend consulting the Gentoo Forums.

After gaining some recent bad advice from a 'well meaning' helper on a forum I recently managed to totally render the portage setup useless to the point where I couldn't install anything. After hours and hours of consulting with others on line and attempting a variety of fixes, the conclusion was reached that I would probably be just as quick rebuilding Gentoo from scratch.

Having completed this task already in November 2009 and with a years experience under my belt and a lot of extra libraries etc on my machine I figured that a fresh install would have my Gentoo system running even faster.

The first time I compiled my first Gentoo OS I made a lot of written notes, these were very useful and I would highly recommend anybody starting Gentoo for the first time to do this as these were invaluable the second time around. These can save time and help avoid falling into the same pitfalls twice.

Upon launching into my new Gentoo system complete with Gnome graphical environment I thought that everything was just about back to normal. One major problem though: both of my DVD drives were listed as Unnamed Drive. Neither were behaving like a DVD drive, any time I tried to eject they simply shut again immediately and I couldn't use any programs that made use of the drives eg Brasero, mplayer etc.

To compile the kernel I took the chickens way out and used Genkernel so I assumed that a lot of the default settings would be right and that the Gentoo Handbook would guide me. At this point can I please state that the Gentoo Handbook is an invaluable, well written guide when installing Gentoo. However there is one point that needs updating:

When using Genkernel with IDE drives the default setting selects:
Device Drivers ---> <*> ATA/ATAPI/MFM/RLL support (DEPRECATED) --->

This is obsolete and causes problems with udev which is designed to make your life easier. For udev to function properly we need to move to libdata. As I had already created the kernel I had to edit it by typing the command:
genkernel --menuconfig all

To rectify this I removed the * by highlighting it and pressing N.
Secondly I moved the cursor down to highlight
SCSI device support --->

and setup as follows by pressing Y to select (* will appear) or N to deselect

│ │ < > RAID Transport Class
│ │ -*- SCSI device support
│ │ < > SCSI target support

│ │ [*] legacy /proc/scsi/ support

│ │ *** SCSI support type (disk, tape, CD-ROM) ***
│ │ <*> SCSI disk support

│ │ < > SCSI tape support
│ │ < > SCSI OnStream SC-x0 tape support
│ │ <*> SCSI CDROM support
│ │ [ ] Enable vendor-specific extensions (for SCSI CDROM)
│ │ <*> SCSI generic support
│ │ < > SCSI media changer support
│ │ [*] Probe all LUNs on each SCSI device
│ │ [ ] Verbose SCSI error reporting (kernel size +=12K)
│ │ [ ] SCSI logging facility
│ │ [ ] Asynchronous SCSI scanning
│ │ SCSI Transports --->
│ │ [ ] SCSI low-level drivers --->
│ │ < > SCSI Device Handlers --->
│ │ < > OSD-Initiator library

I know that your thinking, wait a minute, my drives are IDE/PATA not SCSI. The IDE command set was evolved from SCSI and is now being merged back with it.

now exit genkernel and wait for a few minutes for it to complete. Then I entered the command:
nano -w /etc/fstab

Now comment out anything that includes the DVD/CD drives by placing a # at the start of the line. Then change all of the drives labelled hda, hdb, hdc... etc to sda, sdb.sdc.... etc. If you have a combination of IDE and SATA then the IDE will be labelled first and the SATA drives second. So if you previously had 2 IDE and 2 SATA drives then previously they may have been labelled hda, hdb, sda, sdb. However this will now be changed to sda, sdb, sdc, sdd with your IDE drives being labelled sda & sdb and your SATA drives now getting labelled sdc & sdd. Exit and save.

Finally the last step is to modify your GRUB menu entry if you've set a separate partition for /boot.

If you are using Grub Legacy then type:
nano /boot/grub/menu.lst

On the line it will have the command The (real_)root=/dev/hda... this will need to be changed to /dev/sd...

Restart your system and all of your DVD/CD drives should now be functioning as expected. This problem caused me three days of grief. Hopefully it may provide the answer that some of the other users may be looking for.

Thursday, 18 November 2010

Customise the Gnome menu icon

After a recent major error forced me to rebuild my Gentoo system, I was reminded of some of the small annoyances. Things that should be so easy, yet they can prove incredibly frustrating. One of these is the awkwardness of changing the menu icon in the Gnome desktop. I don't know why it cant be as easy as in the KDE environment; a couple of obvious clicks and then you are asked to select the new icon, dead easy.

First of all create the icon you want in my example I'm using Larry the Cow taken directly from the Gentoo site. Rename/save the file to start-here.png

The next step is to find the folder of the current icons your using. If your not sure which set of icons you have then click on system > preferences > appearance this will open up a window, select customise and then icons, note the name of the highlighted set.

The folder is /usr/share/icons/{name_of_icon_set}/22x22/places/ we need to move our icon into this folder, but the problem is that it is restricted access, so simply dragging the file won't work.

Open a terminal and navigate to our custom icon. Type:
sudo mv start-here.png /usr/share/icons/{name_of_icon_set}/22x22/places/

Some users have also had success putting the icon in the scalable folder instead of 22x22, if you wish to try this then simply replace 22x22 with scalable in the above command. Please note that the 22x22 is a size, the icon should have been resized previously to 22x22 pixels.

So the file is in position and nothing happens, you can even restart and there will be no effect. We need to input a couple of commands before it will change:

sudo gtk-update-icon-cache --force /usr/share/icons/{name_of_icon_set}

and finally:

sudo killall gnome-panel

The screen will flicker and you should have your customised menu icon.