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.
Dear kostya ,
I have not any HDD and i want to boot from my USB Stick ,
At first i bootabled my usb stick with syslinux and then copy all of LFS_LiveCD files to it ,
I configured syslinux.cfg with :
label linux
kernel linux root=UUID=07E6-1968 init=/sbin/init
append initrd=initramfs_data.cpio.gz
BUT when i booted from it these message was notified !
LFS LiveCD could not find its device.
Dropping you to a shell.
Please load the needed modules and, optionally, make /dev/lfs-cd a symlink pointing to the correct device.
I've made a bootable USB stick with LFS on it.
I used grub and installed it to the boot sector of the USB stick.
The most important part was however the initial ramdisk.
The key to the success was having the ramdisk run a script to find the root system.
It kept mounint every system until it found the LFS root and changed to this.
I reckon that the shell you get is part of the initial ramdisk.
That means that you have initial ramdisk support and could make a ramdiks to find the root.
I hope you find this quick reply a helpfull start.
Maybe there are better methods (although I saw a similar method on a KNOPPIX CD).
However, if you have some more question, feel free to ask.
Hint , When i put a LFS-LivCD on my cdrom the booting of USB Stick was TRUE , This means that LFS search for root.ext2 on CD-ROM , We must point it to USB Stick .
The advantage of GRUB2 is that it can actually boot from ISO image. I've done that with a number of images of different LiveCD distros, all of them on one USB stick. I'll try now with LFS one and report back .
Also , memdisk ( syslinux compatible ) can do it with iso images BUT unfortunately booting directly from iso image (with grub or memdisk) needs more memory .
I don't know how i can mount /dev/hda1 as /dev/lfs-cd on kernel appending ...
If we customize init file and force kernel to append USB stick , Booting will complete .
OK, but there's a README on the LiveCD itself.
It says these interesting things:
Quote:
BOOTING FROM ISO IMAGE
If you want to boot this CD on a computer without a CD-ROM drive, follow the steps below.
Store the ISO image of this CD as a file on a partition formatted with one of the following filesystems: vfat, ntfs, ext2, ext3, ext4, jfs, reiserfs, reiser4, xfs
Copy the boot/isolinux/{linux,initramfs_data.cpio.gz} files from the CD to your hard disk
Configure the boot loader to load “linux” as a kernel image and “initramfs_data.cpio.gz” as an initrd. The following parameters have to be passed to the kernel:
where /dev/XXX is a partition where you stored the LiveCD image, and fs_type is the type of the filesystem on that partition. You may also want to add “rootflags=…” option if mounting this partition requires special flags.
If there is only Windows on the target computer, please use grub4dos as a boot loader. It is available from http://sourceforge.net/projects/grub4dos.
MAKING A BOOTABLE USB DRIVE
Install GRUB on a flash drive, then follow instructions in the “BOOTING FROM ISO IMAGE” above, using a partition on your flash drive. The following tips will ensure that the flash drive is bootable in any computer:
Use the persistent symlink such as “/dev/disk/by-uuid/890C-F46A” to identify the target partition.
Add “rootdelay=20” to the kernel arguments.
from which I derive that we must try, when booting from a USB stick, to supply this argument to our kernel line:
Code:
linux /boot/isolinux/linux rw root=iso:/dev/disk/by-uuid/0451-5CDC:/lfslivecd.iso rootfstype=vfat rootdelay=20
Well, it is the worst case possible:
it doesn't work the way the README suggests! In fact, the kernel (linux) doesn't understand not only such complicated command line as
OK, I managed to boot it this way(part of grub2 config:
Quote:
set root=(hd0,1)
linux /linux64
initrd /initramfs_data64_cpio.gz
append rw root=iso:/dev/disk/by-uuid/0451-5CDC:/lfslivecd.iso rootfstype=vfat rootdelay=20
This way it boots up to the message form init that it can't find its LiveCD and therefore drops me to the shell. Which is strange, because at this stage all the needed devices are here and lfslivecd.iso absolutely available to use as root filesystem. Perhaps some more fine tuning of this process will bring some satisfaction?
We just CAN'T stop at this point where we are almost there .
I had a quick galnce at the init file, that creates your error.
It is strange that mknod is ran.
You specified an iso file using "iso:*", which should do the trick.
BTW, are you sure taht initrd should be on the append line as well?
Could you perhaps try this: (that's grublike structure)
The stupid thing is that mknod is not included in the image.
However, normally this shouldn't bother you, because iso mounting doesn't need it.
But that's just a sidenote.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.