This is a combination of 129 commits: Initial Server Configuration Add Caddy Add Jelly Bucket to Minio Remove Podman DNS Initialize Server Configuration Directory Also replace Minio Pod w/ Nix Derivation Remove Neko/WatchThingz User Configuration (Broken, See Issue) Disable WatchThingz Add cockpit TODO: Add Cockpit Plugins TODO: Add Performance Metrics https://github.com/performancecopilot/pcp Start adding Gitea TODO: Gitea specific postgres config, determine global postgres Add Second Mass Storage Drive Add Gitea in Full Mount Both Data Dirs for Minio Add CUDA to Nvidia Add OCI Based Servers TODO: Organize into server arcitecture Add Secrets Add some nice to have packages Massive Server Upgrade Jelly s3fs mount Stats for things like Minio Usage, Logs etc. VirtualHost & Pod Cleanup Move pod import inot oci services that use them Have services define what virtualhost of caddy they belong to Migrade homeassitant and jellyfin to new dir structure Headscale and static files Directory Reorganization New Module Structure Headscale is public facing Headscale User Generation Module Finish HeadScale PreAuth Module TODO: Activation Script sketch: (Tailscale & Container) Headscale integration Add Local DNS Resolver & Local Domains Add Path to Output of ensureUsers Fix Path Setting Add Services Dir Local Join to Tailnet w/ Auth Gen Togers Uses .tv ... Move networking config Add networking to configuration.nix Update to Brdiged Networking Requirement for nspawn Fix unit definitions Cleanup defs for container support Add Minio Containers to tailnet Disable PostGresql, seems to break things Migrate to LVM Disk Fix not Using Headscale Containers Re-add Nextcloud Re Auth Prometheus for Minio Pretty Graphs Init: pre-office servers Init: pre Pterodactyl server Fix Jelly VPN Disable Grafana for Now Add VaultWarden Add Anki Add GC and Store Optimization Correct Gitea's connection to postgresql Add Vaultwarden, Remove Anki Cleanup User Depsfor Recognize Pterodactyl: Add Nspawn Service Change to Flake System Fix flake path pugs Add Hydra Add Build Machine Wings: Migrate to Nix Directly... or do tun tap. Might do latter Try to get Anki to Work It passes args properly now, but not environment variables Add NAT Passthrough on Ports Disable for now, interferes b/c of NAT Tried to enable actions Nix Serve Cache Hydra DynRun Increase port range Stop Using Pod Patch Hydra Video Group & Patches libnvidia-container ldconfig patch More patching nvidia-podman fix && jellyfin nvidia Nix cache domain Update Flake Container Deployment User & Script Add Handy Helper Deploy-scheme Forgetten Flake Update 2023-03-12 -> 2023-03-21 Update Flake Update Nextcloud 25 -> 26 Update Flake & Nvidia-Podman Update of flake broke nvidia podman, this fixes it, hopefully Latest working version Update Time! Use new Gitea Config Use new Gitea Config, properly Currently borked, need to wait, or go back to earlier working version Working now Updates Change Hydra Port Whoops, Keyboard bad Convert to String Update Time NodeJS InSecure for Now OpenSSL1.1.1t InSecure Disable Hydra Tests More insecure Update and Ethan Basic AudioBookshelf impl Add AudioBookShelf Fix Group Test Env Var Environment Wrong Location Remove TMP Env Config Dir SystemDir: Audiobookshelf Audiobook: getopt ExecStart Args for Env Correct Port Add Domain: AudioBooks Git LFS Hauk Location Tracking TODO: Change domain to whereis.chris.crompton.cc Enable Hauk Correct Hauk Port Flake Update Docker-compat Disable Recognize Setup Nextcloud 26 -> 27 Disable Podman-Nvidia Environment is clouded for some reason™️ (nvidia-container-tools makes a "docker" command visible) OctoPrint & Prusa Samba server Reorganize for Config Merge Move Nvidia Fix to File Migrate to sops-nix servers -> server Remove Old Key Things for Agenix
123 lines
4.8 KiB
Diff
123 lines
4.8 KiB
Diff
diff --git a/src/ldcache.c b/src/ldcache.c
|
|
index 38bab05..14c1893 100644
|
|
--- a/src/ldcache.c
|
|
+++ b/src/ldcache.c
|
|
@@ -108,40 +108,27 @@ ldcache_close(struct ldcache *ctx)
|
|
|
|
int
|
|
ldcache_resolve(struct ldcache *ctx, uint32_t arch, const char *root, const char * const libs[],
|
|
- char *paths[], size_t size, ldcache_select_fn select, void *select_ctx)
|
|
+ char *paths[], size_t size, const char* version)
|
|
{
|
|
char path[PATH_MAX];
|
|
- struct header_libc6 *h;
|
|
- int override;
|
|
+ char dir[PATH_MAX];
|
|
+ char lib[PATH_MAX];
|
|
|
|
- h = (struct header_libc6 *)ctx->ptr;
|
|
memset(paths, 0, size * sizeof(*paths));
|
|
|
|
- for (uint32_t i = 0; i < h->nlibs; ++i) {
|
|
- int32_t flags = h->libs[i].flags;
|
|
- char *key = (char *)ctx->ptr + h->libs[i].key;
|
|
- char *value = (char *)ctx->ptr + h->libs[i].value;
|
|
-
|
|
- if (!(flags & LD_ELF) || (flags & LD_ARCH_MASK) != arch)
|
|
- continue;
|
|
-
|
|
- for (size_t j = 0; j < size; ++j) {
|
|
- if (!str_has_prefix(key, libs[j]))
|
|
- continue;
|
|
- if (path_resolve(ctx->err, path, root, value) < 0)
|
|
- return (-1);
|
|
- if (paths[j] != NULL && str_equal(paths[j], path))
|
|
- continue;
|
|
- if ((override = select(ctx->err, select_ctx, root, paths[j], path)) < 0)
|
|
- return (-1);
|
|
- if (override) {
|
|
- free(paths[j]);
|
|
- paths[j] = xstrdup(ctx->err, path);
|
|
- if (paths[j] == NULL)
|
|
- return (-1);
|
|
- }
|
|
- break;
|
|
- }
|
|
+ for (size_t j = 0; j < size; ++j) {
|
|
+ snprintf(dir, 100, "/run/opengl-driver%s/lib",
|
|
+ arch == LD_I386_LIB32 ? "-32" : "");
|
|
+ if (!strncmp(libs[j], "libvdpau_nvidia.so", 100))
|
|
+ strcat(dir, "/vdpau");
|
|
+ snprintf(lib, 100, "%s/%s.%s", dir, libs[j], version);
|
|
+ if (path_resolve_full(ctx->err, path, "/", lib) < 0)
|
|
+ return (-1);
|
|
+ if (!file_exists(ctx->err, path))
|
|
+ continue;
|
|
+ paths[j] = xstrdup(ctx->err, path);
|
|
+ if (paths[j] == NULL)
|
|
+ return (-1);
|
|
}
|
|
return (0);
|
|
}
|
|
diff --git a/src/ldcache.h b/src/ldcache.h
|
|
index 33d78dd..2b087db 100644
|
|
--- a/src/ldcache.h
|
|
+++ b/src/ldcache.h
|
|
@@ -50,6 +50,6 @@ void ldcache_init(struct ldcache *, struct error *, const char *);
|
|
int ldcache_open(struct ldcache *);
|
|
int ldcache_close(struct ldcache *);
|
|
int ldcache_resolve(struct ldcache *, uint32_t, const char *, const char * const [],
|
|
- char *[], size_t, ldcache_select_fn, void *);
|
|
+ char *[], size_t, const char*);
|
|
|
|
#endif /* HEADER_LDCACHE_H */
|
|
diff --git a/src/nvc_info.c b/src/nvc_info.c
|
|
index 9e27c3c..c227f5b 100644
|
|
--- a/src/nvc_info.c
|
|
+++ b/src/nvc_info.c
|
|
@@ -216,15 +216,13 @@ find_library_paths(struct error *err, struct dxcore_context *dxcore, struct nvc_
|
|
if (path_resolve_full(err, path, root, ldcache) < 0)
|
|
return (-1);
|
|
ldcache_init(&ld, err, path);
|
|
- if (ldcache_open(&ld) < 0)
|
|
- return (-1);
|
|
|
|
info->nlibs = size;
|
|
info->libs = array_new(err, size);
|
|
if (info->libs == NULL)
|
|
goto fail;
|
|
if (ldcache_resolve(&ld, LIB_ARCH, root, libs,
|
|
- info->libs, info->nlibs, select_libraries_fn, info) < 0)
|
|
+ info->libs, info->nlibs, info->nvrm_version) < 0)
|
|
goto fail;
|
|
|
|
info->nlibs32 = size;
|
|
@@ -232,13 +230,11 @@ find_library_paths(struct error *err, struct dxcore_context *dxcore, struct nvc_
|
|
if (info->libs32 == NULL)
|
|
goto fail;
|
|
if (ldcache_resolve(&ld, LIB32_ARCH, root, libs,
|
|
- info->libs32, info->nlibs32, select_libraries_fn, info) < 0)
|
|
+ info->libs32, info->nlibs32, info->nvrm_version) < 0)
|
|
goto fail;
|
|
rv = 0;
|
|
|
|
fail:
|
|
- if (ldcache_close(&ld) < 0)
|
|
- return (-1);
|
|
return (rv);
|
|
}
|
|
|
|
diff --git a/src/nvc_ldcache.c b/src/nvc_ldcache.c
|
|
index db3b2f6..076b4ba 100644
|
|
--- a/src/nvc_ldcache.c
|
|
+++ b/src/nvc_ldcache.c
|
|
@@ -367,7 +367,7 @@ nvc_ldcache_update(struct nvc_context *ctx, const struct nvc_container *cnt)
|
|
if (validate_args(ctx, cnt != NULL) < 0)
|
|
return (-1);
|
|
|
|
- argv = (char * []){cnt->cfg.ldconfig, "-f", "/etc/ld.so.conf", "-C", "/etc/ld.so.cache", cnt->cfg.libs_dir, cnt->cfg.libs32_dir, NULL};
|
|
+ argv = (char * []){cnt->cfg.ldconfig, "-f", "/tmp/ld.so.conf.nvidia-host", "-C", "/tmp/ld.so.cache.nvidia-host", cnt->cfg.libs_dir, cnt->cfg.libs32_dir, NULL};
|
|
if (*argv[0] == '@') {
|
|
/*
|
|
* We treat this path specially to be relative to the host filesystem.
|