Find the answer to your Linux question:
Results 1 to 5 of 5
In http://mirrors.163.com/centos/6.4/os/x86_64/images/ I need know process of centos/redhat net install, especially after grub. At first, vmlinuz and initrd are loaded into memory, and some steps later, install.img is loaded as ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Apr 2013
    Posts
    3

    how does images/install.img work?


    In http://mirrors.163.com/centos/6.4/os/x86_64/images/

    I need know process of centos/redhat net install, especially after grub.

    At first, vmlinuz and initrd are loaded into memory, and some steps later, install.img is loaded as current temporary system and execute anaconda for kickstart installation.

    Now what are those "some steps"?

    BTW, in my work now, I need install some package in install.img. Is there a standard way to custom the image?

    Any documents or blog are helpful.
    Last edited by atreyu; 04-18-2013 at 09:44 PM. Reason: fixed link

  2. #2
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    Hello and welcome!

    Your question is not a trivial one. I will try to fill in some holes.

    First the Linux kernel is loaded (vmlinuz). If an initrd is specified, it is uncompressed (to memory). Then the init process is launched (it defaults to /sbin/init but that can be specified at boot time). So the /sbin/init binary that is inside the initrd image is what you are probably after. Unfortunately, it is not a text file, so you can't easily read it.

    At some point during that process, it downloads the install.img and unpacks that (to memory). Both the initrd.img and the install.img files are LZMA-compressed CPIO files, I believe, and are easily unpacked (google for steps).

    As to adding stuff to the install.img, it may be easier for you to just specify an anaconda kickstart file at boot time, and in that kickstart file, include %post stuff (where you can do things like wget files and install RPMS and all kinds of good stuff). You can also specify your list of packages to install in the %packages section, and include sources to them in the %pre section. You can read up on Anaconda here.

  3. #3
    Just Joined!
    Join Date
    Apr 2013
    Posts
    3
    Thanks for you answer.

    To fix sth first, install.img is not CPIO file as initrd.img. And the %post in kickstart is different from %pre. Codes in %post run in installed system, but in %pre it's not. Codes in %pre run in loaded install.img environment. I need do raid/lvm in kickstart and I have to gather some hardware information before kickstart. That's why I want install a package in install.img.

    Actually, there is rpm installed in install.img (github.com/pyKun/install.img/tree/master/usr/bin), but it cannot be easily used. And now I have list all .so files related with a package and take them into some places. This is not the best way. So I wanna know whether there is standard way to custom my own install.img.

    BTW, I also wanna know who load install.img into memory.

  4. $spacer_open
    $spacer_close
  5. #4
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    Quote Originally Posted by gareth2 View Post
    install.img is not CPIO file as initrd.img
    so it is a squashfs file, use unsquashfs if you want to get at the files in it.

    And the %post in kickstart is different from %pre. Codes in %post run in installed system, but in %pre it's not. Codes in %pre run in loaded install.img environment. I need do raid/lvm in kickstart and I have to gather some hardware information before kickstart. That's why I want install a package in install.img.
    i did not know exactly what you needed, that's why i mentioned the kickstart stuff.

    Actually, there is rpm installed in install.img (github.com/pyKun/install.img/tree/master/usr/bin), but it cannot be easily used. And now I have list all .so files related with a package and take them into some places. This is not the best way. So I wanna know whether there is standard way to custom my own install.img.
    I don't know of any standard way. This is old, but there is a discussion of doing this on Fedora here.

    Or perhaps using an updates.img file would be useful, though I think that just replaces files that already should exist.

    I also wanna know who load install.img into memory.
    my guess is the init process of the initrd.img that gets called by the kernel at boot time.

  6. #5
    Just Joined!
    Join Date
    Apr 2013
    Posts
    3
    Wow, thanks your advice, but those two links may be not so helpful.

    1. I already know how to make an install.img, and I need know easier way to replace some files, or easy way to install package
    2. We use centos now, in dir ./images/, there's no update.img, so if I want to have a try, I think I need know who load install.img or update.img at least.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •