help install on Ubuntu

Go To Last Post
17 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I've recently converted to Ubuntu and it's a bit of a learning curve to say the least. Having said that, can someone simplify (dumb down) the Script for building AVR-GCC 4.2.2 on Linux instructions for a Linux newbie?

Thanks :)

IDE - Eclipse w/AVR Eclipse plugin
Programmer - AVRISP MKII
OS - Ubuntu (Intrepid) Linux

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Stealing Proteus doesn't make you an engineer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks, but that's the post that I need simplified.

IDE - Eclipse w/AVR Eclipse plugin
Programmer - AVRISP MKII
OS - Ubuntu (Intrepid) Linux

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Rather than asking someone to "simplify" the whole sequence of instructions, perhaps you might get a faster response if you ask a specific question about the instructions.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

kmr wrote:
Rather than asking someone to "simplify" the whole sequence of instructions, perhaps you might get a faster response if you ask a specific question about the instructions.

True. After fiddling around with it, I have come up with some specific questions.

1. When the instructions say "run as root" does it mean use sudo?

2. When I try to run any of the commands ( ./getfiles.sh, ./get-patches.sh, or ./buildavr-no-insight.sh) with sudo, I get the error "command not found". When I leave out sudo, I get "Permission Denied".

I went through getfiles.sh and ran each line manually and that went ok. I was about to do the same with the next file until I saw how much more involve than just downloading files.

IDE - Eclipse w/AVR Eclipse plugin
Programmer - AVRISP MKII
OS - Ubuntu (Intrepid) Linux

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sorry to repost so quickly, but I just ran one with

bash get-patches.sh

and it ran. What is "bash" and did I do something I'm not supposed to?

Ok, is this bad or correct:

sudo bash ./buildavr-no-insight.sh

? The last line when I run that is

(./buildavr-no-insight.sh) binutils build failed

IDE - Eclipse w/AVR Eclipse plugin
Programmer - AVRISP MKII
OS - Ubuntu (Intrepid) Linux

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Instead of sudo, why don't you simply su to root so you don't have to keep typing the *&^$ sudo command all the time. The root privileges from sudo are probably not getting propagated as far down as they need to, and I'm guessing that is what is getting in your way. Whoever started this whole "Never run as root, always use sudo." mania should be sent to a re-education camp.

Anyway, welcome to the *nix world! Yes, it's a learning curve. But worth it.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

javafiend wrote:
1. When the instructions say "run as root" does it mean use sudo?

Yes, either "sudo" before each command for use "sudo su" to become the root user.
Quote:
2. When I try to run any of the commands ( ./getfiles.sh, ./get-patches.sh, or ./buildavr-no-insight.sh) with sudo, I get the error "command not found". When I leave out sudo, I get "Permission Denied".
Use the syntax
sudo sh ./getfiles.sh
Quote:
I went through getfiles.sh and ran each line manually and that went ok. I was about to do the same with the next file until I saw how much more involve than just downloading files.
That's more work than you need to do. Try the "sudo sh " syntax above.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I think running as sudo su worked for the most part. The error I get now is

(./buildavr-no-insight.sh) binutils patching failed

IDE - Eclipse w/AVR Eclipse plugin
Programmer - AVRISP MKII
OS - Ubuntu (Intrepid) Linux

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The patching is most likely failing because you are attempting to re-patch files that have already been patched once. Assuming you have the bandwidth, probably the simplest approach is to just start the process over again in a clean directory.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

For a root shell try : sudo su -

Quote:
Edit: or is it : sudo - su

I always mix up just that one , as the su is "backwards"

And remember the : chmod +x *.sh

/Bingo

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ok, I think I've got all of the scripts run. How do I check to make sure I have it set up correctly and everything works?

IDE - Eclipse w/AVR Eclipse plugin
Programmer - AVRISP MKII
OS - Ubuntu (Intrepid) Linux

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I had to go back and rebuild my toolchain, couldn't leave well enough alone I guess. I've done well so far up until the last step and am now getting this error

./buildavr-no-insight.sh: 78: Syntax error: "(" unexpected

This is the command I'm running

sudo sh ./buildavr-no-insight.sh

The same format worked for the previous scripts. Any thoughts?

IDE - Eclipse w/AVR Eclipse plugin
Programmer - AVRISP MKII
OS - Ubuntu (Intrepid) Linux

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

dbc wrote:
Instead of sudo, why don't you simply su to root so you don't have to keep typing the *&^$ sudo command all the time.

In Ubuntu, the root account has been disabled by default. The distro maintainers actively enforce the "use sudo for everything" rule. A simple workaround is this:

$ sudo bash
#

Also, Ubuntu doesn't come with a native compiler toolchain installed by default. Did you use apt-get to install the build-essential package first?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

javafiend wrote:
I had to go back and rebuild my toolchain, couldn't leave well enough alone I guess. I've done well so far up until the last step and am now getting this error

./buildavr-no-insight.sh: 78: Syntax error: "(" unexpected

This is the command I'm running

sudo sh ./buildavr-no-insight.sh

The same format worked for the previous scripts. Any thoughts?


Hmm. I remember seeing this one. Unfortunately I don't remember the cause any more. Maybe that syntax is a Bash extension so you should run the script with bash instead of sh.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Doh! I should have thought about using bash. I just remoted to my comp (called my wife and had her do it) and it worked. Thanks a million guys!

IDE - Eclipse w/AVR Eclipse plugin
Programmer - AVRISP MKII
OS - Ubuntu (Intrepid) Linux

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Just in case anyone else runs into the same problem and wants to know why, check the Ubuntu wiki. Apparently, Ubuntu by default uses dash (the Debian Almquist Shell) instead of bash. So I would recommend when building your AVR toolchain to use bash as opposed to just sh when running the build scripts.

Here is a link to my question on the Ubuntu forum >>link<<

Edit::
Or you can forget all that and just leave out the sh and bash all together. I'm sure if I'm incorrect someone will correct me (I hope).

IDE - Eclipse w/AVR Eclipse plugin
Programmer - AVRISP MKII
OS - Ubuntu (Intrepid) Linux