################################################################################## # 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 : 4-Jul-2012 ################################################################################## 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 & 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 - 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 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.2 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 TFP 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.3 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.0 . Download speed will depend on the bandwidth speed of your Internet connection. Whilst it is possible to use the FTP installation inside the installer, it's recommended to download the full tree first, as in this example, and install off an NFS host on your LAN. The full download will be approximately 2.6GB. You may choose a mirror site - some are listed on the Slackware ARM web page: http://arm.slackware.com 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.0 # cd /export/slackwarearm/slackwarearm-14.0/ Copy the Slackware ARM installer: # cp -fav isolinux/uinitrd-tegra.img /tftpboot/slackwarearm-14.0/ The Linux Kernel: # cp -fav kernels/tegra/uImage* /tftpboot/slackwarearm-14.0/ 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.0/ 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 Trimslice # save Trimslice # reset 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 --------------------- Now download the Kernel and Slackware ARM installer via TFTP: Trimslice # tftpboot 0x01100000 slackwarearm-14.0/uinitrd-tegra.img Trimslice # tftpboot 0x00800000 slackwarearm-14.0/uImage-tegra Trimslice # setenv bootargs console=ttyS0,115200 nodhcp kbd=uk root=/dev/ram rw Trimslice # bootm 0x00800000 0x01100000 Notes: [ 1 ] The second 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 console=ttyS0,115200 kbd=uk nic=auto:eth0:dhcp root=/dev/ram rw;bootm 0x00800000 0x01100000;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 ---------------------- Choose '3 - Install from NFS (Network Filesystem)' Enter the IP address: 192.168.1.1 Enter the directory: /export/slackwarearm/slackwarearm-14.0/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.7 Choosing an X Window Manager ---------------------------- The Trimslice system has an HDMI output, however currently (Linux 3.4.4) the required Kernel graphics driver is not in the kernel.org kernel, thus the Trimslice cannot have graphical output. 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 ('/'). rootfs=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 'console=ttyS0,115200 root=/dev/sda2 waitforroot=3 rootfs=ext3 mem=384M@0M mem=512M@512M nvmem=128M@384M vmalloc=248M video=tegrafb' 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 aimed at). TrimSlice # setenv bootcmd_slk 'usb reset 1;ext2load usb 0:2 0x01100000 /boot/uinitrd-tegra;ext2load usb 0:2 0x00800000 /boot/uImage-tegra;bootm 0x00800000 0x01100000' Set standard boot command: TrimSlice # setenv bootcmd 'run bootcmd_slk ; reset' Finally, save the settings and reboot the device: Trimslice # save Trimslice # 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 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