Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 69590
Collapse All | Expand All

(-)grub-0.96.orig/INSTALL (+3 lines)
Lines 207-212 Link Here
207
`--disable-reiserfs'
207
`--disable-reiserfs'
208
     Omit the ReiserFS support in Stage 2.
208
     Omit the ReiserFS support in Stage 2.
209
209
210
`--disable-reiser4'
211
     Omit the Reiser4 support in Stage 2.
212
210
`--disable-vstafs'
213
`--disable-vstafs'
211
     Omit the VSTa filesystem support in Stage 2.
214
     Omit the VSTa filesystem support in Stage 2.
212
215
(-)grub-0.96.orig/config.h.in (+7 lines)
Lines 27-35 Link Here
27
/* Define to 1 if you have the <inttypes.h> header file. */
27
/* Define to 1 if you have the <inttypes.h> header file. */
28
#undef HAVE_INTTYPES_H
28
#undef HAVE_INTTYPES_H
29
29
30
/* Define to 1 if you have the `aal-minimal' library (-laal-minimal). */
31
#undef HAVE_LIBAAL_MINIMAL
32
30
/* Define if you have a curses library */
33
/* Define if you have a curses library */
31
#undef HAVE_LIBCURSES
34
#undef HAVE_LIBCURSES
32
35
36
/* Define to 1 if you have the `reiser4-minimal' library (-lreiser4-minimal).
37
   */
38
#undef HAVE_LIBREISER4_MINIMAL
39
33
/* Define to 1 if you have the <memory.h> header file. */
40
/* Define to 1 if you have the <memory.h> header file. */
34
#undef HAVE_MEMORY_H
41
#undef HAVE_MEMORY_H
35
42
(-)grub-0.96.orig/configure.ac (+71 lines)
Lines 263-268 Link Here
263
  FSYS_CFLAGS="$FSYS_CFLAGS -DFSYS_REISERFS=1"
263
  FSYS_CFLAGS="$FSYS_CFLAGS -DFSYS_REISERFS=1"
264
fi
264
fi
265
265
266
dnl Checking for reiser4
267
REISER4_LIBS=""
268
REISER4_CFLAGS=""
269
270
OLD_LIBS=$LIBS
271
OLD_CFLAGS=$CFLAGS
272
LIBS=""
273
CFLAGS=""
274
275
AC_ARG_ENABLE(reiser4,
276
  [  --disable-reiser4       disable Reiser4 support in Stage 2])
277
278
if test x"$enable_reiser4" != xno; then
279
  AC_CHECK_LIB(aal-minimal, aal_mem_init, , 
280
    AC_MSG_WARN(
281
Reiser4 support is disabled due to inability find libaal-minimal with 
282
memory manager support turned on.)
283
    enable_reiser4=no
284
  )
285
fi
286
  
287
if test x"$enable_reiser4" != xno; then
288
  AC_CHECK_HEADER(aal/libaal.h, ,
289
  AC_MSG_WARN(
290
Libaal header files are not found. Reiser4 support is disabled
291
  )
292
  enable_reiser4=no)
293
fi
294
  
295
if test x"$enable_reiser4" != xno; then
296
  AC_CHECK_LIB(reiser4-minimal, reiser4_fs_open, , 
297
  AC_MSG_WARN(
298
Reiser4 support is disabled due to inability find valid libreiser4-minimal.)
299
    enable_reiser4=no, 
300
    -laal-minimal
301
  )
302
fi
303
304
if test x"$enable_reiser4" != xno; then
305
  AC_CHECK_HEADER(reiser4/libreiser4.h, ,
306
  AC_MSG_WARN(
307
Reiser4 header files are not found. Reiser4 support is disabled.
308
  )
309
  enable_reiser4=no)
310
fi
311
312
if test x"$enable_reiser4" != xno; then
313
  REISER4_CFLAGS="$REISER4_CFLAGS -DFSYS_REISER4=1"
314
  REISER4_LIBS=$LIBS
315
fi
316
317
if test x"$enable_reiser4" != xno; then
318
  AC_CHECK_LIB(reiser4-minimal, __sym40_plug_init, 
319
    REISER4_CFLAGS="$REISER4_CFLAGS -DENABLE_SYMLINKS=1",
320
AC_MSG_WARN(Reiser4 symlinks support is disabled.), 
321
    -laal-minimal
322
  )
323
fi
324
325
LIBS=$OLD_LIBS
326
CFLAGS=$OLD_CFLAGS
327
328
if test x"$enable_reiser4" != xno; then
329
  enable_reiser4_support=yes
330
  FSYS_CFLAGS="$FSYS_CFLAGS $REISER4_CFLAGS"
331
fi
332
333
AC_SUBST(REISER4_LIBS)
334
AC_SUBST(REISER4_CFLAGS)
335
AM_CONDITIONAL(ENABLE_REISER4_SUPPORT, test x"$enable_reiser4" != xno)
336
266
AC_ARG_ENABLE(vstafs,
337
AC_ARG_ENABLE(vstafs,
267
  [  --disable-vstafs        disable VSTa FS support in Stage 2])
338
  [  --disable-vstafs        disable VSTa FS support in Stage 2])
268
339
(-)grub-0.96.orig/docs/grub.texi (-1 / +2 lines)
Lines 283-289 Link Here
283
Support multiple filesystem types transparently, plus a useful explicit
283
Support multiple filesystem types transparently, plus a useful explicit
284
blocklist notation. The currently supported filesystem types are
284
blocklist notation. The currently supported filesystem types are
285
@dfn{BSD FFS}, @dfn{DOS FAT16 and FAT32}, @dfn{Minix fs}, @dfn{Linux
285
@dfn{BSD FFS}, @dfn{DOS FAT16 and FAT32}, @dfn{Minix fs}, @dfn{Linux
286
ext2fs}, @dfn{ReiserFS}, @dfn{JFS}, @dfn{XFS}, and @dfn{VSTa
286
ext2fs}, @dfn{ReiserFS}, @dfn{ReiserFS}, @dfn{JFS}, @dfn{XFS}, and @dfn{VSTa
287
fs}. @xref{Filesystem}, for more information.
287
fs}. @xref{Filesystem}, for more information.
288
288
289
@item Support automatic decompression
289
@item Support automatic decompression
Lines 1776-1781 Link Here
1776
@itemx jfs_stage1_5
1776
@itemx jfs_stage1_5
1777
@itemx minix_stage1_5
1777
@itemx minix_stage1_5
1778
@itemx reiserfs_stage1_5
1778
@itemx reiserfs_stage1_5
1779
@itemx reiser4_stage1_5
1779
@itemx vstafs_stage1_5
1780
@itemx vstafs_stage1_5
1780
@itemx xfs_stage1_5
1781
@itemx xfs_stage1_5
1781
1782
(-)grub-0.96.orig/grub/Makefile.am (-1 / +1 lines)
Lines 16-19 Link Here
16
AM_CFLAGS = $(GRUB_CFLAGS)
16
AM_CFLAGS = $(GRUB_CFLAGS)
17
17
18
grub_SOURCES = main.c asmstub.c
18
grub_SOURCES = main.c asmstub.c
19
grub_LDADD = ../stage2/libgrub.a  ../lib/libcommon.a $(GRUB_LIBS)
19
grub_LDADD = ../stage2/libgrub.a  ../lib/libcommon.a $(GRUB_LIBS) $(REISER4_LIBS)
(-)grub-0.96.orig/grub/Makefile.am.orig (+19 lines)
Line 0 Link Here
1
sbin_PROGRAMS = grub
2
3
if SERIAL_SPEED_SIMULATION
4
SERIAL_FLAGS = -DSUPPORT_SERIAL=1 -DSIMULATE_SLOWNESS_OF_SERIAL=1
5
else
6
SERIAL_FLAGS = -DSUPPORT_SERIAL=1 
7
endif
8
9
AM_CPPFLAGS = -DGRUB_UTIL=1 -DFSYS_EXT2FS=1 -DFSYS_FAT=1 -DFSYS_FFS=1 \
10
	-DFSYS_ISO9660=1 -DFSYS_JFS=1 -DFSYS_MINIX=1 -DFSYS_REISERFS=1 \
11
	-DFSYS_UFS2=1 -DFSYS_VSTAFS=1 -DFSYS_XFS=1 \
12
	-DUSE_MD5_PASSWORDS=1 -DSUPPORT_HERCULES=1 \
13
	$(SERIAL_FLAGS) -I$(top_srcdir)/stage2 \
14
	-I$(top_srcdir)/stage1 -I$(top_srcdir)/lib
15
16
AM_CFLAGS = $(GRUB_CFLAGS)
17
18
grub_SOURCES = main.c asmstub.c
19
grub_LDADD = ../stage2/libgrub.a  ../lib/libcommon.a $(GRUB_LIBS)
(-)grub-0.96.orig/stage2/Makefile.am (-14 / +36 lines)
Lines 13-29 Link Here
13
# For <stage1.h>.
13
# For <stage1.h>.
14
INCLUDES = -I$(top_srcdir)/stage1
14
INCLUDES = -I$(top_srcdir)/stage1
15
15
16
if ENABLE_REISER4_SUPPORT
17
REISER4_STAGE1_5 = reiser4_stage1_5
18
REISER4_STAGE1_5_EXEC = reiser4_stage1_5.exec
19
else
20
REISER4_STAGE1_5 =
21
REISER4_STAGE1_5_EXEC =
22
endif
23
16
# The library for /sbin/grub.
24
# The library for /sbin/grub.
17
noinst_LIBRARIES = libgrub.a
25
noinst_LIBRARIES = libgrub.a
18
libgrub_a_SOURCES = boot.c builtins.c char_io.c cmdline.c common.c \
26
libgrub_a_SOURCES = boot.c builtins.c char_io.c cmdline.c common.c \
19
	disk_io.c fsys_ext2fs.c fsys_fat.c fsys_ffs.c fsys_iso9660.c \
27
	disk_io.c fsys_ext2fs.c fsys_fat.c fsys_ffs.c fsys_iso9660.c \
20
	fsys_jfs.c fsys_minix.c fsys_reiserfs.c fsys_ufs2.c \
28
	fsys_jfs.c fsys_minix.c fsys_reiserfs.c fsys_reiser4.c fsys_ufs2.c \
21
	fsys_vstafs.c fsys_xfs.c gunzip.c md5.c serial.c stage2.c \
29
	fsys_vstafs.c fsys_xfs.c gunzip.c md5.c serial.c stage2.c \
22
	terminfo.c tparm.c graphics.c
30
	terminfo.c tparm.c graphics.c
23
libgrub_a_CFLAGS = $(GRUB_CFLAGS) -I$(top_srcdir)/lib \
31
libgrub_a_CFLAGS = $(GRUB_CFLAGS) -I$(top_srcdir)/lib \
24
	-DGRUB_UTIL=1 -DFSYS_EXT2FS=1 -DFSYS_FAT=1 -DFSYS_FFS=1 \
32
	-DGRUB_UTIL=1 -DFSYS_EXT2FS=1 -DFSYS_FAT=1 -DFSYS_FFS=1 \
25
	-DFSYS_ISO9660=1 -DFSYS_JFS=1 -DFSYS_MINIX=1 -DFSYS_REISERFS=1 \
33
	-DFSYS_ISO9660=1 -DFSYS_JFS=1 -DFSYS_MINIX=1 -DFSYS_REISERFS=1 \
26
	-DFSYS_UFS2=1 -DFSYS_VSTAFS=1 -DFSYS_XFS=1 \
34
	$(REISER4_CFLAGS) -DFSYS_UFS2=1 -DFSYS_VSTAFS=1 -DFSYS_XFS=1 \
27
	-DUSE_MD5_PASSWORDS=1 -DSUPPORT_SERIAL=1 -DSUPPORT_HERCULES=1
35
	-DUSE_MD5_PASSWORDS=1 -DSUPPORT_SERIAL=1 -DSUPPORT_HERCULES=1
28
36
29
# Stage 2 and Stage 1.5's.
37
# Stage 2 and Stage 1.5's.
Lines 34-57 Link Here
34
if DISKLESS_SUPPORT
42
if DISKLESS_SUPPORT
35
pkglib_DATA = stage2 stage2_eltorito e2fs_stage1_5 fat_stage1_5 \
43
pkglib_DATA = stage2 stage2_eltorito e2fs_stage1_5 fat_stage1_5 \
36
	ffs_stage1_5 iso9660_stage1_5 jfs_stage1_5 minix_stage1_5 \
44
	ffs_stage1_5 iso9660_stage1_5 jfs_stage1_5 minix_stage1_5 \
37
	reiserfs_stage1_5 ufs2_stage1_5 vstafs_stage1_5 xfs_stage1_5 \
45
	reiserfs_stage1_5 $(REISER4_STAGE1_5) ufs2_stage1_5 \
38
	nbgrub pxegrub
46
	vstafs_stage1_5 xfs_stage1_5 nbgrub pxegrub
39
noinst_DATA = pre_stage2 start start_eltorito nbloader pxeloader diskless
47
noinst_DATA = pre_stage2 start start_eltorito nbloader pxeloader diskless
40
noinst_PROGRAMS = pre_stage2.exec start.exec start_eltorito.exec \
48
noinst_PROGRAMS = pre_stage2.exec start.exec start_eltorito.exec \
41
	e2fs_stage1_5.exec fat_stage1_5.exec ffs_stage1_5.exec \
49
	e2fs_stage1_5.exec fat_stage1_5.exec ffs_stage1_5.exec \
42
	iso9660_stage1_5.exec jfs_stage1_5.exec minix_stage1_5.exec \
50
	iso9660_stage1_5.exec jfs_stage1_5.exec minix_stage1_5.exec \
43
	reiserfs_stage1_5.exec ufs2_stage1_5.exec vstafs_stage1_5.exec \
51
	reiserfs_stage1_5.exec $(REISER4_STAGE1_5_EXEC) ufs2_stage1_5.exec \
44
	xfs_stage1_5.exec nbloader.exec pxeloader.exec diskless.exec
52
	vstafs_stage1_5.exec xfs_stage1_5.exec nbloader.exec pxeloader.exec \
53
	diskless.exec
45
else
54
else
46
pkglib_DATA = stage2 stage2_eltorito e2fs_stage1_5 fat_stage1_5 \
55
pkglib_DATA = stage2 stage2_eltorito e2fs_stage1_5 fat_stage1_5 \
47
	ffs_stage1_5 iso9660_stage1_5 jfs_stage1_5 minix_stage1_5 \
56
	ffs_stage1_5 iso9660_stage1_5 jfs_stage1_5 minix_stage1_5 \
48
	reiserfs_stage1_5 ufs2_stage1_5 vstafs_stage1_5 xfs_stage1_5
57
	reiserfs_stage1_5 $(REISER4_STAGE1_5) ufs2_stage1_5 \
58
	vstafs_stage1_5 xfs_stage1_5
49
noinst_DATA = pre_stage2 start start_eltorito
59
noinst_DATA = pre_stage2 start start_eltorito
50
noinst_PROGRAMS = pre_stage2.exec start.exec start_eltorito.exec \
60
noinst_PROGRAMS = pre_stage2.exec start.exec start_eltorito.exec \
51
	e2fs_stage1_5.exec fat_stage1_5.exec ffs_stage1_5.exec \
61
	e2fs_stage1_5.exec fat_stage1_5.exec ffs_stage1_5.exec \
52
	iso9660_stage1_5.exec jfs_stage1_5.exec minix_stage1_5.exec \
62
	iso9660_stage1_5.exec jfs_stage1_5.exec minix_stage1_5.exec \
53
	reiserfs_stage1_5.exec ufs2_stage1_5.exec vstafs_stage1_5.exec \
63
	reiserfs_stage1_5.exec $(REISER4_STAGE1_5_EXEC) ufs2_stage1_5.exec \
54
	xfs_stage1_5.exec
64
	vstafs_stage1_5.exec xfs_stage1_5.exec
55
endif
65
endif
56
MOSTLYCLEANFILES = $(noinst_PROGRAMS)
66
MOSTLYCLEANFILES = $(noinst_PROGRAMS)
57
67
Lines 85-91 Link Here
85
GRAPHICS_FLAGS =
95
GRAPHICS_FLAGS =
86
endif
96
endif
87
97
88
STAGE2_COMPILE = $(STAGE2_CFLAGS) -fno-builtin -nostdinc \
98
STAGE2_COMPILE = $(STAGE2_CFLAGS) -fno-builtin \
89
	$(NETBOOT_FLAGS) $(SERIAL_FLAGS) $(HERCULES_FLAGS) $(GRAPHICS_FLAGS)
99
	$(NETBOOT_FLAGS) $(SERIAL_FLAGS) $(HERCULES_FLAGS) $(GRAPHICS_FLAGS)
90
100
91
STAGE1_5_LINK = -nostdlib -Wl,-N -Wl,-Ttext -Wl,2000
101
STAGE1_5_LINK = -nostdlib -Wl,-N -Wl,-Ttext -Wl,2000
Lines 95-109 Link Here
95
pre_stage2_exec_SOURCES = asm.S bios.c boot.c builtins.c char_io.c \
105
pre_stage2_exec_SOURCES = asm.S bios.c boot.c builtins.c char_io.c \
96
	cmdline.c common.c console.c disk_io.c fsys_ext2fs.c \
106
	cmdline.c common.c console.c disk_io.c fsys_ext2fs.c \
97
	fsys_fat.c fsys_ffs.c fsys_iso9660.c fsys_jfs.c fsys_minix.c \
107
	fsys_fat.c fsys_ffs.c fsys_iso9660.c fsys_jfs.c fsys_minix.c \
98
	fsys_reiserfs.c fsys_ufs2.c fsys_vstafs.c fsys_xfs.c gunzip.c \
108
	fsys_reiserfs.c fsys_reiser4.c fsys_ufs2.c fsys_vstafs.c \
99
	hercules.c md5.c serial.c smp-imps.c stage2.c terminfo.c tparm.c \
109
	fsys_xfs.c gunzip.c hercules.c md5.c serial.c smp-imps.c \
100
	graphics.c
110
	stage2.c terminfo.c tparm.c graphics.c
101
pre_stage2_exec_CFLAGS = $(STAGE2_COMPILE) $(FSYS_CFLAGS)
111
pre_stage2_exec_CFLAGS = $(STAGE2_COMPILE) $(FSYS_CFLAGS)
102
pre_stage2_exec_CCASFLAGS = $(STAGE2_COMPILE) $(FSYS_CFLAGS)
112
pre_stage2_exec_CCASFLAGS = $(STAGE2_COMPILE) $(FSYS_CFLAGS)
103
pre_stage2_exec_LDFLAGS = $(PRE_STAGE2_LINK)
113
pre_stage2_exec_LDFLAGS = $(PRE_STAGE2_LINK)
104
114
105
if NETBOOT_SUPPORT
115
if NETBOOT_SUPPORT
106
pre_stage2_exec_LDADD = ../netboot/libdrivers.a
116
pre_stage2_exec_LDADD = ../netboot/libdrivers.a $(REISER4_LIBS)
117
else
118
pre_stage2_exec_LDADD = $(REISER4_LIBS)
107
endif
119
endif
108
120
109
if DISKLESS_SUPPORT
121
if DISKLESS_SUPPORT
Lines 197-202 Link Here
197
	-DNO_BLOCK_FILES=1
209
	-DNO_BLOCK_FILES=1
198
reiserfs_stage1_5_exec_LDFLAGS = $(STAGE1_5_LINK)
210
reiserfs_stage1_5_exec_LDFLAGS = $(STAGE1_5_LINK)
199
211
212
# For reiser4_stage1_5 target.
213
reiser4_stage1_5_exec_SOURCES = start.S asm.S common.c char_io.c \
214
	disk_io.c stage1_5.c fsys_reiser4.c bios.c
215
reiser4_stage1_5_exec_CFLAGS = $(STAGE1_5_COMPILE) $(REISER4_CFLAGS) \
216
	-DNO_BLOCK_FILES=1
217
reiser4_stage1_5_exec_CCASFLAGS = $(STAGE1_5_COMPILE) $(REISER4_CFLAGS) \
218
	-DNO_BLOCK_FILES=1
219
reiser4_stage1_5_exec_LDFLAGS = $(STAGE1_5_LINK)
220
reiser4_stage1_5_exec_LDADD = $(REISER4_LIBS)
221
200
# For vstafs_stage1_5 target.
222
# For vstafs_stage1_5 target.
201
vstafs_stage1_5_exec_SOURCES = start.S asm.S common.c char_io.c \
223
vstafs_stage1_5_exec_SOURCES = start.S asm.S common.c char_io.c \
202
	disk_io.c stage1_5.c fsys_vstafs.c bios.c
224
	disk_io.c stage1_5.c fsys_vstafs.c bios.c
(-)grub-0.96.orig/stage2/Makefile.am.orig (+279 lines)
Line 0 Link Here
1
# For test target.
2
TESTS = size_test
3
noinst_SCRIPTS = $(TESTS)
4
5
# For dist target.
6
noinst_HEADERS = apic.h defs.h dir.h disk_inode.h disk_inode_ffs.h \
7
        fat.h filesys.h freebsd.h fs.h hercules.h i386-elf.h \
8
	imgact_aout.h iso9660.h jfs.h mb_header.h mb_info.h md5.h \
9
	nbi.h pc_slice.h serial.h shared.h smp-imps.h term.h \
10
	terminfo.h tparm.h nbi.h ufs2.h vstafs.h xfs.h graphics.h
11
EXTRA_DIST = setjmp.S apm.S $(noinst_SCRIPTS)
12
13
# For <stage1.h>.
14
INCLUDES = -I$(top_srcdir)/stage1
15
16
# The library for /sbin/grub.
17
noinst_LIBRARIES = libgrub.a
18
libgrub_a_SOURCES = boot.c builtins.c char_io.c cmdline.c common.c \
19
	disk_io.c fsys_ext2fs.c fsys_fat.c fsys_ffs.c fsys_iso9660.c \
20
	fsys_jfs.c fsys_minix.c fsys_reiserfs.c fsys_ufs2.c \
21
	fsys_vstafs.c fsys_xfs.c gunzip.c md5.c serial.c stage2.c \
22
	terminfo.c tparm.c graphics.c
23
libgrub_a_CFLAGS = $(GRUB_CFLAGS) -I$(top_srcdir)/lib \
24
	-DGRUB_UTIL=1 -DFSYS_EXT2FS=1 -DFSYS_FAT=1 -DFSYS_FFS=1 \
25
	-DFSYS_ISO9660=1 -DFSYS_JFS=1 -DFSYS_MINIX=1 -DFSYS_REISERFS=1 \
26
	-DFSYS_UFS2=1 -DFSYS_VSTAFS=1 -DFSYS_XFS=1 \
27
	-DUSE_MD5_PASSWORDS=1 -DSUPPORT_SERIAL=1 -DSUPPORT_HERCULES=1
28
29
# Stage 2 and Stage 1.5's.
30
pkglibdir = $(libdir)/$(PACKAGE)/$(host_cpu)-$(host_vendor)
31
32
EXTRA_PROGRAMS = nbloader.exec pxeloader.exec diskless.exec
33
34
if DISKLESS_SUPPORT
35
pkglib_DATA = stage2 stage2_eltorito e2fs_stage1_5 fat_stage1_5 \
36
	ffs_stage1_5 iso9660_stage1_5 jfs_stage1_5 minix_stage1_5 \
37
	reiserfs_stage1_5 ufs2_stage1_5 vstafs_stage1_5 xfs_stage1_5 \
38
	nbgrub pxegrub
39
noinst_DATA = pre_stage2 start start_eltorito nbloader pxeloader diskless
40
noinst_PROGRAMS = pre_stage2.exec start.exec start_eltorito.exec \
41
	e2fs_stage1_5.exec fat_stage1_5.exec ffs_stage1_5.exec \
42
	iso9660_stage1_5.exec jfs_stage1_5.exec minix_stage1_5.exec \
43
	reiserfs_stage1_5.exec ufs2_stage1_5.exec vstafs_stage1_5.exec \
44
	xfs_stage1_5.exec nbloader.exec pxeloader.exec diskless.exec
45
else
46
pkglib_DATA = stage2 stage2_eltorito e2fs_stage1_5 fat_stage1_5 \
47
	ffs_stage1_5 iso9660_stage1_5 jfs_stage1_5 minix_stage1_5 \
48
	reiserfs_stage1_5 ufs2_stage1_5 vstafs_stage1_5 xfs_stage1_5
49
noinst_DATA = pre_stage2 start start_eltorito
50
noinst_PROGRAMS = pre_stage2.exec start.exec start_eltorito.exec \
51
	e2fs_stage1_5.exec fat_stage1_5.exec ffs_stage1_5.exec \
52
	iso9660_stage1_5.exec jfs_stage1_5.exec minix_stage1_5.exec \
53
	reiserfs_stage1_5.exec ufs2_stage1_5.exec vstafs_stage1_5.exec \
54
	xfs_stage1_5.exec
55
endif
56
MOSTLYCLEANFILES = $(noinst_PROGRAMS)
57
58
PRE_STAGE2_LINK = -nostdlib -Wl,-N -Wl,-Ttext -Wl,8200
59
START_LINK = -nostdlib -Wl,-N -Wl,-Ttext -Wl,8000
60
NBLOADER_LINK = -nostdlib -Wl,-N -Wl,-Ttext -Wl,0
61
PXELOADER_LINK = -nostdlib -Wl,-N -Wl,-Ttext -Wl,7C00
62
START_ELTORITO_LINK = -nostdlib -Wl,-N -Wl,-Ttext -Wl,7C00
63
64
if NETBOOT_SUPPORT
65
NETBOOT_FLAGS = -I$(top_srcdir)/netboot -DSUPPORT_NETBOOT=1
66
else
67
NETBOOT_FLAGS =
68
endif
69
70
if SERIAL_SUPPORT
71
SERIAL_FLAGS = -DSUPPORT_SERIAL=1
72
else
73
SERIAL_FLAGS =
74
endif
75
76
if HERCULES_SUPPORT
77
HERCULES_FLAGS = -DSUPPORT_HERCULES=1
78
else
79
HERCULES_FLAGS =
80
endif
81
82
if GRAPHICS_SUPPORT
83
GRAPHICS_FLAGS = -DSUPPORT_GRAPHICS=1
84
else
85
GRAPHICS_FLAGS =
86
endif
87
88
STAGE2_COMPILE = $(STAGE2_CFLAGS) -fno-builtin -nostdinc \
89
	$(NETBOOT_FLAGS) $(SERIAL_FLAGS) $(HERCULES_FLAGS) $(GRAPHICS_FLAGS)
90
91
STAGE1_5_LINK = -nostdlib -Wl,-N -Wl,-Ttext -Wl,2000
92
STAGE1_5_COMPILE = $(STAGE2_COMPILE) -DNO_DECOMPRESSION=1 -DSTAGE1_5=1
93
94
# For stage2 target.
95
pre_stage2_exec_SOURCES = asm.S bios.c boot.c builtins.c char_io.c \
96
	cmdline.c common.c console.c disk_io.c fsys_ext2fs.c \
97
	fsys_fat.c fsys_ffs.c fsys_iso9660.c fsys_jfs.c fsys_minix.c \
98
	fsys_reiserfs.c fsys_ufs2.c fsys_vstafs.c fsys_xfs.c gunzip.c \
99
	hercules.c md5.c serial.c smp-imps.c stage2.c terminfo.c tparm.c \
100
	graphics.c
101
pre_stage2_exec_CFLAGS = $(STAGE2_COMPILE) $(FSYS_CFLAGS)
102
pre_stage2_exec_CCASFLAGS = $(STAGE2_COMPILE) $(FSYS_CFLAGS)
103
pre_stage2_exec_LDFLAGS = $(PRE_STAGE2_LINK)
104
105
if NETBOOT_SUPPORT
106
pre_stage2_exec_LDADD = ../netboot/libdrivers.a
107
endif
108
109
if DISKLESS_SUPPORT
110
BUILT_SOURCES = stage2_size.h diskless_size.h
111
else
112
BUILT_SOURCES = stage2_size.h
113
endif
114
115
CLEANFILES = $(pkglib_DATA) $(noinst_DATA) $(BUILT_SOURCES)
116
117
stage2_size.h: pre_stage2
118
	-rm -f stage2_size.h
119
	set dummy `ls -l pre_stage2`; \
120
	echo "#define STAGE2_SIZE $$6" > stage2_size.h
121
122
start_exec_SOURCES = start.S
123
start_exec_CCASFLAGS = $(STAGE2_COMPILE)
124
start_exec_LDFLAGS = $(START_LINK)
125
126
# XXX: automake doesn't provide a way to specify dependencies for object
127
# files explicitly, so we must write this by a general Makefile scheme.
128
# If automake change the naming scheme for per-executable objects, this
129
# will be broken.
130
start_exec-start.$(OBJEXT): stage2_size.h
131
132
stage2: pre_stage2 start
133
	-rm -f stage2
134
	cat start pre_stage2 > stage2
135
136
start_eltorito_exec_SOURCES = start_eltorito.S
137
start_eltorito_exec_CCASFLAGS = $(STAGE2_COMPILE)
138
start_eltorito_exec_LDFLAGS = $(START_ELTORITO_LINK)
139
140
start_eltorito_exec-start.$(OBJEXT): stage2_size.h
141
142
stage2_eltorito: pre_stage2 start_eltorito
143
	-rm -f stage2_eltorito
144
	cat start_eltorito pre_stage2 > stage2_eltorito
145
146
# For e2fs_stage1_5 target.
147
e2fs_stage1_5_exec_SOURCES = start.S asm.S common.c char_io.c disk_io.c \
148
	stage1_5.c fsys_ext2fs.c bios.c
149
e2fs_stage1_5_exec_CFLAGS = $(STAGE1_5_COMPILE) -DFSYS_EXT2FS=1 \
150
	-DNO_BLOCK_FILES=1
151
e2fs_stage1_5_exec_CCASFLAGS = $(STAGE1_5_COMPILE) -DFSYS_EXT2FS=1 \
152
	-DNO_BLOCK_FILES=1
153
e2fs_stage1_5_exec_LDFLAGS = $(STAGE1_5_LINK)
154
155
# For fat_stage1_5 target.
156
fat_stage1_5_exec_SOURCES = start.S asm.S common.c char_io.c disk_io.c \
157
	stage1_5.c fsys_fat.c bios.c
158
fat_stage1_5_exec_CFLAGS = $(STAGE1_5_COMPILE) -DFSYS_FAT=1 \
159
	-DNO_BLOCK_FILES=1
160
fat_stage1_5_exec_CCASFLAGS = $(STAGE1_5_COMPILE) -DFSYS_FAT=1 \
161
	-DNO_BLOCK_FILES=1
162
fat_stage1_5_exec_LDFLAGS = $(STAGE1_5_LINK)
163
164
# For ffs_stage1_5 target.
165
ffs_stage1_5_exec_SOURCES = start.S asm.S common.c char_io.c disk_io.c \
166
	stage1_5.c fsys_ffs.c bios.c
167
ffs_stage1_5_exec_CFLAGS = $(STAGE1_5_COMPILE) -DFSYS_FFS=1 \
168
	-DNO_BLOCK_FILES=1
169
ffs_stage1_5_exec_CCASFLAGS = $(STAGE1_5_COMPILE) -DFSYS_FFS=1 \
170
	-DNO_BLOCK_FILES=1
171
ffs_stage1_5_exec_LDFLAGS = $(STAGE1_5_LINK)
172
173
# For ufs2_stage1_5 target.
174
ufs2_stage1_5_exec_SOURCES = start.S asm.S common.c char_io.c disk_io.c \
175
	stage1_5.c fsys_ufs2.c bios.c
176
ufs2_stage1_5_exec_CFLAGS = $(STAGE1_5_COMPILE) -DFSYS_UFS2=1 \
177
	-DNO_BLOCK_FILES=1
178
ufs2_stage1_5_exec_CCASFLAGS = $(STAGE1_5_COMPILE) -DFSYS_UFS2=1 \
179
	-DNO_BLOCK_FILES=1
180
ufs2_stage1_5_exec_LDFLAGS = $(STAGE1_5_LINK)
181
182
# For minix_stage1_5 target.
183
minix_stage1_5_exec_SOURCES = start.S asm.S common.c char_io.c disk_io.c \
184
	stage1_5.c fsys_minix.c bios.c
185
minix_stage1_5_exec_CFLAGS = $(STAGE1_5_COMPILE) -DFSYS_MINIX=1 \
186
	-DNO_BLOCK_FILES=1
187
minix_stage1_5_exec_CCASFLAGS = $(STAGE1_5_COMPILE) -DFSYS_MINIX=1 \
188
	-DNO_BLOCK_FILES=1
189
minix_stage1_5_exec_LDFLAGS = $(STAGE1_5_LINK)
190
191
# For reiserfs_stage1_5 target.
192
reiserfs_stage1_5_exec_SOURCES = start.S asm.S common.c char_io.c \
193
	disk_io.c stage1_5.c fsys_reiserfs.c bios.c
194
reiserfs_stage1_5_exec_CFLAGS = $(STAGE1_5_COMPILE) -DFSYS_REISERFS=1 \
195
	-DNO_BLOCK_FILES=1
196
reiserfs_stage1_5_exec_CCASFLAGS = $(STAGE1_5_COMPILE) -DFSYS_REISERFS=1 \
197
	-DNO_BLOCK_FILES=1
198
reiserfs_stage1_5_exec_LDFLAGS = $(STAGE1_5_LINK)
199
200
# For vstafs_stage1_5 target.
201
vstafs_stage1_5_exec_SOURCES = start.S asm.S common.c char_io.c \
202
	disk_io.c stage1_5.c fsys_vstafs.c bios.c
203
vstafs_stage1_5_exec_CFLAGS = $(STAGE1_5_COMPILE) -DFSYS_VSTAFS=1 \
204
	-DNO_BLOCK_FILES=1
205
vstafs_stage1_5_exec_CCASFLAGS = $(STAGE1_5_COMPILE) -DFSYS_VSTAFS=1 \
206
	-DNO_BLOCK_FILES=1
207
vstafs_stage1_5_exec_LDFLAGS = $(STAGE1_5_LINK)
208
209
# For jfs_stage1_5 target.
210
jfs_stage1_5_exec_SOURCES = start.S asm.S common.c char_io.c \
211
	disk_io.c stage1_5.c fsys_jfs.c bios.c
212
jfs_stage1_5_exec_CFLAGS = $(STAGE1_5_COMPILE) -DFSYS_JFS=1 \
213
	-DNO_BLOCK_FILES=1
214
jfs_stage1_5_exec_CCASFLAGS = $(STAGE1_5_COMPILE) -DFSYS_JFS=1 \
215
	-DNO_BLOCK_FILES=1
216
jfs_stage1_5_exec_LDFLAGS = $(STAGE1_5_LINK)
217
218
# For xfs_stage1_5 target.
219
xfs_stage1_5_exec_SOURCES = start.S asm.S common.c char_io.c \
220
	disk_io.c stage1_5.c fsys_xfs.c bios.c
221
xfs_stage1_5_exec_CFLAGS = $(STAGE1_5_COMPILE) -DFSYS_XFS=1 \
222
	-DNO_BLOCK_FILES=1
223
xfs_stage1_5_exec_CCASFLAGS = $(STAGE1_5_COMPILE) -DFSYS_XFS=1 \
224
	-DNO_BLOCK_FILES=1
225
xfs_stage1_5_exec_LDFLAGS = $(STAGE1_5_LINK)
226
227
# For iso9660_stage1_5 target.
228
iso9660_stage1_5_exec_SOURCES = start_eltorito.S asm.S common.c char_io.c \
229
	disk_io.c stage1_5.c fsys_iso9660.c bios.c
230
iso9660_stage1_5_exec_CFLAGS = $(STAGE1_5_COMPILE) -DFSYS_ISO9660=1 \
231
	-DNO_BLOCK_FILES=1
232
iso9660_stage1_5_exec_CCASFLAGS = $(STAGE1_5_COMPILE) -DFSYS_ISO9660=1 \
233
	-DNO_BLOCK_FILES=1
234
iso9660_stage1_5_exec_LDFLAGS = $(STAGE1_5_LINK)
235
236
# For diskless target.
237
diskless_exec_SOURCES = $(pre_stage2_exec_SOURCES)
238
diskless_exec_CFLAGS = $(STAGE2_COMPILE) $(FSYS_CFLAGS) \
239
	-DSUPPORT_DISKLESS=1
240
diskless_exec_CCASFLAGS = $(STAGE2_COMPILE) $(FSYS_CFLAGS) \
241
	-DSUPPORT_DISKLESS=1
242
diskless_exec_LDFLAGS = $(PRE_STAGE2_LINK)
243
diskless_exec_LDADD = ../netboot/libdrivers.a
244
245
diskless_size.h: diskless
246
	-rm -f $@
247
	set dummy `ls -l $^`; \
248
	echo "#define DISKLESS_SIZE $$6" > $@
249
250
# For nbloader target.
251
nbloader_exec_SOURCES = nbloader.S
252
nbloader_exec_CCASFLAGS = $(STAGE2_COMPILE)
253
nbloader_exec_LDFLAGS = $(NBLOADER_LINK)
254
255
# XXX: See the comment for start_exec-start.o.
256
nbloader_exec-nbloader.$(OBJEXT): diskless_size.h
257
258
# For nbgrub target.
259
nbgrub: nbloader diskless
260
	-rm -f $@
261
	cat $^ > $@
262
263
# For pxeloader target.
264
pxeloader_exec_SOURCES = pxeloader.S
265
pxeloader_exec_CCASFLAGS = $(STAGE2_COMPILE)
266
pxeloader_exec_LDFLAGS = $(PXELOADER_LINK)
267
268
# XXX: See the comment for start_exec-start.o.
269
pxeloader_exec-pxeloader.$(OBJEXT): diskless_size.h
270
271
# For pxegrub target.
272
pxegrub: pxeloader diskless
273
	-rm -f $@
274
	cat $^ > $@
275
276
# General rule for making a raw binary.
277
SUFFIXES = .exec
278
.exec:
279
	$(OBJCOPY) -O binary $< $@
(-)grub-0.96.orig/stage2/builtins.c (+1 lines)
Lines 4067-4072 Link Here
4067
    {"jfs",      "/jfs_stage1_5"},
4067
    {"jfs",      "/jfs_stage1_5"},
4068
    {"minix",    "/minix_stage1_5"},
4068
    {"minix",    "/minix_stage1_5"},
4069
    {"reiserfs", "/reiserfs_stage1_5"},
4069
    {"reiserfs", "/reiserfs_stage1_5"},
4070
    {"reiser4",  "/reiser4_stage1_5"},
4070
    {"vstafs",   "/vstafs_stage1_5"},
4071
    {"vstafs",   "/vstafs_stage1_5"},
4071
    {"xfs",      "/xfs_stage1_5"}
4072
    {"xfs",      "/xfs_stage1_5"}
4072
  };
4073
  };
(-)grub-0.96.orig/stage2/builtins.c.orig (-182 / +512 lines)
Lines 59-65 Link Here
59
/* The default entry.  */
59
/* The default entry.  */
60
int default_entry = 0;
60
int default_entry = 0;
61
/* The fallback entry.  */
61
/* The fallback entry.  */
62
int fallback_entry = -1;
62
int fallback_entryno;
63
int fallback_entries[MAX_FALLBACK_ENTRIES];
63
/* The number of current entry.  */
64
/* The number of current entry.  */
64
int current_entryno;
65
int current_entryno;
65
/* The address for Multiboot command-line buffer.  */
66
/* The address for Multiboot command-line buffer.  */
Lines 97-103 Link Here
97
{
98
{
98
  default_entry = 0;
99
  default_entry = 0;
99
  password = 0;
100
  password = 0;
100
  fallback_entry = -1;
101
  fallback_entryno = -1;
102
  fallback_entries[0] = -1;
101
  grub_timeout = -1;
103
  grub_timeout = -1;
102
}
104
}
103
105
Lines 129-189 Link Here
129
}
131
}
130
132
131
133
134
/* blocklist_read_helper nee disk_read_blocklist_func was a nested
135
 * function, to which pointers were taken and exposed globally.  Even
136
 * in the GNU-C nested functions extension, they have local linkage,
137
 * and aren't guaranteed to be accessable *at all* outside of their 
138
 * containing scope.
139
 *
140
 * Above and beyond all of that, the variables within blocklist_func_context
141
 * are originally local variables, with local (not even static) linkage,
142
 * from within blocklist_func.  These were each referenced by
143
 * disk_read_blocklist_func, which is only called from other functions
144
 * through a globally scoped pointer.
145
 * 
146
 * The documentation in GCC actually uses the words "all hell will break
147
 * loose" to describe this scenario.
148
 *
149
 * Also, "start_sector" was also used uninitialized, but gcc doesn't warn
150
 * about it (possibly because of the scoping madness?)
151
 */
152
   
153
static struct {
154
       int start_sector;
155
       int num_sectors;
156
       int num_entries;
157
       int last_length;
158
} blocklist_func_context = {
159
       .start_sector = 0,
160
       .num_sectors = 0,
161
       .num_entries = 0,
162
       .last_length = 0
163
};
164
165
/* Collect contiguous blocks into one entry as many as possible,
166
   and print the blocklist notation on the screen.  */
167
static void
168
blocklist_read_helper (int sector, int offset, int length)
169
{
170
  int *start_sector = &blocklist_func_context.start_sector;
171
  int *num_sectors = &blocklist_func_context.num_sectors;
172
  int *num_entries = &blocklist_func_context.num_entries;
173
  int *last_length = &blocklist_func_context.last_length;
174
175
  if (*num_sectors > 0)
176
  {
177
    if (*start_sector + *num_sectors == sector
178
      && offset == 0 && *last_length == SECTOR_SIZE)
179
    {
180
      *num_sectors++;
181
      *last_length = length;
182
      return;
183
    }
184
    else
185
    {
186
      if (*last_length == SECTOR_SIZE)
187
        grub_printf ("%s%d+%d", *num_entries ? "," : "",
188
          *start_sector - part_start, *num_sectors);
189
      else if (*num_sectors > 1)
190
        grub_printf ("%s%d+%d,%d[0-%d]", *num_entries ? "," : "",
191
          *start_sector - part_start, *num_sectors-1,
192
          *start_sector + *num_sectors-1 - part_start, 
193
          *last_length);
194
      else
195
        grub_printf ("%s%d[0-%d]", *num_entries ? "," : "",
196
          *start_sector - part_start, *last_length);
197
      *num_entries++;
198
      *num_sectors = 0;
199
    }
200
  }
201
202
  if (offset > 0)
203
  {
204
    grub_printf("%s%d[%d-%d]", *num_entries ? "," : "",
205
          sector-part_start, offset, offset+length);
206
    *num_entries++;
207
  }
208
  else
209
  {
210
    *start_sector = sector;
211
    *num_sectors = 1;
212
    *last_length = length;
213
  }
214
}
215
132
/* blocklist */
216
/* blocklist */
133
static int
217
static int
134
blocklist_func (char *arg, int flags)
218
blocklist_func (char *arg, int flags)
135
{
219
{
136
  char *dummy = (char *) RAW_ADDR (0x100000);
220
  char *dummy = (char *) RAW_ADDR (0x100000);
137
  int start_sector;
138
  int num_sectors = 0;
139
  int num_entries = 0;
140
  int last_length = 0;
141
142
  /* Collect contiguous blocks into one entry as many as possible,
143
     and print the blocklist notation on the screen.  */
144
  static void disk_read_blocklist_func (int sector, int offset, int length)
145
    {
146
      if (num_sectors > 0)
147
	{
148
	  if (start_sector + num_sectors == sector
149
	      && offset == 0 && last_length == SECTOR_SIZE)
150
	    {
151
	      num_sectors++;
152
	      last_length = length;
153
	      return;
154
	    }
155
	  else
156
	    {
157
	      if (last_length == SECTOR_SIZE)
158
		grub_printf ("%s%d+%d", num_entries ? "," : "",
159
			     start_sector - part_start, num_sectors);
160
	      else if (num_sectors > 1)
161
		grub_printf ("%s%d+%d,%d[0-%d]", num_entries ? "," : "",
162
			     start_sector - part_start, num_sectors-1,
163
			     start_sector + num_sectors-1 - part_start, 
164
			     last_length);
165
	      else
166
		grub_printf ("%s%d[0-%d]", num_entries ? "," : "",
167
			     start_sector - part_start, last_length);
168
	      num_entries++;
169
	      num_sectors = 0;
170
	    }
171
	}
172
173
      if (offset > 0)
174
	{
175
	  grub_printf("%s%d[%d-%d]", num_entries ? "," : "",
176
		      sector-part_start, offset, offset+length);
177
	  num_entries++;
178
	}
179
      else
180
	{
181
	  start_sector = sector;
182
	  num_sectors = 1;
183
	  last_length = length;
184
	}
185
    }
186
221
222
  int *start_sector = &blocklist_func_context.start_sector;
223
  int *num_sectors = &blocklist_func_context.num_sectors;
224
  int *num_entries = &blocklist_func_context.num_entries;
225
  
187
  /* Open the file.  */
226
  /* Open the file.  */
188
  if (! grub_open (arg))
227
  if (! grub_open (arg))
189
    return 1;
228
    return 1;
Lines 202-216 Link Here
202
  grub_printf (")");
241
  grub_printf (")");
203
242
204
  /* Read in the whole file to DUMMY.  */
243
  /* Read in the whole file to DUMMY.  */
205
  disk_read_hook = disk_read_blocklist_func;
244
  disk_read_hook = blocklist_read_helper;
206
  if (! grub_read (dummy, -1))
245
  if (! grub_read (dummy, -1))
207
    goto fail;
246
    goto fail;
208
247
209
  /* The last entry may not be printed yet.  Don't check if it is a
248
  /* The last entry may not be printed yet.  Don't check if it is a
210
   * full sector, since it doesn't matter if we read too much. */
249
   * full sector, since it doesn't matter if we read too much. */
211
  if (num_sectors > 0)
250
  if (*num_sectors > 0)
212
    grub_printf ("%s%d+%d", num_entries ? "," : "",
251
	grub_printf ("%s%d+%d", *num_entries ? "," : "",
213
		 start_sector - part_start, num_sectors);
252
                *start_sector - part_start, *num_sectors);
214
253
215
  grub_printf ("\n");
254
  grub_printf ("\n");
216
  
255
  
Lines 587-594 Link Here
587
    "white"
626
    "white"
588
  };
627
  };
589
628
629
  auto int color_number (char *str);
630
  
590
  /* Convert the color name STR into the magical number.  */
631
  /* Convert the color name STR into the magical number.  */
591
  static int color_number (char *str)
632
  auto int color_number (char *str)
592
    {
633
    {
593
      char *ptr;
634
      char *ptr;
594
      int i;
635
      int i;
Lines 846-851 Link Here
846
};
887
};
847
#endif /* SUPPORT_NETBOOT */
888
#endif /* SUPPORT_NETBOOT */
848
889
890
static int terminal_func (char *arg, int flags);
891
892
#ifdef SUPPORT_GRAPHICS
893
894
static int splashimage_func(char *arg, int flags) {
895
    char splashimage[64];
896
    int i;
897
    
898
    /* filename can only be 64 characters due to our buffer size */
899
    if (strlen(arg) > 63)
900
	return 1;
901
    if (flags == BUILTIN_CMDLINE) {
902
	if (!grub_open(arg))
903
	    return 1;
904
	grub_close();
905
    }
906
907
    strcpy(splashimage, arg);
908
909
    /* get rid of TERM_NEED_INIT from the graphics terminal. */
910
    for (i = 0; term_table[i].name; i++) {
911
	if (grub_strcmp (term_table[i].name, "graphics") == 0) {
912
	    term_table[i].flags &= ~TERM_NEED_INIT;
913
	    break;
914
	}
915
    }
916
    
917
    graphics_set_splash(splashimage);
918
919
    if (flags == BUILTIN_CMDLINE && graphics_inited) {
920
	graphics_end();
921
	graphics_init();
922
	graphics_cls();
923
    }
924
925
    /* FIXME: should we be explicitly switching the terminal as a 
926
     * side effect here? */
927
    terminal_func("graphics", flags);
928
929
    return 0;
930
}
931
932
static struct builtin builtin_splashimage =
933
{
934
  "splashimage",
935
  splashimage_func,
936
  BUILTIN_CMDLINE | BUILTIN_MENU | BUILTIN_HELP_LIST,
937
  "splashimage FILE",
938
  "Load FILE as the background image when in graphics mode."
939
};
940
941
942
/* foreground */
943
static int
944
foreground_func(char *arg, int flags)
945
{
946
    if (grub_strlen(arg) == 6) {
947
	int r = ((hex(arg[0]) << 4) | hex(arg[1])) >> 2;
948
	int g = ((hex(arg[2]) << 4) | hex(arg[3])) >> 2;
949
	int b = ((hex(arg[4]) << 4) | hex(arg[5])) >> 2;
950
951
	foreground = (r << 16) | (g << 8) | b;
952
	if (graphics_inited)
953
	    graphics_set_palette(15, r, g, b);
954
955
	return (0);
956
    }
957
958
    return (1);
959
}
960
961
static struct builtin builtin_foreground =
962
{
963
  "foreground",
964
  foreground_func,
965
  BUILTIN_CMDLINE | BUILTIN_MENU | BUILTIN_HELP_LIST,
966
  "foreground RRGGBB",
967
  "Sets the foreground color when in graphics mode."
968
  "RR is red, GG is green, and BB blue. Numbers must be in hexadecimal."
969
};
970
971
972
/* background */
973
static int
974
background_func(char *arg, int flags)
975
{
976
    if (grub_strlen(arg) == 6) {
977
	int r = ((hex(arg[0]) << 4) | hex(arg[1])) >> 2;
978
	int g = ((hex(arg[2]) << 4) | hex(arg[3])) >> 2;
979
	int b = ((hex(arg[4]) << 4) | hex(arg[5])) >> 2;
980
981
	background = (r << 16) | (g << 8) | b;
982
	if (graphics_inited)
983
	    graphics_set_palette(0, r, g, b);
984
	return (0);
985
    }
986
987
    return (1);
988
}
989
990
static struct builtin builtin_background =
991
{
992
  "background",
993
  background_func,
994
  BUILTIN_CMDLINE | BUILTIN_MENU | BUILTIN_HELP_LIST,
995
  "background RRGGBB",
996
  "Sets the background color when in graphics mode."
997
  "RR is red, GG is green, and BB blue. Numbers must be in hexadecimal."
998
};
999
1000
#endif /* SUPPORT_GRAPHICS */
1001
1002
1003
/* clear */
1004
static int 
1005
clear_func() 
1006
{
1007
  if (current_term->cls)
1008
    current_term->cls();
1009
1010
  return 0;
1011
}
1012
1013
static struct builtin builtin_clear =
1014
{
1015
  "clear",
1016
  clear_func,
1017
  BUILTIN_CMDLINE | BUILTIN_HELP_LIST,
1018
  "clear",
1019
  "Clear the screen"
1020
};
1021
849
1022
850
/* displayapm */
1023
/* displayapm */
851
static int
1024
static int
Lines 1143-1151 Link Here
1143
static int
1316
static int
1144
fallback_func (char *arg, int flags)
1317
fallback_func (char *arg, int flags)
1145
{
1318
{
1146
  if (! safe_parse_maxint (&arg, &fallback_entry))
1319
  int i = 0;
1147
    return 1;
1320
1321
  while (*arg)
1322
    {
1323
      int entry;
1324
      int j;
1325
      
1326
      if (! safe_parse_maxint (&arg, &entry))
1327
	return 1;
1328
1329
      /* Remove duplications to prevent infinite looping.  */
1330
      for (j = 0; j < i; j++)
1331
	if (entry == fallback_entries[j])
1332
	  break;
1333
      if (j != i)
1334
	continue;
1335
      
1336
      fallback_entries[i++] = entry;
1337
      if (i == MAX_FALLBACK_ENTRIES)
1338
	break;
1339
      
1340
      arg = skip_to (0, arg);
1341
    }
1148
1342
1343
  if (i < MAX_FALLBACK_ENTRIES)
1344
    fallback_entries[i] = -1;
1345
1346
  fallback_entryno = (i == 0) ? -1 : 0;
1347
  
1149
  return 0;
1348
  return 0;
1150
}
1349
}
1151
1350
Lines 1155-1161 Link Here
1155
  fallback_func,
1354
  fallback_func,
1156
  BUILTIN_MENU,
1355
  BUILTIN_MENU,
1157
#if 0
1356
#if 0
1158
  "fallback NUM",
1357
  "fallback NUM...",
1159
  "Go into unattended boot mode: if the default boot entry has any"
1358
  "Go into unattended boot mode: if the default boot entry has any"
1160
  " errors, instead of waiting for the user to do anything, it"
1359
  " errors, instead of waiting for the user to do anything, it"
1161
  " immediately starts over using the NUM entry (same numbering as the"
1360
  " immediately starts over using the NUM entry (same numbering as the"
Lines 1708-1713 Link Here
1708
1907
1709
1908
1710
/* install */
1909
/* install */
1910
static struct {
1911
       int saved_sector;
1912
       int installaddr;
1913
       int installlist;
1914
       char *stage2_first_buffer;
1915
} install_func_context = {
1916
       .saved_sector = 0,
1917
       .installaddr = 0,
1918
       .installlist = 0,
1919
       .stage2_first_buffer = NULL,
1920
};
1921
1922
/* Save the first sector of Stage2 in STAGE2_SECT.  */
1923
/* Formerly disk_read_savesect_func with local scope inside install_func */
1924
static void
1925
install_savesect_helper(int sector, int offset, int length)
1926
{
1927
  if (debug)
1928
    printf ("[%d]", sector);
1929
1930
  /* ReiserFS has files which sometimes contain data not aligned
1931
     on sector boundaries.  Returning an error is better than
1932
     silently failing. */
1933
  if (offset != 0 || length != SECTOR_SIZE)
1934
    errnum = ERR_UNALIGNED;
1935
1936
  install_func_context.saved_sector = sector;
1937
}
1938
1939
/* Write SECTOR to INSTALLLIST, and update INSTALLADDR and  INSTALLSECT.  */
1940
/* Formerly disk_read_blocklist_func with local scope inside install_func */
1941
static void
1942
install_blocklist_helper (int sector, int offset, int length)
1943
{
1944
  int *installaddr = &install_func_context.installaddr;
1945
  int *installlist = &install_func_context.installlist;
1946
  char **stage2_first_buffer = &install_func_context.stage2_first_buffer;
1947
  /* Was the last sector full? */
1948
  static int last_length = SECTOR_SIZE;
1949
1950
  if (debug)
1951
    printf("[%d]", sector);
1952
1953
  if (offset != 0 || last_length != SECTOR_SIZE)
1954
    {
1955
      /* We found a non-sector-aligned data block. */
1956
      errnum = ERR_UNALIGNED;
1957
      return;
1958
    }
1959
1960
  last_length = length;
1961
1962
  if (*((unsigned long *) (*installlist - 4))
1963
      + *((unsigned short *) *installlist) != sector
1964
      || *installlist == (int) *stage2_first_buffer + SECTOR_SIZE + 4)
1965
    {
1966
      *installlist -= 8;
1967
1968
      if (*((unsigned long *) (*installlist - 8)))
1969
        errnum = ERR_WONT_FIT;
1970
      else
1971
        {
1972
          *((unsigned short *) (*installlist + 2)) = (*installaddr >> 4);
1973
          *((unsigned long *) (*installlist - 4)) = sector;
1974
        }
1975
    }
1976
1977
  *((unsigned short *) *installlist) += 1;
1978
  *installaddr += 512;
1979
}
1980
1711
static int
1981
static int
1712
install_func (char *arg, int flags)
1982
install_func (char *arg, int flags)
1713
{
1983
{
Lines 1715-1734 Link Here
1715
  char *stage1_buffer = (char *) RAW_ADDR (0x100000);
1985
  char *stage1_buffer = (char *) RAW_ADDR (0x100000);
1716
  char *stage2_buffer = stage1_buffer + SECTOR_SIZE;
1986
  char *stage2_buffer = stage1_buffer + SECTOR_SIZE;
1717
  char *old_sect = stage2_buffer + SECTOR_SIZE;
1987
  char *old_sect = stage2_buffer + SECTOR_SIZE;
1718
  char *stage2_first_buffer = old_sect + SECTOR_SIZE;
1988
  /* stage2_first_buffer used to be defined as:
1719
  char *stage2_second_buffer = stage2_first_buffer + SECTOR_SIZE;
1989
   * char *stage2_first_buffer = old_sect + SECTOR_SIZE;  */
1990
  char **stage2_first_buffer = &install_func_context.stage2_first_buffer;
1991
  /* and stage2_second_buffer was:
1992
   * char *stage2_second_buffer = stage2_first_buffer + SECTOR_SIZE; */
1993
  char *stage2_second_buffer = old_sect + SECTOR_SIZE + SECTOR_SIZE;
1720
  /* XXX: Probably SECTOR_SIZE is reasonable.  */
1994
  /* XXX: Probably SECTOR_SIZE is reasonable.  */
1721
  char *config_filename = stage2_second_buffer + SECTOR_SIZE;
1995
  char *config_filename = stage2_second_buffer + SECTOR_SIZE;
1722
  char *dummy = config_filename + SECTOR_SIZE;
1996
  char *dummy = config_filename + SECTOR_SIZE;
1723
  int new_drive = 0xFF;
1997
  int new_drive = GRUB_INVALID_DRIVE;
1724
  int dest_drive, dest_partition, dest_sector;
1998
  int dest_drive, dest_partition, dest_sector;
1725
  int src_drive, src_partition, src_part_start;
1999
  int src_drive, src_partition, src_part_start;
1726
  int i;
2000
  int i;
1727
  struct geometry dest_geom, src_geom;
2001
  struct geometry dest_geom, src_geom;
1728
  int saved_sector;
2002
  int *saved_sector = &install_func_context.saved_sector;
1729
  int stage2_first_sector, stage2_second_sector;
2003
  int stage2_first_sector, stage2_second_sector;
1730
  char *ptr;
2004
  char *ptr;
1731
  int installaddr, installlist;
2005
  int *installaddr = &install_func_context.installaddr;
2006
  int *installlist = &install_func_context.installlist;
1732
  /* Point to the location of the name of a configuration file in Stage 2.  */
2007
  /* Point to the location of the name of a configuration file in Stage 2.  */
1733
  char *config_file_location;
2008
  char *config_file_location;
1734
  /* If FILE is a Stage 1.5?  */
2009
  /* If FILE is a Stage 1.5?  */
Lines 1737-1800 Link Here
1737
  int is_open = 0;
2012
  int is_open = 0;
1738
  /* If LBA is forced?  */
2013
  /* If LBA is forced?  */
1739
  int is_force_lba = 0;
2014
  int is_force_lba = 0;
1740
  /* Was the last sector full? */
1741
  int last_length = SECTOR_SIZE;
1742
  
1743
#ifdef GRUB_UTIL
2015
#ifdef GRUB_UTIL
1744
  /* If the Stage 2 is in a partition mounted by an OS, this will store
2016
  /* If the Stage 2 is in a partition mounted by an OS, this will store
1745
     the filename under the OS.  */
2017
     the filename under the OS.  */
1746
  char *stage2_os_file = 0;
2018
  char *stage2_os_file = 0;
1747
#endif /* GRUB_UTIL */
2019
#endif /* GRUB_UTIL */
1748
  
1749
  /* Save the first sector of Stage2 in STAGE2_SECT.  */
1750
  static void disk_read_savesect_func (int sector, int offset, int length)
1751
    {
1752
      if (debug)
1753
	printf ("[%d]", sector);
1754
1755
      /* ReiserFS has files which sometimes contain data not aligned
1756
         on sector boundaries.  Returning an error is better than
1757
         silently failing. */
1758
      if (offset != 0 || length != SECTOR_SIZE)
1759
	errnum = ERR_UNALIGNED;
1760
2020
1761
      saved_sector = sector;
2021
  *stage2_first_buffer = old_sect + SECTOR_SIZE;
1762
    }
1763
1764
  /* Write SECTOR to INSTALLLIST, and update INSTALLADDR and
1765
     INSTALLSECT.  */
1766
  static void disk_read_blocklist_func (int sector, int offset, int length)
1767
    {
1768
      if (debug)
1769
	printf("[%d]", sector);
1770
1771
      if (offset != 0 || last_length != SECTOR_SIZE)
1772
	{
1773
	  /* We found a non-sector-aligned data block. */
1774
	  errnum = ERR_UNALIGNED;
1775
	  return;
1776
	}
1777
1778
      last_length = length;
1779
1780
      if (*((unsigned long *) (installlist - 4))
1781
	  + *((unsigned short *) installlist) != sector
1782
	  || installlist == (int) stage2_first_buffer + SECTOR_SIZE + 4)
1783
	{
1784
	  installlist -= 8;
1785
1786
	  if (*((unsigned long *) (installlist - 8)))
1787
	    errnum = ERR_WONT_FIT;
1788
	  else
1789
	    {
1790
	      *((unsigned short *) (installlist + 2)) = (installaddr >> 4);
1791
	      *((unsigned long *) (installlist - 4)) = sector;
1792
	    }
1793
	}
1794
1795
      *((unsigned short *) installlist) += 1;
1796
      installaddr += 512;
1797
    }
1798
2022
1799
  /* First, check the GNU-style long option.  */
2023
  /* First, check the GNU-style long option.  */
1800
  while (1)
2024
  while (1)
Lines 1827-1836 Link Here
1827
  addr = skip_to (0, file);
2051
  addr = skip_to (0, file);
1828
2052
1829
  /* Get the installation address.  */
2053
  /* Get the installation address.  */
1830
  if (! safe_parse_maxint (&addr, &installaddr))
2054
  if (! safe_parse_maxint (&addr, installaddr))
1831
    {
2055
    {
1832
      /* ADDR is not specified.  */
2056
      /* ADDR is not specified.  */
1833
      installaddr = 0;
2057
      *installaddr = 0;
1834
      ptr = addr;
2058
      ptr = addr;
1835
      errnum = 0;
2059
      errnum = 0;
1836
    }
2060
    }
Lines 1924-1940 Link Here
1924
    = (dest_drive & BIOS_FLAG_FIXED_DISK);
2148
    = (dest_drive & BIOS_FLAG_FIXED_DISK);
1925
  
2149
  
1926
  /* Read the first sector of Stage 2.  */
2150
  /* Read the first sector of Stage 2.  */
1927
  disk_read_hook = disk_read_savesect_func;
2151
  disk_read_hook = install_savesect_helper;
1928
  if (grub_read (stage2_first_buffer, SECTOR_SIZE) != SECTOR_SIZE)
2152
  if (grub_read (*stage2_first_buffer, SECTOR_SIZE) != SECTOR_SIZE)
1929
    goto fail;
2153
    goto fail;
1930
2154
1931
  stage2_first_sector = saved_sector;
2155
  stage2_first_sector = *saved_sector;
1932
  
2156
  
1933
  /* Read the second sector of Stage 2.  */
2157
  /* Read the second sector of Stage 2.  */
1934
  if (grub_read (stage2_second_buffer, SECTOR_SIZE) != SECTOR_SIZE)
2158
  if (grub_read (stage2_second_buffer, SECTOR_SIZE) != SECTOR_SIZE)
1935
    goto fail;
2159
    goto fail;
1936
2160
1937
  stage2_second_sector = saved_sector;
2161
  stage2_second_sector = *saved_sector;
1938
  
2162
  
1939
  /* Check for the version of Stage 2.  */
2163
  /* Check for the version of Stage 2.  */
1940
  if (*((short *) (stage2_second_buffer + STAGE2_VER_MAJ_OFFS))
2164
  if (*((short *) (stage2_second_buffer + STAGE2_VER_MAJ_OFFS))
Lines 1950-1976 Link Here
1950
2174
1951
  /* If INSTALLADDR is not specified explicitly in the command-line,
2175
  /* If INSTALLADDR is not specified explicitly in the command-line,
1952
     determine it by the Stage 2 id.  */
2176
     determine it by the Stage 2 id.  */
1953
  if (! installaddr)
2177
  if (! *installaddr)
1954
    {
2178
    {
1955
      if (! is_stage1_5)
2179
      if (! is_stage1_5)
1956
	/* Stage 2.  */
2180
	/* Stage 2.  */
1957
	installaddr = 0x8000;
2181
	*installaddr = 0x8000;
1958
      else
2182
      else
1959
	/* Stage 1.5.  */
2183
	/* Stage 1.5.  */
1960
	installaddr = 0x2000;
2184
	*installaddr = 0x2000;
1961
    }
2185
    }
1962
2186
1963
  *((unsigned long *) (stage1_buffer + STAGE1_STAGE2_SECTOR))
2187
  *((unsigned long *) (stage1_buffer + STAGE1_STAGE2_SECTOR))
1964
    = stage2_first_sector;
2188
    = stage2_first_sector;
1965
  *((unsigned short *) (stage1_buffer + STAGE1_STAGE2_ADDRESS))
2189
  *((unsigned short *) (stage1_buffer + STAGE1_STAGE2_ADDRESS))
1966
    = installaddr;
2190
    = *installaddr;
1967
  *((unsigned short *) (stage1_buffer + STAGE1_STAGE2_SEGMENT))
2191
  *((unsigned short *) (stage1_buffer + STAGE1_STAGE2_SEGMENT))
1968
    = installaddr >> 4;
2192
    = *installaddr >> 4;
1969
2193
1970
  i = (int) stage2_first_buffer + SECTOR_SIZE - 4;
2194
  i = (int) *stage2_first_buffer + SECTOR_SIZE - 4;
1971
  while (*((unsigned long *) i))
2195
  while (*((unsigned long *) i))
1972
    {
2196
    {
1973
      if (i < (int) stage2_first_buffer
2197
      if (i < (int) *stage2_first_buffer
1974
	  || (*((int *) (i - 4)) & 0x80000000)
2198
	  || (*((int *) (i - 4)) & 0x80000000)
1975
	  || *((unsigned short *) i) >= 0xA00
2199
	  || *((unsigned short *) i) >= 0xA00
1976
	  || *((short *) (i + 2)) == 0)
2200
	  || *((short *) (i + 2)) == 0)
Lines 1984-1996 Link Here
1984
      i -= 8;
2208
      i -= 8;
1985
    }
2209
    }
1986
2210
1987
  installlist = (int) stage2_first_buffer + SECTOR_SIZE + 4;
2211
  *installlist = (int) *stage2_first_buffer + SECTOR_SIZE + 4;
1988
  installaddr += SECTOR_SIZE;
2212
  *installaddr += SECTOR_SIZE;
1989
  
2213
  
1990
  /* Read the whole of Stage2 except for the first sector.  */
2214
  /* Read the whole of Stage2 except for the first sector.  */
1991
  grub_seek (SECTOR_SIZE);
2215
  grub_seek (SECTOR_SIZE);
1992
2216
1993
  disk_read_hook = disk_read_blocklist_func;
2217
  disk_read_hook = install_blocklist_helper;
1994
  if (! grub_read (dummy, -1))
2218
  if (! grub_read (dummy, -1))
1995
    goto fail;
2219
    goto fail;
1996
  
2220
  
Lines 2051-2057 Link Here
2051
	      /* If the drive where the Stage 2 resides is the same as
2275
	      /* If the drive where the Stage 2 resides is the same as
2052
		 the one where the Stage 1.5 resides, do not embed the
2276
		 the one where the Stage 1.5 resides, do not embed the
2053
		 drive number.  */
2277
		 drive number.  */
2054
	      current_drive = 0xFF;
2278
	      current_drive = GRUB_INVALID_DRIVE;
2055
	    }
2279
	    }
2056
2280
2057
	  device = (current_drive << 24) | current_partition;
2281
	  device = (current_drive << 24) | current_partition;
Lines 2073-2079 Link Here
2073
	  /* Skip the first sector.  */
2297
	  /* Skip the first sector.  */
2074
	  grub_seek (SECTOR_SIZE);
2298
	  grub_seek (SECTOR_SIZE);
2075
	  
2299
	  
2076
	  disk_read_hook = disk_read_savesect_func;
2300
	  disk_read_hook = install_savesect_helper;
2077
	  if (grub_read (stage2_buffer, SECTOR_SIZE) != SECTOR_SIZE)
2301
	  if (grub_read (stage2_buffer, SECTOR_SIZE) != SECTOR_SIZE)
2078
	    goto fail;
2302
	    goto fail;
2079
	  
2303
	  
Lines 2143-2149 Link Here
2143
	  else
2367
	  else
2144
#endif /* GRUB_UTIL */
2368
#endif /* GRUB_UTIL */
2145
	    {
2369
	    {
2146
	      if (! devwrite (saved_sector - part_start, 1, stage2_buffer))
2370
	      if (! devwrite (*saved_sector - part_start, 1, stage2_buffer))
2147
		goto fail;
2371
		goto fail;
2148
	    }
2372
	    }
2149
	}
2373
	}
Lines 2165-2171 Link Here
2165
	  goto fail;
2389
	  goto fail;
2166
	}
2390
	}
2167
2391
2168
      if (fwrite (stage2_first_buffer, 1, SECTOR_SIZE, fp) != SECTOR_SIZE)
2392
      if (fwrite (*stage2_first_buffer, 1, SECTOR_SIZE, fp) != SECTOR_SIZE)
2169
	{
2393
	{
2170
	  fclose (fp);
2394
	  fclose (fp);
2171
	  errnum = ERR_WRITE;
2395
	  errnum = ERR_WRITE;
Lines 2192-2198 Link Here
2192
	goto fail;
2416
	goto fail;
2193
2417
2194
      if (! devwrite (stage2_first_sector - src_part_start, 1,
2418
      if (! devwrite (stage2_first_sector - src_part_start, 1,
2195
		      stage2_first_buffer))
2419
		      *stage2_first_buffer))
2196
	goto fail;
2420
	goto fail;
2197
2421
2198
      if (! devwrite (stage2_second_sector - src_part_start, 1,
2422
      if (! devwrite (stage2_second_sector - src_part_start, 1,
Lines 3185-3192 Link Here
3185
savedefault_func (char *arg, int flags)
3409
savedefault_func (char *arg, int flags)
3186
{
3410
{
3187
#if !defined(SUPPORT_DISKLESS) && !defined(GRUB_UTIL)
3411
#if !defined(SUPPORT_DISKLESS) && !defined(GRUB_UTIL)
3188
  char buffer[512];
3412
  unsigned long tmp_drive = saved_drive;
3189
  int *entryno_ptr;
3413
  unsigned long tmp_partition = saved_partition;
3414
  char *default_file = (char *) DEFAULT_FILE_BUF;
3415
  char buf[10];
3416
  char sect[SECTOR_SIZE];
3417
  int entryno;
3418
  int sector_count = 0;
3419
  int saved_sectors[2];
3420
  int saved_offsets[2];
3421
  int saved_lengths[2];
3422
3423
  /* Save sector information about at most two sectors.  */
3424
  auto void disk_read_savesect_func (int sector, int offset, int length);
3425
  void disk_read_savesect_func (int sector, int offset, int length)
3426
    {
3427
      if (sector_count < 2)
3428
	{
3429
	  saved_sectors[sector_count] = sector;
3430
	  saved_offsets[sector_count] = offset;
3431
	  saved_lengths[sector_count] = length;
3432
	}
3433
      sector_count++;
3434
    }
3190
  
3435
  
3191
  /* This command is only useful when you boot an entry from the menu
3436
  /* This command is only useful when you boot an entry from the menu
3192
     interface.  */
3437
     interface.  */
Lines 3195-3240 Link Here
3195
      errnum = ERR_UNRECOGNIZED;
3440
      errnum = ERR_UNRECOGNIZED;
3196
      return 1;
3441
      return 1;
3197
    }
3442
    }
3198
  
3199
  /* Get the geometry of the boot drive (i.e. the disk which contains
3200
     this stage2).  */
3201
  if (get_diskinfo (boot_drive, &buf_geom))
3202
    {
3203
      errnum = ERR_NO_DISK;
3204
      return 1;
3205
    }
3206
3443
3207
  /* Load the second sector of this stage2.  */
3444
  /* Determine a saved entry number.  */
3208
  if (! rawread (boot_drive, install_second_sector, 0, SECTOR_SIZE, buffer))
3445
  if (*arg)
3209
    {
3446
    {
3210
      return 1;
3447
      if (grub_memcmp (arg, "fallback", sizeof ("fallback") - 1) == 0)
3211
    }
3448
	{
3449
	  int i;
3450
	  int index = 0;
3451
	  
3452
	  for (i = 0; i < MAX_FALLBACK_ENTRIES; i++)
3453
	    {
3454
	      if (fallback_entries[i] < 0)
3455
		break;
3456
	      if (fallback_entries[i] == current_entryno)
3457
		{
3458
		  index = i + 1;
3459
		  break;
3460
		}
3461
	    }
3462
	  
3463
	  if (index >= MAX_FALLBACK_ENTRIES || fallback_entries[index] < 0)
3464
	    {
3465
	      /* This is the last.  */
3466
	      errnum = ERR_BAD_ARGUMENT;
3467
	      return 1;
3468
	    }
3212
3469
3213
  /* Sanity check.  */
3470
	  entryno = fallback_entries[index];
3214
  if (buffer[STAGE2_STAGE2_ID] != STAGE2_ID_STAGE2
3471
	}
3215
      || *((short *) (buffer + STAGE2_VER_MAJ_OFFS)) != COMPAT_VERSION)
3472
      else if (! safe_parse_maxint (&arg, &entryno))
3216
    {
3473
	return 1;
3217
      errnum = ERR_BAD_VERSION;
3218
      return 1;
3219
    }
3474
    }
3220
  
3475
  else
3221
  entryno_ptr = (int *) (buffer + STAGE2_SAVED_ENTRYNO);
3476
    entryno = current_entryno;
3222
3477
3223
  /* Check if the saved entry number differs from current entry number.  */
3478
  /* Open the default file.  */
3224
  if (*entryno_ptr != current_entryno)
3479
  saved_drive = boot_drive;
3225
    {
3480
  saved_partition = install_partition;
3226
      /* Overwrite the saved entry number.  */
3481
  if (grub_open (default_file))
3227
      *entryno_ptr = current_entryno;
3482
    {
3483
      int len;
3484
      
3485
      disk_read_hook = disk_read_savesect_func;
3486
      len = grub_read (buf, sizeof (buf));
3487
      disk_read_hook = 0;
3488
      grub_close ();
3228
      
3489
      
3229
      /* Save the image in the disk.  */
3490
      if (len != sizeof (buf))
3230
      if (! rawwrite (boot_drive, install_second_sector, buffer))
3491
	{
3231
	return 1;
3492
	  /* This is too small. Do not modify the file manually, please!  */
3493
	  errnum = ERR_READ;
3494
	  goto fail;
3495
	}
3496
3497
      if (sector_count > 2)
3498
	{
3499
	  /* Is this possible?! Too fragmented!  */
3500
	  errnum = ERR_FSYS_CORRUPT;
3501
	  goto fail;
3502
	}
3232
      
3503
      
3504
      /* Set up a string to be written.  */
3505
      grub_memset (buf, '\n', sizeof (buf));
3506
      grub_sprintf (buf, "%d", entryno);
3507
      
3508
      if (saved_lengths[0] < sizeof (buf))
3509
	{
3510
	  /* The file is anchored to another file and the first few bytes
3511
	     are spanned in two sectors. Uggh...  */
3512
	  if (! rawread (current_drive, saved_sectors[0], 0, SECTOR_SIZE,
3513
			 sect))
3514
	    goto fail;
3515
	  grub_memmove (sect + saved_offsets[0], buf, saved_lengths[0]);
3516
	  if (! rawwrite (current_drive, saved_sectors[0], sect))
3517
	    goto fail;
3518
3519
	  if (! rawread (current_drive, saved_sectors[1], 0, SECTOR_SIZE,
3520
			 sect))
3521
	    goto fail;
3522
	  grub_memmove (sect + saved_offsets[1],
3523
			buf + saved_lengths[0],
3524
			sizeof (buf) - saved_lengths[0]);
3525
	  if (! rawwrite (current_drive, saved_sectors[1], sect))
3526
	    goto fail;
3527
	}
3528
      else
3529
	{
3530
	  /* This is a simple case. It fits into a single sector.  */
3531
	  if (! rawread (current_drive, saved_sectors[0], 0, SECTOR_SIZE,
3532
			 sect))
3533
	    goto fail;
3534
	  grub_memmove (sect + saved_offsets[0], buf, sizeof (buf));
3535
	  if (! rawwrite (current_drive, saved_sectors[0], sect))
3536
	    goto fail;
3537
	}
3538
3233
      /* Clear the cache.  */
3539
      /* Clear the cache.  */
3234
      buf_track = -1;
3540
      buf_track = -1;
3235
    }
3541
    }
3236
3542
3237
  return 0;
3543
 fail:
3544
  saved_drive = tmp_drive;
3545
  saved_partition = tmp_partition;
3546
  return errnum;
3238
#else /* ! SUPPORT_DISKLESS && ! GRUB_UTIL */
3547
#else /* ! SUPPORT_DISKLESS && ! GRUB_UTIL */
3239
  errnum = ERR_UNRECOGNIZED;
3548
  errnum = ERR_UNRECOGNIZED;
3240
  return 1;
3549
  return 1;
Lines 3246-3253 Link Here
3246
  "savedefault",
3555
  "savedefault",
3247
  savedefault_func,
3556
  savedefault_func,
3248
  BUILTIN_CMDLINE,
3557
  BUILTIN_CMDLINE,
3249
  "savedefault",
3558
  "savedefault [NUM | `fallback']",
3250
  "Save the current entry as the default boot entry."
3559
  "Save the current entry as the default boot entry if no argument is"
3560
  " specified. If a number is specified, this number is saved. If"
3561
  " `fallback' is used, next fallback entry is saved."
3251
};
3562
};
3252
3563
3253
3564
Lines 3495-3501 Link Here
3495
  int to_code, from_code;
3806
  int to_code, from_code;
3496
  int map_in_interrupt = 0;
3807
  int map_in_interrupt = 0;
3497
  
3808
  
3498
  static int find_key_code (char *key)
3809
  auto int find_key_code (char *key);
3810
  auto int find_ascii_code (char *key);
3811
  
3812
  auto int find_key_code (char *key)
3499
    {
3813
    {
3500
      int i;
3814
      int i;
3501
3815
Lines 3512-3518 Link Here
3512
      return 0;
3826
      return 0;
3513
    }
3827
    }
3514
  
3828
  
3515
  static int find_ascii_code (char *key)
3829
  auto int find_ascii_code (char *key)
3516
    {
3830
    {
3517
      int i;
3831
      int i;
3518
      
3832
      
Lines 3747-3753 Link Here
3747
  {
4061
  {
3748
    {"ext2fs",   "/e2fs_stage1_5"},
4062
    {"ext2fs",   "/e2fs_stage1_5"},
3749
    {"fat",      "/fat_stage1_5"},
4063
    {"fat",      "/fat_stage1_5"},
4064
    {"ufs2",     "/ufs2_stage1_5"},
3750
    {"ffs",      "/ffs_stage1_5"},
4065
    {"ffs",      "/ffs_stage1_5"},
4066
    {"iso9660",  "/iso9660_stage1_5"},
3751
    {"jfs",      "/jfs_stage1_5"},
4067
    {"jfs",      "/jfs_stage1_5"},
3752
    {"minix",    "/minix_stage1_5"},
4068
    {"minix",    "/minix_stage1_5"},
3753
    {"reiserfs", "/reiserfs_stage1_5"},
4069
    {"reiserfs", "/reiserfs_stage1_5"},
Lines 3956-3962 Link Here
3956
};
4272
};
3957
4273
3958
4274
3959
#if defined(SUPPORT_SERIAL) || defined(SUPPORT_HERCULES)
4275
#if defined(SUPPORT_SERIAL) || defined(SUPPORT_HERCULES) || defined(SUPPORT_GRAPHICS)
3960
/* terminal */
4276
/* terminal */
3961
static int
4277
static int
3962
terminal_func (char *arg, int flags)
4278
terminal_func (char *arg, int flags)
Lines 4115-4131 Link Here
4115
 end:
4431
 end:
4116
  current_term = term_table + default_term;
4432
  current_term = term_table + default_term;
4117
  current_term->flags = term_flags;
4433
  current_term->flags = term_flags;
4118
  
4434
4119
  if (lines)
4435
  if (lines)
4120
    max_lines = lines;
4436
    max_lines = lines;
4121
  else
4437
  else
4122
    /* 24 would be a good default value.  */
4438
    max_lines = current_term->max_lines;
4123
    max_lines = 24;
4439
4124
  
4125
  /* If the interface is currently the command-line,
4440
  /* If the interface is currently the command-line,
4126
     restart it to repaint the screen.  */
4441
     restart it to repaint the screen.  */
4127
  if (current_term != prev_term && (flags & BUILTIN_CMDLINE))
4442
  if ((current_term != prev_term) && (flags & BUILTIN_CMDLINE)){
4443
    if (prev_term->shutdown)
4444
      prev_term->shutdown();
4445
    if (current_term->startup)
4446
      current_term->startup();
4128
    grub_longjmp (restart_cmdline_env, 0);
4447
    grub_longjmp (restart_cmdline_env, 0);
4448
  }
4129
  
4449
  
4130
  return 0;
4450
  return 0;
4131
}
4451
}
Lines 4135-4141 Link Here
4135
  "terminal",
4455
  "terminal",
4136
  terminal_func,
4456
  terminal_func,
4137
  BUILTIN_MENU | BUILTIN_CMDLINE | BUILTIN_HELP_LIST,
4457
  BUILTIN_MENU | BUILTIN_CMDLINE | BUILTIN_HELP_LIST,
4138
  "terminal [--dumb] [--no-echo] [--no-edit] [--timeout=SECS] [--lines=LINES] [--silent] [console] [serial] [hercules]",
4458
  "terminal [--dumb] [--no-echo] [--no-edit] [--timeout=SECS] [--lines=LINES] [--silent] [console] [serial] [hercules] [graphics]",
4139
  "Select a terminal. When multiple terminals are specified, wait until"
4459
  "Select a terminal. When multiple terminals are specified, wait until"
4140
  " you push any key to continue. If both console and serial are specified,"
4460
  " you push any key to continue. If both console and serial are specified,"
4141
  " the terminal to which you input a key first will be selected. If no"
4461
  " the terminal to which you input a key first will be selected. If no"
Lines 4147-4153 Link Here
4147
  " seconds. The option --lines specifies the maximum number of lines."
4467
  " seconds. The option --lines specifies the maximum number of lines."
4148
  " The option --silent is used to suppress messages."
4468
  " The option --silent is used to suppress messages."
4149
};
4469
};
4150
#endif /* SUPPORT_SERIAL || SUPPORT_HERCULES */
4470
#endif /* SUPPORT_SERIAL || SUPPORT_HERCULES || SUPPORT_GRAPHICS */
4151
4471
4152
4472
4153
#ifdef SUPPORT_SERIAL
4473
#ifdef SUPPORT_SERIAL
Lines 4666-4671 Link Here
4666
/* The table of builtin commands. Sorted in dictionary order.  */
4986
/* The table of builtin commands. Sorted in dictionary order.  */
4667
struct builtin *builtin_table[] =
4987
struct builtin *builtin_table[] =
4668
{
4988
{
4989
#ifdef SUPPORT_GRAPHICS
4990
  &builtin_background,
4991
#endif
4669
  &builtin_blocklist,
4992
  &builtin_blocklist,
4670
  &builtin_boot,
4993
  &builtin_boot,
4671
#ifdef SUPPORT_NETBOOT
4994
#ifdef SUPPORT_NETBOOT
Lines 4673-4678 Link Here
4673
#endif /* SUPPORT_NETBOOT */
4996
#endif /* SUPPORT_NETBOOT */
4674
  &builtin_cat,
4997
  &builtin_cat,
4675
  &builtin_chainloader,
4998
  &builtin_chainloader,
4999
  &builtin_clear,
4676
  &builtin_cmp,
5000
  &builtin_cmp,
4677
  &builtin_color,
5001
  &builtin_color,
4678
  &builtin_configfile,
5002
  &builtin_configfile,
Lines 4692-4697 Link Here
4692
  &builtin_embed,
5016
  &builtin_embed,
4693
  &builtin_fallback,
5017
  &builtin_fallback,
4694
  &builtin_find,
5018
  &builtin_find,
5019
#ifdef SUPPORT_GRAPHICS
5020
  &builtin_foreground,
5021
#endif
4695
  &builtin_fstest,
5022
  &builtin_fstest,
4696
  &builtin_geometry,
5023
  &builtin_geometry,
4697
  &builtin_halt,
5024
  &builtin_halt,
Lines 4735-4743 Link Here
4735
#endif /* SUPPORT_SERIAL */
5062
#endif /* SUPPORT_SERIAL */
4736
  &builtin_setkey,
5063
  &builtin_setkey,
4737
  &builtin_setup,
5064
  &builtin_setup,
4738
#if defined(SUPPORT_SERIAL) || defined(SUPPORT_HERCULES)
5065
#ifdef SUPPORT_GRAPHICS
5066
  &builtin_splashimage,
5067
#endif /* SUPPORT_GRAPHICS */
5068
#if defined(SUPPORT_SERIAL) || defined(SUPPORT_HERCULES) || defined(SUPPORT_GRAPHICS)
4739
  &builtin_terminal,
5069
  &builtin_terminal,
4740
#endif /* SUPPORT_SERIAL || SUPPORT_HERCULES */
5070
#endif /* SUPPORT_SERIAL || SUPPORT_HERCULES || SUPPORT_GRAPHICS */
4741
#ifdef SUPPORT_SERIAL
5071
#ifdef SUPPORT_SERIAL
4742
  &builtin_terminfo,
5072
  &builtin_terminfo,
4743
#endif /* SUPPORT_SERIAL */
5073
#endif /* SUPPORT_SERIAL */
(-)grub-0.96.orig/stage2/disk_io.c (+3 lines)
Lines 63-68 Link Here
63
# ifdef FSYS_REISERFS
63
# ifdef FSYS_REISERFS
64
  {"reiserfs", reiserfs_mount, reiserfs_read, reiserfs_dir, 0, reiserfs_embed},
64
  {"reiserfs", reiserfs_mount, reiserfs_read, reiserfs_dir, 0, reiserfs_embed},
65
# endif
65
# endif
66
# ifdef FSYS_REISER4
67
  {"reiser4", reiser4_mount, reiser4_read, reiser4_dir, 0, reiser4_embed},
68
# endif
66
# ifdef FSYS_VSTAFS
69
# ifdef FSYS_VSTAFS
67
  {"vstafs", vstafs_mount, vstafs_read, vstafs_dir, 0, 0},
70
  {"vstafs", vstafs_mount, vstafs_read, vstafs_dir, 0, 0},
68
# endif
71
# endif
(-)grub-0.96.orig/stage2/filesys.h (-2 / +12 lines)
Lines 77-82 Link Here
77
#define FSYS_REISERFS_NUM 0
77
#define FSYS_REISERFS_NUM 0
78
#endif
78
#endif
79
79
80
#ifdef FSYS_REISER4
81
#define FSYS_REISER4_NUM 1
82
int reiser4_mount (void);
83
int reiser4_read (char *buf, int len);
84
int reiser4_dir (char *dirname);
85
int reiser4_embed (int *start_sector, int needed_sectors);
86
#else
87
#define FSYS_REISER4_NUM 0
88
#endif
89
80
#ifdef FSYS_VSTAFS
90
#ifdef FSYS_VSTAFS
81
#define FSYS_VSTAFS_NUM 1
91
#define FSYS_VSTAFS_NUM 1
82
int vstafs_mount (void);
92
int vstafs_mount (void);
Lines 127-134 Link Here
127
#ifndef NUM_FSYS
137
#ifndef NUM_FSYS
128
#define NUM_FSYS	\
138
#define NUM_FSYS	\
129
  (FSYS_FFS_NUM + FSYS_FAT_NUM + FSYS_EXT2FS_NUM + FSYS_MINIX_NUM	\
139
  (FSYS_FFS_NUM + FSYS_FAT_NUM + FSYS_EXT2FS_NUM + FSYS_MINIX_NUM	\
130
   + FSYS_REISERFS_NUM + FSYS_VSTAFS_NUM + FSYS_JFS_NUM + FSYS_XFS_NUM	\
140
   + FSYS_REISERFS_NUM + FSYS_REISER4_NUM + FSYS_VSTAFS_NUM + FSYS_JFS_NUM \
131
   + FSYS_TFTP_NUM + FSYS_ISO9660_NUM + FSYS_UFS2_NUM)
141
   + FSYS_XFS_NUM + FSYS_TFTP_NUM + FSYS_ISO9660_NUM + FSYS_UFS2_NUM)
132
#endif
142
#endif
133
143
134
/* defines for the block filesystem info area */
144
/* defines for the block filesystem info area */
(-)grub-0.96.orig/stage2/fsys_reiser4.c (+260 lines)
Line 0 Link Here
1
/* 
2
 *  fsys_reiser4.c -- reiser4 filesystem support.
3
 *  Copyright (C) 2000, 2001   Free Software Foundation, Inc.
4
 *  
5
 *  GRUB  --  GRand Unified Bootloader
6
 *
7
 *  This program is free software; you can redistribute it and/or modify
8
 *  it under the terms of the GNU General Public License as published by
9
 *  the Free Software Foundation; either version 2 of the License, or
10
 *  (at your option) any later version.
11
 *
12
 *  This program is distributed in the hope that it will be useful,
13
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
 *  GNU General Public License for more details.
16
 *
17
 *  You should have received a copy of the GNU General Public License
18
 *  along with this program; if not, write to the Free Software
19
 *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20
*/
21
22
#ifdef FSYS_REISER4
23
#include "shared.h"
24
#include "filesys.h"
25
26
#define ENABLE_MINIMAL
27
#include <reiser4/libreiser4.h>
28
29
static reiser4_fs_t *fs = NULL;
30
static aal_device_t *dev = NULL;
31
static reiser4_object_t *object = NULL;
32
33
/* Read callback of grub specific device. It uses devread() for reading passed
34
   @count of device blocks starting from @blk to passed @buff. */
35
static errno_t grub_dev_read(aal_device_t *device,
36
			     void *buff, blk_t blk,
37
			     count_t count)
38
{
39
	unsigned int size;
40
	unsigned int factor;
41
	unsigned int sector;
42
43
	/* Calculating actual sector and size in bytes to be read from
44
	   device. */
45
	factor = device->blksize / SECTOR_SIZE;
46
	sector = (unsigned int)blk << aal_log2(factor);
47
	size = (unsigned int)count * (SECTOR_SIZE * factor);
48
	
49
	/* Reading from the current device */
50
        if (!devread(sector, 0, size, buff))
51
    	        return -EIO;
52
		
53
	return 0;
54
}
55
56
/* Length callback of grub device */
57
static count_t grub_dev_len(aal_device_t *device) {
58
	unsigned int factor;
59
60
	/* Getting partition length in device blocks */
61
	factor = device->blksize / SECTOR_SIZE;
62
	return (part_length >> aal_log2(factor));
63
}
64
65
/*
66
  Initializing grub device abstraction instance. It will use devread and friends
67
  for providing needed functionality.
68
*/
69
struct aal_device_ops grub_dev_ops = {
70
	.read   = grub_dev_read,
71
	.len    = grub_dev_len
72
};
73
74
/* Initializes reiser4 */
75
static int reiser4_init(void) {
76
	extern aal_hash_table_t *plugins;
77
	
78
	plugins = NULL;
79
80
	/* Initializing memory manager */
81
	aal_mem_init((void *)FSYS_BUF, FSYS_BUFLEN);
82
83
	/* Initializing device abstraction on current device GRUB uses. */
84
	if (!(dev = aal_device_open(&grub_dev_ops, NULL,
85
				    SECTOR_SIZE, 0)))
86
	{
87
		return 0;
88
	}
89
90
	/* Initializing libreiser4 (plugins, etc) */
91
	return !libreiser4_init();
92
}
93
94
#define MEMORY_WATERMARK 8192
95
96
/* Memory pressure detect function. */
97
static int mpressure_detect(reiser4_tree_t *tree) {
98
	return (aal_mem_free() <= MEMORY_WATERMARK);
99
}
100
101
/* Reiser4 mount() routine */
102
int reiser4_mount(void) {
103
	
104
	/* Initialize all reiser4 related stuff first */
105
	if (!reiser4_init())
106
		return 0;
107
	
108
	/* Open filesystem on @dev. */
109
	if (!(fs = reiser4_fs_open(dev)))
110
		return 0;
111
112
	fs->tree->mpc_func = mpressure_detect;
113
	
114
	object = NULL;
115
	return 1;
116
}
117
118
/* Reiser4 read() handler */
119
int reiser4_read(char *buf, int len) {
120
	int64_t read;
121
122
	if (object == NULL)
123
		return 0;
124
125
	/* Seet at current position denoted by @filepos */
126
	if (objplug(object)->o.object_ops->seek) {
127
		plug_call(objplug(object)->o.object_ops,
128
			  seek, object->ent, filepos);
129
	}
130
	
131
	/* Reading current file data starting from @filepos */
132
	disk_read_func = disk_read_hook;
133
	read = objplug(object)->o.object_ops->read ?
134
		plug_call(objplug(object)->o.object_ops, read, 
135
			  object->ent, buf, len) : -EINVAL;
136
	disk_read_func = NULL;
137
138
	if (read < 0) {
139
		errnum = ERR_FSYS_CORRUPT;
140
		return 0;
141
	}
142
143
    	filepos += read;
144
	return read;
145
}
146
147
/* Reiser4 file open() routine */
148
int reiser4_dir(char *dirname) {
149
	char *ch;
150
	
151
	if (fs == NULL)
152
		return 0;
153
154
	if (object != NULL) {
155
		plug_call(objplug(object)->o.object_ops, 
156
			  close, object->ent);
157
		aal_free(object);
158
		object = NULL;
159
	}
160
161
	/* Cutting out string after first space character */
162
    	if ((ch = aal_strchr(dirname, ' ')))
163
		*ch = '\0';
164
		
165
	/* This function is also called for getting directory list for
166
	   maintaining the bash-like completion. */
167
#ifndef STAGE1_5
168
	if (print_possibilities) {
169
		char entry[256];
170
		entry_hint_t entry_hint;
171
		
172
		/* Getting last part of name (jsut after last '/') */
173
		if (*(dirname + aal_strlen(dirname) - 1) != '/') {
174
		
175
			if (!(ch = aal_strrchr(dirname, '/'))) {
176
				errnum = ERR_BAD_FILETYPE;
177
				return 0;
178
			}
179
180
			aal_strncpy(entry, ch + 1, sizeof(entry));
181
			*(ch + 1) = '\0';
182
		} else {
183
			aal_memset(entry, 0, sizeof(entry));
184
		}
185
186
		/* Open obejct by @dirname */
187
		if (!(object = reiser4_semantic_open(fs->tree, dirname, 
188
						     NULL, 1))) 
189
		{
190
			errnum = ERR_FILE_NOT_FOUND;
191
			return 0;
192
		}
193
194
		/* Checking if it is a directory object */
195
		if (object->ent->opset.plug[OPSET_OBJ]->id.group != DIR_OBJECT)
196
		{
197
			/* If not, cutting out last '/' character */
198
    			if ((ch = aal_strrchr(dirname, '/')))
199
				*ch = '\0';
200
201
			/* Close current object */
202
			plug_call(objplug(object)->o.object_ops, 
203
				  close, object->ent);
204
			aal_free(object);
205
			return 0;
206
		}
207
		
208
		/* Reading the opened directory to build the completion list. */
209
		if (objplug(object)->o.object_ops->readdir) {
210
			while (plug_call(objplug(object)->o.object_ops, readdir,
211
					 object->ent, &entry_hint) > 0) 
212
			{
213
				if (substring(entry, entry_hint.name) <= 0) {
214
					if (print_possibilities > 0)
215
						print_possibilities = 
216
							-print_possibilities;
217
				
218
					print_a_completion(entry_hint.name);
219
				}
220
			}
221
		}
222
	} else {
223
#endif
224
		/* This is the case when resier4_dir() is called for open the
225
		   file @dirname, not for building completion list. */
226
		if (!(object = reiser4_semantic_open(fs->tree, dirname,
227
						     NULL, 1))) 
228
		{
229
			errnum = ERR_FILE_NOT_FOUND;
230
			return 0;
231
		}
232
		
233
		if (object->ent->opset.plug[OPSET_OBJ]->id.group != REG_OBJECT)
234
		{
235
			errnum = ERR_BAD_FILETYPE;
236
			return 0;
237
		}
238
		
239
		/* Initializing GRUB global variables @filepos and @filemax. */
240
		filepos = 0;
241
		filemax = reiser4_object_size(object);
242
	
243
		return 1;
244
#ifndef STAGE1_5
245
	}
246
247
	return 1;
248
#endif
249
250
	errnum = ERR_FILE_NOT_FOUND;
251
	return 0;
252
}
253
254
/* Returns how many sectors may be used for embeding reiser4_stage1_5 in teh
255
   case of installing GRUB to partition instead of MBR. */
256
int reiser4_embed (int *start_sector, int needed_sectors) {
257
	*start_sector = 1;
258
	return needed_sectors <= ((REISER4_MASTER_OFFSET >> SECTOR_BITS) - 1);
259
}
260
#endif /* FSYS_REISER4 */
(-)grub-0.96.orig/stage2/shared.h (-5 / +8 lines)
Lines 207-217 Link Here
207
#define STAGE2_ID_FAT_STAGE1_5		3
207
#define STAGE2_ID_FAT_STAGE1_5		3
208
#define STAGE2_ID_MINIX_STAGE1_5	4
208
#define STAGE2_ID_MINIX_STAGE1_5	4
209
#define STAGE2_ID_REISERFS_STAGE1_5	5
209
#define STAGE2_ID_REISERFS_STAGE1_5	5
210
#define STAGE2_ID_VSTAFS_STAGE1_5	6
210
#define STAGE2_ID_REISER4_STAGE1_5	6
211
#define STAGE2_ID_JFS_STAGE1_5		7
211
#define STAGE2_ID_VSTAFS_STAGE1_5	7
212
#define STAGE2_ID_XFS_STAGE1_5		8
212
#define STAGE2_ID_JFS_STAGE1_5		8
213
#define STAGE2_ID_ISO9660_STAGE1_5	9
213
#define STAGE2_ID_XFS_STAGE1_5		9
214
#define STAGE2_ID_UFS2_STAGE1_5		10
214
#define STAGE2_ID_ISO9660_STAGE1_5	10
215
#define STAGE2_ID_UFS2_STAGE1_5		11
215
216
216
#ifndef STAGE1_5
217
#ifndef STAGE1_5
217
# define STAGE2_ID	STAGE2_ID_STAGE2
218
# define STAGE2_ID	STAGE2_ID_STAGE2
Lines 226-231 Link Here
226
#  define STAGE2_ID	STAGE2_ID_MINIX_STAGE1_5
227
#  define STAGE2_ID	STAGE2_ID_MINIX_STAGE1_5
227
# elif defined(FSYS_REISERFS)
228
# elif defined(FSYS_REISERFS)
228
#  define STAGE2_ID	STAGE2_ID_REISERFS_STAGE1_5
229
#  define STAGE2_ID	STAGE2_ID_REISERFS_STAGE1_5
230
# elif defined(FSYS_REISER4)
231
#  define STAGE2_ID	STAGE2_ID_REISER4_STAGE1_5
229
# elif defined(FSYS_VSTAFS)
232
# elif defined(FSYS_VSTAFS)
230
#  define STAGE2_ID	STAGE2_ID_VSTAFS_STAGE1_5
233
#  define STAGE2_ID	STAGE2_ID_VSTAFS_STAGE1_5
231
# elif defined(FSYS_JFS)
234
# elif defined(FSYS_JFS)

Return to bug 69590