LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 04-08-2015, 02:57 PM   #1
tduck
LQ Newbie
 
Registered: Apr 2015
Posts: 3

Rep: Reputation: Disabled
Make LFS iso bootable using isolinux


I have a slightly configured version of LFS 7.7, and would like to make an iso image using it. I've managed to copy the files to a separate directory called CD_root using cp -a, and have set up isolinux as described in the Syslinux wiki. When I try to run it in a virtual machine, it starts isolinux, but can't find my kernal. Right now, my isolinux.cfg file is as follows:

Code:
  DEFAULT linux
    SAY Now booting the kernel from SYSLINUX...
  LABEL linux
    KERNEL /boot/vmlinuz-3.19 
    APPEND ro root=/dev/sda1
My kernal image is stored at /boot/vmlinuz-3.19 as shown above, but it tells me that there is no such file or directory.
 
Old 04-09-2015, 05:53 AM   #2
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
Try loop mounting the generated iso file.

Code:
mount -o loop,ro -t iso9660 cd.iso /mnt
And view whether you definitely have kernel in boot directory.
 
Old 04-09-2015, 12:38 PM   #3
tduck
LQ Newbie
 
Registered: Apr 2015
Posts: 3

Original Poster
Rep: Reputation: Disabled
It seems that many of the files in my disk image were renamed using the command when I made the ISO image.

Below are a couple commands to show what I mean.

Code:
$ ls /mnt/boot
config_3.19  system_m.19  vmlinuz_.19

$ ls CD_root/boot/
config-3.19  System.map-3.19 vmlinuz-3.19
When opened using file-roller, the files in the iso are as when they were mounted.

The command I used to make the iso image was

Code:
mkisofs -o output.iso \
   -b isolinux/isolinux.bin -c isolinux/boot.cat \
   -no-emul-boot -boot-load-size 4 -boot-info-table \
   CD_root
Can you please explain what I did wrong, and what I can do to fix it?
 
Old 04-09-2015, 06:28 PM   #4
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: Slackware64-15.0 Multilib
Posts: 6,558
Blog Entries: 15

Rep: Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097
Basically this is normal behavior.

If you look at the isolinux compile for Slackware it renames many of the file names to actually have certain extensions like .bin, .s, etc. This is nothing new technically.

You kinda have to anticipate the rename actually and assign the boot as such. Slackware's repository's /sources/installer has some hints as well as /isolinux on how it all works. Use it as a reference if needed.
 
Old 04-09-2015, 11:37 PM   #5
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
You have to rock ridge protocol extension while making iso file. Just pass '-r' at begining of mkisofs.

And I don't remember now, but there is help page within syslinux sources about what isolinux supports -iso-level parameter of mkisofs.

I usually run 'mkisofs -r -iso-level 2 ...' to make boot cd. Try it. May be now isolinux gets correct filename. Else change your kernel name to 8 letter name followed by dot followed by 3 letter name. E.g. 'vmlinuz.319'.
 
Old 04-10-2015, 03:15 AM   #6
Krejzi
Member
 
Registered: Jan 2015
Posts: 215

Rep: Reputation: Disabled
Quote:
Originally Posted by tduck View Post
I have a slightly configured version of LFS 7.7, and would like to make an iso image using it. I've managed to copy the files to a separate directory called CD_root using cp -a, and have set up isolinux as described in the Syslinux wiki. When I try to run it in a virtual machine, it starts isolinux, but can't find my kernal. Right now, my isolinux.cfg file is as follows:

Code:
  DEFAULT linux
    SAY Now booting the kernel from SYSLINUX...
  LABEL linux
    KERNEL /boot/vmlinuz-3.19 
    APPEND ro root=/dev/sda1
My kernal image is stored at /boot/vmlinuz-3.19 as shown above, but it tells me that there is no such file or directory.
Most distros also keep the kernel in cdrom_root/isolinux, so they just have to specify KERNEL vmlinuz ... Don't use / on a cdrom device, use relative path to cdrom_root/isolinux, ie ../boot/vmlinuzz ...
 
Old 04-10-2015, 11:18 AM   #7
tduck
LQ Newbie
 
Registered: Apr 2015
Posts: 3

Original Poster
Rep: Reputation: Disabled
I got it to start booting the kernel using ReaperX7's recommendation of anticipating the new name. Now my isolinux.cfg file looks like this:
Code:
  DEFAULT linux
    SAY Now booting the kernel from SYSLINUX...
  LABEL linux
    KERNEL /BOOT/VMLINUZ_.19
    APPEND ro root=/dev/sda1
However, when I try to start it in a virtual machine, the kernel crashes in less than a second.
Code:
[    0.985154] ---[ end Kernel panic - not syncing: VFS: Unable to mount on unknown-block(8,1)
This leads me to believe that it is having problems figuring out where to mount the live cd filesystem. I've done some research, and it seems that my method for creating a live cd is so primitive and obscure that there really is very little documentation. I feel like like the problem is simple, like changing my /etc/fstab file, but I don't know where it should be mounted. If the problem is more complex than just modifying a file or two, I'm totally up for working through it anyway.

I know that creating the live cd would likely be easier if I used a more traditional method, but I really like this "challenge" for the sake of education. Also, if someone else tries this approach as well, I'd like to have laid a path for them to follow. Thank you guys for your consistent support.
 
Old 04-10-2015, 04:07 PM   #8
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: Slackware64-15.0 Multilib
Posts: 6,558
Blog Entries: 15

Rep: Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097
You need to have every file system tool possible included on the CD/DVD in order for it to be usable as well as have the kernel built with all known file system support vectors built-in. The Slackware Huge kernel actually does this well but you also should assign other modules into an initramfs similarly.

You'll honestly want this:

ext2/3/4
ntfs-3g
jfs
btrfs
xfs

If your disk is non-redistribution ZFS and SPL (built into the kernel) are nice additions as well as possibly any other local and non-local file system tools.

As far as anything else, IF you ever get the disk working and wish to create a live disk, and use X, just stick to using the modesetting and fbdev video drivers, the mouse, keyboard, and joystick drivers for input (you can use evdev but only if you use eudev rather than mdev), and use a small networking daemon that's non-impact like netplug. A small UI WM like FluxBox will work wonders also. Most live disks can use BusyBox with additional tools like Bash and such a bit easier than normal tools due to memory usage of the Live Disk.

Last edited by ReaperX7; 04-10-2015 at 04:09 PM.
 
Old 04-10-2015, 09:39 PM   #9
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
Quote:
APPEND ro root=/dev/sda1
Though you kernel is loaded from CD/DVD, but this line above states that your LFS filesystem is present in first partition of first hard disk. So it would mount that first.

To make a live cd you would definitely need to have initramfs/initrd plus may be compressed filesystem like squashfs plus a union filesystem like unionfs or unionfs or aufs or unionfs-fuse.
 
Old 03-10-2016, 11:53 AM   #10
aniket669
LQ Newbie
 
Registered: Mar 2016
Distribution: Kali Linux 2016.1, Ubuntu 16.04 Xenial Xerus
Posts: 12

Rep: Reputation: Disabled
Hey can you help me building the iso?
In the syslinux wiki, it's saying to copy all files that I need to CD_root. So which files should I copy?
 
Old 03-10-2016, 10:01 PM   #11
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: Slackware64-15.0 Multilib
Posts: 6,558
Blog Entries: 15

Rep: Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097
I basically started with a small version of CLFS-sysroot to use for my "get it working" ISO bootdisk and added dropbear, netplug, and extlinux/syslinux.

The bootdisk is just that, a bootdisk. I have yet to try and add a full GCC suite going, but it's on my list after getting 7.9 going.
 
  


Reply



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
Make bootable usb from unofficial lfs 7.4 live cd iso image AbhinavKumar Linux From Scratch 1 02-15-2014 07:38 AM
how to make non bootable iso file and iso via linux command line?? npubudu Linux - Newbie 2 02-01-2009 11:31 PM
How to make my LFS-5.1 Bootable from CD ROM alihamza Linux From Scratch 4 09-29-2007 08:59 AM
How to make a bootable .iso CD Gins Linux - General 4 09-14-2007 04:13 AM
Bootable ISO LFS distribution? gnudylan Linux - Distributions 1 12-23-2006 08:18 PM

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

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