2005-10-24 Marco Gerards <mgerards@xs4all.nl>

* include/grub/parser.h: New file.

	* kern/parser.c: Likewise.

	* conf/i386-pc.rmk (kernel_img_SOURCES): Add `kern/parser.c'.
	(grub_setup_SOURCES): Likewise.
	(grub_probefs_SOURCES): Likewise.
	(grub_emu_SOURCES): Likewise.
	(kernel_img_HEADERS): Add `parser.h'.

	* conf/powerpc-ieee1275.rmk (grubof_HEADERS): Add `parser.h'.
	(grub_emu_SOURCES): Add `kern/parser.c'.
	(grubof_SOURCES): Likewise.

	* conf/sparc64-ieee1275.rmk (grubof_HEADERS): Add `parser.h'.
	(grubof_SOURCES): Add `kern/parser.c'.

	* include/grub/misc.h (grub_split_cmdline): Removed prototype.

	* kern/misc.c (grub_split_cmdline): Removed function.

	* kern/rescue.c: Include <grub/parser.h>.
	(grub_enter_rescue_mode): Use `grub_parser_split_cmdline' instead
	of `grub_split_cmdline'.

	* normal/command.c: Include <grub/parser.h>.
	(grub_command_execute):  Use `grub_parser_split_cmdline' instead
	of `grub_split_cmdline'.

	* normal/completion.c: Include <grub/parser.h>.
	(cmdline_state): New variable.
	(iterate_dir): End the filename with a quote depending on the
	command line state.
	(get_state): new function.
	(grub_normal_do_completion): Use `grub_parser_split_cmdline' to
	split the arguments and determine the current argument.  When the
	argument string is not quoted, escape all spaces.
This commit is contained in:
marco_g 2005-10-24 10:23:46 +00:00
parent 6d8f4b0e60
commit 04ccf3ec6f
14 changed files with 531 additions and 324 deletions

View file

@ -1,3 +1,43 @@
2005-10-24 Marco Gerards <mgerards@xs4all.nl>
* include/grub/parser.h: New file.
* kern/parser.c: Likewise.
* conf/i386-pc.rmk (kernel_img_SOURCES): Add `kern/parser.c'.
(grub_setup_SOURCES): Likewise.
(grub_probefs_SOURCES): Likewise.
(grub_emu_SOURCES): Likewise.
(kernel_img_HEADERS): Add `parser.h'.
* conf/powerpc-ieee1275.rmk (grubof_HEADERS): Add `parser.h'.
(grub_emu_SOURCES): Add `kern/parser.c'.
(grubof_SOURCES): Likewise.
* conf/sparc64-ieee1275.rmk (grubof_HEADERS): Add `parser.h'.
(grubof_SOURCES): Add `kern/parser.c'.
* include/grub/misc.h (grub_split_cmdline): Removed prototype.
* kern/misc.c (grub_split_cmdline): Removed function.
* kern/rescue.c: Include <grub/parser.h>.
(grub_enter_rescue_mode): Use `grub_parser_split_cmdline' instead
of `grub_split_cmdline'.
* normal/command.c: Include <grub/parser.h>.
(grub_command_execute): Use `grub_parser_split_cmdline' instead
of `grub_split_cmdline'.
* normal/completion.c: Include <grub/parser.h>.
(cmdline_state): New variable.
(iterate_dir): End the filename with a quote depending on the
command line state.
(get_state): new function.
(grub_normal_do_completion): Use `grub_parser_split_cmdline' to
split the arguments and determine the current argument. When the
argument string is not quoted, escape all spaces.
2005-10-23 Vincent Pelletier <subdino2004@yahoo.fr> 2005-10-23 Vincent Pelletier <subdino2004@yahoo.fr>
* normal/sparc64/setjmp.S: New file. * normal/sparc64/setjmp.S: New file.

View file

@ -77,17 +77,17 @@ diskboot_img_LDFLAGS = -nostdlib -Wl,-N,-Ttext,8000
kernel_img_SOURCES = kern/i386/pc/startup.S kern/main.c kern/device.c \ kernel_img_SOURCES = kern/i386/pc/startup.S kern/main.c kern/device.c \
kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \ kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \
kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \
kern/i386/dl.c kern/i386/pc/init.c kern/partition.c \ kern/i386/dl.c kern/i386/pc/init.c kern/parser.c kern/partition.c \
kern/env.c disk/i386/pc/biosdisk.c \ kern/env.c disk/i386/pc/biosdisk.c \
term/i386/pc/console.c \ term/i386/pc/console.c \
symlist.c symlist.c
CLEANFILES += kernel.img kernel.exec kernel_img-kern_i386_pc_startup.o kernel_img-kern_main.o kernel_img-kern_device.o kernel_img-kern_disk.o kernel_img-kern_dl.o kernel_img-kern_file.o kernel_img-kern_fs.o kernel_img-kern_err.o kernel_img-kern_misc.o kernel_img-kern_mm.o kernel_img-kern_loader.o kernel_img-kern_rescue.o kernel_img-kern_term.o kernel_img-kern_i386_dl.o kernel_img-kern_i386_pc_init.o kernel_img-kern_partition.o kernel_img-kern_env.o kernel_img-disk_i386_pc_biosdisk.o kernel_img-term_i386_pc_console.o kernel_img-symlist.o CLEANFILES += kernel.img kernel.exec kernel_img-kern_i386_pc_startup.o kernel_img-kern_main.o kernel_img-kern_device.o kernel_img-kern_disk.o kernel_img-kern_dl.o kernel_img-kern_file.o kernel_img-kern_fs.o kernel_img-kern_err.o kernel_img-kern_misc.o kernel_img-kern_mm.o kernel_img-kern_loader.o kernel_img-kern_rescue.o kernel_img-kern_term.o kernel_img-kern_i386_dl.o kernel_img-kern_i386_pc_init.o kernel_img-kern_parser.o kernel_img-kern_partition.o kernel_img-kern_env.o kernel_img-disk_i386_pc_biosdisk.o kernel_img-term_i386_pc_console.o kernel_img-symlist.o
MOSTLYCLEANFILES += kernel_img-kern_i386_pc_startup.d kernel_img-kern_main.d kernel_img-kern_device.d kernel_img-kern_disk.d kernel_img-kern_dl.d kernel_img-kern_file.d kernel_img-kern_fs.d kernel_img-kern_err.d kernel_img-kern_misc.d kernel_img-kern_mm.d kernel_img-kern_loader.d kernel_img-kern_rescue.d kernel_img-kern_term.d kernel_img-kern_i386_dl.d kernel_img-kern_i386_pc_init.d kernel_img-kern_partition.d kernel_img-kern_env.d kernel_img-disk_i386_pc_biosdisk.d kernel_img-term_i386_pc_console.d kernel_img-symlist.d MOSTLYCLEANFILES += kernel_img-kern_i386_pc_startup.d kernel_img-kern_main.d kernel_img-kern_device.d kernel_img-kern_disk.d kernel_img-kern_dl.d kernel_img-kern_file.d kernel_img-kern_fs.d kernel_img-kern_err.d kernel_img-kern_misc.d kernel_img-kern_mm.d kernel_img-kern_loader.d kernel_img-kern_rescue.d kernel_img-kern_term.d kernel_img-kern_i386_dl.d kernel_img-kern_i386_pc_init.d kernel_img-kern_parser.d kernel_img-kern_partition.d kernel_img-kern_env.d kernel_img-disk_i386_pc_biosdisk.d kernel_img-term_i386_pc_console.d kernel_img-symlist.d
kernel.img: kernel.exec kernel.img: kernel.exec
$(OBJCOPY) -O binary -R .note -R .comment $< $@ $(OBJCOPY) -O binary -R .note -R .comment $< $@
kernel.exec: kernel_img-kern_i386_pc_startup.o kernel_img-kern_main.o kernel_img-kern_device.o kernel_img-kern_disk.o kernel_img-kern_dl.o kernel_img-kern_file.o kernel_img-kern_fs.o kernel_img-kern_err.o kernel_img-kern_misc.o kernel_img-kern_mm.o kernel_img-kern_loader.o kernel_img-kern_rescue.o kernel_img-kern_term.o kernel_img-kern_i386_dl.o kernel_img-kern_i386_pc_init.o kernel_img-kern_partition.o kernel_img-kern_env.o kernel_img-disk_i386_pc_biosdisk.o kernel_img-term_i386_pc_console.o kernel_img-symlist.o kernel.exec: kernel_img-kern_i386_pc_startup.o kernel_img-kern_main.o kernel_img-kern_device.o kernel_img-kern_disk.o kernel_img-kern_dl.o kernel_img-kern_file.o kernel_img-kern_fs.o kernel_img-kern_err.o kernel_img-kern_misc.o kernel_img-kern_mm.o kernel_img-kern_loader.o kernel_img-kern_rescue.o kernel_img-kern_term.o kernel_img-kern_i386_dl.o kernel_img-kern_i386_pc_init.o kernel_img-kern_parser.o kernel_img-kern_partition.o kernel_img-kern_env.o kernel_img-disk_i386_pc_biosdisk.o kernel_img-term_i386_pc_console.o kernel_img-symlist.o
$(CC) -o $@ $^ $(LDFLAGS) $(kernel_img_LDFLAGS) $(CC) -o $@ $^ $(LDFLAGS) $(kernel_img_LDFLAGS)
kernel_img-kern_i386_pc_startup.o: kern/i386/pc/startup.S kernel_img-kern_i386_pc_startup.o: kern/i386/pc/startup.S
@ -210,6 +210,14 @@ kernel_img-kern_i386_pc_init.d: kern/i386/pc/init.c
-include kernel_img-kern_i386_pc_init.d -include kernel_img-kern_i386_pc_init.d
kernel_img-kern_parser.o: kern/parser.c
$(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
kernel_img-kern_parser.d: kern/parser.c
set -e; $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_img_CFLAGS) -M $< | sed 's,parser\.o[ :]*,kernel_img-kern_parser.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@
-include kernel_img-kern_parser.d
kernel_img-kern_partition.o: kern/partition.c kernel_img-kern_partition.o: kern/partition.c
$(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $< $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
@ -251,7 +259,7 @@ kernel_img-symlist.d: symlist.c
-include kernel_img-symlist.d -include kernel_img-symlist.d
kernel_img_HEADERS = arg.h boot.h device.h disk.h dl.h elf.h env.h err.h \ kernel_img_HEADERS = arg.h boot.h device.h disk.h dl.h elf.h env.h err.h \
file.h fs.h kernel.h loader.h misc.h mm.h net.h partition.h \ file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h partition.h \
pc_partition.h rescue.h symbol.h term.h types.h \ pc_partition.h rescue.h symbol.h term.h types.h \
machine/biosdisk.h machine/boot.h machine/console.h machine/init.h \ machine/biosdisk.h machine/boot.h machine/console.h machine/init.h \
machine/memory.h machine/loader.h machine/time.h machine/vga.h \ machine/memory.h machine/loader.h machine/time.h machine/vga.h \
@ -313,12 +321,12 @@ grub_mkimage_LDFLAGS = $(LIBLZO)
grub_setup_SOURCES = util/i386/pc/grub-setup.c util/i386/pc/biosdisk.c \ grub_setup_SOURCES = util/i386/pc/grub-setup.c util/i386/pc/biosdisk.c \
util/misc.c util/i386/pc/getroot.c kern/device.c kern/disk.c \ util/misc.c util/i386/pc/getroot.c kern/device.c kern/disk.c \
kern/err.c kern/misc.c fs/fat.c fs/ext2.c fs/xfs.c fs/affs.c \ kern/err.c kern/misc.c fs/fat.c fs/ext2.c fs/xfs.c fs/affs.c \
fs/sfs.c kern/partition.c partmap/pc.c \ fs/sfs.c kern/parser.c kern/partition.c partmap/pc.c \
fs/ufs.c fs/minix.c fs/hfs.c fs/jfs.c kern/file.c kern/fs.c kern/env.c fs/fshelp.c fs/ufs.c fs/minix.c fs/hfs.c fs/jfs.c kern/file.c kern/fs.c kern/env.c fs/fshelp.c
CLEANFILES += grub-setup grub_setup-util_i386_pc_grub_setup.o grub_setup-util_i386_pc_biosdisk.o grub_setup-util_misc.o grub_setup-util_i386_pc_getroot.o grub_setup-kern_device.o grub_setup-kern_disk.o grub_setup-kern_err.o grub_setup-kern_misc.o grub_setup-fs_fat.o grub_setup-fs_ext2.o grub_setup-fs_xfs.o grub_setup-fs_affs.o grub_setup-fs_sfs.o grub_setup-kern_partition.o grub_setup-partmap_pc.o grub_setup-fs_ufs.o grub_setup-fs_minix.o grub_setup-fs_hfs.o grub_setup-fs_jfs.o grub_setup-kern_file.o grub_setup-kern_fs.o grub_setup-kern_env.o grub_setup-fs_fshelp.o CLEANFILES += grub-setup grub_setup-util_i386_pc_grub_setup.o grub_setup-util_i386_pc_biosdisk.o grub_setup-util_misc.o grub_setup-util_i386_pc_getroot.o grub_setup-kern_device.o grub_setup-kern_disk.o grub_setup-kern_err.o grub_setup-kern_misc.o grub_setup-fs_fat.o grub_setup-fs_ext2.o grub_setup-fs_xfs.o grub_setup-fs_affs.o grub_setup-fs_sfs.o grub_setup-kern_parser.o grub_setup-kern_partition.o grub_setup-partmap_pc.o grub_setup-fs_ufs.o grub_setup-fs_minix.o grub_setup-fs_hfs.o grub_setup-fs_jfs.o grub_setup-kern_file.o grub_setup-kern_fs.o grub_setup-kern_env.o grub_setup-fs_fshelp.o
MOSTLYCLEANFILES += grub_setup-util_i386_pc_grub_setup.d grub_setup-util_i386_pc_biosdisk.d grub_setup-util_misc.d grub_setup-util_i386_pc_getroot.d grub_setup-kern_device.d grub_setup-kern_disk.d grub_setup-kern_err.d grub_setup-kern_misc.d grub_setup-fs_fat.d grub_setup-fs_ext2.d grub_setup-fs_xfs.d grub_setup-fs_affs.d grub_setup-fs_sfs.d grub_setup-kern_partition.d grub_setup-partmap_pc.d grub_setup-fs_ufs.d grub_setup-fs_minix.d grub_setup-fs_hfs.d grub_setup-fs_jfs.d grub_setup-kern_file.d grub_setup-kern_fs.d grub_setup-kern_env.d grub_setup-fs_fshelp.d MOSTLYCLEANFILES += grub_setup-util_i386_pc_grub_setup.d grub_setup-util_i386_pc_biosdisk.d grub_setup-util_misc.d grub_setup-util_i386_pc_getroot.d grub_setup-kern_device.d grub_setup-kern_disk.d grub_setup-kern_err.d grub_setup-kern_misc.d grub_setup-fs_fat.d grub_setup-fs_ext2.d grub_setup-fs_xfs.d grub_setup-fs_affs.d grub_setup-fs_sfs.d grub_setup-kern_parser.d grub_setup-kern_partition.d grub_setup-partmap_pc.d grub_setup-fs_ufs.d grub_setup-fs_minix.d grub_setup-fs_hfs.d grub_setup-fs_jfs.d grub_setup-kern_file.d grub_setup-kern_fs.d grub_setup-kern_env.d grub_setup-fs_fshelp.d
grub-setup: grub_setup-util_i386_pc_grub_setup.o grub_setup-util_i386_pc_biosdisk.o grub_setup-util_misc.o grub_setup-util_i386_pc_getroot.o grub_setup-kern_device.o grub_setup-kern_disk.o grub_setup-kern_err.o grub_setup-kern_misc.o grub_setup-fs_fat.o grub_setup-fs_ext2.o grub_setup-fs_xfs.o grub_setup-fs_affs.o grub_setup-fs_sfs.o grub_setup-kern_partition.o grub_setup-partmap_pc.o grub_setup-fs_ufs.o grub_setup-fs_minix.o grub_setup-fs_hfs.o grub_setup-fs_jfs.o grub_setup-kern_file.o grub_setup-kern_fs.o grub_setup-kern_env.o grub_setup-fs_fshelp.o grub-setup: grub_setup-util_i386_pc_grub_setup.o grub_setup-util_i386_pc_biosdisk.o grub_setup-util_misc.o grub_setup-util_i386_pc_getroot.o grub_setup-kern_device.o grub_setup-kern_disk.o grub_setup-kern_err.o grub_setup-kern_misc.o grub_setup-fs_fat.o grub_setup-fs_ext2.o grub_setup-fs_xfs.o grub_setup-fs_affs.o grub_setup-fs_sfs.o grub_setup-kern_parser.o grub_setup-kern_partition.o grub_setup-partmap_pc.o grub_setup-fs_ufs.o grub_setup-fs_minix.o grub_setup-fs_hfs.o grub_setup-fs_jfs.o grub_setup-kern_file.o grub_setup-kern_fs.o grub_setup-kern_env.o grub_setup-fs_fshelp.o
$(BUILD_CC) -o $@ $^ $(BUILD_LDFLAGS) $(grub_setup_LDFLAGS) $(BUILD_CC) -o $@ $^ $(BUILD_LDFLAGS) $(grub_setup_LDFLAGS)
grub_setup-util_i386_pc_grub_setup.o: util/i386/pc/grub-setup.c grub_setup-util_i386_pc_grub_setup.o: util/i386/pc/grub-setup.c
@ -425,6 +433,14 @@ grub_setup-fs_sfs.d: fs/sfs.c
-include grub_setup-fs_sfs.d -include grub_setup-fs_sfs.d
grub_setup-kern_parser.o: kern/parser.c
$(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
grub_setup-kern_parser.d: kern/parser.c
set -e; $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $< | sed 's,parser\.o[ :]*,grub_setup-kern_parser.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@
-include grub_setup-kern_parser.d
grub_setup-kern_partition.o: kern/partition.c grub_setup-kern_partition.o: kern/partition.c
$(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $< $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
@ -535,13 +551,13 @@ grub_mkdevicemap-util_misc.d: util/misc.c
grub_probefs_SOURCES = util/i386/pc/grub-probefs.c \ grub_probefs_SOURCES = util/i386/pc/grub-probefs.c \
util/i386/pc/biosdisk.c util/misc.c util/i386/pc/getroot.c \ util/i386/pc/biosdisk.c util/misc.c util/i386/pc/getroot.c \
kern/device.c kern/disk.c kern/err.c kern/misc.c fs/fat.c \ kern/device.c kern/disk.c kern/err.c kern/misc.c fs/fat.c \
fs/ext2.c kern/partition.c partmap/pc.c fs/ufs.c fs/minix.c \ fs/ext2.c kern/parser.c kern/partition.c partmap/pc.c fs/ufs.c \
fs/hfs.c fs/jfs.c kern/fs.c kern/env.c fs/fshelp.c fs/xfs.c \ fs/minix.c fs/hfs.c fs/jfs.c kern/fs.c kern/env.c fs/fshelp.c \
fs/affs.c fs/sfs.c fs/xfs.c fs/affs.c fs/sfs.c
CLEANFILES += grub-probefs grub_probefs-util_i386_pc_grub_probefs.o grub_probefs-util_i386_pc_biosdisk.o grub_probefs-util_misc.o grub_probefs-util_i386_pc_getroot.o grub_probefs-kern_device.o grub_probefs-kern_disk.o grub_probefs-kern_err.o grub_probefs-kern_misc.o grub_probefs-fs_fat.o grub_probefs-fs_ext2.o grub_probefs-kern_partition.o grub_probefs-partmap_pc.o grub_probefs-fs_ufs.o grub_probefs-fs_minix.o grub_probefs-fs_hfs.o grub_probefs-fs_jfs.o grub_probefs-kern_fs.o grub_probefs-kern_env.o grub_probefs-fs_fshelp.o grub_probefs-fs_xfs.o grub_probefs-fs_affs.o grub_probefs-fs_sfs.o CLEANFILES += grub-probefs grub_probefs-util_i386_pc_grub_probefs.o grub_probefs-util_i386_pc_biosdisk.o grub_probefs-util_misc.o grub_probefs-util_i386_pc_getroot.o grub_probefs-kern_device.o grub_probefs-kern_disk.o grub_probefs-kern_err.o grub_probefs-kern_misc.o grub_probefs-fs_fat.o grub_probefs-fs_ext2.o grub_probefs-kern_parser.o grub_probefs-kern_partition.o grub_probefs-partmap_pc.o grub_probefs-fs_ufs.o grub_probefs-fs_minix.o grub_probefs-fs_hfs.o grub_probefs-fs_jfs.o grub_probefs-kern_fs.o grub_probefs-kern_env.o grub_probefs-fs_fshelp.o grub_probefs-fs_xfs.o grub_probefs-fs_affs.o grub_probefs-fs_sfs.o
MOSTLYCLEANFILES += grub_probefs-util_i386_pc_grub_probefs.d grub_probefs-util_i386_pc_biosdisk.d grub_probefs-util_misc.d grub_probefs-util_i386_pc_getroot.d grub_probefs-kern_device.d grub_probefs-kern_disk.d grub_probefs-kern_err.d grub_probefs-kern_misc.d grub_probefs-fs_fat.d grub_probefs-fs_ext2.d grub_probefs-kern_partition.d grub_probefs-partmap_pc.d grub_probefs-fs_ufs.d grub_probefs-fs_minix.d grub_probefs-fs_hfs.d grub_probefs-fs_jfs.d grub_probefs-kern_fs.d grub_probefs-kern_env.d grub_probefs-fs_fshelp.d grub_probefs-fs_xfs.d grub_probefs-fs_affs.d grub_probefs-fs_sfs.d MOSTLYCLEANFILES += grub_probefs-util_i386_pc_grub_probefs.d grub_probefs-util_i386_pc_biosdisk.d grub_probefs-util_misc.d grub_probefs-util_i386_pc_getroot.d grub_probefs-kern_device.d grub_probefs-kern_disk.d grub_probefs-kern_err.d grub_probefs-kern_misc.d grub_probefs-fs_fat.d grub_probefs-fs_ext2.d grub_probefs-kern_parser.d grub_probefs-kern_partition.d grub_probefs-partmap_pc.d grub_probefs-fs_ufs.d grub_probefs-fs_minix.d grub_probefs-fs_hfs.d grub_probefs-fs_jfs.d grub_probefs-kern_fs.d grub_probefs-kern_env.d grub_probefs-fs_fshelp.d grub_probefs-fs_xfs.d grub_probefs-fs_affs.d grub_probefs-fs_sfs.d
grub-probefs: grub_probefs-util_i386_pc_grub_probefs.o grub_probefs-util_i386_pc_biosdisk.o grub_probefs-util_misc.o grub_probefs-util_i386_pc_getroot.o grub_probefs-kern_device.o grub_probefs-kern_disk.o grub_probefs-kern_err.o grub_probefs-kern_misc.o grub_probefs-fs_fat.o grub_probefs-fs_ext2.o grub_probefs-kern_partition.o grub_probefs-partmap_pc.o grub_probefs-fs_ufs.o grub_probefs-fs_minix.o grub_probefs-fs_hfs.o grub_probefs-fs_jfs.o grub_probefs-kern_fs.o grub_probefs-kern_env.o grub_probefs-fs_fshelp.o grub_probefs-fs_xfs.o grub_probefs-fs_affs.o grub_probefs-fs_sfs.o grub-probefs: grub_probefs-util_i386_pc_grub_probefs.o grub_probefs-util_i386_pc_biosdisk.o grub_probefs-util_misc.o grub_probefs-util_i386_pc_getroot.o grub_probefs-kern_device.o grub_probefs-kern_disk.o grub_probefs-kern_err.o grub_probefs-kern_misc.o grub_probefs-fs_fat.o grub_probefs-fs_ext2.o grub_probefs-kern_parser.o grub_probefs-kern_partition.o grub_probefs-partmap_pc.o grub_probefs-fs_ufs.o grub_probefs-fs_minix.o grub_probefs-fs_hfs.o grub_probefs-fs_jfs.o grub_probefs-kern_fs.o grub_probefs-kern_env.o grub_probefs-fs_fshelp.o grub_probefs-fs_xfs.o grub_probefs-fs_affs.o grub_probefs-fs_sfs.o
$(BUILD_CC) -o $@ $^ $(BUILD_LDFLAGS) $(grub_probefs_LDFLAGS) $(BUILD_CC) -o $@ $^ $(BUILD_LDFLAGS) $(grub_probefs_LDFLAGS)
grub_probefs-util_i386_pc_grub_probefs.o: util/i386/pc/grub-probefs.c grub_probefs-util_i386_pc_grub_probefs.o: util/i386/pc/grub-probefs.c
@ -624,6 +640,14 @@ grub_probefs-fs_ext2.d: fs/ext2.c
-include grub_probefs-fs_ext2.d -include grub_probefs-fs_ext2.d
grub_probefs-kern_parser.o: kern/parser.c
$(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
grub_probefs-kern_parser.d: kern/parser.c
set -e; $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $< | sed 's,parser\.o[ :]*,grub_probefs-kern_parser.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@
-include grub_probefs-kern_parser.d
grub_probefs-kern_partition.o: kern/partition.c grub_probefs-kern_partition.o: kern/partition.c
$(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $< $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
@ -733,7 +757,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \
io/gzio.c \ io/gzio.c \
kern/device.c kern/disk.c kern/dl.c kern/env.c kern/err.c \ kern/device.c kern/disk.c kern/dl.c kern/env.c kern/err.c \
kern/file.c kern/fs.c kern/loader.c kern/main.c kern/misc.c \ kern/file.c kern/fs.c kern/loader.c kern/main.c kern/misc.c \
kern/partition.c kern/rescue.c kern/term.c \ kern/parser.c kern/partition.c kern/rescue.c kern/term.c \
normal/arg.c normal/cmdline.c normal/command.c \ normal/arg.c normal/cmdline.c normal/command.c \
normal/completion.c normal/context.c normal/main.c \ normal/completion.c normal/context.c normal/main.c \
normal/menu.c normal/menu_entry.c normal/misc.c \ normal/menu.c normal/menu_entry.c normal/misc.c \
@ -741,10 +765,10 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \
util/console.c util/grub-emu.c util/misc.c \ util/console.c util/grub-emu.c util/misc.c \
util/i386/pc/biosdisk.c util/i386/pc/getroot.c \ util/i386/pc/biosdisk.c util/i386/pc/getroot.c \
util/i386/pc/misc.c util/i386/pc/misc.c
CLEANFILES += grub-emu grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_default.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_search.o grub_emu-commands_timeout.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_i386_pc_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_fshelp.o grub_emu-fs_hfs.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_context.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-util_console.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_i386_pc_biosdisk.o grub_emu-util_i386_pc_getroot.o grub_emu-util_i386_pc_misc.o CLEANFILES += grub-emu grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_default.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_search.o grub_emu-commands_timeout.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_i386_pc_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_fshelp.o grub_emu-fs_hfs.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_context.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-util_console.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_i386_pc_biosdisk.o grub_emu-util_i386_pc_getroot.o grub_emu-util_i386_pc_misc.o
MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_default.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_search.d grub_emu-commands_timeout.d grub_emu-commands_i386_pc_halt.d grub_emu-commands_i386_pc_reboot.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_fshelp.d grub_emu-fs_hfs.d grub_emu-fs_iso9660.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_completion.d grub_emu-normal_context.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-util_console.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_i386_pc_biosdisk.d grub_emu-util_i386_pc_getroot.d grub_emu-util_i386_pc_misc.d MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_default.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_search.d grub_emu-commands_timeout.d grub_emu-commands_i386_pc_halt.d grub_emu-commands_i386_pc_reboot.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_fshelp.d grub_emu-fs_hfs.d grub_emu-fs_iso9660.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_completion.d grub_emu-normal_context.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-util_console.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_i386_pc_biosdisk.d grub_emu-util_i386_pc_getroot.d grub_emu-util_i386_pc_misc.d
grub-emu: grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_default.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_search.o grub_emu-commands_timeout.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_i386_pc_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_fshelp.o grub_emu-fs_hfs.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_context.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-util_console.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_i386_pc_biosdisk.o grub_emu-util_i386_pc_getroot.o grub_emu-util_i386_pc_misc.o grub-emu: grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_default.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_search.o grub_emu-commands_timeout.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_i386_pc_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_fshelp.o grub_emu-fs_hfs.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_context.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-util_console.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_i386_pc_biosdisk.o grub_emu-util_i386_pc_getroot.o grub_emu-util_i386_pc_misc.o
$(BUILD_CC) -o $@ $^ $(BUILD_LDFLAGS) $(grub_emu_LDFLAGS) $(BUILD_CC) -o $@ $^ $(BUILD_LDFLAGS) $(grub_emu_LDFLAGS)
grub_emu-commands_boot.o: commands/boot.c grub_emu-commands_boot.o: commands/boot.c
@ -1027,6 +1051,14 @@ grub_emu-kern_misc.d: kern/misc.c
-include grub_emu-kern_misc.d -include grub_emu-kern_misc.d
grub_emu-kern_parser.o: kern/parser.c
$(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
grub_emu-kern_parser.d: kern/parser.c
set -e; $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $< | sed 's,parser\.o[ :]*,grub_emu-kern_parser.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@
-include grub_emu-kern_parser.d
grub_emu-kern_partition.o: kern/partition.c grub_emu-kern_partition.o: kern/partition.c
$(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $< $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<

View file

@ -26,12 +26,12 @@ diskboot_img_LDFLAGS = -nostdlib -Wl,-N,-Ttext,8000
kernel_img_SOURCES = kern/i386/pc/startup.S kern/main.c kern/device.c \ kernel_img_SOURCES = kern/i386/pc/startup.S kern/main.c kern/device.c \
kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \ kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \
kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \
kern/i386/dl.c kern/i386/pc/init.c kern/partition.c \ kern/i386/dl.c kern/i386/pc/init.c kern/parser.c kern/partition.c \
kern/env.c disk/i386/pc/biosdisk.c \ kern/env.c disk/i386/pc/biosdisk.c \
term/i386/pc/console.c \ term/i386/pc/console.c \
symlist.c symlist.c
kernel_img_HEADERS = arg.h boot.h device.h disk.h dl.h elf.h env.h err.h \ kernel_img_HEADERS = arg.h boot.h device.h disk.h dl.h elf.h env.h err.h \
file.h fs.h kernel.h loader.h misc.h mm.h net.h partition.h \ file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h partition.h \
pc_partition.h rescue.h symbol.h term.h types.h \ pc_partition.h rescue.h symbol.h term.h types.h \
machine/biosdisk.h machine/boot.h machine/console.h machine/init.h \ machine/biosdisk.h machine/boot.h machine/console.h machine/init.h \
machine/memory.h machine/loader.h machine/time.h machine/vga.h \ machine/memory.h machine/loader.h machine/time.h machine/vga.h \
@ -63,7 +63,7 @@ grub_mkimage_LDFLAGS = $(LIBLZO)
grub_setup_SOURCES = util/i386/pc/grub-setup.c util/i386/pc/biosdisk.c \ grub_setup_SOURCES = util/i386/pc/grub-setup.c util/i386/pc/biosdisk.c \
util/misc.c util/i386/pc/getroot.c kern/device.c kern/disk.c \ util/misc.c util/i386/pc/getroot.c kern/device.c kern/disk.c \
kern/err.c kern/misc.c fs/fat.c fs/ext2.c fs/xfs.c fs/affs.c \ kern/err.c kern/misc.c fs/fat.c fs/ext2.c fs/xfs.c fs/affs.c \
fs/sfs.c kern/partition.c partmap/pc.c \ fs/sfs.c kern/parser.c kern/partition.c partmap/pc.c \
fs/ufs.c fs/minix.c fs/hfs.c fs/jfs.c kern/file.c kern/fs.c kern/env.c fs/fshelp.c fs/ufs.c fs/minix.c fs/hfs.c fs/jfs.c kern/file.c kern/fs.c kern/env.c fs/fshelp.c
# For grub-mkdevicemap. # For grub-mkdevicemap.
@ -73,9 +73,9 @@ grub_mkdevicemap_SOURCES = util/i386/pc/grub-mkdevicemap.c util/misc.c
grub_probefs_SOURCES = util/i386/pc/grub-probefs.c \ grub_probefs_SOURCES = util/i386/pc/grub-probefs.c \
util/i386/pc/biosdisk.c util/misc.c util/i386/pc/getroot.c \ util/i386/pc/biosdisk.c util/misc.c util/i386/pc/getroot.c \
kern/device.c kern/disk.c kern/err.c kern/misc.c fs/fat.c \ kern/device.c kern/disk.c kern/err.c kern/misc.c fs/fat.c \
fs/ext2.c kern/partition.c partmap/pc.c fs/ufs.c fs/minix.c \ fs/ext2.c kern/parser.c kern/partition.c partmap/pc.c fs/ufs.c \
fs/hfs.c fs/jfs.c kern/fs.c kern/env.c fs/fshelp.c fs/xfs.c \ fs/minix.c fs/hfs.c fs/jfs.c kern/fs.c kern/env.c fs/fshelp.c \
fs/affs.c fs/sfs.c fs/xfs.c fs/affs.c fs/sfs.c
# For grub-emu. # For grub-emu.
grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \
@ -89,7 +89,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \
io/gzio.c \ io/gzio.c \
kern/device.c kern/disk.c kern/dl.c kern/env.c kern/err.c \ kern/device.c kern/disk.c kern/dl.c kern/env.c kern/err.c \
kern/file.c kern/fs.c kern/loader.c kern/main.c kern/misc.c \ kern/file.c kern/fs.c kern/loader.c kern/main.c kern/misc.c \
kern/partition.c kern/rescue.c kern/term.c \ kern/parser.c kern/partition.c kern/rescue.c kern/term.c \
normal/arg.c normal/cmdline.c normal/command.c \ normal/arg.c normal/cmdline.c normal/command.c \
normal/completion.c normal/context.c normal/main.c \ normal/completion.c normal/context.c normal/main.c \
normal/menu.c normal/menu_entry.c normal/misc.c \ normal/menu.c normal/menu_entry.c normal/misc.c \

View file

@ -10,7 +10,7 @@ MOSTLYCLEANFILES += grubof_symlist.c kernel_syms.lst
DEFSYMFILES += kernel_syms.lst DEFSYMFILES += kernel_syms.lst
grubof_HEADERS = arg.h boot.h device.h disk.h dl.h elf.h env.h err.h \ grubof_HEADERS = arg.h boot.h device.h disk.h dl.h elf.h env.h err.h \
file.h fs.h kernel.h misc.h mm.h net.h rescue.h symbol.h \ file.h fs.h kernel.h misc.h mm.h net.h parser.h rescue.h symbol.h \
term.h types.h powerpc/libgcc.h loader.h \ term.h types.h powerpc/libgcc.h loader.h \
partition.h pc_partition.h ieee1275/ieee1275.h machine/time.h \ partition.h pc_partition.h ieee1275/ieee1275.h machine/time.h \
machine/kernel.h machine/kernel.h
@ -74,18 +74,18 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \
io/gzio.c \ io/gzio.c \
kern/device.c kern/disk.c kern/dl.c kern/env.c kern/err.c \ kern/device.c kern/disk.c kern/dl.c kern/env.c kern/err.c \
kern/file.c kern/fs.c kern/loader.c kern/main.c kern/misc.c \ kern/file.c kern/fs.c kern/loader.c kern/main.c kern/misc.c \
kern/partition.c kern/rescue.c kern/term.c \ kern/parser.c kern/partition.c kern/rescue.c kern/term.c \
normal/arg.c normal/cmdline.c normal/command.c \ normal/arg.c normal/cmdline.c normal/command.c \
normal/completion.c normal/context.c \ normal/completion.c normal/context.c \
normal/main.c normal/menu.c normal/menu_entry.c normal/misc.c \ normal/main.c normal/menu.c normal/menu_entry.c normal/misc.c \
partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \
util/console.c util/grub-emu.c util/misc.c \ util/console.c util/grub-emu.c util/misc.c \
util/i386/pc/biosdisk.c util/i386/pc/getroot.c \ util/i386/pc/biosdisk.c util/i386/pc/getroot.c \
util/powerpc/ieee1275/misc.c util/powerpc/ieee1275/misc.c
CLEANFILES += grub-emu grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_default.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_timeout.o grub_emu-commands_ieee1275_halt.o grub_emu-commands_ieee1275_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_fshelp.o grub_emu-fs_hfs.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_context.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-util_console.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_i386_pc_biosdisk.o grub_emu-util_i386_pc_getroot.o grub_emu-util_powerpc_ieee1275_misc.o CLEANFILES += grub-emu grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_default.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_timeout.o grub_emu-commands_ieee1275_halt.o grub_emu-commands_ieee1275_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_fshelp.o grub_emu-fs_hfs.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_context.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-util_console.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_i386_pc_biosdisk.o grub_emu-util_i386_pc_getroot.o grub_emu-util_powerpc_ieee1275_misc.o
MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_default.d grub_emu-commands_help.d grub_emu-commands_search.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_timeout.d grub_emu-commands_ieee1275_halt.d grub_emu-commands_ieee1275_reboot.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_fshelp.d grub_emu-fs_hfs.d grub_emu-fs_iso9660.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_completion.d grub_emu-normal_context.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-util_console.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_i386_pc_biosdisk.d grub_emu-util_i386_pc_getroot.d grub_emu-util_powerpc_ieee1275_misc.d MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_default.d grub_emu-commands_help.d grub_emu-commands_search.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_timeout.d grub_emu-commands_ieee1275_halt.d grub_emu-commands_ieee1275_reboot.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_fshelp.d grub_emu-fs_hfs.d grub_emu-fs_iso9660.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_completion.d grub_emu-normal_context.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-util_console.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_i386_pc_biosdisk.d grub_emu-util_i386_pc_getroot.d grub_emu-util_powerpc_ieee1275_misc.d
grub-emu: grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_default.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_timeout.o grub_emu-commands_ieee1275_halt.o grub_emu-commands_ieee1275_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_fshelp.o grub_emu-fs_hfs.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_context.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-util_console.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_i386_pc_biosdisk.o grub_emu-util_i386_pc_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub-emu: grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_default.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_timeout.o grub_emu-commands_ieee1275_halt.o grub_emu-commands_ieee1275_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_fshelp.o grub_emu-fs_hfs.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_context.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-util_console.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_i386_pc_biosdisk.o grub_emu-util_i386_pc_getroot.o grub_emu-util_powerpc_ieee1275_misc.o
$(BUILD_CC) -o $@ $^ $(BUILD_LDFLAGS) $(grub_emu_LDFLAGS) $(BUILD_CC) -o $@ $^ $(BUILD_LDFLAGS) $(grub_emu_LDFLAGS)
grub_emu-commands_boot.o: commands/boot.c grub_emu-commands_boot.o: commands/boot.c
@ -368,6 +368,14 @@ grub_emu-kern_misc.d: kern/misc.c
-include grub_emu-kern_misc.d -include grub_emu-kern_misc.d
grub_emu-kern_parser.o: kern/parser.c
$(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
grub_emu-kern_parser.d: kern/parser.c
set -e; $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $< | sed 's,parser\.o[ :]*,grub_emu-kern_parser.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@
-include grub_emu-kern_parser.d
grub_emu-kern_partition.o: kern/partition.c grub_emu-kern_partition.o: kern/partition.c
$(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $< $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
@ -548,17 +556,17 @@ grub_emu-util_powerpc_ieee1275_misc.d: util/powerpc/ieee1275/misc.c
grub_emu_LDFLAGS = $(LIBCURSES) grub_emu_LDFLAGS = $(LIBCURSES)
grubof_SOURCES = kern/powerpc/ieee1275/crt0.S kern/powerpc/ieee1275/cmain.c \ grubof_SOURCES = kern/powerpc/ieee1275/crt0.S kern/powerpc/ieee1275/cmain.c \
kern/ieee1275/ieee1275.c kern/main.c kern/device.c \ kern/ieee1275/ieee1275.c kern/main.c kern/device.c \
kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \ kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \
kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \
kern/powerpc/ieee1275/init.c term/ieee1275/ofconsole.c \ kern/powerpc/ieee1275/init.c term/ieee1275/ofconsole.c \
kern/powerpc/ieee1275/openfw.c disk/ieee1275/ofdisk.c \ kern/powerpc/ieee1275/openfw.c disk/ieee1275/ofdisk.c \
kern/partition.c kern/env.c kern/powerpc/dl.c grubof_symlist.c \ kern/parser.c kern/partition.c kern/env.c kern/powerpc/dl.c \
kern/powerpc/cache.S grubof_symlist.c kern/powerpc/cache.S
CLEANFILES += grubof grubof-kern_powerpc_ieee1275_crt0.o grubof-kern_powerpc_ieee1275_cmain.o grubof-kern_ieee1275_ieee1275.o grubof-kern_main.o grubof-kern_device.o grubof-kern_disk.o grubof-kern_dl.o grubof-kern_file.o grubof-kern_fs.o grubof-kern_err.o grubof-kern_misc.o grubof-kern_mm.o grubof-kern_loader.o grubof-kern_rescue.o grubof-kern_term.o grubof-kern_powerpc_ieee1275_init.o grubof-term_ieee1275_ofconsole.o grubof-kern_powerpc_ieee1275_openfw.o grubof-disk_ieee1275_ofdisk.o grubof-kern_partition.o grubof-kern_env.o grubof-kern_powerpc_dl.o grubof-grubof_symlist.o grubof-kern_powerpc_cache.o CLEANFILES += grubof grubof-kern_powerpc_ieee1275_crt0.o grubof-kern_powerpc_ieee1275_cmain.o grubof-kern_ieee1275_ieee1275.o grubof-kern_main.o grubof-kern_device.o grubof-kern_disk.o grubof-kern_dl.o grubof-kern_file.o grubof-kern_fs.o grubof-kern_err.o grubof-kern_misc.o grubof-kern_mm.o grubof-kern_loader.o grubof-kern_rescue.o grubof-kern_term.o grubof-kern_powerpc_ieee1275_init.o grubof-term_ieee1275_ofconsole.o grubof-kern_powerpc_ieee1275_openfw.o grubof-disk_ieee1275_ofdisk.o grubof-kern_parser.o grubof-kern_partition.o grubof-kern_env.o grubof-kern_powerpc_dl.o grubof-grubof_symlist.o grubof-kern_powerpc_cache.o
MOSTLYCLEANFILES += grubof-kern_powerpc_ieee1275_crt0.d grubof-kern_powerpc_ieee1275_cmain.d grubof-kern_ieee1275_ieee1275.d grubof-kern_main.d grubof-kern_device.d grubof-kern_disk.d grubof-kern_dl.d grubof-kern_file.d grubof-kern_fs.d grubof-kern_err.d grubof-kern_misc.d grubof-kern_mm.d grubof-kern_loader.d grubof-kern_rescue.d grubof-kern_term.d grubof-kern_powerpc_ieee1275_init.d grubof-term_ieee1275_ofconsole.d grubof-kern_powerpc_ieee1275_openfw.d grubof-disk_ieee1275_ofdisk.d grubof-kern_partition.d grubof-kern_env.d grubof-kern_powerpc_dl.d grubof-grubof_symlist.d grubof-kern_powerpc_cache.d MOSTLYCLEANFILES += grubof-kern_powerpc_ieee1275_crt0.d grubof-kern_powerpc_ieee1275_cmain.d grubof-kern_ieee1275_ieee1275.d grubof-kern_main.d grubof-kern_device.d grubof-kern_disk.d grubof-kern_dl.d grubof-kern_file.d grubof-kern_fs.d grubof-kern_err.d grubof-kern_misc.d grubof-kern_mm.d grubof-kern_loader.d grubof-kern_rescue.d grubof-kern_term.d grubof-kern_powerpc_ieee1275_init.d grubof-term_ieee1275_ofconsole.d grubof-kern_powerpc_ieee1275_openfw.d grubof-disk_ieee1275_ofdisk.d grubof-kern_parser.d grubof-kern_partition.d grubof-kern_env.d grubof-kern_powerpc_dl.d grubof-grubof_symlist.d grubof-kern_powerpc_cache.d
grubof: grubof-kern_powerpc_ieee1275_crt0.o grubof-kern_powerpc_ieee1275_cmain.o grubof-kern_ieee1275_ieee1275.o grubof-kern_main.o grubof-kern_device.o grubof-kern_disk.o grubof-kern_dl.o grubof-kern_file.o grubof-kern_fs.o grubof-kern_err.o grubof-kern_misc.o grubof-kern_mm.o grubof-kern_loader.o grubof-kern_rescue.o grubof-kern_term.o grubof-kern_powerpc_ieee1275_init.o grubof-term_ieee1275_ofconsole.o grubof-kern_powerpc_ieee1275_openfw.o grubof-disk_ieee1275_ofdisk.o grubof-kern_partition.o grubof-kern_env.o grubof-kern_powerpc_dl.o grubof-grubof_symlist.o grubof-kern_powerpc_cache.o grubof: grubof-kern_powerpc_ieee1275_crt0.o grubof-kern_powerpc_ieee1275_cmain.o grubof-kern_ieee1275_ieee1275.o grubof-kern_main.o grubof-kern_device.o grubof-kern_disk.o grubof-kern_dl.o grubof-kern_file.o grubof-kern_fs.o grubof-kern_err.o grubof-kern_misc.o grubof-kern_mm.o grubof-kern_loader.o grubof-kern_rescue.o grubof-kern_term.o grubof-kern_powerpc_ieee1275_init.o grubof-term_ieee1275_ofconsole.o grubof-kern_powerpc_ieee1275_openfw.o grubof-disk_ieee1275_ofdisk.o grubof-kern_parser.o grubof-kern_partition.o grubof-kern_env.o grubof-kern_powerpc_dl.o grubof-grubof_symlist.o grubof-kern_powerpc_cache.o
$(CC) -o $@ $^ $(LDFLAGS) $(grubof_LDFLAGS) $(CC) -o $@ $^ $(LDFLAGS) $(grubof_LDFLAGS)
grubof-kern_powerpc_ieee1275_crt0.o: kern/powerpc/ieee1275/crt0.S grubof-kern_powerpc_ieee1275_crt0.o: kern/powerpc/ieee1275/crt0.S
@ -713,6 +721,14 @@ grubof-disk_ieee1275_ofdisk.d: disk/ieee1275/ofdisk.c
-include grubof-disk_ieee1275_ofdisk.d -include grubof-disk_ieee1275_ofdisk.d
grubof-kern_parser.o: kern/parser.c
$(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -c -o $@ $<
grubof-kern_parser.d: kern/parser.c
set -e; $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -M $< | sed 's,parser\.o[ :]*,grubof-kern_parser.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@
-include grubof-kern_parser.d
grubof-kern_partition.o: kern/partition.c grubof-kern_partition.o: kern/partition.c
$(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -c -o $@ $< $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -c -o $@ $<

View file

@ -10,7 +10,7 @@ MOSTLYCLEANFILES += grubof_symlist.c kernel_syms.lst
DEFSYMFILES += kernel_syms.lst DEFSYMFILES += kernel_syms.lst
grubof_HEADERS = arg.h boot.h device.h disk.h dl.h elf.h env.h err.h \ grubof_HEADERS = arg.h boot.h device.h disk.h dl.h elf.h env.h err.h \
file.h fs.h kernel.h misc.h mm.h net.h rescue.h symbol.h \ file.h fs.h kernel.h misc.h mm.h net.h parser.h rescue.h symbol.h \
term.h types.h powerpc/libgcc.h loader.h \ term.h types.h powerpc/libgcc.h loader.h \
partition.h pc_partition.h ieee1275/ieee1275.h machine/time.h \ partition.h pc_partition.h ieee1275/ieee1275.h machine/time.h \
machine/kernel.h machine/kernel.h
@ -44,9 +44,9 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \
io/gzio.c \ io/gzio.c \
kern/device.c kern/disk.c kern/dl.c kern/env.c kern/err.c \ kern/device.c kern/disk.c kern/dl.c kern/env.c kern/err.c \
kern/file.c kern/fs.c kern/loader.c kern/main.c kern/misc.c \ kern/file.c kern/fs.c kern/loader.c kern/main.c kern/misc.c \
kern/partition.c kern/rescue.c kern/term.c \ kern/parser.c kern/partition.c kern/rescue.c kern/term.c \
normal/arg.c normal/cmdline.c normal/command.c \ normal/arg.c normal/cmdline.c normal/command.c \
normal/completion.c normal/context.c \ normal/completion.c normal/context.c \
normal/main.c normal/menu.c normal/menu_entry.c normal/misc.c \ normal/main.c normal/menu.c normal/menu_entry.c normal/misc.c \
partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \
util/console.c util/grub-emu.c util/misc.c \ util/console.c util/grub-emu.c util/misc.c \
@ -56,13 +56,13 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \
grub_emu_LDFLAGS = $(LIBCURSES) grub_emu_LDFLAGS = $(LIBCURSES)
grubof_SOURCES = kern/powerpc/ieee1275/crt0.S kern/powerpc/ieee1275/cmain.c \ grubof_SOURCES = kern/powerpc/ieee1275/crt0.S kern/powerpc/ieee1275/cmain.c \
kern/ieee1275/ieee1275.c kern/main.c kern/device.c \ kern/ieee1275/ieee1275.c kern/main.c kern/device.c \
kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \ kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \
kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \
kern/powerpc/ieee1275/init.c term/ieee1275/ofconsole.c \ kern/powerpc/ieee1275/init.c term/ieee1275/ofconsole.c \
kern/powerpc/ieee1275/openfw.c disk/ieee1275/ofdisk.c \ kern/powerpc/ieee1275/openfw.c disk/ieee1275/ofdisk.c \
kern/partition.c kern/env.c kern/powerpc/dl.c grubof_symlist.c \ kern/parser.c kern/partition.c kern/env.c kern/powerpc/dl.c \
kern/powerpc/cache.S grubof_symlist.c kern/powerpc/cache.S
grubof_HEADERS = grub/powerpc/ieee1275/ieee1275.h grubof_HEADERS = grub/powerpc/ieee1275/ieee1275.h
grubof_CFLAGS = $(COMMON_CFLAGS) grubof_CFLAGS = $(COMMON_CFLAGS)
grubof_ASFLAGS = $(COMMON_ASFLAGS) grubof_ASFLAGS = $(COMMON_ASFLAGS)

View file

@ -11,7 +11,7 @@ MOSTLYCLEANFILES += grubof_symlist.c kernel_syms.lst
DEFSYMFILES += kernel_syms.lst DEFSYMFILES += kernel_syms.lst
grubof_HEADERS = arg.h boot.h device.h disk.h dl.h elf.h env.h err.h \ grubof_HEADERS = arg.h boot.h device.h disk.h dl.h elf.h env.h err.h \
file.h fs.h kernel.h misc.h mm.h net.h rescue.h symbol.h \ file.h fs.h kernel.h misc.h mm.h net.h parser.h rescue.h symbol.h \
term.h types.h sparc64/libgcc.h loader.h \ term.h types.h sparc64/libgcc.h loader.h \
partition.h pc_partition.h ieee1275/ieee1275.h machine/time.h \ partition.h pc_partition.h ieee1275/ieee1275.h machine/time.h \
machine/kernel.h machine/kernel.h
@ -61,11 +61,11 @@ grubof_SOURCES = kern/sparc64/ieee1275/init.c kern/ieee1275/ieee1275.c \
kern/rescue.c kern/term.c term/ieee1275/ofconsole.c \ kern/rescue.c kern/term.c term/ieee1275/ofconsole.c \
kern/sparc64/ieee1275/openfw.c disk/ieee1275/ofdisk.c \ kern/sparc64/ieee1275/openfw.c disk/ieee1275/ofdisk.c \
kern/partition.c kern/env.c kern/sparc64/dl.c grubof_symlist.c \ kern/partition.c kern/env.c kern/sparc64/dl.c grubof_symlist.c \
kern/sparc64/cache.S kern/sparc64/cache.S kern/parser.c
CLEANFILES += grubof grubof-kern_sparc64_ieee1275_init.o grubof-kern_ieee1275_ieee1275.o grubof-kern_main.o grubof-kern_device.o grubof-kern_disk.o grubof-kern_dl.o grubof-kern_file.o grubof-kern_fs.o grubof-kern_err.o grubof-kern_misc.o grubof-kern_mm.o grubof-kern_loader.o grubof-kern_rescue.o grubof-kern_term.o grubof-term_ieee1275_ofconsole.o grubof-kern_sparc64_ieee1275_openfw.o grubof-disk_ieee1275_ofdisk.o grubof-kern_partition.o grubof-kern_env.o grubof-kern_sparc64_dl.o grubof-grubof_symlist.o grubof-kern_sparc64_cache.o CLEANFILES += grubof grubof-kern_sparc64_ieee1275_init.o grubof-kern_ieee1275_ieee1275.o grubof-kern_main.o grubof-kern_device.o grubof-kern_disk.o grubof-kern_dl.o grubof-kern_file.o grubof-kern_fs.o grubof-kern_err.o grubof-kern_misc.o grubof-kern_mm.o grubof-kern_loader.o grubof-kern_rescue.o grubof-kern_term.o grubof-term_ieee1275_ofconsole.o grubof-kern_sparc64_ieee1275_openfw.o grubof-disk_ieee1275_ofdisk.o grubof-kern_partition.o grubof-kern_env.o grubof-kern_sparc64_dl.o grubof-grubof_symlist.o grubof-kern_sparc64_cache.o grubof-kern_parser.o
MOSTLYCLEANFILES += grubof-kern_sparc64_ieee1275_init.d grubof-kern_ieee1275_ieee1275.d grubof-kern_main.d grubof-kern_device.d grubof-kern_disk.d grubof-kern_dl.d grubof-kern_file.d grubof-kern_fs.d grubof-kern_err.d grubof-kern_misc.d grubof-kern_mm.d grubof-kern_loader.d grubof-kern_rescue.d grubof-kern_term.d grubof-term_ieee1275_ofconsole.d grubof-kern_sparc64_ieee1275_openfw.d grubof-disk_ieee1275_ofdisk.d grubof-kern_partition.d grubof-kern_env.d grubof-kern_sparc64_dl.d grubof-grubof_symlist.d grubof-kern_sparc64_cache.d MOSTLYCLEANFILES += grubof-kern_sparc64_ieee1275_init.d grubof-kern_ieee1275_ieee1275.d grubof-kern_main.d grubof-kern_device.d grubof-kern_disk.d grubof-kern_dl.d grubof-kern_file.d grubof-kern_fs.d grubof-kern_err.d grubof-kern_misc.d grubof-kern_mm.d grubof-kern_loader.d grubof-kern_rescue.d grubof-kern_term.d grubof-term_ieee1275_ofconsole.d grubof-kern_sparc64_ieee1275_openfw.d grubof-disk_ieee1275_ofdisk.d grubof-kern_partition.d grubof-kern_env.d grubof-kern_sparc64_dl.d grubof-grubof_symlist.d grubof-kern_sparc64_cache.d grubof-kern_parser.d
grubof: grubof-kern_sparc64_ieee1275_init.o grubof-kern_ieee1275_ieee1275.o grubof-kern_main.o grubof-kern_device.o grubof-kern_disk.o grubof-kern_dl.o grubof-kern_file.o grubof-kern_fs.o grubof-kern_err.o grubof-kern_misc.o grubof-kern_mm.o grubof-kern_loader.o grubof-kern_rescue.o grubof-kern_term.o grubof-term_ieee1275_ofconsole.o grubof-kern_sparc64_ieee1275_openfw.o grubof-disk_ieee1275_ofdisk.o grubof-kern_partition.o grubof-kern_env.o grubof-kern_sparc64_dl.o grubof-grubof_symlist.o grubof-kern_sparc64_cache.o grubof: grubof-kern_sparc64_ieee1275_init.o grubof-kern_ieee1275_ieee1275.o grubof-kern_main.o grubof-kern_device.o grubof-kern_disk.o grubof-kern_dl.o grubof-kern_file.o grubof-kern_fs.o grubof-kern_err.o grubof-kern_misc.o grubof-kern_mm.o grubof-kern_loader.o grubof-kern_rescue.o grubof-kern_term.o grubof-term_ieee1275_ofconsole.o grubof-kern_sparc64_ieee1275_openfw.o grubof-disk_ieee1275_ofdisk.o grubof-kern_partition.o grubof-kern_env.o grubof-kern_sparc64_dl.o grubof-grubof_symlist.o grubof-kern_sparc64_cache.o grubof-kern_parser.o
$(CC) -o $@ $^ $(LDFLAGS) $(grubof_LDFLAGS) $(CC) -o $@ $^ $(LDFLAGS) $(grubof_LDFLAGS)
grubof-kern_sparc64_ieee1275_init.o: kern/sparc64/ieee1275/init.c grubof-kern_sparc64_ieee1275_init.o: kern/sparc64/ieee1275/init.c
@ -244,6 +244,14 @@ grubof-kern_sparc64_cache.d: kern/sparc64/cache.S
-include grubof-kern_sparc64_cache.d -include grubof-kern_sparc64_cache.d
grubof-kern_parser.o: kern/parser.c
$(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -c -o $@ $<
grubof-kern_parser.d: kern/parser.c
set -e; $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -M $< | sed 's,parser\.o[ :]*,grubof-kern_parser.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@
-include grubof-kern_parser.d
grubof_HEADERS = grub/sparc64/ieee1275/ieee1275.h grubof_HEADERS = grub/sparc64/ieee1275/ieee1275.h
grubof_CFLAGS = $(COMMON_CFLAGS) grubof_CFLAGS = $(COMMON_CFLAGS)
grubof_ASFLAGS = $(COMMON_ASFLAGS) grubof_ASFLAGS = $(COMMON_ASFLAGS)

View file

@ -11,7 +11,7 @@ MOSTLYCLEANFILES += grubof_symlist.c kernel_syms.lst
DEFSYMFILES += kernel_syms.lst DEFSYMFILES += kernel_syms.lst
grubof_HEADERS = arg.h boot.h device.h disk.h dl.h elf.h env.h err.h \ grubof_HEADERS = arg.h boot.h device.h disk.h dl.h elf.h env.h err.h \
file.h fs.h kernel.h misc.h mm.h net.h rescue.h symbol.h \ file.h fs.h kernel.h misc.h mm.h net.h parser.h rescue.h symbol.h \
term.h types.h sparc64/libgcc.h loader.h \ term.h types.h sparc64/libgcc.h loader.h \
partition.h pc_partition.h ieee1275/ieee1275.h machine/time.h \ partition.h pc_partition.h ieee1275/ieee1275.h machine/time.h \
machine/kernel.h machine/kernel.h
@ -61,7 +61,7 @@ grubof_SOURCES = kern/sparc64/ieee1275/init.c kern/ieee1275/ieee1275.c \
kern/rescue.c kern/term.c term/ieee1275/ofconsole.c \ kern/rescue.c kern/term.c term/ieee1275/ofconsole.c \
kern/sparc64/ieee1275/openfw.c disk/ieee1275/ofdisk.c \ kern/sparc64/ieee1275/openfw.c disk/ieee1275/ofdisk.c \
kern/partition.c kern/env.c kern/sparc64/dl.c grubof_symlist.c \ kern/partition.c kern/env.c kern/sparc64/dl.c grubof_symlist.c \
kern/sparc64/cache.S kern/sparc64/cache.S kern/parser.c
grubof_HEADERS = grub/sparc64/ieee1275/ieee1275.h grubof_HEADERS = grub/sparc64/ieee1275/ieee1275.h
grubof_CFLAGS = $(COMMON_CFLAGS) grubof_CFLAGS = $(COMMON_CFLAGS)
grubof_ASFLAGS = $(COMMON_ASFLAGS) grubof_ASFLAGS = $(COMMON_ASFLAGS)

View file

@ -76,8 +76,4 @@ grub_ssize_t EXPORT_FUNC(grub_utf8_to_ucs4) (grub_uint32_t *dest,
const grub_uint8_t *src, const grub_uint8_t *src,
grub_size_t size); grub_size_t size);
grub_err_t EXPORT_FUNC(grub_split_cmdline) (const char *str,
grub_err_t (* getline) (char **),
int *argc, char ***argv);
#endif /* ! GRUB_MISC_HEADER */ #endif /* ! GRUB_MISC_HEADER */

68
include/grub/parser.h Normal file
View file

@ -0,0 +1,68 @@
/* parser.h - prototypes for the command line parser. */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2005 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef GRUB_PARSER_HEADER
#define GRUB_PARSER_HEADER 1
#include <grub/types.h>
#include <grub/err.h>
/* All the states for the command line. */
typedef enum
{
GRUB_PARSER_STATE_TEXT = 1,
GRUB_PARSER_STATE_ESC,
GRUB_PARSER_STATE_QUOTE,
GRUB_PARSER_STATE_DQUOTE,
GRUB_PARSER_STATE_VAR,
GRUB_PARSER_STATE_VARNAME,
GRUB_PARSER_STATE_VARNAME2,
GRUB_PARSER_STATE_QVAR,
GRUB_PARSER_STATE_QVARNAME,
GRUB_PARSER_STATE_QVARNAME2
} grub_parser_state_t;
/* A single state transition. */
struct grub_parser_state_transition
{
/* The state that is looked up. */
grub_parser_state_t from_state;
/* The next state, determined by FROM_STATE and INPUT. */
grub_parser_state_t to_state;
/* The input that will determine the next state from FROM_STATE. */
char input;
/* If set to 1, the input is valid and should be used. */
int keep_value;
};
/* Determines the state following STATE, determined by C. */
grub_parser_state_t
EXPORT_FUNC (grub_parser_cmdline_state) (grub_parser_state_t state,
char c, char *result);
grub_err_t
EXPORT_FUNC (grub_parser_split_cmdline) (const char *cmdline,
grub_err_t (*getline) (char **),
int *argc, char ***argv);
#endif /* ! GRUB_PARSER_HEADER */

View file

@ -1,7 +1,7 @@
/* misc.c - definitions of misc functions */ /* misc.c - definitions of misc functions */
/* /*
* GRUB -- GRand Unified Bootloader * GRUB -- GRand Unified Bootloader
* Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc. * Copyright (C) 1999,2000,2001,2002,2003,2004,2005 Free Software Foundation, Inc.
* *
* GRUB is free software; you can redistribute it and/or modify * GRUB is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -874,225 +874,3 @@ grub_utf8_to_ucs4 (grub_uint32_t *dest, const grub_uint8_t *src,
return p - dest; return p - dest;
} }
grub_err_t
grub_split_cmdline (const char *cmdline, grub_err_t (*getline) (char **),
int *argc, char ***argv)
{
/* XXX: Fixed size buffer, perhaps this buffer should be dynamically
allocated. */
char buffer[1024];
char *bp = buffer;
char *rd = (char *) cmdline;
char unputbuf;
int unput = 0;
char *args;
int i;
auto char getchar (void);
auto void unputc (char c);
auto void getenvvar (void);
auto int getarg (void);
/* Get one character from the commandline. If the caller reads
beyond the end of the string a new line will be read. This
function will not chech for errors, the caller has to check for
grub_errno. */
char getchar (void)
{
int c;
if (unput)
{
unput = 0;
return unputbuf;
}
if (! rd)
{
getline (&rd);
/* Error is ignored here, the caller will check for this
when it reads beyond the EOL. */
c = *(rd)++;
return c;
}
c = *(rd)++;
if (! c)
{
rd = 0;
return '\n';
}
return c;
}
void unputc (char c)
{
unputbuf = c;
unput = 1;
}
/* Read a variable name from the commandline and insert its content
into the buffer. */
void getenvvar (void)
{
char varname[100];
char *p = varname;
char *val;
char c;
c = getchar ();
if (c == '{')
while ((c = getchar ()) != '}')
*(p++) = c;
else
{
/* XXX: An env. variable can have characters and digits in
its name, are more characters allowed here? */
while (c && (grub_isalpha (c) || grub_isdigit (c)))
{
*(p++) = c;
c = getchar ();
}
unputc (c);
}
*p = '\0';
/* The variable does not exist. */
val = grub_env_get (varname);
if (! val)
return;
/* Copy the contents of the variable into the buffer. */
for (p = val; *p; p++)
*(bp++) = *p;
}
/* Read one argument. Return 1 if no variables can be read anymore,
otherwise return 0. If there is an error, return 1, the caller
has to check grub_errno. */
int getarg (void)
{
char c;
/* Skip all whitespaces before an argument. */
do {
c = getchar ();
} while (c == ' ' || c == '\t');
do {
switch (c)
{
case '"':
/* Double quote. */
while ((c = getchar ()))
{
if (grub_errno)
return 1;
/* Read in an escaped character. */
if (c == '\\')
{
c = getchar ();
*(bp++) = c;
continue;
}
else if (c == '"')
break;
/* Read a variable. */
if (c == '$')
{
getenvvar ();
continue;
}
*(bp++) = c;
}
break;
case '\'':
/* Single quote. */
while ((c = getchar ()) != '\'')
{
if (grub_errno)
return 1;
*(bp++) = c;
}
break;
case '\n':
/* This was not a argument afterall. */
return 1;
default:
/* A normal option. */
while (c && (grub_isalpha (c)
|| grub_isdigit (c) || grub_isgraph (c)))
{
/* Read in an escaped character. */
if (c == '\\')
{
c = getchar ();
*(bp++) = c;
c = getchar ();
continue;
}
/* Read a variable. */
if (c == '$')
{
getenvvar ();
c = getchar ();
continue;
}
*(bp++) = c;
c = getchar ();
}
unputc (c);
break;
}
} while (! grub_isspace (c) && c != '\'' && c != '"');
return 0;
}
/* Read in all arguments and count them. */
*argc = 0;
while (1)
{
if (getarg ())
break;
*(bp++) = '\0';
(*argc)++;
}
/* Check if there were no errors. */
if (grub_errno)
return grub_errno;
/* Reserve memory for the return values. */
args = grub_malloc (bp - buffer);
if (! args)
return grub_errno;
grub_memcpy (args, buffer, bp - buffer);
*argv = grub_malloc (sizeof (char *) * (*argc + 1));
if (! *argv)
{
grub_free (args);
return grub_errno;
}
/* The arguments are separated with 0's, setup argv so it points to
the right values. */
bp = args;
for (i = 0; i < *argc; i++)
{
(*argv)[i] = bp;
while (*bp)
bp++;
bp++;
}
(*argc)--;
return 0;
}

230
kern/parser.c Normal file
View file

@ -0,0 +1,230 @@
/* parser.c - the part of the parser that can return partial tokens */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2005 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <grub/parser.h>
#include <grub/env.h>
#include <grub/misc.h>
#include <grub/mm.h>
/* All the possible state transitions on the command line. If a
transition can not be found, it is assumed that there is no
transition and keep_value is assumed to be 1. */
static struct grub_parser_state_transition state_transitions[] =
{
{ GRUB_PARSER_STATE_TEXT, GRUB_PARSER_STATE_QUOTE, '\'', 0},
{ GRUB_PARSER_STATE_TEXT, GRUB_PARSER_STATE_DQUOTE, '\"', 0},
{ GRUB_PARSER_STATE_TEXT, GRUB_PARSER_STATE_VAR, '$', 0},
{ GRUB_PARSER_STATE_TEXT, GRUB_PARSER_STATE_ESC, '\\', 0},
{ GRUB_PARSER_STATE_ESC, GRUB_PARSER_STATE_TEXT, 0, 1},
{ GRUB_PARSER_STATE_QUOTE, GRUB_PARSER_STATE_TEXT, '\'', 0},
{ GRUB_PARSER_STATE_DQUOTE, GRUB_PARSER_STATE_TEXT, '\"', 0},
{ GRUB_PARSER_STATE_DQUOTE, GRUB_PARSER_STATE_QVAR, '$', 0},
{ GRUB_PARSER_STATE_VAR, GRUB_PARSER_STATE_VARNAME2, '{', 0},
{ GRUB_PARSER_STATE_VAR, GRUB_PARSER_STATE_VARNAME, 0, 1},
{ GRUB_PARSER_STATE_VARNAME, GRUB_PARSER_STATE_TEXT, ' ', 1},
{ GRUB_PARSER_STATE_VARNAME2, GRUB_PARSER_STATE_TEXT, '}', 0},
{ GRUB_PARSER_STATE_QVAR, GRUB_PARSER_STATE_QVARNAME2, '{', 0},
{ GRUB_PARSER_STATE_QVAR, GRUB_PARSER_STATE_QVARNAME, 0, 1},
{ GRUB_PARSER_STATE_QVARNAME, GRUB_PARSER_STATE_DQUOTE, ' ', 1},
{ GRUB_PARSER_STATE_QVARNAME, GRUB_PARSER_STATE_TEXT, '\"', 0},
{ GRUB_PARSER_STATE_QVARNAME2, GRUB_PARSER_STATE_DQUOTE, '}', 0},
{ 0, 0, 0, 0}
};
/* Determines the state following STATE, determined by C. */
grub_parser_state_t
grub_parser_cmdline_state (grub_parser_state_t state, char c, char *result)
{
struct grub_parser_state_transition *transition;
struct grub_parser_state_transition *next_match = 0;
struct grub_parser_state_transition default_transition;
int found = 0;
default_transition.to_state = state;
default_transition.keep_value = 1;
/* Look for a good translation. */
for (transition = state_transitions; transition->from_state; transition++)
{
/* An exact match was found, use it. */
if (transition->from_state == state && transition->input == c)
{
found = 1;
break;
}
/* A less perfect match was found, use this one if no exact
match can be found. */
if (transition->from_state == state && transition->input == 0)
next_match = transition;
}
if (! found)
{
if (next_match)
transition = next_match;
else
transition = &default_transition;
}
if (transition->keep_value)
*result = c;
else
*result = 0;
return transition->to_state;
}
grub_err_t
grub_parser_split_cmdline (const char *cmdline, grub_err_t (*getline) (char **),
int *argc, char ***argv)
{
grub_parser_state_t state = GRUB_PARSER_STATE_TEXT;
/* XXX: Fixed size buffer, perhaps this buffer should be dynamically
allocated. */
char buffer[1024];
char *bp = buffer;
char *rd = (char *) cmdline;
char varname[200];
char *vp = varname;
char *args;
int i;
auto int check_varstate (grub_parser_state_t state);
int check_varstate (grub_parser_state_t state)
{
return (state == GRUB_PARSER_STATE_VARNAME
|| state == GRUB_PARSER_STATE_VARNAME2
|| state == GRUB_PARSER_STATE_QVARNAME
|| state == GRUB_PARSER_STATE_QVARNAME2);
}
auto void add_var (grub_parser_state_t newstate);
void add_var (grub_parser_state_t newstate)
{
char *val;
/* Check if a variable was being read in and the end of the name
was reached. */
if (! (check_varstate (state) && !check_varstate (newstate)))
return;
*(vp++) = '\0';
val = grub_env_get (varname);
vp = varname;
if (! val)
return;
/* Insert the contents of the variable in the buffer. */
for (; *val; val++)
*(bp++) = *val;
}
*argc = 1;
do
{
if (! *rd)
{
if (getline)
getline (&rd);
else break;
}
for (; *rd; rd++)
{
grub_parser_state_t newstate;
char use;
newstate = grub_parser_cmdline_state (state, *rd, &use);
/* If a variable was being processed and this character does
not describe the variable anymore, write the variable to
the buffer. */
add_var (newstate);
if (check_varstate (newstate))
{
if (use)
*(vp++) = use;
}
else
{
if (newstate == GRUB_PARSER_STATE_TEXT
&& state != GRUB_PARSER_STATE_ESC && use == ' ')
{
/* Don't add more than one argument if multiple
spaces are used. */
if (bp != buffer && *(bp - 1))
{
*(bp++) = '\0';
(*argc)++;
}
}
else if (use)
*(bp++) = use;
}
state = newstate;
}
} while (state != GRUB_PARSER_STATE_TEXT && !check_varstate (state));
*(bp++) = '\0';
/* A special case for when the last character was part of a
variable. */
add_var (GRUB_PARSER_STATE_TEXT);
/* Reserve memory for the return values. */
args = grub_malloc (bp - buffer);
if (! args)
return grub_errno;
grub_memcpy (args, buffer, bp - buffer);
*argv = grub_malloc (sizeof (char *) * (*argc + 1));
if (! *argv)
{
grub_free (args);
return grub_errno;
}
/* The arguments are separated with 0's, setup argv so it points to
the right values. */
bp = args;
for (i = 0; i < *argc; i++)
{
(*argv)[i] = bp;
while (*bp)
bp++;
bp++;
}
(*argc)--;
return 0;
}

View file

@ -1,7 +1,7 @@
/* rescue.c - rescue mode */ /* rescue.c - rescue mode */
/* /*
* GRUB -- GRand Unified Bootloader * GRUB -- GRand Unified Bootloader
* Copyright (C) 2002, 2003 Free Software Foundation, Inc. * Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -30,6 +30,7 @@
#include <grub/dl.h> #include <grub/dl.h>
#include <grub/partition.h> #include <grub/partition.h>
#include <grub/env.h> #include <grub/env.h>
#include <grub/parser.h>
#define GRUB_RESCUE_BUF_SIZE 256 #define GRUB_RESCUE_BUF_SIZE 256
#define GRUB_RESCUE_MAX_ARGS 20 #define GRUB_RESCUE_MAX_ARGS 20
@ -650,7 +651,7 @@ grub_enter_rescue_mode (void)
/* Get a command line. */ /* Get a command line. */
grub_rescue_get_command_line ("grub rescue> "); grub_rescue_get_command_line ("grub rescue> ");
if (grub_split_cmdline (line, getline, &n, &args) || n < 0) if (grub_parser_split_cmdline (line, getline, &n, &args) || n < 0)
continue; continue;
/* In case of an assignment set the environment accordingly /* In case of an assignment set the environment accordingly

View file

@ -24,6 +24,7 @@
#include <grub/term.h> #include <grub/term.h>
#include <grub/env.h> #include <grub/env.h>
#include <grub/dl.h> #include <grub/dl.h>
#include <grub/parser.h>
static grub_command_t grub_command_list; static grub_command_t grub_command_list;
@ -203,7 +204,7 @@ grub_command_execute (char *cmdline, int interactive)
char **arglist; char **arglist;
int numargs; int numargs;
if (grub_split_cmdline (cmdline, cmdline_get, &num, &args)) if (grub_parser_split_cmdline (cmdline, cmdline_get, &num, &args))
return 0; return 0;
/* In case of an assignment set the environment accordingly instead /* In case of an assignment set the environment accordingly instead

View file

@ -25,6 +25,7 @@
#include <grub/partition.h> #include <grub/partition.h>
#include <grub/disk.h> #include <grub/disk.h>
#include <grub/file.h> #include <grub/file.h>
#include <grub/parser.h>
/* The current word. */ /* The current word. */
static char *current_word; static char *current_word;
@ -41,6 +42,8 @@ static const char *suffix;
/* The callback function to print items. */ /* The callback function to print items. */
static void (*print_func) (const char *, grub_completion_type_t, int); static void (*print_func) (const char *, grub_completion_type_t, int);
/* The state the command line is in. */
static grub_parser_state_t cmdline_state;
/* Add a string to the list of possible completions. COMPLETION is the /* Add a string to the list of possible completions. COMPLETION is the
@ -125,7 +128,15 @@ iterate_dir (const char *filename, int dir)
{ {
if (! dir) if (! dir)
{ {
if (add_completion (filename, " ", GRUB_COMPLETION_TYPE_FILE)) const char *prefix;
if (cmdline_state == GRUB_PARSER_STATE_DQUOTE)
prefix = "\" ";
else if (cmdline_state == GRUB_PARSER_STATE_QUOTE)
prefix = "\' ";
else
prefix = " ";
if (add_completion (filename, prefix, GRUB_COMPLETION_TYPE_FILE))
return 1; return 1;
} }
else else
@ -358,6 +369,19 @@ complete_arguments (char *command)
return 0; return 0;
} }
static grub_parser_state_t
get_state (const char *cmdline)
{
grub_parser_state_t state = GRUB_PARSER_STATE_TEXT;
char use;
while (*cmdline)
state = grub_parser_cmdline_state (state, *(cmdline++), &use);
return state;
}
/* Try to complete the string in BUF. Return the characters that /* Try to complete the string in BUF. Return the characters that
should be added to the string. This command outputs the possible should be added to the string. This command outputs the possible
completions by calling HOOK, in that case set RESTORE to 1 so the completions by calling HOOK, in that case set RESTORE to 1 so the
@ -366,7 +390,8 @@ char *
grub_normal_do_completion (char *buf, int *restore, grub_normal_do_completion (char *buf, int *restore,
void (*hook) (const char *, grub_completion_type_t, int)) void (*hook) (const char *, grub_completion_type_t, int))
{ {
char *first_word; int argc;
char **argv;
/* Initialize variables. */ /* Initialize variables. */
match = 0; match = 0;
@ -375,45 +400,38 @@ grub_normal_do_completion (char *buf, int *restore,
print_func = hook; print_func = hook;
*restore = 1; *restore = 1;
/* Find the first word. */
for (first_word = buf; *first_word == ' '; first_word++)
;
/* Find the delimeter of the current word. */ if (grub_parser_split_cmdline (buf, 0, &argc, &argv))
for (current_word = first_word + grub_strlen (first_word); return 0;
current_word > first_word;
current_word--) current_word = argv[argc];
if (*current_word == ' ' || *current_word == '=')
break; /* Determine the state the command line is in, depending on the
state, it can be determined how to complete. */
if (current_word == first_word) cmdline_state = get_state (buf);
if (argc == 0)
{ {
/* Complete a command. */ /* Complete a command. */
if (grub_iterate_commands (iterate_command)) if (grub_iterate_commands (iterate_command))
goto fail; goto fail;
} }
else if (*current_word == '-')
{
if (complete_arguments (buf))
goto fail;
}
else if (*current_word == '(' && ! grub_strchr (current_word, ')'))
{
/* Complete a device. */
if (complete_device ())
goto fail;
}
else else
{ {
current_word++; /* Complete a file. */
if (complete_file ())
if (*current_word == '-') goto fail;
{
if (complete_arguments (buf))
goto fail;
}
else if (*current_word == '(' && ! grub_strchr (current_word, ')'))
{
/* Complete a device. */
if (complete_device ())
goto fail;
}
else
{
/* Complete a file. */
if (complete_file ())
goto fail;
}
} }
/* If more than one match is found those matches will be printed and /* If more than one match is found those matches will be printed and
@ -427,13 +445,32 @@ grub_normal_do_completion (char *buf, int *restore,
if (match) if (match)
{ {
char *ret; char *ret;
char *escstr;
char *newstr;
int current_len; int current_len;
int match_len; int match_len;
int spaces = 0;
current_len = grub_strlen (current_word); current_len = grub_strlen (current_word);
match_len = grub_strlen (match); match_len = grub_strlen (match);
ret = grub_malloc (match_len - current_len + grub_strlen (suffix) + 1);
grub_strcpy (ret, match + current_len); /* Count the number of spaces that have to be escaped. XXX:
More than just spaces have to be escaped. */
for (escstr = match + current_len; *escstr; escstr++)
if (*escstr == ' ')
spaces++;
ret = grub_malloc (match_len - current_len + grub_strlen (suffix) + spaces + 1);
newstr = ret;
for (escstr = match + current_len; *escstr; escstr++)
{
if (*escstr == ' ' && cmdline_state != GRUB_PARSER_STATE_QUOTE
&& cmdline_state != GRUB_PARSER_STATE_QUOTE)
*(newstr++) = '\\';
*(newstr++) = *escstr;
}
*newstr = '\0';
if (num_found == 1) if (num_found == 1)
grub_strcat (ret, suffix); grub_strcat (ret, suffix);