NixOS on ARM/Banana Pi BPI-M5: Difference between revisions

imported>Grische
Created page with "{{ARM/breadcrumb}} == Status == Work in progress == Building Amlogic-compatible U-Boot == === Building U-Boot === '''Note:''' Do not use the severely outdated [https://gi..."
 
mNo edit summary
Line 11: Line 11:
'''Note:''' Do not use the severely outdated [https://github.com/BPI-SINOVOIP/BPI-M5-bsp BPI-M5-bsp] or [https://github.com/Dangku/Amlogic-u-boot Amlogic-u-boot] to build u-boot.
'''Note:''' Do not use the severely outdated [https://github.com/BPI-SINOVOIP/BPI-M5-bsp BPI-M5-bsp] or [https://github.com/Dangku/Amlogic-u-boot Amlogic-u-boot] to build u-boot.


<syntaxhighlight lang="bash">
<syntaxhighlight lang="shell-session">
$ git clone git://git.denx.de/u-boot.git
$ git clone git://git.denx.de/u-boot.git
$ cd u-boot
$ cd u-boot
Line 24: Line 24:
'''Note:''' The following steps require an AMD64 platform.
'''Note:''' The following steps require an AMD64 platform.


<syntaxhighlight lang="bash">
<syntaxhighlight lang="shell-session">
$ git clone https://github.com/LibreELEC/amlogic-boot-fip
$ git clone https://github.com/LibreELEC/amlogic-boot-fip
$ cd amlogic-boot-fip
$ cd amlogic-boot-fip
Line 41: Line 41:
Once the image has been decompressed, the Amlogic U-Boot package needs to be copied to byte 512+ inside the image (replace the image with the name downloaded and decompressed image):
Once the image has been decompressed, the Amlogic U-Boot package needs to be copied to byte 512+ inside the image (replace the image with the name downloaded and decompressed image):


<syntaxhighlight lang="bash">sudo dd if=amlogic-boot-fip/output-bananapim5/u-boot.bin of=nixos-sd-image-22.11.2620.de5448dab58-aarch64-linux.img conv=fsync,notrunc bs=512 seek=1</syntaxhighlight>
<syntaxhighlight lang="shell-session">
$ sudo dd if=amlogic-boot-fip/output-bananapim5/u-boot.bin of=nixos-sd-image-22.11.2620.de5448dab58-aarch64-linux.img conv=fsync,notrunc bs=512 seek=1
</syntaxhighlight>


Then, copy the image onto the eMMC or sdcard using the [[NixOS_on_ARM#Installation_steps|the installation steps]].
Then, copy the image onto the eMMC or sdcard using the [[NixOS_on_ARM#Installation_steps|the installation steps]].
Line 47: Line 49:
In order to get a serial console output, it is required to replace <code>ttyAMA0</code> with <code>ttyAML0</code> in the <code>/boot/extlinux/extlinux.conf</code> file inside the image.
In order to get a serial console output, it is required to replace <code>ttyAMA0</code> with <code>ttyAML0</code> in the <code>/boot/extlinux/extlinux.conf</code> file inside the image.
The easiest way is to just mount the respective folder after the image has been flashed on the SD-card
The easiest way is to just mount the respective folder after the image has been flashed on the SD-card
<syntaxhighlight lang="bash">
<syntaxhighlight lang="shell-session">
sudo mount /dev/sdX /mnt/
$ sudo mount /dev/sdX /mnt/
sudo sed -i 's/ttyAMA0/ttyAML0/g' /mnt/boot/extlinux/extlinux.conf
$ sudo sed -i 's/ttyAMA0/ttyAML0/g' /mnt/boot/extlinux/extlinux.conf
</syntaxhighlight>
</syntaxhighlight>