SpiderElectron

Electronic Engineering Blog

Putting nano on Galileo

In this post I look at how to put my current favoured linux text editor, nano, onto Galileo.

My galileo is running the SD Card based linux image available from Intel’s IoT ADT page. This image includes all the dev tools required to build projects from source. You can use it to develop your own software, or you can use it to build software from source, as we are about to do with Nano.

Introduction

Galileo comes with the ubiquitous ‘vi‘ editor included, and it’s a great editor if you can master it’s mode based interface and learn some of its most useful commands. I happen to like nano, which is a bit more modeless and does what I need from an editor. It is not included in the Galileo Linux image however, so we need to install it. I couldn’t find a suitable binary package, so we’ll need to build it from source, which is a nice way to check that our build environment works, and to learn a little bit about building from source on Galileo.

Getting the Source Code and Buiding nano

Nano is an open source project, all the source is freely available. It’s available for download from www.nano-editor.org/download.php in various forms, such as binary packages for popular linux installations and Windows, but not for Yocto, which Galileo runs. It’s also available as a source tar ball, and via svn if you have an svn client. Galileo does not have an svn client installed, so we’ll need to download the source tar ball. At the nano download page, copy the path to the latest source tar ball, at the time of writing it was here: nano-2.2.6.tar.gz

  1. Logon to your Galileo as root
  2. Create a sub-folder in your home folder, or some other useful location:
    mkdir nano-src
  3. Change into the new folder:
    cd nano-src
  4. Download the source tar ball using curl and the path you noted earlier:
    curl http://www.nano-editor.org/dist/v2.2/nano-2.2.6.tar.gz >nano-2.2.6.tar.gz
  5. Unpack the tar ball, this will create a new folder containing the sources:
    tar zxvf nano-2.2.6.tar.gz
  6. Move into the new folder:
    cd nano-2.2.6
  7. Carry out the following three commands to build, and install, nano:
    ./configure
    make
    make install
  8. Enjoy your new text editor:
    nano <some text file>

 

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.