Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
20 years ago

Release 1.4 cramfs

Greetings,

Between version 1.3 and 1.4 there were some several changes to cramfs ... and unfortunately, there is

some pretty broken code in cramfs/inode.c. Specifically, some new bit manipulation macros

were added that hose the fs from the get-go. Anyway, for those who use cramfs, here&#39;s a quick fix:<div class='quotetop'>QUOTE </div>

--- Quote Start ---

#if defined(CRAMFS_LOBOTOMY_COMPLETE)

/* severe brain damage -- do not use */# define CRAMFS_16(x) le16_to_cpu(x)# define CRAMFS_24(x) ((le32_to_cpu(x)) >> 8)# define CRAMFS_32(x) le32_to_cpu(x)

# define CRAMFS_GET_NAMELEN(x) (((u8*)(x))[8] & 0x3f)# define CRAMFS_GET_OFFSET(x) ((CRAMFS_24(((u32*)(x))[2] & 0xffffff) << 2) |

((((u32*)(x))[2] & 0xc0000000) >> 30))

#else

/* work with nios ii 5.0 -- assume nothing more ;-) */# define CRAMFS_16(x) le16_to_cpu(x)# define CRAMFS_24(x) ((le32_to_cpu(x)) & 0x00ffffff)# define CRAMFS_32(x) le32_to_cpu(x)

# define CRAMFS_GET_NAMELEN(x) (le32_to_cpu(((u32*)(x))[2]) & 0x03f)# define CRAMFS_GET_OFFSET(x) (le32_to_cpu(((u32*)(x))[2]) >> 6)# endif[/b]

--- Quote End ---

Regards,

--Scott