Linux From ScratchThis Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.

Notices

Welcome to LinuxQuestions.org, a friendly and active Linux Community.

You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!

Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.

If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.

Having a problem logging in? Please visit this page to clear all LQ-related cookies.

Introduction to Linux - A Hands on Guide

This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.

I have what is probably a somewhat naive question. I've looked through the LFS 6.0 book online up to chapter 6 and I have looked through a number of hints, but I haven't seen this addressed.

What I want to do is set up a LFS system on a 512MB CF card running on a Via Epia-M motherboard. The box will be set up as a firewall/router with my home network behind it. I won't have a lot of space for sources files, etc. on the CF card, so I was wondering if I couldn't just build the LFS system in a directory in my home directory and then dd the system over to the CF card with something like `dd if=$LFS of=/dev/sda1`. The card will be formatted and have a file system already made on it with cfdisk and mke2fs, respectively, the block size on the CF card will match that on the machine I copy the system from, and the card's partition will have the boot flag set. Then I would install the CF card in the firewall box using a CF card to IDE adapter and boot.

Will that work? If not, why not? Is there a hint that I have missed and should read?

The CF card will start out on the same machine, but will end up on a different machine with a different CPU. It will go from an Athlon XP 2500+ to a VIA C3 at 800MHz. So, some cross compiling will probably be required. I will have to figure out how to do that, but there is a cross compiling hint here:

I will also need to take another look at the LFS FAQ, specifically where it talks about the kernel header files and the importance of matching them with the glibc libraries (although I am thinking of using uclibc instead of glibc).

ahh, i remember reading thru uclibc and LFS when i was first using Linux (or any UNIX like or styled OS) ... kinda wanted a good system for my laptop, since i HAD a choice

anyways, if you go with uclibc, use busybox then also, they are almost a pair

read "info gcc", to see the various options to use for the CFLAGS for your system (that you are compiling for ... that link explains the rest pretty good i think)

the main problem with cross compiling, is that you will need to adjust the LFS instructions to suit your needs (as you wont be able to complete it all, theres no way to use the produced software to recompile itself, as it wont be able to run on a PC

don't worry to much about kernel headers, once its compiled you wont be doing compiling on the machine its going to be on i assume?, making the headers, as well as any other programing thing unneeded on the system ...........

I've been looking at busybox. Actually, I stumbled across uclibc while reading up on busybox. I am planning on using it instead of the coreutils. I haven't compared it against the bin-utils or linux-utils yet though.

Good point on the headers, and you are right, I won't be doing a lot of compiling (read: none) on the router/firewall. That's more spaced saved.

This sounds pretty cool though, a while back, a LONG while back I remember talking with Finegan about doing something just like this with a base Slack install and a Sony Memory Stick. The booting was the major issue at hand at the time, not too many mobo's that would boot from a USB device. Cross compiling though, that's a neat obstacle.

Good Luck, sounds good. Maybe you should take a look at doing a LinuxAnswer write up after it's all said and done, it could fill a small niche

Actually, a minimal Slackware install was the first option I considered. I feel comfortable with Slack, and I was pretty sure I could slim it down to get a good workable system on a 512MB CF card. I will still probably do a Slack install on a normal hard drive to use while I put the LFS system together. The SuSE box I am using as a firewall now is beginning to misbehave, and I need a quick interim solution. I am planning to have a number of setbacks with the LFS system build (hey, it'd be silly not to), and to top it off, the CF card to IDE adapter I ordered turns out to not fit my mobo.

A question that came up while I was planning this system is how much swap to plan for. The board has 256MB of RAM. If I go the one to one calculation, that would argue for 256MB swap. That seems silly to me, and I am thinking that maybe I should use that 256MB DIMM in one of my other machines and put a 64 or 128MB DIMM in the firewall box. If I leave the 256MB in there, I probably wouldn't need any swap at all. It is hard for me to imagine that there would really be anything to swap out. If I could pare the system down to less than 256MB, then it might even be theoretically possible to load the whole system into a ramdisk and then unmount the CF card.

get rid of swap, also from what i heard when first starting linux (reading the install instructions for my first distro install, Core Linux), it says its recommended to have the swap space be twice as large as the RAM .... but you shouldn't need swap, personally you should put that 128MB stick in instead ... it wont need that much RAM, you could probably get away with a 64MB stick, as you wont be using it for any RAM intensive things

I'd say no swap, but I disagree with using no RAM. The 256 wouldn't hurt, and because there will be some applications actually running, it would be a good idea to have the extra if it's needed (better to have it and not need it, than to need it and not have it ). Since there will be no swap, the added protection is nice.

definately no swap!! swap will literally destroy your CF card...
I too am compiling an LFS system on my laptop for use on a CF card on an EPIA MS mobo
the epia boards' processors are i386, my first compile doing a i686 sytem worked fine on my Epia board...so i dont see a need for cross compiling...if im wrong please tell me!!