Re: EXT2 as a module

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On Tue, Sep 23, 2008 at 12:19 AM, Paulo da Silva <psdasilva@xxxxxxxxxxxx> wrote:
Paulo da Silva escreveu:

rishi agrawal escreveu:

You can pick the whole dir of ext2, rename it to another name foo. Then
change all occurences of ext2 to foo, EXT2 to FOO, Ext2 to Foo  (this
one not sure if it exists) and you have a new filesystem foo. You may
need to change back some FOO or foo to EXT2 or ext2 because they are not
in the ext2 dir. These are general stuff, like bit operations that you
may not want to change at all. Other small changes that may occur are
also trivial.

I dit that changing ext2 to extp.
You may have to change this depending on the version of the kernel.

for f in $(ls *.c *.h Makefile); do
  echo $f
  sed -i \
      -e s/ext2/extp/g \
      -e s/EXT2/EXTP/g \
      -e s/extp_find_next_zero_bit/ext2_find_next_zero_bit/g \
      -e s/extp_set_bit_atomic/ext2_set_bit_atomic/g \
      -e s/extp_clear_bit_atomic/ext2_clear_bit_atomic/g \
      -e s/extp_test_bit/ext2_test_bit/g \
      -e s/extp_fsblk_t/ext2_fsblk_t/g \
      -e s/EXTP_SUPER_MAGIC/EXT2_SUPER_MAGIC/g \
          $f
done


HTH
Paulo

BTW, you may also need to copy the ext2* from
/usr/src/linux/include/linux and rename all files ext2* to extp*. Then
replace refs to #include <linux/* > to #include "*".




--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


Other way of doing is,
  1. compile kernel without ext2 support, i.e. set CONFIG_EXT2_FS as n. [probably others too, you can experiment CONFIG_EXT2_FS_XATTR, CONFIG_EXT2_FS_POSIX_ACL, CONFIG_EXT2_FS_SECURITY ]
  2. Then the kernel compiled wont have ext2 as its part.
  3. Then compile your ext2 directory as module. To do this you'll need to edit Makefile, replace CONFIG params by m. e.g.
  4. replace obj-$(CONFIG_EXT2_FS) += ext2.o by obj-m += ext2.o
Now each time you can make changes to ext2 module and compile it as a module and insmod it. I have tried this and it works.

But make sure that your disk file-system that you are using is other than ext2, because it no more will be recognized.

-
Sunil .

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux