FS#9330 - patch for openBSD support for ipodpatcher

Attached to Project: Rockbox
Opened by Brian (empedocles) - Thursday, 28 August 2008, 00:35 GMT
Task Type Patches
Category Rbutil
Status Unconfirmed
Assigned To No-one
Operating System iPod Nano
Severity Low
Priority Normal
Reported Version Daily build (which?)
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No


The following patches will allow someone running openBSD to run ipodpatcher. This is my first pass at these patches, so they cannot be integrated without some problems.

A few outstanding questions remain:

1) should I use /dev/sd0c or /dev/rsd0c?

2) why do byteorder(3) functions exist in fat32format.c?

3) how do the developers want to handle disk geometry?

I ask the last question because my patch overwrites the existing ioctl with what works for openBSD, rather than separate it out. And the patch doesn't fully use what is available in struct disklabel. I plan to re-write this one.

The fat32format.diff comments out byteorder(3) functions. The ipodio-posix.diff converts the file to openBSD disk geometry. The ipodpatcher.diff corrects the device used.

I have only tested the patches above for ipodpatcher on iPod nano 1st gen.

This task depends upon

Comment by Rafaël Carré (funman) - Wednesday, 08 October 2008, 00:04 GMT
1) I don't know what is the difference between the 2, you should know ;)

2) On Linux I don't see swap16/32() functions in byteorder manpage, maybe they are specific to OpenBSD, and should be ifdef'ed ?
Something like #ifndef swap16 rather than #ifndef __OpenBSD__ . What do you think ?
Comment by Brian (empedocles) - Wednesday, 08 October 2008, 00:57 GMT
The difference between the two is that one is for a raw device, while the other is for a block device. My patches assume a block device.

I am planning to clean up the patches. These patches are more of a proof of concept, so that the developers would know what needs to be in place for rbutilqt to build on openBSD. However, before I spend time cleaning these up, I need a static tarball of the source required to build rbutilqt as of it's latest release. Then, I can obtain feedback from other openBSD users, so I can fine tune these patches and make they don't break other builds. I will build my own tarball in mean time.

I do agree with your point two. Here's a link to the byteorder(3) man page:

The last two functions are the ones in question.