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.
Hi all, this is my first post on this forum but I've found a lot of useful answer here in this days.
I'm tryng to create a small LFS installation on a usb drive as base for my degree project.
I've successfully installed LFS on a virtual machine and transferred it to my usb pendrive using rsync.
It boots, but my grub.cfg is this:
linux /boot/vmlinuz-3.2.6-lfs-7.1 rootdelay=20 root=/dev/sdb1 ro
}
I will use UUID (or label) only to boot on any machine, to do that I have to create an initrd file or build all needed modules in the kernel (right?), but which are the needed modules?
Looking at some tutorial seems that I have all I need, but my LFS gives a kernel panic if I remove /dev/sdb1.
I'm using Linux From Scratch 7.1 with kernel 3.2.6
Thank you all in advance and sorry for my english.
Are you installing from usb or to the usb drive?
You set boot to hd0,1 which would be sda but you set root to sdb1
Correction you set root to (hd,1) then /boot/vmlinuzxxxxxroot sdb1
I have LFS already installed on my pendrive, and it works but I want a booloader able to run my installation on any computer without modify menuentry.
"set root=(hd0,1)" outside the menuentry is a remains of LFS default bootloader, thank you for the advice I removed it.
However seems that " set root='...' " inside menuentry has no effect on grub: I've done several trials and I can boot with "hd0,1" "hd1,1" "hd0,msdos1" "hd1,msdos1" and no "set root= ..." and all times my LFS starts.
Probably is overrided by the option " --set=root <UUID> "
Now I use a menu entry like this:
Quote:
menuentry 'GNU/Linux, with Linux 3.2.6-lfs-7.1'
{
search --no-floppy --fs-uuid --set=root b0705ec1-d02f-41d9-8bbd-8caf1cd02d70
linux /boot/vmlinuz-3.2.6-lfs-7.1 rootdelay=20 root=/dev/sdb1 ro
}
but I think that I cannot boot on a pc with two hdd, because my pendrive becomes sdc device.
The pc would have to be set to boot from usb 1st not harddrive 1st
The boot in bios order is CD -> USB -> HDD and it works.
My problem is that in device order the USB in placed after HDDs, I even changend the boot order in USB -> CD -> HDD but the pendrive still remain /dev/sdb.
I don't know if this is a standard or not, but means that grub cannot recognize the boot partition on some machines.
I know that I can simply change the menuentry from grub pressing 'e', but is not the optimal solution, so I'm looking to use UUID or label instead of /dev/sdXY. Even a workaround is a good solution.
Mine is set the same as you but it is permenantly connected to machine so no problem.
What would happen if you added extra menuentry allowing for different options maybe add an entry root=/dev/sdc1 /dev/sdd1 just thinking out loud
What would happen if you added extra menuentry allowing for different options maybe add an entry root=/dev/sdc1 /dev/sdd1 just thinking out loud
Could be a solution, but not the most elegant. Is mine plan C
My ideas is to create a menuentry like this:
Quote:
menuentry 'GNU/Linux, with Linux 3.2.6-lfs-7.1'
{
search --no-floppy --fs-uuid --set=root b0705ec1-d02f-41d9-8bbd-8caf1cd02d70
linux /boot/vmlinuz-3.2.6-lfs-7.1 rootdelay=20 root=b0705ec1-d02f-41d9-8bbd-8caf1cd02d70 ro
}
To do that I need to compile some modules into the kernel, but I'm not able to find a list of them.
Should be file system modules, USB mass storage, USB UHCI, USB OHCI and some scsi modules, but are yet built in a default recent linux kernel.
Another solution is to create a initrd image, and I have found this tutorial, but in LFS you shouldn't need an initrd, so this is plan B.
Edit:
another question: the configuration loaded by menuconfig is standard for a kernel version or is generated using machine information or host system information?
I'm not shure, but I think that the default configs loaded for linux 3.2.6 in VM and in my physical system are a bit different.
Last edited by Alessandro.Valentini; 10-28-2012 at 08:01 AM.
The boot in bios order is CD -> USB -> HDD and it works.
My problem is that in device order the USB in placed after HDDs, I even changend the boot order in USB -> CD -> HDD but the pendrive still remain /dev/sdb.
A flash drive is usually recognized as hdd in bios
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.