Commit graph

1291 commits

Author SHA1 Message Date
Vladimir 'phcoder' Serbinenko
ba102053ce Support ZFS embedding.
* grub-core/fs/zfs/zfs.c (grub_zfs_embed): New function.
	(grub_zfs_fs): Register grub_zfs_embed.
2011-11-12 21:46:52 +01:00
Vladimir 'phcoder' Serbinenko
aa94b87027 Fix MIPS compilation.
* grub-core/boot/mips/startup_raw.S: Use GRUB_DECOMPRESSOR_*
	* include/grub/offsets.h: Rename decompressor fields from
	GRUB_KERNEL_* to GRUB_DECOMPRESSOR_*.
	* util/grub-mkimage.c (image_targets): Use new names.
2011-11-12 21:38:04 +01:00
Vladimir 'phcoder' Serbinenko
5fbdac149b Defer multiboot device parsing until we're in compressed part.
* grub-core/boot/i386/pc/lnxboot.S: Remove setting dos_part and
	bsd_part. setdevice has fallen into disuse.
	* grub-core/boot/i386/pc/startup_raw.S (dos_part): Removed.
	(bsd_part): Likewise.
	(boot_dev): New variable.
	(multiboot_trampoline): Don't parse multiboot device.
	Pass multiboot device in %edx.
	* grub-core/disk/i386/pc/biosdisk.c (GRUB_MOD_INIT): Parse
	grub_boot_device.
	* grub-core/kern/i386/pc/init.c (grub_machine_get_bootlocation):
	Likewise.
	* grub-core/kern/i386/pc/startup.S: Save edx.
	(grub_boot_drive): Removed.
	(grub_install_dos_part): Likewise.
	(grub_install_bsd_part): Likewise.
	(grub_boot_device): New variable.
	* include/grub/i386/pc/kernel.h (grub_install_dos_part): Removed.
	(grub_install_bsd_part): Likewise.
	(grub_boot_drive): Likewise.
	(grub_boot_device): New variable.
	* include/grub/offsets.h (GRUB_KERNEL_I386_PC_INSTALL_DOS_PART):
	Removed.
	(GRUB_KERNEL_I386_PC_INSTALL_BSD_PART): Likewise.
	(GRUB_KERNEL_I386_PC_REED_SOLOMON_REDUNDANCY): Moved lower.
	(GRUB_KERNEL_MACHINE_INSTALL_BSD_PART): Removed.
	(GRUB_KERNEL_MACHINE_INSTALL_DOS_PART): Likewise.
	* util/grub-install.in: Remove redundant condition.
2011-11-12 21:12:52 +01:00
Vladimir 'phcoder' Serbinenko
691cbb5816 Fix bug introduced by previous commit.
* grub-core/boot/i386/pc/startup_raw.S: Compute RS start correctly.
2011-11-12 20:53:46 +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
2b23074a0c Move assembly code to C by using intwrap. It increases core size
by 88 bytes but improves compatibility and maintainability.

	* grub-core/kern/i386/pc/startup.S (grub_console_putchar): Moved to ...
	* grub-core/term/i386/pc/console.c (grub_console_putchar_real):
	... here. Translated to C.
	* grub-core/kern/i386/pc/startup.S (grub_console_getkey): Moved to ...
	* grub-core/term/i386/pc/console.c (grub_console_getkey):
	... here. Translated to C.
	* grub-core/kern/i386/pc/startup.S (grub_console_getxy): Moved to ...
	* grub-core/term/i386/pc/console.c (grub_console_getxy):
	... here. Translated to C.
	* grub-core/kern/i386/pc/startup.S (grub_console_gotoxy): Moved to ...
	* grub-core/term/i386/pc/console.c (grub_console_gotoxy):
	... here. Translated to C.
	* grub-core/kern/i386/pc/startup.S (grub_console_cls): Moved to ...
	* grub-core/term/i386/pc/console.c (grub_console_cls):
	... here. Translated to C.
	* grub-core/kern/i386/pc/startup.S (grub_console_setcursor): Moved to ..
	* grub-core/term/i386/pc/console.c (grub_console_setcursor):
	... here. Translated to C.
	* grub-core/kern/i386/pc/startup.S (grub_get_rtc): Moved to ..
	* grub-core/kern/i386/pc/init.c (grub_get_rtc): ... here.
	Translated to C.
	* grub-core/term/i386/pc/console.c (int10_9): New function.
	(grub_console_putchar): Likewise.
	* include/grub/i386/pc/console.h: Removed the not anymore shared
	functions.
2011-11-12 16:29:04 +01:00
Vladimir 'phcoder' Serbinenko
678f4b6713 Move grub_chainloader_real_boot out of the kernel.
* grub-core/Makefile.am: Remove machine/loader.h.
	* grub-core/kern/i386/pc/startup.S (grub_chainloader_real_boot):
	Removed.
	* grub-core/lib/i386/relocator.c (grub_relocator16_esi): New extern
	variable.
	(grub_relocator16_keep_a20_enabled): Likewise.
	(grub_relocator16_boot): Fill new variables.
	* grub-core/lib/i386/relocator16.S: Add gate a20 handling.
	* grub-core/loader/i386/pc/chainloader.c (grub_chainloader_boot): Use
	relocator.
	(grub_chainloader_unload): Likewise.
	(grub_chainloader_cmd): Likewise.
	* include/grub/i386/pc/loader.h: Removed.
	* include/grub/i386/relocator.h (grub_relocator16_state): Add a20
	and esi. All initialisers updated.
2011-11-12 15:46:50 +01:00
Vladimir 'phcoder' Serbinenko
10f0117bf9 * grub-core/commands/efi/fixvideo.c: Gettextize.
* grub-core/commands/hashsum.c: Likewise.
	* grub-core/commands/i386/cmostest.c: Likewise.
	* grub-core/commands/i386/pc/drivemap.c: Likewise.
	* grub-core/commands/i386/pc/lsapm.c: Likewise.
	* grub-core/commands/i386/pc/sendkey.c: Likewise.
	* grub-core/commands/lsmmap.c: Likewise.
	* grub-core/commands/menuentry.c: Likewise.
	* grub-core/commands/mips/loongson/lsspd.c: Likewise.
	* grub-core/commands/setpci.c: Likewise.
	* grub-core/loader/i386/bsd.c: Likewise.
	* grub-core/loader/i386/linux.c: Likewise.
	* util/getroot.c: Likewise.
	* util/grub-editenv.c: Likewise.
	* util/grub-fstest.c: Likewise.
	* util/grub-mkfont.c: Likewise.
	* util/grub-mkimage.c: Likewise.
	* util/grub-mkpasswd-pbkdf2.c: Likewise.
	* util/grub-pe2elf.c: Likewise.
	* util/grub-probe.c: Likewise.
	* util/grub-setup.c: Likewise.
	* util/ieee1275/ofpath.c: Likewise.
	* util/misc.c: Likewise.
	* util/raid.c: Likewise.
2011-11-12 00:34:14 +01:00
Vladimir 'phcoder' Serbinenko
119d11c885 Replace grub_fatal with normal errors in i386 linux loader.
* grub-core/loader/i386/linux.c (find_efi_mmap_size): Return 0 on error.
	(allocate_pages): Check find_efi_mmap_size return value.
	(grub_e820_add_region): Return error.
	(grub_linux_boot): Check mmap return value.
2011-11-11 22:35:09 +01:00
Vladimir 'phcoder' Serbinenko
6e0632e28c * grub-core/commands/acpihalt.c: Gettextized.
* grub-core/commands/cacheinfo.c: Likewise.
	* grub-core/commands/cmp.c: Likewise.
	* grub-core/commands/efi/loadbios.c: Likewise.
	* grub-core/commands/gptsync.c: Likewise.
	* grub-core/commands/ieee1275/suspend.c: Likewise.
	* grub-core/commands/legacycfg.c: Likewise.
	* grub-core/commands/memrw.c: Likewise.
	* grub-core/commands/minicmd.c: Likewise.
	* grub-core/commands/parttool.c: Likewise.
	* grub-core/commands/time.c: Likewise.
	* grub-core/commands/videoinfo.c: Likewise.
	* grub-core/disk/geli.c: Likewise.
	* grub-core/disk/i386/pc/biosdisk.c: Likewise.
	* grub-core/disk/luks.c: Likewise.
	* grub-core/disk/lvm.c: Likewise.
	* grub-core/font/font_cmd.c: Likewise.
	* grub-core/fs/zfs/zfscrypt.c: Likewise.
	* grub-core/fs/zfs/zfsinfo.c: Likewise.
	* grub-core/gfxmenu/view.c: Likewise.
	* grub-core/kern/emu/hostdisk.c: Likewise.
	* grub-core/kern/emu/main.c: Likewise.
	* grub-core/kern/emu/misc.c: Likewise.
	* grub-core/kern/emu/mm.c: Likewise.
	* grub-core/kern/mips/arc/init.c: Likewise.
	* grub-core/kern/mips/loongson/init.c: Likewise.
	* grub-core/kern/partition.c: Likewise.
	* grub-core/lib/i386/halt.c: Likewise.
	* grub-core/lib/mips/arc/reboot.c: Likewise.
	* grub-core/lib/mips/loongson/reboot.c: Likewise.
	* grub-core/loader/i386/pc/chainloader.c: Likewise.
	* grub-core/loader/i386/xnu.c: Likewise.
	* grub-core/loader/multiboot.c: Likewise.
	* grub-core/net/bootp.c: Likewise.
	* grub-core/net/net.c: Likewise.
	* grub-core/normal/term.c: Likewise.
	* grub-core/partmap/bsdlabel.c: Likewise.
	* grub-core/parttool/msdospart.c: Likewise.
	* grub-core/term/gfxterm.c: Likewise.
	* grub-core/term/terminfo.c: Likewise.
	* grub-core/video/i386/pc/vbe.c: Likewise.
	* util/grub-menulst2cfg.c: Likewise.
	* util/grub-mkdevicemap.c: Likewise.
	* util/grub-mklayout.c: Likewise.
	* util/grub-mkrelpath.c: Likewise.
	* util/grub-script-check.c: Likewise.
	* util/ieee1275/grub-ofpathname.c: Likewise.
	* util/resolve.c: Likewise.
2011-11-11 21:44:56 +01:00
Vladimir 'phcoder' Serbinenko
12d4f965cd Support %1$d syntax.
* tests/printf_unit_test.c: New file.
	* Makefile.util.def (printf_test): New test.
	* grub-core/kern/misc.c (grub_vsnprintf_real): Support %1$d syntax.
2011-11-11 21:14:41 +01:00
Vladimir 'phcoder' Serbinenko
c76b541762 * grub-core/hook/datehook.c (grub_read_hook_datetime): Small stylistic
fix.
2011-11-11 21:03:49 +01:00
Vladimir 'phcoder' Serbinenko
df067ad13a * grub-core/efiemu/mm.c (grub_efiemu_mmap_fill): Change printf into
dprintf.
	* grub-core/font/font.c (grub_font_load): Likewise.
2011-11-11 20:59:25 +01:00
Vladimir 'phcoder' Serbinenko
5b289bc5f6 * util/grub-macho2img.c: Add comment concerning gettext.
* grub-core/lib/legacy_parse.c: Likewise.
2011-11-11 20:52:41 +01:00
Vladimir 'phcoder' Serbinenko
c1860f878b * grub-core/kern/misc.c (grub_vprintf): Add missing va_end.
(grub_xvasprintf): Likewise.
2011-11-11 20:45:31 +01:00
Vladimir 'phcoder' Serbinenko
d35d0d3753 Add const keyword to grub_env_get and gettextize week days.
* grub-core/hook/datehook.c (grub_datetime_names): Make const.
	(grub_read_hook_datetime): Return const char *.
	* grub-core/kern/env.c (grub_env_get): Return const char *. All users
	updated.
	* grub-core/normal/datetime.c (grub_weekday_names): Make const.
	Mark for gettext.
	(grub_get_weekday_name): Return const char *. Call gettext.
	* grub-core/script/argv.c (grub_script_argv_append): Receive const
	char * and len as the argument. All users updated.
	(grub_script_argv_split_append): Receive const char *.
	* include/grub/datetime.h (grub_get_weekday_name): Update proto.
	* include/grub/env.h (grub_env_get): Likewise.
	(grub_env_read_hook_t): Return const char *.
	* include/grub/script_sh.h (grub_script_argv_append): Update proto.
	(grub_script_argv_split_append): Likewise.
2011-11-11 20:34:37 +01:00
Vladimir 'phcoder' Serbinenko
9aed8a7178 * grub-core/normal/main.c (grub_normal_execute): Remove leftover call. 2011-11-11 20:09:14 +01:00
Vladimir 'phcoder' Serbinenko
067fdf0055 * grub-core/kern/misc.c (grub_strstr): Moved from here ...
* include/grub/misc.h (grub_strstr): ... here. Make static and inline.
2011-11-11 20:02:51 +01:00
Vladimir 'phcoder' Serbinenko
f7ce5bafb5 Fix mips compilation.
* grub-core/lib/xzembed/xz_dec_stream.c (xz_dec): Restrict hash_id to
	normal decoder.
	(hashes): Use in embed decoder as well (for sizes).
	(dec_stream_header): Fix embed decompressor logic.
	(dec_stream_footer): Likewise.
2011-11-11 18:30:34 +01:00
Vladimir 'phcoder' Serbinenko
9bb182f371 * grub-core/kern/x86_64/dl.c (grub_arch_dl_relocate_symbols): Issue
an error and not a fatal on unrecognised relocation types.
2011-11-11 18:05:16 +01:00
Vladimir 'phcoder' Serbinenko
63a9e6f6a0 * grub-core/kern/ieee1275/openfw.c (grub_ieee1275_parse_args):
Issue error rather than printf on unknown arguments.
2011-11-11 17:44:47 +01:00
Vladimir 'phcoder' Serbinenko
4c458569a7 * grub-core/kern/ieee1275/ieee1275.c (grub_ieee1275_set_property):
Make buf a const.
2011-11-11 17:34:38 +01:00
Vladimir 'phcoder' Serbinenko
e2d22baf41 * grub-core/fs/zfs/zfscrypt.c (GRUB_MOD_INIT), (GRUB_MOD_FINI):
Fix module name.
2011-11-11 17:21:33 +01:00
Vladimir 'phcoder' Serbinenko
53dc859065 * grub-core/fs/ntfs.c (grub_ntfs_read_symlink): Stylistic fix. Remove
leftover debug printf.
2011-11-11 17:18:34 +01:00
Vladimir 'phcoder' Serbinenko
6c1892942d * grub-core/fs/btrfs.c (grub_btrfs_embed): Spelling fix. 2011-11-11 17:13:23 +01:00
Vladimir 'phcoder' Serbinenko
f768836950 * grub-core/efiemu/main.c (grub_efiemu_register_configuration_table):
A stylistic fix.
2011-11-11 17:10:50 +01:00
Vladimir 'phcoder' Serbinenko
11a775a3ad * grub-core/commands/probe.c (grub_cmd_probe): Fix error message. 2011-11-11 17:08:29 +01:00
Shea Levy
33f784e881 Allow all modules to perform serial IO
* grub-core/term-serial.c (grub_serial_find): Remove static qualifier
	* include/grub/serial.h (grub_serial_port_configure): New inline
	function.
	(grub_serial_port_fetch): Likewise.
	(grub_serial_port_put): Likewise.
	(grub_serial_port_fini): Likewise.
	(grub_serial_find): New proto.
2011-11-10 09:41:07 +01:00
Vladimir 'phcoder' Serbinenko
f627652531 Put symlink at the end of the node and fix a potential
memory corruption.

	* grub-core/fs/iso9660.c (grub_fshelp_node): New field have_symlink.
	Make symlink into an array.
	(set_rockridge): Set have_symlink and alloc_dirents.
	(grub_iso9660_read_symlink): Use new layout.
	(grub_iso9660_iterate_dir): Fix memory corruption.
	Use new layout.
	(grub_iso9660_dir): Set have_symlink.
	(grub_iso9660_open): Likewise.
2011-11-10 09:31:06 +01:00
Vladimir 'phcoder' Serbinenko
cb544caa2e * grub-core/fs/zfs/zfs.c (zfs_mount): Fix spurious warning. 2011-11-10 08:43:08 +01:00
Vladimir 'phcoder' Serbinenko
45bd824d2e Fix ZFS memory and resource leaks.
* grub-core/fs/zfs/zfs.c (fill_vdev_info_real): New paramter inserted.
	All users updated.
	Free type on exit.
	(fill_vdev_info): New parameter inserted. All users updated.
	(check_pool_label): Likewise.
	(scan_disk): Likewise.
	(scan_devices): Close non-inserted disks.
	(fzap_iterate): Free l.
	(unmount_device): Free children descripto memory.
2011-11-10 08:38:06 +01:00
Vladimir 'phcoder' Serbinenko
ad9a2f44b4 * grub-core/fs/iso9660.c (grub_iso9660_iterate_dir): Fix grub_strncat
argument (access out of bounds).
2011-11-10 08:16:27 +01:00
Vladimir 'phcoder' Serbinenko
6b68db81fc * grub-core/fs/btrfs.c (grub_btrfs_read_logical): Fix RAID10 logic for
>= 6 drives.
2011-11-10 08:09:33 +01:00
Vladimir 'phcoder' Serbinenko
8a5a3a5b5a Fix several memory leaks.
* grub-core/fs/btrfs.c (grub_btrfs_dir): Fix memory leak.
	* grub-core/fs/cpio.c (grub_cpio_find_file): Likewise.
	(grub_cpio_dir): Likewise.
	* grub-core/fs/fat.c (grub_fat_label): Likewise.
	* grub-core/fs/jfs.c (grub_jfs_label): Likewise.
	* grub-core/fs/romfs.c (grub_romfs_close): Likewise.
	(grub_romfs_label): Likewise.
	* grub-core/fs/squash4.c (squash_mount): Use zalloc for safety.
	(squash_unmount): New function.
	(grub_squash_dir): Fix memory leak.
	(grub_squash_open): Likewise.
	(grub_squash_read): Likewise.
	(grub_squash_mtime): Likewise.
	* grub-core/fs/xfs.c (grub_xfs_open): Likewise.
	* grub-core/fs/zfs/zfs.c (check_pool_label): Likewise.
	* util/grub-fstest.c (fstest): Likewise.
2011-11-09 15:01:58 +01:00
Vladimir 'phcoder' Serbinenko
52b656c037 Several AFFS fixes.
* grub-core/fs/affs.c (grub_affs_bblock): Replace flags with version.
	(GRUB_AFFS_FLAG_FFS): Removed.
	(GRUB_AFFS_SYMLINK_SIZE): Likewise.
	(GRUB_AFFS_FILETYPE_DIR): Make positive and unsigned.
	(GRUB_AFFS_FILETYPE_DIR), (GRUB_AFFS_FILETYPE_REG): Fix a mix-up.
	(grub_fshelp_node): Make block 32-bit.
	Add block_cache and last_block_cache.
	(grub_affs_read_block): Fill and use block cache.
	(grub_affs_read_file): Removed.
	(grub_affs_mount): Zero-fill node. Fix version check. Don't reread
	boot block.
	(grub_affs_read_symlink): Fix symlink size. Add a \0 at the end for
	safety.
	(grub_affs_iterate_dir): Use more appropriate types. Zero-fill allocated
	space.
	(grub_affs_close): Free block cache.
	(grub_affs_read): Use grub_fshelp_read_file directly.
2011-11-09 11:43:39 +01:00
Vladimir 'phcoder' Serbinenko
438a746a3f * grub-core/fs/zfs/zfs.c (read_dva): Issue an error if read failed
with no error set.
2011-11-08 20:03:06 +01:00
Vladimir 'phcoder' Serbinenko
49a45021c1 * grub-core/lib/LzmaEnc.c (LzmaEnc_CodeOneBlock): Remove set but not
used variable.
	* grub-core/kern/ia64/dl_helper.c (grub_ia64_dl_get_tramp_got_size):
	Likewise.
2011-11-08 19:46:41 +01:00
Vladimir 'phcoder' Serbinenko
3ae17eb83c Fix potential problem with calling zfs_to_cpu and cpu_to_be in a row.
* grub-core/fs/zfs/zfscrypt.c (grub_zfs_decrypt_real): Use explicit
	byteswap when needed.
2011-11-08 19:44:18 +01:00
Vladimir 'phcoder' Serbinenko
27610c3836 Fix FreeBSD compilation.
* grub-core/disk/geli.c (GRUB_MD_SHA256) [GRUB_UTIL]: Redefine in a way
	to avoid circular dependency.
	(GRUB_MD_SHA512) [GRUB_UTIL]: Likewise.
	* util/getroot.c (grub_util_follow_gpart_up): Move from here...
	* grub-core/kern/emu/hostdisk.c (+grub_util_follow_gpart_up): ... here.
2011-11-08 19:34:19 +01:00
Vladimir 'phcoder' Serbinenko
4a19b6017d Fix ZFS crypto error types.
* grub-core/fs/zfs/zfscrypt.c (grub_ccm_decrypt): Fix return type.
	(grub_gcm_decrypt): Likewise.
	(grub_zfs_load_key_real): Fix error code type. Handle possible error
	from PBKDF2.
2011-11-08 16:07:27 +01:00
Vladimir 'phcoder' Serbinenko
958ee22168 Illumos support.
* Makefile.util.def (10_illumos): New script.
	* configure.ac: Set COND_HOST_ILLUMOS.
	* grub-core/kern/emu/hostdisk.c (grub_util_get_fd_sectors) [__sun__]:
	Support Illumos calls.
	(find_partition_start) [__sun__]: Likewise.
	(convert_system_partition_to_system_disk) [__sun__]: Likewise.
	(device_is_wholedisk) [__sun__]: Handle Illumos naming scheme.
	(grub_util_biosdisk_get_grub_dev) [__sun__]: Handle Illumos.
	* util/getroot.c (find_root_device_from_libzfs) [__sun__]: Return raw
	device.
	* util/grub-probe.c (probe) [__sun__]: Do character check.
	* util/grub.d/10_illumos.in: New file.
2011-11-08 12:38:30 +01:00
Vladimir 'phcoder' Serbinenko
cac14fb663 Support escaped commas in hostdisk.
* grub-core/kern/emu/hostdisk.c (unescape_cmp): New function.
	(find_grub_drive): Use unescape_cmp.
	(make_device_name): Escape commas.
2011-11-08 12:15:57 +01:00
Vladimir 'phcoder' Serbinenko
9f421dd1f0 * grub-core/fs/zfs/zfs.c (zap_iterate): Remove set but not used
variable.
2011-11-08 11:32:19 +01:00
Vladimir 'phcoder' Serbinenko
ed64e9e279 Support trampoline jumps on powerpc.
* grub-core/kern/dl.c (grub_dl_load_segments) [__powerpc__]: Follow
	__ia64__ path.
	(grub_dl_load_segments): Set mod->sz.
	(grub_dl_flush_cache): Flush whole space occupied by module, not just
	segments.
	* grub-core/kern/ia64/dl.c (nopm): Make const while on it.
	(jump): Likewise.
	* grub-core/kern/powerpc/dl.c (grub_arch_dl_get_tramp_got_size): New
	function.
	(trampoline): New struct.
	(trampoline_template): New const.
	(grub_arch_dl_relocate_symbols): Create trampolines on overflow.
	* include/grub/dl.h (grub_dl): Add sz element.
	[__powerpc__]: Follow __ia64__.
	(GRUB_ARCH_DL_TRAMP_ALIGN): Define on ppc.
	(GRUB_ARCH_DL_GOT_ALIGN): Likewise.
	(GRUB_ARCH_DL_TRAMP_SIZE): Likewise.
	(grub_arch_dl_get_tramp_got_size) [__powerpc__]: New proto.
2011-11-08 11:23:56 +01:00
Vladimir 'phcoder' Serbinenko
3084ede4c7 ZFS crypto support.
* Makefile.util.def (libgrubmods): Add grub-core/fs/zfs/zfscrypt.c.
	* grub-core/Makefile.core.def (zfscrypt): New module.
	* grub-core/fs/zfs/zfs.c (subvolume): New structure.
	(grub_zfs_data): Replace mdn with subvol. Put case_insensitivity inside
	it. All users updated.
	(grub_zfs_decrypt): New var.
	(grub_zfs_load_key): Likewise.
	(zio_checksum_functions): Add SHA256+MAC.
	(zio_checksum_verify): Handle incomplete comparison due to MAC.
	(zio_read): Handle encrypted blocks.
	(zap_verify): Remove incorrect check.
	(fzap_iterate): Handle non-standard fzap.
	(zap_iterate): Likewise.
	(zap_iterate_u64): New function.
	(dnode_get_fullpath): Load keys.
	* grub-core/fs/zfs/zfscrypt.c: New file.
	* grub-core/lib/crypto.c (grub_crypto_cipher_close): Removed.
	(grub_crypto_ecb_encrypt): Make input const.
	* include/grub/crypto.h (grub_crypto_cipher_close): Inline.
	(grub_crypto_ecb_encrypt): Make input const.
	(GRUB_CIPHER_AES): New macro.
	* include/grub/zfs/dmu.h (dmu_object_type): Add DMU_OT_DSL_KEYCHAIN.
	* include/grub/zfs/dsl_dir.h (dsl_dir_phys): Add keychain.
	* include/grub/zfs/spa.h (grub_zfs_endian): Moved from here ...
	* include/grub/zfs/zfs.h (grub_zfs_endian): ... here. Added GURB_ZFS_
	prefix. All users updated.
	(grub_zfs_add_key): New proto.
	(grub_zfs_decrypt): Likewise.
	(grub_zfs_load_key): Likewise.
	* include/grub/zfs/zio.h (zio_checksum): Add SHA256+MAC.
	* util/grub-fstest.c (options): Add -K option.
	(argp_parser): Likewise.
2011-11-06 21:44:48 +01:00
Vladimir 'phcoder' Serbinenko
ae9a20d973 Small cleanup 2011-11-06 21:08:32 +01:00
Vladimir 'phcoder' Serbinenko
bc1de0bc26 GCM support 2011-11-06 21:05:25 +01:00
Vladimir 'phcoder' Serbinenko
d99b3726e5 Support ZFS subvolumes with multiple keys 2011-11-06 17:13:38 +01:00
Vladimir 'phcoder' Serbinenko
ed746949af ZFS passphrase support 2011-11-06 16:30:52 +01:00
Vladimir 'phcoder' Serbinenko
f003a8c5e7 Move ZFS crypto to separate module 2011-11-06 15:18:25 +01:00