aboutsummaryrefslogtreecommitdiffstats
path: root/com32/hdt/hdt-cli-disk.c
Commit message (Collapse)AuthorAgeFilesLines
* hdt: Adding nomodule support in cliErwan Velu2012-05-271-0/+3
| | | | | | | | | | Some new commands might need being able to manage the argv directly instead of the much more oriented scheme we had until now. This commit add a .nomodule option to cli object to explically tell they don't have a module as parameter but only arguments. This will be needed for the 'say' command.
* hdt: Unique hardware detection pathErwan Velu2009-12-071-3/+0
| | | | | | Impact: Hardware detection path is simplified Hardware is detected once, at boot time
* hdt: EDD uses hex numbers, not decimalErwan Velu2009-12-041-1/+1
| | | | | | | Impact: Fixing commit 4d2536e76d621bc7c5faa076a905051854f9c512 Commit 4d2536e76d621bc7c5faa076a905051854f9c512 was buggy as considering EDD as decimal and not hex.
* hdt: Do not display hostbus & interface for EDD<3Erwan Velu2009-12-041-3/+6
| | | | | | | | | Impact: Avoid corruption while displaying host bus interface when EDD<3.0 If EDD < 3.0 displaying host bus & interface for disk devices return unexpected content. We have to avoid displaying that informations in such case
* hdt: Preventing agressive disk's size roundingErwan Velu2009-12-041-3/+3
| | | | | | Impact: Visual Prevent reported case where 1997MB could be displayed as 1GB.
* hdt: show error message when no disk is foundErwan Velu2009-12-041-1/+14
| | | | | | Impact: Visual Display an error message when no disk is found on the system
* hdt: Running NindentErwan Velu2009-11-241-134/+133
| | | | | | Impact: Visual cleanup HDT now uses the same indent as syslinux
* hdt: more memory corruption fixesPierre-Alexandre Meyer2009-11-181-1/+0
| | | | | | | | A cli_module_descr can be defined with no modules (only a default callback). Cf. the syslinux module for instance. This patch adds a check for NULL structures before trying to dereference them. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* hdt: change remaining printf to more_printf (CLI)Pierre-Alexandre Meyer2009-11-011-6/+10
| | | | | | | | | | | A lot of places still had printf() instead of more_printf(). This patch does a bulk update and add missing reset_more_printf(), used to reset the pager counter between each command call. This also changes the more_printf() routine to delete the "--More--" line while scrolling. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* Merge branch 'bootloader-detection' into hdt-nextPierre-Alexandre Meyer2009-09-071-9/+27
|\ | | | | | | | | | | | | | | | | Conflicts: com32/hdt/hdt-cli-disk.c com32/hdt/hdt-common.h com32/hdt/hdt-menu-disk.c Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
| * hdt: add bootloader detection (CLI)Pierre-Alexandre Meyer2009-08-261-2/+7
| | | | | | | | | | | | | | When iterating through all partitions (e.g. `show disks'), print the bootloader ID if we recognize it. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
| * gpllib: rename bootloader detection to MBR detectionPierre-Alexandre Meyer2009-08-261-10/+9
| | | | | | | | | | | | | | bootloaders.c really inspects the MBR, not the bootloader itself. Let's not confuse the two of them. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
| * hdt: right-align information about each disk (CLI)Pierre-Alexandre Meyer2009-08-231-4/+4
| | | | | | | | | | | | Align C/H/S, EDD and Bootloader fields. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
| * hdt: enhance user experience (CLI) - try harderPierre-Alexandre Meyer2009-08-231-4/+14
| | | | | | | | | | | | | | | | | | | | Alright - let's try again. * Manually increment the display_line_nb counter in the disk CLI (we are doing a multi line more_printf!) * Add the pause_printf() macro to pause the CLI as needed Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
| * hdt: enhance user experience (CLI)Pierre-Alexandre Meyer2009-08-231-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some users have reported that reading the CLI can be difficult, especially when spitting out a lot of information. This patch: * adds a missing reset_more_printf() in the disk CLI * reduces the total scrolling to 20 lines (seems better in my testing) * removes a reset_more_printf() in the show disk function. This can potentially be bad when doing a lot of show disk 0xXX (especially after 4 in a row) but enhances the display when running show disks with lots of disks. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
| * hdt: print bootloader name (CLI)Pierre-Alexandre Meyer2009-08-231-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | `show disks' in the CLI now prints bootloader information, e.g. DISK 0x83: C/H/S: 1023 cylinders, 255 heads, 63 sectors/track EDD: Version: 30 Size: 10 GiB, 512 bytes/sector, 63 sectors/track Host bus: ISA, Interface type: ATA Bootloader: Grub (id 0xEB48) Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* | hdt: fix signedness warningsPierre-Alexandre Meyer2009-09-031-3/+3
| | | | | | | | | | | | | | host_bus_type and interface_type are uint8_t. Force a cast when calling remove_spaces on these fields. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* | hdt: unify disk headers in hdt-common.hPierre-Alexandre Meyer2009-09-011-7/+0
| | | | | | | | | | | | | | Both cli and menu need to access disk functions. Include disk headers in hdt-common.h, instead of duplicating code. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* | hdt: enhance user experience (CLI)Pierre-Alexandre Meyer2009-08-231-1/+3
|/ | | | | | | | | | | | | | | Some users have reported that reading the CLI can be difficult, especially when spitting out a lot of information. This patch: * adds a missing reset_more_printf() in the disk CLI * reduces the total scrolling to 20 lines (seems better in my testing) * removes a reset_more_printf() in the show disk function. This can potentially be bad when doing a lot of show disk 0xXX (especially after 4 in a row) but enhances the display when running show disks with lots of disks. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* hdt: enhance error reporting in the CLI (disk)Pierre-Alexandre Meyer2009-08-221-2/+7
| | | | | | | | | | | | | | | | | | parse_partition_table can fail for two reasons: disk I/O error or unrecognized partition layout (non msdos, corrupt, ...). In the latter case, we were displaying Error parsing disk 0x80 parse_partition_table: error 0 which is confusing. We now display Disk 0x80: unrecognized partition layout or the errno_disk in case of I/O errors. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* hdt: make get_error behaves like perrorPierre-Alexandre Meyer2009-08-221-11/+4
| | | | | | | | This simplifies buffer handling. Misc.: clean some old error code handling. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* hdt: fix CLI crash when parsing unsupported geometriesPierre-Alexandre Meyer2009-08-221-2/+0
| | | | | | | | Remove extra free() calls: these were needed before the introduction of the disklib errno. We apparently forgot to remove them. Reported-by: Gert Hulselmans <hulselmansgert@gmail.com> Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* hdt: fix disklib displayPierre-Alexandre Meyer2009-08-201-1/+1
| | | | | | | We currently display the first sector after the end of an extended. Fix it (-1). Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* hdt: Fixing memory corruptionerwan2009-08-201-3/+3
| | | | | | | | | Impact: Improve stability In some case, sectors_to_size can return a 8 char long string like "1000 MiB". In such case, some buffer were corrupted. This is now fixed by a size[9] instead of size[8].
* hdt: Remove extra more_printf callsPierre-Alexandre Meyer2009-08-051-12/+10
| | | | | | | Let's rather use string concatenation. Reported-by: Shao Miller <Shao.Miller@yrdsb.edu.on.ca> Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* hdt: Don't show partition header if not neededPierre-Alexandre Meyer2009-08-051-1/+3
| | | | | | | Don't blindly print the partition header: check if we are able to iterate through them first. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* hdt: Make the menu and cli use the new disk interfacesPierre-Alexandre Meyer2009-08-051-15/+9
| | | | | | | | | The disklib interfaces have changed (errno_disk introduced). Update these changes in hdt (nobody else use them). Misc: fix get_error declaration. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* gpllib: refactor partitions detectionPierre-Alexandre Meyer2009-08-041-6/+5
| | | | | | | | | | Re-implement the logic to parse extended partitions to correctly go through the linked list of partitions. Updated the CLI in hdt and tested it both on Qemu (Debian Lenny installation) and on DELL E6400 (6 partitions). The output seemed sane. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* hdt: Add disk callbacks (CLI)Pierre-Alexandre Meyer2009-04-261-22/+92
| | | | | | | | | | | In the hdt mode, `show disk' outputs a summary for all disks (C/H/S, EDD (version, size) and host/interface). In the disk mode, `show' outputs the same as above, `show disks' a full description for all disks (with partitions) and `show disk 0x80' detailed information for one disk only (0x80 in that example). Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* hdt: Make the disk mode use parse_partition_table() (CLI)Pierre-Alexandre Meyer2009-04-261-86/+26
| | | | | | | | | | Impact: code refactoring Leverage the new call parse_partition_table() in the disk CLI. Misc.: enhance UI output, add space in the columns for up to 46 TB disks. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* hdt: Improve disk output (CLI)Pierre-Alexandre Meyer2009-04-251-10/+13
| | | | | | | Do not print EDD C/H/S info, since it is not really useful. Add disk size to the summary. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* hdt: Do not print information about buggy extended partitionsPierre-Alexandre Meyer2009-04-211-1/+12
| | | | | | | | | | | | Impact: bug fix Add a sanity check before printing extended partitions. As hpa notes in chain.c: Sanity check entry: must not extend outside the extended partition. This is necessary since some OSes put crap in some entries. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* hdt: Do not modify offsets in the part_entry itselfPierre-Alexandre Meyer2009-04-211-6/+12
| | | | | | | | | | Impact: fix bug When printing extended partitions information, we need to adjust the start lba. Do not modify it in the part_entry struct but just print the adjusted one. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* hdt: Check if a swsusp image exists on swap partitionsPierre-Alexandre Meyer2009-04-211-11/+49
| | | | | | | | | | | Impact: new feature, add error debug information When printing partitions information, add a message in the CLI if a swap device contains a valid swsusp (hibernate) image. Misc.: check and print, if needed, errors after each I/O operation. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* hdt: Use IEC 60027 standard for capacity (CLI)Pierre-Alexandre Meyer2009-04-201-4/+8
| | | | | | | | | | Impact: add hdt-util.c for generic helpers Display size of partitions in kibi, mebi, gibi ot tebibytes. There is no point in displaying the number of sectors in the CLI, a human readable size is more useful. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* hdt: Process extended partitions (CLI)Pierre-Alexandre Meyer2009-04-201-12/+70
| | | | | | | | | Print information about extended partitions in the CLI. Note: the offsets reported are the offsets found in the EBR. We may want to adjust it with the offset in the MBR. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* hdt: Dump partition tables (CLI)Pierre-Alexandre Meyer2009-04-191-0/+23
| | | | | | | Use the new disk API to read mbrs and dump information about detected primary partitions. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* hdt: Adapt disk CLI/menu to new struct devinfoPierre-Alexandre Meyer2009-04-191-6/+15
| | | | | | The struct devinfo has slightly changed. Reflect the changes in hdt. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* hdt: Add disk mode (CLI)Pierre-Alexandre Meyer2009-04-191-0/+71
The disk mode features drives autodetection (geometry). Generic geometry code from hdt-ata.c has been replaced by the new disk gpllib. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>