1

Je pose ça ici au cas où il y aurait des habitués/spécialistes des Linux embarqués !

Je teste actuellement buildroot pour faire une petite borne Pico 8 (appli userland) basée sur une OrangePi Lite.

Le but est de faire comme le projet de PicoPi (son site et son github ici) mais pour le OrangePi Lite. J'ai demandé des conseils au dev mais j'ai appris récemment qu'il était décédé d'un cancer l'année dernière ( sad ) donc je tâtonne seul sur ce sujet. Ce que je veux c'est un système ultra léger qui boot en deux secondes en lançant direct la version ARM de Pico8 et qui fait pas des dizaines de Mio (bref un système minimal et pas un Raspbian avec des centaines de paquets et services qui servent à rien).

Le build spécial Rpi du mec génère ces fichiers (qu'on a juste à coller sur une SD en FAT32 sans besoin de faire de truc chelou avec els parttions, bref KISS) :

bcm2708-rpi-b.dtb
bcm2708-rpi-b-plus.dtb
bcm2708-rpi-cm.dtb
bootcode.bin
config.txt
fixup.dat
start.elf
pico.pi

Si j'ai bien pigé, bootcode.bin est lancé en premier et charge un fichier .dtb. Je ne sais pas à quoi servent fixup.data, pico.pi, start.elf ni s'ils sont dépendant de l'archi (ici RasPi) ou bien si je peux les réutiliser sur une autre board (ce qui m'irait bien vu que le mec n'explique ni leur utilité ni comment les générer).

Pour le OrangePi j'ai téléchargé le dernier buildroot (https://github.com/buildroot/buildroot), puis ai fait un make orangepi_lite_defconfig && make. Une heure de build après (penser à installer ncurses-dev et surtout g++ avant helico) voici les fichiers générés :

boot.scr
rootfs.ext4
u-boot.bin
boot.vfat
sdcard.img
u-boot-sunxi-with-spl.bin
rootfs.ext2
sun8i-h3-orangepi-lite.dtb
zImage

En gras celui qui correspond au dtb (fichier qu'on retrouve dans le build final du gars mais pour le Pi), mais je ne retrouve pas les autres fichiers (start.elf, pico.pi (pour lui j'ai trouvé c'est zImage renommé) et fixup.dat).

De plus si je sniffe ce qu'il y a dans le sdcard.img que je suis censé flasher sur une SD je vois que j'ai un système complet, loin d'être ultra-minimaliste (74Mo) :

$ binwalk sdcard.img 

DECIMAL       HEXADECIMAL     DESCRIPTION
--------------------------------------------------------------------------------
40960         0xA000          uImage header, header size: 64 bytes, header CRC: 0xB232A704, created: 2020-03-04 22:42:11, image size: 427213 bytes, Data Address: 0x4A000000, Entry Point: 0x0, data CRC: 0x47DB92DD, OS: Firmware, CPU: ARM, image type: Firmware Image, compression type: none, image name: "U-Boot 2019.10 for sunxi board"
42976         0xA7E0          CRC32 polynomial table, little endian
249212        0x3CD7C         SHA256 hash constants, little endian
1087524       0x109824        Linux kernel ARM boot executable zImage (little-endian), load address: "0x00000000", end address: "0x0045B2C8"
1117120       0x110BC0        gzip compressed data, maximum compression, from Unix, NULL date (1970-01-01 00:00:00)
2505612       0x263B8C        MySQL ISAM index file Version 5
5677056       0x56A000        uImage header, header size: 64 bytes, header CRC: 0xE63D3BAE, created: 2020-03-04 22:42:19, image size: 238 bytes, Data Address: 0x0, Entry Point: 0x0, data CRC: 0x2B46BD30, OS: Linux, CPU: ARM, image type: Script file, compression type: none, image name: ""
11534336      0xB00000        Linux EXT filesystem, rev 1.0, ext4 filesystem data, UUID=37d2e246-7032-43af-8f14-bee51ce61ce6
11810218      0xB435AA        Unix path: /proc/self/fd/2
13779968      0xD24400        ELF, 32-bit LSB executable, ARM, version 1 (SYSV)
14150256      0xD7EA70        End of Zip archive
14376917      0xDB5FD5        Copyright string: "copyrighted by many authors between 1998-2015."
14377023      0xDB603F        Copyright string: "copyright notices."
14377792      0xDB6340        eCos RTOS string reference: "ECOS field"
14378918      0xDB67A6        Neighborly text, "neighborsop after sending N ARP requests"
14378962      0xDB67D2        Neighborly text, "neighborsSeconds to wait for ARP reply"
14383045      0xDB77C5        Unix path: /var/spool/cron/crontabs
14410395      0xDBE29B        Unix path: /proc/sys/kernel/hotplug
14432908      0xDC3A8C        Unix path: /usr/share/udhcpc/default.script)
14439768      0xDC5558        eCos RTOS string reference: "ecos"
14445059      0xDC6A03        Unix path: /var/spool/cron/crontabs
14455430      0xDC9286        Unix path: /proc/self/fd/0
14455612      0xDC933C        Unix path: /sys/bus/scsi/devices
14458178      0xDC9D42        Unix path: /proc/sys/kernel/tainted
14471658      0xDCD1EA        Unix path: /proc/sys/net/ipv4/route/flush
14475259      0xDCDFFB        Unix path: /usr/share/udhcpc/default.script
14493036      0xDD256C        Unix path: /sys/bus/pci/devices
14493123      0xDD25C3        Unix path: /sys/bus/usb/devices
14496542      0xDD331E        Unix path: /proc/sys/kernel/usermodehelper/bset
14497519      0xDD36EF        POSIX tar archive (GNU), owner user name: "compression not compiled in", owner group name: "magic number"
36700160      0x2300000       Linux EXT filesystem, rev 1.0, ext4 filesystem data, UUID=37d2e246-7032-43af-8f14-bee51ce61ce6
53477376      0x3300000       Linux EXT filesystem, rev 1.0, ext4 filesystem data, UUID=37d2e246-7032-43af-8f14-bee51ce61ce6
70254592      0x4300000       Linux EXT filesystem, rev 1.0, ext4 filesystem data, UUID=37d2e246-7032-43af-8f14-bee51ce61ce6

Je pense donc que le fichier defonfig OrangePi_Lite (qui sert de base pour construire le système) est trop complet mais j'ai pas encore trouvé comment l'alléger. J'ai bien l'impression que le build custom du gars se passe de pas mal de trucs comme uBoot Busybox (ou alors il le planque bien) mais je ne comprend pas la cinématique de boot.

Ma piste actuelle là consiste à faire des diffs entre le github officiel de buildroot et celui du gars (https://github.com/gamaral/rpi-buildroot/tree/picopi) afin de voir ses customisations, mais vu le paquet de fichiers j'en suis pas arrivé au bout grin

Merci d'avance pour vos coups de main même si je pense que ça risque d'être un thread monologue qui résume mon avancée et mes fails helico
avatar
"If you see strict DRM and copy protection that threatens the preservation of history, fight it: copy the work, keep it safe, and eventually share it so it never disappears. [...] no one living 500 years from now will judge your infringing deeds harshly when they can load up an ancient program and see it for themselves."

Benj Edwards - Why History Needs Software Piracy

- - -
Achat ou échange: topic de mes recherches Meilleur smiley = #helico# Obligatory XKCD

2

Erf c'est bien branlé git(hub) quand même, le petit diff entre la branche buildroot principale et pico pi avec tout réuni grin
gamaral/rpi-buildrootGitHubBuildroot overlay with a few personal tweaks for the Raspberry Pi - gamaral/rpi-buildroot


J'ai plus qu'à adapter, ça serait bien si j'arrivais à faire tourner ça avant ce weekend !
avatar
"If you see strict DRM and copy protection that threatens the preservation of history, fight it: copy the work, keep it safe, and eventually share it so it never disappears. [...] no one living 500 years from now will judge your infringing deeds harshly when they can load up an ancient program and see it for themselves."

Benj Edwards - Why History Needs Software Piracy

- - -
Achat ou échange: topic de mes recherches Meilleur smiley = #helico# Obligatory XKCD

3

Godzil a été invité sur ce sujet.


Linux embarqué et Pico8, c'est son rayon smile
avatar
Zeroblog

« Tout homme porte sur l'épaule gauche un singe et, sur l'épaule droite, un perroquet. » — Jean Cocteau
« Moi je cherche plus de logique non plus. C'est surement pour cela que j'apprécie les Ataris, ils sont aussi logiques que moi ! » — GT Turbo

4

(qu’est-ce qui n’est pas le rayon de Godzil ? grin)

5

(taper des posts sans fautes de frappe ? cheeky)
avatar
Zeroblog

« Tout homme porte sur l'épaule gauche un singe et, sur l'épaule droite, un perroquet. » — Jean Cocteau
« Moi je cherche plus de logique non plus. C'est surement pour cela que j'apprécie les Ataris, ils sont aussi logiques que moi ! » — GT Turbo

6

./5 *shots fired*
avatar
"If you see strict DRM and copy protection that threatens the preservation of history, fight it: copy the work, keep it safe, and eventually share it so it never disappears. [...] no one living 500 years from now will judge your infringing deeds harshly when they can load up an ancient program and see it for themselves."

Benj Edwards - Why History Needs Software Piracy

- - -
Achat ou échange: topic de mes recherches Meilleur smiley = #helico# Obligatory XKCD

7

avatar
"If you see strict DRM and copy protection that threatens the preservation of history, fight it: copy the work, keep it safe, and eventually share it so it never disappears. [...] no one living 500 years from now will judge your infringing deeds harshly when they can load up an ancient program and see it for themselves."

Benj Edwards - Why History Needs Software Piracy

- - -
Achat ou échange: topic de mes recherches Meilleur smiley = #helico# Obligatory XKCD

8

Zerosquare (./5) :
(taper des posts sans fautes de frappe ? cheeky)

embarrassed
avatar
Proud to be CAKE©®™


GCC4TI importe qui a problème en Autriche, pour l'UE plus et une encore de correspours nucléaire, ce n'est pas ytre d'instérier. L'état très même contraire, toujours reconstruire un pouvoir une choyer d'aucrée de compris le plus mite de genre, ce n'est pas moins)
Stalin est l'élection de la langie.

9

Allez je profite du confinement pour m'y remettre avec un peu de lecture sur le sujet: https://wrongbaud.github.io/Using-Buildroot-for-Reverse-Engineering/ (le reste du blog est tout aussi bien)
avatar
"If you see strict DRM and copy protection that threatens the preservation of history, fight it: copy the work, keep it safe, and eventually share it so it never disappears. [...] no one living 500 years from now will judge your infringing deeds harshly when they can load up an ancient program and see it for themselves."

Benj Edwards - Why History Needs Software Piracy

- - -
Achat ou échange: topic de mes recherches Meilleur smiley = #helico# Obligatory XKCD