Commit graph

242 commits

Author SHA1 Message Date
Vladimir 'phcoder' Serbinenko
7d462559da Add new command pcidump. 2013-01-16 20:44:11 +01:00
Vladimir 'phcoder' Serbinenko
b78d6c32e3 New terminal outputs using serial: morse and spkmodem. 2013-01-16 20:39:54 +01:00
Vladimir 'phcoder' Serbinenko
4a9950ecb0 Fix compilation with older compilers.
* grub-core/Makefile.core.def (mpi): Add mpi-inline.c.
	* grub-core/lib/libgcrypt_wrap/cipher_wrap.h: Remove redundant
	declarations.
	* grub-core/lib/posix_wrap/string.h: Include sys/types.h.
	* grub-core/lib/posix_wrap/sys/types.h: Add common types.
	* grub-core/lib/xzembed/xz_dec_lzma2.c (dict_put): Replace byte
	identifier with b.
	* grub-core/lib/xzembed/xz_dec_stream.c (dec_vli): Likewise.
	* include/grub/crypto.h: Add type defines.
	* util/import_gcrypth.sed: Remove duplicate type defines.
2013-01-13 21:06:25 +01:00
Vladimir 'phcoder' Serbinenko
5e3b8dcbb5 Import gcrypt public-key cryptography and implement signature checking. 2013-01-11 21:32:42 +01:00
Vladimir 'phcoder' Serbinenko
d9c48c7b7c Support big-endian UFS1.
* Makefile.util.def (libgrubmods): Add ufs_be.c
	* grub-core/Makefile.core.def (ufs1_be): New module.
	* grub-core/fs/ufs_be.c: New file.
	* grub-core/fs/ufs.c: Declare grub_ufs_to_le* and use them throughout
	the file.
2012-12-08 20:56:58 +01:00
Peter Jones
c5052c81ab * grub-core/Makefile.core.def (efifwsetup): New module.
* grub-core/commands/efi/efifwsetup.c: New file.
	* grub-core/kern/efi/efi.c (grub_efi_set_variable): New function
	* include/grub/efi/api.h (GRUB_EFI_OS_INDICATIONS_BOOT_TO_FW_UI):
	New define.
	* include/grub/efi/efi.h (grub_efi_set_variable): New proto.
2012-09-08 09:40:24 +02:00
Vladimir 'phcoder' Serbinenko
7bd29c01f0 New command `lsefi'.
* grub-core/Makefile.core.def (lsefi): New module.
	* grub-core/commands/efi/lsefi.c: New file.
	* include/grub/efi/api.h: Add more GUIDs.
2012-07-22 19:59:06 +02:00
Vladimir 'phcoder' Serbinenko
c35fc5bd15 Add monochrome text support (mda_text, aka `hercules' in grub-legacy).
* grub-core/Makefile.core.def (mda_text): New module.
	* grub-core/lib/legacy_parse.c (grub_legacy_parse): Support `hercules'.
	* grub-core/term/i386/vga_common.c (grub_console_cur_color): Moved to ..
	* grub-core/term/i386/pc/vga_text.c (cur_color): ... here
	* grub-core/term/i386/pc/console.c (grub_console_cur_color): ... and
	here.
	* grub-core/term/i386/vga_common.c (grub_console_getwh): Moved to ..
	* grub-core/term/i386/pc/vga_text.c (grub_console_getwh): ... here
	* grub-core/term/i386/pc/console.c (grub_console_getwh): ... and
	here.
	* grub-core/term/i386/vga_common.c (grub_console_setcolorstate): Moved
	to ..
	* grub-core/term/i386/pc/vga_text.c (grub_console_setcolorstate):
	... here
	* grub-core/term/i386/pc/console.c (grub_console_setcolorstate): ... and
	here.
	* grub-core/term/i386/vga_common.c: Removed.
	* include/grub/i386/vga_common.h: Likewise.
	* include/grub/vga.h (grub_vga_cr_bw_write): New function.
	(grub_vga_cr_bw_read): Likewise.
	* include/grub/vgaregs.h (GRUB_VGA_IO_CR_BW_INDEX): New enum value.
	(GRUB_VGA_IO_CR_BW_DATA): Likewise.
	* grub-core/term/i386/pc/vga_text.c [MODE_MDA]: Call
	grub_vga_cr_bw_read/grub_vga_cr_bw_write instead of
	grub_vga_cr_read/grub_vga_cr_write.
	(grub_vga_text_setcolorstate) [MODE_MDA]: Ignore color.
2012-06-28 15:27:54 +02:00
Vladimir 'phcoder' Serbinenko
7da036bbcb Remove non-functional EFI grub_get_rtc. Put a better fatal message
than current grub_get_rtc() not implemented when booted with
	coreboot without TSC.

	* grub-core/Makefile.am: Exclude efi/time.h from kernel headers.
	Add machine/time.h to kernel headers on loongson.
	* grub-core/Makefile.core.def (kernel): Remove
	kern/generic/rtc_get_time_ms.c on qemu-multiboot-coreboot.
	* grub-core/kern/efi/efi.c (grub_rtc_get_time_ms): Removed.
	(grub_get_rtc): Likewise.
	* grub-core/kern/generic/rtc_get_time_ms.c: Include grub/machine/time.h.
	* grub-core/kern/i386/coreboot/init.c (grub_get_rtc): Removed.
	* grub-core/kern/i386/pc/init.c: Include grub/machine/init.h.
	* grub-core/kern/i386/tsc.c (grub_tsc_init)
	[!GRUB_MACHINE_PCBIOS && !GRUB_MACHINE_IEEE1275]: Call grub_fatal
	rather than installing known non-working time source.
	* grub-core/kern/ieee1275/init.c (grub_get_rtc): Removed.
	* grub-core/kern/mips/loongson/init.c: Include grub/machine/time.h.
	* include/grub/time.h: Don't include machine/time.h.
	* include/grub/efi/time.h: Removed.
	* include/grub/i386/efi/time.h: Likewise.
	* include/grub/i386/ieee1275/time.h: Likewise.
	* include/grub/powerpc/ieee1275/time.h: Likewise.
	* include/grub/sparc64/ieee1275/time.h: Likewise.
	* include/grub/x86_64/efi/time.h: Likewise.
2012-06-11 20:44:38 +02:00
Vladimir 'phcoder' Serbinenko
61c42af084 ESCC serial driver for conducting sautomated tests in qemu.
Not tested on real hardware.

	* include/grub/serial.h (grub_serial_port): New field escc_desc.
	* grub-core/term/ieee1275/escc.c: New file.
	* grub-core/Makefile.core.def (escc): New module.
2012-06-08 19:42:59 +02:00
Vladimir 'phcoder' Serbinenko
cede3ca325 * grub-core/Makefile.core.def (vga_text): Disable on muliboot
and coreboot since it's already in kernel.
2012-06-07 15:18:21 +02:00
Vladimir 'phcoder' Serbinenko
ddb7355862 * Makefile.util.def: Remove -Wno-format.
* grub-core/Makefile.core.def: Likewise.
2012-05-30 13:56:50 +02:00
Vladimir 'phcoder' Serbinenko
526ef13d34 * grub-core/Makefile.core.def (example_functional_test): Rename to ...
(exfctest): ... this to avoid overlong filenames.
	All users updated.
2012-05-27 14:12:48 +02:00
Matthew Garrett
9d34bb85da Suspend broadcom cards in order to stop their DMA.
* grub-core/Makefile.am (KERNEL_HEADER_FILES): Add pci.h on x86 EFI.
	* grub-core/Makefile.core.def (kernel): Add pci.c on x86 EFI.
	(pci): Don't build on x86 EFI.
	* grub-core/bus/pci.c (grub_pci_find_capability): New function.
	* grub-core/kern/efi/mm.c (stop_broadcom) [__i386__ || __x86_64__]:
	New function.
	(grub_efi_finish_boot_services) [__i386__ || __x86_64__]: Call
	stop_broadcom if running on EFI.
	* include/grub/pci.h (GRUB_PCI_CLASS_NETWORK): New enum value.
	(GRUB_PCI_CAP_POWER_MANAGEMENT): Likewise.
	(GRUB_PCI_VENDOR_BROADCOM): Likewise.
	(grub_pci_find_capability): New proto.

	Also-By: Vladimir Serbinenko <phcoder@gmail.com>
2012-05-03 17:26:55 +02:00
Vladimir 'phcoder' Serbinenko
ac66b453df Handle big-endian minixfs (fixes minixfs tests on bigendian).
* grub-core/fs/minix.c: Replace le with minix. Add necessary defines,
	modify names. Introduce MODE_BIGENDIAN.
	* grub-core/fs/minix_be.c: New file.
	* grub-core/fs/minix2_be.c: Likewise
	* grub-core/fs/minix3_be.c: Likewise.
	* Makefile.util.def (libgrubmods): Add minix_be, minix2_be and
	minix3_be.
	* grub-core/Makefile.core.def (minix_be): New module.
	(minix2_be): Likewise.
	(minix3_be): Likewise.
2012-04-01 21:35:18 +02:00
Vladimir 'phcoder' Serbinenko
22e6a774f9 Handle big-endian mdraid.
* Makefile.util.def (libgrubkern): Add mdraid_linux_be.c.
	* grub-core/Makefile.core.def (mdraid09_be): New module.
	* grub-core/disk/mdraid_linux.c: Use grub_md_to_cpu* and grub_cpu_to_md*
	rather than grub_le_to_cpu* and grub_cpu_to_le*.
	* grub-core/disk/mdraid_linux_be.c: New file.
2012-03-26 16:10:40 +02:00
Vladimir 'phcoder' Serbinenko
0f021838c4 * Makefile.am: Strip gold section.
* conf/Makefile.common: Likewise.
	* gentpl.py: Likewise.
	* grub-core/Makefile.core.def: Likewise.
	* grub-core/genmod.sh.in: Likewise.
2012-03-10 16:55:48 +01:00
Vladimir 'phcoder' Serbinenko
c4c48c541c * grub-core/Makefile.core.def (lzma_decompress): Use
TARGET_IMG_BASE_LDOPT rather than hardcoding -Wl,-Ttext.
2012-02-29 16:28:26 +01:00
Vladimir 'phcoder' Serbinenko
99ce1597a4 Add LZSS Mach-O support (needed for new xnu kernelcache).
* grub-core/Makefile.core.def (xnu): Add file lzss.c
	* grub-core/loader/lzss.c: New file.
	* grub-core/loader/xnu.c (grub_xnu_load_driver): Close binaryfile
	on Mach-O open failure.
	* grub-core/loader/macho.c (grub_macho_close): Free uncompressedXX.
	Don't free cmdsXX in uncompressedXX is set.
	(grub_macho_file): Init new fields.
	New argument is_64bit. All users updated.
	Handle compressed. Error out if no suitable architecture is found.
	Don't close file.
	(grub_macho_open): New argument is_64bit. All users updated.
	* grub-core/loader/macho32.c: Add defines for new fields.
	* grub-core/loader/macho64.c: Likewise.
	* grub-core/loader/machoXX.c (grub_macho_contains_macho): Make static.
	(grub_macho_parse): Handle compressed.
	Defer actual processing if compressed.
	(grub_macho_cmds_iterate): Decompress if compressed. New argument
	"filename". All users updated.
	(grub_macho_size): New argument "filename". All users updated.
	(grub_macho_get_entry_point): Likewise.
	(grub_macho_load): Handle compressed.
	* include/grub/macho.h (grub_macho_lzss_header): New struct.
	(GRUB_MACHO_LZSS_OFFSET): New define.
	(grub_decompress_lzss): New proto.
	* include/grub/machoload.h (grub_macho_file): New fields to handle
	compressed.
	(grub_macho_contains_macho64): Remove proto.
	(grub_macho_contains_macho32): Likewise.
	* util/grub.d/30_os-prober.in: Use kernel cache if available.
2012-02-29 13:26:13 +01:00
Vladimir 'phcoder' Serbinenko
2702b4e4f7 Fix make dist.
* Makefile.am (starfield_theme_files): New var.
	(starfield_DATA): Use starfield_theme_files.
	(EXTRA_DIST): Add starfield_theme_files. Add starfield source files.
	Add bootcheck-related files.
	* conf/Makefile.extra-dist (EXTRA_DIST): Add several missing files.
	* docs/Makefile.am (EXTRA_DIST): Add font_char_metrics.png
	and font_char_metrics.txt.
	* grub-core/Makefile.core.def (kernel): Update extra_dist.
	(setjmp): Add lib/ia64/longjmp.S.
	* po/Makefile.in.in (DISTFILES): Add POTFILES-shell.in and grub.d.sed.
	* po/POTFILES.in: Regenerate.
	* po/Rules-swiss: use DISTFILES.common.extra2 and not
	DISTFILES.common.extra1.
	* util/devicemap.c: Removed.
	* grub-core/lib/i386/relocator_backward.S: Likewise.
	* util/import_gcry.py: Remove unused files. Add extra_dist for
	ChangeLog.
2012-02-28 12:58:57 +01:00
Lubomir Kundrak
ff27c3dd5d GDB serial and backtrace support.
* grub-core/kern/i386/realmode.S (real_to_prot): Reload IDT.
	(prot_to_real): Likewise.
	* grub-core/kern/i386/int.S (grub_bios_interrupt): Remove IDT reload.
	* grub-core/Makefile.core.def (backtrace): New module.
	(gdb): Likewise.
	* grub-core/gdb/cstub.c: New file.
	* grub-core/gdb/gdb.c: Likewise.
	* grub-core/gdb/i386/idt.c: Likewise.
	* grub-core/gdb/i386/machdep.S: Likewise.
	* grub-core/gdb/i386/signal.c: Likewise.
	* grub-core/lib/i386/backtrace.c: Likewise.
	* include/grub/backtrace.h: Likewise.
	* include/grub/gdb.h: Likewise.
	* include/grub/i386/gdb.h: Likewise.

	Also-By: Vladimir Serbinenko <phcoder@gmail.com>
2012-02-26 19:17:37 +01:00
Vladimir 'phcoder' Serbinenko
1948a3b714 Several cleanups 2012-02-26 19:10:52 +01:00
Vladimir 'phcoder' Serbinenko
22c7ce85fe Add new all_video module.
* grub-core/Makefile.am (moddep.lst): Make dependent on video.lst.
	* grub-core/Makefile.core.def (all_video): New module.
	* grub-core/genmoddep.awk: Generate dependency of all_video from
	video.lst.
	* grub-core/lib/fake_module.c: New file.
	* grub-core/normal/main.c (features): Add feature_all_video_module.
	* util/grub.d/00_header.in: Define locale_dir based on $prefix and
	don't do explicit search again.
	insmod all_video in load_video if available.
2012-02-26 18:09:07 +01:00
Vladimir 'phcoder' Serbinenko
a9c7fd1c6c Implement serial on IEEE1275 and EFI.
* docs/grub.texi (Platform-specific limitations): Fix the columen video
	on emu. Mention arc and emu as the only platforms without serial
	support.
	* grub-core/Makefile.core.def (serial): Enable on all terminfomodule and
	ieee1275 platforms.
	* grub-core/term/efi/serial.c: New file.
	* grub-core/term/ieee1275/serial.c: Likewise.
	* grub-core/term/serial.c (grub_serial_find): Disable direct port
	specification if no ns8250 driver is available.
	(grub_cmd_serial): Likewise.
	(GRUB_MOD_INIT) [GRUB_MACHINE_IEEE1275]: Init ofserial.
	(GRUB_MOD_INIT) [GRUB_MACHINE_EFI]: Init efiserial.
	* include/grub/efi/api.h (GRUB_EFI_SERIAL_IO_GUID): New define.
	(grub_efi_parity_type_t): New type.
	(grub_efi_stop_bits_t): Likewise.
	(grub_efi_serial_io_interface): New struct.
	* include/grub/serial.h (grub_serial_port): Make 'broken' field
	available for all interfaces.
	Add EFI and IEEE1275 fields.
	(grub_ofserial_init): New proto.
	(grub_efiserial_init): Likeiwse.
	* util/grub.d/00_header.in: Don't check for the presence of serial
	module.
2012-02-26 17:08:11 +01:00
Vladimir 'phcoder' Serbinenko
6a656b0ea5 Convert grub-emu to argp.
* grub-core/Makefile.core.def (kernel): Add kern/emu/argp_common.c on
	emu.
	* util/argp_common.c: Rename to ...
	* grub-core/kern/emu/argp_common.c: ... this. All users updated.
	Add missing includes.
	* grub-core/kern/emu/main.c: Convert to argp.
	* po/POTFILES.in: Regenerate.
	* util/grub-install.in (usage): Make first letter lowcase in messages
	for uniformity.
	* util/grub-setup.c (options): Likewise.
2012-02-25 01:15:29 +01:00
Vladimir 'phcoder' Serbinenko
515e8007fc merge mainline into gdb 2012-02-18 21:00:13 +01:00
Vladimir 'phcoder' Serbinenko
fc400bfd74 merge backtrace into gdb 2012-02-18 20:59:42 +01:00
Vladimir 'phcoder' Serbinenko
80a7121355 * conf/Makefile.common (platform_SCRIPTS): New variable.
(platform_PROGRAMS): Likewise.
	* gentpl.py: Mark *,module and *.image for install.
	* grub-core/gdb_grub.in: Add a notice of expected environment.
	* grub-core/Makefile.core.def (gdb_grub): Mark for install.
	(gmodule.pl): Likewise.
2012-02-18 20:25:11 +01:00
Vladimir 'phcoder' Serbinenko
b500bcfeed * grub-core/kern/emu/console.c: Move to ...
* grub-core/term/emu/console.c: ...here.
	(grub_ncurses_getkey): Fix return value if no key is detected.
2012-02-18 19:51:43 +01:00
Vladimir 'phcoder' Serbinenko
ebcecdf1c3 Increase warning level.
* conf/Makefile.common (CFLAGS_GNULIB): Add -Wno-redundant-decls
	-Wno-unreachable-code -Wno-conversion -Wno-old-style-definition.
	* configure.ac (HOST_CFLAGS): Add bunch of -W arguments.
	(TARGET_CFLAGS): Likewise.
	(HOST_CFLAGS): Add -Werror unless --disable-werror is activated.
	* grub-core/Makefile.core.def (decompressor_xz): Add
	-Wno-unreachable-code.
	(normal): Add -Wno-redundant-decls.
	(xzio): Add -Wno-unreachable-code.
	(lzopio): Add -Wno-redundant-decls -Wno-error.
	* grub-core/commands/acpi.c: Add exception to -Wcast-align.
	* grub-core/commands/lsacpi.c: Add exception to -Wcast-align.
	* grub-core/gensymlist.sh: Add exception to -Wmissing-format-attribute.
	* grub-core/kern/dl.c: Add exception to -Wcast-align.
	* grub-core/kern/efi/efi.c (grub_efi_modules_addr): Likewise.
	* grub-core/kern/i386/coreboot/init.c: Add exception to
	-Wsuggest-attribute=noreturn.
	* grub-core/kern/ia64/dl.c: Add exception to -Wcast-align.
	* grub-core/kern/ia64/dl_helper.c: Likewise.
	* grub-core/kern/mips/dl.c: Likewise.
	* grub-core/kern/sparc64/dl.c: Likewise.
	* grub-core/lib/LzmaEnc.c: Add exception to -Wshadow.
	* grub-core/lib/libgcrypt_wrap/cipher_wrap.h (memcpy): Likewise.
	(memcmp): Likewise.
	* grub-core/lib/pbkdf2.c: Add exception to -Wunreachable-code.
	* grub-core/loader/ia64/efi/linux.c: Add exception to -Wcast-align.
	* grub-core/loader/mips/linux.c: Likewise.
	* grub-core/loader/multiboot_elfxx.c: Likewise.
	* grub-core/script/parser.y: Add exception to -Wunreachable-code.
	* grub-core/video/sm712.c: Add exception to -Wcast-align.
	* util/import_gcry.py: Add -Wno-cast-align to modules checked by hand.
	* grub-core/font/font.c (grub_font_loader_init): Add explicit cast and
	fixme.
	* grub-core/fs/iso9660.c (grub_iso9660_iterate_dir): Likewise.
	* grub-core/kern/i386/multiboot_mmap.c (grub_machine_mmap_init):
	Fix prototype.
2012-02-10 16:48:48 +01:00
Vladimir 'phcoder' Serbinenko
0a96117de7 * grub-core/Makefile.core.def (pxechain): New module.
* grub-core/loader/i386/pc/pxechainloader.c: New file.
	* grub-core/net/drivers/i386/pc/pxe.c (grub_pxe_get_cached): New
	function.
	(grub_pc_net_config_real): Use grub_pxe_get_cached.
	* include/grub/i386/pc/pxe.h (grub_pxe_get_cached): New proto.
2012-02-05 10:33:52 +01:00
Vladimir 'phcoder' Serbinenko
cefa01261b merge mainline into ehci 2012-02-01 13:19:42 +01:00
Vladimir 'phcoder' Serbinenko
ca8c0baf25 Rename ofconsole to console.
* grub-core/commands/terminal.c (handle_command): Handle ofconsole
	as sysnonym to console.
	* grub-core/term/ieee1275/ofconsole.c: Renamed to ..
	* grub-core/term/ieee1275/console.c: ... this. All users updated.
	Rename grub_ofconsole_ to grub_console_. All users updated
	(grub_console_term_output): Rename "ofconsole" to "console".
	* grub-core/term/terminfo.c (grub_cmd_terminfo): Handle "ofconsole"
	as "console".
2012-01-29 17:01:27 +01:00
Vladimir 'phcoder' Serbinenko
076e7c0fda Merge common RAID and LVM logic to an abstract diskfilter.
Add LDM support using the same framework.

	* Makefile.util.def (libgrubkern): Add grub-core/disk/ldm.c,
	grub-core/disk/diskfilter.c and grub-core/partmap/gpt.c.
	(libgrubmods): Remove grub-core/disk/raid.c and
	grub-core/partmap/gpt.c.
	* grub-core/Makefile.core.def (ldm): New module.
	(raid): Renamed to diskfilter. All users updated.
	* grub-core/disk/raid.c: Moved to ...
	* grub-core/disk/diskfilter.c: ... here.
	* grub-core/disk/diskfilter.c: Rename grub_raid_ to grub_diskfilter_.
	(lv_num): New var.
	(find_array): Renamed to ...
	(find_lv): ... this. Support multi-LV. Skip nameless LVs
	(grub_is_array_readable): Renamed to ...
	(grub_is_lv_readable): ... this. Support multinode hierarchy.
	(insert_array): New argument id.
	(is_node_readable): New function.
	(scan_device): Rename to ...
	(scan_disk): .. this. Restrict to one disk.
	(scan_devices): New function.
	(grub_diskfilter_iterate): Support multi-LV.
	Skip invisible and nameless LVs.
	(grub_diskfilter_memberlist): Support multi-LV.
	(grub_diskfilter_read_node): New function.
	(grub_raid_read): Most of logic moved to ...
	(read_segment): ... here
	(read_lv): New function.
	(grub_diskfilter_get_vg_by_uuid): New function.
	(grub_diskfilter_make_raid): Likewise.
	* grub-core/disk/ldm.c: New file.
	* grub-core/disk/lvm.c (vg_list): Removed.
	(lv_count): Likewise.
	(scan_depth): Likewise.
	(is_lv_readable): Likewise.
	(grub_lvm_getvalue): Advance pointer past the number.
	(find_lv): Removed.
	(do_lvm_scan): Refactored into ...
	(grub_lvm_detect): ... this. Support raid.
	(grub_lvm_iterate): Removed.
	(grub_lvm_memberlist): Likewise.
	(grub_lvm_open): Likewise.
	(grub_lvm_close): Likewise.
	(read_lv): Likewise.
	(read_node): Likewise.
	(is_node_readable): Likewise.
	(is_lv_readable): Likewise.
	(grub_lvm_read): Likewise.
	(grub_lvm_write): Likewise.
	(grub_lvm_dev): Use diskfilter
	(GRUB_MOD_INIT): Likewise.
	(GRUB_MOD_FINI): Likewise.
	* grub-core/disk/dmraid_nvidia.c (grub_dmraid_nv_detect): Use
	new interface.
	* grub-core/disk/mdraid1x_linux.c (grub_mdraid_detect): Likewise.
	* grub-core/disk/mdraid_linux.c (grub_mdraid_detect): Likewise.
	* grub-core/disk/raid5_recover.c (grub_raid5_recover): Use
	grub_diskfilter_read_node.
	Fix a bug with xor.
	* grub-core/disk/raid6_recover.c (grub_raid6_recover): Use
	grub_diskfilter_read_node.
	Support GRUB_RAID_LAYOUT_MUL_FROM_POS.
	* grub-core/kern/disk.c (grub_disk_dev_list): Make global.
	(grub_disk_dev_iterate): Move from here...
	* include/grub/disk.h (grub_disk_dev_iterate): ... to here. Inlined.
	* grub-core/kern/emu/hostdisk.c (grub_hostdisk_find_partition_start):
	Make global.
	(grub_hostdisk_find_partition_start): Likewise.
	(grub_hostdisk_os_dev_to_grub_drive): New function.
	(grub_util_biosdisk_get_osdev): Check that disk is biosdisk.
	* grub-core/kern/emu/hostdisk.c (make_device_name): Move to ...
	* util/getroot.c (make_device_name): ... here.
	* grub-core/kern/emu/hostdisk.c (grub_util_get_dm_node_linear_info):
	Move to ...
	* util/getroot.c (grub_util_get_dm_node_linear_info): ...here.
	* grub-core/kern/emu/hostdisk.c
	(convert_system_partition_to_system_disk): Move to ...
	* util/getroot.c (convert_system_partition_to_system_disk): ...here.
	* grub-core/kern/emu/hostdisk.c (device_is_wholedisk): Move to ...
	* util/getroot.c (device_is_wholedisk): ... here.
	* grub-core/kern/emu/hostdisk.c (find_system_device): Move to ...
	* util/getroot.c (find_system_device): ... here.
	* grub-core/kern/emu/hostdisk.c (grub_util_biosdisk_is_present):
	Move to ...
	* util/getroot.c (grub_util_biosdisk_is_present): ...here.
	* grub-core/kern/emu/hostdisk.c (grub_util_biosdisk_get_grub_dev):
	Move to ...
	* util/getroot.c (grub_util_biosdisk_get_grub_dev): ... here.
	Handle LDM.
	* grub-core/kern/emu/hostdisk.c (grub_util_biosdisk_is_floppy):
	Move to ...
	* util/getroot.c (grub_util_biosdisk_is_floppy): ... here.
	* grub-core/partmap/gpt.c (grub_gpt_partition_map_iterate): Made global.
	* include/grub/disk.h (grub_disk_dev_id): Replaced RAID and LVM with
	DISKFILTER.
	* include/grub/raid.h: Renamed to ...
	* include/grub/diskfilter.h: ... this.
	* include/grub/diskfilter.h: Rename grub_raid_* to grub_diskfilter_*
	(GRUB_RAID_LAYOUT_*): Make into array.
	(GRUB_RAID_LAYOUT_MUL_FROM_POS): New value.
	(grub_diskfilter_vg): New struct.
	(grub_diskfilter_pv_id): Likewise.
	(grub_raid_member): Removed.
	(grub_raid_array): Likewise.
	(grub_diskfilter_pv): New struct.
	(grub_diskfilter_lv): Likewise.
	(grub_diskfilter_segment): Likewise.
	(grub_diskfilter_node): Likewise.
	(grub_diskfilter_get_vg_by_uuid): New proto.
	(grub_raid_register): Inline.
	(grub_diskfilter_unregister): Likewise.
	(grub_diskfilter_make_raid): New proto.
	(grub_diskfilter_vg_register): Likewise.
	(grub_diskfilter_read_node): Likewise.
	(grub_diskfilter_get_pv_from_disk) [GRUB_UTIL]: Likewise.
	* include/grub/emu/hostdisk.h (grub_util_get_ldm): New proto.
	(grub_util_is_ldm): Likewise.
	(grub_util_ldm_embed) [GRUB_UTIL]: Likewise.
	(grub_hostdisk_find_partition_start): Likewise.
	(grub_hostdisk_os_dev_to_grub_drive): Likewise.
	* include/grub/gpt_partition.h (GRUB_GPT_PARTITION_TYPE_LDM):
	New definition.
	(grub_gpt_partition_map_iterate): New proto.
	* include/grub/lvm.h (grub_lvm_vg): Removed.
	(grub_lvm_pv): Likewise.
	(grub_lvm_lv): Likewise.
	(grub_lvm_segment): Likewise.
	(grub_lvm_node): Likewise.
	* util/getroot.c [...]
	* util/grub-probe.c (probe_raid_level): Handle diskfilter.
	(probe_abstraction): Likewise.
	* util/grub-setup.c (setup): Remove must_embed. Support LDM.
	(main): Remove dead logic.
2012-01-29 14:28:01 +01:00
Vladimir 'phcoder' Serbinenko
30545b8567 * grub-core/Makefile.core.def (setpci): Enable on all PCI platforms. 2012-01-27 13:52:48 +01:00
Vladimir 'phcoder' Serbinenko
c029da8a89 Various squash4 fixes and LZO and XZ support.
* Makefile.util.def (libgrubmods.a): Add xzembed directory to cppflags.
	Add xzembed source files.
	* grub-core/Makefile.core.def (squash4): Add xzembed and minilzo flags.
	* grub-core/fs/squash4.c (grub_squash_super): New field compression.
	(grub_squash_inode): New subtype long_dir.
	(SQUASH_TYPE_LONG_DIR): New inode type.
	(COMPRESSION): New enum.
	(XZBUFSIZ): New const.
	(grub_squash_data): New fields blksz, decompress, xzdec, xzbuf.
	(read_chunk): Use data->decompress.
	(zlib_decompress): New function.
	(lzo_decompress): Likewise.
	(xz_decompress): Likewise.
	(squash_mount): Set new data fields.
	(grub_squash_iterate_dir): Handle long dir.
	(squash_unmount): Free xzdec and xzbuf.
	(grub_squash_open): Check ino type.
	(direct_read): Stylistic fixes. Use data->decompress.
	(grub_squash_read_data): Likewise.
	* grub-core/io/gzio.c (grub_gzio): Remove disk_input.
	(get_byte): Likewise.
	(grub_zlib_disk_read): Removed.
	* grub-core/lib/posix_wrap/sys/types.h (ssize_t): New type.
	(GRUB_POSIX_BOOL_DEFINED): New define.
	* grub-core/lib/posix_wrap/unistd.h: Include sys/types.h.
	* grub-core/lib/xzembed/xz.h: Addmissing includes.
	[!GRUB_POSIX_BOOL_DEFINED]: Define bool.
	* include/grub/deflate.h (grub_zlib_disk_read): Removed.
2011-12-26 13:18:01 +01:00
Vladimir 'phcoder' Serbinenko
a1a8b1b90a Support odc, newc and bigendian cpio formats.
* Makefile.util.def (libgrubmods): Add odc.c, newc.c and cpio_be.c.
	* grub-core/Makefile.core.def (newc): New module.
	(odc): Likewise.
	(cpio_be): Likewise.
	* grub-core/fs/cpio.c (ALIGN_CPIO): New macro.
	(MAGIC): Likewise.
	(MAGIC2): Likewise.
	(head) [MODE_ODC]: Adapt for the format.
	(head) [MODE_NEWC]: Likewise.
	(head) [!MODE_*]: Write fields of interest as arrays.
	(MAGIC_USTAR): Removed.
	(read_number) [MODE_NEWC]: Change to hex.
	(read_number) [!MODE_*]: Parse binary arrays.
	(grub_cpio_find_file): Factor out the code for better structure and
	always use read_number.
	(grub_cpio_mount): Use MAGIC and MAGIC2.
	(grub_cpio_dir): Exit on first hook non-0 return.
	(grub_cpio_fs) [MODE_ODC]: Set name to odc.
	(grub_cpio_fs) [MODE_NEWC]: Set name to newc.
	(GRUB_MOD_INIT) [MODE_ODC]: Set name to odc.
	(GRUB_MOD_INIT) [MODE_NEWC]: Set name to newc.
	(GRUB_MOD_FINI) [MODE_ODC]: Set name to odc.
	(GRUB_MOD_FINI) [MODE_NEWC]: Set name to newc.
	* grub-core/fs/newc.c: New file.
	* grub-core/fs/odc.c: Likewise.
	* grub-core/fs/cpio_be.c: Likewise.
2011-12-23 16:15:18 +01:00
Seth Goldberg
3ea1ca46c1 * grub-core/Makefile.core.def (lzma_decompress): Add missing
TARGET_IMG_LDFLAGS.
2011-12-23 11:39:30 +01:00
Vladimir 'phcoder' Serbinenko
bd67ad0f70 merge mainline into net 2011-12-15 20:51:35 +01:00
Lubomir Kundrak
66d6a7937b gdb over serial by Lubomir Kundrak and cleaned-up/updated by me (phcoder)
Also-By: Vladimir Serbinenko <phcoder@gmail.com>
2011-11-14 22:58:11 +01:00
Vladimir 'phcoder' Serbinenko
c1677cfccf Fix a mismerge 2011-11-14 14:27:52 +01:00
Vladimir 'phcoder' Serbinenko
245f4582f9 merge mainline into backtrace 2011-11-14 10:50:24 +01:00
Vladimir 'phcoder' Serbinenko
9ad7edd055 merge mainline into backtrace 2011-11-14 10:49:13 +01:00
Lubomir Kundrak
2536cf6463 Add facility to debug GRUB with gdb under qemu.
* grub-core/gdb_grub.in: New file.
	* grub-core/gmodule.pl.in: Likewise.
	* grub-core/Makefile.core.def (gmodule.pl): New script.
	(gdb_grub): Likewise.
2011-11-13 22:59:46 +01:00
Vladimir 'phcoder' Serbinenko
111c17782a Plan9 support.
* Makefile.util.def (libgrubmods): Add
	grub-core/partmap/plan.c.
	* docs/grub.texi: Notice Plan9 support.
	* grub-core/Makefile.core.def (plan9): New module.
	(part_plan): Likewise.
	* grub-core/loader/i386/pc/plan9.c: New file.
	* grub-core/partmap/plan.c: Likewise.
	* include/grub/msdos_partition.h (GRUB_PC_PARTITION_TYPE_PLAN9): New
	define.
	(GRUB_PC_PARTITION_TYPE_LINUX_SWAP): Likewise.
	* include/grub/mm.h (grub_extend_alloc): New inline function.
2011-11-13 19:38:08 +01:00
Vladimir 'phcoder' Serbinenko
4e01c8c165 Merge mainline into plan9 2011-11-13 12:48:39 +01:00
Vladimir 'phcoder' Serbinenko
60240b8bc1 Use decompressors framework on i386-pc. It increases core size
by 46 bytes but improves compatibility and maintainability.

	* grub-core/Makefile.core.def (lzma_decompress): New image.
	(kernel): Add i386_pc_ldflags.
	* grub-core/kern/i386/pc/startup.S: Move intial part to ..
	* grub-core/boot/i386/pc/startup_raw.S: ... here. Pass pointers
	to real_to_prot, prot_to_real and device info.
	* include/grub/offsets.h: Renamed decompressor offsets.
	* util/grub-mkimage.c (grub_compression_t): New cmpression lzma.
	(image_target_desc): Remove raw_size and rename decompressor fields.
	(compress_kernel): Handle lzma.
	(generate_image): Handle decompressors on i386-pc.
2011-11-12 19:53:25 +01:00
Vladimir 'phcoder' Serbinenko
f003a8c5e7 Move ZFS crypto to separate module 2011-11-06 15:18:25 +01:00
Vladimir 'phcoder' Serbinenko
158dc1ea26 XZ CRC64 and SHA256 support.
* Makefile.util.def (libgrubmods): Add crc64.c.
	* grub-core/Makefile.core.def (crc64): New module.
	* grub-core/lib/crc64.c: New file.
	* grub-core/lib/xzembed/xz_dec_stream.c (xz_dec_hash)
	[!GRUB_EMBED_DECOMPRESSOR]: Rename crc32_context to hash_context.
	Fix the type.
	(MAX_HASH_SIZE): New define.
	(xz_dec) [!GRUB_EMBED_DECOMPRESSOR]: Add generic hash fields.
	(dec_block) [!GRUB_EMBED_DECOMPRESSOR]: Handle non-crc32 hashes.
	(index_update) [!GRUB_EMBED_DECOMPRESSOR]: Likewise.
	(dec_index) [!GRUB_EMBED_DECOMPRESSOR]: Likewise.
	(crc32_validate) [!GRUB_EMBED_DECOMPRESSOR]: Rename to ...
	(hash_validate) [!GRUB_EMBED_DECOMPRESSOR]: ... this.
	Handle non-crc32 hashes.
	(hashes) [!GRUB_EMBED_DECOMPRESSOR]: New variable.
	(dec_stream_header): Handle non-crc32 hashes.
	(dec_stream_footer): Likewise.
	(dec_block_header): Likewise.
	(dec_main): Likewise.
	(xz_dec_init): Likewise.
	(xz_dec_reset): Likewise.
	(xz_dec_end): Likewise.
	* util/import_gcry.py: Add CRC64 line.
2011-11-03 15:13:30 +01:00
Vladimir 'phcoder' Serbinenko
eb0b6b45f3 Leverage BFS implementation to read AFS.
* Makefile.util.def (libgrubmods): Add afs.c.
	* grub-core/Makefile.core.def (afs): New module
	* grub-core/fs/afs.c: New file.
	* grub-core/fs/bfs.c [MODE_AFS]: Adapt for AFS.
2011-10-30 16:10:18 +01:00