Difference between revisions of "Remastering the Install ISO"

From ArchWiki
Jump to: navigation, search
m (Creating a new ISO: updated to match latest dual iso)
(Customizations)
(13 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 
[[Category:Getting and installing Arch]]
 
[[Category:Getting and installing Arch]]
{{out of date}}
+
 
 
== Introduction ==
 
== 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:
 
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:
Line 8: Line 8:
  
 
== Preparation ==
 
== Preparation ==
To remaster the Arch Linux ISO, you will need a copy of the original ISO image. Download it from the [http://www.archlinux.org/download/  download page]
+
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]
  
 
{{ Tip | remember that # means that it must be done by root, while $ means that it should be done by a user.}}
 
{{ Tip | remember that # means that it must be done by root, while $ means that it should be done by a user.}}
Line 15: Line 15:
 
  # mkdir /mnt/archiso
 
  # mkdir /mnt/archiso
  
Mount the ISO to this directory (note that it is mounted read-only):
+
Mount the ISO to this directory (note: It being an image, the resulting mount is read-only):
  # mount -o loop /path/to/archISO /mnt/archiso
+
  # 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:
 
Now that the ISO is mounted, we must copy its contents to another directory, where they can be edited:
Line 22: Line 22:
  
 
== Customizations ==
 
== Customizations ==
'''5.''' Edit the contents of ~/customiso as needed.
+
Edit the contents of {{ic|~/customiso}} as needed.
 
*Some helpful hints:
 
*Some helpful hints:
 
** 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
 
** 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 {{ic|arch/}}
 
** 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 {{ic|root-image.fs.sfs}}, 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
+
1. Copy it to another location
  cp root-image.fs.sfs ~
+
  $ cp root-image.fs.sfs ~
  
b. Extract the sqfs image from the file (the package ''squashfs-tools'' is needed for this)
+
2. Extract the sqfs image from the file ({{Pkg|squashfs-tools}} is needed for this)
  unsquashfs root-image.fs.sfs  
+
  $ 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.
+
3. 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
 
  # mkdir /mnt/rootfs
 
  # mount ~/squashfs-root/root-image.fs /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.
+
4. You can do a chroot into this folder to be able to install new software in the image using pacman.
  chroot /mnt/rootfs
+
  $ arch-chroot /mnt/rootfs
  
e. When you're done fiddling around, unmount the rootfs and create the new squashfs image
+
5. When you're done fiddling around, exit from the chroot, unmount the rootfs and create the new squashfs image
 +
# exit
 
  # umount /mnt/rootfs
 
  # umount /mnt/rootfs
 
  $ mksquashfs squashfs-root root-image.fs.sfs
 
  $ 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
+
6. 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
+
  $ cp root-image.fs.sfs customiso/root-image.fs.sfs
  
 
== 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 '''genisoimage''' command.
+
Once you have edited your custom ISO to your needs, you must create a new ISO image. This can be done with {{ic|genisoimage}}, which is part of {{pkg|cdrkit}}.  
  genisoimage -l -r -J -V "ARCH_201005" -b isolinux/isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table -c isolinux/boot.cat -o ~/arch-custom.iso ~/customiso
+
  $ 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 {{ic|ARCH_201209}}) or otherwise the image will not work.
  
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_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 {{ic|ARCH_201209}}. This can be changed with {{ic|e2label}} for ext3 partitions.
  
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 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====
+
== See also ==
http://www.knoppix.net/wiki/KnoppixRemasteringHowto <br>
+
*http://www.knoppix.net/wiki/KnoppixRemasteringHowto
http://syslinux.zytor.com/iso.php <br>
+
*http://syslinux.zytor.com/iso.php
http://busybox.net/ <br>
+
*http://busybox.net/
http://xentac.net/svn/arch-jc/trunk/bin/mkiso <br>
+
*http://xentac.net/svn/arch-jc/trunk/bin/mkiso

Revision as of 13:03, 5 May 2013


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

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:

1. Copy it to another location

$ cp root-image.fs.sfs ~

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

$ unsquashfs root-image.fs.sfs 

3. 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

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

$ arch-chroot /mnt/rootfs

5. When you're done fiddling around, exit from the chroot, unmount the rootfs and create the new squashfs image

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

6. 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 genisoimage, which is part of cdrkit.

$ 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.

See also