4e93851c0f
Use the environment context in the menu. Remove the commands "default" and "timeout", and use variables instead. * normal/menu.c: Include grub/env.h. (print_entry): Cast TITLE to silence gcc. (get_timeout): New function. (set_timeout): Likewise. (get_entry_number): Likewise. (run_menu): Use a default entry, a fallback entry and a timeout in the environment variables "default", "fallback" and "timeout". Also, tweak the default entry if it is not within the current menu entries. (grub_menu_run): Use a fallback entry in the environment variable "fallback". * normal/main.c (read_config_file): Do not initialize NEWMENU->DEFAULT_ENTRY, NEWMENU->FALLBACK_ENTRY or NEWMENU->TIMEOUT. (grub_normal_execute): Use a data slot to store the menu. * include/grub/normal.h (struct grub_menu): Removed default_entry, fallback_entry and timeout. (struct grub_menu_list): Removed. (grub_menu_list_t): Likewise. (struct grub_context): Likewise. (grub_context_t): Likewise. (grub_context_get): Likewise. (grub_context_get_current_menu): Likewise. (grub_context_push_menu): Likewise. (grub_context_pop_menu): Likewise. (grub_default_init): Likewise. (grub_default_fini): Likewise. (grub_timeout_init): Likewise. (grub_timeout_fini): Likewise. * conf/sparc64-ieee1275.rmk (pkgdata_MODULES): Removed default.mod and timeout.mod. (normal_mod_SOURCES): Removed normal/context.c. * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Removed commands/default.c, commands/timeout.c and normal/context.c. (normal_mod_SOURCES): Removed normal/context.c. * conf/i386-pc.rmk (grub_emu_SOURCES): Removed commands/default.c, commands/timeout.c and normal/context.c. (normal_mod_SOURCES): Removed normal/context.c. * conf/i386-efi.rmk (grub_emu_SOURCES): Removed commands/default.c, commands/timeout.c and normal/context.c. (normal_mod_SOURCES): Removed normal/context.c. * conf/common.rmk (pkgdata_MODULES): Removed default.mod and timeout.mod. (default_mod_SOURCES): Removed. (default_mod_CFLAGS): Likewise. (default_mod_LDFLAGS): Likewise. (timeout_mod_SOURCES): Removed. (timeout_mod_CFLAGS): Likewise. (timeout_mod_LDFLAGS): Likewise. * DISTLIST: Removed commands/default.c, commands/timeout.c and normal/context.c. * commands/default.c: Removed. * commands/timeout.c: Likewise. * normal/context.c: Likewise.
118 lines
4.4 KiB
Makefile
118 lines
4.4 KiB
Makefile
# -*- makefile -*-
|
|
|
|
COMMON_ASFLAGS = -nostdinc -fno-builtin -m32
|
|
COMMON_CFLAGS = -fno-builtin -m32
|
|
COMMON_LDFLAGS = -melf_i386 -nostdlib
|
|
|
|
# Utilities.
|
|
bin_UTILITIES = grub-mkimage
|
|
#sbin_UTILITIES = grub-setup grub-emu grub-mkdevicemap grub-probefs
|
|
noinst_UTILITIES = genmoddep
|
|
|
|
# For grub-mkimage.
|
|
grub_mkimage_SOURCES = util/i386/efi/grub-mkimage.c util/misc.c \
|
|
util/resolve.c
|
|
|
|
# For grub-setup.
|
|
#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 \
|
|
# kern/err.c kern/misc.c fs/fat.c fs/ext2.c fs/xfs.c fs/affs.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 fs/hfsplus.c kern/file.c \
|
|
# kern/fs.c kern/env.c fs/fshelp.c
|
|
|
|
# For grub-mkdevicemap.
|
|
#grub_mkdevicemap_SOURCES = util/i386/pc/grub-mkdevicemap.c util/misc.c
|
|
|
|
# For grub-probefs.
|
|
#grub_probefs_SOURCES = util/i386/pc/grub-probefs.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 \
|
|
# fs/ext2.c kern/parser.c kern/partition.c partmap/pc.c fs/ufs.c \
|
|
# fs/minix.c fs/hfs.c fs/jfs.c kern/fs.c kern/env.c fs/fshelp.c \
|
|
# fs/xfs.c fs/affs.c fs/sfs.c fs/hfsplus.c
|
|
|
|
# For grub-emu.
|
|
grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \
|
|
commands/configfile.c commands/help.c \
|
|
commands/terminal.c commands/ls.c commands/test.c \
|
|
commands/search.c \
|
|
commands/i386/pc/halt.c commands/i386/pc/reboot.c \
|
|
disk/loopback.c \
|
|
fs/affs.c fs/ext2.c fs/fat.c fs/fshelp.c fs/hfs.c fs/iso9660.c \
|
|
fs/jfs.c fs/minix.c fs/sfs.c fs/ufs.c fs/xfs.c fs/hfsplus.c \
|
|
io/gzio.c \
|
|
kern/device.c kern/disk.c kern/dl.c kern/env.c kern/err.c \
|
|
normal/execute.c kern/file.c kern/fs.c normal/lexer.c \
|
|
kern/loader.c kern/main.c kern/misc.c kern/parser.c \
|
|
grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \
|
|
normal/arg.c normal/cmdline.c normal/command.c normal/function.c\
|
|
normal/completion.c normal/context.c normal/main.c \
|
|
normal/menu.c normal/menu_entry.c normal/misc.c normal/script.c \
|
|
partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \
|
|
partmap/acorn.c partmap/gpt.c \
|
|
util/console.c util/grub-emu.c util/misc.c \
|
|
util/i386/pc/biosdisk.c util/i386/pc/getroot.c \
|
|
util/i386/pc/misc.c grub_emu_init.c
|
|
|
|
grub_emu_LDFLAGS = $(LIBCURSES)
|
|
|
|
# For genmoddep.
|
|
genmoddep_SOURCES = util/genmoddep.c
|
|
|
|
# Scripts.
|
|
#sbin_SCRIPTS = grub-install
|
|
|
|
# For grub-install.
|
|
#grub_install_SOURCES = util/efi/pc/grub-install.in
|
|
|
|
# Modules.
|
|
pkgdata_MODULES = kernel.mod normal.mod _chain.mod chain.mod
|
|
|
|
# For kernel.mod.
|
|
kernel_mod_EXPORTS = no
|
|
kernel_mod_SOURCES = kern/i386/efi/startup.S kern/main.c kern/device.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/i386/dl.c kern/i386/efi/init.c kern/parser.c kern/partition.c \
|
|
kern/env.c symlist.c kern/efi/efi.c kern/efi/init.c kern/efi/mm.c \
|
|
term/efi/console.c disk/efi/efidisk.c
|
|
kernel_mod_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 parser.h partition.h \
|
|
pc_partition.h rescue.h symbol.h term.h types.h \
|
|
i386/efi/time.h efi/efi.h efi/time.h efi/disk.h
|
|
kernel_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
kernel_mod_ASFLAGS = $(COMMON_ASFLAGS)
|
|
kernel_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
|
|
|
MOSTLYCLEANFILES += symlist.c
|
|
MOSTLYCLEANFILES += symlist.c kernel_syms.lst
|
|
DEFSYMFILES += kernel_syms.lst
|
|
|
|
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)) 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 \
|
|
normal/completion.c normal/execute.c \
|
|
normal/function.c normal/lexer.c normal/main.c normal/menu.c \
|
|
normal/menu_entry.c normal/misc.c grub_script.tab.c \
|
|
normal/script.c normal/i386/setjmp.S
|
|
normal_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
normal_mod_ASFLAGS = $(COMMON_ASFLAGS)
|
|
normal_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
|
|
|
# For _chain.mod.
|
|
_chain_mod_SOURCES = loader/efi/chainloader.c
|
|
_chain_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
_chain_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
|
|
|
# For chain.mod.
|
|
chain_mod_SOURCES = loader/efi/chainloader_normal.c
|
|
chain_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
chain_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
|
|
|
include $(srcdir)/conf/common.mk
|