porting from cramfs 1.1 for mac os