LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This 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


Reply
  Search this Thread
Old 01-20-2005, 08:24 AM   #1
hussar
Member
 
Registered: Oct 2003
Location: Heidelberg, Germany
Distribution: Slackware 11.0; Kubuntu 6.06; OpenBSD 4.0; OS X 10.4.10
Posts: 345

Rep: Reputation: 30
Can I dd a LFS system onto a CF card?


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?
 
Old 01-20-2005, 08:54 AM   #2
SciYro
Senior Member
 
Registered: Oct 2003
Location: hopefully not here
Distribution: Gentoo
Posts: 2,038

Rep: Reputation: 51
no need for dd'ing, use cp or mv (cp best, just in case something goes wrong)

and its perfectly fine, just as long as its on the same machine (unless you know how to cross compile)
 
Old 01-20-2005, 09:15 AM   #3
hussar
Member
 
Registered: Oct 2003
Location: Heidelberg, Germany
Distribution: Slackware 11.0; Kubuntu 6.06; OpenBSD 4.0; OS X 10.4.10
Posts: 345

Original Poster
Rep: Reputation: 30
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:

http://www.linuxfromscratch.org/hint...piling-x86.txt

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).
 
Old 01-20-2005, 10:10 AM   #4
SciYro
Senior Member
 
Registered: Oct 2003
Location: hopefully not here
Distribution: Gentoo
Posts: 2,038

Rep: Reputation: 51
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 ...........
 
Old 01-20-2005, 12:28 PM   #5
hussar
Member
 
Registered: Oct 2003
Location: Heidelberg, Germany
Distribution: Slackware 11.0; Kubuntu 6.06; OpenBSD 4.0; OS X 10.4.10
Posts: 345

Original Poster
Rep: Reputation: 30
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.
 
Old 01-21-2005, 06:14 AM   #6
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Rep: Reputation: 69
All I have to say is:
Geeks!

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

Cool
 
Old 01-21-2005, 01:06 PM   #7
hussar
Member
 
Registered: Oct 2003
Location: Heidelberg, Germany
Distribution: Slackware 11.0; Kubuntu 6.06; OpenBSD 4.0; OS X 10.4.10
Posts: 345

Original Poster
Rep: Reputation: 30
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.

What do you think? What would you recommend to use for swap?
 
Old 01-21-2005, 03:23 PM   #8
SciYro
Senior Member
 
Registered: Oct 2003
Location: hopefully not here
Distribution: Gentoo
Posts: 2,038

Rep: Reputation: 51
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
 
Old 01-22-2005, 01:53 AM   #9
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Rep: Reputation: 69
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.

Cool
 
Old 02-07-2005, 07:57 PM   #10
RobbieB
LQ Newbie
 
Registered: Feb 2005
Posts: 3

Rep: Reputation: 0
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!!
 
Old 02-13-2005, 08:51 PM   #11
pawitp
LQ Newbie
 
Registered: Jan 2005
Posts: 6

Rep: Reputation: 0
You just have to install it to a normal partition. install syslinux on your CF card before copying your linux on to it

NOTE: I HAVE NO IDEA IF THIS WILL WORK!!!
 
Old 02-13-2005, 08:52 PM   #12
pawitp
LQ Newbie
 
Registered: Jan 2005
Posts: 6

Rep: Reputation: 0
EDIT: don't use sys linux, use LILO!

EDIT: ( sorry, didn't see the edit button while post)

Last edited by pawitp; 02-13-2005 at 08:58 PM.
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Building an LFS system from another system z3r0star21 Linux From Scratch 6 11-08-2005 03:13 AM
First LFS system Tez218 Linux From Scratch 1 10-25-2003 12:07 AM
Your LFS system mediab0x Linux From Scratch 3 07-14-2003 05:20 AM
jade install on a lfs system natto34 Linux - Software 0 07-01-2002 03:08 PM
My LFS System Vanished???? jbhoo Linux From Scratch 4 06-05-2002 08:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 07:43 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