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

tftpboot images


On the subject "Net image far too big"
Sat, Apr 19, 2003 at 10:39:42AM +0200, Thorsten Sauter wrote:
> Sat, Apr 19, 2003 at 12:51:46PM +1000, Anthony Towns wrote:
> > Which can all boot from CD anyway, and would generally prefer to do
> > so. Seriously, stop obsessing over floppies. They're for legacy support
> > _only_; if they end up uninternationalised, or have to be two stage,
> > or use some other kernel, it just doesn't matter.
> true. If the system support USB, it support booting from cdrom.
> > CD installs, netboot installs, boot-from-existing-OS and maybe USB
> > disk-key boots are the ones that are interesting these days. Get those
> > working, and people'll be able to hack around the irritating cases where
> > they might use floppies today.
> but I think we shouldn't completly drop the floppy support. It's very
> useful for older hardware (like routers, fw's, ...). And sometimes the
> damn cdrom doesn't boot with this bios and this cdrom, so simply try to
> boot from floppy.

For those situations has the etherboot project an answer.
The implementation on debian-installer side call I "tftpboot_image"

It is an extra target in the build/Makefile.

# cvs diff -u build/Makefile
Index: build/Makefile
RCS file: /cvs/debian-boot/debian-installer/build/Makefile,v
retrieving revision 1.155
diff -u -r1.155 Makefile
--- build/Makefile      20 Apr 2003 07:36:11 -0000      1.155
+++ build/Makefile      20 Apr 2003 19:22:01 -0000
@@ -452,6 +452,27 @@
        # Finalize the image.
        mv $(FLOPPY_IMAGE).new $(FLOPPY_IMAGE)

+# Create a TFTP boot image.
+# this image will be fetched by the "install client"
+# via TFTP and such alike protocols
+# see doc/tftpboot-image.txt for more information
+# TFTP boot image to create.
+tftpboot_image: Makefile $(KERNEL) $(INITRD) $(TFTPBOOT_IMAGE)
+       TBI=$(TFTPBOOT_IMAGE) ../scripts/mk-tftpboot-img \
+               $(KERNEL) $(INITRD) $(KERNEL_SECOND)
+       install $(TFTPBOOT_IMAGE) $(USER_TFTP_DIR)
+       # so it is available in the directory of the TFTP server
+#### end of TFTP boot image
 # Copy files somewhere the CD build scripts can find them
 # XXX Will only use the last kernel if there are several
 cd_content: floppy_image
@@ -513,6 +534,7 @@
        fakeroot $(MAKE) tarball > $(DEST)/$(TYPE).log 2>&1
        $(MAKE) floppy_image >> $(DEST)/$(TYPE).log 2>&1
+       $(MAKE) tftpboot_image >> $(DEST)/$(TYPE).log 2>&1
        $(MAKE) stats | grep -v ^make > $(DEST)/$(TYPE).info
        echo "Tree comparison" >> $(DEST)/$(TYPE).info
        echo "" >> $(DEST)/$(TYPE).info
@@ -523,6 +545,7 @@
        scp -q -B $(DEST)/$(TYPE)-debian-installer.tar.gz \
                $(UPLOAD_DIR)/$(TYPE)-debian-installer-$(shell date +%Y%m%d).tar.gz
        scp -q -B $(FLOPPY_IMAGE) $(INITRD) $(UPLOAD_DIR)/images/
+       scp -q -B $(TFTPBOOT_IMAGE) $(UPLOAD_DIR)/images/
        scp -q -B $(DEST)/$(TYPE).info \
                $(UPLOAD_DIR)/$(TYPE).info-$(shell date +%Y%m%d)
        echo "Type: $(TYPE)" >> $(DEST)/info

The documentation:
# cat doc/tftpboot-image.txt

Debian-installer tftpboot image information

This document describes "tftpboot images" in debian-installer.

tftpboot images

These images are the same as the (old) floppy images
but do not need to written to a floppy disk or CD-ROM.
The build process prepairs them for the install client.
So you can test comfortable the images without making floppies
and still benefit from all the code in debian-installer.

client requirements

The install client must be able to fetch the image
by TFTP and such protocols.
Check the documentation of your client system
for keywords as BOOTP, TFTP, networkboot, diskless.
If the clients bootrom doesn't provived such facililties
you may find a resort in projects like http://www.etherboot.org/
and http://sources.redhat.com/redboot/

If your install client supports PXE,
then use pxelinux from the syslinux package.

server requirements

This paragraph is to tell you that you can't use tftpboot
when have only 1 computer. For a client there has to be
a server to respond to the requests. The setup of such servers
is not documented here. ( send pointers of URLs of such documentation,
so they can be included here. )


This program takes three parameters, ${KERNEL} ${INITRD} ${KERNEL_SECOND}
and in that order. It is in the directory 'scripts'.
The reason for using this wrapper is to keep the Makefile working
for all architectures.

Here is a list of tools succesfull used inside 'scripts/mk-tftpboot-img'

* mkelf-linux
 from the mknbi package, version: 1.2.12-1
 the client is an Etherboot 5.0 version

* program-name
 report here other working tools

If the enviroment variable USER_TFTP_DIR is set,
the image will be installed to that directory

Example build

Goto the build directory and type

 make tftpboot_image TYPE=net USER_TFTP_DIR=/boot

# end of file

And the wrapper script
# cat scripts/mk-tftpboot-img
# mk_tftpboot_img
# makes a TFTPBOOT image
# ../doc/tftpboot-image.txt for more information
# The parameters
# will be munged, depending on the architecture, to a tftpbootable image stream
# the variable TBI should contain the destination of the tftpboot image,
#  the debian-installer build Makefile does this for you
ARCH=$(dpkg-architecture -qDEB_HOST_ARCH)
case ${ARCH} in
    mknbi-linux ${KERNEL} ${INITRD} > ${TBI}
    # put here code for other architectures
    # and update also the ../doc/tftpboot-image.txt file
    # cat ${KERNEL} ${INITRD} > ${TBI}
    # tell the tftpboot image is useless
    echo "
    The program 'debian-installer/scripts/mk-tftpboot-img'
    doesn't known about architecture '${ARCH}', please update it."

# end of wrapper script

Because that scripts calls mknbi the "Build-Depends" changes.

# cvs diff -u build/debian/control.in
Index: build/debian/control.in
RCS file: /cvs/debian-boot/debian-installer/build/debian/control.in,v
retrieving revision 1.1
diff -u -r1.1 control.in
--- build/debian/control.in     11 Apr 2003 20:02:51 -0000      1.1
+++ build/debian/control.in     20 Apr 2003 19:29:19 -0000
@@ -1,7 +1,7 @@
 Source: build-installer
 Section: devel
 Priority: extra
-Build-Depends: apt, bc, slang1-utf8-dev | slang1-dev, libnewt-utf8-dev | libnewt-dev, syslinux [i386], sysutils [i386], dosfstools [i386], libdiscover1-pic [!s390 !s390x], libdiscover1 [!s390 !s390x], ncurses-base, genext2fs, mklibs, libdebconf1, libdebian-installer3, modutils, glibc-pic, apt, @UDEB_DEPENDS@
+Build-Depends: apt, bc, slang1-utf8-dev | slang1-dev, libnewt-utf8-dev | libnewt-dev, syslinux [i386], sysutils [i386], dosfstools [i386], mknbi [i386], libdiscover1-pic [!s390 !s390x], libdiscover1 [!s390 !s390x], ncurses-base, genext2fs, mklibs, libdebconf1, libdebian-installer3, modutils, glibc-pic, apt, @UDEB_DEPENDS@
 Maintainer: Debian Install System Team <debian-boot@lists.debian.org>
 Uploaders: Joey Hess <joeyh@debian.org>, Alastair McKinstry <mckinstry@computer.org>
 Build-Depends: debhelper

Keep up the good work

Geert Stappers

Attachment: pgpyUhirruA7j.pgp
Description: PGP signature

Reply to: