Commit graph

5941 commits

Author SHA1 Message Date
Vladimir 'phcoder' Serbinenko
67e2bd718e Read label on HFS+.
* grub-core/fs/hfsplus.c (grub_hfsplus_cmp_catkey_id): New function.
	(grub_hfsplus_btree_search): Fix types.
	(grub_hfsplus_label): Implement.
2011-10-26 00:32:17 +02:00
Vladimir 'phcoder' Serbinenko
e9cc6b7b0e * grub-core/fs/ntfs.c (grub_ntfs_uuid): Fix a memory leak. 2011-10-26 00:29:46 +02:00
Vladimir 'phcoder' Serbinenko
19832ddb37 * grub-core/fs/fat.c (grub_fat_uuid): Make uppercase to match Linux. 2011-10-25 21:53:57 +02:00
Vladimir 'phcoder' Serbinenko
66b4085033 Fix symlink handling on iso9660.
* grub-core/fs/iso9660.c (grub_fshelp_node): Remove dir_off. Add symlink
	All users updated.
	(grub_iso9660_susp_iterate): Accept zero-size iterate.
	(grub_iso9660_read_symlink): Moved most of code ...
	(grub_iso9660_iterate_dir): ... here. Fill node->symlink.
2011-10-25 21:52:48 +02:00
Vladimir 'phcoder' Serbinenko
db82136381 * grub-core/loader/i386/bsd.c (grub_netbsd_add_boot_disk_and_wedge):
Use union to avoid breaking strict-aliasing rules.
2011-10-25 18:20:39 +02:00
Vladimir 'phcoder' Serbinenko
e12119495d Support multi-extent iso files.
* grub-core/fs/iso9660.c (grub_iso9660_data): Remove first_sector.
	Add node.
	(grub_fshelp_node): Revamp. All users updated.
	(FLAG_*): New enum.
	(read_node): New function.
	(grub_iso9660_susp_iterate): Use read_node. Receive a node as argument.
	All users updated.
	(grub_iso9660_mount): Don't attempt to read sua when there is none.
	(get_node_size): New function.
	(grub_iso9660_iterate_dir): Use read_node. Agglomerate multi-extent
	entries.
	Fix memory leak on . and ..
	(grub_iso9660_read): Use read_node.
	(grub_iso9660_close): Free node.
2011-10-25 18:18:58 +02:00
Vladimir 'phcoder' Serbinenko
d4888031f2 Fix tar 4G limit and handle paths containing dot.
* grub-core/fs/cpio.c (grub_cpio_data): Use grub_off_t for offsets.
	(canonicalize): New function.
	(grub_cpio_find_file): Use canonicalize. Store offs in
	grub_disk_addr_t.
	(grub_cpio_dir): Use grub_disk_addr_t.
	(grub_cpio_open): Likewise.
2011-10-25 18:12:36 +02:00
Vladimir 'phcoder' Serbinenko
9f12e664cc Fix handling of uncompressed blocks on squashfs and break 4G limit.
* grub-core/fs/squash4.c (grub_squash_super): Add block_size. Remove
	unused flags.
	(grub_squash_inode): Add long_file and block_size.
	(grub_squash_cache_inode): New struct.
	(grub_squash_dirent): Make types into enum.
	(SQUASH_TYPE_LONG_REGULAR): New type.
	(grub_squash_frag_desc): Add field size.
	(SQUASH_BLOCK_FLAGS): New enum.
	(grub_squash_data): Use grub_squash_cache_inode.
	(grub_fshelp_node): Make ino_chunk 64-bit.
	(read_chunk): Minor argument change. All users updated.
	(squash_mount): Use correct le_to_cpu.
	(grub_squash_open): Handle LONG_REGULAR.
	(direct_read): New function.
	(grub_squash_read_data): Handle blocks correctly.
2011-10-25 18:09:00 +02:00
Vladimir 'phcoder' Serbinenko
9f326fba96 * grub-core/kern/disk.c (grub_disk_read_small): Fix memory leak. 2011-10-25 18:01:57 +02:00
Vladimir 'phcoder' Serbinenko
f4d9b64bba * grub-core/fs/romfs.c (grub_romfs_open): Add missing return. 2011-10-25 17:38:22 +02:00
Vladimir 'phcoder' Serbinenko
5bbd28b8ce Fix 2G limit on ZFS.
* grub-core/fs/zfs/zfs.c (zio_checksum_verify): Use more appropriate
	types.
	(uberblock_verify): Likewise.
	(dmu_read): Likewise.
	(grub_zfs_read): Likewise. Remove invalid cast.
2011-10-24 21:33:35 +02:00
Vladimir 'phcoder' Serbinenko
68c72069d9 * grub-core/fs/jfs.c (grub_jfs_blkno): Use more appropriate types.
(grub_jfs_blkno): Fix incorrect shift.
	(grub_jfs_read_file): Use more appropriate types.
2011-10-24 17:02:02 +02:00
Vladimir 'phcoder' Serbinenko
6e536dc8ad Support triple indirect on minix2 and minix3.
* grub-core/fs/minix.c (grub_minix_inode) [MODE_MINIX2 || MODE_MINIX3]:
	Declare triple_indir_zone.
	(grub_minix_get_file_block) [MODE_MINIX2 || MODE_MINIX3]: Handle triple
	indirect.
2011-10-24 16:16:28 +02:00
Vladimir 'phcoder' Serbinenko
e0864e7ab7 Minix FS fixes.
* grub-core/fs/minix.c (GRUB_MINIX_INODE_SIZE): Size is always 32-bit.
	(grub_minix_inode) [!MODE_MINIX2 && !MODE_MINIX3]: Make size 32-bit.
	Rename ctime to mtime. All users updated.
	(grub_minix_get_file_block): Fix types and double indirect computations.
2011-10-24 10:45:47 +02:00
Vladimir 'phcoder' Serbinenko
89481cabbd * grub-core/fs/fat.c (grub_fat_label) [MODE_EXFAT]: Set *label to 0
if no label is found.
	(grub_fat_iterate_dir): Fix file size type.
	(grub_fat_iterate_dir): Likewise.
2011-10-24 01:31:06 +02:00
Vladimir 'phcoder' Serbinenko
f646e14309 * grub-core/lib/reed_solomon.c (gf_invert): Declare as const and
save some space.
	* include/grub/offsets.h (GRUB_KERNEL_I386_PC_RAW_SIZE): Decrease.
	(GRUB_KERNEL_I386_PC_NO_REED_SOLOMON_PART): Likewise.
2011-10-23 23:55:38 +02:00
Vladimir 'phcoder' Serbinenko
534d769e57 * util/import_gcry.py: Automatically fix camellia.c and camellia.h. 2011-10-23 23:40:53 +02:00
Vladimir 'phcoder' Serbinenko
e084ba1895 * util/import_gcry.py: Accept space between # and include. 2011-10-23 23:39:00 +02:00
Vladimir 'phcoder' Serbinenko
3471ecdfd9 * grub-core/lib/setjmp.S [__ia64__]: Include ./ia64/longjmp.S. 2011-10-23 23:34:30 +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
4defb8d59b * grub-core/lib/posix_wrap/string.h (memcpy) [GRUB_UTIL]:
New inline function.
	* grub-core/lib/libgcrypt_wrap/cipher_wrap.h (memcpy) [GRUB_UTIL]:
	Likewise.
	(memset) [GRUB_UTIL]: Likewise.
	(memcmp) [GRUB_UTIL]: Likewise.
2011-10-23 23:28:23 +02:00
Vladimir 'phcoder' Serbinenko
4e94ae6575 * include/grub/misc.h (grub_memcpy): Declare grub_memcpy with static
inline function rather than a define.
2011-10-23 23:25:06 +02:00
Vladimir 'phcoder' Serbinenko
18c575e5c5 * util/grub-setup.c: Add missing include. 2011-10-23 23:22:38 +02:00
Vladimir 'phcoder' Serbinenko
f8bc22a832 * util/ieee1275/grub-ofpathname.c: Add missing include. 2011-10-23 23:20:11 +02:00
Vladimir 'phcoder' Serbinenko
3ce69fc90f * grub-core/kern/i386/pc/startup.S (grub_exit): Add missing zeroing-out.
* grub-core/lib/i386/reboot_trampoline.S (grub_reboot_start):
	Likewise.
2011-10-23 23:04:57 +02:00
Vladimir 'phcoder' Serbinenko
d1e293bbfa * grub-core/io/lzopio.c (test_header): Fix incorrect memcmp instead of
grub_memcmp usage.
2011-10-23 22:55:32 +02:00
Vladimir 'phcoder' Serbinenko
7a5c54a437 * util/grub-install.in: Add datarootdir as per automake manual
suggestion.
	* util/grub-mknetdir.in: Likewise.
2011-10-23 22:53:21 +02:00
Vladimir 'phcoder' Serbinenko
7bec1053db * util/grub.d/10_hurd.in: Add datarootdir as per automake manual
suggestion.
	* util/grub.d/10_kfreebsd.in: Likewise.
	* util/grub.d/10_linux.in: Likewise.
	* util/grub.d/10_netbsd.in: Likewise.
	* util/grub.d/10_windows.in: Likewise.
	* util/grub.d/20_linux_xen.in: Likewise.
2011-10-23 22:40:26 +02:00
Vladimir 'phcoder' Serbinenko
766f7d0809 Remove redundant grub_kernel_image_size.
* grub-core/kern/i386/coreboot/init.c (grub_machine_init): Use
	_edata and _start.
	* grub-core/kern/i386/coreboot/startup.S: Move multiboot header after
	the small code. It moves it only by few bytes but simplifies the code.
	* grub-core/kern/i386/pc/init.c (grub_machine_init): Use _edata and
	_start.
	* grub-core/kern/i386/pc/startup.S: Use _edata and _start.
	(grub_kernel_image_size): Removed.
	* grub-core/kern/i386/qemu/startup.S: Use _edata and _start.
	(grub_kernel_image_size): Removed.
	[APPLE_CC]: Remove apple compiler support. i386-qemu port can't be
	compiled with Apple toolchain.
	* grub-core/kern/sparc64/ieee1275/crt0.S: Remove leftover fields.
	* include/grub/i386/pc/kernel.h (grub_kernel_image_size): Removed.
	* include/grub/i386/qemu/kernel.h (grub_kernel_image_size): Removed.
	(grub_total_module_size): Likewise.
	* include/grub/offsets.h (GRUB_KERNEL_I386_PC_KERNEL_IMAGE_SIZE):
	Removed.
	(GRUB_KERNEL_I386_PC_COMPRESSED_SIZE): Put it lower.
	(GRUB_KERNEL_I386_PC_INSTALL_DOS_PART): Likewise.
	(GRUB_KERNEL_I386_PC_INSTALL_BSD_PART): Likewise.
	(GRUB_KERNEL_I386_PC_REED_SOLOMON_REDUNDANCY): Likewise.
	(GRUB_KERNEL_I386_QEMU_KERNEL_IMAGE_SIZE): Removed.
	(GRUB_KERNEL_SPARC64_IEEE1275_KERNEL_IMAGE_SIZE): Likewise.
	(GRUB_KERNEL_SPARC64_IEEE1275_COMPRESSED_SIZE): Likewise.
	* include/grub/sparc64/ieee1275/kernel.h (grub_kernel_image_size):
	Removed.
	(grub_total_module_size): Removed.
	* util/grub-mkimage.c (image_target_desc): Remove image_size.
	(image_targets): Likewise.
	Set .compressed_size to no field on sparc.
	(generate_image): Remove kernel_image_size handling.
2011-10-20 08:13:00 +02:00
Szymon Janc
fcf1d67219 * grub-core/bus/usb/uhci.c (grub_uhci_setup_transfer): Fix possible
NULL pointer dereference.
2011-10-19 23:11:48 +02:00
Vladimir 'phcoder' Serbinenko
de9c615e5c Removed unused GRUB_BOOT_VERSION. Check for kernel version is better
done with a dedicated section.

	* grub-core/boot/sparc64/ieee1275/boot.S: Remove GRUB_BOOT_VERSION.
	Ensure the correct position of boot_path.
	* grub-core/kern/i386/efi/startup.S: Remove GRUB_BOOT_VERSION.
	* grub-core/kern/i386/pc/startup.S: Likewise. Ensure correct position of
	other fields.
	* grub-core/kern/x86_64/efi/startup.S: Remove GRUB_BOOT_VERSION.
	* include/grub/boot.h: Removed. All references removed.
	* include/grub/sparc64/ieee1275/boot.h (GRUB_BOOT_MACHINE_VER_MAJ):
	Removed.
	(GRUB_BOOT_MACHINE_BOOT_DEVPATH): Make it lower.
2011-10-19 23:01:44 +02:00
Vladimir 'phcoder' Serbinenko
e55599dcbf * util/grub-install.in: Declare IEEE1275 as able to find out the disk
name.
2011-10-19 20:35:41 +02:00
Vladimir 'phcoder' Serbinenko
36dd20ad0b * grub-core/kern/main.c (grub_set_prefix_and_root): Init prefix. 2011-10-19 20:30:06 +02:00
Vladimir 'phcoder' Serbinenko
f8f72eb890 * grub-core/kern/ieee1275/openfw.c (grub_ieee1275_encode_devname):
Don't add the bogus brackets.
2011-10-19 20:28:09 +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
a97501d238 Make grub_prefix into module to fix the arbitrary limit and save
some space.

	* grub-core/kern/emu/main.c (grub_prefix): Removed.
	* grub-core/kern/i386/coreboot/startup.S (grub_prefix): Likewise.
	* grub-core/kern/i386/efi/startup.S (grub_prefix): Likewise.
	* grub-core/kern/i386/ieee1275/startup.S (grub_prefix): Likewise.
	* grub-core/kern/i386/pc/startup.S (grub_prefix): Likewise.
	* grub-core/kern/i386/qemu/startup.S (grub_prefix): Likewise.
	* grub-core/kern/ia64/efi/startup.S (grub_prefix): Likewise.
	* grub-core/kern/mips/startup.S (grub_prefix): Likewise.
	* grub-core/kern/powerpc/ieee1275/startup.S (grub_prefix): Likewise.
	* grub-core/kern/sparc64/ieee1275/crt0.S (grub_prefix): Likewise.
	* grub-core/kern/x86_64/efi/startup.S (grub_prefix): Likewise.
	* include/grub/ia64/efi/kernel.h: Removed.
	* include/grub/kernel.h: New module type OBJ_TYPE_PREFIX.
	(grub_prefix): Removed.
	* include/grub/offsets.h (GRUB_KERNEL_I386_PC_PREFIX): Removed.
	(GRUB_KERNEL_I386_PC_PREFIX_END): Likewise.
	(GRUB_KERNEL_I386_QEMU_PREFIX): Likewise.
	(GRUB_KERNEL_I386_QEMU_PREFIX_END): Likewise.
	(GRUB_KERNEL_SPARC64_IEEE1275_PREFIX): Likewise.
	(GRUB_KERNEL_SPARC64_IEEE1275_PREFIX_END): Likewise.
	(GRUB_KERNEL_POWERPC_IEEE1275_PREFIX): Likewise.
	(GRUB_KERNEL_POWERPC_IEEE1275_PREFIX_END): Likewise.
	(GRUB_KERNEL_MIPS_LOONGSON_PREFIX): Likewise.
	(GRUB_KERNEL_MIPS_LOONGSON_PREFIX_END): Likewise.
	(GRUB_KERNEL_MIPS_QEMU_MIPS_PREFIX): Likewise.
	(GRUB_KERNEL_MIPS_QEMU_MIPS_PREFIX_END): Likewise.
	(GRUB_KERNEL_MIPS_ARC_PREFIX): Likewise.
	(GRUB_KERNEL_MIPS_ARC_PREFIX_END): Likewise.
	(GRUB_KERNEL_I386_EFI_PREFIX): Likewise.
	(GRUB_KERNEL_I386_EFI_PREFIX_END): Likewise.
	(GRUB_KERNEL_IA64_EFI_PREFIX): Likewise.
	(GRUB_KERNEL_IA64_EFI_PREFIX_END): Likewise.
	(GRUB_KERNEL_X86_64_EFI_PREFIX): Likewise.
	(GRUB_KERNEL_X86_64_EFI_PREFIX_END): Likewise.
	(GRUB_KERNEL_I386_COREBOOT_PREFIX): Likewise.
	(GRUB_KERNEL_I386_COREBOOT_PREFIX_END): Likewise.
	(GRUB_KERNEL_I386_MULTIBOOT_PREFIX): Likewise.
	(GRUB_KERNEL_I386_MULTIBOOT_PREFIX_END): Likewise.
	(GRUB_KERNEL_I386_IEEE1275_PREFIX): Likewise.
	(GRUB_KERNEL_I386_IEEE1275_PREFIX_END): Likewise.
	(GRUB_KERNEL_MACHINE_PREFIX): Likewise.
	(GRUB_KERNEL_MACHINE_PREFIX_END): Likewise.
	* grub-core/kern/main.c (grub_set_prefix_and_root): Retrieve grub_prefix
	from module.
	* util/grub-mkimage.c (image_target_desc): Removed prefix and
	prefix_end.
	(image_targets): Likewise.
	(generate_image): Put prefix as a module.
2011-10-18 15:21:51 +02:00
Vladimir 'phcoder' Serbinenko
39705fadd7 Replace grub_module_iterate with FOR_MODULES.
* grub-core/disk/memdisk.c (GRUB_MOD_INIT): Switched to new interface.
	* grub-core/kern/efi/efi.c (grub_arch_modules_addr): Renamed to...
	(grub_efi_modules_addr): ...this.
	* grub-core/kern/efi/init.c (grub_modbase): New variable.
	(grub_efi_init): Set grub_modbase.
	* grub-core/kern/emu/main.c (grub_arch_modules_addr): Removed.
	(grub_modbase): New variable.
	* grub-core/kern/i386/coreboot/init.c (grub_arch_modules_addr): Removed.
	(grub_modbase): New variable.
	(grub_machine_init): Set grub_modbase.
	* grub-core/kern/i386/pc/init.c (grub_arch_modules_addr): Removed.
	(grub_modbase): New variable.
	(grub_machine_init): Set grub_modbase.
	* grub-core/kern/ieee1275/init.c (grub_arch_modules_addr): Removed.
	(grub_modbase): New variable.
	(grub_machine_init): Set grub_modbase.
	* grub-core/kern/main.c (grub_module_iterate): Remove.
	(grub_modules_get_end): Use grub_modbase.
	(grub_load_modules): Use FOR_MODULES.
	(grub_load_config): Likewise.
	* grub-core/kern/mips/arc/init.c (grub_arch_modules_addr): Removed.
	(grub_modbase): New variable.
	(grub_machine_init): Set grub_modbase.
	* grub-core/kern/mips/loongson/init.c (grub_arch_modules_addr): Removed.
	(grub_modbase): New variable.
	(grub_machine_init): Set grub_modbase.
	* grub-core/kern/mips/qemu_mips/init.c (grub_arch_modules_addr):
	Removed.
	(grub_modbase): New variable.
	(grub_machine_init): Set grub_modbase.
	* include/grub/efi/efi.h (grub_efi_modules_addr): New declaration.
	* include/grub/kernel.h (grub_arch_modules_addr): Removed.
	(grub_module_iterate): Likewise.
	(grub_modbase): New variable declaration.
	(FOR_MODULES): New macro.
2011-10-16 15:23:29 +02:00
Vladimir 'phcoder' Serbinenko
2afb7f6cbf * configure.ac: Check for __ctzdi2 and __ctzsi2.
* include/grub/libgcc.h: Include __ctzdi2 and __ctzsi2 if present.
2011-10-16 15:15:35 +02:00
Vladimir 'phcoder' Serbinenko
366e34fa5a Fix few obvious type discrepancies.
* grub-core/fs/affs.c (grub_affs_read_file): Use grub_off_t for offset.
	* grub-core/fs/afs.c (grub_afs_read_file): Likewise.
	* grub-core/fs/fshelp.c (grub_fshelp_find_file): Remove leftover
	variable.
	* grub-core/fs/hfs.c (grub_hfs_read_file): Use grub_off_t for offset
	and connected types.
	* grub-core/fs/nilfs2.c (grub_nilfs2_read_file): Use grub_off_t for
	offset.
	(grub_nilfs2_iterate_dir): Use grub_off_t for fpos.
	* grub-core/fs/sfs.c (grub_sfs_read_file): Use grub_off_t for offset.
	* grub-core/fs/ufs.c (grub_ufs_read_file): Use grub_off_t for offset
	and connected types.
2011-10-16 11:57:48 +02:00
Vladimir 'phcoder' Serbinenko
177b960ea4 Fix python 3.x incompatibilities.
* gentpl.py: Put brackets around print strings.
	* util/import_gcry.py: Open explicitly as utf-8.
	Use in instead of has_key.
2011-10-16 11:53:27 +02:00
Vladimir 'phcoder' Serbinenko
3b619ae116 * grub-core/fs/xfs.c (grub_xfs_inode): New field fork_offset.
(GRUB_XFS_INO_AGBITS): Make into inline function.
	(GRUB_XFS_INO_INOINAG): Likewise.
	(GRUB_XFS_INO_AG): Likewise.
	(GRUB_XFS_FSB_TO_BLOCK): Likewise.
	(GRUB_XFS_EXTENT_OFFSET): Likewise.
	(GRUB_XFS_EXTENT_BLOCK): Likewise.
	(GRUB_XFS_EXTENT_SIZE): Likewise.
	(GRUB_XFS_ROUND_TO_DIRENT): Likewise.
	(GRUB_XFS_NEXT_DIRENT): Likewise.
	(grub_xfs_read_block): Rewrite the btree parsing. Fixes invalid BMAP.
	(grub_xfs_read_file): Fix offset type.
2011-10-16 11:48:54 +02:00
Robert Millan
8bcebcb8e4 2011-10-15 Robert Millan <rmh@gnu.org>
* util/getroot.c (grub_util_get_grub_dev): Fix OS selection #ifdefs.
2011-10-15 18:37:55 +02:00
Robert Millan
0017e5ef84 2011-10-15 Robert Millan <rmh@gnu.org>
Fix build problem on FreeBSD and GNU/kFreeBSD.

        * util/getroot.c [__FreeBSD_kernel__]: Include `<sys/mount.h>'.
2011-10-15 13:33:41 +02:00
Vladimir 'phcoder' Serbinenko
d891955241 Fix overflow with >2GiB file on HFS+. >4GiB wasn't tested.
* grub-core/fs/hfsplus.c (grub_hfsplus_btree): Use more appropriate
	types.
	(grub_hfsplus_btree_recoffset): Likewise.
	(grub_hfsplus_btree_recptr): Likewise.
	(grub_hfsplus_find_block): Likewise.
	(grub_hfsplus_btree_search): Likewise.
	(grub_hfsplus_read_block): Likewise.
	(grub_hfsplus_read_file): Likewise.
	(grub_hfsplus_mount): Likewise.
	(grub_hfsplus_btree_iterate_node): Likewise.
	(grub_hfsplus_btree_search): Likewise.
	(grub_hfsplus_iterate_dir): Likewise.
	(grub_hfsplus_read): A small code simplification.
2011-10-14 22:41:21 +02:00
Vladimir 'phcoder' Serbinenko
c81296b65f * grub-core/kern/emu/hostdisk.c
(convert_system_partition_to_system_disk): Don't assume that children
	of mapper nodes are mapper nodes.
2011-10-14 19:20:44 +02:00
Vladimir 'phcoder' Serbinenko
0eb8ffb1f5 * grub-core/lib/posix_wrap/ctype.h (isxdigit): Use grub_isxdigit.
* include/grub/misc.h (grub_isxdigit): New function.
	* grub-core/video/colors.c (my_isxdigit): Removed. All users
	switched to grub_isxdigit.
	* grub-core/term/serial.c (grub_serial_find): Fix in case of port
	number starting with a letter.
2011-10-14 19:16:37 +02:00
Robert Millan
a98f4a0808 2011-10-09 Robert Millan <rmh@gnu.org>
LVM support for FreeBSD and GNU/kFreeBSD.

        * util/lvm.c (grub_util_lvm_isvolume): Enable on FreeBSD and
        GNU/kFreeBSD.
        (LVM_DEV_MAPPER_STRING): Move from here ...
        * include/grub/util/lvm.h (LVM_DEV_MAPPER_STRING): ... to here.
        * util/getroot.c: Include `<grub/util/lvm.h>'.
        (grub_util_get_dev_abstraction): Enable
        grub_util_biosdisk_is_present() on FreeBSD and GNU/kFreeBSD.
        Check for LVM abstraction on FreeBSD and GNU/kFreeBSD.
        (grub_util_get_grub_dev): Replace "/dev/mapper/" with
        `LVM_DEV_MAPPER_STRING'.  Enable LVM and mdRAID only on platforms that
        support it.
        * util/grub-setup.c (main): Check for LVM also on FreeBSD and
        GNU/kFreeBSD.
        * util/grub.d/10_kfreebsd.in: Load `geom_linux_lvm' kernel module
        when LVM abstraction is required for ${GRUB_DEVICE}.
2011-10-09 21:13:00 +02:00
Szymon Janc
050e8e9080 Add support for LZO compression in GRUB:
- import of minilzo library, 
- LZO decompression for btrfs,
- lzop files decompression.

* grub-core/io/lzopio.c: New file.
* grub-core/lib/adler32.c: Likewise.
* grub-core/lib/minilzo/lzoconf.h: Likewise.
* grub-core/lib/minilzo/lzodefs.h: Likewise.
* grub-core/lib/minilzo/minilzo.c: Likewise.
* grub-core/lib/minilzo/minilzo.h: Likewise.
* Makefile.util.def (libgrubmods.a): Add grub-core/io/lzopio.c,
grub-core/lib/adler32.c, grub-core/io/lzopio.c,
grub-core/lib/minilzo/minilzo.c to common.
* Makefile.util.def (libgrubmods.a): Add flags required by minilzo to
cflags in cppflags.
* grub-core/Makefile.core.def (btrfs): Likewise.
* grub-core/Makefile.core.def (lzopio): New module.
(adler32): Likewise.
* grub-core/fs/btrfs.c: Include minilzo.h.
(GRUB_BTRFS_COMPRESSION_LZO): New define.
(GRUB_BTRFS_LZO_BLOCK_SIZE): Likewise.
(GRUB_BTRFS_LZO_BLOCK_MAX_CSIZE): Likewise.
(grub_btrfs_lzo_decompress): New function.
(grub_btrfs_extent_read): Add support for LZO compression type.
* include/grub/types.h (GRUB_UCHAR_MAX): New define.
(GRUB_USHRT_MAX): Likewise.
(GRUB_UINT_MAX): Likewise.
* grub-core/lib/posix_wrap/limits.h (USHRT_MAX): Likewise.
(UINT_MAX): Likewise.
(CHAR_BIT): Likewise.
* grub-core/lib/posix_wrap/sys/types.h (ULONG_MAX): Moved to
grub-core/lib/posix_wrap/limits.h
(UCHAR_MAX): Likewise.
* include/grub/file.h (grub_file_filter_id): New compression filter
GRUB_FILE_FILTER_LZOPIO.
* include/grub/file.h (grub_file_filter_id): Set
GRUB_FILE_FILTER_LZOPIO as GRUB_FILE_FILTER_COMPRESSION_LAST.
* include/grub/types.h (grub_get_unaligned16): New function.
(grub_get_unaligned32): Likewise.
(grub_get_unaligned64): Likewise.
* util/import_gcry.py (cryptolist): Add adler32.
2011-10-06 20:45:14 +02:00
Szymon Janc
a664449575 merge trunk 2011-10-06 19:00:10 +02:00