Commit graph

92 commits

Author SHA1 Message Date
proski
c9c8e6063f 2008-07-02 Pavel Roskin <proski@gnu.org>
* fs/reiserfs.c (grub_reiserfs_read): Fix misuse of grub_size_t
	for file offsets, use grub_off_t instead.  Fix printf format
	warnings.
2008-07-02 20:02:54 +00:00
proski
ca62e5986f 2008-07-02 Pavel Roskin <proski@gnu.org>
* fs/reiserfs.c: Remove #warning, TODO list items don't belong
	there.  Real unexpected warnings should not drown in the noise
	about known problems.
2008-07-02 19:37:09 +00:00
proski
d4c9b428e1 2008-07-02 Pavel Roskin <proski@gnu.org>
* fs/xfs.c (struct grub_xfs_dir_header): Use names similar to
	those in Linux XFS code.  Provide a way to access 64-bit parent
	inode.
	(grub_xfs_iterate_dir): Use the new names.  Avoid reading past
	the end of struct grub_xfs_dir_header.
2008-07-02 18:40:32 +00:00
proski
29d7e38ad8 2008-07-01 Pavel Roskin <proski@gnu.org>
* fs/afs.c (grub_afs_read_block): Return grub_disk_addr_t, as
	grub_fshelp_read_file() expects.
2008-07-01 23:33:49 +00:00
proski
f341f6692c 2008-07-01 Pavel Roskin <proski@gnu.org>
* fs/fat.c: Fix UUID calculation on big-endian systems.  We
	write uuid as a 32-bit value in CPU byte order, so declare and
	use it as such.
2008-07-01 23:18:25 +00:00
proski
0e9e51ec4f 2008-07-01 Pavel Roskin <proski@gnu.org>
* disk/raid.c: Cast grub_dprintf() arguments to unsigned long
	long if the format specifier expects it.
	* partmap/gpt.c (gpt_partition_map_iterate): Likewise.
	* partmap/pc.c (pc_partition_map_iterate): Likewise.
	* fs/ntfs.c (grub_ntfs_uuid): Cast data->uuid to unsigned long
	long to fix a warning.
	* fs/reiserfs.c (grub_reiserfs_read): Change casts in
	grub_dprintf() arguments to fix warnings.
2008-07-01 23:02:16 +00:00
robertmh
5444088da6 2008-06-29 Robert Millan <rmh@aybabtu.com>
* fs/xfs.c (GRUB_XFS_FSB_TO_BLOCK): New macro.  Maps filesystem
        block to disk block.
        (grub_xfs_read_block): Use GRUB_XFS_FSB_TO_BLOCK() on result.
        Patch from Niels B\303\266hm <bitbucket@arcor.de>
2008-06-29 21:33:38 +00:00
bean
d31a32a14c 2008-06-16 Bean <bean123ch@gmail.com>
* fs/ext2.c (grub_ext2_blockgroup): Revert to pre journal state.
	(grub_ext2_read_block): Likewise.
	(grub_ext2_read_inode): Likewise.
	(grub_ext2_mount): Likewise.
	(grub_ext2_close): Likewise.
	(grub_ext3_get_journal): Removed.

	* fs/reiserfs.c (grub_reiserfs_get_item): Revert to pre journal state.
	(grub_reiserfs_read_symlink): Likewise.
	(grub_reiserfs_mount): Likewise.
	(grub_reiserfs_open): Likewise.
	(grub_reiserfs_read): Likewise.
	(grub_reiserfs_close): Likewise.
	(grub_reiserfs_get_journal): Removed.

	* fs/fshelp.c (grub_fshelp_read): Removed.
	(grub_fshelp_map_block): Likewise.

	* include/grub/fshelp.h (grub_fshelp_journal_type): Removed.
	(grub_fshelp_journal): Likewise.
	(grub_fshelp_read): Likewise.
	(grub_fshelp_map_block): Likewise.
2008-06-16 19:02:08 +00:00
robertmh
21cf716ad4 2008-06-15 Robert Millan <rmh@aybabtu.com>
* fs/sfs.c (grub_sfs_read_extent): Fix the count of nodes in
        extent-btree which is written as big endian on disk.
        Reported by Alain Greppin  <al@chilibi.org>.
2008-06-15 13:31:18 +00:00
bean
dfe9ddd4cb 2008-06-13 Bean <bean123ch@gmail.com>
* commands/hexdump.c (grub_cmd_hexdump): Adjust offset for partition.

	* fs/ext2.c (grub_ext3_get_journal): Fix revoke block handling.

	* fs/fshelp.c (grub_fshelp_map_block): Don't map block 0 as it's used
	to indicate sparse block.
2008-06-13 06:47:46 +00:00
proski
e6d1a308ed 2008-06-12 Pavel Roskin <proski@gnu.org>
* fs/ext2.c (grub_ext2_read_inode): Don't normalize block
	number, grub_fshelp_read() does it for us.
2008-06-12 16:13:21 +00:00
proski
16ae7781ef 2008-06-12 Pavel Roskin <proski@gnu.org>
* fs/fshelp.c (grub_fshelp_read): New function.  Implement
	linear disk read with journal translation.
	* fs/ext2.c: Use grub_fshelp_read() instead of grub_disk_read().
	* include/grub/fshelp.h: Declare grub_fshelp_read().
2008-06-12 14:48:27 +00:00
proski
40fd3a2b99 2008-06-09 Pavel Roskin <proski@gnu.org>
* fs/minix.c (grub_minix_mount): Handle error reading
	superblock.
2008-06-09 15:32:43 +00:00
robertmh
ad4936a035 2008-06-08 Robert Millan <rmh@aybabtu.com>
* include/grub/ntfs.h (struct grub_ntfs_bpb): Rename `serial_number' to
        `num_serial' (for consistency with other variables).
        (struct grub_ntfs_data): Add `uuid' member.
        * fs/ntfs.c (grub_ntfs_mount): Initialize `data->uuid'.
        (grub_ntfs_uuid): New function.
        (grub_ntfs_fs): Reference grub_ntfs_uuid() in `uuid' struct member.
2008-06-08 19:18:58 +00:00
robertmh
00c108a446 2008-06-01 Robert Millan <rmh@aybabtu.com>
*  util/biosdisk.c (get_drive): Verify that `map[i].drive' is non-NULL
        before dereferencing it.

        * fs/fat.c (struct grub_fat_bpb): Move fat32-specific fields into a
        union with fat12/fat16-specific ones.  Add some new fields, including
        `num_serial' for both versions.
        (struct grub_fat_data): Add `uuid' member.
        (grub_fat_mount): Refer to fat32-specific fields in `bpb' by their new
        names.  Initialize `data->uuid' using `num_serial'.
        (grub_fat_uuid): New function.
        (grub_fat_fs): Reference grub_fat_uuid() in `uuid' struct member.

        * fs/reiserfs.c (grub_reiserfs_superblock): Add `uuid' field.
        (grub_reiserfs_uuid): New function.
        (grub_reiserfs_fs): Reference grub_reiserfs_uuid() in `uuid' struct
        member.

        * fs/xfs.c (grub_xfs_sblock): Add `uuid' field.
        (grub_xfs_uuid): New function.
        (grub_xfs_fs): Reference grub_reiserfs_uuid() in `uuid' struct member.
2008-06-01 13:30:00 +00:00
robertmh
811d3878d8 2008-05-30 Robert Millan <rmh@aybabtu.com>
* fs/ext2.c (grub_ext2_uuid): Use `04x' instead of '02x' as
        grub_printf() flags, since we're printing in units of 2 bytes.
2008-05-30 20:47:43 +00:00
robertmh
6219127445 2008-05-30 Robert Millan <rmh@aybabtu.com>
* commands/search.c (options): Add --fs_uuid option.
        (search_fs_uuid): New function.
        (grub_cmd_search): Fix --set argument passing.
        Use search_fs_uuid() when requested via --fs_uuid.
        (grub_search_init): Update help message.
        * fs/ext2.c (struct grub_ext2_sblock): Rename `unique_id' to `uuid'
        and redeclare it as an array of 16-bit words.
        (grub_ext2_uuid): New function.
        (grub_ext2_fs): Reference grub_ext2_uuid() in `uuid' struct member.
        * include/grub/fs.h (struct grub_fs): Add `uuid' struct member.
        * util/update-grub.in (GRUB_DEVICE_UUID, GRUB_DEVICE_BOOT)
        (GRUB_DEVICE_BOOT_UUID): New variables.
        (GRUB_DRIVE. GRUB_DRIVE_BOOT. GRUB_DRIVE_BOOT_GRUB): Remove.
        * util/grub.d/00_header.in: Set root using `search --fs_uuid' command
        whenever possible.
        * util/grub.d/10_hurd.in: Avoid explicit use of root drive.  Instead,
        just assume `root' variable has the right value.
        * util/grub.d/10_linux.in: Likewise.
        * util/grub-probe.c (probe): Probe for filesystem UUID when requested
        via PRINT_FS_UUID.
        (main): Recognise `-t fs_uuid' argument.
2008-05-30 11:04:08 +00:00
robertmh
da9a6a9463 2008-05-29 Robert Millan <rmh@aybabtu.com>
* fs/affs.c: Update copyright year.
        * fs/ext2.c: Likewise.
        * fs/fshelp.c: Likewise.
        * fs/hfsplus.c: Likewise.
        * fs/ntfs.c: Likewise.
        * fs/xfs.c: Likewise.
        * include/grub/fshelp.h: Likewise.
        * util/grub-mkdevicemap.c: Likewise.
2008-05-29 13:01:43 +00:00
bean
887d2619bf 2008-05-20 Bean <bean123ch@gmail.com>
* fs/fshelp.c (grub_fshelp_map_block): New function.
	(grub_fshelp_find_file): Use 64-bit type for pos and block address.
	Use `>>' and `&' operator to avoid 64-bit divide and modulo.

	* include/grub/fshelp.h (grub_fshelp_journal_type): New enum.
	(GRUB_FSHELP_JOURNAL_UNUSED_MAPPING): New macro.
	(grub_fshelp_journal): New structure.
	(grub_fshelp_map_block): New function prototype.
	(grub_fshelp_read_file): Use grub_disk_addr_t as block type.
	(grub_fshelp_map_block): Likewise.

	* fs/ext2.c (EXT3_FEATURE_COMPAT_HAS_JOURNAL): New macro.
	(EXT3_JOURNAL_MAGIC_NUMBER): Likewise.
	(EXT3_JOURNAL_DESCRIPTOR_BLOCK): Likewise.
	(EXT3_JOURNAL_COMMIT_BLOCK): Likewise.
	(EXT3_JOURNAL_SUPERBLOCK_V1): Likewise.
	(EXT3_JOURNAL_SUPERBLOCK_V2): Likewise.
	(EXT3_JOURNAL_REVOKE_BLOCK): Likewise.
	(EXT3_JOURNAL_FLAG_ESCAPE): Likewise.
	(EXT3_JOURNAL_FLAG_SAME_UUID): Likewise.
	(EXT3_JOURNAL_FLAG_DELETED): Likewise.
	(EXT3_JOURNAL_FLAG_LAST_TAG): Likewise.
	(grub_ext2_sblock): New members for journal support.
	(grub_ext3_journal_header): New structure.
	(grub_ext3_journal_revoke_header): Likewise.
	(grub_ext3_journal_block_tag): Likewise.
	(grub_ext3_journal_sblock): Likewise.
	(grub_fshelp_node): New members logfile and journal.
	(grub_ext2_read_block): Change block type to grub_disk_addr_t. Use
	grub_fshelp_map_block to get real block number.
	(grub_ext2_blockgroup): Use grub_fshelp_map_block to get real block
	number.
	(grub_ext2_read_inode): Likewise.
	(grub_ext3_get_journal): New function.
	(grub_read_inode): Initialize journal using grub_ext3_get_journal.
	(grub_ext2_close): Release memory used by journal.

	* fs/reiserfs.c (REISERFS_MAGIC_STRING): Changed to "ReIsEr".
	(REISERFS_MAGIC_DESC_BLOCK): New macro.
	(grub_reiserfs_transaction_header): Renamed to
	grub_reiserfs_description_block, replace field data with real_blocks.
	(grub_reiserfs_commit_block): New structure.
	(grub_reiserfs_data): New member journal.
	(grub_reiserfs_get_item): Use grub_fshelp_map_block to get real block
	number.
	(grub_reiserfs_read_symlink): Likewise.
	(grub_reiserfs_iterate_dir): Likewise.
	(grub_reiserfs_open): Likewise.
	(grub_reiserfs_read): Likewise.
	(grub_reiserfs_get_journal): New function.
	(grub_reiserfs_mount): Use "ReIsEr" as super block magic, as there are
	three varieties ReIsErFs, ReIsEr2Fs and ReIsEr3Fs. Initialize journal
	using grub_reiserfs_get_journal.
	(grub_reiserfs_close): Release memory used by journal.

	* fs/affs.c (grub_affs_read_block): Change block type to
	grub_disk_addr_t. Use grub_divmod64 to do 64-bit division.

	* fs/afs.c (grub_afs_read_block): Change block type to grub_disk_addr_t.

	* fs/hfsplus.c (grub_hfsplus_read_block): Likewise.

	* fs/ntfs.c (grub_ntfs_read_block): Likewise.

	* fs/udf.c (grub_udf_read_block): Change block type to
	grub_disk_addr_t. Use type cast to avoid warning.

	* fs/xfs.c (grub_xfs_read_block): Likewise.
2008-05-20 05:00:53 +00:00
proski
ba7328dcba 2008-04-02 Pavel Roskin <proski@gnu.org>
* disk/raid.c (grub_raid_memberlist): Fix a signedness warning.
	* fs/cpio.c (grub_cpio_read): Likewise.
2008-04-02 06:10:44 +00:00
bean
a33224e04b 2008-03-31 Bean <bean123ch@gmail.com>
* video/reader/png.c (grub_png_data): New member is_16bit and
	image_data.
	(grub_png_decode_image_header): Detect 16 bit png image.
	(grub_png_convert_image): New function to convert 16 bit image to 8 bit.
	(grub_png_decode_png): Call grub_png_convert_image for 16 bit image.
	(grub_video_reader_png): Release memory occupied by image_data.

	* fs/ntfs.c (find_attr): Handle non-resident attribute list larger than
	4096 bytes.
	(grub_nfs_mount): Skip the test for sector per cluster.

	* include/grub/ntfs.h (MAX_SPC): Removed.
2008-03-31 12:00:48 +00:00
bean
86cb4f54b4 2008-03-31 Bean <bean123ch@gmail.com>
* conf/common.rmk (pkgdata_MODULES): Add afs.mod.
	(grub_probe_SOURCES): Add fs/afs.c.
	(grub_fstest_SOURCES): Likewise.
	(afs_mod_SOURCES): New variable.
	(afs_mod_CFLAGS): Likewise.
	(afs_mod_LDFLAGS): Likewise.

	* conf/i386-pc.rmk (grub_setup_SOURCES): Add fs/afs.c.
	(grub_emu_SOURCES): Likewise.

	* conf/i386-efi.rmk (grub_emu_SOURCES): Likewise.

	* conf/i386-ieee1275.rmk (grub_emu_SOURCES): Likewise.

	* conf/i386-linuxbios.rmk (grub_emu_SOURCES): Likewise.

	* conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise.

	* fs/afs.c: New file.
2008-03-31 11:18:00 +00:00
proski
8790bb0466 2008-03-30 Pavel Roskin <proski@gnu.org>
* fs/udf.c (grub_udf_mount): Fix warning about a shadowing a
	variable.
	* include/grub/i386/loader.h: Change declaration of
	grub_linux_boot() to match what grub_loader_set() expects.
	* util/getroot.c (grub_guess_root_device): Return const char* to
	fix a warning.
	* util/grub-probe.c (probe): Fix a warning about uninitialized
	abstraction_name variable.
	* util/i386/get_disk_name.c (grub_util_get_disk_name): Mark
	second argument as unused to fix a warning.
2008-03-30 18:04:40 +00:00
bean
2b89344ec4 2008-03-02 Bean <bean123ch@gmail.com>
* fs/reiserfs.c (grub_reiserfs_read_symlink): Add 0 at the end of
	symlink_buffer.
2008-03-02 08:16:52 +00:00
bean
0d16e571f1 2008-02-24 Bean <bean123ch@gmail.com>
* fs/iso9660.c (GRUB_ISO9660_VOLDESC_BOOT): New macro.
	(GRUB_ISO9660_VOLDESC_PRIMARY): Likewise.
	(GRUB_ISO9660_VOLDESC_SUPP): Likewise.
	(GRUB_ISO9660_VOLDESC_PART): Likewise.
	(GRUB_ISO9660_VOLDESC_END): Likewise.
	(grub_iso9660_primary_voldesc): New member escape.
	(grub_iso9660_data): New member joliet.
	(grub_iso9660_convert_string): New function.
	(grub_iso9660_mount): Detect joliet extension.
	(grub_iso9660_iterate_dir): Convert filename when joliet is detected.
	(grub_iso9660_iso9660_label): Likewise.

	* conf/common.rmk (pkgdata_MODULES): Add udf.mod.
	(grub_setup_SOURCES): Add fs/udf.c.
	(grub_fstest_SOURCES): Likewise.
	(udf_mod_SOURCES): New variable.
	(udf_mod_CFLAGS): Likewise.
	(udf_mod_LDFLAGS): Likewise.

	* conf/i386-pc.rmk (grub_setup_SOURCES): Add fs/udf.c.
	(grub_emu_SOURCES): Likewise.

	* conf/i386-efi.rmk (grub_emu_SOURCES): Likewise.

	* conf/i386-ieee1275.rmk (grub_emu_SOURCES): Likewise.

	* conf/i386-linuxbios.rmk (grub_emu_SOURCES): Likewise.

	* conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise.

	* fs/udf.c: New file.
2008-02-24 15:34:15 +00:00
robertmh
b37a922267 2008-02-08 Robert Millan <rmh@aybabtu.com>
* disk/raid.c: Update copyright.
        * fs/cpio.c: Likewise.
        * include/grub/raid.h: Likewise.
        * loader/i386/pc/multiboot.c: Likewise.
        * util/hostfs.c: Likewise.
2008-02-08 21:27:55 +00:00
bean
b0dfd29ab2 2008-02-06 Christian Franke <franke@computer.org>
* fs/cpio.c (grub_cpio_find_file): Return GRUB_ERR_NONE
	(and set *ofs = 0) instead of GRUB_ERR_FILE_NOT_FOUND on
	last block of a cpio or tar stream.
	Check for "TRAILER!!!" instead of any empty data
	block to detect last block of a cpio stream.
	(grub_cpio_dir): Fix constness of variable np.
	(grub_cpio_open): Return GRUB_ERR_FILE_NOT_FOUND if
	cpio or tar trailer is detected.  This fixes a crash
	on open of a non existing file.
2008-02-06 19:57:40 +00:00
bean
c004e1b477 2008-02-02 Bean <bean123ch@gmail.com>
* fs/ufs.c (INODE_BLKSZ): Fix incorrect value.
        (grub_ufs_get_file_block): Fix indirect block calculation problem.

        * fs/xfs.c (grub_xfs_sblock): New member log2_dirblk.
        (grub_xfs_btree_node): New structure.
        (grub_xfs_btree_root): New structure.
        (grub_xfs_inode): New members nblocks, extsize, nextents and btree.
        (GRUB_XFS_EXTENT_OFFSET): Use exts instead of inode->data.extents.
        (GRUB_XFS_EXTENT_BLOCK): Likewise.
        (GRUB_XFS_EXTENT_SIZE): Likewise.
        (grub_xfs_read_block): Support btree format type.
        (grub_xfs_iterate_dir): Use NESTED_FUNC_ATTR in call_hook.
        Use directory block as basic unit.

        * fs/fshelp.c (grub_fshelp_read_file): Bug fix for sparse block.

        * aclocal.m4 (grub_i386_CHECK_REGPARM_BUG): Define NESTED_FUNC_ATTR as
        __attribute__ ((__regparm__ (1))).
2008-02-02 14:15:31 +00:00
bean
22da1f6f0f 2008-01-26 Bean <bean123ch@gmail.com>
* fs/reiserfs.c (grub_fshelp_node): New member next_offset.
        (grub_reiserfs_get_item): Save offset of the next item.
        (grub_reiserfs_iterate_dir): Use next_offset to find next item.
2008-01-26 13:28:37 +00:00
bean
bac332a11a 2008-01-24 Bean <bean123ch@gmail.com>
* fs/ufs.c (GRUB_UFS_VOLNAME_LEN): New macro.
        (grub_ufs_sblock): New member volume name.
        (grub_ufs_find_file): Fix string copy bug.
        (grub_ufs_label): Implement this function properly.

        * fs/hfs.c (grub_hfs_cnid_type): New enum.
        (grub_hfs_iterate_records): Use the correct file number for extents
        and catalog file. Fix problem in next index calculation.
        (grub_hfs_find_node): Replace recursive function call with loop.
        (grub_hfs_iterate_dir): Replace recursive function call with loop.
2008-01-23 20:21:18 +00:00
bean
44023a2816 2008-01-22 Bean <bean123ch@gmail.com>
* fs/cpio.c (grub_cpio_find_file): Return GRUB_ERR_FILE_NOT_FOUND when
	there are no more items.
2008-01-22 12:44:38 +00:00
robertmh
1a8b05264d 2008-01-21 Robert Millan <rmh@aybabtu.com>
Fix detection of very small filesystems (like tar).

        * fs/reiserfs.c (grub_reiserfs_mount): When disk is too small to
        contain a ReiserFS, abort with GRUB_ERR_BAD_FS rather than
        GRUB_ERR_OUT_OF_RANGE (which made the upper layer think there's
        a problem with this disk).
2008-01-21 14:32:49 +00:00
okuji
52bd3de956 2008-01-12 Yoshinori K. Okuji <okuji@enbug.org>
Remove some unused code from reiserfs.

    * fs/reiserfs.c (struct grub_reiserfs_key)
    [GRUB_REISERFS_KEYV2_BITFIELD]: Removed offset and type.
    (struct grub_reiserfs_node_body): Removed.
    (grub_reiserfs_get_key_v2_type) [GRUB_REISERFS_KEYV2_BITFIELD]:
    Likewise.
    (grub_reiserfs_get_key_offset) [GRUB_REISERFS_KEYV2_BITFIELD]:
    Likewise.
    (grub_reiserfs_set_key_offset) [GRUB_REISERFS_KEYV2_BITFIELD]:
    Likewise.
    (grub_reiserfs_set_key_offset) [GRUB_REISERFS_KEYV2_BITFIELD]:
    Likewise.
    (grub_reiserfs_set_key_type) [GRUB_REISERFS_KEYV2_BITFIELD]:
    Likewise.
    (grub_reiserfs_iterate_dir) [GRUB_REISERFS_KEYV2_BITFIELD]:
    Likewise.
    (grub_reiserfs_open) [GRUB_REISERFS_KEYV2_BITFIELD]: Likewise.
    (grub_reiserfs_read) [GRUB_REISERFS_KEYV2_BITFIELD]: Likewise.
    (grub_reiserfs_dir) [GRUB_REISERFS_KEYV2_BITFIELD]: Likewise.
2008-01-12 00:51:34 +00:00
okuji
868967cfaf 2008-01-06 Yoshinori K. Okuji <okuji@enbug.org>
* fs/reiserfs.c (grub_reiserfs_get_key_v2_type): Handle endianness
    correctly.
    (grub_reiserfs_get_key_offset): Likewise.
    (grub_reiserfs_set_key_offset): Likewise.
    (grub_reiserfs_set_key_type): Likewise.
    (grub_reiserfs_iterate_dir): Return 1 if found, otheriwise 0.

    (GRUB_REISERFS_KEYV2_BITFIELD): Undefined. Probably it would be
    better to remove the bitfield version completely.
2008-01-06 22:57:50 +00:00
okuji
f5db429174 2008-01-06 Yoshinori K. Okuji <okuji@enbug.org>
* fs/reiserfs.c (grub_reiserfs_iterate_dir): ENTRY_ITEM must be
    allocated from the heap, due to the fshelp implementation.
    (grub_reiserfs_dir): Free NODE, due to the same reason.
2008-01-06 15:34:11 +00:00
okuji
492e6d9d4b 2008-01-06 Yoshinori K. Okuji <okuji@enbug.org>
Mostly from Vincent Pelletier:

    * fs/reiserfs.c: New file.

    * conf/common.rmk (pkglib_MODULES): Added reiserfs.mod.
    (reiserfs_mod_SOURCES): New variable.
    (reiserfs_mod_CFLAGS): Likewise.
    (reiserfs_mod_LDFLAGS): Likewise.

    * DISTLIST: Added boot/i386/pc/lnxboot.S, commands/hexdump.c,
    disk/ata.c, fs/cpio.c, fs/ntfscomp.c, fs/reiserfs.c,
    include/grub/ntfs.h, include/grub/i386/pc/machine.h, and
    normal/color.c.
2008-01-06 14:14:31 +00:00
proski
cc85c3c340 Typo fixes in comments and variable names. 2007-12-30 08:52:06 +00:00
robertmh
fc6e896cc5 2007-12-26 Bean <bean123ch@gmail.com>
* conf/common.rmk (pkgdata_MODULES): Add cpio.mod.
	(cpio_mod_SOURCES): New variable.
	(cpio_mod_CFLAGS): Likewise.
	(cpio_mod_LDFLAGS): Likewise.

	* fs/cpio.c: New file.

	* conf/i386-pc.rmk (grub_emu_SOURCES): Add cpio.c.

	* conf/i386-efi.rmk (grub_emu_SOURCES): Likewise.

	* conf/i386-linuxbios.rmk (grub_emu_SOURCES): Likewise.

	* conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise.
2007-12-26 07:51:19 +00:00
robertmh
4bc72aa96f 2007-12-21 Bean <bean123ch@gmail.com>
* conf/common.rmk (pkgdata_MODULES): Add ntfscomp.mod.
	(ntfscomp_mod_SOURCES): New variable.
	(ntfscomp_mod_CFLAGS): Likewise.
	(ntfscomp_mod_LDFLAGS): Likewise.

	* conf/i386-pc.rmk (grub_setup_SOURCES): Add fs/ntfscomp.c.
	(grub_probe_SOURCES): Likewise.
	(grub_emu_SOURCES): Likewise.

	* conf/i386-efi.rmk (grub_probe_SOURCES): Add fs/ntfscomp.c.
	(grub_emu_SOURCES): Likewise.

	* conf/i386-linuxbios.rmk (grub_probe_SOURCES): Add fs/ntfscomp.c.
	(grub_emu_SOURCES): Likewise.

	* conf/powerpc-ieee1275.rmk (grub_probe_SOURCES): Add fs/ntfscomp.c.
	(grub_emu_SOURCES): Likewise.

	* fs/ntfs.c (grub_ntfscomp_func): New variable.
	(read_run_list): Renamed to grub_ntfs_read_run_list.
	(decomp_nextvcn): Moved to ntfscomp.c.
	(decomp_getch): Likewise.
	(decomp_get16): Likewise.
	(decomp_block): Likewise.
	(read_block): Likewise.
	(read_data): Partially moved to ntfscomp.c.
	(fixup): Change unsigned to grub_uint16_t.
	(read_mft): Change unsigned long to grub_uint32_t.
	(read_attr): Likewise.
	(read_data): Likewise.
	(read_run_data): Likewise.
	(read_run_list): Likewise.
	(read_mft): Likewise.

	* fs/ntfscomp.c: New file.

	* include/grub/ntfs.h: New file.
2007-12-21 11:41:23 +00:00
robertmh
270c237dbe 2007-11-10 Bean <bean123ch@gmail.com>
* fs/ntfs.c (read_block): Fix a bug caused by adjacent blocks.
2007-11-10 20:08:33 +00:00
marco_g
72c49aab72 Something I forgot during the NTFS commit :) 2007-08-03 07:44:01 +00:00
marco_g
9959f7dbb5 2007-08-02 Bean <bean123ch@gmail.com>
* disk.h (grub_disk): Use NESTED_FUNC_ATTR.

	* file.h (grub_file): Likewise.

	* fshelp.h (grub_fshelp_read_file): Likewise.

	* util/i386/pc/grub-setup.c (setup): Likewise.
	(save_first_sector): Likewise.
	(save_blocklists): Likewise.

	* fs/affs.c (grub_affs_read_file): Likewise.

	* fs/ext2.c (grub_ext2_read_file): Likewise.

	* fs/fat.c (grub_fat_read_data): Likewise.

	* fs/fshelp.c (grub_fshelp_read_file): Likewise.

	* fs/hfs.c (grub_hfs_read_file): Likewise.

	* fs/hfsplus.c (grub_hfsplus_read_file): Likewise.

	* fs/jfs.c (grub_jfs_read_file): Likewise.

	* fs/minix.c (grub_minix_read_file): Likewise.

	* fs/sfs.c (grub_sfs_read_file): Likewise.

	* fs/ufs.c (grub_ufs_read_file): Likewise.

	* fs/xfs.c (grub_xfs_read_file): Likewise.

	* command/blocklist.c (read_blocklist): Likewise.
	(print_blocklist): Likewise.
2007-08-02 18:40:37 +00:00
marco_g
0a203f83ff 2007-08-02 Marco Gerards <marco@gnu.org>
* conf/i386-pc.rmk (grub_emu_SOURCES): Add `disk/host.c' and
	`util/hostfs.c'.

	* disk/host.c: New file.

	* util/hostfs.c: Likewise.

	* fs/hfsplus.c (grub_hfsplus_mount): When reading out of disk,
	return `GRUB_ERR_BAD_FS'.
	* fs/sfs.c (grub_sfs_mount): Likewise.
	* fs/xfs.c (grub_xfs_mount): Likewise.

	* include/grub/disk.h (enum grub_disk_dev_id): Add
	`GRUB_DISK_DEVICE_HOST_ID'.

	* util/grub-emu.c (main): Initialize and de-initialize hostfs.
2007-08-02 17:24:06 +00:00
okuji
5a79f472c7 2007-07-22 Yoshinori K. Okuji <okuji@enbug.org>
Migrate to GNU General Public License Version 3.

    * COPYING: Replaced with the plain text version of GPLv3.

    * config.guess: Updated from gnulib.
    * config.sub: Likewise.

    * geninit.sh: Output a GPLv3 copyright notice.
    * geninitheader.sh: Likewise.
    * genmodsrc.sh: Likewise.
    * gensymlist.sh.in: Likewise.

    * boot/i386/pc/boot.S: Upgraded to GPLv3.
    * boot/i386/pc/diskboot.S: Likewise.
    * boot/i386/pc/pxeboot.S: Likewise.
    * commands/blocklist.c: Likewise.
    * commands/boot.c: Likewise.
    * commands/cat.c: Likewise.
    * commands/cmp.c: Likewise.
    * commands/configfile.c: Likewise.
    * commands/echo.c: Likewise.
    * commands/help.c: Likewise.
    * commands/ls.c: Likewise.
    * commands/search.c: Likewise.
    * commands/terminal.c: Likewise.
    * commands/test.c: Likewise.
    * commands/videotest.c: Likewise.
    * commands/i386/cpuid.c: Likewise.
    * commands/i386/pc/halt.c: Likewise.
    * commands/i386/pc/play.c: Likewise.
    * commands/i386/pc/reboot.c: Likewise.
    * commands/i386/pc/vbeinfo.c: Likewise.
    * commands/i386/pc/vbetest.c: Likewise.
    * commands/ieee1275/halt.c: Likewise.
    * commands/ieee1275/reboot.c: Likewise.
    * commands/ieee1275/suspend.c: Likewise.
    * disk/loopback.c: Likewise.
    * disk/lvm.c: Likewise.
    * disk/raid.c: Likewise.
    * disk/efi/efidisk.c: Likewise.
    * disk/i386/pc/biosdisk.c: Likewise.
    * disk/ieee1275/ofdisk.c: Likewise.
    * font/manager.c: Likewise.
    * fs/affs.c: Likewise.
    * fs/ext2.c: Likewise.
    * fs/fat.c: Likewise.
    * fs/fshelp.c: Likewise.
    * fs/hfs.c: Likewise.
    * fs/hfsplus.c: Likewise.
    * fs/iso9660.c: Likewise.
    * fs/jfs.c: Likewise.
    * fs/minix.c: Likewise.
    * fs/sfs.c: Likewise.
    * fs/ufs.c: Likewise.
    * fs/xfs.c: Likewise.
    * hello/hello.c: Likewise.
    * include/grub/acorn_filecore.h: Likewise.
    * include/grub/arg.h: Likewise.
    * include/grub/bitmap.h: Likewise.
    * include/grub/boot.h: Likewise.
    * include/grub/cache.h: Likewise.
    * include/grub/device.h: Likewise.
    * include/grub/disk.h: Likewise.
    * include/grub/dl.h: Likewise.
    * include/grub/elfload.h: Likewise.
    * include/grub/env.h: Likewise.
    * include/grub/err.h: Likewise.
    * include/grub/file.h: Likewise.
    * include/grub/font.h: Likewise.
    * include/grub/fs.h: Likewise.
    * include/grub/fshelp.h: Likewise.
    * include/grub/gzio.h: Likewise.
    * include/grub/hfs.h: Likewise.
    * include/grub/kernel.h: Likewise.
    * include/grub/loader.h: Likewise.
    * include/grub/lvm.h: Likewise.
    * include/grub/misc.h: Likewise.
    * include/grub/mm.h: Likewise.
    * include/grub/net.h: Likewise.
    * include/grub/normal.h: Likewise.
    * include/grub/parser.h: Likewise.
    * include/grub/partition.h: Likewise.
    * include/grub/pc_partition.h: Likewise.
    * include/grub/raid.h: Likewise.
    * include/grub/rescue.h: Likewise.
    * include/grub/script.h: Likewise.
    * include/grub/setjmp.h: Likewise.
    * include/grub/symbol.h: Likewise.
    * include/grub/term.h: Likewise.
    * include/grub/terminfo.h: Likewise.
    * include/grub/tparm.h: Likewise.
    * include/grub/types.h: Likewise.
    * include/grub/video.h: Likewise.
    * include/grub/efi/api.h: Likewise.
    * include/grub/efi/chainloader.h: Likewise.
    * include/grub/efi/console.h: Likewise.
    * include/grub/efi/console_control.h: Likewise.
    * include/grub/efi/disk.h: Likewise.
    * include/grub/efi/efi.h: Likewise.
    * include/grub/efi/pe32.h: Likewise.
    * include/grub/efi/time.h: Likewise.
    * include/grub/i386/linux.h: Likewise.
    * include/grub/i386/setjmp.h: Likewise.
    * include/grub/i386/types.h: Likewise.
    * include/grub/i386/efi/kernel.h: Likewise.
    * include/grub/i386/efi/loader.h: Likewise.
    * include/grub/i386/efi/time.h: Likewise.
    * include/grub/i386/pc/biosdisk.h: Likewise.
    * include/grub/i386/pc/boot.h: Likewise.
    * include/grub/i386/pc/chainloader.h: Likewise.
    * include/grub/i386/pc/console.h: Likewise.
    * include/grub/i386/pc/init.h: Likewise.
    * include/grub/i386/pc/kernel.h: Likewise.
    * include/grub/i386/pc/loader.h: Likewise.
    * include/grub/i386/pc/memory.h: Likewise.
    * include/grub/i386/pc/multiboot.h: Likewise.
    * include/grub/i386/pc/serial.h: Likewise.
    * include/grub/i386/pc/time.h: Likewise.
    * include/grub/i386/pc/vbe.h: Likewise.
    * include/grub/i386/pc/vbeblit.h: Likewise.
    * include/grub/i386/pc/vbefill.h: Likewise.
    * include/grub/i386/pc/vbeutil.h: Likewise.
    * include/grub/i386/pc/vga.h: Likewise.
    * include/grub/ieee1275/ieee1275.h: Likewise.
    * include/grub/ieee1275/ofdisk.h: Likewise.
    * include/grub/powerpc/libgcc.h: Likewise.
    * include/grub/powerpc/setjmp.h: Likewise.
    * include/grub/powerpc/types.h: Likewise.
    * include/grub/powerpc/ieee1275/biosdisk.h: Likewise.
    * include/grub/powerpc/ieee1275/console.h: Likewise.
    * include/grub/powerpc/ieee1275/ieee1275.h: Likewise.
    * include/grub/powerpc/ieee1275/kernel.h: Likewise.
    * include/grub/powerpc/ieee1275/loader.h: Likewise.
    * include/grub/powerpc/ieee1275/multiboot.h: Likewise.
    * include/grub/powerpc/ieee1275/time.h: Likewise.
    * include/grub/powerpc/ieee1275/util/biosdisk.h: Likewise.
    * include/grub/sparc64/libgcc.h: Likewise.
    * include/grub/sparc64/setjmp.h: Likewise.
    * include/grub/sparc64/types.h: Likewise.
    * include/grub/sparc64/ieee1275/console.h: Likewise.
    * include/grub/sparc64/ieee1275/ieee1275.h: Likewise.
    * include/grub/sparc64/ieee1275/kernel.h: Likewise.
    * include/grub/sparc64/ieee1275/time.h: Likewise.
    * include/grub/util/biosdisk.h: Likewise.
    * include/grub/util/getroot.h: Likewise.
    * include/grub/util/lvm.h: Likewise.
    * include/grub/util/misc.h: Likewise.
    * include/grub/util/raid.h: Likewise.
    * include/grub/util/resolve.h: Likewise.
    * io/gzio.c: Likewise.
    * kern/device.c: Likewise.
    * kern/disk.c: Likewise.
    * kern/dl.c: Likewise.
    * kern/elf.c: Likewise.
    * kern/env.c: Likewise.
    * kern/err.c: Likewise.
    * kern/file.c: Likewise.
    * kern/fs.c: Likewise.
    * kern/loader.c: Likewise.
    * kern/main.c: Likewise.
    * kern/misc.c: Likewise.
    * kern/mm.c: Likewise.
    * kern/parser.c: Likewise.
    * kern/partition.c: Likewise.
    * kern/rescue.c: Likewise.
    * kern/term.c: Likewise.
    * kern/efi/efi.c: Likewise.
    * kern/efi/init.c: Likewise.
    * kern/efi/mm.c: Likewise.
    * kern/i386/dl.c: Likewise.
    * kern/i386/efi/init.c: Likewise.
    * kern/i386/efi/startup.S: Likewise.
    * kern/i386/pc/init.c: Likewise.
    * kern/i386/pc/lzo1x.S: Likewise.
    * kern/i386/pc/startup.S: Likewise.
    * kern/ieee1275/ieee1275.c: Likewise.
    * kern/powerpc/cache.S: Likewise.
    * kern/powerpc/dl.c: Likewise.
    * kern/powerpc/ieee1275/cmain.c: Likewise.
    * kern/powerpc/ieee1275/crt0.S: Likewise.
    * kern/powerpc/ieee1275/init.c: Likewise.
    * kern/powerpc/ieee1275/openfw.c: Likewise.
    * kern/sparc64/cache.S: Likewise.
    * kern/sparc64/dl.c: Likewise.
    * kern/sparc64/ieee1275/init.c: Likewise.
    * kern/sparc64/ieee1275/openfw.c: Likewise.
    * loader/efi/chainloader.c: Likewise.
    * loader/efi/chainloader_normal.c: Likewise.
    * loader/i386/efi/linux.c: Likewise.
    * loader/i386/efi/linux_normal.c: Likewise.
    * loader/i386/pc/chainloader.c: Likewise.
    * loader/i386/pc/chainloader_normal.c: Likewise.
    * loader/i386/pc/linux.c: Likewise.
    * loader/i386/pc/linux_normal.c: Likewise.
    * loader/i386/pc/multiboot.c: Likewise.
    * loader/i386/pc/multiboot_normal.c: Likewise.
    * loader/powerpc/ieee1275/linux.c: Likewise.
    * loader/powerpc/ieee1275/linux_normal.c: Likewise.
    * normal/arg.c: Likewise.
    * normal/cmdline.c: Likewise.
    * normal/command.c: Likewise.
    * normal/completion.c: Likewise.
    * normal/execute.c: Likewise.
    * normal/function.c: Likewise.
    * normal/lexer.c: Likewise.
    * normal/main.c: Likewise.
    * normal/menu.c: Likewise.
    * normal/menu_entry.c: Likewise.
    * normal/misc.c: Likewise.
    * normal/parser.y: Likewise.
    * normal/script.c: Likewise.
    * normal/i386/setjmp.S: Likewise.
    * normal/powerpc/setjmp.S: Likewise.
    * normal/sparc64/setjmp.S: Likewise.
    * partmap/acorn.c: Likewise.
    * partmap/amiga.c: Likewise.
    * partmap/apple.c: Likewise.
    * partmap/gpt.c: Likewise.
    * partmap/pc.c: Likewise.
    * partmap/sun.c: Likewise.
    * term/gfxterm.c: Likewise.
    * term/terminfo.c: Likewise.
    * term/efi/console.c: Likewise.
    * term/i386/pc/console.c: Likewise.
    * term/i386/pc/serial.c: Likewise.
    * term/i386/pc/vesafb.c: Likewise.
    * term/i386/pc/vga.c: Likewise.
    * term/ieee1275/ofconsole.c: Likewise.
    * util/biosdisk.c: Likewise.
    * util/console.c: Likewise.
    * util/genmoddep.c: Likewise.
    * util/getroot.c: Likewise.
    * util/grub-emu.c: Likewise.
    * util/grub-mkdevicemap.c: Likewise.
    * util/grub-probe.c: Likewise.
    * util/lvm.c: Likewise.
    * util/misc.c: Likewise.
    * util/raid.c: Likewise.
    * util/resolve.c: Likewise.
    * util/update-grub.in: Likewise.
    * util/update-grub_lib.in: Likewise.
    * util/grub.d/00_header.in: Likewise.
    * util/grub.d/10_hurd.in: Likewise.
    * util/grub.d/10_linux.in: Likewise.
    * util/i386/efi/grub-install.in: Likewise.
    * util/i386/efi/grub-mkimage.c: Likewise.
    * util/i386/pc/grub-install.in: Likewise.
    * util/i386/pc/grub-mkimage.c: Likewise.
    * util/i386/pc/grub-mkrescue.in: Likewise.
    * util/i386/pc/grub-setup.c: Likewise.
    * util/i386/pc/misc.c: Likewise.
    * util/powerpc/ieee1275/grub-install.in: Likewise.
    * util/powerpc/ieee1275/grub-mkimage.c: Likewise.
    * util/powerpc/ieee1275/misc.c: Likewise.
    * video/bitmap.c: Likewise.
    * video/video.c: Likewise.
    * video/i386/pc/vbe.c: Likewise.
    * video/i386/pc/vbeblit.c: Likewise.
    * video/i386/pc/vbefill.c: Likewise.
    * video/i386/pc/vbeutil.c: Likewise.
    * video/readers/tga.c: Likewise.
2007-07-21 23:32:33 +00:00
jeroen
21c8cbb1ab 2007-05-17 Jeroen Dekkers <jeroen@dekkers.cx>
* video/i386/pc/vbe.c (grub_video_vbe_create_render_target): Add
	__attribute_ ((unused)) to mode_type argument.

	* util/getroot.c (grub_guess_root_device): Fix #endif.

	* kern/misc.c (memcmp): Fix prototype.

	* include/grub/partition.h [GRUB_UTIL]
	(grub_gpt_partition_map_init): Add prototype.
	(grub_gpt_partition_map_fini): Likewise.

	* fs/jfs.c (struct grub_jfs_inode): Put __attribute__ ((packed)
	at the right place.

	* fs/fat.c (grub_fat_mount): Replace ~0UL with ~0U.
	(grub_fat_read_data): Likewise.
	(grub_fat_find_dir): Likewise.

	* font/manager.c (find_glyph): Make table a const.
	(grub_font_get_glyph): Remove bitmap from if statement.
2007-05-17 15:43:32 +00:00
okuji
6795c4e10b 2007-03-19 Yoshinori K. Okuji <okuji@enbug.org>
* fs/ext2.c (EXT2_GOOD_OLD_REVISION): New macro.
    (EXT2_GOOD_OLD_INODE_SIZE): Likewise.
    (EXT2_REVISION): Likewise.
    (EXT2_INODE_SIZE): Likewise.
    (struct grub_ext2_block_group): Added a missing member
    "used_dirs".
    (grub_ext2_read_inode): Divide by the inode size in a superblock
    instead of 128 to obtain INODES_PER_BLOCK.
    Use the macro EXT2_INODE_SIZE instead of directly using
    SBLOCK->INODE_SIZE.
2007-03-19 00:04:29 +00:00
okuji
d70af616c2 2007-03-18 Yoshinori K. Okuji <okuji@enbug.org>
* fs/ext2.c (grub_ext2_read_inode): Use the inode size in a
    superblock instead of the structure size to compute an
    offset. This fixes the problem that GRUB could not read a
    filesystem when inode size is different from 128-byte.
2007-03-18 01:18:39 +00:00
okuji
deae281bfe 2006-06-05 Yoshinori K. Okuji <okuji@enbug.org>
Count partitions from 1 instead of 0 in the string representation
        of partitions. Still use 0-based internally.

        * partmap/sun.c (grub_sun_is_valid): A cosmetic change.
        (sun_partition_map_iterate): Use grub_partition_t instead of
        struct grub_partition *. Cast DESC->START_CYLINDER to
        grub_uint64_t after converting the endian.
        (sun_partition_map_probe): Subtract 1 for PARTNUM.
        (sun_partition_map_get_name): Add 1 to P->INDEX.

        * partmap/pc.c (grub_partition_parse): Subtract 1 for
        PCDATA->DOS_PART.
        (pc_partition_map_get_name): Add 1 into PCDATA->DOS_PART.

        * partmap/gpt.c (gpt_partition_map_iterate): Initialize PARTNO to
        zero instead of one.
        (gpt_partition_map_probe): Subtract 1 for PARTNUM.
        (gpt_partition_map_get_name): Add 1 into P->INDEX.

        * partmap/apple.c (apple_partition_map_iterate): Change the type
        of POS to unsigned.
        (apple_partition_map_probe): Subtract 1 for PARTNUM.
        (apple_partition_map_get_name): Add 1 into P->INDEX.

        * partmap/amiga.c (amiga_partition_map_iterate): Change the type
        of POS to unsigned.
        (amiga_partition_map_iterate): Cast NEXT to grub_off_t to
        calculate the offset of a partition.
        (amiga_partition_map_probe): Subtract 1 for PARTNUM.
        (amiga_partition_map_get_name): Add 1 into P->INDEX.

        * partmap/acorn.c (acorn_partition_map_find): Change the type of
        SECTOR to grub_disk_addr_t.
        (acorn_partition_map_iterate): Likewise.
        (acorn_partition_map_probe): Subtract 1 for PARTNUM.
        Change the type of SECTOR to grub_disk_addr_t. Declare P on the
        top.
        (acorn_partition_map_get_name): Add 1 into P->INDEX.

        * kern/i386/pc/init.c (make_install_device): Add 1 into
        GRUB_INSTALL_DOS_PART.

        * fs/iso9660.c (grub_iso9660_mount): Fixed a reversed
        conditional.
2006-06-05 17:18:31 +00:00
okuji
524a1e6a40 2006-06-04 Yoshinori K. Okuji <okuji@enbug.org>
Clean up the code to support 64-bit addressing in disks and
        files. This change is not enough for filesystems yet.

        * util/i386/pc/grub-setup.c (struct boot_blocklist): Change the
        type of "start" to grub_uint64_t.
        (setup): Change the types of KERNEL_SECTOR and FIRST_SECTOR to
        grub_disk_addr_t * and grub_disk_addr_t. Fix the format string in
        save_first_sector and save_blocklists. Use grub_le_to_cpu64 to
        convert addresses.

        * util/i386/pc/biosdisk.c (open_device): Change the type of SECTOR
        to grub_disk_addr_t.

        * partmap/gpt.c (gpt_partition_map_iterate): Fix the format
        string.

        * partmap/pc.c (pc_partition_map_iterate): Likewise.

        * partmap/amiga.c (amiga_partition_map_iterate): Cast RDSK.MAGIC
        to char *.

        * normal/script.c (grub_script_parse): Remove unused MEMFREE.

        * normal/parser.y (YYLTYPE_IS_TRIVIAL): New macro.

        * normal/lexer.c (grub_script_yyerror): Specify unused to LEX.

        * loader/i386/pc/multiboot.c (grub_multiboot_load_elf64): Cast -1
        to grub_off_t, to detect an error from grub_file_seek.
        (grub_multiboot_load_elf32): Likewise.

        * kern/misc.c (grub_strtoul): Use grub_strtoull. Return the
        maximum unsigned long value when an overflow is detected.
        (grub_strtoull): New function.
        (grub_divmod64): Likewise.
        (grub_lltoa): use grub_divmod64.

        * kern/fs.c (struct grub_fs_block): Change the type of "offset" to
        grub_disk_addr_t.
        (grub_fs_blocklist_open): Increase P if P is not NULL to advance
        the pointer to next character. Use grub_strtoull instead of
        grub_strtoul.
        (grub_fs_blocklist_read): Change the types of SECTOR, OFFSET and
        SIZE to grub_disk_addr_t, grub_off_t and grub_size_t,
        respectively.

        * kern/file.c (grub_file_read): Prevent an oveflow of LEN, as the
        return value is signed.
        (grub_file_seek): Change the type of OLD to grub_off_t. Do not
        test if OFFSET is less than zero, as OFFSET is unsigned now.

        * kern/disk.c (struct grub_disk_cache): Change the type of
        "sector" to grub_disk_addr_t.
        (grub_disk_cache_get_index): Change the type of SECTOR to
        grub_disk_addr_t. Calculate the hash with SECTOR casted to
        unsigned after shifting.
        (grub_disk_cache_invalidate): Change the type of SECTOR to
        grub_disk_addr_t.
        (grub_disk_cache_unlock): Likewise.
        (grub_disk_cache_store): Likewise.
        (grub_disk_check_range): Change the types of SECTOR, OFFSET, SIZE,
        START and LEN to grub_disk_addr_t *, grub_off_t *, grub_size_t,
        grub_disk_addr_t and grub_uint64_t, respectively.
        (grub_disk_read): Use an unsigned variable REAL_OFFSET for the
        body, as the value of OFFSET is tweaked by
        grub_disk_check_range. Change the types of START_SECTOR, LEN and
        POS to grub_disk_addr_t, grub_size_t and grub_size_t,
        respectively.
        (grub_disk_write): Use an unsigned variable REAL_OFFSET for the
        body, as the value of OFFSET is tweaked by
        grub_disk_check_range. Change the types of LEN and N to
        grub_size_t.

        * io/gzio.c (struct grub_gzio): Change the types of "data_offset"
        and "saved_offset" to grub_off_t.
        (test_header): Cast BUF to char *.
        (get_byte): Cast GZIO->DATA_OFFSET to grub_off_t. Cast GZIO->INBUF
        to char *.
        (grub_gzio_read): Change the types of OFFSET and SIZE to
        grub_off_t and grub_size_t, respectively.

        * include/grub/i386/pc/boot.h (GRUB_BOOT_MACHINE_FORCE_LBA):
        Removed.
        (GRUB_BOOT_MACHINE_BOOT_DRIVE): Changed to 0x4c.
        (GRUB_BOOT_MACHINE_KERNEL_ADDRESS): Changed to 0x40.
        (GRUB_BOOT_MACHINE_KERNEL_SEGMENT): Changed to 0x42.
        (GRUB_BOOT_MACHINE_DRIVE_CHECK): Changed to 0x4e.
        (GRUB_BOOT_MACHINE_LIST_SIZE): Increased to 12.

        * include/grub/types.h (grub_off_t): Unconditionally set to
        grub_uint64_t.
        (grub_disk_addr_t): Changed to grub_uint64_t.

        * include/grub/partition.h (struct grub_partition): Change the
        types of "start", "len" and "offset" to grub_disk_addr_t,
        grub_uint64_t and grub_disk_addr_t, respectively.
        (grub_partition_get_start): Return grub_disk_addr_t.
        (grub_partition_get_len): Return grub_uint64_t.

        * include/grub/misc.h (grub_strtoull): New prototype.
        (grub_divmod64): Likewise.

        * include/grub/fshelp.h (grub_fshelp_read_file): Change the types
        of SECTOR, LEN and FILESIZE to grub_disk_addr_t, grub_size_t and
        grub_off_t, respectively.
        All callers and references changed.

        * include/grub/fs.h (struct grub_fs): Change the type of LEN to
        grub_size_t in "read".
        All callers and references changed.

        * include/grub/file.h (struct grub_file): Change the types of
        "offset" and "size" to grub_off_t and grub_off_t,
        respectively. Change the type of SECTOR to grub_disk_addr_t in
        "read_hook".
        (grub_file_read): Change the type of LEN to grub_size_t.
        (grub_file_seek): Return grub_off_t. Change the type of OFFSET to
        grub_off_t.
        (grub_file_size): Return grub_off_t.
        (grub_file_tell): Likewise.
        All callers and references changed.

        * include/grub/disk.h (struct grub_disk_dev): Change the types of
        SECTOR and SIZE to grub_disk_addr_t and grub_size_t in "read" and
        "write".
        (struct grub_disk): Change the type of "total_sectors" to
        grub_uint64_t. Change the type of SECTOR to grub_disk_addr_t in
        "read_hook".
        (grub_disk_read): Change the types of SECTOR, OFFSET and SIZE to
        grub_disk_addr_t, grub_off_t and grub_size_t, respectively.
        (grub_disk_write): Likewise.
        All callers and references changed.

        * fs/iso9660.c (grub_iso9660_susp_iterate): Cast parameters to
        char * for grub_strncmp to silence gcc.
        (grub_iso9660_mount): Likewise.
        (grub_iso9660_mount): Likewise.
        (grub_iso9660_read_symlink): Likewise. Also, remove the nonsense
        return statement.
        (grub_iso9660_iterate_dir): Likewise.
        (grub_iso9660_label): Cast DATA->VOLDESC.VOLNAME to char *.

        * fs/hfs.c (grub_hfs_read_file): Change the types of SECTOR and
        LEN to grub_disk_addr_t and grub_size_t, respectively.

        * fs/hfsplus.c (grub_hfsplus_read_file): Likewise.

        * fs/jfs.c (grub_jfs_read_file): Likewise.

        * fs/minix.c (grub_jfs_read_file): Likewise.

        * fs/sfs.c (grub_jfs_read_file): Likewise.

        * fs/ufs.c (grub_jfs_read_file): Likewise.

        * fs/xfs.c (grub_jfs_read_file): Likewise.

        * fs/fat.c (grub_fat_read_data): Change the types of SECTOR, LEN
        and SIZE to grub_disk_addr_t, grub_size_t and grub_size_t,
        respectively.

        * fs/ext2.c (grub_ext2_read_block): When an error happens, set
        BLKNR to -1 instead of returning GRUB_ERRNO.
        (grub_ext2_read_file): Change the types of SECTOR and
        LEN to grub_disk_addr_t and grub_size_t, respectively.

        * fs/affs.c (grub_affs_read_file): Change the types of SECTOR and
        LEN to grub_disk_addr_t and grub_size_t, respectively.

        * font/manager.c (grub_font_get_glyph): Cast BITMAP to char * for
        grub_file_read.

        * disk/ieee1275/ofdisk.c (grub_ofdisk_read): Fix the format
        string. Do not cast SECTOR explicitly.

        * disk/i386/pc/biosdisk.c (grub_biosdisk_open): Change the type of
        TOTAL_SECTORS to grub_uint64_t. Do not mask DRP->TOTAL_SECTORS.
        (grub_biosdisk_rw): Change the types of SECTOR and SIZE to
        grub_disk_addr_t and grub_size_t, respectively. If the sector is
        over 2TB and LBA mode is not supported, raise an error.
        (get_safe_sectors): New function.
        (grub_biosdisk_read): Use get_safe_sectors.
        (grub_biosdisk_write): Likewise.

        * disk/efi/efidisk.c (grub_efidisk_read): Fix the format string.
        (grub_efidisk_write): Likewise.

        * disk/loopback.c (delete_loopback): Cosmetic changes.
        (grub_cmd_loopback): Likewise. Also, test NEWDEV->FILENAME
        correctly.
        (grub_loopback_open): Likewise.
        (grub_loopback_read): Likewise. Also, change the type of POS to
        grub_off_t, and fix the usage of grub_memset.

        * commands/i386/pc/play.c: Include grub/machine/time.h.

        * commands/ls.c (grub_ls_list_files): Use "llu" instead of "d" to
        print FILE->SIZE.

        * commands/configfile.c: Include grub/env.h.

        * commands/cmp.c (grub_cmd_cmp): Do not use ERR, but use
        GRUB_ERRNO directly instead. Change the type of POS to
        grub_off_t. Follow the coding standard.

        * commands/blocklist.c: Include grub/partition.h.
        (grub_cmd_blocklist): Return an error if the underlying device is
        not a disk. Take the starting sector of a partition into account,
        if a partition is used.

        * boot/i386/pc/diskboot.S (bootloop): Adapted to the new offset of
        a length field.
        (lba_mode): Support 64-bit addresses.
        (chs_mode): Likewise.
        (copy_buffer): Adapted to the new offsets of a length field and a
        segment field.
        (blocklist_default_start): Allocate 64-bit space.

        * boot/i386/pc/boot.S (force_lba): Removed.
        (boot_drive): Moved to under KERNEL_SECTOR.
        (kernel_sector): Moved to under KENREL_SEGMENT. Allocate 64-bit
        space.
        (real_start): Set %si earlier. Remove code for FORCE_LBA, since it
        is useless.
        (lba_mode): Refactored to support a 64-bit address. More size
        optimization.
        (setup_sectors): Likewise.
2006-06-04 15:56:55 +00:00
okuji
118f4fb31e 2006-05-28 Yoshinori K. Okuji <okuji@enbug.org>
* fs/hfsplus.c (grub_hfsplus_btree_recoffset): Moved to near the
        top.
        (grub_hfsplus_btree_recptr): Likewise.
        (grub_hfsplus_find_block): Do not take RETRY any longer. Use
        FILEBLOCK both to pass a block number and store next block
        number.
        (grub_hfsplus_read_block): Rewritten heavily to support an extent
        overflow file correctly. Specify errors appropriately, because
        fshelp expects that GRUB_ERRNO is set when fails. Reuse
        grub_hfsplus_btree_recptr to get the pointer to a found key.
        (grub_hfsplus_btree_search): Return 1 instead of 0 when no match
        is found.

        * conf/i386-efi.rmk (pkgdata_MODULES): Added _linux.mod and
        linux.mod.
        (_linux_mod_SOURCES): New variable.
        (_linux_mod_CFLAGS): Likewise.
        (_linux_mod_LDFLAGS): Likewise.
        (linux_mod_SOURCES): Likewise.
        (linux_mod_CFLAGS): Likewise.
        (linux_mod_LDFLAGS): Likewise.

        * DISTLIST: Added loader/i386/efi/linux.c,
        loader/i386/efi/linux_normal.c and
        include/grub/i386/efi/loader.h.

        * loader/i386/efi/linux.c: New file.
        * loader/i386/efi/linux_normal.c: Likewise.
        * include/grub/i386/efi/loader.h: Likewise.
2006-05-28 03:20:18 +00:00