From nobody Mon Oct 03 17:09:27 2022 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Mh6kv4rqfz4dhxN; Mon, 3 Oct 2022 17:09:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Mh6kv4H2xz3Tg3; Mon, 3 Oct 2022 17:09:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1664816967; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kmnQxnKApZYRnbSnXM3+Ez+kH+/+2iyaYCL9BV47VGQ=; b=H50Xj+aavgA0hXsm4WpDHju2vnxKjsYamwTbe+T8TMkF8yzfBXpxmsYtlIJoH8QHJACpq0 BqdgGJ0poq1Sir9Hggp/Gw5Df05eALbzfDuPfKFjqDQ9/3U3DkTAu3CsIldzDoBozR1YJu RNzb53Tp1McwD8916pnrsgr3GYXTI5ZLc1cOgeipjMmBQV33HG9/zqHeXuYIM7PMOS5yWY BWNXTwOIpGg7V+5I+I2I/iXTfc4MdEKYgJUOIZYO0xd9+i4MHjMRzcufPWYUEtqFaiB5H6 gCWEuRrJHU80Rn32CHbXg/ulFCKAQMezE0754Dswy1ny6tUfC9QA+0K2wgWFCQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Mh6kv38C6zGsx; Mon, 3 Oct 2022 17:09:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 293H9RVQ098359; Mon, 3 Oct 2022 17:09:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 293H9RRX098358; Mon, 3 Oct 2022 17:09:27 GMT (envelope-from git) Date: Mon, 3 Oct 2022 17:09:27 GMT Message-Id: <202210031709.293H9RRX098358@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Luca Pizzamiglio Subject: git: 7ddec062787b - main - sysutils/devctl-jail-kmod: new port List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pizzamig X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7ddec062787b2ef2443e540d0b56489bb1fffc0c Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1664816967; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kmnQxnKApZYRnbSnXM3+Ez+kH+/+2iyaYCL9BV47VGQ=; b=nc1Nws06bLMMPBZ6S4O3eHF4UijJcjxKy0LvAs6FAbwdTKQCF/pwZ0t5WWDiB/MKnAyjkp SFqHBCRu4OL3GyRmNnyfIZcbkEoOwqDUnWLZUS5FczVPNA5PFZzrJP9lHw0GyLR4Yu6Dua w6qUGEbWx0CIM3L5+rMzvlycSikJAOhJNya8eJ8CXnH7Fz8OVFa+mFoqU26uDx4YQvEWvB R73iyXV07kf5dIe5RkIImvhr5TIPSIWFvgN6xhIO7gmm5hgLWJx+q/VoG4qi07TBqD9NKW XDqzhoQcf68WGZ1xKsbNp8iyHpeLrHkTiAMM9/1ijcmCd/LM34l1zoosp4Rr9g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1664816967; a=rsa-sha256; cv=none; b=Nj7xS9DVU6rgKUaXPB/1mAuho36nMHdgeY7vX/KvXCK0l4bsSWvVxzVC3I9fnntpc/NUvf 9emHqJIF/3i0+0J3oaXqoH4x16CTILhvNPw2vmNdgZza6Vpt1UzNi5qs/zSkT1iMN1OO07 7df3Hol8eQkVm+pFuFLh2ntrYtwopT/iZpkd42LzFVTd3/qZX5Rqmg3VYVe6RZVWSSCPXn HaR5wyqJOrnFacLrjbSiHFbzrJoWrOR7fo1lFhSvrSNUlgs1XAWIUghrGOUmRrrVoY2PWU l93y+iuoFTPCvmtoOwCq8VuARa5gQFaYl87tYgv2ZjhN5iDpgxdEeU24axO18A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by pizzamig: URL: https://cgit.FreeBSD.org/ports/commit/?id=7ddec062787b2ef2443e540d0b56489bb1fffc0c commit 7ddec062787b2ef2443e540d0b56489bb1fffc0c Author: Luca Pizzamiglio AuthorDate: 2022-10-03 17:04:42 +0000 Commit: Luca Pizzamiglio CommitDate: 2022-10-03 17:08:45 +0000 sysutils/devctl-jail-kmod: new port This kernel module provides jails status changes in devctl, and available to devd Initial non working draft Fix include order for 13+ Fix category's makefile Remove devctl_notify_f that has been removed in later version The flag used is the default one, so we are not introducing different behaviors --- sysutils/Makefile | 1 + sysutils/devctl-jail-kmod/Makefile | 19 ++++++++ sysutils/devctl-jail-kmod/distinfo | 3 ++ .../devctl-jail-kmod/files/patch-devctl__jail.c | 50 ++++++++++++++++++++++ sysutils/devctl-jail-kmod/pkg-descr | 3 ++ 5 files changed, 76 insertions(+) diff --git a/sysutils/Makefile b/sysutils/Makefile index 3f425b3abc91..a262a1a51746 100644 --- a/sysutils/Makefile +++ b/sysutils/Makefile @@ -263,6 +263,7 @@ SUBDIR += deltup SUBDIR += desktop-installer SUBDIR += detox + SUBDIR += devctl-jail-kmod SUBDIR += devcpu-data SUBDIR += devcpu-data-amd SUBDIR += devcpu-data-intel diff --git a/sysutils/devctl-jail-kmod/Makefile b/sysutils/devctl-jail-kmod/Makefile new file mode 100644 index 000000000000..09ad9bc79b7f --- /dev/null +++ b/sysutils/devctl-jail-kmod/Makefile @@ -0,0 +1,19 @@ +PORTNAME= devctl-jail-kmod +DISTVERSION= g20190521 +CATEGORIES= sysutils + +MAINTAINER= pizzamig@FreeBSD.org +COMMENT= Module to expose jail lifecycle events + +LICENSE= BSD3CLAUSE +LICENSE_FILE= ${WRKSRC}/LICENSE + +USES= kmod uidfix +USE_GITHUB= yes +GH_ACCOUNT= fubarnetes +GH_PROJECT= kmod_devctl_jail +GH_TAGNAME= d3c17d2381a + +PLIST_FILES= ${KMODDIR}/devctl_jail.ko + +.include diff --git a/sysutils/devctl-jail-kmod/distinfo b/sysutils/devctl-jail-kmod/distinfo new file mode 100644 index 000000000000..4885e795e88b --- /dev/null +++ b/sysutils/devctl-jail-kmod/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1663582453 +SHA256 (fubarnetes-kmod_devctl_jail-g20190521-d3c17d2381a_GH0.tar.gz) = 6ad5e1a8cfd4704499be29c5881ac41817220ba0cd51521ed2e9f9054afbbcfb +SIZE (fubarnetes-kmod_devctl_jail-g20190521-d3c17d2381a_GH0.tar.gz) = 4187 diff --git a/sysutils/devctl-jail-kmod/files/patch-devctl__jail.c b/sysutils/devctl-jail-kmod/files/patch-devctl__jail.c new file mode 100644 index 000000000000..969cbc22a0ef --- /dev/null +++ b/sysutils/devctl-jail-kmod/files/patch-devctl__jail.c @@ -0,0 +1,50 @@ +--- devctl_jail.c.orig 2019-05-21 13:00:05 UTC ++++ devctl_jail.c +@@ -34,10 +34,10 @@ + + #include + #include ++#include /* defines used in kernel.h */ + #include + #include /* uprintf */ + #include +-#include /* defines used in kernel.h */ + #include /* types used in module initialization */ + #include + #include +@@ -73,7 +73,7 @@ devctl_jail_prison_create(void *obj, void *data __unus + sbuf_new(&sb, buf, DEVCTL_JAIL_LOGSIZE, SBUF_FIXEDLEN); + sbuf_printf(&sb, "jid=%d", pr->pr_id); + sbuf_finish(&sb); +- devctl_notify_f("kernel", "jail", "created", sbuf_data(&sb), M_NOWAIT); ++ devctl_notify("kernel", "jail", "created", sbuf_data(&sb)); + sbuf_delete(&sb); + free(buf, M_DEVCTL_JAIL); + return (0); +@@ -117,7 +117,7 @@ devctl_jail_prison_set(void *obj, void *data) + } + + sbuf_finish(&sb); +- devctl_notify_f("kernel", "jail", "updated", sbuf_data(&sb), M_NOWAIT); ++ devctl_notify("kernel", "jail", "updated", sbuf_data(&sb)); + sbuf_delete(&sb); + free(buf, M_DEVCTL_JAIL); + return (0); +@@ -143,7 +143,7 @@ devctl_jail_prison_remove(void *obj, void *data __unus + sbuf_new(&sb, buf, DEVCTL_JAIL_LOGSIZE, SBUF_FIXEDLEN); + sbuf_printf(&sb, "jid=%d", pr->pr_id); + sbuf_finish(&sb); +- devctl_notify_f("kernel", "jail", "removed", sbuf_data(&sb), M_NOWAIT); ++ devctl_notify("kernel", "jail", "removed", sbuf_data(&sb)); + sbuf_delete(&sb); + free(buf, M_DEVCTL_JAIL); + return (0); +@@ -165,7 +165,7 @@ devctl_jail_prison_attach(void *obj, void *data __unus + sbuf_new(&sb, buf, DEVCTL_JAIL_LOGSIZE, SBUF_FIXEDLEN); + sbuf_printf(&sb, "jid=%d pid=%d", pr->pr_id, td->td_proc->p_pid); + sbuf_finish(&sb); +- devctl_notify_f("kernel", "jail", "attached", sbuf_data(&sb), M_NOWAIT); ++ devctl_notify("kernel", "jail", "attached", sbuf_data(&sb)); + sbuf_delete(&sb); + free(buf, M_DEVCTL_JAIL); + return (0); diff --git a/sysutils/devctl-jail-kmod/pkg-descr b/sysutils/devctl-jail-kmod/pkg-descr new file mode 100644 index 000000000000..0e99d254bd02 --- /dev/null +++ b/sysutils/devctl-jail-kmod/pkg-descr @@ -0,0 +1,3 @@ +Kernel mdule providing dectl notifications for jails +Jails event like start and stop can be notified via devd. +Devd acions can be added to send messages to syslogd