[darwinbuild] "darwinbuild xnu" fails: /dev/null: No such file or
ssen at opendarwin.org
Mon Jan 9 13:39:31 PST 2006
Fascinating... if you look at the file cctools/as/notes:
Changes for the 5.17 release (the cctools-572 release):
- Fixed a bug so that if /dev/null is used as the output file it is
since it is not a regular file. The change was in write_object() in
write_object.c to stat(2) the output file first and check to see
that it is a
regular file before doing the unlink(2). Radar bug #4007180.
Since Panther's cctools doesn't have this change, darwinbuild doesn't
work. It looks like we should not be relying on that functionality.
Your change is probably the correct one. Thanks for investigating this!
On Jan 9, 2006, at 1:29 PM, Dustin Lang wrote:
> I'll provide an answer to my own question.
> It appears that the "as" command invoked by the build script was
> deleting /dev/null. Cheeky monkey! I fixed it by changing the
> following line in darwinbuild (around line 620):
> echo " cctools version: \$(as -v -o /dev/null < /dev/
> null 2>&1 | cut -c 22- 2>/dev/null)"
> echo " cctools version: \$(as -v -o /ignore-me < /dev/null 2>&1
> | cut -c 22- 2>/dev/null)"
> I found this problem by adding an "ls -l /dev/null" after that line
> and finding that /dev/null no longer existed.
> After this change, xnu is (so far) happily building...
> By the way, this was on a MacOS 10.3.9 system:
> ProductName: Mac OS X
> ProductVersion: 10.3.9
> BuildVersion: 7W98
>> I spent yesterday trying to get various darwin components build,
>> using what I thought was darwinbuild 0.7.2. It turned out that I
>> had in fact installed an older version to /usr/local/darwinbuild
>> and modified my path to point to that one, while the new one was
>> installed in /usr/local. Argh - that sort of thing makes me feel
>> pretty dumb. If darwinbuild had a "-version" option I might have
>> caught my mistake sooner - feature request?
>> Anyway, I've now straightened myself out but am rather quickly
>> hitting a wall. I run "darwinbuild -init 7W98", then "darwinbuild
>> xnu", which produces the log file attached.
>> I tried doing "mount -t devfs devfs BuildRoot/dev/" before running
>> darwinbuild, with almost the same effect (it reports "devfs
>> appears to exist").
>> I added a couple of lines to darwinbuild to do an "ls -l /dev/
>> null" at the start of the build script, with this result:
>> Checking /dev/null:
>> crw-rw-rw- 1 root wheel 3, 2 9 Jan 09:22 /dev/null
>> so it looks to me like /dev/null exists in the chrooted environment.
>> What's going on? Any suggestions of what I should do?
> darwinbuild mailing list
> darwinbuild at opendarwin.org
More information about the darwinbuild-dev