Differences between revisions 2 and 3
Revision 2 as of 2008-04-24 12:43:41
Size: 5877
Editor: ?FransPop
Comment:
Revision 3 as of 2008-04-24 14:24:44
Size: 7162
Editor: ?FransPop
Comment:
Deletions are marked like this. Additions are marked like this.
Line 29: Line 29:
=== CD use in Etch D-I === === CD use in D-I: Etch ===
Line 38: Line 38:
For the rest of {{{base-installer}}} D-I still uses the Because the directory is bind mounted, the CD obviously cannot be unmounted and remounted by {{{apt-cdrom}}} in the target environment, so a trick is used to avoid that. Before {{{apt-cdrom}}} is actually run, the configuration of APT in /target/etc/apt/ is changed (for the duration of the installation) in such a way that {{{apt-cdrom}}} does not try to mount or unmount the CD. Essentially it is told to use '{{{true}}}' as the mount/unmount command, which always succeeds, but does nothing.
Line 40: Line 40:
With this setup the CD can simply be scanned in {{{apt-setup}}} by using: {{{ With that setup the CD can then simply be scanned by using: {{{
Line 44: Line 44:
However, because the directory is bind mounted, the CD obviously cannot be unmounted and remounted by {{{apt-cdrom}}} in the target environment, so a trick is used to avoid that. Before {{{apt-cdrom}}} is actually run, the configuration of APT in /target/etc/apt/ is changed (for the duration of the installation) in such a way that {{{apt-cdrom}}} does not try to mount or unmount the CD. Essentially it is told to use '{{{true}}}' as the mount/unmount command, which always succeeds, but does nothing.
Line 48: Line 46:
=== CD use in Lenny Beta 1 === During {{{apt-setup}}} the installer creates {{{/etc/apt/sources.list}}} from scratch, so the CD will be scanned again, but the situation does not really change.

=== CD use in D-I: Lenny Beta 1 ===
Line 56: Line 56:
 * the installation CD is scanned ({{{apt-cdrom}}} automatically unmount the CD when that is done)
Line 58: Line 59:
 * the installation CD is scanned ({{{apt-cdrom}}} automatically unmount the CD when that is done)
Line 73: Line 73:
After the release of Beta1, the handling of CDs has been made more consistent by not using the bind mount at all. The use of the CD during {{{debootstrap}}} is not changed, but after that {{{apt-cdrom}}} is allowed to mount and unmount the CD as needed.
Line 74: Line 75:
What this means with that, if there are problems with using the CD due to the CD changing support, users will first see them '''after''' {{{base-installer}}} for Lenny Beta1, but with images based on current unstable they may first see them '''during''' {{{base-installer}}}.

The basic assumption behind this change is that mounting and unmounting the CD in the target environment should be possible regardless of whether or not the CD is also mounted in the D-I environment. It's not possible to '''eject''' a CD that's still mounted somewhere, but having a CD mounted twice should not be a problem.
Line 78: Line 82:
=== Before Beta1 === === Before Lenny Beta1 ===
Before Beta1 there was an issue where the CD was remounted in the D-I environment at a time it was not supposed to be mounted, which prevented changing CDs when multiple CDs were being used. This was the problem behind [http://bugs.debian.org/470423 #470423] and this was solved in time for the release.

=== Current issues ===

/!\ This page is work in progress

This page documents issues with the new feature that allows using multiple CDs or DVDs during an installation. The main purpose of this page is to provide background information to users in the hope that that will help narrow down the real cause of the problem.

Note: on the rest of this page "CD" will be used for both CDs and DVDs.

Introduction

The Sarge version of Debian Installer (D-I) still used base-config which supported scanning of multiple CDs before installing "additional software" during the second stage of the installation of a new system (after the first reboot).

With the Etch version of the installer base-config was replaced by various different D-I components, including: - apt-setup: create a sources.list file for the target system - pkgsel: run tasksel in the /target chroot

For Etch, apt-setup only supported using the installation CD and not scanning additional CDs. This regression was accepted because of the general advantages of being able to do the whole installation in a consistent environment without needing to reboot.

For Lenny Beta1, apt-setup has been changed to support scanning multiple CDs again. For this to be possible, changes were needed in various other D-I components, including pkgsel.

After the release of Lenny Beta1 some additional changes have been made to the way D-I uses CDs.

The main problem with supporting multiple CDs is that the installation CD is needed simultaneously in the "D-I environment" and in the "target environment", which basically means that the CD has to be mounted twice.

As a CD can only be changed (ejected) if it is unmounted, some regulation of how/when a CD is used for what was needed.

Internals

This section gives an overview how the installer uses CDs, both now and in the past.

Note that only the use of real CDs that are accessed through either a physical or virtual (in the case of emulators) CD drive is described, not the use of CD images (.iso files) as used with the hd-media installation method.

CD use in D-I: Etch

The CD drives are detected early in the installation and if an installation CD is found, it is mounted on /cdrom.

During the installation of the base system (base-installer, the CD is first used by debootstrap using APT's file protocol (i.e: debootstrap does not actually know it's reading a CD; it just uses a directory).

After that base-installer "bind mounts" the CD in the target environment to allow additional packages to be installed. The command used is (using /dev/hdc as example for the CD drive):

mount -o bind /cdrom/ /target/cdrom/

Because the directory is bind mounted, the CD obviously cannot be unmounted and remounted by apt-cdrom in the target environment, so a trick is used to avoid that. Before apt-cdrom is actually run, the configuration of APT in /target/etc/apt/ is changed (for the duration of the installation) in such a way that apt-cdrom does not try to mount or unmount the CD. Essentially it is told to use 'true' as the mount/unmount command, which always succeeds, but does nothing.

With that setup the CD can then simply be scanned by using:

chroot /target apt-cdrom add

But it should now be obvious why CD changing will not work :-)

During apt-setup the installer creates /etc/apt/sources.list from scratch, so the CD will be scanned again, but the situation does not really change.

CD use in D-I: Lenny Beta 1

Everything up to and including base-installer remains unchanged, but in apt-setup two different cases are distinguished:

  1. the installation CD is not part of a set
  2. the installation CD is part of a set

In the first case, nothing changes: the installer still works like it did for Etch.

In the second case, the following is done in apt-setup:

  • the installation CD is scanned (apt-cdrom automatically unmount the CD when that is done)

  • the CD is unmounted from /cdrom, which also removes the bind mount on /target/cdrom

  • the configuration file that disabled (un)mounting the CD in the target environment is removed so from then on apt-cdrom is allowed to actually mount and unmount the CD

  • the user is asked whether or not he wants to scan another CD
  • if (s)he does, the second CD is scanned
  • this process is repeated for all CDs
  • after the last CD has been scanned, the user is asked to insert the installation CD (this is checked) and that CD is mounted on /cdrom again (because D-I will still need it in the D-I environment and expects it to be available)

There are also changes in pkgsel and when individual packages are installed after this point. Basically we need to make sure that /cdrom is not mounted whenever we run apt or aptitude in the target environment because we do not know beforehand whether APT will need a package that is not on a different CD and having /cdrom mounted would prevent ejecting and changing the CD by the user when APT asks him to.

Each time after APT has been used in the target environment, the installer checks if the installation CD is in the drive. If it is not, it will ask the user to insert it. When the installation CD is detected, it is mounted on /cdrom again.

This is fairly complex, but it does ensure that

  • the CD can be changed when needed to install packages in the target environment
  • while still also keeping the CD available in the D-I environment

Changes after the release of Lenny Beta1

After the release of Beta1, the handling of CDs has been made more consistent by not using the bind mount at all. The use of the CD during debootstrap is not changed, but after that apt-cdrom is allowed to mount and unmount the CD as needed.

What this means with that, if there are problems with using the CD due to the CD changing support, users will first see them after base-installer for Lenny Beta1, but with images based on current unstable they may first see them during base-installer.

The basic assumption behind this change is that mounting and unmounting the CD in the target environment should be possible regardless of whether or not the CD is also mounted in the D-I environment. It's not possible to eject a CD that's still mounted somewhere, but having a CD mounted twice should not be a problem.

The issues

As this is fairly complex new functionality, some initial problems are almost inevitable. It is important to distinguish between the issues seen (and solved) before the release of Beta1 and the current issues.

=== Before Lenny Beta1 === Before Beta1 there was an issue where the CD was remounted in the D-I environment at a time it was not supposed to be mounted, which prevented changing CDs when multiple CDs were being used. This was the problem behind [http://bugs.debian.org/470423 #470423] and this was solved in time for the release.

Current issues