Differences between revisions 1 and 106 (spanning 105 versions)
Revision 1 as of 2004-01-11 21:33:59
Size: 2254
Editor: anonymous
Comment:
Revision 106 as of 2021-09-14 08:36:39
Size: 5872
Editor: PaulWise
Comment: fix command
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
## Auto-converted by kwiki2moinmoin v2005-10-07
Originally from http://lists.debian.org/debian-boot/2002/debian-boot-200207/msg00441.html but probably much changed since.
= Debian-Installer: Building the installer yourself =
Line 4: Line 3:
NOTE that it's possible to build this under woody, but it's difficult. It might require packages from unstable during the build process. I actually got thru the build process, but haven't seen the thing work yet. I had to install libc from unstable and then my original libc again, then the libc from security.debian.org which might work in the first place. I'm going to redo the build with that lib to see if that clears up problems. If not, I'll search the open seas for a good floppy :) This page explains how to manually build specific images. The installer can of course also be built as any other package using for example `dpkg-buildpackage` or `debuild`.
Line 6: Line 5:
-Jim Lynch First of all, debian-installer images should only be built in an environment that matches the version of the installer you want to build, so:
 * if you want to build the installer for development purposes, your system needs to be running unstable, or you need to create a chroot environment that has unstable;
 * if you want to build D-I for a specific Debian release, e.g. for the current stable release, your system needs to either be running the current Debian stable release, or you need to create a chroot that has the stable release.
Line 8: Line 9:
Here are the steps to build debian-installer: Note: Don't forget to mount /proc inside chroot. mkfs.vfat is failing if you are running a chroot in sid, so it is better to have a full lenny installation (you could use Virtual Box or qemu, roughly the same space as a chroot)
Line 10: Line 11:
 * check out the d-i sources from CVS{{{
  cvs -d:pserver:anonymous@cvs.debian.org:/cvs/debian-boot login;
  cvs -d:pserver:anonymous@cvs.debian.org:/cvs/debian-boot co debian-installer
If you get this wrong, build errors or non-working images are almost guaranteed! It is sometimes possible to smuggle with testing and unstable, but don't expect any support from the D-I team if you do.

This same procedure can also be followed to build the installer from testing, using udebs from testing. But you should be aware that there are periods during which it is very likely that builds from testing are broken, especially: (1) the period after a new Debian stable release and before the first alpha release of D-I for the next Debian release and (2) when a new release of D-I is being prepared. Building the installer from testing is only really advisable when there is a Release Candidate (RC) release of debian-installer in testing.

/!\ If you build the installer for release purposes, make sure your build environment is "clean", i.e. that it is up-to-date and that you don't have any weird (versions of) packages installed from external repositories. If your system is not clean, use for example `pbuilder` or create a chroot environment.

Here are the steps to build debian-installer and download required [[udeb]]s.

== Get the source ==

See [[DebianInstaller/CheckOut|CheckOut]].

== Preparing the build system ==

 * Change to the directory `installer/` under your `TOP` directory.

 * Read `build/README`

 * Install the build-dependencies on the host system (or in the chroot): {{{
# apt build-dep debian-installer
Line 15: Line 33:
 * build cdebconf ( cd tools/cdebconf ; dpkg-buildpackage ) then look in .. (i.e., tools/) for the results)  * Verify that the build dependencies are all met using `dpkg-checkbuilddeps`. You may still see something like: {{{
$ dpkg-checkbuilddeps
dpkg-checkbuilddeps: Unmet build dependencies: grep-dctrl debiandoc-sgml glibc-pic libparted1.6-13 libslang2-pic libnewt-pic libdiscover1-pic libbogl-dev genext2fs (>= 1.3-7.1) mklibs (>= 0.1.15) mkisofs dosfstools syslinux (>= 2.11-0.1) tofrodos bf-utf-source upx-ucl-beta (>= 1:1.91+0.20030910cvs-2)
}}} which means some build dependencies are still missing. Correct this by installing the missing packages, for example: {{{
# aptitude install -R grep-dctrl debiandoc-sgml [...]
}}} repeat the check until `dpkg-checkbuilddeps` no longer reports any missing dependencies.
Line 17: Line 40:
 * install libcdebconf0 and libcdebconf-dev in the host system. (these were produced in the previous step)  * Check that the variables `DEBIAN_RELEASE` and `USE_UDEBS_FROM` in the file `build/config/common` are set correctly:
   * if you are building the installer for development purposes (from Git HEAD), no changes should be needed;
   * if you are building the installer for stable or oldstable, the variables should already be set to the codename of that Debian release; if not you need to change them;
   * if you are building the installer for testing it is likely you will need to change at least the variable `USE_UDEBS_FROM` to the codename for testing.
Line 19: Line 45:
 * build libdebian-installer ( cd libdebian-installer ; dpkg-buildpackage then look in .. for the results) == Building an image ==
Line 21: Line 47:
 * install libdebian-installer1, libdebian-installer1-dev and libdebian-installer-pic in the host system. (these were produced in the previous step)  * Change directory to the directory `installer/build/`.
Line 23: Line 49:
 * build the different modules by cd-ing into them and building using dpkg-buildpackage.  * Run `make` to get a list of available targets.
Line 25: Line 51:
 * link those new udebs into build/localudebs  * Build an image using one of the "build" targets (`build_netboot`, `all_build`, etc). {{{
$ make reallyclean
$ fakeroot make build_netboot
}}}
Line 27: Line 56:
 * simply to make symlinks inside build/localudebs that point at the udebs. (else it will try to download them, and the dir structure isn't set up on the mirrors (since debian-installer isn't the current installer)) Because your build environment is for the same Debian release as the version of debian-installer you want to build, the build system should automatically generate a correct `sources.list.udeb` file based on your `/etc/apt/sources.list`. However, in some cases it may be necessary to create a `sources.list.udeb.local`. In some cases you have to explicitly provide main/debian-installer section in the sources.list file of your chroot or local installation.
Line 29: Line 58:
 * One way: build all the udebs you're gonna build -first-...  * Look in `dest/` for the completed images.
Line 31: Line 60:
 ''' then do cd build/localudebs; for i in $(find ../.. -name "'''.udeb"); do ln -s $i; done  * Look in `dest/MANIFEST.udebs` for the udebs associated with this image.
Line 33: Line 62:
 * run make demo or make boot_floppy in build/
Line 35: Line 63:
You will need sudo access or be root to do this. == Adding a udeb or files to the built image ==
Line 37: Line 65:
This will give you a network-enabled installer, if you'd rather want a cdrom installer, run make TYPE=cdrom or TYPE=cdrom144. The list of packages added to the netboot image is in {{{installer/build/pkg-lists/netboot/yourarch.cfg}}} , you can try add the desired package there.
Line 39: Line 67:
This will break on every arch but i386; any help fixing this is very much appreciated.
See NoMultipleArchitectureSupport.
In order to just add a few files, you can create your own udeb package:

 * Create a {{{control}}} file containing:

{{{
Package: mypackage
Files: /my/file/on/my/hard/drive /where/to/put/it/in/installer
 /my/other/file /another/place/in/installer
}}}

 * run {{{equivs-build control}}} , that will create {{{mypackage_1.0_all.deb}}}, which you can rename to {{{mypackage.udeb}}}, and put it into {{{installer/build/localudebs}}} . You can then add {{{mypackage}}} in {{{installer/build/pkg-lists/netboot/yourarch.cfg}}}

== Questions ==

 * How does one build an image which also contains a repository, like the netinst images contain?
    * A: This is normally done using `debian-cd`; see also [[DebianInstaller/Modify]]
 * When I'm not able to rebuild Debian-Installer from source, what should I do?
    * A: Persist. Most likely you are allready subscribed mailinglist debian-boot where development of d-i is discussed. Explain in an e-mail to that ML where you are stuck.

----

CategoryDebianInstaller

Debian-Installer: Building the installer yourself

This page explains how to manually build specific images. The installer can of course also be built as any other package using for example dpkg-buildpackage or debuild.

First of all, debian-installer images should only be built in an environment that matches the version of the installer you want to build, so:

  • if you want to build the installer for development purposes, your system needs to be running unstable, or you need to create a chroot environment that has unstable;
  • if you want to build D-I for a specific Debian release, e.g. for the current stable release, your system needs to either be running the current Debian stable release, or you need to create a chroot that has the stable release.

Note: Don't forget to mount /proc inside chroot. mkfs.vfat is failing if you are running a chroot in sid, so it is better to have a full lenny installation (you could use Virtual Box or qemu, roughly the same space as a chroot)

If you get this wrong, build errors or non-working images are almost guaranteed! It is sometimes possible to smuggle with testing and unstable, but don't expect any support from the D-I team if you do.

This same procedure can also be followed to build the installer from testing, using udebs from testing. But you should be aware that there are periods during which it is very likely that builds from testing are broken, especially: (1) the period after a new Debian stable release and before the first alpha release of D-I for the next Debian release and (2) when a new release of D-I is being prepared. Building the installer from testing is only really advisable when there is a Release Candidate (RC) release of debian-installer in testing.

/!\ If you build the installer for release purposes, make sure your build environment is "clean", i.e. that it is up-to-date and that you don't have any weird (versions of) packages installed from external repositories. If your system is not clean, use for example pbuilder or create a chroot environment.

Here are the steps to build debian-installer and download required udebs.

Get the source

See CheckOut.

Preparing the build system

  • Change to the directory installer/ under your TOP directory.

  • Read build/README

  • Install the build-dependencies on the host system (or in the chroot):

    # apt build-dep debian-installer
  • Verify that the build dependencies are all met using dpkg-checkbuilddeps. You may still see something like:

    $ dpkg-checkbuilddeps
    dpkg-checkbuilddeps: Unmet build dependencies: grep-dctrl debiandoc-sgml glibc-pic libparted1.6-13 libslang2-pic libnewt-pic libdiscover1-pic libbogl-dev genext2fs (>= 1.3-7.1) mklibs (>= 0.1.15) mkisofs dosfstools syslinux (>= 2.11-0.1) tofrodos bf-utf-source upx-ucl-beta (>= 1:1.91+0.20030910cvs-2)

    which means some build dependencies are still missing. Correct this by installing the missing packages, for example:

    # aptitude install -R grep-dctrl debiandoc-sgml [...]

    repeat the check until dpkg-checkbuilddeps no longer reports any missing dependencies.

  • Check that the variables DEBIAN_RELEASE and USE_UDEBS_FROM in the file build/config/common are set correctly:

    • if you are building the installer for development purposes (from Git HEAD), no changes should be needed;
    • if you are building the installer for stable or oldstable, the variables should already be set to the codename of that Debian release; if not you need to change them;
    • if you are building the installer for testing it is likely you will need to change at least the variable USE_UDEBS_FROM to the codename for testing.

Building an image

  • Change directory to the directory installer/build/.

  • Run make to get a list of available targets.

  • Build an image using one of the "build" targets (build_netboot, all_build, etc).

    $ make reallyclean
    $ fakeroot make build_netboot

Because your build environment is for the same Debian release as the version of debian-installer you want to build, the build system should automatically generate a correct sources.list.udeb file based on your /etc/apt/sources.list. However, in some cases it may be necessary to create a sources.list.udeb.local. In some cases you have to explicitly provide main/debian-installer section in the sources.list file of your chroot or local installation.

  • Look in dest/ for the completed images.

  • Look in dest/MANIFEST.udebs for the udebs associated with this image.

Adding a udeb or files to the built image

The list of packages added to the netboot image is in installer/build/pkg-lists/netboot/yourarch.cfg , you can try add the desired package there.

In order to just add a few files, you can create your own udeb package:

  • Create a control file containing:

Package: mypackage
Files: /my/file/on/my/hard/drive /where/to/put/it/in/installer
 /my/other/file /another/place/in/installer
  • run equivs-build control , that will create mypackage_1.0_all.deb, which you can rename to mypackage.udeb, and put it into installer/build/localudebs . You can then add mypackage in installer/build/pkg-lists/netboot/yourarch.cfg

Questions

  • How does one build an image which also contains a repository, like the netinst images contain?
  • When I'm not able to rebuild Debian-Installer from source, what should I do?
    • A: Persist. Most likely you are allready subscribed mailinglist debian-boot where development of d-i is discussed. Explain in an e-mail to that ML where you are stuck.


CategoryDebianInstaller