<div dir="ltr">Hi Marcin,<div><br></div><div>The Debian images at your first link are too old - it looks like they were last updated in 2013. I would need a Stretch image. However, that's not the part I had an issue with - as I mentioned in my initial email, I was able to install Debian in a MIPS emulator but the package build failed.</div><div><br></div><div>I will check out the cross-compiling link you sent.</div><div><br></div><div>Thanks,</div><div>Ross</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Apr 3, 2020 at 1:33 PM Marcin Dulinski <<a href="mailto:martin@dulin.me.uk">martin@dulin.me.uk</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi</div><div><br></div>I built a bird for edgerouter using these debian images:
<a href="https://people.debian.org/~aurel32/qemu/" target="_blank">https://people.debian.org/~aurel32/qemu/</a> sometimes you can specify cpu type but for edgerouter is quite slow... So I used <a href="http://emdebian.org" target="_blank">emdebian.org</a> but it looks down. I think you can find docker images for each platform.<div>You can try use: <a href="https://wiki.debian.org/CrossToolchains" target="_blank">https://wiki.debian.org/CrossToolchains</a></div><div><br></div><div><br></div><div>Regards,</div><div>Martin</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, 3 Apr 2020 at 17:58, Ross Tajvar <<a href="mailto:ross@tajvar.io" target="_blank">ross@tajvar.io</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Thank you Clemens, this is very useful information. Unfortunately I don't have an Edgerouter with a USB port that's not currently in production. Perhaps I will buy a spare so I can try the process you describe.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Apr 2, 2020 at 7:47 AM Clemens Schrimpe <<a href="mailto:clemens.schrimpe@gmail.com" target="_blank">clemens.schrimpe@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><font face="Courier New"><span style="font-size:12px">Hallo all -</span></font><div><font face="Courier New"><span style="font-size:12px"><br></span></font></div><div><font face="Courier New"><span style="font-size:12px">I built BIRD (1.x and 2.x) for the EdgeRouter platforms(!) myself for many years now and I still do. At first I used a "proot" environment with QEMU on a Ubuntu environment, but I have moved on to compiling it directly on the machines in question a while ago. EdgeRouters (especially the "XG" or "Infinity" types) have more than enough CPU and RAM to do it there, it's just the "local storage" and the way their firmware is updated, which prevents you from "just doing it".</span></font></div><div><font face="Courier New"><span style="font-size:12px"><br></span></font></div><div><font face="Courier New"><span style="font-size:12px">The solution is simple, though: Current EdgeOS versions support the USB-Port on those routers and you can just plug in a cheap thumb drive or even a real SSD/HD with a USB-Interface. Format it with ext3/ext4, mount it to /mnt for example, clone the current OS onto it, like so:</span></font></div><div><font face="Courier New"><span style="font-size:12px"><br></span></font></div><div><font face="Courier New"><span style="font-size:12px"><span style="white-space:pre-wrap"> </span>rsync -aAXv --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found","/<a href="http://root.dev/*" target="_blank">root.dev/*</a>"} / /mnt/</span></font></div><div><font face="Courier New"><span style="font-size:12px"><br></span></font></div><div><font face="Courier New"><span style="font-size:12px">create shadow-mounts for the special kernel filesystems:</span></font></div><div><font face="Courier New"><span style="font-size:12px"><br></span></font></div><div><font face="Courier New"><span style="font-size:12px"><span style="white-space:pre-wrap"> </span>mount --rbind /dev /mnt/dev<br><span style="white-space:pre-wrap"> </span>mount --rbind /proc /mnt/proc<br><span style="white-space:pre-wrap"> </span>mount --rbind /sys /mnt/sys</span></font></div><div><font face="Courier New"><span style="font-size:12px"><br></span></font></div><div><font face="Courier New"><span style="font-size:12px">and now you can chroot into your development environment:</span></font></div><div><font face="Courier New"><span style="font-size:12px"><br></span></font></div><div><font face="Courier New"><span style="font-size:12px"><span style="white-space:pre-wrap"> </span>chroot /mnt /bin/bash --login</span></font></div><div><font face="Courier New"><span style="font-size:12px"><br></span></font></div><div><font face="Courier New"><span style="font-size:12px">and (bonus track) even start an sshd <i>within</i><span style="font-style:normal"> this environment for easier access later:</span></span></font></div><div><font face="Courier New"><span style="font-size:12px"><br></span></font></div><div><font face="Courier New"><span style="font-size:12px"><span style="white-space:pre-wrap"> </span>mkdir /var/run/sshd /run/sshd<span style="white-space:pre-wrap"> </span><font color="#ff2600"># may fail on either</font></span></font><div><font face="Courier New"><span style="font-size:12px"><br></span></font></div><div><font face="Courier New"><span style="font-size:12px"><span style="white-space:pre-wrap"> </span>/usr/sbin/sshd -p 222 -o Protocol=2</span></font></div><div><font face="Courier New"><span style="font-size:12px"><br></span></font></div><div><div><font face="Courier New"><span style="font-size:12px">which runs on port 222 now (vs. the "normal" sshd, running on port 22).</span></font></div></div><div><font face="Courier New"><span style="font-size:12px"><br></span></font></div><div><font face="Courier New"><span style="font-size:12px">Depending on the EdgeOS Version (1.x or 2.x) you install additional packages need for development. Here are some suggestions (non-comprehensive):</span></font></div><div><font face="Courier New"><span style="font-size:12px"><br></span></font></div></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><div><font face="Courier New"><span style="font-size:12px">Packages for 2.x:</span></font></div></div><div><div><font face="Courier New"><span style="font-size:12px"><br></span></font></div></div><div><div><font face="Courier New"><span style="font-size:12px">wget</span></font></div></div><div><div><font face="Courier New"><span style="font-size:12px">git</span></font></div></div><div><div><font face="Courier New"><span style="font-size:12px">build-essential</span></font></div></div><div><div><font face="Courier New"><span style="font-size:12px">autoconf</span></font></div></div><div><div><font face="Courier New"><span style="font-size:12px">locales-all</span></font></div></div><div><div><font face="Courier New"><span style="font-size:12px">cscope</span></font></div></div><div><div><font face="Courier New"><span style="font-size:12px">ncurses-dev</span></font></div></div><div><div><font face="Courier New"><span style="font-size:12px">libssl-dev</span></font></div></div><div><div><font face="Courier New"><span style="font-size:12px">libev-dev</span></font></div></div><div><div><font face="Courier New"><span style="font-size:12px">liblzo2-dev</span></font></div></div><div><div><font face="Courier New"><span style="font-size:12px">libpam-dev</span></font></div></div><div><div><font face="Courier New"><span style="font-size:12px">minizip</span></font></div></div><div><div><font face="Courier New"><span style="font-size:12px">flex</span></font></div></div><div><div><font face="Courier New"><span style="font-size:12px">bison</span></font></div></div><div><div><font face="Courier New"><span style="font-size:12px">libperl-dev</span></font></div></div><div><div><font face="Courier New"><span style="font-size:12px">libreadline-dev</span></font></div></div><div><div><font face="Courier New"><span style="font-size:12px">libpcre3-dev</span></font></div></div><div><div><font face="Courier New"><span style="font-size:12px">libpcap-dev</span></font></div></div><div><div><font face="Courier New"><span style="font-size:12px">libldap-dev</span></font></div></div><div><div><font face="Courier New"><span style="font-size:12px">libtalloc-dev</span></font></div></div><div><div><font face="Courier New"><span style="font-size:12px">libcap2-dev</span></font></div></div><div><div><font face="Courier New"><span style="font-size:12px">libmemcached-dev</span></font></div></div><div><div><font face="Courier New"><span style="font-size:12px">libjson-c-dev</span></font></div></div><div><div><font face="Courier New"><span style="font-size:12px">libgdbm-dev</span></font></div></div><div><div><font face="Courier New"><span style="font-size:12px">libsqlite3-dev</span></font></div></div><div><div><font face="Courier New"><span style="font-size:12px">libssh-dev</span></font></div></div><div><div><font face="Courier New"><span style="font-size:12px">libssh2-1-dev</span></font></div></div><div><div><font face="Courier New"><span style="font-size:12px"><br></span></font></div></div><div><div><font face="Courier New"><span style="font-size:12px">binutils manuell nachinstallieren! (dpkg -i ...)</span></font></div></div><div><div><font face="Courier New"><span style="font-size:12px"><br></span></font></div></div><div><div><font face="Courier New"><span style="font-size:12px"><br></span></font></div></div><div><div><font face="Courier New"><span style="font-size:12px">------</span></font></div></div><div><div><font face="Courier New"><span style="font-size:12px"><br></span></font></div></div><div><div><font face="Courier New"><span style="font-size:12px">Packages for 1.x:</span></font></div></div><div><div><font face="Courier New"><span style="font-size:12px"><br></span></font></div></div><div><div><font face="Courier New"><span style="font-size:12px"><br></span></font></div></div><div><div><font face="Courier New"><span style="font-size:12px">autoconf</span></font></div></div><div><div><font face="Courier New"><span style="font-size:12px">locales-all</span></font></div></div><div><div><font face="Courier New"><span style="font-size:12px">cscope</span></font></div></div><div><div><font face="Courier New"><span style="font-size:12px">ncurses-dev</span></font></div></div><div><div><font face="Courier New"><span style="font-size:12px">libssl-dev</span></font></div></div><div><div><font face="Courier New"><span style="font-size:12px">libev-dev</span></font></div></div><div><div><font face="Courier New"><span style="font-size:12px">liblzo2-dev</span></font></div></div><div><div><font face="Courier New"><span style="font-size:12px">libpam-dev</span></font></div></div><div><div><font face="Courier New"><span style="font-size:12px">flex</span></font></div></div><div><div><font face="Courier New"><span style="font-size:12px">bison</span></font></div></div><div><div><font face="Courier New"><span style="font-size:12px">libperl-dev</span></font></div></div><div><div><font face="Courier New"><span style="font-size:12px">libreadline-dev</span></font></div></div><div><div><font face="Courier New"><span style="font-size:12px">libpcre3-dev</span></font></div></div><div><div><font face="Courier New"><span style="font-size:12px">libpcap-dev</span></font></div></div><div><div><font face="Courier New"><span style="font-size:12px">libldap-dev</span></font></div></div><div><div><font face="Courier New"><span style="font-size:12px">libtalloc-dev</span></font></div></div><div><div><font face="Courier New"><span style="font-size:12px">libcap2-dev</span></font></div></div><div><div><font face="Courier New"><span style="font-size:12px">libmemcached-dev</span></font></div></div><div><div><font face="Courier New"><span style="font-size:12px">libgdbm-dev</span></font></div></div><div><div><font face="Courier New"><span style="font-size:12px">libsqlite3-dev</span></font></div></div><div><div><font face="Courier New"><span style="font-size:12px">libssh-dev</span></font></div></div><div><div><font face="Courier New"><span style="font-size:12px">libssh2-1-dev</span></font></div></div></blockquote><div><div><font face="Courier New"><span style="font-size:12px"><br></span></font></div><div><font face="Courier New"><span style="font-size:12px">Why am I doing this on this "shadow root" again? Because every EdgeOS update wipes <b>everything</b>, except for /config (which is why I place my compiled "modules" (binaries), like BIRD, into /config/opt/bird/... for example → <i>./configure -prefix=/config/opt/bird</i> .</span></font></div><div><font face="Courier New"><span style="font-size:12px"><br></span></font></div><div><font face="Courier New"><span style="font-size:12px">This has been working very well for me in a while and I am compiling all sorts of tools all the time within this "Build jail". </span></font></div><div><font face="Courier New"><span style="font-size:12px"><br></span></font></div><div><font face="Courier New"><span style="font-size:12px">Tools needed to start this off (mkfs, rsync, etc.) are either already on the platform or can be installed through the officially supported "apt-get" mechanism.</span></font></div><div><font face="Courier New"><span style="font-size:12px"><br></span></font></div><div><font face="Courier New"><span style="font-size:12px">The above was quickly copy&pasted together from what I have on my terminal windows right now and and is surely lacking a step or two along the way, sorry. Please feel free to ask for more detailed instructions if you get stuck somewhere.</span></font></div><div><font face="Courier New"><span style="font-size:12px"><br></span></font></div><div><font face="Courier New"><span style="font-size:12px">Greeting,</span></font></div><div><font face="Courier New"><span style="font-size:12px"><br></span></font></div><div><font face="Courier New"><span style="font-size:12px"><span style="white-space:pre-wrap"> </span>Clemens</span></font></div><div><font face="Courier New"><span style="font-size:12px"><br></span></font></div><div><font face="Courier New"><span style="font-size:12px">PS: If you want to cover the whole EdgeRouter platform you'll need to do this <i>twice</i><span style="font-style:normal"> - once on an ER-Pro/ER-Infinity and once on an ER-10X (the only X-router with an open USB port), as the former is MIPS-BE and the latter is MIPS-LE ... yes, all of these can somehow be "emulated", but I just found it much easier to create/operate/maintain those build environments on their respective </span><i>native</i> platforms - besides: They are incredibly cheap - even the Infinity router (8 x SFP+, 116 CPUs - 16G RAM - bored beyond belief) is comparatively cheap.</span></font></div><div><br></div><div><blockquote type="cite"><div><div>We've not been able to build ourselves on MIPS yet, we went into some strange problems last time (don't remember exactly). Were you so kind please and could you please help us setting up Debian for MIPS in QEMU if I fail to manage it once more?<br>The main issue was, what hardware to choose and how to boot it. But I'll try once more before asking any detailed question. Then we can replicate your issue and probably even build and test for MIPS.<br></div></div></blockquote></div><br></div></div></blockquote></div>
</blockquote></div>
</blockquote></div>