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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,150
Rep:
Before you start patching the kernel source make sure it is a problem with the kernel and not just a config problem, if possible use a working config ie the slackware huge config ( there are plenty of links on this forum about it).
I have never had to patch the kernel, just get the config right.
Never use a RAMDisk (initrd) with B/LFS until you fully understand your system and hardware. To be perfectly honest with you, using the larger memory footprint feature-filled style kernels like Slackware-Huge with B/LFS is actually recommended. After you learn how to trim your kernel of non-required drivers, modules, and features you don't need, using an initrd really becomes questionable. You're only reducing the size of the kernel itself and assigning more to loadable modules, not the memory footprint.
Of course i'm in this situation due to my inexperience but this is also the reason of this try (i could install a user friendly distro but i don't want it). I want to make my life difficult and learn.
I was not able to patch the kernel or use a huge config file but i can work on it reading some documentation. I skipped also the 8.4 step of lfs book (Using GRUB to Set Up the Boot Process) because i prefer boot from an usb pen drive (i installed supegrub2 on it via xp). I remember many years ago i put lilo on a floppy and i had never a problem in this way, but if this is the problem i can put grub on the mbr. Any suggestion is welcome.
root:/# ls /boot/
config-3.13.3 System.map-3.13.3 vmlinuz-3.13.3-lfs-7.5
...but if this is the problem i can put grub on the mbr.
That's not a requirement, so that by itself shouldn't really help. Something else is wrong. I too have seen that console output before, but I can't remember specifically what I was doing at the time.
If you don't figure this out on your own, I recommend returning to post more detail such as the output of fdisk -l, the contents of /etc/fstab, the actual grub commands being used to attempt booting. You also can upload that config-3.13.3 file as an attachment (append .txt to it). If it's not obvious from the fdisk output, is the drive external? If you are choosing the Super Grub Disk pendrive from a splashscreen menu, consider the possibility that your drive enumeration may be different from what you expect. Consider using UUIDs or LABELs in /etc/fstab instead of device names. I imagine the issue will be found buried somewhere in that kind of information. Maybe somebody will be able to see it.
Of course i'm in this situation due to my inexperience but this is also the reason of this try (i could install a user friendly distro but i don't want it). I want to make my life difficult and learn.
I was not able to patch the kernel or use a huge config file but i can work on it reading some documentation. I skipped also the 8.4 step of lfs book (Using GRUB to Set Up the Boot Process) because i prefer boot from an usb pen drive (i installed supegrub2 on it via xp). I remember many years ago i put lilo on a floppy and i had never a problem in this way, but if this is the problem i can put grub on the mbr. Any suggestion is welcome.
root:/# ls /boot/
config-3.13.3 System.map-3.13.3 vmlinuz-3.13.3-lfs-7.5
O-K, there is no initrd file in your boot directory- and from the screenshot you posted, it looks as though you are having a kernel panic because of that fact.
I wouldn't fool with the kernel; the kernel is not the problem. If it's not a huge kernel, you need a initrd [ram disk] file for the kernel to boot successfully. Did you somehow skip the step where the inti file is built? (Just looking through the table of contents of the LFS book, I see that there is an entry for "initool"- I have a feeling that the answer to your problem has to do with the use of that)
Where are all the LFS users, here? I'll bet someone who is familiar with the intimacies of LFS could figure this out 1-2-3.
EDIT: Looking at the sample GRUB configuration in the LFS book, it doesn't look as though the standard kernel needs an init. Maybe just check the configuration of your boot loader, and make sure it points to the proper place and that the kernel is specified correctly- if nothing else, to at least rule-out the possibility of there being an error there.
...it doesn't look as though the standard kernel needs an init.
The BLFS book provides for a way to create an initial ram filesystem, but it generally is not needed. Since an LFS builder knows in advance what hardware and filesystems exist, there is no need to provide modules for the thousands of possible things like that and copy them all into an initial ram filesystem so they all can be available to the kernel before the root filesystem is mounted (like a typical distro has to do). Instead, an LFS builder configures the things needed by the kernel at boot time for the particular hardware to be built-in to the kernel. All that's really needed at this early point in booting are storage and filesystem drivers. Usually, a few particular drivers in the SCSI, SATA, and PATA sections of the kernel config are needed. If the drive is USB, then the USB core, port, and mass storage stuff should be built in. And the filesystem drivers should be built in. Anyway, most of that stuff can be discovered by studying what modules the host system loads and uses. The LFS book's kernel chapter gives advice on getting started and some links to additional detail.
P.S.: I had to recompile my first LFS kernel probably thirty times because of things like what's going on right here. I hate to sound negative, but there's no use pretending either. See, this booting thing is only the beginning. Once it boots, then comes video.
The BLFS book provides for a way to create an initial ram filesystem, but it generally is not needed. Since an LFS builder knows in advance what hardware and filesystems exist, there is no need to provide modules for the thousands of possible things like that and copy them all into an initial ram filesystem so they all can be available to the kernel before the root filesystem is mounted (like a typical distro has to do). Instead, an LFS builder configures the things needed by the kernel at boot time for the particular hardware to be built-in to the kernel. All that's really needed at this early point in booting are storage and filesystem drivers. Usually, a few particular drivers in the SCSI, SATA, and PATA sections of the kernel config are needed. If the drive is USB, then the USB core, port, and mass storage stuff should be built in. And the filesystem drivers should be built in. Anyway, most of that stuff can be discovered by studying what modules the host system loads and uses. The LFS book's kernel chapter gives advice on getting started and some links to additional detail.
P.S.: I had to recompile my first LFS kernel probably thirty times because of things like what's going on right here. I hate to sound negative, but there's no use pretending either. See, this booting thing is only the beginning. Once it boots, then comes video.
Thank you for taking the time to explain that to me. It makes sense. (I like the idea of LFS very much. Just have what you want/need; tailored specifically to your machine. But I'm not going anywhere near LFS- I'll be lucky if I can successfully figger[sic]-out how to install packages in Slackware! )
What I don't understand, is why a typical distro can't install what one's specific machine needs...and then discard the 98% of the other junk that it doesn't need. It's like when you install printer support on Crunchbang. It downloads EVERY printer driver known to man, for every printer ever made since Gutenberg- all to install one lowly driver! What is the point of that? I mean, why can't it just determine what driver you need, and just download ONE- or at least discard the 99,999 ones you don't need, after it installs the one you do need? Maybe I'm mising something- or my understanding is still too simplistic- but some of these things just don't make sense.
The Linux kernel is generally very good at loading the modules needed by the hardware it discovers. We rarely have to give it any help with that. But the modules needed by the hardware have to be present for the kernel to load them. They exist in /lib/modules. Since the distros are aiming at everybody out there, they have to build a lotta lotta modules. The kernel figures out which modules are needed and loads them. All of the others sit there in /lib/modules waiting for something that is never coming (a call to be loaded and used). That's just the way it has to be for a distro intended to be installed as is by just anybody out there. But people who know how to compile a custom kernel can decide to build something into the kernel, or build it as a module, or not build it at all. For example, I build my Ethernet driver as a module and unselect all of the others. Same for all the wireless drivers. And so on. I like modules where possible. I like seeing that stuff listed in lsmod. I build stuff into the kernel when it's needed before the root filesystem is mounted. I try not to build things at all if I will never need them. But there is so much stuff in there nowadays that I will probably never stop learning how to configure a kernel. I keep detailed notes (sort of a diagram) and it has never stopped growing.
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,150
Rep:
Quote:
Originally Posted by stoat
...I like modules where possible....
Just to show we are all different here I don't use modules if at all possible, I like to compile it directly into the kernel, of course I only select what I need.
Today was a day away from home .. next days i will start working on it. I think the problem is in the config file, probably i need something for my hardware that i haven't now; i'm not sure but i would start from here and i need time for some tests.
No external hd. I have 2 hd, i created a partition in the first hard drive where i hold xp.
[root@paldo:/]# fdisk -l
Disk /dev/sdb: 279.5 GiB, 300090728448 bytes, 586114704 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00000001
Device Boot Start End Blocks Id System
/dev/sdb1 16065 586099394 293041665 f W95 Ext'd (LBA)
/dev/sdb5 16128 586099394 293041633+ 7 HPFS/NTFS/exFAT
Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x0e2f0e2e
Device Boot Start End Blocks Id System
/dev/sda1 * 63 881534744 440767341 7 HPFS/NTFS/exFAT
/dev/sda2 881534745 974422574 46443915 83 Linux
/dev/sda3 974422575 976773167 1175296+ 82 Linux swap / Solaris
Disk /dev/sdc: 3.8 GiB, 4020240384 bytes, 7852032 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x04030201
Device Boot Start End Blocks Id System
/dev/sdc1 * 1104 7852031 3925464 b W95 FAT32
[root@paldo:/mnt/lfs/etc]# cat fstab
# Begin /etc/fstab
# file system mount-point type options dump fsck
# order
Maybe. I looked through the config file, and to me you have built-in what you probably need to boot. This also could be a simple GRUB issue.
A simple and quick experiment (if you want to do it) would be to boot with the pendrive again. At the Super Grub Disk boot menu, press the "c" key to get the grub> prompt. Then enter these commands at the prompt...
Code:
grub> linux (hd0,2)/boot/vmlinuz-3.13.3-lfs-7.5 root=/dev/sda2 ro
grub> boot
If the same thing happens again, then try again with this (change only the red part)...
Code:
grub> linux (hd0,2)/boot/vmlinuz-3.13.3-lfs-7.5 root=/dev/sdb2 ro
grub> boot
Then this...
Code:
grub> linux (hd0,2)/boot/vmlinuz-3.13.3-lfs-7.5 root=/dev/sdc2 ro
grub> boot
What I'm getting at is that it's at least possible that the operating system is enumerating the partition in a way that GRUB and you don't expect. Anyway, it's completely harmless and changes nothing in the system to try.
P.S.: If none of those three tries succeeded, then take a moment to confirm that the GRUB device (hd0,2) was right for the experiment (I guessed at that). This at the grub> prompt will answer that...
Code:
grub> search -f /boot/vmlinuz-3.13.3-lfs-7.5
If that reveals something other than (hd0,2), then try the three tests again with the new GRUB device name to see if one boots the system. If that happens, then I recommend that you stop using the pendrive to boot and install a permanent boot loader (your choice) to boot XP and LFS. Just my opinion.
Ok friends, i have an update.
As i said i started with a config file and my choise was for a .config paldo linux (i used this live cd for lfs). At boot i have good informations.. "cannot open root device UUID="4ec08b33-ec9e-4a2e-b01b-a767796973b4" Please append a correct "root=" boot option.
"I have a bootloader problem" i think and i edit my fstab:
I don't like it, i never used a similar fstab but ok.. "if it works no problem" i think. I also create a /boot/grub/grub.cfg
set default=0
set timeout=5
insmod ext2
set root=(hd1,2)
menuentry "GNU/Linux, Linux 3.13.3-lfs-7.5" {
linux /boot/vmlinuz-3.13.3-lfs-7.5 root=4ec08b33-ec9e-4a2e-b01b-a767796973b4 ro
After reboot i have a cpu warning and so i would try a second option, the slack config file.
With this file the boot happens but i have many "fail", i upload some screenshots (the first three are related to boot, the last after shutdown). It happened a while ago and i had no time yet to investigate solutions (i will do it) but of course if meanwhile you have any suggestions i'm here!
Well, many problems but i'm very happy!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.