From a6e0dd021287152305755518baaac3daaa623fa1 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Oct 30 2018 04:54:25 +0000 Subject: import sg3_utils-1.37-17.el7 --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c2043a3 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/sg3_utils-1.37.tgz diff --git a/.sg3_utils.metadata b/.sg3_utils.metadata new file mode 100644 index 0000000..7751761 --- /dev/null +++ b/.sg3_utils.metadata @@ -0,0 +1 @@ +44c202926950a204f793bc826362db3a952fd408 SOURCES/sg3_utils-1.37.tgz diff --git a/README.md b/README.md deleted file mode 100644 index 0e7897f..0000000 --- a/README.md +++ /dev/null @@ -1,5 +0,0 @@ -The master branch has no content - -Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6 - -If you find this file in a distro specific branch, it means that no content has been checked in yet diff --git a/SOURCES/0001-Add-upstream-updates-to-sg_inq-sg_rdac-and-sg_vpd.patch b/SOURCES/0001-Add-upstream-updates-to-sg_inq-sg_rdac-and-sg_vpd.patch new file mode 100644 index 0000000..2bb97cd --- /dev/null +++ b/SOURCES/0001-Add-upstream-updates-to-sg_inq-sg_rdac-and-sg_vpd.patch @@ -0,0 +1,920 @@ +From 4fed8b17b1cd75492d20cf701ebe4f66e13385f5 Mon Sep 17 00:00:00 2001 +From: David Sommerseth +Date: Fri, 29 Apr 2016 01:12:20 +0200 +Subject: [PATCH] Add upstream updates to sg_inq, sg_rdac and sg_vpd + +--- + src/sg_inq.c | 165 +++++++++++++++++++++++++++++++----- + src/sg_rdac.c | 216 ++++++++++++++++++++++++++++++++++------------- + src/sg_vpd_vendor.c | 239 +++++++++++++++++++++++++++++++++++++++++++++++----- + 3 files changed, 519 insertions(+), 101 deletions(-) + +diff --git a/src/sg_inq.c b/src/sg_inq.c +index 80c8aec..9666e08 100644 +--- a/src/sg_inq.c ++++ b/src/sg_inq.c +@@ -2225,8 +2225,8 @@ decode_rdac_vpd_c2(unsigned char * buff, int len) + "not possible.\n" , buff[4], buff[5], buff[6], buff[7]); + return; + } +- printf(" Software Version: %d.%d.%d\n", buff[8], buff[9], buff[10]); +- printf(" Software Date: %02x/%02x/%02x\n", buff[11], buff[12], buff[13]); ++ printf(" Software Version: %02x.%02x.%02x\n", buff[8], buff[9], buff[10]); ++ printf(" Software Date: %02d/%02d/%02d\n", buff[11], buff[12], buff[13]); + printf(" Features:"); + if (buff[14] & 0x01) + printf(" Dual Active,"); +@@ -2235,15 +2235,77 @@ decode_rdac_vpd_c2(unsigned char * buff, int len) + if (buff[14] & 0x04) + printf(" Multiple Sub-enclosures,"); + if (buff[14] & 0x08) +- printf(" DCE/DRM,"); ++ printf(" DCE/DRM/DSS/DVE,"); + if (buff[14] & 0x10) +- printf(" AVT,"); ++ printf(" Asymmetric Logical Unit Access,"); + printf("\n"); + printf(" Max. #of LUNS: %d\n", buff[15]); + return; + } + + static void ++decode_rdac_vpd_c9_rtpg_data(unsigned char aas, unsigned char vendor) ++{ ++ printf(" Asymmetric Access State:"); ++ switch(aas & 0x0F) { ++ case 0x0: ++ printf(" Active/Optimized"); ++ break; ++ case 0x1: ++ printf(" Active/Non-Optimized"); ++ break; ++ case 0x2: ++ printf(" Standby"); ++ break; ++ case 0x3: ++ printf(" Unavailable"); ++ break; ++ case 0xE: ++ printf(" Offline"); ++ break; ++ case 0xF: ++ printf(" Transitioning"); ++ break; ++ default: ++ printf(" (unknown)"); ++ break; ++ } ++ printf("\n"); ++ ++ printf(" Vendor Specific Field:"); ++ switch(vendor) { ++ case 0x01: ++ printf(" Operating normally"); ++ break; ++ case 0x02: ++ printf(" Non-responsive to queries"); ++ break; ++ case 0x03: ++ printf(" Controller being held in reset"); ++ break; ++ case 0x04: ++ printf(" Performing controller firmware download (1st controller)"); ++ break; ++ case 0x05: ++ printf(" Performing controller firmware download (2nd controller)"); ++ break; ++ case 0x06: ++ printf(" Quiesced as a result of an administrative request"); ++ break; ++ case 0x07: ++ printf(" Service mode as a result of an administrative request"); ++ break; ++ case 0xFF: ++ printf(" Details are not available"); ++ break; ++ default: ++ printf(" (unknown)"); ++ break; ++ } ++ printf("\n"); ++} ++ ++static void + decode_rdac_vpd_c9(unsigned char * buff, int len) + { + if (len < 3) { +@@ -2260,14 +2322,18 @@ decode_rdac_vpd_c9(unsigned char * buff, int len) + fprintf(stderr, "Invalid page version '%c' (should be 1)\n", + buff[7]); + } +- printf(" AVT:"); +- if (buff[8] & 0x80) { +- printf(" Enabled"); +- if (buff[8] & 0x40) +- printf(" (Allow reads on sector 0)"); +- printf("\n"); ++ if ( (buff[8] & 0xE0) == 0xE0 ) { ++ printf(" IOShipping (ALUA): Enabled\n"); + } else { +- printf(" Disabled\n"); ++ printf(" AVT:"); ++ if (buff[8] & 0x80) { ++ printf(" Enabled"); ++ if (buff[8] & 0x40) ++ printf(" (Allow reads on sector 0)"); ++ printf("\n"); ++ } else { ++ printf(" Disabled\n"); ++ } + } + printf(" Volume Access via: "); + if (buff[8] & 0x01) +@@ -2275,17 +2341,72 @@ decode_rdac_vpd_c9(unsigned char * buff, int len) + else + printf("alternate controller\n"); + +- printf(" Path priority: %d ", buff[9] & 0xf); +- switch(buff[9] & 0xf) { +- case 0x1: +- printf("(preferred path)\n"); +- break; +- case 0x2: +- printf("(secondary path)\n"); +- break; +- default: +- printf("(unknown)\n"); +- break; ++ if (buff[8] & 0x08) { ++ printf(" Path priority: %d ", buff[15] & 0xf); ++ switch(buff[15] & 0xf) { ++ case 0x1: ++ printf("(preferred path)\n"); ++ break; ++ case 0x2: ++ printf("(secondary path)\n"); ++ break; ++ default: ++ printf("(unknown)\n"); ++ break; ++ } ++ ++ printf(" Preferred Path Auto Changeable:"); ++ switch(buff[14] & 0x3C) { ++ case 0x14: ++ printf(" No (User Disabled and Host Type Restricted)\n"); ++ break; ++ case 0x18: ++ printf(" No (User Disabled)\n"); ++ break; ++ case 0x24: ++ printf(" No (Host Type Restricted)\n"); ++ break; ++ case 0x28: ++ printf(" Yes\n"); ++ break; ++ default: ++ printf(" (Unknown)\n"); ++ break; ++ } ++ ++ printf(" Implicit Failback:"); ++ switch(buff[14] & 0x03) { ++ case 0x1: ++ printf(" Disabled\n"); ++ break; ++ case 0x2: ++ printf(" Enabled\n"); ++ break; ++ default: ++ printf(" (Unknown)\n"); ++ break; ++ } ++ } else { ++ printf(" Path priority: %d ", buff[9] & 0xf); ++ switch(buff[9] & 0xf) { ++ case 0x1: ++ printf("(preferred path)\n"); ++ break; ++ case 0x2: ++ printf("(secondary path)\n"); ++ break; ++ default: ++ printf("(unknown)\n"); ++ break; ++ } ++ } ++ ++ if (buff[8] & 0x80) { ++ printf(" Target Port Group Data (This controller):\n"); ++ decode_rdac_vpd_c9_rtpg_data(buff[10], buff[11]); ++ ++ printf(" Target Port Group Data (Alternate controller):\n"); ++ decode_rdac_vpd_c9_rtpg_data(buff[12], buff[13]); + } + + return; +diff --git a/src/sg_rdac.c b/src/sg_rdac.c +index 41ec544..ea243a2 100644 +--- a/src/sg_rdac.c ++++ b/src/sg_rdac.c +@@ -28,12 +28,20 @@ + static const char * version_str = "1.06 20130507"; + + unsigned char mode6_hdr[] = { +- 75, /* Length */ ++ 0x75, /* Length */ + 0, /* medium */ + 0, /* params */ + 8, /* Block descriptor length */ + }; + ++unsigned char mode10_hdr[] = { ++ 0x01, 0x18, /* Length */ ++ 0, /* medium */ ++ 0, /* params */ ++ 0, 0, /* reserved */ ++ 0, 0, /* block descriptor length */ ++}; ++ + unsigned char block_descriptor[] = { + 0, /* Density code */ + 0, 0, 0, /* Number of blocks */ +@@ -41,22 +49,35 @@ unsigned char block_descriptor[] = { + 0, 0x02, 0, /* 512 byte blocks */ + }; + +-struct rdac_legacy_page { +- unsigned char page_code; +- unsigned char page_length; +- char current_serial[16]; +- char alternate_serial[16]; ++struct rdac_page_common { ++ unsigned char current_serial[16]; ++ unsigned char alternate_serial[16]; + unsigned char current_mode_msb; + unsigned char current_mode_lsb; + unsigned char alternate_mode_msb; + unsigned char alternate_mode_lsb; + unsigned char quiescence; + unsigned char options; ++}; ++ ++struct rdac_legacy_page { ++ unsigned char page_code; ++ unsigned char page_length; ++ struct rdac_page_common attr; + unsigned char lun_table[32]; + unsigned char lun_table_exp[32]; + unsigned short reserved; + }; + ++struct rdac_expanded_page { ++ unsigned char page_code; ++ unsigned char subpage_code; ++ unsigned char page_length[2]; ++ struct rdac_page_common attr; ++ unsigned char lun_table[256]; ++ unsigned char reserved[2]; ++}; ++ + static int do_verbose = 0; + + static void dump_mode_page( unsigned char *page, int len ) +@@ -83,30 +104,52 @@ static void dump_mode_page( unsigned char *page, int len ) + #define RDAC_CONTROLLER_PAGE_LEN 0x68 + #define LEGACY_PAGE 0x00 + #define EXPANDED_LUN_SPACE_PAGE 0x01 ++#define EXPANDED_LUN_SPACE_PAGE_LEN 0x128 + #define RDAC_FAIL_ALL_PATHS 0x1 + #define RDAC_FAIL_SELECTED_PATHS 0x2 + #define RDAC_FORCE_QUIESCENCE 0x2 + #define RDAC_QUIESCENCE_TIME 10 + +-static int fail_all_paths(int fd) ++static int fail_all_paths(int fd, int use_6_byte) + { +- unsigned char fail_paths_pg[118]; ++ unsigned char fail_paths_pg[308]; + struct rdac_legacy_page *rdac_page; ++ struct rdac_expanded_page *rdac_page_exp; ++ struct rdac_page_common *rdac_common = NULL; ++ + int res; + +- memset(fail_paths_pg, 0, 118); +- memcpy(fail_paths_pg, mode6_hdr, 4); +- memcpy(fail_paths_pg + 4, block_descriptor, 8); +- rdac_page = (struct rdac_legacy_page *)(fail_paths_pg + 4 + 8); +- rdac_page->page_code = RDAC_CONTROLLER_PAGE | 0x40; +- rdac_page->page_length = RDAC_CONTROLLER_PAGE_LEN; +- rdac_page->quiescence = RDAC_QUIESCENCE_TIME; +- rdac_page->options = RDAC_FORCE_QUIESCENCE; +- rdac_page->current_mode_lsb = RDAC_FAIL_ALL_PATHS; ++ memset(fail_paths_pg, 0, 308); ++ if (use_6_byte) { ++ memcpy(fail_paths_pg, mode6_hdr, 4); ++ memcpy(fail_paths_pg + 4, block_descriptor, 8); ++ rdac_page = (struct rdac_legacy_page *)(fail_paths_pg + 4 + 8); ++ rdac_page->page_code = RDAC_CONTROLLER_PAGE; ++ rdac_page->page_length = RDAC_CONTROLLER_PAGE_LEN; ++ rdac_common = &rdac_page->attr; ++ } else { ++ memcpy(fail_paths_pg, mode10_hdr, 8); ++ rdac_page_exp = (struct rdac_expanded_page *)(fail_paths_pg + 8); ++ rdac_page_exp->page_code = RDAC_CONTROLLER_PAGE | 0x40; ++ rdac_page_exp->subpage_code = 0x1; ++ rdac_page_exp->page_length[0] = EXPANDED_LUN_SPACE_PAGE_LEN >> 8; ++ rdac_page_exp->page_length[1] = EXPANDED_LUN_SPACE_PAGE_LEN & 0xFF; ++ rdac_common = &rdac_page_exp->attr; ++ } + +- res = sg_ll_mode_select6(fd, 1 /* pf */, 0 /* sp */, +- fail_paths_pg, 118, +- 1, (do_verbose ? 2 : 0)); ++ rdac_common->current_mode_lsb = RDAC_FAIL_ALL_PATHS; ++ rdac_common->quiescence = RDAC_QUIESCENCE_TIME; ++ rdac_common->options = RDAC_FORCE_QUIESCENCE; ++ ++ if (use_6_byte) { ++ res = sg_ll_mode_select6(fd, 1 /* pf */, 0 /* sp */, ++ fail_paths_pg, 118, ++ 1, (do_verbose ? 2 : 0)); ++ } else { ++ res = sg_ll_mode_select10(fd, 1 /* pf */, 0 /* sp */, ++ fail_paths_pg, 308, ++ 1, (do_verbose ? 2: 0)); ++ } + + switch (res) { + case 0: +@@ -137,27 +180,54 @@ static int fail_all_paths(int fd) + return res; + } + +-static int fail_this_path(int fd, int lun) ++static int fail_this_path(int fd, int lun, int use_6_byte) + { +- unsigned char fail_paths_pg[118]; ++ unsigned char fail_paths_pg[308]; + struct rdac_legacy_page *rdac_page; ++ struct rdac_expanded_page *rdac_page_exp; ++ struct rdac_page_common *rdac_common = NULL; + int res; + +- memset(fail_paths_pg, 0, 118); +- memcpy(fail_paths_pg, mode6_hdr, 4); +- memcpy(fail_paths_pg + 4, block_descriptor, 8); +- rdac_page = (struct rdac_legacy_page *)(fail_paths_pg + 4 + 8); +- rdac_page->page_code = RDAC_CONTROLLER_PAGE | 0x40; +- rdac_page->page_length = RDAC_CONTROLLER_PAGE_LEN; +- rdac_page->current_mode_lsb = RDAC_FAIL_SELECTED_PATHS; +- rdac_page->quiescence = RDAC_QUIESCENCE_TIME; +- rdac_page->options = RDAC_FORCE_QUIESCENCE; +- memset(rdac_page->lun_table, 0x0, 32); +- rdac_page->lun_table[lun] = 0x81; +- +- res = sg_ll_mode_select6(fd, 1 /* pf */, 0 /* sp */, +- fail_paths_pg, 118, +- 1, (do_verbose ? 2 : 0)); ++ if (use_6_byte && lun > 32) { ++ fprintf(stderr, "must use 10 byte cdb to fail luns over 32\n"); ++ return -1; ++ } ++ ++ memset(fail_paths_pg, 0, 308); ++ if (use_6_byte) { ++ memcpy(fail_paths_pg, mode6_hdr, 4); ++ memcpy(fail_paths_pg + 4, block_descriptor, 8); ++ rdac_page = (struct rdac_legacy_page *)(fail_paths_pg + 4 + 8); ++ rdac_page->page_code = RDAC_CONTROLLER_PAGE; ++ rdac_page->page_length = RDAC_CONTROLLER_PAGE_LEN; ++ rdac_common = &rdac_page->attr; ++ memset(rdac_page->lun_table, 0x0, 32); ++ rdac_page->lun_table[lun] = 0x81; ++ } else { ++ memcpy(fail_paths_pg, mode10_hdr, 8); ++ rdac_page_exp = (struct rdac_expanded_page *)(fail_paths_pg + 8); ++ rdac_page_exp->page_code = RDAC_CONTROLLER_PAGE | 0x40; ++ rdac_page_exp->subpage_code = 0x1; ++ rdac_page_exp->page_length[0] = EXPANDED_LUN_SPACE_PAGE_LEN >> 8; ++ rdac_page_exp->page_length[1] = EXPANDED_LUN_SPACE_PAGE_LEN & 0xFF; ++ rdac_common = &rdac_page_exp->attr; ++ memset(rdac_page_exp->lun_table, 0x0, 256); ++ rdac_page_exp->lun_table[lun] = 0x81; ++ } ++ ++ rdac_common->current_mode_lsb = RDAC_FAIL_SELECTED_PATHS; ++ rdac_common->quiescence = RDAC_QUIESCENCE_TIME; ++ rdac_common->options = RDAC_FORCE_QUIESCENCE; ++ ++ if (use_6_byte) { ++ res = sg_ll_mode_select6(fd, 1 /* pf */, 0 /* sp */, ++ fail_paths_pg, 118, ++ 1, (do_verbose ? 2 : 0)); ++ } else { ++ res = sg_ll_mode_select10(fd, 1 /* pf */, 0 /* sp */, ++ fail_paths_pg, 308, ++ 1, (do_verbose ? 2: 0)); ++ } + + switch (res) { + case 0: +@@ -189,16 +259,29 @@ static int fail_this_path(int fd, int lun) + return res; + } + +-static void print_rdac_mode( unsigned char *ptr ) ++static void print_rdac_mode( unsigned char *ptr, int subpg) + { +- struct rdac_legacy_page *rdac_ptr; +- int i, k, bd_len; +- +- bd_len = ptr[3]; +- +- rdac_ptr = (struct rdac_legacy_page *)(ptr + 4 + bd_len); ++ struct rdac_legacy_page *legacy; ++ struct rdac_expanded_page *expanded; ++ struct rdac_page_common *rdac_ptr = NULL; ++ unsigned char * lun_table = NULL; ++ int i, k, bd_len, lun_table_len; ++ ++ if (subpg == 1) { ++ bd_len = ptr[7]; ++ expanded = (struct rdac_expanded_page *)(ptr + 8 + bd_len); ++ rdac_ptr = &expanded->attr; ++ lun_table = expanded->lun_table; ++ lun_table_len = 256; ++ } else { ++ bd_len = ptr[3]; ++ legacy = (struct rdac_legacy_page *)(ptr + 4 + bd_len); ++ rdac_ptr = &legacy->attr; ++ lun_table = legacy->lun_table; ++ lun_table_len = 32; ++ } + +- printf("RDAC Legacy page\n"); ++ printf("RDAC %s page\n", (subpg == 1) ? "Expanded" : "Legacy"); + printf(" Controller serial: %s\n", + rdac_ptr->current_serial); + printf(" Alternate controller serial: %s\n", +@@ -239,9 +322,6 @@ static void print_rdac_mode( unsigned char *ptr ) + case 0x01: + printf("alternate controller present; "); + break; +- case 0x02: +- printf("active/active mode; "); +- break; + default: + printf("(Unknown status 0x%x); ", + rdac_ptr->alternate_mode_msb); +@@ -257,7 +337,10 @@ static void print_rdac_mode( unsigned char *ptr ) + case 0x2: + printf("Dual active mode\n"); + break; +- case 0x04: ++ case 0x3: ++ printf("Not present\n"); ++ break; ++ case 0x4: + printf("held in reset\n"); + break; + default: +@@ -266,11 +349,14 @@ static void print_rdac_mode( unsigned char *ptr ) + } + printf(" Quiescence timeout: %d\n", rdac_ptr->quiescence); + printf(" RDAC option 0x%x\n", rdac_ptr->options); +- printf (" LUN Table:\n"); +- for (k = 0; k < 32; k += 8) { +- printf(" %x:",k / 8); +- for (i = 0; i < 8; i++) { +- switch (rdac_ptr->lun_table[k + i]) { ++ printf(" ALUA: %s\n", (rdac_ptr->options & 0x4 ? "Enabled" : "Disabled" )); ++ printf(" Force Quiescence: %s\n", (rdac_ptr->options & 0x2 ? "Enabled" : "Disabled" )); ++ printf (" LUN Table: (p = preferred, a = alternate, u = utm lun)\n"); ++ printf(" 0 1 2 3 4 5 6 7 8 9 a b c d e f\n"); ++ for (k = 0; k < lun_table_len; k += 16) { ++ printf(" 0x%x:",k / 16); ++ for (i = 0; i < 16; i++) { ++ switch (lun_table[k + i]) { + case 0x0: + printf(" x"); + break; +@@ -287,6 +373,9 @@ static void print_rdac_mode( unsigned char *ptr ) + printf(" ?"); + break; + } ++ if (i == 7) { ++ printf(" "); ++ } + } + printf("\n"); + } +@@ -296,6 +385,7 @@ static void usage() + { + printf("Usage: sg_rdac [-a] [-f=LUN] [-v] [-V] DEVICE\n" + " where:\n" ++ " -6 use 6 byte cdbs for mode sense/select\n" + " -a transfer all devices to the controller\n" + " serving DEVICE.\n" + " -f=LUN transfer the device at LUN to the\n" +@@ -316,6 +406,7 @@ int main(int argc, char * argv[]) + int fail_all = 0; + int fail_path = 0; + int ret = 0; ++ int use_6_byte = 0; + + if (argc < 2) { + usage (); +@@ -333,6 +424,9 @@ int main(int argc, char * argv[]) + else if (!strcmp(*argptr, "-a")) { + ++fail_all; + } ++ else if (!strcmp(*argptr, "-6")) { ++ use_6_byte = 1; ++ } + else if (!strcmp(*argptr, "-V")) { + fprintf(stderr, "sg_rdac version: %s\n", version_str); + return 0; +@@ -364,18 +458,24 @@ int main(int argc, char * argv[]) + } + + if (fail_all) { +- res = fail_all_paths(fd); ++ res = fail_all_paths(fd, use_6_byte); + } else if (fail_path) { +- res = fail_this_path(fd, lun); ++ res = fail_this_path(fd, lun, use_6_byte); + } else { +- res = sg_ll_mode_sense6(fd, /*DBD*/ 0, /* page control */0, ++ if (use_6_byte) { ++ res = sg_ll_mode_sense6(fd, /*DBD*/ 0, /* page control */0, + 0x2c, 0, rsp_buff, 252, + 1, do_verbose); ++ } else { ++ res = sg_ll_mode_sense10(fd, /*llbaa*/ 0, /*DBD*/ 0, /* page control */0, ++ 0x2c, 0x1, rsp_buff, 308, ++ 1, do_verbose); ++ } + + if (!res) { + if (do_verbose) + dump_mode_page(rsp_buff, rsp_buff[0]); +- print_rdac_mode(rsp_buff); ++ print_rdac_mode(rsp_buff, !use_6_byte); + } + } + ret = res; +diff --git a/src/sg_vpd_vendor.c b/src/sg_vpd_vendor.c +index 10d455a..45e2b9d 100644 +--- a/src/sg_vpd_vendor.c ++++ b/src/sg_vpd_vendor.c +@@ -89,20 +89,20 @@ static struct svpd_values_name_t vendor_vpd_pg[] = { + {VPD_V_DEV_BEH_SEA, 0, -1, 1, "devb", "Device behavior (Seagate)"}, + {VPD_V_EDID_RDAC, 0, -1, 1, "edid", "Extended device identification " + "(RDAC)"}, +- {VPD_V_FEAT_RDAC, 1, -1, 1, "feat", "Feature Parameters (RDAC)"}, ++ {VPD_V_FEAT_RDAC, 1, -1, 1, "prm4", "Feature Parameters (RDAC)"}, + {VPD_V_FIRM_SEA, 0, -1, 1, "firm", "Firmware numbers (Seagate)"}, +- {VPD_V_FVER_RDAC, 1, -1, 1, "fver", "Firmware version (RDAC)"}, ++ {VPD_V_FVER_RDAC, 1, -1, 1, "fwr4", "Firmware version (RDAC)"}, + {VPD_V_HP3PAR, 2, -1, 1, "hp3par", "Volume information (HP/3PAR)"}, +- {VPD_V_HVER_RDAC, 3, -1, 1, "hver", "Hardware version (RDAC)"}, ++ {VPD_V_HVER_RDAC, 3, -1, 1, "hwr4", "Hardware version (RDAC)"}, + {VPD_V_JUMP_SEA, 0, -1, 1, "jump", "Jump setting (Seagate)"}, + {VPD_V_RVSI_RDAC, 0, -1, 1, "rvsi", "Replicated volume source " + "identifier (RDAC)"}, + {VPD_V_SAID_RDAC, 0, -1, 1, "said", "Storage array world wide name " + "(RDAC)"}, +- {VPD_V_SUBS_RDAC, 0, -1, 1, "sub", "Subsystem identifier (RDAC)"}, +- {VPD_V_SVER_RDAC, 1, -1, 1, "sver", "Software version (RDAC)"}, ++ {VPD_V_SUBS_RDAC, 0, -1, 1, "subs", "Subsystem identifier (RDAC)"}, ++ {VPD_V_SVER_RDAC, 1, -1, 1, "swr4", "Software version (RDAC)"}, + {VPD_V_UPR_EMC, 1, -1, 1, "upr", "Unit path report (EMC)"}, +- {VPD_V_VAC_RDAC, 0, -1, 1, "vac", "Volume access control (RDAC)"}, ++ {VPD_V_VAC_RDAC, 0, -1, 1, "vac1", "Volume access control (RDAC)"}, + {0, 0, 0, 0, NULL, NULL}, + }; + +@@ -439,7 +439,7 @@ decode_rdac_vpd_c0(unsigned char * buff, int len) + memcpy(name, buff + 152, 2); + printf(" Board Revision: %s\n", name); + memset(name, 0, 65); +- memcpy(name, buff + 154, 2); ++ memcpy(name, buff + 154, 4); + printf(" Board Identifier: %s\n", name); + + return; +@@ -461,7 +461,7 @@ decode_rdac_vpd_c1(unsigned char * buff, int len) + "not possible.\n" , buff[4], buff[5], buff[6], buff[7]); + return; + } +- printf(" Firmware Version: %x.%x.%x\n", buff[8], buff[9], buff[10]); ++ printf(" Firmware Version: %02x.%02x.%02x\n", buff[8], buff[9], buff[10]); + printf(" Firmware Date: %02d/%02d/%02d\n", buff[11], buff[12], buff[13]); + + num_part = (len - 12) / 16; +@@ -504,7 +504,7 @@ decode_rdac_vpd_c2(unsigned char * buff, int len) + "not possible.\n" , buff[4], buff[5], buff[6], buff[7]); + return; + } +- printf(" Software Version: %x.%x.%x\n", buff[8], buff[9], buff[10]); ++ printf(" Software Version: %02x.%02x.%02x\n", buff[8], buff[9], buff[10]); + printf(" Software Date: %02d/%02d/%02d\n", buff[11], buff[12], buff[13]); + printf(" Features:"); + if (buff[14] & 0x01) +@@ -514,9 +514,9 @@ decode_rdac_vpd_c2(unsigned char * buff, int len) + if (buff[14] & 0x04) + printf(" Multiple Sub-enclosures,"); + if (buff[14] & 0x08) +- printf(" DCE/DRM,"); ++ printf(" DCE/DRM/DSS/DVE,"); + if (buff[14] & 0x10) +- printf(" AVT,"); ++ printf(" Asymmetric Logical Unit Access,"); + printf("\n"); + printf(" Max. #of LUNS: %d\n", buff[15]); + +@@ -562,6 +562,7 @@ decode_rdac_vpd_c3(unsigned char * buff, int len) + printf(" UTM: %s\n", buff[11] & 0x80?"enabled":"disabled"); + if ((buff[11] & 0x80)) + printf(" UTM LUN: %02x\n", buff[11] & 0x7f); ++ printf(" Persistent Reservations Bus Reset Support: %s\n", buff[12] & 0x01?"enabled":"disabled"); + + return; + } +@@ -603,6 +604,32 @@ decode_rdac_vpd_c4(unsigned char * buff, int len) + printf(" (Board ID 2880)\n"); + else if (!strcmp(subsystem_rev, "14.0")) + printf(" (Board ID 2822)\n"); ++ else if (!strcmp(subsystem_rev, "15.0")) ++ printf(" (Board ID 6091)\n"); ++ else if (!strcmp(subsystem_rev, "16.0")) ++ printf(" (Board ID 3992)\n"); ++ else if (!strcmp(subsystem_rev, "16.1")) ++ printf(" (Board ID 3991)\n"); ++ else if (!strcmp(subsystem_rev, "17.0")) ++ printf(" (Board ID 1331)\n"); ++ else if (!strcmp(subsystem_rev, "17.1")) ++ printf(" (Board ID 1332)\n"); ++ else if (!strcmp(subsystem_rev, "17.3")) ++ printf(" (Board ID 1532)\n"); ++ else if (!strcmp(subsystem_rev, "17.4")) ++ printf(" (Board ID 1932)\n"); ++ else if (!strcmp(subsystem_rev, "42.0")) ++ printf(" (Board ID 26x0)\n"); ++ else if (!strcmp(subsystem_rev, "43.0")) ++ printf(" (Board ID 498x)\n"); ++ else if (!strcmp(subsystem_rev, "44.0")) ++ printf(" (Board ID 548x)\n"); ++ else if (!strcmp(subsystem_rev, "45.0")) ++ printf(" (Board ID 5501)\n"); ++ else if (!strcmp(subsystem_rev, "46.0")) ++ printf(" (Board ID 2701)\n"); ++ else if (!strcmp(subsystem_rev, "47.0")) ++ printf(" (Board ID 5601)\n"); + else + printf(" (Board ID unknown)\n"); + +@@ -612,6 +639,16 @@ decode_rdac_vpd_c4(unsigned char * buff, int len) + } + + static void ++convert_binary_to_ascii(unsigned char * src, unsigned char * dst, int len) ++{ ++ int i; ++ ++ for (i = 0; i < len; i++) { ++ sprintf((char *)(dst+2*i), "%02x", *(src+i)); ++ } ++} ++ ++static void + decode_rdac_vpd_c8(unsigned char * buff, int len) + { + int i; +@@ -623,6 +660,8 @@ decode_rdac_vpd_c8(unsigned char * buff, int len) + int label_len; + char uuid[33]; + int uuid_len; ++ unsigned char port_id[128]; ++ int n; + + if (len < 0xab) { + fprintf(stderr, "Extended Device Identification VPD page length too " +@@ -679,10 +718,110 @@ decode_rdac_vpd_c8(unsigned char * buff, int len) + + printf(" Logical Unit Number: %s\n", uuid); + ++ /* Initiator transport ID */ ++ if ( buff[10] & 0x01 ) { ++ memset(port_id, 0, 128); ++ printf(" Transport Protocol: "); ++ switch (buff[175] & 0x0F) { ++ case TPROTO_FCP: /* FC */ ++ printf("FC\n"); ++ convert_binary_to_ascii(&buff[183], port_id, 8); ++ n = 199; ++ break; ++ case TPROTO_SRP: /* SRP */ ++ printf("SRP\n"); ++ convert_binary_to_ascii(&buff[183], port_id, 8); ++ n = 199; ++ break; ++ case TPROTO_ISCSI: /* iSCSI */ ++ printf("iSCSI\n"); ++ n = (buff[177] << 8) + buff[178]; ++ memcpy(port_id, &buff[179], n); ++ n = 179 + n; ++ break; ++ case TPROTO_SAS: /* SAS */ ++ printf("SAS\n"); ++ convert_binary_to_ascii(&buff[179], port_id, 8); ++ n = 199; ++ break; ++ default: ++ return; /* Can't continue decoding, so return */ ++ } ++ ++ printf(" Initiator Port Identifier: %s\n", port_id); ++ if ( buff[10] & 0x02 ) { ++ memset(port_id, 0, 128); ++ memcpy(port_id, &buff[n], 8); ++ printf(" Supplemental Vendor ID: %s\n", port_id); ++ } ++ } ++ + return; + } + + static void ++decode_rdac_vpd_c9_rtpg_data(unsigned char aas, unsigned char vendor) ++{ ++ printf(" Asymmetric Access State:"); ++ switch(aas & 0x0F) { ++ case 0x0: ++ printf(" Active/Optimized"); ++ break; ++ case 0x1: ++ printf(" Active/Non-Optimized"); ++ break; ++ case 0x2: ++ printf(" Standby"); ++ break; ++ case 0x3: ++ printf(" Unavailable"); ++ break; ++ case 0xE: ++ printf(" Offline"); ++ break; ++ case 0xF: ++ printf(" Transitioning"); ++ break; ++ default: ++ printf(" (unknown)"); ++ break; ++ } ++ printf("\n"); ++ ++ printf(" Vendor Specific Field:"); ++ switch(vendor) { ++ case 0x01: ++ printf(" Operating normally"); ++ break; ++ case 0x02: ++ printf(" Non-responsive to queries"); ++ break; ++ case 0x03: ++ printf(" Controller being held in reset"); ++ break; ++ case 0x04: ++ printf(" Performing controller firmware download (1st controller)"); ++ break; ++ case 0x05: ++ printf(" Performing controller firmware download (2nd controller)"); ++ break; ++ case 0x06: ++ printf(" Quiesced as a result of an administrative request"); ++ break; ++ case 0x07: ++ printf(" Service mode as a result of an administrative request"); ++ break; ++ case 0xFF: ++ printf(" Details are not available"); ++ break; ++ default: ++ printf(" (unknown)"); ++ break; ++ } ++ printf("\n"); ++} ++ ++static void + decode_rdac_vpd_c9(unsigned char * buff, int len) + { + if (len < 3) { +@@ -699,14 +838,18 @@ decode_rdac_vpd_c9(unsigned char * buff, int len) + fprintf(stderr, "Invalid page version '%c' (should be 1)\n", + buff[7]); + } +- printf(" AVT:"); +- if (buff[8] & 0x80) { +- printf(" Enabled"); +- if (buff[8] & 0x40) +- printf(" (Allow reads on sector 0)"); +- printf("\n"); ++ if ( (buff[8] & 0xE0) == 0xE0 ) { ++ printf(" IOShipping (ALUA): Enabled\n"); + } else { +- printf(" Disabled\n"); ++ printf(" AVT:"); ++ if (buff[8] & 0x80) { ++ printf(" Enabled"); ++ if (buff[8] & 0x40) ++ printf(" (Allow reads on sector 0)"); ++ printf("\n"); ++ } else { ++ printf(" Disabled\n"); ++ } + } + printf(" Volume Access via: "); + if (buff[8] & 0x01) +@@ -714,8 +857,54 @@ decode_rdac_vpd_c9(unsigned char * buff, int len) + else + printf("alternate controller\n"); + +- printf(" Path priority: %d ", buff[9] & 0xf); +- switch(buff[9] & 0xf) { ++ if (buff[8] & 0x08) { ++ printf(" Path priority: %d ", buff[15] & 0xf); ++ switch(buff[15] & 0xf) { ++ case 0x1: ++ printf("(preferred path)\n"); ++ break; ++ case 0x2: ++ printf("(secondary path)\n"); ++ break; ++ default: ++ printf("(unknown)\n"); ++ break; ++ } ++ ++ printf(" Preferred Path Auto Changeable:"); ++ switch(buff[14] & 0x3C) { ++ case 0x14: ++ printf(" No (User Disabled and Host Type Restricted)\n"); ++ break; ++ case 0x18: ++ printf(" No (User Disabled)\n"); ++ break; ++ case 0x24: ++ printf(" No (Host Type Restricted)\n"); ++ break; ++ case 0x28: ++ printf(" Yes\n"); ++ break; ++ default: ++ printf(" (Unknown)\n"); ++ break; ++ } ++ ++ printf(" Implicit Failback:"); ++ switch(buff[14] & 0x03) { ++ case 0x1: ++ printf(" Disabled\n"); ++ break; ++ case 0x2: ++ printf(" Enabled\n"); ++ break; ++ default: ++ printf(" (Unknown)\n"); ++ break; ++ } ++ } else { ++ printf(" Path priority: %d ", buff[9] & 0xf); ++ switch(buff[9] & 0xf) { + case 0x1: + printf("(preferred path)\n"); + break; +@@ -725,9 +914,17 @@ decode_rdac_vpd_c9(unsigned char * buff, int len) + default: + printf("(unknown)\n"); + break; ++ } + } + +- return; ++ ++ if (buff[8] & 0x80) { ++ printf(" Target Port Group Data (This controller):\n"); ++ decode_rdac_vpd_c9_rtpg_data(buff[10], buff[11]); ++ ++ printf(" Target Port Group Data (Alternate controller):\n"); ++ decode_rdac_vpd_c9_rtpg_data(buff[12], buff[13]); ++ } + } + + static void +-- +1.8.3.1 + diff --git a/SOURCES/0001-Fix-dev-null-redirect-mistakes.patch b/SOURCES/0001-Fix-dev-null-redirect-mistakes.patch new file mode 100644 index 0000000..3d9b4e4 --- /dev/null +++ b/SOURCES/0001-Fix-dev-null-redirect-mistakes.patch @@ -0,0 +1,115 @@ +From 9d2adc90e76e76c07ee63b2b2868579188fec1a7 Mon Sep 17 00:00:00 2001 +From: David Sommerseth +Date: Fri, 15 Apr 2016 23:53:18 +0200 +Subject: [PATCH] Fix /dev/null redirect mistakes + +Several places there are attempts to redirect to /dev/null, but +missing the redirect operator. This causes also /dev/null to be +deleted when running 'rescan-scsi-bus.sh -u'. + +Patch based on proposed patches in Red Hat bugzilla 1245302 +--- + scripts/rescan-scsi-bus.sh | 28 ++++++++++++++-------------- + 1 file changed, 14 insertions(+), 14 deletions(-) + +diff --git a/scripts/rescan-scsi-bus.sh b/scripts/rescan-scsi-bus.sh +index 7ec9323..4468cd3 100644 +--- a/scripts/rescan-scsi-bus.sh ++++ b/scripts/rescan-scsi-bus.sh +@@ -234,7 +234,7 @@ testonline () + if test ! -x /usr/bin/sg_turs; then return 0; fi + sgdevice + if test -z "$SGDEV"; then return 0; fi +- sg_turs /dev/$SGDEV >/dev/null 2>&1 ++ sg_turs /dev/$SGDEV &>/dev/null + RC=$? + # Handle in progress of becoming ready and unit attention -- wait at max 11s + declare -i ctr=0 +@@ -246,7 +246,7 @@ testonline () + if test $RC = 2 -a "$RMB" != "1"; then echo -n "."; let LN+=1; sleep 1 + else usleep 20000; fi + let ctr+=1 +- sg_turs /dev/$SGDEV >/dev/null 2>&1 ++ sg_turs /dev/$SGDEV &>/dev/null + RC=$? + done + if test $ctr != 0; then white_out; fi +@@ -703,7 +703,7 @@ findremapped() + # Trigger udev to update the info + echo -n "Triggering udev to update device information... " + /sbin/udevadm trigger +- udevadm_settle 2&>1 /dev/null ++ udevadm_settle &>/dev/null + echo "Done" + + # See what changed and reload the respective multipath device if applicable +@@ -724,12 +724,12 @@ findremapped() + incrchgd "$hctl" + fi + done < $tmpfile +- rm $tmpfile 2&>1 /dev/null ++ rm $tmpfile &>/dev/null + + if test -n "$mp_enable" -a -n "$mpaths" ; then + echo "Updating multipath device mappings" + flushmpaths +- $MULTIPATH | grep "create:" 2> /dev/null #2&>1 /dev/null ++ $MULTIPATH | grep "create:" 2> /dev/null + fi + } + +@@ -831,14 +831,14 @@ reloadmpaths() + + if [ "$1" = "1" ] ; then + echo "Reloading all multipath devices" +- $MULTIPATH -r 2&>1 /dev/null ++ $MULTIPATH -r &>/dev/null + return + fi + + # Reload the multipath devices + for mpath in $mpaths ; do + echo "Reloading multipath device $mpath" +- $MULTIPATH -r $mpath 2&>1 /dev/null ++ $MULTIPATH -r $mpath &>/dev/null + done + } + +@@ -851,9 +851,9 @@ flushmpaths() + num=$($DMSETUP status $mpath | awk 'BEGIN{RS=" ";active=0}/[0-9]+:[0-9]+/{dev=1}/A/{if (dev == 1) active++; dev=0} END{ print active }') + if [ $num -eq 0 ] ; then + echo -n "Flushing multipath device $mpath... " +- $DMSETUP message $mpath 0 fail_if_no_path 2&>1 /dev/null +- $MULTIPATH -f $mpath 2&>1 /dev/null +- $DMSETUP status $mpath 2&>1 /dev/null ++ $DMSETUP message $mpath 0 fail_if_no_path &>/dev/null ++ $MULTIPATH -f $mpath &>/dev/null ++ $DMSETUP status $mpath &>/dev/null + if test "$?" = "1" ; then + echo "Done" + else +@@ -866,9 +866,9 @@ flushmpaths() + # Flush all the devs specified in $mpaths + for mpath in $mpaths ; do + echo -n "Flushing multipath device $mpath... " +- $DMSETUP message $mpath 0 fail_if_no_path 2&>1 /dev/null +- $MULTIPATH -f $mpath 2&>1 /dev/null +- $DMSETUP status $mpath 2&>1 /dev/null ++ $DMSETUP message $mpath 0 fail_if_no_path &>/dev/null ++ $MULTIPATH -f $mpath &>/dev/null ++ $DMSETUP status $mpath &>/dev/null + if test "$?" = "1" ; then + echo "Done" + else +@@ -967,7 +967,7 @@ if test ! -d /sys/class/scsi_host/ -a ! -d /proc/scsi/; then + fi + + # Make sure sg is there +-modprobe sg >/dev/null 2>&1 ++modprobe sg &>/dev/null + + if test -x /usr/bin/sg_inq; then + sg_version=$(sg_inq -V 2>&1 | cut -d " " -f 3) +-- +1.8.3.1 + diff --git a/SOURCES/0001-Fix-issues-with-multi-word-device-types.patch b/SOURCES/0001-Fix-issues-with-multi-word-device-types.patch new file mode 100644 index 0000000..c2beb77 --- /dev/null +++ b/SOURCES/0001-Fix-issues-with-multi-word-device-types.patch @@ -0,0 +1,31 @@ +commit 9a2c94700471486dd6487b7659762a41f7ee33c7 +Author: David Sommerseth +Date: Fri Apr 15 20:31:32 2016 +0200 + + Fix issues with multi word device types + + When running rescan-scsi-bus.sh on systems with device types such + as "Medium Changer" or "Optical Device", the following error can be + observed: + + /usr/bin/rescan-scsi-bus.sh: line 281: [: too many arguments + + Signed-off-by: David Sommerseth + +diff --git a/scripts/rescan-scsi-bus.sh b/scripts/rescan-scsi-bus.sh +old mode 100755 +new mode 100644 +index 81112c1..7ec9323 +--- a/scripts/rescan-scsi-bus.sh ++++ b/scripts/rescan-scsi-bus.sh +@@ -278,7 +278,9 @@ testonline () + return 1 + fi + TMPSTR=`echo "$SCSISTR" | sed -n 's/.*Type: *\(.*\) *ANSI.*/\1/p'` +- if [ $TMPSTR != $TYPE ] ; then ++ NTMPSTR="$(sed -e 's/[[:space:]]*$//' -e 's/^[[:space:]]*//' <<<${TMPSTR})" ++ NTYPE="$(sed -e 's/[[:space:]]*$//' -e 's/^[[:space:]]*//' <<<${TYPE})" ++ if [ "$NTMPSTR" != "$NTYPE" ] ; then + echo -e "\e[A\e[A\e[A\e[A${red}$SGDEV changed: ${bold}\nfrom:${TMPSTR} \nto: $TYPE ${norm} \n\n\n" + return 1 + fi diff --git a/SOURCES/0001-Fix-syntax-error-in-if-statement-related-to-mpath-fl.patch b/SOURCES/0001-Fix-syntax-error-in-if-statement-related-to-mpath-fl.patch new file mode 100644 index 0000000..abd1a5a --- /dev/null +++ b/SOURCES/0001-Fix-syntax-error-in-if-statement-related-to-mpath-fl.patch @@ -0,0 +1,29 @@ +From e946e403b434d27c88dc7819fb3589419cdfd954 Mon Sep 17 00:00:00 2001 +From: David Sommerseth +Date: Fri, 22 Apr 2016 18:58:08 +0200 +Subject: [PATCH] Fix syntax error in if-statement related to mpath flush + operation + +Without this patch, the error "[-x: command not found" would be seen +when running 'rescan-scsi-bus.sh -f' on a system with multipath support +packages installed. +--- + scripts/rescan-scsi-bus.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/scripts/rescan-scsi-bus.sh b/scripts/rescan-scsi-bus.sh +index 4468cd3..caa031f 100644 +--- a/scripts/rescan-scsi-bus.sh ++++ b/scripts/rescan-scsi-bus.sh +@@ -1090,7 +1090,7 @@ declare -i updated=0 + declare -i rmvd=0 + + if [ -n "$flush" ] ; then +- if [-x $MULTIPATH ] ; then ++ if [ -x $MULTIPATH ] ; then + flushmpaths 1 + fi + fi +-- +1.8.3.1 + diff --git a/SOURCES/BZ_1359274_sg_logs_fix_inline_help.patch b/SOURCES/BZ_1359274_sg_logs_fix_inline_help.patch new file mode 100644 index 0000000..3b72184 --- /dev/null +++ b/SOURCES/BZ_1359274_sg_logs_fix_inline_help.patch @@ -0,0 +1,13 @@ +diff -Nur sg3_utils-1.37_old/src/sg_logs.c sg3_utils-1.37/src/sg_logs.c +--- sg3_utils-1.37_old/src/sg_logs.c 2018-07-16 20:25:42.111255897 +0800 ++++ sg3_utils-1.37/src/sg_logs.c 2018-07-16 20:28:08.235249900 +0800 +@@ -169,7 +169,8 @@ + " --transport|-T decode transport (protocol specific port " + "0x18) log page\n" + " --verbose|-v increase verbosity\n" +- " -N|--new use new interface\n" ++ " --new|-N use new interface\n" ++ " --old|-O use old interface (use as first option)\n" + " --version|-V output version string then exit\n\n" + "Performs a SCSI LOG SENSE (or LOG SELECT) command and decodes " + "the response.\n"); diff --git a/SOURCES/BZ_1359282_sg_requests_fix_manpage.patch b/SOURCES/BZ_1359282_sg_requests_fix_manpage.patch new file mode 100644 index 0000000..8b6c731 --- /dev/null +++ b/SOURCES/BZ_1359282_sg_requests_fix_manpage.patch @@ -0,0 +1,12 @@ +diff -Nur sg3_utils-1.37_old/doc/sg_requests.8 sg3_utils-1.37/doc/sg_requests.8 +--- sg3_utils-1.37_old/doc/sg_requests.8 2012-12-22 11:05:14.000000000 +0800 ++++ sg3_utils-1.37/doc/sg_requests.8 2018-07-17 20:48:10.968824402 +0800 +@@ -43,7 +43,7 @@ + is reached or an error occurs. The default value for \fINUM\fR is 1 . + .TP + \fB\-p\fR, \fB\-\-progress\fR +-show progress indication (a percentage) if available. If \fI\-\-number=NUM\fR ++show progress indication (a percentage) if available. If \fI\-\-num=NUM\fR + is given, \fINUM\fR is greater than 1 and an initial progress indication + was detected then this utility waits 30 seconds before subsequent checks. + Exits when \fINUM\fR is reached or there are no more progress indications. diff --git a/SOURCES/BZ_1359286_sg_senddiag_fix_help.patch b/SOURCES/BZ_1359286_sg_senddiag_fix_help.patch new file mode 100644 index 0000000..9e73cd1 --- /dev/null +++ b/SOURCES/BZ_1359286_sg_senddiag_fix_help.patch @@ -0,0 +1,21 @@ +diff -Nur sg3_utils-1.37_old/src/sg_senddiag.c sg3_utils-1.37/src/sg_senddiag.c +--- sg3_utils-1.37_old/src/sg_senddiag.c 2018-07-17 20:46:38.731809658 +0800 ++++ sg3_utils-1.37/src/sg_senddiag.c 2018-07-17 21:15:20.035924083 +0800 +@@ -79,7 +79,7 @@ + " --extdur|-e duration of an extended self-test (from mode " + "page 0xa)\n" + " --help|-h print usage message then exit\n" +- " --hex|H output in hex\n" ++ " --hex|-H output in hex\n" + " --list|-l list supported page codes (with or without " + "DEVICE)\n" + " --pf|-p set PF bit (def: 0)\n" +@@ -128,7 +128,7 @@ + " -uoff unit offline (def: 0, only with '-t')\n" + " -v increase verbosity (print issued SCSI cmds)\n" + " -V output version string\n" +- " -N|--new use new interface\n" ++ " --new|-N use new interface\n" + " -? output this usage message\n\n" + "Performs a SCSI SEND DIAGNOSTIC (and/or a RECEIVE DIAGNOSTIC " + "RESULTS) command\n" diff --git a/SOURCES/BZ_1359292_sg_write_buffer_fix_help.patch b/SOURCES/BZ_1359292_sg_write_buffer_fix_help.patch new file mode 100644 index 0000000..faa2402 --- /dev/null +++ b/SOURCES/BZ_1359292_sg_write_buffer_fix_help.patch @@ -0,0 +1,12 @@ +diff -Nur sg3_utils-1.37_old/src/sg_write_buffer.c sg3_utils-1.37/src/sg_write_buffer.c +--- sg3_utils-1.37_old/src/sg_write_buffer.c 2013-07-31 07:58:53.000000000 +0800 ++++ sg3_utils-1.37/src/sg_write_buffer.c 2018-07-17 22:02:28.434790002 +0800 +@@ -72,7 +72,7 @@ + "deduced from FILE\n" + " --mode=MO|-m MO write buffer mode, MO is number or " + "acronym (def: 0)\n" +- " --off=OFF|-o OFF buffer offset (unit: bytes, def: 0)\n" ++ " --offset=OFF|-o OFF buffer offset (unit: bytes, def: 0)\n" + " --raw|-r read from stdin (same as '-I -')\n" + " --skip=SKIP|-s SKIP bytes in file FILE to skip before " + "reading\n" diff --git a/SOURCES/BZ_1360915-rescan-scsi-bus.sh-Fixup-help-text-for-forcerescan.patch b/SOURCES/BZ_1360915-rescan-scsi-bus.sh-Fixup-help-text-for-forcerescan.patch new file mode 100644 index 0000000..e22c628 --- /dev/null +++ b/SOURCES/BZ_1360915-rescan-scsi-bus.sh-Fixup-help-text-for-forcerescan.patch @@ -0,0 +1,14 @@ +diff -Nur sg3_utils-1.37_old/scripts/rescan-scsi-bus.sh sg3_utils-1.37/scripts/rescan-scsi-bus.sh +--- sg3_utils-1.37_old/scripts/rescan-scsi-bus.sh 2017-03-14 14:45:43.312032787 +0800 ++++ sg3_utils-1.37/scripts/rescan-scsi-bus.sh 2017-03-14 14:47:06.997039234 +0800 +@@ -964,8 +964,8 @@ + echo "--issue-lip: same as -i" + echo "--wide: same as -w" + echo "--multipath: same as -m" +- echo "--forcerescan: Rescan existing devices" +- echo "--forceremove: Remove and readd every device (DANGEROUS)" ++ echo "--forceremove: Remove stale devices (DANGEROUS)" ++ echo "--forcerescan: Remove and readd existing devices (DANGEROUS)" + echo "--nooptscan: don't stop looking for LUNs if 0 is not found" + echo "--color: use coloured prefixes OLD/NEW/DEL" + echo "--hosts=LIST: Scan only host(s) in LIST" diff --git a/SOURCES/BZ_1380744-rescan-scsi-bus.sh-Add-lunsearch-filter-to-searchexi.patch b/SOURCES/BZ_1380744-rescan-scsi-bus.sh-Add-lunsearch-filter-to-searchexi.patch new file mode 100644 index 0000000..7c2927c --- /dev/null +++ b/SOURCES/BZ_1380744-rescan-scsi-bus.sh-Add-lunsearch-filter-to-searchexi.patch @@ -0,0 +1,45 @@ +From c387f9de93750a04380f068803ce9da340cf45f5 Mon Sep 17 00:00:00 2001 +From: Sebastian Parschauer +Date: Wed, 31 Aug 2016 15:34:23 +0200 +Subject: [PATCH] rescan-scsi-bus.sh: Add lunsearch filter to searchexisting() + +A user has reported that `rescan-scsi-bus.sh --luns=` prints +all existing LUNs and scans all new LUNs instead of only the ones +specified. The problem is that searchexisting() always calls +doreportlun() and is missing the lunsearch filter e.g. used in +dosearch(). +So add the required lunsearch filter from dosearch() to +searchexisting(). + +References: bsc#981452 + +Signed-off-by: Sebastian Parschauer +--- + scripts/rescan-scsi-bus.sh | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +diff --git a/scripts/rescan-scsi-bus.sh b/scripts/rescan-scsi-bus.sh +index 5f43d6d..1f957b0 100755 +--- a/scripts/rescan-scsi-bus.sh ++++ b/scripts/rescan-scsi-bus.sh +@@ -715,7 +715,16 @@ searchexisting() + else + match=1 + fi +- test $match -eq 1 && doreportlun ++ ++ test $match -eq 0 && continue ++ ++ if [ -z "$lunsearch" ] ; then ++ doreportlun ++ else ++ for lun in $lunsearch ; do ++ dolunscan ++ done ++ fi + done + } + +-- +2.12.0 + diff --git a/SOURCES/BZ_1400491_rescan-scsi-bus.sh_ignore_rev_change.patch b/SOURCES/BZ_1400491_rescan-scsi-bus.sh_ignore_rev_change.patch new file mode 100644 index 0000000..206787c --- /dev/null +++ b/SOURCES/BZ_1400491_rescan-scsi-bus.sh_ignore_rev_change.patch @@ -0,0 +1,50 @@ +diff -Nur sg3_utils-1.37_old/scripts/rescan-scsi-bus.sh sg3_utils-1.37/scripts/rescan-scsi-bus.sh +--- sg3_utils-1.37_old/scripts/rescan-scsi-bus.sh 2018-06-12 19:54:42.668354127 +0800 ++++ sg3_utils-1.37/scripts/rescan-scsi-bus.sh 2018-06-12 19:55:13.261890351 +0800 +@@ -273,9 +273,19 @@ + return 2 + fi + TMPSTR=`echo "$SCSISTR" | grep 'Vendor:'` +- if [ "$TMPSTR" != "$STR" ]; then +- echo -e "\e[A\e[A\e[A\e[A${red}$SGDEV changed: ${bold}\nfrom:${SCSISTR#* } \nto: $STR ${norm} \n\n\n" +- return 1 ++ if test $ignore_rev -eq 0 ; then ++ if [ "$TMPSTR" != "$STR" ]; then ++ echo -e "\e[A\e[A\e[A\e[A${red}$SGDEV changed: ${bold}\nfrom:${SCSISTR#* } \nto: $STR ${norm} \n\n\n" ++ return 1 ++ fi ++ else ++ # Ignore disk revision change ++ local old_str_no_rev=`echo "$TMPSTR" | sed -e 's/.\{4\}$//'` ++ local new_str_no_rev=`echo "$STR" | sed -e 's/.\{4\}$//'` ++ if [ "$old_str_no_rev" != "$new_str_no_rev" ]; then ++ echo -e "\e[A\e[A\e[A\e[A${red}$SGDEV changed: ${bold}\nfrom:${SCSISTR#* } \nto: $STR ${norm} \n\n\n" ++ return 1 ++ fi + fi + TMPSTR=`echo "$SCSISTR" | sed -n 's/.*Type: *\(.*\) *ANSI.*/\1/p'` + NTMPSTR="$(sed -e 's/[[:space:]]*$//' -e 's/^[[:space:]]*//' <<<${TMPSTR})" +@@ -965,6 +975,7 @@ + echo "--sparselun: Tell kernel to support sparse LUN numbering" + echo "--update: same as -u" + echo "--resize: same as -s" ++ echo "--ignore-rev: Ignore the revision change" + echo " Host numbers may thus be specified either directly on cmd line (deprecated) or" + echo " or with the --hosts=LIST parameter (recommended)." + echo "LIST: A[-B][,C[-D]]... is a comma separated list of single values and ranges" +@@ -1016,6 +1027,7 @@ + existing_targets=1 + mp_enable= + declare -i scan_flags=0 ++ignore_rev=0 + + # Scan options + opt="$1" +@@ -1056,6 +1068,7 @@ + -sparselun) scan_flags=$((scan_flags|0x40)) ;; + -update) update=1;; + -wide) opt_idsearch=`seq 0 15` ;; ++ -ignore-rev) ignore_rev=1;; + *) echo "Unknown option -$opt !" ;; + esac + shift diff --git a/SOURCES/rescan-scsi-bus.sh.8 b/SOURCES/rescan-scsi-bus.sh.8 new file mode 100644 index 0000000..60f8feb --- /dev/null +++ b/SOURCES/rescan-scsi-bus.sh.8 @@ -0,0 +1,93 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.41.2. +.TH RESCAN-SCSI-BUS.SH "1" "leden 2014" "rescan-scsi-bus.sh 1.57" "User Commands" +.SH NAME +rescan-scsi-bus.sh \- script for adding and removing SCSI devices without rebooting +.SH SYNOPSIS +.B rescan-scsi-bus.sh +[\fIoptions\fR] [\fIhost \fR[\fIhost \fR...]] +.SH OPTIONS +.TP +\fB\-a\fR, \fB\-\-alltargets\fR +scan all targets, not just currently existing [default: disabled] +.TP +\fB\-d\fR +enable debug [default: 0] +.TP +\fB\-l\fR +activates scanning for LUNs 0\-\-7 [default: 0] +.TP +\fB\-L\fR NUM +activates scanning for LUNs 0\-\-NUM [default: 0] +.TP +\fB\-w\fR, \fB\-\-wide\fR +scan for target device IDs 0\-\-15 [default: 0\-\-7] +.TP +\fB\-c\fR +enables scanning of channels 0 1 [default: 0 / all detected ones] +.TP +\fB\-r\fR, \fB\-\-remove\fR +enables removing of devices [default: disabled] +.TP +\fB\-f\fR, \fB\-\-flush\fR +flush failed multipath devices [default: disabled] +.TP +\fB\-i\fR, \fB\-\-issue\-lip\fR +issue a FibreChannel LIP reset [default: disabled] +.TP +\fB\-m\fR, \fB\-\-multipath\fR +update multipath devices [default: disabled] +.TP +\fB\-u\fR, \fB\-\-update\fR +look for existing disks that have been remapped +.TP +\fB\-s\fR, \fB\-\-resize\fR +look for resized disks and reload associated multipath devices, if applicable +.TP +\fB\-\-forcerescan\fR +remove and readd existing devices (DANGEROUS) +.TP +\fB\-\-forceremove\fR +remove stale devices (DANGEROUS) +.TP +\fB\-\-nooptscan\fR +don't stop looking for LUNs if 0 is not found +.TP +\fB\-\-color\fR +use coloured prefixes OLD/NEW/DEL +.TP +\fB\-\-hosts\fR=\fILIST\fR +scan only host(s) in \fILIST\fR +.TP +\fB\-\-channels\fR=\fILIST\fR +scan only channel(s) in \fILIST\fR +.TP +\fB\-\-ids\fR=\fILIST\fR +scan only target ID(s) in \fILIST\fR +.TP +\fB\-\-luns\fR=\fILIST\fR +scan only lun(s) in \fILIST\fR +.TP +\fB\-\-sync\fR, \fB\-\-nosync\fR +issue a sync / no sync [default: sync if remove] +.TP +\fB\-\-attachpq3\fR +tell kernel to attach sg to LUN 0 that reports PQ=3 +.TP +\fB\-\-reportlun2\fR +tell kernel to try REPORT_LUN even on SCSI2 devices +.TP +\fB\-\-largelun\fR +tell kernel to support LUNs > 7 even on SCSI2 devs +.TP +\fB\-\-sparselun\fR +tell kernel to support sparse LUN numbering +.IP +Host numbers may thus be specified either directly on cmd line (deprecated) or +or with the \fB\-\-hosts\fR=\fILIST\fR parameter (recommended). +.PP +\fILIST\fR: A[\-B][,C[\-D]]... is a comma separated list of single values and ranges +(No spaces allowed.) +.SH SEE ALSO +\fBrescan-scsi-bus.sh\fR Homepage: \fBhttp://www.garloff.de/kurt/linux/#rescan-scsi\fR +.PP +\fBsg3_utils\fR Homepage: \fBhttp://sg.danny.cz/sg\fR diff --git a/SOURCES/scsi-rescan.8 b/SOURCES/scsi-rescan.8 new file mode 100644 index 0000000..7252653 --- /dev/null +++ b/SOURCES/scsi-rescan.8 @@ -0,0 +1 @@ +.so man8/rescan-scsi-bus.sh.8 diff --git a/SOURCES/sg3_utils-1.37-dont-open-dev-snapshot.patch b/SOURCES/sg3_utils-1.37-dont-open-dev-snapshot.patch new file mode 100644 index 0000000..2fbfe3a --- /dev/null +++ b/SOURCES/sg3_utils-1.37-dont-open-dev-snapshot.patch @@ -0,0 +1,27 @@ +From a0569d83929d98c0a175bc3992352c2c8d09ffa4 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Dan=20Hor=C3=A1k?= +Date: Fri, 18 Oct 2013 12:38:05 +0200 +Subject: [PATCH] don't open /dev/snapshot in sginfo (#920687) + +see https://bugzilla.redhat.com/show_bug.cgi?id=920687 for details +--- + src/sginfo.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/src/sginfo.c b/src/sginfo.c +index b27f117..1f2151d 100644 +--- a/src/sginfo.c ++++ b/src/sginfo.c +@@ -3408,6 +3408,9 @@ show_devices(int raw) + if ( isdigit(entry->d_name[strlen(entry->d_name)-1]) ) { + continue; + } ++ if ( strncmp("snapshot",entry->d_name,8) == 0 ) { ++ continue; ++ } + + snprintf(dev_name, sizeof(dev_name),"/dev/%s",entry->d_name); + +-- +1.8.1.4 + diff --git a/SOURCES/sg3_utils-1.37-man-pages-fix.patch b/SOURCES/sg3_utils-1.37-man-pages-fix.patch new file mode 100644 index 0000000..3c7ca36 --- /dev/null +++ b/SOURCES/sg3_utils-1.37-man-pages-fix.patch @@ -0,0 +1,95 @@ +From 1653f314de9f0a0415259f2182bf65a745537f33 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Dan=20Hor=C3=A1k?= +Date: Tue, 28 Jan 2014 14:15:56 +0100 +Subject: [PATCH] remove duplicit words in man pages + +--- + doc/sg3_utils.8 | 2 +- + doc/sg_format.8 | 2 +- + doc/sg_get_lba_status.8 | 2 +- + doc/sg_ses.8 | 2 +- + doc/sg_stpg.8 | 2 +- + doc/sginfo.8 | 2 +- + 6 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/doc/sg3_utils.8 b/doc/sg3_utils.8 +index ae9b181..d295eeb 100644 +--- a/doc/sg3_utils.8 ++++ b/doc/sg3_utils.8 +@@ -146,7 +146,7 @@ drives and "cd" for SCSI CD/DVD/BD drives. Each SCSI device has a + corresponding pass\-through device name of the form /dev/pass + where is an integer starting at zero. The "camcontrol devlist" + command may be useful for finding out which SCSI device names are +-available and the correspondence between between class and pass\-through ++available and the correspondence between class and pass\-through + names. + .SH SOLARIS DEVICE NAMING + SCSI device names below the /dev directory have a form like: c5t4d3s2 +diff --git a/doc/sg_format.8 b/doc/sg_format.8 +index 4cf4e82..055ff04 100644 +--- a/doc/sg_format.8 ++++ b/doc/sg_format.8 +@@ -265,7 +265,7 @@ protection type of a disk can be found in the "P_TYPE" and "PROT_EN" + fields in the response of a READ CAPACITY (16) command (e.g. with + the 'sg_readcap \-\-long' utility). + .PP +-Given that a device supports a particular protection type, a user can then ++Given that a device supports a particular protection type, a user can + then choose to format that disk with that protection type by setting + the "FMTPINFO" and "Protection Field Usage" fields in the FORMAT UNIT + command. Those fields correspond to the \fI\-\-fmtpinfo=FPI\fR and the +diff --git a/doc/sg_get_lba_status.8 b/doc/sg_get_lba_status.8 +index ab8269c..bbb0c09 100644 +--- a/doc/sg_get_lba_status.8 ++++ b/doc/sg_get_lba_status.8 +@@ -28,7 +28,7 @@ when use once then one LBA status descriptor per line is output to stdout. + Each line has this + format: "0x 0x ". So the + descriptor LBA and blocks are output in hex and the provisioning status +-in decimal. When used twice (e.g. '\-bb' or '\-\-brief \-\-brief') the ++in decimal. When used twice (e.g. '\-bb' or '\-\-brief \-\-brief') + the provisioning status of the given \fILBA\fR (or LBA 0 if the + \fI\-\-lba\fR option is not given) is output to stdout. A check is made + that the given \fILBA\fR lies on the range of the first returned LBA +diff --git a/doc/sg_ses.8 b/doc/sg_ses.8 +index 1cd71c5..a94fe48 100644 +--- a/doc/sg_ses.8 ++++ b/doc/sg_ses.8 +@@ -237,7 +237,7 @@ given. + .PP + One of two command lines variants can be used to specify indexes: + \fI\-\-index=TIA,II\fR where \fITIA\fR is either an type header index (TI) +-or an Element type abbreviation (A) (e.g. "ps" or "ps1"). \fIII\fR is ++or an Element type abbreviation (A) (e.g. "ps" or "ps1"). \fIII\fR + is either an individual index or "\-1" to specify the overall element. The + second variant is \fI\-\-index=IIA\fR where \fIIIA\fR is either an individual + index (II) or an Element type abbreviation (A). When \fIIIA\fR is an +diff --git a/doc/sg_stpg.8 b/doc/sg_stpg.8 +index f93f029..8ab6b1a 100644 +--- a/doc/sg_stpg.8 ++++ b/doc/sg_stpg.8 +@@ -104,7 +104,7 @@ identifier (i.e. acts on one or more target ports). + When \fI\-\-tp=\fR is given then the same number of elements should be + given to the \fI\-\-state=\fR option. If more than one list element is + given to \fI\-\-tp=\fR and an equal number of elements is _not_ given +-to the the \fI\-\-state=\fR option, then if only one state is specified ++to the \fI\-\-state=\fR option, then if only one state is specified + then it is repeated. + .SH EXIT STATUS + The exit status of sg_stpg is 0 when it is successful. Otherwise see +diff --git a/doc/sginfo.8 b/doc/sginfo.8 +index 8d570b1..7abff65 100644 +--- a/doc/sginfo.8 ++++ b/doc/sginfo.8 +@@ -287,7 +287,7 @@ hex (mode page index in the first column and the corresponding byte + value in the second column) use "\-u 0xa". Mode pages (subpage code == 0) + start at index position 2 while subpages start at index position 4. + If the "\-Xu ..." option is used then a list a hex values each value +-prefixed by "@" is output. Mode (sub)page values can then be modified with ++prefixed by "@" is output. Mode (sub)page values can then be modified + with the "\-RXu ..." option. + .PP + .SH RESTRICTIONS +-- +1.8.1.4 + diff --git a/SOURCES/sg3_utils-1.37-rescan-scsi-missingoption.patch b/SOURCES/sg3_utils-1.37-rescan-scsi-missingoption.patch new file mode 100644 index 0000000..67a8481 --- /dev/null +++ b/SOURCES/sg3_utils-1.37-rescan-scsi-missingoption.patch @@ -0,0 +1,19 @@ +diff -urNp sg3_utils-1.37-orig/scripts/rescan-scsi-bus.sh sg3_utils-1.37-new/scripts/rescan-scsi-bus.sh +--- sg3_utils-1.37-orig/scripts/rescan-scsi-bus.sh 2016-07-19 15:49:36.401733259 +0200 ++++ sg3_utils-1.37-new/scripts/rescan-scsi-bus.sh 2016-07-19 15:54:35.719136146 +0200 +@@ -929,6 +929,7 @@ if test @$1 = @--help -o @$1 = @-h -o @$ + echo " -L NUM activates scanning for LUNs 0--NUM [default: 0]" + echo " -w scan for target device IDs 0--15 [default: 0--7]" + echo " -c enables scanning of channels 0 1 [default: 0 / all detected ones]" ++ echo " -m update multipath devices [default: disabled]" + echo " -r enables removing of devices [default: disabled]" + echo " -f flush failed multipath devices [default: disabled]" + echo " -i issue a FibreChannel LIP reset [default: disabled]" +@@ -939,6 +940,7 @@ if test @$1 = @--help -o @$1 = @-h -o @$ + echo "--flush: same as -f" + echo "--issue-lip: same as -i" + echo "--wide: same as -w" ++ echo "--multipath: same as -m" + echo "--forcerescan: Rescan existing devices" + echo "--forceremove: Remove and readd every device (DANGEROUS)" + echo "--nooptscan: don't stop looking for LUNs if 0 is not found" diff --git a/SOURCES/sg3_utils-1.37-rescan-scsi-typo.patch b/SOURCES/sg3_utils-1.37-rescan-scsi-typo.patch new file mode 100644 index 0000000..f1d1a55 --- /dev/null +++ b/SOURCES/sg3_utils-1.37-rescan-scsi-typo.patch @@ -0,0 +1,12 @@ +diff -urNp sg3_utils-1.37-orig/scripts/rescan-scsi-bus.sh sg3_utils-1.37-new/scripts/rescan-scsi-bus.sh +--- sg3_utils-1.37-orig/scripts/rescan-scsi-bus.sh 2016-07-14 15:22:26.268711185 +0200 ++++ sg3_utils-1.37-new/scripts/rescan-scsi-bus.sh 2016-07-14 15:18:50.443651936 +0200 +@@ -941,7 +941,7 @@ if test @$1 = @--help -o @$1 = @-h -o @$ + echo "--wide: same as -w" + echo "--forcerescan: Rescan existing devices" + echo "--forceremove: Remove and readd every device (DANGEROUS)" +- echo "--nooptscan: don't stop looking for LUNs is 0 is not found" ++ echo "--nooptscan: don't stop looking for LUNs if 0 is not found" + echo "--color: use coloured prefixes OLD/NEW/DEL" + echo "--hosts=LIST: Scan only host(s) in LIST" + echo "--channels=LIST: Scan only channel(s) in LIST" diff --git a/SOURCES/sg3_utils_manpage_and_cli_help_message_fixes.patch b/SOURCES/sg3_utils_manpage_and_cli_help_message_fixes.patch new file mode 100644 index 0000000..0cdbfc6 --- /dev/null +++ b/SOURCES/sg3_utils_manpage_and_cli_help_message_fixes.patch @@ -0,0 +1,835 @@ +diff -Nur sg3_utils-1.37_old/doc/sg_compare_and_write.8 sg3_utils-1.37/doc/sg_compare_and_write.8 +--- sg3_utils-1.37_old/doc/sg_compare_and_write.8 2013-08-26 05:30:30.000000000 +0800 ++++ sg3_utils-1.37/doc/sg_compare_and_write.8 2018-06-19 19:52:13.949811015 +0800 +@@ -76,6 +76,9 @@ + just the compare buffer (when the \fI\-\-inw=WF\fR option is given). If + \fIIF\fR is '\-' then stdin (e.g. a pipe) is read. + .TP ++\fB\-C\fR, \fB\-\-inc\fR=\fIIF\fR ++The same as the \fB\-\-in\fR option. ++.TP + \fB\-D\fR, \fB\-\-inw\fR=\fIWF\fR + read data (binary) from file named \fIWF\fR. This will the write buffer + that will become the second half of the data-out buffer sent to the +diff -Nur sg3_utils-1.37_old/doc/sginfo.8 sg3_utils-1.37/doc/sginfo.8 +--- sg3_utils-1.37_old/doc/sginfo.8 2018-06-19 19:51:43.652097867 +0800 ++++ sg3_utils-1.37/doc/sginfo.8 2018-06-19 19:52:13.951810798 +0800 +@@ -206,7 +206,7 @@ + Display output values in a list. Make them suitable for editing and + being given back to the '\-R' (replace command). + .TP +-\fB\\-R\fR ++\fB\-R\fR + Replace parameters \- best used with \-X (expert use only) + .SH CHANGING MODE PAGE PARAMETERS + Firstly you should know what you are doing before changing existing +diff -Nur sg3_utils-1.37_old/doc/sg_inq.8 sg3_utils-1.37/doc/sg_inq.8 +--- sg3_utils-1.37_old/doc/sg_inq.8 2013-05-08 21:21:30.000000000 +0800 ++++ sg3_utils-1.37/doc/sg_inq.8 2018-06-19 19:52:13.951810798 +0800 +@@ -129,7 +129,7 @@ + utilities. + .TP + \fB\-O\fR, \fB\-\-old\fR +-switch to older style options. ++Switch to older style options. Please use as first option. + .TP + \fB\-p\fR, \fB\-\-page\fR=\fIPG\fR + the \fIPG\fR argument can be either a number of an abbreviation for a VPD +@@ -297,8 +297,8 @@ + decodes the Mode page policy VPD page [0x87]. Equivalent to '\-\-page=mpp' + in the main description. + .TP +-\fB\-N\fR +-switch to the newer style options. ++\fB-N\fR, \fB\-\-new\fR ++Switch to the newer style options. + .TP + \fB\-o\fR=\fIOPCODE_PG\fR + used in conjunction with the \fI\-e\fR or \fI\-c\fR option. If neither given +diff -Nur sg3_utils-1.37_old/doc/sg_logs.8 sg3_utils-1.37/doc/sg_logs.8 +--- sg3_utils-1.37_old/doc/sg_logs.8 2013-07-02 12:21:40.000000000 +0800 ++++ sg3_utils-1.37/doc/sg_logs.8 2018-06-19 19:52:13.951810798 +0800 +@@ -91,7 +91,7 @@ + is meant to be relatively easy to parse. + .TP + \fB\-O\fR, \fB\-\-old\fR +-switch to older style options. ++Switch to older style options. Please use as first option. + .TP + \fB\-p\fR, \fB\-\-page\fR=\fIPG[,SPG]\fR + log page code to access. \fIPG\fR is expected to be a decimal number between +@@ -285,8 +285,8 @@ + \fB\-n\fR + Equivalent to \fI\-\-name\fR in the main description. + .TP +-\fB\-N\fR +-switch to the newer style options. ++\fB\-N\fR, \fB\-\-new\fR ++Switch to the newer style options. Enabeld by default. + .TP + \fB\-p\fR=\fIPG[,SPG]\fR + \fIPG\fR is the log page code to access. Should be a hexadecimal number +diff -Nur sg3_utils-1.37_old/doc/sg_modes.8 sg3_utils-1.37/doc/sg_modes.8 +--- sg3_utils-1.37_old/doc/sg_modes.8 2012-12-22 11:05:14.000000000 +0800 ++++ sg3_utils-1.37/doc/sg_modes.8 2018-06-19 19:52:13.951810798 +0800 +@@ -128,7 +128,7 @@ + for MODE SENSE (6). + .TP + \fB\-O\fR, \fB\-\-old\fR +-switch to older style options. ++Switch to older style options. Please use as first option. + .TP + \fB\-p\fR, \fB\-\-page\fR=\fIPG\fR + page code to fetch. The \fIPG\fR is assumed to be a decimal value unless +@@ -227,8 +227,8 @@ + \fB\-L\fR + see \fB\-\-llbaa\fR in the main description. + .TP +-\fB\-N\fR +-switch to the newer style options. ++\fB-N\fR, \fB\-\-new\fR ++Switch to the newer style options. + .TP + \fB\-m\fR=\fILEN\fR + see \fB\-\-maxlen\fR=\fILEN\fR in the main description. +diff -Nur sg3_utils-1.37_old/doc/sg_opcodes.8 sg3_utils-1.37/doc/sg_opcodes.8 +--- sg3_utils-1.37_old/doc/sg_opcodes.8 2012-12-22 11:05:14.000000000 +0800 ++++ sg3_utils-1.37/doc/sg_opcodes.8 2018-06-19 19:52:13.951810798 +0800 +@@ -64,7 +64,7 @@ + is given then that summary is not printed on stdout. + .TP + \fB\-O\fR, \fB\-\-old\fR +-switch to older style options. ++Switch to older style options. Please use as first option. + .TP + \fB\-o\fR, \fB\-\-opcode\fR=\fIOP\fR + the \fIDEVICE\fR will be queried for the given operation code ( i.e. the +@@ -144,8 +144,8 @@ + \fB\-n\fR + don't print a summary of the SCSI INQUIRY response on stdout. + .TP +-\fB\-N\fR +-switch to the newer style options. ++\fB-N\fR, \fB\-\-new\fR ++Switch to the newer style options. + .TP + \fB\-o\fR=\fIOP\fR + the \fIDEVICE\fR will be queried for the given operation code (i.e. +diff -Nur sg3_utils-1.37_old/doc/sg_rbuf.8 sg3_utils-1.37/doc/sg_rbuf.8 +--- sg3_utils-1.37_old/doc/sg_rbuf.8 2012-02-11 07:09:25.000000000 +0800 ++++ sg3_utils-1.37/doc/sg_rbuf.8 2018-06-19 19:52:13.962809605 +0800 +@@ -4,7 +4,7 @@ + .SH SYNOPSIS + .B sg_rbuf + [\fI\-\-buffer=EACH\fR] [\fI\-\-dio\fR] [\fI\-\-help\fR] [\fI\-\-mmap\fR] +-[\fI\-\-quick\fR] [\fI\-\-size=OVERALL\fR] [\fI\-\-test\fR] ++[\fI\-\-quick\fR] [\fI\-\-size=OVERALL\fR] + [\fI\-\-verbose\fR] [\fI\-\-version\fR] \fIDEVICE\fR + .PP + .B sg_rbuf +@@ -53,7 +53,7 @@ + directly into user memory. This will eliminate the copy via kernel buffers. + .TP + \fB\-O\fR, \fB\-\-old\fR +-switch to older style options. ++Switch to older style options. Please use as first option. + .TP + \fB\-q\fR, \fB\-\-quick\fR + only transfer the data into kernel buffers (typically by DMA from the SCSI +@@ -143,8 +143,8 @@ + use memory mapped IO if available. Equivalent to the \fI\-\-mmap\fR option + in the main description. + .TP +-\fB\-N\fR +-switch to the newer style options. ++\fB-N\fR, \fB\-\-new\fR ++Switch to the newer style options. + .TP + \fB\-q\fR + only transfer the data into kernel buffers (typically by DMA from +diff -Nur sg3_utils-1.37_old/doc/sg_readcap.8 sg3_utils-1.37/doc/sg_readcap.8 +--- sg3_utils-1.37_old/doc/sg_readcap.8 2013-05-18 09:50:52.000000000 +0800 ++++ sg3_utils-1.37/doc/sg_readcap.8 2018-06-19 19:52:13.951810798 +0800 +@@ -80,7 +80,7 @@ + of 0xffffffff is returned (if the device complies with SBC\-2 or later). + .TP + \fB\-O\fR, \fB\-\-old\fR +-switch to older style options. ++Switch to older style options. Please use as first option. + .TP + \fB\-p\fR, \fB\-\-pmi\fR + partial medium indicator: for finding the next block address prior to +@@ -136,8 +136,8 @@ + will yield the last block address after \fILBA\fR prior to a delay. + Equivalent to \fI\-\-lba=LBA\fR in the main description. + .TP +-\fB\-N\fR +-switch to the newer style options. ++\fB-N\fR, \fB\-\-new\fR ++Switch to the newer style options. + .TP + \fB\-pmi\fR + partial medium indicator: for finding the next block address prior to +diff -Nur sg3_utils-1.37_old/doc/sg_reassign.8 sg3_utils-1.37/doc/sg_reassign.8 +--- sg3_utils-1.37_old/doc/sg_reassign.8 2012-11-25 07:13:16.000000000 +0800 ++++ sg3_utils-1.37/doc/sg_reassign.8 2018-06-19 19:52:13.961809714 +0800 +@@ -4,7 +4,7 @@ + .SH SYNOPSIS + .B sg_reassign + [\fI\-\-address=A,A...\fR] [\fI\-\-dummy\fR] [\fI\-\-eight=0|1\fR] +-[\fI\-\-grown\fR] [\fI\-\-help\fR] [\fI\-\-longlist=0|1\fR] ++[\fI\-\-grown\fR] [\fI\-\-help\fR] [\fI\-\-longlist=0|1\fR] [\fI\-\-hex\fR] + [\fI\-\-primary\fR] [\fI\-\-verbose\fR] [\fI\-\-version\fR] \fIDEVICE\fR + .SH DESCRIPTION + .\" Add any additional description here +@@ -84,6 +84,10 @@ + the \fI\-\-address=\fR option is not permitted. This list is sometimes + referred to as the PLIST. + .TP ++\fB\-H\fR, \fB\-\-hex\fR ++print response in hex (for \fB\-g\fR, \fB\-\-grown\fR or ++\fB\-p\fR, \fB\-\-primary\fR) ++.TP + \fB\-v\fR, \fB\-\-verbose\fR + increase the level of verbosity, (i.e. debug output). + .TP +diff -Nur sg3_utils-1.37_old/doc/sg_reset.8 sg3_utils-1.37/doc/sg_reset.8 +--- sg3_utils-1.37_old/doc/sg_reset.8 2013-08-26 05:30:30.000000000 +0800 ++++ sg3_utils-1.37/doc/sg_reset.8 2018-06-19 19:52:13.960809822 +0800 +@@ -42,7 +42,7 @@ + attempt a SCSI device reset. This would typically involve sending a LOGICAL + UNIT RESET task management function to \fIDEVICE\fR. + .TP +-\fB\-h\fR, \fB\-\-help\fR ++\fB\-z\fR, \fB\-\-help\fR + print the usage message then exit. + .TP + \fB\-H\fR, \fB\-\-host\fR +@@ -57,6 +57,9 @@ + option only the requested reset is attempted. An alternate option name of + \fI\-\-no-escalate\fR is also accepted. + .TP ++\fB\-\-no\-escalate\fR ++The same as \fB\-N\fR, \fB\-\-no\-esc\fR. ++.TP + \fB\-t\fR, \fB\-\-target\fR + attempt a SCSI target reset. A SCSI target contains one or more LUs. This + would typically involve sending a I_T NEXUS RESET task management function +diff -Nur sg3_utils-1.37_old/doc/sg_sat_identify.8 sg3_utils-1.37/doc/sg_sat_identify.8 +--- sg3_utils-1.37_old/doc/sg_sat_identify.8 2013-06-29 01:44:32.000000000 +0800 ++++ sg3_utils-1.37/doc/sg_sat_identify.8 2018-06-19 20:03:44.802468384 +0800 +@@ -5,7 +5,7 @@ + .SH SYNOPSIS + .B sg_sat_identify + [\fI\-\-ck_cond\fR] [\fI\-\-extend\fR] [\fI\-\-help\fR] [\fI\-\-hex\fR] +-[\fI\-\-indent\fR] [\fI\-\-len=\fR{16|12}] [\fI\-\-packet\fR] [\fI\-\-raw\fR] ++[\fI\-\-ident\fR] [\fI\-\-len=\fR{16|12}] [\fI\-\-packet\fR] [\fI\-\-raw\fR] + [\fI\-\-verbose\fR] [\fI\-\-version\fR] \fIDEVICE\fR + .SH DESCRIPTION + .\" Add any additional description here +@@ -54,7 +54,7 @@ + 16 bit words, in a format that is acceptable for 'hdparm \-\-Istdin' to + process. + .TP +-\fB\-i\fR, \fB\-\-indent\fR ++\fB\-i\fR, \fB\-\-ident\fR + outputs the World Wide Name (WWN) of the device. This should be a NAA\-5 + 64 bit number. It is output in hex prefixed with "0x". If not available + then "0x0000000000000000" is output. The equivalent for a SCSI disk (i.e. its +diff -Nur sg3_utils-1.37_old/doc/sg_senddiag.8 sg3_utils-1.37/doc/sg_senddiag.8 +--- sg3_utils-1.37_old/doc/sg_senddiag.8 2012-02-11 07:09:25.000000000 +0800 ++++ sg3_utils-1.37/doc/sg_senddiag.8 2018-06-19 19:52:13.951810798 +0800 +@@ -58,7 +58,7 @@ + by this utility, are listed. + .TP + \fB\-O\fR, \fB\-\-old\fR +-switch to older style options. ++Switch to older style options. Please use as first option. + .TP + \fB\-p\fR, \fB\-\-pf\fR + set Page Format (PF) bit. By default it is clear (i.e. 0) unless the +@@ -186,8 +186,8 @@ + argument then a list of diagnostic page names and their numbers, known + by this utility, are listed. + .TP +-\fB\-N\fR +-switch to the newer style options. ++\fB-N\fR, \fB\-\-new\fR ++Switch to the newer style options. + .TP + \fB\-pf\fR + set Page Format (PF) bit. By default it is clear (i.e. 0) unless +diff -Nur sg3_utils-1.37_old/doc/sg_start.8 sg3_utils-1.37/doc/sg_start.8 +--- sg3_utils-1.37_old/doc/sg_start.8 2012-11-21 08:39:11.000000000 +0800 ++++ sg3_utils-1.37/doc/sg_start.8 2018-06-19 19:52:13.951810798 +0800 +@@ -92,7 +92,7 @@ + media. This 'noflush' field in the cdb was added after sbc3r13. + .TP + \fB\-O\fR, \fB\-\-old\fR +-switch to older style options. ++Switch to older style options. Please use as first option. + .TP + \fB\-p\fR, \fB\-\-pc\fR=\fIPC\fR + where \fIPC\fR is the 'power conditions' value. 0 to 15 (inclusive) are valid. +@@ -221,8 +221,8 @@ + action differs from the new interface in which the option of this name + defaults to load and start.] + .TP +-\fB\-N\fR +-switch to the newer style options. ++\fB-N\fR, \fB\-\-new\fR ++Switch to the newer style options. + .TP + \fB\-\-mod\fR=\fIPC_MOD\fR + where \fIPC_MOD\fR is the 'power condition modifier' value. 0 to 15 (inclusive) +diff -Nur sg3_utils-1.37_old/doc/sg_turs.8 sg3_utils-1.37/doc/sg_turs.8 +--- sg3_utils-1.37_old/doc/sg_turs.8 2012-12-22 11:05:14.000000000 +0800 ++++ sg3_utils-1.37/doc/sg_turs.8 2018-06-19 19:52:13.951810798 +0800 +@@ -35,7 +35,7 @@ + number may be given, prefixed by either '0x' or has a trailing 'h'. + .TP + \fB\-O\fR, \fB\-\-old\fR +-switch to older style options. ++Switch to older style options. Please use as first option. + .TP + \fB\-p\fR, \fB\-\-progress\fR + show progress indication (a percentage) if available. If \fI\-\-number=NUM\fR +@@ -85,8 +85,8 @@ + performs TEST UNIT READY \fINUM\fR times. If not given defaults to 1. + Equivalent to \fI\-\-number=NUM\fR in the main description. + .TP +-\fB\-N\fR +-switch to the newer style options. ++\fB-N\fR, \fB\-\-new\fR ++Switch to the newer style options. + .TP + \fB\-p\fR + show progress indication (a percentage) if available. +diff -Nur sg3_utils-1.37_old/doc/sg_verify.8 sg3_utils-1.37/doc/sg_verify.8 +--- sg3_utils-1.37_old/doc/sg_verify.8 2013-08-26 05:30:30.000000000 +0800 ++++ sg3_utils-1.37/doc/sg_verify.8 2018-06-19 19:52:13.951810798 +0800 +@@ -5,7 +5,7 @@ + .B sg_verify + [\fI\-\-16\fR] [\fI\-\-bpc=BPC\fR] [\fI\-\-count=COUNT\fR] [\fI\-\-dpo\fR] + [\fI\-\-ebytchk=BCH\fR] [\fI\-\-group=GN\fR] [\fI\-\-help\fR] +-[\fI\-\-in=IF\fR] [\fI\-\-lba=LBA\fR] [\fI\-\-ndo=NDO\fR] [\fI\-\-quiet\fR] ++[\fI\-\-in=IF\fR] [\fI\-\-lba=LBA\fR] [\fI\-\-nbo=NBO\fR] [\fI\-\-quiet\fR] + [\fI\-\-readonly\fR] [\fI\-\-verbose\fR] [\fI\-\-version\fR] + [\fI\-\-vrprotect=VRP\fR] \fIDEVICE\fR + .SH DESCRIPTION +@@ -15,7 +15,7 @@ + commands are defined in the SBC\-2 (draft) standard at http://www.t10.org and + SBC\-3 drafts. + .PP +-When \fI\-\-ndo=NDO\fR is not given then the verify starts at the logical ++When \fI\-\-nbo=NBO\fR is not given then the verify starts at the logical + block address given by the \fI\-\-lba=LBA\fR option and continues for + \fI\-\-count=COUNT\fR blocks. No more than \fI\-\-bpc=BPC\fR blocks are + verified by each VERIFY command so if necessary multiple VERIFY commands are +@@ -24,11 +24,11 @@ + block contents). No news is good news (i.e. if there are no verify errors + detected then no messages are sent to stderr and the Unix exit status is 0). + .PP +-When \fI\-\-ndo=NDO\fR is given then the \fI\-\-bpc=BPC\fR option is ++When \fI\-\-nbo=NBO\fR is given then the \fI\-\-bpc=BPC\fR option is + ignored. A single VERIFY command is issued and a comparison starts at the + logical block address given by the \fI\-\-lba=LBA\fR option and continues for + \fI\-\-count=COUNT\fR blocks. The VERIFY command has an associated data\-out +-buffer that is \fINDO\fR bytes long. The contents of the data\-out buffer are ++buffer that is \fINBO\fR bytes long. The contents of the data\-out buffer are + obtained from the \fIFN\fR file (if \fI\-\-in=FN\fR is given) or from stdin. + A comparison takes place between data\-out buffer and the logical blocks + on the \fIDEVICE\fR. If the comparison is good then no messages are sent to +@@ -51,7 +51,7 @@ + to issue a VERIFY(16) command. + .TP + \fB\-b\fR, \fB\-\-bpc\fR=\fIBPC\fR +-this option is ignored if \fI\-\-ndo=NDO\fR is given. Otherwise \fIBPC\fR ++this option is ignored if \fI\-\-nbo=NBO\fR is given. Otherwise \fIBPC\fR + specifies the maximum number of blocks that will be verified by a single SCSI + VERIFY command. The default value is 128 blocks which equates to 64 KB for a + disk with 512 byte blocks. If \fIBPC\fR is less than \fICOUNT\fR then +@@ -64,7 +64,7 @@ + \fB\-c\fR, \fB\-\-count\fR=\fICOUNT\fR + where \fICOUNT\fR specifies the number of blocks to verify. The default value + is 1 . If \fICOUNT\fR is greater than \fIBPC\fR (or its default value of 128) +-and \fINDO\fR is not given, 0 or less then multiple SCSI VERIFY commands are ++and \fINBO\fR is not given, 0 or less then multiple SCSI VERIFY commands are + sent to the device. Otherwise \fICOUNT\fR becomes the contents of the + verification length field of the SCSI VERIFY command issued. The + .B sg_readcap +@@ -78,10 +78,10 @@ + .TP + \fB\-E\fR, \fB\-\-ebytchk\fR=\fIBCH\fR + sets the BYTCHK field to \fIBCH\fR overriding the value (1) set by the +-\fI\-\-ndo=NDO\fR option. Values of 1, 2 or 3 are accepted for \fIBCH\fR ++\fI\-\-nbo=NBO\fR option. Values of 1, 2 or 3 are accepted for \fIBCH\fR + however sbc3r34 reserves the value 2. If this option is given then +-\fI\-\-ndo=NDO\fR must also be given. If \fIBCH\fR is 3 then \fICOUNT\fR +-must be 1 and \fINDO\fR should be the size of one logical block (plus the ++\fI\-\-nbo=NBO\fR must also be given. If \fIBCH\fR is 3 then \fICOUNT\fR ++must be 1 and \fINBO\fR should be the size of one logical block (plus the + size of some or all of the protection infomation if \fIVRP\fR is greater + than 0). + .TP +@@ -94,9 +94,9 @@ + output the usage message then exit. + .TP + \fB\-i\fR, \fB\-\-in\fR=\fIIF\fR +-where \fIIF\fR is the name of a file from which \fINDO\fR bytes will be read ++where \fIIF\fR is the name of a file from which \fINBO\fR bytes will be read + and placed in the data\-out buffer. This is only done when the +-\fI\-\-ndo=NDO\fR option is given. If this option is not given then stdin ++\fI\-\-nbo=NBO\fR option is given. If this option is not given then stdin + is read. If \fIIF\fR is "\-" then stdin is also used. + .TP + \fB\-l\fR, \fB\-\-lba\fR=\fILBA\fR +@@ -105,12 +105,12 @@ + by '0x' or a trailing 'h' (see below). The default value is 0 (i.e. the start + of the device). + .TP +-\fB\-n\fR, \fB\-\-ndo\fR=\fINDO\fR +-\fINDO\fR is the number of bytes to obtain from the \fIFN\fR file (if ++\fB\-n\fR, \fB\-\-nbo\fR=\fINBO\fR ++\fINBO\fR is the number of bytes to obtain from the \fIFN\fR file (if + \fI\-\-in=FN\fR is given) or from stdin. Those bytes are placed in the +-data\-out buffer associated with the SCSI VERIFY command and \fINDO\fR ++data\-out buffer associated with the SCSI VERIFY command and \fINBO\fR + is placed in the verification length field in the cdb. The default value +-for \fINDO\fR is 0 and the maximum value is dependant on the OS. If the ++for \fINBO\fR is 0 and the maximum value is dependant on the OS. If the + \fI\-\-ebytchk=BCH\fR option is not given then the BYTCHK field in the cdb + is set to 1. + .TP +@@ -138,13 +138,13 @@ + BYTCHK is the name of a field (two bits wide) in the VERIFY(10) and + VERIFY(16) commands. When set to 1 or 3 (sbc3r34 reserves the value 2) it + indicates that associated with the SCSI VERIFY command, a data\-out buffer +-will be sent for the device (disk) to check. Using the \fI\-\-ndo=NDO\fR +-option sets the BYTCHK field to 1 and \fINDO\fR is the number of bytes ++will be sent for the device (disk) to check. Using the \fI\-\-nbo=NBO\fR ++option sets the BYTCHK field to 1 and \fINBO\fR is the number of bytes + placed in the data\-out buffer. Those bytes are obtained from stdin or + \fIIF\fR (from the \fI\-\-in=FN\fR option). The \fI\-\-ebytchk=BCH\fR + option may be used to override the BYTCHK field value of 1 with \fIBCH\fR. + .PP +-The calculation of \fINDO\fR is left up to the user. Its value depends ++The calculation of \fINBO\fR is left up to the user. Its value depends + on the logical block size (which can be found with the sg_readcap utility), + the \fICOUNT\fR and the \fIVRP\fR values. If the \fIVRP\fR is greater than + 0 then each logical block will contain an extra 8 bytes (at least) of +@@ -159,12 +159,12 @@ + data\-out (and data\-in) buffer. For Linux at one time the limit was + less than 1 MB but has been increased somewhat. + .SH OPTION CHANGES +-Earlier versions of this utility had a \fI\-\-bytchk=NDO\fR option which +-set the BYTCHK bit and set the cdb verification length field to \fINDO\fR. +-The shorter form of that option was \fI\-B NDO\fR. For backward ++Earlier versions of this utility had a \fI\-\-bytchk=NBO\fR option which ++set the BYTCHK bit and set the cdb verification length field to \fINBO\fR. ++The shorter form of that option was \fI\-B NBO\fR. For backward + compatibility that option is still present but not documented. In its place +-is the \fI\-\-ndo=NDO\fR whose shorter form of \fI\-n NDO\fR. +-\fI\-\-ndo=NDO\fR sets the BYTCHK field to 1 unless that is overridden by ++is the \fI\-\-nbo=NBO\fR whose shorter form of \fI\-n NBO\fR. ++\fI\-\-nbo=NBO\fR sets the BYTCHK field to 1 unless that is overridden by + the \fI\-\-ebytchk=BCH\fR. + .SH NOTES + Various numeric arguments (e.g. \fILBA\fR) may include multiplicative +diff -Nur sg3_utils-1.37_old/doc/sg_xcopy.8 sg3_utils-1.37/doc/sg_xcopy.8 +--- sg3_utils-1.37_old/doc/sg_xcopy.8 2013-10-08 22:24:59.000000000 +0800 ++++ sg3_utils-1.37/doc/sg_xcopy.8 2018-06-19 19:52:13.951810798 +0800 +@@ -75,6 +75,9 @@ + \fBconv\fR=\fBCONV\fR + all \fBCONV\fR arguments are ignored. + .TP ++\fBapp\fR=\fBAPPEND\fR ++all \fBAPPEND\fR arguments are ignored. ++.TP + \fBcount\fR=\fICOUNT\fR + copy \fICOUNT\fR blocks from \fIIFILE\fR to \fIOFILE\fR. Default is the + minimum (\fIIFILE\fR if \fIdc=0\fR or \fIOFILE\fR if \fIdc=1\fR) +diff -Nur sg3_utils-1.37_old/scripts/scsi_mandat sg3_utils-1.37/scripts/scsi_mandat +--- sg3_utils-1.37_old/scripts/scsi_mandat 2013-05-15 21:35:46.000000000 +0800 ++++ sg3_utils-1.37/scripts/scsi_mandat 2018-06-19 19:52:13.949811015 +0800 +@@ -42,10 +42,10 @@ + usage() + { + echo "Usage: scsi_mandat [-h] [-L] [-q] [-v] " +- echo " where: -h print usage message" +- echo " -L, --log append stderr to 'scsi_mandat.err'" +- echo " -q suppress some output" +- echo " -v increase verbosity of output" ++ echo " where: -h, --help print usage message" ++ echo " -L, --log append stderr to 'scsi_mandat.err'" ++ echo " -q, --quiet suppress some output" ++ echo " -v, --verbose increase verbosity of output" + echo "" + echo "Check for manadatory SCSI command support" + } +@@ -71,7 +71,7 @@ + then + usage + exit 1 +-fi ++fi + + for command in "sg_inq" "sg_luns" "sg_turs" "sg_requests" "sg_vpd" \ + "sg_vpd -i" "sg_senddiag -t" +diff -Nur sg3_utils-1.37_old/src/sg_compare_and_write.c sg3_utils-1.37/src/sg_compare_and_write.c +--- sg3_utils-1.37_old/src/sg_compare_and_write.c 2013-08-26 05:30:30.000000000 +0800 ++++ sg3_utils-1.37/src/sg_compare_and_write.c 2018-06-19 19:52:13.951810798 +0800 +@@ -114,11 +114,12 @@ + fprintf(stderr, "Usage: " + "sg_compare_and_write [--dpo] [--fua] [--fua_nv] " + "[--group=GN] [--help]\n" +- " --in=IF [--inw=WF] --lba=LBA " ++ " --in=IF|--inc=IF [--inw=WF] " ++ "--lba=LBA " + "[--num=NUM]\n" + " [--quiet] [--timeout=TO] " + "[--verbose] [--version]\n" +- " [--wrpotect=WP] [--xferlen=LEN] " ++ " [--wrprotect=WP] [--xferlen=LEN] " + "DEVICE\n" + " where:\n" + " --dpo|-d set the dpo bit in cdb (def: " +@@ -135,6 +136,7 @@ + " optionally a write buffer (when " + "--inw=WF is\n" + " not given)\n" ++ " --inc=IF|-C IF The same as the --in option\n" + " --inw=WF|-D WF WF is a file containing a write " + "buffer\n" + " --lba=LBA|-l LBA LBA of the first block of the " +diff -Nur sg3_utils-1.37_old/src/sg_inq.c sg3_utils-1.37/src/sg_inq.c +--- sg3_utils-1.37_old/src/sg_inq.c 2018-06-19 19:51:43.677095155 +0800 ++++ sg3_utils-1.37/src/sg_inq.c 2018-06-19 19:52:13.951810798 +0800 +@@ -285,6 +285,7 @@ + "inquiry\n" + " --verbose|-v increase verbosity\n" + " --version|-V print version string then exit\n" ++ " --old|-O use old interface (use as first option)\n" + " --vpd|-e vital product data (set page with " + "'--page=PG')\n\n" + "Performs a SCSI INQUIRY command. " +@@ -345,6 +346,7 @@ + " -V output version string\n" + " -x decode extended INQUIRY data VPD page (0x86)\n" + " -36 perform standard INQUIRY with a 36 byte response\n" ++ " -N|--new use new interface\n" + " -? output this usage message\n\n" + "If no options given then does a standard SCSI INQUIRY\n"); + } +diff -Nur sg3_utils-1.37_old/src/sg_logs.c sg3_utils-1.37/src/sg_logs.c +--- sg3_utils-1.37_old/src/sg_logs.c 2013-07-31 07:58:53.000000000 +0800 ++++ sg3_utils-1.37/src/sg_logs.c 2018-06-19 19:53:56.318072013 +0800 +@@ -169,6 +169,7 @@ + " --transport|-T decode transport (protocol specific port " + "0x18) log page\n" + " --verbose|-v increase verbosity\n" ++ " -N|--new use new interface\n" + " --version|-V output version string then exit\n\n" + "Performs a SCSI LOG SENSE (or LOG SELECT) command and decodes " + "the response.\n"); +diff -Nur sg3_utils-1.37_old/src/sg_modes.c sg3_utils-1.37/src/sg_modes.c +--- sg3_utils-1.37_old/src/sg_modes.c 2013-06-05 04:33:26.000000000 +0800 ++++ sg3_utils-1.37/src/sg_modes.c 2018-06-19 19:52:13.951810798 +0800 +@@ -131,6 +131,7 @@ + " --six|-6 use MODE SENSE(6), by default uses MODE " + "SENSE(10)\n" + " --verbose|-v increase verbosity\n" ++ " --old|-O use old interface (use as first option)\n" + " --version|-V output version string then exit\n\n" + "Performs a SCSI MODE SENSE (10 or 6) command. To access and " + "possibly change\nmode page fields see the sdparm utility.\n"); +@@ -171,6 +172,7 @@ + " -v verbose\n" + " -V output version string\n" + " -6 Use MODE SENSE(6), by default uses MODE SENSE(10)\n" ++ " -N|--new use new interface\n" + " -? output this usage message\n\n" + "Performs a SCSI MODE SENSE (10 or 6) command\n"); + } +diff -Nur sg3_utils-1.37_old/src/sg_opcodes.c sg3_utils-1.37/src/sg_opcodes.c +--- sg3_utils-1.37_old/src/sg_opcodes.c 2013-05-18 09:50:52.000000000 +0800 ++++ sg3_utils-1.37/src/sg_opcodes.c 2018-06-19 19:52:13.951810798 +0800 +@@ -124,6 +124,7 @@ + " (def: sort by opcode (then service " + "action))\n" + " --verbose|-v increase verbosity\n" ++ " --old|-O use old interface (use as first option)\n" + " --version|-V print version string then exit\n\n" + "Performs a SCSI REPORT SUPPORTED OPERATION CODES or a REPORT " + "SUPPORTED\nTASK MANAGEMENT FUNCTIONS command\n"); +@@ -151,6 +152,7 @@ + " -u output list of operation codes as is (unsorted)\n" + " -v verbose\n" + " -V output version string\n" ++ " -N|--new use new interface\n" + " -? output this usage message\n\n" + "Performs a SCSI REPORT SUPPORTED OPERATION CODES (or a REPORT " + "TASK MANAGEMENT\nFUNCTIONS) command\n"); +diff -Nur sg3_utils-1.37_old/src/sg_rbuf.c sg3_utils-1.37/src/sg_rbuf.c +--- sg3_utils-1.37_old/src/sg_rbuf.c 2013-10-15 03:29:37.000000000 +0800 ++++ sg3_utils-1.37/src/sg_rbuf.c 2018-06-19 19:52:13.951810798 +0800 +@@ -101,6 +101,7 @@ + " default: 200 MiB\n" + " --time|-t time the data transfer\n" + " --verbose|-v increase verbosity (more debug)\n" ++ " --old|-O use old interface (use as first option)\n" + " --version|-V print version string then exit\n\n" + "Use SCSI READ BUFFER command (data mode, buffer id 0) " + "repeatedly\n"); +@@ -121,6 +122,7 @@ + printf(" maximum total size is 4000 MiB\n"); + printf(" -t time the data transfer\n"); + printf(" -v increase verbosity (more debug)\n"); ++ printf(" -N|--new use new interface\n"); + printf(" -V print version string then exit\n\n"); + printf("Use SCSI READ BUFFER command (data mode, buffer id 0) " + "repeatedly\n"); +diff -Nur sg3_utils-1.37_old/src/sg_readcap.c sg3_utils-1.37/src/sg_readcap.c +--- sg3_utils-1.37_old/src/sg_readcap.c 2013-05-08 21:21:30.000000000 +0800 ++++ sg3_utils-1.37/src/sg_readcap.c 2018-06-19 19:54:44.244187218 +0800 +@@ -93,6 +93,7 @@ + " --raw|-r output response in binary to stdout\n" + " --verbose|-v increase verbosity\n" + " --version|-V print version string and exit\n\n" ++ " --old|-O use old interface (use as first option)\n" + "Perform a SCSI READ CAPACITY (10 or 16) command\n"); + } + +@@ -118,6 +119,7 @@ + " -r output response in binary to stdout\n" + " -v increase verbosity\n" + " -V print version string and exit\n\n" ++ " -N|--new use new interface\n" + "Perform a SCSI READ CAPACITY command\n"); + } + +diff -Nur sg3_utils-1.37_old/src/sg_reset.c sg3_utils-1.37/src/sg_reset.c +--- sg3_utils-1.37_old/src/sg_reset.c 2013-05-08 21:21:30.000000000 +0800 ++++ sg3_utils-1.37/src/sg_reset.c 2018-06-19 20:04:30.988100021 +0800 +@@ -68,7 +68,7 @@ + { + fprintf(stderr, "Usage: " + "sg_reset [--bus] [--device] [--help] [--host] [--no-esc] " +- "[--target]\n" ++ "[--target] [--no-escalate]\n" + " [--verbose] [--version] DEVICE\n" + " where:\n" + " --bus|-b SCSI bus reset (SPI concept), might be all " +@@ -89,6 +89,7 @@ + " --target|-t target reset. The target holds the DEVICE " + "and perhaps\n" + " other LUs\n" ++ " --no-escalate The same as --no-esc|-N" + " --verbose|-v increase the level of verbosity\n" + " --version|-V print version number then exit\n\n" + "Use SG_SCSI_RESET ioctl to send a reset to the " +diff -Nur sg3_utils-1.37_old/src/sg_sat_phy_event.c sg3_utils-1.37/src/sg_sat_phy_event.c +--- sg3_utils-1.37_old/src/sg_sat_phy_event.c 2013-05-08 21:21:30.000000000 +0800 ++++ sg3_utils-1.37/src/sg_sat_phy_event.c 2018-06-19 19:52:13.960809822 +0800 +@@ -64,6 +64,7 @@ + {"len", no_argument, 0, 'l'}, + {"raw", no_argument, 0, 'r'}, + {"reset", no_argument, 0, 'R'}, ++ {"help", no_argument, 0, 'h'}, + {"verbose", no_argument, 0, 'v'}, + {"version", no_argument, 0, 'V'}, + {0, 0, 0, 0}, +diff -Nur sg3_utils-1.37_old/src/sg_senddiag.c sg3_utils-1.37/src/sg_senddiag.c +--- sg3_utils-1.37_old/src/sg_senddiag.c 2013-05-08 21:21:30.000000000 +0800 ++++ sg3_utils-1.37/src/sg_senddiag.c 2018-06-19 19:52:13.951810798 +0800 +@@ -96,6 +96,7 @@ + " --test|-t default self-test\n" + " --uoff|-u unit offline (def: 0, only with '--test')\n" + " --verbose|-v increase verbosity\n" ++ " --old|-O use old interface (use as first option)\n" + " --version|-V output version string then exit\n\n" + "Performs a SCSI SEND DIAGNOSTIC (and/or a RECEIVE DIAGNOSTIC " + "RESULTS) command\n" +@@ -127,6 +128,7 @@ + " -uoff unit offline (def: 0, only with '-t')\n" + " -v increase verbosity (print issued SCSI cmds)\n" + " -V output version string\n" ++ " -N|--new use new interface\n" + " -? output this usage message\n\n" + "Performs a SCSI SEND DIAGNOSTIC (and/or a RECEIVE DIAGNOSTIC " + "RESULTS) command\n" +diff -Nur sg3_utils-1.37_old/src/sg_start.c sg3_utils-1.37/src/sg_start.c +--- sg3_utils-1.37_old/src/sg_start.c 2013-05-08 21:21:30.000000000 +0800 ++++ sg3_utils-1.37/src/sg_start.c 2018-06-19 19:52:13.951810798 +0800 +@@ -110,6 +110,7 @@ + "given\n" + " --stop|-S stop unit (e.g. spin down disk)\n" + " --verbose|-v increase verbosity\n" ++ " --old|-O use old interface (use as first option)\n" + " --version|-V print version string then exit\n\n" + " Example: 'sg_start --stop /dev/sdb' stops unit\n" + " 'sg_start --eject /dev/scd0' stops unit and " +@@ -155,6 +156,7 @@ + "action\n" + " --stop stop unit (same as '0')\n" + " -v verbose (print out SCSI commands)\n" ++ " -N|--new use new interface\n" + " -V print version string then exit\n\n" + " Example: 'sg_start --stop /dev/sdb' stops unit\n" + " 'sg_start --eject /dev/scd0' stops unit and " +diff -Nur sg3_utils-1.37_old/src/sg_stpg.c sg3_utils-1.37/src/sg_stpg.c +--- sg3_utils-1.37_old/src/sg_stpg.c 2013-07-31 07:58:53.000000000 +0800 ++++ sg3_utils-1.37/src/sg_stpg.c 2018-06-19 19:55:15.088253110 +0800 +@@ -100,7 +100,7 @@ + " --help|-h print out usage message\n" + " --hex|-H print out report response in hex, then " + "exit\n" +- " --offline|-l set asymm. access state to offline, takes " ++ " --offline|-l|-O set asymm. access state to offline, takes " + "relative\n" + " target port id, rather than target port " + "group id\n" +diff -Nur sg3_utils-1.37_old/src/sg_test_rwbuf.c sg3_utils-1.37/src/sg_test_rwbuf.c +--- sg3_utils-1.37_old/src/sg_test_rwbuf.c 2013-05-08 21:21:30.000000000 +0800 ++++ sg3_utils-1.37/src/sg_test_rwbuf.c 2018-06-19 19:52:13.951810798 +0800 +@@ -334,17 +334,17 @@ + " or\n" + " sg_test_rwbuf DEVICE SZ [AW] [AR]\n"); + printf (" where:\n" +- " --addrd=AR extra bytes to fetch during READ " ++ " --addrd=AR|-r extra bytes to fetch during READ " + "BUFFER\n" +- " --addwr=AW extra bytes to send to WRITE BUFFER\n" +- " --help output this usage message then exit\n" +- " --quick output read buffer size then exit\n" +- " --size=SZ size of buffer (in bytes) to write " ++ " --addwr=AW|-w extra bytes to send to WRITE BUFFER\n" ++ " --help|-l output this usage message then exit\n" ++ " --quick|-q output read buffer size then exit\n" ++ " --size=SZ|-s size of buffer (in bytes) to write " + "then read back\n" +- " --times=NUM number of times to run test " ++ " --times=NUM|-t number of times to run test " + "(default 1)\n" +- " --verbose increase verbosity of output\n" +- " --version output version then exit\n"); ++ " --verbose|-v increase verbosity of output\n" ++ " --version|-V output version then exit\n"); + printf ("\nWARNING: If you access the device at the same time, e.g. " + "because it's a\n"); + printf (" mounted hard disk, the device's buffer may be used by the " +diff -Nur sg3_utils-1.37_old/src/sg_turs.c sg3_utils-1.37/src/sg_turs.c +--- sg3_utils-1.37_old/src/sg_turs.c 2013-06-01 02:40:32.000000000 +0800 ++++ sg3_utils-1.37/src/sg_turs.c 2018-06-19 19:52:13.951810798 +0800 +@@ -81,6 +81,7 @@ + " --time|-t outputs total duration and commands per " + "second\n" + " --verbose|-v increase verbosity\n" ++ " --old|-O use old interface (use as first option)\n" + " --version|-V print version string then exit\n\n" + "Performs a SCSI TEST UNIT READY command (or many of them)\n"); + } +@@ -97,6 +98,7 @@ + " -t outputs total duration and commands per " + "second\n" + " -v increase verbosity\n" ++ " -N|--new use new interface\n" + " -V print version string then exit\n\n" + "Performs a SCSI TEST UNIT READY command (or many of them)\n"); + } +diff -Nur sg3_utils-1.37_old/src/sg_verify.c sg3_utils-1.37/src/sg_verify.c +--- sg3_utils-1.37_old/src/sg_verify.c 2013-08-26 05:30:30.000000000 +0800 ++++ sg3_utils-1.37/src/sg_verify.c 2018-06-19 19:59:15.026705607 +0800 +@@ -67,7 +67,7 @@ + "sg_verify [--16] [--bpc=BPC] [--count=COUNT] [--dpo] " + "[--ebytchk=BCH]\n" + " [--group=GN] [--help] [--in=IF] " +- "[--lba=LBA] [--ndo=NDO]\n" ++ "[--lba=LBA] [--nbo=NBO]\n" + " [--quiet] [--readonly] [--verbose] " + "[--version]\n" + " [--vrprotect=VRP] DEVICE\n" +@@ -85,8 +85,8 @@ + " --ebytchk=BCH|-E BCH sets BYTCHK value, either 1, 2 " + "or 3 (def: 0).\n" + " BCH overrides BYTCHK=1 set by " +- "'--ndo='. If\n" +- " BCH is 3 then NDO must be the LBA " ++ "'--nbo='. If\n" ++ " BCH is 3 then NBO must be the LBA " + "size\n" + " (plus protection size if DIF " + "active)\n" +@@ -97,7 +97,7 @@ + " only active if --bytchk=N given\n" + " --lba=LBA|-l LBA logical block address to start " + "verify (def: 0)\n" +- " --ndo=NDO|-n NDO NDO is number of bytes placed in " ++ " --nbo=NBO|-n NBO NBO is number of bytes placed in " + "data-out buffer.\n" + " These are fetched from IF (or " + "stdin) and used\n" +@@ -207,10 +207,10 @@ + lba = (uint64_t)ll; + break; + case 'n': +- case 'B': /* undocumented, old --bytchk=NDO option */ ++ case 'B': /* undocumented, old --bytchk=NBO option */ + ndo = sg_get_num(optarg); + if (ndo < 1) { +- fprintf(stderr, "bad argument to '--ndo'\n"); ++ fprintf(stderr, "bad argument to '--nbo'\n"); + return SG_LIB_SYNTAX_ERROR; + } + break; +@@ -277,7 +277,7 @@ + bpc = (int)count; + } else if (bytchk > 0) { + fprintf(stderr, "when the 'ebytchk=BCH' option is given, " +- "then '--bytchk=NDO' must also be given\n"); ++ "then '--bytchk=NBO' must also be given\n"); + return SG_LIB_SYNTAX_ERROR; + } + +diff -Nur sg3_utils-1.37_old/src/sg_xcopy.c sg3_utils-1.37/src/sg_xcopy.c +--- sg3_utils-1.37_old/src/sg_xcopy.c 2013-10-08 22:24:59.000000000 +0800 ++++ sg3_utils-1.37/src/sg_xcopy.c 2018-06-19 20:02:36.284619039 +0800 +@@ -500,12 +500,12 @@ + "sg_xcopy [bs=BS] [count=COUNT] [ibs=BS] [if=IFILE]" + " [iflag=FLAGS]\n" + " [obs=BS] [of=OFILE] [oflag=FLAGS] " +- "[seek=SEEK] [skip=SKIP]\n" ++ "[seek=SEEK] [app=APPEND] [skip=SKIP]\n" + " [--help] [--version]\n\n" + " [bpt=BPT] [cat=0|1] [dc=0|1] " + "[id_usage=hold|discard|disable]\n" + " [list_id=ID] [prio=PRIO] [time=0|1] " +- "[verbose=VERB]\n" ++ "[verbose=VERB] [conv=CONV]\n" + " [--on_dst|--on_src] [--verbose]\n" + " where:\n" + " bpt is blocks_per_transfer (default: 128)\n" +@@ -532,18 +532,20 @@ + " null]\n" + " prio set priority field to PRIO (def: 1)\n" + " seek block position to start writing to OFILE\n" ++ " app ignored\n" ++ " conv ignored\n" + " skip block position to start reading from IFILE\n" + " time 0->no timing(def), 1->time plus calculate " + "throughput\n" + " verbose 0->quiet(def), 1->some noise, 2->more noise, " + "etc\n" +- " --help print out this usage message then exit\n" ++ " --help|-h print out this usage message then exit\n" + " --on_dst send XCOPY command to the output file/device\n" + " --on_src send XCOPY command to the input file/device.\n" + " Default if this and --on_dst options not " + "given\n" +- " --verbose same action as verbose=1\n" +- " --version print version information then exit\n\n" ++ " --verbose|-v same action as verbose=1\n" ++ " --version|-V print version information then exit\n\n" + "Copy from IFILE to OFILE, similar to dd command; " + "but using the SCSI\nEXTENDED COPY (XCOPY) command.\n"); + } diff --git a/SOURCES/sg_rdac_additional_upstream_fixes.patch b/SOURCES/sg_rdac_additional_upstream_fixes.patch new file mode 100644 index 0000000..06d53eb --- /dev/null +++ b/SOURCES/sg_rdac_additional_upstream_fixes.patch @@ -0,0 +1,46 @@ +diff --git a/doc/sg_rdac.8 b/doc/sg_rdac.8 +index 8e3d27a..cac0776 100644 +--- a/doc/sg_rdac.8 ++++ b/doc/sg_rdac.8 +@@ -19,6 +19,8 @@ Transfer all (visible) devices + \fB\-f\fR=\fILUN\fR + Transfer the device identified by \fILUN\fR. This command will only work + if the controller supports 'Dual Active Mode' (aka active/active mode). ++\fILUN\fR is a decimal number which cannot exceed 31 when the \fI\-6\fR ++option is given, otherwise is cannot exceed 255. + .TP + \fB\-v\fR + be verbose +@@ -33,7 +35,7 @@ Written by Hannes Reinecke , based on sg_emc_trespass. + .SH "REPORTING BUGS" + Report bugs to . + .SH COPYRIGHT +-Copyright \(co 2006\-2012 Hannes Reinecke, Douglas Gilbert. ++Copyright \(co 2006\-2016 Hannes Reinecke, Douglas Gilbert. + .br + This software is distributed under the GPL version 2. There is NO + warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +diff --git a/src/sg_rdac.c b/src/sg_rdac.c +index ea243a2..63cfe46 100644 +--- a/src/sg_rdac.c ++++ b/src/sg_rdac.c +@@ -188,9 +188,16 @@ static int fail_this_path(int fd, int lun, int use_6_byte) + struct rdac_page_common *rdac_common = NULL; + int res; + +- if (use_6_byte && lun > 32) { +- fprintf(stderr, "must use 10 byte cdb to fail luns over 32\n"); +- return -1; ++ if (use_6_byte) { ++ if (lun > 31) { ++ fprintf(stderr, "must use 10 byte cdb to fail luns over 31\n"); ++ return -1; ++ } ++ } else { /* 10 byte cdb case */ ++ if (lun > 255) { ++ fprintf(stderr, "lun cannot exceed 255\n"); ++ return -1; ++ } + } + + memset(fail_paths_pg, 0, 308); diff --git a/SPECS/sg3_utils.spec b/SPECS/sg3_utils.spec new file mode 100644 index 0000000..695fe4a --- /dev/null +++ b/SPECS/sg3_utils.spec @@ -0,0 +1,392 @@ +%global rescan_script rescan-scsi-bus.sh + +Summary: Utilities for devices that use SCSI command sets +Name: sg3_utils +Version: 1.37 +Release: 17%{?dist} +License: GPLv2+ and BSD +Group: Applications/System +Source0: http://sg.danny.cz/sg/p/sg3_utils-%{version}.tgz +Source1: rescan-scsi-bus.sh.8 +Source2: scsi-rescan.8 +# https://bugzilla.redhat.com/show_bug.cgi?id=920687 +Patch0: sg3_utils-1.37-dont-open-dev-snapshot.patch +# https://bugzilla.redhat.com/show_bug.cgi?id=948463 +Patch1: sg3_utils-1.37-man-pages-fix.patch +Patch2: 0001-Fix-issues-with-multi-word-device-types.patch +Patch3: 0001-Fix-dev-null-redirect-mistakes.patch +Patch4: 0001-Fix-syntax-error-in-if-statement-related-to-mpath-fl.patch +Patch5: 0001-Add-upstream-updates-to-sg_inq-sg_rdac-and-sg_vpd.patch +Patch6: sg_rdac_additional_upstream_fixes.patch +#fix typo in nooptscan option in rescan scsi bus script (#1353941) +Patch7: sg3_utils-1.37-rescan-scsi-typo.patch +#document -m/--multipath option in rescan-scsi-bus.sh script (#1357851) +Patch8: sg3_utils-1.37-rescan-scsi-missingoption.patch +Patch9: BZ_1380744-rescan-scsi-bus.sh-Add-lunsearch-filter-to-searchexi.patch +Patch10: BZ_1360915-rescan-scsi-bus.sh-Fixup-help-text-for-forcerescan.patch +Patch11: sg3_utils_manpage_and_cli_help_message_fixes.patch +Patch12: BZ_1400491_rescan-scsi-bus.sh_ignore_rev_change.patch +Patch13: BZ_1359274_sg_logs_fix_inline_help.patch +Patch14: BZ_1359282_sg_requests_fix_manpage.patch +Patch15: BZ_1359286_sg_senddiag_fix_help.patch +Patch16: BZ_1359292_sg_write_buffer_fix_help.patch +URL: http://sg.danny.cz/sg/sg3_utils.html +Requires: %{name}-libs = %{version}-%{release} + + +%description +Collection of Linux utilities for devices that use the SCSI command set. +Includes utilities to copy data based on "dd" syntax and semantics (called +sg_dd, sgp_dd and sgm_dd); check INQUIRY data and VPD pages (sg_inq); check +mode and log pages (sginfo, sg_modes and sg_logs); spin up and down +disks (sg_start); do self tests (sg_senddiag); and various other functions. +See the README, CHANGELOG and COVERAGE files. Requires the linux kernel 2.4 +series or later. In the 2.4 series SCSI generic device names (e.g. /dev/sg0) +must be used. In the 2.6 series other device names may be used as +well (e.g. /dev/sda). + +Warning: Some of these tools access the internals of your system +and the incorrect usage of them may render your system inoperable. + +%package libs +Summary: Shared library for %{name} +Group: System Environment/Libraries + +%description libs +This package contains the shared library for %{name}. + +%package devel +Summary: Development library and header files for the sg3_utils library +Group: Development/Libraries +Requires: %{name}-libs = %{version}-%{release} +Requires: glibc-headers + +%description devel +This package contains the %{name} library and its header files for +developing applications. + +%prep +%setup -q +%patch0 -p1 -b .dev-snapshot +%patch1 -p1 -b .man-fixes +%patch2 -p1 -b .mwdevtype +%patch3 -p1 -b .rmdevnullfix +%patch4 -p1 -b .mpathsyntaxerr +%patch5 -p1 -b .upstream1 +%patch6 -p1 -b .upstream2 +%patch7 -p1 -b .typo +%patch8 -p1 -b .missingopt +%patch9 -p1 -b .rescan_all_lun +%patch10 -p1 -b .help_forcerescan_forceremove +%patch11 -p1 -b .help_and_man_fixes +%patch12 -p1 -b .ignore_rev_change +%patch13 -p1 -b .sg_log_inline_help +%patch14 -p1 -b .sg_requests_man +%patch15 -p1 -b .sg_senddiag_help +%patch16 -p1 -b .sg_write_buffer_help + +%build +%configure --disable-static + +# Don't use rpath! +sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool +sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool + +make %{?_smp_mflags} + + +%install +make install DESTDIR=$RPM_BUILD_ROOT +rm -rf $RPM_BUILD_ROOT/%{_libdir}/*.la + +install -p -m 755 scripts/%{rescan_script} $RPM_BUILD_ROOT%{_bindir} +( cd $RPM_BUILD_ROOT%{_bindir}; ln -sf %{rescan_script} scsi-rescan ) + +install -p -m 644 %{SOURCE1} $RPM_BUILD_ROOT%{_mandir}/man8 +install -p -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_mandir}/man8 + + +%post libs -p /sbin/ldconfig + +%postun libs -p /sbin/ldconfig + + +%files +%doc AUTHORS BSD_LICENSE COPYING COVERAGE CREDITS ChangeLog README README.sg_start +%{_bindir}/* +%{_mandir}/man8/* + +%files libs +%doc BSD_LICENSE COPYING +%{_libdir}/*.so.* + +%files devel +%{_includedir}/scsi/*.h +%{_libdir}/*.so + + +%changelog +* Tue Jul 17 2018 Gris Ge 1.37-17 +- Fix help documents of sg_requests, sg_senddiag and sg_write_buffer. + (RHBZ #1359282, #1359286, #1359292) + +* Mon Jul 16 2018 Gris Ge 1.37-16 +- Fix inline help of sg_logs. (RHBZ #1359274) + +* Tue Jun 19 2018 Gris Ge 1.37-15 +- Massive manapge and cli help message fixes. + +* Tue Jun 12 2018 Gris Ge 1.37-14 +- Add '--ignore-rev` option to rescan-scsi-bus.sh. + (RHBZ #1400491) + +* Tue Jun 12 2018 Gris Ge 1.37-13 +- Add missing short options of sg_test_rwbuf. + (RHBZ #1359289) + +* Wed May 10 2017 Gris Ge 1.37-12 +- Fix the manpage of `forceremove` and `forcerescan` command. + (RHBZ #1360915) + +* Tue Mar 14 2017 Gris Ge - 1.37-11 +- Fix the help message of `forceremove` and `forcerescan` command. + (RHBZ #1360915) + +* Tue Mar 07 2017 Gris Ge - 1.37-10 +- Fix rescan-scsi-bus.sh for scan all luns. (RHBZ #1380744) + +* Tue Jul 19 2016 Ondrej Vasik - 1.37-9 +- rescan-scsi-bus.sh: document -m/--multipath option (#1357851) + +* Thu Jul 14 2016 Josef Ridky - 1.37-8 +- rescan-scsi-bus.sh: fix typo in help and man page (#1353941) + +* Fri Apr 15 2016 David Sommerseth - 1.37-7 +- Avoid deletion of /dev/null (#1298737) +- Fix syntax error in rescan-scsi-bus related to multipath flushing (#1255564) +- Add upstream updates to sg_inq, sg_rdac and sg_vpd (#1170719) + +* Fri Apr 15 2016 David Sommerseth - 1.37-6 +- Fix error appearing on device types described with multiple words (#1298739) + +* Wed Jan 29 2014 Dan Horák - 1.37-5 +- fix various man pages (#948463) +- add man page for the rescan-scsi-bus.sh script (#948463) +- Resolves: #948463 + +* Fri Jan 24 2014 Daniel Mach - 1.37-4 +- Mass rebuild 2014-01-24 + +* Fri Dec 27 2013 Daniel Mach - 1.37-3 +- Mass rebuild 2013-12-27 + +* Fri Oct 18 2013 Dan Horák - 1.37-2 +- include fix for #920687 + +* Wed Oct 16 2013 Dan Horák - 1.37-1 +- update to version 1.37 +- switch to included rescan-scsi-bus script + +* Sun Aug 04 2013 Fedora Release Engineering - 1.36-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Thu Jun 06 2013 Dan Horák - 1.36-1 +- update to version 1.36 +- modernize spec + +* Thu Feb 14 2013 Fedora Release Engineering - 1.35-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Mon Jan 21 2013 Dan Horák - 1.35-1 +- update to version 1.35 + +* Thu Oct 18 2012 Dan Horák - 1.34-1 +- update to version 1.34 + +* Fri Sep 14 2012 Dan Horák - 1.33-4 +- add fix for sg3_utils >= 1.32 to the rescan-scsi-bus script + +* Sat Jul 21 2012 Fedora Release Engineering - 1.33-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Wed Apr 4 2012 Dan Horák - 1.33-2 +- include rescan-scsi-bus script 1.56 + +* Tue Apr 3 2012 Dan Horák - 1.33-1 +- update to version 1.33 + +* Sat Jan 14 2012 Fedora Release Engineering - 1.31-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Fri Feb 18 2011 Dan Horák - 1.31-1 +- update to version 1.31 + +* Wed Feb 09 2011 Fedora Release Engineering - 1.29-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Thu Jul 8 2010 Dan Horák - 1.29-2 +- added license texts into -libs subpackage + +* Mon Apr 12 2010 Dan Horák - 1.29-1 +- update to version 1.29 + +* Thu Jan 14 2010 Dan Horák - 1.28-2 +- include rescan-scsi-bus script 1.35 +- rebase patches and add fix for issue mentioned in #538787 + +* Thu Oct 22 2009 Dan Horák - 1.28-1 +- update to version 1.28 +- added fixes from RHEL to rescan-scsi-bus.sh +- added scsi-rescan symlink to the rescan-scsi-bus.sh script + +* Sun Jul 26 2009 Fedora Release Engineering - 1.27-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Tue Apr 28 2009 Dan Horák - 1.27-1 +- update to version 1.27 +- changelog: http://sg.danny.cz/sg/p/sg3_utils.ChangeLog + +* Tue Mar 31 2009 Dan Horák - 1.26-4 +- add dependency between the libs subpackage and the main package (#492921) + +* Wed Feb 25 2009 Fedora Release Engineering - 1.26-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Mon Nov 3 2008 Dan Horák - 1.26-2 +- update URL +- include rescan-scsi-bus script 1.29 + +* Mon Jun 30 2008 Dan Horák - 1.26-1 +- update to upstream version 1.26 + +* Fri Mar 28 2008 Phil Knirsch - 1.25-4 +- Dropped really unnecessary Provides of sg_utils (#226414) +- Use --disable-static in configure (#226414) + +* Thu Mar 27 2008 Phil Knirsch - 1.25-3 +- Specfile cleanup, removal of static development libraries (#226414) + +* Tue Feb 19 2008 Fedora Release Engineering - 1.25-2 +- Autorebuild for GCC 4.3 + +* Mon Oct 22 2007 Phil Knirsch - 1.25-1 +- Fixed URLs +- Updated to sg3_utils-1.25 + +* Thu Aug 16 2007 Phil Knirsch - 1.23-2 +- License review and update + +* Fri Feb 02 2007 Phil Knirsch - 1.23-1 +- Update to sg3_utils-1.23 +- Updated summary + +* Mon Nov 13 2006 Phil Knirsch - 1.22-1 +- Update to sg3_utils-1.22 + +* Wed Jul 12 2006 Jesse Keating - 1.20-2.1 +- rebuild + +* Wed Jun 07 2006 Phil Knirsch - 1.20-2 +- Fixed rebuild problem on latest toolchain +- Added missing buildprereqs + +* Fri May 19 2006 Phil Knirsch - 1.20-1 +- Update to sg3_utils-1.20. + +* Fri Feb 10 2006 Jesse Keating - 1.19-1.1 +- bump again for double-long bug on ppc(64) + +* Fri Feb 10 2006 Phil Knirsch - 1.19-1 +- Update to sg3_utils-1.19. +- Fixed rebuild problem on 64bit archs. + +* Tue Feb 07 2006 Jesse Keating - 1.17-1.1 +- rebuilt for new gcc4.1 snapshot and glibc changes + +* Mon Nov 07 2005 Phil Knirsch 1.17-1 +- Update to sg3-utils-1.17 +- Split package up into 3 subpackages: sg3_utils, devel and libs +- Some minor updates to the specfile + +* Wed Mar 02 2005 Phil Knirsch 1.06-5 +- bump release and rebuild with gcc 4 + +* Fri Feb 18 2005 Phil Knirsch 1.06-4 +- rebuilt + +* Tue Aug 03 2004 Phil Knirsch 1.06-3 +- rebuilt + +* Thu Mar 11 2004 Tim Powers 1.06-2 +- rebuild + +* Wed Feb 18 2004 Phil Knirsch 1.06-1 +- Initial version for RHEL3 U2. + +* Fri Jan 09 2004 - dgilbert@interlog.com +- sg3_utils.spec for mandrake; more sginfo work, sg_scan, sg_logs + * sg3_utils-1.06 + +* Wed Nov 12 2003 - dgilbert@interlog.com +- sg_readcap: sizes; sg_logs: double fetch; sg_map 256 sg devices; sginfo + * sg3_utils-1.05 + +* Tue May 13 2003 - dgilbert@interlog.com +- default sg_turs '-n=' to 1, sg_logs gets '-t' for temperature, CREDITS + * sg3_utils-1.04 + +* Wed Apr 02 2003 - dgilbert@interlog.com +- 6 byte CDBs for sg_modes, sg_start on block devs, sg_senddiag, man pages + * sg3_utils-1.03 + +* Wed Jan 01 2003 - dgilbert@interlog.com +- interwork with block SG_IO, fix in sginfo, '-t' for sg_turs + * sg3_utils-1.02 + +* Wed Aug 14 2002 - dgilbert@interlog.com +- raw switch in sg_inq + * sg3_utils-1.01 + +* Sun Jul 28 2002 - dgilbert@interlog.com +- decode sg_logs pages, add dio to sgm_dd, drop "gen=1" arg, "of=/dev/null" + * sg3_utils-1.00 + +* Sun Mar 17 2002 - dgilbert@interlog.com +- add sg_modes+sg_logs for sense pages, expand sg_inq, add fua+sync to sg_dd++ + * sg3_utils-0.99 + +* Sat Feb 16 2002 - dgilbert@interlog.com +- resurrect sg_reset; snprintf cleanup, time,gen+cdbsz args to sg_dd++ + * sg3_utils-0.98 + +* Sun Dec 23 2001 - dgilbert@interlog.com +- move isosize to archive directory; now found in util-linux-2.10s and later + * sg3_utils-0.97 + +* Fri Dec 21 2001 - dgilbert@interlog.com +- add sgm_dd, sg_read, sg_simple4 and sg_simple16 [add mmap-ed IO support] + * sg3_utils-0.96 + +* Sat Sep 15 2001 - dgilbert@interlog.com +- sg_map can do inquiry; sg_dd, sgp_dd + sgq_dd dio help + * sg3_utils-0.95 + +* Thu Apr 19 2001 - dgilbert@interlog.com +- add sg_start, improve sginfo and sg_map [Kurt Garloff] + * sg3_utils-0.94 + +* Mon Mar 5 2001 - dgilbert@interlog.com +- add scsi_devfs_scan, add sg_include.h, 'coe' more general in sgp_dd + * sg3_utils-0.93 + +* Tue Jan 16 2001 - dgilbert@interlog.com +- clean sg_err.h include dependencies, bug fixes, Makefile in archive directory + * sg3_utils-0.92 + +* Thu Dec 21 2000 - dgilbert@interlog.com +- signals for sg_dd, man pages and additions for sg_rbuf and isosize + * sg3_utils-0.91 + +* Mon Dec 11 2000 - dgilbert@interlog.com +- Initial creation of package, containing + * sg3_utils-0.90