Rockpi4/dev/u-boot/pxe/pt BR
ROCK Pi 4 > Development > U-boot > PXE BOOT
Inicialização PXE, Preboot eXecution Environment é uma especificação que descreve um ambiente cliente-servidor padronizado que inicializa um conjunto de softwares, recuperado de uma rede. U-boot no ROCK Pi 4 com suporta a inicialização PXE e é ativado por padrão. Esta página descreve como usar a inicialização PXE no ROCK Pi 4.
Contents
Configuração do servidor
este documento é usado como servidor tftp para testar a inicialização do pxe em 'ramdisk' ; em seguida, instruiremos sobre a instalação e configuração do servidor tftp no ubuntu 16.04LTS e a preparação de alguns arquivos de inicialização.
Etapa 1: Instalar o servidor TFTP e TFTP
sudo apt-get install tftp-hpa tftpd-hpa
Etapa 2: Configurar o servidor TFTP
1.Crie uma pasta, assim:
mkdir /data/tftp_server
2.modifique o arquivo de configuração, assim:
$ cat /etc/default/tftpd-hpa # /etc/default/tftpd-hpa TFTP_USERNAME="tftp" TFTP_DIRECTORY="/data/tftp_server" TFTP_ADDRESS="0.0.0.0:69" TFTP_OPTIONS="-l -c -s"
Etapa 3: reiniciar o tftp
service tftpd-hpa restart
Etapa 4: preparando o arquivo de inicialização
copie todos os arquivos da partição de inicialização do sistema operacional debian, da seguinte maneira:
#:/data/tftp_server$ tree . ├── config-4.4.154-88-rockchip-00030-g90239a6 //copiar do debian ├── dtbs //.dtb file,nós precisamos rockpi-4b-linux.dtb,copiar do debian │ └── 4.4.154-88-rockchip-00030-g90239a6 │ └── rockchip │ ├── ficus-linux.dtb │ ├── px30-evb-ddr3-lvds-v10.dtb . . . │ └── rockpi-4b-linux.dtb ├── extlinux //copiar do debian │ ├── extlinux.conf ├── hw_intfc.conf //copiar do debian ├── initrd.img-4.4.154-88-rockchip-00030-g90239a6 //ramdisk,copiar do debian ├── overlays //.dtbo files,copiar do debian │ ├── at24c02.dtbo │ ├── console-on-ttyS2.dtbo │ ├── console-on-ttyS4.dtbo . . . │ ├── spi1-waveshare35c.dtbo │ └── two-color-led.dtbo ├── pxelinux.cfg //esta pasta é importante, você pode criar a pasta por si só │ ├── 01-be-73-e6-4e-04-2b //nomeado por env ethaddr do uboot.i apresentará este arquivo │ └── extlinux.conf └── vmlinuz-4.4.154-88-rockchip-00030-g90239a6 //esta é uma imagem do kernel, copie do debian ou crie você mesmo
Pxelinux.cfg
chamado arquivo de configuração pxe, execute o uboot e print ethaddr:
...
hclk_perilp1 100000 KHz
pclk_perilp1 50000 KHz
Net: eth0: ethernet@fe300000
Hit key to stop autoboot('CTRL+C'): 0
=> print ethaddr
ethaddr=be:73:e6:4e:04:2b
então eu nomeei meu arquivo de configuração pxe 01-be-73-e6-4e-04-2b,ou você pode nomear como padrão
:/data/tftp_server/pxelinux.cfg$ cat 01-be-73-e6-4e-04-2b
label kernel-4.4.154-88-rockchip-00030-g90239a6
kernel /vmlinuz-4.4.154-88-rockchip-00030-g90239a6 //escolha sua imagem do kernel
devicetreedir /dtbs/4.4.154-88-rockchip-00030-g90239a6 //escolha sua pasta dtb
initrd initrd.img-4.4.154-88-rockchip-00030-g90239a6 //escolha seu ramdisk
append earlycon=uart8250,mmio32,0xff1a0000 swiotlb=1 coherent_pool=1m earlyprintk console=ttyFIQ0,1500000n8 rw root=PARTUUID=b921b045-1d rootfstype=ext4 init=/sbin/init rootwait //this is bootargs for kernel
Rock Pi 4
devemos instalar o uboot no spi flash ou emmc ou microSD, este documento é usado spi flash, então consulte spi-install to install uboot in spi flash
Etapa 1: Configurando o endereço IP
entre no uboot e defina alguns env:
=> setenv ipaddr xx.xx.xx.xx //set rockpi4 ip => setenv serverip xx.xx.xx.xx //set ip of tftp
Etapa 2: executando o comando pxe boot
Quando você executa o pxe cammand, o uboot recebe alguns arquivos de inicialização do seu servidor tftp.
=>pxe get
missing environment variable: pxeuuid
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/01-be-73-e6-4e-04-2b
Speed: 1000, full duplex
Using ethernet@fe300000 device
TFTP from server 192.168.2.140; our IP address is 192.168.2.205
Filename 'pxelinux.cfg/01-be-73-e6-4e-04-2b'.
Load address: 0x600000
Loading: #
391.6 KiB/s
done
Bytes transferred = 401 (191 hex)
Config file found
=>pxe boot
missing environment variable: bootfile
Retrieving file: /hw_intfc.conf
Speed: 1000, full duplex
Using ethernet@fe300000 device
TFTP from server 192.168.2.140; our IP address is 192.168.2.205
Filename '/hw_intfc.conf'.
Load address: 0x700000
Loading: #
840.8 KiB/s
feito
Bytes transferred = 1722 (6ba hex)
dtoverlay number: 0, name:/overlays/console-on-ttyS2.dtbo
hw_conf.valid = 1
hw_conf.pwm0 = 0
hw_conf.pwm1 = 0
hw_conf.uart2 = 0
hw_conf.uart4 = 0
hw_conf.spi1 = 0
hw_conf.spi2 = 0
hw_conf.i2c2 = 0
hw_conf.i2c6 = 0
hw_conf.i2c7 = 0
hw_conf.dts_overlay_count = 1
hw_conf.dts_overlay[0] = /overlays/console-on-ttyS2.dtbo
1: kernel-4.4.154-88-rockchip-00030-g90239a6
missing environment variable: bootfile
Retrieving file: initrd.img-4.4.154-88-rockchip-00030-g90239a6
Speed: 1000, full duplex
Using ethernet@fe300000 device
TFTP from server 192.168.2.140; our IP address is 192.168.2.205
Filename 'initrd.img-4.4.154-88-rockchip-00030-g90239a6'.
Load address: 0xa200000
Loading: ########......
##################
5.2 MiB/s
done
Bytes transferred = 4072215 (3e2317 hex)
missing environment variable: bootfile
Retrieving file: /vmlinuz-4.4.154-88-rockchip-00030-g90239a6
Speed: 1000, full duplex
Using ethernet@fe300000 device
TFTP from server 192.168.2.140; our IP address is 192.168.2.205
Filename '/vmlinuz-4.4.154-88-rockchip-00030-g90239a6'.
Load address: 0x280000
Loading: ################# ......
########################
5 MiB/s
feito
Bytes transferred = 19427336 (1287008 hex)
append: earlycon=uart8250,mmio32,0xff1a0000 swiotlb=1 coherent_pool=1m earlyprintk console=ttyFIQ0,1500000n8 rw root=PARTUUID=b921b045-1dt
missing environment variable: bootfile
Retrieving file: /dtbs/4.4.154-88-rockchip-00030-g90239a6/rockchip/rockpi-4b-linux.dtb
Speed: 1000, full duplex
Using ethernet@fe300000 device
TFTP from server 192.168.2.140; our IP address is 192.168.2.205
Filename '/dtbs/4.4.154-88-rockchip-00030-g90239a6/rockchip/rockpi-4b-linux.dtb'.
Load address: 0x8300000
Loading: #######
5 MiB/s
feito
Bytes transferred = 93561 (16d79 hex)
fdt addr 0000000008300000
fdt magic number edfe0dd0
fdt size 1048576
merge_dts_overlay
missing environment variable: bootfile
Retrieving file: /overlays/console-on-ttyS2.dtbo
Speed: 1000, full duplex
Using ethernet@fe300000 device
TFTP from server 192.168.2.140; our IP address is 192.168.2.205
Filename '/overlays/console-on-ttyS2.dtbo'.
Load address: 0x8200000
Loading: #
755.9 KiB/s
feito
Bytes transferred = 774 (306 hex)
overlay dtb(0x0000000008200000) is valid
fdt_overlay_apply 0000000008300000 0000000008200000
## Flattened Device Tree blob at 08300000
Booting using the fdt blob at 0x8300000
Loading Ramdisk to e99e3000, end e9dc5317 ... OK
Loading Device Tree to 00000000e98e0000, end 00000000e99e2fff ... OK
Adding bank: 0x00200000 - 0xf8000000 (size: 0xf7e00000)
Total: 717296.593 ms
Iniciando o kernel ...
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Initializing cgroup subsys cpuset
e agora, seu kernel está inicializando
