Re: [non-finalised patch] reiserfs handling

2008-01-08 Thread Robert Millan
On Mon, Jan 07, 2008 at 11:54:04PM +0100, Yoshinori K. Okuji wrote:
> On Monday 07 January 2008 10:19, Robert Millan wrote:
> > Great!  I see that you fixed the endianess issues.
> >
> > I'll push this to Debian sid ASAP.
> 
> I hope I have fixed all the endianness issues, but I am not sure yet. Perhaps 
> I need to clean up the code further.

I tested it again on a basic Debian etch install with reiserfs and it worked
fine.  I suppose we'll receive reports when it's more stress-tested.

> BTW, I noticed that make distcheck didn't work. I added missing files into 
> DISTLIST, but it still fails, because update-grub and some related files are 
> not deleted after make uninstall. Maybe you know how to fix this?

Fixed.  I also found a race with make distcheck -j2, fixed that as well.

Does this mean 1.96 will be out soon?

-- 
Robert Millan

 I know my rights; I want my phone call!
 What use is a phone call, if you are unable to speak?
(as seen on /.)


___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel


Re: [non-finalised patch] reiserfs handling

2008-01-07 Thread Yoshinori K. Okuji
On Monday 07 January 2008 10:19, Robert Millan wrote:
> Great!  I see that you fixed the endianess issues.
>
> I'll push this to Debian sid ASAP.

I hope I have fixed all the endianness issues, but I am not sure yet. Perhaps 
I need to clean up the code further.

BTW, I noticed that make distcheck didn't work. I added missing files into 
DISTLIST, but it still fails, because update-grub and some related files are 
not deleted after make uninstall. Maybe you know how to fix this?

Okuji


___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel


Re: [non-finalised patch] reiserfs handling

2008-01-07 Thread Yoshinori K. Okuji
On Monday 07 January 2008 06:28, Jeff Chua wrote:
> On Jan 7, 2008 7:00 AM, Yoshinori K. Okuji <[EMAIL PROTECTED]> wrote:
> > So I have worked with Vincent on the reiserfs support today. Now it's
> > somehow working, although I didn't test it very much.
>
> It's working fine here with reiserfs.

Great.

Thanks,
Okuji


___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel


Re: [non-finalised patch] reiserfs handling

2008-01-07 Thread Robert Millan
On Mon, Jan 07, 2008 at 12:00:02AM +0100, Yoshinori K. Okuji wrote:
> On Saturday 05 January 2008 11:41, Yoshinori K. Okuji wrote:
> > On Wednesday 02 January 2008 23:22, Robert Millan wrote:
> > > On Tue, Dec 25, 2007 at 12:51:35PM +0100, Yoshinori K. Okuji wrote:
> > > > On Sunday 14 October 2007 15:56, Vincent Pelletier wrote:
> > > > > Attached is my work on reiserfs handling.
> > > >
> > > > Has anybody tried his patch? If you have reiserfs, please test it and
> > > > let me know the result. I am willing to clean up his patch and commit
> > > > it.
> > >
> > > I installed a pristine Debian etch with reiserfs to test, and get
> > > "unaligned pointer" error followed by grub_abort().
> > >
> > > However, if it works for simple test cases I think it'd still be a good
> > > idea to clean it up and check it in.  This would encourage other people
> > > to debug and improve it.
> >
> > Thank you for your report. I will work on it.
> 
> So I have worked with Vincent on the reiserfs support today. Now it's somehow 
> working, although I didn't test it very much.

Great!  I see that you fixed the endianess issues.

I'll push this to Debian sid ASAP.

-- 
Robert Millan

 I know my rights; I want my phone call!
 What use is a phone call, if you are unable to speak?
(as seen on /.)


___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel


Re: [non-finalised patch] reiserfs handling

2008-01-06 Thread Jeff Chua
On Jan 7, 2008 7:00 AM, Yoshinori K. Okuji <[EMAIL PROTECTED]> wrote:

> So I have worked with Vincent on the reiserfs support today. Now it's somehow
> working, although I didn't test it very much.

It's working fine here with reiserfs.

Thanks,
Jeff.


___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel


Re: [non-finalised patch] reiserfs handling

2008-01-06 Thread Yoshinori K. Okuji
On Saturday 05 January 2008 11:41, Yoshinori K. Okuji wrote:
> On Wednesday 02 January 2008 23:22, Robert Millan wrote:
> > On Tue, Dec 25, 2007 at 12:51:35PM +0100, Yoshinori K. Okuji wrote:
> > > On Sunday 14 October 2007 15:56, Vincent Pelletier wrote:
> > > > Attached is my work on reiserfs handling.
> > >
> > > Has anybody tried his patch? If you have reiserfs, please test it and
> > > let me know the result. I am willing to clean up his patch and commit
> > > it.
> >
> > I installed a pristine Debian etch with reiserfs to test, and get
> > "unaligned pointer" error followed by grub_abort().
> >
> > However, if it works for simple test cases I think it'd still be a good
> > idea to clean it up and check it in.  This would encourage other people
> > to debug and improve it.
>
> Thank you for your report. I will work on it.

So I have worked with Vincent on the reiserfs support today. Now it's somehow 
working, although I didn't test it very much.

Okuji


___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel


Re: [non-finalised patch] reiserfs handling

2008-01-05 Thread Yoshinori K. Okuji
On Wednesday 02 January 2008 23:22, Robert Millan wrote:
> On Tue, Dec 25, 2007 at 12:51:35PM +0100, Yoshinori K. Okuji wrote:
> > On Sunday 14 October 2007 15:56, Vincent Pelletier wrote:
> > > Attached is my work on reiserfs handling.
> >
> > Has anybody tried his patch? If you have reiserfs, please test it and let
> > me know the result. I am willing to clean up his patch and commit it.
>
> I installed a pristine Debian etch with reiserfs to test, and get
> "unaligned pointer" error followed by grub_abort().
>
> However, if it works for simple test cases I think it'd still be a good
> idea to clean it up and check it in.  This would encourage other people to
> debug and improve it.

Thank you for your report. I will work on it.

Okuji


___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel


Re: [non-finalised patch] reiserfs handling

2008-01-02 Thread Robert Millan
On Tue, Dec 25, 2007 at 12:51:35PM +0100, Yoshinori K. Okuji wrote:
> On Sunday 14 October 2007 15:56, Vincent Pelletier wrote:
> > Attached is my work on reiserfs handling.
> 
> Has anybody tried his patch? If you have reiserfs, please test it and let me 
> know the result. I am willing to clean up his patch and commit it.

I installed a pristine Debian etch with reiserfs to test, and get "unaligned
pointer" error followed by grub_abort().

However, if it works for simple test cases I think it'd still be a good idea
to clean it up and check it in.  This would encourage other people to debug
and improve it.

-- 
Robert Millan

 I know my rights; I want my phone call!
 What use is a phone call, if you are unable to speak?
(as seen on /.)


___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel


Re: [non-finalised patch] reiserfs handling

2007-12-25 Thread Yoshinori K. Okuji
On Sunday 14 October 2007 15:56, Vincent Pelletier wrote:
> Attached is my work on reiserfs handling.

Has anybody tried his patch? If you have reiserfs, please test it and let me 
know the result. I am willing to clean up his patch and commit it.

Okuji


___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel


[non-finalised patch] reiserfs handling

2007-10-14 Thread Vincent Pelletier
Hi.

Attached is my work on reiserfs handling.

As I don't plan to work on it anytime soon, and as I was advised on IRC, I 
port it here, in case someone want to use it as a base.

It does not follow the coding style, some part looks quite ugly (big hex 
constants as bitmasks, grub_reiserfs_get_item and grub_reiserfe_iterate_dir 
functions), has old commented out code (grub_reiserfs_read) and some debug 
printfs commented out (grub_reiserfe_iterate_dir), conditionaly compiled 
(GRUB_REISERFS_DEBUG), or always available.

As such, it was good enough to read tens of megabyte big files on a reiserfs 
3.5 disk image on a PPC32 box. It handles symlinks as such, and showed no 
read errors as far as I could tell. It was only tested in grub-emu, and never 
on a live system.

To build grub2 with reiserfs module, add this file in the "fs" folder and add 
a reference to this file in conf/*.rmk files .

Sorry for not finishing that work.

-- 
Vincent Pelletier
/* reiserfs.c - ReiserFS versions up to 3.6 */
/*
 *  GRUB  --  GRand Unified Bootloader
 *  Copyright (C) 2003, 2004, 2005  Free Software Foundation, Inc.
 *
 *  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.
 */

/*
  TODO:
  implement journal handling (ram replay)
  implement symlinks support
  support items bigger than roughly (blocksize / 4) * blocksize
!! that goes for directories aswell, size in such case is metadata size.
  test tail packing & direct files
  validate partition label position
*/
#warning "TODO : journal, tail packing (?)"

// #define GRUB_REISERFS_KEYV2_BITFIELD
// #define GRUB_REISERFS_DEBUG
// #define GRUB_REISERFS_JOURNALING
// #define GRUB_HEXDUMP

#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 

#define MIN(a, b) (((a)<(b))?(a):(b))
#define MAX(a, b) (((a)>(b))?(a):(b))

#define REISERFS_SUPER_BLOCK_OFFSET 0x1
#define REISERFS_MAGIC_LEN 12
#define REISERFS_MAGIC_STRING "ReIsEr2Fs\0\0\0"
/* If the 3rd bit of an item state is set, then it's visible.  */
#define GRUB_REISERFS_VISIBLE_MASK ((grub_uint16_t)0x04)
#define REISERFS_MAX_LABEL_LENGTH 16
#define REISERFS_LABEL_OFFSET 0x64

#define S_IFLNK 0xA000

#ifndef GRUB_UTIL
static grub_dl_t my_mod;
#endif

enum grub_reiserfs_item_type
{
  GRUB_REISERFS_STAT,
  GRUB_REISERFS_DIRECTORY,
  GRUB_REISERFS_DIRECT,
  GRUB_REISERFS_INDIRECT,
  GRUB_REISERFS_ANY, /* Matches both _DIRECT and _INDIRECT when searching.  */
  GRUB_REISERFS_UNKNOWN
};

struct grub_reiserfs_superblock
{
  grub_uint32_t block_count;
  grub_uint32_t block_free_count;
  grub_uint32_t root_block;
  grub_uint32_t journal_block;
  grub_uint32_t journal_device;
  grub_uint32_t journal_original_size;
  grub_uint32_t journal_max_transaction_size;
  grub_uint32_t journal_block_count;
  grub_uint32_t journal_max_batch;
  grub_uint32_t journal_max_commit_age;
  grub_uint32_t journal_max_transaction_age;
  grub_uint16_t block_size;
  grub_uint16_t oid_max_size;
  grub_uint16_t oid_current_size;
  grub_uint16_t state;
  grub_uint8_t magic_string[REISERFS_MAGIC_LEN];
  grub_uint32_t function_hash_code;
  grub_uint16_t tree_height;
  grub_uint16_t bitmap_number;
  grub_uint16_t version;
  grub_uint16_t reserved;
  grub_uint32_t inode_generation;
} __attribute__ ((packed));

#ifdef GRUB_REISERFS_JOURNALING
#error "Journaling not yet supported."
struct grub_reiserfs_journal_header
{
  grub_uint32_t last_flush_uid;
  grub_uint32_t unflushed_offset;
  grub_uint32_t mount_id;
} __attribute__ ((packed));

struct grub_reiserfs_transaction_header
{
  grub_uint32_t id;
  grub_uint32_t len;
  grub_uint32_t mount_id;
  char *data;
  char checksum[12];
} __attribute__ ((packed));
#endif

struct grub_reiserfs_stat_item_v1
{
  grub_uint16_t mode;
  grub_uint16_t hardlink_count;
  grub_uint16_t uid;
  grub_uint16_t gid;
  grub_uint32_t size;
  grub_uint32_t atime;
  grub_uint32_t mtime;
  grub_uint32_t ctime;
  grub_uint32_t rdev;
  grub_uint32_t first_direct_byte;
} __attribute__ ((packed));

struct grub_reiserfs_stat_item_v2
{
  grub_uint16_t mode;
  grub_uint16_t reserved;
  grub_uint32_t hardlink_count;
  grub_uint64_t size;
  grub_uint32_t uid;
  grub_uint32_t gid;
  grub_uint32_t atime;
  grub_uint32_t mtime;
  grub_uint32_t ctime;
  grub_uint32_t blocks;
  grub_uint32_t first_direct_byte;
} __attribute__ ((packed));

struct grub_reiserfs_key
{
  grub_uint32_t