Difference between revisions of "Remastering the Install ISO"

From ArchWiki
Jump to: navigation, search
(use https for links to archlinux.org)
(25 intermediate revisions by 11 users not shown)
Line 1: Line 1:
{{out of date}}
+
[[Category:Getting and installing Arch]]
[[Category:Getting and installing Arch (English)]]
+
[[Category:HOWTOs (English)]]
+
Remastering the Arch Linux install ISO image is generally not necessary, but there are certain instances in which it needs to be done. Usually these instances involve hardware that the ISO's kernel does not support.
+
  
- Download da última versão: [[mirrors]]
+
== 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.
  
'''2.''' Create a new directory in which we can mount the iso
+
== Preparation ==
<pre>
+
To remaster the Arch Linux ISO, you will need a copy of the original ISO image. Download it from the [https://www.archlinux.org/download/ download page]
mkdir origiso
+
</pre>
+
  
'''3.''' Mount the ISO to the directory we just created, since it is an isofs, it will be mounted read-only
+
{{ Tip | remember that # means that it must be done by root, while $ means that it should be done by a user.}}
<pre>
+
su -c 'mount -o loop arch-0.7-beta1-base.iso origiso'
+
</pre>
+
  
'''4.''' Now that the ISO is mounted, we can copy its contents to another directory, where we can edit them
+
Now, create a new directory to mount the ISO:
<pre>
+
# mkdir /mnt/archiso
cp -a origiso/ newiso
+
</pre>
+
  
'''5.''' Edit the contents of newiso as needed.
+
Mount the ISO to this directory (note: It being an image, the resulting mount is read-only):
 +
# mount -t iso9660 -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 ~/customiso as needed.
 
*Some helpful hints:
 
*Some helpful hints:
** 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 {{ic|isolinux/vmlinuz}} and {{ic|isolinux/vmlinuz_scsi}}, you may want to replace them with home-brewed ones. I recommend that you do not 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 {{ic|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 <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 {{ic|arch/}}
** 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 {{ic|root-image.fs.sfs}}, if you'd like to edit this:
a. Copy it to another location, adding a .gz extension
+
a. Copy it to another location
<pre>
+
cp root-image.fs.sfs ~
cp isolinux/initrd.img initrd.img.gz
+
</pre>
+
b. Run it through Gzip
+
<pre>
+
gunzip initrd.img.gz
+
</pre>
+
c. You'll be left with initrd.img, now create a directory to mount it in
+
<pre>
+
mkdir initrdedit
+
</pre>
+
d. Then mount it
+
<pre>
+
su -c 'mount -o loop initrd.img initrdedit'
+
</pre>
+
e. You can now edit the stuff in <code>initrdedit/</code> as you please
+
  
f. When you're done fiddling around, unmount it
+
b. Extract the sqfs image from the file (the package ''squashfs-tools'' is needed for this)
<pre>
+
unsquashfs root-image.fs.sfs
umount initrdedit
+
</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>
+
* 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>
+
* Various tools and kernel modules can be found at <code>addons/</code>
+
  
'''6.''' Once you have edited newiso to your liking, you need to create a new ISO image, this can be done using <code>mkisofs</code>
+
c. This will generate a new folder called squashfs-root with a file called root-image.fs in it. This file contains a ext2 filesystem. Mount this filesystem to make changes to it.
<pre>
+
# mkdir /mnt/rootfs
  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 newiso
+
# mount ~/squashfs-root/root-image.fs /mnt/rootfs
</pre>
+
  
'''7.''' There should now be a file called <code>arch-custom.iso</code>, and you can burn that to a CD, boot off of it, and enjoy your very own, customized, Arch Install CD.
+
d. You can do a chroot into this folder to be able to install new software in the image using pacman.
 +
chroot /mnt/rootfs
  
 +
e. When you're done fiddling around, unmount the rootfs and create the new squashfs image
 +
# umount /mnt/rootfs
 +
$ mksquashfs squashfs-root root-image.fs.sfs
  
 +
f. You'll now have a new {{ic|root-image.fs.sfs}}, which you can copy back to your ISO, replacing the old one
 +
cp root-image.fs.sfs customiso/root-image.fs.sfs
 +
 +
== 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 which is part of the the {{pkg|cdrkit}} package.
 +
genisoimage -l -r -J -V "ARCH_201209" -b isolinux/isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table -c isolinux/boot.cat -o ~/arch-custom.iso ~/customiso
 +
 +
There should now be a file called {{Ic|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. Remember that the iso label must be the same as the one from the original ISO (in this case ARCH_201209) 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_201209. This can be changed with '''e2label''' for ext3 partitions.
 +
 +
{{Note|In the most recent series of Arch ISO's, it has been reported that unetbootin sometimes breaks the image.  Please use dd to create installer.}}
  
 
==== Further Reading and Related Resources====
 
==== Further Reading and Related Resources====
Line 73: Line 62:
 
http://busybox.net/ <br>
 
http://busybox.net/ <br>
 
http://xentac.net/svn/arch-jc/trunk/bin/mkiso <br>
 
http://xentac.net/svn/arch-jc/trunk/bin/mkiso <br>
 
----
 
 
'''Note''': do not try to remaster the ISO with Wind*ws tools as WinISO or UltraISO as you'll only botch it up, the files will appear as 8+3 file names and the setup app won't be  able to install packages. Though, if you manage to find options for the program that are roughly equivalent to the mkisofs options above, it ''should'' work.
 
----
 

Revision as of 01:13, 6 December 2012


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: It being an image, the resulting mount is read-only):

# mount -t iso9660 -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 ~/customiso 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 recommend that you do not 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.fs.sfs, if you'd like to edit this:

a. Copy it to another location

cp root-image.fs.sfs ~

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

unsquashfs root-image.fs.sfs 

c. This will generate a new folder called squashfs-root with a file called root-image.fs in it. This file contains a ext2 filesystem. Mount this filesystem to make changes to it.

# mkdir /mnt/rootfs
# mount ~/squashfs-root/root-image.fs /mnt/rootfs

d. You can do a chroot into this folder to be able to install new software in the image using pacman.

chroot /mnt/rootfs

e. When you're done fiddling around, unmount the rootfs and create the new squashfs image

# umount /mnt/rootfs
$ mksquashfs squashfs-root root-image.fs.sfs

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

cp root-image.fs.sfs customiso/root-image.fs.sfs

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 which is part of the the cdrkit package.

genisoimage -l -r -J -V "ARCH_201209" -b isolinux/isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table -c isolinux/boot.cat -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. Remember that the iso label must be the same as the one from the original ISO (in this case ARCH_201209) 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_201209. This can be changed with e2label for ext3 partitions.

Note: In the most recent series of Arch ISO's, it has been reported that unetbootin sometimes breaks the image. Please use dd to create installer.

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