Friday, April 07, 2006

Ubuntu on a PowerBook

If you haven't read my previous two posts, please go back and do so. This is a continuation of them.

When we last left off, I ran out of hard disk space. The solution I came up with was this... While the installer was running a second time (I allowed it to reformat the ext3 Linux partition to start over), I did these things: I flipped over to the second console (ctrl+option+F1), pressed enter to start it, and navigated to the folder where packages were being copied to. There are two locations I found that were useful. One of them was /target/var/cache/apt/archives, and when the installer reaches the Copying remaining packages to hard disk phase, you can go in after it and delete things. Upon completion, I realize that I could probably have deleted almost everything, because Ubuntu was really resiliant with downloading or retrieving from CD things it did not have at the time it needed them later. But, I was careful, and I picked and chose things I knew about that I considered unessential to begin with, like gimp, openoffice.org, and a few others. Quite a few others, too many to list. At this step, don't worry so much about what you want to run, we just need to get the base system up and going, so be generous in how much you delete. Be sure to delete most of the truetype font packages, especially the foreign ones, they're really hefty on space requirements. (I would remove xorg and gnome for the time being for reasons described further down. We will add them back in later.) My partition was 1.7G, and at the end of this step I think I had whittled it down to 36% usage (use "df" to check your free space on /target) But, the previous attempt when I ran out of space, it was around 51% usage at the end of this step. The "end" of this step is when the installer talks about a bootloader and instructs you to remove the media and reboot.

After this, unplug your network connection, because if you don't, you'll be waiting on a big download to retrieve the files you swiped out from under it. Remove the CD when you reboot as well, or else it will probably copy from there.

In BootX, select the new kernel from the install, but leave the ramdisk image the same as it was (I think), and boot again. In this phase, Ubuntu will set up and configure all the packages that were copied.

If you boot up to a text login prompt, you can skip down until the section titled "GETTING GNOME TO WORK":

So, after I got Ubuntu installed, my first main problem was the video was scrambled. There were stripes through it, and the mouse cursor tweaked the colors as I moved it. Also, even though I could see well enough to log in, doing so gave me nothing but a blank "brown" screen, along with the gnome login sound. To make matters worse, trying to flip over to another console with option+ctrl+F1 produced a flickering screen instead of readable text, and logging into the failsafe terminal mode gave me scrambled letters that were unreadable.

To make a long story short, I used BootX to boot up from the CD again. There is some confusion in my mind about which initrd file to use. I am pretty sure I have only had real success with the initrd.gz from the Ubuntu CD. The one I copied over wasn't proceeding to boot. However, I flipped the kernel back over to the vmlinux taken from the CD, and started up. I proceeded forward until the networking was set up, but did NOT partition again, then flipped over to another console. option+ctrl+F2, and press enter to start it. At this point, you are accessing the Ram Disk (initrd) file system, not the one you installed previously. So, I made a directory in the root called t (for target, I'm lazy), with mkdir /t, then I mounted my target volume there. mount -t ext3 /dev/hda10 /t, and you can get in and update your XF86Config file, use cd /t and chroot to set your root to your target drive so that you can use pico or vi to edit your files.

GETTING GNOME TO WORK

The XF86Config file I "copied from" to achieve a working result with the PowerBook LCD display was this one, although I only used portions of it. Specifically, I tried to keep my keyboard and mouse devices "as is" because they were working fine. Your mileage may vary:
Section "ServerLayout"
Identifier "Powerbook 3400c Configured"
Screen 0 "Screen0" 0 0
InputDevice "Mouse0" "CorePointer"
InputDevice "Keyboard0" "CoreKeyboard"
EndSection

Section "Files"
RgbPath "/usr/X11R6/lib/X11/rgb"
FontPath "/usr/share/fonts/ttf"
FontPath "/usr/share/fonts/artwiz-fonts:unscaled"
FontPath "/usr/share/fonts/misc"
FontPath "/usr/lib/X11/fonts/100dpi/:unscaled"
# FontPath "/usr/lib/X11/fonts/75dpi/:unscaled"
FontPath "/usr/lib/X11/fonts/misc:unscaled"
# FontPath "/usr/lib/X11/fonts/Type1"
# FontPath "/usr/lib/X11/fonts/Speedo"
# FontPath "/usr/lib/X11/fonts/75dpi"
# FontPath "/usr/lib/X11/fonts/100dpi"
EndSection

Section "Module"
# Load "GLcore"
# Load "dbe"
# Load "dri"
Load "extmod"
# Load "glx"
# Load "pex5"
# Load "record"
# Load "xie"
# Load "ddc"
Load "bitmap"
Load "freetype"
# Load "speedo"
Load "type1"
# Load "vbe"
# Load "int10"
EndSection

Section "InputDevice"
Identifier "Keyboard0"
Driver "keyboard"
Option "Protocol" "Standard"
Option "AutoRepeat" "250 30"
Option "LeftAlt" "Meta"
Option "RightAlt" "Meta"
Option "ScrollLock" "Compose"
Option "RightCtl" "Control"
Option "XkbLayout" "us"
EndSection

Section "InputDevice"
Identifier "Mouse0"
Driver "mouse"
# Option "ZAxisMapping" "4 5"
Option "Protocol" "PS/2"
# Kernel 2.4 with devfs:
Option "Device" "/dev/input/mice"
# Kernel 2.2 :
# Option "Device" "/dev/mouse"
EndSection

Section "Monitor"
Identifier "Monitor0"
VendorName "Unknown"
ModelName "Unknown"
# DisplaySize 256 184
HorizSync 119
VertRefresh 196
Option "DPMS"
Option "blank time""5"
Option "standby time""10"
Option "suspend time""30"
Option "off time""60"
EndSection

Section "Device"
Identifier "Card0"
Driver "fbdev"
# BusID "PCI:0:17:0"
EndSection

Section "Screen"
Identifier "Screen0"
Device "Card0"
Monitor "Monitor0"
DefaultDepth 15
SubSection "Display"
Depth 1
EndSubSection
SubSection "Display"
Depth 4
EndSubSection
SubSection "Display"
Depth 8
Modes "800x600"
ViewPort 0 0
Virtual 800 600
EndSubSection
SubSection "Display"
Depth 15
fbbpp 16
Modes "800x600"
# ViewPort 0 0
# Virtual 800 600
EndSubSection
SubSection "Display"
Depth 16
fbbpp 16
Modes "800x600"
# ViewPort 0 0
# Virtual 800 600
EndSubSection
SubSection "Display"
Depth 24
Modes "800x600"
ViewPort 0 0
Virtual 800 600
EndSubSection
SubSection "Display"
Depth 32
Modes "800x600"
ViewPort 0 0
Virtual 800 600
EndSubSection
EndSection
After these changes, I unmounted the drive, umount /t, then I rebooted again (type "sudo shutdown now"), set BootX back to the installed kernel, and it booted up to a fine looking screen.

If you've made it this far, the rest is relatively easy. Flip over to a text console with ctrl+option+F1 and log in. run sudo aptitude to go into the text mode package manager, and watching the space requirements, use its interface to disable anything remaining that you don't think you'll need, and enable gnome. You will want to remove ubuntu-desktop and a couple other similar packages, because they are "umbrellas" for the entire system, and will be considered broken if you don't. Don't worry, removing ubuntu-desktop will still let you install everything you need, it just won't enforce it anymore.

After you've applied your changes here, and waited a long time. :-) You will find that gnome still doesn't work. Darn. To fix your gdm and gnome, you need to run
sudo dpkg-reconfigure -a
After answering the numerous questions to the best of your ability, and trying NOT to change the video settings at all, so as not to destroy our custom PowerBook video selection we made above.

Affter this was all finished, I rebooted ("sudo shutdown now") and logged in, and everything came up fine!

Watch your free disk space! Installing even a couple packages can wipe it away to nothing. This is not for the faint of heart, but does render a usable Macintosh as a result.

Best of luck!

0 Comments:

Post a Comment

<< Home