]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/patches/grub-0.97-reiser4-20050808.diff
Reiser4 Implementation abgeschlossen...
[people/pmueller/ipfire-2.x.git] / src / patches / grub-0.97-reiser4-20050808.diff
1 diff -upNr --exclude=Makefile.in --exclude='*.info' --exclude='*.m4' --exclude='*cache' --exclude=configure --exclude=.deps grub-0.97/config.h.in grub-0.97-1/config.h.in
2 --- grub-0.97/config.h.in 2005-05-08 06:48:19.000000000 +0400
3 +++ grub-0.97-1/config.h.in 2005-08-05 22:48:24.000000000 +0400
4 @@ -27,9 +27,16 @@
5 /* Define to 1 if you have the <inttypes.h> header file. */
6 #undef HAVE_INTTYPES_H
7
8 +/* Define to 1 if you have the `aal-minimal' library (-laal-minimal). */
9 +#undef HAVE_LIBAAL_MINIMAL
10 +
11 /* Define if you have a curses library */
12 #undef HAVE_LIBCURSES
13
14 +/* Define to 1 if you have the `reiser4-minimal' library (-lreiser4-minimal).
15 + */
16 +#undef HAVE_LIBREISER4_MINIMAL
17 +
18 /* Define to 1 if you have the <memory.h> header file. */
19 #undef HAVE_MEMORY_H
20
21 diff -upNr --exclude=Makefile.in --exclude='*.info' --exclude='*.m4' --exclude='*cache' --exclude=configure --exclude=.deps grub-0.97/configure.ac grub-0.97-1/configure.ac
22 --- grub-0.97/configure.ac 2005-05-08 06:36:03.000000000 +0400
23 +++ grub-0.97-1/configure.ac 2005-08-05 22:48:24.000000000 +0400
24 @@ -263,6 +263,77 @@ if test x"$enable_reiserfs" != xno; then
25 FSYS_CFLAGS="$FSYS_CFLAGS -DFSYS_REISERFS=1"
26 fi
27
28 +dnl Checking for reiser4
29 +REISER4_LIBS=""
30 +REISER4_CFLAGS=""
31 +
32 +OLD_LIBS=$LIBS
33 +OLD_CFLAGS=$CFLAGS
34 +LIBS=""
35 +CFLAGS=""
36 +
37 +AC_ARG_ENABLE(reiser4,
38 + [ --disable-reiser4 disable Reiser4 support in Stage 2])
39 +
40 +if test x"$enable_reiser4" != xno; then
41 + AC_CHECK_LIB(aal-minimal, aal_mem_init, ,
42 + AC_MSG_WARN(
43 +Reiser4 support is disabled due to inability find libaal-minimal with
44 +memory manager support turned on.)
45 + enable_reiser4=no
46 + )
47 +fi
48 +
49 +if test x"$enable_reiser4" != xno; then
50 + AC_CHECK_HEADER(aal/libaal.h, ,
51 + AC_MSG_WARN(
52 +Libaal header files are not found. Reiser4 support is disabled
53 + )
54 + enable_reiser4=no)
55 +fi
56 +
57 +if test x"$enable_reiser4" != xno; then
58 + AC_CHECK_LIB(reiser4-minimal, reiser4_fs_open, ,
59 + AC_MSG_WARN(
60 +Reiser4 support is disabled due to inability find valid libreiser4-minimal.)
61 + enable_reiser4=no,
62 + -laal-minimal
63 + )
64 +fi
65 +
66 +if test x"$enable_reiser4" != xno; then
67 + AC_CHECK_HEADER(reiser4/libreiser4.h, ,
68 + AC_MSG_WARN(
69 +Reiser4 header files are not found. Reiser4 support is disabled.
70 + )
71 + enable_reiser4=no)
72 +fi
73 +
74 +if test x"$enable_reiser4" != xno; then
75 + REISER4_CFLAGS="$REISER4_CFLAGS -DFSYS_REISER4=1"
76 + REISER4_LIBS=$LIBS
77 +fi
78 +
79 +if test x"$enable_reiser4" != xno; then
80 + AC_CHECK_LIB(reiser4-minimal, __sym40_plug_init,
81 + REISER4_CFLAGS="$REISER4_CFLAGS -DENABLE_SYMLINKS=1",
82 +AC_MSG_WARN(Reiser4 symlinks support is disabled.),
83 + -laal-minimal
84 + )
85 +fi
86 +
87 +LIBS=$OLD_LIBS
88 +CFLAGS=$OLD_CFLAGS
89 +
90 +if test x"$enable_reiser4" != xno; then
91 + enable_reiser4_support=yes
92 + FSYS_CFLAGS="$FSYS_CFLAGS $REISER4_CFLAGS"
93 +fi
94 +
95 +AC_SUBST(REISER4_LIBS)
96 +AC_SUBST(REISER4_CFLAGS)
97 +AM_CONDITIONAL(ENABLE_REISER4_SUPPORT, test x"$enable_reiser4" != xno)
98 +
99 AC_ARG_ENABLE(vstafs,
100 [ --disable-vstafs disable VSTa FS support in Stage 2])
101
102 diff -upNr --exclude=Makefile.in --exclude='*.info' --exclude='*.m4' --exclude='*cache' --exclude=configure --exclude=.deps grub-0.97/docs/grub.texi grub-0.97-1/docs/grub.texi
103 --- grub-0.97/docs/grub.texi 2005-05-08 06:59:59.000000000 +0400
104 +++ grub-0.97-1/docs/grub.texi 2005-08-05 22:48:24.000000000 +0400
105 @@ -283,7 +283,7 @@ devices, partitions, and files in a dire
106 Support multiple filesystem types transparently, plus a useful explicit
107 blocklist notation. The currently supported filesystem types are
108 @dfn{BSD FFS}, @dfn{DOS FAT16 and FAT32}, @dfn{Minix fs}, @dfn{Linux
109 -ext2fs}, @dfn{ReiserFS}, @dfn{JFS}, @dfn{XFS}, and @dfn{VSTa
110 +ext2fs}, @dfn{ReiserFS}, @dfn{ReiserFS}, @dfn{JFS}, @dfn{XFS}, and @dfn{VSTa
111 fs}. @xref{Filesystem}, for more information.
112
113 @item Support automatic decompression
114 @@ -1776,6 +1776,7 @@ itself. Usually, this is put in a filesy
115 @itemx jfs_stage1_5
116 @itemx minix_stage1_5
117 @itemx reiserfs_stage1_5
118 +@itemx reiser4_stage1_5
119 @itemx vstafs_stage1_5
120 @itemx xfs_stage1_5
121
122 diff -upNr --exclude=Makefile.in --exclude='*.info' --exclude='*.m4' --exclude='*cache' --exclude=configure --exclude=.deps grub-0.97/grub/Makefile.am grub-0.97-1/grub/Makefile.am
123 --- grub-0.97/grub/Makefile.am 2005-02-02 23:38:19.000000000 +0300
124 +++ grub-0.97-1/grub/Makefile.am 2005-08-05 22:48:24.000000000 +0400
125 @@ -16,4 +16,4 @@ AM_CPPFLAGS = -DGRUB_UTIL=1 -DFSYS_EXT2F
126 AM_CFLAGS = $(GRUB_CFLAGS)
127
128 grub_SOURCES = main.c asmstub.c
129 -grub_LDADD = ../stage2/libgrub.a ../lib/libcommon.a $(GRUB_LIBS)
130 +grub_LDADD = ../stage2/libgrub.a ../lib/libcommon.a $(GRUB_LIBS) $(REISER4_LIBS)
131 diff -upNr --exclude=Makefile.in --exclude='*.info' --exclude='*.m4' --exclude='*cache' --exclude=configure --exclude=.deps grub-0.97/INSTALL grub-0.97-1/INSTALL
132 --- grub-0.97/INSTALL 2005-05-08 06:43:15.000000000 +0400
133 +++ grub-0.97-1/INSTALL 2005-08-05 22:48:24.000000000 +0400
134 @@ -207,6 +207,9 @@ operates.
135 `--disable-reiserfs'
136 Omit the ReiserFS support in Stage 2.
137
138 +`--disable-reiser4'
139 + Omit the Reiser4 support in Stage 2.
140 +
141 `--disable-vstafs'
142 Omit the VSTa filesystem support in Stage 2.
143
144 diff -upNr --exclude=Makefile.in --exclude='*.info' --exclude='*.m4' --exclude='*cache' --exclude=configure --exclude=.deps grub-0.97/stage2/builtins.c grub-0.97-1/stage2/builtins.c
145 --- grub-0.97/stage2/builtins.c 2005-02-16 00:58:23.000000000 +0300
146 +++ grub-0.97-1/stage2/builtins.c 2005-08-05 22:48:24.000000000 +0400
147 @@ -3880,6 +3880,7 @@ setup_func (char *arg, int flags)
148 {"jfs", "/jfs_stage1_5"},
149 {"minix", "/minix_stage1_5"},
150 {"reiserfs", "/reiserfs_stage1_5"},
151 + {"reiser4", "/reiser4_stage1_5"},
152 {"vstafs", "/vstafs_stage1_5"},
153 {"xfs", "/xfs_stage1_5"}
154 };
155 diff -upNr --exclude=Makefile.in --exclude='*.info' --exclude='*.m4' --exclude='*cache' --exclude=configure --exclude=.deps grub-0.97/stage2/disk_io.c grub-0.97-1/stage2/disk_io.c
156 --- grub-0.97/stage2/disk_io.c 2004-05-23 20:35:24.000000000 +0400
157 +++ grub-0.97-1/stage2/disk_io.c 2005-08-05 22:48:24.000000000 +0400
158 @@ -63,6 +63,9 @@ struct fsys_entry fsys_table[NUM_FSYS +
159 # ifdef FSYS_REISERFS
160 {"reiserfs", reiserfs_mount, reiserfs_read, reiserfs_dir, 0, reiserfs_embed},
161 # endif
162 +# ifdef FSYS_REISER4
163 + {"reiser4", reiser4_mount, reiser4_read, reiser4_dir, 0, reiser4_embed},
164 +# endif
165 # ifdef FSYS_VSTAFS
166 {"vstafs", vstafs_mount, vstafs_read, vstafs_dir, 0, 0},
167 # endif
168 diff -upNr --exclude=Makefile.in --exclude='*.info' --exclude='*.m4' --exclude='*cache' --exclude=configure --exclude=.deps grub-0.97/stage2/filesys.h grub-0.97-1/stage2/filesys.h
169 --- grub-0.97/stage2/filesys.h 2004-05-14 23:36:43.000000000 +0400
170 +++ grub-0.97-1/stage2/filesys.h 2005-08-05 22:48:24.000000000 +0400
171 @@ -77,6 +77,16 @@ int reiserfs_embed (int *start_sector, i
172 #define FSYS_REISERFS_NUM 0
173 #endif
174
175 +#ifdef FSYS_REISER4
176 +#define FSYS_REISER4_NUM 1
177 +int reiser4_mount (void);
178 +int reiser4_read (char *buf, int len);
179 +int reiser4_dir (char *dirname);
180 +int reiser4_embed (int *start_sector, int needed_sectors);
181 +#else
182 +#define FSYS_REISER4_NUM 0
183 +#endif
184 +
185 #ifdef FSYS_VSTAFS
186 #define FSYS_VSTAFS_NUM 1
187 int vstafs_mount (void);
188 @@ -127,8 +137,8 @@ int iso9660_dir (char *dirname);
189 #ifndef NUM_FSYS
190 #define NUM_FSYS \
191 (FSYS_FFS_NUM + FSYS_FAT_NUM + FSYS_EXT2FS_NUM + FSYS_MINIX_NUM \
192 - + FSYS_REISERFS_NUM + FSYS_VSTAFS_NUM + FSYS_JFS_NUM + FSYS_XFS_NUM \
193 - + FSYS_TFTP_NUM + FSYS_ISO9660_NUM + FSYS_UFS2_NUM)
194 + + FSYS_REISERFS_NUM + FSYS_REISER4_NUM + FSYS_VSTAFS_NUM + FSYS_JFS_NUM \
195 + + FSYS_XFS_NUM + FSYS_TFTP_NUM + FSYS_ISO9660_NUM + FSYS_UFS2_NUM)
196 #endif
197
198 /* defines for the block filesystem info area */
199 diff -upNr --exclude=Makefile.in --exclude='*.info' --exclude='*.m4' --exclude='*cache' --exclude=configure --exclude=.deps grub-0.97/stage2/fsys_reiser4.c grub-0.97-1/stage2/fsys_reiser4.c
200 --- grub-0.97/stage2/fsys_reiser4.c 1970-01-01 03:00:00.000000000 +0300
201 +++ grub-0.97-1/stage2/fsys_reiser4.c 2005-08-05 22:48:24.000000000 +0400
202 @@ -0,0 +1,260 @@
203 +/*
204 + * fsys_reiser4.c -- reiser4 filesystem support.
205 + * Copyright (C) 2000, 2001 Free Software Foundation, Inc.
206 + *
207 + * GRUB -- GRand Unified Bootloader
208 + *
209 + * This program is free software; you can redistribute it and/or modify
210 + * it under the terms of the GNU General Public License as published by
211 + * the Free Software Foundation; either version 2 of the License, or
212 + * (at your option) any later version.
213 + *
214 + * This program is distributed in the hope that it will be useful,
215 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
216 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
217 + * GNU General Public License for more details.
218 + *
219 + * You should have received a copy of the GNU General Public License
220 + * along with this program; if not, write to the Free Software
221 + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
222 +*/
223 +
224 +#ifdef FSYS_REISER4
225 +#include "shared.h"
226 +#include "filesys.h"
227 +
228 +#define ENABLE_MINIMAL
229 +#include <reiser4/libreiser4.h>
230 +
231 +static reiser4_fs_t *fs = NULL;
232 +static aal_device_t *dev = NULL;
233 +static reiser4_object_t *object = NULL;
234 +
235 +/* Read callback of grub specific device. It uses devread() for reading passed
236 + @count of device blocks starting from @blk to passed @buff. */
237 +static errno_t grub_dev_read(aal_device_t *device,
238 + void *buff, blk_t blk,
239 + count_t count)
240 +{
241 + unsigned int size;
242 + unsigned int factor;
243 + unsigned int sector;
244 +
245 + /* Calculating actual sector and size in bytes to be read from
246 + device. */
247 + factor = device->blksize / SECTOR_SIZE;
248 + sector = (unsigned int)blk << aal_log2(factor);
249 + size = (unsigned int)count * (SECTOR_SIZE * factor);
250 +
251 + /* Reading from the current device */
252 + if (!devread(sector, 0, size, buff))
253 + return -EIO;
254 +
255 + return 0;
256 +}
257 +
258 +/* Length callback of grub device */
259 +static count_t grub_dev_len(aal_device_t *device) {
260 + unsigned int factor;
261 +
262 + /* Getting partition length in device blocks */
263 + factor = device->blksize / SECTOR_SIZE;
264 + return (part_length >> aal_log2(factor));
265 +}
266 +
267 +/*
268 + Initializing grub device abstraction instance. It will use devread and friends
269 + for providing needed functionality.
270 +*/
271 +struct aal_device_ops grub_dev_ops = {
272 + .read = grub_dev_read,
273 + .len = grub_dev_len
274 +};
275 +
276 +/* Initializes reiser4 */
277 +static int reiser4_init(void) {
278 + extern aal_hash_table_t *plugins;
279 +
280 + plugins = NULL;
281 +
282 + /* Initializing memory manager */
283 + aal_mem_init((void *)FSYS_BUF, FSYS_BUFLEN);
284 +
285 + /* Initializing device abstraction on current device GRUB uses. */
286 + if (!(dev = aal_device_open(&grub_dev_ops, NULL,
287 + SECTOR_SIZE, 0)))
288 + {
289 + return 0;
290 + }
291 +
292 + /* Initializing libreiser4 (plugins, etc) */
293 + return !libreiser4_init();
294 +}
295 +
296 +#define MEMORY_WATERMARK 8192
297 +
298 +/* Memory pressure detect function. */
299 +static int mpressure_detect(reiser4_tree_t *tree) {
300 + return (aal_mem_free() <= MEMORY_WATERMARK);
301 +}
302 +
303 +/* Reiser4 mount() routine */
304 +int reiser4_mount(void) {
305 +
306 + /* Initialize all reiser4 related stuff first */
307 + if (!reiser4_init())
308 + return 0;
309 +
310 + /* Open filesystem on @dev. */
311 + if (!(fs = reiser4_fs_open(dev)))
312 + return 0;
313 +
314 + fs->tree->mpc_func = mpressure_detect;
315 +
316 + object = NULL;
317 + return 1;
318 +}
319 +
320 +/* Reiser4 read() handler */
321 +int reiser4_read(char *buf, int len) {
322 + int64_t read;
323 +
324 + if (object == NULL)
325 + return 0;
326 +
327 + /* Seet at current position denoted by @filepos */
328 + if (objplug(object)->o.object_ops->seek) {
329 + plug_call(objplug(object)->o.object_ops,
330 + seek, object->ent, filepos);
331 + }
332 +
333 + /* Reading current file data starting from @filepos */
334 + disk_read_func = disk_read_hook;
335 + read = objplug(object)->o.object_ops->read ?
336 + plug_call(objplug(object)->o.object_ops, read,
337 + object->ent, buf, len) : -EINVAL;
338 + disk_read_func = NULL;
339 +
340 + if (read < 0) {
341 + errnum = ERR_FSYS_CORRUPT;
342 + return 0;
343 + }
344 +
345 + filepos += read;
346 + return read;
347 +}
348 +
349 +/* Reiser4 file open() routine */
350 +int reiser4_dir(char *dirname) {
351 + char *ch;
352 +
353 + if (fs == NULL)
354 + return 0;
355 +
356 + if (object != NULL) {
357 + plug_call(objplug(object)->o.object_ops,
358 + close, object->ent);
359 + aal_free(object);
360 + object = NULL;
361 + }
362 +
363 + /* Cutting out string after first space character */
364 + if ((ch = aal_strchr(dirname, ' ')))
365 + *ch = '\0';
366 +
367 + /* This function is also called for getting directory list for
368 + maintaining the bash-like completion. */
369 +#ifndef STAGE1_5
370 + if (print_possibilities) {
371 + char entry[256];
372 + entry_hint_t entry_hint;
373 +
374 + /* Getting last part of name (jsut after last '/') */
375 + if (*(dirname + aal_strlen(dirname) - 1) != '/') {
376 +
377 + if (!(ch = aal_strrchr(dirname, '/'))) {
378 + errnum = ERR_BAD_FILETYPE;
379 + return 0;
380 + }
381 +
382 + aal_strncpy(entry, ch + 1, sizeof(entry));
383 + *(ch + 1) = '\0';
384 + } else {
385 + aal_memset(entry, 0, sizeof(entry));
386 + }
387 +
388 + /* Open obejct by @dirname */
389 + if (!(object = reiser4_semantic_open(fs->tree, dirname,
390 + NULL, 1)))
391 + {
392 + errnum = ERR_FILE_NOT_FOUND;
393 + return 0;
394 + }
395 +
396 + /* Checking if it is a directory object */
397 + if (object->ent->opset.plug[OPSET_OBJ]->id.group != DIR_OBJECT)
398 + {
399 + /* If not, cutting out last '/' character */
400 + if ((ch = aal_strrchr(dirname, '/')))
401 + *ch = '\0';
402 +
403 + /* Close current object */
404 + plug_call(objplug(object)->o.object_ops,
405 + close, object->ent);
406 + aal_free(object);
407 + return 0;
408 + }
409 +
410 + /* Reading the opened directory to build the completion list. */
411 + if (objplug(object)->o.object_ops->readdir) {
412 + while (plug_call(objplug(object)->o.object_ops, readdir,
413 + object->ent, &entry_hint) > 0)
414 + {
415 + if (substring(entry, entry_hint.name) <= 0) {
416 + if (print_possibilities > 0)
417 + print_possibilities =
418 + -print_possibilities;
419 +
420 + print_a_completion(entry_hint.name);
421 + }
422 + }
423 + }
424 + } else {
425 +#endif
426 + /* This is the case when resier4_dir() is called for open the
427 + file @dirname, not for building completion list. */
428 + if (!(object = reiser4_semantic_open(fs->tree, dirname,
429 + NULL, 1)))
430 + {
431 + errnum = ERR_FILE_NOT_FOUND;
432 + return 0;
433 + }
434 +
435 + if (object->ent->opset.plug[OPSET_OBJ]->id.group != REG_OBJECT)
436 + {
437 + errnum = ERR_BAD_FILETYPE;
438 + return 0;
439 + }
440 +
441 + /* Initializing GRUB global variables @filepos and @filemax. */
442 + filepos = 0;
443 + filemax = reiser4_object_size(object);
444 +
445 + return 1;
446 +#ifndef STAGE1_5
447 + }
448 +
449 + return 1;
450 +#endif
451 +
452 + errnum = ERR_FILE_NOT_FOUND;
453 + return 0;
454 +}
455 +
456 +/* Returns how many sectors may be used for embeding reiser4_stage1_5 in teh
457 + case of installing GRUB to partition instead of MBR. */
458 +int reiser4_embed (int *start_sector, int needed_sectors) {
459 + *start_sector = 1;
460 + return needed_sectors <= ((REISER4_MASTER_OFFSET >> SECTOR_BITS) - 1);
461 +}
462 +#endif /* FSYS_REISER4 */
463 diff -upNr --exclude=Makefile.in --exclude='*.info' --exclude='*.m4' --exclude='*cache' --exclude=configure --exclude=.deps grub-0.97/stage2/Makefile.am grub-0.97-1/stage2/Makefile.am
464 --- grub-0.97/stage2/Makefile.am 2005-02-02 23:37:35.000000000 +0300
465 +++ grub-0.97-1/stage2/Makefile.am 2005-08-05 22:48:24.000000000 +0400
466 @@ -13,17 +13,25 @@ EXTRA_DIST = setjmp.S apm.S $(noinst_SCR
467 # For <stage1.h>.
468 INCLUDES = -I$(top_srcdir)/stage1
469
470 +if ENABLE_REISER4_SUPPORT
471 +REISER4_STAGE1_5 = reiser4_stage1_5
472 +REISER4_STAGE1_5_EXEC = reiser4_stage1_5.exec
473 +else
474 +REISER4_STAGE1_5 =
475 +REISER4_STAGE1_5_EXEC =
476 +endif
477 +
478 # The library for /sbin/grub.
479 noinst_LIBRARIES = libgrub.a
480 libgrub_a_SOURCES = boot.c builtins.c char_io.c cmdline.c common.c \
481 disk_io.c fsys_ext2fs.c fsys_fat.c fsys_ffs.c fsys_iso9660.c \
482 - fsys_jfs.c fsys_minix.c fsys_reiserfs.c fsys_ufs2.c \
483 + fsys_jfs.c fsys_minix.c fsys_reiserfs.c fsys_reiser4.c fsys_ufs2.c \
484 fsys_vstafs.c fsys_xfs.c gunzip.c md5.c serial.c stage2.c \
485 terminfo.c tparm.c
486 libgrub_a_CFLAGS = $(GRUB_CFLAGS) -I$(top_srcdir)/lib \
487 -DGRUB_UTIL=1 -DFSYS_EXT2FS=1 -DFSYS_FAT=1 -DFSYS_FFS=1 \
488 -DFSYS_ISO9660=1 -DFSYS_JFS=1 -DFSYS_MINIX=1 -DFSYS_REISERFS=1 \
489 - -DFSYS_UFS2=1 -DFSYS_VSTAFS=1 -DFSYS_XFS=1 \
490 + $(REISER4_CFLAGS) -DFSYS_UFS2=1 -DFSYS_VSTAFS=1 -DFSYS_XFS=1 \
491 -DUSE_MD5_PASSWORDS=1 -DSUPPORT_SERIAL=1 -DSUPPORT_HERCULES=1
492
493 # Stage 2 and Stage 1.5's.
494 @@ -34,24 +42,26 @@ EXTRA_PROGRAMS = nbloader.exec pxeloader
495 if DISKLESS_SUPPORT
496 pkglib_DATA = stage2 stage2_eltorito e2fs_stage1_5 fat_stage1_5 \
497 ffs_stage1_5 iso9660_stage1_5 jfs_stage1_5 minix_stage1_5 \
498 - reiserfs_stage1_5 ufs2_stage1_5 vstafs_stage1_5 xfs_stage1_5 \
499 - nbgrub pxegrub
500 + reiserfs_stage1_5 $(REISER4_STAGE1_5) ufs2_stage1_5 \
501 + vstafs_stage1_5 xfs_stage1_5 nbgrub pxegrub
502 noinst_DATA = pre_stage2 start start_eltorito nbloader pxeloader diskless
503 noinst_PROGRAMS = pre_stage2.exec start.exec start_eltorito.exec \
504 e2fs_stage1_5.exec fat_stage1_5.exec ffs_stage1_5.exec \
505 iso9660_stage1_5.exec jfs_stage1_5.exec minix_stage1_5.exec \
506 - reiserfs_stage1_5.exec ufs2_stage1_5.exec vstafs_stage1_5.exec \
507 - xfs_stage1_5.exec nbloader.exec pxeloader.exec diskless.exec
508 + reiserfs_stage1_5.exec $(REISER4_STAGE1_5_EXEC) ufs2_stage1_5.exec \
509 + vstafs_stage1_5.exec xfs_stage1_5.exec nbloader.exec pxeloader.exec \
510 + diskless.exec
511 else
512 pkglib_DATA = stage2 stage2_eltorito e2fs_stage1_5 fat_stage1_5 \
513 ffs_stage1_5 iso9660_stage1_5 jfs_stage1_5 minix_stage1_5 \
514 - reiserfs_stage1_5 ufs2_stage1_5 vstafs_stage1_5 xfs_stage1_5
515 + reiserfs_stage1_5 $(REISER4_STAGE1_5) ufs2_stage1_5 \
516 + vstafs_stage1_5 xfs_stage1_5
517 noinst_DATA = pre_stage2 start start_eltorito
518 noinst_PROGRAMS = pre_stage2.exec start.exec start_eltorito.exec \
519 e2fs_stage1_5.exec fat_stage1_5.exec ffs_stage1_5.exec \
520 iso9660_stage1_5.exec jfs_stage1_5.exec minix_stage1_5.exec \
521 - reiserfs_stage1_5.exec ufs2_stage1_5.exec vstafs_stage1_5.exec \
522 - xfs_stage1_5.exec
523 + reiserfs_stage1_5.exec $(REISER4_STAGE1_5_EXEC) ufs2_stage1_5.exec \
524 + vstafs_stage1_5.exec xfs_stage1_5.exec
525 endif
526 MOSTLYCLEANFILES = $(noinst_PROGRAMS)
527
528 @@ -79,7 +89,7 @@ else
529 HERCULES_FLAGS =
530 endif
531
532 -STAGE2_COMPILE = $(STAGE2_CFLAGS) -fno-builtin -nostdinc \
533 +STAGE2_COMPILE = $(STAGE2_CFLAGS) -fno-builtin \
534 $(NETBOOT_FLAGS) $(SERIAL_FLAGS) $(HERCULES_FLAGS)
535
536 STAGE1_5_LINK = -nostdlib -Wl,-N -Wl,-Ttext -Wl,2000
537 @@ -89,14 +99,17 @@ STAGE1_5_COMPILE = $(STAGE2_COMPILE) -DN
538 pre_stage2_exec_SOURCES = asm.S bios.c boot.c builtins.c char_io.c \
539 cmdline.c common.c console.c disk_io.c fsys_ext2fs.c \
540 fsys_fat.c fsys_ffs.c fsys_iso9660.c fsys_jfs.c fsys_minix.c \
541 - fsys_reiserfs.c fsys_ufs2.c fsys_vstafs.c fsys_xfs.c gunzip.c \
542 - hercules.c md5.c serial.c smp-imps.c stage2.c terminfo.c tparm.c
543 + fsys_reiserfs.c fsys_reiser4.c fsys_ufs2.c fsys_vstafs.c \
544 + fsys_xfs.c gunzip.c hercules.c md5.c serial.c smp-imps.c \
545 + stage2.c terminfo.c tparm.c
546 pre_stage2_exec_CFLAGS = $(STAGE2_COMPILE) $(FSYS_CFLAGS)
547 pre_stage2_exec_CCASFLAGS = $(STAGE2_COMPILE) $(FSYS_CFLAGS)
548 pre_stage2_exec_LDFLAGS = $(PRE_STAGE2_LINK)
549
550 if NETBOOT_SUPPORT
551 -pre_stage2_exec_LDADD = ../netboot/libdrivers.a
552 +pre_stage2_exec_LDADD = ../netboot/libdrivers.a $(REISER4_LIBS)
553 +else
554 +pre_stage2_exec_LDADD = $(REISER4_LIBS)
555 endif
556
557 if DISKLESS_SUPPORT
558 @@ -190,6 +203,16 @@ reiserfs_stage1_5_exec_CCASFLAGS = $(STA
559 -DNO_BLOCK_FILES=1
560 reiserfs_stage1_5_exec_LDFLAGS = $(STAGE1_5_LINK)
561
562 +# For reiser4_stage1_5 target.
563 +reiser4_stage1_5_exec_SOURCES = start.S asm.S common.c char_io.c \
564 + disk_io.c stage1_5.c fsys_reiser4.c bios.c
565 +reiser4_stage1_5_exec_CFLAGS = $(STAGE1_5_COMPILE) $(REISER4_CFLAGS) \
566 + -DNO_BLOCK_FILES=1
567 +reiser4_stage1_5_exec_CCASFLAGS = $(STAGE1_5_COMPILE) $(REISER4_CFLAGS) \
568 + -DNO_BLOCK_FILES=1
569 +reiser4_stage1_5_exec_LDFLAGS = $(STAGE1_5_LINK)
570 +reiser4_stage1_5_exec_LDADD = $(REISER4_LIBS)
571 +
572 # For vstafs_stage1_5 target.
573 vstafs_stage1_5_exec_SOURCES = start.S asm.S common.c char_io.c \
574 disk_io.c stage1_5.c fsys_vstafs.c bios.c
575 diff -upNr --exclude=Makefile.in --exclude='*.info' --exclude='*.m4' --exclude='*cache' --exclude=configure --exclude=.deps grub-0.97/stage2/shared.h grub-0.97-1/stage2/shared.h
576 --- grub-0.97/stage2/shared.h 2004-06-19 20:40:09.000000000 +0400
577 +++ grub-0.97-1/stage2/shared.h 2005-08-05 22:48:24.000000000 +0400
578 @@ -207,11 +207,12 @@ extern char *grub_scratch_mem;
579 #define STAGE2_ID_FAT_STAGE1_5 3
580 #define STAGE2_ID_MINIX_STAGE1_5 4
581 #define STAGE2_ID_REISERFS_STAGE1_5 5
582 -#define STAGE2_ID_VSTAFS_STAGE1_5 6
583 -#define STAGE2_ID_JFS_STAGE1_5 7
584 -#define STAGE2_ID_XFS_STAGE1_5 8
585 -#define STAGE2_ID_ISO9660_STAGE1_5 9
586 -#define STAGE2_ID_UFS2_STAGE1_5 10
587 +#define STAGE2_ID_REISER4_STAGE1_5 6
588 +#define STAGE2_ID_VSTAFS_STAGE1_5 7
589 +#define STAGE2_ID_JFS_STAGE1_5 8
590 +#define STAGE2_ID_XFS_STAGE1_5 9
591 +#define STAGE2_ID_ISO9660_STAGE1_5 10
592 +#define STAGE2_ID_UFS2_STAGE1_5 11
593
594 #ifndef STAGE1_5
595 # define STAGE2_ID STAGE2_ID_STAGE2
596 @@ -226,6 +227,8 @@ extern char *grub_scratch_mem;
597 # define STAGE2_ID STAGE2_ID_MINIX_STAGE1_5
598 # elif defined(FSYS_REISERFS)
599 # define STAGE2_ID STAGE2_ID_REISERFS_STAGE1_5
600 +# elif defined(FSYS_REISER4)
601 +# define STAGE2_ID STAGE2_ID_REISER4_STAGE1_5
602 # elif defined(FSYS_VSTAFS)
603 # define STAGE2_ID STAGE2_ID_VSTAFS_STAGE1_5
604 # elif defined(FSYS_JFS)