Bug 219377 - [NEW PORT] sysutils/mac_rtprio :Simple MAC framework policy to manage access for setting realtime priorities by selected GID
Summary: [NEW PORT] sysutils/mac_rtprio :Simple MAC framework policy to manage access ...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Tobias Kortkamp
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-05-18 12:14 UTC by Jov
Modified: 2018-03-12 06:36 UTC (History)
3 users (show)

See Also:


Attachments
new port shar file (1.89 KB, text/plain)
2017-05-18 12:14 UTC, Jov
no flags Details
mac_rtprio.shar (1.86 KB, text/plain)
2017-05-26 06:12 UTC, Jov
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jov 2017-05-18 12:14:05 UTC
Created attachment 182694 [details]
new port shar file

Simple MAC framework policy to manage access for setting realtime priorities by
selected GID.Running kldload mac_rtprio.ko to load the kernel module. The load
action require root permissions. Set GID that should be able to change realtime
priorities: 
    sysctl security.mac.rtprio.gid=1001
and enable enforcing:
    sysctl security.mac.rtprio.enabled=1

WWW: https://github.com/pbiernacki/mac_rtprio
Comment 1 Baptiste Daroussin freebsd_committer freebsd_triage 2017-05-25 21:06:08 UTC
Comment on attachment 182694 [details]
new port shar file

GH_PROJECT is useless
The port should use USES=kmod
Comment 2 Jov 2017-05-26 06:12:01 UTC
Created attachment 182920 [details]
mac_rtprio.shar

GH_PROJECT is useless-----fixed
The port should use USES=kmod-----fixed(the origin has already use this)
Comment 3 Dan MacDonald 2017-07-15 11:22:01 UTC
Hi Jov

Does this module only work with specific kernel versions? I have just built and installed it under TrueOS but when I try loading it, dmesg says:

KLD mac_rtprio.ko: depends on kernel - not available or version mismatch
linker_load_file: /boot/modules/mac_rtprio.ko - unsupported file type
Comment 4 Dan MacDonald 2017-07-15 11:23:13 UTC
uname -a

FreeBSD true76 12.0-CURRENT FreeBSD 12.0-CURRENT #66 ac2f0aa3b(trueos-stable)-dirty: Wed Jun 21 01:09:23 UTC 2017     root@gauntlet:/usr/obj/usr/src/sys/GENERIC  amd64
Comment 5 Jov 2017-07-15 12:43:20 UTC
(In reply to Dan MacDonald from comment #3)
This port does not depend on specific kernel version, but you should sync the /usr/src with your running system before building, or there may be problems.

Also note, I think 12-current may have some problems because when I try to load the tcpmd5 module,it report similar error: "depends on kernel - not available or version mismatch"

This is a test on my FreeBSD-RELEASE11.0:
pkg install ./mac_rtprio-kmod-20170417.txz 
Updating FreeBSD repository catalogue...
Fetching meta.txz: 100%    944 B   0.9kB/s    00:01    
Fetching packagesite.txz: 100%    6 MiB 201.6kB/s    00:30    
Processing entries: 100%
FreeBSD repository update completed. 26597 packages processed.
All repositories are up to date.
Updating database digests format: 100%
Checking integrity... done (0 conflicting)
The following 1 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
	mac_rtprio-kmod: 20170417

Number of packages to be installed: 1

Proceed with this action? [y/N]: y
[1/1] Installing mac_rtprio-kmod-20170417...
Extracting mac_rtprio-kmod-20170417: 100%
root@:/usr/ports/sysutils/mac_rtprio # kldload mac_rtprio
root@:/usr/ports/sysutils/mac_rtprio # kldstat
Id Refs Address            Size     Name
 1  102 0xffffffff80200000 1fa8888  kernel
 2    1 0xffffffff821aa000 30aec0   zfs.ko
 3    2 0xffffffff824b5000 adc0     opensolaris.ko
 4    1 0xffffffff824c0000 21bd0    geom_eli.ko
 5    1 0xffffffff824e3000 b3e8     aesni.ko
...
71    1 0xffffffff82b66000 b2f      mac_rtprio.ko
Comment 6 Dan MacDonald 2017-07-15 12:58:23 UTC
Hi Jov

TrueOS doesn't seem to offer a kernel source package so I cloned the TrueOS freebsd kernel source from https://github.com/trueos/freebsd into /usr/src before I built your module.

Unfortunately re-building the current TrueOS kernel isn't possible right now as I'm told drm-next and bootenvs are broken and the first is the exact reason I'm running TrueOS instead of FreeBSD 12 as it fully supports my Haswell GPU so the kernel source might not align exactly with the kernel I'm running.
Comment 7 commit-hook freebsd_committer freebsd_triage 2018-03-12 06:34:45 UTC
A commit references this bug:

Author: tobik
Date: Mon Mar 12 06:34:18 UTC 2018
New revision: 464219
URL: https://svnweb.freebsd.org/changeset/ports/464219

Log:
  New port: sysutils/mac_rtprio

  Simple MAC framework policy to manage access for setting realtime priorities by
  selected GID.Running kldload mac_rtprio.ko to load the kernel module. The load
  action require root permissions. Set GID that should be able to change realtime
  priorities:
      sysctl security.mac.rtprio.gid=1001
  and enable enforcing:
      sysctl security.mac.rtprio.enabled=1

  WWW: https://github.com/pbiernacki/mac_rtprio

  PR:		219377
  Submitted by:	amutu@amutu.com
  Reviewed by:	bapt

Changes:
  head/sysutils/Makefile
  head/sysutils/mac_rtprio/
  head/sysutils/mac_rtprio/Makefile
  head/sysutils/mac_rtprio/distinfo
  head/sysutils/mac_rtprio/pkg-descr
Comment 8 Tobias Kortkamp freebsd_committer freebsd_triage 2018-03-12 06:36:32 UTC
Committed. Thanks!

Sorry that this took so long.
Comment 9 commit-hook freebsd_committer freebsd_triage 2018-03-12 06:36:49 UTC
A commit references this bug:

Author: tobik
Date: Mon Mar 12 06:35:56 UTC 2018
New revision: 464220
URL: https://svnweb.freebsd.org/changeset/ports/464220

Log:
  sysutils/mac_rtprio: Shorten COMMENT

  PR:		219377

Changes:
  head/sysutils/mac_rtprio/Makefile