LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Source based distribution for development (https://www.linuxquestions.org/questions/linux-newbie-8/source-based-distribution-for-development-4175489081/)

KansaiRobot 12-24-2013 08:05 PM

Source based distribution for development
 
Hello Everybody this is my first post and would appreciate if someone can help me.

I have some experience working with Linux. In the past I have used Fedora, and lately Debian.

The thing is I have used Linux because I needed it without thinking much about definitions and I need them now. So far my experience is limited to Fedora and lately Debian. Ergo, binary based distributions. Within there I compiled programs and always had a Hard Disk to store my files. not even once I had to build the kernel or the userland. just my programs.

My problem is now I am working with a "Source Based Distribution for Development for a microcontroller without a hard disk. And I dont know what that means :scratch:

So I would appreciate definitions.

Another definition I would like to get is : "image file" (bin.gz and img.gz)

It seems the way of working here is way different to what I am used to. It seems whenever I write a program (using C) I have to put that source (and the makefile) in the source of the whole system, make make config to change any configuration I would like and then rebuild the entire thing each and every time! (really?)

Is that how this "source based distribution for development" works? Has any of you have any experience or comment on that.

I would really appreciate your feedback on this to help my confused state of mind.

Thank you very much

Kansai

frankbell 12-24-2013 08:52 PM

The short definition would be that source-based distribution is one in which all software is compiled for sources, rather than installed from binary packages. You download the source code for the software, rather than a copy of the already-compiled program file, and compile it locally.

This will tell you more about compiling software. http://linuxgazette.net/issue38/pollman.html

An image file is a file which contains a compressed image of, say, a CD. When decompressed, it replicates the file structure and files of the original. If you are familiar with the Windows program "Ghost," it works by creating an "image" of the target. You may need special-purpose software to restore the image; for example, if you want to recreate a CD to a new disc, you need to use the "burn image" tool in your CD burning program, not the "copy" tool to do so.

Wikipedia has a nice article on image files: https://en.wikipedia.org/wiki/Image_file_formats

KansaiRobot 12-24-2013 10:28 PM

1 Attachment(s)
Thank you very much for your reply

I am wondering about the normal development flow in these kind of distributions. Do I really have to rebuild everything from scratch every time?
And if I do project 1 and then project 2 do I have to have the source code of both projects?

To understand my confusion please take a look at the pic

Attachment 14312

Normally in desktop binary distributions, I work on a project, compile it and then write the executable on some directory. Later when I work on a different project I build it and the executable is in another directory. It works incrementally and I don't need to have the original system at all. Even more, I don't even need the source code of project 1, just the binaries to add project 2.

But from what I have read for source based distributions (without a HD) I work on a project, then put it in a directory, use make config to configurate it and then build everything. This will make me a image file 1 that I write on flash

Later if I work on project 2 I have to put it in a directory and then using the original system use make config again and then build everything again to generate image file 2 to write on flash.

In other words I can not use Image file 1 to increment project 2 over it, but instead I have to use the original system files

Is that how it works? Or am I missing something?

Kansai

i92guboj 12-25-2013 06:12 AM

It's hard to guess without knowing exactly what are you comparing against... That would help. What are you used to?

You also are mixing apples and oranges here.

You can perfectly develop an OS based for a microcontroller in any Linux (binary or not), or even in Windows or MacOSX if that's your call. There are also virtual machines, native sdks and that stuff for that.

And you can always cross-compile, of course.

So, what are you exactly trying to do?

Are you maybe developing apps for a mobile phone? Are you developing or hacking an OS for an embedded device? Developing regular applications? Developing drivers? We need to know that.

-----

Now, about source based distributions, what I use and know is Gentoo. This OS is compiled from the Ground, and you have all the source code right there. But that really shouldn't be a thing that will stop you from using your favourite binary distro either. There are -lib and -devel packages in most distros that you can use to get the source of the libraries or applications that you wish, so you can #include them in your projects or something... we would need to know more specific details about "WHY" you need (or why you think you need) the sources of your whole OS.

You can always get them, but maybe you are trying to kill a fly with a bomb here.

-----

About your other question, you really shouldn't need to rebuild most parts of anything nowadays. That's what build systems are for. There's gnu make/autotools/automake, cmake, pmake, nmake, etc. Those should evaluate the dependencies, modification dates et al, and decide what parts of given project need to be rebuilt. All the frontends use this nowadays.

Definitely, you don't need to rebuild your OS each time you compile a program.

Source distros, however, need a way to control ABI breakage. Sometimes, when you update a given lib (let's say SDL or libpng), all or most of the programs that are linked dynamically to that library will remain broken (and won't work) until you recompile them against the new version of the library.

In Gentoo, portage (it's "package manager", to call it something) can take care of that. There's also a now to be deprecated tool to do that, that's called "revdep-rebuild". In Linux From Scratch the one to take over that responsibility would be the user.

In those cases, just like you have to rebuild the OS applications depending on libpng, you would also need to rebuild your program if it depends on libpng.

But I have no idea if that's what you are talking about, since you spoke in such general terms...

I hope this offer at least a starting point to iron the issue a bit. Feel free to ask for details if you need more info. :)


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