################################################################################## # Document: INSTALL_KIRKWOOD.TXT # Purpose : How to install Slackware ARM on the Marvell SoC Kirkwood series # including: # SheevaPlug # GuruPlug # OpenRD Base # OpenRD Client # Author : Stuart Winter # For questions and support, please use the Slackware ARM forum # http://www.linuxquestions.org/questions/slackware-arm-108/ # Date : 06-Dec-2012 ################################################################################## # # References: # http://computingplugs.com/index.php/Booting_entirely_off_an_external_USB_device # http://www.cyrius.com/debian/kirkwood/sheevaplug/unpack.html # http://dev.gentoo.org/~armin76/arm/sheevaplug/install.xml # http://www.cyrius.com/debian/kirkwood/openrd/install.html # http://code.google.com/p/openrd/wiki/UbootConfigForMainLineKernel ################################################################################## # Change Log ## # 29-Dec-2012 # * 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 file system, and the root file system 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. # # 03-Oct-2012 # * Modified U-boot configuration settings to assume that the SheevaPlugs are # using the 'DENX' U-boot release rather than the supplied version from 'Marvell'. # The 'OpenRD' systems remain using the 'Marvell' release, so still have the # 'archNumber' values set. # The U-boot loader and upgrade instructions can be found here: # http://arm.slackware.com/maint_kirkwooduboot/ # Thanks to Michael Langfinger for the suggestion. # # 19-Jul-2010 # * First version ################################################################################### 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. Kirkwood system: - You want to install the OS onto an eSATA hard disc, MMC device or a USB hard drive or USB memory device. Some Kirkwood devices such as the OpenRD and some "Plug" devices have an eSATA port. If you have an eSATA enclosure, it's recommended to use this because the disc throughput will be faster. You have at least an 8GB hard disk or USB flash stick - a full installation of Slackware is approximately 6.5GB. - You want to retain the stock Ubuntu/Fedora installation. 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 Kirkwood unit, we'll boot the Linux Kernel and Initial RAM disk via TFTP. It *is* possible to place these two files onto an ext2 or FAT partition on USB stick/drive (even the one you'll be installing Slackware onto), but during development I've found it beneficial to have the images available by 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-kirkwood.img /tftpboot/slackwarearm-14.1/ The Linux Kernel: # cp -fav kernels/kirkwood/uImage* /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/kirkwood/uinitrd* /tftpboot/slackwarearm-14.1/ 2.4.1 Adding the U-Boot update to the /tftpboot directory --------------------------------------------------- When the SheevaPlugs were first released, the u-Boot shipped with them was not very reliable. * This guide expects that for 'Plug' devices (Sheeva, Guru etc) * * that the version of U-Boot is the upstream version from 'DENX'. * * If you are running the release from 'Marvell', you must upgrade * * in order to use these instructions. * Please visit the Kirkwood maintenance page for details and a HOWTO guide. http://arm.slackware.com/maint_kirkwooduboot For 'OpenRD' systems, this document assumes you are using the 'Marvell' release of U-Boot (as there appear to be no other versions available). 3.0 Connecting to the Kirkwood system via the Serial Port ----------------------------------------------------- 1. Create a udev rules file for the Kirkwood system: When you power cycle the Kirkwood system, often the /dev/ttyUSB device numbers will change which means you have to update your terminal program's settings; this way you don't need to. Paste the following into a root shell on your host: echo ' # /etc/udev/rules.d/99-marvell-kirkwood.rules # Attach /dev/{openrd,sheevaplug} to the serial console of the Marvel Kirkwood systems. # by Jim Hawkins # # The JTAG module supplied with the GuruPlug identifies itself as "SheevaPlug" so you # can use the /dev/sheevaplug device. # ACTION=="add", SUBSYSTEM=="tty", SUBSYSTEMS=="usb", ATTRS{bInterfaceNumber}=="01", ATTRS{interface}=="SheevaPlug JTAGKey FT2232D B", SYMLINK+="sheevaplug" ACTION=="add", SUBSYSTEM=="tty", SUBSYSTEMS=="usb", ATTRS{bInterfaceNumber}=="01", ATTRS{interface}=="OpenRD JTAGKey FT2232D B", SYMLINK+="openrd" ' > /etc/udev/rules.d/99-marvell-kirkwood.rules Cause udev to find the new rules: # sh /etc/rc.d/rc.udev restart 2. Load the Kernel modules required: For SheevaPlug, GuruPlug (using JTAG module), OpenRD client: ```````````````````````````````````````````````````````````` # modprobe usbserial vendor=0x9e88 product=0x9e8f # modprobe ftdi_sio vendor=0x9e88 product=0x9e8f For the OpenRD Ultimate: ```````````````````````` # modprobe ftdi_sio vendor=0x0403 product=0x9e90 For any other devices, if you're running Linux 2.6.26 or higher, try omitting the vendor and product parameters - the module should be able to determine the correct parameters by itself. 3. 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 Note: I find it easier to use 'screen' because when you power cycle the Kirkwood system, the ttyUSB device (that /dev/{sheevaplug,openrd} symlinks to) is removed from /dev by udev. This causes the program to either quit or hang up, making you have to reconnect. I find it faster to press the up arrow in my shell, and re-run screen, than having to perform key combinations in minicom. 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/openrd ( or /dev/sheevaplug ) 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/openrd 115200,-crtscts # or /dev/sheevaplug 4. Connect the USB serial cable that comes with the Kirkwood system to your PC. 5. Connect your USB stick or hard disk to the unit. If the hard disk has an external power supply, power on the drive now and wait for it to spin up. 6. Power on the Kirkwood system unit. 7. Open the connection to the Kirkwood system serial port Example: # screen /dev/openrd 115200,-crtscts # or /dev/sheevaplug 8. You should see the output from the Kirkwood 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 'Marvell>>' prompt. 3.1 Configuring the Kirkwood system ------------------------------- 1. Set or request an IP address for the Kirkwood system: ````````````````````````````````````````````````````` The Kirkwood 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 Kirkwood 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: Marvell>> setenv ipaddr 192.168.1.20 To request an IP via DHCP: Marvell>> 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. Marvell>> setenv serverip 192.168.1.1 3. Kernel version configuration: ````````````````````````````` Some Kirkwood systems need to know how to boot the correct kernel for the particular device you're installing upon. If your system is not listed below (e.g. GuruPlug, SheevaPlug) this is because you do not need to apply this particular setting and you can proceed to step number 4. For the SheevaPlug *eSATA* systems: Marvell>> setenv machid 2678 For the OpenRD *CLIENT* systems: Marvell>> setenv arcNumber 2361 Marvell>> setenv mainlineLinux yes For the OpenRD *BASE* systems: Marvell>> setenv arcNumber 2325 Marvell>> setenv mainlineLinux yes For the OpenRD *ULTIMATE* systems: Marvell>> setenv arcNumber 2884 Marvell>> setenv mainlineLinux yes 4. Save the settings and reboot ```````````````````````````` Marvell>> saveenv ; reset 4.0 Slackware ARM installation -------------------------- Power cycle/reset the Kirkwood system and Interrupt the boot process by pressing ENTER a few times. 4.1 Performing an installation to a USB disc ---------------------------------------- If you want to perform the installation to a USB disc: At the U-Boot console: Marvell>> usb start If your device says: (Re)start USB... USB: scanning bus for devices... 2 USB Device(s) found scanning bus for storage devices... Device NOT ready Request Sense returned 05 24 00 1 Storage Device(s) found Where it says that the device is not ready, reset the device again and retry. If after four or so goes it still doesn't work, then it may be that the Kirkwood system simply does not like your device and you'll either have to check if there's a newer U-Boot version for your Kirkwood system system, or find another USB enclosure. If the system finds your USB device, it should report something similar to: Marvell>> usb start (Re)start USB... USB: scanning bus for devices... 2 USB Device(s) found scanning bus for storage devices... 1 Storage Device(s) found Marvell>> 4.2 Performing an installation to an eSATA disc ------------------------------------------- To perform an installation to an eSATA drive, we need to reset the IDE interface: Marvell>> ide reset 4.3 Performing an installation to an MMC device ------------------------------------------- Start the MMC interface: Marvell>> mmcinit 4.4 Booting the installer --------------------- Now download the Kernel and Slackware ARM installer via TFTP: Marvell>> tftpboot 0x01100000 slackwarearm-14.1/uinitrd-kirkwood.img Marvell>> tftpboot 0x00800000 slackwarearm-14.1/uImage-kirkwood Marvell>> setenv bootargs console=ttyS0,115200 nodhcp kbd=uk root=/dev/ram rw Marvell>> bootm 0x00800000 0x01100000 Note: 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. 4.4.2 Starting the network automatically ---------------------------------- 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 Kirkwood device without any further work via the serial console. To do this, adjust the "bootargs" above to be: Marvell>> setenv bootargs console=ttyS0,115200 kbd=uk nic=auto:eth0:dhcp root=/dev/ram rw;bootm 0x00800000 0x01100000;reset 4.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.5 Begin the setup --------------- Slackware ARM has an identical installer to Slackware x86, so the same tools are available, including fdisk. 4.5.1 Connect to the installer via SSH -------------------------------- The easiest way to get Slackware ARM onto a Kirkwood system is to login to the installer via SSH. On your x86 host PC, ssh into the IP address of the Kirkwood 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 Kirkwood. 4.5.2 Partitioning your hard disk --------------------------- You should find your USB/eSATA drives are identified as /dev/sda. If you're using an MMC device you will find it identified as /dev/mmcblk0 and the partitions as /dev/mmcblk0pN (where N is the partition number). In the examples below, for MMC the device names become /dev/sda1 = /dev/mmcblk0p1 /dev/sda2 = /dev/mmcblk0p2 /dev/sda3 = /dev/mmcblk0p3 The rest of the examples use the /dev/sda names for ease of documentation. If you're using MMC, you need to substitute /dev/sda for the MMC device names in the table above. Please choose a partitioning scheme. The recommended scheme is: /dev/sda1 - Size: 100MB Mount point: /boot Partition type: 83 "Linux" Filesystem: ext2 * Note: * The reason for a separate /boot partition with an ext2 filesystem, rather than say one large / formatted as ext4, is because the ext2 support in u-boot does not support anything higher than ext2. /dev/sda2 - Size: 800MB Mount point: Not applicable Partition tyoe: 82 "Linux Swap" Tip: If you have small sized storage you may wish to have a small swap partition. But if you're going to be doing software development, it's advisable to have a larger swap partition to 'avoid out of memory' errors. /dev/sda3 - Size: Remainder of the disc Mount point: / Partition type: 83 "Linux" Filesystem: ext4 (or your choice) You are free to choose your own partitioning scheme but U-Boot is restricted to loading files (the Linux Kernel & Initial RAM disk) from either ext2 or FAT partitions; therefore it's recommended to have a small ext2 formatted /boot partition. You can create the partition table using fdisk or cfdisk. 4.5.3 Start the installer menu ------------------------ In the SSH terminal window, on the Kirkwood 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 Kirkwood 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.5.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/sda3, and choose any format you wish. The next step to "Select other Linux partitions for /etc/fstab" Here: - Select /dev/sda1 - Format it - Select 'ext2' as its filesystem - Mount point: /boot 4.5.5 Source media selection ---------------------- Depending upon your choice in section 2.2, you must now choose the corresponding installation source - NFS or HTTP. 4.5.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.5.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.5.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.5.6.1 Choosing a Window manager for X.org ----------------------------------- 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 Kirkwood, and you'll be dropped into the familiar 'Marvell>>' U-Boot console. We now need to tell the Kirkwood how to boot the Operating System. In section 4.2.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 the values contained in the U-Boot configuration below: The first line: root=/dev/sda3 This is where Linux will find its root filesystem ('/'). rootfstype=ext4 The filesystem (e.g. ext2,ext3,ext4,xfs,jfs,reiserfs) used on the root filesystem. The second and third lines tell U-Boot to start the USB subsystem; load the Initial RAM disk off an ext2 filesystem which is the first partition on the disk; load the Linux Kernel off an ext2 filesystem which is on the first partition on the disk. The fourth line boots the Kernel and Initial RAM disk using the values configured. Paste these lines into your Kirkwood U-Boot console, adjusting any necessary settings, as described above: Marvell>> setenv bootargs_console console=ttyS0,115200 Marvell>> setenv bootargs_root 'root=/dev/sda3 waitforroot=5 rootfstype=ext4' Marvell>> setenv bootcmd 'setenv bootargs $(bootargs_console) $(bootargs_root); run bootcmd_slk ; reset' For installation to a *USB* disc: Marvell>> setenv bootcmd_slk 'usb start;ext2load usb 0:1 0x01100000 /uinitrd-kirkwood;ext2load usb 0:1 0x00800000 /uImage-kirkwood;bootm 0x00800000 0x01100000' For installations to an EXTERNAL *eSATA* disc: Marvell>> setenv bootcmd_slk 'ide reset;ext2load ide 1:1 0x01100000 /uinitrd-kirkwood;ext2load ide 1:1 0x00800000 /uImage-kirkwood;bootm 0x00800000 0x01100000' For installations to an INTERNAL *SATA* disc: Marvell>> setenv bootcmd_slk 'ide reset;ext2load ide 0:1 0x01100000 /uinitrd-kirkwood;ext2load ide 0:1 0x00800000 /uImage-kirkwood;bootm 0x00800000 0x01100000' For installations to an *MMC* device: Marvell>> setenv bootcmd_slk 'mmcinit;ext2load mmc 0:1 0x01100000 /uinitrd-kirkwood;ext2load mmc 0:1 0x00800000 /uImage-kirkwood;bootm 0x00800000 0x01100000' Finally, save the settings and reboot the device: Marvell>> saveenv ; reset The Kirkwood will reboot and should begin running the Linux Kernel, and booting into your new Slackware ARM installation. 6.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. 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 7.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