dev builds
themes manual
device status forums
mailing lists
IRC bugs
dev guide

Rockbox mail archive

Subject: Trying to build ipodpatcher for openBSD

Trying to build ipodpatcher for openBSD

From: Brian <>
Date: Tue, 26 Aug 2008 21:32:48 -0700 (PDT)

I have started down the road of building ipodpatcher for openBSD. I have been successful in building ipodpatcher, but I am still have some questions. And I'm still trying to get it to work.

Some questions:

* if I had previously used ipodpatcher on an ipod nano, should I receive an error saying that the partition does not match an ipod, if I turn off the silence flags? This is where I am stuck.

Some info:

* ipods show up as /dev/sd0j, where 0 can be incremented, so I had to add
  this line to ipodpatcher.c

#elif defined(__OpenBSD__)

* some functions are redeclared in fat32format.c from byteorder(3) as found in sys/types.h, for now, I just #if 0 #endif'd them out. I need some help here.

* the geometry works differently on openBSD, so here's an example c program that opens up an ipod and gets some basic geometry information,
so geometry needs to be changed in ipodio-posix.c:

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/disklabel.h>
#include <sys/ioctl.h>
#include <err.h>

main(int argc, char **argv) {

  int fd;
  char *ipod = "/dev/sd0j";
  struct disklabel dl;

  fd = open(ipod, O_RDONLY);
  if (fd == -1) {
     printf("fd: %d\n", fd);
  /* disk geometry */

  if (ioctl(fd, DIOCGPDINFO, &dl) == -1) {

  printf("sectors: %d\nsector size: %d\n", dl.d_nsectors, dl.d_secsize);

  return 0;

Here are some temporary changes I made; need some help with how this file should be patched:

#elif defined(__OpenBSD__)
#include <sys/disklabel.h>

struct disklabel geometry;

    if(ioctl(ipod->dh, DIOCGPDINFO, &geometry) == -1 &&
       ioctl(ipod->dh, DIOCGDINFO, &geometry) == -1 ) {
        ipod->sector_size = 512;
        if (!silent) fprintf(stderr,"[ERR] ioctl() call to get sector size failed, defaulting to %d\n"
    else {
        ipod->sector_size = geometry.d_secsize;

note: I go by _emp on the irc chat.


List admin:
Received on 2008-08-27

Page template was last modified "Tue Sep 7 00:00:02 2021" The Rockbox Crew -- Privacy Policy