summaryrefslogtreecommitdiff
path: root/sys-kernel/vtty/vtty-0_p20230917.ebuild
blob: 8419b74a5c842227a319cd02afafe0edd04bd0fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8
inherit linux-mod-r1 udev

DESCRIPTION="Virtual serial port kernel module"
HOMEPAGE="https://github.com/anszom/vtty"
COMMIT="49f3fb0ba5f062771d06182d24c2b525e4b67dea"
SRC_URI="https://github.com/anszom/vtty/archive/${COMMIT}.tar.gz -> ${P}.tar.gz"
S="${WORKDIR}/${PN}-${COMMIT}"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64"

RDEPEND="virtual/udev"
DEPEND="${RDEPEND}"

PATCHES=(
	"${FILESDIR}"/vtty-tty_operations.patch
)

src_compile() {
	local modlist=( vtty )
	local modargs=( KDIR="${KV_OUT_DIR}" )

	linux-mod-r1_src_compile
}

src_install() {
	linux-mod-r1_src_install

	udev_newrules - 69-vtty.rules <<-EOF
		# do not edit this file, it will be overwritten on update
		#
		KERNEL=="vtmx", SUBSYSTEM=="misc", TAG+="uaccess"
		KERNEL=="ttyV[0-9]*", SUBSYSTEM=="tty", TAG+="uaccess"
	EOF
}

pkg_postinst() {
	linux-mod-r1_pkg_postinst
	udev_reload
}

pkg_postrm() {
	udev_reload
}