diff options
-rw-r--r-- | sys-kernel/vtty/Manifest | 1 | ||||
-rw-r--r-- | sys-kernel/vtty/files/vtty-tty_operations.patch | 13 | ||||
-rw-r--r-- | sys-kernel/vtty/vtty-0_p20230917.ebuild | 49 |
3 files changed, 63 insertions, 0 deletions
diff --git a/sys-kernel/vtty/Manifest b/sys-kernel/vtty/Manifest new file mode 100644 index 0000000..dff9885 --- /dev/null +++ b/sys-kernel/vtty/Manifest @@ -0,0 +1 @@ +DIST vtty-0_p20230917.tar.gz 19947 BLAKE2B e9c2623828f46625746fe4a436f6a89ba2fedd4d157f07273160a5658d08c351c515da72651fc942c969369fadf267737d6ea46fc83106d825cb208201575540 SHA512 f71f0175bce4756bc8a589aea0e8a75b92ebbf6bf3c276598aac046933621185867f6b449de12e4c79a8a8695522a83511ea9418a941eb8f99c3e58f52a1a98b diff --git a/sys-kernel/vtty/files/vtty-tty_operations.patch b/sys-kernel/vtty/files/vtty-tty_operations.patch new file mode 100644 index 0000000..6974fe0 --- /dev/null +++ b/sys-kernel/vtty/files/vtty-tty_operations.patch @@ -0,0 +1,13 @@ +diff --git a/vtty.c b/vtty.c +index b3c6c65..6aef89a 100644 +--- a/vtty.c ++++ b/vtty.c +@@ -105,7 +105,7 @@ static void vtty_close(struct tty_struct *tty, struct file *filp) + return; + } + +-static int vtty_write(struct tty_struct *tty, const unsigned char *buf, int count) ++static ssize_t vtty_write(struct tty_struct *tty, const u8 *buf, size_t count) + { + // the TTY layer manages -EAGAIN and (non-)blocking writes + struct vtty_port *port = &ports[tty->index]; diff --git a/sys-kernel/vtty/vtty-0_p20230917.ebuild b/sys-kernel/vtty/vtty-0_p20230917.ebuild new file mode 100644 index 0000000..8419b74 --- /dev/null +++ b/sys-kernel/vtty/vtty-0_p20230917.ebuild @@ -0,0 +1,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 +} |