/!\ Under construction

DebianOn is an effort to document how to install, configure and use Debian on some specific hardware. Therefore potential buyers would know if that hardware is supported and owners would know how get the best out of that hardware.

The purpose is not to duplicate the Debian Official Documentation, but to document how to install Debian on some specific hardware.

If you need help to get Debian running on your hardware, please have a look at our user support channels where you may find specific channels (mailing list, IRC channel) dedicated to certain types of hardware.

Translation(s): none

Models covered
Xiaomi ?MiWifi mini

Overall Status

Core Components

[ATTACH]

Boot Standard Kernel:

{X} / OpenWRT

Ethernet interface ():

{OK}

Hard drives:

USB drives ok

Extra Features

Ethernet switch ()

{OK}

WLAN interface Wi-Fi 802.11ac (?MediaTek MT7612)

/!\

WLAN interface Wi-Fi 802.11b/g (?MediaTek MT7620A)

/!\

Serial console (you have to solder it)

{OK}

LEDs

{OK}

Legend :
{OK} = OK ; {X} Unsupported(No Driver) ; /!\ = Error (Couldn't get it working); [?] Unknown, Not Test ; [-] Not-applicable
{i} = Configuration Required; X-( = Only works with a non-free driver and or firmware

Important Note

This Debian installation is based on the OpenWRT kernel and it's modified init system. You may note this article, but it uses old version of ?OpenWrt(without procd). That's the reason you need to modify init program to spawn debian init instead of procd. Install OpenWRT on your router and make sure it works before attempting to install Debian. A working and configured OpenWRT system on the internal flash also works as a backup. If the USB drive containing the rootfs breaks, you will lose your Debian server, but at least the network routing still works with OpenWRT. Remember backups.

Installation

Build a custom OpenWRT image

Get ?OpenWrt code

mkdir ~/wrt
cd ~/wrt
git clone git://github.com/openwrt/openwrt.git
git checkout tags/v17.01.4

Configure ?OpenWrt build system

make menuconfig

Set options:

/Target System->?MediaTek Ralink MIPS

/Subtarget->MT7620 based boards

/Target Profile->Xiaomi ?MiWiFi Mini

/Base system->block-mount

Enable Floating point emulation:

make kernel_menuconfig

/Kernel type->MIPS FPU Emulator

Tweaking init

Now we need to patch init system, so that if debian root detected, we launch debian init.

make download
cd openwrt/build_dir/target-mipsel_24kc_musl-1.1.16/procd-2017-08-08-66be6a23/initd

#create init patch
cat <<EOF >> init_patch
> 53c53
> < spawn_procd(struct uloop_process *proc, int ret)
> ---
> > spawn_real_init(struct uloop_process *proc, int ret)
> 54a55,56
> >     char *deb_init_args[] = { "/sbin/init", "3", NULL};
> >     char *procd_args[] = { "/sbin/procd", NULL};
> 56d57
> < preinitchar *argv[] = { "/sbin/procd", NULL};
> 57a59
> >     int is_extroot_mounted = !stat("/etc/debian_version", &s);
> 70d71
> < preinitDEBUG(2, "Exec to real procd now\n");
> 79c80,88
> < preinitexecvp(argv[0], argv);
> ---
> > preinitif (is_extroot_mounted) {
> >         DEBUG(2, "Exec to debian init now\n");
> >         watchdog_set_magicclose(true);
> >         watchdog_set_stopped(true);
> >         execvp(deb_init_args[0], deb_init_args);
> >     } else {
> >         DEBUG(2, "Exec to openwrt procd now\n");
> >         execvp(procd_args[0], procd_args);
> >     }
> 119c128
> < preinitpreinit_proc.cb = spawn_procd;
> ---
> > preinitpreinit_proc.cb = spawn_real_init;
> EOF

#patch preinit.c
patch preinit.c init_patch

Build

make

Flash image

Use open wrt guide.

OpenWRT extroot configuration

Set up the external root FS in OpenWRT. The configuration file /etc/config/fstab should have this kind of section:

config mount
    option target '/'
    option fstype 'ext4'
    option options 'rw,sync'
    option enabled '1'
    option enabled_fsck '0'
    option device '/dev/sda1'

Create debian rootfs

mkdir ~/debian_root_fs
cd ~/debian_root_fs
debootstrap --arch mipsel stretch .

Configure debian rootfs

WiFi

System Summary

lspci

lspci -nn

lsusb

lsusb -v | grep -E '\<(Bus|iProduct|bDeviceClass|bDeviceProtocol)' 2>/dev/null

Resources

Attachments

Some configuration files and sample outputs.

Credits



CategoryDebianOn CategoryDebianOn