svn commit: r349936 - head/sbin/camcontrol

Warner Losh imp at FreeBSD.org
Fri Jul 12 05:35:47 UTC 2019


Author: imp
Date: Fri Jul 12 05:35:45 2019
New Revision: 349936
URL: https://svnweb.freebsd.org/changeset/base/349936

Log:
  Retire support for -DMINIMALISTIC
  
  We've not used this in years since we retired sysinstall, and it
  hasn't compiled in at least a year. A full camcontrol is only 180k, so
  making it smaller is not as important as it once was.
  
  OK'd by: ken@, scottl@

Modified:
  head/sbin/camcontrol/Makefile
  head/sbin/camcontrol/camcontrol.c

Modified: head/sbin/camcontrol/Makefile
==============================================================================
--- head/sbin/camcontrol/Makefile	Fri Jul 12 05:19:37 2019	(r349935)
+++ head/sbin/camcontrol/Makefile	Fri Jul 12 05:35:45 2019	(r349936)
@@ -5,11 +5,7 @@
 PACKAGE=runtime
 PROG=	camcontrol
 SRCS=	camcontrol.c util.c
-.if !defined(RELEASE_CRUNCH)
 SRCS+=	attrib.c epc.c fwdownload.c modeedit.c persist.c progress.c timestamp.c zone.c
-.else
-CFLAGS+= -DMINIMALISTIC
-.endif
 .if ${MK_NVME} != "no"
 .PATH:	${SRCTOP}/sbin/nvmecontrol
 CFLAGS+= -I${SRCTOP}/sbin/nvmecontrol -DWITH_NVME

Modified: head/sbin/camcontrol/camcontrol.c
==============================================================================
--- head/sbin/camcontrol/camcontrol.c	Fri Jul 12 05:19:37 2019	(r349935)
+++ head/sbin/camcontrol/camcontrol.c	Fri Jul 12 05:35:45 2019	(r349936)
@@ -46,10 +46,8 @@ __FBSDID("$FreeBSD$");
 #include <ctype.h>
 #include <err.h>
 #include <libutil.h>
-#ifndef MINIMALISTIC
 #include <limits.h>
 #include <inttypes.h>
-#endif
 
 #include <cam/cam.h>
 #include <cam/cam_debug.h>
@@ -153,7 +151,6 @@ struct camcontrol_opts {
 	const char	*subopt;
 };
 
-#ifndef MINIMALISTIC
 struct ata_res_pass16 {
 	u_int16_t reserved[5];
 	u_int8_t flags;
@@ -192,10 +189,8 @@ static const char smprg_opts[] = "l";
 static const char smppc_opts[] = "a:A:d:lm:M:o:p:s:S:T:";
 static const char smpphylist_opts[] = "lq";
 static char pwd_opt;
-#endif
 
 static struct camcontrol_opts option_table[] = {
-#ifndef MINIMALISTIC
 	{"tur", CAM_CMD_TUR, CAM_ARG_NONE, NULL},
 	{"inquiry", CAM_CMD_INQUIRY, CAM_ARG_NONE, "DSR"},
 	{"identify", CAM_CMD_IDENTIFY, CAM_ARG_NONE, NULL},
@@ -206,10 +201,8 @@ static struct camcontrol_opts option_table[] = {
 	{"reportluns", CAM_CMD_REPORTLUNS, CAM_ARG_NONE, "clr:"},
 	{"readcapacity", CAM_CMD_READCAP, CAM_ARG_NONE, "bhHlNqs"},
 	{"reprobe", CAM_CMD_REPROBE, CAM_ARG_NONE, NULL},
-#endif /* MINIMALISTIC */
 	{"rescan", CAM_CMD_RESCAN, CAM_ARG_NONE, NULL},
 	{"reset", CAM_CMD_RESET, CAM_ARG_NONE, NULL},
-#ifndef MINIMALISTIC
 	{"cmd", CAM_CMD_SCSI_CMD, CAM_ARG_NONE, scsicmd_opts},
 	{"mmcsdcmd", CAM_CMD_MMCSD_CMD, CAM_ARG_NONE, "c:a:f:Wb:l:41S:I"},
 	{"command", CAM_CMD_SCSI_CMD, CAM_ARG_NONE, scsicmd_opts},
@@ -223,9 +216,7 @@ static struct camcontrol_opts option_table[] = {
 	{"smpmaninfo", CAM_CMD_SMP_MANINFO, CAM_ARG_NONE, "l"},
 	{"defects", CAM_CMD_READ_DEFECTS, CAM_ARG_NONE, readdefect_opts},
 	{"defectlist", CAM_CMD_READ_DEFECTS, CAM_ARG_NONE, readdefect_opts},
-#endif /* MINIMALISTIC */
 	{"devlist", CAM_CMD_DEVTREE, CAM_ARG_NONE, "-b"},
-#ifndef MINIMALISTIC
 	{"periphlist", CAM_CMD_DEVLIST, CAM_ARG_NONE, NULL},
 	{"modepage", CAM_CMD_MODE_PAGE, CAM_ARG_NONE, "bdelm:P:"},
 	{"tags", CAM_CMD_TAG, CAM_ARG_NONE, "N:q"},
@@ -249,7 +240,6 @@ static struct camcontrol_opts option_table[] = {
 	{"zone", CAM_CMD_ZONE, CAM_ARG_NONE, "ac:l:No:P:"},
 	{"epc", CAM_CMD_EPC, CAM_ARG_NONE, "c:dDeHp:Pr:sS:T:"},
 	{"timestamp", CAM_CMD_TIMESTAMP, CAM_ARG_NONE, "f:mrsUT:"},
-#endif /* MINIMALISTIC */
 	{"help", CAM_CMD_USAGE, CAM_ARG_NONE, NULL},
 	{"-?", CAM_CMD_USAGE, CAM_ARG_NONE, NULL},
 	{"-h", CAM_CMD_USAGE, CAM_ARG_NONE, NULL},
@@ -276,9 +266,7 @@ static cam_argmask arglist;
 camcontrol_optret getoption(struct camcontrol_opts *table, char *arg,
 			    uint32_t *cmdnum, cam_argmask *argnum,
 			    const char **subopt);
-#ifndef MINIMALISTIC
 static int getdevlist(struct cam_device *device);
-#endif /* MINIMALISTIC */
 static int getdevtree(int argc, char **argv, char *combinedopt);
 static int print_dev_scsi(struct device_match_result *dev_result, char *tmpstr);
 static int print_dev_ata(struct device_match_result *dev_result, char *tmpstr);
@@ -288,7 +276,6 @@ static int print_dev_mmcsd(struct device_match_result 
 #ifdef WITH_NVME
 static int print_dev_nvme(struct device_match_result *dev_result, char *tmpstr);
 #endif
-#ifndef MINIMALISTIC
 static int testunitready(struct cam_device *device, int task_attr,
 			 int retry_count, int timeout, int quiet);
 static int scsistart(struct cam_device *device, int startstop, int loadeject,
@@ -297,14 +284,12 @@ static int scsiinquiry(struct cam_device *device, int 
 		       int retry_count, int timeout);
 static int scsiserial(struct cam_device *device, int task_attr,
 		      int retry_count, int timeout);
-#endif /* MINIMALISTIC */
 static int parse_btl(char *tstr, path_id_t *bus, target_id_t *target,
 		     lun_id_t *lun, cam_argmask *arglst);
 static int dorescan_or_reset(int argc, char **argv, int rescan);
 static int rescan_or_reset_bus(path_id_t bus, int rescan);
 static int scanlun_or_reset_dev(path_id_t bus, target_id_t target,
     lun_id_t lun, int scan);
-#ifndef MINIMALISTIC
 static int readdefects(struct cam_device *device, int argc, char **argv,
 		       char *combinedopt, int task_attr, int retry_count,
 		       int timeout);
@@ -371,7 +356,6 @@ static int scsiopcodes(struct cam_device *device, int 
 		       int timeout, int verbose);
 static int scsireprobe(struct cam_device *device);
 
-#endif /* MINIMALISTIC */
 #ifndef min
 #define min(a,b) (((a)<(b))?(a):(b))
 #endif
@@ -403,7 +387,6 @@ getoption(struct camcontrol_opts *table, char *arg, ui
 		return (CC_OR_NOT_FOUND);
 }
 
-#ifndef MINIMALISTIC
 static int
 getdevlist(struct cam_device *device)
 {
@@ -462,7 +445,6 @@ getdevlist(struct cam_device *device)
 
 	return (error);
 }
-#endif /* MINIMALISTIC */
 
 static int
 getdevtree(int argc, char **argv, char *combinedopt)
@@ -835,7 +817,6 @@ print_dev_nvme(struct device_match_result *dev_result,
 }
 #endif
 
-#ifndef MINIMALISTIC
 static int
 testunitready(struct cam_device *device, int task_attr, int retry_count,
 	      int timeout, int quiet)
@@ -2424,10 +2405,8 @@ identify(struct cam_device *device, int retry_count, i
 #endif
 	return (ataidentify(device, retry_count, timeout));
 }
-#endif /* MINIMALISTIC */
 
 
-#ifndef MINIMALISTIC
 enum {
 	ATA_SECURITY_ACTION_PRINT,
 	ATA_SECURITY_ACTION_FREEZE,
@@ -3260,7 +3239,6 @@ atasecurity(struct cam_device *device, int retry_count
 
 	return (error);
 }
-#endif /* MINIMALISTIC */
 
 /*
  * Parse out a bus, or a bus, target and lun in the following
@@ -3708,7 +3686,6 @@ scanlun_or_reset_dev(path_id_t bus, target_id_t target
 	}
 }
 
-#ifndef MINIMALISTIC
 
 static struct scsi_nv defect_list_type_map[] = {
 	{ "block", SRDD10_BLOCK_FORMAT },
@@ -4284,7 +4261,6 @@ defect_bailout:
 
 	return (error);
 }
-#endif /* MINIMALISTIC */
 
 #if 0
 void
@@ -4298,7 +4274,6 @@ reassignblocks(struct cam_device *device, u_int32_t *b
 }
 #endif
 
-#ifndef MINIMALISTIC
 void
 mode_sense(struct cam_device *device, int dbd, int pc, int page, int subpage,
 	   int task_attr, int retry_count, int timeout, u_int8_t *data,
@@ -9522,7 +9497,6 @@ bailout:
 	return (retval);
 }
 
-#endif /* MINIMALISTIC */
 
 static int
 scsireprobe(struct cam_device *device)
@@ -9566,7 +9540,6 @@ usage(int printlong)
 	fprintf(printlong ? stdout : stderr,
 "usage:  camcontrol <command>  [device id][generic args][command args]\n"
 "        camcontrol devlist    [-b] [-v]\n"
-#ifndef MINIMALISTIC
 "        camcontrol periphlist [dev_id][-n dev_name] [-u unit]\n"
 "        camcontrol tur        [dev_id][generic args]\n"
 "        camcontrol inquiry    [dev_id][generic args] [-D] [-S] [-R]\n"
@@ -9579,10 +9552,8 @@ usage(int printlong)
 "        camcontrol load       [dev_id][generic args]\n"
 "        camcontrol eject      [dev_id][generic args]\n"
 "        camcontrol reprobe    [dev_id][generic args]\n"
-#endif /* MINIMALISTIC */
 "        camcontrol rescan     <all | bus[:target:lun] | dev_id>\n"
 "        camcontrol reset      <all | bus[:target:lun] | dev_id>\n"
-#ifndef MINIMALISTIC
 "        camcontrol defects    [dev_id][generic args] <-f format> [-P][-G]\n"
 "                              [-q][-s][-S offset][-X]\n"
 "        camcontrol modepage   [dev_id][generic args] <-m page | -l>\n"
@@ -9642,11 +9613,9 @@ usage(int printlong)
 "        camcontrol timestamp  [dev_id][generic_args] <-r [-f format|-m|-U]>|\n"
 "                              <-s <-f format -T time | -U >>\n"
 "                              \n"
-#endif /* MINIMALISTIC */
 "        camcontrol help\n");
 	if (!printlong)
 		return;
-#ifndef MINIMALISTIC
 	fprintf(stdout,
 "Specify one of the following options:\n"
 "devlist     list all CAM devices\n"
@@ -9892,7 +9861,6 @@ usage(int printlong)
 "-T time           the time value passed into strptime(3)\n"
 "-U                set the timestamp of the device to UTC time\n"
 );
-#endif /* MINIMALISTIC */
 }
 
 int
@@ -9911,11 +9879,9 @@ main(int argc, char **argv)
 	int error = 0, optstart = 2;
 	int task_attr = MSG_SIMPLE_Q_TAG;
 	int devopen = 1;
-#ifndef MINIMALISTIC
 	path_id_t bus;
 	target_id_t target;
 	lun_id_t lun;
-#endif /* MINIMALISTIC */
 
 	cmdlist = CAM_CMD_NONE;
 	arglist = CAM_ARG_NONE;
@@ -10003,7 +9969,6 @@ main(int argc, char **argv)
 	 || (cmdlist == CAM_CMD_DEBUG))
 		devopen = 0;
 
-#ifndef MINIMALISTIC
 	if ((devopen == 1)
 	 && (argc > 2 && argv[2][0] != '-')) {
 		char name[30];
@@ -10031,7 +9996,6 @@ main(int argc, char **argv)
 			optstart++;
 		}
 	}
-#endif /* MINIMALISTIC */
 	/*
 	 * Start getopt processing at argv[2/3], since we've already
 	 * accepted argv[1..2] as the command name, and as a possible
@@ -10117,7 +10081,6 @@ main(int argc, char **argv)
 		}
 	}
 
-#ifndef MINIMALISTIC
 	/*
 	 * For most commands we'll want to open the passthrough device
 	 * associated with the specified device.  In the case of the rescan
@@ -10138,7 +10101,6 @@ main(int argc, char **argv)
 		     == NULL)
 			errx(1,"%s", cam_errbuf);
 	}
-#endif /* MINIMALISTIC */
 
 	/*
 	 * Reset optind to 2, and reset getopt, so these routines can parse
@@ -10148,7 +10110,6 @@ main(int argc, char **argv)
 	optreset = 1;
 
 	switch(cmdlist) {
-#ifndef MINIMALISTIC
 	case CAM_CMD_DEVLIST:
 		error = getdevlist(cam_dev);
 		break;
@@ -10156,11 +10117,9 @@ main(int argc, char **argv)
 		error = atahpa(cam_dev, retry_count, timeout,
 			       argc, argv, combinedopt);
 		break;
-#endif /* MINIMALISTIC */
 	case CAM_CMD_DEVTREE:
 		error = getdevtree(argc, argv, combinedopt);
 		break;
-#ifndef MINIMALISTIC
 	case CAM_CMD_TUR:
 		error = testunitready(cam_dev, task_attr, retry_count,
 		    timeout, 0);
@@ -10177,14 +10136,12 @@ main(int argc, char **argv)
 				  arglist & CAM_ARG_EJECT, task_attr,
 				  retry_count, timeout);
 		break;
-#endif /* MINIMALISTIC */
 	case CAM_CMD_RESCAN:
 		error = dorescan_or_reset(argc, argv, 1);
 		break;
 	case CAM_CMD_RESET:
 		error = dorescan_or_reset(argc, argv, 0);
 		break;
-#ifndef MINIMALISTIC
 	case CAM_CMD_READ_DEFECTS:
 		error = readdefects(cam_dev, argc, argv, combinedopt,
 				    task_attr, retry_count, timeout);
@@ -10307,7 +10264,6 @@ main(int argc, char **argv)
 		    task_attr, retry_count, timeout,
 		    arglist & CAM_ARG_VERBOSE);
 		break;
-#endif /* MINIMALISTIC */
 	case CAM_CMD_USAGE:
 		usage(1);
 		break;


More information about the svn-src-head mailing list