################################################################################## # Document: INSTALL_TRIMSLICE.TXT # Purpose : How to install Slackware ARM on the NVidia Tegra systems # including: # CompuLab's TrimSlice Pro # Author : Stuart Winter # For questions and support, please use the Slackware ARM forum # http://www.linuxquestions.org/questions/slackware-arm-108/ # Date : 03-Mar-2015 ################################################################################## # Change Log ############# # 07-Sep-2015 # * Added section 6.0 'Post installation tweaks' # The Trimslice needs longer to obtain an IP via dhcp, so we adjust the time # out period to 70 seconds. # 03-Mar-2015 # * Replaced instances of 'tegra' with 'armv7' since the 'tegra' Kernel was # merged into a generic 'armv7' Kernel after the release of Slackware 14.1. # 06-Dec-2013 # * Removed instructions to login via SSH, as this is no longer necessary - the # installation can be conducted purely through the serial port. # Removed mentions of minicom and Hyperterm as terminal emulators, since the # installer is now only tested using 'screen' under Linux as a terminal emulator. # The settings for minicom and Hyperterm can still be found in # slackwarearm-14.1/INSTALL_TRIMSLICE.txt but note that you may need to work # on getting a good termcap setting to make it work with the 'dialog' menus # in the installer. # # 31-Jul-2013 # * In the Kernel and initrd file names, replace 'tegra' with 'armv7' to support # the new generic ARMv7 kernel package. # # 10-Apr-2013 # * Added 'earlyprintk' to the kernel boot options. This allows displaying of # the kernel boot messages before the console is activated, which is extremely # useful for debugging an unbootable kernel. # * Added U-Boot configuration options which allow booting with 1GB RAM on the # Trimslice using a kernel with FDT: # setenv fdt_high 0x2C000000 # setenv initrd_high 0x2C000000 # # 23-Dec-2012 # * Updated instructions to use DTB (Device Tree Blob) files. # * Added section 0.0 ("U-Boot upgrade"). # * Reverted to 'waitforroot' in the examples because the Kernel pauses for the # duration of 'rootdelay' before mounting the initrd, so the delay ends up being # doubled. This way only the initrd pauses before mounting the root fs. # # 06-Dec-2012 # * Added instructions for a local HTTP installation option. # Thanks to dlachausse on linuxquestions.org. # * Switched the parameter names that control the delay before attempting to mount # the root filesystem, and the root filesystem type: 'rootdelay' 'rootfstype' # respectively. These are the official/documented parameters in the Kernel # documentation. # The original parameters ('rootfs' and 'waitforroot') may still be used. # Thanks to Thorsten Mühlfelder and Richard Lapointe for the suggestion. # # 4-Jul-2012 # * First version ################################################################################### 0.0 U-Boot Firmware Upgrade ----------------------- To boot Slackware ARM's kernels, you __need__ the U-Boot firmware that supports 'DTS' (Device Tree Support / Flattened Device Tree). Browse to the following URL and scroll down to the section entitled 'U-Boot with DTS support': http://www.trimslice.com/wiki/index.php/Trim-Slice_Firmware_Updater 0.1 Downloading the new firmware release ------------------------------------ This document assumes that your system is running TrimSlice U-Boot version "v2012.04-1.02". Versions newer than this release may also work. This version of U-Boot can be downloaded from this URL: http://trimslice.com/download/firmware-updater/v2012.04-1.02/firmware-updater.2012.04-1.02.img.zip 0.2 Applying the firmware update ---------------------------- Please follow the vendor's documented steps to apply the firmware update: http://www.trimslice.com/wiki/index.php/Firmware_Update 0.3 Restoring the Trimslice's U-Boot configuration ---------------------------------------------- Upgrading the firmware will result in resetting all of the previous U-Boot configuration, so you will need to re-configure from scratch by following the instructions below in this section, followed by the instructions in section 5.0 ('Booting the Slackware ARM OS'). The first configuration settings to apply permit booting of Linux 3.7+ using Flattened Device Tree: Trimslice # setenv fdt_high 0x2C000000 Trimslice # setenv initrd_high 0x2C000000 Users who are only upgrading the firmware but not performing a fresh installation of Slackware ARM: `````````````` Please proceed to section 5.0. If you had previously installed Slackware following the instructions exactly, then you can literally paste the configurations from section 5.0 directly in to the U-Boot console. If you customised your setup then you will need to adjust the configuration values accordingly. Users who are performing a fresh installation of Slackware ARM: ``````````````````````````````````````````````````````````````` If you are performing a new/fresh installation of Slackware ARM, then you can follow the document from section 1.0 through to the end. 1.0 Assumptions ----------- Several assumptions -- in the form of IP addresses and directory paths -- are made to help writing the examples for this documentation. These values are easy to modify to suit your environment. Environment: - You have a host machine running an existing Slackware system. Any other Unix/Linux system will suffice, but each Linux distribution is different so you'll have to make some adjustments. This machine will house the Slackware ARM tree, NFS/HTTP & TFTP server. - Your host machine has Internet access, or some method of obtaining the Slackware ARM tree. - You have a secure (you trust the people using it) LAN, on 192.168.1.0/24 - Your host machine has the IP 192.168.1.1 - You can NFS export the Slackware ARM tree, or can run the Python 'SimpleHTTPServer' module within a local copy of the Slackware ARM tree. - You can run a TFTP daemon on your host - You want to use /export to house the Slackware ARM tree. Trimslice system: - This document has been written for the Trimslice Pro unit which has an onboard 40GB SSD. It's assumed that you will be replacing the supplied Ubuntu Linux system with Slackware ARM. Other installation methods may be available for this system, but this document cannot describe them as the author has only experience with the 'Pro' version of the Trimslice. 2.0 Configuring your environment ---------------------------- 2.1 Downloading Slackware ARM -------------------------- Assumptions: [ ] Your current user has read/write/execute access to /export Make the directory that we'll download Slackware ARM into: # mkdir -p /export/slackwarearm # cd /export/slackwarearm Download: The easiest way to download Slackware ARM is to use rsync. # rsync \ --exclude '*/source/*' \ --delete -Pavv \ ftp.arm.slackware.com::slackwarearm/slackwarearm-14.2 . Whilst it is possible to use the FTP or HTTP installation over the Internet, it's recommended to download the full tree first, as in this example, and install from a local NFS export or local HTTP server. This is because if something were to go wrong during the installation, you do not need to download the packages from the Internet again. The full download will be approximately 3GB. You may choose a mirror site - some are listed on the Slackware ARM web page: http://arm.slackware.com 2.2 Setting up the data export service ---------------------------------- Unless you already have an existing NFS configuration set up on your machine, the easiest way to make the Slackware ARM tree available is to run the simple Python-based HTTP server. Choose the most appropriate option for you and setup either an HTTP server or an NFS export, detailed in the two sections below. 2.2.1 HTTP server ----------- On your Slackware host, change into the directory into which you downloaded the Slackware ARM tree, and launch the Python HTTP server: You may wish to start this under 'screen' or at least in another shell - and preferably as a non-root user unless you are on a secure LAN: # cd /export/slackwarearm && python -m SimpleHTTPServer 2.2.2 NFS export ---------- On your Slackware host, add a line similar to the example below: /export/slackwarearm 192.168.1.0/255.255.255.0(ro,nohide,root_squash,sync,no_subtree_check) If you don't have an NFS server already running: # chmod +x /etc/rc.d/{rc.rpc,rc.nfsd} # /etc/rc.d/rc.nfsd restart If you have an NFS server already running: # exportfs -va 2.3 Setting up your TFTP boot server -------------------------------- Slackware ships a tftpd (TFTP boot daemon) in the 'tftp-hpa' package which can be found in the 'n/' package series. Ensure that inetd is running: # chmod +x /etc/rc.d/rc.inetd # /etc/rc.d/rc.inetd restart By default, the line in /etc/inetd.conf that loads the TFTP server is commented out. # tftp dgram udp wait root /usr/sbin/in.tftpd in.tftpd -s /tftpboot -r blksize Uncomment that line. Note: If you want to use a directory other than /tftpboot to house the data, you may do so - but note that the instructions in this document refer to /tftpboot, so please remember to adjust the paths as you go. Cause inetd to re-load its configuration file: # killall -HUP inetd 2.4 Populating the /tftpboot directory ---------------------------------- Assumptions: [ ] Your current user has read/write/execute access to /tftpboot To begin the installation on the Trimslice, we'll boot the Linux Kernel and Initial RAM disk via TFTP. Copy the Kernel and Initial RAM disk images into the tftpboot directory: # mkdir -vpm755 /tftpboot/slackwarearm-14.2 # cd /export/slackwarearm/slackwarearm-14.2/ Copy the Slackware ARM installer: # cp -fav isolinux/uinitrd-armv7.img /tftpboot/slackwarearm-14.2/ The Linux Kernel & the DTB files (Device Tree Blob): # cp -fav kernels/armv7/{uImage*,dtb} /tftpboot/slackwarearm-14.2/ The Initial RAM disk, used for booting the OS after installation (This shouldn't be needed, but it's useful as a fall back in case your system cannot load the OS initrd from the local media for some reason): # cp -fav kernels/armv7/uinitrd* /tftpboot/slackwarearm-14.2/ 3.0 Connecting to the Trimslice via the Serial Port ----------------------------------------------- The Trimslice's serial connection is a standard RS232, and therefore requires no USB serial modules unless your client machine has no RS232 connection and you choose to use an RS232 to USB converter. 1. Configure your terminal software with the following settings: In Slackware you can use 'screen' which provides great terminal emulation and also allows you to connect to the device's serial port: 'screen' in the 'ap' series To use 'screen': # screen -T screen-256color /dev/ttyS0 115200,-crtscts 2. Connect the serial cable that comes with the Trimslice to your PC. 4. Power on the Trimslice. 5. Open the connection to the Trimslice's serial port Example: # screen -T screen-256color /dev/ttyS0 115200,-crtscts 8. You should see the output from the Trimslice appearing in your terminal window. 9. You will see a prompt saying you can press any key to interrupt the boot process. Press ENTER a few times and you will be dropped into the U-Boot console, and sit at the 'Trimslice # ' prompt. 3.1 Configuring the Trimslice ------------------------- 1. Set or request an IP address for the Trimslice: The Trimslice's U-Boot console needs an IP address temporarily to contact the TFTP boot server. If you are running a DHCP server on your network, you may prefer to request an IP address by DHCP. However, after following the instructions here and updating U-Boot, the MAC address of the Trimslice will change - so if you were planning on binding a MAC to an IP address in your /etc/dhcpd.conf, don't just yet! To set an IP statically: Trimslice # setenv ipaddr 192.168.1.20 To request an IP via DHCP: Trimslice # dhcp 2. Set the IP address of the TFTP server: This is the IP address of your Slackware x86 host on which the TFTP daemon runs. Trimslice # setenv serverip 192.168.1.1 3. Allow booting of Linux v3.7+ using Flattened Device Tree (aka 'DTS'): Trimslice # setenv fdt_high 0x2C000000 Trimslice # setenv initrd_high 0x2C000000 4. Save the settings and reboot the device: Trimslice # save ; reset The device will reboot. Press ENTER to stop the automatic boot process. 4.0 Slackware ARM installation -------------------------- Power cycle/reset (as you will have in the previous step) the Trimslice and Interrupt the boot process again by pressing the ENTER Key. 4.1 Booting the installer --------------------- Download the Kernel and Slackware ARM installer via TFTP: Trimslice # tftpboot 0x01100000 slackwarearm-14.2/uinitrd-armv7.img Trimslice # tftpboot 0x00800000 slackwarearm-14.2/uImage-armv7 Download the appropriate Device Tree Blob for your device. For the 'Compulab Trimslice': Trimslice # tftpboot 0x5880000 slackwarearm-14.2/dtb/tegra20-trimslice.dtb Set the initial boot environment, and boot the installer: Trimslice # setenv bootargs earlyprintk TERM=screen-256color console=ttyS0,115200n8 nodhcp kbd=uk root=/dev/ram rw Trimslice # bootm 0x00800000 0x01100000 0x5880000 Notes: [ 1 ] For some unknown reason it takes the author's trimslice a 2nd attempt to perform any sort of network activity - the symptom presenting itself primarily when either downloading a file via TFTP or or requesting a lease from the DHCP server. 4.1.2 Starting the network automatically (most likely preferred option if you are using DHCP) --------------------------------------------------------------------------------------- To save manual effort, you may wish to have the Slackware installer boot and automatically: - have the IP address assigned by DHCP (requires a DHCP server on your network); - start the SSH server This way you can SSH directly to the Trimslice device without any further work via the serial console. However, the serial console support works perfectly in the installer so SSH is just an option if you prefer to use it. To do this, adjust the "bootargs" above (in step 4.1) to be: Trimslice # setenv bootargs earlyprintk TERM=screen-256color console=ttyS0,115200n8 kbd=uk nic=auto:eth0:dhcp root=/dev/ram rw;bootm 0x00800000 0x01100000 0x5880000;reset 4.2 Starting the network manually ----------------------------- If you would rather bring up networking manually, or you do not have a DHCP server on your network, you need to follow this section. Before you can mount the NFS share, you need to setup networking in the installer. # ifconfig eth0 You should see a stanza for eth0. If you have a DHCP server on your network, you can request an IP address by dhcp: # dhcpcd eth0 # ifconfig eth0 Note down the IP address. You can complete the installation via SSH if you wish, or conduct it all via the serial connection that you have open. If you don't have a DHCP server then you need to configure the network address manually: # ifconfig eth0 192.168.1.20 netmask 255.255.255.0 Remember that you'll need to adjust these network settings for your own LAN! 4.3 Begin the setup --------------- Slackware ARM has an identical installer to Slackware x86, so the same tools are available, including fdisk. The installation will be conducted via the serial console. 4.3.1 Partitioning your hard disk --------------------------- You should find your onboard SSD drive identified as /dev/sda. Use the following partitioning scheme: /dev/sda1 - 400MB Linux Swap /dev/sda2 - The remainder of the disk. 'Format' this as ext3 because u-boot can't read ext4 file systems. Note: You can't set an ext2/3 /boot and an ext4 / because there is a problem with the Kernel - random USB resets. You can create the partition table using fdisk or cfdisk. 4.3.2 Start the installer menu ------------------------ Either using the SSH or the serial console session to the Banana Pi, start up the installer menu: # setup The first thing to do is 'ADD SWAP'. Select this menu option and let the installer locate the swap partition and format it. From now on the installer will progress automatically on to the next steps. 4.3.3 Setting up filesystems ---------------------- The Slackware installer will first present a list of available "Linux" type partitions, and ask which one should be the root ('/') partition. If you are following the partition layout as suggested in this document then you should choose /dev/sda2, and format it as ext3. The next step to "Select other Linux partitions for /etc/fstab" 4.3.4 Source media selection ---------------------- Depending upon your choice in section 2.2, you must now choose the corresponding installation source - NFS or HTTP. 4.3.4.1 Installing from an NFS export ----------------------------- Choose menu option '3 - Install from NFS (Network Filesystem)' Enter the IP address: 192.168.1.1 Enter the directory : /export/slackwarearm/slackwarearm-14.2/slackware 4.3.4.2 Installing from an HTTP server ----------------------------- Choose menu option '4 Install from FTP/HTTP server' Enter the URL......: http://192.168.1.1:8000 Enter the directory: /slackware/ 4.3.5 Package selection ----------------- Slackware ARM has all of the Slackware packages apart from those which are x86 only. It's up to you which packages you install, but we recommend a full installation. 4.3.5.1 Choosing an X Window Manager ---------------------------- The Trimslice has an HDMI output, however currently (Linux 3.10.x) the required Kernel graphics driver is not in the kernel.org kernel, thus the Trimslice cannot have graphical output. Whilst KDE does work on the ARM platform, it's not recommended since it's very resource heavy. You can choose any of them, but it's recommended to choose something light weight such as WindowMaker or Fluxbox. 5.0 Booting the Slackware ARM OS ---------------------------- Congratulations! After you've completed the installation of Slackware ARM, you will be prompted to reboot - choose 'Yes'. The Trimslice will now reboot back into the U-Boot console. Once again, interrupt the boot process of the Trimslice, and you'll be dropped into the familiar 'Trimslice #' U-Boot console. We now need to tell the Trimslice how to boot the Operating System. In section 4.3.1 (Partitioning your hard disk), you chose a disk layout and chose which filesystem to use. If you followed the example in this document, you won't need to change anything below. If you chose your own disk layout, here follows an explanation of some of the values contained in the U-Boot configuration below: The first line: root=/dev/sda2 This is where Linux will find its root filesystem ('/'). rootfstype=ext3 The filesystem (e.g. ext2,ext3,ext4,xfs,jfs,reiserfs) used on the root filesystem. Paste these lines (all text after the 'Trimslice # ' prompt) into your Trimslice U-Boot console, adjusting any necessary settings, as described above: TrimSlice # setenv bootargs 'earlyprintk root=/dev/sda2 waitforroot=3 rootfstype=ext3 mem=384M@0M mem=512M@512M nvmem=128M@384M vmalloc=248M video=tegrafb console=ttyS0,115200n8 kgdboc=kms,ttyS0,115200n8' TrimSlice # setenv bootcmd 'run bootcmd_slk ; reset' For the Internal SSD (The TrimSlice has its internal SSD living off a USB host): (you should use this line if your device is a TrimSlice Pro, which is the product that this document is currently aimed at). You need to configure the U-Boot loader to load the appropriate DTB (Device Tree Blob) file: For the 'Compulab Trimslice': TrimSlice # setenv bootcmd_dtb 'ext2load usb 0:2 0x5880000 /boot/dtb/tegra20-trimslice.dtb' Configure the U-Boot loader to load the Kernel and Initial RAM disk: TrimSlice # setenv bootcmd_slk 'usb reset 1;ext2load usb 0:2 0x01100000 /boot/uinitrd-armv7;ext2load usb 0:2 0x00800000 /boot/uImage-armv7;run bootcmd_dtb;bootm 0x00800000 0x01100000 0x5880000' Set standard boot command: TrimSlice # setenv bootcmd 'run bootcmd_slk ; reset' Finally, save the settings and reboot the device: Trimslice # save ; reset The Trimslice will reboot and should begin running the Linux Kernel, and booting into your new Slackware ARM installation. 6.0 Post installation tweaks ------------------------ For an as-yet unknown issue, on the Trimslice it takes over a minute for the dhcpcd client to obtain an IP address. The default time out is set to 12 seconds, so it's recommended that if you will obtain an IP via dhcp that you adjust it to at least 70 seconds: As root paste the following in to the shell (without the leading '#') # sed -i -e 's?12 seconds?70 seconds?g' \ -e 's?\${DHCP_TIMEOUT\[\$i\]:-12\}?\$\{DHCP_TIMEOUT\[\$i\]:-70\}?g' \ /etc/rc.d/rc.inet1 7.0 Final considerations -------------------- The Trimslice Pro's real time clock (RTC) doesn't yet work properly so you might want to consider setting up NTP on the system. 8.0 Help support the Slackware ARM project -------------------------------------- Maintainance of the Slackware ARM port takes not only a lot of time, but also has financial costs such as the on-going use of electricity, Internet hosting and purchasing and maintainance of ARM hardware. Once you find yourself enjoying using the ARM port of Slackware, please take a few moments to show your appreciation by sponsoring either through * A one-off donation: https://paypal.me/armedslack * or (preferably, for this author) a monthly appreciation payment: https://www.patreon.com/armedslack More information on this subject may be found here: http://arm.slackware.com/sponsor 8.1 Helping support the upstream Slackware project ---------------------------------------------- Please consider donating to the parent Slackware project also, developed and maintained by Patrick Volkerding. Without this project, the ARM port of Slackware would, in short order, cease to exist. https://www.patreon.com/slackwarelinux/overview 9.0 Suggestions/alterations ----------------------- If you have any suggestions, recommendations or corrections(!) for this document, please do email me. Thanks! Stuart Winter. -- Stuart Winter mozes@slackware.com