Support for mtime and further expandability of dir command
* include/grub/lib/datetime.h: moved to ...
* include/grub/datetime.h: ... moved here and added
declaration of grub_unixtime2datetime. All users updated
* include/grub/fs.h: new syntax for dir and mtime functionin
struct grub_fs
* include/grub/fshelp.h: new declarations of GRUB_FSHELP_TYPE_MASK
and GRUB_FSHELP_FLAGS_MASK
* commands/ls.c (grub_ls_list_files): Write mtime in long format
* fs/ext2.c (grub_ext2_dir): use new dir syntax and supply mtime
(grub_ext2_mtime): new function
* fs/hfsplus.c (grub_hfsplus_dir): use new dir syntax and supply mtime
(grub_hfsplus_mtime): new function
* fs/ufs.c (GRUB_UFS_ATTR_TYPE): new definition
(GRUB_UFS_ATTR_FILE): likewise
(GRUB_UFS_ATTR_LNK): likewise
(struct grub_ufs_sblock): new fields mtime
(grub_ufs_read_inode): new parameter to read inode to a separate buffer
all users updated
(grub_ufs_dir): mtime support
(grub_ufs_mtime): new function
* fs/affs.c (grub_affs_dir): use new dir syntax
* fs/afs.c (grub_afs_dir): likewise
* fs/cpio.c (grub_cpio_dir): likewise
* fs/fat.c (grub_fat_find_dir): likewise
* fs/hfs.c (grub_hfs_dir): likewise
* fs/iso9660.c (grub_iso9660_dir): likewise
* fs/jfs.c (grub_jfs_dir): likewise
* fs/minix.c (grub_minix_dir): likewise
* fs/ntfs.c (grub_ntfs_dir): likewise
* fs/reiserfs.c (grub_reiserfs_dir): likewise
* fs/sfs.c (grub_sfs_dir): likewise
* fs/xfs.c (grub_xfs_dir): likewise
* util/hostfs.c (grub_hostfs_dir): likewise
* lib/datetime.c: moved to ...
* normal/datetime.c: ... moved here
(grub_unixtime2datetime): new function
* kern/rescue.c (grub_rescue_print_files): use new dir syntax
* normal/completition.c (iterate_dir): use new dir syntax
* normal/misc.c (grub_normal_print_device_info): tell the
last modification time of a volume
* kern/fs.c (grub_fs_probe): updated dummy function to use new syntax
* conf/common.rmk: added lib/datetime.c to ls.mod
* conf/i386-coreboot.rmk (grub_emu_SOURCES): add normal/datetime.c
(normal_mod_SOURCES): likewise
(datetime_mod_SOURCES): Removed lib/datetime.c
* conf/i386-efi.rmk: likewise
* conf/i386-ieee1275.rmk: likewise
* conf/i386-pc.rmk: likewise
* conf/powerpc-ieee1275.rmk: likewise
* conf/sparc64-ieee1275.rmk: likewise
* conf/x86_64-efi.rmk: likewise
Support multiple fallback entries, and provide an API to support
executing default+fallback menu entries. Renamed the `terminal' menu
viewer to `text'.
* include/grub/normal.h (grub_normal_text_menu_viewer): New global
variable declaration.
(grub_menu_execute_callback): New structure declaration.
(grub_menu_execute_callback_t): New typedef.
(grub_menu_execute_with_fallback): New function declaration.
(grub_menu_get_entry): Likewise.
(grub_menu_get_timeout): Likewise.
(grub_menu_set_timeout): Likewise.
* normal/main.c (GRUB_MOD_INIT(normal)): Refer to new variable name.
* normal/menu.c (grub_wait_after_message): Moved to
`normal/menu_text.c'.
(draw_border): Likewise.
(print_message): Likewise.
(print_entry): Likewise.
(print_entries): Likewise.
(grub_menu_init_page): Likewise.
(get_entry_number): Likewise.
(print_timeout): Likewise.
(run_menu): Likewise.
(grub_menu_execute_entry): Likewise.
(show_text_menu): Likewise.
(get_and_remove_first_entry_number): New function.
(grub_menu_execute_with_fallback): Likewise.
(get_entry): Renamed to ...
(grub_menu_get_entry): .. this and made it global.
(get_timeout): Renamed to ...
(grub_menu_get_timeout): ... this and made it global.
(set_timeout): Renamed to ...
(grub_menu_set_timeout): ... this and made it global.
(grub_normal_terminal_menu_viewer): Renamed to ...
(grub_normal_text_menu_viewer): ... this.
* normal/menu_text.c: New file. Extracted text-menu-specific code
from normal/menu.c.
* conf/i386-coreboot.rmk (grub_emu_SOURCES): Add `normal/menu_text.c'.
(normal_mod_SOURCES): Likewise.
* conf/i386-efi.rmk (grub_emu_SOURCES): Likewise.
(normal_mod_SOURCES): Likewise.
* conf/i386-ieee1275.rmk (grub_emu_SOURCES): Likewise.
(normal_mod_SOURCES): Likewise.
* conf/i386-pc.rmk, (grub_emu_SOURCES): Likewise.
(normal_mod_SOURCES): Likewise.
* conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise.
(normal_mod_SOURCES): Likewise.
* conf/sparc64-ieee1275.rmk (grub_emu_SOURCES): Likewise.
(normal_mod_SOURCES): Likewise.
* conf/x86_64-efi.rmk (grub_emu_SOURCES): Likewise.
(normal_mod_SOURCES): Likewise.
* normal/main.c: Add include to grub/menu_viewer.h.
(free_menu_entry_classes): Added.
(grub_normal_menu_addentry): Added class property handling.
(grub_normal_execute): Changed to use new menu viewer for menu viewing.
(GRUB_MOD_INIT(normal)): Added register for text based menu viewer.
* normal/menu_viewer.c: New file.
* normal/menu.c (run_menu_entry): Renamed to ...
(grub_menu_execute_entry): ... this and made it as global.
(grub_menu_run): Renamed to ...
(show_text_menu): ... this and made it local.
(show_text_menu): Adapt to new function names.
(grub_normal_terminal_menu_viewer): New global variable.
* include/grub/menu.h: New file.
* include/grub/menu_viewer.h: New file.
* include/grub/normal.h: Added include to grub/menu.h.
(grub_menu_entry): Moved to include/grub/menu.h.
(grub_menu_entry_t): Likewise.
(grub_menu): Likewise.
(grub_menu_t): Likewise.
(grub_normal_terminal_menu_viewer): Added.
(grub_menu_execute_entry): Likewise.
(grub_menu_run): Removed.
* DISTLIST: Added include/grub/menu.h.
Added include/grub/menu_viewer.h.
Added normal/menu_viewer.c.
2009-01-31 Vesa Jääskeläinen <chaac@nic.fi>
* normal/execute.c (grub_script_execute_menuentry): Changed to use
arglist for menutitle arguments.
* normal/main.c (grub_normal_menu_addentry): Likewise.
* normal/parser.y (menuentry): Likewise.
* normal/script.c (grub_script_create_cmdmenu): Likewise.
* include/grub/script.h (grub_script_cmd_menuentry): Likewise.
(grub_script_create_cmdmenu): Likewise.
* include/grub/normal.h (grub_normal_menu_addentry): Likewise.
* conf/i386-pc.rmk (normal_mod_SOURCES): Adapt Colin D Bennett's
changes.
* conf/x86_64-efi.rmk (normal_mod_SOURCES): Likewise.
* conf/i386-coreboot.rmk (normal_mod_SOURCES): Likewise.
* conf/i386-efi.rmk (normal_mod_SOURCES): Likewise.
* conf/i386-ieee1275.rmk (normal_mod_SOURCES): Likewise.
* conf/powerpc-ieee1275.rmk (normal_mod_SOURCES): Likewise.
* conf/sparc64-ieee1275.rmk (normal_mod_SOURCES): Likewise.
* conf/common.rmk (grub_probe_SOURCES): Add disk/mdraid_linux.c.
(grub_fstest_SOURCES): Add disk/raid5_recover.c, disk/raid6_recover.c,
disk/mdraid_linux.c and disk/dmraid_nvidia.c and lib/crc.c.
(pkglib_MODULES): Add raid5rec.mod, raid6rec.mod, mdraid.mod and
dm_nv.mod.
(raid5rec_mod_SOURCES): New macro.
(raid5rec_mod_CFLAGS): Likewise.
(raid5rec_mod_LDFLAGS): Likewise.
(raid6rec_mod_SOURCES): Likewise.
(raid6rec_mod_CFLAGS): Likewise.
(raid6rec_mod_LDFLAGS): Likewise.
(mdraid_mod_SOURCES): Likewise.
(mdraid_mod_CFLAGS): Likewise.
(mdraid_mod_LDFLAGS): Likewise.
(dm_nv_mod_SOURCES): Likewise.
(dm_nv_mod_CFLAGS): Likewise.
(dm_nv_mod_LDFLAGS): Likewise.
* conf/i386-pc.rmk (grub_setup_SOURCES): Add disk/mdraid_linux.c.
(grub_emu_SOURCES): Add disk/raid5_recover.c, disk/raid6_recover.c,
disk/mdraid_linux.c and disk/dmraid_nvidia.c.
* conf/i386-coreboot.rmk (grub_emu_SOURCES): Add disk/raid5_recover.c,
disk/raid6_recover.c, disk/mdraid_linux.c and disk/dmraid_nvidia.c.
* conf/i386-efi.rmk (grub_emu_SOURCES): Likewise.
* conf/x86_64-efi.rmk (grub_emu_SOURCES): Likewise.
* conf/i386-ieee1275.rmk (grub_emu_SOURCES): Likewise.
* conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise.
* disk/raid5_recover.c: New file.
* disk/raid6_recover.c: Likewise.
* disk/mdraid_linux.c: Likewise.
* disk/dmraid_nvidia.c: Likewise.
* disk/i386/pc/biosdisk.c: Set total_sectors of cdrom device to
ULONG_MAX.
* disk/raid.c (grub_raid_open): Use the size of the smallest disk to
calculate the size of raid device.
(grub_raid_read): Simplify raid0 code. Support raid4, raid6 and four
different layout of raid5.
(grub_raid_scan_device): Remove code specific to mdraid.
(grub_raid_list): New variable.
(free_array): New function.
(grub_raid_register): Likewise.
(grub_raid_unregister): Likewise.
(grub_raid_rescan): Likewise.
(GRUB_MOD_INIT): Don't iterate device here.
(GRUB_MOD_FINI): Use free_array to release resource.
* include/grub/raid.h: Remove macro and structure specific to mdraid.
(grub_raid5_recover_func_t): New function variable type.
(grub_raid6_recover_func_t): Likewise.
(grub_raid5_recover_func): New variable.
(grub_raid6_recover_func): Likewise.
(grub_raid_register): New function.
(grub_raid_unregister): Likewise.
(grub_raid_rescan): Likewise.
(grub_raid_block_xor): Likewise.
* util/grub-fstest.c: Add #include <grub/raid.h> and <grub/lib/crc.h>.
(CMD_CRC): New macro.
(part): Removed.
(read_file): Handle device as well as file.
(cmd_crc): New function.
(fstest): Handle multiple disks.
(options): Remove part, raw and long, add root and diskcount.
(usage): Add crc, remove -p, -r, -l, add -r and -c.
(main): Find the first non option entry and ignore subsequence options,
add handling for the new options, support multiple disks.
* util/grub-probe.c (probe): Add mdraid to abstraction_name.
* common.rmk (bin_UTILITIES): Add grub-pe2elf.
(grub_pe2elf_SOURCES): New macro.
(CLEANFILES): Add grub-pe2elf.
* include/grub/efi/pe32.h (GRUB_PE32_SCN_ALIGN_1BYTES): New constant.
(GRUB_PE32_SCN_ALIGN_2BYTES): Likewise.
(GRUB_PE32_SCN_ALIGN_4BYTES): Likewise.
(GRUB_PE32_SCN_ALIGN_8BYTES): Likewise.
(GRUB_PE32_SCN_ALIGN_16BYTES): Likewise.
(GRUB_PE32_SCN_ALIGN_32BYTES): Likewise.
(GRUB_PE32_SCN_ALIGN_64BYTES): Likewise.
(GRUB_PE32_SCN_ALIGN_SHIFT): Likewise.
(GRUB_PE32_SCN_ALIGN_MASK): Likewise.
(GRUB_PE32_SYM_CLASS_EXTERNAL): Likewise.
(GRUB_PE32_SYM_CLASS_STATIC): Likewise.
(GRUB_PE32_SYM_CLASS_FILE): Likewise.
(GRUB_PE32_DT_FUNCTION): Likewise.
(GRUB_PE32_REL_I386_DIR32): Likewise.
(GRUB_PE32_REL_I386_REL32): Likewise.
(grub_pe32_symbol): New structure.
(grub_pe32_reloc): Likewise.
* util/grub-pe2elf.c: New file.
* configure.ac: Set TARGET_OBJ2ELF if host os is cygwin. Don't test for
start symbol in non pc platform.
* genmk.rb: Use TARGET_OBJ2ELF to convert native object format to elf.
The following patches are from Christian Franke.
* include/grub/dl.h: Remove .previous, gas supports this only
for ELF format.
* include/grub/symbol.h [__CYGWIN__] (#define FUNCTION/VARIABLE):
Remove .type, gas supports this only for ELF format.
* kern/dl.c (grub_dl_resolve_dependencies): Add check for trailing
nullbytes in symbol table. This fixes an infinite loop if table is
zero filled.
* Makefile.in: Add autoconf replacements TARGET_IMG_LDSCRIPT,
TARGET_IMG_LDFLAGS and EXEEXT.
* aclocal.m4 (grub_PROG_OBJCOPY_ABSOLUTE): Replace -Wl,-N by
TARGET_IMG_LDFLAGS_AC.
(grub_CHECK_STACK_ARG_PROBE): New function.
* conf/i386-pc.rmk: Replace -Wl,-N by TARGET_IMG_LDFLAGS.
* conf/i386-pc-cygwin-ld-img.sc: New linker script.
* configure.ac: Add check for linker script "conf/${target}-img-ld.c"
to set TARGET_IMG_LD* accordingly.
Add check for Cygwin to set TARGET_MOD_OBJCOPY accordingly.
Add call to grub_CHECK_STACK_ARG_PROBE.
Use TARGET_IMG_LDFLAGS to check start, bss_start, end symbols.
* genkernsyms.sh.in: Handle HAVE_ASM_USCORE case.
* genmk.rb: Add EXEEXT to CLEANFILES.