xref: /illumos-gate/usr/src/cmd/modload/errmsg.h (revision 88181e00)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
51ca93273Seota  * Common Development and Distribution License (the "License").
61ca93273Seota  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
21*88181e00SAlexander Eremin /*
22*88181e00SAlexander Eremin  * Copyright 2010 Nexenta Systems, Inc.  All rights reserved.
23*88181e00SAlexander Eremin  * Use is subject to license terms.
24*88181e00SAlexander Eremin  */
257c478bd9Sstevel@tonic-gate /*
267e485317SJerry Gilliam  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
277c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
287c478bd9Sstevel@tonic-gate  */
307c478bd9Sstevel@tonic-gate #ifndef	_ERRMSG_H
317c478bd9Sstevel@tonic-gate #define	_ERRMSG_H
337c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
347c478bd9Sstevel@tonic-gate extern "C" {
357c478bd9Sstevel@tonic-gate #endif
377c478bd9Sstevel@tonic-gate /* text for gettext error messages for adddrv.c and remdrv.c */
397c478bd9Sstevel@tonic-gate #define	USAGE	"Usage:\n"\
407c478bd9Sstevel@tonic-gate "	add_drv [ -m '<permission> ','<...>' ]\n"\
417c478bd9Sstevel@tonic-gate "		[ -n ]\n"\
427c478bd9Sstevel@tonic-gate "		[ -f ]\n"\
437c478bd9Sstevel@tonic-gate "		[ -v ]\n"\
447c478bd9Sstevel@tonic-gate "		[ -i '<identify_name  <...>' ] \n"\
457c478bd9Sstevel@tonic-gate "		[ -b <basedir> ]\n"\
467c478bd9Sstevel@tonic-gate "		[ -c <class_name> ]\n"\
477c478bd9Sstevel@tonic-gate "		[ -p <dev_policy> ]\n"\
487c478bd9Sstevel@tonic-gate "		<driver_module>\n"\
497c478bd9Sstevel@tonic-gate "Example:\n"\
507c478bd9Sstevel@tonic-gate "	add_drv -m '* 0666 bin bin' -i 'acme,sd new,sd' sd \n"\
517c478bd9Sstevel@tonic-gate "	Add 'sd' drive with identify names: acme,sd and new,sd.\n"\
527c478bd9Sstevel@tonic-gate "	Every minor node will have the permission 0666,\n"\
537c478bd9Sstevel@tonic-gate "	and be owned by bin with group bin.\n"
557c478bd9Sstevel@tonic-gate #define	BOOT_CLIENT	"Reboot client to install driver.\n"
567c478bd9Sstevel@tonic-gate #define	DRIVER_INSTALLED	"Driver (%s) installed.\n"
587c478bd9Sstevel@tonic-gate #define	ERR_INSTALL_FAIL	"Error: Could not install driver (%s).\n"
597c478bd9Sstevel@tonic-gate #define	ERR_DRVNAME_TOO_LONG	"Error: driver name must not exceed (%d)" \
607c478bd9Sstevel@tonic-gate " characters; driver name too long (%s)\n"
61f4da9be0Scth #define	ERR_ALIAS_IN_NAM_MAJ	\
62f4da9be0Scth "Alias (\"%s\") already in use as driver name.\n"
63f4da9be0Scth #define	ERR_ALIAS_IN_USE	\
64f4da9be0Scth "(\"%s\") already in use as a driver or alias.\n"
657c478bd9Sstevel@tonic-gate #define	ERR_CANT_ACCESS_FILE	"Cannot access file (%s).\n"
667c478bd9Sstevel@tonic-gate #define	ERR_BAD_PATH	"Bad syntax for pathname : (%s)\n"
677c478bd9Sstevel@tonic-gate #define	ERR_FORK_FAIL	"Fork failed; cannot exec : %s\n"
687c478bd9Sstevel@tonic-gate #define	ERR_PROG_IN_USE	"add_drv/rem_drv currently busy; try later\n"
697c478bd9Sstevel@tonic-gate #define	ERR_NOT_ROOT	"You must be root to run this program.\n"
7017e9b2b7SDhanaraj M #define	ERR_NOT_GLOBAL_ZONE	\
7117e9b2b7SDhanaraj M "add_drv/rem_drv can only be run from the global zone.\n"
727c478bd9Sstevel@tonic-gate #define	ERR_BAD_LINE	"Bad line in file %s : %s\n"
737c478bd9Sstevel@tonic-gate #define	ERR_CANNOT_OPEN	"Cannot open (%s): %s.\n"
747c478bd9Sstevel@tonic-gate #define	ERR_MIS_TOK	"Option (%s) : missing token: (%s)\n"
751ca93273Seota #define	ERR_BAD_TOK	"Option (%s) : bad token: (%s)\n"
767c478bd9Sstevel@tonic-gate #define	ERR_TOO_MANY_ARGS	"Option (%s) : too many arguments: (%s)\n"
777c478bd9Sstevel@tonic-gate #define	ERR_BAD_MODE	"Bad mode: (%s)\n"
787c478bd9Sstevel@tonic-gate #define	ERR_CANT_OPEN	"Cannot open (%s)\n"
797c478bd9Sstevel@tonic-gate #define	ERR_NO_UPDATE	"Cannot update (%s)\n"
807c478bd9Sstevel@tonic-gate #define	ERR_CANT_RM	"Cannot remove temporary file (%s); remove by hand.\n"
817c478bd9Sstevel@tonic-gate #define	ERR_BAD_LINK	"(%s) exists as (%s); Please rename by hand.\n"
82*88181e00SAlexander Eremin #define	ERR_FILE_EXISTS	"Temporary file (%s) exists; Please remove by hand.\n"
837c478bd9Sstevel@tonic-gate #define	ERR_NO_MEM		"Not enough memory\n"
847c478bd9Sstevel@tonic-gate #define	ERR_DEL_ENTRY	"Cannot delete entry for driver (%s) from file (%s).\n"
857c478bd9Sstevel@tonic-gate #define	ERR_NO_ENTRY	"No entry found for driver (%s) in file (%s).\n"
866532b960SJerry Gilliam #define	ERR_DEV_IN_USE	"One or more devices remain in use for driver %s.\n"
877c478bd9Sstevel@tonic-gate #define	ERR_INT_UPDATE	"Internal error updating (%s).\n"
887c478bd9Sstevel@tonic-gate #define	ERR_NOMOD	"Cannot find module (%s).\n"
897c478bd9Sstevel@tonic-gate #define	ERR_MAX_MAJOR	"Cannot get major device information.\n"
907c478bd9Sstevel@tonic-gate #define	ERR_NO_FREE_MAJOR	"No available major numbers.\n"
917c478bd9Sstevel@tonic-gate #define	ERR_NOT_UNIQUE	"Driver (%s) is already installed.\n"
927c478bd9Sstevel@tonic-gate #define	ERR_NOT_INSTALLED "Driver (%s) not installed.\n"
936532b960SJerry Gilliam #define	ERR_ALIAS_NOT_BOUND "Alias not bound to driver %s.\n"
947c478bd9Sstevel@tonic-gate #define	ERR_UPDATE	"Cannot update (%s).\n"
957c478bd9Sstevel@tonic-gate #define	ERR_MAX_EXCEEDS "Major number (%d) exceeds maximum (%d).\n"
967c478bd9Sstevel@tonic-gate #define	ERR_NO_CLEAN	"Cannot update; check file %s and rem_drv %s by hand.\n"
977c478bd9Sstevel@tonic-gate #define	ERR_CONFIG	\
987c478bd9Sstevel@tonic-gate "Warning: Driver (%s) successfully added to system but failed to attach\n"
997c478bd9Sstevel@tonic-gate #define	ERR_DEVTREE	\
1007c478bd9Sstevel@tonic-gate "Warning: Unable to check for driver configuration conflicts.\n"
1017c478bd9Sstevel@tonic-gate #define	ERR_MODPATH	"System error: Could not get module path.\n"
1027c478bd9Sstevel@tonic-gate #define	ERR_BAD_MAJNUM	\
1037c478bd9Sstevel@tonic-gate "Warning: Major number (%d) inconsistent with /etc/name_to_major file.\n"
1047c478bd9Sstevel@tonic-gate #define	ERR_MAJ_TOOBIG	"Warning: Entry '%s %llu' in %s has a major number " \
1057c478bd9Sstevel@tonic-gate 			"larger\nthan the maximum allowed value %u.\n"
10749e92448Svikram #define	ERR_CREAT_LOCK	"Failed to create lock file(%s): %s\n"
1083c0ea289SJerry Gilliam #define	ERR_STAT_LOCK	"Failed to stat lock file(%s): %s\n"
10949e92448Svikram #define	ERR_LOCK	"Failed to lock the lock file(%s): %s\n"
11049e92448Svikram #define	ERR_UNLOCK	"Failed to unlock the lock file(%s): %s\n"
1113c0ea289SJerry Gilliam #define	ERR_OWNER_LOCK	"Lock file(%s) not owned by user\n"
1137c478bd9Sstevel@tonic-gate #define	ERR_LOCATION	\
1147c478bd9Sstevel@tonic-gate "Warning: %s-bit version of driver found at %s.\n"
1157c478bd9Sstevel@tonic-gate #define	ERR_ISA_MISMATCH	"No %s-bit version of (%s) found; %s-bit " \
1167c478bd9Sstevel@tonic-gate 				"version of this driver exists.\n"
1177c478bd9Sstevel@tonic-gate #define	ERR_NOT_LOADABLE	\
1187c478bd9Sstevel@tonic-gate "%s-bit driver (%s) not loadable on %s-bit kernel.\n"
1197c478bd9Sstevel@tonic-gate #define	ERR_ELF_VERSION "ELF library out of date : %s. \n"
1207c478bd9Sstevel@tonic-gate #define	ERR_ELF_KIND	"The file (%s) is not in ELF format.\n"
1217c478bd9Sstevel@tonic-gate #define	ERR_KERNEL_ISA	"Could not identify kernel's ISA. \n"
1227c478bd9Sstevel@tonic-gate #define	ERR_CONFIG_NOLOAD	\
1237c478bd9Sstevel@tonic-gate "System configuration files modified but %s driver not loaded or attached.\n"
1247c478bd9Sstevel@tonic-gate #define	ERR_SOL_LOCATION	\
1257c478bd9Sstevel@tonic-gate "Place (%s) driver in correct location and run devfsadm -i %s.\n"
1267c478bd9Sstevel@tonic-gate #define	ERR_ARCH_NOT_SUPPORTED	"Architecture %s not supported by add_drv.\n"
1277c478bd9Sstevel@tonic-gate #define	ERR_SYSINFO_ARCH	"Failed to identify system architecture.\n"
1287c478bd9Sstevel@tonic-gate #define	ERR_PATH_SPEC	"Error: driver may not be specified by path (%s)\n"
1297c478bd9Sstevel@tonic-gate #define	ERR_CREATE_RECONFIG	"Error: Could not create /reconfigure.\n"
131c9cc1492SJerry Gilliam #define	INFO_UPDATE_ONLY	\
132c9cc1492SJerry Gilliam "System updated but %s driver not yet configured.\n"
133c9cc1492SJerry Gilliam 
1347c478bd9Sstevel@tonic-gate /* update_drv messages */
1357c478bd9Sstevel@tonic-gate #define	UPD_DRV_USAGE	\
1367c478bd9Sstevel@tonic-gate 	"Usage:\tupdate_drv [ -f | -v ] <driver_module>\n" \
1377e485317SJerry Gilliam 	"\tupdate_drv [ -b basedir ] [ -f | -v | -n ] -a\n" \
1387c478bd9Sstevel@tonic-gate 		"\t\t[-m 'permission'] [-i 'identify_name']\n" \
1397c478bd9Sstevel@tonic-gate 		"\t\t[-P privilege] [-p 'policy']  <driver_module>\n" \
1407e485317SJerry Gilliam 	"\tupdate_drv [ -b basedir ] [ -f | -v | -n ] -d\n" \
1417c478bd9Sstevel@tonic-gate 		"\t\t[-m 'permission'] [-i 'identify_name']\n" \
1427c478bd9Sstevel@tonic-gate 		"\t\t[-P privilege] [-p 'policy']  <driver_module>\n\n"\
1437c478bd9Sstevel@tonic-gate 	"NOTE: at least one of m/i/P/p must be specified with -a and -d.\n"
1457c478bd9Sstevel@tonic-gate #define	FORCE_UPDATE	"Forcing update of %s.conf.\n"
1467c478bd9Sstevel@tonic-gate #define	ERR_DRVCONF	"Failed to update %s.conf for driver.\n"
1477c478bd9Sstevel@tonic-gate #define	DRVCONF_UPDATED	"%s.conf updated in the kernel.\n"
1487c478bd9Sstevel@tonic-gate #define	NOUPDATE	"%s.conf not updated in the kernel\n"
1507c478bd9Sstevel@tonic-gate /* remdrv messages */
1527e485317SJerry Gilliam #define	REM_USAGE1	\
1537e485317SJerry Gilliam 	"Usage:\n\t rem_drv [ -C ] [ -b <basedir> ] [ -n ] driver_name\n"
1547c478bd9Sstevel@tonic-gate #define	ERR_NO_MAJ	"Cannot get major number for :  %s\n"
1557c478bd9Sstevel@tonic-gate #define	ERR_UNLINK	"Warning: Cannot remove %s from devfs namespace.\n"
1567c478bd9Sstevel@tonic-gate #define	ERR_PIPE	"System error : Cannot create pipe\n"
1577c478bd9Sstevel@tonic-gate #define	ERR_EXEC	"System error : Exec failed\n"
1587c478bd9Sstevel@tonic-gate #define	ERR_DEVFSCLEAN  \
1597c478bd9Sstevel@tonic-gate "Warning: Cannot remove entries from devfs namespace for driver : %s.\n"
1607c478bd9Sstevel@tonic-gate #define	ERR_DEVFSALCLEAN  \
1617c478bd9Sstevel@tonic-gate "Warning: Cannot remove alias entries from devfs namespace for driver : %s .\n"
1627c478bd9Sstevel@tonic-gate #define	ERR_MODID	"Cannot get modid for : (%s)\n"
1637c478bd9Sstevel@tonic-gate #define	ERR_MODUN	\
1647c478bd9Sstevel@tonic-gate 	"Cannot unload module: %s\nWill be unloaded upon reboot.\n"
1657c478bd9Sstevel@tonic-gate #define	ERR_MODREMMAJ	"Cannot remove major number binding for %d\n"
1667c478bd9Sstevel@tonic-gate #define	ERR_NOENTRY	"Cannot find (%s) in file : %s\n"
1687c478bd9Sstevel@tonic-gate /* drvsubr messages */
1697c478bd9Sstevel@tonic-gate #define	ERR_NOFILE	"Warning: (%s) file missing.\n"
1707c478bd9Sstevel@tonic-gate #define	ERR_NO_SPACE	\
1717c478bd9Sstevel@tonic-gate "Can't have space within double quote: %s. \
1727c478bd9Sstevel@tonic-gate Use octal escape sequence \"\\040\".\n"
1747c478bd9Sstevel@tonic-gate #define	ERR_PRIVIMPL	"Cannot get privilege information.\n"
1757c478bd9Sstevel@tonic-gate #define	ERR_BAD_MINOR	"Minor device specification cannot include ``:''.\n"
1767c478bd9Sstevel@tonic-gate #define	ERR_BAD_TOKEN	"Bad policy token: ``%s''.\n"
1777c478bd9Sstevel@tonic-gate #define	ERR_BAD_PRIVS	"Error in privilege set specification: %.*s[HERE->]%s\n"
1787c478bd9Sstevel@tonic-gate #define	ERR_INVALID_PLCY	"Invalid policy specification\n"
1797c478bd9Sstevel@tonic-gate #define	ERR_ONLY_ONE	"Only one policy entry allowed per invocation\n"
1807c478bd9Sstevel@tonic-gate #define	ERR_NO_EQUALS	"Missing equal sign in token ``%s''\n"
1817c478bd9Sstevel@tonic-gate #define	ERR_BAD_PRIV	"Cannot allocate privilege ``%s'': %s\n"
1837c478bd9Sstevel@tonic-gate #define	ERR_UPDATE_PERM		\
1847c478bd9Sstevel@tonic-gate 	"kernel update of permissions for driver %s failed (%d)\n"
1867c478bd9Sstevel@tonic-gate #define	ERR_REMDRV_CLEANUP	\
1877c478bd9Sstevel@tonic-gate 	"post-rem_drv devfs cleanup for driver %s failed (%d)\n"
189f4da9be0Scth #define	ERR_PATH_ORIENTED_ALIAS	\
190f4da9be0Scth 	"no device at specified path-oriented alias \"%s\"\n"
1927c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
1937c478bd9Sstevel@tonic-gate }
1947c478bd9Sstevel@tonic-gate #endif
1967c478bd9Sstevel@tonic-gate #endif	/* _ERRMSG_H */