xref: /onnv-gate/usr/src/cmd/modload/errmsg.h (revision 10842:e5e88c478ff5)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
52805Seota  * Common Development and Distribution License (the "License").
62805Seota  * You may not use this file except in compliance with the License.
70Sstevel@tonic-gate  *
80Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate  * See the License for the specific language governing permissions
110Sstevel@tonic-gate  * and limitations under the License.
120Sstevel@tonic-gate  *
130Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate  *
190Sstevel@tonic-gate  * CDDL HEADER END
200Sstevel@tonic-gate  */
210Sstevel@tonic-gate /*
228565SJerry.Gilliam@Sun.COM  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
230Sstevel@tonic-gate  * Use is subject to license terms.
240Sstevel@tonic-gate  */
250Sstevel@tonic-gate 
260Sstevel@tonic-gate #ifndef	_ERRMSG_H
270Sstevel@tonic-gate #define	_ERRMSG_H
280Sstevel@tonic-gate 
290Sstevel@tonic-gate #ifdef	__cplusplus
300Sstevel@tonic-gate extern "C" {
310Sstevel@tonic-gate #endif
320Sstevel@tonic-gate 
330Sstevel@tonic-gate /* text for gettext error messages for adddrv.c and remdrv.c */
340Sstevel@tonic-gate 
350Sstevel@tonic-gate #define	USAGE	"Usage:\n"\
360Sstevel@tonic-gate "	add_drv [ -m '<permission> ','<...>' ]\n"\
370Sstevel@tonic-gate "		[ -n ]\n"\
380Sstevel@tonic-gate "		[ -f ]\n"\
390Sstevel@tonic-gate "		[ -v ]\n"\
400Sstevel@tonic-gate "		[ -i '<identify_name  <...>' ] \n"\
410Sstevel@tonic-gate "		[ -b <basedir> ]\n"\
420Sstevel@tonic-gate "		[ -c <class_name> ]\n"\
430Sstevel@tonic-gate "		[ -p <dev_policy> ]\n"\
440Sstevel@tonic-gate "		<driver_module>\n"\
450Sstevel@tonic-gate "Example:\n"\
460Sstevel@tonic-gate "	add_drv -m '* 0666 bin bin' -i 'acme,sd new,sd' sd \n"\
470Sstevel@tonic-gate "	Add 'sd' drive with identify names: acme,sd and new,sd.\n"\
480Sstevel@tonic-gate "	Every minor node will have the permission 0666,\n"\
490Sstevel@tonic-gate "	and be owned by bin with group bin.\n"
500Sstevel@tonic-gate 
510Sstevel@tonic-gate #define	BOOT_CLIENT	"Reboot client to install driver.\n"
520Sstevel@tonic-gate #define	DRIVER_INSTALLED	"Driver (%s) installed.\n"
530Sstevel@tonic-gate 
540Sstevel@tonic-gate #define	ERR_INSTALL_FAIL	"Error: Could not install driver (%s).\n"
550Sstevel@tonic-gate #define	ERR_DRVNAME_TOO_LONG	"Error: driver name must not exceed (%d)" \
560Sstevel@tonic-gate " characters; driver name too long (%s)\n"
574145Scth #define	ERR_ALIAS_IN_NAM_MAJ	\
584145Scth "Alias (\"%s\") already in use as driver name.\n"
594145Scth #define	ERR_ALIAS_IN_USE	\
604145Scth "(\"%s\") already in use as a driver or alias.\n"
610Sstevel@tonic-gate #define	ERR_CANT_ACCESS_FILE	"Cannot access file (%s).\n"
620Sstevel@tonic-gate #define	ERR_BAD_PATH	"Bad syntax for pathname : (%s)\n"
630Sstevel@tonic-gate #define	ERR_FORK_FAIL	"Fork failed; cannot exec : %s\n"
640Sstevel@tonic-gate #define	ERR_PROG_IN_USE	"add_drv/rem_drv currently busy; try later\n"
650Sstevel@tonic-gate #define	ERR_NOT_ROOT	"You must be root to run this program.\n"
6610585SDhanaraj.M@Sun.COM #define	ERR_NOT_GLOBAL_ZONE	\
6710585SDhanaraj.M@Sun.COM "add_drv/rem_drv can only be run from the global zone.\n"
680Sstevel@tonic-gate #define	ERR_BAD_LINE	"Bad line in file %s : %s\n"
690Sstevel@tonic-gate #define	ERR_CANNOT_OPEN	"Cannot open (%s): %s.\n"
700Sstevel@tonic-gate #define	ERR_MIS_TOK	"Option (%s) : missing token: (%s)\n"
712805Seota #define	ERR_BAD_TOK	"Option (%s) : bad token: (%s)\n"
720Sstevel@tonic-gate #define	ERR_TOO_MANY_ARGS	"Option (%s) : too many arguments: (%s)\n"
730Sstevel@tonic-gate #define	ERR_BAD_MODE	"Bad mode: (%s)\n"
740Sstevel@tonic-gate #define	ERR_CANT_OPEN	"Cannot open (%s)\n"
750Sstevel@tonic-gate #define	ERR_NO_UPDATE	"Cannot update (%s)\n"
760Sstevel@tonic-gate #define	ERR_CANT_RM	"Cannot remove temporary file (%s); remove by hand.\n"
770Sstevel@tonic-gate #define	ERR_BAD_LINK	"(%s) exists as (%s); Please rename by hand.\n"
780Sstevel@tonic-gate #define	ERR_NO_MEM		"Not enough memory\n"
790Sstevel@tonic-gate #define	ERR_DEL_ENTRY	"Cannot delete entry for driver (%s) from file (%s).\n"
800Sstevel@tonic-gate #define	ERR_NO_ENTRY	"No entry found for driver (%s) in file (%s).\n"
818831SJerry.Gilliam@Sun.COM #define	ERR_DEV_IN_USE	"One or more devices remain in use for driver %s.\n"
820Sstevel@tonic-gate #define	ERR_INT_UPDATE	"Internal error updating (%s).\n"
830Sstevel@tonic-gate #define	ERR_NOMOD	"Cannot find module (%s).\n"
840Sstevel@tonic-gate #define	ERR_MAX_MAJOR	"Cannot get major device information.\n"
850Sstevel@tonic-gate #define	ERR_NO_FREE_MAJOR	"No available major numbers.\n"
860Sstevel@tonic-gate #define	ERR_NOT_UNIQUE	"Driver (%s) is already installed.\n"
870Sstevel@tonic-gate #define	ERR_NOT_INSTALLED "Driver (%s) not installed.\n"
888831SJerry.Gilliam@Sun.COM #define	ERR_ALIAS_NOT_BOUND "Alias not bound to driver %s.\n"
890Sstevel@tonic-gate #define	ERR_UPDATE	"Cannot update (%s).\n"
900Sstevel@tonic-gate #define	ERR_MAX_EXCEEDS "Major number (%d) exceeds maximum (%d).\n"
910Sstevel@tonic-gate #define	ERR_NO_CLEAN	"Cannot update; check file %s and rem_drv %s by hand.\n"
920Sstevel@tonic-gate #define	ERR_CONFIG	\
930Sstevel@tonic-gate "Warning: Driver (%s) successfully added to system but failed to attach\n"
940Sstevel@tonic-gate #define	ERR_DEVTREE	\
950Sstevel@tonic-gate "Warning: Unable to check for driver configuration conflicts.\n"
960Sstevel@tonic-gate #define	ERR_MODPATH	"System error: Could not get module path.\n"
970Sstevel@tonic-gate #define	ERR_BAD_MAJNUM	\
980Sstevel@tonic-gate "Warning: Major number (%d) inconsistent with /etc/name_to_major file.\n"
990Sstevel@tonic-gate #define	ERR_MAJ_TOOBIG	"Warning: Entry '%s %llu' in %s has a major number " \
1000Sstevel@tonic-gate 			"larger\nthan the maximum allowed value %u.\n"
1013442Svikram 
1023442Svikram #define	ERR_CREAT_LOCK	"Failed to create lock file(%s): %s\n"
10310599SJerry.Gilliam@Sun.COM #define	ERR_STAT_LOCK	"Failed to stat lock file(%s): %s\n"
1043442Svikram #define	ERR_LOCK	"Failed to lock the lock file(%s): %s\n"
1053442Svikram #define	ERR_UNLOCK	"Failed to unlock the lock file(%s): %s\n"
10610599SJerry.Gilliam@Sun.COM #define	ERR_OWNER_LOCK	"Lock file(%s) not owned by user\n"
1070Sstevel@tonic-gate 
1080Sstevel@tonic-gate #define	ERR_LOCATION	\
1090Sstevel@tonic-gate "Warning: %s-bit version of driver found at %s.\n"
1100Sstevel@tonic-gate #define	ERR_ISA_MISMATCH	"No %s-bit version of (%s) found; %s-bit " \
1110Sstevel@tonic-gate 				"version of this driver exists.\n"
1120Sstevel@tonic-gate #define	ERR_NOT_LOADABLE	\
1130Sstevel@tonic-gate "%s-bit driver (%s) not loadable on %s-bit kernel.\n"
1140Sstevel@tonic-gate #define	ERR_ELF_VERSION "ELF library out of date : %s. \n"
1150Sstevel@tonic-gate #define	ERR_ELF_KIND	"The file (%s) is not in ELF format.\n"
1160Sstevel@tonic-gate #define	ERR_KERNEL_ISA	"Could not identify kernel's ISA. \n"
1170Sstevel@tonic-gate #define	ERR_CONFIG_NOLOAD	\
1180Sstevel@tonic-gate "System configuration files modified but %s driver not loaded or attached.\n"
1190Sstevel@tonic-gate #define	ERR_SOL_LOCATION	\
1200Sstevel@tonic-gate "Place (%s) driver in correct location and run devfsadm -i %s.\n"
1210Sstevel@tonic-gate #define	ERR_ARCH_NOT_SUPPORTED	"Architecture %s not supported by add_drv.\n"
1220Sstevel@tonic-gate #define	ERR_SYSINFO_ARCH	"Failed to identify system architecture.\n"
1230Sstevel@tonic-gate #define	ERR_PATH_SPEC	"Error: driver may not be specified by path (%s)\n"
1240Sstevel@tonic-gate #define	ERR_CREATE_RECONFIG	"Error: Could not create /reconfigure.\n"
1250Sstevel@tonic-gate 
126*10842SJerry.Gilliam@Sun.COM #define	INFO_UPDATE_ONLY	\
127*10842SJerry.Gilliam@Sun.COM "System updated but %s driver not yet configured.\n"
128*10842SJerry.Gilliam@Sun.COM 
1290Sstevel@tonic-gate /* update_drv messages */
1300Sstevel@tonic-gate #define	UPD_DRV_USAGE	\
1310Sstevel@tonic-gate 	"Usage:\tupdate_drv [ -f | -v ] <driver_module>\n" \
1328565SJerry.Gilliam@Sun.COM 	"\tupdate_drv [ -b basedir ] [ -f | -v | -n ] -a\n" \
1330Sstevel@tonic-gate 		"\t\t[-m 'permission'] [-i 'identify_name']\n" \
1340Sstevel@tonic-gate 		"\t\t[-P privilege] [-p 'policy']  <driver_module>\n" \
1358565SJerry.Gilliam@Sun.COM 	"\tupdate_drv [ -b basedir ] [ -f | -v | -n ] -d\n" \
1360Sstevel@tonic-gate 		"\t\t[-m 'permission'] [-i 'identify_name']\n" \
1370Sstevel@tonic-gate 		"\t\t[-P privilege] [-p 'policy']  <driver_module>\n\n"\
1380Sstevel@tonic-gate 	"NOTE: at least one of m/i/P/p must be specified with -a and -d.\n"
1390Sstevel@tonic-gate 
1400Sstevel@tonic-gate #define	FORCE_UPDATE	"Forcing update of %s.conf.\n"
1410Sstevel@tonic-gate #define	ERR_DRVCONF	"Failed to update %s.conf for driver.\n"
1420Sstevel@tonic-gate #define	DRVCONF_UPDATED	"%s.conf updated in the kernel.\n"
1430Sstevel@tonic-gate #define	NOUPDATE	"%s.conf not updated in the kernel\n"
1440Sstevel@tonic-gate 
1450Sstevel@tonic-gate /* remdrv messages */
1460Sstevel@tonic-gate 
1478565SJerry.Gilliam@Sun.COM #define	REM_USAGE1	\
1488565SJerry.Gilliam@Sun.COM 	"Usage:\n\t rem_drv [ -C ] [ -b <basedir> ] [ -n ] driver_name\n"
1490Sstevel@tonic-gate #define	ERR_NO_MAJ	"Cannot get major number for :  %s\n"
1500Sstevel@tonic-gate #define	ERR_UNLINK	"Warning: Cannot remove %s from devfs namespace.\n"
1510Sstevel@tonic-gate #define	ERR_PIPE	"System error : Cannot create pipe\n"
1520Sstevel@tonic-gate #define	ERR_EXEC	"System error : Exec failed\n"
1530Sstevel@tonic-gate #define	ERR_DEVFSCLEAN  \
1540Sstevel@tonic-gate "Warning: Cannot remove entries from devfs namespace for driver : %s.\n"
1550Sstevel@tonic-gate #define	ERR_DEVFSALCLEAN  \
1560Sstevel@tonic-gate "Warning: Cannot remove alias entries from devfs namespace for driver : %s .\n"
1570Sstevel@tonic-gate #define	ERR_MODID	"Cannot get modid for : (%s)\n"
1580Sstevel@tonic-gate #define	ERR_MODUN	\
1590Sstevel@tonic-gate 	"Cannot unload module: %s\nWill be unloaded upon reboot.\n"
1600Sstevel@tonic-gate #define	ERR_MODREMMAJ	"Cannot remove major number binding for %d\n"
1610Sstevel@tonic-gate #define	ERR_NOENTRY	"Cannot find (%s) in file : %s\n"
1620Sstevel@tonic-gate 
1630Sstevel@tonic-gate /* drvsubr messages */
1640Sstevel@tonic-gate #define	ERR_NOFILE	"Warning: (%s) file missing.\n"
1650Sstevel@tonic-gate #define	ERR_NO_SPACE	\
1660Sstevel@tonic-gate "Can't have space within double quote: %s. \
1670Sstevel@tonic-gate Use octal escape sequence \"\\040\".\n"
1680Sstevel@tonic-gate 
1690Sstevel@tonic-gate #define	ERR_PRIVIMPL	"Cannot get privilege information.\n"
1700Sstevel@tonic-gate #define	ERR_BAD_MINOR	"Minor device specification cannot include ``:''.\n"
1710Sstevel@tonic-gate #define	ERR_BAD_TOKEN	"Bad policy token: ``%s''.\n"
1720Sstevel@tonic-gate #define	ERR_BAD_PRIVS	"Error in privilege set specification: %.*s[HERE->]%s\n"
1730Sstevel@tonic-gate #define	ERR_INVALID_PLCY	"Invalid policy specification\n"
1740Sstevel@tonic-gate #define	ERR_ONLY_ONE	"Only one policy entry allowed per invocation\n"
1750Sstevel@tonic-gate #define	ERR_NO_EQUALS	"Missing equal sign in token ``%s''\n"
1760Sstevel@tonic-gate #define	ERR_BAD_PRIV	"Cannot allocate privilege ``%s'': %s\n"
1770Sstevel@tonic-gate 
1780Sstevel@tonic-gate #define	ERR_UPDATE_PERM		\
1790Sstevel@tonic-gate 	"kernel update of permissions for driver %s failed (%d)\n"
1800Sstevel@tonic-gate 
1810Sstevel@tonic-gate #define	ERR_REMDRV_CLEANUP	\
1820Sstevel@tonic-gate 	"post-rem_drv devfs cleanup for driver %s failed (%d)\n"
1830Sstevel@tonic-gate 
1844145Scth #define	ERR_PATH_ORIENTED_ALIAS	\
1854145Scth 	"no device at specified path-oriented alias \"%s\"\n"
1864145Scth 
1870Sstevel@tonic-gate #ifdef	__cplusplus
1880Sstevel@tonic-gate }
1890Sstevel@tonic-gate #endif
1900Sstevel@tonic-gate 
1910Sstevel@tonic-gate #endif	/* _ERRMSG_H */
192