Vladimir 'phcoder' Serbinenko
164ebb480d
* include/grub/symbol.h (EXT_C) [GRUB_UTIL]: Removed.
...
(FUNCTION) [GRUB_UTIL]: Likewise.
(VARIABLE) [GRUB_UTIL]: Likewise.
2012-02-10 12:47:42 +01:00
Vladimir 'phcoder' Serbinenko
44318d6168
* include/grub/misc.h: Avoid evaluationg NEED_ENABLE_EXECUTE_STACK and
...
NEED_REGISTER_FRAME_INFO in GRUB_UTIL.
2012-02-10 12:45:32 +01:00
Vladimir 'phcoder' Serbinenko
ccc3b1b898
* grub-core/kern/emu/full.c (grub_emu_post_init): Remove raid reinit.
...
* include/grub/disk.h [GRUB_MACHINE_EMU]: Remove now useless LVM/RAID
declarations.
2012-02-09 23:15:27 +01:00
Vladimir 'phcoder' Serbinenko
b2c0c4a6c6
* include/grub/net.h: Remove double declarations.
2012-02-09 22:44:28 +01:00
Vladimir 'phcoder' Serbinenko
e4e37e8dfa
Fix `help' with unloaded modules.
...
* include/grub/normal.h (grub_dyncmd_get_cmd): New proto.
* grub-core/normal/dyncmd.c (grub_dyncmd_get_cmd): New function.
(grub_dyncmd_dispatcher): Small stylistic fix.
* grub-core/commands/help.c (grub_cmd_help): Load missing modules when
explicit help is requested.
2012-02-09 14:38:34 +01:00
Vladimir 'phcoder' Serbinenko
9c4b5c13e6
Improve gettext support. Stylistic fixes and error handling fixes while
...
on it.
2012-02-08 19:26:01 +01:00
Vladimir 'phcoder' Serbinenko
215c90cb82
* grub-core/lib/i386/relocator16.S: Revert moving A20 code into PM
...
part. Instead setup the correct stack in RM.
* grub-core/lib/i386/relocator.c (grub_relocator16_boot): Reserve place
for stack.
* include/grub/i386/relocator_private.h: New file.
2012-02-07 22:31:14 +01:00
Vladimir 'phcoder' Serbinenko
0ae70393ba
Improve and unify messages.
...
* grub-core/kern/emu/hostdisk.c (grub_util_get_fd_sectors): Add argument
name. All users updated.
Print filename in error.
(read_device_map): Print filename in error.
* util/getroot.c (grub_guess_root_devices): Print filename in error.
(grub_util_get_os_disk): Likewise.
(grub_util_biosdisk_get_grub_dev): Likewise.
(grub_util_check_block_device): Likewise.
(grub_util_check_char_device): Likewise.
(grub_make_system_path_relative_to_its_root): Likewise.
* util/grub-editenv.c (create_envblk_file): Likewise.
(open_envblk_file): Likewise.
(write_envblk): Likewise.
* util/grub-fstest.c (cmd_cp): Likewise.
(cmd_cat): Likewise.
(cmd_cmp): Likewise.
* util/grub-menulst2cfg.c (main): Likewise.
* util/grub-mkfont.c (write_font_ascii_bitmap): Likewise.
(write_font_width_spec): Likewise.
(write_font_pf2): Likewise.
* util/grub-mkimage.c (generate_image): New argument outname.
All users updated.
Remove unreacheable message.
(options): Unify messages.
(help_filter): Likewise.
* util/grub-mklayout.c (usage): Removed (unused).
(main): Print filename in error.
* util/grub-mkrescue.in: Fix wrong quoting.
* util/grub-setup.c (setup): Print filename in error.
* util/ieee1275/ofpath.c (vendor_is_ATA): Likewise.
(check_sas): Likewise.
* util/misc.c (grub_util_get_fp_size): Removed.
(grub_util_get_image_size): Print filename in error.
(grub_util_read_at): Removed.
(grub_util_read_image): Print filename in error.
(grub_util_load_image): Likewise.
(grub_util_write_image_at): New argument filename. All users updated.
Print filename in error.
(grub_util_write_image): New argument filename. All users updated.
Print filename in error.
* util/raid.c (grub_util_raid_getmembers): Print filename in error.
* util/resolve.c (grub_util_resolve_dependencies): Likewise.
2012-02-05 11:07:33 +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
aca002f7e4
* grub-core/kern/err.c (GRUB_MAX_ERRMSG): Move to ...
...
* include/grub/err.h (GRUB_MAX_ERRMSG): ... here.
* include/grub/err.h (grub_error_saved): New struct.
(grub_errmsg): Make array size explicit.
* include/grub/misc.h (grub_error_save): New function.
(grub_error_load): Likewise.
* grub-core/kern/err.c (grub_error_stack_items): Use grub_error_saved.
(grub_error_push): Update `errno' member name.
(grub_error_pop): Likewise
* grub-core/net/tftp.c (tftp_data): New member save_err.
(tftp_receive): Save error.
(tftp_open): Restore error.
2012-02-05 10:24:53 +01:00
Vladimir 'phcoder' Serbinenko
db606889a9
* grub-core/kern/ieee1275/openfw.c (grub_claimmap): Change to
...
grub_error framework. All users updated.
2012-02-04 14:00:23 +01:00
Vladimir 'phcoder' Serbinenko
8be63f2ef6
* Makefile.util.def (grub-mkdevicemap): Removed.
...
* include/grub/emu/hostdisk.h (grub_util_get_os_disk): New proto.
* include/grub/util/deviceiter.h: Removed.
* util/deviceiter.c: Likewise.
* util/getroot.c (grub_util_get_os_disk): New function.
* util/grub-install.in: Remove grub-mkdevicemap. Use -t disk as
replacement for EFI.
* util/grub-mkdevicemap.c: Removed.
* util/grub-probe.c (probe): Handle PRINT_DISK.
(argp_parser): Handle -t disk.
2012-02-03 22:36:51 +01:00
Vladimir 'phcoder' Serbinenko
cf5f7ee788
Support install on multi-device filesystems.
...
* include/grub/emu/getroot.h (grub_guess_root_device): Renamed to ...
(grub_guess_root_devices): ...this. Return char **. All users updated.
* include/grub/emu/misc.h (grub_find_root_device_from_mountinfo):
Removed.
* util/getroot.c (find_root_device_from_libzfs): Moved pool logic to ...
(find_root_devices_from_poolname): ... here.
(grub_find_root_devices_from_mountinfo): Return char **. Make static.
Support zfs-fuse.
(grub_guess_root_device): Rename to ...
(grub_guess_root_devices): ... this. Return char **. All users updated.
* util/grub-install.in: Handle multi-device filesystems.
* util/grub-probe.c (probe). Make device_names a char **. Add delim
argument. All users updated.
Handle multi-device filesystems.
Use 'delim' as separator.
Remove device check to allow filesystems on file.
(main): Support -0 argument. Handle multi-device.
* util/grub-setup.c (setup): Remove root argument. Handle multi-device.
Fix a cross-device check while on it.
(arguments): Remove root_dev.
(argp_parser): Remove -r.
(main): Remove root_dev.
2012-02-03 10:35:28 +01:00
Vladimir 'phcoder' Serbinenko
d68538e928
merge mainline into cbi
2012-02-01 14:30:40 +01:00
Vladimir 'phcoder' Serbinenko
cefa01261b
merge mainline into ehci
2012-02-01 13:19:42 +01:00
Vladimir 'phcoder' Serbinenko
9c08ad8707
* grub-core/disk/scsi.c (grub_scsi_read_capacity): Renamed to ...
...
(grub_scsi_read_capacity10): ... this.
(grub_scsi_read_capacity16): New function.
(grub_scsi_open): Use read_capacity16 if read_capacity10 returned
0xffffffff.
Fix off-by-one error.
* include/grub/scsi.h (grub_scsi): Rename size to last_block and make it
64-bit unsigned.
* include/grub/scsicmd.h (grub_scsi_read_capacity): Rename to ...
(grub_scsi_read_capacity10): ... this.
(grub_scsi_read_capacity_data): Rename to ...
(grub_scsi_read_capacity10_data): ... this. Rename size to last_block.
(grub_scsi_read_capacity16): New struct.
(grub_scsi_read_capacity16_data): Likewise.
(grub_scsi_cmd_t): Rename grub_scsi_cmd_read_capacity to
grub_scsi_cmd_read_capacity10.
New command grub_scsi_cmd_read_capacity16.
2012-01-30 18:33:11 +01:00
Vladimir 'phcoder' Serbinenko
bc8d0f45a5
SCSI >2TiB support.
...
* grub-core/disk/scsi.c (grub_scsi_read16): New function.
(grub_scsi_write16): Likewise.
(grub_scsi_read): Use read16 when necessary.
(grub_scsi_write): Likewise.
* include/grub/scsicmd.h (grub_scsi_read16): New struct.
(grub_scsi_write16): Likewise.
(grub_scsi_cmd_t): Add READ16 and WRITE16.
2012-01-30 12:47:26 +01:00
Vladimir 'phcoder' Serbinenko
cc774926f1
SCSI write support (for usbms mainly).
...
* grub-core/disk/scsi.c (grub_scsi_write10): Uncomment. Make buffer
a const pointer.
(grub_scsi_write): Implement.
* include/grub/scsi.h (grub_scsi_dev): Make write buffer a const pointer
2012-01-30 12:26:11 +01:00
Vladimir 'phcoder' Serbinenko
0b3b3b38bd
* grub-core/lib/posix_wrap/limits.h (SHRT_MAX): New define.
...
(INT_MAX): Likewise.
* grub-core/lib/posix_wrap/stdio.h (snprintf): New function.
* grub-core/lib/posix_wrap/stdlib.h (abs): Likewise.
* grub-core/lib/posix_wrap/string.h (memcmp): Likewise.
(strcpy): Likewise.
(strstr): Likewise.
(strchr): Likewise.
(strncpy): Likewise.
(strcat): Likewise.
(strncat): Likewise.
(strcoll): Likewise.
* include/grub/types.h (GRUB_SHRT_MAX): New define.
(GRUB_INT_MAX): Likewise.
2012-01-29 23:27:31 +01:00
Vladimir 'phcoder' Serbinenko
f37c87e1ba
* grub-core/boot/i386/pc/lnxboot.S: Use
...
GRUB_DECOMPRESSOR_MAX_DECOMPRESSOR_SIZE.
* grub-core/boot/i386/pc/startup_raw.S: Ensure about boot_dev
location.
* include/grub/offsets.h (GRUB_DECOMPRESSOR_I386_PC_BOOT_DEVICE): New
definition.
(GRUB_DECOMPRESSOR_I386_PC_MAX_DECOMPRESSOR_SIZE): Likewise.
2012-01-29 23:20:02 +01:00
Vladimir 'phcoder' Serbinenko
63fe43f3c3
* util/getroot.c (grub_util_get_dm_node_linear_info): Fix memory leak.
...
* grub-core/disk/cryptodisk.c (cryptodisk_cleanup): Disable for
now to avoid double free.
* grub-core/kern/emu/hostdisk.c (grub_util_biosdisk_dev): Rename to
hostdisk.
* include/grub/disk.h (grub_disk_dev_id): New id HOSTDISK.
* util/grub-probe.c (escape_of_path): Always return a new copy.
(print_full_name): Escape path.
(probe): Don't call grub_util_devname_to_ofpath on NULL.
Fix hints on abstractions.
2012-01-29 21:49:44 +01:00
Vladimir 'phcoder' Serbinenko
2b5336a24a
* include/grub/ata.h (grub_ata): Add a new element maxbuffer.
...
* grub-core/disk/ata.c (grub_ata_readwrite): Limit to ata->maxbuffer.
* grub-core/disk/pata.c (grub_pata_open): Set ata->maxbuffer.
* grub-core/disk/ahci.c (grub_ahci_open): Likewise.
2012-01-29 19:00:30 +01:00
Vladimir 'phcoder' Serbinenko
74310bd8a7
* include/grub/zfs/dnode.h (DN_MIN_INDBLKSHIFT): Removed.
2012-01-29 18:56:44 +01:00
Vladimir 'phcoder' Serbinenko
9c6e84b838
Cryptodisk write support.
...
* grub-core/disk/cryptodisk.c (grub_crypto_pcbc_encrypt): New function.
(grub_cryptodisk_decrypt): Moved logic to ...
(grub_cryptodisk_endecrypt): ...this. New argument "encrypt".
(grub_cryptodisk_write): Implement.
* grub-core/kern/emu/hostdisk.c (nwrite): Rename to ...
(grub_util_fd_write): ... this. Make global.
* include/grub/emu/hostdisk.h (grub_util_fd_write): New proto.
2012-01-29 18:16:48 +01:00
Vladimir 'phcoder' Serbinenko
87cf97447e
* include/grub/list.h (grub_list_remove): Don't crash if element is
...
removed twice.
2012-01-29 18:09:53 +01:00
Vladimir 'phcoder' Serbinenko
64c8b8f64c
* grub-core/loader/i386/pc/plan9.c (grub_cmd_plan9): Remove PXE
...
handling.
* include/grub/disk.h (grub_disk_dev_id): Remove obsolete
GRUB_DISK_DEVICE_UUID_ID, GRUB_DISK_DEVICE_PXE_ID and
GRUB_DISK_DEVICE_FILE_ID.
2012-01-29 16:34:39 +01:00
Vladimir 'phcoder' Serbinenko
4ed3c26b0d
* include/grub/powerpc/ieee1275/util/biosdisk.h: Remove.
...
* include/grub/powerpc/ieee1275/biosdisk.h: Likewise.
2012-01-29 16:20:41 +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
7626111087
IEEE1275 disk write support.
...
* grub-core/kern/ieee1275/ieee1275.c (grub_ieee1275_write): Make buffer
const void *.
* include/grub/ieee1275/ieee1275.h (grub_ieee1275_write): Likewise.
* grub-core/disk/ieee1275/ofdisk.c (grub_ofdisk_read): Move open
and seek loginc to ...
(grub_ofdisk_prepare): ... here.
(grub_ofdisk_write): Implement.
2012-01-25 18:32:08 +01:00
Vladimir 'phcoder' Serbinenko
fc36d6038b
ARC disk write support.
...
* grub-core/disk/arc/arcdisk.c (handle_writable): New var.
(reopen): New argument writable. All users updated.
Handle required access mode.
(grub_arcdisk_write): Implement.
* include/grub/arc/arc.h (grub_arc_file_access): New enum.
(grub_arc_firmware_vector): Make buffer to write a const buffer.
2012-01-25 16:13:34 +01:00
Vladimir 'phcoder' Serbinenko
2e13ede59e
Eliminate fixed limit on reed solomon decoder length.
...
* grub-core/boot/i386/pc/lnxboot.S: Scan for multiboot signature
rather than hardcoding the address.
* grub-core/boot/i386/pc/startup_raw.S: Add new data field
no_reed_solomon_length.
Move gate_a20 to no-reed-solomon part.
Don't force a particular size of no reed-solomon part.
* include/grub/offsets.h (GRUB_KERNEL_I386_PC_NO_REED_SOLOMON_PART):
Removed.
(GRUB_KERNEL_I386_PC_NO_REED_SOLOMON_LENGTH): New define.
* util/grub-setup.c (setup): Read no_rs_length from the image itself.
2012-01-24 14:39:29 +01:00
Vladimir 'phcoder' Serbinenko
87edb8940a
Replace single-linked with double-linked lists. It results in more
...
compact and more efficient code.
* grub-core/kern/list.c (grub_list_push): Moved from here ...
* include/grub/list.h (grub_list_push): ... to here. Set prev.
(grub_list_remove): Moved from here ...
* include/grub/list.h (grub_list_remove): ... here. Use and set prev.
(grub_prio_list_insert): Set prev.
* include/grub/list.h (grub_list): Add prev. All users updated.
2012-01-24 13:31:12 +01:00
Vladimir 'phcoder' Serbinenko
b508af6989
Support 4K-sector NTFS.
...
* include/grub/ntfs.h (GRUB_NTFS_MAX_MFT): Increase to 8.
(grub_ntfs_data): Remove blocksize.
* grub-core/fs/ntfs.c (fixup): Fix size comparison.
Remove data argument. All users updated.
2012-01-20 15:01:35 +01:00
Vladimir 'phcoder' Serbinenko
dad9c8b59e
* grub-core/kern/mips/arc/init.c (grub_total_modules_size): Mark as
...
being in .text to avoid dprel references.
* include/grub/mips/loongson/kernel.h (grub_arch_machine): Likewise.
* include/grub/mips/loongson/memory.h (grub_arch_memsize): Likewise.
(grub_arch_highmemsize): Likewise.
* include/grub/mips/loongson/time.h (grub_arch_busclock): Likewise.
* include/grub/mips/qemu_mips/memory.h (grub_arch_memsize): Likewise.
* include/grub/mips/time.h (grub_arch_cpuclock): Likewise.
2012-01-20 14:48:26 +01:00
Vladimir 'phcoder' Serbinenko
34e4208ffe
* include/grub/datetime.h (grub_get_datetime_cmos): Don't define in
...
GRUB_UTIL.
(grub_set_datetime_cmos): Likewise.
2012-01-18 14:01:11 +01:00
Vladimir 'phcoder' Serbinenko
9c2710789f
Eliminate grub_min/grub_max prone to overflow usage.
...
* grub-core/bus/usb/usbhub.c (grub_usb_add_hub): Eliminate grub_min.
(poll_nonroot_hub): Likewise.
* grub-core/fs/affs.c (grub_affs_iterate_dir): Likewise.
(grub_affs_label): Likewise.
* grub-core/fs/btrfs.c (grub_btrfs_lzo_decompress): Likewise.
* grub-core/fs/hfs.c (grub_hfs_dir): Likewise.
(grub_hfs_label): Likewise.
* grub-core/fs/hfsplus.c (grub_hfsplus_cmp_catkey): Likewise.
* grub-core/fs/zfs/zfs.c (MIN): Remove.
(zap_leaf_array_equal): Use grub_size. Remove MIN.
(zap_leaf_array_get): Likewise.
(dnode_get_path): Likewise.
* grub-core/io/lzopio.c (grub_lzopio_read): Eliminate grub_min.
* grub-core/io/xzio.c (grub_xzio_read): Likewise.
* grub-core/script/execute.c (grub_script_break): Likewise.
* grub-core/script/lexer.c (grub_script_lexer_record): Eliminate
grub_max.
* grub-core/script/yylex.l (grub_lexer_yyrealloc): Likewise.
* include/grub/misc.h (grub_min): Removed.
(grub_max): Likewise.
2012-01-14 15:44:34 +01:00
Vladimir 'phcoder' Serbinenko
b1ac4cb1f9
* include/grub/datetime.h (grub_datetime2unixtime): Fix offset.
2012-01-14 11:51:52 +01:00
Vladimir 'phcoder' Serbinenko
75b49ebed9
Remove defines pertaining to arbitrary limits not affecting GRUB
...
anymore.
* grub-core/fs/ext2.c (EXT2_PATH_MAX): Removed.
(EXT2_MAX_SYMLINKCNT): Likewise.
* grub-core/fs/nilfs2.c (NILFS_BTREE_LEVEL_MAX): Likewise.
* grub-core/net/tftp.c (TFTP_MAX_PACKET): Likewise.
* include/grub/i386/pc/pxe.h (GRUB_PXE_MIN_BLKSIZE): Likewise.
(GRUB_PXE_MAX_BLKSIZE): Likewise.
* include/grub/normal.h (GRUB_MAX_CMDLINE): Likewise.
* include/grub/zfs/dnode.h (DN_MAX_INDBLKSHIFT): Likewise.
(DN_MAX_OBJECT_SHIFT): Likewise.
(DN_MAX_OFFSET_SHIFT): Likewise.
(DN_MAX_OBJECT): Likewise.
(DNODES_PER_LEVEL_SHIFT): Likewise.
* include/grub/zfs/spa.h (SPA_MAXBLOCKSHIFT): Likewise.
(SPA_MAXBLOCKSIZE): Likewise.
(SPA_BLOCKSIZES): Likewise.
* include/grub/zfs/zap_impl.h (MZAP_MAX_BLKSHIFT): Likewise.
(MZAP_MAX_BLKSZ): Likewise.
2012-01-14 11:30:43 +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
4d8c476536
Avoid cutting in the middle of UTF-8 string.
...
* include/grub/charset.h (grub_getend): New function.
* grub-core/script/function.c (grub_script_function_find): Use
grub_getend.
* grub-core/normal/completion.c (add_completion): Likewise.
2011-12-25 16:11:41 +01:00
Vladimir 'phcoder' Serbinenko
f3cb4a4e57
* grub-core/normal/charset.c (grub_ucs4_to_utf8): Small stylistic fix.
...
(grub_bidi_line_logical_to_visual): Skip tags. They are deprecated.
* include/grub/unicode.h (GRUB_UNICODE_TAG_START): New enum value.
(GRUB_UNICODE_TAG_END): Likewise.
(GRUB_UNICODE_LAST_VALID): Likewise.
2011-12-25 16:07:33 +01:00
Vladimir 'phcoder' Serbinenko
5da8dbc5bc
* include/grub/unicode.h (grub_unicode_compact_range): Replace end with
...
len and make it smaller. All users updated.
* util/import_unicode.py: Put length and not end character.
Check length.
2011-12-25 16:03:42 +01:00
Vladimir 'phcoder' Serbinenko
8569f13d8d
Make better Unicode-compliant and unify some UTF-8 code pathes.
...
* grub-core/normal/charset.c (grub_utf8_to_utf16): Don't eat possibly
valid character.
(grub_is_valid_utf8): Use grub_utf8_process.
Check resulting code range.
(grub_utf8_to_ucs4): Use grub_utf8_process.
* include/grub/charset.h (grub_utf16_to_utf8): Don't eat up a possibly
valid character.
2011-12-25 15:57:50 +01:00
Vladimir 'phcoder' Serbinenko
17785932df
merge mainline into hints
2011-12-23 18:49:00 +01:00
Vladimir 'phcoder' Serbinenko
6babad5e59
Initial integration of hints
2011-12-23 18:19:16 +01:00
Vladimir 'phcoder' Serbinenko
aa7d205236
Retrieve DNS names from DHCP/BOOTP
2011-12-16 17:37:47 +01:00
Vladimir 'phcoder' Serbinenko
f0f4253cd2
Integrate DNS with address parsing
2011-12-16 17:12:01 +01:00
Vladimir 'phcoder' Serbinenko
bd67ad0f70
merge mainline into net
2011-12-15 20:51:35 +01:00
Vladimir 'phcoder' Serbinenko
f2b60fbdb8
Replace UINT_TO_PTR and PTR_TO_UINT with explicit grub_addr_t casts.
...
* include/grub/types.h (UINT_TO_PTR): Removed. All users switched to
grub_addr_t casts.
(PTR_TO_UINT64): Likewise.
(PTR_TO_UINT32): Likewise.
2011-12-15 19:59:49 +01:00
Vladimir 'phcoder' Serbinenko
e3fd394a10
* grub-core/boot/i386/pc/startup_raw.S: Move realmode routines to
...
non-RS part to avoid RS messing with GDT.
* include/grub/offsets.h (GRUB_KERNEL_I386_PC_NO_REED_SOLOMON_PART):
Increase to suit in realmode routines.
2011-12-15 19:20:41 +01:00