<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Hi Edhay,</p>
    <p>Thanks for the information.</p>
    <p>I'll check on my local machine and PPA to see if I can reproduce
      it.</p>
    <p><br>
    </p>
    <p>Cheers,</p>
    <p>Ivan<br>
    </p>
    <p><br>
    </p>
    <div class="moz-cite-prefix">On 3/29/22 19:34, G Edhaya Chandran
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:DB9PR08MB7470964319FE3EF51A21EA4CE81E9@DB9PR08MB7470.eurprd08.prod.outlook.com">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <meta name="Generator" content="Microsoft Word 15 (filtered
        medium)">
      <!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]-->
      <style>@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}@font-face
        {font-family:DengXian;
        panose-1:2 1 6 0 3 1 1 1 1 1;}@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}@font-face
        {font-family:"\@DengXian";
        panose-1:2 1 6 0 3 1 1 1 1 1;}@font-face
        {font-family:-apple-system;}p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}div.WordSection1
        {page:WordSection1;}</style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
      <div class="WordSection1">
        <p class="MsoNormal">Hi Alex,<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">    Apologies for following up on the below
          issue after so long.<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal"><i><span
              style="font-family:"Verdana",sans-serif">I don't
              observe the build errors on my local system and not on
              PPA.<o:p></o:p></span></i></p>
        <p class="MsoNormal"><i><span
              style="font-family:"Verdana",sans-serif">Could
              you please share more about your build env? I will try to
              reproduce it and see how this can be fixed.<o:p></o:p></span></i></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">The build environment is a new installation
          of Ubuntu 20.04.<o:p></o:p></p>
        <p class="MsoNormal">The FWTS build will fail with the below
          error:<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal"><img
            style="width:13.3679in;height:3.9528in" id="Picture_x0020_1"
            src="cid:part1.WAN89KCv.aGs8zuTP@canonical.com" class=""
            width="1283" height="379"><o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p style="margin:0cm;background:white;vertical-align:baseline"><span
            style="color:black">The suggestion to resolve this
            dependency is to install the
          </span><span
            style="font-size:10.0pt;font-family:Consolas;color:black;border:none
            windowtext 1.0pt;padding:0cm">libz-dev
          </span><span style="color:black">package by</span><span
            style="font-size:10.0pt;font-family:Consolas;color:#ED6C63;border:none
            windowtext 1.0pt;padding:0cm"><o:p></o:p></span></p>
        <p class="MsoNormal"
          style="background:white;vertical-align:baseline"><span
            style="font-size:10.0pt;font-family:Consolas;color:black;border:none
            windowtext 1.0pt;padding:0cm">sudo apt-get install libz-dev</span><span
style="font-size:12.0pt;font-family:-apple-system;color:#24292E"><o:p></o:p></span></p>
        <p class="MsoNormal">However this installed zlib.h in
          /usr/include which is not in the include path of FWTS
          compilation for fwts_ac_adapter.c<o:p></o:p></p>
        <p class="MsoNormal">(In fact this package is by default
          installed in default Ubuntu 20.04)<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">Suggestion:<o:p></o:p></p>
        <p class="MsoNormal">Including /usr/include in the -I path
          fwts_ac_adapter.c for may solve this issue.<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">With Warm Regards,<o:p></o:p></p>
        <p class="MsoNormal">Edhay<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <div style="border:none;border-left:solid blue 1.5pt;padding:0cm
          0cm 0cm 4.0pt">
          <div>
            <div style="border:none;border-top:solid #E1E1E1
              1.0pt;padding:3.0pt 0cm 0cm 0cm">
              <p class="MsoNormal"><b>From:</b> Alex Hung
                <a class="moz-txt-link-rfc2396E" href="mailto:alex.hung@canonical.com"><alex.hung@canonical.com></a> <br>
                <b>Sent:</b> 16 December 2021 21:27<br>
                <b>To:</b> G Edhaya Chandran
                <a class="moz-txt-link-rfc2396E" href="mailto:Edhaya.Chandran@arm.com"><Edhaya.Chandran@arm.com></a><br>
                <b>Cc:</b> Sunny Wang <a class="moz-txt-link-rfc2396E" href="mailto:Sunny.Wang@arm.com"><Sunny.Wang@arm.com></a>;
                <a class="moz-txt-link-abbreviated" href="mailto:fwts-devel@lists.ubuntu.com">fwts-devel@lists.ubuntu.com</a><br>
                <b>Subject:</b> Re: [PATCH][V3] dmicheck: skip scanning
                smbios in /dev/mem on aarch64<o:p></o:p></p>
            </div>
          </div>
          <p class="MsoNormal"><o:p> </o:p></p>
          <div>
            <div>
              <div>
                <p class="MsoNormal"><span
                    style="font-family:"Verdana",sans-serif"><o:p> </o:p></span></p>
              </div>
            </div>
            <p class="MsoNormal"><o:p> </o:p></p>
            <div>
              <div>
                <p class="MsoNormal">On Thu, Dec 16, 2021 at 1:36 AM G
                  Edhaya Chandran <<a
                    href="mailto:Edhaya.Chandran@arm.com"
                    moz-do-not-send="true" class="moz-txt-link-freetext">Edhaya.Chandran@arm.com</a>>
                  wrote:<o:p></o:p></p>
              </div>
              <blockquote style="border:none;border-left:solid #CCCCCC
                1.0pt;padding:0cm 0cm 0cm
                6.0pt;margin-left:4.8pt;margin-right:0cm">
                <div>
                  <div>
                    <p class="MsoNormal"
                      style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Hi
                      Alex,<o:p></o:p></p>
                    <p class="MsoNormal"
                      style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
                    <p class="MsoNormal"
                      style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">   
                      There is no dependency on ACS image, but on
                      <b>ubuntu</b> build env.<o:p></o:p></p>
                  </div>
                </div>
              </blockquote>
              <div>
                <p class="MsoNormal"><o:p> </o:p></p>
              </div>
              <div>
                <div>
                  <p class="MsoNormal"><span
                      style="font-family:"Verdana",sans-serif">I
                      don't observe the build errors on my local system
                      and not on PPA.<o:p></o:p></span></p>
                </div>
                <div>
                  <p class="MsoNormal"><span
                      style="font-family:"Verdana",sans-serif"><o:p> </o:p></span></p>
                </div>
                <div>
                  <p class="MsoNormal"><span
                      style="font-family:"Verdana",sans-serif">Could
                      you please share more about your build env? I will
                      try to reproduce it and see how this can be fixed.<o:p></o:p></span></p>
                </div>
                <p class="MsoNormal"><o:p> </o:p></p>
              </div>
              <div>
                <p class="MsoNormal"> <o:p></o:p></p>
              </div>
              <blockquote style="border:none;border-left:solid #CCCCCC
                1.0pt;padding:0cm 0cm 0cm
                6.0pt;margin-left:4.8pt;margin-right:0cm">
                <div>
                  <div>
                    <p class="MsoNormal"
                      style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
                    <p class="MsoNormal"
                      style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">I
                      already tried the solution
                      <span
                        style="font-family:"Verdana",sans-serif"> <a
href="https://unix.stackexchange.com/questions/315605/unable-to-cross-compile-openssh-for-arm-zlib-missing"
                          target="_blank" moz-do-not-send="true"
                          class="moz-txt-link-freetext">https://unix.stackexchange.com/questions/315605/unable-to-cross-compile-openssh-for-arm-zlib-missing</a>.</span><o:p></o:p></p>
                    <p class="MsoNormal"
                      style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">The
                      package was already installed in my env.  However
                      the zlib.h was present in /usr/include<o:p></o:p></p>
                    <p class="MsoNormal"
                      style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Probably
                      this is different in the other Linux distros.<o:p></o:p></p>
                    <p class="MsoNormal"
                      style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
                    <p class="MsoNormal"
                      style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">I
                      am not sure of the relevance but the .Po files in
                      the package alse has this path<o:p></o:p></p>
                    <p class="MsoNormal"
                      style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">src/acpi/battery/.deps/fwts-battery.Po:
                      ../src/lib/include/fwts_fileio.h
                      <b>/usr/include/zlib.h </b>\<o:p></o:p></p>
                    <p class="MsoNormal"
                      style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">src/acpi/battery/.deps/fwts-battery.Po:/usr/include/zlib.h:<o:p></o:p></p>
                    <p class="MsoNormal"
                      style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">src/acpi/crsdump/.deps/fwts-prsdump.Po:
                      ../src/lib/include/fwts_fileio.h
                      /usr/include/zlib.h \<o:p></o:p></p>
                    <p class="MsoNormal"
                      style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">src/acpi/crsdump/.deps/fwts-prsdump.Po:/usr/include/zlib.h:<o:p></o:p></p>
                    <p class="MsoNormal"
                      style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
                    <p class="MsoNormal"
                      style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">With
                      Warm Regards,<br>
                      Edhay<o:p></o:p></p>
                    <p class="MsoNormal"
                      style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
                    <p class="MsoNormal"
                      style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
                    <div style="border:none;border-left:solid windowtext
                      1.5pt;padding:0cm 0cm 0cm
                      4.0pt;border-color:currentcolor currentcolor
                      currentcolor blue">
                      <div>
                        <div style="border:none;border-top:solid
                          windowtext 1.0pt;padding:3.0pt 0cm 0cm
                          0cm;border-color:currentcolor currentcolor">
                          <p class="MsoNormal"
                            style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b>From:</b>
                            Alex Hung <<a
                              href="mailto:alex.hung@canonical.com"
                              target="_blank" moz-do-not-send="true"
                              class="moz-txt-link-freetext">alex.hung@canonical.com</a>>
                            <br>
                            <b>Sent:</b> 16 December 2021 00:15<br>
                            <b>To:</b> G Edhaya Chandran <<a
                              href="mailto:Edhaya.Chandran@arm.com"
                              target="_blank" moz-do-not-send="true"
                              class="moz-txt-link-freetext">Edhaya.Chandran@arm.com</a>><br>
                            <b>Cc:</b> Sunny Wang <<a
                              href="mailto:Sunny.Wang@arm.com"
                              target="_blank" moz-do-not-send="true"
                              class="moz-txt-link-freetext">Sunny.Wang@arm.com</a>>;
                            <a href="mailto:fwts-devel@lists.ubuntu.com"
                              target="_blank" moz-do-not-send="true"
                              class="moz-txt-link-freetext">fwts-devel@lists.ubuntu.com</a><br>
                            <b>Subject:</b> Re: [PATCH][V3] dmicheck:
                            skip scanning smbios in /dev/mem on aarch64<o:p></o:p></p>
                        </div>
                      </div>
                      <p class="MsoNormal"
                        style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
                      <div>
                        <div>
                          <div>
                            <p class="MsoNormal"
                              style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span
style="font-family:"Verdana",sans-serif">Hi,</span><o:p></o:p></p>
                          </div>
                          <div>
                            <p class="MsoNormal"
                              style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span
style="font-family:"Verdana",sans-serif"> </span><o:p></o:p></p>
                          </div>
                          <div>
                            <p class="MsoNormal"
                              style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span
style="font-family:"Verdana",sans-serif">I am not familiar
                                with your ACS image but did you try
                                solutions like
                                <a
href="https://unix.stackexchange.com/questions/315605/unable-to-cross-compile-openssh-for-arm-zlib-missing"
                                  target="_blank" moz-do-not-send="true"
                                  class="moz-txt-link-freetext">
https://unix.stackexchange.com/questions/315605/unable-to-cross-compile-openssh-for-arm-zlib-missing</a>?</span><o:p></o:p></p>
                          </div>
                        </div>
                        <p class="MsoNormal"
                          style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
                        <div>
                          <div>
                            <p class="MsoNormal"
                              style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">On
                              Mon, Dec 13, 2021 at 12:48 AM G Edhaya
                              Chandran <<a
                                href="mailto:Edhaya.Chandran@arm.com"
                                target="_blank" moz-do-not-send="true"
                                class="moz-txt-link-freetext">Edhaya.Chandran@arm.com</a>>
                              wrote:<o:p></o:p></p>
                          </div>
                          <blockquote
                            style="border:none;border-left:solid
                            windowtext 1.0pt;padding:0cm 0cm 0cm
6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt;border-color:currentcolor
                            currentcolor currentcolor rgb(204,204,204)">
                            <div>
                              <div>
                                <p class="MsoNormal"
                                  style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Hello
                                  Alex,<o:p></o:p></p>
                                <p class="MsoNormal"
                                  style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
                                <p class="MsoNormal"
                                  style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">  
                                  Thank you. The solution does work on
                                  our ACS Image.<o:p></o:p></p>
                                <p class="MsoNormal"
                                  style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Attached
                                  are the logs.<o:p></o:p></p>
                                <p class="MsoNormal"
                                  style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
                                <p class="MsoNormal"
                                  style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
                                <p class="MsoNormal"
                                  style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">However
                                  I did find a build issue for including
                                  the .h file:<o:p></o:p></p>
                                <p class="MsoNormal"
                                  style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">#include
                                  <zlib.h><o:p></o:p></p>
                                <p class="MsoNormal"
                                  style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
                                <p class="MsoNormal"
                                  style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">In
                                  the Ubuntu installation that I have
                                  this file exists in
                                  <o:p></o:p></p>
                                <p class="MsoNormal"
                                  style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">/usr/include<o:p></o:p></p>
                                <p class="MsoNormal"
                                  style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
                                <p class="MsoNormal"
                                  style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">When
                                  I included this path though
                                  -I/usr/include in Makefile.md, it gave
                                  redefinition errors for other symbols.<o:p></o:p></p>
                                <p class="MsoNormal"
                                  style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">So
                                  I updated the code to
                                  <o:p></o:p></p>
                                <p class="MsoNormal"
                                  style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">#include
                                  </usr/include/zlib.h><o:p></o:p></p>
                                <p class="MsoNormal"
                                  style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">to
                                  complete the build.<o:p></o:p></p>
                                <p class="MsoNormal"
                                  style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
                                <p class="MsoNormal"
                                  style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">With
                                  Warm Regards,<o:p></o:p></p>
                                <p class="MsoNormal"
                                  style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Edhay<o:p></o:p></p>
                                <p class="MsoNormal"
                                  style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
                                <p class="MsoNormal"
                                  style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
                                <p class="MsoNormal"
                                  style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
                                <div
                                  style="border:none;border-left:solid
                                  windowtext 1.5pt;padding:0cm 0cm 0cm
                                  4.0pt;border-color:currentcolor
                                  currentcolor currentcolor blue">
                                  <div>
                                    <div
                                      style="border:none;border-top:solid
                                      windowtext 1.0pt;padding:3.0pt 0cm
                                      0cm 0cm;border-color:currentcolor">
                                      <p class="MsoNormal"
                                        style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b>From:</b>
                                        Alex Hung <<a
                                          href="mailto:alex.hung@canonical.com"
                                          target="_blank"
                                          moz-do-not-send="true"
                                          class="moz-txt-link-freetext">alex.hung@canonical.com</a>>
                                        <br>
                                        <b>Sent:</b> 08 December 2021
                                        04:28<br>
                                        <b>To:</b> Sunny Wang <<a
                                          href="mailto:Sunny.Wang@arm.com"
                                          target="_blank"
                                          moz-do-not-send="true"
                                          class="moz-txt-link-freetext">Sunny.Wang@arm.com</a>><br>
                                        <b>Cc:</b> <a
                                          href="mailto:fwts-devel@lists.ubuntu.com"
                                          target="_blank"
                                          moz-do-not-send="true"
                                          class="moz-txt-link-freetext">fwts-devel@lists.ubuntu.com</a>;
                                        G Edhaya Chandran <<a
                                          href="mailto:Edhaya.Chandran@arm.com"
                                          target="_blank"
                                          moz-do-not-send="true"
                                          class="moz-txt-link-freetext">Edhaya.Chandran@arm.com</a>><br>
                                        <b>Subject:</b> Re: [PATCH][V3]
                                        dmicheck: skip scanning smbios
                                        in /dev/mem on aarch64<o:p></o:p></p>
                                    </div>
                                  </div>
                                  <p class="MsoNormal"
                                    style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
                                  <div>
                                    <div>
                                      <p class="MsoNormal"
                                        style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span
style="font-family:"Verdana",sans-serif">Hi Sunny,</span><o:p></o:p></p>
                                    </div>
                                    <div>
                                      <p class="MsoNormal"
                                        style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span
style="font-family:"Verdana",sans-serif"> </span><o:p></o:p></p>
                                    </div>
                                    <div>
                                      <p class="MsoNormal"
                                        style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span
style="font-family:"Verdana",sans-serif">The attached patch
                                          also checks /proc/config.gz.</span><o:p></o:p></p>
                                    </div>
                                    <div>
                                      <p class="MsoNormal"
                                        style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span
style="font-family:"Verdana",sans-serif"> </span><o:p></o:p></p>
                                    </div>
                                    <div>
                                      <p class="MsoNormal"
                                        style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span
style="font-family:"Verdana",sans-serif">Please give it a try
                                          and let me know whether it
                                          works or needs improvement.</span><o:p></o:p></p>
                                    </div>
                                  </div>
                                  <p class="MsoNormal"
                                    style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
                                  <div>
                                    <div>
                                      <p class="MsoNormal"
                                        style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">On
                                        Thu, Nov 25, 2021 at 10:39 AM
                                        Sunny Wang <<a
                                          href="mailto:Sunny.Wang@arm.com"
                                          target="_blank"
                                          moz-do-not-send="true"
                                          class="moz-txt-link-freetext">Sunny.Wang@arm.com</a>>
                                        wrote:<o:p></o:p></p>
                                    </div>
                                    <blockquote
                                      style="border:none;border-left:solid
                                      windowtext 1.0pt;padding:0cm 0cm
                                      0cm
6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt;border-color:currentcolor
                                      currentcolor currentcolor
                                      rgb(204,204,204)">
                                      <div>
                                        <div>
                                          <p class="MsoNormal"
                                            style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Here
                                            you go.
                                            <o:p></o:p></p>
                                          <p class="MsoNormal"
                                            style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
                                          <p class="MsoNormal"
                                            style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Best
                                            Regards,<o:p></o:p></p>
                                          <p class="MsoNormal"
                                            style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Sunny<o:p></o:p></p>
                                          <p class="MsoNormal"
                                            style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
                                          <div
                                            style="border:none;border-top:solid
                                            windowtext
                                            1.0pt;padding:3.0pt 0cm 0cm
0cm;border-color:currentcolor">
                                            <p class="MsoNormal"
                                              style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b>From:</b>
                                              Alex Hung <<a
                                                href="mailto:alex.hung@canonical.com"
                                                target="_blank"
                                                moz-do-not-send="true"
                                                class="moz-txt-link-freetext">alex.hung@canonical.com</a>>
                                              <br>
                                              <b>Sent:</b> 25 November
                                              2021 16:39<br>
                                              <b>To:</b> Sunny Wang <<a
href="mailto:Sunny.Wang@arm.com" target="_blank" moz-do-not-send="true"
class="moz-txt-link-freetext">Sunny.Wang@arm.com</a>><br>
                                              <b>Cc:</b> <a
                                                href="mailto:fwts-devel@lists.ubuntu.com"
                                                target="_blank"
                                                moz-do-not-send="true"
                                                class="moz-txt-link-freetext">fwts-devel@lists.ubuntu.com</a>;
                                              G Edhaya Chandran <<a
                                                href="mailto:Edhaya.Chandran@arm.com"
                                                target="_blank"
                                                moz-do-not-send="true"
                                                class="moz-txt-link-freetext">Edhaya.Chandran@arm.com</a>><br>
                                              <b>Subject:</b> Re:
                                              [PATCH][V3] dmicheck: skip
                                              scanning smbios in
                                              /dev/mem on aarch64<o:p></o:p></p>
                                          </div>
                                          <p class="MsoNormal"
                                            style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
                                          <div>
                                            <div>
                                              <div>
                                                <p class="MsoNormal"
                                                  style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span
style="font-family:"Verdana",sans-serif"> </span><o:p></o:p></p>
                                              </div>
                                            </div>
                                            <p class="MsoNormal"
                                              style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
                                            <div>
                                              <div>
                                                <p class="MsoNormal"
                                                  style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">On
                                                  Tue, Nov 23, 2021 at
                                                  4:18 AM Sunny Wang
                                                  <<a
                                                    href="mailto:Sunny.Wang@arm.com"
                                                    target="_blank"
                                                    moz-do-not-send="true"
class="moz-txt-link-freetext">Sunny.Wang@arm.com</a>> wrote:<o:p></o:p></p>
                                              </div>
                                              <blockquote
                                                style="border:none;border-left:solid
                                                windowtext
                                                1.0pt;padding:0cm 0cm
                                                0cm
6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt;border-color:currentcolor
                                                currentcolor
                                                currentcolor
                                                rgb(204,204,204)">
                                                <div>
                                                  <div>
                                                    <p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">You’re right,
                                                      Alex.
                                                      <o:p></o:p></p>
                                                    <p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Edhaya and I
                                                      just checked this.
                                                      Our kernel config
                                                      is in
                                                      /proc/config.gz.
                                                      Could you add code
                                                      to handle
                                                      /proc/config.gz?
                                                      <o:p></o:p></p>
                                                  </div>
                                                </div>
                                              </blockquote>
                                              <div>
                                                <p class="MsoNormal"
                                                  style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
                                              </div>
                                              <div>
                                                <p class="MsoNormal"
                                                  style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span
style="font-family:"Verdana",sans-serif">Please share a copy
                                                    of config.gz for
                                                    further analysis.</span><o:p></o:p></p>
                                              </div>
                                              <blockquote
                                                style="border:none;border-left:solid
                                                windowtext
                                                1.0pt;padding:0cm 0cm
                                                0cm
6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt;border-color:currentcolor
                                                currentcolor
                                                currentcolor
                                                rgb(204,204,204)">
                                                <div>
                                                  <div>
                                                    <p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">For more
                                                      information,
                                                      please check
                                                      <a
href="https://superuser.com/questions/287371/obtain-kernel-config-from-currently-running-linux-system"
                                                        target="_blank"
moz-do-not-send="true" class="moz-txt-link-freetext">
https://superuser.com/questions/287371/obtain-kernel-config-from-currently-running-linux-system</a>.<o:p></o:p></p>
                                                    <p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
                                                    <p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Best Regards,<o:p></o:p></p>
                                                    <p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Sunny<o:p></o:p></p>
                                                    <div
                                                      style="border:none;border-top:solid
                                                      windowtext
                                                      1.0pt;padding:3.0pt
                                                      0cm 0cm
                                                      0cm;border-color:currentcolor">
                                                      <p
                                                        class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b>From:</b>
                                                        Alex Hung <<a
href="mailto:alex.hung@canonical.com" target="_blank"
                                                          moz-do-not-send="true"
class="moz-txt-link-freetext">alex.hung@canonical.com</a>>
                                                        <br>
                                                        <b>Sent:</b> 22
                                                        November 2021
                                                        22:59<br>
                                                        <b>To:</b> Sunny
                                                        Wang <<a
                                                          href="mailto:Sunny.Wang@arm.com"
target="_blank" moz-do-not-send="true" class="moz-txt-link-freetext">Sunny.Wang@arm.com</a>><br>
                                                        <b>Cc:</b> <a
                                                          href="mailto:fwts-devel@lists.ubuntu.com"
target="_blank" moz-do-not-send="true" class="moz-txt-link-freetext">fwts-devel@lists.ubuntu.com</a>;
                                                        G Edhaya
                                                        Chandran <<a
href="mailto:Edhaya.Chandran@arm.com" target="_blank"
                                                          moz-do-not-send="true"
class="moz-txt-link-freetext">Edhaya.Chandran@arm.com</a>><br>
                                                        <b>Subject:</b>
                                                        Re: [PATCH][V3]
                                                        dmicheck: skip
                                                        scanning smbios
                                                        in /dev/mem on
                                                        aarch64<o:p></o:p></p>
                                                    </div>
                                                    <p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
                                                    <div>
                                                      <div>
                                                        <p
                                                          class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span
                                                          style="font-family:"Verdana",sans-serif">It
                                                          is also
                                                          possible that
                                                          your ACS uses
                                                          a different
                                                          approach for
                                                          kernel config,
                                                          i.e. not
                                                          /boot/config-`uname
                                                          -r` like
                                                          Ubuntu and
                                                          fwts-live. If
                                                          that's the
                                                          case, this
                                                          patch can be
                                                          improved to
                                                          include more
                                                          ways for
                                                          kernel config.</span><o:p></o:p></p>
                                                      </div>
                                                    </div>
                                                    <p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
                                                    <div>
                                                      <div>
                                                        <p
                                                          class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">On Mon, Nov
                                                          22, 2021 at
                                                          3:46 PM Alex
                                                          Hung <<a
                                                          href="mailto:alex.hung@canonical.com"
target="_blank" moz-do-not-send="true" class="moz-txt-link-freetext">alex.hung@canonical.com</a>>
                                                          wrote:<o:p></o:p></p>
                                                      </div>
                                                      <blockquote
                                                        style="border:none;border-left:solid
                                                        windowtext
                                                        1.0pt;padding:0cm
                                                        0cm 0cm
6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt;border-color:currentcolor
                                                        currentcolor
                                                        currentcolor
                                                        rgb(204,204,204)">
                                                        <div>
                                                          <div>
                                                          <div>
                                                          <p
                                                          class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span
                                                          style="font-family:"Verdana",sans-serif"> </span><o:p></o:p></p>
                                                          </div>
                                                          </div>
                                                          <p
                                                          class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
                                                          <div>
                                                          <div>
                                                          <p
                                                          class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">On Mon, Nov
                                                          22, 2021 at
                                                          2:44 PM Sunny
                                                          Wang <<a
                                                          href="mailto:Sunny.Wang@arm.com"
target="_blank" moz-do-not-send="true" class="moz-txt-link-freetext">Sunny.Wang@arm.com</a>>
                                                          wrote:<o:p></o:p></p>
                                                          </div>
                                                          <blockquote
                                                          style="border:none;border-left:solid
                                                          windowtext
                                                          1.0pt;padding:0cm
                                                          0cm 0cm
6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt;border-color:currentcolor
                                                          currentcolor
                                                          currentcolor
                                                          rgb(204,204,204)">
                                                          <p
                                                          class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Hi Alex,<br>
                                                          <br>
                                                          Edhaya and I
                                                          just tested
                                                          the v2 patch
                                                          by
                                                          cherry-picking
                                                          it into our
                                                          ACS FWTS, and
                                                          then somehow
                                                          this fix
                                                          doesn’t work.<br>
                                                          Does it work
                                                          on your side?
                                                          Could you
                                                          build the FWTS
                                                          live image
                                                          with this fix
                                                          and offline
                                                          share it with
                                                          us for
                                                          verification?<o:p></o:p></p>
                                                          </blockquote>
                                                          <div>
                                                          <p
                                                          class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
                                                          </div>
                                                          <div>
                                                          <div>
                                                          <p
                                                          class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span
                                                          style="font-family:"Verdana",sans-serif">Yes
                                                          it worked on
                                                          my RPI4. The
                                                          attached
                                                          results.log
                                                          contains two
                                                          runs: 1st run
                                                          with patch
                                                          (runs to
                                                          completion)
                                                          and 2nd run
                                                          without the
                                                          patch (stopped
                                                          in test 1)</span><o:p></o:p></p>
                                                          </div>
                                                          <div>
                                                          <p
                                                          class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span
                                                          style="font-family:"Verdana",sans-serif"> </span><o:p></o:p></p>
                                                          </div>
                                                          <div>
                                                          <p
                                                          class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span
                                                          style="font-family:"Verdana",sans-serif">The
                                                          fwts-live
                                                          requires
                                                          released
                                                          version of
                                                          fwts so it's
                                                          not possible
                                                          without major
                                                          modifications.
                                                          If it doesn't
                                                          work I think
                                                          the patch may
                                                          not fix but
                                                          hide the error
                                                          on my systems.
                                                          We will have
                                                          to revisit the
                                                          bug again.</span><o:p></o:p></p>
                                                          </div>
                                                          <p
                                                          class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
                                                          </div>
                                                          <div>
                                                          <p
                                                          class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
                                                          </div>
                                                          <blockquote
                                                          style="border:none;border-left:solid
                                                          windowtext
                                                          1.0pt;padding:0cm
                                                          0cm 0cm
6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt;border-color:currentcolor
                                                          currentcolor
                                                          currentcolor
                                                          rgb(204,204,204)">
                                                          <p
                                                          class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><br>
                                                          Best Regards,<br>
                                                          Sunny<br>
                                                          -----Original
                                                          Message-----<br>
                                                          From:
                                                          fwts-devel
                                                          <<a
                                                          href="mailto:fwts-devel-bounces@lists.ubuntu.com"
target="_blank" moz-do-not-send="true" class="moz-txt-link-freetext">fwts-devel-bounces@lists.ubuntu.com</a>>
                                                          On Behalf Of
                                                          Alex Hung<br>
                                                          Sent: 22
                                                          November 2021
                                                          02:15<br>
                                                          To: <a
                                                          href="mailto:fwts-devel@lists.ubuntu.com"
target="_blank" moz-do-not-send="true" class="moz-txt-link-freetext">fwts-devel@lists.ubuntu.com</a><br>
                                                          Subject:
                                                          [PATCH][V3]
                                                          dmicheck: skip
                                                          scanning
                                                          smbios in
                                                          /dev/mem on
                                                          aarch64<br>
                                                          <br>
                                                          Buglink: <a
                                                          href="https://bugs.launchpad.net/bugs/1947786"
target="_blank" moz-do-not-send="true" class="moz-txt-link-freetext">https://bugs.launchpad.net/bugs/1947786</a><br>
                                                          <br>
                                                          Signed-off-by:
                                                          Alex Hung <<a
href="mailto:alex.hung@canonical.com" target="_blank"
                                                          moz-do-not-send="true"
class="moz-txt-link-freetext">alex.hung@canonical.com</a>><br>
                                                          ---<br>
 src/dmi/dmicheck/dmicheck.c   | 14 +++++++<br>
 src/lib/include/fwts.h        |  1 +<br>
 src/lib/include/fwts_kernel.h | 25 ++++++++++++<br>
 src/lib/src/Makefile.am       |  1 +<br>
 src/lib/src/fwts_kernel.c     | 74 +++++++++++++++++++++++++++++++++++<br>
                                                           5 files
                                                          changed, 115
                                                          insertions(+)<br>
                                                           create mode
                                                          100644
                                                          src/lib/include/fwts_kernel.h<br>
                                                           create mode
                                                          100644
                                                          src/lib/src/fwts_kernel.c<br>
                                                          <br>
                                                          diff --git
                                                          a/src/dmi/dmicheck/dmicheck.c
b/src/dmi/dmicheck/dmicheck.c<br>
                                                          index
                                                          7f6a90c4..3985b126
                                                          100644<br>
                                                          ---
                                                          a/src/dmi/dmicheck/dmicheck.c<br>
                                                          +++
                                                          b/src/dmi/dmicheck/dmicheck.c<br>
                                                          @@ -381,6
                                                          +381,13 @@
                                                          static void*
                                                          dmi_table_smbios(fwts_framework
                                                          *fw,
                                                          fwts_smbios_entry
                                                          *entry)<br>
                                                                       
                                                            free(table);<br>
                                                                  }<br>
                                                          <br>
                                                          +#ifdef
                                                          FWTS_ARCH_AARCH64<br>
                                                          +       if
                                                          (fwts_kernel_config_set("CONFIG_STRICT_DEVMEM"))
                                                          {<br>
                                                          +             
 fwts_warning(fw, "Skipping scanning SMBIOS table in memory for arm64
                                                          systems");<br>
                                                          +             
                                                           return NULL;<br>
                                                          +       }<br>
                                                          +#endif<br>
                                                          +<br>
                                                                  mem =
fwts_mmap(addr, length);<br>
                                                                  if
                                                          (mem !=
                                                          FWTS_MAP_FAILED)
                                                          {<br>
                                                                       
                                                            /* Can we
                                                          safely copy
                                                          the table? */<br>
                                                          @@ -429,6
                                                          +436,13 @@
                                                          static void*
                                                          dmi_table_smbios30(fwts_framework
                                                          *fw,
                                                          fwts_smbios30_entry
                                                          *entry)<br>
                                                                       
                                                            free(table);<br>
                                                                  }<br>
                                                          <br>
                                                          +#ifdef
                                                          FWTS_ARCH_AARCH64<br>
                                                          +       if
                                                          (fwts_kernel_config_set("CONFIG_STRICT_DEVMEM"))
                                                          {<br>
                                                          +             
 fwts_warning(fw, "Skipping scanning SMBIOS3 table in memory for arm64
                                                          systems");<br>
                                                          +             
                                                           return NULL;<br>
                                                          +       }<br>
                                                          +#endif<br>
                                                          +<br>
                                                                  mem =
fwts_mmap(addr, length);<br>
                                                                  if
                                                          (mem !=
                                                          FWTS_MAP_FAILED)
                                                          {<br>
                                                                       
                                                            /* Can we
                                                          safely copy
                                                          the table? */<br>
                                                          diff --git
                                                          a/src/lib/include/fwts.h
b/src/lib/include/fwts.h<br>
                                                          index
                                                          551a4e09..be754a99
                                                          100644<br>
                                                          ---
                                                          a/src/lib/include/fwts.h<br>
                                                          +++
                                                          b/src/lib/include/fwts.h<br>
                                                          @@ -185,6
                                                          +185,7 @@<br>
                                                           #include
                                                          "fwts_iasl.h"<br>
                                                           #include
                                                          "fwts_ipmi.h"<br>
                                                           #include
                                                          "fwts_klog.h"<br>
                                                          +#include
                                                          "fwts_kernel.h"<br>
                                                           #include
                                                          "fwts_olog.h"<br>
                                                           #include
                                                          "fwts_pipeio.h"<br>
                                                           #include
                                                          "fwts_stringextras.h"<br>
                                                          diff --git
                                                          a/src/lib/include/fwts_kernel.h
b/src/lib/include/fwts_kernel.h<br>
                                                          new file mode
                                                          100644<br>
                                                          index
                                                          00000000..a89576ae<br>
                                                          --- /dev/null<br>
                                                          +++
                                                          b/src/lib/include/fwts_kernel.h<br>
                                                          @@ -0,0 +1,25
                                                          @@<br>
                                                          +/*<br>
                                                          + * Copyright
                                                          (C) 2021
                                                          Canonical<br>
                                                          + *<br>
                                                          + * This
                                                          program is
                                                          free software;
                                                          you can
                                                          redistribute
                                                          it and/or<br>
                                                          + * modify it
                                                          under the
                                                          terms of the
                                                          GNU General
                                                          Public License<br>
                                                          + * as
                                                          published by
                                                          the Free
                                                          Software
                                                          Foundation;
                                                          either version
                                                          2<br>
                                                          + * of the
                                                          License, or
                                                          (at your
                                                          option) any
                                                          later version.<br>
                                                          + *<br>
                                                          + * This
                                                          program is
                                                          distributed in
                                                          the hope that
                                                          it will be
                                                          useful,<br>
                                                          + * but
                                                          WITHOUT ANY
                                                          WARRANTY;
                                                          without even
                                                          the implied
                                                          warranty of<br>
                                                          + *
                                                          MERCHANTABILITY
                                                          or FITNESS FOR
                                                          A PARTICULAR
                                                          PURPOSE.  See
                                                          the<br>
                                                          + * GNU
                                                          General Public
                                                          License for
                                                          more details.<br>
                                                          + *<br>
                                                          + * You should
                                                          have received
                                                          a copy of the
                                                          GNU General
                                                          Public License<br>
                                                          + * along with
                                                          this program;
                                                          if not, write
                                                          to the Free
                                                          Software<br>
                                                          + *
                                                          Foundation,
                                                          Inc., 51
                                                          Franklin
                                                          Street, Fifth
                                                          Floor, Boston,
                                                          MA 02110-1301,
                                                          USA.<br>
                                                          + *<br>
                                                          + */<br>
                                                          +<br>
                                                          +#ifndef
                                                          __FWTS_KERNEL_H__<br>
                                                          +#define
                                                          __FWTS_KERNEL_H__<br>
                                                          +<br>
                                                          +bool
                                                          fwts_kernel_config_set(const
                                                          char *config);<br>
                                                          +<br>
                                                          +#endif<br>
                                                          diff --git
                                                          a/src/lib/src/Makefile.am
b/src/lib/src/Makefile.am<br>
                                                          index
                                                          55c52b41..0a39882a
                                                          100644<br>
                                                          ---
                                                          a/src/lib/src/Makefile.am<br>
                                                          +++
                                                          b/src/lib/src/Makefile.am<br>
                                                          @@ -83,6 +83,7
                                                          @@
                                                          libfwts_la_SOURCES
                                                          =          \<br>
                                                                 
                                                          fwts_ioport.c 
                                                                   \<br>
                                                                 
                                                          fwts_ipmi.c   
                                                                   \<br>
                                                                 
                                                          fwts_json.c   
                                                                   \<br>
                                                          +     
                                                           fwts_kernel.c 
                                                                   \<br>
                                                                 
                                                          fwts_keymap.c 
                                                                   \<br>
                                                                 
                                                          fwts_klog.c   
                                                                   \<br>
                                                                 
                                                          fwts_olog.c   
                                                                   \<br>
                                                          diff --git
                                                          a/src/lib/src/fwts_kernel.c
b/src/lib/src/fwts_kernel.c<br>
                                                          new file mode
                                                          100644<br>
                                                          index
                                                          00000000..10d11a99<br>
                                                          --- /dev/null<br>
                                                          +++
                                                          b/src/lib/src/fwts_kernel.c<br>
                                                          @@ -0,0 +1,74
                                                          @@<br>
                                                          +/*<br>
                                                          + * Copyright
                                                          (C) 2021
                                                          Canonical<br>
                                                          + *<br>
                                                          + * This
                                                          program is
                                                          free software;
                                                          you can
                                                          redistribute
                                                          it and/or<br>
                                                          + * modify it
                                                          under the
                                                          terms of the
                                                          GNU General
                                                          Public License<br>
                                                          + * as
                                                          published by
                                                          the Free
                                                          Software
                                                          Foundation;
                                                          either version
                                                          2<br>
                                                          + * of the
                                                          License, or
                                                          (at your
                                                          option) any
                                                          later version.<br>
                                                          + *<br>
                                                          + * This
                                                          program is
                                                          distributed in
                                                          the hope that
                                                          it will be
                                                          useful,<br>
                                                          + * but
                                                          WITHOUT ANY
                                                          WARRANTY;
                                                          without even
                                                          the implied
                                                          warranty of<br>
                                                          + *
                                                          MERCHANTABILITY
                                                          or FITNESS FOR
                                                          A PARTICULAR
                                                          PURPOSE.  See
                                                          the<br>
                                                          + * GNU
                                                          General Public
                                                          License for
                                                          more details.<br>
                                                          + *<br>
                                                          + * You should
                                                          have received
                                                          a copy of the
                                                          GNU General
                                                          Public License<br>
                                                          + * along with
                                                          this program;
                                                          if not, write
                                                          to the Free
                                                          Software<br>
                                                          + *
                                                          Foundation,
                                                          Inc., 51
                                                          Franklin
                                                          Street, Fifth
                                                          Floor, Boston,
                                                          MA 02110-1301,
                                                          USA.<br>
                                                          + *<br>
                                                          + */<br>
                                                          +<br>
                                                          +#include
                                                          <sys/utsname.h><br>
                                                          +<br>
                                                          +#include
                                                          "fwts.h"<br>
                                                          +#include
                                                          "fwts_kernel.h"<br>
                                                          +#include
                                                          <stdlib.h><br>
                                                          +#include
                                                          <stdio.h><br>
                                                          +#include
                                                          <bsd/string.h><br>
                                                          +<br>
                                                          +#define
                                                          CONFIG_FILE_PREFIX 
                                                           
                                                           "/boot/config-"<br>
                                                          +<br>
                                                          +/*<br>
                                                          + * 
                                                          fwts_kernel_config_set<br>
                                                          + *      check
                                                          whether a
                                                          kernel config
                                                          is set, ex.<br>
                                                          + *      true
                                                          if
                                                          CONFIG_XYZ=y
                                                          or
                                                          CONFIG_XYZ=m<br>
                                                          + */<br>
                                                          +bool
                                                          fwts_kernel_config_set(const
                                                          char *config)<br>
                                                          +{<br>
                                                          +       const
                                                          size_t
                                                          config_str_len
                                                          =
                                                          strlen(config)
                                                          + 3;<br>
                                                          +       char
                                                          config_file[PATH_MAX];<br>
                                                          +       char
                                                          config_str[255];<br>
                                                          +       size_t
config_file_len;<br>
                                                          +     
                                                           fwts_list*
                                                          config_list;<br>
                                                          +     
                                                           fwts_list_link
                                                          *item;<br>
                                                          +       struct
                                                          utsname buf;<br>
                                                          +<br>
                                                          +       /* get
                                                          path of config
                                                          file, i.e.
                                                          /boot/config-5.11.0-38-generic
                                                          */<br>
                                                          +     
                                                           uname(&buf);<br>
                                                          +     
                                                           config_file_len
                                                          =
                                                          strlen(CONFIG_FILE_PREFIX)
                                                          +
                                                          strlen(buf.release)
                                                          + 1;<br>
                                                          +     
                                                           (void)strlcpy(config_file,
CONFIG_FILE_PREFIX, config_file_len);<br>
                                                          +     
                                                           (void)strlcat(config_file,
                                                          buf.release,
                                                          config_file_len);<br>
                                                          +<br>
                                                          +     
                                                           config_list =
fwts_file_open_and_read(config_file);<br>
                                                          +       if
                                                          (config_list
                                                          == NULL)<br>
                                                          +             
                                                           return false;<br>
                                                          +<br>
                                                          +     
                                                           fwts_list_foreach(item,
                                                          config_list) {<br>
                                                          +             
                                                           /* check
                                                          built-in, i.e.
                                                          =y */<br>
                                                          +             
 (void)strlcpy(config_str, config, config_str_len);<br>
                                                          +             
 (void)strlcat(config_str, "=y", config_str_len);<br>
                                                          +             
                                                           if
                                                          (!strncmp(fwts_text_list_text(item),
                                                          config_str,
                                                          strlen(config_str)))
                                                          {<br>
                                                          +             
                                                                 
                                                           fwts_list_free(config_list,
                                                          free);<br>
                                                          +             
                                                                 
                                                           return true;<br>
                                                          +             
                                                           }<br>
                                                          +<br>
                                                          +             
                                                           /* check
                                                          module, i.e.
                                                          =m */<br>
                                                          +             
 config_str[strlen(config_str) - 1] = 'm';<br>
                                                          +             
                                                           if
                                                          (!strncmp(fwts_text_list_text(item),
                                                          config_str,
                                                          strlen(config_str)))
                                                          {<br>
                                                          +             
                                                                 
                                                           fwts_list_free(config_list,
                                                          free);<br>
                                                          +             
                                                                 
                                                           return true;<br>
                                                          +             
                                                           }<br>
                                                          +       }<br>
                                                          +<br>
                                                          +     
                                                           fwts_list_free(config_list,
                                                          free);<br>
                                                          +       return
                                                          false;<br>
                                                          +}<br>
                                                          --<br>
                                                          2.32.0<br>
                                                          <br>
                                                          <br>
                                                          --<br>
                                                          fwts-devel
                                                          mailing list<br>
                                                          <a
                                                          href="mailto:fwts-devel@lists.ubuntu.com"
target="_blank" moz-do-not-send="true" class="moz-txt-link-freetext">fwts-devel@lists.ubuntu.com</a><br>
                                                          Modify
                                                          settings or
                                                          unsubscribe
                                                          at: <a
                                                          href="https://lists.ubuntu.com/mailman/listinfo/fwts-devel"
target="_blank" moz-do-not-send="true" class="moz-txt-link-freetext">
https://lists.ubuntu.com/mailman/listinfo/fwts-devel</a><br>
                                                          IMPORTANT
                                                          NOTICE: The
                                                          contents of
                                                          this email and
                                                          any
                                                          attachments
                                                          are
                                                          confidential
                                                          and may also
                                                          be privileged.
                                                          If you are not
                                                          the intended
                                                          recipient,
                                                          please notify
                                                          the sender
                                                          immediately
                                                          and do not
                                                          disclose the
                                                          contents to
                                                          any other
                                                          person, use it
                                                          for any
                                                          purpose, or
                                                          store or copy
                                                          the
                                                          information in
                                                          any medium.
                                                          Thank you.<o:p></o:p></p>
                                                          </blockquote>
                                                          </div>
                                                          <p
                                                          class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><br
                                                          clear="all">
                                                          <br>
                                                          -- <o:p></o:p></p>
                                                          <div>
                                                          <div>
                                                          <p
                                                          class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Cheers,<br>
                                                          Alex Hung<o:p></o:p></p>
                                                          </div>
                                                          </div>
                                                        </div>
                                                      </blockquote>
                                                    </div>
                                                    <p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><br
                                                        clear="all">
                                                      <br>
                                                      -- <o:p></o:p></p>
                                                    <div>
                                                      <div>
                                                        <p
                                                          class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Cheers,<br>
                                                          Alex Hung<o:p></o:p></p>
                                                      </div>
                                                    </div>
                                                  </div>
                                                  <p class="MsoNormal"
                                                    style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">IMPORTANT
                                                    NOTICE: The contents
                                                    of this email and
                                                    any attachments are
                                                    confidential and may
                                                    also be privileged.
                                                    If you are not the
                                                    intended recipient,
                                                    please notify the
                                                    sender immediately
                                                    and do not disclose
                                                    the contents to any
                                                    other person, use it
                                                    for any purpose, or
                                                    store or copy the
                                                    information in any
                                                    medium. Thank you.
                                                    <o:p></o:p></p>
                                                </div>
                                              </blockquote>
                                            </div>
                                            <p class="MsoNormal"
                                              style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><br
                                                clear="all">
                                              <br>
                                              -- <o:p></o:p></p>
                                            <div>
                                              <div>
                                                <p class="MsoNormal"
                                                  style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Cheers,<br>
                                                  Alex Hung<o:p></o:p></p>
                                              </div>
                                            </div>
                                          </div>
                                        </div>
                                        <p class="MsoNormal"
                                          style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">IMPORTANT
                                          NOTICE: The contents of this
                                          email and any attachments are
                                          confidential and may also be
                                          privileged. If you are not the
                                          intended recipient, please
                                          notify the sender immediately
                                          and do not disclose the
                                          contents to any other person,
                                          use it for any purpose, or
                                          store or copy the information
                                          in any medium. Thank you.
                                          <o:p></o:p></p>
                                      </div>
                                    </blockquote>
                                  </div>
                                  <p class="MsoNormal"
                                    style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><br
                                      clear="all">
                                    <br>
                                    -- <o:p></o:p></p>
                                  <div>
                                    <div>
                                      <p class="MsoNormal"
                                        style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Cheers,<br>
                                        Alex Hung<o:p></o:p></p>
                                    </div>
                                  </div>
                                </div>
                              </div>
                              <p class="MsoNormal"
                                style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">IMPORTANT
                                NOTICE: The contents of this email and
                                any attachments are confidential and may
                                also be privileged. If you are not the
                                intended recipient, please notify the
                                sender immediately and do not disclose
                                the contents to any other person, use it
                                for any purpose, or store or copy the
                                information in any medium. Thank you.
                                <o:p></o:p></p>
                            </div>
                          </blockquote>
                        </div>
                        <p class="MsoNormal"
                          style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><br
                            clear="all">
                          <br>
                          -- <o:p></o:p></p>
                        <div>
                          <div>
                            <p class="MsoNormal"
                              style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Cheers,<br>
                              Alex Hung<o:p></o:p></p>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                  <p class="MsoNormal">IMPORTANT NOTICE: The contents of
                    this email and any attachments are confidential and
                    may also be privileged. If you are not the intended
                    recipient, please notify the sender immediately and
                    do not disclose the contents to any other person,
                    use it for any purpose, or store or copy the
                    information in any medium. Thank you.
                    <o:p></o:p></p>
                </div>
              </blockquote>
            </div>
            <p class="MsoNormal"><br clear="all">
              <br>
              -- <o:p></o:p></p>
            <div>
              <div>
                <p class="MsoNormal">Cheers,<br>
                  Alex Hung<o:p></o:p></p>
              </div>
            </div>
          </div>
        </div>
      </div>
      IMPORTANT NOTICE: The contents of this email and any attachments
      are confidential and may also be privileged. If you are not the
      intended recipient, please notify the sender immediately and do
      not disclose the contents to any other person, use it for any
      purpose, or store or copy the information in any medium. Thank
      you.
    </blockquote>
  </body>
</html>