OpenBSD on a PowerBook G4: A brief overview

Discussion in 'Windows, Linux & Others on the Mac' started by 556fmjoe, Apr 25, 2014.

  1. 556fmjoe, Apr 25, 2014
    Last edited: Mar 21, 2016

    556fmjoe macrumors 65816

    Joined:
    Apr 19, 2014
    #1
    edit on 21-MAR-2016: This post is outdated. Some of it may still work, but some won't. Some of the things I mentioned here I no longer think is the best way anymore. Always check the official OpenBSD documentation linked in this post.


    A couple people have asked about my OpenBSD setup, so I figured I'd make a post that addresses it. This mainly pertains to OpenBSD 5.4 on a PowerPC based Mac, but a lot of it will apply to any OpenBSD installation. This isn't about what OpenBSD is or whether you should or shouldn't use it, but if you decide to give it a shot, hopefully it will come in useful.

    Some good links

    Main OpenBSD page: http://www.openbsd.org/

    FAQ that covers almost everything: http://www.openbsd.org/faq/index.html

    Great guide for setting up encrypted /home: http://geekyschmidt.com/2011/01/24/configuring-openbsd-svnd-for-encrypted-volumes





    Installation: Very easy. OpenBSD has a very straightforward installer. You can install the whole system with only a few key presses. On my machine, you boot the install CD by either holding the C key or from the Open Firmware prompt like so

    Code:
    boot cd:,ofwboot 5.4/macppc/bsd.rd
    The installation steps are well documented and self explanatory, so I won't go through them here.

    I wanted a fully encrypted drive, which would normally be accomplished through softraid, but that method appears to only work for amd64 and i386 architectures. I settled for an encrypted /home.

    I accomplished this through the vnconfig tool. It's similar to Truecrypt in that you create an encrypted file that will be treated like a device that you can read, write, etc. When you dismount it, it is simply an encrypted file. The steps I used are documented at this website (http://geekyschmidt.com/2011/01/24/configuring-openbsd-svnd-for-encrypted-volumes) but I had to make a few changes because his guide seems to be a little out of date.

    Changes I made

    1.) During the OpenBSD install process, I created a separate /crypt partition so I could store my image file there. I also resized the /home partition to only 2 GB since I was not going to really use it as /home.

    2.) The size of the image file can't be more than 3 GB. I got errors when trying to use vnconfig on a file larger than that. I have not seen this documented anywhere, so it may just be a macppc related issue. A 3 GB /home is fine for my purposes. It's not a good idea to make a gigantic image file here anyway, since vnconfig uses 448 bit Blowfish when used the -K option, as I did. Blowfish is a 64 bit block cipher, and security implications arise if a 64 bit block cipher is used on more than 34 gigabytes of data with the same key. 3 GB provides a comfortable margin.


    3.) Instead of using the svnd1 device as specified in the guide, use vnd1 if you are using OpenBSD 5.4. It used to be necessary to use svnd1 when using encryption, but this is no longer the case and vnd1 will handle it fine. You will get errors if you try to use svnd1 because it no longer exists in OpenBSD.

    4.) I increased the PBKDF2 round count to 7555. Higher is better, but much slower on old hardware like mine.

    One side effect of doing your /home encryption the vnconfig way is that you can still login if you forget the encryption password for the vnd1 device. You will not be able to see your data stored there, but you won't be shut out of the system. I'm ambivalent about whether this is good or bad.


    Besides encryption, I also needed wifi. The Airport Extreme card in my PowerBook is supposed to be supported by the Broadcom driver, bwi. Unfortunately, Broadcom does not release open source firmware, which means I had to download the firmware and manually install it with pkg_add. It installed fine, and the OS can see the card (it shows up as bwi0), but crashes when I try to bring the bwi0 interface up. I think this is a firmware issue, since the card worked under OS X.

    A much better solution was to buy a $10 Buffalo N150 USB wireless adapter. This one is based on the Ralink WLI-UC-GNM chipset and is supported by the run driver. It works perfectly with the open source firmware included in OpenBSD and is nice and small. I'd prefer to run only open source firmware anyway, since that stuff runs in the kernel. The kernel can't do much to protect itself against malicious or sloppy code running in the kernel, so open source mitigates those risks.

    I wanted to run the fvwm window manager, but with a nice background. I installed xv to handle this and made a .xinitrc file in my home directory. I put these lines in it. The first will load background.jpg as a wallpaper when the X server starts, and the second will launch fvwm.

    Code:
    xv -root -quit /home/556fmjoe/pics/background.jpg
    fvwm
    Running the X server lets me use a lot more applications than I can run from just the shell, even tough I prefer the shell. Here are some of them.

    Web Browsing: Firefox for most use. You can install either Firefox 22 or 3.6.28. I found that 3.6.28 is about twice as fast as 22 and half the size. I have my user agent set to that of an iPhone 3 using the UserAgentSwitcher add-on so that I get mobile versions of sites. This makes things much faster. I disabled automatic image loading for the same reason. I use NoScript, HttpsEverywhere, and Perspectives (great addon that checks for man-in-the-middle attacks over SSL/TLS connections). NoScript really helps with speed and security but breaks a lot of websites until you allow the necessary scripts.

    Youtube and Flash: Minitube and Gnash, respectively. I only tried these once and they were so painfully slow that I gave up. I have used Minitube before on faster hardware and it was great, so I'm sure this is just the old hardware's fault. Gnash is a free Flash replacement plugin that also works most of the time, but since I seldom need it, I'd prefer not to have it on my machine.

    Email: Claws Mail. It's light, fast, and supports GPG encryption. I like it.

    Documents: AbiWord. Lightweight and allows for saving as .doc files, sort of. They are really .rtf files with a .doc extension. However, Microsoft themselves did this with Word years ago and AbiWord seems to be compatible. I have not had any problems.

    PDF Reader: Evince. Another lighter weight program, it handles PDFs pretty well. Loads a bit slowly on my machine, but so does most software.

    Text editor: I use vi or nano. Nano is much easier and faster, so I use that if I just need to make a few quick changes to a configuration file. Vi is good for more intensive tasks, like programming which I seldom do.


    Hardware support is mixed on this machine. Firewire and Bluetooth are not supported, though I have little need for either. Battery and power management is lacking, though running
    Code:
    apm
    gives an overview of battery life. I use
    Code:
    sudo sysctl hw.setperf=X
    to change the CPU clock speed to whatever I decide X is (either 50% or 100%). Battery life at 50% CPU is about 120 minutes, but my battery is old and at full charge only has 30 watt hours of capacity. The touchpad works great, the USB ports work, wireless mice work, and the backlight works. The wifi issue I covered above, but can be worked around with a USB wireless. The keyboard controls for brightness and volume work fine, as does the eject cd button.

    The system is stable and I have never had it crash, other than the aforementioned wifi firmware issue. The performance is good for this computer, probably better than OS X Tiger. Then again, Fvwm takes almost no resources and I have very few programs running at any given time. Browsing with Firefox is decent and slightly faster than Firefox for Tiger, but nothing spectacularly better.

    I'll add more as I think of it
     
  2. whiteonline macrumors 6502

    whiteonline

    Joined:
    Aug 19, 2011
    Location:
    California, USA
    #2
    Well done.
    Reminds me of when I came across an abandoned Sun Sparc Station (aka "pizza box") in the datacenter, and decided to do the same. Was a challenge due to no CDROM drive.
    I had to create a jumpstart server to create a slice as a destination of the extracted BSD CD image. Then i could boot from that to install. Great learning experience....back in 2000. :cool:
     
  3. G4TheWin macrumors member

    Joined:
    Dec 8, 2012
    Location:
    A ditch somewhere
    #3
    That reminds me of my Debian setup on my iBook. I got video acceleration AND suspend working by downgrading Mesa, and it runs fairly well. Here's a picture of it running Iceweasel 24, streaming Groove Salad, and playing a quick game of Solitaire.[​IMG] I stole my Conky configuration from PPC Luddite, and modified it to work with the Airport card, not the Ethernet interface. It's not lightweight, but it works, and the battery lasts for about 4-5 hours before the thing turns off. I do hope that the Debian package maintainers get bug 961488 working, or else I won't be able to use Iceweasel when I upgrade to Jessie. I mainly use this computer for video capture (It's the only computer I own that has a Firewire port and DOESN'T overheat, and I can't put a Firewire card in my desktop since the people who designed my motherboard are stupid and put the PCI slots IN FRONT of the PCI Extreme slot, where the graphics card sticks out too far and covers them), web browsing on the go, and taking notes in class. I don't use Gnash or anything because the version installed by Debian gives you Pulse Audio, which likes to take up my CPU, reduce battery life, and randomly mute the speaker when I unplug my headphones.
     
  4. Altemose macrumors G3

    Altemose

    Joined:
    Mar 26, 2013
    Location:
    Elkton, Maryland
    #4
    @556fmjoe Could you post what your desktop looks like under OpenBSD with the window manager you use?
     
  5. 556fmjoe thread starter macrumors 65816

    Joined:
    Apr 19, 2014
    #5
    This is the current configuration with spectrwm, showing a plain desktop, one rxvt terminal running top, and rxvt and Netsurf running concurrently on the same virtual desktop.

    I should add that my original post is outdated. The official documentation should always take precedence over anything I post.
     

    Attached Files:

    • wm3.png
      wm3.png
      File size:
      66.8 KB
      Views:
      280
    • wm1.png
      wm1.png
      File size:
      767.2 KB
      Views:
      221
    • wm2.png
      wm2.png
      File size:
      54.8 KB
      Views:
      255
  6. Altemose macrumors G3

    Altemose

    Joined:
    Mar 26, 2013
    Location:
    Elkton, Maryland
    #6
    It appears to be very lean and clean from the looks of it! What other (lightweight) desktop environments can you use?
     
  7. 556fmjoe, Aug 14, 2015
    Last edited: Aug 14, 2015

    556fmjoe thread starter macrumors 65816

    Joined:
    Apr 19, 2014
    #7
    There are lots of them. The other two I use the most are cwm and XFCE. XFCE is probably the heaviest I would go on a G4, but it will run it fine. Cwm is in the base system so you don't need to install anything. It's very lightweight and simple. Like spectrwm, everything is controlled by key bindings, though unlike spectrwm you get a right click context menu that you can edit with whatever items you want. Tons of other WMs are available though.

    Here are a couple screenshots of XFCE on my T420.
     

    Attached Files:

  8. Altemose macrumors G3

    Altemose

    Joined:
    Mar 26, 2013
    Location:
    Elkton, Maryland
    #9
    Very nice!
     
  9. Lastic macrumors 6502

    Joined:
    Mar 19, 2016
    Location:
    North of the HellHole
    #10
    I just finished installing a triple boot on my Powerbook G4 12 inch consisting of

    Ubuntu Mate 16.04 LTS, OpenBSD 5.8, OS X 10.5.8

    So far I'm loving OpenBSD the most due to the small footprint of the OS ( have it running on a Sun Fire T1000 also ) but there is just one thing which I seem to be unable to find any solution for : the console font.

    Any clue on how to change the console to 80x50 or how to load a nicer font , the one I currently get looks like Comic SanSerif :) and is way too big to be usable on the system console (tty) ?
     
  10. 556fmjoe thread starter macrumors 65816

    Joined:
    Apr 19, 2014
    #11
    I don't believe there is a way to do that on macppc. The usual way is documented here (section 7.5), but macppc is not in the list: http://www.openbsd.org/faq/faq7.html

    The only machine I have that lets me change to a 80x50 console using the above process is a T23 with a Savage video card. I would consider just running X.
     
  11. Lastic macrumors 6502

    Joined:
    Mar 19, 2016
    Location:
    North of the HellHole
    #12
    Thanks for your prompt reply.

    Tried NetBSD but cannot even get it to boot from Open Firmware.

    Tried FreeBSD there the font is usable, screen dimming works even in tty up to blanking the screen but their bwi0 is broken and since it being Tier 2 compiling curl from source was already taking 4 hours so I'm not even going to start compiling X from source.

    So sad that there isn't a best of both worlds, FreeBSD graphics support + OpenBSD network,security support .
     
  12. Lastic macrumors 6502

    Joined:
    Mar 19, 2016
    Location:
    North of the HellHole
    #13
    After reading all the messages in the OpenBSD powerpc mailing list up to 2013 , I found the solution
    which as I suspected means compiling your own kernel because one option has to be added.

    The post from the OpenBSD powerpc mailing list

    http://openbsd-archive.7691.n7.nabbl...-td233231.html

    A guide on how to do this ( in German but still usable ) look at the Section Framebuffer

    http://linuxwiki.de/BennySiegert/iBook2

    Now I can get a text on a line without it breaking off to the next line (vi,nano) , no weird columns when running systat.

    Next up :) change the text foreground colour
     
  13. Lastic macrumors 6502

    Joined:
    Mar 19, 2016
    Location:
    North of the HellHole
    #14
    Sorry to dig up your thread again but I'm currently still running FreeBSD 10.3 on my 12" Powerbook G4.

    After several days of compiling from ports , I got X11 running and Openbox .

    Several browsers failed to compile but luckily I remembered your thread and the only browser that compiles is Netsurf.

    Thus thought I give spectrwm a try , I was just wondering if you could share how you got your statusbar at the top setup in spectrwm ? Is it done via the .spectrwm.config file or using something like conky ?
     

Share This Page