xref: /illumos-gate/usr/src/cmd/modload/errmsg.h (revision 88181e00)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright 2010 Nexenta Systems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 /*
26  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
27  * Use is subject to license terms.
28  */
29 
30 #ifndef	_ERRMSG_H
31 #define	_ERRMSG_H
32 
33 #ifdef	__cplusplus
34 extern "C" {
35 #endif
36 
37 /* text for gettext error messages for adddrv.c and remdrv.c */
38 
39 #define	USAGE	"Usage:\n"\
40 "	add_drv [ -m '<permission> ','<...>' ]\n"\
41 "		[ -n ]\n"\
42 "		[ -f ]\n"\
43 "		[ -v ]\n"\
44 "		[ -i '<identify_name  <...>' ] \n"\
45 "		[ -b <basedir> ]\n"\
46 "		[ -c <class_name> ]\n"\
47 "		[ -p <dev_policy> ]\n"\
48 "		<driver_module>\n"\
49 "Example:\n"\
50 "	add_drv -m '* 0666 bin bin' -i 'acme,sd new,sd' sd \n"\
51 "	Add 'sd' drive with identify names: acme,sd and new,sd.\n"\
52 "	Every minor node will have the permission 0666,\n"\
53 "	and be owned by bin with group bin.\n"
54 
55 #define	BOOT_CLIENT	"Reboot client to install driver.\n"
56 #define	DRIVER_INSTALLED	"Driver (%s) installed.\n"
57 
58 #define	ERR_INSTALL_FAIL	"Error: Could not install driver (%s).\n"
59 #define	ERR_DRVNAME_TOO_LONG	"Error: driver name must not exceed (%d)" \
60 " characters; driver name too long (%s)\n"
61 #define	ERR_ALIAS_IN_NAM_MAJ	\
62 "Alias (\"%s\") already in use as driver name.\n"
63 #define	ERR_ALIAS_IN_USE	\
64 "(\"%s\") already in use as a driver or alias.\n"
65 #define	ERR_CANT_ACCESS_FILE	"Cannot access file (%s).\n"
66 #define	ERR_BAD_PATH	"Bad syntax for pathname : (%s)\n"
67 #define	ERR_FORK_FAIL	"Fork failed; cannot exec : %s\n"
68 #define	ERR_PROG_IN_USE	"add_drv/rem_drv currently busy; try later\n"
69 #define	ERR_NOT_ROOT	"You must be root to run this program.\n"
70 #define	ERR_NOT_GLOBAL_ZONE	\
71 "add_drv/rem_drv can only be run from the global zone.\n"
72 #define	ERR_BAD_LINE	"Bad line in file %s : %s\n"
73 #define	ERR_CANNOT_OPEN	"Cannot open (%s): %s.\n"
74 #define	ERR_MIS_TOK	"Option (%s) : missing token: (%s)\n"
75 #define	ERR_BAD_TOK	"Option (%s) : bad token: (%s)\n"
76 #define	ERR_TOO_MANY_ARGS	"Option (%s) : too many arguments: (%s)\n"
77 #define	ERR_BAD_MODE	"Bad mode: (%s)\n"
78 #define	ERR_CANT_OPEN	"Cannot open (%s)\n"
79 #define	ERR_NO_UPDATE	"Cannot update (%s)\n"
80 #define	ERR_CANT_RM	"Cannot remove temporary file (%s); remove by hand.\n"
81 #define	ERR_BAD_LINK	"(%s) exists as (%s); Please rename by hand.\n"
82 #define	ERR_FILE_EXISTS	"Temporary file (%s) exists; Please remove by hand.\n"
83 #define	ERR_NO_MEM		"Not enough memory\n"
84 #define	ERR_DEL_ENTRY	"Cannot delete entry for driver (%s) from file (%s).\n"
85 #define	ERR_NO_ENTRY	"No entry found for driver (%s) in file (%s).\n"
86 #define	ERR_DEV_IN_USE	"One or more devices remain in use for driver %s.\n"
87 #define	ERR_INT_UPDATE	"Internal error updating (%s).\n"
88 #define	ERR_NOMOD	"Cannot find module (%s).\n"
89 #define	ERR_MAX_MAJOR	"Cannot get major device information.\n"
90 #define	ERR_NO_FREE_MAJOR	"No available major numbers.\n"
91 #define	ERR_NOT_UNIQUE	"Driver (%s) is already installed.\n"
92 #define	ERR_NOT_INSTALLED "Driver (%s) not installed.\n"
93 #define	ERR_ALIAS_NOT_BOUND "Alias not bound to driver %s.\n"
94 #define	ERR_UPDATE	"Cannot update (%s).\n"
95 #define	ERR_MAX_EXCEEDS "Major number (%d) exceeds maximum (%d).\n"
96 #define	ERR_NO_CLEAN	"Cannot update; check file %s and rem_drv %s by hand.\n"
97 #define	ERR_CONFIG	\
98 "Warning: Driver (%s) successfully added to system but failed to attach\n"
99 #define	ERR_DEVTREE	\
100 "Warning: Unable to check for driver configuration conflicts.\n"
101 #define	ERR_MODPATH	"System error: Could not get module path.\n"
102 #define	ERR_BAD_MAJNUM	\
103 "Warning: Major number (%d) inconsistent with /etc/name_to_major file.\n"
104 #define	ERR_MAJ_TOOBIG	"Warning: Entry '%s %llu' in %s has a major number " \
105 			"larger\nthan the maximum allowed value %u.\n"
106 
107 #define	ERR_CREAT_LOCK	"Failed to create lock file(%s): %s\n"
108 #define	ERR_STAT_LOCK	"Failed to stat lock file(%s): %s\n"
109 #define	ERR_LOCK	"Failed to lock the lock file(%s): %s\n"
110 #define	ERR_UNLOCK	"Failed to unlock the lock file(%s): %s\n"
111 #define	ERR_OWNER_LOCK	"Lock file(%s) not owned by user\n"
112 
113 #define	ERR_LOCATION	\
114 "Warning: %s-bit version of driver found at %s.\n"
115 #define	ERR_ISA_MISMATCH	"No %s-bit version of (%s) found; %s-bit " \
116 				"version of this driver exists.\n"
117 #define	ERR_NOT_LOADABLE	\
118 "%s-bit driver (%s) not loadable on %s-bit kernel.\n"
119 #define	ERR_ELF_VERSION "ELF library out of date : %s. \n"
120 #define	ERR_ELF_KIND	"The file (%s) is not in ELF format.\n"
121 #define	ERR_KERNEL_ISA	"Could not identify kernel's ISA. \n"
122 #define	ERR_CONFIG_NOLOAD	\
123 "System configuration files modified but %s driver not loaded or attached.\n"
124 #define	ERR_SOL_LOCATION	\
125 "Place (%s) driver in correct location and run devfsadm -i %s.\n"
126 #define	ERR_ARCH_NOT_SUPPORTED	"Architecture %s not supported by add_drv.\n"
127 #define	ERR_SYSINFO_ARCH	"Failed to identify system architecture.\n"
128 #define	ERR_PATH_SPEC	"Error: driver may not be specified by path (%s)\n"
129 #define	ERR_CREATE_RECONFIG	"Error: Could not create /reconfigure.\n"
130 
131 #define	INFO_UPDATE_ONLY	\
132 "System updated but %s driver not yet configured.\n"
133 
134 /* update_drv messages */
135 #define	UPD_DRV_USAGE	\
136 	"Usage:\tupdate_drv [ -f | -v ] <driver_module>\n" \
137 	"\tupdate_drv [ -b basedir ] [ -f | -v | -n ] -a\n" \
138 		"\t\t[-m 'permission'] [-i 'identify_name']\n" \
139 		"\t\t[-P privilege] [-p 'policy']  <driver_module>\n" \
140 	"\tupdate_drv [ -b basedir ] [ -f | -v | -n ] -d\n" \
141 		"\t\t[-m 'permission'] [-i 'identify_name']\n" \
142 		"\t\t[-P privilege] [-p 'policy']  <driver_module>\n\n"\
143 	"NOTE: at least one of m/i/P/p must be specified with -a and -d.\n"
144 
145 #define	FORCE_UPDATE	"Forcing update of %s.conf.\n"
146 #define	ERR_DRVCONF	"Failed to update %s.conf for driver.\n"
147 #define	DRVCONF_UPDATED	"%s.conf updated in the kernel.\n"
148 #define	NOUPDATE	"%s.conf not updated in the kernel\n"
149 
150 /* remdrv messages */
151 
152 #define	REM_USAGE1	\
153 	"Usage:\n\t rem_drv [ -C ] [ -b <basedir> ] [ -n ] driver_name\n"
154 #define	ERR_NO_MAJ	"Cannot get major number for :  %s\n"
155 #define	ERR_UNLINK	"Warning: Cannot remove %s from devfs namespace.\n"
156 #define	ERR_PIPE	"System error : Cannot create pipe\n"
157 #define	ERR_EXEC	"System error : Exec failed\n"
158 #define	ERR_DEVFSCLEAN  \
159 "Warning: Cannot remove entries from devfs namespace for driver : %s.\n"
160 #define	ERR_DEVFSALCLEAN  \
161 "Warning: Cannot remove alias entries from devfs namespace for driver : %s .\n"
162 #define	ERR_MODID	"Cannot get modid for : (%s)\n"
163 #define	ERR_MODUN	\
164 	"Cannot unload module: %s\nWill be unloaded upon reboot.\n"
165 #define	ERR_MODREMMAJ	"Cannot remove major number binding for %d\n"
166 #define	ERR_NOENTRY	"Cannot find (%s) in file : %s\n"
167 
168 /* drvsubr messages */
169 #define	ERR_NOFILE	"Warning: (%s) file missing.\n"
170 #define	ERR_NO_SPACE	\
171 "Can't have space within double quote: %s. \
172 Use octal escape sequence \"\\040\".\n"
173 
174 #define	ERR_PRIVIMPL	"Cannot get privilege information.\n"
175 #define	ERR_BAD_MINOR	"Minor device specification cannot include ``:''.\n"
176 #define	ERR_BAD_TOKEN	"Bad policy token: ``%s''.\n"
177 #define	ERR_BAD_PRIVS	"Error in privilege set specification: %.*s[HERE->]%s\n"
178 #define	ERR_INVALID_PLCY	"Invalid policy specification\n"
179 #define	ERR_ONLY_ONE	"Only one policy entry allowed per invocation\n"
180 #define	ERR_NO_EQUALS	"Missing equal sign in token ``%s''\n"
181 #define	ERR_BAD_PRIV	"Cannot allocate privilege ``%s'': %s\n"
182 
183 #define	ERR_UPDATE_PERM		\
184 	"kernel update of permissions for driver %s failed (%d)\n"
185 
186 #define	ERR_REMDRV_CLEANUP	\
187 	"post-rem_drv devfs cleanup for driver %s failed (%d)\n"
188 
189 #define	ERR_PATH_ORIENTED_ALIAS	\
190 	"no device at specified path-oriented alias \"%s\"\n"
191 
192 #ifdef	__cplusplus
193 }
194 #endif
195 
196 #endif	/* _ERRMSG_H */
197