################################################################################## # Document: INSTALL_TEGRA.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 : 31-Jul-2013 ################################################################################## # Change Log ############# # 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. Tegra 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.1 . 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 2.7GB. 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 Tegra unit, 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.1 # cd /export/slackwarearm/slackwarearm-14.1/ Copy the Slackware ARM installer: # cp -fav isolinux/uinitrd-armv7.img /tftpboot/slackwarearm-14.1/ The Linux Kernel & the DTB files (Device Tree Blob): # cp -fav kernels/tegra/{uImage*,dtb} /tftpboot/slackwarearm-14.1/ The Initial RAM disk, used for booting the OS after installation (This shouldn't be needed, but if your SheevaPlug cannot make the USB device 'ready' at the U-Boot console, we still have the option to boot the initrd & Kernel from the network/tftp) # cp -fav kernels/tegra/uinitrd* /tftpboot/slackwarearm-14.1/ 3.0 Connecting to the Tegra system via the Serial Port -------------------------------------------------- The Trimslice system'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 could use these programs which allow terminal emulation to tty: 'minicom' in the 'a/minicom' package 'screen' in the 'ap/screen' package In Windows, you could use the bundled 'HyperTerm' utility but you'd need to download the USB drivers from the Marvell website first. Serial Device: /dev/ttyS0 Baudrate: 115200bps Databits: 8 Parity: None Stopbits: 1 Hardware Flow Control: No Software Flow Control: No Start minicom with the -s switch: # minicom -s Configure the serial settings using the values above. You need to enable linewrap because the lines you'll be pasting into the U-Boot console are very long. Toggle line wrap using: Ctrl-A W To use 'screen': # screen /dev/ttyS0 115200,-crtscts 2. Connect the serial cable that comes with the Tegra system to your PC. 4. Power on the Tegra system unit. 5. Open the connection to the Tegra system serial port Example: # screen /dev/ttyS0 115200,-crtscts 8. You should see the output from the Tegra system 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 Tegra system ----------------------------- 1. Set or request an IP address for the Tegra system: The Tegra system 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 Tegra system 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 Tegra system 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.1/uinitrd-armv7.img Trimslice # tftpboot 0x00800000 slackwarearm-14.1/uImage-armv7 Download the appropriate Device Tree Blob for your device. For the 'Compulab Trimslice': Trimslice # tftpboot 0x5880000 slackwarearm-14.1/dtb/tegra20-trimslice.dtb Set the initial boot environment, and boot the installer: Trimslice # setenv bootargs earlyprintk console=ttyS0,115200n8 nodhcp kbd=uk root=/dev/ram rw Trimslice # bootm 0x00800000 0x01100000 0x5880000 Notes: [ 1 ] The penultimate line above ("setenv bootargs..") sets the keyboard setting to 'uk'. You may choose another such as "us", one one of the other valid keymaps. The installation will be conducted through SSH which uses your local keymap, but you may wish to set this keymap here since you'll need to type a few commands in once the installer has booted. For those of you who are familiar with the Slackware installer, you will note that you will not be presented with the option to select your keymap as soon as the installer has booted. This is because the cursor keys don't work properly in the menus over the serial console; but you can configure it later in the main 'setup' menu. [ 2 ] 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 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 Tegra device without any further work via the serial console. To do this, adjust the "bootargs" above (in step 4.1) to be: Trimslice # setenv bootargs earlyprintk 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'll be SSHing into it soon. 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! Start the SSH server: # /etc/rc.d/rc.dropbear start 4.3 Begin the setup --------------- Slackware ARM has an identical installer to Slackware x86, so the same tools are available, including fdisk. 4.3.1 Connect to the installer via SSH -------------------------------- The easiest way to get Slackware ARM onto a Tegra system is to login to the installer via SSH. On your x86 host PC, ssh into the IP address of the Tegra system: # ssh root@192.168.1.20 Type 'yes' when asked about confirming the identity of the host. Press ENTER when prompted for a password -- there is no password. You will now be logged into the installer running on the Tegra. 4.3.2 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 filesystems. 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.3 Start the installer menu ------------------------ In the SSH terminal window, on the Tegra system's Slackware installer shell, start up the installer menu: # TERM=linux setup The first thing to select is the keymap. Whilst you will probably be using the Tegra remotely, it's worth configuring the keymap for when you do connect via the serial port. From now on the installer will progress automatically on to the next steps. 4.3.4 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.5 Source media selection ---------------------- Depending upon your choice in section 2.2, you must now choose the corresponding installation source - NFS or HTTP. 4.3.5.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.1/slackware 4.3.5.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.6 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.6.1 Choosing an X Window Manager ---------------------------- The Trimslice system 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 should exit the 'setup' menu, drop to the shell and type # reboot Once again, interrupt the boot process of the Tegra, and you'll be dropped into the familiar 'Trimslice #' U-Boot console. We now need to tell the Tegra how to boot the Operating System. In section 4.3.2 (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 Tegra 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 Tegra will reboot and should begin running the Linux Kernel, and booting into your new Slackware ARM installation. 6.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. 7.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 through Paypal and 'ad-clicking'. Please visit the URL below to learn more. http://arm.slackware.com/sponsor The main Slackware project is also funded from donations and media purchases, so please consider donating there also -- without the upstream project, the ARM port would cease to exist: https://store.slackware.com/cgi-bin/store/slackdonation 8.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