Well, it’s 04:09… and I can barely keep my eyes open, but I wanted to write some of this stuff down while it’s still fresh in my head. Right now, I’m writing this from my slackbook air. Feels pretty good. Granted, I’m not using a tiling window manager yet… and I’m using Firefox. But hey! it boots, networks, and x starts.
Unfortunately I can’t remember every little step that I took getting to this point. There was a lot of hacking, trying, failing, and retrying involved in getting here. I’ve reinstalled OS X and Slackware several more times since my last post in an attempt to get here. In the end, I made an OS X restore USB stick with the Lion DMG on it already. That sped things up greatly when restoring OS X.
I ended up installing rEFIt to the EFI system partition. While I did bless it (the OS X “make bootable” command), it still hangs during startup for about thirty seconds. This indicates that the blessing either fell off, or didn’t apply correctly the first time. Either way, I’m going to rebless it tomorrow with the OS X recovery thing.
I also decided to completely blow away OS X and the OS X recovery partition that normally sits on the drive with Lion. This is what prompted me to install rEFIt on the EFI system partition… I mistakenly thought that was where rEFIt installed automatically, so when I blew away the OS X partition that time, the whole system quit booting.
Quick Bloated overview
I know this is really unorganized. I’ll probably (not) come back later and clean it all up. Here is a brief bulleted rundown on how to get a working Slackbook Air:
- Backup your junk.
- Clone the slacware 13.37 directory and put it on an external hard drive (formatted with fat, preferably… or anything that mounts in the USBslack environment).
- Reinstall OS X
- Install rEFIt to the EFI system partition and bless it.
- Chop your OS X partition down to about 32GB.
- Create two new partitions: first one needs to be ~1gb, and the second fills the rest of the space. Both use fat. The second is just filler because the OS X partition tool is really stupid. You’ll delete it when you make your real filesystems.
- dd the usbslack image onto the smaller one. (dd if=/path/to/usbslack.img of=/dev/disk0s4 bs=512) (CHECK THAT COMMAND BEFORE YOU RUN IT. DD IS A DANGEROUS TOOL).
- At this point in the process, you have five partitions. In order: EFI System, OS X, OS X recovery, slackusb.
- Reboot twice.
- Boot into USB slack.
- mkdir /slack
- Hook up your external hard drive that you have the slackware 13.37 directory cloned to.
- dmesg | tail to figure out where it showed up.
- mount -t vfat /dev/sdc1 /slack (Note: it’s important to NOT use anything under /mnt for this. The install process mounts your new / partition directly on /mnt).
- Run `gdisk /dev/sda`. If you’ve installed rEFIt on your EFI system partition correctly, then you can blow away the OS X partitions (main and recovery) without repercussion now. The important thing here is that you absolutely must have a /boot partition in the first four. This is because we have to use a hybrid MBR later. So make your partitions. Mine looked like this:
- EFI system (DO NOT blow this one away)
- / (ext4, 64GB)
- /boot (ext2, 256MB)
- /usbslack (whatever fs it uses, 64MB)
- swap (swap, 4GB)
- /home (ext4, whatever was left)
I chose to keep /usbslack on number four just in case I screwed up my boot partition and needed to recover. Remember, you CANNOT boot linux off of USB on these machines. You will want something to keep you safe. It did come in handy several times.
- make your file systems (mkfs.ext4, mkfs.ext2, and mkswap)
- run `setup`
- go through the setup until you get to the part where it asks where you want to install packages from.
- At this point, choose pre-mounted directory (or whatever the bottom option is), and input `/slack/slackware13.37-64/slackware64/` without the quotes. If you didn’t mount your USB thing on /slack, or you renamed the slackware13.37-64 directory, then substitute appropriately. You do need to point to the directory that contains the package section directories (a, n , kde, etc).
- Choose your packages, or install them all. whatever.
- When you get to the lilo part, choose the expert option.
- Tell it you want to install to a super block, not the MBR.
- Go through the menu items one at a time inputting the appropriate information.
- Once you’ve gone through them, have it try to install. It’s going to fail, but the important part is that it’s generated a semi-working lilo.conf for you.
- Finish the rest of the setup process and exit. Don’t reboot yet.
- `cp /etc/lilo.conf /mnt/etc/lilo.conf` This saves your working config.
- I can’t recall whether I had to edit lilo.conf or not. Best to open it up and give it a once over.
- When you’re ready, run this: lilo -P ignore
- Hit y when it asks you if you’re really sure.
- That should succeed even though it throws like 7 something warnings. If you get a message about your new menu option being added, then you’re set.
- Go ahead and reboot now.
- If you see a new linux option appear in rEFIt, then you’ve done it successfully!
- If not, open up the EFI console and run: `gptsync` (without the quotes). If the stuff it spits out at you looks right, hit y. Then `reset` (again without the quotes).
- If it still doesn’t appear, then you’ve screwed up somewhere and lilo didn’t write correctly.
- Choose the linux option from rEFIt and boot.
- Awesome! Good job! it boots!
- And your frame buffer is totally screwed up (all that garbage at the right and bottom of your screen).
- The frame buffer problem is solved by upgrading to current. Yeah, i guess you could have just cloned current instead of 13.37, but whatever… that’s not how i did it.
- To get the wireless working, you’ll need to download, compile and install the wl kernel module. (wget, or lynx download it, untar, make, make install). You’ll need to reboot before you can `modprobe wl`. I sneakernetted this over.
- At this point, you can deviate from these, but I’ll just tell you what I did here:
- Download, compile, copy to /usr/bin/ and run macfanctld. This will keep your laptop from melting.
- Uncomment a 13.37 mirror in /etc/slackpkg/mirrors, and run `slackpkg update && slackpkg upgrade-all`. Upgrade it all.
- Reboot, make sure everything still works.
- Uncommant a current mirror in /etc/slackpkg/mirrors, and recomment the 13.37 mirror you uncommented earlier. Run those slackpkg update, and slackpkg upgrade-all commands. Be sure to de-select wget from the list, because it’s totally going to break, and screw up the rest of your upgrades!!
- That should finish, and ask you if you want to re-run lilo. Tell it yes. It should complain a lot less now (only two warnings, if i recall correctly).
- reboot, and fix your wireless config (the interface name has changed from eth0 to wlan0 or wlan1).
- You may also need to install a new version of libnl to get wpa-supplicant working again. I had to download this on another machine and sneakernet it over.
- Your framebuffer should now be fixed, and you’ll probably be able to startx now.
- Go though /etc/rc.d/rc.modules and uncomment the following:
- anything else you want.
You may have to run `slackpkg install-new` before x will work. There are some libraries there that it depends on, I think.
Some mistakes I made that you can avoid.
Don’t dd to the wrong partition. I accidentally demolished my EFI system partition this way, and had to reinstall OS X.
Make a full OS X recovery USB stick early. It works on Lion just fine. You need to re-download the installer from the app store though. No problem if you already bought lion.
Don’t stay up all night every night. It’s not good for you.
Don’t be afraid to break some stuff in the name of experimentation. Just make sure that you give it your best trying to fix it, and always have a backup of your data and an OS X recovery USB stick. I didn’t make this mistake.