From cfd47151ec95a744cd34d4d45e266ee3843e9aa6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Tue, 21 Jun 2016 08:57:25 +0200 Subject: [PATCH] Update the FEX handling in the documentation --- documentation/Enabling_hardware_features.md | 56 ++++++++++++++++++++- 1 file changed, 55 insertions(+), 1 deletion(-) diff --git a/documentation/Enabling_hardware_features.md b/documentation/Enabling_hardware_features.md index db10cae59..65ee8c1c0 100644 --- a/documentation/Enabling_hardware_features.md +++ b/documentation/Enabling_hardware_features.md @@ -22,7 +22,61 @@ root@bananapipro:~# uname -a Linux bananapipro 4.5.2-sunxi #11 SMP Thu Apr 28 21:53:25 CEST 2016 armv7l GNU/Linux ``` -In this example the kernel version is 4.5.2 so you can use DT to tweak some settings. If you get a kernel version 3.X then you'll be certainly using FEX. +In this example the kernel version is 4.5.2 so you can use DT to tweak some settings. If you get a kernel version 3.X then you'll be certainly using FEX like on an Orange Pi Plus 2E : + +``` +root@orangepiplus2e:~# uname -a +Linux orangepiplus2e 3.4.112-sun8i #10 SMP PREEMPT Wed Jun 1 19:43:08 CEST 2016 armv7l GNU/Linux +``` + +## FEX + +### Which file should I edit + +Armbian embed a lot of BIN files, but a symlink point to the one in use : + +``` +root@orangepiplus2e:~# ls -la /boot/script.bin +lrwxrwxrwx 1 root root 22 Jun 1 20:30 /boot/script.bin -> bin/orangepiplus2e.bin +``` + +### Updating a FEX + +You may need to use `sudo` with all the following commands. + +The whole process won't overwrite any of your files. If you're paranoid, you can make a proper backup of your BIN file : + +``` +cp /boot/script.bin /boot/bin/script.bin.backup +``` + +Then you can decompile your BIN into a FEX : + +``` +bin2fex /boot/script.bin /tmp/custom.fex +``` + +Finally you can edit your FEX file with your favorite text editor and compile it back to a BIN : + +``` +fex2bin /tmp/custom.fex /boot/bin/custom.bin +``` + +The last step is to change the symlink to use your custom BIN : + +``` +ln -sf /boot/bin/custom.bin /boot/script.bin +``` + +## Device Tree + +### Which file should I edit + +I use the following command and try to guess which file to use in `/boot/dtb/` : + +``` +cat /proc/device-tree/model +``` # H3 based Orange Pi, legacy kernel