Please enable javascript, or click here to visit my ecommerce web site powered by Shopify.
Jump to: navigation, search

Difference between revisions of "Rockpi4/dev/Debian/es es"

< Rockpi4‎ | dev‎ | Debian
(Make rootfs image)
(Combine everything into one image)
Line 101: Line 101:
 
Esto instalará los paquetes de Rockchip especificados y los enlazará con el rootfs Debian estándar y generará una imagen rootfs en formato ext4 en  '''rootfs/linaro-rootfs.img'''.
 
Esto instalará los paquetes de Rockchip especificados y los enlazará con el rootfs Debian estándar y generará una imagen rootfs en formato ext4 en  '''rootfs/linaro-rootfs.img'''.
  
== Combine everything into one image ==
+
== Combinar todo en una única imagen ==
  
 
     build/mk-image.sh -c rk3399 -t system -r rootfs/linaro-rootfs.img
 
     build/mk-image.sh -c rk3399 -t system -r rootfs/linaro-rootfs.img
  
This will combine u-boot, kernel and rootfs into one image and generate GPT partition table. Output is
+
Esto combinará el u-boot, el núcleo y el rootfs en una única imagen y generará una tabla de particiones GPT. La salida será
  
 
     out/system.img
 
     out/system.img

Revision as of 23:32, 10 December 2018

    ROCK Pi 4 >  Desarrollando >  Compilando Debian

El SDK de Rockchip para Debian

A continuación están las instrucciones sobre cómo construir una imagen Debian para el ROCK Pi 4.

Obtener el código fuente

Necesitarás Git para usar múltiples repositorios git en la construción de la imagen.

Instala Git si no lo tienes.

   sudo apt-get update
   sudo apt-get install git

Clona el código fuente

   git clone --recursive https://github.com/radxa/rockchip-bsp.git

Bájate

   build  kernel  README.md  rkbin  rootfs  u-boot

Estos directorios contienen instrucciones para:

  • build:
    • Ficheros de script y ficheros de configuración para compilar u-boot, el núcleo y el rootfs.
  • kernel:
    • El código fuente del núcleo, la versión actual es la 4.4
  • rkbin:
    • Binarios precompilados de Rockchip, se incluye el cargador de primera etapa, y el Firmware ATF(Arm Trustzone Firmware).
  • rootfs:
    • Bootstrap es un rootfs basado en Debian, soporta las arquitecturas armhf y arm64 de Debian Jessie y Stretch.
  • u-boot:
    • u-boot como segunda etapa de cargador de arranque

Instalar el toolchain y las demás herramientas de construcción

   sudo apt-get install gcc-aarch64-linux-gnu device-tree-compiler libncurses5 libncurses5-dev build-essential libssl-dev mtools

Compilando u-boot

   ./build/mk-uboot.sh rockpi4b     #Para ROCK Pi 4 Modelo B

Las imágenes generadas se copiarán en la carpeta out/u-boot

   ls out/u-boot/
   idbloader.img  rk3399_loader_v1.12.112.bin  trust.img  uboot.img

Compilar el núcleo

Compilar el núcleo con la configuración por defecto rockchip_linux_defconfig

   ./build/mk-kernel.sh rockpi4b    #Para ROCK Pi 4 Modelo B

Cambiar la configuración del núcleo(opcional)

Opcionalmente, puedes cambiar la configuración por defecto del núcleo.

   cd kernel
   export ARCH=arm64
   export CROSS_COMPILE=aarch64-linux-gnu-
   make rockchip_linux_defconfig
   make menuconfig
   cd ..
   ./build/mk-kernel.sh rockpi4b    #Para ROCK Pi 4 Modelo B


Te devolverá la imagen del núcleo y el fichero dtb

   ls out/kernel/
   Image  rockpi-4b-linux.dtb

Crear una imagen de rootfs

Para compilar un rootfs de 32bits:

   export ARCH=armhf

Para compilar un rootfs de 64bits:

   export ARCH=arm64

Cómo construir un sistema de base Debian usando el servicio de construcción ubuntu de linaro (ubuntu-build-service).

   cd rootfs
   sudo apt-get install binfmt-support qemu-user-static
   sudo dpkg -i ubuntu-build-service/packages/*        # ignore the broken dependencies, we will fix it next step
   sudo apt-get install -f
   RELEASE=stretch TARGET=desktop ARCH=$ARCH ./mk-base-debian.sh

Esto creará una imagen de Debian Stretch, obtendrás un tar de rootfs llamado linaro-stretch-alip-xxxx.tar.gz.

Compila el rootfs de rk-debian con debug:

   VERSION=debug ARCH=$ARCH ./mk-rootfs-stretch.sh  && ./mk-image.sh

Esto instalará los paquetes de Rockchip especificados y los enlazará con el rootfs Debian estándar y generará una imagen rootfs en formato ext4 en rootfs/linaro-rootfs.img.

Combinar todo en una única imagen

   build/mk-image.sh -c rk3399 -t system -r rootfs/linaro-rootfs.img

Esto combinará el u-boot, el núcleo y el rootfs en una única imagen y generará una tabla de particiones GPT. La salida será

   out/system.img

Flash the image

For normal users, follow instructions here. You will need the generated out/system.img only.

For developers, flash from USB OTG port, follow instructions here. You will need the flash helper rk3399_loader_xxx.bin and generated out/system.img files.

Troubleshooting

Check ROCK Pi 4 FAQs first, if it doesn't help, start a new post on the forum https://forum.radxa.com/c/dev