Orange Pi One Plus: diferenças entre revisões
Ir para a navegação
Ir para a procura
Sem resumo de edição |
|||
| (Há 2 edições intermédias do mesmo utilizador que não estão a ser apresentadas) | |||
| Linha 3: | Linha 3: | ||
=== Gentoo === | === Gentoo === | ||
< | <syntaxhighlight lang="bash"> | ||
crossdev -P -v -t aarch64-unknown-linux-gnu | |||
PYTHON=python2 emerge u-boot-tools | |||
</ | </syntaxhighlight> | ||
=== ArchLinux === | === ArchLinux === | ||
< | <syntaxhighlight lang="bash"> | ||
pacman -S uboot-tools aarch64-linux-gnu-binutils aarch64-linux-gnu-gcc aarch64-linux-gnu-glibc aarch64-linux-gnu-linux-api-headers | |||
</ | </syntaxhighlight> | ||
== Preparar o cartão == | == Preparar o cartão == | ||
| Linha 20: | Linha 20: | ||
Escrever zeros no inicio do cartão para ter a certeza que não tem restos de outro bootloader. | Escrever zeros no inicio do cartão para ter a certeza que não tem restos de outro bootloader. | ||
< | <syntaxhighlight lang="bash"> | ||
dd if=/dev/zero of=/dev/sdX bs=1M count=8 | |||
</ | </syntaxhighlight> | ||
== Criar Partição == | == Criar Partição == | ||
| Linha 28: | Linha 28: | ||
Criar a partição com o inicio a partir do sector '''4096'''. | Criar a partição com o inicio a partir do sector '''4096'''. | ||
< | <syntaxhighlight lang="bash"> | ||
fdisk /dev/sdX | |||
</ | </syntaxhighlight> | ||
== Filesystem == | == Filesystem == | ||
| Linha 36: | Linha 36: | ||
Criar o filesystem com esta opção hacker que ripei de outro artigo. | Criar o filesystem com esta opção hacker que ripei de outro artigo. | ||
< | <syntaxhighlight lang="bash"> | ||
mkfs.ext4 -O ^metadata_csum /dev/sdX1 | |||
mkswap /dev/sdX2 | |||
</ | </syntaxhighlight> | ||
== Copiar o Userland == | == Copiar o Userland == | ||
< | <syntaxhighlight lang="bash"> | ||
mkdir /mnt/opioneplus | |||
mount /dev/sdX1 /mnt/opioneplus | |||
mkdir ~/opioneplus | |||
cd ~/opioneplus | |||
</ | </syntaxhighlight> | ||
=== ArchLinux === | === ArchLinux === | ||
< | <syntaxhighlight lang="bash"> | ||
wget http://archlinuxarm.org/os/ArchLinuxARM-aarch64-latest.tar.gz | |||
bsdtar -xpf ArchLinuxARM-aarch64-latest.tar.gz -C /mnt/opioneplus | |||
</ | </syntaxhighlight> | ||
=== Gentoo === | === Gentoo === | ||
| Linha 61: | Linha 61: | ||
Sacar o mais recente de http://distfiles.gentoo.org/releases/arm/autobuilds/current-stage3-arm64/ | Sacar o mais recente de http://distfiles.gentoo.org/releases/arm/autobuilds/current-stage3-arm64/ | ||
< | <syntaxhighlight lang="bash"> | ||
wget http://distfiles.gentoo.org/releases/arm/autobuilds/current-stage3-arm64/stage3-arm64-????????.tar.bz2 | |||
tar xfa stage3-arm64-????????.tar.bz2 -C /mnt/opioneplus | |||
</ | </syntaxhighlight> | ||
== fstab == | == fstab == | ||
| Linha 103: | Linha 103: | ||
E correr o mkimage para criar o '''boot.scr'''. | E correr o mkimage para criar o '''boot.scr'''. | ||
< | <syntaxhighlight lang="bash"> | ||
cd /mnt/opioneplus/boot | |||
mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n "Orange Pi One Plus boot script" -d boot.cmd boot.scr | |||
</ | </syntaxhighlight> | ||
== ARM Trusted Firmware == | == ARM Trusted Firmware == | ||
< | <syntaxhighlight lang="bash"> | ||
cd ~/opioneplus | |||
git clone https://github.com/ARM-software/arm-trusted-firmware | |||
cd arm-trusted-firmware | |||
make CROSS_COMPILE=aarch64-unknown-linux-gnu- PLAT=sun50i_h6 DEBUG=1 bl31 | |||
cp build/sun50i_h6/debug/bl31.bin ../u-boot/ | |||
</ | </syntaxhighlight> | ||
== U-Boot == | == U-Boot == | ||
< | <syntaxhighlight lang="bash"> | ||
cd ~/opioneplus | |||
git clone git://git.denx.de/u-boot.git | |||
cd u-boot | |||
export BL31=~/opioneplus/u-boot/bl31.bin | |||
make ARCH=arm CROSS_COMPILE=aarch64-unknown-linux-gnu- -j4 orangepi_one_plus_defconfig | |||
make ARCH=arm CROSS_COMPILE=aarch64-unknown-linux-gnu- -j4 | |||
</ | </syntaxhighlight> | ||
E gravar o bootloader no cartão com: | E gravar o bootloader no cartão com: | ||
< | <syntaxhighlight lang="bash"> | ||
dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=8k seek=1 | |||
</ | </syntaxhighlight> | ||
== Kernel == | == Kernel == | ||
< | <syntaxhighlight lang="bash"> | ||
# menuconfig, se necessario | # menuconfig, se necessario | ||
make ARCH=arm64 CROSS_COMPILE=aarch64-unknown-linux-gnu- menuconfig | |||
# sem modulos | # sem modulos | ||
make ARCH=arm64 CROSS_COMPILE=aarch64-unknown-linux-gnu- Image dtbs -j4 | |||
# com modulos | # com modulos | ||
make ARCH=arm64 CROSS_COMPILE=aarch64-unknown-linux-gnu- Image dtbs modules -j4 | |||
# instalar modulos | # instalar modulos | ||
make ARCH=arm64 CROSS_COMPILE=aarch64-unknown-linux-gnu- INSTALL_MOD_PATH=/mnt/opioneplus modules_install -j4 | |||
cp arch/arm64/boot/Image /mnt/opioneplus/boot | |||
cp arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-one-plus.dtb /mnt/opioneplus/boot/dtbs/allwinner | |||
</ | </syntaxhighlight> | ||
== MALI == | == MALI == | ||
< | <syntaxhighlight lang="bash"> | ||
cd ~/opioneplus | |||
git clone https://github.com/mripard/sunxi-mali.git | |||
cd sunxi-mali | |||
export ARCH=arm64 | |||
export CROSS_COMPILE=aarch64-unknown-linux-gnu- | |||
export KDIR=/root/opioneplus/linux | |||
export INSTALL_MOD_PATH=/mnt/opioneplus | |||
./build.sh -r r6p2 -b | |||
./build.sh -r r6p2 -i | |||
cd ~/opicp2 | |||
git clone https://github.com/free-electrons/mali-blobs.git | |||
cd mali-blobs | |||
cp r6p2/arm64/fbdev/lib* /mnt/opioneplus/usr/lib/ | |||
</ | </syntaxhighlight> | ||
== Finalizar == | == Finalizar == | ||
< | <syntaxhighlight lang="bash"> | ||
sync | |||
umount /mnt/opioneplus | |||
eject /dev/sdX | |||
</ | </syntaxhighlight> | ||
== Ligações externas == | == Ligações externas == | ||
| Linha 185: | Linha 185: | ||
* [https://wiki.gentoo.org/wiki/Orange_Pi_PC/Quick_Start Orange Pi PC Quick Start @ GentooWiki] | * [https://wiki.gentoo.org/wiki/Orange_Pi_PC/Quick_Start Orange Pi PC Quick Start @ GentooWiki] | ||
[[Category: | [[Category:SBC]] | ||
Edição atual desde as 21h13min de 7 de março de 2026
Requisitos
Gentoo
crossdev -P -v -t aarch64-unknown-linux-gnu
PYTHON=python2 emerge u-boot-tools
ArchLinux
pacman -S uboot-tools aarch64-linux-gnu-binutils aarch64-linux-gnu-gcc aarch64-linux-gnu-glibc aarch64-linux-gnu-linux-api-headers
Preparar o cartão
Limpar
Escrever zeros no inicio do cartão para ter a certeza que não tem restos de outro bootloader.
dd if=/dev/zero of=/dev/sdX bs=1M count=8
Criar Partição
Criar a partição com o inicio a partir do sector 4096.
fdisk /dev/sdX
Filesystem
Criar o filesystem com esta opção hacker que ripei de outro artigo.
mkfs.ext4 -O ^metadata_csum /dev/sdX1
mkswap /dev/sdX2
Copiar o Userland
mkdir /mnt/opioneplus
mount /dev/sdX1 /mnt/opioneplus
mkdir ~/opioneplus
cd ~/opioneplus
ArchLinux
wget http://archlinuxarm.org/os/ArchLinuxARM-aarch64-latest.tar.gz
bsdtar -xpf ArchLinuxARM-aarch64-latest.tar.gz -C /mnt/opioneplus
Gentoo
Sacar o mais recente de http://distfiles.gentoo.org/releases/arm/autobuilds/current-stage3-arm64/
wget http://distfiles.gentoo.org/releases/arm/autobuilds/current-stage3-arm64/stage3-arm64-????????.tar.bz2
tar xfa stage3-arm64-????????.tar.bz2 -C /mnt/opioneplus
fstab
Editar o /mnt/opioneplus/etc/fstab e usar o seguinte.
<file system> <dir> <type> <options> <dump> <pass> /dev/mmcblk0p1 / ext4 defaults,noatime 0 1 /dev/mmcblk0p2 none swap defaults 0 0
boot.scr
Criar o ficheiro /mnt/opioneplus/boot/boot.cmd com o seguinte conteúdo:
part uuid ${devtype} ${devnum}:${bootpart} uuid
#setenv console tty0
setenv bootargs console=${console} root=PARTUUID=${uuid} rw rootwait
setenv fdtfile allwinner/sun50i-h6-orangepi-one-plus.dtb
if load ${devtype} ${devnum}:${bootpart} ${kernel_addr_r} /boot/Image; then
if load ${devtype} ${devnum}:${bootpart} ${fdt_addr_r} /boot/dtbs/${fdtfile}; then
if load ${devtype} ${devnum}:${bootpart} ${ramdisk_addr_r} /boot/initramfs-linux.img; then
booti ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr_r};
else
booti ${kernel_addr_r} - ${fdt_addr_r};
fi;
fi;
fi
# Generate with:
# mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n "Orange Pi One Plus boot script" -d boot.cmd boot.scr
E correr o mkimage para criar o boot.scr.
cd /mnt/opioneplus/boot
mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n "Orange Pi One Plus boot script" -d boot.cmd boot.scr
ARM Trusted Firmware
cd ~/opioneplus
git clone https://github.com/ARM-software/arm-trusted-firmware
cd arm-trusted-firmware
make CROSS_COMPILE=aarch64-unknown-linux-gnu- PLAT=sun50i_h6 DEBUG=1 bl31
cp build/sun50i_h6/debug/bl31.bin ../u-boot/
U-Boot
cd ~/opioneplus
git clone git://git.denx.de/u-boot.git
cd u-boot
export BL31=~/opioneplus/u-boot/bl31.bin
make ARCH=arm CROSS_COMPILE=aarch64-unknown-linux-gnu- -j4 orangepi_one_plus_defconfig
make ARCH=arm CROSS_COMPILE=aarch64-unknown-linux-gnu- -j4
E gravar o bootloader no cartão com:
dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=8k seek=1
Kernel
# menuconfig, se necessario
make ARCH=arm64 CROSS_COMPILE=aarch64-unknown-linux-gnu- menuconfig
# sem modulos
make ARCH=arm64 CROSS_COMPILE=aarch64-unknown-linux-gnu- Image dtbs -j4
# com modulos
make ARCH=arm64 CROSS_COMPILE=aarch64-unknown-linux-gnu- Image dtbs modules -j4
# instalar modulos
make ARCH=arm64 CROSS_COMPILE=aarch64-unknown-linux-gnu- INSTALL_MOD_PATH=/mnt/opioneplus modules_install -j4
cp arch/arm64/boot/Image /mnt/opioneplus/boot
cp arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-one-plus.dtb /mnt/opioneplus/boot/dtbs/allwinner
MALI
cd ~/opioneplus
git clone https://github.com/mripard/sunxi-mali.git
cd sunxi-mali
export ARCH=arm64
export CROSS_COMPILE=aarch64-unknown-linux-gnu-
export KDIR=/root/opioneplus/linux
export INSTALL_MOD_PATH=/mnt/opioneplus
./build.sh -r r6p2 -b
./build.sh -r r6p2 -i
cd ~/opicp2
git clone https://github.com/free-electrons/mali-blobs.git
cd mali-blobs
cp r6p2/arm64/fbdev/lib* /mnt/opioneplus/usr/lib/
Finalizar
sync
umount /mnt/opioneplus
eject /dev/sdX