<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Jul 16, 2023 at 1:10 AM Rob Landley <<a href="mailto:rob@landley.net">rob@landley.net</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">On 7/14/23 12:08, enh via Toybox wrote:<br>
> heh, i hadn't noticed that toybox-built kernels mention the fact before...<br>
> <br>
> ~/aosp-master-with-phones/bionic$ adb shell uname -a<br>
> Linux localhost 6.3.0-mainline-g0526833d4674-ab10303652 #1 SMP PREEMPT Mon Jun<br>
> 12 08:24:48 UTC 2023 riscv64 Toybox<br>
<br>
Did that build _on_ risc64 or _for_ risc64?<br>
<br>
Hmmm, I wonder where it's getting that from. ("Toybox" is the first word of help<br>
output, nonzero chance this is in error). I can't easily reproduce your kernel<br>
build, but let's see...<br>
<br>
<a href="https://source.android.com/docs/setup/build/building-kernels" rel="noreferrer" target="_blank">https://source.android.com/docs/setup/build/building-kernels</a><br>
<br>
Um...<br>
<br>
<a href="https://android.googlesource.com/kernel/manifest/+/refs/heads/common-android-mainline/default.xml#14" rel="noreferrer" target="_blank">https://android.googlesource.com/kernel/manifest/+/refs/heads/common-android-mainline/default.xml#14</a><br>
<br>
Er...<br>
<br>
<a href="https://android.googlesource.com/kernel/common/+/refs/heads/android-mainline/fs/proc/version.c" rel="noreferrer" target="_blank">https://android.googlesource.com/kernel/common/+/refs/heads/android-mainline/fs/proc/version.c</a><br>
<br>
Sigh, bounce off include/linux/utsname.h and where is init_uts_ns initialized...<br>
<a href="https://android.googlesource.com/kernel/common/+/refs/heads/android-mainline/init/version.c" rel="noreferrer" target="_blank">https://android.googlesource.com/kernel/common/+/refs/heads/android-mainline/init/version.c</a><br>
leads us to the ACTUAL version string at:<br>
<br>
<a href="https://android.googlesource.com/kernel/common/+/refs/heads/android-mainline/init/version-timestamp.c#28" rel="noreferrer" target="_blank">https://android.googlesource.com/kernel/common/+/refs/heads/android-mainline/init/version-timestamp.c#28</a><br>
<br>
So yes, it ends with UTS_VERSION. So...<br>
<br>
<a href="https://android.googlesource.com/kernel/common/+/refs/heads/android-mainline/init/Makefile#35" rel="noreferrer" target="_blank">https://android.googlesource.com/kernel/common/+/refs/heads/android-mainline/init/Makefile#35</a><br>
<br>
utsver=$$(echo '$(pound)'"$(build-version)" $(smp-flag-y) $(preempt-flag-y)<br>
"$(build-timestamp)" | cut -b -64);<br>
<br>
No, that's the "SMP PREEMPT Mon Jun 12 08:24:48 UTC 2023" part, and toybox cut<br>
-b -64 is not producing an error message, so where does it get riscv64 and<br>
Toybox? It's calling...<br>
<br>
<a href="https://android.googlesource.com/kernel/common/+/refs/heads/android-mainline/init/build-version" rel="noreferrer" target="_blank">https://android.googlesource.com/kernel/common/+/refs/heads/android-mainline/init/build-version</a><br>
<br>
Nope, that's not it... Hmmm:<br>
<br>
<a href="https://android.googlesource.com/kernel/common/+/refs/heads/android-mainline/init/version-timestamp.c#12" rel="noreferrer" target="_blank">https://android.googlesource.com/kernel/common/+/refs/heads/android-mainline/init/version-timestamp.c#12</a><br>
<br>
Is something outputting the fields in order? Where is UTS_DOMAINNAME set... it's<br>
dynamic at runtime? But /proc/version wouldn't... Oh. duh.<br>
<br>
$ toybox uname -o<br>
Toybox<br>
<br>
You didn't _run_ cat /proc/version, you ran toybox uname -a. Which<br>
means it's not the kernel saying "Toybox", it's toybox saying it.<br></blockquote><div><br></div><div>d'oh! that makes more sense ... i thought they'd added the build environment as well as the compiler, but the capital letter in "Toybox" was a bit weird for that :-)</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">
Blah. Long tangent (started Friday!) because I didn't read the problem statement<br>
closely enough. Yes, toybox says "toybox" when you ask it what userspace you're<br>
running. Because I refused to ever describe anything as "GNU/Linux", which is<br>
what the other one says for the -o extension.<br>
<br>
Rob<br>
<br>
P.S. And then on sheer autopilot I ran a grep -r 'uname -a' * in the kernel<br>
source to go "and now that I've found THAT, here's where the build is..." NO.<br>
Wrong. Step away from the keyboard.<br>
</blockquote></div></div>