Commit graph

292 commits

Author SHA1 Message Date
Colin Watson
a63c31b62d * kern/emu/hostdisk.c: Include <sys/ioctl.h> and <sys/disklabel.h>
on FreeBSD.  Define HAVE_DIOCGDINFO on NetBSD and FreeBSD to reduce
the verbosity of later #ifs.
(find_partition_start): Define this function on FreeBSD too.
(device_is_wholedisk) [__FreeBSD__ || __FreeBSD_kernel__]: New
function.
(grub_util_biosdisk_get_grub_dev): Use partition-start-sector logic
on FreeBSD.
2010-09-20 12:12:33 +01:00
Yves Blusseau
15c6926126 Use gnulib-tool to create gnulib source files.
* Add gnulib files generated by gnulib-tool in build-aux, m4 and
    grub-core/gnulib directories
    * .bzignore: Add **/.deps and autogenerated gnulib files
    * configure.ac: Assign auxiliary directory to build-aux, add invocation
    of gnulib macros, add grub-core/gnulib/Makefile
    * Makefile.am: Add gnulib directory in SUBDIRS (removing unnecessary .),
    include m4 directory to aclocal.
    * Makefile.util.def: Remove direct compilation of gnulib source files
    and use the new grub-core/gnulib/libgnu.a.
    * build-aux/config.rpath: move config.rpath from top directory to
    build-aux
    * conf/Makefile.common: Remove the macro _GL_UNUSED already defined
    in gnulib headers
    * conf/Makefile.extra-dist: Add m4/gnulib-cache.m4
    * grub-core/Makefile.core.def: Remove unnecessary extra_dist
    * grub-core/lib/posix_wrap/localcharset.h (locale_charset): Update
    header.
    * grub-core/lib/posix_wrap/langinfo.h (nl_langinfo): Return static
    string.
2010-09-20 12:35:33 +02:00
Szymon Janc
c55f50180d Remove crc.mod and move crc command to hashsum.mod.
Remove lib/crc.c - users updated to use gcrypt implementation.

	* grub-core/commands/crc.c: Removed.
	* grub-core/Makefile.core.def (crc): Module removed.
	* grub-core/commands/hashsum.c (aliases[]): Add crc alias.
	* grub-core/commands/hashsum.c (GRUB_MOD_INIT): Register crc command.
	* grub-core/commands/hashsum.c (GRUB_MOD_FINI): Unregister crc command.
	* grub-core/lib/crc.c: Removed.
	* include/grub/lib/crc.h: Removed.
	* Makefile.util.def (crc): Remove lib/crc.c
	* grub-core/Makefile.core.def (libgrub.a): Remove grub-core/lib/crc.c.
	* util/grub-fstest.c (cmd_crd): Use libgcrypt crc implementation.
	* Makefile.util.def (libgrub.a): Add grub-core/lib/libgcrypt-grub/cipher/crc.c.
	* Makefile.util.def (grub-fstest): Add CFLAGS_GCRY to cflags.
	* Makefile.util.def (grub-fstest): Add CPPFLAGS_GCRY to cppflags.
	* grub-core/efiemu/prepare.c (grub_efiemu_crc): Use libgcrypt crc implementation.
2010-09-20 01:40:58 +02:00
Vladimir 'phcoder' Serbinenko
e0337366d1 * grub-core/boot/i386/pc/boot.S: Ignore %dl if it's not in a sane range. 2010-09-20 00:06:45 +02:00
Vladimir 'phcoder' Serbinenko
742f9232e3 Split config.h for util and core.
* acinclude.m4 (HAVE_ASM_USCORE): Transformed into a variable.
	(ADDR32): Likewise.
	(DATA32): Likewise.
	(BSS_START_SYMBOL): Likewise.
	(END_SYMBOL): Likewise.
	(NEED_ENABLE_EXECUTE_STACK): Likewise. All users updated.
	(grub_I386_ASM_ABSOLUTE_WITHOUT_ASTERISK): Removed.
	* config.h.in: New file.
	* configure.ac: Use config-util.h as config define file.
	Rename MACHINE into GRUB_MACHINE. All users updated.
	(NEED_REGISTER_FRAME_INFO): Transformed into a variable. All users
	updated.
	(NESTED_FUNC_ATTR): Likewise.
	Substitue new variables.
	(COND_HAVE_ASM_USCORE): New conditional.
	* grub-core/Makefile.am (ASM_PREFIX): New variable.
	(kernel_syms.lst): Use ASM_PREFIX.
	* grub-core/kern/emu/console.c: Include config-util.h.
	* grub-core/kern/emu/misc.c: Likewise.
	* grub-core/kern/emu/mm.c: Likewise.
	* include/grub/emu/misc.h: Likewise.
	* include/grub/libgcc.h: Likewise.
2010-09-19 22:22:43 +02:00
Vladimir 'phcoder' Serbinenko
5d6015ddf6 Add lost part of GRUB_TERM_KEY_* commit 2010-09-19 22:12:25 +02:00
Vladimir 'phcoder' Serbinenko
39feb0e8f9 * grub-core/term/efi/console.c (efi_codes): Fix GRUB_TERM_KEY_*
constants usage.
	* grub-core/kern/emu/console.c (grub_ncurses_getkey):
	Fix GRUB_TERM_KEY_* constants usage.
	* grub-core/kern/emu/misc.c (asprintf): Fix vasprintf usage.
2010-09-19 22:09:05 +02:00
Vladimir 'phcoder' Serbinenko
9af6dac30d * grub-core/bus/usb/ohci.c (grub_ohci_cancel_transfer): Use %p to
print pointer.
	* grub-core/bus/usb/uhci.c: Remove empty define.
	(grub_uhci_check_transfer): Add missing cast.
	* grub-core/bus/usb/usbhub.c (poll_nonroot_hub): Use %p to
	print pointer.
	* grub-core/term/usb_keyboard.c (grub_usb_keyboard_getkey): Use
	PRIuGRUB_SIZE.
	* include/grub/types.h (PRIuGRUB_SIZE): New definition.
2010-09-19 22:05:48 +02:00
Vladimir 'phcoder' Serbinenko
d6d94820b5 * grub-core/Makefile.core.def (legacycfg): Add
lib/i386/pc/vesa_modes_table.c on emu.
2010-09-19 22:03:16 +02:00
BVK Chaitanya
3572f2b65a Reduce number of temporary files generated by build system.
* grub-core/gencmdlist.sh: Removed.
	* grub-core/genfslist.sh: Removed.
	* grub-core/genhandlerlist.sh: Removed.
	* grub-core/genmodsrc.sh: Removed.
	* grub-core/genpartmaplist.sh: Removed.
	* grub-core/genparttoollist.sh: Removed.
	* grub-core/gentermiinallist.sh: Removed.
	* grub-core/genvideolist.sh: Removed.

	* grub-core/genmod.sh.in: New file.
	* grub-core/gensyminfo.sh.in: New file.

	* conf/Makefile.common (CPPFLAGS_*_LIST): New marker flags.
	* conf/Makefile.extra-dist: Update with new files.
	* gentpl.py: Remove rules related to unnecessary temporary files.
	* grub-core/Makefile.am (syminfo.lst): New replacement for def-*
	and und-* files.
	* grub-core/Makefile.core.def: New rules for gensyminfo.sh and
	genmod.sh scripts.
	* grub-core/bus/usb/uhci.c: Remove empty #define.
	* grub-core/genmoddep.awk: Updated with new syminfo format.
	* util/bash-completion.d/Makefile.am: Add config.log to
	CLEANFILES.
2010-09-19 19:29:36 +05:30
BVK Chaitanya
b524259bec merge with mainline 2010-09-19 18:54:45 +05:30
Vladimir 'phcoder' Serbinenko
eaf41b2592 * grub-core/commands/i386/cmostest.c (+parse_args): New function.
(grub_cmd_cmosclean): Likewise.
	(GRUB_MOD_INIT): Register command cmosclean.
	* util/grub-mkconfig.in: Export GRUB_BUTTON_CMOS_CLEAN.
	* util/grub.d/00_header.in: Handle GRUB_BUTTON_CMOS_CLEAN.
2010-09-19 01:15:44 +02:00
Carles Pina i Estany
1a9130dd3f Add keyboard layouts support.
* Makefile.util.def (grub-mklayout): New file.
	(grub-kbdcomp): New script.
	* grub-core/Makefile.am (KERNEL_HEADER_FILES) [COND_mips_yeeloong]:
	Add keyboard_layouts.h.
	* grub-core/Makefile.core.def (kernel): Add commands/keylayouts.c and
	commands/boot.c on yeeloong.
	(keylayouts): New module.
	* grub-core/bus/usb/ohci.c
	* grub-core/bus/usb/uhci.c
	* grub-core/bus/usb/usbhub.c (rescan): New variable.
	(grub_usb_add_hub): Poll interrupt pipe for device handling.
	(attach_root_port): Likewise.
	(poll_nonroot_hub): Likewise.
	(grub_usb_poll_devices): Likewise.
	(detach_device): Close transfer.
	* grub-core/bus/usb/usbtrans.c (grub_usb_execute_and_wait_transfer): New
	function.
	(grub_usb_bulk_setup_readwrite): Likewise.
	(grub_usb_bulk_finish_readwrite): Likewise.
	* grub-core/commands/keylayouts.c: New file.
	* grub-core/commands/keystatus.c (grub_getkeystatus): New function.
	* grub-core/commands/menuentry.c (hotkey_aliases): All several new
	aliases.
	* grub-core/term/at_keyboard.c: Restructured to use keylayouts and
	support scancode 2.
	* grub-core/term/usb_keyboard.c: Restructured to use keylayouts.
	* include/grub/keyboard_layouts.h: New file.
	* util/grub-mklayout.c: New file.
	* util/grub-kbdcomp.in: Likewise.

	Also-By: Aleš Nesrsta <starous@volny.cz>

	Also-By: Vladimir Serbinenko <phcoder@gmail.com>
2010-09-19 01:01:35 +02:00
Aleš Nesrsta
ab629d0c5d Fix incorrect usb report interpretation 2010-09-19 00:34:25 +02:00
Vladimir 'phcoder' Serbinenko
a1d84a5e5e Unify memory types.
* grub-core/Makefile.am (KERNEL_HEADER_FILES): Include memory.h.
	* grub-core/commands/lsmmap.c (grub_cmd_lsmmap): Output user-readable
	types.
	* grub-core/kern/i386/multiboot_mmap.c (grub_lower_mem): Removed.
	(grub_upper_mem): Likewise.
	* grub-core/kern/ieee1275/init.c (grub_upper_mem): Likewise.
	* include/grub/memory.h (grub_memory_type_t): New enum.
	All users updated.
2010-09-19 00:04:31 +02:00
Vladimir 'phcoder' Serbinenko
9696382e79 GRUB-legacy configuration file support.
* Makefile.util.def (grub-menulst2cfg): New util.
	* docs/man/grub-menulst2cfg.h2m: New file.
	* grub-core/Makefile.core.def (legacycfg): New module.
	* grub-core/commands/legacycfg.c: New file.
	* grub-core/commands/menuentry.c (append_menu_entry): Rename to ...
	(grub_normal_add_menu_entry): ... this.
	* grub-core/commands/password.c (grub_cmd_password): Split main part to ...
	(grub_normal_set_password): ...this.
	* grub-core/commands/videoinfo.c (grub_cmd_videoinfo): Support MODE.
	* grub-core/loader/i386/linux.c (linux_vesafb_res): Move to ..,
	* grub-core/lib/i386/pc/vesa_modes_table.c: ... here.
	* grub-core/lib/legacy_parse.c: New file.
	* grub-core/normal/auth.c (grub_cmd_authenticate): New command.
	* include/grub/i386/pc/vesa_modes_table.h: New file.
	* include/grub/legacy_parse.h: Likewise.
	* include/grub/normal.h (grub_normal_add_menu_entry): New proto.
	* util/grub-menulst2cfg.c: New file.

	* grub-core/Makefile.core.def (lsapm): New module.
	* grub-core/commands/i386/pc/lsapm.c: New file.
	* grub-core/loader/i386/multiboot_mbi.c (make_mbi) [GRUB_MACHINE_PCBIOS]: Pass APM info.
	* grub-core/loader/multiboot_mbi2.c (make_mbi) [GRUB_MACHINE_PCBIOS]:
	Likewise.
	* include/grub/i386/pc/apm.h: New file.
	* include/multiboot.h (multiboot_apm_info): New struct.
2010-09-18 16:21:57 +02:00
Vladimir 'phcoder' Serbinenko
685475e596 Fix yeeloong compilation 2010-09-18 13:49:39 +02:00
Aleš Nesrsta
e70a1b9535 Fix multiple USB issues 2010-09-18 13:49:15 +02:00
Aleš Nesrsta
b9c7e9d400 Set UHCI low-speed flag 2010-09-18 10:56:52 +02:00
Colin Watson
bf8d13388d (convert_system_partition_to_system_disk): Initialise node.
* grub-core/kern/emu/hostdisk.c
2010-09-17 23:41:06 +01:00
Colin Watson
9c0bad2e15 * grub-core/kern/emu/hostdisk.c
(convert_system_partition_to_system_disk): Fix devmapper memory pool
leak.
Reported and based on patch by: Modestas Vainius.
2010-09-17 11:43:46 +01:00
Colin Watson
a939d135ec Fix DM-RAID probing with recent versions of device-mapper udev
rules.
* grub-core/kern/emu/hostdisk.c (read_device_map): Don't
canonicalise device paths under /dev/mapper/.
(convert_system_partition_to_system_disk): Compare the
uncanonicalised path to /dev/mapper/ rather than the canonicalised
path, since device nodes under /dev/mapper/ are often symlinks.
2010-09-17 11:00:37 +01:00
Colin Watson
108538d8ff Support RAID on virtio devices, and others.
* grub-core/kern/emu/getroot.c [__MINGW32__] (find_root_device):
Rename to ...
[__MINGW32__] (grub_find_device): ... this.
[! __MINGW32__ && ! __CYGWIN__] (find_root_device): Rename to ...
[! __MINGW32__ && ! __CYGWIN__] (grub_find_device): ... this.  Use a
reasonable default if dir is NULL.
[! __MINGW32__ && __CYGWIN__] (find_cygwin_root_device): Rename to
...
[! __MINGW32__ && __CYGWIN__] (grub_find_device): ... this.
(grub_guess_root_device): Update callers.
* include/grub/emu/getroot.h (grub_find_device): Add prototype.
* util/raid.c (grub_util_getdiskname): Remove.
(grub_util_raid_getmembers): Use grub_find_device rather than
grub_util_getdiskname.
2010-09-16 14:55:28 +01:00
Colin Watson
e5bfc130a4 * docs/grub.texi (serial): Remove obsolete comment about GRUB
needing to be compiled with serial support.
(ls): Indicate that multiple files are accepted.
* grub-core/commands/ls.c (GRUB_MOD_INIT): Update help text to
indicate that multiple files are accepted.
2010-09-16 14:13:48 +01:00
Vladimir 'phcoder' Serbinenko
35139e8a55 * grub-core/commands/parttool.c (grub_cmd_parttool): Fix a variable
misusage.
	Reported by: J. Nick Terry
2010-09-15 21:48:24 +02:00
Vladimir 'phcoder' Serbinenko
e50fca4a4c Move embedding routines to partmap sources files.
* grub-core/partmap/gpt.c (grub_gpt_partition_type_bios_boot)
	[GRUB_UTIL]: New variable.
	(gpt_partition_map_iterate): Set part.parent.
	(gpt_partition_map_embed) [GRUB_UTIL]: New function.
	(grub_gpt_partition_map) [GRUB_UTIL]: Set .embed.
	* grub-core/partmap/msdos.c (pc_partition_map_embed) [GRUB_UTIL]:
	New function.
	(grub_msdos_partition_map) [GRUB_UTIL]: Set .embed.
	* include/grub/partition.h (grub_embed_type_t) [GRUB_UTIL]: New type.
	(grub_partition_map) [GRUB_UTIL]: New field embed.
	* util/grub-setup.c (grub_gpt_partition_type_bios_boot): Removed.
	(setup): Use ->embed.
2010-09-15 21:36:57 +02:00
Vladimir 'phcoder' Serbinenko
f00478b719 * grub-core/kern/emu/hostdisk.c (grub_util_biosdisk_is_floppy): New
function.
	* include/grub/emu/hostdisk.h (grub_util_biosdisk_is_floppy): New proto.
	* util/grub-setup.c (setup): Use grub_util_biosdisk_is_floppy.
2010-09-15 15:30:43 +02:00
Vladimir 'phcoder' Serbinenko
3f8fcb6a24 Support vbeprobe MODE 2010-09-15 14:37:28 +02:00
Vladimir 'phcoder' Serbinenko
c99dead654 Support geometry 2010-09-15 14:11:08 +02:00
Vladimir 'phcoder' Serbinenko
e2830452f0 Support legacy_check_password 2010-09-15 13:51:02 +02:00
Vladimir 'phcoder' Serbinenko
0cb2f2813f merge mainline into legacy_parser 2010-09-15 11:43:59 +02:00
Vladimir 'phcoder' Serbinenko
890c9fa5f2 Implement APM 2010-09-15 11:42:18 +02:00
Vladimir 'phcoder' Serbinenko
e31bb61911 Transform legacy mode numbers into resolution specification 2010-09-15 11:39:53 +02:00
Vladimir 'phcoder' Serbinenko
2e04a00685 * grub-core/gnulib/basename-lgpl.c: Imported.
* grub-core/gnulib/basename.c: Likewise.
	* grub-core/gnulib/dirname-lgpl.c: Likewise.
	* grub-core/gnulib/dirname.c: Likewise.
	* grub-core/gnulib/dirname.h: Likewise.
	* grub-core/gnulib/stripslash.c: Likewise.
2010-09-15 11:34:29 +02:00
Vladimir 'phcoder' Serbinenko
5dcdf93ad6 * grub-core/gnulib/error.c: Resynced.
* grub-core/gnulib/getopt.c: Likewise.
	* grub-core/gnulib/getopt_int.h: Likewise.
	* grub-core/gnulib/regex.h: Likewise.
	* grub-core/gnulib/regex_internal.c: Likewise.
	* grub-core/gnulib/regex_internal.h: Likewise.
2010-09-15 11:31:02 +02:00
Vladimir 'phcoder' Serbinenko
44224d3948 Fix UUID command. Reported by: Jordan Uggla 2010-09-15 02:16:12 +02:00
Szymon Janc
014f47b74f * grub-core/lib/xzembed/xz_dec_stream.c (dec_main): Fix index and block
CRC calculations and validity checks.
	* grub-core/lib/xzembed/xz_dec_stream.c (dec_index): Fix index CRC
	calculations.
2010-09-15 00:39:49 +02:00
Szymon Janc
dd521a4afb * grub-core/lib/xzembed/xz_dec_stream.c (xz_dec_end): Fix memory leak. 2010-09-15 00:13:09 +02:00
Vladimir 'phcoder' Serbinenko
79c4eeb919 Fix incorrect echo options handling.
Reported by: Yves Blusseau.

	* include/grub/command.h (grub_command_flags_t): New flags
	GRUB_COMMAND_ACCEPT_DASH and GRUB_COMMAND_OPTIONS_AT_START.
	* grub-core/lib/arg.c (grub_arg_parse): Handle new flags.
	* grub-core/commands/echo.c (GRUB_MOD_INIT): Use new flags.
2010-09-14 23:30:06 +02:00
Vladimir 'phcoder' Serbinenko
ed80f7d586 * include/grub/command.h (GRUB_COMMAND_FLAG_CMDLINE): Removed. All
users updated.
	(GRUB_COMMAND_FLAG_MENU): Likewise.
	(GRUB_COMMAND_FLAG_BOTH): Likewise.
	(GRUB_COMMAND_FLAG_TITLE): Removed.
	(GRUB_COMMAND_FLAG_NO_ECHO): Likewise.
	(GRUB_COMMAND_FLAG_EXTCMD): Moved into enum.
	(GRUB_COMMAND_FLAG_DYNCMD): Likewise.
	(GRUB_COMMAND_FLAG_BLOCKS): Likewise.
	(grub_command_flags_t): New enum. All users updated.
2010-09-14 23:06:01 +02:00
Seth Goldberg
5fe7620a4e Fix solaris compilation.
* grub-core/Makefile.core.def (kernel): Include gnulib/error.c on emu.
	(grub-emu): Add LIBZFS and LIBNVPAIR to ldadd.
	(grub-emu-list): Likewise.
2010-09-14 22:32:33 +02:00
Vladimir 'phcoder' Serbinenko
545b752f88 Remove deprecated root command.
* grub-core/commands/minicmd.c (grub_mini_cmd_root): Removed. All users
	updated.
2010-09-14 22:21:35 +02:00
Vladimir 'phcoder' Serbinenko
d2ea455141 * grub-core/partmap/sun.c (sun_partition_map_iterate): Don't needlesly
allocate p.
2010-09-14 21:07:39 +02:00
Vladimir 'phcoder' Serbinenko
b71c3faedb * grub-core/kern/sparc64/ieee1275/crt0.S: Align stack. 2010-09-14 20:59:00 +02:00
Vladimir 'phcoder' Serbinenko
275433e642 Don't export grub_gate_a20.
* grub-core/kern/i386/pc/init.c: Remove leftovers.
	* grub-core/kern/i386/pc/startup.S (FUNCTION(grub_gate_a20)): Rename
	to ...
	(grub_gate_a20): ... this. All users updated.
	* include/grub/i386/pc/init.h: Removed. All users updated.
2010-09-14 01:08:24 +02:00
Vladimir 'phcoder' Serbinenko
608e43b102 Disable usbserial on grub-emu since our libusb code isn't good enough
yet.

	* grub-core/Makefile.core.def (usbserial_common): Disable on emu.
	(usbserial_pl2303): Likewise.
	(usbserial_ftdi): Likewise.
2010-09-14 00:08:07 +02:00
Vladimir 'phcoder' Serbinenko
94564f81a8 * include/grub/disk.h (grub_disk): Remove has_partitions.
All users updated.
	* disk/loopback.c (grub_loopback): Remove has_partitions.
	All users updated.
	(options): Remove partitions. All users updated.
	* util/grub-fstest.c (fstest): Don't pass "-p" to loopback.
	* util/i386/pc/grub-setup.c (setup): copy partition table only when
	actual partition table is found.
2010-09-13 23:59:22 +02:00
Vladimir 'phcoder' Serbinenko
2419f17a09 Enable acpi shutdown on all ACPI platforms.
* grub-core/Makefile.core.def (halt): Inlude commands/acpihalt.c
	on coreboo, multiboot and EFI.
	* grub-core/commands/acpihalt.c (get_sleep_type): Add missing casts.
	(grub_acpi_halt): Likewise.
	* grub-core/commands/i386/pc/halt.c (grub_halt): Call grub_acpi_halt.
	(grub_cmd_halt): Don't call grub_acpi_halt directly.
	* grub-core/lib/efi/halt.c (grub_halt): Call grub_acpi_halt.
	* grub-core/lib/i386/halt.c (grub_halt)
	[GRUB_MACHINE_COREBOOT || GRUB_MACHINE_MULTIBOOT]: Likewise.
2010-09-13 20:29:15 +02:00
Vladimir 'phcoder' Serbinenko
0575c7c3ec * grub-core/commands/iorw.c (grub_cmd_read): Declare buf in smallest
context.
2010-09-13 20:16:51 +02:00
Vladimir 'phcoder' Serbinenko
54ac3cd189 * grub-core/video/efi_gop.c: Fix over-80-chars line.
* grub-core/video/efi_uga.c: Likewise.
2010-09-13 20:10:41 +02:00