Revert r447625 which added new port sysutils/chvt

This functionality is available in base using vidcontrol(1)

For example, to switch to the second virtual terminal (/dev/ttyv1):
# vidcontrol </dev/ttyv0 -s 2

Reported by:	jbeich
Requested by:	danfe
This commit is contained in:
Ben Woods 2017-08-09 23:11:58 +00:00
parent c29ab0a9c9
commit 53d1284c69
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=447658
5 changed files with 1 additions and 109 deletions

1
MOVED
View file

@ -9502,3 +9502,4 @@ devel/hs-MonadCatchIO-transformers||2017-08-08|Deprecated in favor of the except
devel/hs-directory||2017-08-08|Part of the bundled packages in ghc
devel/hs-syb-with-class-instances-text||2017-08-08|Upstream is unmaintained
textproc/hs-citeproc-hs||2017-08-08|Upstream is unmaintained, use pandoc-citeproc instead
sysutils/chvt||2017-08-10|Functionality available in base, using vidcontrol(1)

View file

@ -154,7 +154,6 @@
SUBDIR += cfengine38
SUBDIR += cfengine39
SUBDIR += chgrep
SUBDIR += chvt
SUBDIR += chyves
SUBDIR += cinnamon-control-center
SUBDIR += cinnamon-settings-daemon

View file

@ -1,36 +0,0 @@
# Created by: Ben Woods <woodsb02@FreeBSD.org>
# $FreeBSD$
PORTNAME= chvt
PORTVERSION= 0.20091101
CATEGORIES= sysutils
MASTER_SITES= #
DISTFILES= #
MAINTAINER= woodsb02@FreeBSD.org
COMMENT= Change foreground virtual terminal
LICENSE= GNUALLPERMISSIVE
LICENSE_NAME= GNU All-Permissive License
LICENSE_TEXT= See https://www.gnu.org/prep/maintain/html_node/License-Notices-for-Other-Files.html
LICENSE_PERMS= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
PLIST_FILES= bin/chvt
OPTIONS_DEFINE= SETUID
SETUID_DESC= Install setuid binary (does not require root priviledges)
do-extract:
${MKDIR} ${WRKSRC}
# ${CP} ${FILESDIR}/chvt.c ${WRKSRC}/
do-build:
cd ${WRKSRC} && ${CC} -o ${WRKSRC}/chvt ${FILESDIR}/chvt.c
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/chvt ${STAGEDIR}${PREFIX}/bin/chvt
post-install-SETUID-on:
${CHMOD} u+s ${STAGEDIR}${PREFIX}/bin/chvt
.include <bsd.port.mk>

View file

@ -1,68 +0,0 @@
/* chvt.c - change virtual terminal for [k]freebsd
Copyright (C) 2009 Werner Koch
This file is free software; as a special exception the author gives
unlimited permission to copy and/or distribute it, with or without
modifications, as long as this notice is preserved.
This file is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY, to the extent permitted by law; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/consio.h>
#include <errno.h>
int
main (int argc, char **argv)
{
int fd, screen;
if (argc < 1 || argc > 2)
{
fputs ("Usage: chvt [VTNO]\n", stderr);
return 1;
}
if (argc == 2)
{
screen = atoi (argv[1]);
if (screen < 1 || screen > 11)
{
fprintf (stderr, "chvt: invalid screen numver %d\n", screen);
return 1;
}
}
fd = open ("/dev/ttyv0", O_RDWR, 0);
if (fd == -1)
{
fprintf (stderr, "chvt: error opening terminal: %s\n", strerror (errno));
return 1;
}
if (argc == 2)
{
if (ioctl (fd, VT_ACTIVATE, screen))
{
fprintf (stderr, "chvt: VT_ACTIVATE failed: %s\n", strerror (errno));
return 1;
}
}
else
{
if (ioctl (fd, VT_GETACTIVE, &screen))
{
fprintf (stderr, "chvt: VT_GETACTIVE failed: %s\n", strerror (errno));
return 1;
}
printf ("%d\n", screen);
}
return 0;
}

View file

@ -1,4 +0,0 @@
The command chvt N makes /dev/ttyv(N-1) the foreground terminal.
The key combination Ctrl-Alt-FN (with N in the range 1-12) has a similar effect.
WWW: https://lists.debian.org/debian-bsd/2009/11/msg00006.html