Difference between revisions of "Remastering the Install ISO"

From ArchWiki
Jump to: navigation, search
m (Bot: Removing from Category:HOWTOs (English))
(Update some information for the las iso of arch)
Line 27: Line 27:
 
** The kernels (IDE and scsi) that are booted by the cd are found at <code>isolinux/vmlinuz</code> and <code>isolinux/vmlinuz_scsi</code>, 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 <code>scripts/extract-ikconfig</code> from any kernel source tree
 
** The kernels (IDE and scsi) that are booted by the cd are found at <code>isolinux/vmlinuz</code> and <code>isolinux/vmlinuz_scsi</code>, 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 <code>scripts/extract-ikconfig</code> 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 <code>arch/</code>
 
** 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 <code>arch/</code>
** The filesystem you are given while in the install environment is at <code>isolinux/initrd.img</code>, if you'd like to edit this:
+
** The filesystem you are given while in the install environment is at <code>root-image.sqfs</code>, if you'd like to edit this:
a. Copy it to another location, adding a .gz extension
+
a. Copy it to another location
 
<pre>
 
<pre>
cp isolinux/initrd.img initrd.img.gz
+
cp root-image.sqfs ~
 
</pre>
 
</pre>
b. Run it through Gzip
+
b. Extract the sqfs image from the file (the package ''squashfs-tools'' is needed for this)
 
<pre>
 
<pre>
gunzip initrd.img.gz
+
unsquashfs root-image.sqfs
 
</pre>
 
</pre>
c. You'll be left with initrd.img, now create a directory to mount it in
+
c. This will generate a new folder called squashfs-root whith the root file system in it. You can do a chroot into this folder to be able to install new software in the image using pacman.
 
<pre>
 
<pre>
mkdir initrdedit
+
chroot squashfs-root
 
</pre>
 
</pre>
d. Then mount it
+
d. When you're done fiddling around, create the new squashfs image
 
<pre>
 
<pre>
su -c 'mount -o loop initrd.img initrdedit'
+
mksquashfs squashfs-root root-image.sqfs
 
</pre>
 
</pre>
e. You can now edit the stuff in <code>initrdedit/</code> as you please
+
e. You'll now have a new <code>root-image.sqfs</code>, which you can copy back to your ISO, replacing the old one
 
+
f. When you're done fiddling around, unmount it
+
 
<pre>
 
<pre>
umount initrdedit
+
cp root-image.sqfs newiso/root-image.sqfs
</pre>
+
g. Now take the <code>initrd.img</code> you just unmounted and run it back through gzip
+
<pre>
+
gzip initrd.img
+
</pre>
+
h. You'll now once again have an <code>initrd.img.gz</code>, which you can copy back to your ISO, replacing the old one
+
<pre>
+
cp initrd.img.gz newiso/isolinux/initrd.img
+
 
</pre>
 
</pre>
 
* The packages which are included on the cd are found at <code>arch/pkg</code>, if you mess with these, don't forget to run <code>gensync</code> and create a new <code>current.db.tar.gz</code>
 
* The packages which are included on the cd are found at <code>arch/pkg</code>, if you mess with these, don't forget to run <code>gensync</code> and create a new <code>current.db.tar.gz</code>
Line 62: Line 52:
  
 
== Creating a new ISO ==
 
== 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.
+
Once you have edited your custom ISO to your needs, you must create a new ISO image. This can be done with the '''genisoimage''' command.
  mkisofs -RlDJLV "arch-custom" -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 -boot-info-table -o ~/arch-custom.iso ~/customiso
+
  genisoimage -l -r -J -V "ARCH_201005" -b boot/isolinux/isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table -c boot/isolinux/boot.cat -o ~/arch-custom.iso newiso
 +
 
 +
There should now be a file called <tt>arch-custom.iso</tt> 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. Remeber that the iso label must be the same as the one from the original ISO (in this case ARCH_201005) or otherwise the image will not work
  
There should now be a file called <tt>arch-custom.iso</tt> 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.
+
If installing the image into a pen drive with '''unetbootin''' remember also that the label of the pen drive partition must be ARCH_201005. This can be changes with '''e2label''' for ext3 partitions.
  
 
==== Further Reading and Related Resources====
 
==== Further Reading and Related Resources====

Revision as of 20:41, 27 July 2011

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 root-image.sqfs, if you'd like to edit this:

a. Copy it to another location

cp root-image.sqfs ~

b. Extract the sqfs image from the file (the package squashfs-tools is needed for this)

unsquashfs root-image.sqfs 

c. This will generate a new folder called squashfs-root whith the root file system in it. You can do a chroot into this folder to be able to install new software in the image using pacman.

chroot squashfs-root

d. When you're done fiddling around, create the new squashfs image

mksquashfs squashfs-root root-image.sqfs

e. You'll now have a new root-image.sqfs, which you can copy back to your ISO, replacing the old one

cp root-image.sqfs newiso/root-image.sqfs
  • 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 genisoimage command.

genisoimage -l -r -J -V "ARCH_201005" -b boot/isolinux/isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table -c boot/isolinux/boot.cat -o ~/arch-custom.iso newiso

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. Remeber that the iso label must be the same as the one from the original ISO (in this case ARCH_201005) or otherwise the image will not work

If installing the image into a pen drive with unetbootin remember also that the label of the pen drive partition must be ARCH_201005. This can be changes with e2label for ext3 partitions.

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