LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Minimal Linux install just to learn (https://www.linuxquestions.org/questions/linux-newbie-8/minimal-linux-install-just-to-learn-4175456159/)

d7909 03-30-2013 11:35 AM

Minimal Linux install just to learn
 
Hi,

I've been working a while now with Linux and want to learn more. So i've been reading up on kernels compiling and all and am busy installing LFS while typing this.

Usually a couple of questions pop up that I can answer myself by googling it. But some don't:

* When compiling a program, should it always place it's binary in /bin (for instance) or does the user always have to do this himself. (or does it depend on the software)

* While installing LFS, I'm apparently compiling stuff I don't think I need. Theoretically, would it be possible to just compile stuff I need (kernel, bash, busybox) copy it to an SD card for instance, make it bootable and then boot from it?

DavidMcCann 03-30-2013 12:45 PM

The low-level stuff you're compiling in LTS is mostly going to wind up in /bin or /sbin. Applications can go in various places, but many (most?) are not relocatable and their target will be set in the install section of the make file.

I'm no expert on LTS — I soon gave up — but I'd be inclined to follow the instructions to the letter. You may not think you need something, but software can have the strangest dependencies.

rabirk 03-31-2013 09:33 AM

I agree with DavidMcCann. You should follow the LFS instructions as written. They supposedly result in a rather basic Linux system. You won't end up with a lot of unnecessary "stuff." I also haven't made it through the process, but one of these days when I have time and a bit more motivation I'll try again.

If you want to see what a base system is like, you can install the base packages of Slackware (package A), or load ArchLinux. Both are pretty basic until you add stuff on.

TobiSGD 03-31-2013 09:47 AM

You should follow the LFS manual at least the first time you install it, if you have understood how the basic Linux system that you get works feel free to experiment with it.
If you just want to run a really basic system without going through LFS it is even sufficient to just copy the parts you need from an existing Linux install.
For example, for a minimal special purpose system that I needed to built I just used Slackware's mkinitrd tool to create a basic file-system tree, then copied the programs that I needed into that tree and modified the startup script so that it did what I wanted. Then I just compiled a kernel and gave it the generated tree as inbuilt filesystem.
Another approach could be the Slitaz scratchbook to get a minimal system up and running: http://www.slitaz.org/en/doc/scratchbook/

mreff555 03-31-2013 02:05 PM

What you have to remember is that a lot of that stuff you are installing you don't need as a user. However it may satisfy a dependance for something you do need. For instance. you'll install quite a few libraries which you may never use before building gcc. But you can't build gcc without them. some linux distros don't even include gcc in the release because if you are using a package manager that just installs binaries, and you aren't a developer. you don't really need it. Bottom line, you may not need some of those programs when you are done, but if you actually want to learn, you should try to learn why they were installed in the first place. You'll have plenty of time to look it up while you are compiling :)

To answer your other questions.
1. maybe. If you run "make install" the program will install at the prefix defined in the configuration script. This means that if your prefix is /usr all binary files will go to /usr/bin or /usr/sbin
LFS tells you how to set your prefixes. For the most part. Most programs end up where they should without the prefix argument but you should probably follow their instructions.

2. Yes. It is possible, most installs of linux are just that. Precompiled binaries which are somewhat transparently configured.
If you want a minimal setup like this to start from give gentoo a try. With gentoo you download "Stages" basically a really basic set of commands and the package manager which compiles everything on the fly. Next you tweak it so it's bootable, boot in to your os and install whatever you want. In my opinion, if you want to start from bare bones but have a working system in 3 hours, that's the best way to do it.

jefro 03-31-2013 06:34 PM

I agree with the others ideas and suggestions.


"* When compiling a program, should it always place it's binary in /bin (for instance) or does the user always have to do this himself. (or does it depend on the software)"

Many people compile stuff still today for many reasons. Where the program is compiled from usually has only to do with access to other tools. One can generally compile any program in any sub directory if they also know how it is used or needs. Many a system has been compiled in wrong locations and then fixed later.


My guess is that LFS is just trying to let you create some of the basic tools one might find in /bin. Simple tools end up there mostly but totally important to the system or user at least. So as to not confuse you, they compile the program where it will reside later.

d7909 04-01-2013 05:18 AM

Thanks for the answers guys.
Clears things up a bit for me.


All times are GMT -5. The time now is 04:39 AM.