maandag 7 juli 2008

HOWTO: MacBook (since february 2008) with Sabayon Linux 3.5 (Compiz Fusion, sound, belgian french keyboard)

Hi all,

I have my macbook since a few months and I like it alot.

But even Mac OS X can't give me the pleasure Linux or BSD gives me. (personally I hate the window manager)

That's why I tried installing Sabayon Linux.

I have experience with Gentoo, Debian, CentOS, ArchLinux, ...
However, the reasons why I installed Sabayon Linux (which is based on Gentoo) are the following:
- I like Gentoo alot, but am sometimes tired of all the compiling (Sabayon Linux provides a binary package manager which works together with portage (Gentoo package manager)
- Gentoo is more error prone
- Sabayon Linux has all the "bling bling" right out of the box (well... almost all:D )
- Sabayon is optimized to boot as fast as possible and shutdown as fast as possible (believe me, shutdown is really fast). This makes the other distros less good for this.
- ...

The following steps need to be done:
====================================
-Prepare the environment (partitioning)
-Install Sabayon Linux
-Install the bootloader (rEFIt)
-Configure Xorg to work with Compiz Fusion
-Configure Xorg to support the keyboard layout
-Configure ALSA for audio support
-Things still to fix

Partitioning
------------
There are different ways to do this, however I got alot of problems doing it.

I first tried with BootCamp (google for it ;) )
In a graphical interface you can slide a bar which splits a volume in 2 parts.
For me this failed. I booted with the Mac OS X Leopard CD and went to the diskutility.
There I repaired the drive and the permissions.
Still the same error (something about not being enough space; I even removed 2 large files which were 18GB in total, still the same result). I tried to first resize the first partition using diskutil, but with no succes either.
When I typed df -h to see the usage of the partitions I saw there was something wrong, so again I booted from CD and repaired it.
After alot of trying I gave up this method.

I disabled the journaling in Mac OS X:(should be re-enabled after resizing the partition)
sudo diskutil disableJournal disk0s2

I downloaded the Sabayon Linux iso file (x86_64) and burned it to a DVD.
Restart Mac OS X and be shure the DVD is in the drive. While booting up press "c" (without the quotes) after the chimes sound. (try to press it multiple times or for a long time if it fails to boot).
"Start Sabayon Linux 3.5" seemed a good start.
However I got a grey X server, and the Desktop Manager(window manager) would not start.
I went to the console by pressing "fn"+"ctrl"+"alt" (no shift for the alt button) and stopped xdm by issueing /etc/init.d/xdm stop
I just want X running with an easy window manager just so I could start gparted.
With nano I created a .xinit file in the root home directory.
nano .xinit
This was the content:
startfluxbox

Make .xinit executable by doing:
chmod +x .xinit
Now issue:
startx

This started fvwm (which is a very minimal window manager but it is more than enough for this purpose). X seemed to ignored my .xinit because fluxbox did not get started. Maybe I did something wrong, but the important is I have Xorg and a shell.

It is time to start gparted:
On a shell I typed "gparted" (without the quotes)
Then I selected where I wanted the application to be placed on the screen.

Then I resized the Mac OS X partition and Applied the changes.

To my surprise this went without any problems.

What I forgot the first time was making a linux partition and making it bootable.
So I rebooted after the install of Sabayon Linux (created the partition tool in the installer) and did it using the command line.
Again boot with the Sabayon Linux CD and this time choose Console only
parted
list
set 3 boot on
Where 3 is the number of the partition where linux is going to be (or in my case: already is)
If you don't make it bootable you get a black screen with a message that the device is not bootable.

Installation
------------
I used the text mode installer
After the installation boot into Mac OS X again (you will not be able to boot into linux anyway at this time).

Install boot manager
--------------------
Download rEFIt from sourceforge. Copy the efi directory to the root directory (not the root home directory). Go into the folder and run enable_always.sh (or something similar).

Now reboot again.
This time you should be presented with a menu which gives you the choice to boot Mac OS X or Linux (maybe also CD/DVD).
Just trying to boot Linux at this point will possibly still fail.
If it does, reboot and select the rEFIt shell in the menu.
It will automatically tell you something is wrong with the MBR and that it should be fixed.
Let rEFIt fix it.

Now reboot and select Linux.
Taaadaaaaaa :D

Configure Xorg for Compiz Fusion
--------------------------------
Go to the start menu and type "Compiz" in the search text field.
Start Compiz Fusion Icon.
When I the started applications I had only blank windows :s

I had a portable before with an Intel chipset so I knew where to search.
Open a terminal and edit /etc/X11/xorg.conf
Change your xorg Device section (Driver i810) until it looks like this: (you only have to uncomment 2 or 3 lines, if not, you are doing something wrong or another chipset is used. This method will help for you then)
IMPORTANT! BE SURE TO TAKE A BACKUP OF THIS FILE
Section "Device"
Identifier "VESA"
Driver "i810"
Option "RenderAccel" "on"
Option "XAANoOffscreenPixmaps"
#Option "BusType" "PCI"
#Option "ColorTiling" "on"
#Option "EnablePageFlip" "on"
Option "AccelMethod" "XAA"
EndSection

Now restart Xorg by issueing ctrl+alt+backspace (no shift for the alt key)
After starting Compiz Fusion Icon it should work great:)

Configure Xorg keyboard layout
------------------------------
Go to the start menu and search for "Control Center.
Start it and go to "Regional & accessibility", then "Keyboard layout".
Select France keyboard and add it to the list on the right.
Keep the layout variant as "Default" and for keyboard model select "MacBook/MacBook Pro (Intl)".

Apply and it should work correctly.
IMPORTANT! For square brackets or curly brackets (or braces), you need to use the LEFT alt key (with or without shift for curly or square brackets).

After logging out I get back to a qwerty keyboard layout. This is probably because I have to log in as root to change the keyboard layout system-wide.

Configure ALSA for audio support
--------------------------------
It took me some time to get this solved altough I found out quickly that it was the snd-intel-hda module(which was also in my Dell Latitude D630:) )

I searched for a few minutes and saw about the model that can be supplied as an option to the snd-intel-hda kernel module.

I was pretty sure this was the answer to my problem.
I tried with macbook, intel-mac-v1, ....
This url pointed me in the good direction:
http://wiki.sabayonlinux.org/index.php?title=HOWTO:_Resolve_Problems_with_HDA-Intel_Sound_Cards

None of these worked so after a lot of searching I decided to try with mbp3 (which is for the MacBook Pro 3rd generation; while mine isn't).

IMPORTANT: To see what model you have you could check the list in the introduction on this link:
http://gentoo-wiki.com/HARDWARE_Apple_MacBook

Edit /etc/modules.d/options (or create it if it does not exist yet)
and put the following in it:
options snd-hda-intel model=mbp3

(if it still fails also try to add this:
options snd-hda-intel position_fix=1
)

IMPORTANT: Be sure to do this after each change you make to /etc/modules.d/*
update-modules force
This will regenerate the /etc/modprobe.conf and /etc/modules.conf files.
And then:
/etc/init.d/alsasound start.

If still no succes, retry with doing
alsaconf

Also check that your volumes aren't muted.
00 means NOT muted. For me it is always confusing.
Master, PCI and Front should be enabled if I am correct.

Things still to fix
-------------------
-When I use the arrow keys, they just don't move the cursor, but instead do another action
-Right click is not possible :s
-The touchpad is so sensitive that when I type I accidentaly move the cursor.

maandag 14 april 2008

MySQL on FreeBSD don't want to start

I installed mysql5 server on my FreeBSD machine.
After adding the following to rc.conf:
mysql_enable="yes"
I notice that mysql is not really running:
netstat -an | grep 3306
did not give any output.

So I started digging.
The log file is by default:
/var/db/mysql/your-FQDN.err

The contest where:
080413 21:10:41 mysqld started
InnoDB: The first specified data file ./ibdata1 did not exist:
InnoDB: a new database to be created!
080413 21:10:42 InnoDB: Setting file ./ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
080413 21:10:43 InnoDB: Log file ./ib_logfile0 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile0 size to 5 MB
InnoDB: Database physically writes the file full: wait...
080413 21:10:43 InnoDB: Log file ./ib_logfile1 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile1 size to 5 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
080413 21:10:44 InnoDB: Started; log sequence number 0 0
080413 21:10:44 [ERROR] Can't start server : Bind on unix socket: Permission den
ied
080413 21:10:44 [ERROR] Do you already have another mysqld server running on soc
ket: /tmp/mysql.sock ?
080413 21:10:44 [ERROR] Aborting

080413 21:10:44 InnoDB: Starting shutdown...

So the bind of the unix socket is the problem. And it seems to be a permissions problem.

I started googling for this, and some info about /var/local/lib/mysql should be entirely owned by mysql (also group mysql)
I did that, but still without any luck.
There was not already a mysql server running or a file /tmp/mysql.sock

After some time I found out that the /tmp should be chmod 1777 for this to work.
The /var/tmp was like this, but the /tmp was not.
So I did this:
chmod 1777 /tmp
And mysql started just fine.

I have to say that this is probably not the good way of fixing this, probably I have to create an my.cnf file and specify there where the socket should be created.
Linux install by default a my.cnf file, but FreeBSD doesn't seem to be doing this.

If you fixed it you will get this at the bottom of your logfile:
080414 9:21:27 [Note] /usr/local/libexec/mysqld: ready for connections.

vrijdag 25 januari 2008

Compiz Fusion on Sabayon Linux 3.5 Loop 1 for Dell Latitude D630 (Intel 965GM X3100 chipset)

When I first tried Sabayon Linux (version 3.4f) Compiz Fusion was able to start, but when move a window it locked up.

A few days ago I installed the 3.5 version and noticed that the machine did not lock up anymore while using Compiz Fusion which is great.
BUT when I maximized and minimized the window or turned the cube it was not fluently.
Even If I only had one terminal open it still wasn't performing very well.

For daily use I use Debian and Compiz Fusion does work great there.
So I went to my config and compared them (another possibility was different versions of drivers, ...).
The only difference I see there is:

Code:
Option "AccelMethod" "EXA"

I commented this out and restarted Xorg.
Now everything goes great:)
There is only one downside: graphics quality seems lower (sharpness in the animations).

Although I normally do a minimal install of a distro and install the packages I really need, I do like Sabayon Linux because of it's real ease of use. (and of course because it's Gentoo based :D )
I only had to change this one line and my system works perfect (and this even for a beta version).
This made me very happy about Sabayon!

woensdag 16 januari 2008

Parallel Printer (lpt) on FreeBSD with CUPS

---Temporary---


For making the printer installable through SMB shares (drivers have still to be installed on the client?)
http://www.freebsddiary.org/cups.php

http://lfs.aliensoft.org/lfs/downloads/6.3/LFS-BOOK-6.3.pdf

Basic setup
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/printing-intro-setup.html




Powered by ScribeFire.