Difference between revisions of "RockpiS/dev/pxe"
(Created page with "{{rockpiS_header}} {{Languages|rockpiS/dev/pxe}} ROCK Pi S > Development > PXE BOOT PXE boot, Preboot eXecution Envir...") |
|||
Line 5: | Line 5: | ||
PXE boot, Preboot eXecution Environment is a specification describes a standardized client-server environment that boots a software assembly, retrieved from a network. U-boot of ROCK Pi S supports PXE boot and it's enabled by default. This page describe how to use PXE boot on ROCK Pi S. | PXE boot, Preboot eXecution Environment is a specification describes a standardized client-server environment that boots a software assembly, retrieved from a network. U-boot of ROCK Pi S supports PXE boot and it's enabled by default. This page describe how to use PXE boot on ROCK Pi S. | ||
− | == Server setting == | + | ==PC Server setting == |
this document is used tftp server to test pxe boot to '''ramdisk''',next,we will instruct on installing and configuring the tftp server in ubuntu 18.04.5 LTS,and preparing some boot files. | this document is used tftp server to test pxe boot to '''ramdisk''',next,we will instruct on installing and configuring the tftp server in ubuntu 18.04.5 LTS,and preparing some boot files. | ||
Line 28: | Line 28: | ||
====Step 4:Preparing boot file==== | ====Step 4:Preparing boot file==== | ||
copy all files from debian os boot partition,as follows: | copy all files from debian os boot partition,as follows: | ||
+ | #:sudo scp -r rock@ip:/boot/* /data/tftp_server | ||
#:/data/tftp_server$ tree | #:/data/tftp_server$ tree | ||
. | . | ||
− | + | ├── boot.cmd | |
− | + | ├── boot.scr | |
− | + | ├── config-4.4.143-61-rockchip-g1f77a85486f7 //copy from ubuntu | |
− | + | ├── dtbs //.dtb file,we need '''rockpi-s-linux.dtb''',copy from ubuntu | |
− | + | │ └── 4.4.143-61-rockchip-g1f77a85486f7 | |
− | + | │ └── rockchip | |
− | + | │ ├── overlay //.dtbo files,copy from ubuntu | |
− | + | │ │ ├── i2c1-hym8563.dtbo | |
− | + | │ │ ├── README.rockchip-overlays | |
− | + | │ │ ├── rk3308-console-on-uart0.dtbo | |
− | + | . | |
− | + | . | |
− | + | . | |
− | + | │ ├── rk3399-videostrong-linux.dtb | |
− | + | │ ├── rk3399-vr-android.dtb | |
− | + | │ └── '''rockpi-s-linux.dtb''' | |
− | + | . | |
− | + | . | |
− | + | . | |
− | + | ├── extlinux //copy from ubuntu | |
− | + | │ └── extlinux.conf | |
− | + | ├── initrd.img-4.4.143-61-rockchip-g1f77a85486f7 //ramdisk,copy from ubuntu | |
− | + | ├── pxelinux.cfg //'''this folder is important,you can make the folder by yourself''' | |
− | + | │ └── 01-5e-50-a4-83-72-98 //'''named it by env ethaddr of uboot.i will introduce this file''' | |
− | + | ├── System.map-4.4.143-61-rockchip-g1f77a85486f7 | |
− | + | ├── uEnv.txt | |
− | + | └── vmlinuz-4.4.143-61-rockchip-g1f77a85486f7 //this is a kernel image,copy from debian or build by yourself | |
− | + | ||
====Pxelinux.cfg==== | ====Pxelinux.cfg==== | ||
named pxe configaration file,run to uboot and print ethaddr: | named pxe configaration file,run to uboot and print ethaddr: | ||
Line 65: | Line 66: | ||
Net: eth0: ethernet@fe300000 | Net: eth0: ethernet@fe300000 | ||
Hit key to stop autoboot('CTRL+C'): 0 | Hit key to stop autoboot('CTRL+C'): 0 | ||
− | => print ethaddr | + | => '''print ethaddr''' |
− | ethaddr= | + | ethaddr=5e:50:a4:83:72:98 |
− | so i named my pxe configaration file 01- | + | so i named my pxe configaration file '''01-5e-50-a4-83-72-98''',or you can named it default |
− | :/data/tftp_server/pxelinux.cfg$ cat 01- | + | :/data/tftp_server/pxelinux.cfg$ cat 01-5e-50-a4-83-72-98 |
− | label kernel-4.4. | + | label kernel-4.4.143-61-rockchip-g1f77a85486f7 |
− | + | kernel /vmlinuz-4.4.143-61-rockchip-g1f77a85486f7 //choose your kernel image | |
− | + | initrd /initrd.img-4.4.143-61-rockchip-g1f77a85486f7 //choose your ramdisk | |
− | + | devicetreedir /dtbs/4.4.143-61-rockchip-g1f77a85486f7 //choose your dtb folder | |
− | + | append earlyprintk console=ttyFIQ0,1500000n8 rw init=/sbin/init rootfstype=ext4 rootwait root=UUID=f6864320-28f2-41de-a865-3c2fb8d0e670 //this is bootargs for kernel | |
− | ==Rock Pi | + | |
− | we must install uboot on | + | ==Rock Pi S== |
+ | we must install uboot on microSD,this document is used microSD,so please see [https://wiki.radxa.com/RockpiS/install/microSD | microSD] to install uboot in microSD | ||
====Step 1: Configure ip addr==== | ====Step 1: Configure ip addr==== | ||
enter uboot,and set some env: | enter uboot,and set some env: | ||
− | => setenv ipaddr xx.xx.xx.xx //set | + | => setenv ipaddr xx.xx.xx.xx //set rockpis ip |
=> setenv serverip xx.xx.xx.xx //set ip of tftp | => setenv serverip xx.xx.xx.xx //set ip of tftp | ||
Line 87: | Line 89: | ||
when you run pxe cammand,uboot will get some boot files from your tftp server.as follows: | when you run pxe cammand,uboot will get some boot files from your tftp server.as follows: | ||
'''=>pxe get''' | '''=>pxe get''' | ||
− | + | missing environment variable: pxeuuid | |
− | + | missing environment variable: bootfile | |
− | + | Retrieving file: pxelinux.cfg/01-5e-50-a4-83-72-98 | |
− | + | Speed: 100, full duplex | |
− | + | Using ethernet@ff4e0000 device | |
− | + | TFTP from server 192.168.1.102; our IP address is 192.168.1.104 | |
− | + | Filename 'pxelinux.cfg/01-5e-50-a4-83-72-98'. | |
− | + | Load address: 0x600000 | |
− | + | Loading: # | |
− | + | 95.7 KiB/s | |
− | + | done | |
− | + | Bytes transferred = 395 (18b hex) | |
− | + | Config file found | |
'''=>pxe boot''' | '''=>pxe boot''' | ||
− | missing environment variable: bootfile | + | select kernel |
− | Retrieving file: /hw_intfc.conf | + | 1: kernel-4.4.143-61-rockchip-g1f77a85486f7 |
− | Speed: | + | Enter choice: missing environment variable: bootfile |
− | Using ethernet@ | + | Retrieving file: /hw_intfc.conf |
− | TFTP from server 192.168. | + | Speed: 100, full duplex |
− | Filename '/hw_intfc.conf'. | + | Using ethernet@ff4e0000 device |
− | Load address: 0x700000 | + | TFTP from server 192.168.1.102; our IP address is 192.168.1.104 |
− | Loading: | + | Filename '/hw_intfc.conf'. |
− | + | Load address: 0x700000 | |
− | + | Loading: * | |
− | + | TFTP error: 'File not found' (1) | |
− | + | Not retrying... | |
− | hw_conf.valid = | + | hw_conf.valid = 0 |
− | hw_conf. | + | hw_conf.i2c0 = 2 |
− | hw_conf. | + | hw_conf.i2c1 = 2 |
− | hw_conf. | + | hw_conf.i2c2 = 2 |
− | hw_conf. | + | hw_conf.i2c3 = 2 |
− | hw_conf. | + | hw_conf.pwm1 = 2 |
− | hw_conf. | + | hw_conf.pwm2 = 2 |
− | hw_conf. | + | hw_conf.pwm3 = 2 |
− | hw_conf. | + | hw_conf.spi0 = 2 |
− | hw_conf. | + | hw_conf.spi2 = 2 |
− | hw_conf. | + | hw_conf.uart0 = 2 |
− | hw_conf. | + | hw_conf.uart1 = 2 |
− | 1: kernel-4.4. | + | hw_conf.uart2 = 2 |
− | missing environment variable: bootfile | + | hw_conf.dts_overlay_count = 0 |
− | Retrieving file: initrd.img-4.4. | + | 1: kernel-4.4.143-61-rockchip-g1f77a85486f7 |
− | Speed: | + | missing environment variable: bootfile |
− | Using ethernet@ | + | Retrieving file: /initrd.img-4.4.143-61-rockchip-g1f77a85486f7 |
− | TFTP from server 192.168. | + | Speed: 100, full duplex |
− | Filename 'initrd.img-4.4. | + | Using ethernet@ff4e0000 device |
− | Load address: | + | TFTP from server 192.168.1.102; our IP address is 192.168.1.104 |
− | Loading: ######## | + | Filename '/initrd.img-4.4.143-61-rockchip-g1f77a85486f7'. |
− | ################## | + | Load address: 0x4000000 |
− | + | Loading: ################################################################# | |
− | done | + | ################################################################# |
− | Bytes transferred = | + | ################################################################# |
− | missing environment variable: bootfile | + | ################## |
− | Retrieving file: /vmlinuz-4.4. | + | 4 MiB/s |
− | Speed: | + | done |
− | Using ethernet@ | + | Bytes transferred = 6941705 (69ec09 hex) |
− | TFTP from server 192.168. | + | missing environment variable: bootfile |
− | Filename '/vmlinuz-4.4. | + | Retrieving file: /vmlinuz-4.4.143-61-rockchip-g1f77a85486f7 |
− | Load address: 0x280000 | + | Speed: 100, full duplex |
− | Loading: ################# | + | Using ethernet@ff4e0000 device |
− | ######################## | + | TFTP from server 192.168.1.102; our IP address is 192.168.1.104 |
− | + | Filename '/vmlinuz-4.4.143-61-rockchip-g1f77a85486f7'. | |
− | done | + | Load address: 0x280000 |
− | Bytes transferred = | + | Loading: ################################################################# |
− | append: | + | ################################################################# |
− | missing environment variable: bootfile | + | ################################################################# |
− | Retrieving file: /dtbs/4.4. | + | ############ |
− | Speed: | + | 3.9 MiB/s |
− | Using ethernet@ | + | done |
− | TFTP from server 192.168. | + | Bytes transferred = 10663944 (a2b808 hex) |
− | Filename '/dtbs/4.4. | + | append: earlyprintk console=ttyFIQ0,1500000n8 rw init=/sbin/init rootfstype=ext0 |
− | Load address: | + | missing environment variable: bootfile |
− | Loading: ##### | + | Retrieving file: /dtbs/4.4.143-61-rockchip-g1f77a85486f7/rockchip/rk3308-rock-pb |
− | + | Speed: 100, full duplex | |
− | done | + | Using ethernet@ff4e0000 device |
− | Bytes transferred = | + | TFTP from server 192.168.1.102; our IP address is 192.168.1.104 |
− | fdt addr | + | Filename '/dtbs/4.4.143-61-rockchip-g1f77a85486f7/rockchip/rk3308-rock-pi-s.dtb. |
− | fdt magic number edfe0dd0 | + | Load address: 0x1f00000 |
− | fdt size 1048576 | + | Loading: ##### |
− | + | 2.8 MiB/s | |
− | + | done | |
− | + | Bytes transferred = 63554 (f842 hex) | |
− | + | fdt addr 0000000001f00000 | |
− | + | fdt magic number edfe0dd0 | |
− | + | fdt size 1048576 | |
− | + | ## Flattened Device Tree blob at 01f00000 | |
− | + | Booting using the fdt blob at 0x1f00000 | |
− | + | Loading Ramdisk to 1ee68000, end 1f506c09 ... OK | |
− | + | Loading Device Tree to 000000001ed65000, end 000000001ee67fff ... OK | |
− | + | Adding bank: 0x00200000 - 0x20000000 (size: 0x1fe00000) | |
− | + | ||
− | + | Starting kernel ... | |
− | + | ||
− | ## Flattened Device Tree blob at | + | DDR Version V1.26 |
− | Booting using the fdt blob at | + | REGFB: 0x00000032, 0x00000031 |
− | Loading Ramdisk to | + | In |
− | Loading Device Tree to | + | 589MHz |
− | Adding bank: 0x00200000 - | + | . |
− | + | . | |
− | + | . | |
− | Starting kernel ... | + | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
and now,your kernel is booting up | and now,your kernel is booting up |
Revision as of 02:55, 25 May 2021
ROCK Pi S > Development > PXE BOOT
PXE boot, Preboot eXecution Environment is a specification describes a standardized client-server environment that boots a software assembly, retrieved from a network. U-boot of ROCK Pi S supports PXE boot and it's enabled by default. This page describe how to use PXE boot on ROCK Pi S.
Contents
PC Server setting
this document is used tftp server to test pxe boot to ramdisk,next,we will instruct on installing and configuring the tftp server in ubuntu 18.04.5 LTS,and preparing some boot files.
Step 1: Install TFTP and TFTP server
sudo apt-get install tftp-hpa tftpd-hpa
Step 2: Configure TFTP server
1.Create a folder,like this:
mkdir /data/tftp_server
2.modify configuration file,like this:
$ 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"
Step 3: Restart tftp
service tftpd-hpa restart
Step 4:Preparing boot file
copy all files from debian os boot partition,as follows:
#:sudo scp -r rock@ip:/boot/* /data/tftp_server #:/data/tftp_server$ tree . ├── boot.cmd ├── boot.scr ├── config-4.4.143-61-rockchip-g1f77a85486f7 //copy from ubuntu ├── dtbs //.dtb file,we need rockpi-s-linux.dtb,copy from ubuntu │ └── 4.4.143-61-rockchip-g1f77a85486f7 │ └── rockchip │ ├── overlay //.dtbo files,copy from ubuntu │ │ ├── i2c1-hym8563.dtbo │ │ ├── README.rockchip-overlays │ │ ├── rk3308-console-on-uart0.dtbo . . . │ ├── rk3399-videostrong-linux.dtb │ ├── rk3399-vr-android.dtb │ └── rockpi-s-linux.dtb . . . ├── extlinux //copy from ubuntu │ └── extlinux.conf ├── initrd.img-4.4.143-61-rockchip-g1f77a85486f7 //ramdisk,copy from ubuntu ├── pxelinux.cfg //this folder is important,you can make the folder by yourself │ └── 01-5e-50-a4-83-72-98 //named it by env ethaddr of uboot.i will introduce this file ├── System.map-4.4.143-61-rockchip-g1f77a85486f7 ├── uEnv.txt └── vmlinuz-4.4.143-61-rockchip-g1f77a85486f7 //this is a kernel image,copy from debian or build by yourself
Pxelinux.cfg
named pxe configaration file,run to uboot and 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=5e:50:a4:83:72:98
so i named my pxe configaration file 01-5e-50-a4-83-72-98,or you can named it default
:/data/tftp_server/pxelinux.cfg$ cat 01-5e-50-a4-83-72-98 label kernel-4.4.143-61-rockchip-g1f77a85486f7 kernel /vmlinuz-4.4.143-61-rockchip-g1f77a85486f7 //choose your kernel image initrd /initrd.img-4.4.143-61-rockchip-g1f77a85486f7 //choose your ramdisk devicetreedir /dtbs/4.4.143-61-rockchip-g1f77a85486f7 //choose your dtb folder append earlyprintk console=ttyFIQ0,1500000n8 rw init=/sbin/init rootfstype=ext4 rootwait root=UUID=f6864320-28f2-41de-a865-3c2fb8d0e670 //this is bootargs for kernel
Rock Pi S
we must install uboot on microSD,this document is used microSD,so please see | microSD to install uboot in microSD
Step 1: Configure ip addr
enter uboot,and set some env:
=> setenv ipaddr xx.xx.xx.xx //set rockpis ip => setenv serverip xx.xx.xx.xx //set ip of tftp
Step 2: run pxe boot cammand
when you run pxe cammand,uboot will get some boot files from your tftp server.as follows:
=>pxe get missing environment variable: pxeuuid missing environment variable: bootfile Retrieving file: pxelinux.cfg/01-5e-50-a4-83-72-98 Speed: 100, full duplex Using ethernet@ff4e0000 device TFTP from server 192.168.1.102; our IP address is 192.168.1.104 Filename 'pxelinux.cfg/01-5e-50-a4-83-72-98'. Load address: 0x600000 Loading: # 95.7 KiB/s done Bytes transferred = 395 (18b hex) Config file found =>pxe boot select kernel 1: kernel-4.4.143-61-rockchip-g1f77a85486f7 Enter choice: missing environment variable: bootfile Retrieving file: /hw_intfc.conf Speed: 100, full duplex Using ethernet@ff4e0000 device TFTP from server 192.168.1.102; our IP address is 192.168.1.104 Filename '/hw_intfc.conf'. Load address: 0x700000 Loading: * TFTP error: 'File not found' (1) Not retrying... hw_conf.valid = 0 hw_conf.i2c0 = 2 hw_conf.i2c1 = 2 hw_conf.i2c2 = 2 hw_conf.i2c3 = 2 hw_conf.pwm1 = 2 hw_conf.pwm2 = 2 hw_conf.pwm3 = 2 hw_conf.spi0 = 2 hw_conf.spi2 = 2 hw_conf.uart0 = 2 hw_conf.uart1 = 2 hw_conf.uart2 = 2 hw_conf.dts_overlay_count = 0 1: kernel-4.4.143-61-rockchip-g1f77a85486f7 missing environment variable: bootfile Retrieving file: /initrd.img-4.4.143-61-rockchip-g1f77a85486f7 Speed: 100, full duplex Using ethernet@ff4e0000 device TFTP from server 192.168.1.102; our IP address is 192.168.1.104 Filename '/initrd.img-4.4.143-61-rockchip-g1f77a85486f7'. Load address: 0x4000000 Loading: ################################################################# ################################################################# ################################################################# ################## 4 MiB/s done Bytes transferred = 6941705 (69ec09 hex) missing environment variable: bootfile Retrieving file: /vmlinuz-4.4.143-61-rockchip-g1f77a85486f7 Speed: 100, full duplex Using ethernet@ff4e0000 device TFTP from server 192.168.1.102; our IP address is 192.168.1.104 Filename '/vmlinuz-4.4.143-61-rockchip-g1f77a85486f7'. Load address: 0x280000 Loading: ################################################################# ################################################################# ################################################################# ############ 3.9 MiB/s done Bytes transferred = 10663944 (a2b808 hex) append: earlyprintk console=ttyFIQ0,1500000n8 rw init=/sbin/init rootfstype=ext0 missing environment variable: bootfile Retrieving file: /dtbs/4.4.143-61-rockchip-g1f77a85486f7/rockchip/rk3308-rock-pb Speed: 100, full duplex Using ethernet@ff4e0000 device TFTP from server 192.168.1.102; our IP address is 192.168.1.104 Filename '/dtbs/4.4.143-61-rockchip-g1f77a85486f7/rockchip/rk3308-rock-pi-s.dtb. Load address: 0x1f00000 Loading: ##### 2.8 MiB/s done Bytes transferred = 63554 (f842 hex) fdt addr 0000000001f00000 fdt magic number edfe0dd0 fdt size 1048576 ## Flattened Device Tree blob at 01f00000 Booting using the fdt blob at 0x1f00000 Loading Ramdisk to 1ee68000, end 1f506c09 ... OK Loading Device Tree to 000000001ed65000, end 000000001ee67fff ... OK Adding bank: 0x00200000 - 0x20000000 (size: 0x1fe00000) Starting kernel ... DDR Version V1.26 REGFB: 0x00000032, 0x00000031 In 589MHz . . .
and now,your kernel is booting up