summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--usr.sbin/sade/config.c25
-rw-r--r--usr.sbin/sade/menus.c3
-rw-r--r--usr.sbin/sade/sade.h1
-rw-r--r--usr.sbin/sysinstall/config.c25
-rw-r--r--usr.sbin/sysinstall/menus.c3
-rw-r--r--usr.sbin/sysinstall/sysinstall.h1
6 files changed, 58 insertions, 0 deletions
diff --git a/usr.sbin/sade/config.c b/usr.sbin/sade/config.c
index 56ffede..f50c75c 100644
--- a/usr.sbin/sade/config.c
+++ b/usr.sbin/sade/config.c
@@ -1029,3 +1029,28 @@ configNFSServer(dialogMenuItem *self)
}
return DITEM_SUCCESS;
}
+
+int
+configTTYs(dialogMenuItem *self)
+{
+ char cmd[256];
+
+ WINDOW *w = savescr();
+
+ /* Simply prompt for confirmation, then edit away. */
+ if (msgYesNo("Configuration of system TTYs requires editing the /etc/ttys file.\n"
+ "Typical configuration activities might include enabling getty(8)\n"
+ "on the first serial port to allow login via serial console after\n"
+ "reboot, or to enable xdm. The default ttys file enables normal\n"
+ "virtual consoles, and most sites will not need to perform manual\n"
+ "configuration.\n\n"
+ "To load /etc/ttys in the editor, select [Yes], otherwise, [No].")) {
+ } else {
+ sprintf(cmd, "%s /etc/ttys", variable_get(VAR_EDITOR));
+ dialog_clear();
+ systemExecute(cmd);
+ }
+
+ restorescr(w);
+ return DITEM_SUCCESS;
+}
diff --git a/usr.sbin/sade/menus.c b/usr.sbin/sade/menus.c
index 5e3750c..089407e 100644
--- a/usr.sbin/sade/menus.c
+++ b/usr.sbin/sade/menus.c
@@ -270,6 +270,7 @@ DMenu MenuIndex = {
{ " Syscons, Screenmap", "The console screenmap configuration menu.", NULL, dmenuSubmenu, NULL, &MenuSysconsScrnmap },
{ " Syscons, Ttys", "The console terminal type menu.", NULL, dmenuSubmenu, NULL, &MenuSysconsTtys },
{ " Time Zone", "Set the system's time zone.", NULL, dmenuSystemCommand, NULL, "tzsetup" },
+ { " TTYs", "Configure system ttys.", NULL, configTTYs, NULL, "ttys" },
{ " Upgrade", "Upgrade an existing system.", NULL, installUpgrade },
{ " Usage", "Quick start - How to use this menu system.", NULL, dmenuDisplayFile, NULL, "usage" },
{ " User Management", "Add user and group information.", NULL, dmenuSubmenu, NULL, &MenuUsermgmt },
@@ -1248,6 +1249,8 @@ DMenu MenuConfigure = {
NULL, dmenuSubmenu, NULL, &MenuSecurityProfile },
{ " Startup", "Configure system startup options",
NULL, dmenuSubmenu, NULL, &MenuStartup },
+ { " TTYs", "Configure system ttys.",
+ NULL, configTTYs, NULL, "ttys" },
{ " Options", "View/Set various installation options",
NULL, optionsEditor },
{ " XFree86", "Configure XFree86 Server",
diff --git a/usr.sbin/sade/sade.h b/usr.sbin/sade/sade.h
index 14d1b95..721aa00 100644
--- a/usr.sbin/sade/sade.h
+++ b/usr.sbin/sade/sade.h
@@ -455,6 +455,7 @@ extern int configSecurityFascist(dialogMenuItem *self);
extern int configSecurityHigh(dialogMenuItem *self);
extern int configSecurityModerate(dialogMenuItem *self);
extern int configSecurityLiberal(dialogMenuItem *self);
+extern int configTTYs(dialogMenuItem *self);
/* crc.c */
extern int crc(int, unsigned long *, unsigned long *);
diff --git a/usr.sbin/sysinstall/config.c b/usr.sbin/sysinstall/config.c
index 56ffede..f50c75c 100644
--- a/usr.sbin/sysinstall/config.c
+++ b/usr.sbin/sysinstall/config.c
@@ -1029,3 +1029,28 @@ configNFSServer(dialogMenuItem *self)
}
return DITEM_SUCCESS;
}
+
+int
+configTTYs(dialogMenuItem *self)
+{
+ char cmd[256];
+
+ WINDOW *w = savescr();
+
+ /* Simply prompt for confirmation, then edit away. */
+ if (msgYesNo("Configuration of system TTYs requires editing the /etc/ttys file.\n"
+ "Typical configuration activities might include enabling getty(8)\n"
+ "on the first serial port to allow login via serial console after\n"
+ "reboot, or to enable xdm. The default ttys file enables normal\n"
+ "virtual consoles, and most sites will not need to perform manual\n"
+ "configuration.\n\n"
+ "To load /etc/ttys in the editor, select [Yes], otherwise, [No].")) {
+ } else {
+ sprintf(cmd, "%s /etc/ttys", variable_get(VAR_EDITOR));
+ dialog_clear();
+ systemExecute(cmd);
+ }
+
+ restorescr(w);
+ return DITEM_SUCCESS;
+}
diff --git a/usr.sbin/sysinstall/menus.c b/usr.sbin/sysinstall/menus.c
index 5e3750c..089407e 100644
--- a/usr.sbin/sysinstall/menus.c
+++ b/usr.sbin/sysinstall/menus.c
@@ -270,6 +270,7 @@ DMenu MenuIndex = {
{ " Syscons, Screenmap", "The console screenmap configuration menu.", NULL, dmenuSubmenu, NULL, &MenuSysconsScrnmap },
{ " Syscons, Ttys", "The console terminal type menu.", NULL, dmenuSubmenu, NULL, &MenuSysconsTtys },
{ " Time Zone", "Set the system's time zone.", NULL, dmenuSystemCommand, NULL, "tzsetup" },
+ { " TTYs", "Configure system ttys.", NULL, configTTYs, NULL, "ttys" },
{ " Upgrade", "Upgrade an existing system.", NULL, installUpgrade },
{ " Usage", "Quick start - How to use this menu system.", NULL, dmenuDisplayFile, NULL, "usage" },
{ " User Management", "Add user and group information.", NULL, dmenuSubmenu, NULL, &MenuUsermgmt },
@@ -1248,6 +1249,8 @@ DMenu MenuConfigure = {
NULL, dmenuSubmenu, NULL, &MenuSecurityProfile },
{ " Startup", "Configure system startup options",
NULL, dmenuSubmenu, NULL, &MenuStartup },
+ { " TTYs", "Configure system ttys.",
+ NULL, configTTYs, NULL, "ttys" },
{ " Options", "View/Set various installation options",
NULL, optionsEditor },
{ " XFree86", "Configure XFree86 Server",
diff --git a/usr.sbin/sysinstall/sysinstall.h b/usr.sbin/sysinstall/sysinstall.h
index 14d1b95..721aa00 100644
--- a/usr.sbin/sysinstall/sysinstall.h
+++ b/usr.sbin/sysinstall/sysinstall.h
@@ -455,6 +455,7 @@ extern int configSecurityFascist(dialogMenuItem *self);
extern int configSecurityHigh(dialogMenuItem *self);
extern int configSecurityModerate(dialogMenuItem *self);
extern int configSecurityLiberal(dialogMenuItem *self);
+extern int configTTYs(dialogMenuItem *self);
/* crc.c */
extern int crc(int, unsigned long *, unsigned long *);
OpenPOWER on IntegriCloud