From 7b455f4dd3766e45ec978443a46e00ab78f7bc33 Mon Sep 17 00:00:00 2001 From: okuji Date: Wed, 26 Apr 2006 21:58:36 +0000 Subject: [PATCH] 2006-04-26 Yoshinori K. Okuji * util/i386/pc/grub-mkimage.c (compress_kernel): Cast arguments explicitly to suppress gcc's warnings. * fs/fat.c (grub_fat_find_dir): Likewise. (grub_fat_label): Likewise. * fs/xfs.c (grub_xfs_read_inode): Likewise. (grub_xfs_mount): Likewise. (grub_xfs_label): Likewise. * fs/affs.c (grub_affs_mount): Likewise. (grub_affs_label): Likewise. (grub_affs_iterate_dir): Likewise. * fs/sfs.c (grub_sfs_mount): Likewise. (grub_sfs_iterate_dir): Likewise. * fs/ufs.c (grub_ufs_lookup_symlink): Likewise. * fs/hfs.c (grub_hfs_mount): Likewise. (grub_hfs_cmp_catkeys): Likewise. (grub_hfs_find_dir): Likewise. (grub_hfs_dir): Likewise. (grub_hfs_label): Likewise. * fs/jfs.c (grub_jfs_mount): Likewise. (grub_jfs_opendir): Likewise. (grub_jfs_getent): Likewise. (grub_jfs_lookup_symlink): Likewise. (grub_jfs_label): Likewise. * fs/hfsplus.c (grub_hfsplus_cmp_catkey): Likewise. (grub_hfsplus_iterate_dir): Likewise. (grub_hfsplus_btree_iterate_node): Made static. * util/grub-emu.c (prefix): New variable. (grub_machine_set_prefix): New function. (main): Do not set the environment variable "prefix" here. Only set PREFIX, which is used later by grub_machine_set_prefix. * include/grub/video.h: Do not include grub/symbol.h. (grub_video_register): Not exported. This symbol is not defined in the kernel. (grub_video_unregister): Likewise. (grub_video_iterate): Likewise. (grub_video_setup): Likewise. (grub_video_restore): Likewise. (grub_video_get_info): Likewise. (grub_video_get_blit_format): Likewise. (grub_video_set_palette): Likewise. (grub_video_get_palette): Likewise. (grub_video_set_viewport): Likewise. (grub_video_get_viewport): Likewise. (grub_video_map_color): Likewise. (grub_video_map_rgb): Likewise. (grub_video_map_rgba): Likewise. (grub_video_fill_rect): Likewise. (grub_video_blit_glyph): Likewise. (grub_video_blit_bitmap): Likewise. (grub_video_blit_render_target): Likewise. (grub_video_scroll): Likewise. (grub_video_swap_buffers): Likewise. (grub_video_create_render_target): Likewise. (grub_video_delete_render_target): Likewise. (grub_video_set_active_render_target): Likewise. * include/grub/symbol.h [GRUB_SYMBOL_GENERATOR] (EXPORT_FUNC): Undefined. [GRUB_SYMBOL_GENERATOR] (EXPORT_VAR): Likewise. * conf/sparc64-ieee1275.rmk (grubof_symlist.c): Depended on config.h. Use gensymlist.sh instead of $(srcdir)/gensymlist.sh. (kernel_syms.lst): Depended on config.h. Use genkernsyms.sh instead of $(srcdir)/genkernsyms.sh. * conf/powerpc-ieee1275.rmk (grubof_symlist.c): Depended on config.h. Use gensymlist.sh instead of $(srcdir)/gensymlist.sh. (kernel_syms.lst): Depended on config.h. Use genkernsyms.sh instead of $(srcdir)/genkernsyms.sh. * conf/i386-pc.rmk (symlist.c): Depended on config.h. Use gensymlist.sh instead of $(srcdir)/gensymlist.sh. (kernel_syms.lst): Depended on config.h. Use genkernsyms.sh instead of $(srcdir)/genkernsyms.sh. * conf/i386-efi.rmk (symlist.c): Depended on config.h. Use gensymlist.sh instead of $(srcdir)/gensymlist.sh. (kernel_syms.lst): Depended on config.h. Use genkernsyms.sh instead of $(srcdir)/genkernsyms.sh. * configure.ac (AC_CONFIG_FILES): Added gensymlist.sh and genkernsyms.sh. * Makefile.in (DISTCLEANFILES): Added gensymlist.sh and genkernsyms.sh. (gensymlist.sh): New target. (genkernsyms.sh): Likewise. * DISTLIST: Removed genkernsyms.sh and gensymlist.sh. Added genkernsyms.sh.in and gensymlist.sh.in. * genkernsyms.sh: Removed. * gensymlist.sh: Likewise. * genkernsyms.sh.in: New file. * gensymlist.sh.in: Likewise. --- ChangeLog | 101 +++++++++++++++++++++++ DISTLIST | 4 +- Makefile.in | 9 +- conf/i386-efi.mk | 8 +- conf/i386-efi.rmk | 8 +- conf/i386-pc.mk | 8 +- conf/i386-pc.rmk | 8 +- conf/powerpc-ieee1275.mk | 8 +- conf/powerpc-ieee1275.rmk | 8 +- conf/sparc64-ieee1275.mk | 8 +- conf/sparc64-ieee1275.rmk | 8 +- configure | 4 +- configure.ac | 2 +- fs/affs.c | 6 +- fs/fat.c | 5 +- fs/hfs.c | 15 ++-- fs/hfsplus.c | 6 +- fs/jfs.c | 10 +-- fs/sfs.c | 8 +- fs/ufs.c | 2 +- fs/xfs.c | 6 +- genkernsyms.sh | 15 ---- genkernsyms.sh.in | 24 ++++++ gensymlist.sh => gensymlist.sh.in | 20 +++-- include/grub/symbol.h | 8 +- include/grub/video.h | 131 +++++++++++++++--------------- util/grub-emu.c | 25 ++++-- util/i386/pc/grub-mkimage.c | 6 +- 28 files changed, 308 insertions(+), 163 deletions(-) delete mode 100644 genkernsyms.sh create mode 100644 genkernsyms.sh.in rename gensymlist.sh => gensymlist.sh.in (72%) diff --git a/ChangeLog b/ChangeLog index 41d68d661..5e6cef0a9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,104 @@ +2006-04-26 Yoshinori K. Okuji + + * util/i386/pc/grub-mkimage.c (compress_kernel): Cast arguments + explicitly to suppress gcc's warnings. + * fs/fat.c (grub_fat_find_dir): Likewise. + (grub_fat_label): Likewise. + * fs/xfs.c (grub_xfs_read_inode): Likewise. + (grub_xfs_mount): Likewise. + (grub_xfs_label): Likewise. + * fs/affs.c (grub_affs_mount): Likewise. + (grub_affs_label): Likewise. + (grub_affs_iterate_dir): Likewise. + * fs/sfs.c (grub_sfs_mount): Likewise. + (grub_sfs_iterate_dir): Likewise. + * fs/ufs.c (grub_ufs_lookup_symlink): Likewise. + * fs/hfs.c (grub_hfs_mount): Likewise. + (grub_hfs_cmp_catkeys): Likewise. + (grub_hfs_find_dir): Likewise. + (grub_hfs_dir): Likewise. + (grub_hfs_label): Likewise. + * fs/jfs.c (grub_jfs_mount): Likewise. + (grub_jfs_opendir): Likewise. + (grub_jfs_getent): Likewise. + (grub_jfs_lookup_symlink): Likewise. + (grub_jfs_label): Likewise. + * fs/hfsplus.c (grub_hfsplus_cmp_catkey): Likewise. + (grub_hfsplus_iterate_dir): Likewise. + (grub_hfsplus_btree_iterate_node): Made static. + + * util/grub-emu.c (prefix): New variable. + (grub_machine_set_prefix): New function. + (main): Do not set the environment variable "prefix" here. Only + set PREFIX, which is used later by grub_machine_set_prefix. + + * include/grub/video.h: Do not include grub/symbol.h. + (grub_video_register): Not exported. This symbol is not defined in + the kernel. + (grub_video_unregister): Likewise. + (grub_video_iterate): Likewise. + (grub_video_setup): Likewise. + (grub_video_restore): Likewise. + (grub_video_get_info): Likewise. + (grub_video_get_blit_format): Likewise. + (grub_video_set_palette): Likewise. + (grub_video_get_palette): Likewise. + (grub_video_set_viewport): Likewise. + (grub_video_get_viewport): Likewise. + (grub_video_map_color): Likewise. + (grub_video_map_rgb): Likewise. + (grub_video_map_rgba): Likewise. + (grub_video_fill_rect): Likewise. + (grub_video_blit_glyph): Likewise. + (grub_video_blit_bitmap): Likewise. + (grub_video_blit_render_target): Likewise. + (grub_video_scroll): Likewise. + (grub_video_swap_buffers): Likewise. + (grub_video_create_render_target): Likewise. + (grub_video_delete_render_target): Likewise. + (grub_video_set_active_render_target): Likewise. + + * include/grub/symbol.h [GRUB_SYMBOL_GENERATOR] (EXPORT_FUNC): + Undefined. + [GRUB_SYMBOL_GENERATOR] (EXPORT_VAR): Likewise. + + * conf/sparc64-ieee1275.rmk (grubof_symlist.c): Depended on + config.h. Use gensymlist.sh instead of $(srcdir)/gensymlist.sh. + (kernel_syms.lst): Depended on config.h. Use genkernsyms.sh + instead of $(srcdir)/genkernsyms.sh. + + * conf/powerpc-ieee1275.rmk (grubof_symlist.c): Depended on + config.h. Use gensymlist.sh instead of $(srcdir)/gensymlist.sh. + (kernel_syms.lst): Depended on config.h. Use genkernsyms.sh + instead of $(srcdir)/genkernsyms.sh. + + * conf/i386-pc.rmk (symlist.c): Depended on config.h. Use + gensymlist.sh instead of $(srcdir)/gensymlist.sh. + (kernel_syms.lst): Depended on config.h. Use genkernsyms.sh + instead of $(srcdir)/genkernsyms.sh. + + * conf/i386-efi.rmk (symlist.c): Depended on config.h. Use + gensymlist.sh instead of $(srcdir)/gensymlist.sh. + (kernel_syms.lst): Depended on config.h. Use genkernsyms.sh + instead of $(srcdir)/genkernsyms.sh. + + * configure.ac (AC_CONFIG_FILES): Added gensymlist.sh and + genkernsyms.sh. + + * Makefile.in (DISTCLEANFILES): Added gensymlist.sh and + genkernsyms.sh. + (gensymlist.sh): New target. + (genkernsyms.sh): Likewise. + + * DISTLIST: Removed genkernsyms.sh and gensymlist.sh. Added + genkernsyms.sh.in and gensymlist.sh.in. + + * genkernsyms.sh: Removed. + * gensymlist.sh: Likewise. + + * genkernsyms.sh.in: New file. + * gensymlist.sh.in: Likewise. + 2006-04-25 Hollis Blanchard * kern/powerpc/ieee1275/init.c (grub_machine_set_prefix): Do not diff --git a/DISTLIST b/DISTLIST index 7da515697..16899fc3a 100644 --- a/DISTLIST +++ b/DISTLIST @@ -20,10 +20,10 @@ gendistlist.sh genfslist.sh geninitheader.sh geninit.sh -genkernsyms.sh +genkernsyms.sh.in genmk.rb genmodsrc.sh -gensymlist.sh +gensymlist.sh.in install-sh mkinstalldirs stamp-h.in diff --git a/Makefile.in b/Makefile.in index f635339a6..64d49a8fb 100644 --- a/Makefile.in +++ b/Makefile.in @@ -84,7 +84,8 @@ SCRIPTS = $(sbin_SCRIPTS) CLEANFILES = MOSTLYCLEANFILES = DISTCLEANFILES = config.status config.cache config.log config.h \ - Makefile stamp-h include/grub/cpu include/grub/machine + Makefile stamp-h include/grub/cpu include/grub/machine \ + gensymlist.sh genkernsyms.sh MAINTAINER_CLEANFILES = $(srcdir)/configure $(addprefix $(srcdir)/,$(MKFILES)) # The default target. @@ -250,6 +251,12 @@ Makefile: Makefile.in config.status config.status: configure ./config.status --recheck +gensymlist.sh: gensymlist.sh.in config.status + ./config.status + +genkernsyms.sh: genkernsyms.sh.in config.status + ./config.status + .PHONY: all install install-strip uninstall clean mostlyclean distclean .PHONY: maintainer-clean info dvi dist check diff --git a/conf/i386-efi.mk b/conf/i386-efi.mk index b3bb41725..e4393a6e3 100644 --- a/conf/i386-efi.mk +++ b/conf/i386-efi.mk @@ -621,11 +621,11 @@ MOSTLYCLEANFILES += symlist.c MOSTLYCLEANFILES += symlist.c kernel_syms.lst DEFSYMFILES += kernel_syms.lst -symlist.c: $(addprefix include/grub/,$(kernel_mod_HEADERS)) gensymlist.sh - sh $(srcdir)/gensymlist.sh $(filter %.h,$^) > $@ +symlist.c: $(addprefix include/grub/,$(kernel_mod_HEADERS)) config.h gensymlist.sh + /bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) -kernel_syms.lst: $(addprefix include/grub/,$(kernel_mod_HEADERS)) genkernsyms.sh - sh $(srcdir)/genkernsyms.sh $(filter %.h,$^) > $@ || rm -f $@ +kernel_syms.lst: $(addprefix include/grub/,$(kernel_mod_HEADERS)) config.h genkernsyms.sh + /bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) # For normal.mod. normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ diff --git a/conf/i386-efi.rmk b/conf/i386-efi.rmk index 79f19b788..f42fb6ea4 100644 --- a/conf/i386-efi.rmk +++ b/conf/i386-efi.rmk @@ -89,11 +89,11 @@ MOSTLYCLEANFILES += symlist.c MOSTLYCLEANFILES += symlist.c kernel_syms.lst DEFSYMFILES += kernel_syms.lst -symlist.c: $(addprefix include/grub/,$(kernel_mod_HEADERS)) gensymlist.sh - sh $(srcdir)/gensymlist.sh $(filter %.h,$^) > $@ +symlist.c: $(addprefix include/grub/,$(kernel_mod_HEADERS)) config.h gensymlist.sh + /bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) -kernel_syms.lst: $(addprefix include/grub/,$(kernel_mod_HEADERS)) genkernsyms.sh - sh $(srcdir)/genkernsyms.sh $(filter %.h,$^) > $@ || rm -f $@ +kernel_syms.lst: $(addprefix include/grub/,$(kernel_mod_HEADERS)) config.h genkernsyms.sh + /bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) # For normal.mod. normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ diff --git a/conf/i386-pc.mk b/conf/i386-pc.mk index 556e2a255..b774b7aed 100644 --- a/conf/i386-pc.mk +++ b/conf/i386-pc.mk @@ -271,11 +271,11 @@ kernel_img_LDFLAGS = -nostdlib -Wl,-N,-Ttext,8200 $(COMMON_CFLAGS) MOSTLYCLEANFILES += symlist.c kernel_syms.lst DEFSYMFILES += kernel_syms.lst -symlist.c: $(addprefix include/grub/,$(kernel_img_HEADERS)) gensymlist.sh - sh $(srcdir)/gensymlist.sh $(filter %.h,$^) > $@ +symlist.c: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h gensymlist.sh + /bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) -kernel_syms.lst: $(addprefix include/grub/,$(kernel_img_HEADERS)) genkernsyms.sh - sh $(srcdir)/genkernsyms.sh $(filter %h,$^) > $@ +kernel_syms.lst: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h genkernsyms.sh + /bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) # Utilities. bin_UTILITIES = grub-mkimage diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index 165bd0b05..811137dfc 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -43,11 +43,11 @@ kernel_img_LDFLAGS = -nostdlib -Wl,-N,-Ttext,8200 $(COMMON_CFLAGS) MOSTLYCLEANFILES += symlist.c kernel_syms.lst DEFSYMFILES += kernel_syms.lst -symlist.c: $(addprefix include/grub/,$(kernel_img_HEADERS)) gensymlist.sh - sh $(srcdir)/gensymlist.sh $(filter %.h,$^) > $@ +symlist.c: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h gensymlist.sh + /bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) -kernel_syms.lst: $(addprefix include/grub/,$(kernel_img_HEADERS)) genkernsyms.sh - sh $(srcdir)/genkernsyms.sh $(filter %h,$^) > $@ +kernel_syms.lst: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h genkernsyms.sh + /bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) # Utilities. bin_UTILITIES = grub-mkimage diff --git a/conf/powerpc-ieee1275.mk b/conf/powerpc-ieee1275.mk index a0d235628..692f044ae 100644 --- a/conf/powerpc-ieee1275.mk +++ b/conf/powerpc-ieee1275.mk @@ -16,11 +16,11 @@ grubof_HEADERS = arg.h boot.h device.h disk.h dl.h elf.h env.h err.h \ partition.h pc_partition.h ieee1275/ieee1275.h machine/time.h \ machine/kernel.h -grubof_symlist.c: $(addprefix include/grub/,$(grubof_HEADERS)) gensymlist.sh - sh $(srcdir)/gensymlist.sh $(filter %.h,$^) > $@ +grubof_symlist.c: $(addprefix include/grub/,$(grubof_HEADERS)) config.h gensymlist.sh + /bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) -kernel_syms.lst: $(addprefix include/grub/,$(grubof_HEADERS)) genkernsyms.sh - sh $(srcdir)/genkernsyms.sh $(filter %h,$^) > $@ +kernel_syms.lst: $(addprefix include/grub/,$(grubof_HEADERS)) config.h genkernsyms.sh + /bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) # Programs pkgdata_PROGRAMS = grubof diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index 0ae6ef6c2..34872e9cd 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -16,11 +16,11 @@ grubof_HEADERS = arg.h boot.h device.h disk.h dl.h elf.h env.h err.h \ partition.h pc_partition.h ieee1275/ieee1275.h machine/time.h \ machine/kernel.h -grubof_symlist.c: $(addprefix include/grub/,$(grubof_HEADERS)) gensymlist.sh - sh $(srcdir)/gensymlist.sh $(filter %.h,$^) > $@ +grubof_symlist.c: $(addprefix include/grub/,$(grubof_HEADERS)) config.h gensymlist.sh + /bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) -kernel_syms.lst: $(addprefix include/grub/,$(grubof_HEADERS)) genkernsyms.sh - sh $(srcdir)/genkernsyms.sh $(filter %h,$^) > $@ +kernel_syms.lst: $(addprefix include/grub/,$(grubof_HEADERS)) config.h genkernsyms.sh + /bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) # Programs pkgdata_PROGRAMS = grubof diff --git a/conf/sparc64-ieee1275.mk b/conf/sparc64-ieee1275.mk index d8e88e845..8756844b8 100644 --- a/conf/sparc64-ieee1275.mk +++ b/conf/sparc64-ieee1275.mk @@ -16,15 +16,15 @@ grubof_HEADERS = arg.h boot.h device.h disk.h dl.h elf.h env.h err.h \ partition.h pc_partition.h ieee1275/ieee1275.h machine/time.h \ machine/kernel.h -grubof_symlist.c: $(addprefix include/grub/,$(grubof_HEADERS)) gensymlist.sh - sh $(srcdir)/gensymlist.sh $(filter %.h,$^) > $@ +grubof_symlist.c: $(addprefix include/grub/,$(grubof_HEADERS)) config.h gensymlist.sh + /bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) # For the parser. grub_script.tab.c grub_script.tab.h: normal/parser.y $(YACC) -d -p grub_script_yy -b grub_script $(srcdir)/normal/parser.y -kernel_syms.lst: $(addprefix include/grub/,$(grubof_HEADERS)) genkernsyms.sh - sh $(srcdir)/genkernsyms.sh $(filter %h,$^) > $@ +kernel_syms.lst: $(addprefix include/grub/,$(grubof_HEADERS)) config.h genkernsyms.sh + /bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) # Programs pkgdata_PROGRAMS = grubof diff --git a/conf/sparc64-ieee1275.rmk b/conf/sparc64-ieee1275.rmk index 74c96dfa5..727127ae9 100644 --- a/conf/sparc64-ieee1275.rmk +++ b/conf/sparc64-ieee1275.rmk @@ -16,15 +16,15 @@ grubof_HEADERS = arg.h boot.h device.h disk.h dl.h elf.h env.h err.h \ partition.h pc_partition.h ieee1275/ieee1275.h machine/time.h \ machine/kernel.h -grubof_symlist.c: $(addprefix include/grub/,$(grubof_HEADERS)) gensymlist.sh - sh $(srcdir)/gensymlist.sh $(filter %.h,$^) > $@ +grubof_symlist.c: $(addprefix include/grub/,$(grubof_HEADERS)) config.h gensymlist.sh + /bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) # For the parser. grub_script.tab.c grub_script.tab.h: normal/parser.y $(YACC) -d -p grub_script_yy -b grub_script $(srcdir)/normal/parser.y -kernel_syms.lst: $(addprefix include/grub/,$(grubof_HEADERS)) genkernsyms.sh - sh $(srcdir)/genkernsyms.sh $(filter %h,$^) > $@ +kernel_syms.lst: $(addprefix include/grub/,$(grubof_HEADERS)) config.h genkernsyms.sh + /bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) # Programs pkgdata_PROGRAMS = grubof diff --git a/configure b/configure index 66a551419..86d7ab227 100644 --- a/configure +++ b/configure @@ -6578,7 +6578,7 @@ fi; # Output files. ac_config_links="$ac_config_links include/grub/cpu:include/grub/$host_cpu include/grub/machine:include/grub/$host_cpu/$host_vendor" - ac_config_files="$ac_config_files Makefile" + ac_config_files="$ac_config_files Makefile gensymlist.sh genkernsyms.sh" ac_config_files="$ac_config_files stamp-h" @@ -7111,6 +7111,8 @@ do case "$ac_config_target" in # Handling of arguments. "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "gensymlist.sh" ) CONFIG_FILES="$CONFIG_FILES gensymlist.sh" ;; + "genkernsyms.sh" ) CONFIG_FILES="$CONFIG_FILES genkernsyms.sh" ;; "stamp-h" ) CONFIG_FILES="$CONFIG_FILES stamp-h" ;; "include/grub/cpu" ) CONFIG_LINKS="$CONFIG_LINKS include/grub/cpu:include/grub/$host_cpu" ;; "include/grub/machine" ) CONFIG_LINKS="$CONFIG_LINKS include/grub/machine:include/grub/$host_cpu/$host_vendor" ;; diff --git a/configure.ac b/configure.ac index 53e85e0c6..be80ce517 100644 --- a/configure.ac +++ b/configure.ac @@ -190,6 +190,6 @@ AC_ARG_ENABLE([mm-debug], # Output files. AC_CONFIG_LINKS([include/grub/cpu:include/grub/$host_cpu include/grub/machine:include/grub/$host_cpu/$host_vendor]) -AC_CONFIG_FILES([Makefile]) +AC_CONFIG_FILES([Makefile gensymlist.sh genkernsyms.sh]) AC_CONFIG_FILES([stamp-h], [echo timestamp > stamp-h]) AC_OUTPUT diff --git a/fs/affs.c b/fs/affs.c index de755ba99..3350715bc 100644 --- a/fs/affs.c +++ b/fs/affs.c @@ -182,7 +182,7 @@ grub_affs_mount (grub_disk_t disk) goto fail; /* Make sure this is an affs filesystem. */ - if (grub_strncmp (data->bblock.type, "DOS", 3)) + if (grub_strncmp ((char *) (data->bblock.type), "DOS", 3)) { grub_error (GRUB_ERR_BAD_FS, "not an affs filesystem"); goto fail; @@ -364,7 +364,7 @@ grub_affs_iterate_dir (grub_fshelp_node_t dir, else type = GRUB_FSHELP_UNKNOWN; - if (grub_affs_create_node (file.name, next, + if (grub_affs_create_node ((char *) (file.name), next, grub_be_to_cpu32 (file.size), type)) return 1; @@ -527,7 +527,7 @@ grub_affs_label (grub_device_t device, char **label) if (grub_errno) return 0; - *label = grub_strndup (file.name, file.namelen); + *label = grub_strndup ((char *) (file.name), file.namelen); } else *label = 0; diff --git a/fs/fat.c b/fs/fat.c index 185d6d591..d4d2d388a 100644 --- a/fs/fat.c +++ b/fs/fat.c @@ -557,7 +557,8 @@ grub_fat_find_dir (grub_disk_t disk, struct grub_fat_data *data, for (u = 0; u < slots * 13; u++) unibuf[u] = grub_le_to_cpu16 (unibuf[u]); - *grub_utf16_to_utf8 (filename, unibuf, slots * 13) = '\0'; + *grub_utf16_to_utf8 ((grub_uint8_t *) filename, unibuf, + slots * 13) = '\0'; if (*dirname == '\0' && call_hook) { @@ -779,7 +780,7 @@ grub_fat_label (grub_device_t device, char **label) if (dir.attr == GRUB_FAT_ATTR_VOLUME_ID) { - *label = grub_strndup (dir.name, 11); + *label = grub_strndup ((char *) dir.name, 11); return GRUB_ERR_NONE; } } diff --git a/fs/hfs.c b/fs/hfs.c index 6224b4fdd..1b5f5a5a5 100644 --- a/fs/hfs.c +++ b/fs/hfs.c @@ -357,7 +357,7 @@ grub_hfs_mount (grub_disk_t disk) volume name. */ key.parent_dir = grub_cpu_to_be32 (1); key.strlen = data->sblock.volname[0]; - grub_strcpy (key.str, data->sblock.volname + 1); + grub_strcpy ((char *) key.str, (char *) (data->sblock.volname + 1)); if (grub_hfs_find_node (data, (char *) &key, data->cat_root, 0, (char *) &dir, sizeof (dir)) == 0) @@ -393,7 +393,7 @@ grub_hfs_cmp_catkeys (struct grub_hfs_catalog_key *k1, if (cmp != 0) return cmp; - cmp = grub_strncasecmp (k1->str, k2->str, k1->strlen); + cmp = grub_strncasecmp ((char *) (k1->str), (char *) (k2->str), k1->strlen); /* This is required because the compared strings are not of equal length. */ @@ -673,11 +673,11 @@ grub_hfs_find_dir (struct grub_hfs_data *data, const char *path, key.parent_dir = grub_cpu_to_be32 (inode); key.strlen = grub_strlen (path); - grub_strcpy (key.str, path); + grub_strcpy ((char *) (key.str), path); /* Lookup this node. */ - if (!grub_hfs_find_node (data, (char *) &key, data->cat_root, - 0, (char *) &frec, sizeof (frec))) + if (! grub_hfs_find_node (data, (char *) &key, data->cat_root, + 0, (char *) &frec, sizeof (frec))) { grub_error (GRUB_ERR_FILE_NOT_FOUND, "file not found"); goto fail; @@ -717,7 +717,7 @@ grub_hfs_dir (grub_device_t device, const char *path, char *filetype = rec->data; struct grub_hfs_catalog_key *ckey = rec->key; - grub_strncpy (fname, ckey->str, ckey->strlen); + grub_strncpy (fname, (char *) (ckey->str), ckey->strlen); if (*filetype == GRUB_HFS_FILETYPE_DIR) return hook (fname, 1); @@ -834,7 +834,8 @@ grub_hfs_label (grub_device_t device, char **label) data = grub_hfs_mount (device->disk); if (data) - *label = grub_strndup (data->sblock.volname + 1, *data->sblock.volname); + *label = grub_strndup ((char *) (data->sblock.volname + 1), + *data->sblock.volname); else *label = 0; diff --git a/fs/hfsplus.c b/fs/hfsplus.c index b29fb1f3c..18aa965f6 100644 --- a/fs/hfsplus.c +++ b/fs/hfsplus.c @@ -480,7 +480,7 @@ grub_hfsplus_cmp_catkey (struct grub_hfsplus_key *keya, filename = grub_malloc (grub_be_to_cpu16 (catkey_a->namelen) + 1); - if (! grub_utf16_to_utf8 (filename, catkey_a->name, + if (! grub_utf16_to_utf8 ((grub_uint8_t *) filename, catkey_a->name, grub_be_to_cpu16 (catkey_a->namelen))) return -1; /* XXX: This error never occurs, but in case it happens just skip this entry. */ @@ -563,7 +563,7 @@ grub_hfsplus_read_symlink (grub_fshelp_node_t node) return symlink; } -int +static int grub_hfsplus_btree_iterate_node (struct grub_hfsplus_btree *btree, struct grub_hfsplus_btnode *first_node, int first_rec, @@ -723,7 +723,7 @@ grub_hfsplus_iterate_dir (grub_fshelp_node_t dir, for (i = 0; i < grub_be_to_cpu16 (catkey->namelen); i++) catkey->name[i] = grub_be_to_cpu16 (catkey->name[i]); - if (! grub_utf16_to_utf8 (filename, catkey->name, + if (! grub_utf16_to_utf8 ((grub_uint8_t *) filename, catkey->name, grub_be_to_cpu16 (catkey->namelen))) { grub_free (filename); diff --git a/fs/jfs.c b/fs/jfs.c index a43eb6009..9431f81a4 100644 --- a/fs/jfs.c +++ b/fs/jfs.c @@ -342,7 +342,7 @@ grub_jfs_mount (grub_disk_t disk) sizeof (struct grub_jfs_sblock), (char *) &data->sblock)) goto fail; - if (grub_strncmp (data->sblock.magic, "JFS1", 4)) + if (grub_strncmp ((char *) (data->sblock.magic), "JFS1", 4)) { grub_error (GRUB_ERR_BAD_FS, "not a jfs filesystem"); goto fail; @@ -398,7 +398,7 @@ grub_jfs_opendir (struct grub_jfs_data *data, struct grub_jfs_inode *inode) { diro->leaf = inode->dir.dirents; diro->next_leaf = (struct grub_jfs_leaf_next_dirent *) de; - diro->sorted = inode->dir.header.sorted; + diro->sorted = (char *) (inode->dir.header.sorted); diro->count = inode->dir.header.count; diro->dirpage = 0; @@ -530,7 +530,7 @@ grub_jfs_getent (struct grub_jfs_diropen *diro) diro->index++; /* Convert the temporary UTF16 filename to UTF8. */ - *grub_utf16_to_utf8 (diro->name, filename, strpos) = '\0'; + *grub_utf16_to_utf8 ((grub_uint8_t *) (diro->name), filename, strpos) = '\0'; return 0; } @@ -703,7 +703,7 @@ grub_jfs_lookup_symlink (struct grub_jfs_data *data, int ino) return grub_error (GRUB_ERR_SYMLINK_LOOP, "too deep nesting of symlinks"); if (size <= 128) - grub_strncpy (symlink, data->currinode.symlink.path, 128); + grub_strncpy (symlink, (char *) (data->currinode.symlink.path), 128); else if (grub_jfs_read_file (data, 0, 0, size, symlink) < 0) return grub_errno; @@ -851,7 +851,7 @@ grub_jfs_label (grub_device_t device, char **label) data = grub_jfs_mount (device->disk); if (data) - *label = grub_strndup (data->sblock.volname, 11); + *label = grub_strndup ((char *) (data->sblock.volname), 11); else *label = 0; diff --git a/fs/sfs.c b/fs/sfs.c index ed68e0808..0d27b4385 100644 --- a/fs/sfs.c +++ b/fs/sfs.c @@ -288,7 +288,7 @@ grub_sfs_mount (grub_disk_t disk) goto fail; /* Make sure this is a sfs filesystem. */ - if (grub_strncmp (data->rblock.header.magic, "SFS", 4)) + if (grub_strncmp ((char *) (data->rblock.header.magic), "SFS", 4)) { grub_error (GRUB_ERR_BAD_FS, "not a sfs filesystem"); goto fail; @@ -296,7 +296,7 @@ grub_sfs_mount (grub_disk_t disk) data->blocksize = grub_be_to_cpu32 (data->rblock.blocksize); rootobjc_data = grub_malloc (data->blocksize); - if (!rootobjc_data) + if (! rootobjc_data) goto fail; /* Read the root object container. */ @@ -312,7 +312,7 @@ grub_sfs_mount (grub_disk_t disk) data->diropen.block = blk; data->diropen.data = data; data->disk = disk; - data->label = grub_strdup (rootobjc->objects[0].filename); + data->label = grub_strdup ((char *) (rootobjc->objects[0].filename)); return data; @@ -403,7 +403,7 @@ grub_sfs_iterate_dir (grub_fshelp_node_t dir, { struct grub_sfs_obj *obj; obj = (struct grub_sfs_obj *) ((char *) objc + pos); - char *filename = obj->filename; + char *filename = (char *) (obj->filename); int len; enum grub_fshelp_filetype type; unsigned int block; diff --git a/fs/ufs.c b/fs/ufs.c index ab25a67d0..845374b8d 100644 --- a/fs/ufs.c +++ b/fs/ufs.c @@ -363,7 +363,7 @@ grub_ufs_lookup_symlink (struct grub_ufs_data *data, int ino) if (INODE_SIZE (data) < (GRUB_UFS_DIRBLKS + GRUB_UFS_INDIRBLKS * INODE_BLKSZ (data))) - grub_strcpy (symlink, INODE (data, symlink)); + grub_strcpy (symlink, (char *) INODE (data, symlink)); else { grub_disk_read (data->disk, diff --git a/fs/xfs.c b/fs/xfs.c index 6992e6626..39adc204d 100644 --- a/fs/xfs.c +++ b/fs/xfs.c @@ -191,7 +191,7 @@ grub_xfs_read_inode (struct grub_xfs_data *data, grub_uint64_t ino, sizeof (struct grub_xfs_inode), (char *) inode)) return grub_errno; - if (grub_strncmp (inode->magic, "IN", 2)) + if (grub_strncmp ((char *) inode->magic, "IN", 2)) return grub_error (GRUB_ERR_BAD_FS, "not a correct XFS inode.\n"); return 0; @@ -494,7 +494,7 @@ grub_xfs_mount (grub_disk_t disk) sizeof (struct grub_xfs_sblock), (char *) &data->sblock)) goto fail; - if (grub_strncmp (data->sblock.magic, "XFSB", 4)) + if (grub_strncmp ((char *) (data->sblock.magic), "XFSB", 4)) { grub_error (GRUB_ERR_BAD_FS, "not a xfs filesystem"); goto fail; @@ -663,7 +663,7 @@ grub_xfs_label (grub_device_t device, char **label) data = grub_xfs_mount (disk); if (data) - *label = grub_strndup (data->sblock.label, 12); + *label = grub_strndup ((char *) (data->sblock.label), 12); else *label = 0; diff --git a/genkernsyms.sh b/genkernsyms.sh deleted file mode 100644 index 12189355f..000000000 --- a/genkernsyms.sh +++ /dev/null @@ -1,15 +0,0 @@ -#! /bin/sh -# -# Copyright (C) 2002 Free Software Foundation, Inc. -# -# This gensymlist.sh is free software; the author -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -cat $* | grep -v '^#' | sed -n '/EXPORT_FUNC *([a-zA-Z0-9_]*)/{s/.*EXPORT_FUNC *(\([a-zA-Z0-9_]*\)).*/\1 kernel/;p;}' -cat $* | grep -v '^#' | sed -n '/EXPORT_VAR *([a-zA-Z0-9_]*)/{s/.*EXPORT_VAR *(\([a-zA-Z0-9_]*\)).*/\1 kernel/;p;}' diff --git a/genkernsyms.sh.in b/genkernsyms.sh.in new file mode 100644 index 000000000..e06f5e50e --- /dev/null +++ b/genkernsyms.sh.in @@ -0,0 +1,24 @@ +#! /bin/sh +# +# Copyright (C) 2002,2006 Free Software Foundation, Inc. +# +# This gensymlist.sh is free software; the author +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +### The configure script will replace these variables. + +srcdir=@srcdir@ +CC=@CC@ + +$CC -DGRUB_SYMBOL_GENERATOR=1 -E -I. -Iinclude -I$srcdir/include $* \ + | grep -v '^#' \ + | sed -n \ + -e '/EXPORT_FUNC *([a-zA-Z0-9_]*)/{s/.*EXPORT_FUNC *(\([a-zA-Z0-9_]*\)).*/\1 kernel/;p;}' \ + -e '/EXPORT_VAR *([a-zA-Z0-9_]*)/{s/.*EXPORT_VAR *(\([a-zA-Z0-9_]*\)).*/\1 kernel/;p;}' \ + | sort -u diff --git a/gensymlist.sh b/gensymlist.sh.in similarity index 72% rename from gensymlist.sh rename to gensymlist.sh.in index c7e41a93d..588a1836e 100644 --- a/gensymlist.sh +++ b/gensymlist.sh.in @@ -1,8 +1,8 @@ #! /bin/sh # -# Copyright (C) 2002 Free Software Foundation, Inc. +# Copyright (C) 2002,2006 Free Software Foundation, Inc. # -# This gensymlist.sh is free software; the author +# This gensymlist.sh.in is free software; the author # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # @@ -11,11 +11,17 @@ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. +### The configure script will replace these variables. + +srcdir=@srcdir@ +CC=@CC@ + + cat < -#include #include typedef grub_uint32_t grub_video_color_t; @@ -241,89 +240,89 @@ struct grub_video_adapter }; typedef struct grub_video_adapter *grub_video_adapter_t; -void EXPORT_FUNC(grub_video_register) (grub_video_adapter_t adapter); -void EXPORT_FUNC(grub_video_unregister) (grub_video_adapter_t adapter); -void EXPORT_FUNC(grub_video_iterate) (int (*hook) (grub_video_adapter_t adapter)); +void grub_video_register (grub_video_adapter_t adapter); +void grub_video_unregister (grub_video_adapter_t adapter); +void grub_video_iterate (int (*hook) (grub_video_adapter_t adapter)); -grub_err_t EXPORT_FUNC(grub_video_setup) (unsigned int width, - unsigned int height, - unsigned int mode_type); +grub_err_t grub_video_setup (unsigned int width, + unsigned int height, + unsigned int mode_type); -grub_err_t EXPORT_FUNC(grub_video_restore) (void); +grub_err_t grub_video_restore (void); -grub_err_t EXPORT_FUNC(grub_video_get_info) (struct grub_video_mode_info *mode_info); +grub_err_t grub_video_get_info (struct grub_video_mode_info *mode_info); -enum grub_video_blit_format EXPORT_FUNC(grub_video_get_blit_format) (struct grub_video_mode_info *mode_info); +enum grub_video_blit_format grub_video_get_blit_format (struct grub_video_mode_info *mode_info); -grub_err_t EXPORT_FUNC(grub_video_set_palette) (unsigned int start, - unsigned int count, - struct grub_video_palette_data *palette_data); +grub_err_t grub_video_set_palette (unsigned int start, + unsigned int count, + struct grub_video_palette_data *palette_data); -grub_err_t EXPORT_FUNC(grub_video_get_palette) (unsigned int start, - unsigned int count, - struct grub_video_palette_data *palette_data); +grub_err_t grub_video_get_palette (unsigned int start, + unsigned int count, + struct grub_video_palette_data *palette_data); -grub_err_t EXPORT_FUNC(grub_video_set_viewport) (unsigned int x, - unsigned int y, - unsigned int width, - unsigned int height); +grub_err_t grub_video_set_viewport (unsigned int x, + unsigned int y, + unsigned int width, + unsigned int height); -grub_err_t EXPORT_FUNC(grub_video_get_viewport) (unsigned int *x, - unsigned int *y, - unsigned int *width, - unsigned int *height); +grub_err_t grub_video_get_viewport (unsigned int *x, + unsigned int *y, + unsigned int *width, + unsigned int *height); -grub_video_color_t EXPORT_FUNC(grub_video_map_color) (grub_uint32_t color_name); +grub_video_color_t grub_video_map_color (grub_uint32_t color_name); -grub_video_color_t EXPORT_FUNC(grub_video_map_rgb) (grub_uint8_t red, - grub_uint8_t green, - grub_uint8_t blue); +grub_video_color_t grub_video_map_rgb (grub_uint8_t red, + grub_uint8_t green, + grub_uint8_t blue); -grub_video_color_t EXPORT_FUNC(grub_video_map_rgba) (grub_uint8_t red, - grub_uint8_t green, - grub_uint8_t blue, - grub_uint8_t alpha); +grub_video_color_t grub_video_map_rgba (grub_uint8_t red, + grub_uint8_t green, + grub_uint8_t blue, + grub_uint8_t alpha); -grub_err_t EXPORT_FUNC(grub_video_fill_rect) (grub_video_color_t color, - int x, - int y, - unsigned int width, - unsigned int height); +grub_err_t grub_video_fill_rect (grub_video_color_t color, + int x, + int y, + unsigned int width, + unsigned int height); -grub_err_t EXPORT_FUNC(grub_video_blit_glyph) (struct grub_font_glyph *glyph, - grub_video_color_t color, - int x, - int y); +grub_err_t grub_video_blit_glyph (struct grub_font_glyph *glyph, + grub_video_color_t color, + int x, + int y); -grub_err_t EXPORT_FUNC(grub_video_blit_bitmap) (struct grub_video_bitmap *bitmap, - int x, - int y, - int offset_x, - int offset_y, - unsigned int width, - unsigned int height); +grub_err_t grub_video_blit_bitmap (struct grub_video_bitmap *bitmap, + int x, + int y, + int offset_x, + int offset_y, + unsigned int width, + unsigned int height); -grub_err_t EXPORT_FUNC(grub_video_blit_render_target) (struct grub_video_render_target *source, - int x, - int y, - int offset_x, - int offset_y, - unsigned int width, - unsigned int height); +grub_err_t grub_video_blit_render_target (struct grub_video_render_target *source, + int x, + int y, + int offset_x, + int offset_y, + unsigned int width, + unsigned int height); -grub_err_t EXPORT_FUNC(grub_video_scroll) (grub_video_color_t color, - int dx, - int dy); +grub_err_t grub_video_scroll (grub_video_color_t color, + int dx, + int dy); -grub_err_t EXPORT_FUNC(grub_video_swap_buffers) (void); +grub_err_t grub_video_swap_buffers (void); -grub_err_t EXPORT_FUNC(grub_video_create_render_target) (struct grub_video_render_target **result, - unsigned int width, - unsigned int height, - unsigned int mode_type); +grub_err_t grub_video_create_render_target (struct grub_video_render_target **result, + unsigned int width, + unsigned int height, + unsigned int mode_type); -grub_err_t EXPORT_FUNC(grub_video_delete_render_target) (struct grub_video_render_target *target); +grub_err_t grub_video_delete_render_target (struct grub_video_render_target *target); + +grub_err_t grub_video_set_active_render_target (struct grub_video_render_target *target); -grub_err_t EXPORT_FUNC(grub_video_set_active_render_target) (struct grub_video_render_target *target); - #endif /* ! GRUB_VIDEO_HEADER */ diff --git a/util/grub-emu.c b/util/grub-emu.c index 99fc3d843..602098f1d 100644 --- a/util/grub-emu.c +++ b/util/grub-emu.c @@ -1,6 +1,6 @@ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. + * Copyright (C) 2003,2004,2005,2006 Free Software Foundation, Inc. * * GRUB is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -53,6 +53,9 @@ /* Used for going back to the main function. */ jmp_buf main_env; +/* Store the prefix specified by an argument. */ +static char *prefix = 0; + grub_addr_t grub_arch_modules_addr (void) { @@ -83,6 +86,14 @@ grub_machine_init (void) grub_console_init (); } +void +grub_machine_set_prefix (void) +{ + grub_env_set ("prefix", prefix); + free (prefix); + prefix = 0; +} + void grub_machine_fini (void) { @@ -147,8 +158,8 @@ static struct argp argp = {options, parse_opt, 0, doc, 0, 0, 0}; int main (int argc, char *argv[]) { - char *prefix = 0; - char rootprefix[100]; + char *dir; + struct arguments args = { .dir = DEFAULT_DIRECTORY, @@ -184,10 +195,10 @@ main (int argc, char *argv[]) } } - prefix = grub_get_prefix (args.dir ? : DEFAULT_DIRECTORY); - sprintf (rootprefix, "%s%s", args.root_dev, prefix); - - grub_env_set ("prefix", rootprefix); + dir = grub_get_prefix (args.dir ? : DEFAULT_DIRECTORY); + prefix = xmalloc (strlen (args.root_dev) + strlen (dir) + 1); + sprintf (prefix, "%s%s", args.root_dev, dir); + free (dir); /* XXX: This is a bit unportable. */ grub_util_biosdisk_init (args.dev_map); diff --git a/util/i386/pc/grub-mkimage.c b/util/i386/pc/grub-mkimage.c index 546f4738a..99a331101 100644 --- a/util/i386/pc/grub-mkimage.c +++ b/util/i386/pc/grub-mkimage.c @@ -61,9 +61,11 @@ compress_kernel (char *kernel_img, size_t kernel_size, memcpy (*core_img, kernel_img, GRUB_KERNEL_MACHINE_RAW_SIZE); grub_util_info ("compressing the core image"); - if (lzo1x_999_compress (kernel_img + GRUB_KERNEL_MACHINE_RAW_SIZE, + if (lzo1x_999_compress ((const lzo_byte *) (kernel_img + + GRUB_KERNEL_MACHINE_RAW_SIZE), kernel_size - GRUB_KERNEL_MACHINE_RAW_SIZE, - *core_img + GRUB_KERNEL_MACHINE_RAW_SIZE, + (lzo_byte *) (*core_img + + GRUB_KERNEL_MACHINE_RAW_SIZE), &size, wrkmem) != LZO_E_OK) grub_util_error ("cannot compress the kernel image");