firewing1's blog

MacBook and MacBook Pro 4,1 + Fedora 9

I recently bought a new MacBook Pro and had some trouble getting it to work in Fedora - Here's how I did it :)

Before we start

I've discovered three useful tips from playing around and a bit of web research that I should share before we begin. The first is that no matter how many OSs you install on your Mac, you're going to have to put Windows on the last partition of the disk. I have no idea why, but XP SP2 seems to bug out if you don't.

The second useful tip is that because of the way the EFI+MBR overlap when booting multiple operating systems, no extended partitions are supported. Mac also takes its own partition as part of the MBR compatability scheme, so that leaves you with a maximum of 3 OS partitions.

Finally and most importantly, it's very difficult to change the partitioning scheme once it's been finalized/the OSs are installed. I would recommend that if you think you're going to triple-boot later on, you leave the empty partiton in between for Linux or at the end for Windows to save you lots of headaches later... I hope this can help someone, since I almost had to format the entire HD (at that point, Windows AND Mac OS X) when I realized it would be very difficult to repartition and preserve data.

Step 1: Resize your Macintosh HD (HFS+ partition)

If you'd like to dual boot, simply open up the Boot Camp assistant and use it to partition your Mac Drive. When asked to insert the Windows installation disk, simply insert a Linux one and it will do the rest (skip step 2a). I recommend a kernel >= 2.6.24.

If you'd like to triple boot, it would be a good move to create the three partitions ahead of time. Fortunately for us, HFS+ partitions support resizing so it's a breeze to shrink OSX and add two new partitions. Simply boot from your Mac OSX install CD and select Terminal from the Utilities menu once it boots. Resize Macintish HD with this command:

diskutil resizeVolume disk0s2 100G "MS-DOS FAT32" "FormatToLinux" 15G "MS-DOS FAT32" "Windows" 50G

Change the volume sizes to match your preferred setup and hard drive size. Since both Linux can read to NTFS and read HFS+ safely, I figured it didn't need to be that big and so I left the Mac and Windows partitions larger.

When you're done, quit Terminal and reboot back into OS X. Insert the Windows install CD, reboot and hold the left "alt/option" key as the Mac boots. This will offer you the choice of booting from the CD named "Windows".

Step 2a: Install Windows

When it comes to the partition selection, select the last FAT32 partition ("Partition 4"). It should be labelled "Windows" - format it to NTFS (Quick format) and install onto that partition. Hint: One of the two OS X installation disks included with the Mac has Windows drivers for the keyboard backlight, trackpad, graphics card and more. When you're done setting up Windows, reboot holding the left "alt/option" key and boot into Mac OS X.

Step 2b: Install Fedora 9

Since the new Intel CPUs in the Macs have the EM64T extension, they support 64bit operating systems (x86_64). I chose the x86_64 variant of Fedora, however the 32bit (i386) version would work just as well. The installation, either off DVD of live media, goes pretty smoothly until partitioning. You must select "Custom Partition Layout". You'll find /dev/sda3 is type vfat - This is the drive we made that we need to format to ext3. Select it mount as "/", formatting to ext3 as well (you can use xfs or whatever filesystem you prefer here as well, I just like ext3 since it's well supported and tested). From here on you can follow the rest of the installation as usual.

Step 3: Wireless & Sound

Wireless is actually pretty easy for the Mac. The drivers included on the installation disc work perfectly, but Dell offers a driver form the same card that's easier to install than extracting it off the exes. First, download these RPMs on anther computer and transfer them to your home:

32bit (i386):
kmod-ndiswrapper-1.52-30.lvn9.i686.rpm

kmod-ndiswrapper-2.6.25-14.fc9.i686-1.52-30.lvn9.i686.rpm
ndiswrapper-1.52-1.lvn9.i386.rpm
R151517.EXE

64it (x86_64):
kmod-ndiswrapper-1.52-30.lvn9.x86_64.rpm

kmod-ndiswrapper-2.6.25-14.fc9.x86_64-1.52-30.lvn9.x86_64.rpm
ndiswrapper-1.52-1.lvn9.x86_64.rpm
R151517.EXE


Next, run this to install the wifi driver:

mkdir wifidriver
unzip -a R151517.EXE -d wifidriver/
cd wifidriver/DRIVER/
su
# install ndiswrapper and the wifi driver
rpm -Uhv *ndiswrapper*rpm && rm -i *ndiswrapper*rpm
/sbin/modprobe ndiswrapper
ndiswrapper -i bcmwl5.inf && rm -rf wifidriver && rm -i R151517.EXE
echo "options snd_hda_intel model=mbp3" >> /etc/modprobe.d/soundcard
echo "blacklist bcm43xx" >> /etc/modprobe.d/blacklist
echo "blacklist ssb" >> /etc/modprobe.d/blacklist
echo "blacklist b43" >> /etc/modprobe.d/blacklist
# ndiswrapper is used for wlan0
echo "modprobe ndiswrapper" >> /etc/rc.d/rc.local
echo "alias wlan0 ndiswrapper" >> /etc/modprobe.d/ndiswrapper
/sbin/service NetworkManager restart 

Step 5: Akmods

Since we plan on upgrading the kernel in a second, let's install akmods so that the kernel modules (ie, for wireless and nvidia if you're on a Pro) will create themselves when we update the kernel:

su
rpm -Uhv http://rpm.livna.org/livna-release-9.rpm
yum install akmods-ndiswrapper

If you're on a MacBook Pro, install the nvidia driver as well:

yum install akmods-nvidia 

Step 6: Kernel

Kernels 2.6.25.4-35 and newer include a fix for the fn-keys, which enables you to control the current song, volume and backlight, etc. At the moment this kernel hasn't been released to updates or updates-testing so we can use the a more recent koji build here. When a newer kernel is released to updates, just do a "yum update" to update the system (or do it via PackageKit if you prefere a GUI) and skip this entire step.

For 32bit systems, download it with this command:

wget http://koji.fedoraproject.org/packages/kernel/2.6.25.4/39.fc9/i686/\
kernel-2.6.25.4-39.fc9.i686.rpm http://koji.fedoraproject.org/packages/kernel\
/2.6.25.4/39.fc9/i686/kernel-devel-2.6.25.4-39.fc9.i686.rpm

For 64bit systems, download it with this command:

wget http://koji.fedoraproject.org/packages/kernel/2.6.25.4/39.fc9/x86_64/\
kernel-2.6.25.4-39.fc9.x86_64.rpm http://koji.fedoraproject.org/packages/kernel/\
2.6.25.4/39.fc9/x86_64/kernel-devel-2.6.25.4-39.fc9.x86_64.rpm

Next, install it:

su
rpm -ihv kernel*2.6.25.4-39*.rpm 

Reboot and let the akmods work their magic. If you don't have the nVidia driver and wireless working the first try, reboot again and things should return to normal.

Step 7: Pommed

Pommed lets you control the LED and keyboard backlight, soundcard, infrared remote and more. It will (hopefully) soon be included in Fedora, but until then, if you'd like to install it run this:

su
wget http://downloads.diffingo.com/diffingo-repo/diffingo.repo -O \
/etc/yum.repos.d/diffingo.repo
yum install pommed

Enjoy Linux (and Windows if applicable) on your new MacBook!

Rating: 

fwbackups 1.44 progress

First of all I wanted to mention I've registered #fwbackups irc.freenode.net, so you you have an account feel free to come by and discuss and ideas, feedback or bugs.

I've also been learning C++ (slowly) so I'm going to rewrite fwbackups into C++ but keep the interface the same. In other words, you shouldn't notice a thing except it being much, much faster! A friend also recently joined the development team, so hoepfully 1.44 won't take too long and we're planning to release with support for archives, direct copy as well as incremental backups à-la-Time Machine, have a backend plug-in system and have it run naitively in OS X too!

Rating: 
Tags: 

Fedora 9

Fedora 9 is here! As usual, this new Fedora release is the best so far and includes many new features from PackageKit replacing Pup and Pirut to the new PolicyKit system that makes regular users perform tasks that require root privledges easily. Check it out at fedoraproject.org.

Rating: 
Tags: 

Don't forget the ice cubes

My cousin has a 4 year-old iBook G4 that died recently... When I took a look at it, it was pretty evident that it was a hard disk failure. My cousin didn't have a backup and the iBook wouldn't boot at all, so I held Command+S to boot in single user mode and see what was recoverable. Everything seemed fine.

The longer I used the iBook, the more "ls" and "cd" hung... That's never a good sign. I plugged in my USB disk and tried to dd the iBook's disk over, which did work but at 5KB/s. That comes to roughly 72 days to copy the entire 60GB disk! I've heard the stories about people freezing their hard drives to get some data off, so figured at this point there was nothing to lose and it was worth a try. I stuck the Mac in the fridge for an hour and went to buy a 6-to-6pin Firewire cable.

When I got back, the Mac was nice and cold. I connected the iBook to a working Mac with the Firewire cable, connected my USB disk to the working Mac and finally, booted the iBook while holding "T" (for target disk mode - it makes the iBook act as an external disk).

To my surprise, not only did the iBook turn on (screen working and all), but the working Mac I had connected the iBook to recognized the iBook's hard internal disk! I was able to start running dd and then thought "that's great and all, but who says it's not going at 5KB/s again?" Well, a quick kill -s SIGINFO $! revealed that it was copying at over 5MB/s... Not bad!

The verdict? The freezer myth is true. I kept a ziplock filled with ice cubes around the area where the disk drive is on the iBook, and it kept up the 6MB/s rate for over 8 hours now, save for a few spots where there were bad sectors or funnily enough, when the ice melted! If you'd like to try this procedure, here's the condensed version:

  1. Make sure you have a partition that supports large files (ie, FAT32 won't cut it - we're making a disk image the size of the hard disk you're recovering). In my case, I used a 100GB HFS+ volume.
  2. Place the dead Mac in the fridge for an hour.
  3. Connect the dead Mac to a working one with a Firewire cable, and boot the dead Mac while holding "T" on it's keyboard. You should see the Firewire logo appear on it's screen after a moment.
  4. On the functional Mac, open Disk Utility again and you'll see the "Macintosh HD" volume from the dead Mac on the left pane. Select it and do File > Get Info to determine the partition identifier. It should be diskXsY, where X and Y are typically numbers under 10.
  5. Open a Terminal (Applications > Utilities > Terminal) and enter:
    dd if=/dev/diskXsY of="/Volumes/VOLNAME/dd.img" bs=512 conv=noerror &
    pid=$!;while true;do kill -s SIGINFO $pid;sleep 15;done

Remember to replace diskXsY with the identifier we found for the dead Mac's Macintosh HD. Replace VOLNAME with the volume name of drive you'd like to save the image to. It could be a networked, internally, or externally attached volume. For example, I used a volume on my external USB disk which had the name BACKUPS. I used the following:

dd if=/dev/disk1s2 of="/Volumes/BACKUPS/dd.img" bs=512 conv=noerror &

These commands will clone the dead Mac's hard disk partition, effectively creating a .dmg disk image of the dead Mac's drive. Once dd has finished, you'll find the image saved as dd.img on the volume you selected. dd will skip any bad sectors it encounters, so some data may be lost but if you're lucky you'll be able to get a good chunk out (in this case I was able to recover ~90% of the data). Statistics about the transfer progress are printed every 15 seconds - Once the disk copy is done, you can hit <ctrl+c> and quit the terminal to stop printing them. I hope this is able to help someone who needs data off their Mac!

Rating: 

Realtek HD + Mic (aka Intel Integrated Audio on ICH8)

I bought a low-end Logitech headset recently and it works perfectly in Linux but for some reason in Windows the volume was terrible. To make matters worse, it seemed like the drivers don't support mic boost and only the main "capture" slider is changable… The others such as line-in are locked!

After a bit of Googleing I came to relatively simple fix to the problem. If you're looking for a way to bring up your mic's volume, follow these steps:

  1. Update to the lastest drivers available from the Realtek website.
  2. Browse to C:\Program Files\Realtek\Audio\InstallShield and run the program named MicCal.exe
  3. Follow the on-screen instructions and when promted with a slider, bring it down to zero, leave it there for a few seconds. Raise it to 100% and be sure to click Next right away. Continue with the on-screen instructions to finish the wizard.
  4. Open up Realtek HD Sound Effect Manager from the Sounds, Speech & Audio Devices control panel category. You'll notice under the Playback knob on the left, you have a litte wrench/tool icon; click it and make sure Rear Pink In is checked off.
  5. Now, (use the arrows as needed) click the small button labeled .. (the Advanced button) under Rear Pink In. There, hidden, are the options for Mic Boost!

Reference: johnnygoodface's post at techspot forums

Rating: 

Future of fwbackups: What features do you like?

I've been thinking about the future of fwbackups, and the engines are causing me a bit of trouble. TimeVault is pretty cool and I'd like to implement something similar, but to do that I have to scrap the tar and tar+gz engines. I could also forget the TimeVault-like features for now and implement incremental backups. So, what do you think? I've got a poll running so you can vote for your preferred option on the left.

On another note, 1.43.2rc1 will include a minimize to system tray function so that fwbackups can stay in the tray as an applet :)

Rating: 
Tags: 

Welcome to the Matrix.

I like the Matrix trilogy more every time I watch it... There's some pretty interesting ideas in the movie. With the capabilities of technology growing every day, I don't believe we are going to be imprisoned by machines anytime soon but I do believe that the idea of a computer-generated "reality" will become, well, a reality pretty soon.

What is real? It's going to be interesting to see how reality (both the sense of the word's meaning and the experiences we all retain from this "reality"), will change. If computers can interact with the nervous system, how will we be able to tell the difference between the current and computer-projected realities? In theory, the two would be indistinguishable and as with all other digital technology, chances are the digital projection of reality would be even better than the real thing. Either way, linking human brains to machines is going to bring about both new possibilities and vulnerabilities... Ad-hock networks of brains would be something very cool - imagine swapping digitized memories, complete with a sense of smell, touch, etc that you could replay any number of times. Work experience/skills could be transferred as well, which would make education easier and quicker. The gaming industry would be revolutionalized... You wouldn't play games anymore, you'd experience them. Interact with them.

On the other hand, I bet it won't be long before brain-malware (brain32.mydoom O_o) appears too. But that's a whole other topic...

Rating: 

Presto: Speed up your updates and save bandwidth

Prestro is a new project that bridges the gap between deltarpm and yum. Now only will using yum-presto save you lots of bandwidth, but it will cut down on the time it takes to perform updates!

Need more help or want to ask a question? Discuss this topic here.

A little background information

Delta RPMs (DRPMs) are very similar to binary (regular) RPMs. The main difference is that DRPMs contain only the changes between two versions of an RPM package. This allows you to do full updates in a lot less time - Instead of downloading a full 10MB for an update where only 50kb of content changed, for example, you can now download only that 50kb of change and apply it to your system.

Not only will you save on bandwidth since you're only downloading in the changes in a package, but you'll also cut down on the time it takes to download and apply the packages.

Presto is a project which brings deltarpm and yum together; In other words, letting you use yum to apply DRPMs.

Installing yum-presto

The first step toward setting up Presto is installing the yum plugin:

yum -y install yum-presto

Configure the Updates repository

Next, we need to configure your updates repository to download deltarpm packages instead of the full ones. In the /etc/yum.repos.d/fedora-updates.repo file you'll find two lines that looks like this in the [updates] section:

#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/updates/$releasever/$basearch/
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-fX&arch=$basearch

Add a pound character to the start of the mirrorlist line so that it looks like this:

#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/updates/$releasever/$basearch/
#mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-fX&arch=$basearch

Finally, add a new line just under the "#mirrorlist=" line we just edited:

mirrorlist=http://presto-mirrors.anmar.eu.org/mirrorlist?repo=updates-released-f$releasever&arch=$basearch 

The pound sign makes Yum ignore the line that it's on, so essentially we're telling yum to ignore the base repository and any mirrors. The line which was added tells yum to use the presto-enabled mirrors instead.

 
That's it! Now run you can use yum or yumex as normal and benefit from the advantages of deltarpms.
 
Need more help or want to ask a question? Discuss this topic here.
Rating: 
Tags: 

Presto: Speed up your updates and save bandwidth

Need more help or want to ask a question? Discuss this topic here.

A little background information

Delta RPMs (DRPMs) are very similar to binary (regular) RPMs. The main difference is that DRPMs contain only the changes between two versions of an RPM package. This allows you to do full updates in a lot less time - Instead of downloading a full 10MB for an update where only 50kb of content changed, for example, you can now download only that 50kb of change and apply it to your system.

Not only will you save on bandwidth since you're only downloading in the changes in a package, but you'll also cut down on the time it takes to download and apply the packages.

Presto is a project which brings deltarpm and yum together; In other words, letting you use yum to apply DRPMs.

Installing yum-presto

The first step toward setting up Presto is installing the yum plugin:

yum -y install yum-presto

Configure the Updates repository

Next, we need to configure your updates repository to download deltarpm packages instead of the full ones. In the /etc/yum.repos.d/fedora-updates.repo file you'll find two lines that looks like this in the [updates] section:

#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/updates/$releasever/$basearch/
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-fX&arch=$basearch

Add a pound character to the start of the mirrorlist line so that it looks like this:

#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/updates/$releasever/$basearch/
#mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-fX&arch=$basearch

Finally, add a new line just under the "#mirrorlist=" line we just edited:

mirrorlist=http://presto-mirrors.anmar.eu.org/mirrorlist?repo=updates-released-f$releasever&arch=$basearch 

The pound sign makes Yum ignore the line that it's on, so essentially we're telling yum to ignore the base repository and any mirrors. The line which was added tells yum to use the presto-enabled mirrors instead.

 
That's it! Now run you can use yum or yumex as normal and benefit from the advantages of deltarpms.
 
Need more help or want to ask a question? Discuss this topic here.
Rating: 
Tags: 

Presto: Speed up your updates and save bandwidth

Need more help or want to ask a question? Discuss this topic here.

A little background information

Delta RPMs (DRPMs) are very similar to binary (regular) RPMs. The main difference is that DRPMs contain only the changes between two versions of an RPM package. This allows you to do full updates in a lot less time - Instead of downloading a full 10MB for an update where only 50kb of content changed, for example, you can now download only that 50kb of change and apply it to your system.

Not only will you save on bandwidth since you're only downloading in the changes in a package, but you'll also cut down on the time it takes to download and apply the packages.

Presto is a project which brings deltarpm and yum together; In other words, letting you use yum to apply DRPMs.

Installing yum-presto

The first step toward setting up Presto is installing the yum plugin:

yum -y install yum-presto

Configure the Updates repository

Next, we need to configure your updates repository to download deltarpm packages instead of the full ones. In the /etc/yum.repos.d/fedora-updates.repo file you'll find two lines that looks like this in the [updates] section:

#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/updates/$releasever/$basearch/
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-fX&arch=$basearch

Add a pound character to the start of the mirrorlist line so that it looks like this:

#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/updates/$releasever/$basearch/
#mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-fX&arch=$basearch

Finally, add a new line just under the "#mirrorlist=" line we just edited:

mirrorlist=http://presto-mirrors.anmar.eu.org/mirrorlist?repo=updates-released-f$releasever&arch=$basearch 

The pound sign makes Yum ignore the line that it's on, so essentially we're telling yum to ignore the base repository and any mirrors. The line which was added tells yum to use the presto-enabled mirrors instead.

That's it! Now run you can use yum or yumex as normal and benefit from the advantages of deltarpms.
 
Need more help or want to ask a question? Discuss this topic here.
Rating: 
Tags: