erich@xxxxxxxx wrote:
[...]
: I'm interested in adding XFS support to the GRUB bootloader, and want
: to know if there's anything better than the early XFS documents and
: reverse-engineering to go by? (I suppose I could just ask a lot of
: questions as I go? ;)
I have started to write grub xfs module, but now I have no enought
time to finish it.
Good place to see how to read xfs is source of xfsutils, and
experiments with xfs_db, for example - we have kernel in
/boot/vmlinuz-2.4.4-ac8-xfs-kdb, rootfs is on /dev/hdb1,
so try:
root@wizard:~:# xfs_db /dev/hdb1
xfs_db: inode 128
xfs_db: print
[...]
u.sfdir2.hdr.count = 1
u.sfdir2.hdr.i8count = 0
u.sfdir2.hdr.parent.i4 = 128
u.sfdir2.list[0].namelen = 4
u.sfdir2.list[0].offset = 0x30
u.sfdir2.list[0].name = "boot"
u.sfdir2.list[0].inumber.i4 = 131
xfs_db: inode 131
xfs_db: print
[...]
u.sfdir2.hdr.count = 1
u.sfdir2.hdr.i8count = 0
u.sfdir2.hdr.parent.i4 = 128
u.sfdir2.list[0].namelen = 25
u.sfdir2.list[0].offset = 0x30
u.sfdir2.list[0].name = "vmlinuz-2.4.4-ac8-xfs-kdb"
u.sfdir2.list[0].inumber.i4 = 132
xfs_db: inode 132
xfs_db: print
core.magic = 0x494e
core.mode = 0100644
core.version = 1
core.format = 2 (extents)
core.nlinkv1 = 1
core.uid = 0
core.gid = 0
core.atime.sec = Sat May 19 19:34:36 2001
core.atime.nsec = 365138000
core.mtime.sec = Sat May 19 19:34:36 2001
core.mtime.nsec = 415138000
core.ctime.sec = Sat May 19 19:34:36 2001
core.ctime.nsec = 415138000
core.size = 1126036
core.nblocks = 275
core.extsize = 0
core.nextents = 1
core.naextents = 0
core.forkoff = 0
core.aformat = 2 (extents)
core.dmevmask = 0
core.dmstate = 0
core.newrtbm = 0
core.prealloc = 0
core.realtime = 0
core.gen = 0
next_unlinked = null
u.bmx[0] = [startoff,startblock,blockcount,extentflag] 0:[0,12,275,0]
Root inode is usualy 128, in this inode boot ditrectory is in 131
inode, and vmlinuz-2.4.4-ac8-xfs-kdb file in 132 inode.
File starst on block 12 and occupy 275 blocks.
In grub should be done:
- in stage2/disk_io.c - entry for xfs in fsys_table, this table
contains functions pointers to xfs_mount, xfs_read and xfs_dir
- stage2/fsys_xfs.c - file with this functions
--
Daniel Podlejski <underley@xxxxxxxxxxxxxxx>
... When you're talkin to yourself and nobody's home
You can fool yourself, you came in this world alone ...
|