diff --git a/ChangeLog b/ChangeLog index dc9b160ac..555a702b0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,56 @@ +2009-11-23 Robert Millan + + * configure.ac: Detect all `emu' platforms. Define + GRUB_MACHINE_* macros in TARGET_CFLAGS. Remove + --enable-grub-emu logic. Disable include/grub/machine + symlink on `emu' platforms. + + * genkernsyms.sh.in: Use @TARGET_CFLAGS@ during symbol generation. + * gensymlist.sh.in: Likewise. + + * include/grub/i386/coreboot/machine.h: Remove file. + * include/grub/i386/efi/machine.h: Likewise. + * include/grub/i386/ieee1275/machine.h: Likewise. + * include/grub/i386/pc/machine.h: Likewise. + * include/grub/i386/qemu/machine.h: Likewise. + * include/grub/powerpc/ieee1275/machine.h: Likewise. + * include/grub/sparc64/ieee1275/machine.h: Likewise. + * include/grub/x86_64/efi/machine.h: Likewise. + + * commands/acpi.c: Remove `'. + * commands/halt.c: Likewise. + * commands/reboot.c: Likewise. + * include/grub/autoefi.h: Likewise. + * include/grub/i386/at_keyboard.h: Likewise. + * include/grub/i386/kernel.h: Likewise. + * include/grub/i386/loader.h: Likewise. + * include/grub/i386/pc/memory.h: Likewise. + * kern/dl.c: Likewise. + * kern/i386/coreboot/init.c: Likewise. + * loader/i386/bsd.c: Likewise. + * loader/i386/linux.c: Likewise. + * loader/multiboot_loader.c: Likewise. + * term/i386/pc/serial.c: Likewise. + * term/usb_keyboard.c: Likewise. + + * include/grub/time.h [!GRUB_MACHINE_EMU]: Remove + `' + [!GRUB_MACHINE_EMU] (GRUB_TICKS_PER_SECOND): New macro. + * util/misc.c: Remove `' and + `'. + + * Makefile.in (enable_grub_emu): Remove variable. + Include $(srcdir)/conf/any-emu.mk for the `emu' platform. + + * conf/any-emu.rmk: New file. + * conf/common.rmk (grub_emu_init.lst, grub_emu_init.h) + (grub_emu_init.c): Move from here ... + * conf/any-emu.rmk: ... to here. + + * conf/i386-coreboot.rmk (sbin_UTILITIES): Remove `grub-emu'. + (grub_emu_SOURCES, grub_emu_LDFLAGS): Move from here ... + * conf/any-emu.rmk: ... to here. + 2009-11-23 Robert Millan * include/grub/parser.h (grub_parser_register): Document need diff --git a/Makefile.in b/Makefile.in index 17cf6209f..adab7ec0a 100644 --- a/Makefile.in +++ b/Makefile.in @@ -111,7 +111,6 @@ YACC = @YACC@ FONT_SOURCE = @FONT_SOURCE@ # Options. -enable_grub_emu = @enable_grub_emu@ enable_grub_emu_usb = @enable_grub_emu_usb@ enable_grub_fstest = @enable_grub_fstest@ enable_grub_pe2elf = @enable_grub_pe2elf@ @@ -153,7 +152,11 @@ $(addprefix $(srcdir)/,$(MKFILES)): %.mk: %.rmk genmk.rb $(RUBY) $(srcdir)/genmk.rb < $< > $@; \ fi +ifeq ($(platform), emu) +include $(srcdir)/conf/any-emu.mk +else include $(srcdir)/conf/$(target_cpu)-$(platform).mk +endif # For external modules. -include $(wildcard $(GRUB_CONTRIB)/*/conf/common.mk) diff --git a/commands/acpi.c b/commands/acpi.c index 9cfd8ef10..1a7bf8018 100644 --- a/commands/acpi.c +++ b/commands/acpi.c @@ -26,7 +26,6 @@ #include #include #include -#include #include #include diff --git a/commands/halt.c b/commands/halt.c index b902418a8..9a42938b4 100644 --- a/commands/halt.c +++ b/commands/halt.c @@ -18,7 +18,6 @@ */ #include -#include #include #if defined(GRUB_MACHINE_IEEE1275) diff --git a/commands/reboot.c b/commands/reboot.c index 11bceeb31..0b553b710 100644 --- a/commands/reboot.c +++ b/commands/reboot.c @@ -18,7 +18,6 @@ */ #include -#include #include #if defined(GRUB_MACHINE_IEEE1275) diff --git a/conf/any-emu.rmk b/conf/any-emu.rmk new file mode 100644 index 000000000..e8172b00d --- /dev/null +++ b/conf/any-emu.rmk @@ -0,0 +1,89 @@ +# -*- makefile -*- + +# Used by various components. These rules need to precede them. +script/sh/lexer.c_DEPENDENCIES = grub_script.tab.h + +sbin_UTILITIES += grub-emu +util/grub-emu.c_DEPENDENCIES = grub_emu_init.h +grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ + commands/configfile.c commands/echo.c commands/help.c \ + commands/handler.c commands/ls.c commands/test.c \ + commands/search.c commands/blocklist.c commands/hexdump.c \ + lib/hexdump.c commands/halt.c commands/reboot.c \ + lib/envblk.c commands/loadenv.c \ + commands/gptsync.c commands/probe.c commands/xnu_uuid.c \ + commands/password.c commands/keystatus.c \ + disk/host.c disk/loopback.c disk/scsi.c \ + fs/fshelp.c \ + \ + io/gzio.c \ + kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ + kern/err.c kern/list.c kern/handler.c \ + kern/command.c kern/corecmd.c commands/extcmd.c kern/file.c \ + kern/fs.c commands/boot.c kern/main.c kern/misc.c kern/parser.c \ + kern/partition.c kern/reader.c kern/term.c \ + kern/rescue_reader.c kern/rescue_parser.c \ + lib/arg.c normal/cmdline.c normal/datetime.c normal/misc.c \ + normal/handler.c normal/auth.c normal/autofs.c \ + normal/completion.c normal/main.c normal/color.c \ + normal/menu.c normal/menu_entry.c normal/menu_viewer.c \ + normal/menu_text.c \ + script/sh/main.c script/sh/execute.c script/sh/function.c \ + script/sh/lexer.c script/sh/script.c grub_script.tab.c \ + partmap/amiga.c partmap/apple.c partmap/msdos.c partmap/sun.c \ + partmap/acorn.c partmap/gpt.c \ + \ + fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ + fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ + fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ + fs/ufs.c fs/ufs2.c fs/xfs.c fs/afs.c fs/afs_be.c \ + fs/befs.c fs/befs_be.c fs/tar.c \ + \ + util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ + util/hostdisk.c util/getroot.c \ + \ + disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ + disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ + commands/parttool.c parttool/msdospart.c \ + grub_emu_init.c + +ifeq ($(target_cpu), i386) +grub_emu_SOURCES += commands/i386/cpuid.c +endif + +grub_emu_LDFLAGS = $(LIBCURSES) + +ifeq ($(enable_grub_emu_usb), yes) +grub_emu_SOURCES += disk/usbms.c util/usb.c bus/usb/usb.c \ + commands/usbtest.c +grub_emu_LDFLAGS += $(LIBCURSES) $(LIBUSB) +endif + +grub_emu_init.lst: geninit.sh $(filter-out grub_emu_init.c,$(grub_emu_SOURCES)) + rm -f $@; grep GRUB_MOD_INIT $(filter %.c,$^) /dev/null > $@ +DISTCLEANFILES += grub_emu_init.lst + +grub_emu_init.h: grub_emu_init.lst $(filter-out grub_emu_init.c,$(grub_emu_SOURCES)) geninitheader.sh + rm -f $@; sh $(srcdir)/geninitheader.sh $< > $@ +DISTCLEANFILES += grub_emu_init.h + +grub_emu_init.c: grub_emu_init.lst $(filter-out grub_emu_init.c,$(grub_emu_SOURCES)) geninit.sh grub_emu_init.h + rm -f $@; sh $(srcdir)/geninit.sh $< $(filter %.c,$^) > $@ +DISTCLEANFILES += grub_emu_init.c + + + + +# FIXME: this could be shared with common.rmk + +# For grub-mkfont. +ifeq ($(enable_grub_mkfont), yes) +bin_UTILITIES += grub-mkfont +grub_mkfont_SOURCES = util/grub-mkfont.c util/misc.c +grub_mkfont_CFLAGS = $(freetype_cflags) +grub_mkfont_LDFLAGS = $(freetype_libs) +endif + +grub_script.tab.c grub_script.tab.h: script/sh/parser.y + $(YACC) -d -p grub_script_yy -b grub_script $(srcdir)/script/sh/parser.y +DISTCLEANFILES += grub_script.tab.c grub_script.tab.h diff --git a/conf/common.rmk b/conf/common.rmk index 173f24b62..dc6d44d65 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -76,19 +76,6 @@ grub_script.tab.c grub_script.tab.h: script/sh/parser.y $(YACC) -d -p grub_script_yy -b grub_script $(srcdir)/script/sh/parser.y DISTCLEANFILES += grub_script.tab.c grub_script.tab.h -# For grub-emu. -grub_emu_init.lst: geninit.sh $(filter-out grub_emu_init.c,$(grub_emu_SOURCES)) - rm -f $@; grep GRUB_MOD_INIT $(filter %.c,$^) /dev/null > $@ -DISTCLEANFILES += grub_emu_init.lst - -grub_emu_init.h: grub_emu_init.lst $(filter-out grub_emu_init.c,$(grub_emu_SOURCES)) geninitheader.sh - rm -f $@; sh $(srcdir)/geninitheader.sh $< > $@ -DISTCLEANFILES += grub_emu_init.h - -grub_emu_init.c: grub_emu_init.lst $(filter-out grub_emu_init.c,$(grub_emu_SOURCES)) geninit.sh grub_emu_init.h - rm -f $@; sh $(srcdir)/geninit.sh $< $(filter %.c,$^) > $@ -DISTCLEANFILES += grub_emu_init.c - # For grub-probe. grub_probe_init.lst: geninit.sh $(filter-out grub_probe_init.c,$(grub_probe_SOURCES)) rm -f $@; grep GRUB_MOD_INIT $(filter %.c,$^) /dev/null > $@ diff --git a/conf/i386-coreboot.rmk b/conf/i386-coreboot.rmk index c506e4153..74a7cc9c8 100644 --- a/conf/i386-coreboot.rmk +++ b/conf/i386-coreboot.rmk @@ -95,60 +95,11 @@ kernel_syms.lst: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h genke # Utilities. sbin_UTILITIES = grub-mkdevicemap -ifeq ($(enable_grub_emu), yes) -sbin_UTILITIES += grub-emu -endif # For grub-mkdevicemap. grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/deviceiter.c \ util/devicemap.c util/misc.c -# For grub-emu. -util/grub-emu.c_DEPENDENCIES = grub_emu_init.h -grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ - commands/configfile.c commands/echo.c commands/help.c \ - commands/handler.c commands/ls.c commands/test.c \ - commands/search.c commands/blocklist.c commands/hexdump.c \ - commands/gptsync.c commands/probe.c commands/xnu_uuid.c \ - commands/password.c commands/keystatus.c \ - lib/hexdump.c commands/i386/cpuid.c \ - lib/envblk.c commands/loadenv.c \ - disk/host.c disk/loopback.c \ - \ - fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ - fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ - fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/ufs2.c fs/xfs.c fs/afs.c fs/afs_be.c \ - fs/befs.c fs/befs_be.c fs/tar.c \ - \ - fs/fshelp.c \ - io/gzio.c \ - kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ - kern/err.c kern/list.c kern/handler.c \ - kern/command.c kern/corecmd.c commands/extcmd.c kern/file.c \ - kern/fs.c commands/boot.c kern/main.c kern/misc.c kern/parser.c \ - kern/partition.c kern/reader.c kern/term.c \ - kern/rescue_reader.c kern/rescue_parser.c \ - lib/arg.c normal/cmdline.c normal/misc.c \ - normal/handler.c normal/auth.c normal/autofs.c \ - normal/completion.c normal/datetime.c normal/main.c \ - normal/menu_text.c \ - normal/menu.c normal/menu_entry.c normal/menu_viewer.c \ - normal/color.c \ - script/sh/main.c script/sh/execute.c script/sh/function.c \ - script/sh/lexer.c script/sh/script.c grub_script.tab.c \ - partmap/amiga.c partmap/apple.c partmap/msdos.c partmap/sun.c \ - partmap/acorn.c partmap/gpt.c \ - util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ - util/hostdisk.c util/getroot.c \ - \ - disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ - disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ - commands/parttool.c parttool/msdospart.c \ - grub_emu_init.c - -grub_emu_LDFLAGS = $(LIBCURSES) - sbin_SCRIPTS += grub-install grub_install_SOURCES = util/grub-install.in diff --git a/conf/i386-efi.rmk b/conf/i386-efi.rmk index 39613d186..13c3a5731 100644 --- a/conf/i386-efi.rmk +++ b/conf/i386-efi.rmk @@ -10,9 +10,6 @@ script/sh/lexer.c_DEPENDENCIES = grub_script.tab.h # Utilities. bin_UTILITIES = grub-mkimage sbin_UTILITIES = grub-mkdevicemap -#ifeq ($(enable_grub_emu), yes) -#sbin_UTILITIES += grub-emu -#endif # For grub-mkimage. grub_mkimage_SOURCES = util/i386/efi/grub-mkimage.c util/misc.c \ @@ -31,51 +28,6 @@ util/i386/efi/grub-mkimage.c_DEPENDENCIES = Makefile grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/deviceiter.c \ util/devicemap.c util/misc.c -# For grub-emu. -util/grub-emu.c_DEPENDENCIES = grub_emu_init.h -grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ - commands/configfile.c commands/help.c \ - commands/handler.c commands/ls.c commands/test.c \ - commands/search.c commands/hexdump.c lib/hexdump.c \ - commands/halt.c commands/reboot.c commands/keystatus.c \ - commands/i386/cpuid.c \ - commands/password.c \ - lib/envblk.c commands/loadenv.c \ - disk/loopback.c \ - \ - fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ - fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ - fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/ufs2.c fs/xfs.c fs/afs.c fs/afs_be.c \ - fs/befs.c fs/befs_be.c fs/tar.c \ - \ - io/gzio.c \ - kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ - kern/err.c kern/list.c kern/handler.c \ - kern/command.c kern/corecmd.c commands/extcmd.c kern/file.c \ - kern/fs.c commands/boot.c kern/main.c kern/misc.c kern/parser.c \ - kern/partition.c kern/reader.c kern/term.c \ - kern/rescue_reader.c kern/rescue_parser.c \ - lib/arg.c normal/cmdline.c normal/command.c normal/datetime.c \ - normal/auth.c normal/autofs.c \ - normal/completion.c normal/context.c normal/main.c \ - normal/menu.c normal/menu_entry.c normal/menu_viewer.c \ - normal/menu_text.c \ - normal/color.c \ - script/sh/main.c script/sh/execute.c script/sh/function.c \ - script/sh/lexer.c script/sh/script.c grub_script.tab.c \ - partmap/amiga.c partmap/apple.c partmap/msdos.c partmap/sun.c \ - partmap/acorn.c partmap/gpt.c \ - util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ - util/hostdisk.c util/getroot.c \ - \ - disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ - disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ - commands/parttool.c parttool/msdospart.c \ - grub_emu_init.c - -grub_emu_LDFLAGS = $(LIBCURSES) - # Scripts. sbin_SCRIPTS = grub-install diff --git a/conf/i386-ieee1275.rmk b/conf/i386-ieee1275.rmk index 1eeba3af5..2d9532380 100644 --- a/conf/i386-ieee1275.rmk +++ b/conf/i386-ieee1275.rmk @@ -49,59 +49,11 @@ kernel_syms.lst: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h genke # Utilities. sbin_UTILITIES = grub-mkdevicemap -ifeq ($(enable_grub_emu), yes) -sbin_UTILITIES += grub-emu -endif # For grub-mkdevicemap. grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/deviceiter.c \ util/devicemap.c util/misc.c -# For grub-emu. -util/grub-emu.c_DEPENDENCIES = grub_emu_init.h -grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ - commands/configfile.c commands/echo.c commands/help.c \ - commands/handler.c commands/ls.c commands/test.c \ - commands/search.c commands/blocklist.c commands/hexdump.c \ - lib/hexdump.c commands/halt.c commands/reboot.c \ - lib/envblk.c commands/loadenv.c \ - commands/gptsync.c commands/probe.c commands/xnu_uuid.c \ - commands/i386/cpuid.c \ - commands/password.c commands/keystatus.c \ - disk/host.c disk/loopback.c \ - \ - fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ - fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ - fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/ufs2.c fs/xfs.c fs/afs.c fs/afs_be.c fs/befs.c \ - fs/befs_be.c fs/tar.c \ - \ - fs/fshelp.c \ - io/gzio.c \ - kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ - kern/err.c kern/list.c kern/handler.c \ - kern/command.c kern/corecmd.c commands/extcmd.c kern/file.c \ - kern/fs.c commands/boot.c kern/main.c kern/misc.c kern/parser.c \ - kern/partition.c kern/reader.c kern/term.c \ - kern/rescue_reader.c kern/rescue_parser.c \ - lib/arg.c normal/cmdline.c normal/datetime.c normal/misc.c \ - normal/handler.c normal/auth.c normal/autofs.c \ - normal/completion.c normal/main.c normal/menu_text.c \ - normal/menu.c normal/menu_entry.c normal/menu_viewer.c \ - normal/color.c \ - script/sh/main.c script/sh/execute.c script/sh/function.c \ - script/sh/lexer.c script/sh/script.c grub_script.tab.c \ - partmap/amiga.c partmap/apple.c partmap/msdos.c partmap/sun.c \ - partmap/acorn.c partmap/gpt.c \ - util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ - util/hostdisk.c util/getroot.c \ - \ - disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ - disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ - grub_emu_init.c - -grub_emu_LDFLAGS = $(LIBCURSES) - # Scripts. sbin_SCRIPTS = grub-install diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index e1688ccd5..d4118526b 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -82,9 +82,6 @@ kernel_syms.lst: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h genke # Utilities. bin_UTILITIES = grub-mkimage sbin_UTILITIES = grub-setup grub-mkdevicemap -ifeq ($(enable_grub_emu), yes) -sbin_UTILITIES += grub-emu -endif # For grub-mkimage. grub_mkimage_SOURCES = gnulib/progname.c util/i386/pc/grub-mkimage.c util/misc.c \ @@ -116,59 +113,6 @@ grub_setup_SOURCES = gnulib/progname.c \ grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/deviceiter.c \ util/devicemap.c util/misc.c -# For grub-emu. -util/grub-emu.c_DEPENDENCIES = grub_emu_init.h -grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ - commands/configfile.c commands/echo.c commands/help.c \ - commands/handler.c commands/ls.c commands/test.c \ - commands/search.c commands/blocklist.c commands/hexdump.c \ - lib/hexdump.c commands/i386/pc/halt.c commands/reboot.c \ - lib/envblk.c commands/loadenv.c \ - commands/gptsync.c commands/probe.c commands/xnu_uuid.c \ - commands/i386/cpuid.c \ - commands/password.c commands/keystatus.c \ - disk/host.c disk/loopback.c disk/scsi.c \ - fs/fshelp.c \ - \ - io/gzio.c \ - kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ - kern/err.c kern/list.c kern/handler.c \ - kern/command.c kern/corecmd.c commands/extcmd.c kern/file.c \ - kern/fs.c commands/boot.c kern/main.c kern/misc.c kern/parser.c \ - kern/partition.c kern/reader.c kern/term.c \ - kern/rescue_reader.c kern/rescue_parser.c \ - lib/arg.c normal/cmdline.c normal/datetime.c normal/misc.c \ - normal/handler.c normal/auth.c normal/autofs.c \ - normal/completion.c normal/main.c normal/color.c \ - normal/menu.c normal/menu_entry.c normal/menu_viewer.c \ - normal/menu_text.c \ - script/sh/main.c script/sh/execute.c script/sh/function.c \ - script/sh/lexer.c script/sh/script.c grub_script.tab.c \ - partmap/amiga.c partmap/apple.c partmap/msdos.c partmap/sun.c \ - partmap/acorn.c partmap/gpt.c \ - \ - fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ - fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ - fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/ufs2.c fs/xfs.c fs/afs.c fs/afs_be.c \ - fs/befs.c fs/befs_be.c fs/tar.c \ - \ - util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ - util/hostdisk.c util/getroot.c \ - \ - disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ - disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ - commands/parttool.c parttool/msdospart.c \ - grub_emu_init.c - -grub_emu_LDFLAGS = $(LIBCURSES) - -ifeq ($(enable_grub_emu_usb), yes) -grub_emu_SOURCES += disk/usbms.c util/usb.c bus/usb/usb.c \ - commands/usbtest.c -grub_emu_LDFLAGS += $(LIBCURSES) $(LIBUSB) -endif - sbin_SCRIPTS += grub-install grub_install_SOURCES = util/grub-install.in diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index ee7f9ec27..b8c62711b 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -30,60 +30,11 @@ pkglib_PROGRAMS = kernel.img # Utilities. sbin_UTILITIES = grub-mkdevicemap -ifeq ($(enable_grub_emu), yes) -sbin_UTILITIES += grub-emu -endif # For grub-mkdevicemap. grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/deviceiter.c \ util/devicemap.c util/misc.c -# For grub-emu -util/grub-emu.c_DEPENDENCIES = grub_emu_init.h -grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ - commands/configfile.c commands/help.c \ - commands/search.c commands/handler.c commands/test.c \ - commands/ls.c commands/blocklist.c commands/hexdump.c \ - lib/hexdump.c commands/halt.c commands/reboot.c \ - lib/envblk.c commands/loadenv.c \ - commands/gptsync.c commands/probe.c commands/xnu_uuid.c \ - commands/password.c commands/keystatus.c \ - disk/loopback.c \ - \ - fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ - fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ - fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/ufs2.c fs/xfs.c fs/afs.c fs/afs_be.c \ - fs/befs.c fs/befs_be.c fs/tar.c \ - \ - io/gzio.c \ - kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ - kern/err.c kern/file.c kern/fs.c commands/boot.c kern/main.c \ - kern/misc.c kern/parser.c kern/partition.c kern/reader.c \ - kern/rescue_reader.c kern/rescue_parser.c \ - kern/term.c kern/list.c kern/handler.c fs/fshelp.c \ - kern/command.c kern/corecmd.c commands/extcmd.c \ - lib/arg.c normal/cmdline.c normal/datetime.c \ - normal/completion.c normal/misc.c \ - normal/handler.c normal/auth.c normal/autofs.c normal/main.c \ - normal/menu.c \ - normal/menu_text.c \ - normal/menu_entry.c normal/menu_viewer.c \ - normal/color.c \ - script/sh/main.c script/sh/execute.c script/sh/function.c \ - script/sh/lexer.c script/sh/script.c \ - partmap/amiga.c partmap/apple.c partmap/msdos.c partmap/sun.c \ - partmap/acorn.c \ - util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ - util/hostdisk.c util/getroot.c \ - \ - disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ - disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ - commands/parttool.c parttool/msdospart.c \ - grub_script.tab.c grub_emu_init.c - -grub_emu_LDFLAGS = $(LIBCURSES) - kernel_img_SOURCES = kern/powerpc/ieee1275/startup.S kern/ieee1275/cmain.c \ kern/ieee1275/ieee1275.c kern/main.c kern/device.c \ kern/disk.c kern/dl.c kern/err.c kern/file.c kern/fs.c \ diff --git a/conf/sparc64-ieee1275.rmk b/conf/sparc64-ieee1275.rmk index 62e951a5e..945a33d3f 100644 --- a/conf/sparc64-ieee1275.rmk +++ b/conf/sparc64-ieee1275.rmk @@ -60,9 +60,6 @@ kernel_syms.lst: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h genke # Utilities. bin_UTILITIES = grub-mkimage sbin_UTILITIES = grub-setup grub-mkdevicemap grub-ofpathname -ifeq ($(enable_grub_emu), yes) -sbin_UTILITIES += grub-emu -endif # For grub-mkimage. grub_mkimage_SOURCES = util/sparc64/ieee1275/grub-mkimage.c util/misc.c \ @@ -96,52 +93,6 @@ grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/deviceiter.c \ grub_ofpathname_SOURCES = util/sparc64/ieee1275/grub-ofpathname.c \ util/ieee1275/ofpath.c util/misc.c -# For grub-emu -util/grub-emu.c_DEPENDENCIES = grub_emu_init.h -grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ - commands/configfile.c commands/help.c \ - commands/search.c commands/handler.c commands/test.c \ - commands/ls.c commands/blocklist.c commands/hexdump.c \ - lib/hexdump.c commands/halt.c commands/reboot.c \ - lib/envblk.c commands/loadenv.c \ - commands/gptsync.c commands/probe.c commands/xnu_uuid.c \ - commands/password.c commands/keystatus.c \ - disk/loopback.c \ - \ - fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ - fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ - fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/ufs2.c fs/xfs.c fs/afs.c fs/afs_be.c \ - fs/befs.c fs/befs_be.c fs/tar.c \ - \ - io/gzio.c \ - kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ - kern/err.c kern/file.c kern/fs.c commands/boot.c kern/main.c \ - kern/misc.c kern/parser.c kern/partition.c kern/reader.c \ - kern/rescue_reader.c kern/rescue_parser.c \ - kern/term.c kern/list.c kern/handler.c fs/fshelp.c \ - kern/command.c kern/corecmd.c commands/extcmd.c \ - lib/arg.c normal/cmdline.c normal/datetime.c \ - normal/completion.c normal/misc.c \ - normal/handler.c normal/auth.c normal/autofs.c normal/main.c \ - normal/menu.c \ - normal/menu_text.c \ - normal/menu_entry.c normal/menu_viewer.c \ - normal/color.c \ - script/sh/main.c script/sh/execute.c script/sh/function.c \ - script/sh/lexer.c script/sh/script.c \ - partmap/amiga.c partmap/apple.c partmap/msdos.c partmap/sun.c \ - partmap/acorn.c \ - util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ - util/hostdisk.c util/getroot.c \ - \ - disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ - disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ - commands/parttool.c parttool/msdospart.c \ - grub_script.tab.c grub_emu_init.c - -grub_emu_LDFLAGS = $(LIBCURSES) - # Scripts. sbin_SCRIPTS = grub-install diff --git a/conf/x86_64-efi.rmk b/conf/x86_64-efi.rmk index 2e90dc428..df32b0a5f 100644 --- a/conf/x86_64-efi.rmk +++ b/conf/x86_64-efi.rmk @@ -10,9 +10,6 @@ script/sh/lexer.c_DEPENDENCIES = grub_script.tab.h # Utilities. bin_UTILITIES = grub-mkimage sbin_UTILITIES = grub-mkdevicemap -#ifeq ($(enable_grub_emu), yes) -#sbin_UTILITIES += grub-emu -#endif # For grub-mkimage. grub_mkimage_SOURCES = util/i386/efi/grub-mkimage.c util/misc.c \ @@ -30,50 +27,6 @@ grub_mkimage_SOURCES = util/i386/efi/grub-mkimage.c util/misc.c \ grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/deviceiter.c \ util/devicemap.c util/misc.c -# For grub-emu. -util/grub-emu.c_DEPENDENCIES = grub_emu_init.h -grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ - commands/configfile.c commands/help.c \ - commands/handler.c commands/ls.c commands/test.c \ - commands/search.c commands/hexdump.c lib/hexdump.c \ - commands/halt.c commands/reboot.c \ - commands/i386/cpuid.c \ - commands/password.c commands/keystatus.c \ - lib/envblk.c commands/loadenv.c \ - disk/loopback.c \ - \ - fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ - fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ - fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/ufs2.c fs/xfs.c fs/afs.c fs/afs_be.c \ - \ - io/gzio.c \ - kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ - kern/err.c kern/list.c kern/handler.c \ - kern/command.c kern/corecmd.c commands/extcmd.c kern/file.c \ - kern/fs.c commands/boot.c kern/main.c kern/misc.c kern/parser.c \ - kern/partition.c kern/readerescue.c kern/term.c \ - lib/arg.c normal/cmdline.c normal/misc.c normal/auth.c \ - normal/autofs.c \ - normal/completion.c normal/datetime.c normal/context.c \ - normal/main.c \ - normal/menu.c normal/menu_entry.c normal/menu_viewer.c \ - normal/menu_text.c \ - normal/color.c \ - script/sh/main.c script/sh/execute.c script/sh/function.c \ - script/sh/lexer.c script/sh/script.c grub_script.tab.c \ - partmap/amiga.c partmap/apple.c partmap/msdos.c partmap/sun.c \ - partmap/acorn.c partmap/gpt.c \ - util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ - util/hostdisk.c util/getroot.c \ - \ - disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ - disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ - commands/parttool.c parttool/msdospart.c \ - grub_emu_init.c - -grub_emu_LDFLAGS = $(LIBCURSES) - # Scripts. sbin_SCRIPTS = grub-install diff --git a/configure.ac b/configure.ac index 383cb67a3..58b291d4f 100644 --- a/configure.ac +++ b/configure.ac @@ -91,6 +91,7 @@ case "$target_cpu"-"$platform" in i386-qemu) ;; powerpc-ieee1275) ;; sparc64-ieee1275) ;; + *-emu) ;; *) AC_MSG_ERROR([platform "$platform" is not supported for target CPU "$target_cpu"]) ;; esac @@ -113,6 +114,17 @@ case "$host_os" in cygwin) host_kernel=windows ;; esac +case "$platform" in + coreboot) machine_CFLAGS="-DGRUB_MACHINE_COREBOOT=1" ;; + efi) machine_CFLAGS="-DGRUB_MACHINE_EFI=1" ;; + ieee1275) machine_CFLAGS="-DGRUB_MACHINE_IEEE1275=1" ;; + qemu) machine_CFLAGS="-DGRUB_MACHINE_QEMU=1" ;; + pc) machine_CFLAGS="-DGRUB_MACHINE_PCBIOS=1" ;; + emu) machine_CFLAGS="-DGRUB_MACHINE_EMU=1" ;; +esac +CFLAGS="$CFLAGS $machine_CFLAGS" +TARGET_CFLAGS="$TARGET_CFLAGS $machine_CFLAGS" + AC_SUBST(host_cpu) AC_SUBST(host_os) AC_SUBST(host_kernel) @@ -509,40 +521,28 @@ AC_ARG_ENABLE([mm-debug], [AC_DEFINE([MM_DEBUG], [1], [Define to 1 if you enable memory manager debugging.])]) -AC_ARG_ENABLE([grub-emu], - [AS_HELP_STRING([--enable-grub-emu], - [build and install the `grub-emu' debugging utility (default=guessed)])]) AC_ARG_ENABLE([grub-emu-usb], [AS_HELP_STRING([--enable-grub-emu-usb], [build and install the `grub-emu' debugging utility with USB support (default=guessed)])]) -if test x"$enable_grub_emu" = xno ; then - grub_emu_excuse="explicitly disabled" -fi - [# Check for curses libraries.] -[if [ x"$grub_emu_excuse" = x ]; then ] +if test "$platform" = emu; then + missing_ncurses= +[# Check for curses libraries.] AC_CHECK_LIB([ncurses], [wgetch], [LIBCURSES="-lncurses"], [AC_CHECK_LIB([curses], [wgetch], [LIBCURSES="-lcurses"], - [grub_emu_excuse=["need (n)curses libraries"]])]) + [missing_ncurses=[true]])]) AC_SUBST([LIBCURSES]) -[fi] -[if [ x"$grub_emu_excuse" = x ]; then ] +[if [ x"$missing_ncurses" = x ]; then ] [# Check for headers.] AC_CHECK_HEADERS([ncurses/curses.h], [], [AC_CHECK_HEADERS([ncurses.h], [], [AC_CHECK_HEADERS([curses.h], [], - [grub_emu_excuse=["need (n)curses headers"]])])]) + [missing_ncurses=[true]])])]) [fi] +if test x"$missing_ncurses" = xtrue ; then + AC_MSG_ERROR([grub-emu can't be compiled without ncurses]) +fi -if test x"$enable_grub_emu" = xyes && test x"$grub_emu_excuse" != x ; then - AC_MSG_ERROR([grub-emu was explicitly requested but can't be compiled]) -fi -if test x"$grub_emu_excuse" = x ; then -enable_grub_emu=yes -else -enable_grub_emu=no -grub_emu_usb_excuse="grub-emu isn't built" -fi if test x"$enable_grub_emu_usb" = xno ; then grub_emu_usb_excuse="explicitly disabled" fi @@ -565,9 +565,8 @@ enable_grub_emu_usb=yes else enable_grub_emu_usb=no fi - -AC_SUBST([enable_grub_emu]) AC_SUBST([enable_grub_emu_usb]) +fi AC_ARG_ENABLE([grub-fstest], [AS_HELP_STRING([--enable-grub-fstest], @@ -615,14 +614,18 @@ AC_SUBST(ASFLAGS) # Output files. grub_CHECK_LINK_DIR if test x"$link_dir" = xyes ; then - AC_CONFIG_LINKS([include/grub/cpu:include/grub/$target_cpu - include/grub/machine:include/grub/$target_cpu/$platform]) + AC_CONFIG_LINKS([include/grub/cpu:include/grub/$target_cpu]) + if test "$platform" != emu ; then + AC_CONFIG_LINKS([include/grub/machine:include/grub/$target_cpu/$platform]) + fi else mkdir -p include/grub 2>/dev/null rm -rf include/grub/cpu cp -rp $srcdir/include/grub/$target_cpu include/grub/cpu 2>/dev/null - rm -rf include/grub/machine - cp -rp $srcdir/include/grub/$target_cpu/$platform include/grub/machine 2>/dev/null + if test "$platform" != emu ; then + rm -rf include/grub/machine + cp -rp $srcdir/include/grub/$target_cpu/$platform include/grub/machine 2>/dev/null + fi fi AC_CONFIG_FILES([Makefile gensymlist.sh genkernsyms.sh]) AC_CONFIG_FILES([stamp-h], [echo timestamp > stamp-h]) @@ -631,16 +634,13 @@ AC_OUTPUT echo "*******************************************************" echo GRUB2 will be compiled with following components: echo Platform: "$target_cpu"-"$platform" -if [ x"$grub_emu_excuse" = x ]; then -echo grub-emu: Yes -else -echo grub-emu: No "($grub_emu_excuse)" -fi +if [ x"$platform" = xemu ]; then if [ x"$grub_emu_usb_excuse" = x ]; then echo USB support for grub-emu: Yes else echo USB support for grub-emu: No "($grub_emu_usb_excuse)" fi +fi if [ x"$enable_mm_debug" = xyes ]; then echo With memory debugging: Yes else diff --git a/genkernsyms.sh.in b/genkernsyms.sh.in index 3dec5828d..b2f3f7af9 100644 --- a/genkernsyms.sh.in +++ b/genkernsyms.sh.in @@ -19,7 +19,7 @@ u= grep "^#define HAVE_ASM_USCORE" config.h >/dev/null 2>&1 && u="_" -$CC -DGRUB_SYMBOL_GENERATOR=1 -E -I. -Iinclude -I"$srcdir/include" $* \ +$CC @TARGET_CFLAGS@ -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_]*\)).*/'"$u"'\1 kernel/;p;}' \ diff --git a/gensymlist.sh.in b/gensymlist.sh.in index 8f50b99ea..27fc5e61a 100644 --- a/gensymlist.sh.in +++ b/gensymlist.sh.in @@ -59,7 +59,7 @@ cat < #ifdef GRUB_MACHINE_EFI # include diff --git a/include/grub/i386/at_keyboard.h b/include/grub/i386/at_keyboard.h index 96b21627f..12d61608e 100644 --- a/include/grub/i386/at_keyboard.h +++ b/include/grub/i386/at_keyboard.h @@ -19,7 +19,6 @@ #ifndef GRUB_CPU_AT_KEYBOARD_HEADER #define GRUB_CPU_AT_KEYBOARD_HEADER 1 -#include #define SHIFT_L 0x2a #define SHIFT_R 0x36 diff --git a/include/grub/i386/coreboot/machine.h b/include/grub/i386/coreboot/machine.h deleted file mode 100644 index 8b7059005..000000000 --- a/include/grub/i386/coreboot/machine.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * GRUB -- GRand Unified Bootloader - * Copyright (C) 2007 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 - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GRUB 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 GRUB. If not, see . - */ - -#ifndef GRUB_MACHINE_MACHINE_HEADER -#define GRUB_MACHINE_MACHINE_HEADER 1 - -#define GRUB_MACHINE_COREBOOT 1 - -#endif /* ! GRUB_MACHINE_MACHINE_HEADER */ diff --git a/include/grub/i386/efi/machine.h b/include/grub/i386/efi/machine.h deleted file mode 100644 index 160076859..000000000 --- a/include/grub/i386/efi/machine.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * GRUB -- GRand Unified Bootloader - * Copyright (C) 2007 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 - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GRUB 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 GRUB. If not, see . - */ - -#ifndef GRUB_MACHINE_MACHINE_HEADER -#define GRUB_MACHINE_MACHINE_HEADER 1 - -#define GRUB_MACHINE_EFI 1 - -#endif /* ! GRUB_MACHINE_MACHINE_HEADER */ diff --git a/include/grub/i386/ieee1275/machine.h b/include/grub/i386/ieee1275/machine.h deleted file mode 100644 index 755eb33ae..000000000 --- a/include/grub/i386/ieee1275/machine.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * GRUB -- GRand Unified Bootloader - * Copyright (C) 2008 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 - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GRUB 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 GRUB. If not, see . - */ - -#ifndef GRUB_MACHINE_MACHINE_HEADER -#define GRUB_MACHINE_MACHINE_HEADER 1 - -#define GRUB_MACHINE_IEEE1275 1 - -#endif /* ! GRUB_MACHINE_MACHINE_HEADER */ diff --git a/include/grub/i386/kernel.h b/include/grub/i386/kernel.h index 74715e178..5514c8ccf 100644 --- a/include/grub/i386/kernel.h +++ b/include/grub/i386/kernel.h @@ -19,7 +19,6 @@ #ifndef GRUB_KERNEL_CPU_HEADER #define GRUB_KERNEL_CPU_HEADER 1 -#include #ifdef GRUB_MACHINE_IEEE1275 #define GRUB_MOD_ALIGN 0x1000 diff --git a/include/grub/i386/loader.h b/include/grub/i386/loader.h index b7fa413f1..0df5f757f 100644 --- a/include/grub/i386/loader.h +++ b/include/grub/i386/loader.h @@ -22,7 +22,6 @@ #include #include #include -#include extern grub_addr_t EXPORT_VAR(grub_os_area_addr); extern grub_size_t EXPORT_VAR(grub_os_area_size); diff --git a/include/grub/i386/pc/machine.h b/include/grub/i386/pc/machine.h deleted file mode 100644 index e6de7281a..000000000 --- a/include/grub/i386/pc/machine.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * GRUB -- GRand Unified Bootloader - * Copyright (C) 2007 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 - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GRUB 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 GRUB. If not, see . - */ - -#ifndef GRUB_MACHINE_MACHINE_HEADER -#define GRUB_MACHINE_MACHINE_HEADER 1 - -#define GRUB_MACHINE_PCBIOS 1 - -#endif /* ! GRUB_MACHINE_MACHINE_HEADER */ diff --git a/include/grub/i386/pc/memory.h b/include/grub/i386/pc/memory.h index 815390482..4ce3a6283 100644 --- a/include/grub/i386/pc/memory.h +++ b/include/grub/i386/pc/memory.h @@ -21,7 +21,6 @@ #define GRUB_MEMORY_MACHINE_HEADER 1 #include -#include #ifndef ASM_FILE #include #include diff --git a/include/grub/i386/qemu/machine.h b/include/grub/i386/qemu/machine.h deleted file mode 100644 index b57932b49..000000000 --- a/include/grub/i386/qemu/machine.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * GRUB -- GRand Unified Bootloader - * Copyright (C) 2009 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 - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GRUB 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 GRUB. If not, see . - */ - -#ifndef GRUB_MACHINE_MACHINE_HEADER -#define GRUB_MACHINE_MACHINE_HEADER 1 - -#define GRUB_MACHINE_QEMU 1 - -#endif /* ! GRUB_MACHINE_MACHINE_HEADER */ diff --git a/include/grub/powerpc/ieee1275/machine.h b/include/grub/powerpc/ieee1275/machine.h deleted file mode 100644 index 66da1d9e8..000000000 --- a/include/grub/powerpc/ieee1275/machine.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * GRUB -- GRand Unified Bootloader - * Copyright (C) 2007 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 - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GRUB 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 GRUB. If not, see . - */ - -#ifndef GRUB_MACHINE_MACHINE_HEADER -#define GRUB_MACHINE_MACHINE_HEADER 1 - -#define GRUB_MACHINE_IEEE1275 1 - -#endif /* ! GRUB_MACHINE_MACHINE_HEADER */ diff --git a/include/grub/sparc64/ieee1275/machine.h b/include/grub/sparc64/ieee1275/machine.h deleted file mode 100644 index 66da1d9e8..000000000 --- a/include/grub/sparc64/ieee1275/machine.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * GRUB -- GRand Unified Bootloader - * Copyright (C) 2007 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 - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GRUB 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 GRUB. If not, see . - */ - -#ifndef GRUB_MACHINE_MACHINE_HEADER -#define GRUB_MACHINE_MACHINE_HEADER 1 - -#define GRUB_MACHINE_IEEE1275 1 - -#endif /* ! GRUB_MACHINE_MACHINE_HEADER */ diff --git a/include/grub/time.h b/include/grub/time.h index 4dcd843de..115fbd95e 100644 --- a/include/grub/time.h +++ b/include/grub/time.h @@ -21,9 +21,14 @@ #include #include -#include #include +#ifdef GRUB_MACHINE_EMU +#define GRUB_TICKS_PER_SECOND 100000 +#else +#include +#endif + void EXPORT_FUNC(grub_millisleep) (grub_uint32_t ms); grub_uint64_t EXPORT_FUNC(grub_get_time_ms) (void); diff --git a/include/grub/x86_64/efi/machine.h b/include/grub/x86_64/efi/machine.h deleted file mode 100644 index 160076859..000000000 --- a/include/grub/x86_64/efi/machine.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * GRUB -- GRand Unified Bootloader - * Copyright (C) 2007 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 - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GRUB 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 GRUB. If not, see . - */ - -#ifndef GRUB_MACHINE_MACHINE_HEADER -#define GRUB_MACHINE_MACHINE_HEADER 1 - -#define GRUB_MACHINE_EFI 1 - -#endif /* ! GRUB_MACHINE_MACHINE_HEADER */ diff --git a/kern/dl.c b/kern/dl.c index 78ebc1e38..20ab1c5c2 100644 --- a/kern/dl.c +++ b/kern/dl.c @@ -31,7 +31,6 @@ #include #include #include -#include /* Platforms where modules are in a readonly area of memory. */ #if defined(GRUB_MACHINE_QEMU) diff --git a/kern/i386/coreboot/init.c b/kern/i386/coreboot/init.c index 0bf4934fb..550a2a60a 100644 --- a/kern/i386/coreboot/init.c +++ b/kern/i386/coreboot/init.c @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include diff --git a/loader/i386/bsd.c b/loader/i386/bsd.c index acc653c9e..6f2202a67 100644 --- a/loader/i386/bsd.c +++ b/loader/i386/bsd.c @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include diff --git a/loader/i386/linux.c b/loader/i386/linux.c index 4bdb09b24..82bfd6b95 100644 --- a/loader/i386/linux.c +++ b/loader/i386/linux.c @@ -17,7 +17,6 @@ */ #include -#include #include #include #include diff --git a/loader/multiboot_loader.c b/loader/multiboot_loader.c index 168e821c7..9078d0622 100644 --- a/loader/multiboot_loader.c +++ b/loader/multiboot_loader.c @@ -17,7 +17,6 @@ * along with GRUB. If not, see . */ -#include #include #include #include diff --git a/term/i386/pc/serial.c b/term/i386/pc/serial.c index 1d74dbbc8..3f1c6d062 100644 --- a/term/i386/pc/serial.c +++ b/term/i386/pc/serial.c @@ -16,7 +16,6 @@ * along with GRUB. If not, see . */ -#include #include #include #include diff --git a/term/usb_keyboard.c b/term/usb_keyboard.c index 76b9bc3d4..5d76c5e02 100644 --- a/term/usb_keyboard.c +++ b/term/usb_keyboard.c @@ -18,7 +18,6 @@ */ #include -#include #include #include #include diff --git a/util/misc.c b/util/misc.c index 37e75311e..799ffbf85 100644 --- a/util/misc.c +++ b/util/misc.c @@ -36,8 +36,6 @@ #include #include #include -#include -#include /* Include malloc.h, only if memalign is available. It is known that memalign is declared in malloc.h in all systems, if present. */