-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
freebsd: various new packages to support a NixBSD system #320475
Merged
Merged
Changes from all commits
Commits
Show all changes
65 commits
Select commit
Hold shift + click to select a range
77177e3
freebsd.sysctl: init
rhelmot c171489
freebsd.top: init
rhelmot b51604a
freebsd.mount: init
rhelmot 27b9567
freebsd.nscd: init
rhelmot d942e3f
freebsd.pwd_mkdb: init
rhelmot c9b08ff
freebsd.getent: init
rhelmot a20e099
freebsd.getty: init
rhelmot 7ada439
freebsd.cap_mkdb: init
rhelmot 6e52c40
freebsd.libpam: init
rhelmot 4fdc9f9
freebsd.libbsm: init
rhelmot d58f00e
freebsd.libradius: init
rhelmot b85f78b
freebsd.login: init
rhelmot 95bed7c
freebsd.rc: init
rhelmot a25eb64
freebsd.rcorder: init
rhelmot 22a4ba4
freebsd.protect: init
rhelmot f80a34d
freebsd.id: init
rhelmot c94a2a2
freebsd.limits: init
rhelmot 54f1777
freebsd.mount_msdosfs: init
rhelmot 8479282
freebsd.libkiconv: init
rhelmot 80e3eca
freebsd.route: init
rhelmot 9f84814
freebsd.ifconfig: init
rhelmot a03b493
freebsd.lib80211: init
rhelmot 64e36d5
freebsd.libbsdxml: init
rhelmot cc86fcb
freebsd.libifconfig: init
rhelmot b9f1c7e
freebsd.newsyslog: init
rhelmot 70236c2
freebsd.daemon: init
rhelmot f3c9e4a
freebsd.shutdown: init
rhelmot 1185d75
freebsd.syslogd: init
rhelmot 352259d
freebsd.services_mkdb: init
rhelmot 7627bc4
freebsd.truss: init
rhelmot 901f831
freebsd.libsysdecode: init
rhelmot 06d2cdb
freebsd.bsdlabel: init
rhelmot afee073
freebsd.libgeom: init
rhelmot 57cc0fb
freebsd.devfs: init
rhelmot 16cad24
freebsd.dmesg: init
rhelmot cbc6f47
freebsd.fdisk: init
rhelmot 39fe4cf
freebsd.geom: init
rhelmot 20cf5fb
freebsd.libufs: init
rhelmot d7fc1a6
freebsd.kldconfig: init
rhelmot e310298
freebsd.kldload: init
rhelmot d542659
freebsd.kldstat: init
rhelmot 15a263f
freebsd.kldunload: init
rhelmot 2b7f6d3
freebsd.mdconfig: init
rhelmot 256fe4a
freebsd.newfs: init
rhelmot 55c787a
freebsd.newfs_msdos: init
rhelmot a46e74f
freebsd.ping: init
rhelmot 4b76aee
freebsd.libipsec: init
rhelmot e87b4f2
freebsd.reboot: init
rhelmot 2da43c3
freebsd.swapon: init
rhelmot 8330c89
freebsd.zfs: init
rhelmot be96ca6
freebsd.zfs-data: init
rhelmot d651bd6
freebsd.libzfs: init
rhelmot bf35a20
freebsd.fsck: init
rhelmot 9fa145f
freebsd.drm-kmod: init
rhelmot 693bccf
freebsd.drm-kmod-firmware: init
rhelmot 8fd9a80
freebsd.bintrans: init
rhelmot 37f5de0
freebsd.init: init
rhelmot 6acde4a
freebsd.stand-efi: init
rhelmot d8eef12
freebsd.vtfontcvt: init
rhelmot f413ee7
freebsd.makefs: init
rhelmot 256f8ff
freebsd.mkimg: init
rhelmot 94880ca
freebsd.stat: disable tests
rhelmot 8cd6273
freebsd: move filterPatches into freebsd-lib
rhelmot f0097d1
freebsd.sys: make patched source visible, fix build
rhelmot e589fdb
chore: Remove `with lib` from various freebsd packages
rhelmot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
pkgs/os-specific/bsd/freebsd/patches/14.0/libifconfig-no-internal.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
diff --git a/lib/libifconfig/Makefile b/lib/libifconfig/Makefile | ||
index 6bdb202bec1d..ebc626901cfc 100644 | ||
--- a/lib/libifconfig/Makefile | ||
+++ b/lib/libifconfig/Makefile | ||
@@ -1,7 +1,6 @@ | ||
|
||
PACKAGE= lib${LIB} | ||
LIB= ifconfig | ||
-INTERNALLIB= true | ||
|
||
LIBADD= m | ||
|
||
@@ -36,8 +35,8 @@ SRCS+= ${GEN} | ||
CLEANFILES+= ${GEN} | ||
|
||
# If libifconfig become public uncomment those two lines | ||
-#INCSDIR= ${INCLUDEDIR} | ||
-#INCS= libifconfig.h libifconfig_sfp.h libifconfig_sfp_tables.h | ||
+INCSDIR= ${INCLUDEDIR} | ||
+INCS= libifconfig.h libifconfig_sfp.h libifconfig_sfp_tables.h | ||
|
||
#MAN= libifconfig.3 | ||
|
||
diff --git a/lib/libifconfig/Symbol.map b/lib/libifconfig/Symbol.map | ||
index 2d80fb31652a..8b08947112e5 100644 | ||
--- a/lib/libifconfig/Symbol.map | ||
+++ b/lib/libifconfig/Symbol.map | ||
@@ -2,6 +2,8 @@ FBSD_1.6 { | ||
ifconfig_bridge_get_bridge_status; | ||
ifconfig_bridge_free_bridge_status; | ||
ifconfig_carp_get_info; | ||
+ ifconfig_carp_get_vhid; | ||
+ ifconfig_carp_set_info; | ||
ifconfig_close; | ||
ifconfig_create_interface; | ||
ifconfig_create_interface_vlan; |
18 changes: 18 additions & 0 deletions
18
pkgs/os-specific/bsd/freebsd/patches/14.0/mount-use-path.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
diff --git a/sbin/mount/mount.c b/sbin/mount/mount.c | ||
index 2fcc94e40818..7de6da1bb20e 100644 | ||
--- a/sbin/mount/mount.c | ||
+++ b/sbin/mount/mount.c | ||
@@ -155,12 +155,9 @@ exec_mountprog(const char *name, const char *execname, char *const argv[]) | ||
EXIT(1); | ||
case 0: /* Child. */ | ||
/* Go find an executable. */ | ||
- execvP(execname, _PATH_SYSPATH, argv); | ||
+ execvp(execname, argv); | ||
if (errno == ENOENT) { | ||
xo_warn("exec %s not found", execname); | ||
- if (execname[0] != '/') { | ||
- xo_warnx("in path: %s", _PATH_SYSPATH); | ||
- } | ||
} | ||
EXIT(1); | ||
default: /* Parent. */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
diff --git a/libexec/rc/rc b/libexec/rc/rc | ||
index 0ea61a4b2c0a..d9bfb228224c 100644 | ||
--- a/libexec/rc/rc | ||
+++ b/libexec/rc/rc | ||
@@ -87,6 +87,12 @@ if ! [ -e ${firstboot_sentinel} ]; then | ||
skip_firstboot="-s firstboot" | ||
fi | ||
|
||
+if [ -z "$USER_LOGIN" ]; then | ||
+ skip="$skip -s user" | ||
+else | ||
+ skip="$skip -k user" | ||
+fi | ||
+ | ||
# Do a first pass to get everything up to $early_late_divider so that | ||
# we can do a second pass that includes $local_startup directories | ||
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ mkDerivation }: | ||
mkDerivation { | ||
path = "usr.bin/bintrans"; | ||
MK_TESTS = "no"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ mkDerivation, libgeom }: | ||
mkDerivation { | ||
path = "sbin/bsdlabel"; | ||
extraPaths = [ "sys/geom" ]; | ||
buildInputs = [ libgeom ]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ mkDerivation }: | ||
mkDerivation { | ||
path = "usr.bin/cap_mkdb"; | ||
|
||
MK_TESTS = "no"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ mkDerivation }: | ||
mkDerivation { | ||
path = "usr.sbin/daemon"; | ||
MK_TESTS = "no"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ mkDerivation }: | ||
mkDerivation { | ||
path = "sbin/devfs"; | ||
|
||
# These config files are mostly examples and not super useful | ||
# in nixbsd | ||
postPatch = '' | ||
sed -i 's/^CONFS=.*$//' $BSDSRCDIR/sbin/devfs/Makefile | ||
''; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ mkDerivation, lib }: | ||
mkDerivation { | ||
path = "sbin/dmesg"; | ||
|
||
meta.platforms = lib.platforms.freebsd; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
{ | ||
lib, | ||
mkDerivation, | ||
fetchFromGitHub, | ||
buildFreebsd, | ||
sys, | ||
withAmd ? true, | ||
withIntel ? true, | ||
}: | ||
mkDerivation rec { | ||
pname = | ||
"drm-kmod-firmware" + lib.optionalString withAmd "-amd" + lib.optionalString withIntel "-intel"; | ||
|
||
version = "20230625_8"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "freebsd"; | ||
repo = "drm-kmod-firmware"; | ||
rev = version; | ||
hash = "sha256-Ly9B0zf+YODel/X1sZYVVUVWh38faNLhkcXcjEnQwII="; | ||
}; | ||
|
||
extraNativeBuildInputs = [ buildFreebsd.xargs-j ]; | ||
|
||
hardeningDisable = [ | ||
"pic" # generates relocations the linker can't handle | ||
"stackprotector" # generates stack protection for the function generating the stack canary | ||
]; | ||
|
||
# hardeningDisable = stackprotector doesn't seem to be enough, put it in cflags too | ||
NIX_CFLAGS_COMPILE = "-fno-stack-protector"; | ||
|
||
KMODS = | ||
lib.optional withIntel "i915kmsfw" | ||
++ lib.optionals withAmd [ | ||
"amdgpukmsfw" | ||
"radeonkmsfw" | ||
]; | ||
|
||
env = sys.passthru.env; | ||
SYSDIR = "${sys.src}/sys"; | ||
|
||
KMODDIR = "${builtins.placeholder "out"}/kernel"; | ||
|
||
meta = { | ||
description = "GPU firmware for FreeBSD drm-kmod"; | ||
platforms = lib.platforms.freebsd; | ||
license = | ||
lib.optional withAmd lib.licenses.unfreeRedistributableFirmware | ||
# Intel license prohibits modification. this will wrap firmware files in an ELF | ||
++ lib.optional withIntel lib.licenses.unfree; | ||
sourceProvenance = [ lib.sourceTypes.binaryFirmware ]; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
{ | ||
lib, | ||
mkDerivation, | ||
fetchFromGitHub, | ||
xargs-j, | ||
versionData, | ||
sys, | ||
}: | ||
let | ||
# Based off ports tree versions | ||
reldate = lib.toIntBase10 versionData.reldate; | ||
branch = | ||
if reldate >= 1500008 then | ||
"6.1-lts" | ||
else if reldate >= 1400097 then | ||
"5.15-lts" | ||
else if reldate >= 1302000 then | ||
"5.10-lts" | ||
else | ||
throw "drm-kmod not supported on FreeBSD version ${reldate}"; | ||
|
||
fetchOptions = (lib.importJSON ./versions.json).${branch}; | ||
in | ||
mkDerivation { | ||
pname = "drm-kmod"; | ||
version = branch; | ||
|
||
src = fetchFromGitHub fetchOptions; | ||
|
||
extraNativeBuildInputs = [ xargs-j ]; | ||
|
||
hardeningDisable = [ | ||
"pic" # generates relocations the linker can't handle | ||
"stackprotector" # generates stack protection for the function generating the stack canary | ||
]; | ||
|
||
# hardeningDisable = stackprotector doesn't seem to be enough, put it in cflags too | ||
NIX_CFLAGS_COMPILE = "-fno-stack-protector"; | ||
|
||
env = sys.passthru.env; | ||
SYSDIR = "${sys.src}/sys"; | ||
|
||
KMODDIR = "${builtins.placeholder "out"}/kernel"; | ||
|
||
meta = { | ||
description = "Linux drm driver, ported to FreeBSD"; | ||
platforms = lib.platforms.freebsd; | ||
license = with lib.licenses; [ | ||
bsd2 | ||
gpl2Only | ||
]; | ||
}; | ||
} | ||
rhelmot marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/usr/bin/env nix-shell | ||
#!nix-shell -i python -p python3 nix-prefetch-github git | ||
|
||
import subprocess | ||
import json | ||
import os.path | ||
|
||
BRANCHES = ["5.10-lts", "5.15-lts", "6.1-lts"] | ||
BASE_DIR = os.path.dirname(os.path.abspath(__file__)) | ||
|
||
versions = dict() | ||
|
||
for branch in BRANCHES: | ||
text = subprocess.check_output( | ||
["nix-prefetch-github", "freebsd", "drm-kmod", "--rev", branch, "--json"] | ||
).decode("utf-8") | ||
versions[branch] = json.loads(text) | ||
|
||
with open(os.path.join(BASE_DIR, "versions.json"), "w") as out: | ||
json.dump(versions, out, sort_keys=True, indent=2) | ||
out.write("\n") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"5.10-lts": { | ||
"hash": "sha256-6v8FhaEch9fJfo0/1UXeo0bcZh5n4Y2TyAsyHmCBJgw=", | ||
"owner": "freebsd", | ||
"repo": "drm-kmod", | ||
"rev": "e7950546196d44af502dd6abf162d1453f6f0dd0" | ||
}, | ||
"5.15-lts": { | ||
"hash": "sha256-i768QfnYo2hqxnoCEnfYqOurDSRwkAsC4qsP7TUalxc=", | ||
"owner": "freebsd", | ||
"repo": "drm-kmod", | ||
"rev": "d7dc64fb8e63208afaca01e6d48284aa2305df35" | ||
}, | ||
"6.1-lts": { | ||
"hash": "sha256-+CsqQ0beJgoO3SSWzwLcAO8JP15oaDW9HR+bxwPaan4=", | ||
"owner": "freebsd", | ||
"repo": "drm-kmod", | ||
"rev": "f2d6d4b58446fa45de575bae76d6435439b3ca8b" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ mkDerivation, libgeom }: | ||
mkDerivation { | ||
path = "sbin/fdisk"; | ||
|
||
buildInputs = [ libgeom ]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ mkDerivation }: | ||
mkDerivation { | ||
path = "sbin/fsck"; | ||
extraPaths = [ "sbin/mount" ]; | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is too long. Can it be at least documented?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does need documentation, but do note it is just being moved. I would be OK with that happening in a later PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added an overview.