Answering Terminal Prompts/Warnings Automatically

2010 February 22
by SendDerek

A quick tip for automating those terminal prompts or warnings that you may get while, for example, overwriting files during a ‘cp’ command, is to use the ‘yes‘ command which will “be repetitively affirmative”. Use it like this:

yes | cp -r foo/ bar/

The ‘yes’ command will output whatever you want forever as well. For example, if you wanted to say “no” to all prompts or warnings, you would simply use…

yes n | cp -r foo/ bar/

CodeSourcery.com: A Place to Get Cross Compile Toolchains for ARM

2010 February 16
by SendDerek

This is something that I’m still coming to grips with, but today I learned that the cross compile toolchains that Technologic Systems provides for at least some of their products come from CodeSourcery.com. A quick blurb from their website:

CodeSourcery, in partnership with ARM, Ltd., develops improvements to the GNU Toolchain for ARM processors and provides regular, validated releases of the GNU Toolchain. Sourcery G++ Lite Edition supports ARM, Thumb, and Thumb-2 compilation for all architectures in active use, including Version 7 of the ARM Architecture.

For example, today I needed a newer version of the g++ cross compiler targeted towards EABI and glibc, so I took a look around the website at http://www.codesourcery.com/sgpp/lite/arm and found the release in the downloads section here: http://www.codesourcery.com/sgpp/lite/arm/portal/subscription?@template=lite

A short term goal for myself is to figure out what goes into creating a cross compile environment. I think this would be a valuable skill in the embedded Linux market. For now, this was a shock to learn about how simple it really is to be able to simply download the toolchain and that there wasn’t any other trickery or knowledge required.

Guide on TFTP Server Setup in Fedora

2010 February 15
by SendDerek

This guide will help you understand the very basics of setting up a TFTP server.  This was written using Fedora 12 and tested with SELinux disabled. I have not yet confirmed if SELinux needs to be disabled, but I have confirmed that the firewall needs to be configured to allow port 69 (TFTP port).  Let’s get to it…

read more…

How To Fix “public key is not available” Message

2010 February 12
by SendDerek

Here are the steps that I have taken in the past to fix the “public key is not available:” message while trying to use apt-get:

1.) Use apt-get to install debian-archive-keyring

apt-get install debian-archive-keyring

2.) Try using apt-get again. Additional information will be provided.

3.) Use additional information from last attempt with gpg commands.

Replace the KEYNUMBER with the actual keynumber that you should now have from running apt-get again.

gpg --keyserver wwwkeys.eu.pgp.net --recv-keys KEYNUMBER
gpg --armor --export KEYNUMBER | sudo apt-key add -

4.) Update apt-get to resynchronize the package index files.

apt-get update

5.) You should be good to go!

Keep in mind you may need to run apt-get update a couple of times. Also, make sure your date is set correctly.

Setup Static IP Address in Linux Terminal

2010 February 12
by SendDerek

This tidbit intends on helping folks running Linux in an embedded environment to setup a static IP address. This is also applicable to full fledge desktop installations of Linux as well. It has been tested on Debian Linux, but I suspect the process is identical for most distributions. Let’s get to it…

Edit “/etc/network/interfaces” to reflect the changes you’d like to make to your IP address. For example, I would like to setup my Debian box with the IP address 192.168.1.100. I have filled in all of the important information as well as seen below:

   # Used by ifup(8) and ifdown(8). See the interfaces(5) manpage or
   # /usr/share/doc/ifupdown/examples for more information.

   auto eth0
   #iface eth0 inet dhcp
   iface eth0 inet static
           address 192.168.1.100
           network 192.168.1.0
           netmask 255.255.255.0
           broadcast 192.168.1.255
           gateway 192.168.1.1

Then, edit the “/etc/resolv.conf” file to reflect your DNS servers (or simply use OpenDNS addresses below):

   nameserver 208.67.222.222
   nameserver 208.67.220.220

Now, reset the eth0 interface by using the command:

ifdown eth0; ifup eth0

Test the connection using the command:

ping google.com

As an additional tidbit, you can simply get an IP address via DHCP using the ‘dhclient’ or ‘pump’ command.