You are not logged in.

#1 2008-11-17 09:15:39

shazeal
Member
From: New Zealand
Registered: 2007-06-05
Posts: 341

Klibc + Kernel 2.6.28 + Ext4

After a major headache today when I decided to mix these 3 things together I found that fstype from klibc has no idea what ext4 is, only ext4dev. I had the ext4dev option enabled in the kernel thinking this would be ok, but it does not actually build an ext4dev.ko just inserts some code into ext4.ko.
In the end I had to butcher the mkinitcpio filesystem hook and directly insert ext4 as the FSTYPE. This was build of course on another machine since I am using ext4 as my rootfs wink

I did try rebuilding klibc but it really does not like 2.6.28 with the new asm dir changes, even the 2.6.26-ARCH kernel makes the build bail.

So really I'm just wondering if anyone else actually has any of this in a working state? Or would know of a way to fix it other than mangling mkinitcpio?

Offline

#2 2008-11-17 10:17:52

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,018

Re: Klibc + Kernel 2.6.28 + Ext4

I've been using .28-zen and ext4 without problems or any additional fiddling.

-edit-

But not for root, that's the problem, I presume.

Last edited by lucke (2008-11-17 10:19:03)

Offline

#3 2008-11-17 18:57:34

shazeal
Member
From: New Zealand
Registered: 2007-06-05
Posts: 341

Re: Klibc + Kernel 2.6.28 + Ext4

Yep, anything other than root would be fine since its done after the initramfs has loaded, the code for kinit is pretty hideous, but all that needs to change afaik is replacing ext4dev with ext4 since the 2.6.27->2.6.28 change is just a name change. But it seems you have to jump through rings of fire to get klibc to compile mad

From fstype.c in klibc, it cant find ext4 so it trys to autodetect and finds an ext3 superblock, unfortunately it also finds extents and falls over when it trys to mount root.

    {1, "ext4dev", ext4_image},
    {1, "ext3", ext3_image},
    {1, "ext2", ext2_image},

Offline

#4 2008-11-17 19:04:55

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,018

Re: Klibc + Kernel 2.6.28 + Ext4

If you're using your own kernel anyway, perhaps you should think of getting rid of initramfs.

Offline

#5 2008-11-17 19:31:01

shazeal
Member
From: New Zealand
Registered: 2007-06-05
Posts: 341

Re: Klibc + Kernel 2.6.28 + Ext4

Unfortunately its not my own, it gets shipped off to about 5 other machines wink

Offline

#6 2009-01-12 06:25:12

jkyellic
Member
Registered: 2009-01-12
Posts: 2

Re: Klibc + Kernel 2.6.28 + Ext4

It's quick and dirty, and certainly not good practice, but a solution to this was to quickly hexedit /usr/lib/klibc/bin/fstype, find the "ext3" string and switch it to be "ext4".  Then rebuild your initramfs image by reinstalling the kernel.

This causes all ext3 filesystems to be mis-detected as ext4 at boot (not after init).  Since ext4 can be used to mount ext3 filesystems without breaking compatibility with ext3 this works alright for me.

It's ugly, but it's a 10 second fix that works.

Last edited by jkyellic (2009-01-12 06:26:59)

Offline

Board footer

Powered by FluxBB