Update the dkms on redhat instructions
authorMichael Meffie <mmeffie@sinenomine.net>
Wed, 4 Nov 2020 20:49:00 +0000 (15:49 -0500)
committerMichael Meffie <mmeffie@sinenomine.net>
Wed, 4 Nov 2020 20:49:00 +0000 (15:49 -0500)
Bring these instructions up to date for recent versions of Red Hat/CentOS.

admin/RpmClientInstallationWithDKMS.mdwn

index 5ab50a0..52c4986 100644 (file)
@@ -1,73 +1,99 @@
-This page describes how to use the DKMS OpenAFS package to build
-and install an OpenAFS kernel module for your RPM linux based system.
-This may be needed if there is not a pre-built kernel module for your
-platform and/or kernel version. DMKS is a system used to build
-Linux kernel modules which are not included in the maintained
-mainline Linux code.
 
+# Introduction
 
-Configure yum for DKMS
-----------------------
+This page describes how to install the OpenAFS client on RPM-based Linux
+distributions using the Dynamic Kernel Module Support (DKMS) framework. Modules
+installed with DKMS are automatically rebuilt when a new kernel is installed.
 
-yum needs to be configured to install packages from the EPEL (Extra Packages
-for Enterprise Linux) repository so you can install dkms.  You may already have
-yum configured to pull from EPEL. You can check with yum,
+## Setup
 
-     $ yum repolist | grep epel
-     * epel: mirror.cogentco.com
-     epel         Extra Packages for Enterprise Linux 5 - x86_64       enabled: 6,330
+The DKMS system is available in the base system on Fedora systems and is
+available in the 'Extra Packages for Enterprise Linux' (EPEL) on Red Hat
+and CentOS systems.  Add the EPEL repository to your Red Hat/CentOS system
+with:
 
-If you do not have yum configured to use EPEL, then you can add it with an rpm
-command, for example,
+    $ sudo yum install epel-release
 
-    sudo rpm -Uhv http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
+It is recommended to be running a recent kernel release. If the system has just
+been installed, or has not been updated recently, be sure to update the kernel
+release with:
 
-See <http://fedoraproject.org/wiki/EPEL/FAQ#How_can_I_install_the_packages_from_the_EPEL_software_repository>
+    $ sudo yum update kernel
+    $ sudo reboot
 
+Install the kernel development package for your running kernel version:
 
-Configure yum for OpenAFS
--------------------------
+    $ sudo yum install "kernel-devel-uname-r == $(uname -r)"
 
-yum needs to be configured to install openafs packages.  An openafs repository
-configuration is available on dl.openafs.org:
+Be sure you are running a recent kernel version as described above, or you may
+in encounter the error:
 
-     $ sudo rpm -Uvh http://dl.openafs.org/dl/openafs/<version>/openafs-repository-rhel-<version>-1.noarch.rpm
+    No match for argument: kernel-devel-uname-r == <version>
+    Error: Unable to find a match: kernel-devel-uname-r == <version>
 
+If you are installing OpenAFS 1.8.6 or older, ensure the `make` program
+is present before installing the OpenAFS packages.
 
-Kernel Packages
----------------
+    $ sudo yum install make
 
-You will need to have a kernel-devel package which matches your running kernel
-version.  Assuming you want the most recent kernel, you can do this by doing a
-yum update of the kernel and kernel-devel packages. 
 
-    $ sudo yum update kernel kernel-devel
+## OpenAFS RPM package files
 
-You will need to restart your system if the kernel was updated.  To verify you
-have a kernel-devel that matches your kernel version, you can run
+First, you will need to download or build OpenAFS RPM package files, or have
+access to a yum repository which contains the OpenAFS RPM package files.
 
-     $ yum list 'kernel*'
+See [devel/HowToBuildOpenAfsRpmPackages] for instructions on how to build the
+RPM package files.
 
+The following is a yum repo configuration file for a public yum repo of
+prebuilt OpenAFS RPM package files. To use this repository, copy this file to
+`/etc/yum.repos.d/sna-openafs.repo`.
 
-Tools
------
+    [sna-openafs]
+    name=SNA OpenAFS
+    baseurl=https://download.sinenomine.net/openafs/rpms/el$releasever/$basearch
+    enabled=1
+    gpgcheck=0
 
-Install the dkms package and compiler:
 
-     $ sudo yum install dkms gcc make
+## OpenAFS client installation
 
+Install the OpenAFS client with yum (or dnf):
 
-OpenAFS Client
---------------
+    $ sudo yum install openafs openafs-krb5 openafs-doc dkms-openafs
 
-Install the openafs client packages, including the dkms-openafs package to have
-the kernel module built for your kernel version.
+Be sure to install the `openafs` package and the `dkms-openafs` package with a
+single `yum install` invocation.
 
-     $ sudo yum install openafs openafs-krb5 dkms-openafs
+Edit the `/usr/vice/etc/ThisCell` file to configure your cellname.
 
-Startup the client with,
+    $ sudo bash -c 'echo example.com > /usr/vice/etc/ThisCell'
 
-     service openafs-client start
+Edit the `/usr/vice/etc/CellServDB.local` file to configure your AFS database
+locations. The `CellServDB.local` file may be blank if your site uses DNS
+service records (SRV records) to publish the OpenAFS database server addresses.
+Here is an example `CellServDB.local` file to illustrate the file format:
 
+    >example.com         # Example
+    192.168.10.100       # afsdb1.example.com
+    192.168.10.101       # afsdb2.example.com
+    192.168.10.102       # afsdb3.example.com
 
-At this point you should have a working openafs kernel module.
+Start the OpenAFS client with:
+
+    $ sudo systemctl enable openafs-client
+    $ sudo systemctl start openafs-client
+    $ sudo systemctl status openafs-client
+    ...
+    Nov 04 15:20:28 cen8 systemd[1]: Started OpenAFS Client Service.
+    Nov 04 15:20:28 cen8 afsd[113313]: afsd: All AFS daemons started.
+
+The kernel module should be loaded:
+
+    $ lsmod | grep openafs
+    openafs              2830336  2
+
+The AFS filesystem should be mounted:
+
+    $ mount | grep AFS
+    AFS on /afs type afs (rw,relatime)