convert all the hardware docs to adoc

This commit is contained in:
Daniel Barlow
2025-09-18 21:58:26 +01:00
parent ebfaba45e6
commit 4bdd30b58d
14 changed files with 426 additions and 436 deletions

View File

@@ -1,149 +1,151 @@
{
description = ''
Turris Omnia
************
== Turris Omnia
This is a 32 bit ARMv7 MVEBU device, which is usually shipped with
TurrisOS, an OpenWrt-based system. Rather than reformatting the
builtin storage, we install Liminix on to the existing btrfs
filesystem so that the vendor snapshot/recovery system continues
to work (and provides you an easy rollback if you decide you don't
like Liminix after all).
This is a 32 bit ARMv7 MVEBU device, which is usually shipped with
TurrisOS, an OpenWrt-based system. Rather than reformatting the builtin
storage, we install Liminix on to the existing btrfs filesystem so that
the vendor snapshot/recovery system continues to work (and provides you
an easy rollback if you decide you don't like Liminix after all).
The install process has two stages, and is intended that you
should not need to open the device and add a serial console
(although it may be handy for visibility, and in case anything
goes wrong). First we build a minimal installation/recovery
system, then we reboot into that recovery image to prepare the
device for the full target install.
The install process has two stages, and is intended that you should not
need to open the device and add a serial console (although it may be
handy for visibility, and in case anything goes wrong). First we build a
minimal installation/recovery system, then we reboot into that recovery
image to prepare the device for the full target install.
Installation using a USB stick
==============================
=== Installation using a USB stick
First, build the image for the USB stick. Review
:file:`examples/recovery.nix` in order to change the default
root password (which is ``secret``) and/or the SSH keys, then
build it with
First, build the image for the USB stick. Review
`+examples/recovery.nix+` in order to change the default root password
(which is `+secret+`) and/or the SSH keys, then build it with
.. code-block:: console
[source,console]
----
$ nix-build -I liminix-config=./examples/recovery.nix \
--arg device "import ./devices/turris-omnia" \
-A outputs.mbrimage -o mbrimage
$ file -L mbrimage
mbrimage: DOS/MBR boot sector; partition 1 : ID=0x83, active, start-CHS (0x0,0,5), end-CHS (0x6,130,26), startsector 4, 104602 sectors
----
$ nix-build -I liminix-config=./examples/recovery.nix \
--arg device "import ./devices/turris-omnia" \
-A outputs.mbrimage -o mbrimage
$ file -L mbrimage
mbrimage: DOS/MBR boot sector; partition 1 : ID=0x83, active, start-CHS (0x0,0,5), end-CHS (0x6,130,26), startsector 4, 104602 sectors
Next, copy the image from your build machine to a USB storage medium
using `+dd+` or your other most favoured file copying tool, which might
be a comand something like this:
Next, copy the image from your build machine to a USB storage
medium using :command:`dd` or your other most favoured file copying
tool, which might be a comand something like this:
[source,console]
----
$ dd if=mbrimage of=/dev/path/to/the/usb/stick \
bs=1M conv=fdatasync status=progress
----
.. code-block:: console
The Omnia's default boot order only checks USB after it has failed to
boot from eMMC, which is not ideal for our purpose. Unless you have a
serial cable, the easiest way to change this is by booting to TurrisOS
and logging in with ssh:
$ dd if=mbrimage of=/dev/path/to/the/usb/stick \
bs=1M conv=fdatasync status=progress
[source,console]
----
root@turris:/# fw_printenv boot_targets
boot_targets=mmc0 nvme0 scsi0 usb0 pxe dhcp
root@turris:/# fw_setenv boot_targets usb0 mmc0
root@turris:/# fw_printenv boot_targets
boot_targets=usb0 mmc0
root@turris:/# reboot -f
----
The Omnia's default boot order only checks USB after it has failed
to boot from eMMC, which is not ideal for our purpose. Unless you
have a serial cable, the easiest way to change this is by booting
to TurrisOS and logging in with ssh:
It should now boot into the recovery image. It expects a network cable
to be plugged into LAN2 with something on the other end of it that
serves DHCP requests. Check your DHCP server logs for a request from a
`+liminix-recovery+` host and figure out what IP address was assigned.
.. code-block:: console
[source,console]
----
$ ssh liminix-recovery.lan
----
root@turris:/# fw_printenv boot_targets
boot_targets=mmc0 nvme0 scsi0 usb0 pxe dhcp
root@turris:/# fw_setenv boot_targets usb0 mmc0
root@turris:/# fw_printenv boot_targets
boot_targets=usb0 mmc0
root@turris:/# reboot -f
You should get a "Busybox" banner and a root prompt. Now you can start
preparing the device to install Liminix on it. First we'll mount the
root filesystem and take a snapshot:
It should now boot into the recovery image. It expects a network
cable to be plugged into LAN2 with something on the other end of
it that serves DHCP requests. Check your DHCP server logs for a
request from a ``liminix-recovery`` host and figure out what IP
address was assigned.
[source,console]
----
# mkdir /dest && mount /dev/mmcblk0p1 /dest
# schnapps -d /dest create "pre liminix"
# schnapps -d /dest list
ERROR: not a valid btrfs filesystem: /
# | Type | Size | Date | Description
------+-----------+-------------+---------------------------+------------------------------------
1 | single | 16.00KiB | 1970-01-01 00:11:49 +0000 | pre liminix
----
.. code-block:: console
(`+not a valid btrfs filesystem: /+` is not a real error)
$ ssh liminix-recovery.lan
then we can remove all the files
You should get a "Busybox" banner and a root prompt. Now you can
start preparing the device to install Liminix on it. First we'll
mount the root filesystem and take a snapshot:
[source,console]
----
# rm -r /dest/@/*
----
.. code-block:: console
and then it's ready to install the real Liminix system onto. On your
build system, create the Liminix configuration you wish to install: here
we'll use the `+rotuer+` example.
# mkdir /dest && mount /dev/mmcblk0p1 /dest
# schnapps -d /dest create "pre liminix"
# schnapps -d /dest list
ERROR: not a valid btrfs filesystem: /
# | Type | Size | Date | Description
------+-----------+-------------+---------------------------+------------------------------------
1 | single | 16.00KiB | 1970-01-01 00:11:49 +0000 | pre liminix
[source,console]
----
build$ nix-build -I liminix-config=./examples/rotuer.nix \
--arg device "import ./devices/turris-omnia" \
-A outputs.systemConfiguration
----
(``not a valid btrfs filesystem: /`` is not a real error)
and then use `+min-copy-closure+` to copy it to the device.
then we can remove all the files
[source,console]
----
build$ nix-shell --run \
"min-copy-closure -r /dest/@ root@liminix-recovery.lan result"
----
.. code-block:: console
and activate it
# rm -r /dest/@/*
[source,console]
----
build$ ssh root@liminix-recovery.lan \
"/dest/@/$(readlink result)/bin/install /dest/@"
----
and then it's ready to install the real Liminix system onto. On
your build system, create the Liminix configuration you wish to
install: here we'll use the ``rotuer`` example.
The final steps are performed directly on the device again: add a
symlink so U-Boot can find `+/boot+`, then restore the default boot
order and reboot into the new configuration.
.. code-block:: console
[source,console]
----
# cd /dest && ln -s @/boot .
# fw_setenv boot_targets "mmc0 nvme0 scsi0 usb0 pxe dhcp"
# cd / ; umount /dest
# reboot
----
build$ nix-build -I liminix-config=./examples/rotuer.nix \
--arg device "import ./devices/turris-omnia" \
-A outputs.systemConfiguration
=== Installation using a TFTP server and serial console
and then use :command:`min-copy-closure` to copy it to the device.
If you have a <<serial,serial console connection>> and a TFTP server, and would
rather use them than fiddling with USB sticks, the
`+examples/recovery.nix+` configuration also works using the
`+tftpboot+` output. So you can do
.. code-block:: console
[source,console]
----
build$ nix-build -I liminix-config=./examples/recovery.nix \
--arg device "import ./devices/turris-omnia" \
-A outputs.tftpboot
----
build$ nix-shell --run \
"min-copy-closure -r /dest/@ root@liminix-recovery.lan result"
and activate it
.. code-block:: console
build$ ssh root@liminix-recovery.lan \
"/dest/@/$(readlink result)/bin/install /dest/@"
The final steps are performed directly on the device again: add
a symlink so U-Boot can find :file:`/boot`, then restore the
default boot order and reboot into the new configuration.
.. code-block:: console
# cd /dest && ln -s @/boot .
# fw_setenv boot_targets "mmc0 nvme0 scsi0 usb0 pxe dhcp"
# cd / ; umount /dest
# reboot
Installation using a TFTP server and serial console
===================================================
If you have a :ref:`serial` console connection and a TFTP server,
and would rather use them than fiddling with USB sticks, the
:file:`examples/recovery.nix` configuration also works
using the ``tftpboot`` output. So you can do
.. code-block:: console
build$ nix-build -I liminix-config=./examples/recovery.nix \
--arg device "import ./devices/turris-omnia" \
-A outputs.tftpboot
and then paste the generated :file:`result/boot.scr` into
U-Boot, and you will end up with the same system as you would
have had after booting from USB. If you don't have a serial
console connection you could probably even get clever with
elaborate use of :command:`fw_setenv`, but that is left as
an exercise for the reader.
and then paste the generated `+result/boot.scr+` into U-Boot, and you
will end up with the same system as you would have had after booting
from USB. If you don't have a serial console connection you could
probably even get clever with elaborate use of `+fw_setenv+`, but that
is left as an exercise for the reader.
'';