[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Installing extra packages into /target/ - suggested design



Here is a succested design description for a mechanism to install
extra packages into /target/.  It is not yet implemented, but it
should be mostly cut-n-paste from existing code.  Comments?

I plan to check this into debian-installer/doc/dpkginstall.txt if the
design is accepted.

The idea is to make it possible to request packages before
base-installer is installed, and at any point before prebaseconfig is
executed.  When /target/ or /cdrom/ is umounted, it is to late to
install extra packages.


Installing extra packages into /target/
=======================================

The udeb packages can request extra packages to be installed into
/target/.  One way to use this is for grub-installer to request the
grub package to be installed, making it easier to set up the grub boot
loader.

The packages will be queued for installation until base-installer is
executed.  At this point, the queued packages will be installed, and
any requests for extra packages will be executed immediately.

Usage
-----

The postinst or prebaseconfig.d script for packages call a script to
queue or install a package.

  dpkginstall <package>

This script have the following return values:

 0 The package is installed, or was successfully installed into /target/
 1 The package is now queued for installation
 2 The package failed to install into /target/ (it was missing, or
   something else was wrong).

Implementation
--------------

The script will check if base-installer was successfully completed,
and in this case will run 'apt-get install' try to fetch and install
the packages.  If base-installer isn't completed, it will add the
package name to /etc/dpkginstall-queue.conf.

At the end of the base-installer postinst script, it will check this
file and install the packages listed in the file, something like this:

  for pkg in `cat /etc/dpkg-queue.conf` do
      dpkg-doinstall "$pkg"
  done

Files
-----

[Is the file names any good?  Should some of them be renamed?]

  /usr/bin/dpkg-install    - request a package 
  /usr/bin/dpkg-doinstall  - try to install a package into /target/
  /etc/dpkg-queue.conf     - package queue, emptied in base-installer postinst
  /etc/base-installer-done - flag file created when base-installer completes

Comments
--------

The udeb kernel-installer can be changed to call 'dpkg-install
<kernel>' instead of installing the package manually.

The lilo and grub package can call 'dpkg-install {lilo|grub}' before
they start to use the grub or lilo programs in /target/.

The brltty-udeb package can call 'dpkg-install brltty' in its postinst
and make sure also brltty is installed into /target/.



Reply to: