|Deletions are marked like this.||Additions are marked like this.|
|Line 97:||Line 97:|
|setenv debboot setenv bootargs console=ttyS0,115200 rootfstype=btrfs rootwait root=/dev/mmcblk0p1 rootflags=subvol=@debian,commit=5 rw\; btrload mmc 0 0x01000000 boot/vmlinuz @debian\; btrload mmc 0 0x02000000 boot/dtb @debian\; btrload mmc 0 0x03000000 boot/initrd.img @debian\; bootz 0x01000000 0x03000000:$filesize 0x02000000||setenv debbootargs console=ttyS0,115200 rootfstype=btrfs rootwait root=/dev/mmcblk0p1 rootflags=subvol=@debian,commit=5 rw
setenv debboot 'setenv bootargs $debbootargs ; btrload mmc 0 0x01000000 boot/vmlinuz @debian ; btrload mmc 0 0x02000000 boot/dtb @debian ; btrload mmc 0 0x03000000 boot/initrd.img @debian ; bootz 0x01000000 0x03000000:$filesize 0x02000000'
|Line 109:||Line 110:|
|setenv turrisosboot <merge the output of the two commands with a \; between them and escape any other ; characters with a \ character>||setenv turrisosbootargs <set to bootargs>
setenv turrisosboot '<set to mmcboot and use $turrisosbootargs in place of $bootargs>'
|Line 111:||Line 113:|
|setenv mmcboot btrload mmc 0 0x01000000 boot/vmlinuz @debian\; btrload mmc 0 0x02000000 boot/dtb @debian\; btrload mmc 0 0x03000000 boot/initrd.img @debian\; bootz 0x01000000 0x03000000:$filesize 0x02000000||setenv mmcboot 'btrload mmc 0 0x01000000 boot/vmlinuz @debian ; btrload mmc 0 0x02000000 boot/dtb @debian ; btrload mmc 0 0x03000000 boot/initrd.img @debian ; bootz 0x01000000 0x03000000:$filesize 0x02000000'|
This page should be rebased on the template.
Installing Debian On The Turris Omnia Router
By default it runs an OpenWRT derivative called TurrisOS, but Debian armhf userland can run on it, too. For now it though needs a custom (read non-Debian) kernel as well as some additional scripts to get all the features. The custom kernel is based on some Linux 4.x branch and is maintained on Github. (Update: it is unclear if that repository is the official one. The official repository is the OpenWRT fork and has a different set of patches.)
Installing vanilla Debian
The u-boot shipped on the device does not have USB support so you will need to connect the WAN port on the device to a DHCP managed network, which you can get on your computer with NetworkManager by sharing your Internet connection.
If you are on unstable, install the debian-installer-netboot-armhf virtual package. If you don't want to install it, you can just download it with apt and then unpack it with dpkg-deb. For stretch or earlier, you can add unstable to your sources.list. If you don't want to modify your sources.list, then use a chdist or apt-venv to download it with apt and unpack it with dpkg-deb. You will need these files:
/usr/lib/debian-installer/images/9/armhf/text/debian-installer/armhf/vmlinuz /usr/lib/debian-installer/images/9/armhf/text/debian-installer/armhf/initrd.gz /usr/lib/debian-installer/images/9/armhf/text/debian-installer/armhf/dtbs/armada-385-turris-omnia.dtb
To enter the u-boot prompt, plug the UART to USB cable (video) into the 4 pin (black yellow red empty) header to the right of the LEDs and plug the USB end into your computer. Start your favourite serial console tool, like GNU screen, minicom or microcom, or busybox microcom and connect to the USB serial console device. The busybox microcom should already be installed on your computer if you are running Debian.
busybox microcom -s 115200 /dev/ttyUSB0 microcom -s 115200 /dev/ttyUSB0 minicom /dev/ttyUSB0 screen /dev/ttyUSB0 115200
Then power on or reset the device and hit any key to interrupt autoboot at this point:
Hit any key to stop autoboot: 3
Then install a tftp server like tftpd-hpa on your computer, put the above files in /srv/tftp and on the serial console enter the following in U-Boot:
mw 0xf1020300 0x403 #disable watchdog dhcp setenv serverip <your_tftp_server_legacy_ip_address> tftpboot 0x01000000 vmlinuz tftpboot 0x02000000 armada-385-turris-omnia.dtb tftpboot 0x03000000 initrd.gz bootz 0x01000000 0x03000000:$filesize 0x02000000
If this fails for you with
Wrong Ramdisk Image Format Ramdisk image is corrupt or invalid
your U-Boot needs an update. The U-Boot images that are about to be released by cz.nic are fixed, you can find them at https://api.turris.cz/openwrt-repo/omnia-test/nor_fw/. Update as follows after downloading the image to your tftp directory:
dhcp tftpboot 0x1000000 uboot-turris-omnia-spl.kwb sf probe sf update 0x1000000 0 $filesize
Once the update is done, you will need to reboot to start the new version of U-Boot and then go back to the start of the TFTP stage above.
Once you are in the Debian Installer you will see a blue screen with a language choice (English or C). At this point you can use the standard GNU screen keys (Ctrl+a n, Ctrl+a p etc) to switch between the Debian Installer virtual terminals.
Choose English and other parameters and stop at the partitioning step to read the next paragraph. You will want to use the eth2 device for network if you have a cable connected to the WAN port.
Is possible to preserve the existing TurrisOS installation and install Debian into a subvolume of the existing btrfs filesystem on the eMMC storage. This means both TurrisOS and Debian will share the same filesystem/partition but use separate btrfs subvolumes. The Debian Installer doesn't yet support btrfs subvolumes but you can use them by switching to expert mode. When you get to the partitioning step, press tab to switch to "Go Back" and press enter. Go down to "Change debconf priority" and press enter, continue and choose "low" then go back to the partitioning step. Choose to use the btrfs volume as / but do *not* format it (a format will delete TurrisOS). After the partitioning, but before the software installation, you will need to unmount the install directory, mount the root subvolume, create a new Debian subvolume and then mount the new Debian subvolume. You can substitute @debian for any subvolume name other than @ and @factory, which are TurrisOS subvolumes.
# Check what volume is mounted mount # If there is something other than subvol=/ then remount umount /target mount -o subvol=/ /dev/mmcblk0p1 /target # Create the Debian subvolume btrfs subvolume create /target/@debian # move all non-subvolume files/dirs to the Debian subvolume # Anything with @ in the name is likely a subvolume mv /target/etc /target/media /target/@debian # Remount with the Debian subvolume umount /target mount -o subvol=@debian /dev/mmcblk0p1 /target
Before ending the installation switch back to a shell, add the subvol=@debian option to the mount options for the rootfs in /target/etc/fstab and put the dtb into the Debian rootfs as /target/boot/dtb.
After the installation, reboot into the uboot prompt. At this point you can either create a command to boot Debian or always boot Debian by default.
To create the command to boot Debian and then run it:
setenv debbootargs console=ttyS0,115200 rootfstype=btrfs rootwait root=/dev/mmcblk0p1 rootflags=subvol=@debian,commit=5 rw setenv debboot 'setenv bootargs $debbootargs ; btrload mmc 0 0x01000000 boot/vmlinuz @debian ; btrload mmc 0 0x02000000 boot/dtb @debian ; btrload mmc 0 0x03000000 boot/initrd.img @debian ; bootz 0x01000000 0x03000000:$filesize 0x02000000' saveenv run debboot
To always boot Debian by default:
# Get a copy of the variable we are about to overwrite # and then save that as a new variable so that # we can still boot TurrisOS any time we want printenv bootargs mmcboot setenv turrisosbootargs <set to bootargs> setenv turrisosboot '<set to mmcboot and use $turrisosbootargs in place of $bootargs>' # Overwrite the mmcboot/bootargs variables to make Debian the default setenv mmcboot 'btrload mmc 0 0x01000000 boot/vmlinuz @debian ; btrload mmc 0 0x02000000 boot/dtb @debian ; btrload mmc 0 0x03000000 boot/initrd.img @debian ; bootz 0x01000000 0x03000000:$filesize 0x02000000' setenv bootargs console=ttyS0,115200 rootfstype=btrfs rootwait root=/dev/mmcblk0p1 rootflags=subvol=@debian,commit=5 rw # Save the change to the flash storage saveenv
There are some missing parts yet, so the SFP and switch port doesn't work. With the Debian kernel the wifi driver fails to probe, while this works with a monolithic (vanilla) kernel compiled for mvebu + ath10k.
The bootloader enables the watchdog of the SoC. To handle this you either have to disable it again in the bootloader (see above) or pet it regularly. For the latter just add
U-Boot doesn't provide the mac addresses to be used in the device tree. To make the Debian system use the right ones I did:
cat > /etc/systemd/network/00-eth0.link [Match] Path=platform-f1070000.ethernet [Link] MACAddress=... EOF
and the same for eth1 (platform-f1030000.ethernet) and eth2 (platform-f1034000.ethernet).
The mac address reserved for your machine is saved in the crypto chip. To find out the base check U-Boot's ethaddr variable. You "own" this and the two following addresses.
The in-SoC RTC isn't working properly. It is somewhat working after doing
mw 0xf10184a0 0xfd4d4cfa
in U-Boot. If you don't do this, the driver only reads 2016-12-19 22:00:34 from it.
The Debian kernel fails to probe the wifi drivers. There is already a bug report about this. As a work around add
on the kernel command line, then the wifi drivers probe correctly.
Installing with self-build kernel
For an alternative installation using a self compiled kernel (instead of a debian kernel as above) see the omnia-debian wiki. If you follow this one, you're not keen on cross-compiling and accept to trust images downloaded unencrypted from the internet, you can find an ready-made image on http://aule.elfove.cz/%7Ebrill/omnia-debian/.