Commit Graph

404 Commits

Author SHA1 Message Date
Leif Lindholm 389b31cd71 Initial import of Leif's work 2013-04-07 02:41:07 +02:00
Vladimir 'phcoder' Serbinenko f75835bdad Use TSC as a possible time source on i386-ieee1275. 2013-04-04 09:55:44 +02:00
Vladimir 'phcoder' Serbinenko 30d6b1b290 * grub-core/Makefile.core.def (vga): Disable on coreboot and multiboot
platforms.
2013-03-24 14:01:51 +01:00
Vladimir 'phcoder' Serbinenko 23c9cc0490 * grub-core/Makefile.core.def (vbe): Disable on coreboot and multiboot
platforms.
2013-03-24 13:07:51 +01:00
Vladimir 'phcoder' Serbinenko ce50dbd746 Add new 'proc' filesystem framework and put luks_script into it. 2013-03-24 13:05:59 +01:00
Vladimir 'phcoder' Serbinenko 92750e4c60 Add ability to generate newc additions on runtime. 2013-03-22 21:01:28 +01:00
Vladimir 'phcoder' Serbinenko cc19857a2a New commands cbmemc, lscoreboot, coreboot_boottime to inspect
coreboot tables content. Support for cbmemc.
2013-03-20 17:13:31 +01:00
Vladimir 'phcoder' Serbinenko e744219bb6 Implement boot time analysis framework. 2013-03-19 20:25:09 +01:00
Vladimir 'phcoder' Serbinenko 5341c0fbfc Avoid costly 64-bit division in grub_get_time_ms on most platforms. 2013-03-10 17:45:38 +01:00
Vladimir 'phcoder' Serbinenko 0789b67232 Enable linux16 on non-BIOS systems for i.a. memtest.
* grub-core/loader/i386/pc/linux.c (grub_cmd_linux): Handle hole at 0
	correctly.
	* grub-core/Makefile.core.def (linux16): Enable on all x86 flavours.
2013-02-28 22:48:41 +01:00
Vladimir 'phcoder' Serbinenko d55ffb0249 Implement new command cmosdump. 2013-02-24 19:44:17 +01:00
Vladimir 'phcoder' Serbinenko 66a93674b2 Implement USBDebug (full USB stack variant). 2013-02-01 21:49:29 +01:00
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
Vladimir 'phcoder' Serbinenko 5825b3794b BFS implementation based on the specification.
* grub-core/fs/bfs.c: New file.
	* Makefile.util.def (libgrubmods): Add bfs.c.
	* grub-core/Makefile.core.def (bfs): New module.
2011-10-30 13:25:51 +01:00
Vladimir 'phcoder' Serbinenko faba3d163a Remove afs and befs because of copyright problem.
* grub-core/fs/afs.c: Removed.
	* grub-core/fs/afs_be.c: Removed.
	* grub-core/fs/befs.c: Removed.
	* grub-core/fs/befs_be.c: Removed.
	* Makefile.util.def (libgrubkern): Remove afs, afs_be, befs and befs_be.
	* grub-core/Makefile.core.def (afs): Removed.
	(afs_be): Likewise.
	(befs): Likewise.
	(befs_be): Likewise.
2011-10-29 11:29:34 +02:00
Vladimir 'phcoder' Serbinenko 124df5f6ca Fine grainely disable warnings on lexer. Remove Wno-error on it.
* grub-core/Makefile.core.def (normal): Remove -Wno-error.
	* grub-core/script/lexer.c: Declare yytext_ptr to avoid having
	yylex_strncpy.
	* grub-core/script/yylex.l: Add fine-grained #pragma.
2011-10-23 23:32:06 +02:00
Vladimir 'phcoder' Serbinenko a374751b16 ExFAT support.
* Makefile.util.def (libgrubmods.a): Add grub-core/fs/exfat.c.
	* grub-core/Makefile.core.def (exfat): New module.
	* grub-core/fs/exfat.c: New file.
	* grub-core/fs/fat.c (GRUB_FAT_DIR_ENTRY_SIZE): Removed.
	(GRUB_FAT_ATTR_*): Make into an enum.
	(GRUB_FAT_ATTR_LONG_NAME) [MODE_EXFAT]: Removed.
	(GRUB_FAT_ATTR_VALID) [MODE_EXFAT]: Remove GRUB_FAT_ATTR_VOLUME_ID.
	(GRUB_FAT_ATTR_VOLUME_ID) [MODE_EXFAT]: Removed.
	(GRUB_FAT_MAXFILE): Removed.
	(grub_exfat_bpb) [MODE_EXFAT]: New struct.
	(grub_current_fat_bpb_t): New type.
	(grub_fat_dir_entry) [MODE_EXFAT]: New struct.
	(grub_fat_dir_node) [MODE_EXFAT]: New struct.
	(grub_fat_dir_node_t): New type.
	(grub_fat_data) [MODE_EXFAT]: Remove root_sector and num_root_sectors.
	(fat_log2) [MODE_EXFAT]: Removed.
	(grub_fat_mount): Use grub_current_fat_bpb_t. Add some sanity checks.
	(grub_fat_mount) [MODE_EXFAT]: Handle ExFAT.
	(grub_fat_iterate_dir) [MODE_EXFAT]: New function.
	(grub_fat_find_dir) [MODE_EXFAT]: Handle ExFAT.
	(grub_fat_label) [MODE_EXFAT]: New function.
	(grub_fat_fs) [MODE_EXFAT]: Set name to "exfat" and
	reserved_first_sector to 0.
2011-10-19 20:19:25 +02:00
Vladimir 'phcoder' Serbinenko 544c24876e Move grub_reboot out of the kernel.
* grub-core/Makefile.core.def (reboot): Add platform-specific files.
	* grub-core/kern/efi/efi.c (grub_reboot): Moved to ...
	* grub-core/lib/efi/reboot.c: ... here.
	* grub-core/kern/i386/efi/startup.S: Remove including of realmode.S.
	* grub-core/kern/i386/ieee1275/startup.S: Likewise.
	* grub-core/kern/i386/pc/startup.S (grub_exit): Inline cold_reboot.
	* grub-core/kern/i386/realmode.S (grub_reboot): Moved to...
	* grub-core/lib/i386/reboot_trampoline.S: ... here.
	* grub-core/kern/ieee1275/openfw.c (grub_reboot): Moved to...
	* grub-core/lib/ieee1275/reboot.c: ... here.
	* grub-core/kern/mips/arc/init.c (grub_reboot): Moved to...
	* grub-core/lib/mips/arc/reboot.c: ... here.
	* grub-core/kern/mips/loongson/init.c (grub_reboot): Moved to...
	* grub-core/lib/mips/loongson/reboot.c: ...here.
	* grub-core/kern/mips/qemu_mips/init.c (grub_reboot): Moved to...
	* grub-core/lib/mips/qemu_mips/reboot.c: ... here.
	* include/grub/emu/misc.h (grub_reboot): New function declaration.
	* include/grub/i386/reboot.h: New file.
	* include/grub/mips/loongson/ec.h: Fix includes.
	* include/grub/mips/qemu_mips/kernel.h (grub_reboot): Removed.
	* include/grub/misc.h (grub_reboot): Don't mark as kernel function.
	* grub-core/lib/i386/reboot.c: New file.
2011-10-19 16:53:18 +02:00
Vladimir 'phcoder' Serbinenko 038ec56a31 nslookup implementation 2011-10-14 19:21:59 +02:00
Vladimir 'phcoder' Serbinenko a53cf6534d some more ipv6 code 2011-10-12 10:20:55 +02:00
Szymon Janc a664449575 merge trunk 2011-10-06 19:00:10 +02:00
Vladimir 'phcoder' Serbinenko aa6b91afe9 merge mainline into net 2011-10-05 13:32:40 +02:00
Vladimir 'phcoder' Serbinenko fe942b7dbb * grub-core/Makefile.core.def: Eliminate rarely used emu_condition. This
in perspective decreases the complexity of build system and fixes
	compilation right now.
2011-10-05 11:53:36 +02:00
Szymon Janc 709e61a55f merge trunk 2011-10-04 20:21:12 +02:00
Szymon Janc b871e8ebcc * grub-core/Makefile.core.def (btrfs): Remove minilzo.c from common. 2011-10-03 23:01:14 +02:00
Aleš Nesrsta 2f82ea948d EHCI implementation by Aleš Nesrsta. 2011-10-01 20:18:47 +02:00
Mads Kiilerich fc5efcc083 * grub-core/Makefile.core.def (kernel): Add kern/i386/int.S to
extra_dist.
2011-09-29 10:50:25 +02:00
Szymon Janc 9a8d32a24f Add support for adler32 checksuming.
* grub-core/lib/adler32.c: New file.
* Makefile.util.def (library): Add grub-core/lib/adler32.c to common.
* util/import_gcry.py (cryptolist): Add adler32.
2011-08-20 18:24:54 +02:00
Szymon Janc 540c000f0d merge trunk 2011-08-20 09:49:15 +02:00
Vladimir 'phcoder' Serbinenko d94497eaca * grub-core/Makefile.core.def (kernel): Add video/radeon_fuloong2e.c on
loongson.
	* grub-core/kern/mips/loongson/init.c (grub_machine_init): Init
	video_radeon_fuloong2e.
	* grub-core/video/radeon_fuloong2e.c: New file.
	* include/grub/video.h (grub_video_id_t): Add new ID
	GRUB_VIDEO_DRIVER_RADEON_FULOONG2E.
2011-08-19 23:08:36 +02:00
Vladimir 'phcoder' Serbinenko 14a2562cf7 Rename Fuloong into Fuloong 2F. Add new ID for Fuloong2E.
* grub-core/Makefile.core.def (fwstart_fuloong): Rename fwstart_fuloong
	into fwstart_fuloong2f. Use boot/mips/loongson/fuloong2f.S.
	* grub-core/boot/mips/loongson/fuloong.S: Rename to ...
	* grub-core/boot/mips/loongson/fuloong2f.S: ... this.
	(FULOONG): Rename to ...
	(FULOONG2F): ... this. All users updated.
	* grub-core/boot/mips/startup_raw.S (machtype_fuloong_str): Rename to
	(machtype_fuloong2f_str): ... this.
	(machtype_fuloong2e_str): New string.
	Check for machtype_fuloong2e_str.
	* grub-core/loader/mips/linux.c (loongson_machtypes)
	[GRUB_MACHINE_MIPS_LOONGSON]: Add GRUB_ARCH_MACHINE_FULOONG2E.
	* grub-core/term/serial.c (loongson_defserial)
	[GRUB_MACHINE_MIPS_LOONGSON]: New array.
	(grub_serial_register) [GRUB_MACHINE_MIPS_LOONGSON]: Use
	loongson_defserial.
	* include/grub/mips/loongson/kernel.h (GRUB_ARCH_MACHINE_FULOONG):
	Rename to ...
	(GRUB_ARCH_MACHINE_FULOONG2F): ... this.
	(GRUB_ARCH_MACHINE_FULOONG2E): New const.
	* util/grub-mkimage.c (image_target_desc): Rename IMAGE_FULOONG_FLASH
	to IMAGE_FULOONG2F_FLASH. All users updated.
	(image_targets): Rename images.
	* util/grub-mkstandalone.in: Accept fuloong2f and fuloong2e.
2011-08-19 22:46:11 +02:00
Szymon Janc d6beefcfc9 Add initial support for lzop files decompression.
* grub-core/Makefile.core.def (lzopio): New module.
* grub-core/io/lzopio.c: New file.
* include/grub/file.h (grub_file_filter_id): New compression filter
GRUB_FILE_FILTER_LZOPIO.
2011-08-17 19:40:25 +02:00
Szymon Janc 095f077e6d Add support for LZO compression in btrfs.
* Makefile.util.def (libgrubmods.a): Add minilzo.c and add required flags
to cflags in cppflags.
* Makefile.core.def (btrfs): Likewise.
* grub-core/fs/btrfs.c: Include minilzo.h.
(grub_btrfs_superblock): Add sectorsize, nodesize, leafsize, stripsize and
dummy5 field.
(GRUB_BTRFS_COMPRESSION_LZO): New define.
(grub_btrfs_extent_read): Add support for LZO compression type.
2011-08-14 11:46:05 +02:00
Szymon Janc 99cecb4fc7 merge trunk 2011-08-13 15:00:48 +02:00
Vladimir 'phcoder' Serbinenko 80e722366d First attempt at http 2011-07-23 03:49:02 +02:00
Vladimir 'phcoder' Serbinenko 3a7af37260 basic tcp implementation 2011-07-10 08:46:48 +02:00
Vladimir 'phcoder' Serbinenko 1367c143dd several cleanups. Ping reply support 2011-07-08 14:41:52 +02:00
Vladimir 'phcoder' Serbinenko 6e706342c3 merge mainline into net 2011-07-08 13:34:37 +02:00
Vladimir 'phcoder' Serbinenko 2e418de646 Remove getroot.c from core on emu platform.
* grub-core/Makefile.core.def (kernel): Remove kern/emu/getroot.c and
	kern/emu/raid.c.
	* grub-core/kern/emu/main.c (main): Don't try to guess root device. It's
	useless.
	* grub-core/kern/emu/misc.c (get_win32_path): Moved from here...
	* util/getroot.c (get_win32_path): ... here.
	* grub-core/kern/emu/misc.c (fini_libzfs): Moved from here...
	* util/getroot.c (fini_libzfs): ... here.
	* grub-core/kern/emu/misc.c (grub_get_libzfs_handle): Moved from here...
	* util/getroot.c (grub_get_libzfs_handle): ... here.
	* grub-core/kern/emu/misc.c (grub_find_zpool_from_dir):
	Moved from here...
	* util/getroot.c (grub_find_zpool_from_dir): ... here.
	* grub-core/kern/emu/misc.c
	(grub_make_system_path_relative_to_its_root): Moved from here...
	* util/getroot.c (grub_make_system_path_relative_to_its_root): ... here.
	* grub-core/kern/emu/getroot.c: Moved from here ...
	* util/getroot.c: ... here. All users updated.
	* grub-core/kern/emu/raid.c: Moved from here ...
	* util/raid.c: ... here. All users updated.
2011-07-08 13:33:12 +02:00
Vladimir 'phcoder' Serbinenko 4db3461696 Priority queue implementation 2011-07-08 04:07:15 +02:00
Vladimir Serbinenko a251b71915 LUKS and GELI support.
* Makefile.util.def (libgrubkern.a): Add grub-core/lib/crypto.c,
	grub-core/disk/luks.c, grub-core/disk/geli.c,
	grub-core/disk/cryptodisk.c, grub-core/disk/AFSplitter.c,
	grub-core/lib/pbkdf2.c, grub-core/commands/extcmd.c,
	grub-core/lib/arg.c.
	(libgrubmods.a): Remove gcrypts cflags and cppflags.
	Remove grub-core/commands/extcmd.c, grub-core/lib/arg.c,
	grub-core/lib/crypto.c, grub-core/lib/libgcrypt-grub/cipher/sha512.c,
	grub-core/lib/libgcrypt-grub/cipher/crc.c and grub-core/lib/pbkdf2.c.
	(grub-bin2h): Add libgcry.a.
	(grub-mkimage): Likewise.
	(grub-mkrelpath): Likewise.
	(grub-script-check): Likewise.
	(grub-editenv): Likewise.
	(grub-mkpasswd-pbkdf2): Likewise.
	(grub-pe2elf): Likewise.
	(grub-fstest): Likewise.
	(grub-mkfont): Likewise.
	(grub-mkdevicemap): Likewise.
	(grub-probe): Likewise.
	(grub-ofpath): Likewise.
	(grub-mklayout): Likewise.
	(example_unit_test): Likewise.
	(grub-menulst2cfg): Likewise.
	* autogen.sh (UTIL_DEFS): Add Makefile.utilgcry.def.
	* grub-core/Makefile.core.def (cryptodisk): New module.
	(luks): Likewise.
	(geli): Likewise.
	* grub-core/disk/AFSplitter.c: New file.
	* grub-core/disk/cryptodisk.c: Likewise.
	* grub-core/disk/geli.c: Likewise.
	* grub-core/disk/luks.c: Likewise.
	* grub-core/kern/emu/getroot.c (get_dm_uuid): New function based on
	grub_util_is_lvm.
	(grub_util_get_dm_abstraction): New function.
	(grub_util_follow_gpart_up): Likewise.
	(grub_util_get_geom_abstraction): Likewise.
	(grub_util_get_dev_abstraction): Use new functions.
	(grub_util_pull_device): Pull GELI and LUKS.
	(grub_util_get_grub_dev): Handle LUKS and GELI.
	* grub-core/kern/emu/hostdisk.c (grub_util_get_fd_sectors): New function.
	(grub_util_biosdisk_open): Use grub_util_get_fd_sectors.
	(follow_geom_up): Removed.
	(grub_util_fd_seek): New function.
	(open_device): Use grub_util_fd_seek.
	(nread): Rename to ..
	(grub_util_fd_read): ... this. All users updated.
	* grub-core/lib/crypto.c (grub_crypto_ecb_decrypt): A better prototype.
	(grub_crypto_cbc_decrypt): Likewise.
	(grub_crypto_hmac_write): Likewise.
	(grub_crypto_hmac_buffer): Likewise.
	(grub_password_get): Extend to util.
	* include/grub/crypto.h (gcry_cipher_spec) [GRUB_UTIL]:
	New member modname.
	(gcry_md_spec) [GRUB_UTIL]: Likewise.
	* include/grub/cryptodisk.h: New file.
	* include/grub/disk.h (grub_disk_dev_id): Rename LUKS to CRYPTODISK.
	* include/grub/emu/getroot.h (grub_dev_abstraction_types): Add
	LUKS and GELI.
	(grub_util_follow_gpart_up): New proto.
	* include/grub/emu/hostdisk.h (grub_util_fd_seek): Likewise.
	(grub_util_fd_read): Likewise.
	(grub_cryptodisk_cheat_mount): Likewise.
	(grub_util_cryptodisk_print_uuid): Likewise.
	(grub_util_get_fd_sectors): Likewise.
	* util/grub-fstest.c (mount_crypt): New var.
	(fstest): Mount crypto if requested.
	(options): New option -C.
	(argp_parser): Parse -C.
	(main): Init and fini gcry.
	* util/grub-install.in: Support cryptodisk install.
	* util/grub-mkconfig.in: Export GRUB_ENABLE_CRYPTODISK.
	* util/grub-mkconfig_lib.in (is_path_readable_by_grub): Support
	cryptodisk.
	(prepare_grub_to_access_device): Likewise.
	* util/grub-mkpasswd-pbkdf2.c (main): Use grub_password_get.
	* util/grub-probe.c (probe_partmap): Support cryptodisk UUID probe.
	(probe_cryptodisk_uuid): New function.
	(probe_abstraction): Likewise.
	(probe): Use new functions.
	* util/import_gcry.py: Create Makefile.utilgcry.def.
	Add modname member.

	Also-By: Michael Gorven <michael@gorven.za.net>

	Also-By: Clemens Fruhwirth <clemens@endorphin.org>
2011-07-07 23:52:58 +02:00
Vladimir 'phcoder' Serbinenko 00542307eb merge mainline into lazy 2011-07-07 12:21:53 +02:00
Vladimir 'phcoder' Serbinenko 138eeb3625 Move bootp into a separate file 2011-07-06 13:52:35 +02:00
Vladimir 'phcoder' Serbinenko d53bf34924 merge mainline into net 2011-07-06 01:35:41 +02:00
Vladimir 'phcoder' Serbinenko 93c06ff9c6 VGA text support in qemu-mips
* grub-core/Makefile.core.def (kernel): Add term/i386/pc/vga_text.c,
	term/i386/vga_common.c and kern/vga_init.c on qemu-mips.
	* grub-core/kern/mips/qemu_mips/init.c (grub_machine_init): Init vga
	text.
	* grub-core/kern/i386/qemu/init.c: Renamed to ...
	* grub-core/kern/vga_init.c: ... this.
	* grub-core/kern/vga_init.c (VGA_ADDR) [__mips__]: Adjust.
	(grub_qemu_init_cirrus) [__mips__]: Skip PCI and adjust the I/O base.
	* grub-core/term/i386/pc/vga_text.c (VGA_TEXT_SCREEN) [__mips__]:
	Adjust.
	* include/grub/vga.h [GRUB_MACHINE_MIPS_QEMU_MIPS]: Declare
	GRUB_MACHINE_PCI_IO_BASE.
2011-07-05 23:46:15 +02:00
Vladimir 'phcoder' Serbinenko d734599439 MIPS qemu at_keyboard support.
* gentpl.py (videoinkernel): Add qemu-mips.
	* grub-core/Makefile.am (KERNEL_HEADER_FILES): Add necessary headers.
	* grub-core/Makefile.core.def (kernel): Add at_keyboard and layout.
	* grub-core/kern/mips/qemu_mips/init.c (grub_machine_init): Init new
	modules.
	* grub-core/term/at_keyboard.c (grub_keyboard_controller_init)
	[GRUB_MACHINE_MIPS_QEMU_MIPS]: Don't consider original set.
	* grub-core/term/serial.c (grub_serial_register)
	[GRUB_MACHINE_MIPS_QEMU_MIPS]: Make com0 explicitly active.
2011-07-05 21:00:01 +02:00
Vladimir 'phcoder' Serbinenko 145c7b4661 merge mainline into net 2011-07-05 20:40:39 +02:00
Vladimir 'phcoder' Serbinenko a07a81b335 CMOS support on sparc.
* gentpl.py (cmos): Add powerpc and sparc.
	* grub-core/Makefile.core.def (datetime): Add lib/ieee1275/cmos.c on
	powerpc and sparc.
	* grub-core/lib/cmos_datetime.c (grub_get_datetime)
	[__powerpc__ || __sparc__]: Rename to grub_get_datetime_cmos.
	(grub_set_datetime) [__powerpc__ || __sparc__]: Likewise to
	grub_set_datetime_cmos.
	* grub-core/lib/ieee1275/cmos.c: New file.
	* grub-core/lib/ieee1275/datetime.c (no_ieee1275_rtc): New vaiable.
	(find_rtc): Set no_ieee1275_rtc on error.
	(grub_get_datetime): Call grub_get_datetime_cmos on error.
	(grub_set_datetime): Call grub_set_datetime_cmos on error.
	* include/grub/cmos.h (grub_cmos_read): Return grub_err_t since it may
	fail. Move value to argument. All users updated
	(grub_cmos_write): Likewise.
	(grub_cmos_read) [__powerpc__ || __sparc__]: Rewritten.
	(grub_cmos_write) [__powerpc__ || __sparc__]: Likewise.
	* include/grub/datetime.h [__powerpc__ || __sparc__]: Declare
	grub_get_datetime_cmos and grub_set_datetime_cmos.
2011-07-05 20:24:20 +02:00
Vladimir 'phcoder' Serbinenko 671a78acb0 cleanup pxe and efi network release 2011-07-05 14:34:10 +02:00
Vladimir 'phcoder' Serbinenko 03a0046581 merge mainline into net 2011-07-02 18:52:50 +02:00
Vladimir 'phcoder' Serbinenko 574618a2e9 unify prefix handling across platforms 2011-07-02 14:09:36 +02:00
Vladimir 'phcoder' Serbinenko 8d5d8444bd * grub-core/Makefile.core.def (chain): Fix coreboot filename. 2011-06-27 19:30:16 +02:00
Vladimir 'phcoder' Serbinenko ba7df45ee6 Chainloading on coreboot support.
* grub-core/Makefile.core.def (chain): Add coreboot.
	* grub-core/loader/i386/coreboot/chainloader.c: New file.
2011-06-27 14:14:11 +02:00
Vladimir 'phcoder' Serbinenko 5ff1d945ed Implement time command.
* grub-core/Makefile.core.def (time): New module.
	* grub-core/commands/time.c: New file.
	* grub-core/script/parser.y: Remove "time" keyword.
	* grub-core/script/yylex.l: Likewise.
2011-06-27 12:31:37 +02:00
Vladimir 'phcoder' Serbinenko 9fc9ce3795 Coreboot video support.
* grub-core/Makefile.core.def (vga): Extend to coreboot and multiboot.
	(vbe): Likewise.
	* grub-core/kern/i386/coreboot/startup.S: Include int.S.
	* grub-core/kern/i386/pc/startup.S (grub_bios_interrupt): Moved from
	here ...
	* grub-core/kern/i386/int.S: ... here.
	* grub-core/video/i386/pc/vbe.c: Updated includes.
	* grub-core/video/i386/pc/vga.c: Likewise.
	* include/grub/i386/coreboot/memory.h
	(GRUB_MEMORY_MACHINE_SCRATCH_ADDR): New definition.
	(GRUB_MEMORY_MACHINE_SCRATCH_SEG): Likewise.
	(GRUB_MEMORY_MACHINE_SCRATCH_SIZE): Likewise.
	* include/grub/i386/pc/int.h (GRUB_CPU_INT_FLAGS_DEFAULT) [!PCBIOS]:
	Disable interrupts.
	* include/grub/i386/pc/vga.h: Removed. All users updated.
2011-06-27 08:54:55 +02:00
Vladimir 'phcoder' Serbinenko 9d22909b85 efinet support 2011-06-26 22:42:04 +02:00
Vladimir 'phcoder' Serbinenko 8e60fc8f85 Send network packets on PXE 2011-06-26 04:19:12 +02:00
Manoel Rebelo Abranches 90162423e9 Network infrastructure.
The ARP protocol was made by Paulo Pinatti <ppinatti@br.ibm.com>

	* include/grub/net/arp.h: New file.
	* include/grub/net/device.h: Likewise.
	* include/grub/net/ethernet.h: Likewise.
	* include/grub/net/ip.h: Likewise.
	* include/grub/net/netbuff.h: Likewise.
	* include/grub/net/tftp.h: Likewise.
	* include/grub/net/udp.h: Likewise.
	* include/grub/ieee1275/ofnet.h: Likewise.
	* include/grub/emu/export.h: Likewise.
	* include/grub/net.h: Likewise.
	* grub-core/net/arp.c: Likewise.
	* grub-core/net/ethernet.c: Likewise.
	* grub-core/net/ip.c: Likewise.
	* grub-core/net/udp.c: Likewise.
	* grub-core/net/tftp.c: Likewise.
	* grub-core/net/netbuff.c: Likewise.
	* grub-core/net/net.c: Likewise.
	* grub-core/net/drivers/emu/emunet.c: Likewise.
	* grub-core/net/drivers/ieee1275/ofnet.c: Likewise.
	* grub-core/Makefile.am (KERNEL_HEADER_FILES): Add net.h, ofnet.h and
	export.h.
	* grub-core/Makefile.core.def (net): New module.
	(tftp): Likewise.
	(ofnet): Likewise.
	(emunet): Likewise.
	* grub-core/commands/ls.c (grub_ls_list_devices) [!GRUB_UTIL]: List
	network protocols.
	* grub-core/kern/device.c (grub_net_open) : New variable.
	(grub_device_open): Handle network device.
	(grub_device_close): Likewise.
	* grub-core/kern/file.c (grub_file_net_seek) : New variable.
	(grub_grubnet_fini): Likewise.
	(grub_file_seek): Seek in network device.
	* grub-core/kern/fs.c (grub_fs_probe): Handle network devices.
	* grub-core/kern/ieee1275/init.c (grub_machine_set_prefix): Handle
	network root.
	(grub_machine_fini): Call grub_grubnet_fini.
	* grub-core/kern/ieee1275/openfw.c (grub_ieee1275_parse_args): Handle
	network.
	(grub_ieee1275_get_aliasdevname): New function.
	* grub-core/loader/i386/multiboot_mbi.c (grub_multiboot_get_mbi_size):
	Add unofficial Solaris network info.
	(grub_multiboot_make_mbi): Likewise.
	* grub-core/fs/i386/pc/pxe.c: Moved from here ...
	* grub-core/net/i386/pc/pxe.c: ...here. Adapted for new design.
	* include/grub/device.h (grub_fs): Removed.
	* include/grub/err.h (grub_err_t): Add network-related values.
	* include/grub/i386/pc/pxe.h: Removed bootp parts.
	* include/grub/ieee1275/ieee1275.h (grub_ofnetcard_data): New struct.
	(grub_ieee1275_get_aliasdevname): New proto.
	* include/grub/net.h: Rewritten.

	Also-By: Paulo Pinatti <ppinatti@br.ibm.com>

	Also-By: Vladimir Serbinenko <phcoder@gmail.com>
2011-06-24 22:16:05 +02:00
Vladimir 'phcoder' Serbinenko 5ab3f48a92 AHCI support.
* grub-core/Makefile.core.def (ata_pthru): Removed.
	(ahci): New module.
	(pata): Likewise.
	* grub-core/bus/usb/ohci.c (GRUB_MOD_FINI): Unregister preboot hook
	on unload.
	* grub-core/commands/hdparm.c (grub_hdparm_do_ata_cmd): Use ATA
	readwrite.
	(grub_hdparm_do_check_powermode_cmd): Likewise.
	(grub_hdparm_do_smart_cmd): Likewise.
	(grub_hdparm_set_val_cmd): Likewise.
	(grub_cmd_hdparm): Likewise. Check thta we have an ATA device.
	* grub-core/disk/ahci.c: New file.
	* grub-core/disk/ata.c: Factor out the low-level part into ...
	* grub-core/disk/pata.c: ... here.
	* grub-core/disk/ata_pthru.c: Contents moved to ...
	* grub-core/disk/pata.c: ... here.
	* grub-core/disk/scsi.c (grub_scsi_names): New array.
	(grub_scsi_iterate): Use grub_scsi_names.
	(grub_scsi_open): Likewise.
	* grub-core/kern/disk.c (grub_disk_ata_pass_through): Removed.
	* include/grub/ata.h (grub_ata_commands): Add DMA commands.
	(grub_ata_regs_t): New struct.
	(grub_disk_ata_pass_through_parms): Likewise.
	(grub_ata_device): Renamed to ...
	(grub_ata): ... this.
	(grub_ata_dev): New struct.
	Removed all low-level inline functions.
	* include/grub/scsi.h: Add PATA and AHCI subsystems.
	(grub_scsi_dev): Removed 'name' and 'id'. Added 'id' parameter to
	iterate hooks and open. All users updated.
	* util/grub-install.in: Handle AHCI disk module.
2011-06-24 00:07:55 +02:00
Manoel R. Abranches 85fd555441 Merge Mainline. 2011-05-27 00:23:33 -03:00
Vladimir 'phcoder' Serbinenko 9a79fcf2c9 * grub-core/Makefile.core.def (lsacpi): Fix ia64 mismerge.
(lsefisystab): Likewise.
	(lssal): Likewise.
	(lsefimmap): Likewise.
	(hdparm): Enable on qemu-mips.
	(setjmp): Add ia64 nodist.
	(serial): Simplify tags.
2011-05-19 12:13:18 +02:00
Colin Watson e2965f4a32 Move gfxmenu color handling to video, so that gfxterm can use it
too.

* grub-core/gfxmenu/named_colors.c: Move to ...
* grub-core/video/colors.c: ... here.  Rename
grub_gui_get_named_color to grub_video_get_named_color.
* grub-core/gfxmenu/gui_string_util.c (my_isxdigit): Move to ...
* grub-core/video/colors.c (my_isxdigit): ... here.
* grub-core/gfxmenu/gui_string_util.c (parse_hex_color_component):
Move to ...
* grub-core/video/colors.c (parse_hex_color_component): ... here.
* grub-core/gfxmenu/gui_string_util.c (grub_gui_parse_color): Move
to ...
* grub-core/video/colors.c (grub_video_parse_color): ... here.

* include/grub/gui.h (grub_gui_color_t): Move to ...
* include/grub/video.h (grub_video_rgba_color_t): ... here.
* include/grub/gui.h (grub_gui_color_rgb): Move to ...
* include/grub/video.h (grub_video_rgba_color_rgb): ... here.
* include/grub/gui.h (grub_gui_map_color): Move to ...
* include/grub/video.h (grub_video_map_rgba_color): ... here.
* include/grub/gui_string_util.h (grub_gui_get_named_color): Move
to ...
* include/grub/video.h (grub_video_get_named_color): ... here.
* include/grub/gui_string_util.h (grub_gui_parse_color): Move to ...
* include/grub/video.h (grub_video_parse_color): ... here.

* grub-core/Makefile.core.def (kernel) [videoinkernel]: Add
video/colors.c.
(gfxmenu): Remove gfxmenu/named_colors.c.
(video) [videomodules]: Add video/colors.c.

Add a background_color command.

* grub-core/term/gfxterm.c (grub_gfxterm_background_color_cmd): New
function.
(GRUB_MOD_INIT): Register background_color command.
(GRUB_MOD_FINI): Unregister background_color command.
(redraw_screen_rect): Allow blend/replace of text layer to be
controlled independently from whether there is a background bitmap.
(grub_gfxterm_background_image_cmd): Change blend_text_bg when
changing bitmap.
2011-05-18 12:44:24 +01:00
Vladimir 'phcoder' Serbinenko cf02731e48 * grub-core/Makefile.core.def (ieee1275_fb): Use enable=powerpc_ieee1275
for cleanness.
2011-05-18 12:39:22 +02:00
Vladimir 'phcoder' Serbinenko 548937c6d6 merge mainline into ahci 2011-05-18 12:36:26 +02:00
Vladimir 'phcoder' Serbinenko e3a1073fd2 FreeDOS direct loading support.
* docs/grub.texi (Supported OS): Add FreeDOS.
	* grub-core/Makefile.core.def (freedos): New module.
	* grub-core/lib/i386/relocator.c (grub_relocator16_ebx): New extern
	variable.
	(grub_relocator16_boot): Handle %ebx.
	* grub-core/lib/i386/relocator16.S: Likewise.
	* grub-core/loader/i386/pc/freedos.c: New file.
2011-05-18 12:15:16 +02:00
Vladimir 'phcoder' Serbinenko 6ad6223e92 Unify grub-mkrescue (except powerpc) and grrub-mknetdir across platforms
* grub-core/Makefile.am (platform_DATA): Add modinfo.sh.
	* grub-core/modinfo.sh.in: New file.
	* grub-core/Makefile.core.def (modinfo.sh): New script.
	* util/grub-mknetdir.in: Use modinfo.sh.
	* util/grub-mkrescue.in: Likewise.
2011-05-18 01:38:01 +02:00
Vladimir 'phcoder' Serbinenko b772baedcd Reduce memory footprint on SGI by putting modules before the kernel
as opposed to after.

	* grub-core/Makefile.core.def (kernel): Increase linking address.
	(none_decompress): Likewise.
	(xz_decompress): Likewise.
	* grub-core/boot/mips/startup_raw.S: Use prewritten uncompression
	address.
	* grub-core/kern/mips/arc/init.c (grub_machine_init): Handle memory
	layout change.
	(grub_arch_modules_addr): New function.
	* grub-core/kern/mips/init.c (grub_arch_modules_addr): Moved from here...
	* grub-core/kern/mips/loongson/init.c (grub_arch_modules_addr): .. here
	* grub-core/kern/mips/qemu_mips/init.c (grub_arch_modules_addr): ... and
	here.
	* grub-core/kern/mips/startup.S (total_size): Rename to ...
	(grub_total_modules_size): ... this. Make global.
	[GRUB_MACHINE_ARC]: Don't attempt to move modules out of the bss.
	* include/grub/offsets.h (GRUB_KERNEL_MIPS_LOONGSON_UNCOMPRESSED_ADDR):
	New definition.
	(GRUB_KERNEL_MIPS_QEMU_MIPS_UNCOMPRESSED_ADDR): Likewise.
	(GRUB_KERNEL_MIPS_ARC_UNCOMPRESSED_ADDR): Likewise.
	(GRUB_KERNEL_MACHINE_UNCOMPRESSED_ADDR): Likewise.
	(GRUB_KERNEL_MIPS_ARC_LINK_ADDR): Increased.
	* util/grub-mkimage.c (image_target_desc): New flag
	PLATFORM_FLAGS_MODULES_BEFORE_KERNEL.
	(image_targets): Set PLATFORM_FLAGS_MODULES_BEFORE_KERNEL on mips-arc.
	(generate_image): Handle images with modules before kernel.
2011-05-17 21:15:54 +02:00
Vladimir 'phcoder' Serbinenko a228ec103a enable ATA on qemu-mips 2011-05-17 14:35:55 +02:00
Vladimir 'phcoder' Serbinenko 3666d5f636 merge mainline and various cleanups 2011-05-17 14:02:18 +02:00
Vladimir 'phcoder' Serbinenko 400b93718f SGI ARCS port.
* Makefile.util.def (libgrubmods.a): Add dvh.c.
	* conf/Makefile.common (CCASFLAGS_PLATFORM): Add -mips3 on all mips
	platforms.
	* configure.ac: New target mips-arc.
	* gentpl.py: Likewise.
	* grub-core/Makefile.am: Likewise.
	* grub-core/Makefile.core.def: Likewise.
	(xz_decompress): Remove -D GRUB_MACHINE_LINK_ADDR.
	(none_decompress): Likewise.
	(lsdev): New module.
	(datetime): Use lib/arc/datetime.c on ARC.
	(part_dvh): New module.
	* grub-core/commands/arc/lsdev.c: New file.
	* grub-core/disk/arc/arcdisk.c: Likewise.
	* grub-core/kern/mips/arc/init.c: Likewise.
	* grub-core/kern/mips/cache_flush.S: Don't flush non 4-byte
	aligned addresses.
	* grub-core/kern/mips/dl.c (grub_arch_dl_check_header): Fix bigendian
	support.
	(grub_arch_dl_relocate_symbols): Likewise.
	* grub-core/kern/mips/loongson/init.c (grub_get_rtc): Moved from here...
	* grub-core/kern/mips/init.c (grub_get_rtc): ... here.
	* grub-core/kern/mips/startup.S (grub_arch_cpuclock): Have on all
	platforms.
	* grub-core/lib/arc/datetime.c: New file.
	* grub-core/loader/mips/linux.c: Always include time.h. Don't include
	pci.h on non-loongson.
	(envp_off) [!GRUB_MACHINE_MIPS_LOONGSON]: Remove.
	(grub_linux_boot): Set unused registers to 0.
	(grub_cmd_linux) [!GRUB_MACHINE_MIPS_LOONGSON]: Remove envp.
	* grub-core/mmap/mips/loongson/uppermem.c: Moved from here ...
	* grub-core/mmap/mips/uppermem.c: ...here.
	* grub-core/partmap/dvh.c: New file.
	* grub-core/term/arc/console.c: Likewise.
	* grub-core/term/terminfo.c (ANSI_C0_STR): New const.
	(grub_terminfo_set_current): Add terminal "arc".
	(grub_terminfo_readkey): Support ARC sequences.
	* include/grub/arc/arc.h: New file.
	* include/grub/arc/console.h: Likewise.
	* include/grub/disk.h (grub_disk_dev_id): Add
	GRUB_DISK_DEVICE_ARCDISK_ID.
	* include/grub/mips/arc/kernel.h: New file.
	* include/grub/mips/arc/memory.h: Likewise.
	* include/grub/mips/arc/time.h: Likewise.
	* include/grub/mips/loongson/kernel.h (grub_halt): Moved from here ...
	* include/grub/mips/kernel.h (grub_halt): ... here.
	* include/grub/mips/loongson.h (GRUB_CPU_REGISTER_WRAP): Moved from
	here...
	* include/grub/mips/mips.h (GRUB_CPU_REGISTER_WRAP): ... here.
	(GRUB_CPU_LOONGSON_COP0_TIMER_COUNT): Moved from here ...
	* include/grub/mips/mips.h (GRUB_CPU_LOONGSON_COP0_TIMER_COUNT): .. here
	* include/grub/mips/loongson/kernel.h (grub_reboot): Removed redundant
	proto.
	* include/grub/mips/loongson/memory.h (GRUB_ARCH_LOWMEMVSTART): Moved
	from here ...
	* include/grub/mips/memory.h (GRUB_ARCH_LOWMEMVSTART): ... here.
	(GRUB_ARCH_LOWMEMPSTART): Moved from here ...
	* include/grub/mips/memory.h (GRUB_ARCH_LOWMEMPSTART): ... here.
	(GRUB_ARCH_LOWMEMMAXSIZE): Moved from here ...
	* include/grub/mips/memory.h (GRUB_ARCH_LOWMEMMAXSIZE): ... here.
	(GRUB_ARCH_HIGHMEMPSTART): Moved from here ...
	* include/grub/mips/memory.h (GRUB_ARCH_HIGHMEMPSTART): ... here.
	(grub_phys_addr_t): Moved from here ...
	* include/grub/mips/memory.h (grub_phys_addr_t): ... here.
	(grub_vtop): Moved from here ...
	* include/grub/mips/memory.h (grub_vtop): ... here.
	(grub_map_memory): Moved from here ...
	* include/grub/mips/memory.h (grub_map_memory): ... here.
	(grub_unmap_memory): Moved from here ...
	* include/grub/mips/memory.h (grub_unmap_memory): ... here.
	(grub_machine_mmap_iterate): Moved from here ...
	* include/grub/mips/memory.h (grub_machine_mmap_iterate): ... here.
	(grub_mmap_get_lower): Moved from here ...
	* include/grub/mips/memory.h (grub_mmap_get_lower): ... here.
	(grub_mmap_get_upper): Moved from here ...
	* include/grub/mips/memory.h (grub_mmap_get_upper): ... here.
	* include/grub/mips/loongson/time.h (grub_arch_cpuclock): Moved from
	here ...
	* include/grub/mips/time.h (grub_arch_cpuclock): ... here.
	* include/grub/mips/loongson/time.h (grub_get_rtc): Moved from
	here ...
	* include/grub/mips/time.h (grub_get_rtc): ... here.
	* include/grub/mips/loongson/time.h (grub_arch_cpuclock): Moved from
	here ...
	* include/grub/mips/time.h (grub_arch_cpuclock): ... here.
	* include/grub/mips/loongson/time.h (grub_cpu_idle): Moved from
	here ...
	* include/grub/mips/time.h (grub_cpu_idle): ... here.
	* include/grub/offsets.h (GRUB_KERNEL_MIPS_ARC_LINK_ADDR): New
	definition.
	(GRUB_KERNEL_MIPS_ARC_LINK_ALIGN): Likewise.
	(GRUB_KERNEL_MIPS_ARC_COMPRESSED_SIZE): Likewise.
	(GRUB_KERNEL_MIPS_ARC_UNCOMPRESSED_SIZE): Likewise.
	(GRUB_KERNEL_MIPS_ARC_TOTAL_MODULE_SIZE): Likewise.
	(GRUB_KERNEL_MIPS_ARC_PREFIX): Likewise.
	(GRUB_KERNEL_MIPS_ARC_PREFIX_END): Likewise.
	(GRUB_KERNEL_MIPS_ARC_MOD_ALIGN): Likewise.
	(GRUB_MACHINE_LINK_ADDR): Likewise.
	* include/grub/terminfo.h (GRUB_TERMINFO_READKEY_MAX_LEN): Increased
	to 6.
	* util/grub-install.in: Run dvhtool on ARC.
	* util/grub-mkimage.c (image_targets): Add mips-arc.
2011-05-17 09:17:38 +02:00
Vladimir 'phcoder' Serbinenko 0670a9751b merge mainline into ahci 2011-05-16 17:17:04 +02:00
Vladimir 'phcoder' Serbinenko 5470225d58 ROMFS support.
* Makefile.util.def (libgrubmods.a): Add romfs.
	* grub-core/Makefile.core.def (romfs): New module.
	* grub-core/fs/romfs.c: New file.
2011-05-15 12:01:03 +02:00
Vladimir 'phcoder' Serbinenko d4680a3556 Squashfs v4 support.
* Makefile.util.def (libgrubmods.a): Add squash4.
	* grub-core/Makefile.core.def (squash4): New module.
	* grub-core/fs/squash4.c: New file.
	* grub-core/io/gzio.c (grub_gzio): New members disk_input_off,
	disk_input_start, disk_input.
	(get_byte): Handle disk_input.
	(grub_zlib_disk_read): New function.
	* include/grub/deflate.h (grub_zlib_disk_read): New proto.
2011-05-15 11:58:22 +02:00
Feiran Zheng bcb18e748f * Makefile.util.def (libgrubmods.a): Add minix3.
* grub-core/Makefile.core.def (minix3): New module.
	* grub-core/fs/minix.c (GRUB_MINIX_MAGIC) [MODE_MINIX3]: New value.
	(GRUB_MINIX_BSIZE): Removed.
	(GRUB_MINIX_INODE_DIR_BLOCKS): New definition. All users updated.
	(grub_minix_ino_t): New type.
	(grub_minix_le_to_cpu_ino): New macro.
	(GRUB_MINIX_ZONE2SECT): New definition. All users updated.
	(grub_minix_sblock) [MODE_MINIX3]: Change for minix3.
	(grub_minix_data): New field block_size.
	(grub_minix_read_file): Handle 64-bit correctly.
	* grub-core/fs/minix3.c: New file.

	Also-By: Vladimir Serbinenko <phcoder@gmail.com>
2011-05-15 11:53:16 +02:00
Tristan Gingold 32297d5ff7 IA64 support.
* Makefile.util.def (libgrubmods.a): Add grub-core/kern/ia64/dl_helper.c
	* configure.ac: Add ia64-efi target.
	Probe for __ia64_trampoline, __udivsi3, __umoddi3, __udivdi3,
	__divsi3, __modsi3, __umodsi3, __moddi3 and __divdi3 symbols.
	* gentpl.py: Add ia64_efi platform.
	Rename x86_efi to efi and Add ia64-efi. All users updated.
	* grub-core/Makefile.am: Set KERNEL_HEADER_FILES for ia64-efi.
	* grub-core/Makefile.core.def (kernel.img): Add compile flags for ia64.
	Remove kern/generic/rtc_get_time_ms.c on EFI.
	Add kern/ia64/efi/startup.S, kern/ia64/efi/init.c, kern/ia64/dl.c,
	kern/ia64/dl_helper.c on ia64-efi.
	Add kern/emu/cache.c on emu.
	(linux): Use on loader/ia64/efi/linux.c on ia64.
	* grub-core/gensymlist.sh (grub_register_exported_symbols): Check
	whether symbol is a function.
	* grub-core/kern/dl.c [GRUB_MACHINE_EMU]: Include sys/mman.h.
	(grub_symbol): New field 'isfunc'.
	(grub_dl_resolve_symbol): Return whole symbol rather than just address.
	(grub_dl_register_symbol): New argument 'isfunc'. All users updated.
	(grub_dl_load_segments): Place all sections into the same region.
	[__ia64__]: Create trampolines and got.
	[GRUB_MACHINE_EMU]: Call mprotect.
	(grub_dl_resolve_symbols): Resolve symbol type as well.
	[__ia64__]: Create function descriptors.
	* grub-core/kern/efi/efi.c (grub_get_rtc): Renamed to ...
	(grub_rtc_get_time_ms): ... this. Expressions simplified.
	(grub_get_rtc): New function.
	* grub-core/kern/emu/cache.c [__ia64__]: New file.
	* grub-core/kern/emu/cache.S: Renamed to ...
	* grub-core/kern/emu/cache_s.S: ... this.
	[__ia64__]: Add a nop.
	* grub-core/kern/emu/full.c (grub_arch_dl_get_tramp_got_size)
	[__ia64__]: New function.
	* grub-core/kern/emu/lite.c [__ia64__]: Include ../ia64/dl.c.
	* grub-core/kern/ia64/dl.c: New file.
	* grub-core/kern/ia64/dl_helper.c: Likewise.
	* grub-core/kern/ia64/efi/init.c: New file.
	* grub-core/kern/ia64/efi/startup.S: Likewise.
	* grub-core/lib/efi/halt.c [__ia64__]: Don't try acpi.
	* grub-core/lib/ia64/longjmp.S: New file (from glibc).
	* grub-core/lib/ia64/setjmp.S: Likewise (from glibc).
	* grub-core/lib/setjmp.S [__ia64__]: Include ./ia64/setjmp.S.
	* grub-core/loader/ia64/efi/linux.c: New file.
	* include/grub/dl.h (GRUB_MOD_NAME): Redefined using C rather than asm.
	(GRUB_MOD_DEP): Likewise.
	(grub_dl) [__ia64__]: New fields got and tramp.
	(grub_dl): New field 'base'.
	(grub_dl_register_symbol): New argument isfunc. All users updated.
	(GRUB_IA64_DL_TRAMP_ALIGN): New definition.
	(GRUB_IA64_DL_TRAMP_SIZE): Likewise.
	(GRUB_IA64_DL_GOT_ALIGN): Likewise.
	(grub_ia64_dl_get_tramp_got_size): New proto.
	(GRUB_ARCH_DL_TRAMP_ALIGN) [__ia64__]: Likewise
	(GRUB_ARCH_DL_GOT_ALIGN) [__ia64__]: Likewise
	(grub_arch_dl_get_tramp_got_size) [__ia64__]: Likewise
	* include/grub/efi/api.h: Skip call wrappers on ia64.
	* include/grub/efi/pe32.h (GRUB_PE32_MACHINE_IA64): New definition.
	* include/grub/efi/time.h (GRUB_TICKS_PER_SECOND): Change to 1000.
	* include/grub/elf.h (ELF_ST_INFO): New definition.
	* include/grub/ia64/efi/kernel.h: New file.
	* include/grub/ia64/efi/memory.h: Likewise.
	* include/grub/ia64/efi/time.h: Likewise.
	* include/grub/ia64/kernel.h: Likewise.
	* include/grub/ia64/setjmp.h: Likewise (from glibc).
	* include/grub/ia64/time.h: New file.
	* include/grub/ia64/types.h: Likewise.
	* include/grub/libgcc.h (__udivsi3, __umodsi3, __umoddi3, __udivdi3,
	__moddi3, __divdi3, __divsi3, __modsi3, __ia64_trampoline):
	New protos.
	* include/grub/offsets.h (GRUB_KERNEL_IA64_EFI_PREFIX): New definition.
	(GRUB_KERNEL_IA64_EFI_PREFIX_END): Likewise.
	* include/grub/types.h (PRIxGRUB_ADDR): Likewise.
	* util/grub-mkimage.c (image_target_desc): New field pe_target.
	All users updated.
	(EFI64_HEADER_SIZE): New definition. All users updated.
	(image_targets): Add ia64-efi.
	* util/grub-mkimagexx.c (relocate_symbols): New arguments jumpers and
	jumpers_addr. All users updated.
	Create function descriptors.
	(count_funcs): New function.
	(unaligned_uint32): New struct.
	(MASK20): New definition.
	(MASK19): Likewise.
	(MASKF21): Likewise.
	(add_value_to_slot_20b): New function.
	(add_value_to_slot_21_real): Likewise.
	(add_value_to_slot_21): Likewise.
	(ia64_kernel_trampoline): New struct.
	(nopm): New variable.
	(jump): Likewise.
	(make_trampoline): New function.
	(relocate_addresses): Handle ia64.
	(make_reloc_section): Likewise.
	(load_image): Likewise.

	Also-By: Robert Millan <rmh.grub@aybabtu.com>

	Also-By: Vladimir Serbinenko <phcoder@gmail.com>
2011-05-15 11:22:59 +02:00
Vladimir 'phcoder' Serbinenko bee1aeb9a1 merge mainline into sgi 2011-05-15 02:23:36 +02:00
Vladimir 'phcoder' Serbinenko 5d063cdc10 Fuloong support.
* configure.ac: Rename yeeloong platform to loongson. All users updated.
	* grub-core/Makefile.core.def (fwstart_fuloong): New image.
	* grub-core/boot/mips/loongson/fuloong.S: New file.
	* grub-core/boot/mips/loongson/fwstart.S: Wait for CS5536 to come up.
	Explicitly init CS5536.
	[FULOONG]: Don't use serial until CS5536 is available.
	Set GPIO based on dumps.
	(serial_hw_init) [FULOONG]: Handle CS5536 parts.
	[FULOONG]: Handle GPIO and memory controller differences.
	Parse machine type in $a2.
	* grub-core/boot/mips/startup_raw.S: Determine and save the
	architecture.
	* grub-core/bus/cs5536.c (gpiodump): Move to fwstart.S.
	(grub_cs5536_init_geode): Remove gpio part. Conditionalise DIVIL
	init on architecture type.
	* grub-core/kern/mips/loongson/init.c (grub_machine_init): Init
	SIS315E. Don't init at_keyboard on fuloong.
	(grub_halt): Support Fuloong.
	* grub-core/kern/mips/startup.S [LOONGSON]: Save $s7.
	* grub-core/loader/mips/linux.c (LOONGSON_MACHTYPE): Removed.
	(loongson_machtypes): New array.
	(grub_cmd_linux) [GRUB_MACHINE_MIPS_LOONGSON]: Pass the right machine
	type.
	* grub-core/term/ns8250.c (serial_get_divisor): New parameter port and
	config. All users updated. Handle CS5536 serial.
	* grub-core/term/serial.c (grub_serial_register): Conditionalise
	default port on machine type. Register serial as inactive.
	* grub-core/video/sis315pro.c: New file.
	* include/grub/cs5536.h (GRUB_CS5536_MSR_MAILBOX_CONFIG_ENABLED): New
	definition.
	(GRUB_CS5536_MSR_MAILBOX_CONFIG): Likewise.
	(GRUB_CS5536_MSR_DIVIL_LEG_IO_UART1_COM1): Likewise.
	(GRUB_CS5536_MSR_DIVIL_LEG_IO_UART2_COM3): Likewise.
	(GRUB_CS5536_MSR_DIVIL_UART1_CONF): Likewise.
	(GRUB_CS5536_MSR_DIVIL_UART2_CONF): Likewise.
	* include/grub/mips/loongson.h (GRUB_CPU_LOONGSON_SHUTDOWN_GPIO): Rename
	to ...
	(GRUB_CPU_YEELOONG_SHUTDOWN_GPIO): ... this.
	* include/grub/mips/loongson/kernel.h (GRUB_ARCH_MACHINE_YEELOONG): New
	definition.
	(GRUB_ARCH_MACHINE_FULOONG): Likewise.
	(grub_arch_machine): New extern var.
	* include/grub/mips/loongson/serial.h
	(GRUB_MACHINE_SERIAL_DIVISOR_115200): Renamed to ...
	(GRUB_MACHINE_SERIAL_PORT0_DIVISOR_115200): ... this.
	(GRUB_MACHINE_SERIAL_PORT): Renamed to ...
	(GRUB_MACHINE_SERIAL_PORT0): ... this.
	(GRUB_MACHINE_SERIAL_PORT2_DIVISOR_115200): New definition.
	(GRUB_MACHINE_SERIAL_PORT1): Likewise.
	(GRUB_MACHINE_SERIAL_PORT2): Likewise.
	(GRUB_MACHINE_SERIAL_PORTS): Include ports 1 and 2.
	* include/grub/term.h (grub_term_register_input_inactive): New inline
	function.
	(grub_term_register_output_inactive): Likewise.
	* include/grub/video.h (grub_video_driver_id): New value
	GRUB_VIDEO_DRIVER_SIS315PRO.
	* util/grub-mkimage.c (image_target_desc): Rename name to dirname.
	New field "names". All users updated.
	New field value IMAGE_FULOONG_FLASH.
	(generate_image): USe separate fwstart hashes for yeeloong and fuloong.
2011-05-15 01:43:44 +02:00
Vladimir 'phcoder' Serbinenko 8906c3dd40 sgi support 2011-05-13 16:36:05 +02:00
Manoel R. Abranches d8123bfb54 Correct some compile erros. 2011-05-12 13:20:43 -03:00
Vladimir 'phcoder' Serbinenko 7216a1bff3 Set EFI ticks to 1000Hz simplifying much of the code and avoiding cotsly division 2011-05-08 17:05:47 +02:00
Vladimir 'phcoder' Serbinenko 5452733f35 more or less functional ia64 grub-mkimage 2011-05-08 12:39:08 +02:00
Manoel Rebelo Abranches 90eb90e24c Merge mainline. 2011-05-05 12:12:22 -03:00
Vladimir 'phcoder' Serbinenko 1a1f408f20 geli support 2011-04-24 00:00:29 +02:00
Vladimir 'phcoder' Serbinenko 8585e54bec factor cryptodisk part out 2011-04-23 18:00:42 +02:00
Vladimir 'phcoder' Serbinenko 0aaa85f1a0 merge lazy into luks 2011-04-22 15:13:12 +02:00
Vladimir 'phcoder' Serbinenko 4defebbec8 automatic raid members addition 2011-04-22 13:55:30 +02:00
Colin Watson 1eb44ae37e merge trunk 2011-04-21 11:07:10 +01:00
Michael Gorven 7217f315d3 LUKS support based on work of Michael Gorven with some code from Clemens Fruhwirth and heavily cleaned up by me (phcoder)
Also-By: Clemens Fruhwirth <clemens@endorphin.org>

	Also-By: Vladimir Serbinenko <phcoder@gmail.com>
2011-04-21 11:14:29 +02:00
Vladimir 'phcoder' Serbinenko 48fe18dcf2 exfat reader 2011-04-11 18:13:00 +02:00
Feiran Zheng 3dd3dd335f minix3fs support 2011-04-11 08:16:13 +02:00
Vladimir 'phcoder' Serbinenko c7ba1ba62e merge mainline into butter 2011-04-11 07:56:31 +02:00
Manoel Rebelo Abranches 50ee5d686d Merge mainline. 2011-04-01 04:45:37 -03:00
Vladimir 'phcoder' Serbinenko f4727da93f Use libgeom on FreeBSD to detect partitions.
* Makefile.util.def (grub-mkimage): Add LIBGEOM to ldadd.
	(grub-mkrelpath): Likewise.
	(grub-script-check): Likewise.
	(grub-editenv): Likewise.
	(grub-mkpasswd-pbkdf2): Likewise.
	(grub-fstest): Likewise.
	(grub-mkfont): Likewise.
	(grub-mkdevicemap): Likewise.
	(grub-probe): Likewise.
	(grub-setup): Likewise.
	(grub-ofpathname): Likewise.
	(grub-mklayout): Likewise.
	(example_unit_test): Likewise.
	(grub-menulst2cfg): Likewise.
	* grub-core/Makefile.core.def (grub-emu): Likewise.
	(grub-emu-lite): Likewise.
	* configure.ac: Check for -lgeom on FreeBSD and set LIBGEOM.
	* grub-core/kern/emu/hostdisk.c [FreeBSD]: Include libgeom.h. Don't
	define HAVE_DIOCGDINFO.
	(follow_geom_up) [FreeBSD]: New function.
	(find_partition_start) [FreeBSD]: Rewritten using follow_geom_up.
	(convert_system_partition_to_system_disk) [FreeBSD]: Likewise.
	(grub_util_biosdisk_get_grub_dev) [FreeBSD]: Use FreeBSD path
	unconditionally of HAVE_DIOCGDINFO.
2011-03-26 12:59:02 +01:00
Vladimir 'phcoder' Serbinenko 54da1febce Rename mipsel-yeeloong to mipsel-loongson 2011-02-19 13:18:05 +01:00
Colin Watson 28f9509eb7 merge trunk 2011-02-17 14:51:11 +00:00
Vladimir 'phcoder' Serbinenko a9fa2a22d7 Integrate Fuloong firmware port into build system and grub-mkimage 2011-01-24 02:20:04 +01:00
Vladimir 'phcoder' Serbinenko 01b08a0f15 initial SIS315PRO support 2011-01-18 13:44:16 +01:00
Vladimir 'phcoder' Serbinenko 1d955d0098 * grub-core/Makefile.core.def (fwstart): Add lost LDFLAGS. 2011-01-14 19:21:06 +01:00
Vladimir 'phcoder' Serbinenko f440c33fd2 Make qemu-mips compile again. Still no grub-mkimage support 2011-01-14 17:37:11 +01:00
Vladimir 'phcoder' Serbinenko 8fc0a24576 * grub-core/Makefile.core.def (ieee1275_fb): Disable on sparc.
It doesn't work well there.
2011-01-12 11:55:52 +01:00
Colin Watson 6b978c4f04 merge trunk 2011-01-11 10:00:45 -06:00
Szymon Janc 25953e1055 Improve loaders' kernel command line handling.
* grub-core/lib/cmdline.c: New file.
	* include/grub/lib/cmdline.h: Likewise.
	* grub-core/loader/i386/linux.c (grub_cmd_linux): Use
	grub_create_loader_cmdline to create kernel command line.
	* grub-core/loader/i386/pc/linux.c (grub_cmd_linux): Likewise.
	* grub-core/loader/powerpc/ieee1275/linux.c (grub_cmd_linux): Likewise.
	* grub-core/loader/sparc64/ieee1275/linux.c (grub_cmd_linux): Likewise.
	* grub-core/Makefile.core.def (linux16): Add lib/cmdline.c on i386_pc.
	(linux): Add lib/cmdline.c on common.
2011-01-07 17:09:39 +01:00
Colin Watson 944404efb8 merge trunk 2011-01-04 15:41:07 +00:00
phcoder bea3358389 First handling of ia64-efi in grub-mkimage 2011-01-03 13:46:36 +01:00
phcoder c18271ed00 Fix compilation errors 2011-01-03 02:28:14 +01:00
phcoder 0a2b2cdc95 Fix autogen 2011-01-03 00:30:26 +01:00
Vladimir 'phcoder' Serbinenko 0f35c665e6 merge mainline to ia64 2011-01-03 00:04:39 +01:00
Vladimir 'phcoder' Serbinenko 7edf63fce6 merge ia64-emu into ia64 2011-01-02 23:55:50 +01:00
Vladimir 'phcoder' Serbinenko 6f49d0aacb Add missing cache.c 2011-01-01 15:53:31 +01:00
Vladimir 'phcoder' Serbinenko b28fd807eb freedos support 2010-12-26 00:38:20 +01:00
Vladimir 'phcoder' Serbinenko de2690be7c merge mainline into ahci 2010-12-24 16:16:01 +01:00
Colin Watson 1c95b6d2bf Move video/colors.c into video.mod. 2010-12-23 12:11:44 +00:00
Vladimir 'phcoder' Serbinenko ac9ef7eef9 plan9 subpartition support 2010-12-20 01:18:21 +01:00
Vladimir 'phcoder' Serbinenko 70e8145a7b Plan9 support 2010-12-19 16:10:26 +01:00
Vladimir 'phcoder' Serbinenko 29184e9312 romfs support 2010-12-15 19:49:35 +01:00
Colin Watson 52832c554c Move gfxmenu color handling to video, so that gfxterm can use it
too.

* grub-core/gfxmenu/named_colors.c: Move to ...
* grub-core/video/colors.c: ... here.  Rename
grub_gui_get_named_color to grub_video_get_named_color.
* grub-core/gfxmenu/gui_string_util.c (my_isxdigit): Move to ...
* grub-core/video/colors.c (my_isxdigit): ... here.
* grub-core/gfxmenu/gui_string_util.c (parse_hex_color_component):
Move to ...
* grub-core/video/colors.c (parse_hex_color_component): ... here.
* grub-core/gfxmenu/gui_string_util.c (grub_gui_parse_color): Move
to ...
* grub-core/video/colors.c (grub_video_parse_color): ... here.

* include/grub/gui.h (grub_gui_color_t): Move to ...
* include/grub/video.h (grub_video_rgba_color_t): ... here.
* include/grub/gui.h (grub_gui_color_rgb): Move to ...
* include/grub/video.h (grub_video_rgba_color_rgb): ... here.
* include/grub/gui.h (grub_gui_map_color): Move to ...
* include/grub/video.h (grub_video_map_rgba_color): ... here.
* include/grub/gui_string_util.h (grub_gui_get_named_color): Move
to ...
* include/grub/video.h (grub_video_get_named_color): ... here.
* include/grub/gui_string_util.h (grub_gui_parse_color): Move to ...
* include/grub/video.h (grub_video_parse_color): ... here.

* grub-core/Makefile.core.def (kernel) [videoinkernel]: Add
video/colors.c.
(gfxmenu): Remove gfxmenu/named_colors.c.
(video_colors) [videomodules]: New module, containing
video/colors.c.
2010-12-10 16:45:58 +00:00
Vladimir 'phcoder' Serbinenko 332fa36887 some squash4 code. Works only in very easy cases. 2010-12-08 21:22:46 +01:00
Robert Millan bf78d5b251 2010-12-01 Robert Millan <rmh@gnu.org>
* grub-core/fs/zfs/zfs.c: New file.
	* grub-core/fs/zfs/zfs_fletcher.c: Likewise.
	* grub-core/fs/zfs/zfs_lzjb.c: Likewise.
	* grub-core/fs/zfs/zfs_sha256.c: Likewise.
	* grub-core/fs/zfs/zfsinfo.c: Likewise.
	
	* include/grub/zfs/dmu.h: Likewise.
	* include/grub/zfs/dmu_objset.h: Likewise.
	* include/grub/zfs/dnode.h: Likewise.
	* include/grub/zfs/dsl_dataset.h: Likewise.
	* include/grub/zfs/dsl_dir.h: Likewise.
	* include/grub/zfs/sa_impl.h: Likewise.
	* include/grub/zfs/spa.h: Likewise.
	* include/grub/zfs/uberblock_impl.h: Likewise.
	* include/grub/zfs/vdev_impl.h: Likewise.
	* include/grub/zfs/zap_impl.h: Likewise.
	* include/grub/zfs/zap_leaf.h: Likewise.
	* include/grub/zfs/zfs.h: Likewise.
	* include/grub/zfs/zfs_acl.h: Likewise.
	* include/grub/zfs/zfs_znode.h: Likewise.
	* include/grub/zfs/zil.h: Likewise.
	* include/grub/zfs/zio.h: Likewise.
	* include/grub/zfs/zio_checksum.h: Likewise.
	
	* Makefile.util.def: Build ZFS into libgrubmods.
	* grub-core/Makefile.core.def: Build zfs.mod.
2010-12-01 22:42:11 +01:00
Vladimir 'phcoder' Serbinenko 3836e89df1 Add crc32c for btrfs 2010-12-01 01:22:55 +01:00
Colin Watson 5a4072785b * grub-core/Makefile.core.def (xz_decompress): Move -lgcc from
ldflags to ldadd, to fix link line ordering.
(none_decompress): Likewise.
2010-11-24 19:32:49 +00:00
Colin Watson 3030d8ec49 * grub-core/Makefile.core.def (kernel): Add kern/emu/cache.S for emu
platforms.
(grub-emu-lite): Remove kern/emu/cache.S.
2010-11-24 12:07:14 +00:00
Vladimir 'phcoder' Serbinenko 03f80960cf Don't add -lgcc on i386 and x86_64.
* configure.ac (LIBS): Don't add -lgcc on i386 and x86_64.
	* conf/Makefile.common (LDADD_KERNEL): Likewise.
	* grub-core/Makefile.core.def (kernel): Use LDADD_KERNEL.
2010-11-14 23:36:20 +01:00
Vladimir 'phcoder' Serbinenko dc5aeea5b9 merge mainline into net 2010-10-25 13:19:10 +02:00
Szymon Janc c5dc16905a Make enable of disk cache statistics code configurable.
* configure.ac: --enable-cache-stats added.
	* config.h.in (DISK_CACHE_STATS): New define.
	* grub-core/Makefile.core.def (cacheinfo): New command.
	* include/grub/disk.h(grub_disk_cache_get_performance): New function.
	* grub-core/commands/cacheinfo.c: New file.
	* grub-core/commands/minicmd.c (grub_rescue_cmd_info): Updated and
	moved to cacheinfo.c.
	* grub-core/kern/disk.c: Use DISK_CACHE_STATS to disable disk cache
	debug code.
	* include/grub/disk.h: Likewise.
2010-10-06 19:57:01 +02:00
Vladimir 'phcoder' Serbinenko ee74fa4822 Put terminfo into core on ieee1275 and yeeloong (needed for console).
* gentpl.py: New groups terminfoinkernel and terminfomodule.
	* grub-core/Makefile.am (KERNEL_HEADER_FILES): Include extcmd.h, arg.h
	and terminfo.h when needed.
	* grub-core/Makefile.core.def (kernel): Include term/terminfo.c,
	term/tparm.c, commands/extcmd.c, lib/arg.c on terminfokernel.
	(terminfo): Enable only on terminfokernel.
	(extcmd): Likewise.
	* include/grub/extcmd.h: Add missing EXPORT_FUNC.
	* include/grub/lib/arg.h: Likewise.
	* grub-core/term/ieee1275/ofconsole.c (grub_ofconsole_dimensions): Fix
	incorrect usage of ->.
2010-09-30 17:50:01 +02:00
Vladimir 'phcoder' Serbinenko 6d0fa83c79 Support xz compression on yeeloong.
* Makefile.util.def (grub-mkimage): Add $(LIBLZMA).
	* configure.ac: Check for LZMA.
	* grub-core/Makefile.core.def (xz_decompress): New target.
	(none_decompress): Likewise.
	* grub-core/boot/decompressor/minilib.c: New file.
	* grub-core/boot/decompressor/none.c: Likewise.
	* grub-core/boot/decompressor/xz.c: Likewise.
	* grub-core/kern/mips/cache.S: Change to noreorder nomacro.
	* grub-core/kern/mips/cache_flush.S: Likewise.
	* grub-core/kern/i386/pc/lzma_decode.S: Remove dead code.
	* grub-core/kern/mips/startup.S: Move first stage to ...
	* grub-core/boot/mips/startup_raw.S: ...here. Change to noreorder
	nomacro.
	* grub-core/kern/mips/startup.S: Change to noreorder nomacro.
	* grub-core/lib/mips/relocator_asm.S: Change to noreorder nomacro.
	* grub-core/lib/xzembed/xz_dec_bcj.c [GRUB_EMBED_DECOMPRESSOR]:
	Allocate statically.
	* grub-core/lib/xzembed/xz_dec_lzma2.c [GRUB_EMBED_DECOMPRESSOR]:
	Allocate statically or use scratch. Don't check CRC32.
	* grub-core/lib/xzembed/xz_dec_stream.c [GRUB_EMBED_DECOMPRESSOR]:
	Allocate statically. Don't check CRC32.
	* include/grub/decompressor.h: New file.
	* include/grub/offsets.h (GRUB_KERNEL_MIPS_YEELOONG_RAW_SIZE):
	Removed.
	(GRUB_KERNEL_MIPS_YEELOONG_UNCOMPRESSED_SIZE): New field.
	(GRUB_KERNEL_MIPS_YEELOONG_TOTAL_MODULE_SIZE): Adjusted.
	(GRUB_KERNEL_MIPS_YEELOONG_PREFIX): Likewise.
	(GRUB_KERNEL_MIPS_YEELOONG_PREFIX_END): Likewise.
	(GRUB_KERNEL_MACHINE_UNCOMPRESSED_SIZE): New define.
	* util/grub-mkimage.c (grub_compression_t): New type.
	(PLATFORM_FLAGS_DECOMPRESSORS): New flag.
	(image_target_desc): New field default_compression.
	(image_targets): Adjust yeeloong targets.
	(compress_kernel_xz) [HAVE_LIBLZMA]: New function.
	(compress_kernel): New parameter comp.
	(generate_image): Likewise. Handle new compression case.
	(options): New option --compression
	(help): Likewise.
	(main): Handle new option.
2010-09-23 02:10:44 +02:00
Vladimir 'phcoder' Serbinenko ce3a2ec025 Remove some dead code 2010-09-22 20:34:20 +02:00
Vladimir 'phcoder' Serbinenko 760a7e5aed Merge mainline into net 2010-09-22 20:13:00 +02:00
Vladimir 'phcoder' Serbinenko 90451bb1c9 networking in grub-emu 2010-09-22 17:14:43 +02:00
Vladimir 'phcoder' Serbinenko 758194b076 Allow compression algorithm specification 2010-09-21 20:30:28 +02:00
Vladimir 'phcoder' Serbinenko f8926c32b4 C part of decompressor 2010-09-21 11:22:52 +02:00
Vladimir 'phcoder' Serbinenko c5b4cd370e asm part for mips decompressor 2010-09-21 10:14:08 +02:00
Vladimir 'phcoder' Serbinenko 1e8d555b7d Split mdraid.mod into mdraid09.mod and mdraid1x.mod.
* Makefile.util.def (libgrub.a): Add grub-core/disk/mdraid1x_linux.c.
	* grub-core/Makefile.core.def (mdraid): Renamed to ...
	(mdraid09): ... this.
	(mdraid1x): New module.
	* grub-core/disk/mdraid_linux.c: Move 1.x parts ...
	* grub-core/disk/mdraid1x_linux.c: ...here. All users updated.
2010-09-20 20:09:31 +02:00
Tristan Gingold 3dccbe4bbb * grub-core/commands/efi/lsefimmap.c: New file.
* grub-core/Makefile.core.def (lsefimmap): New module.
	* include/grub/efi/api.h (PRIxGRUB_EFI_UINTN_T): New definition.

	Also-By: Robert Millan <rmh.grub@aybabtu.com>

	Also-By: Vladimir Serbinenko <phcoder@gmail.com>
2010-09-20 17:59:25 +02: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
Vladimir 'phcoder' Serbinenko 774b7ca021 merge mainline into gingold3 2010-09-20 12:23:10 +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 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
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
Vladimir 'phcoder' Serbinenko 685475e596 Fix yeeloong compilation 2010-09-18 13:49:39 +02:00
Manoel R. Abranches 7bb47706c9 Merge grub_net into net. Compiles but is broken right now. 2010-09-16 21:57:31 +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
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 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 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 fb53b340aa Fix sparc64.
* configure.ac (GRUB_KERNEL_MACHINE_LINK_ADDR): Removed.
	* grub-core/Makefile.core.def (kernel): Make ldflags just use the
	right address. Add sparc64_ieee1275_ldflags.
	* grub-core/loader/sparc64/ieee1275/linux.c: Remove leftover include.
	* util/grub-mkimagexx.c (locate_sections): Correct grub_host_to_target32
	to grub_host_to_target_addr
	(load_image): Likewise.
2010-09-13 16:49:50 +02:00
Vladimir 'phcoder' Serbinenko 9d2be652d4 videoinfo on non-vbe.
* grub-core/Makefile.core.def (vbeinfo): Removed.
	(vbetest): Removed.
	(videoinfo): New module.
	* grub-core/commands/i386/pc/vbeinfo.c: Removed.
	* grub-core/commands/i386/pc/vbetest.c: Removed.
	* grub-core/commands/videoinfo.c: New file.
	* grub-core/commands/videotest.c (grub_cmd_videotest): Support mode
	specification.
	(grub_cmd_videotest) [GRUB_MACHINE_PCBIOS]: Load vbe.mod when invoked
	as vbetest.
	(GRUB_MOD_INIT) [GRUB_MACHINE_PCBIOS]: New command vbetest.
	(GRUB_MOD_FINI) [GRUB_MACHINE_PCBIOS]: Unregister vbetest.
	* grub-core/video/efi_gop.c (grub_video_gop_fill_mode_info): Fill
	mode_number. New parameter mode. All users updated.
	(grub_video_gop_iterate): New function.
	(grub_video_efi_gop): New member iterate.
	* grub-core/video/i386/pc/vbe.c (framebuffer): Removed leftover fields.
	(grub_vbe_set_video_mode): Remove setting useless fields.
	(vbe2videoinfo): New function.
	(grub_video_vbe_iterate): Likewise.
	(grub_video_vbe_setup): Use vbe2videoinfo.
	(grub_video_vbe_print_adapter_specific_info): New function.
	(grub_video_vbe_adapter): New fields iterate and
	print_adapter_specific_info.
	* include/grub/video.h (GRUB_VIDEO_MODE_*): Transform into enum.
	All users updated.
	(grub_video_mode_info): New field mode_number.
	(grub_video_adapter): New fields iterate and
	print_adapter_specific_info.
2010-09-13 13:38:13 +02:00