LinuxQuestions.org
Review your favorite Linux distribution.
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 06-22-2011, 03:57 AM   #1
lich000king
Member
 
Registered: Jun 2011
Posts: 56

Rep: Reputation: Disabled
Build LFS on one computer and run it on another


Hi

I would like to build my LFS on a computer that has an AMD Phenom CPU. But ultimately this LFS should run on another machine with a C2D.

These architectures are quite similar. Is there anything I need to pay attention to, or do I not need to worry about this at all?

Or put differently, is there any benefit of building on the second machine in the first place?

The main reason I want to build on the AMD machine: it is a lot faster.

I have already gone through LFS 6.8 using ubuntu 11.04 as host on said AMD machine successfully.
 
Old 06-22-2011, 04:31 AM   #2
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
If you don't use any CPU-specific optimizations you should be fine.
 
Old 06-22-2011, 06:12 AM   #3
lich000king
Member
 
Registered: Jun 2011
Posts: 56

Original Poster
Rep: Reputation: Disabled
Thanks for the quick reply.
The only CPU-specific optimizations I can remember are in the "Processor type and features" entry in the kernel config.

So should I just select 386 as processor family?

Last edited by lich000king; 06-22-2011 at 06:15 AM.
 
Old 06-22-2011, 06:22 AM   #4
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
With Phenom and C2D CPUs I would go for 64 bit, but you can also go for 32 bit. I would choose i686 as common base. Don't forget to compile in the drivers you need for the second machine.
There are also possibilities to compile for a specific CPU with other software than the kernel if you use the -mcpu and -march options of the compiler.
 
Old 06-22-2011, 06:54 AM   #5
lich000king
Member
 
Registered: Jun 2011
Posts: 56

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by TobiSGD View Post
With Phenom and C2D CPUs I would go for 64 bit, but you can also go for 32 bit. I would choose i686 as common base.
There is no "i686" entry, there is only a "586/K5/5x86/6x86/6x86MX", but I think that is not the same.
(I am looking at the 2.6.39.1 kernel configurator.)
 
Old 06-22-2011, 07:03 AM   #6
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
Go for Pentium Pro, that is the i686. Both processors you have (and every other i686-capable CPU) will be able to work with that code.
 
1 members found this post helpful.
Old 06-22-2011, 09:40 AM   #7
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

A few possible attention points that come to mind:

- make sure your partition layout is the same on both boxes or adjust your fstab (if you use uuid's, see next comment),
- if you used uuid's in your grub config you need to change these, or switch back to device names,
- if you have created/fixed any udev rules, make sure they are still correct/relevant.

The above depends on when you are going to switch from one box to the other, but you might want to keep them in mind.

Hope this helps.
 
1 members found this post helpful.
Old 06-22-2011, 11:06 AM   #8
lich000king
Member
 
Registered: Jun 2011
Posts: 56

Original Poster
Rep: Reputation: Disabled
Thanks for your answers, both of you.

Regarding the partition layout: I have thought about this and come to the following conclusion:

On the host PC I don't necessarily need to boot into lfs, I can do everything from the chroot environment. Therefore I can create fstab as if I were already on the other machine.

I intend to get lfs to the new machine by making a disk image (using an acronis true image live cd) and restoring it to the new hard disk.

One thing I am not yet sure about is, how I can install grub to work on the new machine without breaking the existing grub on the host.
Maybe I can just install grub to MBR on the new machine using a live CD like
http://www.supergrubdisk.org/rescatux/ and not do anything about it on the host?
 
Old 06-22-2011, 02:18 PM   #9
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,
Quote:
Originally Posted by lich000king View Post
One thing I am not yet sure about is, how I can install grub to work on the new machine without breaking the existing grub on the host.
Installing the grub package can be done on your host, configuring it and writing to MBR can be done at a later point, using any live CD.

Once the LFS image is on the new machine's hard disk, boot from the live CD, chroot into LFS and do the grub configuration.

At this point you could also:
- re-do the kernel build if you want/need to.
- re-check your device layout.

Hope this helps.
 
1 members found this post helpful.
Old 06-22-2011, 02:42 PM   #10
lich000king
Member
 
Registered: Jun 2011
Posts: 56

Original Poster
Rep: Reputation: Disabled
Great, I will do it exactly like this.

Thank you very much!
 
Old 06-24-2011, 08:59 AM   #11
lich000king
Member
 
Registered: Jun 2011
Posts: 56

Original Poster
Rep: Reputation: Disabled
Edit: see below

Ok, the grub part worked very well.

But now I have a network probem. At boot I get:
"interface eth0 does not exist"
three times in a row.

My guess was the driver was missing, so I recompiled the kernel (on the new machine), installing all the network drivers as modules, just to be on the safe side. Then I redid the dhcpcd-4.0.11 and DHCP-3.0.6 chapters from BLFS (svn-20110620) and also deleted the ipv4 file.

However, this did not solve the problem, I still get the same error (twice now).

The network controller is a standard gigabit onboard one working in every recent Linux distro, so the driver is certainly contained in the kernel.

What am I missing?

Edit:
I think I should have read
http://www.linuxfromscratch.org/lfs/...nown-interface

Updating /etc/modules.conf should do the trick. Though I was under the impression recompiling the kernel should a least install the driver for the network card in the computer from which it is rebuilt. On the old computer I did not install any extra drivers and it worked??

Last edited by lich000king; 06-24-2011 at 09:17 AM.
 
Old 06-24-2011, 09:57 AM   #12
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,
Quote:
Originally Posted by lich000king View Post


Personally I like my kernel's as small and as static (= no/minimal modules) as possible. And too be honest I only have a basic understanding of automated device handling using modules during installalation. I do believe that activating all, in this case, network interfaces as module isn't enough to activate the correct one automatically at boot. Maybe someone else also reads this and can explain in more detail.

I'm not sure if using a module was a conscious choice made by you. I would rather not use the module, but build it statically, no extra stuff is needed. If the specific card is present in your system it will be picked up (enabling all network devices as static is an option, the correct one is still automatically used, but there is a possibility of warning messages thrown by the cards that are not found).

I would advise you to disable the modules/static entries you don't need once you know which card is used.

Hope this helps.
 
Old 06-28-2011, 01:22 PM   #13
lich000king
Member
 
Registered: Jun 2011
Posts: 56

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by druuna View Post
Personally I like my kernel's as small and as static (= no/minimal modules) as possible.
So do I.
Installing all the drivers as modules was more like an experiment, to see if it will work.
Now I have gone though LFS again, this time the SVN version (20110620).
I identified the correct driver in the kernel config and installed it (not as a module).

But now I have a grub problem again.
I bootet from liveCD, chrooted and did exactly as described here:
http://www.linuxfromscratch.org/lfs/...er08/grub.html
except I used /dev/sda1

When I reboot, I get one (correct-looking) grub entry. But when I hit enter, I get:
Code:
error: File not found
But what file?

I have seen GRUB was updated to 1.99 in SVN 20110626, but as far as I can tell, this should not make a difference, I haven't tried yet.
 
Old 06-28-2011, 01:40 PM   #14
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,
Quote:
Originally Posted by lich000king View Post
But now I have a grub problem again.
I bootet from liveCD, chrooted and did exactly as described here:
http://www.linuxfromscratch.org/lfs/...er08/grub.html
except I used /dev/sda1

When I reboot, I get one (correct-looking) grub entry. But when I hit enter, I get:
Code:
error: File not found
But what file?

I have seen GRUB was updated to 1.99 in SVN 20110626, but as far as I can tell, this should not make a difference, I haven't tried yet.
I'm guessing that it is looking for /boot/vmlinux-2.6.39.2-lfs-SVN-20110626

Is your /boot/grub/grub.cfg correct? If you used /dev/sda1 and did not use a separate /boot partition, it should look something like this:
Code:
# Begin /boot/grub/grub.cfg
set default=0
set timeout=5

insmod ext2
set root=(hd0,1)

menuentry "GNU/Linux, Linux 2.6.39.2-lfs-SVN-20110626" {
        linux   /boot/vmlinux-2.6.39.2-lfs-SVN-20110626 root=/dev/sda1 ro
}
The bold parts should be the same.

Hope this helps.
 
Old 06-29-2011, 12:52 PM   #15
lich000king
Member
 
Registered: Jun 2011
Posts: 56

Original Poster
Rep: Reputation: Disabled
That's exactly it. The file in /boot/ is called vmlinux-2.6.39.2-lfs-SVN-20110620, which is a bit strange. SVN-20110620 contained kernel 39.1, SVN-20110626 contains kernel 39.2.

Now I used the correct filename in grub.cfg.
Et voilą, it boots and the network is also working!

Thanks again!

Edit:

And even more specifically:
The file that needs to be in /boot/grub/grub.cfg is simply the one created after compiling the kernel:
http://www.linuxfromscratch.org/lfs/...08/kernel.html

Code:
cp -v arch/x86/boot/bzImage /boot/vmlinux[...]

Last edited by lich000king; 07-02-2011 at 09:38 AM.
 
  


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
WEEHOOO! Build my first LFS BroX Linux From Scratch 1 02-17-2011 01:28 AM
How long did it take you to build your LFS? cynicalpsycho Linux From Scratch 4 05-19-2009 01:26 PM
Build LFS successfully PhillipHuang Linux From Scratch 2 03-13-2008 10:42 AM
Will compiling LFS on an 64 bit distro build an 64 bit LFS? Vampirite Linux From Scratch 4 08-31-2007 02:48 PM
How to build LiveCD from LFS isilinux Linux From Scratch 1 08-24-2005 03:45 AM

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

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