Differences

This shows you the differences between two versions of the page.

doc:howto:dockstar_sandbox [2014/02/15 09:28] (current)
megal0maniac created
Line 1: Line 1:
 +===Installation===
 +==Prerequisites==
 +  * A Seagate Dockstar
 +  * A computer running Windows or Linux on the same network as the Dockstar
 +  * Access to the serial port ([[#Serial|serial connection]]), or Netconsole (see http://forum.doozan.com/read.php?3,14,14)
 +  * A tftp server
 +  * The ability to provide DHCP to the Dockstar without internet access (only applicable for initial install on a new unit)
 +
 +When I refer to sending commands over netconsole, you will do the same if you are using the serial port. Obviously, any references to setting up or starting netconsole do not apply
 +
 +==For users with brand new Dockstars, or one running the original firmware==
 +Connect the Dockstar to a network with DHCP, but disconnected from the internet. (Note that if you've been using the Dockstar as intended, it will have updated itself and SSH will no longer be available. You'll need to open it up and follow this guide using the serial header. See generic.serial)
 +
 +SSH in. ''root'' is the username and ''stxadmin'' is the password. Run ''killall hwbd'' then reconnect to the internet.
 +
 +==Bootloader update (required)==
 +Install updated uBoot (from http://projects.doozan.com/uboot/)
 +
 +This will also install and set up fw_envtools in order to modify bootloader parameters from within the operating system, and allow booting from USB drives (see additional resources). This script should work on most distros, but was designed to be run from the original firmware.
 +<code>cd /tmp
 +wget http://projects.doozan.com/uboot/install_uboot_mtd0.sh
 +chmod +x install_uboot_mtd0.sh
 +./install_uboot_mtd0.sh</code>
 +
 +==Netconsole configuration (optional)==
 +//You may skip this step if you are connected to the Dockstar via the serial headers on the board – this simply tunnels the physical serial port over the network and is necessary if you'd rather not open up your Dockstar. It might come in handy later, so it doesn't hurt to do this.//
 +
 +**Please note** that netconsole will not work once the system has booted, as the operating system will take over control. It is not a complete replacement for access to the serial port. The main purpose is to identify errors during boot and gain access to the uboot console.
 +
 +Configure netconsole (server IP is your machine)
 +<code>fw_setenv serverip <your IP address>
 +fw_setenv ipaddr <dockstar’s IP address>
 +fw_setenv if_netconsole 'ping $serverip'
 +fw_setenv start_netconsole 'setenv ncip $serverip; setenv bootdelay 3; setenv stdin nc; setenv stdout nc; setenv stderr nc; version;'
 +fw_setenv preboot 'run if_netconsole start_netconsole'</code>
 +
 +==Repartition NAND (highly recommended. If you don't know that you don't want this, then you want this)==
 +This will essentially combine what used to be mtd2 (32MB) and mtd3 (219MB) into a single rootfs partition.
 +<code>fw_setenv mtdparts ‘mtdparts=orion_nand:1M(u-boot),4M(uImage),-(rootfs)’</code>
 +
 +Flash layout now looks like this:
 +
 +^ New Flash Layout ^^^^
 +^ mtd#        |mtd0      |mtd1      |mtd2      |
 +^ size        |0x0100000  |0x0400000  |0xfb00000 |
 +^ in MiB      |1          |4          |251      |
 +^ name        |u-boot    |uImage    |rootfs    |
 +^ file system |//none//      |//none//      |jffs2    |
 +(see [[doc:techref:flash.layout]] for more info)
 +
 +==Set up necessary bootcmd variables==
 +<code>fw_setenv rescue_bootcmd 'if test $rescue_installed -eq 1; then run rescue_set_bootargs; nand read.e 0x800000 0x100000 0x400000; bootm 0x800000; else run pogo_bootcmd; fi'
 +fw_setenv rescue_set_bootargs 'setenv bootargs console=$console ubi.mtd=2 root=/dev/mtdblock2 ro rootfstype=jffs2 $mtdparts $rescue_custom_params'
 +fw_setenv rescue_installed 1</code>
 +
 +Start a TFTP server on your machine, bound to all interfaces or the one as specified in serverip and host these files:
 +  * openwrt-kirkwood--jffs2-128k.img (openwrt-kirkwood-jffs2-nand-2048-128k.img in Barrier Breaker)
 +  * openwrt-kirkwood-uImage
 +
 +If using the netconsole method, run <code>nc -l -u -p 6666</code> to monitor boot console. Ensure that any firewalls are off. Remember that you will need to run 2 simultaneous instances of nc. Refer to the link in the netconsole section for more details.
 +
 +**Reboot the Dockstar**, press “any key” when prompted to enter the console (alphanumeric key, enter doesn’t seem to work)
 +
 +Run the following commands at the bootloader prompt:
 +<code>mw 0x6400000 0xffff 0x300000
 +tftpboot 0x6400000 openwrt-kirkwood-uImage
 +nand erase 0x100000 0x400000
 +nand write.e 0x6400000 0x100000 0x400000
 +mw 0x6400000 0xffff 0x200000
 +tftpboot 0x6400000 openwrt-kirkwood--jffs2-128k.img
 +nand erase 0x500000 0xfb00000
 +nand write.e 0x6400000 0x500000 0x200000</code>
 +
 +And that's it! Your Dockstar has had its bootloader updated, flash repartitioned and OpenWRT installed.
 +
 +To run any other programs, or to preserve flash life, you can also run the OS off a USB drive. The Dockstar will automatically boot off any connected USB storage device provided the necessary files are on the first partition. See the next section for details
 +
 +I have OpenWRT installed on flash as a backup / recovery setup. My primary install is on the first partition of an external HDD so as to not wear out the flash.
 +
 +===Additional resources===
 +
 +==Installing OpenWRT onto a USB stick or HDD==
 +To install OpenWRT onto a USB drive of any sort, you need to do the following:
 +  * Format the first partition as ext2 and resize it if necessary, as this will be the system partition
 +  * Extract ''openwrt-kirkwood-rootfs.tar.gz'' onto this partition
 +  * Copy ''openwrt-kirkwood-uImage'' onto the root of the same partition and rename as ''uImage''
 +
 +If the device is plugged in at boot, then the Dockstar should start with a clean installation. If there's a problem, it will be in the boot log. If it fails to start, double check that ''uImage'' is named as such and that the partition is ext2 formatted.
 +
 +If using external storage, it is recommended that you create a ''swap'' partition of around 256MB. (OpenWRT does not seem to use much swap on this device)
 +
 +==Installing and configuring uboot-envtools==
 +This is required if you'd like to modify your uboot environment variables from within OpenWRT.
 +
 +Run
 +<code>opkg update
 +opkg install uboot-envtools</code>
 +
 +Put this into a new file at ''/etc/fw_eng.config''
 +<code># MTD device name Device offset Env. size Flash sector size Number of sectors
 +/dev/mtd0 0xc0000 0x20000 0x20000</code>
 +
 +(This might also be possible to achieve by simply running the uboot install script again, as it will skip installation of u-boot if a valid version is found, but should still install fw_envtools)

Back to top

doc/howto/dockstar_sandbox.txt · Last modified: 2014/02/15 09:28 by megal0maniac