Post Reply 
 
Thread Rating:
  • 1 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Any Recommendation on creating a custom iso from installed OS
2013-10-20, 10:18 (This post was last modified: 2013-10-20 10:33 by robinsmidsrod.)
Post: #7
RE: Any Recommendation on creating a custom iso from installed OS
I'm not sure how much you know about the general way Linux is loaded. It seems to me that there is some confusion about what goes where, and how it's loaded.

1. A boot loader is responsible for loading your kernel and initrd into memory, and specifying the kernel command line (which among other things tell you where your root mountpoint is located). This is usually ipxe, grub or syslinux's job.
2. The kernel is started, it will find its initrd (ramdisk) in memory, initialize all the hardware it can see, and then start /sbin/init (inside the initrd/ramdisk).
3. /sbin/init will ensure that other software is started that does a bunch of different things.
4. One of them is to find the storage media for the root mount point and mount that.

Usually the root mount point is on a local storage device (like a HDD) so it's just a matter of looking through your device list and connect things together.

When you netboot you usually don't have any local storage, and you need to start the network first, before you can mount your root fs. In most installers this is usually a squashfs located somewhere on the CD. When you netboot, you'll need to find out a way to tell the /sbin/init-scripts on the initrd where to locate that file instead of using a locally connected CD. That is usually done using some kernel command line paramter.

Ubuntu, using its software called casper, supports finding this file using either NFS or SMB file sharing. SystemRescueCD supports both of those, but also HTTP and FTP. It all depends on the distro what options you have.

If you look closely at my menu example at https://gist.github.com/robinsmidsrod/2234639 you can see that I've figured out how to load a bunch of different distros via the network by carefully setting the kernel command line paramters to something that works. Finding out how has been a thorough work looking through a lot of documentation for the different distros, and sometimes unpacking the initrds to see how the boot scripts are put together and what parameters they accept.

A quick way to study an initrd is to boot your kernel with init=/bin/sh (or init=/bin/bash if available) which will give you a shell straight onto the initrd. If the initrd has bash, I'd use that instead, and with a bit of clever usage of the busybox tools available, it is usually quite easy to look around and get an understanding of how the initrd works.

Hope this will help you on your netbooting quest.
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Any Recommendation on creating a custom iso from installed OS - robinsmidsrod - 2013-10-20 10:18



User(s) browsing this thread: 1 Guest(s)