First, you need to know what Debootstrap is.
Then read the first section of this document: EmDebianCrossDebootstrap.
You’ll see that there are several ways to achieve our goal. My router’s CPU is an MT7621, which uses the mipsel architecture.
I used the method in the second section: QEMU/debootstrap approach.
My host system is Ubuntu.
Following the instructions, install the required packages:
|
|
Then create a directory, for example:
|
|
Now run the bootstrap command. Note that the architecture should be changed. After that comes the Debian release you want (e.g., Jessie), then the target directory you just created, and finally the Debian mirror.
|
|
Once that’s done, continue following the official instructions. Some steps need to be adapted.
|
|
Now it’s ready. You can copy the whole directory to a USB stick, plug it into your router, SSH into the router, and chroot
into the Debian environment.
Before using chroot
, you need to mount some filesystems. Refer to Debootstrap for details:
|
|
Finally, chroot into Debian:
|
|
If you plan to use SSH, you might also need to do the following before chroot
:
|
|