Index: sysutils/cciss_vol_status/Makefile =================================================================== --- sysutils/cciss_vol_status/Makefile (revision 539621) +++ sysutils/cciss_vol_status/Makefile (working copy) @@ -3,10 +3,11 @@ PORTNAME= cciss_vol_status PORTVERSION= 1.12 +PORTREVISION= 1 CATEGORIES= sysutils MASTER_SITES= SF/cciss/${PORTNAME} -MAINTAINER= fw@moov.de +MAINTAINER= pen@lysator.liu.se COMMENT= Reports status of logical drives on ciss(4) controllers LICENSE= GPLv2 @@ -18,7 +19,7 @@ SUB_FILES= cciss_vol_status .if !exists(${SRC_BASE}/sys/dev/ciss/cissio.h) -IGNORE= cciss_vol_status requires kernel sources of the ciss driver +IGNORE+= cciss_vol_status requires kernel sources of the ciss driver .endif post-install: Index: sysutils/cciss_vol_status/files/patch-cciss_vol_status.c =================================================================== --- sysutils/cciss_vol_status/files/patch-cciss_vol_status.c (revision 539621) +++ sysutils/cciss_vol_status/files/patch-cciss_vol_status.c (working copy) @@ -1,6 +1,68 @@ ---- cciss_vol_status.c.orig 2017-10-18 07:49:43.578445000 +0200 -+++ cciss_vol_status.c 2017-10-18 07:51:20.372056000 +0200 -@@ -1098,7 +1098,7 @@ +--- cciss_vol_status.c.orig 2017-03-10 22:14:51 UTC ++++ cciss_vol_status.c +@@ -23,6 +23,8 @@ + #include + #endif + ++#include ++ + #define VERSION_NUMBER PACKAGE_VERSION + + #include +@@ -193,8 +195,10 @@ struct smartarray_id_t { + #ifdef HAVE_SCSI_SG_H + { MSA1000_ID, "MSA1000", 1, 0}, + #else ++#ifndef __FreeBSD__ + #warning Since is not around, MSA1000 support will not be compiled. + #endif ++#endif + { 0xFFFFFFFF, "Unknown Smart Array", 0, 1}, + }; + +@@ -613,8 +617,13 @@ char *progname = "cciss_vol_status"; + + void usage() + { +- fprintf(stderr, "%s: usage: %s [-p] [-q] [-v] [-u] [-x] /dev/cciss/c*d0 /dev/sg*\n", progname, progname); ++#ifdef __FreeBSD__ ++ fprintf(stderr, "%s: usage: %s [] /dev/ciss*\n", progname, progname); ++#else ++ fprintf(stderr, "%s: usage: %s [] /dev/cciss/* /dev/sg*\n", progname, progname); ++#endif + fprintf(stderr, " -p --persnickety Complain about device nodes which can't be opened.\n"); ++ fprintf(stderr, " -q --quiet Be more quiet.\n"); + fprintf(stderr, " -u --try-unknown-devices Allow interrogation of even unrecognized controllers\n"); + fprintf(stderr, " (useful for brand new hardware.)\n"); + fprintf(stderr, " -s --smart Report S.M.A.R.T. predictive failures. \n"); +@@ -637,7 +646,7 @@ static void find_bus_target(struct ident + int big_map_support; + int drives_per_scsi_bus; + +- big_map_support = (id->controller_flags && (1<<7)); ++ big_map_support = (id->controller_flags & (1<<7)); + drives_per_scsi_bus = id->drives_per_scsi_bus;; + + /* if no big drive map support, & zero devices per scsi bus */ +@@ -683,7 +692,7 @@ static void format_phys_drive_location(c + copy_drive_field(model, device_data->drive_model, sizeof(device_data->drive_model)); + copy_drive_field(serial_no, device_data->drive_serial_no, sizeof(device_data->drive_serial_no)); + copy_drive_field(fw_rev, device_data->drive_fw_rev, sizeof(device_data->drive_fw_rev)); +- sprintf(tail, " connector %c%c box %d bay %d %40s %40s %8s", ++ sprintf(tail, " connector %c%c box %d bay %-2d %40s %40s %8s", + device_data->phys_connector[0], + device_data->phys_connector[1], + device_data->phys_box_on_bus, +@@ -1001,7 +1010,7 @@ static void show_disk_map(char *title, c + struct identify_physical_device device_data; + char location[300]; + +- big_map_support = (id->controller_flags && (1<<7)); ++ big_map_support = (id->controller_flags & (1<<7)); + drives_per_scsi_bus = id->drives_per_scsi_bus;; + + /* if no big drive map support, & zero devices per scsi bus */ +@@ -1098,7 +1107,7 @@ static void print_volume_status(char *fi break; case 1: sprintf(raid_level, "RAID 4"); break; @@ -9,3 +71,46 @@ break; case 3: sprintf(raid_level, "RAID 5"); break; +@@ -1204,7 +1213,7 @@ static void print_bus_status(char *file, + /* Eg. 6400 with internal card cage gives back bogus info */ + /* for me for the serial number. */ + strncpy(enclosure_sn, bus_param->chassis_sn, 40); +- enclosure_sn[41] = '\0'; ++ enclosure_sn[40] = '\0'; + for (i = 40 - 1; i > 0; i--) + if (enclosure_sn[i] == ' ') { + enclosure_sn[i] = '\0'; +@@ -2291,7 +2300,7 @@ static void check_one_nonvolatile_cache_ + return; + + printf("%35s: %hu MiB\n", "Total cache memory", cache_config->total_memory_size); +- printf("%35s: %d% Read / %d% Write\n", "Cache Ratio", cache_config->percent_read_cache, cache_config->percent_write_cache); ++ printf("%35s: %d%% Read / %d%% Write\n", "Cache Ratio", cache_config->percent_read_cache, cache_config->percent_write_cache); + printf("%35s: %hu MiB\n", "Read cache memory", cache_config->mem_for_read_cache); + printf("%35s: %hu MiB\n", "Write cache memory", cache_config->mem_for_write_cache); + printf("%35s: %s\n", "Write cache enabled", +@@ -2357,6 +2366,7 @@ static void check_nonvolatile_cache_stat + } + } + ++#ifdef HAVE_SCSI_SG_H + static int msa1000_status(char *file, int fd) + { + int i, rc, numluns; +@@ -2378,6 +2388,7 @@ static int msa1000_status(char *file, in + close(fd); + return 0; + } ++#endif + + static int cciss_device_type_is_correct(char *file, int fd) + { +@@ -2477,7 +2488,7 @@ static void cciss_logical_drive_status(c + + static inline int bmic_supports_big_maps(struct identify_controller *id) + { +- return id->controller_flags && (1<<7); ++ return id->controller_flags & (1<<7); + } + + static int bmic_next_disk_bits(uint8_t *bits, int bitmapsize, int disk)