Remastering the Install ISO

From ArchWiki
Revision as of 05:26, 9 August 2009 by Arcanazar (Talk | contribs) (Preparation)

Jump to: navigation, search

Tango-view-refresh-red.pngThis article or section is out of date.Tango-view-refresh-red.png

Reason: please use the first argument of the template to provide a brief explanation. (Discuss in Talk:Remastering the Install ISO#)

Introduction

Remastering the official Arch Linux install ISO image is not necessary for most applications. However, in some circumstances it is desirable. A short, and non-inclusive list includes:

  • Basic hardware is not supported by the core install. (A rare circumstance)
  • Installation on a non-internet capable machine.
  • Deployment of Arch Linux on many similar machines, requiring the same installation procedure, and the administrator does not have the time (or desire) to install each machine manually.

Preparation

To remaster the Arch Linux ISO, you will need a copy of the original ISO image. Download it from the download page

Tip: remember that # means that it must be done by root, while $ means that it should be done by a user.

Now, create a new directory to mount the ISO:

# mkdir /mnt/archiso

Mount the ISO to this directory (note that it is mounted read-only):

# mount -o loop /path/to/archISO /mnt/archiso

Now that the ISO is mounted, we must copy its contents to another directory, where they can be edited:

$ cp -a /mnt/archiso ~/customiso

Customizations

5. Edit the contents of newiso as needed.

  • Some helpful hints:
    • The kernels (IDE and scsi) that are booted by the cd are found at isolinux/vmlinuz and isolinux/vmlinuz_scsi, you may want to replace them with home-brewed ones. I recomend that you don't use your own, completely new, configs, but instead fetch the ones out of the kernels that already exist and edit as desired, this can be done using scripts/extract-ikconfig from any kernel source tree
    • Kernel sources, as well as default Arch kernel configs, which are used if a user chooses to build a kernel at install time are located at arch/
    • The filesystem you are given while in the install environment is at isolinux/initrd.img, if you'd like to edit this:

a. Copy it to another location, adding a .gz extension

cp isolinux/initrd.img initrd.img.gz

b. Run it through Gzip

gunzip initrd.img.gz

c. You'll be left with initrd.img, now create a directory to mount it in

mkdir initrdedit

d. Then mount it

su -c 'mount -o loop initrd.img initrdedit'

e. You can now edit the stuff in initrdedit/ as you please

f. When you're done fiddling around, unmount it

umount initrdedit

g. Now take the initrd.img you just unmounted and run it back through gzip

gzip initrd.img

h. You'll now once again have an initrd.img.gz, which you can copy back to your ISO, replacing the old one

cp initrd.img.gz newiso/isolinux/initrd.img
  • The packages which are included on the cd are found at arch/pkg, if you mess with these, don't forget to run gensync and create a new current.db.tar.gz
  • Various tools and kernel modules can be found at addons/

Creating a new ISO

Once you have edited your custom ISO to your needs, you must create a new ISO image. This can be done with the mkisofs command.

mkisofs -RlDJLV "arch-custom" -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -o ~/arch-custom.iso ~/customiso

There should now be a file called arch-custom.iso in the home folder of the user that created the iso. This can now be burned to a CD (DVD) and used as intended. Enjoy your very own, customized, Arch Install CD.

Further Reading and Related Resources

http://www.knoppix.net/wiki/KnoppixRemasteringHowto
http://syslinux.zytor.com/iso.php
http://busybox.net/
http://xentac.net/svn/arch-jc/trunk/bin/mkiso