<div dir="ltr"><div class="gmail_extra" style="text-align:left"><div><div class="gmail-m_-146480140006259521gmail_signature"><div dir="ltr"><div><div dir="ltr"><div></div></div></div></div></div></div>
<br><div class="gmail_quote">2018-03-05 17:36 GMT+01:00 Rob Landley <span dir="ltr"><<a href="mailto:rob@landley.net" target="_blank">rob@landley.net</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-m_-146480140006259521gmail-">On 03/02/2018 04:56 AM, Ruhollah Majdoddin wrote:<br>
</span><span class="gmail-m_-146480140006259521gmail-">> Hello,<br>
> I have spent the past month over mkroot (and native build with QEMU),<br>
<br>
</span>What do you think of it so far? (It's a newish project I haven't gotten too much<br>
feedback on yet...)<br>
<span class="gmail-m_-146480140006259521gmail-"><br></span></blockquote><div>I started in 2015 with Aboriginal Linux. I was searching for such a thing to avoid Yocto for arm embedded devices. <br></div><div>I got a linux and compiled Lighttpd and White-Rabbit PTP natively. My chef was satisfied.<br></div><div><br>Last month, in my new job, I tried it again. Your tutorial presentation was very informative (I wish you could do more like that). <br>There was two issues.<br>1- The company runs a lot of software on their embedded device. So it seemed that we needed a Linux-Distribution to manage package dependencies.<br>2- Mkroot still does not provide a native build system. <br><br>Therefore I tactically decided to use Debain Arm ports with QEMU. <br></div><div>I got a running Debian-Linux on QEMU, with that I used Gnu toolchaing to compil the kernel from Boundary-Devices for the I.MX6 chip and run Debian with it (I had to append the defconfig of mkroot when compiling the kernel, to be able to run the image on the QEMU with Arm virt machine).<br></div><div>Finally I compiled and installed some modules from the company, I got the system-image and installed it on the embedded device. But the chef and other colleagues were not very excited (they feel comfortable with Yocto/OE) and I got fired. <br></div><div>I can say that your presentation and mkroot, served as a guide and test bench, to say the least. <br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-m_-146480140006259521gmail-">
> now I have<br>
> free time for one or two months. Where can I contribute?<br>
> If toybox has more priority now (I see more activity there) please tell me<br>
> where can I contribute there (I have browsed through the roadmap and other<br>
> documentation).<br>
<br>
</span>Mkroot needs a lot of work. I haven't got the native toolchain working under it<br>
yet (partly for design reasons, there's no non-gpl make, and should ninja or<br>
cmake be in there too?), the old build control image infrastructure at<br>
<a href="https://landley.net/aboriginal/control-images" rel="noreferrer" target="_blank">https://landley.net/aboriginal<wbr>/control-images</a> needs to be redone in the new<br>
context, the old Linux From Scratch build image there needs to be recreated<br>
using current LFS... But I'm not sure any of that's a good starting place for a<br>
new developer? <br></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Reproducing the existing build with other toolchains might be nice too (android<br>
NDK, bootlin's toolchains, the crosstool images on <a href="http://kernel.org" rel="noreferrer" target="_blank">kernel.org</a>, <a href="https://ellcc.org" rel="noreferrer" target="_blank">https://ellcc.org</a><br>
and so on), but none of them provide native compilers, but they might start and<br>
it would be very nice to have an llvm build baseline.<br></blockquote><div>This is interesting, it seems crosstool images are derived from bootlin. <br></div><div>Is Compert-C also an option? <a href="http://compcert.inria.fr/compcert-C.html">http://compcert.inria.fr/compcert-C.html</a><br></div><div>Although it is just a (formally verified) compiler, no assember and no linker. <br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
For toybox I want to use mkroot as a way to run tests requiring root access and<br>
a known build environment, but again that's not necessarily a good starting<br>
point for new developers. (How you do proper "top" tests is a hard problem.)<br>
Fixing existing test failures might be, though? (Or at least diagnosing them, I<br>
haven't had time to even sort which test scripts pass and which fail, and which<br>
ones are actually providing reasonable test coverage and which aren't yet. It's<br>
on the todo list...)<br></blockquote><div>This is also interesting. I think you mean the scripts under toybox/tests.<span id="gmail-blob-path" class="gmail-css-truncate-target"><span class="gmail-separator"></span></span><br><br><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Something I've hit that might be worth a look is actually a qemu issue. I test<br>
new mkroot builds with something like:<br>
<br>
for i in $(./cross.sh); do (sleep 5; echo date; sleep 1; echo ifconfig; sleep 1;<br>
echo tail /dev/?da; sleep 1; echo exit; sleep 2) | ./run.sh qemu-$i |<br>
smokelog-$i.txt; done<br>
<br>
But when I do that, qemu often _hangs_ with current -git. Something about qemu's<br>
stdio console handling is wonky when dealing with pipes instead of pty<br>
instances, and I'm not sure what.<br></blockquote><div><br>The Qemu problem is what I have been working on the last two days, my laptop is not fast, it got 9 hours to build musl. Actually, I could not reproduce the problem, it worked for me (but see below). <br></div><div><br>My system: x86_64 Sony Vaio Laptop<br>$ uname -a<br>Linux ruhollah 4.9.0-4-amd64 #1 SMP Debian 4.9.65-3+deb9u1 (2017-12-23) x86_64 GNU/Linux<br><br></div><div>I cloned QEMU from git, compiled the Master branch with GCC (Does the toolchain matter?)<br><br>~/qemu/build/x86_64-softmmu$ ./qemu-system-x86_64 --version<br>QEMU emulator version 2.11.50 (v2.11.0-1911-g136c67e078-<wbr>dirty)<br><br></div><div>I built mkroot for x86_64 with GCC from debian, and mkroot for armvl with musl, and did similar tests with similar results.<br><br>~/mkroot/output/armv7l$ (sleep 7; echo ls; sleep 1; echo date; sleep 1; echo tail '/dev/pts' ; sleep 1; echo ifconfig; sleep 1; echo exit; sleep 1) | ./qemu-armv7l.sh <br><div style="margin-left:40px">.<br>.<br>.<br>This architecture does not have kernel memory protection.<br>random: fast init done<br>Type exit when done.<br>/ # ^[[50;5Rls<br>bin dev etc home init lib mnt proc root sbin sys tmp usr var <br>/ # ^[[50;5Rdate<br>Tue Mar 6 11:11:23 UTC 2018<br>/ # ^[[50;5Rtail /dev/pts<br>/ # ^[[50;5Rifconfig<br>eth0 Link encap:Ethernet HWaddr 52:54:00:12:34:56 Driver virtio_net<br> inet addr:10.0.2.15 Bcast:10.255.255.255 Mask:255.0.0.0 <br> inet6 addr: fec0::5054:ff:fe12:3456/64 Scope: Site<br> inet6 addr: fe80::5054:ff:fe12:3456/64 Scope: Link<br> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1<br> RX packets:1 errors:0 dropped:0 overruns:0 frame:0 <br> TX packets:6 errors:0 dropped:0 overruns:0 carrier:0 <br> collisions:0 txqueuelen:1000 <br> RX bytes:134 TX bytes:512 <br><br>/ # ^[[50;5Rexit<br>reboot: Restarting system<br></div>~/mkroot/output/armv7l$ ;5R;5R;5R;5R;5R<br></div><div><div style="margin-left:40px"><br></div></div><div>As you see it does not hang, but there is always a "^[[50;5R" on the QEMU prompt. Afterwards I got some ";5R" on the prompt and I have problems with my bash settings (I use Konsole): a long line does not wrap and overruns itself. <br><br>If I redirect the output of QEMU to a file,<br><br></div><div>~/mkroot/output/armv7l$./qemu-armv7l.sh > log.txt<br></div><div>^C<br></div><div>$vi log.txt<br></div><div><br>then I see other characters at prompt. If I do it with mkroot for x86_64 I get ^M (carriage return) on end of lines.<br></div><div>It seems to be a problem with stty (and $PS1 ?) settings. Any suggestions?<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Thanks for your interest,<br>
<br>
Rob<br></blockquote><div>Many Thanks,<br></div><div>Ruhollah <br></div></div><br></div></div>