X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=disk%2Fpart_iso.c;h=4401790af2f8e12c2e4f4e02b0d89681c983e050;hb=a6a78be02542dbdcd530c62281dd6bfe79074a0b;hp=a98539da4696b51bd2638887d98ea89392c9c706;hpb=cc1c8a136f9813d0a9cb9a94d2f12206873ddc4e;p=u-boot diff --git a/disk/part_iso.c b/disk/part_iso.c index a98539da46..4401790af2 100644 --- a/disk/part_iso.c +++ b/disk/part_iso.c @@ -23,12 +23,16 @@ #include #include -#include #include "part_iso.h" -#if ((CONFIG_COMMANDS & CFG_CMD_IDE) || (CONFIG_COMMANDS & CFG_CMD_SCSI)) && defined(CONFIG_ISO_PARTITION) +#if defined(CONFIG_CMD_IDE) || \ + defined(CONFIG_CMD_SCSI) || \ + defined(CONFIG_CMD_SATA) || \ + defined(CONFIG_CMD_USB) || \ + defined(CONFIG_MMC) || \ + defined(CONFIG_SYSTEMACE) -#undef ISO_PART_DEBUG +/* #define ISO_PART_DEBUG */ #ifdef ISO_PART_DEBUG #define PRINTF(fmt,args...) printf (fmt ,##args) @@ -77,14 +81,14 @@ int get_partition_info_iso_verb(block_dev_desc_t * dev_desc, int part_num, disk_ /* the first sector (sector 0x10) must be a primary volume desc */ blkaddr=PVD_OFFSET; if (dev_desc->block_read (dev_desc->dev, PVD_OFFSET, 1, (ulong *) tmpbuf) != 1) - return (-1); + return (-1); if(ppr->desctype!=0x01) { if(verb) printf ("** First descriptor is NOT a primary desc on %d:%d **\n", dev_desc->dev, part_num); return (-1); } - if(strncmp(ppr->stand_ident,"CD001",5)!=0) { + if(strncmp((char *)ppr->stand_ident,"CD001",5)!=0) { if(verb) printf ("** Wrong ISO Ident: %s on %d:%d **\n", ppr->stand_ident,dev_desc->dev, part_num); @@ -97,8 +101,9 @@ int get_partition_info_iso_verb(block_dev_desc_t * dev_desc, int part_num, disk_ info->blksz=ppr->secsize_BE; /* assuming same block size for all entries */ PRINTF(" Lastsect:%08lx\n",lastsect); for(i=blkaddr;iblock_read (dev_desc->dev, i, 1, (ulong *) tmpbuf) != 1) - return (-1); + return (-1); if(ppr->desctype==0x00) break; /* boot entry found */ if(ppr->desctype==0xff) { @@ -108,7 +113,7 @@ int get_partition_info_iso_verb(block_dev_desc_t * dev_desc, int part_num, disk_ return (-1); } } - /* boot entry found */ + /* boot entry found */ if(strncmp(pbr->ident_str,"EL TORITO SPECIFICATION",23)!=0) { if(verb) printf ("** Wrong El Torito ident: %s on %d:%d **\n", @@ -150,23 +155,29 @@ int get_partition_info_iso_verb(block_dev_desc_t * dev_desc, int part_num, disk_ /* the validation entry seems to be ok, now search the "partition" */ entry_num=0; offset=0x20; - sprintf (info->type, "U-Boot"); + sprintf ((char *)info->type, "U-Boot"); switch(dev_desc->if_type) { case IF_TYPE_IDE: + case IF_TYPE_SATA: case IF_TYPE_ATAPI: - sprintf (info->name, "hd%c%d\n", 'a' + dev_desc->dev, part_num); + sprintf ((char *)info->name, "hd%c%d", + 'a' + dev_desc->dev, part_num); break; case IF_TYPE_SCSI: - sprintf (info->name, "sd%c%d\n", 'a' + dev_desc->dev, part_num); + sprintf ((char *)info->name, "sd%c%d", + 'a' + dev_desc->dev, part_num); break; case IF_TYPE_USB: - sprintf (info->name, "usbd%c%d\n", 'a' + dev_desc->dev, part_num); + sprintf ((char *)info->name, "usbd%c%d", + 'a' + dev_desc->dev, part_num); break; case IF_TYPE_DOC: - sprintf (info->name, "docd%c%d\n", 'a' + dev_desc->dev, part_num); + sprintf ((char *)info->name, "docd%c%d", + 'a' + dev_desc->dev, part_num); break; default: - sprintf (info->name, "xx%c%d\n", 'a' + dev_desc->dev, part_num); + sprintf ((char *)info->name, "xx%c%d", + 'a' + dev_desc->dev, part_num); break; } /* the bootcatalog (including validation Entry) is limited to 2048Bytes @@ -229,7 +240,6 @@ int get_partition_info_iso(block_dev_desc_t * dev_desc, int part_num, disk_parti } - void print_part_iso(block_dev_desc_t * dev_desc) { disk_partition_t info; @@ -254,4 +264,4 @@ int test_part_iso (block_dev_desc_t *dev_desc) return(get_partition_info_iso_verb(dev_desc,0,&info,0)); } -#endif /* ((CONFIG_COMMANDS & CFG_CMD_IDE) || (CONFIG_COMMANDS & CFG_CMD_SCSI)) && defined(CONFIG_ISO_PARTITION) */ +#endif