Driver Disk Installation Guide for ARC-11XX/ARC12XX/ARC16XX/18XX RAID Controller 
on openSUSE 15.5(kernel 5.14.21-150500.53)
=================================================================================
=================================================================================
Linux SCSI driver technical support 
Mail address: support@areca.com.tw
Web site: www.areca.com.tw
==================================================================================
==================================================================================

**********************************************************************************   
1. Contents									**
**********************************************************************************

readme.txt  - The installation guide of arcsas driver for openSUSE 15.5
arcmsr-opensuse15.5.zip  - Areca Raid driver for system installation
arcmsr-1.51.0X.16-20231226.zip  - arcms driver source code
arcmsr-1.51.00.16-20231226-source-only.dkms.tar.gz - DKMS enabled driver source code
genkey.cfg	- configuration file for generating public and private key pair
public_key.der	- public key for pre-compiled driver arcmsr in .rpm and .ko first time installation

**********************************************************************************
2. SLES system Installation
**********************************************************************************

A. Before Installation
=========================

    Extract arcmsr-opensuse15.5.zip to the top(/) directory of an USB flash drive.
    Copy public_key.der to top(/) directory of the same USB flash drive .
    Give a label to this USB flash drive, said ARECA.

B. Start installation
========================

    openSUSE 15.5 kernel default has supported driver for all Areca Raid controllers except ARC-1688.
    So just following the installation guide to install system to on-board hard drive or Areca Raid volume.
    You can ignore following procedure, except you want to use this udpated driver.

        a. Insert the USB flash drive to the target system.
	
        b. Boot from openSUSE 15.5 DVD installation disc.
	
    For choice legacy DVD drive to install:
    =======================================
        c. Press "F6" select "Yes".

           Move cursor to hightlight "Installation", then press ENTER to install openSUSE.

    For choice UEFI DVD drive to install:
    =======================================
	c. When grub boot menu show up, move cursor to "Installation"
	   type e to edit kernel boot option.

	   At the end of line that include "linuxefi /boot/x86_64/loader/linux" append " dud=1"
	   (double quotation mark are not include).

	   Press F10 to start system installation.


        d. When the message: "Driver Updates Added" show-up, and you can see "arcmsr Driver Update Disk 1",
           press Enter to continue.
	   
        e. When the message: "Please choose the driver update medium" show-up, if 
           you can see all your raid volumes appear on the medium list,
           move cursor to "Back" and press Enter to continue system installation.

           If you can't see the Areca RAID controller or raid volumes, move cursor to
           driver update media and press OK to update driver.

	   
**********************************************************************************
3. Installing arcmsr driver for your System
**********************************************************************************
   If your Linux system can use Areca Raid volume normally, you need not to install driver package.

        Extract arcmsr-opensuse15.5.zip to current directory.
        # cd linux/suse/x86_64-leap15.5/install

        Install driver package.
        # rpm -ivh arcmsr-kmp-default-1.51.0X.16_opensuse15.5_k5.14.21_150500.53-1.x86_64.rpm
	# depmod -a
        # modprobe arcmsr

	To build new init ramdisk with updated arcmsr driver for next boot-up or system boot from Raid volume.
	# cd /boot
	# mv initrd-$(uname -r) initrd-$(uname -r).old				
	# mkinitrd initrd-$(uname -r) $(uname -r)

**********************************************************************************
4. To compile raid driver on an existed system.
**********************************************************************************
   If your Linux system can use Areca Raid volume normally, you need not to compile driver for it.
   If areca pre-build driver(arcmsr-kmp-...) can not fit for your kernel, then you need compile
   driver for it by yourself.
        if your target kernel version is not (uname -r), then replace following
        $(uname -r) by target kernel version

	You must have your Linux system with developmental environment and kernel source,
	in order to build kernel modules.
	When you install kernel-macros, kernel-devel, kernel default-devel, kernel-syms, checking current kernel 
	version by $(uname -r) first. Be sure to install the kernel package corresponding to current kernel version.

	# zypper install kernel-source
	# zypper install kernel-syms
	# zypper install rpm-build

	Unzip arcmsr-1.51.0X.16-20231226.zip to a new directory
	# make KDIR=/lib/modules/$(uname -r)/build

	# cp -f arcmsr.ko /lib/modules/$(uname -r)/kernel/drivers/scsi/arcmsr 
	# depmod -a $(uname -r)
	# insmod arcmsr.ko

	To build new init ramdisk with updated arcmsr driver for next boot-up or system boot from Raid volume.
	# cd /boot
	# mv initrd-$(uname -r) initrd-$(uname -r).old				
	# mkinitrd initrd-$(uname -r) $(uname -r)

**********************************************************************************
5. To install DKMS enabled tarball of arcmsr driver on an existed System.
**********************************************************************************
	You must have your Linux system with developmental environment and kernel source,
	in other words you should select the adequate packages on the menu list during installation.
	If you do not have installed these packages during system installation, you can install 
	kernel-default-devel rpm package from internet.

	Login as root.
	# zypper install kernel-default-devel-5.14.21-150500.53.1.x86_64

	Download DKMS package dkms-<dkmsversion>.noarch.rpm from http://software.opensuse.org/package/dkms or http://linux.dell.com/dkms
	Before using DKMS, you must install DKMS package. You can install dkms as following.
	# rpm -ivh dkms-<dkmsversion>.noarch.rpm
	where <moduleversion> is dkms version could be, e.g., 2.2.0.3_git20141020-2.1

	Copy arcmsr DKMS enabled tarball to home directory.
	In order to load tarball into the DKMS tree, you must use the following command:

	# dkms ldtarball --archive=./arcmsr-<moduleversion>-source-only.dkms.tar.gz
	where <moduleversion> is module version could be, e.g., 1.51.00.16
	arcmsr source code will be added to DKMS tree.
	
	To build arcmsr driver module
	# dkms build -m arcmsr -v <moduleversion>
	
	To install arcmsr driver module
	# dkms install -m arcmsr -v <moduleversion>


	If you are upgrading linux kernel, then you have to install the corresponding kernel-devel-<kernelver>.noarch.rpm before
	reboot your system. 
	# rpm -ivh kernel-devel-<kernelver>.noarch.rpm
	where <kernelver> is kernel version could be, e.g., 5.14.21-150500.53
	
	After installed kernel devel files, DKMS service will build and install arcmsr driver for new kernel automatically.

**********************************************************************************
6. To support Areca thunderbolt device and cable hotplug
**********************************************************************************
	openSUSE 15.5 has native support Areca thunderbolt 2 & 3 devices, ARC-8050T2/T3 series.
	But it needs root user to authorised permission after connect the thunderbolt cable.

	The first time of connection thunderbolt device to system, it may need to authorize the device to system.
	From GNOME Settings->Privacy->Thunderbolt, click the 'connected' but not yet authorized device,
	confirm the 'authorize and connect' to make it 'authorized'.

**********************************************************************************
7. To set driver parameters value
**********************************************************************************
    arcmsr provided driver parameters setting since v1.30.0X.25.
    Multiple Driver parameters can be set at a time.
    e.g. # insmod arcmsr.ko host_can_queue=72 cmd_per_lun=16

    Setting parameter value out of range will be ignored, parameter remain default value.

    a. To list what driver parameter can be set, parameter default value and value range.
       # modinfo arcmsr

    b. To set driver parameter when you manually install driver.
       (This method will be infeasible if your system was boot from areca Raid volume.)
       e.g. to set parameter host_can_queue value to 64
       # sudo rmmod arcmsr
       # sudo insmod /lib/modules/$(uname -r)/kernel/drivers/scsi/arcmsr/arcmsr.ko host_can_queue=64

    c. To set driver parameter during booting from grub menu.
       When grub menu display, use UP and DOWN arrow key to move cursor to booting target.
       Type e to edit, move cursor to end of line that include "linux   /boot/vmlinuz-x.xx.xx ....."
       Append driver parameter to there.(e.g. to set parameter host_can_queue value to 64)

       linux   /boot/vmlinuz-5.14.21-xx..... ... ... quiet arcmsr.host_can_queue=64

    d. To set driver parameter for every boot up.
       e.g. to set parameter host_can_queue value to 64
       # sudo gedit /boot/grub2/grub.cfg
       Append driver parameter setting to end of line that include "linux   /boot/vmlinuz-x.xx.xx ....."

       linux   /boot/vmlinuz-5.14.21-xx..... ... ... quiet arcmsr.host_can_queue=64

    e. To verify parameter setting is correct.
       1. To locate adapter parameter directory
          Find Areca host number:
          # dmesg | grep 'scsi host'
          # cat /sys/class/scsi_host/hostX/proc_name
                where hostX could be host0, host1, ...
          The correct output should be arcmsr. If output is (null), check host_fw_model and host_driver_version.
          # cat /sys/class/scsi_host/hostX/host_fw_model
          # cat /sys/class/scsi_host/hostX/host_driver_version

       2. List host_can_queue value
          #  cat /sys/class/scsi_host/hostX/can_queue

       3. List cmd_per_lun value
          #  cat /sys/class/scsi_host/hostX/cmd_per_lun

       4. List cmd_timeout value
          #  cat /sys/block/sdX/device/cmd_timeout
             where sdX could be sda, sdb, ...
