I've managed to install Debian environment over OpenWRT, using chroot.
Omega2+ board can be used as a MIPS-based Linux workstation, for generic development tasks. To get access to a console port, you can use any USB-to-serial adapter.
From a user point of view, an OpenWRT environment is quite different from Linux. But it's possible to build a Debian-based environment, located on microSD card and used via chroot.
- No modification to OpenWRT system is required
- All additional files placed on SD card
- Full traditional Linux environment is provided
The following instructions assume you use Ubuntu on your host machine.
Step 1. Download a minimal root filesystem: http://ftp.vak.ru/pub/unix/debian-stretch-mini.tgz
Step 2. Prepare SD card. Create an empty Linux partition on SD card:
sudo umount /dev/mmcblk0p1 sudo sfdisk /dev/mmcblk0 << EOF /dev/mmcblk0p2 : size=512M, type=82 /dev/mmcblk0p1 : type=83, bootable EOF sudo mke2fs /dev/mmcblk0p1 sudo mkswap /dev/mmcblk0p2
Unpack the downloaded package into the SD card:
sudo mount /dev/mmcblk0p1 /mnt sudo tar xvzf debian-stretch-mini.tgz -C /mnt sudo umount /mnt
Unmount the SD card from the host computer and insert it into your Omega2+ board.
Step 3. Connect the console port. Use Expansion Dock or any USB-to-serial adapter like FT232, CP2102 or CH340. Connect signals GND, TXD and RXD of the adapter to pins GND, P9, and P8. Attach USB adapter to the host compoter and start
minicom or any other terminal application, and configure the connection at 115200 baud rate. Press "Reset" button - you should see the boot protocol, and finally a shell prompt.
Step 4. Configure a Wi-Fi or Ethernet network, as described in the manual (https://docs.onion.io/omega2-docs/first-time-setup-command-line.html#connect-to-the-omegas-command-line). Install a few filesystem utilities:
wifisetup [...] opkg update opkg install swap-utils block-mount e2fsprogs
Step 5. Start the Debian environment. We use chroot utility to point the root filesystem to the SD card. Actually, when Wi-Fi or Ethernet interface had started, you don't need USB console anymore, you can log in via ssh (don't forget to set a password on root first).
swapon /dev/mmcblk0p2 mount --bind /dev /tmp/run/mountd/mmcblk0p1/dev mount --bind /proc /tmp/run/mountd/mmcblk0p1/proc mount --bind /sys /tmp/run/mountd/mmcblk0p1/sys chroot /tmp/run/mountd/mmcblk0p1 /bin/bash
At this point you should get a shell prompt from Debian environment. It first run, it makes sense to install some useful packages:
apt-get update apt-get install locales bison byacc flex libelf-dev libfuse-dev \ build-essential make autoconf automake libtool gdb fuse man-db \ groff less ed bmake git byacc flex exuberant-ctags libfuse-dev \ bmake git byacc flex exuberant-ctags libfuse-dev dialog \ openssh-client subversion le vim gettext iputils-ping locate procps
Now you have a full scale Debian Linux. You can download, compile and run any Linux software.
To free the SD card before removing it, you need exit from the Debian shell and run::
umount /tmp/run/mountd/mmcblk0p1/dev umount /tmp/run/mountd/mmcblk0p1/proc umount /tmp/run/mountd/mmcblk0p1/sys umount /tmp/run/mountd/mmcblk0p1 swapoff /dev/mmcblk0p2