Skip to content
This repository has been archived by the owner on Oct 17, 2021. It is now read-only.

Distribution-agnostic installer #111

Closed
Samsagax opened this issue Sep 29, 2011 · 13 comments
Closed

Distribution-agnostic installer #111

Samsagax opened this issue Sep 29, 2011 · 13 comments

Comments

@Samsagax
Copy link
Member

This is highly needed, why? because currently there is no way that any user that uses any distribution other than Ubuntu or ArchLinux can install Bumblebee without tweaking the installer (and I mean, a lot!)

We need to eliminate all distribution related stuff gradually. There are some steps like the configure one that can't be "eliminated", but fortunately those steps can be supplied by packagers (and is the recommended way to install it, anyway).

So, let's take a more "configure-make-install" approach:

configure step (precheck and setting variables):

  • Check for VirtualGL present (how is to be discussed, but shouldn't be hard checking some files/libraries)
  • Check for BOTH cards to be present (getting the PCI of both for example)
  • Set all paths, should accept arguments like --prefix=/usr/ --configdir=/etc/ to change that paths. Is not hard to implement with the current installer, there is almost all done.
  • All variables will be stored in a file that will be sourced by the installer.

"make" step (build files and install in the configured paths):

  • build the files (like the current buildfiles stage)
  • copy the files (copyfiles stage)

The post configuration should be left to the user. Just before start complaining about that: That should be done by packagers! This is a way to make the installer distro-agnostic and even more flexible to package for new unsupported distributions. Remember that this installer shouldn't be used by users directly, unless he/she want's to test something crazy on his/her machine.

Opinions are most welcome

@Lekensteyn
Copy link
Member

For VGL, I'd check /opt/VirtualGL which is the official path. If that fails, we can fallback to searching vglrun in /usr/local/bin and /usr/bin (I doubt /bin ever contains such binaries, so I did not include that).

You're probably right on pre- and post-configuration (i.e. fixing OpenGL on the Intel display), if we create an INSTALL file documentating that, Bumblebee would be better usable for other distros.

@Samsagax
Copy link
Member Author

Samsagax commented Oct 3, 2011

Ohh... BTW this would eventually deprecate all installer-related branches, and should make all distro-dev branches obsolete. So please any distribution-specific developers take a look at this branch: common-agnostic-installer and add as many options as you need (providing some "safe" defaults or leaving empty for error check)

This installer is intended to be configurable to the bone and targeted to package makers. For user usage there should be a documentation about each option, clear enough so any user can use it from cli.

Samsagax added a commit that referenced this issue Oct 4, 2011
  - First attempt of a functional agnostic installer for GH-#111

WARNING: Sanity check is still not reliable, use with caution and set ALL
  variables via command line. The help message is outdated and should be
  updated soon
@Samsagax
Copy link
Member Author

Samsagax commented Oct 4, 2011

Well the installer is "usable" at minimum. ALL VARIABLES MUST BE SET!!!

The sanity check is not reliable yet. Needs to be improved. And the variables doesn't have any default.

@Samsagax
Copy link
Member Author

Samsagax commented Oct 4, 2011

Ok, just to clarify some things: This installer won't check for dependencies (yet). Is intended to be a helper on package and to be easily portable to any distro.

Here are some examples on usage (in the future all *.new files should be renamed):

For ArchLinux this installer should be used:

./configure \
        --driver=nouveau \
        --initdir=etc/rc.d \
        --prefix= \
        --usrdir="/usr" \
        --initdir="/etc/rc.d"
./install.new

@Lekensteyn
Copy link
Member

--prefix should be /usr (by default /usr/local) and --usrdir removed. Do not confuse --prefix with DESTDIR, the former is visible in the "compiled" files, the latter isn't.

@Samsagax
Copy link
Member Author

Samsagax commented Oct 4, 2011

@Lekensteyn: Ok I'll do the refactor.

@Samsagax
Copy link
Member Author

There is a problem with the default directories setting. I've tested on a box and they point relative to root in the configuration instead of the prefix (like LIBDIR).

The DESTDIR is not set. And there is no way to set it in the configuration, nor make.

I'll check that later

@Samsagax
Copy link
Member Author

Well, thanks to @Lekensteyn the installer is in a usable (yet not by everyone, not fail-safe) state:

Pre-installation steps

Some things must be there for Bumblebee to work, all of this are left to the packager:

  • Check for a (working) installation of VirtualGL (or whatever backend to support remote application run)
  • Check for drivers and binaries to be installed properly.
  • Check for the main X server to be run over the intel card with 3D acceleration (that means, the nvidia driver not messing mesa drivers). Such paths to make the second X server to run with nvidia drivers are passed to the configure script with xorg-module-path and nv-lib-path/nv-lib32-path variables.

Install

The installer has two steps, configure for the distribution (where you set paths and destinations) and installation through make install:

Example configure:

./configure --driver=nouveau --prefix=/usr --confdir=/etc

That would generate this configuration:

# autogenerated at Tue, 25 Oct 2011 14:17:18 -0300 by ./configure
BUMBLEBEE_VERSION := 2.4.1~git701a873

BINDIR      := /usr/bin
SBINDIR     := /usr/sbin
CONFDIR     := /etc/bumblebee
LIBDIR      := /usr/lib/bumblebee
INITDIR     := 
BUILDDIR    := .build
XORG_MODULEPATH := 
NV_LIBPATH  := 
NV_LIB32PATH    := 

DRIVERS     := nouveau
NVIDIABUSID := 01:00:0

Then you can install it with make.

Example installation for packagers:

To install Bumblebee for packaging (and for system wide too) use make install DESTDIR=<pkgdir>

That will build the files according to the configuration variables, and copy all files to <pkgdir>.

Post-installation steps

  • Configure NVIDIABUSID in the bumblebee xorg.conf files. Such task is easy and you can use the current code in the old installer to do that. As is a user/machine specific task, this must be done by packagers.
  • Install a daemon handler and register it to be launched at start. The default handler is not installed but this is an advantage to provide the packagers with a way to provide their own handler scripts. Then you must regster the daemon to be launched at start by the system. If no handler is written for your distro then you can use the default.

Things yet to improve

The current configuration script needs some cleaning:

  • Removal of NVIDIABUSID variable as is needed at post-install only.
  • Removal of INITDIR variable as it's left to the packager side to provide a daemon handler
  • Add an entry to install documentation, default configuration files (full and properly commented), the default handler script and any stuff needed under PREFIX/share/bumblebee as a resource location. Add the options to the configure script as well to override that location.
  • Sanity check on the configuration script to check whether the variables passed are correct, specially for nvidia stuff (that's always problematic).

@Lekensteyn
Copy link
Member

Tasks:

  • Removal of NVIDIABUSID: done
  • Removal of INITDIR: done

Adding to the post-installation script todo:

  • Create group bumblebee
  • Detect NVIDIABUSID (lookup in commit history)

To do:

  • Example post-installation script which can be used by users directly (e.g. on their homebrew distro)
  • Document library stuff (the dependency installer on the fedora-dev is a good example for the nvidia drivers installation which does not break the primary X server)
  • Document the library paths (XORG_MODULEPATH and NV_LIB*PATH

...

Samsagax added a commit that referenced this issue Nov 2, 2011
…-installer should remain until fully deprecation and removal of the former installer

* common-agnostic-installer: (69 commits)
  Makefile: use configured files for installation
  Makefile: create DATADIR if it does not exist
  Makefile: Install DATADIR
  Fix wrong default value for DATADIR
  .gitattributes: expand the commit hash in configure
  configure: add DATADIR support (PREFIX/share/bumblebee)
  configure: remove obsolete detect_busid call
  Make configure executable and remove obsolete installer files (*.new)
  configure: Remove INITDIR-related stuff
  configure: Remove NVIDIABUSID-related stuff
  Makefile: use customized xorg.conf.$driver
  Removed initdir check, passed along to post-installation steps
  Makefile: Do not fail if $driver.options does not exist
  Makefile: check for missing directories in $DESTDIR/.., not /..
  configure: Fix incomplete LIBDIR and CONFDIR, missing $PREFIX
  configure: xorg module path validation should look for nvidia_drv.so
  Makefile changes to fit driver.options build
  Set nvidia variables in configuration script.
  Build the file LIB/drivers/nvidia.options paths
  Created agnostic LIB/drivers/nvidia.options
  ...
@Samsagax
Copy link
Member Author

Samsagax commented Nov 3, 2011

Well I made bumblebee-git package for ArchLinux to use the new installation method and works great actually.

This will deprecate the entire common-checdependencies branch and should do the same with fedora-dev and opensuse-dev too. Developers please make packages using the new method so we can deprecate and eventually remove the former installer

@Lekensteyn
Copy link
Member

The ubuntu packages on testing are built with the new installer as well. Let's keep it for a few weeks so maintainers who rely on a branch instead of a tag are able to update their build script.

@Samsagax
Copy link
Member Author

Samsagax commented Nov 4, 2011

Deleting the common-checkdependencies branch as it is utterly outdated and now it has no relevance

@Lekensteyn
Copy link
Member

Obsolete with BB3.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants