Driver Disk Installation Guide for ARC-11XX/ARC12XX/ARC16XX/18XX RAID Controller 
on Ubuntu 17.10.1 i686 and x86_64(kernel 4.13.0-21)
=================================================================================
=================================================================================
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 ARC-11XX/12XX/16XX/18XX driver for Ubuntu
arcmsr-ubuntu-17.10.1.zip	- Areca RAID driver disk for system installation
arcmsr-modules-4.13.0-21-generic.x86_64.deb
arcmsr-modules-4.13.0-21-generic.i386.deb
arcmsr-1.40.00.05-source-only.dkms.tar.gz - DKMS enabled driver source code
arcmsr-1.40.0X.05-20180222.zip	- driver source code

**********************************************************************
2. First time Installation                                 	    **
**********************************************************************

A. Before Installation 

   Extract arcmsr-ubuntu-17.10.1.zip to an USB flash drive.

B. Install ubuntu server

	1) Insert the Areca driver USB flash disk to target system.
	2) Start Ubuntu installation by booting from Ubuntu installation DVD disc.
	3) On the Welcom screen, select "Install Ubuntu Server", then press Enter.
	4) At "Select a language" screen, Press "CTRL+ALT+F2" to switch to console.
	5) Type the following commands:
	   # mkdir /arcmsr /tmp/arcmsr
	   # mount /dev/sda1 /arcmsr
	   # cp -f /arcmsr/* /tmp/arcmsr
	   # umount /arcmsr
	6) Remove the USB flash drive from the USB port and then type:
	   # cd /tmp/arcmsr
	   # ./pre-install.sh
	7) Press "Alt+F1" back to installation screen.
	8) Continue the installation process. 
	9) Do not reboot after the installation is complete. press "Ctrl+Alt+F2" to
	   switch to console 2 and type the following commands:
	   # mkdir /target/tmp/arcmsr
	   # cp /tmp/arcmsr/* /target/tmp/arcmsr
	   # chroot /target
	   # cd /tmp/arcmsr
	   # ./post-install.sh
	   # exit
	10) Press "Alt+F1" to continue. 

C. Install ubuntu Desktop

	1) Insert the Areca driver USB flash disk to target system.
	2) Start Ubuntu installation by booting from Ubuntu installation DVD disc.
	3) On the Ubuntu menu, stay cursor at "Try Ubuntu without installing", then press Enter.
	4) At Ubuntu desktop, open a terminal console.
	5) Type the following commands:
	   # mount
	   Find the driver USB device /dev/sda1 mount point, and unmount it.
	   # sudo mkdir /arcmsr /tmp/arcmsr
	   # sudo mount /dev/sda1 /arcmsr
	   # sudo cp -f /arcmsr/* /tmp/arcmsr
	   # sudo umount /arcmsr
	6) Remove the USB flash drive from the USB port and then type:
	   # cd /tmp/arcmsr
	   # sudo ./pre-install.sh
	7) Click th "Install Ubuntu 17.10" icon, to start Ubuntu system installation.
	8) Do not reboot after the installation is complete.
	   Switch to terminal console and type the following commands:
	   # mkdir /target/tmp/arcmsr
	   # cp /tmp/arcmsr/* /target/tmp/arcmsr
	   # sudo chroot /target
	   # cd /tmp/arcmsr
	   # sudo ./post-install.sh
	   # exit
	9) Now you can restart the system. 

**********************************************************************
3. Installing raid driver on an Existing System	
**********************************************************************

	For x86_64 system:
	# sudo dpkg -i arcmsr-modules-4.13.0-21-generic.x86_64.deb

	For i386, i686 system:
	# sudo dpkg -i arcmsr-modules-4.13.0-21-generic.i386.deb

	# sudo depmod -a
	# sudo update-initramfs -u

	Reboot you system to make arcmsr driver take effect.

**********************************************************************************
4. To install DKMS enabled tarball of arcmsr driver on an Existing System.
**********************************************************************************
	Before using DKMS, you must install DKMS package. You can install dkms as following.
	# sudo apt-get install dkms

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

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


	If you are upgrading linux kernel, then you have to install the corresponding linux-headers-<kernelver> before
	reboot your system. New kernel image can be find in /boot, corresponding new linux header can be find in /usr/src.
	If you can not find new linux header in /usr/src, you can install it as following.
	# sudo apt-get install linux-headers-<kernelver>
	where <kernelver> could be, e.g., 4.13.0-21-generic.
	
	After installed linux header files, DKMS service will build and install arcmsr driver for new kernel automatically.

**********************************************************************************
5. To compile arcmsr driver on an Existing System.
**********************************************************************************
	Unzip arcmsr-1.40.0X.05-20171220.zip to a directory and change to.
	# sudo make
	# sudo cp -f arcmsr.ko /lib/modules/$(uname -r)/kernel/drivers/scsi/arcmsr/
	# sudo depmod -a
	# sudo update-initramfs -u
	# sudo insmod arcmsr.ko

**********************************************************************************
6. To support thunderbolt cable hotplug
**********************************************************************************

You have to install intel tbtadm CLI utility, in order to support thunderbolt cable hotplug.
Before you install tbtadm you have to download the tbtadm package source and build it.

NOTE!!! The tbtadm utility need Linux system kernel 4.13.0 or later.

To build and install tbtadm utility:

0. # sudo apt-get install cmake libboost-filesystem-dev txt2tags pkg-config
1. Download thunderbolt-software-user-space-master.zip from https://github.com/intel/thunderbolt-software-user-space
   (click the pull down menu of "Clone or download", then select 'Download ZIP')
2. Extract thunderbolt-software-user-space-master.zip to home.
3. # cd ~
4. # mkdir build
5. # cd build
6. # sudo cmake ../thunderbolt-software-user-space-master -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr
7. # sudo cmake --build . --target install

Now tbtadm utility was installed.
Following the instruction of readme file on tbtadm package source to make thunderbolt adapter in ACL.
i.e.   # tbtadm approve 0-1

NOTE!!! If you upgrade to Ubuntu higher version or kernel, you may need to remove both thunderbolt-software-user-space-master and build directories.
        And redo above steps 2 to 7 to rebuild and install tbtadm utility, or tbtadm may not work.
