<div dir="ltr">This maybe?<div><br></div><div><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;color:rgb(36,39,41);font-family:arial,"helvetica neue",helvetica,sans-serif">To find out what version of Linux is compiled, use the<span class="inbox-inbox-Apple-converted-space"> </span><code style="margin:0px;padding:1px 5px;border:0px;font-size:13px;font-family:consolas,menlo,monaco,"lucida console","liberation mono","dejavu sans mono","bitstream vera sans mono","courier new",monospace,sans-serif;background-color:rgb(239,240,241);white-space:pre-wrap">strings</code><span class="inbox-inbox-Apple-converted-space"> </span>utility on the uncompressed vmlinux image.</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;color:rgb(36,39,41);font-family:arial,"helvetica neue",helvetica,sans-serif">For example:</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;color:rgb(36,39,41);font-family:arial,"helvetica neue",helvetica,sans-serif"><code style="margin:0px;padding:1px 5px;border:0px;font-size:13px;font-family:consolas,menlo,monaco,"lucida console","liberation mono","dejavu sans mono","bitstream vera sans mono","courier new",monospace,sans-serif;background-color:rgb(239,240,241);white-space:pre-wrap">strings linux-src/build/build-generic/vmlinux|grep "Linux version"</code></p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;color:rgb(36,39,41);font-family:arial,"helvetica neue",helvetica,sans-serif">Sample output:</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;color:rgb(36,39,41);font-family:arial,"helvetica neue",helvetica,sans-serif"><code style="margin:0px;padding:1px 5px;border:0px;font-size:13px;font-family:consolas,menlo,monaco,"lucida console","liberation mono","dejavu sans mono","bitstream vera sans mono","courier new",monospace,sans-serif;background-color:rgb(239,240,241);white-space:pre-wrap">Linux version 3.2.0-56-generic (root@puerto-cayo) (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) ) #86 SMP Fri Nov 1 10:24:18 EDT 2013 (Ubuntu 3.2.0-56.86-generic 3.2.51)</code></p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;color:rgb(36,39,41);font-family:arial,"helvetica neue",helvetica,sans-serif"><code style="margin:0px;padding:1px 5px;border:0px;font-size:13px;font-family:consolas,menlo,monaco,"lucida console","liberation mono","dejavu sans mono","bitstream vera sans mono","courier new",monospace,sans-serif;background-color:rgb(239,240,241);white-space:pre-wrap"><br></code></p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;color:rgb(36,39,41);font-family:arial,"helvetica neue",helvetica,sans-serif"><code style="margin:0px;padding:1px 5px;border:0px;font-size:13px;font-family:consolas,menlo,monaco,"lucida console","liberation mono","dejavu sans mono","bitstream vera sans mono","courier new",monospace,sans-serif;background-color:rgb(239,240,241);white-space:pre-wrap"><br></code></p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;color:rgb(36,39,41);font-family:arial,"helvetica neue",helvetica,sans-serif"><code style="margin:0px;padding:1px 5px;border:0px;font-size:13px;font-family:consolas,menlo,monaco,"lucida console","liberation mono","dejavu sans mono","bitstream vera sans mono","courier new",monospace,sans-serif;background-color:rgb(239,240,241);white-space:pre-wrap"><br></code></p><p style="margin:0px 0px 1em;padding:0px;border:0px;clear:both"><font color="#242729" face="consolas, menlo, monaco, lucida console, liberation mono, dejavu sans mono, bitstream vera sans mono, courier new, monospace, sans-serif"><span style="white-space:pre-wrap;background-color:rgb(239,240,241)">From <a href="http://stackoverflow.com/questions/3180029/how-can-i-determine-the-build-version-of-linux-kernel-uimage">http://stackoverflow.com/questions/3180029/how-can-i-determine-the-build-version-of-linux-kernel-uimage</a></span></font><br></p></div></div><br><div class="gmail_quote"><div dir="ltr">On Thu, 24 Nov 2016 at 12:04 Euan de Kock <<a href="mailto:euan@dekock.net">euan@dekock.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr" class="gmail_msg">Would ldd give any useful library links that use the kernel version number - not in front of a machine to check, so I'm just guessing...</p>
<p dir="ltr" class="gmail_msg">Euan</p>
<div class="gmail_extra gmail_msg"><br class="gmail_msg"><div class="gmail_quote gmail_msg">On 24 Nov. 2016 11:56 am, "BillK" <<a href="mailto:billk@iinet.net.au" class="gmail_msg" target="_blank">billk@iinet.net.au</a>> wrote:<br type="attribution" class="gmail_msg"><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_msg">It's a binary, not a running kernel! And you can't boot it until you have built a matching initrd. Catch 22<br class="gmail_msg">
<br class="gmail_msg">
BillK<br class="gmail_msg">
<br class="gmail_msg"><br class="gmail_msg"><div class="gmail_quote gmail_msg">On 24 November 2016 11:48:56 AM AWST, "Marcos Raúl Carot" <<a href="mailto:marcos.carot@gmail.com" class="gmail_msg" target="_blank">marcos.carot@gmail.com</a>> wrote:<blockquote class="gmail_quote gmail_msg" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<p dir="ltr" class="gmail_msg">cat /proc/version </p>
<br class="gmail_msg"><div class="gmail_quote gmail_msg"><div dir="ltr" class="gmail_msg">On Thu, 24 Nov 2016, 11:36 Bill Kenworthy <<a href="mailto:billk@iinet.net.au" class="gmail_msg" target="_blank">billk@iinet.net.au</a>> wrote:<br class="gmail_msg"></div><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">What's the best way to get kernel version from a binary?<br class="m_-3608802962492962175m_-707605183867158878gmail_msg gmail_msg">
<br class="m_-3608802962492962175m_-707605183867158878gmail_msg gmail_msg">
Context is that the raspberry pi stock firware doesn’t use version<br class="m_-3608802962492962175m_-707605183867158878gmail_msg gmail_msg">
numbers in the filename and I want to know what kernel version I am<br class="m_-3608802962492962175m_-707605183867158878gmail_msg gmail_msg">
building a custom initrd using dracut for a btrfs on root filesystem.<br class="m_-3608802962492962175m_-707605183867158878gmail_msg gmail_msg">
<br class="m_-3608802962492962175m_-707605183867158878gmail_msg gmail_msg">
Easy to get manually (strings|grep the file) but its clumsy and hard to<br class="m_-3608802962492962175m_-707605183867158878gmail_msg gmail_msg">
get precision in a script and uname doesn’t work on a file :(<br class="m_-3608802962492962175m_-707605183867158878gmail_msg gmail_msg">
<br class="m_-3608802962492962175m_-707605183867158878gmail_msg gmail_msg">
BillK<br class="m_-3608802962492962175m_-707605183867158878gmail_msg gmail_msg">
_______________________________________________<br class="m_-3608802962492962175m_-707605183867158878gmail_msg gmail_msg">
PLUG discussion list: <a href="mailto:plug@plug.org.au" class="m_-3608802962492962175m_-707605183867158878gmail_msg gmail_msg" target="_blank">plug@plug.org.au</a><br class="m_-3608802962492962175m_-707605183867158878gmail_msg gmail_msg">
<a href="http://lists.plug.org.au/mailman/listinfo/plug" rel="noreferrer" class="m_-3608802962492962175m_-707605183867158878gmail_msg gmail_msg" target="_blank">http://lists.plug.org.au/mailman/listinfo/plug</a><br class="m_-3608802962492962175m_-707605183867158878gmail_msg gmail_msg">
Committee e-mail: <a href="mailto:committee@plug.org.au" class="m_-3608802962492962175m_-707605183867158878gmail_msg gmail_msg" target="_blank">committee@plug.org.au</a><br class="m_-3608802962492962175m_-707605183867158878gmail_msg gmail_msg">
PLUG Membership: <a href="http://www.plug.org.au/membership" rel="noreferrer" class="m_-3608802962492962175m_-707605183867158878gmail_msg gmail_msg" target="_blank">http://www.plug.org.au/membership</a></blockquote></div>
<p style="margin-top:2.5em;margin-bottom:1em;border-bottom:1px solid #000" class="gmail_msg"></p><pre class="m_-3608802962492962175m_-707605183867158878k9mail gmail_msg"><hr class="gmail_msg"><br class="gmail_msg">PLUG discussion list: <a href="mailto:plug@plug.org.au" class="gmail_msg" target="_blank">plug@plug.org.au</a><br class="gmail_msg"><a href="http://lists.plug.org.au/mailman/listinfo/plug" class="gmail_msg" target="_blank">http://lists.plug.org.au/mailman/listinfo/plug</a><br class="gmail_msg">Committee e-mail: <a href="mailto:committee@plug.org.au" class="gmail_msg" target="_blank">committee@plug.org.au</a><br class="gmail_msg">PLUG Membership: <a href="http://www.plug.org.au/membership" class="gmail_msg" target="_blank">http://www.plug.org.au/membership</a></pre></blockquote></div><br class="gmail_msg">
-- <br class="gmail_msg">
Sent from my Android phone with K-9 Mail. Please excuse my brevity.</div><br class="gmail_msg">_______________________________________________<br class="gmail_msg">
PLUG discussion list: <a href="mailto:plug@plug.org.au" class="gmail_msg" target="_blank">plug@plug.org.au</a><br class="gmail_msg">
<a href="http://lists.plug.org.au/mailman/listinfo/plug" rel="noreferrer" class="gmail_msg" target="_blank">http://lists.plug.org.au/mailman/listinfo/plug</a><br class="gmail_msg">
Committee e-mail: <a href="mailto:committee@plug.org.au" class="gmail_msg" target="_blank">committee@plug.org.au</a><br class="gmail_msg">
PLUG Membership: <a href="http://www.plug.org.au/membership" rel="noreferrer" class="gmail_msg" target="_blank">http://www.plug.org.au/membership</a><br class="gmail_msg"></blockquote></div></div>
</blockquote></div>