* status of grub reiser4 support ?
@ 2004-03-15 11:47 Vince
2004-03-15 14:19 ` Vitaly Fertman
0 siblings, 1 reply; 16+ messages in thread
From: Vince @ 2004-03-15 11:47 UTC (permalink / raw)
To: reiserfs-list; +Cc: bug-grub
Hi,
I'd like to know the current status of bootloaders support for
reiser4. The latest patch for grub I could find is this one:
http://www.namesys.com/snapshots/2003.06.06/grub-0.93-reiser4-20030606.diff
I've tried to apply it to the current grub sources from debian/unstable
and made a few modifications to make it compile and link with the
current libaal and libreiser4 but in the end I couldn't make it work...
Is there a more up to date patch for grub available ?
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: status of grub reiser4 support ?
2004-03-15 11:47 status of grub reiser4 support ? Vince
@ 2004-03-15 14:19 ` Vitaly Fertman
2004-03-15 16:52 ` Vince
0 siblings, 1 reply; 16+ messages in thread
From: Vitaly Fertman @ 2004-03-15 14:19 UTC (permalink / raw)
To: Vince, reiserfs-list; +Cc: bug-grub
[-- Attachment #1: Type: text/plain, Size: 639 bytes --]
On Monday 15 March 2004 14:47, Vince wrote:
> Hi,
Hello,
> I'd like to know the current status of bootloaders support for
> reiser4. The latest patch for grub I could find is this one:
> http://www.namesys.com/snapshots/2003.06.06/grub-0.93-reiser4-20030606.diff
>
> I've tried to apply it to the current grub sources from debian/unstable
> and made a few modifications to make it compile and link with the
> current libaal and libreiser4 but in the end I couldn't make it work...
> Is there a more up to date patch for grub available ?
this is the reiser4 support patch for grub-0.94, would you try it?
--
Thanks,
Vitaly Fertman
[-- Attachment #2: grub-0.94-reiser4-20040127.diff --]
[-- Type: text/x-diff, Size: 19495 bytes --]
diff -urN --exclude=Makefile.in --exclude=configure --exclude='*.info' --exclude='*.*~' --exclude='*.m4' ./grub-0.94.orig/config.h.in ./grub-0.94/config.h.in
--- ./grub-0.94.orig/config.h.in 2003-10-19 21:27:16.000000000 +0400
+++ ./grub-0.94/config.h.in 2004-01-27 11:32:07.000000000 +0300
@@ -50,6 +50,12 @@
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
+/* Define to 1 if you have the `aal-alone' library (-laal-alone). */
+#undef HAVE_LIBAAL_ALONE
+
+/* Define to 1 if you have the `reiser4-alone' library (-lreiser4-alone). */
+#undef HAVE_LIBREISER4_ALONE
+
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
diff -urN --exclude=Makefile.in --exclude=configure --exclude='*.info' --exclude='*.*~' --exclude='*.m4' ./grub-0.94.orig/configure.ac ./grub-0.94/configure.ac
--- ./grub-0.94.orig/configure.ac 2003-10-19 21:25:30.000000000 +0400
+++ ./grub-0.94/configure.ac 2004-01-27 14:22:54.000000000 +0300
@@ -241,6 +241,77 @@
FSYS_CFLAGS="$FSYS_CFLAGS -DFSYS_REISERFS=1"
fi
+dnl Checking for reiser4
+REISER4_LIBS=""
+REISER4_CFLAGS=""
+
+OLD_LIBS=$LIBS
+OLD_CFLAGS=$CFLAGS
+LIBS=""
+CFLAGS=""
+
+AC_ARG_ENABLE(reiser4,
+ [ --disable-reiser4 disable Reiser4 support in Stage 2])
+
+enable_reiser4_support=yes
+
+AC_CHECK_LIB(aal-alone, aal_mem_init, ,
+ AC_MSG_WARN(
+Reiser4 support is disabled due to inability find libaal-alone with
+memory manager support turned on.)
+ enable_reiser4_support=no
+)
+
+if test x"$enable_reiser4_support" != xno; then
+ AC_CHECK_HEADER(aal/libaal.h, ,
+ AC_MSG_WARN(
+Libaal header files are not found. Reiser4 support is disabled
+ )
+ enable_reiser4_support=no)
+fi
+
+if test x"$enable_reiser4_support" != xno; then
+ AC_CHECK_LIB(reiser4-alone, reiser4_fs_open, ,
+ AC_MSG_WARN(
+Reiser4 support is disabled due to inability find valid libreiser4-alone.)
+ enable_reiser4_support=no,
+ -laal-alone
+ )
+fi
+
+if test x"$enable_reiser4_support" != xno; then
+ AC_CHECK_HEADER(reiser4/libreiser4.h, ,
+ AC_MSG_WARN(
+Reiser4 header files are not found. Reiser4 support is disabled.
+ )
+ enable_reiser4_support=no)
+fi
+
+if test x"$enable_reiser4_support" != xno; then
+ REISER4_CFLAGS="$REISER4_CFLAGS -DFSYS_REISER4=1"
+ REISER4_LIBS=$LIBS
+fi
+
+if test x"$enable_reiser4_support" != xno; then
+ AC_CHECK_LIB(reiser4-alone, __sym40_plug_init,
+ REISER4_CFLAGS="$REISER4_CFLAGS -DENABLE_SYMLINKS=1",
+AC_MSG_WARN(Reiser4 symlinks support is disabled.),
+ -laal-alone
+ )
+fi
+
+LIBS=$OLD_LIBS
+CFLAGS=$OLD_CFLAGS
+
+if test x"$enable_reiser4" != xno; then
+ (test x"$enable_reiser4_support" != xno) &&
+ FSYS_CFLAGS="$FSYS_CFLAGS $REISER4_CFLAGS"
+fi
+
+AC_SUBST(REISER4_LIBS)
+AC_SUBST(REISER4_CFLAGS)
+AM_CONDITIONAL(ENABLE_REISER4_SUPPORT, test x"$enable_reiser4_support" != xno)
+
AC_ARG_ENABLE(vstafs,
[ --disable-vstafs disable VSTa FS support in Stage 2])
diff -urN --exclude=Makefile.in --exclude=configure --exclude='*.info' --exclude='*.*~' --exclude='*.m4' ./grub-0.94.orig/docs/grub.texi ./grub-0.94/docs/grub.texi
--- ./grub-0.94.orig/docs/grub.texi 2004-01-25 18:39:14.000000000 +0300
+++ ./grub-0.94/docs/grub.texi 2004-01-27 11:29:54.000000000 +0300
@@ -277,7 +277,7 @@
Support multiple filesystem types transparently, plus a useful explicit
blocklist notation. The currently supported filesystem types are
@dfn{BSD FFS}, @dfn{DOS FAT16 and FAT32}, @dfn{Minix fs}, @dfn{Linux
-ext2fs}, @dfn{ReiserFS}, @dfn{JFS}, @dfn{XFS}, and @dfn{VSTa
+ext2fs}, @dfn{ReiserFS}, @dfn{Reiser4}, @dfn{JFS}, @dfn{XFS}, and @dfn{VSTa
fs}. @xref{Filesystem}, for more information.
@item Support automatic decompression
@@ -1528,6 +1528,7 @@
@itemx jfs_stage1_5
@itemx minix_stage1_5
@itemx reiserfs_stage1_5
+@itemx reiser4_stage1_5
@itemx vstafs_stage1_5
@itemx xfs_stage1_5
diff -urN --exclude=Makefile.in --exclude=configure --exclude='*.info' --exclude='*.*~' --exclude='*.m4' ./grub-0.94.orig/grub/Makefile.am ./grub-0.94/grub/Makefile.am
--- ./grub-0.94.orig/grub/Makefile.am 2004-01-18 22:34:24.000000000 +0300
+++ ./grub-0.94/grub/Makefile.am 2004-01-27 16:15:50.314761912 +0300
@@ -14,4 +14,4 @@
AM_CFLAGS = $(GRUB_CFLAGS) -fwritable-strings
grub_SOURCES = main.c asmstub.c
-grub_LDADD = ../stage2/libgrub.a ../lib/libcommon.a $(GRUB_LIBS)
+grub_LDADD = ../stage2/libgrub.a ../lib/libcommon.a $(GRUB_LIBS) $(REISER4_LIBS)
diff -urN --exclude=Makefile.in --exclude=configure --exclude='*.info' --exclude='*.*~' --exclude='*.m4' ./grub-0.94.orig/INSTALL ./grub-0.94/INSTALL
--- ./grub-0.94.orig/INSTALL 2003-10-19 21:15:45.000000000 +0400
+++ ./grub-0.94/INSTALL 2004-01-27 11:25:00.000000000 +0300
@@ -207,6 +207,9 @@
`--disable-reiserfs'
Omit the ReiserFS support in Stage 2.
+`--disable-reiser4'
+ Omit the Reiser4 support in Stage 2.
+
`--disable-vstafs'
Omit the VSTa filesystem support in Stage 2.
diff -urN --exclude=Makefile.in --exclude=configure --exclude='*.info' --exclude='*.*~' --exclude='*.m4' ./grub-0.94.orig/stage2/builtins.c ./grub-0.94/stage2/builtins.c
--- ./grub-0.94.orig/stage2/builtins.c 2004-01-11 12:39:22.000000000 +0300
+++ ./grub-0.94/stage2/builtins.c 2004-01-27 11:27:38.000000000 +0300
@@ -3751,6 +3751,7 @@
{"jfs", "/jfs_stage1_5"},
{"minix", "/minix_stage1_5"},
{"reiserfs", "/reiserfs_stage1_5"},
+ {"reiser4", "/reiser4_stage1_5"},
{"vstafs", "/vstafs_stage1_5"},
{"xfs", "/xfs_stage1_5"}
};
diff -urN --exclude=Makefile.in --exclude=configure --exclude='*.info' --exclude='*.*~' --exclude='*.m4' ./grub-0.94.orig/stage2/disk_io.c ./grub-0.94/stage2/disk_io.c
--- ./grub-0.94.orig/stage2/disk_io.c 2003-10-19 19:58:03.000000000 +0400
+++ ./grub-0.94/stage2/disk_io.c 2004-01-27 12:33:21.000000000 +0300
@@ -63,6 +63,9 @@
# ifdef FSYS_REISERFS
{"reiserfs", reiserfs_mount, reiserfs_read, reiserfs_dir, 0, reiserfs_embed},
# endif
+# ifdef FSYS_REISER4
+ {"reiser4", reiser4_mount, reiser4_read, reiser4_dir, 0, reiser4_embed},
+# endif
# ifdef FSYS_VSTAFS
{"vstafs", vstafs_mount, vstafs_read, vstafs_dir, 0, 0},
# endif
diff -urN --exclude=Makefile.in --exclude=configure --exclude='*.info' --exclude='*.*~' --exclude='*.m4' ./grub-0.94.orig/stage2/filesys.h ./grub-0.94/stage2/filesys.h
--- ./grub-0.94.orig/stage2/filesys.h 2003-07-09 15:45:52.000000000 +0400
+++ ./grub-0.94/stage2/filesys.h 2004-01-27 12:29:44.000000000 +0300
@@ -67,6 +67,16 @@
#define FSYS_REISERFS_NUM 0
#endif
+#ifdef FSYS_REISER4
+#define FSYS_REISER4_NUM 1
+int reiser4_mount (void);
+int reiser4_read (char *buf, int len);
+int reiser4_dir (char *dirname);
+int reiser4_embed (int *start_sector, int needed_sectors);
+#else
+#define FSYS_REISER4_NUM 0
+#endif
+
#ifdef FSYS_VSTAFS
#define FSYS_VSTAFS_NUM 1
int vstafs_mount (void);
@@ -108,8 +118,8 @@
#ifndef NUM_FSYS
#define NUM_FSYS \
(FSYS_FFS_NUM + FSYS_FAT_NUM + FSYS_EXT2FS_NUM + FSYS_MINIX_NUM \
- + FSYS_REISERFS_NUM + FSYS_VSTAFS_NUM + FSYS_JFS_NUM + FSYS_XFS_NUM \
- + FSYS_TFTP_NUM)
+ + FSYS_REISERFS_NUM + FSYS_REISER4_NUM + FSYS_VSTAFS_NUM + FSYS_JFS_NUM \
+ + FSYS_XFS_NUM + FSYS_TFTP_NUM)
#endif
/* defines for the block filesystem info area */
diff -urN --exclude=Makefile.in --exclude=configure --exclude='*.info' --exclude='*.*~' --exclude='*.m4' ./grub-0.94.orig/stage2/fsys_reiser4.c ./grub-0.94/stage2/fsys_reiser4.c
--- ./grub-0.94.orig/stage2/fsys_reiser4.c 1970-01-01 03:00:00.000000000 +0300
+++ ./grub-0.94/stage2/fsys_reiser4.c 2004-01-27 12:36:33.000000000 +0300
@@ -0,0 +1,243 @@
+/*
+ * fsys_reiser4.c -- reiser4 filesystem support.
+ * Copyright (C) 2001, 2002, 2003 Hans Reiser.
+ *
+ * GRUB -- GRand Unified Bootloader
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#ifdef FSYS_REISER4
+#include "shared.h"
+#include "filesys.h"
+
+#define ENABLE_STAND_ALONE
+#include <reiser4/libreiser4.h>
+
+static reiser4_fs_t *fs = NULL;
+static aal_device_t *dev = NULL;
+static reiser4_object_t *object = NULL;
+
+/* Read callback of grub specific device. It uses devread() for reading passed
+ @count of device blocks starting from @blk to passed @buff. */
+static errno_t grub_dev_read(aal_device_t *device,
+ void *buff, blk_t blk,
+ count_t count)
+{
+ unsigned int size;
+ unsigned int factor;
+ unsigned int sector;
+
+ /* Calculating actual sector and size in bytes to be read from
+ device. */
+ factor = device->blksize / SECTOR_SIZE;
+ sector = (unsigned int)blk << aal_log2(factor);
+ size = (unsigned int)count * (SECTOR_SIZE * factor);
+
+ /* Reading from the current device */
+ if (!devread(sector, 0, size, buff))
+ return -EIO;
+
+ return 0;
+}
+
+/* Length callback of grub device */
+static count_t grub_dev_len(aal_device_t *device) {
+ unsigned int factor;
+
+ /* Getting partition length in device blocks */
+ factor = device->blksize / SECTOR_SIZE;
+ return (part_length >> aal_log2(factor));
+}
+
+/*
+ Initializing grub device abstraction instance. It will use devread and friends
+ for providing needed functionality.
+*/
+struct aal_device_ops grub_dev_ops = {
+ .read = grub_dev_read,
+ .len = grub_dev_len
+};
+
+/* Initializes reiser4 */
+static int reiser4_init(void) {
+ extern aal_hash_table_t *plugins;
+
+ plugins = NULL;
+
+ /* Initializing memory manager */
+ aal_mem_init((void *)FSYS_BUF, FSYS_BUFLEN);
+
+ /* Initializing device abstraction on current device GRUB uses. */
+ if (!(dev = aal_device_open(&grub_dev_ops, NULL,
+ SECTOR_SIZE, 0)))
+ {
+ return 0;
+ }
+
+ /* Initializing libreiser4 (plugins, etc) */
+ return !libreiser4_init();
+}
+
+#define MEMORY_WATERMARK 8192
+
+/* Memory pressure detect function. */
+static int mpressure_detect(reiser4_tree_t *tree) {
+ return (aal_mem_free() <= MEMORY_WATERMARK);
+}
+
+/* Reiser4 mount() routine */
+int reiser4_mount(void) {
+
+ /* Initialize all reiser4 related stuff first */
+ if (!reiser4_init())
+ return 0;
+
+ /* Open filesystem on @dev. */
+ if (!(fs = reiser4_fs_open(dev, 0)))
+ return 0;
+
+ fs->tree->mpc_func = mpressure_detect;
+
+ object = NULL;
+ return 1;
+}
+
+/* Reiser4 read() handler */
+int reiser4_read(char *buf, int len) {
+ int64_t read;
+
+ if (object == NULL)
+ return 0;
+
+ /* Seet at current position denoted by @filepos */
+ reiser4_object_seek(object, filepos);
+
+ /* Reading current file data starting from @filepos */
+ disk_read_func = disk_read_hook;
+ read = reiser4_object_read(object, buf, len);
+ disk_read_func = NULL;
+
+ if (read < 0) {
+ errnum = ERR_FSYS_CORRUPT;
+ return 0;
+ }
+
+ filepos += read;
+ return read;
+}
+
+/* Reiser4 file open() routine */
+int reiser4_dir(char *dirname) {
+ char *ch;
+
+ if (fs == NULL)
+ return 0;
+
+ if (object != NULL) {
+ reiser4_object_close(object);
+ object = NULL;
+ }
+
+ /* Cutting out string after first space character */
+ if ((ch = aal_strchr(dirname, ' ')))
+ *ch = '\0';
+
+ /* This function is also called for getting directory list for
+ maintaining the bash-like completion. */
+#ifndef STAGE1_5
+ if (print_possibilities) {
+ char entry[256];
+ entry_hint_t entry_hint;
+
+ /* Getting last part of name (jsut after last '/') */
+ if (*(dirname + aal_strlen(dirname) - 1) != '/') {
+
+ if (!(ch = aal_strrchr(dirname, '/'))) {
+ errnum = ERR_BAD_FILETYPE;
+ return 0;
+ }
+
+ aal_strncpy(entry, ch + 1, sizeof(entry));
+ *(ch + 1) = '\0';
+ }
+
+ /* Open obejct by @dirname */
+ if (!(object = reiser4_object_open(fs->tree, dirname, 1))) {
+ errnum = ERR_FILE_NOT_FOUND;
+ return 0;
+ }
+
+ /* Checking if it is a directory object */
+ if (object->entity->plug->id.group != DIR_OBJECT) {
+
+ /* If not, cutting out last '/' character */
+ if ((ch = aal_strrchr(dirname, '/')))
+ *ch = '\0';
+
+ /* Close current object */
+ reiser4_object_close(object);
+
+ /* Getting out */
+ return 0;
+ }
+
+ /* Reading opened directory in order to build completion
+ list. */
+ while (reiser4_object_readdir(object, &entry_hint) == 0) {
+ if (substring(entry, entry_hint.name) <= 0) {
+
+ if (print_possibilities > 0)
+ print_possibilities = -print_possibilities;
+
+ print_a_completion(entry_hint.name);
+ }
+ }
+ } else {
+#endif
+ /* This is the case when resier4_dir() is called for open the
+ file @dirname, not for building completion list. */
+ if (!(object = reiser4_object_open(fs->tree, dirname, 1))) {
+ errnum = ERR_FILE_NOT_FOUND;
+ return 0;
+ }
+
+ if (object->entity->plug->id.group != REG_OBJECT) {
+ errnum = ERR_BAD_FILETYPE;
+ return 0;
+ }
+
+ /* Initializing GRUB global variables @filepos and @filemax. */
+ filepos = 0;
+ filemax = reiser4_object_size(object);
+
+ return 1;
+#ifndef STAGE1_5
+ }
+
+ return 1;
+#endif
+
+ errnum = ERR_FILE_NOT_FOUND;
+ return 0;
+}
+
+/* Returns how many sectors may be used for embeding reiser4_stage1_5 in teh
+ case of installing GRUB to partition instead of MBR. */
+int reiser4_embed (int *start_sector, int needed_sectors) {
+ *start_sector = 1;
+ return needed_sectors <= ((REISER4_MASTER_OFFSET >> SECTOR_BITS) - 1);
+}
+#endif /* FSYS_REISER4 */
diff -urN --exclude=Makefile.in --exclude=configure --exclude='*.info' --exclude='*.*~' --exclude='*.m4' ./grub-0.94.orig/stage2/Makefile.am ./grub-0.94/stage2/Makefile.am
--- ./grub-0.94.orig/stage2/Makefile.am 2003-10-19 20:45:18.000000000 +0400
+++ ./grub-0.94/stage2/Makefile.am 2004-01-27 16:10:53.033955464 +0300
@@ -13,16 +13,24 @@
# For <stage1.h>.
INCLUDES = -I$(top_srcdir)/stage1
+if ENABLE_REISER4_SUPPORT
+REISER4_STAGE1_5 = reiser4_stage1_5
+REISER4_STAGE1_5_EXEC = reiser4_stage1_5.exec
+else
+REISER4_STAGE1_5 =
+REISER4_STAGE1_5_EXEC =
+endif
+
# The library for /sbin/grub.
noinst_LIBRARIES = libgrub.a
libgrub_a_SOURCES = boot.c builtins.c char_io.c cmdline.c common.c \
disk_io.c fsys_ext2fs.c fsys_fat.c fsys_ffs.c fsys_jfs.c \
- fsys_minix.c fsys_reiserfs.c fsys_vstafs.c fsys_xfs.c gunzip.c \
- md5.c serial.c stage2.c terminfo.c tparm.c
+ fsys_minix.c fsys_reiserfs.c fsys_reiser4.c fsys_vstafs.c \
+ fsys_xfs.c gunzip.c md5.c serial.c stage2.c terminfo.c tparm.c
libgrub_a_CFLAGS = $(GRUB_CFLAGS) -I$(top_srcdir)/lib \
-DGRUB_UTIL=1 -DFSYS_EXT2FS=1 -DFSYS_FAT=1 -DFSYS_FFS=1 \
- -DFSYS_JFS=1 -DFSYS_MINIX=1 -DFSYS_REISERFS=1 -DFSYS_VSTAFS=1 \
- -DFSYS_XFS=1 -DUSE_MD5_PASSWORDS=1 \
+ -DFSYS_JFS=1 -DFSYS_MINIX=1 -DFSYS_REISERFS=1 $(REISER4_CFLAGS) \
+ -DFSYS_VSTAFS=1 -DFSYS_XFS=1 -DUSE_MD5_PASSWORDS=1 \
-DSUPPORT_SERIAL=1 -DSUPPORT_HERCULES=1 -fwritable-strings
# Stage 2 and Stage 1.5's.
@@ -32,22 +40,22 @@
if DISKLESS_SUPPORT
pkgdata_DATA = stage2 e2fs_stage1_5 fat_stage1_5 ffs_stage1_5 \
- jfs_stage1_5 minix_stage1_5 reiserfs_stage1_5 vstafs_stage1_5 \
- xfs_stage1_5 nbgrub pxegrub
+ jfs_stage1_5 minix_stage1_5 reiserfs_stage1_5 $(REISER4_STAGE1_5) \
+ vstafs_stage1_5 xfs_stage1_5 nbgrub pxegrub
noinst_DATA = pre_stage2 start nbloader pxeloader diskless
noinst_PROGRAMS = pre_stage2.exec start.exec e2fs_stage1_5.exec \
fat_stage1_5.exec ffs_stage1_5.exec jfs_stage1_5.exec \
- minix_stage1_5.exec reiserfs_stage1_5.exec \
+ minix_stage1_5.exec reiserfs_stage1_5.exec $(REISER4_STAGE1_5_EXEC) \
vstafs_stage1_5.exec xfs_stage1_5.exec nbloader.exec \
pxeloader.exec diskless.exec
else
pkgdata_DATA = stage2 e2fs_stage1_5 fat_stage1_5 ffs_stage1_5 \
- jfs_stage1_5 minix_stage1_5 reiserfs_stage1_5 vstafs_stage1_5 \
- xfs_stage1_5
+ jfs_stage1_5 minix_stage1_5 reiserfs_stage1_5 $(REISER4_STAGE1_5) \
+ vstafs_stage1_5 xfs_stage1_5
noinst_DATA = pre_stage2 start
noinst_PROGRAMS = pre_stage2.exec start.exec e2fs_stage1_5.exec \
fat_stage1_5.exec ffs_stage1_5.exec jfs_stage1_5.exec \
- minix_stage1_5.exec reiserfs_stage1_5.exec \
+ minix_stage1_5.exec reiserfs_stage1_5.exec $(REISER4_STAGE1_5_EXEC) \
vstafs_stage1_5.exec xfs_stage1_5.exec
endif
MOSTLYCLEANFILES = $(noinst_PROGRAMS)
@@ -75,7 +83,7 @@
HERCULES_FLAGS =
endif
-STAGE2_COMPILE = $(STAGE2_CFLAGS) -fno-builtin -nostdinc \
+STAGE2_COMPILE = $(STAGE2_CFLAGS) -fno-builtin \
$(NETBOOT_FLAGS) $(SERIAL_FLAGS) $(HERCULES_FLAGS)
STAGE1_5_LINK = -nostdlib -Wl,-N -Wl,-Ttext -Wl,2000
@@ -85,14 +93,16 @@
pre_stage2_exec_SOURCES = asm.S bios.c boot.c builtins.c char_io.c \
cmdline.c common.c console.c disk_io.c fsys_ext2fs.c \
fsys_fat.c fsys_ffs.c fsys_jfs.c fsys_minix.c fsys_reiserfs.c \
- fsys_vstafs.c fsys_xfs.c gunzip.c hercules.c md5.c serial.c \
- smp-imps.c stage2.c terminfo.c tparm.c
+ fsys_reiser4.c fsys_vstafs.c fsys_xfs.c gunzip.c hercules.c \
+ md5.c serial.c smp-imps.c stage2.c terminfo.c tparm.c
pre_stage2_exec_CFLAGS = $(STAGE2_COMPILE) $(FSYS_CFLAGS)
pre_stage2_exec_CCASFLAGS = $(STAGE2_COMPILE) $(FSYS_CFLAGS)
pre_stage2_exec_LDFLAGS = $(PRE_STAGE2_LINK)
if NETBOOT_SUPPORT
-pre_stage2_exec_LDADD = ../netboot/libdrivers.a
+pre_stage2_exec_LDADD = ../netboot/libdrivers.a $(REISER4_LIBS)
+else
+pre_stage2_exec_LDADD = $(REISER4_LIBS)
endif
if DISKLESS_SUPPORT
@@ -167,6 +177,16 @@
-DNO_BLOCK_FILES=1
reiserfs_stage1_5_exec_LDFLAGS = $(STAGE1_5_LINK)
+# For reiser4_stage1_5 target.
+reiser4_stage1_5_exec_SOURCES = start.S asm.S common.c char_io.c \
+ disk_io.c stage1_5.c fsys_reiser4.c bios.c
+reiser4_stage1_5_exec_CFLAGS = $(STAGE1_5_COMPILE) $(REISER4_CFLAGS) \
+ -DNO_BLOCK_FILES=1
+reiser4_stage1_5_exec_CCASFLAGS = $(STAGE1_5_COMPILE) $(REISER4_CFLAGS) \
+ -DNO_BLOCK_FILES=1
+reiser4_stage1_5_exec_LDFLAGS = $(STAGE1_5_LINK)
+reiser4_stage1_5_exec_LDADD = $(REISER4_LIBS)
+
# For vstafs_stage1_5 target.
vstafs_stage1_5_exec_SOURCES = start.S asm.S common.c char_io.c \
disk_io.c stage1_5.c fsys_vstafs.c bios.c
diff -urN --exclude=Makefile.in --exclude=configure --exclude='*.info' --exclude='*.*~' --exclude='*.m4' ./grub-0.94.orig/stage2/shared.h ./grub-0.94/stage2/shared.h
--- ./grub-0.94.orig/stage2/shared.h 2004-01-11 12:39:22.000000000 +0300
+++ ./grub-0.94/stage2/shared.h 2004-01-27 11:41:39.000000000 +0300
@@ -202,9 +202,10 @@
#define STAGE2_ID_FAT_STAGE1_5 3
#define STAGE2_ID_MINIX_STAGE1_5 4
#define STAGE2_ID_REISERFS_STAGE1_5 5
-#define STAGE2_ID_VSTAFS_STAGE1_5 6
-#define STAGE2_ID_JFS_STAGE1_5 7
-#define STAGE2_ID_XFS_STAGE1_5 8
+#define STAGE2_ID_REISER4_STAGE1_5 6
+#define STAGE2_ID_VSTAFS_STAGE1_5 7
+#define STAGE2_ID_JFS_STAGE1_5 8
+#define STAGE2_ID_XFS_STAGE1_5 9
#ifndef STAGE1_5
# define STAGE2_ID STAGE2_ID_STAGE2
@@ -219,6 +220,8 @@
# define STAGE2_ID STAGE2_ID_MINIX_STAGE1_5
# elif defined(FSYS_REISERFS)
# define STAGE2_ID STAGE2_ID_REISERFS_STAGE1_5
+# elif defined(FSYS_REISER4)
+# define STAGE2_ID STAGE2_ID_REISER4_STAGE1_5
# elif defined(FSYS_VSTAFS)
# define STAGE2_ID STAGE2_ID_VSTAFS_STAGE1_5
# elif defined(FSYS_JFS)
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: status of grub reiser4 support ?
2004-03-15 14:19 ` Vitaly Fertman
@ 2004-03-15 16:52 ` Vince
2004-03-15 20:20 ` Vince
0 siblings, 1 reply; 16+ messages in thread
From: Vince @ 2004-03-15 16:52 UTC (permalink / raw)
To: Vitaly Fertman; +Cc: Reiserfs mail-list, bug-grub
Building succeded, this is what I have:
diablo:/boot/grub# ll *stage*
-rw-r--r-- 1 root root 7616 Mar 15 17:27 e2fs_stage1_5
-rw-r--r-- 1 root root 7376 Mar 15 17:27 fat_stage1_5
-rw-r--r-- 1 root root 6688 Mar 15 17:27 ffs_stage1_5
-rw-r--r-- 1 root root 8224 Mar 15 17:27 jfs_stage1_5
-rw-r--r-- 1 root root 6880 Mar 15 17:27 minix_stage1_5
-rw-r--r-- 1 root root 54088 Mar 15 17:27 reiser4_stage1_5
-rw-r--r-- 1 root root 9088 Mar 15 17:27 reiserfs_stage1_5
-rw-r--r-- 1 root root 512 Mar 15 17:27 stage1
-rw-r--r-- 1 root root 103752 Mar 15 17:27 stage2
-rw-r--r-- 1 root root 6336 Mar 15 17:27 vstafs_stage1_5
-rw-r--r-- 1 root root 9160 Mar 15 17:27 xfs_stage1_5
Unfortunately, grub under linux will encounter a segmentation as soon as
I try to read a file on a reiser4 partition:
grub> cat (hd1,<TAB>
Possible partitions are:
Partition num: 0, Filesystem type is reiser4, partition type 0xc
Partition num: 1, Filesystem type is reiserfs, partition type 0x83
Partition num: 2, Filesystem type is reiser4, partition type 0x83
grub> cat (hd1,2)/<TAB>zsh: segmentation fault grub
Booting directly grub from the bios, reiser4 partitions are marked as
unknown (but I bet this is probably a stage 1/1.5/2 problem from my part)...
Vince
Vitaly Fertman wrote:
> On Monday 15 March 2004 14:47, Vince wrote:
>
>> I'd like to know the current status of bootloaders support for
>>reiser4. The latest patch for grub I could find is this one:
>>http://www.namesys.com/snapshots/2003.06.06/grub-0.93-reiser4-20030606.diff
>> [...]
>>Is there a more up to date patch for grub available ?
>
>
> this is the reiser4 support patch for grub-0.94, would you try it?
>
>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: status of grub reiser4 support ?
2004-03-15 16:52 ` Vince
@ 2004-03-15 20:20 ` Vince
2004-03-15 20:39 ` Vince
0 siblings, 1 reply; 16+ messages in thread
From: Vince @ 2004-03-15 20:20 UTC (permalink / raw)
To: Vitaly Fertman; +Cc: Reiserfs mail-list
Hi,
I compiled grub with debugging symbols enabled and this is what I got:
grub> cat (hd1,2)/
Program received signal SIGSEGV, Segmentation fault.
0x0806204a in reiser4_item_units ()
I'll probably also recompile libreiser4 with debugging symbols in order
to further track this problem...
Vince wrote:
> Building succeded, this is what I have:
>
> diablo:/boot/grub# ll *stage*
> -rw-r--r-- 1 root root 7616 Mar 15 17:27 e2fs_stage1_5
> -rw-r--r-- 1 root root 7376 Mar 15 17:27 fat_stage1_5
> -rw-r--r-- 1 root root 6688 Mar 15 17:27 ffs_stage1_5
> -rw-r--r-- 1 root root 8224 Mar 15 17:27 jfs_stage1_5
> -rw-r--r-- 1 root root 6880 Mar 15 17:27 minix_stage1_5
> -rw-r--r-- 1 root root 54088 Mar 15 17:27 reiser4_stage1_5
> -rw-r--r-- 1 root root 9088 Mar 15 17:27 reiserfs_stage1_5
> -rw-r--r-- 1 root root 512 Mar 15 17:27 stage1
> -rw-r--r-- 1 root root 103752 Mar 15 17:27 stage2
> -rw-r--r-- 1 root root 6336 Mar 15 17:27 vstafs_stage1_5
> -rw-r--r-- 1 root root 9160 Mar 15 17:27 xfs_stage1_5
>
> Unfortunately, grub under linux will encounter a segmentation as soon as
> I try to read a file on a reiser4 partition:
> grub> cat (hd1,<TAB>
> Possible partitions are:
> Partition num: 0, Filesystem type is reiser4, partition type 0xc
> Partition num: 1, Filesystem type is reiserfs, partition type 0x83
> Partition num: 2, Filesystem type is reiser4, partition type 0x83
>
>
> grub> cat (hd1,2)/<TAB>zsh: segmentation fault grub
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: status of grub reiser4 support ?
2004-03-15 20:20 ` Vince
@ 2004-03-15 20:39 ` Vince
2004-03-15 20:43 ` Vince
0 siblings, 1 reply; 16+ messages in thread
From: Vince @ 2004-03-15 20:39 UTC (permalink / raw)
To: Vitaly Fertman; +Cc: Reiserfs mail-list
Debugging symbols in libreiser4 (0.5.1) gave me:
Program received signal SIGSEGV, Segmentation fault.
0x0806204a in reiser4_item_units (place=0x400801ac) at item.c:14
14 if (place->plug->o.item_ops->balance->units) {
Here follows a backtrace, more information is available on request...
(gdb) bt
#0 0x0806204a in reiser4_item_units (place=0x400801ac) at item.c:14
#1 0x0805fed6 in tree_find_child_pos (tree=0x4007d7e8,
parent=0x4007f0c0, child=0x400801a0, place=0x400801ac) at tree.c:275
#2 0x0805ff1e in reiser4_tree_rebind_node (tree=0x4007d7e8,
parent=0x4007f0c0, child=0x400801a0) at tree.c:290
#3 0x0806001b in reiser4_tree_connect_node (tree=0x4007d7e8,
parent=0x4007f0c0, node=0x400801a0) at tree.c:415
#4 0x080602b3 in reiser4_tree_load_node (tree=0x4007d7e8,
parent=0x4007f0c0, blk=6236949) at tree.c:579
#5 0x080603b5 in reiser4_tree_child_node (tree=0x4007d7e8,
place=0x4007ca58) at tree.c:638
#6 0x0806109c in reiser4_tree_lookup (tree=0x4007d7e8, hint=0x4007c8c0,
bias=FIND_EXACT, place=0x4007ca58) at tree.c:1905
#7 0x0806223a in callback_find_statdata (track=0x0, entry=0x0,
data=0x4007ca50) at semantic.c:43
#8 0x08062c7e in aux_parse_path (path=0x4008fdc7 "/",
pre_func=0x80621e4 <callback_find_statdata>,
post_func=0x806245d <callback_find_entry>, data=0x4007ca50) at aux.c:92
#9 0x08062696 in reiser4_semantic_resolve (tree=0x4007d7e8,
path=0x4008fdc7 "/", from=0x4007d7f4, follow=1) at semantic.c:207
#10 0x08061707 in reiser4_object_resolve (object=0x4007e070,
tree=0x4007d7e8, path=0x4008fdc7 "/", follow=1) at object.c:105
#11 0x080617a1 in reiser4_object_open (tree=0x4007d7e8, path=0x4008fdc7
"/", follow=1) at object.c:136
#12 0x0805226b in reiser4_dir (dirname=0x4008fdc7 "/") at fsys_reiser4.c:178
#13 0x0804e04d in dir (dirname=0x400801ac "") at disk_io.c:1730
#14 0x0804d8c8 in print_completions (is_filename=1, is_completion=1) at
disk_io.c:1436
#15 0x0804b3f6 in real_get_cmdline (prompt=0x8072b40 "grub> ",
cmdline=0x4002bc60 "", maxlen=1600, echo_char=0, readline=1)
at char_io.c:638
#16 0x0804b778 in get_cmdline (prompt=0x8072b40 "grub> ",
cmdline=0x4002bc60 "", maxlen=0, echo_char=0, readline=0)
at char_io.c:872
#17 0x0805c45c in enter_cmdline (heap=0x4002bc60 "", forever=1) at
cmdline.c:143
#18 0x08056372 in cmain () at stage2.c:1018
#19 0x0804c052 in init_bios_info () at common.c:323
#20 0x08049808 in doit.0 () at asmstub.c:129
#21 0x08049900 in grub_stage2 () at asmstub.c:186
#22 0x080495e8 in main (argc=1, argv=0xbffff9d4) at main.c:264
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: status of grub reiser4 support ?
2004-03-15 20:39 ` Vince
@ 2004-03-15 20:43 ` Vince
2004-03-15 21:07 ` Hans Reiser
2004-03-16 9:40 ` Vitaly Fertman
0 siblings, 2 replies; 16+ messages in thread
From: Vince @ 2004-03-15 20:43 UTC (permalink / raw)
To: Vitaly Fertman; +Cc: Reiserfs mail-list
BTW, I've checked and the problem here is:
(gdb) print place->plug
$1 = (reiser4_plug_t *) 0x0
Vince wrote:
> Debugging symbols in libreiser4 (0.5.1) gave me:
>
> Program received signal SIGSEGV, Segmentation fault.
> 0x0806204a in reiser4_item_units (place=0x400801ac) at item.c:14
> 14 if (place->plug->o.item_ops->balance->units) {
>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: status of grub reiser4 support ?
2004-03-15 20:43 ` Vince
@ 2004-03-15 21:07 ` Hans Reiser
2004-03-16 9:40 ` Vitaly Fertman
1 sibling, 0 replies; 16+ messages in thread
From: Hans Reiser @ 2004-03-15 21:07 UTC (permalink / raw)
To: Vince; +Cc: Vitaly Fertman, Reiserfs mail-list
Vince wrote:
> BTW, I've checked and the problem here is:
>
> (gdb) print place->plug
> $1 = (reiser4_plug_t *) 0x0
>
>
> Vince wrote:
>
>> Debugging symbols in libreiser4 (0.5.1) gave me:
>>
>> Program received signal SIGSEGV, Segmentation fault.
>> 0x0806204a in reiser4_item_units (place=0x400801ac) at item.c:14
>> 14 if (place->plug->o.item_ops->balance->units) {
>>
>
>
Thanks for helping Vitaly on this.
--
Hans
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: status of grub reiser4 support ?
2004-03-15 20:43 ` Vince
2004-03-15 21:07 ` Hans Reiser
@ 2004-03-16 9:40 ` Vitaly Fertman
2004-03-16 10:57 ` Vince
1 sibling, 1 reply; 16+ messages in thread
From: Vitaly Fertman @ 2004-03-16 9:40 UTC (permalink / raw)
To: Vince; +Cc: Reiserfs mail-list
[-- Attachment #1: Type: text/plain, Size: 679 bytes --]
On Monday 15 March 2004 23:43, Vince wrote:
> BTW, I've checked and the problem here is:
>
> (gdb) print place->plug
> $1 = (reiser4_plug_t *) 0x0
>
> Vince wrote:
> > Debugging symbols in libreiser4 (0.5.1) gave me:
> >
> > Program received signal SIGSEGV, Segmentation fault.
> > 0x0806204a in reiser4_item_units (place=0x400801ac) at item.c:14
> > 14 if (place->plug->o.item_ops->balance->units) {
yes, thank you, I have found a few other bugs also, so attached are
the fixed grub patch and fixes for the reiser4progs. You probably
do not have fibration plugins yet, so just through away the last diff
in the reiser4progs patch.
--
Thanks,
Vitaly Fertman
[-- Attachment #2: reiser4_alone.patch --]
[-- Type: text/x-diff, Size: 2581 bytes --]
diff -Nru a/libreiser4/tree.c b/libreiser4/tree.c
--- a/libreiser4/tree.c Tue Mar 16 12:33:26 2004
+++ b/libreiser4/tree.c Tue Mar 16 12:33:26 2004
@@ -271,6 +271,9 @@
return -EINVAL;
out_correct_place:
+#else
+ if (reiser4_place_fetch(place))
+ return -EINVAL;
#endif
if (reiser4_item_units(place) == 1)
place->pos.unit = MAX_UINT32;
diff -Nru a/plugin/key/key_large/key_large.c b/plugin/key/key_large/key_large.c
--- a/plugin/key/key_large/key_large.c Tue Mar 16 12:33:26 2004
+++ b/plugin/key/key_large/key_large.c Tue Mar 16 12:33:26 2004
@@ -186,7 +186,6 @@
aal_memset(key->body, 0, sizeof(key->body));
}
-#ifndef ENABLE_STAND_ALONE
/* Figures out if items are of one file or not. */
static int key_large_compshort(reiser4_key_t *key1,
reiser4_key_t *key2)
@@ -219,7 +218,6 @@
return kl_comp_el((key_large_t *)key1->body,
(key_large_t *)key2->body, 2);
}
-#endif
static int key_large_compraw(void *key1, void *key2) {
int res;
@@ -386,11 +384,8 @@
.bodysize = key_lage_bodysize,
.compraw = key_large_compraw,
.compfull = key_large_compfull,
-
-#ifndef ENABLE_STAND_ALONE
.compshort = key_large_compshort,
-#endif
-
+
.build_hashed = key_large_build_hashed,
.build_generic = key_large_build_generic,
diff -Nru a/plugin/key/key_short/key_short.c b/plugin/key/key_short/key_short.c
--- a/plugin/key/key_short/key_short.c Tue Mar 16 12:33:26 2004
+++ b/plugin/key/key_short/key_short.c Tue Mar 16 12:33:26 2004
@@ -179,7 +179,6 @@
aal_memset(key->body, 0, sizeof(key->body));
}
-#ifndef ENABLE_STAND_ALONE
/* Compares two first components of the pased keys (locality and objectid) */
static int key_short_compshort(reiser4_key_t *key1,
reiser4_key_t *key2)
@@ -206,7 +205,6 @@
/* Checking object id */
return aal_memcmp(&oid1, &oid2, sizeof(oid1));
}
-#endif
/* Compares two passed key bodies. */
static int key_short_compraw(void *key1, void *key2) {
@@ -368,10 +366,7 @@
.bodysize = key_short_bodysize,
.compfull = key_short_compfull,
.compraw = key_short_compraw,
-
-#ifndef ENABLE_STAND_ALONE
.compshort = key_short_compshort,
-#endif
.build_hashed = key_short_build_hashed,
.build_generic = key_short_build_generic,
diff -Nru a/plugin/object/obj40/obj40.c b/plugin/object/obj40/obj40.c
--- a/plugin/object/obj40/obj40.c Tue Mar 16 12:33:26 2004
+++ b/plugin/object/obj40/obj40.c Tue Mar 16 12:33:26 2004
@@ -598,6 +598,9 @@
#else
if (type == HASH_PLUG_TYPE)
pid = HASH_R5_ID;
+
+ if (type == FIBRE_PLUG_TYPE)
+ pid = FIBRE_DOT_O_ID;
#endif
}
[-- Attachment #3: grub-0.94-reiser4-20040127.diff --]
[-- Type: text/x-diff, Size: 19547 bytes --]
diff -urN --exclude=Makefile.in --exclude=configure --exclude='*.info' --exclude='*.*~' --exclude='*.m4' ./grub-0.94.orig/config.h.in ./grub-0.94/config.h.in
--- ./grub-0.94.orig/config.h.in 2003-10-19 21:27:16.000000000 +0400
+++ ./grub-0.94/config.h.in 2004-01-27 11:32:07.000000000 +0300
@@ -50,6 +50,12 @@
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
+/* Define to 1 if you have the `aal-alone' library (-laal-alone). */
+#undef HAVE_LIBAAL_ALONE
+
+/* Define to 1 if you have the `reiser4-alone' library (-lreiser4-alone). */
+#undef HAVE_LIBREISER4_ALONE
+
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
diff -urN --exclude=Makefile.in --exclude=configure --exclude='*.info' --exclude='*.*~' --exclude='*.m4' ./grub-0.94.orig/configure.ac ./grub-0.94/configure.ac
--- ./grub-0.94.orig/configure.ac 2003-10-19 21:25:30.000000000 +0400
+++ ./grub-0.94/configure.ac 2004-01-27 14:22:54.000000000 +0300
@@ -241,6 +241,77 @@
FSYS_CFLAGS="$FSYS_CFLAGS -DFSYS_REISERFS=1"
fi
+dnl Checking for reiser4
+REISER4_LIBS=""
+REISER4_CFLAGS=""
+
+OLD_LIBS=$LIBS
+OLD_CFLAGS=$CFLAGS
+LIBS=""
+CFLAGS=""
+
+AC_ARG_ENABLE(reiser4,
+ [ --disable-reiser4 disable Reiser4 support in Stage 2])
+
+enable_reiser4_support=yes
+
+AC_CHECK_LIB(aal-alone, aal_mem_init, ,
+ AC_MSG_WARN(
+Reiser4 support is disabled due to inability find libaal-alone with
+memory manager support turned on.)
+ enable_reiser4_support=no
+)
+
+if test x"$enable_reiser4_support" != xno; then
+ AC_CHECK_HEADER(aal/libaal.h, ,
+ AC_MSG_WARN(
+Libaal header files are not found. Reiser4 support is disabled
+ )
+ enable_reiser4_support=no)
+fi
+
+if test x"$enable_reiser4_support" != xno; then
+ AC_CHECK_LIB(reiser4-alone, reiser4_fs_open, ,
+ AC_MSG_WARN(
+Reiser4 support is disabled due to inability find valid libreiser4-alone.)
+ enable_reiser4_support=no,
+ -laal-alone
+ )
+fi
+
+if test x"$enable_reiser4_support" != xno; then
+ AC_CHECK_HEADER(reiser4/libreiser4.h, ,
+ AC_MSG_WARN(
+Reiser4 header files are not found. Reiser4 support is disabled.
+ )
+ enable_reiser4_support=no)
+fi
+
+if test x"$enable_reiser4_support" != xno; then
+ REISER4_CFLAGS="$REISER4_CFLAGS -DFSYS_REISER4=1"
+ REISER4_LIBS=$LIBS
+fi
+
+if test x"$enable_reiser4_support" != xno; then
+ AC_CHECK_LIB(reiser4-alone, __sym40_plug_init,
+ REISER4_CFLAGS="$REISER4_CFLAGS -DENABLE_SYMLINKS=1",
+AC_MSG_WARN(Reiser4 symlinks support is disabled.),
+ -laal-alone
+ )
+fi
+
+LIBS=$OLD_LIBS
+CFLAGS=$OLD_CFLAGS
+
+if test x"$enable_reiser4" != xno; then
+ (test x"$enable_reiser4_support" != xno) &&
+ FSYS_CFLAGS="$FSYS_CFLAGS $REISER4_CFLAGS"
+fi
+
+AC_SUBST(REISER4_LIBS)
+AC_SUBST(REISER4_CFLAGS)
+AM_CONDITIONAL(ENABLE_REISER4_SUPPORT, test x"$enable_reiser4_support" != xno)
+
AC_ARG_ENABLE(vstafs,
[ --disable-vstafs disable VSTa FS support in Stage 2])
diff -urN --exclude=Makefile.in --exclude=configure --exclude='*.info' --exclude='*.*~' --exclude='*.m4' ./grub-0.94.orig/docs/grub.texi ./grub-0.94/docs/grub.texi
--- ./grub-0.94.orig/docs/grub.texi 2004-01-25 18:39:14.000000000 +0300
+++ ./grub-0.94/docs/grub.texi 2004-01-27 11:29:54.000000000 +0300
@@ -277,7 +277,7 @@
Support multiple filesystem types transparently, plus a useful explicit
blocklist notation. The currently supported filesystem types are
@dfn{BSD FFS}, @dfn{DOS FAT16 and FAT32}, @dfn{Minix fs}, @dfn{Linux
-ext2fs}, @dfn{ReiserFS}, @dfn{JFS}, @dfn{XFS}, and @dfn{VSTa
+ext2fs}, @dfn{ReiserFS}, @dfn{Reiser4}, @dfn{JFS}, @dfn{XFS}, and @dfn{VSTa
fs}. @xref{Filesystem}, for more information.
@item Support automatic decompression
@@ -1528,6 +1528,7 @@
@itemx jfs_stage1_5
@itemx minix_stage1_5
@itemx reiserfs_stage1_5
+@itemx reiser4_stage1_5
@itemx vstafs_stage1_5
@itemx xfs_stage1_5
diff -urN --exclude=Makefile.in --exclude=configure --exclude='*.info' --exclude='*.*~' --exclude='*.m4' ./grub-0.94.orig/grub/Makefile.am ./grub-0.94/grub/Makefile.am
--- ./grub-0.94.orig/grub/Makefile.am 2004-01-18 22:34:24.000000000 +0300
+++ ./grub-0.94/grub/Makefile.am 2004-01-27 16:15:50.314761912 +0300
@@ -14,4 +14,4 @@
AM_CFLAGS = $(GRUB_CFLAGS) -fwritable-strings
grub_SOURCES = main.c asmstub.c
-grub_LDADD = ../stage2/libgrub.a ../lib/libcommon.a $(GRUB_LIBS)
+grub_LDADD = ../stage2/libgrub.a ../lib/libcommon.a $(GRUB_LIBS) $(REISER4_LIBS)
diff -urN --exclude=Makefile.in --exclude=configure --exclude='*.info' --exclude='*.*~' --exclude='*.m4' ./grub-0.94.orig/INSTALL ./grub-0.94/INSTALL
--- ./grub-0.94.orig/INSTALL 2003-10-19 21:15:45.000000000 +0400
+++ ./grub-0.94/INSTALL 2004-01-27 11:25:00.000000000 +0300
@@ -207,6 +207,9 @@
`--disable-reiserfs'
Omit the ReiserFS support in Stage 2.
+`--disable-reiser4'
+ Omit the Reiser4 support in Stage 2.
+
`--disable-vstafs'
Omit the VSTa filesystem support in Stage 2.
diff -urN --exclude=Makefile.in --exclude=configure --exclude='*.info' --exclude='*.*~' --exclude='*.m4' ./grub-0.94.orig/stage2/builtins.c ./grub-0.94/stage2/builtins.c
--- ./grub-0.94.orig/stage2/builtins.c 2004-01-11 12:39:22.000000000 +0300
+++ ./grub-0.94/stage2/builtins.c 2004-01-27 11:27:38.000000000 +0300
@@ -3751,6 +3751,7 @@
{"jfs", "/jfs_stage1_5"},
{"minix", "/minix_stage1_5"},
{"reiserfs", "/reiserfs_stage1_5"},
+ {"reiser4", "/reiser4_stage1_5"},
{"vstafs", "/vstafs_stage1_5"},
{"xfs", "/xfs_stage1_5"}
};
diff -urN --exclude=Makefile.in --exclude=configure --exclude='*.info' --exclude='*.*~' --exclude='*.m4' ./grub-0.94.orig/stage2/disk_io.c ./grub-0.94/stage2/disk_io.c
--- ./grub-0.94.orig/stage2/disk_io.c 2003-10-19 19:58:03.000000000 +0400
+++ ./grub-0.94/stage2/disk_io.c 2004-01-27 12:33:21.000000000 +0300
@@ -63,6 +63,9 @@
# ifdef FSYS_REISERFS
{"reiserfs", reiserfs_mount, reiserfs_read, reiserfs_dir, 0, reiserfs_embed},
# endif
+# ifdef FSYS_REISER4
+ {"reiser4", reiser4_mount, reiser4_read, reiser4_dir, 0, reiser4_embed},
+# endif
# ifdef FSYS_VSTAFS
{"vstafs", vstafs_mount, vstafs_read, vstafs_dir, 0, 0},
# endif
diff -urN --exclude=Makefile.in --exclude=configure --exclude='*.info' --exclude='*.*~' --exclude='*.m4' ./grub-0.94.orig/stage2/filesys.h ./grub-0.94/stage2/filesys.h
--- ./grub-0.94.orig/stage2/filesys.h 2003-07-09 15:45:52.000000000 +0400
+++ ./grub-0.94/stage2/filesys.h 2004-01-27 12:29:44.000000000 +0300
@@ -67,6 +67,16 @@
#define FSYS_REISERFS_NUM 0
#endif
+#ifdef FSYS_REISER4
+#define FSYS_REISER4_NUM 1
+int reiser4_mount (void);
+int reiser4_read (char *buf, int len);
+int reiser4_dir (char *dirname);
+int reiser4_embed (int *start_sector, int needed_sectors);
+#else
+#define FSYS_REISER4_NUM 0
+#endif
+
#ifdef FSYS_VSTAFS
#define FSYS_VSTAFS_NUM 1
int vstafs_mount (void);
@@ -108,8 +118,8 @@
#ifndef NUM_FSYS
#define NUM_FSYS \
(FSYS_FFS_NUM + FSYS_FAT_NUM + FSYS_EXT2FS_NUM + FSYS_MINIX_NUM \
- + FSYS_REISERFS_NUM + FSYS_VSTAFS_NUM + FSYS_JFS_NUM + FSYS_XFS_NUM \
- + FSYS_TFTP_NUM)
+ + FSYS_REISERFS_NUM + FSYS_REISER4_NUM + FSYS_VSTAFS_NUM + FSYS_JFS_NUM \
+ + FSYS_XFS_NUM + FSYS_TFTP_NUM)
#endif
/* defines for the block filesystem info area */
diff -urN --exclude=Makefile.in --exclude=configure --exclude='*.info' --exclude='*.*~' --exclude='*.m4' ./grub-0.94.orig/stage2/fsys_reiser4.c ./grub-0.94/stage2/fsys_reiser4.c
--- ./grub-0.94.orig/stage2/fsys_reiser4.c 1970-01-01 03:00:00.000000000 +0300
+++ ./grub-0.94/stage2/fsys_reiser4.c 2004-01-27 12:36:33.000000000 +0300
@@ -0,0 +1,245 @@
+/*
+ * fsys_reiser4.c -- reiser4 filesystem support.
+ * Copyright (C) 2001, 2002, 2003 Hans Reiser.
+ *
+ * GRUB -- GRand Unified Bootloader
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#ifdef FSYS_REISER4
+#include "shared.h"
+#include "filesys.h"
+
+#define ENABLE_STAND_ALONE
+#include <reiser4/libreiser4.h>
+
+static reiser4_fs_t *fs = NULL;
+static aal_device_t *dev = NULL;
+static reiser4_object_t *object = NULL;
+
+/* Read callback of grub specific device. It uses devread() for reading passed
+ @count of device blocks starting from @blk to passed @buff. */
+static errno_t grub_dev_read(aal_device_t *device,
+ void *buff, blk_t blk,
+ count_t count)
+{
+ unsigned int size;
+ unsigned int factor;
+ unsigned int sector;
+
+ /* Calculating actual sector and size in bytes to be read from
+ device. */
+ factor = device->blksize / SECTOR_SIZE;
+ sector = (unsigned int)blk << aal_log2(factor);
+ size = (unsigned int)count * (SECTOR_SIZE * factor);
+
+ /* Reading from the current device */
+ if (!devread(sector, 0, size, buff))
+ return -EIO;
+
+ return 0;
+}
+
+/* Length callback of grub device */
+static count_t grub_dev_len(aal_device_t *device) {
+ unsigned int factor;
+
+ /* Getting partition length in device blocks */
+ factor = device->blksize / SECTOR_SIZE;
+ return (part_length >> aal_log2(factor));
+}
+
+/*
+ Initializing grub device abstraction instance. It will use devread and friends
+ for providing needed functionality.
+*/
+struct aal_device_ops grub_dev_ops = {
+ .read = grub_dev_read,
+ .len = grub_dev_len
+};
+
+/* Initializes reiser4 */
+static int reiser4_init(void) {
+ extern aal_hash_table_t *plugins;
+
+ plugins = NULL;
+
+ /* Initializing memory manager */
+ aal_mem_init((void *)FSYS_BUF, FSYS_BUFLEN);
+
+ /* Initializing device abstraction on current device GRUB uses. */
+ if (!(dev = aal_device_open(&grub_dev_ops, NULL,
+ SECTOR_SIZE, 0)))
+ {
+ return 0;
+ }
+
+ /* Initializing libreiser4 (plugins, etc) */
+ return !libreiser4_init();
+}
+
+#define MEMORY_WATERMARK 8192
+
+/* Memory pressure detect function. */
+static int mpressure_detect(reiser4_tree_t *tree) {
+ return (aal_mem_free() <= MEMORY_WATERMARK);
+}
+
+/* Reiser4 mount() routine */
+int reiser4_mount(void) {
+
+ /* Initialize all reiser4 related stuff first */
+ if (!reiser4_init())
+ return 0;
+
+ /* Open filesystem on @dev. */
+ if (!(fs = reiser4_fs_open(dev, 0)))
+ return 0;
+
+ fs->tree->mpc_func = mpressure_detect;
+
+ object = NULL;
+ return 1;
+}
+
+/* Reiser4 read() handler */
+int reiser4_read(char *buf, int len) {
+ int64_t read;
+
+ if (object == NULL)
+ return 0;
+
+ /* Seet at current position denoted by @filepos */
+ reiser4_object_seek(object, filepos);
+
+ /* Reading current file data starting from @filepos */
+ disk_read_func = disk_read_hook;
+ read = reiser4_object_read(object, buf, len);
+ disk_read_func = NULL;
+
+ if (read < 0) {
+ errnum = ERR_FSYS_CORRUPT;
+ return 0;
+ }
+
+ filepos += read;
+ return read;
+}
+
+/* Reiser4 file open() routine */
+int reiser4_dir(char *dirname) {
+ char *ch;
+
+ if (fs == NULL)
+ return 0;
+
+ if (object != NULL) {
+ reiser4_object_close(object);
+ object = NULL;
+ }
+
+ /* Cutting out string after first space character */
+ if ((ch = aal_strchr(dirname, ' ')))
+ *ch = '\0';
+
+ /* This function is also called for getting directory list for
+ maintaining the bash-like completion. */
+#ifndef STAGE1_5
+ if (print_possibilities) {
+ char entry[256];
+ entry_hint_t entry_hint;
+
+ /* Getting last part of name (jsut after last '/') */
+ if (*(dirname + aal_strlen(dirname) - 1) != '/') {
+
+ if (!(ch = aal_strrchr(dirname, '/'))) {
+ errnum = ERR_BAD_FILETYPE;
+ return 0;
+ }
+
+ aal_strncpy(entry, ch + 1, sizeof(entry));
+ *(ch + 1) = '\0';
+ } else {
+ aal_memset(entry, 0, sizeof(entry));
+ }
+
+ /* Open obejct by @dirname */
+ if (!(object = reiser4_object_open(fs->tree, dirname, 1))) {
+ errnum = ERR_FILE_NOT_FOUND;
+ return 0;
+ }
+
+ /* Checking if it is a directory object */
+ if (object->entity->plug->id.group != DIR_OBJECT) {
+
+ /* If not, cutting out last '/' character */
+ if ((ch = aal_strrchr(dirname, '/')))
+ *ch = '\0';
+
+ /* Close current object */
+ reiser4_object_close(object);
+
+ /* Getting out */
+ return 0;
+ }
+
+ /* Reading opened directory in order to build completion
+ list. */
+ while (reiser4_object_readdir(object, &entry_hint) > 0) {
+ if (substring(entry, entry_hint.name) <= 0) {
+
+ if (print_possibilities > 0)
+ print_possibilities = -print_possibilities;
+
+ print_a_completion(entry_hint.name);
+ }
+ }
+ } else {
+#endif
+ /* This is the case when resier4_dir() is called for open the
+ file @dirname, not for building completion list. */
+ if (!(object = reiser4_object_open(fs->tree, dirname, 1))) {
+ errnum = ERR_FILE_NOT_FOUND;
+ return 0;
+ }
+
+ if (object->entity->plug->id.group != REG_OBJECT) {
+ errnum = ERR_BAD_FILETYPE;
+ return 0;
+ }
+
+ /* Initializing GRUB global variables @filepos and @filemax. */
+ filepos = 0;
+ filemax = reiser4_object_size(object);
+
+ return 1;
+#ifndef STAGE1_5
+ }
+
+ return 1;
+#endif
+
+ errnum = ERR_FILE_NOT_FOUND;
+ return 0;
+}
+
+/* Returns how many sectors may be used for embeding reiser4_stage1_5 in teh
+ case of installing GRUB to partition instead of MBR. */
+int reiser4_embed (int *start_sector, int needed_sectors) {
+ *start_sector = 1;
+ return needed_sectors <= ((REISER4_MASTER_OFFSET >> SECTOR_BITS) - 1);
+}
+#endif /* FSYS_REISER4 */
diff -urN --exclude=Makefile.in --exclude=configure --exclude='*.info' --exclude='*.*~' --exclude='*.m4' ./grub-0.94.orig/stage2/Makefile.am ./grub-0.94/stage2/Makefile.am
--- ./grub-0.94.orig/stage2/Makefile.am 2003-10-19 20:45:18.000000000 +0400
+++ ./grub-0.94/stage2/Makefile.am 2004-01-27 16:10:53.033955464 +0300
@@ -13,16 +13,24 @@
# For <stage1.h>.
INCLUDES = -I$(top_srcdir)/stage1
+if ENABLE_REISER4_SUPPORT
+REISER4_STAGE1_5 = reiser4_stage1_5
+REISER4_STAGE1_5_EXEC = reiser4_stage1_5.exec
+else
+REISER4_STAGE1_5 =
+REISER4_STAGE1_5_EXEC =
+endif
+
# The library for /sbin/grub.
noinst_LIBRARIES = libgrub.a
libgrub_a_SOURCES = boot.c builtins.c char_io.c cmdline.c common.c \
disk_io.c fsys_ext2fs.c fsys_fat.c fsys_ffs.c fsys_jfs.c \
- fsys_minix.c fsys_reiserfs.c fsys_vstafs.c fsys_xfs.c gunzip.c \
- md5.c serial.c stage2.c terminfo.c tparm.c
+ fsys_minix.c fsys_reiserfs.c fsys_reiser4.c fsys_vstafs.c \
+ fsys_xfs.c gunzip.c md5.c serial.c stage2.c terminfo.c tparm.c
libgrub_a_CFLAGS = $(GRUB_CFLAGS) -I$(top_srcdir)/lib \
-DGRUB_UTIL=1 -DFSYS_EXT2FS=1 -DFSYS_FAT=1 -DFSYS_FFS=1 \
- -DFSYS_JFS=1 -DFSYS_MINIX=1 -DFSYS_REISERFS=1 -DFSYS_VSTAFS=1 \
- -DFSYS_XFS=1 -DUSE_MD5_PASSWORDS=1 \
+ -DFSYS_JFS=1 -DFSYS_MINIX=1 -DFSYS_REISERFS=1 $(REISER4_CFLAGS) \
+ -DFSYS_VSTAFS=1 -DFSYS_XFS=1 -DUSE_MD5_PASSWORDS=1 \
-DSUPPORT_SERIAL=1 -DSUPPORT_HERCULES=1 -fwritable-strings
# Stage 2 and Stage 1.5's.
@@ -32,22 +40,22 @@
if DISKLESS_SUPPORT
pkgdata_DATA = stage2 e2fs_stage1_5 fat_stage1_5 ffs_stage1_5 \
- jfs_stage1_5 minix_stage1_5 reiserfs_stage1_5 vstafs_stage1_5 \
- xfs_stage1_5 nbgrub pxegrub
+ jfs_stage1_5 minix_stage1_5 reiserfs_stage1_5 $(REISER4_STAGE1_5) \
+ vstafs_stage1_5 xfs_stage1_5 nbgrub pxegrub
noinst_DATA = pre_stage2 start nbloader pxeloader diskless
noinst_PROGRAMS = pre_stage2.exec start.exec e2fs_stage1_5.exec \
fat_stage1_5.exec ffs_stage1_5.exec jfs_stage1_5.exec \
- minix_stage1_5.exec reiserfs_stage1_5.exec \
+ minix_stage1_5.exec reiserfs_stage1_5.exec $(REISER4_STAGE1_5_EXEC) \
vstafs_stage1_5.exec xfs_stage1_5.exec nbloader.exec \
pxeloader.exec diskless.exec
else
pkgdata_DATA = stage2 e2fs_stage1_5 fat_stage1_5 ffs_stage1_5 \
- jfs_stage1_5 minix_stage1_5 reiserfs_stage1_5 vstafs_stage1_5 \
- xfs_stage1_5
+ jfs_stage1_5 minix_stage1_5 reiserfs_stage1_5 $(REISER4_STAGE1_5) \
+ vstafs_stage1_5 xfs_stage1_5
noinst_DATA = pre_stage2 start
noinst_PROGRAMS = pre_stage2.exec start.exec e2fs_stage1_5.exec \
fat_stage1_5.exec ffs_stage1_5.exec jfs_stage1_5.exec \
- minix_stage1_5.exec reiserfs_stage1_5.exec \
+ minix_stage1_5.exec reiserfs_stage1_5.exec $(REISER4_STAGE1_5_EXEC) \
vstafs_stage1_5.exec xfs_stage1_5.exec
endif
MOSTLYCLEANFILES = $(noinst_PROGRAMS)
@@ -75,7 +83,7 @@
HERCULES_FLAGS =
endif
-STAGE2_COMPILE = $(STAGE2_CFLAGS) -fno-builtin -nostdinc \
+STAGE2_COMPILE = $(STAGE2_CFLAGS) -fno-builtin \
$(NETBOOT_FLAGS) $(SERIAL_FLAGS) $(HERCULES_FLAGS)
STAGE1_5_LINK = -nostdlib -Wl,-N -Wl,-Ttext -Wl,2000
@@ -85,14 +93,16 @@
pre_stage2_exec_SOURCES = asm.S bios.c boot.c builtins.c char_io.c \
cmdline.c common.c console.c disk_io.c fsys_ext2fs.c \
fsys_fat.c fsys_ffs.c fsys_jfs.c fsys_minix.c fsys_reiserfs.c \
- fsys_vstafs.c fsys_xfs.c gunzip.c hercules.c md5.c serial.c \
- smp-imps.c stage2.c terminfo.c tparm.c
+ fsys_reiser4.c fsys_vstafs.c fsys_xfs.c gunzip.c hercules.c \
+ md5.c serial.c smp-imps.c stage2.c terminfo.c tparm.c
pre_stage2_exec_CFLAGS = $(STAGE2_COMPILE) $(FSYS_CFLAGS)
pre_stage2_exec_CCASFLAGS = $(STAGE2_COMPILE) $(FSYS_CFLAGS)
pre_stage2_exec_LDFLAGS = $(PRE_STAGE2_LINK)
if NETBOOT_SUPPORT
-pre_stage2_exec_LDADD = ../netboot/libdrivers.a
+pre_stage2_exec_LDADD = ../netboot/libdrivers.a $(REISER4_LIBS)
+else
+pre_stage2_exec_LDADD = $(REISER4_LIBS)
endif
if DISKLESS_SUPPORT
@@ -167,6 +177,16 @@
-DNO_BLOCK_FILES=1
reiserfs_stage1_5_exec_LDFLAGS = $(STAGE1_5_LINK)
+# For reiser4_stage1_5 target.
+reiser4_stage1_5_exec_SOURCES = start.S asm.S common.c char_io.c \
+ disk_io.c stage1_5.c fsys_reiser4.c bios.c
+reiser4_stage1_5_exec_CFLAGS = $(STAGE1_5_COMPILE) $(REISER4_CFLAGS) \
+ -DNO_BLOCK_FILES=1
+reiser4_stage1_5_exec_CCASFLAGS = $(STAGE1_5_COMPILE) $(REISER4_CFLAGS) \
+ -DNO_BLOCK_FILES=1
+reiser4_stage1_5_exec_LDFLAGS = $(STAGE1_5_LINK)
+reiser4_stage1_5_exec_LDADD = $(REISER4_LIBS)
+
# For vstafs_stage1_5 target.
vstafs_stage1_5_exec_SOURCES = start.S asm.S common.c char_io.c \
disk_io.c stage1_5.c fsys_vstafs.c bios.c
diff -urN --exclude=Makefile.in --exclude=configure --exclude='*.info' --exclude='*.*~' --exclude='*.m4' ./grub-0.94.orig/stage2/shared.h ./grub-0.94/stage2/shared.h
--- ./grub-0.94.orig/stage2/shared.h 2004-01-11 12:39:22.000000000 +0300
+++ ./grub-0.94/stage2/shared.h 2004-01-27 11:41:39.000000000 +0300
@@ -202,9 +202,10 @@
#define STAGE2_ID_FAT_STAGE1_5 3
#define STAGE2_ID_MINIX_STAGE1_5 4
#define STAGE2_ID_REISERFS_STAGE1_5 5
-#define STAGE2_ID_VSTAFS_STAGE1_5 6
-#define STAGE2_ID_JFS_STAGE1_5 7
-#define STAGE2_ID_XFS_STAGE1_5 8
+#define STAGE2_ID_REISER4_STAGE1_5 6
+#define STAGE2_ID_VSTAFS_STAGE1_5 7
+#define STAGE2_ID_JFS_STAGE1_5 8
+#define STAGE2_ID_XFS_STAGE1_5 9
#ifndef STAGE1_5
# define STAGE2_ID STAGE2_ID_STAGE2
@@ -219,6 +220,8 @@
# define STAGE2_ID STAGE2_ID_MINIX_STAGE1_5
# elif defined(FSYS_REISERFS)
# define STAGE2_ID STAGE2_ID_REISERFS_STAGE1_5
+# elif defined(FSYS_REISER4)
+# define STAGE2_ID STAGE2_ID_REISER4_STAGE1_5
# elif defined(FSYS_VSTAFS)
# define STAGE2_ID STAGE2_ID_VSTAFS_STAGE1_5
# elif defined(FSYS_JFS)
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: status of grub reiser4 support ?
2004-03-16 9:40 ` Vitaly Fertman
@ 2004-03-16 10:57 ` Vince
2004-03-16 11:21 ` Vince
2004-03-16 11:24 ` status of grub reiser4 support ? Vince
0 siblings, 2 replies; 16+ messages in thread
From: Vince @ 2004-03-16 10:57 UTC (permalink / raw)
To: Vitaly Fertman; +Cc: Reiserfs mail-list
Hi,
with your latest patches, grub can now read reiser4 partitions (both
from linux and from the bios) but:
1) any attempt to load a kernel image sitting on a reiser4 partition
just hangs
2) attempting to install grub on a reiser4 partition results in a
segmentation fault (no backtrace yet, I have to recompile...).
Vitaly Fertman wrote:
>
> yes, thank you, I have found a few other bugs also, so attached are
> the fixed grub patch and fixes for the reiser4progs. You probably
> do not have fibration plugins yet, so just through away the last diff
> in the reiser4progs patch.
>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: status of grub reiser4 support ?
2004-03-16 10:57 ` Vince
@ 2004-03-16 11:21 ` Vince
2004-03-16 13:55 ` Vitaly Fertman
2004-03-16 11:24 ` status of grub reiser4 support ? Vince
1 sibling, 1 reply; 16+ messages in thread
From: Vince @ 2004-03-16 11:21 UTC (permalink / raw)
To: Vitaly Fertman; +Cc: Reiserfs mail-list
More information follows:
> Hi,
>
> with your latest patches, grub can now read reiser4 partitions (both
> from linux and from the bios) but:
> 1) any attempt to load a kernel image sitting on a reiser4 partition
> just hangs
grub> kernel (hd1,0)/boot/vmlinuz-2.6.4-bk5
Program received signal SIGSEGV, Segmentation fault.
0x0806408f in extent40_offset (place=0x4007aba0, pos=4294967295) at
extent40.c:41
41 blocks += et40_get_width(extent);
(gdb) bt
#0 0x0806408f in extent40_offset (place=0x4007aba0, pos=4294967295) at
extent40.c:41
#1 0x0806922d in body40_get_key (place=0x4007aba0, pos=4294967295,
key=0x4007aac0, trans_func=0x8064062 <extent40_offset>)
at body40.c:20
#2 0x080640e9 in extent40_fetch_key (place=0x4007aba0, key=0x4007aac0)
at extent40.c:52
#3 0x080642a3 in extent40_read_units (place=0x4007aba0,
hint=0x4007aca0) at extent40.c:510
#4 0x0806114d in reiser4_tree_read (tree=0x4007d7e8, place=0x4007aba0,
hint=0x4007aca0) at tree.c:1922
#5 0x08062a3b in reiser4_flow_read (tree=0x4007d7e8, hint=0x4007aca0)
at flow.c:86
#6 0x0805f227 in tree_read (tree=0x4007d7e8, hint=0x4007aca0) at
libreiser4.c:79
#7 0x08066ef5 in obj40_read (obj=0x40080248, hint=0x4007aca0) at
obj40.c:657
#8 0x080672c1 in reg40_read (entity=0x40080248, buff=0x4007ae00, n=10)
at reg40.c:120
#9 0x08061ad9 in reiser4_object_read (object=0x4007e070,
buff=0x4007ae00, n=10) at object.c:660
#10 0x0805218d in reiser4_read (buf=0x40416004 <Address 0x40416004 out
of bounds>, len=1078026244) at fsys_reiser4.c:130
#11 0x0804df97 in grub_read (buf=0x4007ae00 "g¼\002@Ю\a@\030®\a@",
len=10) at disk_io.c:1693
#12 0x080539fe in gunzip_test_header () at gunzip.c:333
#13 0x0804dd0a in grub_open (filename=0x4002bc6e
"/boot/vmlinuz-2.6.4-bk5") at disk_io.c:1591
#14 0x0805cd6e in load_image (kernel=0x40416004 <Address 0x40416004 out
of bounds>,
arg=0x40017000 "(hd1,0)/boot/vmlinuz-2.6.4-bk5",
suggested_type=KERNEL_TYPE_NONE, load_flags=1) at boot.c:64
#15 0x08059864 in kernel_func (arg=0x4002bc67
"(hd1,0)/boot/vmlinuz-2.6.4-bk5", flags=1) at builtins.c:2514
#16 0x0805c4ed in enter_cmdline (heap=0x4002bc60 "kernel
(hd1,0)/boot/vmlinuz-2.6.4-bk5", forever=1) at cmdline.c:172
#17 0x08056396 in cmain () at stage2.c:1018
#18 0x0804c052 in init_bios_info () at common.c:323
#19 0x08049808 in doit.0 () at asmstub.c:129
#20 0x08049900 in grub_stage2 () at asmstub.c:186
#21 0x080495e8 in main (argc=1, argv=0xbffff9d4) at main.c:264
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: status of grub reiser4 support ?
2004-03-16 10:57 ` Vince
2004-03-16 11:21 ` Vince
@ 2004-03-16 11:24 ` Vince
1 sibling, 0 replies; 16+ messages in thread
From: Vince @ 2004-03-16 11:24 UTC (permalink / raw)
To: Vitaly Fertman; +Cc: Reiserfs mail-list
Another backtrace for the second point (looks like the same bug):
> 2) attempting to install grub on a reiser4 partition results in a
> segmentation fault
grub> root (hd1,0)
Filesystem type is reiser4, partition type 0x83
grub> setup (hd1)
Program received signal SIGSEGV, Segmentation fault.
0x0806408f in extent40_offset (place=0x4007c930, pos=4294967295) at
extent40.c:41
41 blocks += et40_get_width(extent);
(gdb) bt
#0 0x0806408f in extent40_offset (place=0x4007c930, pos=4294967295) at
extent40.c:41
#1 0x0806922d in body40_get_key (place=0x4007c930, pos=4294967295,
key=0x4007c850, trans_func=0x8064062 <extent40_offset>)
at body40.c:20
#2 0x080640e9 in extent40_fetch_key (place=0x4007c930, key=0x4007c850)
at extent40.c:52
#3 0x080642a3 in extent40_read_units (place=0x4007c930,
hint=0x4007ca30) at extent40.c:510
#4 0x0806114d in reiser4_tree_read (tree=0x4007d7e8, place=0x4007c930,
hint=0x4007ca30) at tree.c:1922
#5 0x08062a3b in reiser4_flow_read (tree=0x4007d7e8, hint=0x4007ca30)
at flow.c:86
#6 0x0805f227 in tree_read (tree=0x4007d7e8, hint=0x4007ca30) at
libreiser4.c:79
#7 0x08066ef5 in obj40_read (obj=0x40081448, hint=0x4007ca30) at
obj40.c:657
#8 0x080672c1 in reg40_read (entity=0x40081448, buff=0x4007cb90, n=10)
at reg40.c:120
#9 0x08061ad9 in reiser4_object_read (object=0x4007e070,
buff=0x4007cb90, n=10) at object.c:660
#10 0x0805218d in reiser4_read (buf=0x40415ffc "", len=1078026236) at
fsys_reiser4.c:130
#11 0x0804df97 in grub_read (buf=0x4007cb90 " ", len=10) at disk_io.c:1693
#12 0x080539fe in gunzip_test_header () at gunzip.c:333
#13 0x0804dd0a in grub_open (filename=0x4007ce80 "/boot/grub/stage2") at
disk_io.c:1591
#14 0x0805ad22 in check_file.8 () at builtins.c:3956
#15 0x0805b12a in setup_func (arg=0x0, flags=1) at builtins.c:4124
#16 0x0805c4ed in enter_cmdline (heap=0x4002bc60 "setup (hd1)",
forever=1) at cmdline.c:172
#17 0x08056396 in cmain () at stage2.c:1018
#18 0x0804c052 in init_bios_info () at common.c:323
#19 0x08049808 in doit.0 () at asmstub.c:129
#20 0x08049900 in grub_stage2 () at asmstub.c:186
#21 0x080495e8 in main (argc=1, argv=0xbffff9d4) at main.c:264
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: status of grub reiser4 support ?
2004-03-16 11:21 ` Vince
@ 2004-03-16 13:55 ` Vitaly Fertman
2004-03-16 14:40 ` grub reiser4 support... success ! Vince
2004-03-16 14:56 ` fsck.reiser4 infinite loop Vince
0 siblings, 2 replies; 16+ messages in thread
From: Vitaly Fertman @ 2004-03-16 13:55 UTC (permalink / raw)
To: Vince; +Cc: Reiserfs mail-list
[-- Attachment #1: Type: text/plain, Size: 1010 bytes --]
On Tuesday 16 March 2004 14:21, Vince wrote:
> More information follows:
> > Hi,
> >
> > with your latest patches, grub can now read reiser4 partitions (both
> > from linux and from the bios) but:
> > 1) any attempt to load a kernel image sitting on a reiser4 partition
> > just hangs
>
> grub> kernel (hd1,0)/boot/vmlinuz-2.6.4-bk5
> Program received signal SIGSEGV, Segmentation fault.
> 0x0806408f in extent40_offset (place=0x4007aba0, pos=4294967295) at
> extent40.c:41
> 41 blocks += et40_get_width(extent);
> (gdb) bt
> #0 0x0806408f in extent40_offset (place=0x4007aba0, pos=4294967295) at
> extent40.c:41
> #1 0x0806922d in body40_get_key (place=0x4007aba0, pos=4294967295,
> key=0x4007aac0, trans_func=0x8064062 <extent40_offset>)
> at body40.c:20
> #2 0x080640e9 in extent40_fetch_key (place=0x4007aba0, key=0x4007aac0)
thank you for hitting this, I have attached the updated patch for reiser4progs.
it should cure for the problem, email me about your results please.
[-- Attachment #2: reiser4_alone1.patch --]
[-- Type: text/x-diff, Size: 4162 bytes --]
diff -Nru a/libreiser4/tree.c b/libreiser4/tree.c
--- a/libreiser4/tree.c Tue Mar 16 16:50:54 2004
+++ b/libreiser4/tree.c Tue Mar 16 16:50:54 2004
@@ -271,6 +271,9 @@
return -EINVAL;
out_correct_place:
+#else
+ if (reiser4_place_fetch(place))
+ return -EINVAL;
#endif
if (reiser4_item_units(place) == 1)
place->pos.unit = MAX_UINT32;
diff -Nru a/plugin/item/extent40/extent40.c b/plugin/item/extent40/extent40.c
--- a/plugin/item/extent40/extent40.c Tue Mar 16 16:50:54 2004
+++ b/plugin/item/extent40/extent40.c Tue Mar 16 16:50:54 2004
@@ -112,6 +112,10 @@
pos = place->pos.unit;
units = extent40_units(place);
+
+ /* Check for unit pos. */
+ if (pos == MAX_UINT32)
+ pos = 0;
aal_assert("umka-3026",
pos + hint->count <= units);
@@ -181,7 +185,6 @@
aal_assert("umka-2458", place != NULL);
aal_assert("umka-2461", hint != NULL);
-
hint->len = 0;
hint->bytes = 0;
hint->overhead = 0;
@@ -507,13 +510,14 @@
buff = hint->specific;
count = (uint32_t)hint->count;
+ if (place->pos.unit == MAX_UINT32)
+ place->pos.unit = 0;
+
extent40_fetch_key(place, &key);
blksize = extent40_blksize(place);
secsize = extent40_secsize(place);
- if (place->pos.unit == MAX_UINT32)
- place->pos.unit = 0;
read_offset = plug_call(hint->offset.plug->o.key_ops,
get_offset, &hint->offset);
@@ -600,7 +604,8 @@
aal_assert("umka-2435", hint != NULL);
aal_assert("umka-2434", place != NULL);
- pos = place->pos.unit;
+ pos = place->pos.unit == MAX_UINT32 ? 0 : place->pos.unit;
+
extent = extent40_body(place) + pos;
ptr_hint = (ptr_hint_t *)hint->specific;
@@ -698,8 +703,7 @@
aal_assert("umka-2431", hint != NULL);
aal_assert("umka-2430", place != NULL);
- if ((pos = place->pos.unit) == MAX_UINT32)
- pos = 0;
+ pos = place->pos.unit == MAX_UINT32 ? 0 : place->pos.unit;
extent = extent40_body(place) + pos;
ptr_hint = (ptr_hint_t *)hint->specific;
diff -Nru a/plugin/key/key_large/key_large.c b/plugin/key/key_large/key_large.c
--- a/plugin/key/key_large/key_large.c Tue Mar 16 16:50:54 2004
+++ b/plugin/key/key_large/key_large.c Tue Mar 16 16:50:54 2004
@@ -186,7 +186,6 @@
aal_memset(key->body, 0, sizeof(key->body));
}
-#ifndef ENABLE_STAND_ALONE
/* Figures out if items are of one file or not. */
static int key_large_compshort(reiser4_key_t *key1,
reiser4_key_t *key2)
@@ -219,7 +218,6 @@
return kl_comp_el((key_large_t *)key1->body,
(key_large_t *)key2->body, 2);
}
-#endif
static int key_large_compraw(void *key1, void *key2) {
int res;
@@ -386,11 +384,8 @@
.bodysize = key_lage_bodysize,
.compraw = key_large_compraw,
.compfull = key_large_compfull,
-
-#ifndef ENABLE_STAND_ALONE
.compshort = key_large_compshort,
-#endif
-
+
.build_hashed = key_large_build_hashed,
.build_generic = key_large_build_generic,
diff -Nru a/plugin/key/key_short/key_short.c b/plugin/key/key_short/key_short.c
--- a/plugin/key/key_short/key_short.c Tue Mar 16 16:50:54 2004
+++ b/plugin/key/key_short/key_short.c Tue Mar 16 16:50:54 2004
@@ -179,7 +179,6 @@
aal_memset(key->body, 0, sizeof(key->body));
}
-#ifndef ENABLE_STAND_ALONE
/* Compares two first components of the pased keys (locality and objectid) */
static int key_short_compshort(reiser4_key_t *key1,
reiser4_key_t *key2)
@@ -206,7 +205,6 @@
/* Checking object id */
return aal_memcmp(&oid1, &oid2, sizeof(oid1));
}
-#endif
/* Compares two passed key bodies. */
static int key_short_compraw(void *key1, void *key2) {
@@ -368,10 +366,7 @@
.bodysize = key_short_bodysize,
.compfull = key_short_compfull,
.compraw = key_short_compraw,
-
-#ifndef ENABLE_STAND_ALONE
.compshort = key_short_compshort,
-#endif
.build_hashed = key_short_build_hashed,
.build_generic = key_short_build_generic,
diff -Nru a/plugin/object/obj40/obj40.c b/plugin/object/obj40/obj40.c
--- a/plugin/object/obj40/obj40.c Tue Mar 16 16:50:54 2004
+++ b/plugin/object/obj40/obj40.c Tue Mar 16 16:50:54 2004
@@ -598,6 +598,9 @@
#else
if (type == HASH_PLUG_TYPE)
pid = HASH_R5_ID;
+
+ if (type == FIBRE_PLUG_TYPE)
+ pid = FIBRE_DOT_O_ID;
#endif
}
^ permalink raw reply [flat|nested] 16+ messages in thread
* grub reiser4 support... success !
2004-03-16 13:55 ` Vitaly Fertman
@ 2004-03-16 14:40 ` Vince
2004-03-16 14:56 ` fsck.reiser4 infinite loop Vince
1 sibling, 0 replies; 16+ messages in thread
From: Vince @ 2004-03-16 14:40 UTC (permalink / raw)
To: Vitaly Fertman; +Cc: Reiserfs mail-list
With your latest patch, grub finally installs and boots fine using a
reiser4 partition.
Thanks !
Vince
Vitaly Fertman wrote:
>
> thank you for hitting this, I have attached the updated patch for reiser4progs.
> it should cure for the problem, email me about your results please.
>
^ permalink raw reply [flat|nested] 16+ messages in thread
* fsck.reiser4 infinite loop
2004-03-16 13:55 ` Vitaly Fertman
2004-03-16 14:40 ` grub reiser4 support... success ! Vince
@ 2004-03-16 14:56 ` Vince
2004-03-16 15:15 ` Vitaly Fertman
1 sibling, 1 reply; 16+ messages in thread
From: Vince @ 2004-03-16 14:56 UTC (permalink / raw)
To: Vitaly Fertman; +Cc: Reiserfs mail-list
Vitaly Fertman wrote:
>
> thank you for hitting this, I have attached the updated patch for reiser4progs.
> it should cure for the problem, email me about your results please.
>
It looks that I'm quite good at hitting bugs ;-)
Ok, yet another problem: fsck.reiser4 on my other reiser4 partition
loops on some entry. I can pack the metadata and make it available if
needed, for now here is the log:
Fscking the /dev/hdc3 block device.
Will check the consistency of the Reiser4 SuperBlock.
Will check the consistency of the Reiser4 FileSystem.
Continue?
(Yes/No): Yes
***** Openning the fs.
Reiser4 fs was detected on the /dev/hdc3.
Master super block (16):
magic: ReIsEr4
blksize: 4096
format: 0x0 (format40)
uuid: 2c166267-3a92-488b-902f-30dc85f086f8
label: <none>
Format super block (17):
plugin: format40
description: Disk-format for reiser4, ver. 0.5.2
magic: ReIsEr40FoRmAt
flushes: 0
mkfs id: 0x3f7b1d62
blocks: 22826356
free blocks: 18051014
root block: 6340107
tail policy: 0x4 (smart)
next oid: 0x9c389
file count: 3686
tree height: 4
key policy: LARGE
***** Tree Traverse Pass: scanning the reiser4 internal tree.
Read nodes 2145
Nodes left in the tree 2145
Leaves of them 2015, Twigs of them 125
Time interval: Tue Mar 16 15:49:26 2004 - Tue Mar 16 15:49:29 2004
***** TwigScan Pass: checking extent pointers of all twigs.
Read twigs 125
Time interval: Tue Mar 16 15:49:29 2004 - Tue Mar 16 15:49:30 2004
***** Semantic Traverse Pass: reiser4 semantic tree checking.
Error: Directory [2a:4d616e61726100:103ed], plugin [dir40], node
[3920676], item [0], unit [20]: entry
has wrong offset
[103ed:0(NAME):14c276172742064:65206c6120466573:6600f39efe3688d0]. Should be
[103ed:0(NAME):14c276172742064:65206c6120466573:ba6f4da7b42f7420].
Error: Directory [2a:4d616e61726100:103ed], plugin [dir40], node
[3920676], item [0], unit [25]: entry
has wrong offset
[103ed:0(NAME):1506972616e6573:6520286c6120706c:d6bdb1be36b2b0]. Should be
[103ed:0(NAME):1506972616e6573:6520286c6120706c:d292ac7637ed80].
Error: Directory [2a:4d616e61726100:103ed], plugin [dir40], node
[3920676], item [0], unit [26]: entry
has wrong offset
[103ed:0(NAME):1506c616e636865:73204f726967696e:61324235cf02fffc]. Should be
[103ed:0(NAME):1506c616e636865:73204f726967696e:6131e135541a626c].
Error: Directory [2a:4d616e61726100:103ed], plugin [dir40], node
[3920676], item [0], unit [27]: entry
has wrong offset
[103ed:0(NAME):1506c616e636865:73204f726967696e:b084105f6fc0e590]. Should be
[103ed:0(NAME):1506c616e636865:73204f726967696e:6baf3c8eb0cabfe0].
Error: Directory [2a:4d616e61726100:103ed], plugin [dir40], node
[3920676], item [0], unit [27]: entry
has wrong offset
[103ed:0(NAME):1506c616e636865:73204f726967696e:b084105f6fc0e590]. Should be
[103ed:0(NAME):1506c616e636865:73204f726967696e:6baf3c8eb0cabfe0].
[-> from here, fsck.reiser4 only loops on the last entry]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: fsck.reiser4 infinite loop
2004-03-16 14:56 ` fsck.reiser4 infinite loop Vince
@ 2004-03-16 15:15 ` Vitaly Fertman
2004-03-16 16:01 ` Vince
0 siblings, 1 reply; 16+ messages in thread
From: Vitaly Fertman @ 2004-03-16 15:15 UTC (permalink / raw)
To: Vince; +Cc: Reiserfs mail-list
[-- Attachment #1: Type: text/plain, Size: 678 bytes --]
On Tuesday 16 March 2004 17:56, Vince wrote:
> Vitaly Fertman wrote:
> > thank you for hitting this, I have attached the updated patch for
> > reiser4progs. it should cure for the problem, email me about your results
> > please.
>
> It looks that I'm quite good at hitting bugs ;-)
good day.
> Ok, yet another problem: fsck.reiser4 on my other reiser4 partition
> loops on some entry. I can pack the metadata and make it available if
> needed, for now here is the log:
I see the problem, although not sure that the attached patch will
fix it correctly. If it does not, I need to have a look at the metadata.
p.s. waiting for other bug reports :)
--
Thanks,
Vitaly Fertman
[-- Attachment #2: dir40_check.patch --]
[-- Type: text/x-diff, Size: 466 bytes --]
===== plugin/object/dir40/dir40_repair.c 1.88 vs edited =====
--- 1.88/plugin/object/dir40/dir40_repair.c Thu Mar 11 22:01:47 2004
+++ edited/plugin/object/dir40/dir40_repair.c Tue Mar 16 18:07:00 2004
@@ -316,6 +316,10 @@
if (mode != RM_BUILD) {
+ /* If not the BUILD mode, continue with the
+ entry key, not the correct one. */
+ plug_call(key.plug->o.key_ops, assign,
+ &key, &entry.offset);
res |= RE_FATAL;
goto next;
}
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: fsck.reiser4 infinite loop
2004-03-16 15:15 ` Vitaly Fertman
@ 2004-03-16 16:01 ` Vince
0 siblings, 0 replies; 16+ messages in thread
From: Vince @ 2004-03-16 16:01 UTC (permalink / raw)
To: Vitaly Fertman; +Cc: Reiserfs mail-list
Vitaly Fertman wrote:
>
> I see the problem, although not sure that the attached patch will
> fix it correctly. If it does not, I need to have a look at the metadata.
Good guess, the problem is fixed.
-------------------------------------------------------
***** fsck.reiser4 finished at Tue Mar 16 16:48:09 2004
Closing fs...done
52 fatal corruptions were detected in FileSystem. Run with --build-fs
option to fix them.
--------------------------------------------------------
And then fsck.reiser4 --build-fs had no problem fixing the partition.
> p.s. waiting for other bug reports :)
Don't worry, I'll send them as soon as they arise -- although I hope I
had enough of them for today 8-)
Anyway, thank you for your quick answers & fixes :-)
Vince
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2004-03-16 16:01 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-15 11:47 status of grub reiser4 support ? Vince
2004-03-15 14:19 ` Vitaly Fertman
2004-03-15 16:52 ` Vince
2004-03-15 20:20 ` Vince
2004-03-15 20:39 ` Vince
2004-03-15 20:43 ` Vince
2004-03-15 21:07 ` Hans Reiser
2004-03-16 9:40 ` Vitaly Fertman
2004-03-16 10:57 ` Vince
2004-03-16 11:21 ` Vince
2004-03-16 13:55 ` Vitaly Fertman
2004-03-16 14:40 ` grub reiser4 support... success ! Vince
2004-03-16 14:56 ` fsck.reiser4 infinite loop Vince
2004-03-16 15:15 ` Vitaly Fertman
2004-03-16 16:01 ` Vince
2004-03-16 11:24 ` status of grub reiser4 support ? Vince
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.