http://www.openplug.org/plugwiki/index.php/SheevaPlug_Installer

SheevaPlug Installer

From PlugWiki

Jump to: navigation, search

The SheevaPlug installer is a new software package intended to replace the current recovery tool for reinstalling or reviving a bricked plug.

The main new features in the installer are -

  1. Generic that can be used to install any distro (or any operating system even).
  2. Distro specific stuff is under a directory called 'installer'.
  3. Built-in openocd that automatically flashes uboot.

Missing features -

  1. GUI
  2. Some restructuring of the files to make it more scalable?

Contents

[hide]

Release version 1.0

What are the changes from alpha-6?

Changes are -

  • Supports both Linux and Windows (works on XP) host OS
  • Supports loading root filesystem to either internal NAND flash or external SD card
  • Based on Kernel 2.6.30.2 (thanks cbxbiker61)
  • Includes latest uboot (version 3.4.19) -
    • Better SD card support
    • Better FAT32 USB partitions
    • Improved internal NAND interface timing (faster access)
  • Based on OpenOCD release 2.0
  • Includes sources of initrd, uboot-envtool

How to install 1.0 ?

Following instructions are for installing Ubuntu 9.04.

  1. Download the tarball from here
  2. Untar the archive onto the host that is connected to the plug by the USB serial cable
  3. Carefully read the README.txt file and follow the instructions. In brief -
    • Copy the content of the 'installer' directory into the root directory of an empty FAT32 formatted USB stick
    • Insert the USB stick into the plug's USB port
    • Make sure you read the bugs section in the README.txt - especially for the minicom console users
    • IMPORTANT NOTE FOR NEWER PLUGS (> 7/30/09ish)
    • Power your sheevaplug
    • On Linux host run 'sudo php /runme.php'
    • On Windows host run 'runme.exe nand|mmc' from the command prompt. Afterwards the Windows version beeps; you need to unplug your mini usb cable, plug it back again and open the terminal.
    • On Linux you can launch serial terminal console in the beginning of the process. putty is known to work well.
    • Wait for two minutes until fresh new U-Boot is up and running.
    • Don't stop U-Boot count down. Wait for additional 5 minutes until it reflashes itself from the USB stick.
    • If U-Boot was stopped (sometimes because of opening a terminal on Windows) you can restart it by running 'run recover1' on the U-boot command line.

Troubleshooting

For "openocd/openocd: error while loading shared libraries: libftdi.so.1: cannot open shared object file: No such file or directory", see [1]. It may be due to interacting with the plug via usb-serial before the installer script gets a chance to do so, so try again without opening any screens or putty sessions to the plug. After the installer has finished, you should have no problem connecting to the plug via usb-serial.

Otherwise, if you are on an x86_64 system, the problem is that the pre-compiled openocd is for 32bit. Thus, it requires a 32bit version of libftdi.so.1. You can replace it as follows:

1.) Follow the instructions at [2], stopping after building openocd (make sure to build and install libftdi ;-) ).

2.) Move to the openocd directory in the installer tree

   [u...@localhost ~] $ cd path/to/sheevaplug-installer-v1.0/uboot/openocd/

3.) Rename the pre-compiled, 32bit openocd so it's out of the way.

   [u...@localhost openocd] $ mv openocd openocd32

4.) Symlink to the 64bit openocd you just compiled.

   [u...@localhost openocd] $ ln -sf ../../../path/to/openocd-0.2.0/src/openocd openocd

5.) Return to the top of the tree and run the php script

   [u...@localhost openocd] $ cd path/to/sheevaplug-installer-v1.0
   [u...@localhost sheevaplug-installer-v1.0] $ sudo php ./runme.php nand

Previous Alpha-6 Release

What's included in the alpha-6 release

The alpha-6 includes the following -

  • uboot that supports FAT32 and SD card support (*). Please refer to the forums post here - Thanks kwonsk
  • Linux kernel 2.6.30-rc#6 and it's modules from here - Thanks cbxbiker61
  • Ubuntu 9.04 root filesystem - Refer to the script inside 'installer' directory to see how to recreate this rootfs.
  • Switch from JFFS2 to the newer and faster booting UBIFS file system.

(*) This is NOT official Marvell support. The SD card support in this Uboot is partial and known to be buggy. Marvell is working on official SD card support, details in the future.

In this wiki, the installer is for installing the Ubuntu 9.04 from an image. Hopefully the community will like this installer and build their own 'installer' directories that provides other distros.

How to install alpha-6 ?

Following instructions are for installing Ubuntu 9.04.

  1. Download the tarball from here
  2. Untar the archive onto the Linux host that is connected to the plug by the USB serial cable
  3. Carefully read the README.txt file and follow the instructions. In brief -
    • Copy the content of the 'installer' directory into the root directory of an empty FAT32 formatted USB stick
    • Insert the USB stick into the plug's USB port
    • Make sure you read the bugs section in the README.txt - especially for the minicom console users
    • Power your sheevaplug
    • IMPORTANT NOTE FOR NEWER PLUGS (7/30/09ish)- see extended note below...
    • Run 'sudo ./runme.sh' from the Linux host connected to the plug
    • You can launch serial terminal console in the beginning of the process. putty is known to work well.
    • Wait for two minutes until fresh new U-Boot is up and running.
    • Don't stop U-Boot count down. Wait for additional 5 minutes until it reflashes itself from the USB stick.


Important Note for Newer Plugs (7/30/09ish)

If you are getting errors when trying to connect to the plug, you may need to change the Vendor and Product IDs in the config (sheevaplug-installer-v1.x\uboot\openocd\config\interface\sheevaplug.cfg ). This is needed if you see the ftdi device and messages as outlined above, but have errors when trying to connect using the runme.sh. You need to change the file so that it contains:

 interface ft2232
 ft2232_layout sheevaplug
 ft2232_vid_pid 0x0403 0x6010
 #ft2232_vid_pid 0x9e88 0x9e8f
 #ft2232_device_desc "SheevaPlug JTAGKey FT2232D B"
 jtag_khz 2000

Why reinventing the wheel ?

The original recovery tool has big limitation that it doesn't reflash u-boot, which is important for a seriously bricked plug.

We started from that, and given that the tool itself isn't easy to master and to scale to other distros, we decided to re-invent the wheel.

What are the internals ?

The runme.sh script does the following -

  • Creates a uboot-env.bin 128KB file which will have the uboot environment variables.
  • Populate uboot-env.bin with default environment variables (refer to the scripts-linux/uboot-env/uboot-dflt.txt file).
  • Reads the installer/uboot-custom.txt and change uboot-env.bin accordingly
  • Start openocd (static binary) that -
    • Initialize the plug
    • Erase blocks 5-6 on the plug's NAND flash and write to it uboot-env.bin
    • Erase blocks 0-4 on the plug's NAND flash and writes uboot/uboot.bin
    • Releases the processor to start booting from a fresh new uboot.

After that the plug starts executing it's bootcmd. In the alpha-6 example, first time bootcmd is configured as follows -

 bootcmd = run recover1

and recover1 is -

 recover1 = setenv mainlineLinux yes; setenv arcNumber 2097; setenv bootcmd run recover2; saveenv; reset

So, basically recover1 sets some env variables, sets bootcmd to run recover2 (for next reset), saves the env and resets the plug.


In the next reset bootcmd will have the following -

 bootcmd = run recover2

Refer to the installer/uboot-custom.txt file in the alpha-6 release to see all uboot command sequencing being used.

How can I modify it to install my ...

Please read the README.txt file for suggestions.

Then read the README.txt inside the 'installer' directory for explanation about the usage of files.

How can I modify it to install open u-boot ...

Please apply the patch File:Patch Update-Sheevaplug-installer-for-open-u-boot.tar.gz to the SheevaPlug installer root folder

Build open u-boot for SheevaPlug since it it not included in this package, please refer Das U-boot plug support

Replace u-boot.bin with u-boot.kwb (flashable open u-boot binary)

Follow the process explained in the above chapter

Powered by MediaWiki

Reply via email to