5.1. Arranque del instalador en 32-bit hard-float ARMv7

5.1.1. Formatos de imagen de arranque

En los sistemas basados en ARM, en la mayoría de los casos, se utiliza uno de los dos formatos de imágenes de arranque: a) núcleos Linux estándares en formato zImage (vmlinuz) conjuntamente con discos de RAM inicial estándares de Linux (initrd.gz), o bien b) núcleos en formato uImage (uImage) conjuntamente con los discos de RAM inicial correspondientes (uInitrd).

uImage y uInitrd son formatos de imagen diseñados para el «firmware» U-Boot, utilizados en muchos sistemas basados en ARM (sobre todo de 32 bits). Las versiones anteriores de U-Boot solo pueden arrancar archivos en el formato uImage/uInitrd y, por tanto, suelen emplearse en sistemas ARM más antiguos. Las versiones más recientes de U-Boot permiten además arrancar núcleos Linux estándares e imágenes de discos RAM, aunque la sintaxis de las órdenes necesarias para hacerlo es algo distinta de la utilizada para arrancar uImages.

En los sistemas que utilizan un núcleo multiplataforma, además del núcleo y el disco de RAM inicial se necesita lo que se denomina un archivo de árbol de dispositivos (también conocido como «device-tree blob» o dtb). Este archivo es específico para cada sistema admitido y contiene la descripción del «hardware» concreto de cada sistema. Este dtb lo debería suministrar el «firmware» del equipo, aunque en la práctica a menudo hace falta cargar uno nuevo.

5.1.2. Configuración de consola

The netboot tarball (Sección 5.1.3.2, “Pre-built netboot tarball”), and the installer SD-card images (Sección 5.1.5, “Utilizar imágenes precompiladas para tarjetas SD con el instalador”) use the (platform-specific) default console that is defined by U-Boot in the console variable. In most cases that is a serial console, so on those platforms you by default need a serial console cable to use the installer.

En las plataformas que admiten un terminal de vídeo, puede modificar la variable console de U-Boot si quiere que el instalador se inicie en la consola de vídeo.

5.1.3. Arrancar desde TFTP

Booting from the network requires that you have a network connection and a TFTP network boot server (and probably also a DHCP, RARP, or BOOTP server for automatic network configuration).

The server-side setup to support network booting is described in Sección 4.3, “Preparación de los ficheros para el arranque a través de red usando TFTP”.

5.1.3.1. Arranque TFTP en U-Boot

Network booting on systems using the U-Boot firmware consists of three steps: a) configuring the network, b) loading the images (kernel/initial ramdisk/dtb) into memory and c) actually executing the previosly loaded code.

First you have to configure the network, either automatically via DHCP by running

setenv autoload no
dhcp

or manually by setting several environment variables

setenv ipaddr <ip address of the client>
setenv netmask <netmask>
setenv serverip <ip address of the tftp server>
setenv dnsip <ip address of the nameserver>
setenv gatewayip <ip address of the default gateway>

If you prefer, you can make these settings permanent by running

saveenv

Afterwards you need to load the images (kernel/initial ramdisk/dtb) into memory. This is done with the tftpboot command, which has to be provided with the address at which the image shall be stored in memory. Unfortunately the memory map can vary from system to system, so there is no general rule which addresses can be used for this.

On some systems, U-Boot predefines a set of environment variables with suitable load addresses: kernel_addr_r, ramdisk_addr_r and fdt_addr_r. You can check whether they are defined by running

printenv kernel_addr_r ramdisk_addr_r fdt_addr_r

If they are not defined, you have to check your system's documentation for appropriate values and set them manually. For systems based on Allwinner SunXi SOCs (e.g. the Allwinner A10, architecture name sun4i or the Allwinner A20, architecture name sun7i), you can e.g. use the following values:

setenv kernel_addr_r 0x46000000
setenv fdt_addr_r 0x47000000
setenv ramdisk_addr_r 0x48000000

When the load addresses are defined, you can load the images into memory from the previously defined tftp server with

tftpboot ${kernel_addr_r} <filename of the kernel image>
tftpboot ${fdt_addr_r} <filename of the dtb>
tftpboot ${ramdisk_addr_r} <filename of the initial ramdisk image>

The third part is setting the kernel commandline and actually executing the loaded code. U-Boot passes the content of the bootargs environment variable as commandline to the kernel, so any parameters for the kernel and the installer - such as the console device (see Sección 5.3.1, “Consola de arranque”) or preseeding options (see Sección 5.3.2, “Parámetros del instalador de Debian” and Apéndice B, Instalar automáticamente utilizando preconfiguración) - can be set with a command like

setenv bootargs console=ttyS0,115200 rootwait panic=10

The exact command to execute the previously loaded code depends on the image format used. With uImage/uInitrd, the command is

bootm ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r}

and with native Linux images it is

bootz ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr_r}

Nota: al arrancar imágenes de Linux estándares, es importante cargar la imagen del disco RAM inicial después del núcleo y el «dtb» a medida que U-Boot define en la variable «filesize» el valor del tamaño del último archivo cargado y la orden «bootz» solicita el tamaño de la imagen del disco RAM para que esta funcione adecuadamente. Si está arrancando un núcleo específico para una plataforma (un núcleo sin árbol de dispositivos, por ejemplo), omita el parámetro ${fdt_addr_r}.

5.1.3.2. Pre-built netboot tarball

Debian provides a pre-built tarball ( .../images/netboot/netboot.tar.gz ) that can simply be unpacked on your tftp server and contains all files necessary for netbooting. It also includes a boot script that automates all steps to load the installer. Modern U-Boot versions contain a tftp autoboot feature that becomes active if there is no bootable local storage device (MMC/SD, USB, IDE/SATA/SCSI) and then loads this boot script from the tftp server. Prerequisite for using this feature is that you have a dhcp server in your network which provides the client with the address of the tftp server.

If you would like to trigger the tftp autoboot feature from the U-Boot commandline, you can use the follwing command:

run bootcmd_dhcp

To manually load the bootscript provided by the tarball, you can alternatively issue the following commands at the U-Boot prompt:

setenv autoload no
dhcp
tftpboot ${scriptaddr} /debian-installer/armhf/tftpboot.scr
source ${scriptaddr}

5.1.4. Booting from a USB stick in U-Boot

Many modern U-Boot versions have USB support and allow booting from USB mass storage devices such as USB sticks. Unfortunately the exact steps required to do that can vary quite a bit from device to device.

U-Boot v2014.10 has introduced a common commandline handling and autoboot framework. This allows building generic boot images that work on any system implementing this framework. The debian-installer supports installation from a USB stick on such systems, but unfortunately not all platforms have adopted this new framework yet.

To build a bootable USB stick for installing Debian, unpack the hd-media tarball (see Sección 4.2.1, “Dónde encontrar las imágenes de instalación”) onto a USB stick formatted with a filesystem supported by the U-Boot version on your device. For modern U-Boot versions, any of FAT16 / FAT32 / ext2 / ext3 / ext4 usually works. Then copy the ISO image file of the first Debian installation CD or DVD onto the stick.

El mecanismo de arranque automático en las versiones modernas de U-Boot funciona de manera semejante a las opciones de orden de inicio de la BIOS de los PC, dado que, por ejemplo, comprueba una lista de dispositivos de arranque posibles proveniente de una imagen de arranque válida y arranca el primero que encuentra. Si no hay ningún sistema operativo instalado, enchufar el dispositivo USB y encender el sistema debería bastar para que se inicie el instalador. Puede asimismo iniciar el proceso de arranque desde USB desde el indicador de U-Boot en cualquier momento; para ello ejecute la orden run bootcmd_usb0.

One problem that can come up when booting from a USB stick while using a serial console can be a console baudrate mismatch. If a console variable is defined in U-Boot, the debian-installer boot script automatically passes it to the kernel to set the primary console device and, if applicable, the console baudrate. Unfortunately the handling of the console variable varies from platform to platform - on some platforms, the console variable includes the baudrate (as in console=ttyS0,115200), while on other platforms the console variable contains only the device (as in console=ttyS0). The latter case leads to a garbled console output when the default baudrate differs between U-Boot and the kernel. Modern U-Boot versions often use 115200 baud while the kernel still defaults to the traditional 9600 baud. If this happens, you should manually set the console variable to contain the correct baudrate for your system and then start the installer with the run bootcmd_usb0 command.

5.1.5. Utilizar imágenes precompiladas para tarjetas SD con el instalador

En determinados sistemas, Debian facilita imágenes para tarjetas SD que contienen tanto U-Boot como el debian-installer. Estas imágenes son de dos tipos: una para descargar los paquetes de «software» desde la red (disponible en .../images/netboot/SD-card-images/ ) y otra para llevar a cabo instalaciones sin conexión mediante un CD/DVD de Debian (disponible en .../images/hd-media/SD-card-images/ ). Para ahorrar espacio y ancho de banda de red, las imágenes se dividen en dos partes: una dependiente del sistema denominada firmware.<tipo-sistema>.img.gz y otra independiente del sistema denominada partition.img.gz.

To create a complete image from the two parts on Linux systems, you can use zcat as follows:

zcat firmware.<system-type>.img.gz partition.img.gz > complete_image.img

On Windows systems, you have to first decompress the two parts separately, which can be done e.g. by using 7-Zip, and then concatenate the decompressed parts together by running the command

copy /b firmware.<system-type>.img + partition.img complete_image.img

in a Windows CMD.exe window.

Write the resulting image onto an SD card, e.g. by running the following command on a Linux system:

cat complete_image.img > /dev/SD_CARD_DEVICE

After plugging the SD card into the target system and powering the system up, the installer is loaded from the SD card. If you use the hd-media variant for offline installations, you must provide the installer with access to the first Debian CD/DVD on a separate medium, which can e.g. be a CD/DVD ISO image on a USB stick.

When you come to the partitioning step in the installer (see Sección 6.3.4, “Particionado y elección de punto de montaje”), you can delete or replace any previous partitions on the card. Once the installer is started, it runs completely in the system's main memory and does not need to access the SD card anymore, so you can use the full card for installing Debian. The easiest way to create a proper partition layout on the SD card is to let the installer automatically create one for you (see Sección 6.3.4.2, “Particionado guiado”).