« ecto vs KungLog | Main | Oops my fault »
February 28, 2004
ext2fs for OSX
After realizing I didn't have the proper build environment on my machine to compile ext2fs for OSX, I shot an email off to Brian about it. He was quick to respond and set me sort of straight... well, as straight as one could be set given the following circumstances.
It seems that the disklib library (found in the diskdev_cmds project) needed for mounting and unmounting of things is a bit out of whack, or I've forgotten how source control works again. Anyways, to get version 208 of the code to work, let alone compile, the patch in the extended portion of this entry will be needed. Mind you I called the original files blah.orig where blah is to be replaced by the properly named file. Really it seems that disk.h was moved, and someone forgot to update the project. I make no promises that my hack is usable or stable for anyone or anything, user be wary.
ext2fs though does not seem to like compiling, and I'm not sure what the best answer is. Upon opening the project in Xcode, any build fails because of missing header files. Those missing header files are dynamically generated though by the e2fsprogsbuild.sh script, which currently seems to die at the end. Looks like a bunch of time will need to be spent getting this to compile status on Panther yet.
--- dkdisklabel.orig Sat Feb 28 17:15:27 2004
+++ dkdisklabel.c Sat Feb 28 17:19:15 2004
@@ -14,6 +14,7 @@
#include
#include
#include
+#include
#include
#include
@@ -23,13 +24,13 @@
#define NLABELS 4
///m:temp:added:stop::workaround:awaiting-disk_label-deprecation-from-"disk.h"
#ifndef linux
-#include
+#include
#else
#include
#ifdef __powerpc__
#define __ppc__
#endif
-#define DKIOCNUMBLKS BLKGETSIZE
+#define DKIOCGETBLOCKCOUNT BLKGETSIZE
#endif
#include
@@ -90,7 +91,7 @@
int numblks;
/* obtain the size of the media (in blocks) */
- if ( (error = ioctl(fd, DKIOCNUMBLKS, &numblks)) < 0 )
+ if ( (error = ioctl(fd, DKIOCGETBLOCKCOUNT, &numblks)) < 0 )
return(error);
#ifdef linux
@@ -98,7 +99,7 @@
blksize = DEV_BSIZE;
#else
/* obtain the block size of the media */
- if ( (error = ioctl(fd, DKIOCBLKSIZE, &blksize)) < 0 )
+ if ( (error = ioctl(fd, DKIOCGETBLOCKSIZE, &blksize)) < 0 )
return(error);
#endif
--- dksecsize.orig Sat Feb 28 17:22:18 2004
+++ dksecsize.c Sat Feb 28 17:14:19 2004
@@ -38,7 +38,8 @@
#include
#include
-#include
+#include
+#include
#include
#include
#include
@@ -63,7 +64,7 @@
else
return (0);
- if (ioctl(fd, DKIOCTBLKSIZE, &devblklen) < 0) {
+ if (ioctl(fd, DKIOCGETBLOCKSIZE, &devblklen) < 0) {
(void)close(fd);
return (0);
}
--- ufslabel.orig Sat Feb 28 17:19:27 2004
+++ ufslabel.c Sat Feb 28 17:20:00 2004
@@ -17,7 +17,7 @@
#include
#include
#ifndef linux
-#include
+#include
#endif
#include
#include
@@ -184,8 +184,8 @@
*label_p = NULL;
#ifndef linux
- if (ioctl(fd, DKIOCBLKSIZE, &blocksize) < 0) {
- fprintf(stderr, "DKIOCBLKSIZE failed, %s\n", strerror(errno));
+ if (ioctl(fd, DKIOCGETBLOCKSIZE, &blocksize) < 0) {
+ fprintf(stderr, "DKIOCGETBLOCKSIZE failed, %s\n", strerror(errno));
return (NULL);
}
#else
Posted by Dan at February 28, 2004 08:16 PM
Trackback Pings
TrackBack URL for this entry:
http://www.deadmime.org/cgi-bin/cgiwrap/dank/mt.cgi/mt-tb.cgi/6
Listed below are links to weblogs that reference ext2fs for OSX:
» Don't fix it unless it's broke from My World Line (Relatively Speaking)
Dan and I spent a good three hours on AIM today tracking down why building e2fsprogs broke on his machine but not mine. Both were running Panther and had the XCode 1.1 tools installed. But, Dan would always get compiler... [Read More]
Tracked on February 29, 2004 03:26 PM