Skip to contentSkip to conversation

UFS support

DISCUSSION Marco Gerards 2 participants 5 messages May 13, 2004 – May 21, 2004

lore
Share & tools
lore
#0 lore raw

Hi,

Just to to prevent someone else will do the same (and thus double) work.

I am working on UFS/UFS2 support for GRUB 2 (and it is almost finished). After that I will work on some other filesystems:

- minixfs
- hfs / hfs+
- jfs
- reiserfs (3 and 4)
- xfs
- bfs
- ext3
(most likely inn that order)

Jeroen is working on iso9660fs now, so I will not do that.

If I do not send any email about this, please assume I am working on it. But if someone else wants to work on one of these things please tell me.

All these filesystems will be written from scratch (because I want to learn about the filesystems and I just like doing this work -- a lot).

If I forgot to mention one important filesystem, please tell me. Requests for less important are of course welcome, but do not expect anything.

Thanks,
Marco

#1 lore raw
Quoted 1 line · Marco Gerards

- minixfs

If you can, please add support for version 2 as well. Currently, GRUB Legacy supports only version 1 (I have a patch for version 2 locally, though).

Quoted 3 lines

If I forgot to mention one important filesystem, please tell me. Requests for less important are of course welcome, but do not expect anything.

Probably these are less important, but some people would want these:

- cramfs
- squashfs
- jffs
- jffs2
- ntfs

Regards,
Okuji

#2 lore raw
Quoted 6 lines · Yoshinori K. Okuji
Quoted 1 line · Marco Gerards

- minixfs

If you can, please add support for version 2 as well. Currently, GRUB Legacy supports only version 1 (I have a patch for version 2 locally, though).

Ok. That is not hard to do.

Quoted 11 lines
Quoted 3 lines

If I forgot to mention one important filesystem, please tell me. Requests for less important are of course welcome, but do not expect anything.

Probably these are less important, but some people would want these:

- cramfs
- squashfs
- jffs
- jffs2
- ntfs

I will keep those in mind, but no promises. (I haven't even heard about the first 4).

--
Marco

#3 lore raw
In reply to Marco Gerards
Quoted 2 lines · Marco Gerards

I am working on UFS/UFS2 support for GRUB 2 (and it is almost finished). After that I will work on some other filesystems:

Here it is.

It supports both UFS and UFS2. I will commit it on Sunday, so please review it before Sunday if you want to check it.

Thanks,
Marco

2004-05-21 Marco Gerards <[email protected]>

* conf/i386-pc.rmk (grub_setup_SOURCES): Add fs/ufs.c (grub_emu_SOURCES): Likewise. (pkgdata_MODULES): Add ufs.mod. (ufs_mod_SOURCES): New variable. (ufs_mod_CFLAGS): Likewise.
* fs/ufs.c: New file.
* include/grub/fs.h (grub_ufs_init): New prototype. (grub_ufs_fini): Likewise.
* util/grub-emu.c (main): Initialize and deinitialize UFS.

Index: conf/i386-pc.rmk
===================================================================
RCS file: /cvsroot/grub/grub2/conf/i386-pc.rmk,v
retrieving revision 1.13

i386-pc.rmk +7 -3
diff -u -p -u -p -r1.13 i386-pc.rmk
@@ -56,7 +56,7 @@ grub_mkimage_LDFLAGS = -llzo
 grub_setup_SOURCES = util/i386/pc/grub-setup.c util/i386/pc/biosdisk.c \
 	util/misc.c util/i386/pc/getroot.c kern/device.c kern/disk.c \
 	kern/err.c kern/misc.c disk/i386/pc/partition.c fs/fat.c fs/ext2.c \
-	kern/file.c kern/fs.c kern/env.c
+	fs/ufs.c kern/file.c kern/fs.c kern/env.c
 
 # For grub
 grub_emu_SOURCES = kern/main.c kern/device.c				\
@@ -64,7 +64,7 @@ grub_emu_SOURCES = kern/main.c kern/devi
         kern/misc.c kern/loader.c kern/rescue.c kern/term.c		\
 	disk/i386/pc/partition.c kern/env.c commands/ls.c		\
 	commands/terminal.c commands/boot.c commands/cmp.c commands/cat.c		\
-	util/i386/pc/biosdisk.c fs/fat.c fs/ext2.c			\
+	util/i386/pc/biosdisk.c fs/fat.c fs/ext2.c fs/ufs.c			\
 	normal/cmdline.c normal/command.c normal/main.c normal/menu.c normal/arg.c	\
 	util/console.c util/grub-emu.c util/misc.c util/i386/pc/getroot.c
 grub_emu_LDFLAGS = -lncurses
@@ -73,7 +73,7 @@ grub_emu_LDFLAGS = -lncurses
 genmoddep_SOURCES = util/genmoddep.c
 
 # Modules.
-pkgdata_MODULES = _chain.mod _linux.mod fat.mod ext2.mod normal.mod hello.mod \
+pkgdata_MODULES = _chain.mod _linux.mod fat.mod ufs.mod ext2.mod normal.mod hello.mod \
 	 vga.mod font.mod _multiboot.mod ls.mod boot.mod cmp.mod cat.mod terminal.mod
 
 # For _chain.mod.
@@ -87,6 +87,10 @@ fat_mod_CFLAGS = $(COMMON_CFLAGS)
 # For ext2.mod.
 ext2_mod_SOURCES = fs/ext2.c
 ext2_mod_CFLAGS = $(COMMON_CFLAGS)
+
+# For ufs.mod.
+ufs_mod_SOURCES = fs/ufs.c
+ufs_mod_CFLAGS = $(COMMON_CFLAGS)
 
 # For _linux.mod.
 _linux_mod_SOURCES = loader/i386/pc/linux.c

Index: fs/ufs.c
===================================================================
RCS file: fs/ufs.c

ufs.c new file +690 -0

690 lines not on this page · raw message

Index: include/grub/fs.h
===================================================================
RCS file: /cvsroot/grub/grub2/include/grub/fs.h,v
retrieving revision 1.6

grub/fs.h +3 -1
diff -u -p -u -p -r1.6 fs.h
@@ -1,7 +1,7 @@
 /* fs.h - filesystem manager */
 /*
  *  GRUB  --  GRand Unified Bootloader
- *  Copyright (C) 2002,2003  Free Software Foundation, Inc.
+ *  Copyright (C) 2002,2003,2004  Free Software Foundation, Inc.
  *
  *  GRUB is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -70,6 +70,8 @@ void grub_fat_init (void);
 void grub_fat_fini (void);
 void grub_ext2_init (void);
 void grub_ext2_fini (void);
+void grub_ufs_init (void);
+void grub_ufs_fini (void);
 #endif /* GRUB_UTIL */
 
 #endif /* ! GRUB_FS_HEADER */

Index: util/grub-emu.c
===================================================================
RCS file: /cvsroot/grub/grub2/util/grub-emu.c,v
retrieving revision 1.4

grub-emu.c +3 -1
diff -u -p -u -p -r1.4 grub-emu.c
@@ -1,6 +1,6 @@
 /*
  *  GRUB  --  GRand Unified Bootloader
- *  Copyright (C) 2003  Free Software Foundation, Inc.
+ *  Copyright (C) 2003, 2004  Free Software Foundation, Inc.
  *
  *  GRUB is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -158,6 +158,7 @@ main (int argc, char *argv[])
   /* Initialize the default modules.  */
   grub_fat_init ();
   grub_ext2_init ();
+  grub_ufs_init ();
   grub_ls_init ();
   grub_boot_init ();
   grub_cmp_init ();
@@ -173,6 +174,7 @@ main (int argc, char *argv[])
   grub_util_biosdisk_fini ();
   grub_normal_fini ();
   grub_ext2_fini ();
+  grub_ufs_fini ();
   grub_fat_fini ();
   grub_boot_fini ();
   grub_cmp_fini ();
#4 lore raw
Quoted 2 lines · Marco Gerards

It supports both UFS and UFS2. I will commit it on Sunday, so please review it before Sunday if you want to check it.

Great! Please commit it. :)

Okuji