Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am trying to understand the content of a Linux distribution's ISO image file and how the installation process take place. Here I am specifically talking about CentOS 6.4 in its minimal version.

So ISOLINUX is triggered, and I get the menu displayed. Then I hit install.

It loads the kernel and the initrd filesystem.

My questions are:

  1. How does Anaconda get called?

  2. What is the role of the images/install.img file ? (Who calls/mount it?)

  3. Does Anaconda installs Packages/*.rpm? If I wanted to add one in there can I and would it be installed ?

Any link / recommendation is welcome,

share|improve this question
1  
    
@Livinglifeback - if you summarised that thread as an answer, it would add value to the StackExchange site? –  EightBitTony Jun 22 '13 at 22:35
    
Note for future visitors: this, especially #3, varies distribution-to-distribution and even in the same distribution. Compare e.g. Ubuntu's Ubiquity installer and its alternate installer. –  strugee Jun 23 '13 at 3:57
    
@EightBitTony I began to summarize it however, I don't feel I'd be able to completely answer the question. I do think the link might help them learn more. –  Livinglifeback Jun 23 '13 at 17:54
    
@Livinglifeback Thanks it did actually help me surrounder more the problem. I am still investigating to be able to fully answer my own question. When I'll be able to do so, I ll post the answer I'd have found. Link was appreciated :) –  Spredzy Jun 23 '13 at 22:26

3 Answers 3

I'm one of the Anaconda authors/maintainers. I could go into way too much detail about how the installer boots, but I'll try to be brief.

(Note that this only applies to RHEL/CentOS 6.x or Fedora 14 and earlier; the installer was almost completely rewritten between Fedora 15, 16, and 17, so things are very different now.)

  1. How does Anaconda get called?
  2. What is the role of the images/install.img file ? (Who calls/mount it?)

The initrd.img on the install media is what we call the stage1 image. It contains a program called loader, whose only job is to find and load images/install.img.

install.img is the stage2 image. This is where Anaconda actually lives - it's a squashfs image that contains the installer's root filesystem.

There are a lot of different ways for loader to find install.img, but when you boot from DVD it's simple: loader notices the installer DVD, mounts it, and mounts images/install.img as its root filesystem.

Once the stage2 image is mounted, loader starts Anaconda, which then starts up Xorg and puts a shell on tty2 and all that nice stuff, and the installer really starts.

3. Does Anaconda installs Packages/*.rpm? If I wanted to add one in there can I and would it be installed ?

No, it doesn't just install everything there. It uses the comps.xml file (in repodata/) to decide which package groups are available (and what packages are in those groups) - that's how the package selection UI gets filled in.

If you add anything to the Packages/ directory (like if you're trying to create a custom DVD image) and you want it to be installable, you'll need to use createrepo to regenerate the repodata/ directory. That will let you install your packages via kickstart, at least.

If you need them to show up in the UI, you'll need to edit comps.xml as well.

share|improve this answer
1  
Thanks for sharing these details! –  slm May 30 at 19:29

When you boot the installation CD it loads the Kernel and initrd just like you mentioned. This basically loads a minimal Linux system into your computers memory. Anaconda runs as a service on boot and the program launches. Anaconda then finds your HDs and mounts them as /mnt/sysimage. Anaconda does install Packages/*.rpm from the install CD and you could add a RPM to the Packages dir and then re-burn the iso, but Anaconda still wouldn't know that it needed to be installed. As far as hacking Anaconda to make the program look for the RPM I don't have an answer.

share|improve this answer

When you boot from the CD, you get the ISOLINUX bootloader, and that loads the Linux kernel and the initial ramdisk. That starts Anaconda, which loads its various pieces, such as the install.img. Anaconda then takes care of installing the various packages, etc.

The easiest way to get Anaconda to install additional packages (or do additional configuration) is by writing a kickstart script. A kickstart script tells Anaconda which packages to install, how to configure the operating system, and so forth. To tell anaconda to use a particular kickstart script, you can type "install ks=http://example.com/my_kickstart.ks" at the ISOLINUX prompt. It will then download that kickstart file (from a web server in this example), and use it to know which packages to install.

More details on kickstart scripts are available at http://fedoraproject.org/wiki/Anaconda/Kickstart

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.