4.4. Preparando os Arquivos para a Inicialização usando o Memory Stick USB

Para preparar a memória stick USB, será necessário um sistema onde o GNU/Linux já esteja sendo executado e que tenha suporte a USB. Tenha certeza que o módulo do kernel usb-storate está carregado ( modprobe usb-storage) e tente achar o dispositivo SCSI que recebeu a associação com a memória stick USB (neste exemplo será usado o dispositivo /dev/sda). Para gravar em sua memória stick primeiro desative a proteção contra gravação.

Note que a memória stick USB deverá ter pelo menos 128MB de tamanho (tamanhos menores são possíveis se seguir os passos em Seção 4.4.2, “Copiando os arquivos - o método flexível”).

4.4.1. Copiando os arquivos - o método fácil

Existe um arquivo tudo-em-um hd-media/boot.img.gz que contém todos os arquivos do programa de instalação (incluindo o kernel) assim como o yaboot e seu arquivo de configuração. Crie uma partição do tipo "Apple_Bootstrap" em sua memória stick USB usando o mac-fdisk comando C e descompacte a imagem diretamente para lá:

# zcat boot.img.gz > /dev/sda2

É claro que isto destruirá tudo que já estiver no dispositivo, assim tenha cuidado de usar o nome correto de dispositivo para sua memória stick USB.

Após isto, monte a memória stick USB (mount /dev/sda2 /mnt), que agora terá um sistema de arquivos HFS dentro dele e copie a imagem ISO Debian netinst ou cartão de visita para lá. Note que o nome de arquivo deverá finalizar em .iso. Desmonte a memória stick (umount /mnt) e você terá concluído.

4.4.2. Copiando os arquivos - o método flexível

Se quiser mais flexibilidade ou apenas deseja saber o que está acontecendo, você deverá usar o seguinte método para armazenar os arquivos em sua memória stick.

4.4.2.1. USB stick partitioning on PowerPC

Most USB sticks do not come pre-configured in such a way that Open Firmware can boot from them, so you will need to repartition the stick. On Mac systems, run mac-fdisk /dev/sda, initialise a new partition map using the i command, and create a new partition of type Apple_Bootstrap using the C command. (Note that the first "partition" will always be the partition map itself.) Then type

$ hformat /dev/sda2

Take care that you use the correct device name for your USB stick. The hformat command is contained in the hfsutils Debian package.

In order to start the kernel after booting from the USB stick, we will put a boot loader on the stick. The yaboot boot loader can be installed on an HFS filesystem and can be reconfigured by just editing a text file. Any operating system which supports the HFS file system can be used to make changes to the configuration of the boot loader.

The normal ybin tool that comes with yaboot does not yet understand USB storage devices, so you will have to install yaboot by hand using the hfsutils tools. Type

$ hmount /dev/sda2
$ hcopy -r /usr/lib/yaboot/yaboot :
$ hattrib -c UNIX -t tbxi :yaboot
$ hattrib -b :
$ humount

Again, take care that you use the correct device name. The partition must not be otherwise mounted during this procedure. This procedure writes the boot loader to the partition, and uses the HFS utilities to mark it in such a way that Open Firmware will boot it. Having done this, the rest of the USB stick may be prepared using the normal Unix utilities.

Mount the partition (mount /dev/sda2 /mnt) and copy the following files from the Debian archives to the stick:

  • vmlinux (kernel binary)

  • initrd.gz (initial ramdisk image)

  • yaboot.conf (yaboot configuration file)

  • boot.msg (optional boot message)

  • Optional kernel modules

The yaboot.conf configuration file should contain the following lines:

default=install
root=/dev/ram

message=/boot.msg

image=/vmlinux
        label=install
        initrd=/initrd.gz
        initrd-size=10000
        append="devfs=mount,dall --"
        read-only

Please note that the initrd-size parameter may need to be increased, depending on the image you are booting.

4.4.2.2. Adicionando uma imagem ISO

Agora você deverá colocar qualquer imagem ISO da Debian (businesscard, netinst ou até mesmo uma completa) em sua memória stick (caso couber em seu espaço livre). O nome de arquivo da imagem deverá ser finalizado em .iso.

Se quiser instalar através da rede, sem usar uma imagem ISO, você deverá, é claro, pular o passo anterior. Ainda em tempo, voce deverá usar um disco de memória ram inicial do diretório netboot ao invés do que se encontra em hd-media, porque o hd-media/initrd.gz não possui suporte a rede.

Quando terminar, desmonte a memória stick USB (umount /mnt) e ative sua proteção contra gravação.