Showing posts with label powerbook. Show all posts
Showing posts with label powerbook. Show all posts

Wednesday, July 18, 2007

Samba Server

A few weeks ago, I decided I would make my Linux box the file server for my network. Since shared files and folders must be accessible from Windows and Mac machines, Samba seemed like the best cross-platform solution.

The installation turned out to be a relatively painless process. Here's how I did it on Ubuntu Dapper.

First we need to install a couple of packages:

sudo apt-get install samba smbfs

I'm not positive that smbfs is required for the Samba server, but most guides recommend it. So I'll follow their lead.

A vanilla install of Ubuntu should be properly configured for Samba, so there's not much else to do besides add to the list of Samba users. In the second line, you may replace sudo with gksudo if you prefer one of the GTK editors, like gedit. There may be an analogous command for KDE apps, but I rarely run them as superuser, so I wouldn't know.

sudo smbpasswd -a system_username
sudo vi /etc/samba/smbusers


where system_username is the user you wish to add as a Samba user. You will be prompted to create a password. This is the password the user will use to connect to Samba shares.

We must add the following line to /etc/samba/smbusers:

system_username = "network username"

Note you may make the network username different from the system username. There are a variety of reasons you might do this. For example, the user may have a different name on the machine from which he will connect to the Samba shares. You might alternately designate a unique username as a security measure.

To set up your Samba shares, you must either edit /etc/samba/smb.conf by hand or install SWAT, which supposedly does the dirty work for you. Either way, the lines you add to the file should look something like this:

[music]
path = /windows/Music
browseable = yes
writeable = yes
valid users = jlz27
admin users = jlz27

I'm typing this from my PowerBook, running Mac OS X 10.4.10, while connected to one of the Samba shares. So it definitely works.

Saturday, January 27, 2007

Etch-a-Sketch

I've finally made some progress installing Debian on my PowerBook. I took the laptop to campus last week and ran a net install of Debian Etch. Everything went well until the installation was complete, when I discovered the X server wouldn't start. Aïe! Luckily it turned out to be nothing serious.

After delivering a proper barrage of expletives, I decided to tweak the configuration a bit. Among the errors in the X server were one line about DRI and a couple of lines about the Synaptics touchpad driver. The latter was simple enough to fix. I opened the X server configuration file and commented out the sections that mentioned Synaptics.

nano /etc/X11/xorg.conf

So that took care of the errors about the Synaptics driver. I later removed those lines altogether, once I was sure they weren't needed. The DRI error proved to be more frustrating to remedy. I'll skip the gory details and just say that I had to disable the framebuffer device. Here's how my config file looks now.
Section "Files"
FontPath "/usr/share/fonts/X11/misc"
FontPath "/usr/X11R6/lib/X11/fonts/misc"
FontPath "/usr/share/fonts/X11/cyrillic"
FontPath "/usr/X11R6/lib/X11/fonts/cyrillic"
FontPath "/usr/share/fonts/X11/100dpi/:unscaled"
FontPath "/usr/X11R6/lib/X11/fonts/100dpi/:unscaled"
FontPath "/usr/share/fonts/X11/75dpi/:unscaled"
FontPath "/usr/X11R6/lib/X11/fonts/75dpi/:unscaled"
FontPath "/usr/share/fonts/X11/Type1"
FontPath "/usr/X11R6/lib/X11/fonts/Type1"
FontPath "/usr/share/fonts/X11/100dpi"
FontPath "/usr/X11R6/lib/X11/fonts/100dpi"
FontPath "/usr/share/fonts/X11/75dpi"
FontPath "/usr/X11R6/lib/X11/fonts/75dpi"
# path to defoma fonts
FontPath "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
EndSection

Section "Module"
Load "i2c"
Load "bitmap"
Load "ddc"
Load "dri"
Load "extmod"
Load "freetype"
Load "glx"
Load "int10"
Load "vbe"
EndSection

Section "InputDevice"
Identifier "Generic Keyboard"
Driver "kbd"
Option "CoreKeyboard"
Option "XkbRules" "xorg"
Option "XkbModel" "pc104"
Option "XkbLayout" "us"
EndSection

Section "InputDevice"
Identifier "Configured Mouse"
Driver "mouse"
Option "CorePointer"
Option "Device" "/dev/input/mice"
Option "Protocol" "ImPS/2"
Option "Emulate3Buttons" "true"
EndSection

Section "Device"
Identifier "nVidia Corporation NV34M [GeForce FX Go5200]"
Driver "nv"
BusID "PCI:0:16:0"
Option "UseFBDev" "false"
EndSection

Section "Monitor"
Identifier "Color LCD"
Option "DPMS"
HorizSync 28-51
VertRefresh 43-60
EndSection

Section "Screen"
Identifier "Default Screen"
Device "nVidia Corporation NV34M [GeForce FX Go5200]"
Monitor "Color LCD"
DefaultDepth 16
SubSection "Display"
Depth 1
Modes "1024x768"
EndSubSection
SubSection "Display"
Depth 4
Modes "1024x768"
EndSubSection
SubSection "Display"
Depth 8
Modes "1024x768"
EndSubSection
SubSection "Display"
Depth 15
Modes "1024x768"
EndSubSection
SubSection "Display"
Depth 16
Modes "1024x768"
EndSubSection
SubSection "Display"
Depth 24
Modes "1024x768"
EndSubSection
EndSection

Section "ServerLayout"
Identifier "Default Layout"
Screen "Default Screen"
InputDevice "Generic Keyboard"
InputDevice "Configured Mouse"
EndSection

Section "DRI"
Mode 0666
EndSection
Those two changes got me a working X server. As usual, there are some lingering issues to be resolved but not as many as I expected.

Matthias Schmidt reported that an older 2.4 kernel, courtesy of Benjamin Herrenschmidt, didn't correctly recognize the CPU clock frequency. That doesn't seem to be a problem with the 2.6.17-2-powerpc kernel in Etch. You can enter the following command to see your clock frequency.

cat /proc/cpuinfo | grep clock

For me, this outputs 1333.333000MHz, which my limited mental math skills tell me equals 1.33GHz and is therefore accurate. However, the problems with power management haven't been remedied yet.

The source of all the difficulty is the GeForce FX Go5200. NVIDIA hasn't released open source drivers for the PowerPC and probably never will. I can't say I blame them. To the best of my knowledge, Apple didn't start using NVIDIA chips in their machines until the advent of OS X. At this point, no sane user of Apple hardware would run GNU/Linux when Tiger "just works" to a degree that its free counterpart has yet to achieve. Thus I return to OS X on my PowerBook G4.

I offer my apologies to those who were hoping for more information on this topic. You may find these resources useful.

Thursday, December 21, 2006

PowerPC + NVIDIA + Linux = Headaches

Earlier this week, I got the idea into my head that I would reformat the hard disk on my 12" 1.33GHz PowerBook G4, model number M9183LL/A, and install some flavor of Linux on it. I'm not talking about a dual-boot system. No way, José! I want the distro I choose to be the only OS on the machine. Well, easier said than done, it seems.

I rather arbitrarily picked Gentoo, mostly because I've been itching to try it and partly because Drexel University's CS machines run it. I'm glad it wasn't the first time I was installing a Linux distro; a Gentoo installation requires you to manually configure your kernel. Thankfully the Gentoo Foundation's docs made it a painless procedure. Unfortunately I neglected to download the ISO for the Package CD until I had already completed the base installation. At this point, I realized the ISO is too large to fit on a 700MB CD-R. I wasn't interested in going out and buying 870MB discs, so I decided I had nothing to lose by moving to a different distro. (Net install wasn't an option because it seems our ISP only allows one MAC address per customer with its basic service.) Ubuntu was next on my list, since I had great success with it when I was a newbie.

I downloaded Ubuntu 6.10 Edgy, the current release.1 The streamlined graphical installer—and video interview with Nelson Mandela, included on the Live CD—made me think twice about continuing. I've grown accustomed (or, some might say, desensitized) to poorly color-coordinated, often inscrutable Linux interfaces. This new Ubuntu installer bears an unsettling resemblance to the Windows XP installer. It asks you the same questions: language, time zone, user name and password. The only potentially intimidating part is partitioning your disk, and it offers to do that for you. Personal prejudices aside, Edgy did deliver a functional Linux OS in a matter of minutes with minimal effort on my part.

Of course, as with any Linux installation, there were some lingering issues to be resolved:
  • I immediately noticed that I couldn't adjust the screen brightness. The Fn+F1 and +F2 key combinations displayed a brightness indicator, but the actual level didn't correspond to the indicated level. In fact, it didn't change at all.
  • Next I discovered that suspend doesn't work.2 When I closed the lid and the switch engaged, the screen went blank, but I could still hear the fan spinning.
This was intolerable. The only way I ever got close to the advertised 5 hours of battery life (at left) was through judicious use of the power management functions; I always keep the brightness down when I'm unplugged and let the machine sleep when it's idle.


To be deprived of power management spoils mobile computing for me. I wasn't ready to give up on Ubuntu, so I turned to Google.
  • The NVIDIA GeForce FX Go5200 equipped in my PowerBook lacks an official driver for the PowerPC (PPC) architecture. This goes for all NVIDIA GPUs. That's a pain.3
  • Power management is perhaps the most challenging aspect of configuring the Linux kernel. It requires tight integration of your OS, BIOS and hardware.
  • A daemon called pmud may alleviate some of the problems users are experiencing running Ubuntu for PPC. (I've already come up with a slew of clever puns for the post I'll probably be writing about it. Consider yourself warned.)
While searching for information on the power management problem, I came across several pages describing successful Debian installations on the PPC. As a satisfied Debian user, this immediately piqued my interest. I'm planning to try a net install sometime in the next few days. Due to the aforementioned ISP limitations, I need to find a place where I'll have uninterrupted broadband ethernet access for an hour or two. For now, here are links to two hits I found particularly informative:
I hope to be posting soon with better news. Adieu!
1 There is also Ubuntu 6.06 Dapper, which promises 3 years of support on the desktop. I read yesterday that it's more stable on the PPC than Edgy.
2 For the uninitiated, there are two types, suspend-to-RAM and suspend-to-disk. The former freezes all processes and stores their state in RAM, powering off all other hardware. This allows for fast resume but does have the disadvantage of causing an unclean crash in the event of a power interruption. The latter saves the processes' state to the hard disk and shuts down the entire system. As you might expect, it takes longer to resume from suspend-to-disk.
3 There are myriad petitions online urging NVIDIA to release open source drivers. It seems NVIDIA hasn't heard or doesn't care. I wouldn't hold out hope for seeing these drivers anytime soon.

Monday, June 19, 2006

X11 marks the spot

Over the past year, I've grown fond of my Linux box and sorely miss it when I'm using my PowerBook on the go. Luckily a couple of computer science professors introduced me to two invaluable tools. Now I can run my favorite programs without going through the hassle of installing a separate OS.

The first tool is Fink. This project ports Unix software to Darwin and Mac OS X. It also allows you to manage your packages with dpkg and apt-get, one of the most attractive and celebrated features of Debian. Download Fink from the SourceForge project site and install it. Installation instructions are available there. I ran into trouble because I already had a .profile and .Xresources file. I moved these files to another path and ran pathsetup.sh again. After that, everything went smoothly. Once you have Fink installed, you can use dselect and apt-get on the command line—which I'm sure makes you very happy if you're a Debian vet.

Now you'll want to install Apple's X11 or XDarwin. When you're running X11 within Mac OS X, it probably makes more sense to choose Apple's X11, even though it doesn't have quite the same features as XDarwin does. Supposedly it is available on the third Panther CD. (Since I only have the first two Panther CDs, I can't confirm this.) I downloaded it from the Apple web site. The installation was easy.

Before you start your X server for the first time, you should configure it to initialize Fink. You'll need a file named .xinitrc in your home directory for this. I copied an existing one and modified it to suit my needs.

$ cp /private/etc/X11/xinit/xinitrc ~/.xinitrc

Open the copy in your favorite editor.

$ sudo emacs .xinitrc

Now add the following line to the top of the file. This will tell the X server to initialize Fink before anything else. In my copy, I added three more lines at the end of the file to start the KDE window manager.* You can do other cool things, but I'll leave it at that for this example.

. /sw/bin/init.sh

export KDEWM=kwin
quartz-wm --only-proxy &
/sw/bin/startkde > /tmp/kde.log 2>&1

Once you've saved the file, you can begin using your X11 environment. To start Apple's X11, go to the Utilities folder (Command + Shift + U in Finder) and double-click X11. You need to change your preferences to run in full screen mode. Full screen mode is toggled with the Command + Option + A shortcut. Once the X server has initialized you have a UNIX-like environment for your computing pleasure.

* Note that you don't have to use KDE. I chose it because it seems to be the most fully supported window manager for Fink.