LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-27-2012, 05:07 PM   #1
friendlybear
LQ Newbie
 
Registered: Aug 2012
Posts: 5

Rep: Reputation: Disabled
How do I create a usable .bin file from source code?


I'm a total newbie to Linux and my first question for everyone, is:

How do I take a source code I have, and turn it into something usable?

I have the source for Linksys WRT310N router, and would like to get a usable .bin file from it. The router is currently running an older version of firmware, and the only upgrade that is available on their site will disable my ability to replace it with DD-WRT, or other open source options. I am not comfortable enough with DD-WRT to flash it on my router yet, I don't want to brick it.

As well as that, I don't like being forced into a particular upgrade by Linksys.

This is the file here:

wrt310n_v1.0.07.014.tar,0.gz

Thanks for looking, and extra thanks for answering.
 
Old 08-27-2012, 05:16 PM   #2
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
Usually you would use a compiler to build the code into an executable. Yours is a unique situation, however, because you want to build the code to run on an architecture that is different than the machine on which you'll be doing the compiling. This is referred to as cross-compiling, and to do that you need to install a cross-compiler.

That file you linked to contains everything you need, though. Extract it with:
Code:
tar -xzf wrt310n_v1.0.07.014.tar,0.gz
That will generate a directory with a .pdf file and another .tar.gz file, so extract that one:
Code:
cd wrt310n_v1.0.07.014
tar -xzf wrt310n_v1.0.07.014.tar.gz
That will generate a directory with the source in it. Inside you'll find a How_to_make_WRT310N.txt file with some information, and in tools-src/README.TXT you'll find even more information, along with the cross-compilers you need to set up and instructions on how to do so.
 
1 members found this post helpful.
Old 08-27-2012, 05:24 PM   #3
friendlybear
LQ Newbie
 
Registered: Aug 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by suicidaleggroll View Post
Usually you would use a compiler to build the code into an executable. Yours is a unique situation, however, because you want to build the code to run on an architecture that is different than the machine on which you'll be doing the compiling. This is referred to as cross-compiling, and to do that you need to install a cross-compiler.

That file you linked to contains everything you need, though. Extract it with:
Code:
tar -xzf wrt310n_v1.0.07.014.tar,0.gz
That will generate a directory with a .pdf file and another .tar.gz file, so extract that one:
Code:
cd wrt310n_v1.0.07.014
tar -xzf wrt310n_v1.0.07.014.tar.gz
That will generate a directory with the source in it. Inside you'll find a How_to_make_WRT310N.txt file with some information, and in tools-src/README.TXT you'll find even more information, along with the cross-compilers you need to set up and instructions on how to do so.
Thank you for your reply, it was very helpful and informative. Do I need a particular archiving program to run that command in windows, or do I just type it at the command prompt? Sorry to sound like such a newbie, but I don't have a clue.
 
Old 08-27-2012, 05:57 PM   #4
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
Even if you can get it extracted, I'm not sure how you'd do the cross compiling in Windows. Possibly through Cygwin...otherwise you could set up a Linux VM and do the work there.
 
1 members found this post helpful.
Old 08-27-2012, 06:06 PM   #5
friendlybear
LQ Newbie
 
Registered: Aug 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
Thumbs up

Quote:
Originally Posted by suicidaleggroll View Post
Even if you can get it extracted, I'm not sure how you'd do the cross compiling in Windows. Possibly through Cygwin...otherwise you could set up a Linux VM and do the work there.
So, can I boot from a linux live disc and do what I need to?

Again, thank you for your assistance.
 
Old 08-27-2012, 08:24 PM   #6
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
Probably, but I would recommend using a bootable live USB with persistent storage instead so that you can reboot without losing everything you did. Either that or a VM from within Windows, assuming your hardware can handle it.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do i create a .bin file for linux from my java source code ojerag Programming 4 01-04-2010 09:45 AM
how to create a .bin file in linux sharad Linux - General 6 12-03-2009 03:59 AM
"convert source code into bin file" kandhakumar Linux - Software 2 05-26-2009 03:15 PM
source code for /usr/bin/script rithik_ghoshal Fedora 2 01-20-2009 02:59 PM
Source Code for /bin/ps jasonlambert Programming 2 10-17-2003 09:07 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:03 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration