Skip to content

Feature request: --destdir option to prefix all install paths #36

@miz060

Description

@miz060

When using nvidia-installer for RPM packaging (i.e., installing files into a buildroot rather than the live system), every prefix option needs to be individually overridden to include the buildroot path:

nvidia-installer \
    --opengl-prefix=$BUILDROOT/usr \
    --x-prefix=$BUILDROOT/usr \
    --utility-prefix=$BUILDROOT/usr \
    --documentation-prefix=$BUILDROOT/usr \
    --xdg-data-dir=$BUILDROOT/usr/share \
    --kernel-install-path=$BUILDROOT/lib/modules/... \
    --systemd-unit-prefix=$BUILDROOT/usr/lib/systemd/system \
    --systemd-sysconf-prefix=$BUILDROOT/etc/systemd/system \
    ...

This is a bit complicated and fragile; if a new file type or prefix is added in a future release, packagers won't know to override it and files will be installed to the live system instead of the buildroot.

It would be very useful to have a single --destdir=/path/to/buildroot option (analogous to make install DESTDIR=...) that prepends to all installation paths. This is the standard mechanism used by autotools, CMake, Meson, etc. for staged installs.

Additionally, symlink targets created by the installer currently use the full prefixed path (e.g., the GBM backend symlink nvidia-drm_gbm.so ends up pointing to $BUILDROOT/usr/lib64/libnvidia-allocator.so.1 instead of ../libnvidia-allocator.so.1). A proper --destdir implementation would separate the install root from the runtime path and construct correct symlink targets.

Related: #20 raised the same use case (installing to a build folder for packaging). It was closed after --skip-module-load was added, which solved the module loading issue but not the lack of a single install root prefix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions