[
  {
    "path": ".github/workflows/build-test-deploy.yml",
    "content": "name: yocto-container build and test\non:\n  push:\n    branches:\n      - master\n  pull_request:\n\n  # Allow for manually running\n  workflow_dispatch:\n\n  # Run at 00:52 UTC every Saturday\n  schedule:\n    - cron: '52 0 * * 6'\n\njobs:\n  build-test-deploy:\n    runs-on: ubuntu-latest\n    permissions:\n      packages: write\n    strategy:\n      fail-fast: false\n      matrix:\n        distro_to_build: [\n          alma-8,\n          alma-9,\n          debian-10,\n          debian-11,\n          debian-12,\n          fedora-39,\n          fedora-40,\n          opensuse-15.4,\n          opensuse-15.5,\n          opensuse-15.6,\n          ubuntu-18.04,\n          ubuntu-20.04,\n          ubuntu-22.04,\n          ubuntu-24.04\n        ]\n        targetplatform: [\n          linux/amd64\n        ]\n    env:\n      DISTRO_TO_BUILD: ${{ matrix.distro_to_build }}\n      TARGETPLATFORM: ${{ matrix.targetplatform }}\n      REPO: crops/yocto\n      DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}\n      DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}\n      GHCR_USERNAME: ${{ github.actor }}\n      GHCR_PASSWORD: ${{ secrets.GITHUB_TOKEN }}\n\n    steps:\n      - uses: actions/checkout@v4\n\n      # Build and test the images\n      - name: Run build-and-test.sh\n        run: ./build_container.sh\n\n      # Deploy the images\n      - name: Deploy\n        if: ${{ env.DOCKER_PASSWORD != '' && env.GHCR_PASSWORD != '' }}\n        run: ./deploy.sh\n"
  },
  {
    "path": ".gitignore",
    "content": "dockerfiles/*/*/*-builder/Dockerfile\n*.pyc\n*.pyo\n*.orig\n*.rej\n*~\n"
  },
  {
    "path": "COPYING",
    "content": "                    GNU GENERAL PUBLIC LICENSE\n                       Version 2, June 1991\n\n Copyright (C) 1989, 1991 Free Software Foundation, Inc.,\n 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n                            Preamble\n\n  The licenses for most software are designed to take away your\nfreedom to share and change it.  By contrast, the GNU General Public\nLicense is intended to guarantee your freedom to share and change free\nsoftware--to make sure the software is free for all its users.  This\nGeneral Public License applies to most of the Free Software\nFoundation's software and to any other program whose authors commit to\nusing it.  (Some other Free Software Foundation software is covered by\nthe GNU Lesser General Public License instead.)  You can apply it to\nyour programs, too.\n\n  When we speak of free software, we are referring to freedom, not\nprice.  Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthis service if you wish), that you receive source code or can get it\nif you want it, that you can change the software or use pieces of it\nin new free programs; and that you know you can do these things.\n\n  To protect your rights, we need to make restrictions that forbid\nanyone to deny you these rights or to ask you to surrender the rights.\nThese restrictions translate to certain responsibilities for you if you\ndistribute copies of the software, or if you modify it.\n\n  For example, if you distribute copies of such a program, whether\ngratis or for a fee, you must give the recipients all the rights that\nyou have.  You must make sure that they, too, receive or can get the\nsource code.  And you must show them these terms so they know their\nrights.\n\n  We protect your rights with two steps: (1) copyright the software, and\n(2) offer you this license which gives you legal permission to copy,\ndistribute and/or modify the software.\n\n  Also, for each author's protection and ours, we want to make certain\nthat everyone understands that there is no warranty for this free\nsoftware.  If the software is modified by someone else and passed on, we\nwant its recipients to know that what they have is not the original, so\nthat any problems introduced by others will not reflect on the original\nauthors' reputations.\n\n  Finally, any free program is threatened constantly by software\npatents.  We wish to avoid the danger that redistributors of a free\nprogram will individually obtain patent licenses, in effect making the\nprogram proprietary.  To prevent this, we have made it clear that any\npatent must be licensed for everyone's free use or not licensed at all.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.\n\n                    GNU GENERAL PUBLIC LICENSE\n   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\n\n  0. This License applies to any program or other work which contains\na notice placed by the copyright holder saying it may be distributed\nunder the terms of this General Public License.  The \"Program\", below,\nrefers to any such program or work, and a \"work based on the Program\"\nmeans either the Program or any derivative work under copyright law:\nthat is to say, a work containing the Program or a portion of it,\neither verbatim or with modifications and/or translated into another\nlanguage.  (Hereinafter, translation is included without limitation in\nthe term \"modification\".)  Each licensee is addressed as \"you\".\n\nActivities other than copying, distribution and modification are not\ncovered by this License; they are outside its scope.  The act of\nrunning the Program is not restricted, and the output from the Program\nis covered only if its contents constitute a work based on the\nProgram (independent of having been made by running the Program).\nWhether that is true depends on what the Program does.\n\n  1. You may copy and distribute verbatim copies of the Program's\nsource code as you receive it, in any medium, provided that you\nconspicuously and appropriately publish on each copy an appropriate\ncopyright notice and disclaimer of warranty; keep intact all the\nnotices that refer to this License and to the absence of any warranty;\nand give any other recipients of the Program a copy of this License\nalong with the Program.\n\nYou may charge a fee for the physical act of transferring a copy, and\nyou may at your option offer warranty protection in exchange for a fee.\n\n  2. You may modify your copy or copies of the Program or any portion\nof it, thus forming a work based on the Program, and copy and\ndistribute such modifications or work under the terms of Section 1\nabove, provided that you also meet all of these conditions:\n\n    a) You must cause the modified files to carry prominent notices\n    stating that you changed the files and the date of any change.\n\n    b) You must cause any work that you distribute or publish, that in\n    whole or in part contains or is derived from the Program or any\n    part thereof, to be licensed as a whole at no charge to all third\n    parties under the terms of this License.\n\n    c) If the modified program normally reads commands interactively\n    when run, you must cause it, when started running for such\n    interactive use in the most ordinary way, to print or display an\n    announcement including an appropriate copyright notice and a\n    notice that there is no warranty (or else, saying that you provide\n    a warranty) and that users may redistribute the program under\n    these conditions, and telling the user how to view a copy of this\n    License.  (Exception: if the Program itself is interactive but\n    does not normally print such an announcement, your work based on\n    the Program is not required to print an announcement.)\n\nThese requirements apply to the modified work as a whole.  If\nidentifiable sections of that work are not derived from the Program,\nand can be reasonably considered independent and separate works in\nthemselves, then this License, and its terms, do not apply to those\nsections when you distribute them as separate works.  But when you\ndistribute the same sections as part of a whole which is a work based\non the Program, the distribution of the whole must be on the terms of\nthis License, whose permissions for other licensees extend to the\nentire whole, and thus to each and every part regardless of who wrote it.\n\nThus, it is not the intent of this section to claim rights or contest\nyour rights to work written entirely by you; rather, the intent is to\nexercise the right to control the distribution of derivative or\ncollective works based on the Program.\n\nIn addition, mere aggregation of another work not based on the Program\nwith the Program (or with a work based on the Program) on a volume of\na storage or distribution medium does not bring the other work under\nthe scope of this License.\n\n  3. You may copy and distribute the Program (or a work based on it,\nunder Section 2) in object code or executable form under the terms of\nSections 1 and 2 above provided that you also do one of the following:\n\n    a) Accompany it with the complete corresponding machine-readable\n    source code, which must be distributed under the terms of Sections\n    1 and 2 above on a medium customarily used for software interchange; or,\n\n    b) Accompany it with a written offer, valid for at least three\n    years, to give any third party, for a charge no more than your\n    cost of physically performing source distribution, a complete\n    machine-readable copy of the corresponding source code, to be\n    distributed under the terms of Sections 1 and 2 above on a medium\n    customarily used for software interchange; or,\n\n    c) Accompany it with the information you received as to the offer\n    to distribute corresponding source code.  (This alternative is\n    allowed only for noncommercial distribution and only if you\n    received the program in object code or executable form with such\n    an offer, in accord with Subsection b above.)\n\nThe source code for a work means the preferred form of the work for\nmaking modifications to it.  For an executable work, complete source\ncode means all the source code for all modules it contains, plus any\nassociated interface definition files, plus the scripts used to\ncontrol compilation and installation of the executable.  However, as a\nspecial exception, the source code distributed need not include\nanything that is normally distributed (in either source or binary\nform) with the major components (compiler, kernel, and so on) of the\noperating system on which the executable runs, unless that component\nitself accompanies the executable.\n\nIf distribution of executable or object code is made by offering\naccess to copy from a designated place, then offering equivalent\naccess to copy the source code from the same place counts as\ndistribution of the source code, even though third parties are not\ncompelled to copy the source along with the object code.\n\n  4. You may not copy, modify, sublicense, or distribute the Program\nexcept as expressly provided under this License.  Any attempt\notherwise to copy, modify, sublicense or distribute the Program is\nvoid, and will automatically terminate your rights under this License.\nHowever, parties who have received copies, or rights, from you under\nthis License will not have their licenses terminated so long as such\nparties remain in full compliance.\n\n  5. You are not required to accept this License, since you have not\nsigned it.  However, nothing else grants you permission to modify or\ndistribute the Program or its derivative works.  These actions are\nprohibited by law if you do not accept this License.  Therefore, by\nmodifying or distributing the Program (or any work based on the\nProgram), you indicate your acceptance of this License to do so, and\nall its terms and conditions for copying, distributing or modifying\nthe Program or works based on it.\n\n  6. Each time you redistribute the Program (or any work based on the\nProgram), the recipient automatically receives a license from the\noriginal licensor to copy, distribute or modify the Program subject to\nthese terms and conditions.  You may not impose any further\nrestrictions on the recipients' exercise of the rights granted herein.\nYou are not responsible for enforcing compliance by third parties to\nthis License.\n\n  7. If, as a consequence of a court judgment or allegation of patent\ninfringement or for any other reason (not limited to patent issues),\nconditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot\ndistribute so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you\nmay not distribute the Program at all.  For example, if a patent\nlicense would not permit royalty-free redistribution of the Program by\nall those who receive copies directly or indirectly through you, then\nthe only way you could satisfy both it and this License would be to\nrefrain entirely from distribution of the Program.\n\nIf any portion of this section is held invalid or unenforceable under\nany particular circumstance, the balance of the section is intended to\napply and the section as a whole is intended to apply in other\ncircumstances.\n\nIt is not the purpose of this section to induce you to infringe any\npatents or other property right claims or to contest validity of any\nsuch claims; this section has the sole purpose of protecting the\nintegrity of the free software distribution system, which is\nimplemented by public license practices.  Many people have made\ngenerous contributions to the wide range of software distributed\nthrough that system in reliance on consistent application of that\nsystem; it is up to the author/donor to decide if he or she is willing\nto distribute software through any other system and a licensee cannot\nimpose that choice.\n\nThis section is intended to make thoroughly clear what is believed to\nbe a consequence of the rest of this License.\n\n  8. If the distribution and/or use of the Program is restricted in\ncertain countries either by patents or by copyrighted interfaces, the\noriginal copyright holder who places the Program under this License\nmay add an explicit geographical distribution limitation excluding\nthose countries, so that distribution is permitted only in or among\ncountries not thus excluded.  In such case, this License incorporates\nthe limitation as if written in the body of this License.\n\n  9. The Free Software Foundation may publish revised and/or new versions\nof the General Public License from time to time.  Such new versions will\nbe similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\nEach version is given a distinguishing version number.  If the Program\nspecifies a version number of this License which applies to it and \"any\nlater version\", you have the option of following the terms and conditions\neither of that version or of any later version published by the Free\nSoftware Foundation.  If the Program does not specify a version number of\nthis License, you may choose any version ever published by the Free Software\nFoundation.\n\n  10. If you wish to incorporate parts of the Program into other free\nprograms whose distribution conditions are different, write to the author\nto ask for permission.  For software which is copyrighted by the Free\nSoftware Foundation, write to the Free Software Foundation; we sometimes\nmake exceptions for this.  Our decision will be guided by the two goals\nof preserving the free status of all derivatives of our free software and\nof promoting the sharing and reuse of software generally.\n\n                            NO WARRANTY\n\n  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY\nFOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN\nOTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES\nPROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED\nOR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\nMERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS\nTO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE\nPROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,\nREPAIR OR CORRECTION.\n\n  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR\nREDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,\nINCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING\nOUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED\nTO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY\nYOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER\nPROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE\nPOSSIBILITY OF SUCH DAMAGES.\n\n                     END OF TERMS AND CONDITIONS\n\n            How to Apply These Terms to Your New Programs\n\n  If you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\n  To do so, attach the following notices to the program.  It is safest\nto attach them to the start of each source file to most effectively\nconvey the exclusion of warranty; and each file should have at least\nthe \"copyright\" line and a pointer to where the full notice is found.\n\n    <one line to give the program's name and a brief idea of what it does.>\n    Copyright (C) <year>  <name of author>\n\n    This program is free software; you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation; either version 2 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License along\n    with this program; if not, write to the Free Software Foundation, Inc.,\n    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\n\nAlso add information on how to contact you by electronic and paper mail.\n\nIf the program is interactive, make it output a short notice like this\nwhen it starts in an interactive mode:\n\n    Gnomovision version 69, Copyright (C) year name of author\n    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\n    This is free software, and you are welcome to redistribute it\n    under certain conditions; type `show c' for details.\n\nThe hypothetical commands `show w' and `show c' should show the appropriate\nparts of the General Public License.  Of course, the commands you use may\nbe called something other than `show w' and `show c'; they could even be\nmouse-clicks or menu items--whatever suits your program.\n\nYou should also get your employer (if you work as a programmer) or your\nschool, if any, to sign a \"copyright disclaimer\" for the program, if\nnecessary.  Here is a sample; alter the names:\n\n  Yoyodyne, Inc., hereby disclaims all copyright interest in the program\n  `Gnomovision' (which makes passes at compilers) written by James Hacker.\n\n  <signature of Ty Coon>, 1 April 1989\n  Ty Coon, President of Vice\n\nThis General Public License does not permit incorporating your program into\nproprietary programs.  If your program is a subroutine library, you may\nconsider it more useful to permit linking proprietary applications with the\nlibrary.  If this is what you want to do, use the GNU Lesser General\nPublic License instead of this License.\n"
  },
  {
    "path": "LICENSE",
    "content": "                    GNU GENERAL PUBLIC LICENSE\n                       Version 2, June 1991\n\n Copyright (C) 1989, 1991 Free Software Foundation, Inc.,\n 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n                            Preamble\n\n  The licenses for most software are designed to take away your\nfreedom to share and change it.  By contrast, the GNU General Public\nLicense is intended to guarantee your freedom to share and change free\nsoftware--to make sure the software is free for all its users.  This\nGeneral Public License applies to most of the Free Software\nFoundation's software and to any other program whose authors commit to\nusing it.  (Some other Free Software Foundation software is covered by\nthe GNU Lesser General Public License instead.)  You can apply it to\nyour programs, too.\n\n  When we speak of free software, we are referring to freedom, not\nprice.  Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthis service if you wish), that you receive source code or can get it\nif you want it, that you can change the software or use pieces of it\nin new free programs; and that you know you can do these things.\n\n  To protect your rights, we need to make restrictions that forbid\nanyone to deny you these rights or to ask you to surrender the rights.\nThese restrictions translate to certain responsibilities for you if you\ndistribute copies of the software, or if you modify it.\n\n  For example, if you distribute copies of such a program, whether\ngratis or for a fee, you must give the recipients all the rights that\nyou have.  You must make sure that they, too, receive or can get the\nsource code.  And you must show them these terms so they know their\nrights.\n\n  We protect your rights with two steps: (1) copyright the software, and\n(2) offer you this license which gives you legal permission to copy,\ndistribute and/or modify the software.\n\n  Also, for each author's protection and ours, we want to make certain\nthat everyone understands that there is no warranty for this free\nsoftware.  If the software is modified by someone else and passed on, we\nwant its recipients to know that what they have is not the original, so\nthat any problems introduced by others will not reflect on the original\nauthors' reputations.\n\n  Finally, any free program is threatened constantly by software\npatents.  We wish to avoid the danger that redistributors of a free\nprogram will individually obtain patent licenses, in effect making the\nprogram proprietary.  To prevent this, we have made it clear that any\npatent must be licensed for everyone's free use or not licensed at all.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.\n\n                    GNU GENERAL PUBLIC LICENSE\n   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\n\n  0. This License applies to any program or other work which contains\na notice placed by the copyright holder saying it may be distributed\nunder the terms of this General Public License.  The \"Program\", below,\nrefers to any such program or work, and a \"work based on the Program\"\nmeans either the Program or any derivative work under copyright law:\nthat is to say, a work containing the Program or a portion of it,\neither verbatim or with modifications and/or translated into another\nlanguage.  (Hereinafter, translation is included without limitation in\nthe term \"modification\".)  Each licensee is addressed as \"you\".\n\nActivities other than copying, distribution and modification are not\ncovered by this License; they are outside its scope.  The act of\nrunning the Program is not restricted, and the output from the Program\nis covered only if its contents constitute a work based on the\nProgram (independent of having been made by running the Program).\nWhether that is true depends on what the Program does.\n\n  1. You may copy and distribute verbatim copies of the Program's\nsource code as you receive it, in any medium, provided that you\nconspicuously and appropriately publish on each copy an appropriate\ncopyright notice and disclaimer of warranty; keep intact all the\nnotices that refer to this License and to the absence of any warranty;\nand give any other recipients of the Program a copy of this License\nalong with the Program.\n\nYou may charge a fee for the physical act of transferring a copy, and\nyou may at your option offer warranty protection in exchange for a fee.\n\n  2. You may modify your copy or copies of the Program or any portion\nof it, thus forming a work based on the Program, and copy and\ndistribute such modifications or work under the terms of Section 1\nabove, provided that you also meet all of these conditions:\n\n    a) You must cause the modified files to carry prominent notices\n    stating that you changed the files and the date of any change.\n\n    b) You must cause any work that you distribute or publish, that in\n    whole or in part contains or is derived from the Program or any\n    part thereof, to be licensed as a whole at no charge to all third\n    parties under the terms of this License.\n\n    c) If the modified program normally reads commands interactively\n    when run, you must cause it, when started running for such\n    interactive use in the most ordinary way, to print or display an\n    announcement including an appropriate copyright notice and a\n    notice that there is no warranty (or else, saying that you provide\n    a warranty) and that users may redistribute the program under\n    these conditions, and telling the user how to view a copy of this\n    License.  (Exception: if the Program itself is interactive but\n    does not normally print such an announcement, your work based on\n    the Program is not required to print an announcement.)\n\nThese requirements apply to the modified work as a whole.  If\nidentifiable sections of that work are not derived from the Program,\nand can be reasonably considered independent and separate works in\nthemselves, then this License, and its terms, do not apply to those\nsections when you distribute them as separate works.  But when you\ndistribute the same sections as part of a whole which is a work based\non the Program, the distribution of the whole must be on the terms of\nthis License, whose permissions for other licensees extend to the\nentire whole, and thus to each and every part regardless of who wrote it.\n\nThus, it is not the intent of this section to claim rights or contest\nyour rights to work written entirely by you; rather, the intent is to\nexercise the right to control the distribution of derivative or\ncollective works based on the Program.\n\nIn addition, mere aggregation of another work not based on the Program\nwith the Program (or with a work based on the Program) on a volume of\na storage or distribution medium does not bring the other work under\nthe scope of this License.\n\n  3. You may copy and distribute the Program (or a work based on it,\nunder Section 2) in object code or executable form under the terms of\nSections 1 and 2 above provided that you also do one of the following:\n\n    a) Accompany it with the complete corresponding machine-readable\n    source code, which must be distributed under the terms of Sections\n    1 and 2 above on a medium customarily used for software interchange; or,\n\n    b) Accompany it with a written offer, valid for at least three\n    years, to give any third party, for a charge no more than your\n    cost of physically performing source distribution, a complete\n    machine-readable copy of the corresponding source code, to be\n    distributed under the terms of Sections 1 and 2 above on a medium\n    customarily used for software interchange; or,\n\n    c) Accompany it with the information you received as to the offer\n    to distribute corresponding source code.  (This alternative is\n    allowed only for noncommercial distribution and only if you\n    received the program in object code or executable form with such\n    an offer, in accord with Subsection b above.)\n\nThe source code for a work means the preferred form of the work for\nmaking modifications to it.  For an executable work, complete source\ncode means all the source code for all modules it contains, plus any\nassociated interface definition files, plus the scripts used to\ncontrol compilation and installation of the executable.  However, as a\nspecial exception, the source code distributed need not include\nanything that is normally distributed (in either source or binary\nform) with the major components (compiler, kernel, and so on) of the\noperating system on which the executable runs, unless that component\nitself accompanies the executable.\n\nIf distribution of executable or object code is made by offering\naccess to copy from a designated place, then offering equivalent\naccess to copy the source code from the same place counts as\ndistribution of the source code, even though third parties are not\ncompelled to copy the source along with the object code.\n\n  4. You may not copy, modify, sublicense, or distribute the Program\nexcept as expressly provided under this License.  Any attempt\notherwise to copy, modify, sublicense or distribute the Program is\nvoid, and will automatically terminate your rights under this License.\nHowever, parties who have received copies, or rights, from you under\nthis License will not have their licenses terminated so long as such\nparties remain in full compliance.\n\n  5. You are not required to accept this License, since you have not\nsigned it.  However, nothing else grants you permission to modify or\ndistribute the Program or its derivative works.  These actions are\nprohibited by law if you do not accept this License.  Therefore, by\nmodifying or distributing the Program (or any work based on the\nProgram), you indicate your acceptance of this License to do so, and\nall its terms and conditions for copying, distributing or modifying\nthe Program or works based on it.\n\n  6. Each time you redistribute the Program (or any work based on the\nProgram), the recipient automatically receives a license from the\noriginal licensor to copy, distribute or modify the Program subject to\nthese terms and conditions.  You may not impose any further\nrestrictions on the recipients' exercise of the rights granted herein.\nYou are not responsible for enforcing compliance by third parties to\nthis License.\n\n  7. If, as a consequence of a court judgment or allegation of patent\ninfringement or for any other reason (not limited to patent issues),\nconditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot\ndistribute so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you\nmay not distribute the Program at all.  For example, if a patent\nlicense would not permit royalty-free redistribution of the Program by\nall those who receive copies directly or indirectly through you, then\nthe only way you could satisfy both it and this License would be to\nrefrain entirely from distribution of the Program.\n\nIf any portion of this section is held invalid or unenforceable under\nany particular circumstance, the balance of the section is intended to\napply and the section as a whole is intended to apply in other\ncircumstances.\n\nIt is not the purpose of this section to induce you to infringe any\npatents or other property right claims or to contest validity of any\nsuch claims; this section has the sole purpose of protecting the\nintegrity of the free software distribution system, which is\nimplemented by public license practices.  Many people have made\ngenerous contributions to the wide range of software distributed\nthrough that system in reliance on consistent application of that\nsystem; it is up to the author/donor to decide if he or she is willing\nto distribute software through any other system and a licensee cannot\nimpose that choice.\n\nThis section is intended to make thoroughly clear what is believed to\nbe a consequence of the rest of this License.\n\n  8. If the distribution and/or use of the Program is restricted in\ncertain countries either by patents or by copyrighted interfaces, the\noriginal copyright holder who places the Program under this License\nmay add an explicit geographical distribution limitation excluding\nthose countries, so that distribution is permitted only in or among\ncountries not thus excluded.  In such case, this License incorporates\nthe limitation as if written in the body of this License.\n\n  9. The Free Software Foundation may publish revised and/or new versions\nof the General Public License from time to time.  Such new versions will\nbe similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\nEach version is given a distinguishing version number.  If the Program\nspecifies a version number of this License which applies to it and \"any\nlater version\", you have the option of following the terms and conditions\neither of that version or of any later version published by the Free\nSoftware Foundation.  If the Program does not specify a version number of\nthis License, you may choose any version ever published by the Free Software\nFoundation.\n\n  10. If you wish to incorporate parts of the Program into other free\nprograms whose distribution conditions are different, write to the author\nto ask for permission.  For software which is copyrighted by the Free\nSoftware Foundation, write to the Free Software Foundation; we sometimes\nmake exceptions for this.  Our decision will be guided by the two goals\nof preserving the free status of all derivatives of our free software and\nof promoting the sharing and reuse of software generally.\n\n                            NO WARRANTY\n\n  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY\nFOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN\nOTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES\nPROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED\nOR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\nMERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS\nTO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE\nPROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,\nREPAIR OR CORRECTION.\n\n  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR\nREDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,\nINCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING\nOUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED\nTO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY\nYOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER\nPROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE\nPOSSIBILITY OF SUCH DAMAGES.\n\n                     END OF TERMS AND CONDITIONS\n\n            How to Apply These Terms to Your New Programs\n\n  If you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\n  To do so, attach the following notices to the program.  It is safest\nto attach them to the start of each source file to most effectively\nconvey the exclusion of warranty; and each file should have at least\nthe \"copyright\" line and a pointer to where the full notice is found.\n\n    <one line to give the program's name and a brief idea of what it does.>\n    Copyright (C) <year>  <name of author>\n\n    This program is free software; you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation; either version 2 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License along\n    with this program; if not, write to the Free Software Foundation, Inc.,\n    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\n\nAlso add information on how to contact you by electronic and paper mail.\n\nIf the program is interactive, make it output a short notice like this\nwhen it starts in an interactive mode:\n\n    Gnomovision version 69, Copyright (C) year name of author\n    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\n    This is free software, and you are welcome to redistribute it\n    under certain conditions; type `show c' for details.\n\nThe hypothetical commands `show w' and `show c' should show the appropriate\nparts of the General Public License.  Of course, the commands you use may\nbe called something other than `show w' and `show c'; they could even be\nmouse-clicks or menu items--whatever suits your program.\n\nYou should also get your employer (if you work as a programmer) or your\nschool, if any, to sign a \"copyright disclaimer\" for the program, if\nnecessary.  Here is a sample; alter the names:\n\n  Yoyodyne, Inc., hereby disclaims all copyright interest in the program\n  `Gnomovision' (which makes passes at compilers) written by James Hacker.\n\n  <signature of Ty Coon>, 1 April 1989\n  Ty Coon, President of Vice\n\nThis General Public License does not permit incorporating your program into\nproprietary programs.  If your program is a subroutine library, you may\nconsider it more useful to permit linking proprietary applications with the\nlibrary.  If this is what you want to do, use the GNU Lesser General\nPublic License instead of this License.\n"
  },
  {
    "path": "README.md",
    "content": "# yocto-docker\n"
  },
  {
    "path": "build-install-dumb-init.sh",
    "content": "#!/bin/bash\n\n# build-install-dumb-init.sh\n#\n# Copyright (C) 2017-2021 Intel Corporation\n#\n# SPDX-License-Identifier: GPL-2.0-only\n#\n\nset -x\n\nbuilddir=`mktemp -d` || exit 1\ncd $builddir || exit 1\n\nif grep -q Alma /etc/*release; then\n    INSTALL_CMD=\"dnf -y install glibc-static\"\n    REMOVE_CMD=\"dnf -y remove glibc-static\"\nelif grep -q CentOS /etc/*release; then\n    INSTALL_CMD=\"yum -y install glibc-static\"\n    REMOVE_CMD=\"yum -y remove glibc-static\"\nelif grep -q Fedora /etc/*release; then\n    INSTALL_CMD=\"dnf -y install glibc-static\"\n    REMOVE_CMD=\"dnf -y remove glibc-static\"\nelif grep -q Ubuntu /etc/*release || grep -q Debian /etc/*release; then\n    INSTALL_CMD=\"\"\n    REMOVE_CMD=\"\"\nelif grep -q openSUSE /etc/*release; then\n    INSTALL_CMD=\"zypper --non-interactive install glibc-devel-static\"\n    REMOVE_CMD=\"zypper --non-interactive remove glibc-devel-static\"\nelse\n    exit 1\nfi\n\nwget https://github.com/Yelp/dumb-init/archive/v1.2.5.tar.gz || exit 1\necho \"3eda470d8a4a89123f4516d26877a727c0945006c8830b7e3bad717a5f6efc4e  v1.2.5.tar.gz\" > sha256sums || exit 1\n\nsha256sum -c sha256sums || exit 1\ntar xf v1.2.5.tar.gz || exit 1\n# https://github.com/Yelp/dumb-init/issues/273\nsed -i '128 i \\ \\ \\ \\ packages=[],' dumb-init*/setup.py || exit 1\n# https://github.com/Yelp/dumb-init/issues/286\necho py >> dumb-init*/requirements-dev.txt\n\n# Replace the versions of python used for testing dumb-init. Since it is\n# testing c code, and not python it shouldn't matter. Also remove the\n# pre-commit test from the test rule because we don't care.\nsed -i -e 's/envlist = .*/envlist = py3/' dumb-init*/tox.ini || exit 1\nsed -i -e 's/tox -e pre-commit//' dumb-init*/Makefile || exit 1\n\n$INSTALL_CMD || exit 1\n\nvirtualenv $builddir/venv || exit 1\n. $builddir/venv/bin/activate || exit 1\npip3 install setuptools tox || exit 1\n\n. $builddir/venv/bin/activate || exit 1\ncd dumb-init* || exit 1\nmake dumb-init || exit 1\nmake test || exit 1\n\ncp dumb-init /usr/bin/dumb-init || exit 1\nchmod +x /usr/bin/dumb-init || exit 1\n\nrm $builddir -rf || exit 1\n# Really this should be an exit 1 as well if it fails, but for some reason\n# on travis, for fedora it consistently says that it cannot acquire the\n# the transaction lock.\n$REMOVE_CMD || exit 0\n"
  },
  {
    "path": "build_container.sh",
    "content": "#!/bin/bash\n\n# build-container.sh\n#\n# Copyright (C) 2016-2021 Intel Corporation\n#\n# SPDX-License-Identifier: GPL-2.0-only\n#\n\nset -e\n\n# Allow the user to specify another command to use for building such as podman\nif [ \"${ENGINE_CMD}\" = \"\" ]; then\n    ENGINE_CMD=\"docker\"\nfi\n\n# DISTRO_TO_BUILD is essentially the prefix to the \"base\" and \"builder\"\n# directories you plan to use. i.e. \"fedora-23\" or \"ubuntu-16.04\"\n\n# First build the base\nTAG=$DISTRO_TO_BUILD-base\ndockerdir=`find -name $TAG`\nworkdir=`mktemp --tmpdir -d tmp-$TAG.XXX`\n\ncp -r $dockerdir $workdir\nworkdir=$workdir/$TAG\n\ncp build-install-dumb-init.sh $workdir\ncp install-buildtools.sh $workdir\ncp install-buildtools-make.sh $workdir\ncd $workdir\n\nbaseimage=`grep FROM Dockerfile | sed -e 's/FROM //'`\n${ENGINE_CMD} pull $baseimage\n\n${ENGINE_CMD} build \\\n       --build-arg TARGETPLATFORM=$TARGETPLATFORM \\\n       --build-arg http_proxy=$http_proxy \\\n       --build-arg HTTP_PROXY=$http_proxy \\\n       --build-arg https_proxy=$https_proxy \\\n       --build-arg HTTPS_PROXY=$https_proxy \\\n       --build-arg no_proxy=$no_proxy \\\n       --build-arg NO_PROXY=$no_proxy \\\n       -t $REPO:$TAG .\nrm $workdir -rf\ncd -\n\n# Now build the builder. We copy things to a temporary directory so that we\n# can modify the Dockerfile to use whatever REPO is in the environment.\nTAG=$DISTRO_TO_BUILD-builder\nworkdir=`mktemp --tmpdir -d tmp-$TAG.XXX`\n\n# use the builder template to populate the distro specific Dockerfile\ncp dockerfiles/templates/Dockerfile.builder $workdir/Dockerfile\ncp distro-entry.sh $workdir\nsed -i \"s/DISTRO_TO_BUILD/$DISTRO_TO_BUILD/g\" $workdir/Dockerfile\n\ncp helpers/runbitbake.py $workdir\ncd $workdir\n\n# Replace the rewitt/yocto repo with the one from environment\nsed -i -e \"s#crops/yocto#$REPO#\" Dockerfile\n\n# Lastly build the image\n${ENGINE_CMD} build \\\n       --build-arg TARGETPLATFORM=$TARGETPLATFORM \\\n       --build-arg http_proxy=$http_proxy \\\n       --build-arg HTTP_PROXY=$http_proxy \\\n       --build-arg https_proxy=$https_proxy \\\n       --build-arg HTTPS_PROXY=$https_proxy \\\n       --build-arg no_proxy=$no_proxy \\\n       --build-arg NO_PROXY=$no_proxy \\\n       -t $REPO:$TAG .\ncd -\n\n# base tests\nENGINE_CMD=${ENGINE_CMD} \\\n    ./tests/container/vnc-test.sh $REPO:$DISTRO_TO_BUILD-base\n# builder tests\nENGINE_CMD=${ENGINE_CMD} \\\n    ./tests/container/smoke.sh $REPO:$DISTRO_TO_BUILD-builder\n\nrm $workdir -rf\n"
  },
  {
    "path": "buildall.sh",
    "content": "#!/bin/bash\n\n# Copyright (C) 2016-2021 Intel Corporation\n#\n# SPDX-License-Identifier: GPL-2.0-only\n#\n\nPIDS=()\n# some systems do not have enough tty's available to run all the\n# dumbinit tests in parallel. If the tty tests are failing try\n# setting SERIAL_BUILD=1\nif [ \"$SERIAL_BUILD\" == \"\" ]; then\n    SERIAL_BUILD=0\nfi\ntrap cleanup SIGINT SIGTERM ERR\nfunction cleanup () {\n    # Since we're calling kill again on the entire process group make sure\n    # to not recurse into cleanup() by disabling the trap on SIGTERM.\n    trap - SIGTERM\n    kill -- -$$\n\n    exit 1\n}\n\nbuild_image() {\n    OUTPUTDIR=$1\n    REPO=$2\n    DISTRO_TO_BUILD=$3\n    TMPDIR=$OUTPUTDIR REPO=$REPO \\\n        DISTRO_TO_BUILD=$DISTRO_TO_BUILD \\\n        bash -c \"$build_cont . >& \\\n                    $OUTPUTDIR/build.log || \\\n                    echo \\\"$DISTRO_TO_BUILD build failed\\\"\"\n}\n\nfunction build_images {\n    PIDS=()\n    localrepo=$2\n    tmpdir=$(mktemp --tmpdir -d tmp-buildall.XXX)\n\n    echo \"Building REPO=$REPO in $tmpdir\"\n\n    for i in $1; do\n        DISTRO_TO_BUILD=$(basename $i)\n        OUTPUTDIR=$tmpdir/$DISTRO_TO_BUILD\n        mkdir $OUTPUTDIR\n\n        echo \"Building $DISTRO_TO_BUILD\"\n\n        if [ $SERIAL_BUILD == \"0\" ]; then\n            build_image $OUTPUTDIR $REPO $DISTRO_TO_BUILD &\n        else\n            build_image $OUTPUTDIR $REPO $DISTRO_TO_BUILD\n        fi\n        PIDS=( ${PIDS[@]} $! )\n    done\n}\n\nfunction waitforimages {\n    numpids=${#PIDS[@]}\n    while [ $numpids -gt 0 ]; do\n        echo \"waiting for $numpids images to be built\"\n        wait -n\n        if [ $? -ne 0 ]; then\n            cleanup\n        fi\n        numpids=$((numpids-1))\n    done\n}\n\n\nset -e\n\nSCRIPTDIR=\"$( cd \"$( dirname \"${BASH_SOURCE[0]}\" )\" && pwd )\"\ncd $SCRIPTDIR\n\nif [ \"x\" = \"x$REPO\" ]; then\n    # Create a uid for the repo so we don't overwrite any user images\n    REPO=$(uuidgen)-yocto-docker-test\nfi\n\nbuild_cont=`readlink -f ./build_container.sh`\n\nDIRS=$(readlink -f $(dirname $(dirname $(find -path '*base/Dockerfile'))))\nbuild_images \"$DIRS\"\nwaitforimages\n"
  },
  {
    "path": "deploy.sh",
    "content": "#!/bin/bash\n# Copyright (C) 2016-2021 Intel Corporation\n# Copyright (C) 2022 Konsulko Group\n#\n# SPDX-License-Identifier: GPL-2.0-only\n#\n# This script is meant to be consumed by travis. It's very simple but running\n# a loop in travis.yml isn't a great thing.\nset -e\n\n# Allow the user to specify another command to use for building such as podman\nif [ \"${ENGINE_CMD}\" = \"\" ]; then\n    ENGINE_CMD=\"docker\"\nfi\n\n# Don't deploy on pull requests because it could just be junk code that won't\n# get merged\nif ([ \"${GITHUB_EVENT_NAME}\" = \"push\" ] || [ \"${GITHUB_EVENT_NAME}\" = \"workflow_dispatch\" ] || [ \"${GITHUB_EVENT_NAME}\"  = \"schedule\" ])  && [ \"${GITHUB_REF}\" = \"refs/heads/master\" ]; then\n    echo $DOCKER_PASSWORD | ${ENGINE_CMD} login -u $DOCKER_USERNAME --password-stdin\n    ${ENGINE_CMD} push $REPO:$DISTRO_TO_BUILD-base\n    ${ENGINE_CMD} push $REPO:$DISTRO_TO_BUILD-builder\n\n    ${ENGINE_CMD} tag $REPO:$DISTRO_TO_BUILD-base ghcr.io/$REPO:$DISTRO_TO_BUILD-base\n    ${ENGINE_CMD} tag $REPO:$DISTRO_TO_BUILD-builder ghcr.io/$REPO:$DISTRO_TO_BUILD-builder\n\n    echo $GHCR_PASSWORD | ${ENGINE_CMD} login ghcr.io -u $GHCR_USERNAME --password-stdin\n    ${ENGINE_CMD} push ghcr.io/$REPO:$DISTRO_TO_BUILD-base\n    ${ENGINE_CMD} push ghcr.io/$REPO:$DISTRO_TO_BUILD-builder\nfi\n"
  },
  {
    "path": "distro-entry.sh",
    "content": "#!/bin/bash\n# Copyright (C) 2019-2021 Intel Corporation\n#\n# SPDX-License-Identifier: GPL-2.0-only\n#\n\nRELEASE=\"4.1\"\n\nif [ \"$(uname -m)\" = \"aarch64\" ]; then\n    SETUPSCRIPT=\"environment-setup-aarch64-pokysdk-linux\"\nelif [ \"$(uname -m)\" = \"x86_64\" ]; then\n    SETUPSCRIPT=\"environment-setup-x86_64-pokysdk-linux\"\nfi\n\n# This entry point is so that we can do distro specific changes to the launch.\nif [ -e /opt/poky/${RELEASE}/${SETUPSCRIPT} ]; then\n    # Buildtools has been installed so enable it\n    . /opt/poky/${RELEASE}/${SETUPSCRIPT} || exit 1\nelif [ -e /opt/poky/${RELEASE}/${SETUPSCRIPT} ]; then\n    # Buildtools(-make) has been installed so enable it\n    . /opt/poky/${RELEASE}/${SETUPSCRIPT} || exit 1\nfi\n\nexec \"$@\"\n"
  },
  {
    "path": "dockerfiles/alma/alma-8/alma-8-base/Dockerfile",
    "content": "# alama-8-base\n# Copyright (C) 2015-2020 Intel Corporation\n# Copyright (C) 2022 Konsulko Group\n#\n# SPDX-License-Identifier: GPL-2.0-only\n#\n\nFROM almalinux:8\n\nRUN dnf install -y 'dnf-command(config-manager)' && \\\n    dnf config-manager --set-enabled powertools && \\\n    dnf -y install epel-release && \\\n    dnf -y update && \\\n    dnf -y install \\\n        bzip2 \\\n        ccache \\\n        chrpath \\\n        cpio \\\n        cpp \\\n        diffstat \\\n        diffutils \\\n        file \\\n        gawk \\\n        gcc \\\n        gcc-c++ \\\n        git \\\n        glibc-devel \\\n        glibc-langpack-en \\\n        gzip \\\n        lz4 \\\n        make \\\n        patch \\\n        perl \\\n        perl-Data-Dumper \\\n        perl-Text-ParseWords \\\n        perl-Thread-Queue \\\n        procps \\\n        python3 \\\n        python3-GitPython \\\n        python3-jinja2 \\\n        python3-pexpect \\\n        python3-pip \\\n        python3-virtualenv \\\n        rpcgen \\\n        socat \\\n        subversion \\\n        sudo \\\n        tar \\\n        texinfo \\\n        tigervnc-server \\\n        tmux \\\n        unzip \\\n        wget \\\n        which \\\n        xz \\\n        zstd && \\\n    cp -af /etc/skel/ /etc/vncskel/ && \\\n    echo \"export DISPLAY=1\" >>/etc/vncskel/.bashrc && \\\n    mkdir  /etc/vncskel/.vnc && \\\n    echo \"\" | vncpasswd -f > /etc/vncskel/.vnc/passwd && \\\n    chmod 0600 /etc/vncskel/.vnc/passwd && \\\n    groupadd -g 1000 yoctouser && \\\n    useradd -u 1000 -g yoctouser -m yoctouser\n\n# Install buildtools. The original reason this was needed was due to a\n# sanity check for make 4.1.2, but now we're relying on python-3.8 so instead\n# of -make, install all the buildtools\n\nCOPY install-buildtools.sh /\nRUN bash /install-buildtools.sh && \\\n    rm /install-buildtools.sh\n\nCOPY build-install-dumb-init.sh /\nRUN  bash build-install-dumb-init.sh && \\\n     rm /build-install-dumb-init.sh && \\\n     dnf -y clean all\n\nUSER yoctouser\nWORKDIR /home/yoctouser\nCMD /bin/bash\n"
  },
  {
    "path": "dockerfiles/alma/alma-9/alma-9-base/Dockerfile",
    "content": "# alama-9-base\n# Copyright (C) 2015-2020 Intel Corporation\n# Copyright (C) 2022 Konsulko Group\n#\n# SPDX-License-Identifier: GPL-2.0-only\n#\n\nFROM almalinux:9\n\nRUN dnf install -y 'dnf-command(config-manager)' && \\\n    dnf config-manager --set-enabled crb && \\\n    dnf -y install epel-release && \\\n    dnf -y update && \\\n    dnf -y install \\\n        bzip2 \\\n        ccache \\\n        chrpath \\\n        cpio \\\n        cpp \\\n        diffstat \\\n        diffutils \\\n        file \\\n        gawk \\\n        gcc \\\n        gcc-c++ \\\n        git \\\n        glibc-devel \\\n        glibc-langpack-en \\\n        gzip \\\n        lz4 \\\n        make \\\n        patch \\\n        perl \\\n        perl-Data-Dumper \\\n        perl-Text-ParseWords \\\n        perl-Thread-Queue \\\n        procps \\\n        python3 \\\n        python3-GitPython \\\n        python3-jinja2 \\\n        python3-pexpect \\\n        python3-pip \\\n        python3-virtualenv \\\n        rpcgen \\\n        socat \\\n        subversion \\\n        sudo \\\n        tar \\\n        texinfo \\\n        tigervnc-server \\\n        tmux \\\n        unzip \\\n        wget \\\n        which \\\n        xz \\\n        zstd && \\\n    cp -af /etc/skel/ /etc/vncskel/ && \\\n    echo \"export DISPLAY=1\" >>/etc/vncskel/.bashrc && \\\n    mkdir  /etc/vncskel/.vnc && \\\n    echo \"\" | vncpasswd -f > /etc/vncskel/.vnc/passwd && \\\n    chmod 0600 /etc/vncskel/.vnc/passwd && \\\n    groupadd -g 1000 yoctouser && \\\n    useradd -u 1000 -g yoctouser -m yoctouser\n\n# Install buildtools-make. The original reason this was needed was due to a\n# sanity check for make 4.1.2\nCOPY install-buildtools-make.sh /\nRUN bash /install-buildtools-make.sh && \\\n    rm /install-buildtools-make.sh\n\nCOPY build-install-dumb-init.sh /\nRUN  bash build-install-dumb-init.sh && \\\n     rm /build-install-dumb-init.sh && \\\n     dnf -y clean all\n\nUSER yoctouser\nWORKDIR /home/yoctouser\nCMD /bin/bash\n"
  },
  {
    "path": "dockerfiles/debian/debian-10/debian-10-base/Dockerfile",
    "content": "# debian-10-base\n# Copyright (C) 2015-2021 Intel Corporation\n#\n# SPDX-License-Identifier: GPL-2.0-only\n#\n\nFROM debian:10\n\nARG TARGETPLATFORM\n\nRUN apt-get clean && \\\n    apt-get update && \\\n    DEBIAN_FRONTEND=noninteractive apt-get install -y \\\n        build-essential \\\n        chrpath \\\n        cpio \\\n        diffstat \\\n        fluxbox \\\n        gawk \\\n        git-core \\\n        locales \\\n        lz4 \\\n        procps \\\n        python \\\n        python-virtualenv \\\n        python3 \\\n        python3-pip \\\n        python3-virtualenv \\\n        screen \\\n        socat \\\n        subversion \\\n        sudo \\\n        sysstat \\\n        texinfo \\\n        tightvncserver \\\n        tmux \\\n        unzip \\\n        wget \\\n        xz-utils \\\n        zstd && \\\n    case ${TARGETPLATFORM} in \\\n        \"linux/amd64\") \\\n            DEBIAN_FRONTEND=noninteractive apt-get install -y \\\n                gcc-multilib \\\n                g++-multilib \\\n            ;; \\\n    esac && \\\n    cp -af /etc/skel/ /etc/vncskel/ && \\\n    echo \"export DISPLAY=1\" >>/etc/vncskel/.bashrc && \\\n    mkdir  /etc/vncskel/.vnc && \\\n    echo \"\" | vncpasswd -f > /etc/vncskel/.vnc/passwd && \\\n    chmod 0600 /etc/vncskel/.vnc/passwd && \\\n    useradd -U -m yoctouser && \\\n    echo 'en_US.UTF-8 UTF-8' >> /etc/locale.gen && locale-gen\n\n# Install buildtools. The original reason this was needed was due to a\n# sanity check for make 4.1.2, but now we're relying on python-3.8 so instead\n# of -make, install all the buildtools\n\nCOPY install-buildtools.sh /\nRUN bash /install-buildtools.sh && \\\n    rm /install-buildtools.sh\n\nCOPY build-install-dumb-init.sh /\nRUN  bash /build-install-dumb-init.sh && \\\n     rm /build-install-dumb-init.sh && \\\n     apt-get clean\n\nUSER yoctouser\nWORKDIR /home/yoctouser\nCMD /bin/bash\n"
  },
  {
    "path": "dockerfiles/debian/debian-11/debian-11-base/Dockerfile",
    "content": "# debian-11-base\n# Copyright (C) 2015-2021 Intel Corporation\n#\n# SPDX-License-Identifier: GPL-2.0-only\n#\n\nFROM debian:11\n\nARG TARGETPLATFORM\n\nRUN apt-get clean && \\\n    apt-get update && \\\n    DEBIAN_FRONTEND=noninteractive apt-get install -y \\\n        build-essential \\\n        chrpath \\\n        cpio \\\n        diffstat \\\n        fluxbox \\\n        gawk \\\n        git-core \\\n        locales \\\n        lz4 \\\n        procps \\\n        python \\\n        python3 \\\n        python3-pip \\\n        python3-virtualenv \\\n        screen \\\n        socat \\\n        subversion \\\n        sudo \\\n        sysstat \\\n        texinfo \\\n        tightvncserver \\\n        tmux \\\n        unzip \\\n        wget \\\n        xz-utils \\\n        zstd && \\\n    case ${TARGETPLATFORM} in \\\n        \"linux/amd64\") \\\n            DEBIAN_FRONTEND=noninteractive apt-get install -y \\\n                gcc-multilib \\\n                g++-multilib \\\n            ;; \\\n    esac && \\\n    cp -af /etc/skel/ /etc/vncskel/ && \\\n    echo \"export DISPLAY=1\" >>/etc/vncskel/.bashrc && \\\n    mkdir  /etc/vncskel/.vnc && \\\n    echo \"\" | vncpasswd -f > /etc/vncskel/.vnc/passwd && \\\n    chmod 0600 /etc/vncskel/.vnc/passwd && \\\n    useradd -U -m yoctouser && \\\n    echo 'en_US.UTF-8 UTF-8' >> /etc/locale.gen && locale-gen\n\nCOPY build-install-dumb-init.sh  /\nRUN  bash /build-install-dumb-init.sh && \\\n     rm /build-install-dumb-init.sh && \\\n     apt-get clean\n\nUSER yoctouser\nWORKDIR /home/yoctouser\nCMD /bin/bash\n"
  },
  {
    "path": "dockerfiles/debian/debian-12/debian-12-base/Dockerfile",
    "content": "# debian-12-base\n# Copyright (C) 2015-2021 Intel Corporation\n#\n# SPDX-License-Identifier: GPL-2.0-only\n#\n\nFROM debian:12\n\nARG TARGETPLATFORM\n\nRUN apt-get clean && \\\n    apt-get update && \\\n    DEBIAN_FRONTEND=noninteractive apt-get install -y \\\n        build-essential \\\n        chrpath \\\n        cpio \\\n        diffstat \\\n        file \\\n        fluxbox \\\n        gawk \\\n        git-core \\\n        locales \\\n        lz4 \\\n        procps \\\n        python3 \\\n        python3-pip \\\n        python3-virtualenv \\\n        screen \\\n        socat \\\n        subversion \\\n        sudo \\\n        sysstat \\\n        texinfo \\\n        tightvncserver \\\n        tmux \\\n        unzip \\\n        wget \\\n        xz-utils \\\n        zstd && \\\n    case ${TARGETPLATFORM} in \\\n        \"linux/amd64\") \\\n            DEBIAN_FRONTEND=noninteractive apt-get install -y \\\n                gcc-multilib \\\n                g++-multilib \\\n            ;; \\\n    esac && \\\n    cp -af /etc/skel/ /etc/vncskel/ && \\\n    echo \"export DISPLAY=1\" >>/etc/vncskel/.bashrc && \\\n    mkdir  /etc/vncskel/.vnc && \\\n    echo \"\" | vncpasswd -f > /etc/vncskel/.vnc/passwd && \\\n    chmod 0600 /etc/vncskel/.vnc/passwd && \\\n    useradd -U -m yoctouser && \\\n    echo 'en_US.UTF-8 UTF-8' >> /etc/locale.gen && locale-gen\n\nCOPY build-install-dumb-init.sh  /\nRUN  bash /build-install-dumb-init.sh && \\\n     rm /build-install-dumb-init.sh && \\\n     apt-get clean\n\nUSER yoctouser\nWORKDIR /home/yoctouser\nCMD /bin/bash\n"
  },
  {
    "path": "dockerfiles/fedora/fedora-39/fedora-39-base/Dockerfile",
    "content": "# fedora-39-base\n# Copyright (C) 2021 Intel Corporation\n# Copyright (C) 2021-2024 Konsulko Group\n#\n# SPDX-License-Identifier: GPL-2.0-only\n#\n\nFROM fedora:39\n\nRUN dnf -y update && \\\n    dnf -y install \\\n\t# These packages were copied straight from the Yocto Project reference\n        # manual which is why they are not alphabetized\n        gawk \\\n        make \\\n        wget \\\n        tar \\\n        bzip2 \\\n        gzip \\\n        python3 \\\n        unzip \\\n        perl \\\n        patch \\\n        diffutils \\\n        diffstat \\\n        git \\\n        cpp \\\n        gcc \\\n        gcc-c++ \\\n        glibc-devel \\\n        texinfo \\\n        chrpath \\\n        ccache \\\n        perl-Data-Dumper \\\n        perl-Text-ParseWords \\\n        perl-Thread-Queue \\\n        perl-bignum \\\n        socat \\\n        python3-pexpect \\\n        findutils \\\n        which \\\n        file \\\n        cpio \\\n        python3-pip \\\n        xz \\\n        python3-GitPython \\\n        python3-jinja2 \\\n        python3-virtualenv \\\n        SDL-devel \\\n        xterm \\\n        rpcgen \\\n\tlz4 \\\n\tzstd \\\n        \\\n        # These packages were added because of reasons such as fewer packages\n        # being in the container image by default\n        fluxbox \\\n        glibc-langpack-en \\\n        hostname \\\n        procps \\\n        python-unversioned-command \\\n        subversion \\\n        sudo \\\n        screen \\\n        tigervnc-server \\\n        tmux && \\\n    cp -af /etc/skel/ /etc/vncskel/ && \\\n    echo \"export DISPLAY=1\" >>/etc/vncskel/.bashrc && \\\n    mkdir  /etc/vncskel/.vnc && \\\n    echo \"\" | vncpasswd -f > /etc/vncskel/.vnc/passwd && \\\n    chmod 0600 /etc/vncskel/.vnc/passwd && \\\n    useradd -U -m yoctouser\n\nCOPY build-install-dumb-init.sh /\nRUN  bash /build-install-dumb-init.sh && \\\n     rm /build-install-dumb-init.sh && \\\n     dnf -y clean all\n\nUSER yoctouser\nWORKDIR /home/yoctouser\nCMD /bin/bash\n"
  },
  {
    "path": "dockerfiles/fedora/fedora-40/fedora-40-base/Dockerfile",
    "content": "# fedora-40-base\n# Copyright (C) 2021 Intel Corporation\n# Copyright (C) 2021-2024 Konsulko Group\n#\n# SPDX-License-Identifier: GPL-2.0-only\n#\n\nFROM fedora:40\n\nRUN dnf -y update && \\\n    dnf -y install \\\n\t# These packages were copied straight from the Yocto Project reference\n        # manual which is why they are not alphabetized\n        gawk \\\n        make \\\n        wget \\\n        tar \\\n        bzip2 \\\n        gzip \\\n        python3 \\\n        unzip \\\n        perl \\\n        patch \\\n        diffutils \\\n        diffstat \\\n        git \\\n        cpp \\\n        gcc \\\n        gcc-c++ \\\n        glibc-devel \\\n        texinfo \\\n        chrpath \\\n        ccache \\\n        perl-Data-Dumper \\\n        perl-Text-ParseWords \\\n        perl-Thread-Queue \\\n        perl-bignum \\\n        socat \\\n        python3-pexpect \\\n        findutils \\\n        which \\\n        file \\\n        cpio \\\n        python3-pip \\\n        xz \\\n        python3-GitPython \\\n        python3-jinja2 \\\n        python3-virtualenv \\\n        SDL-devel \\\n        xterm \\\n        rpcgen \\\n\tlz4 \\\n\tzstd \\\n        \\\n        # These packages were added because of reasons such as fewer packages\n        # being in the container image by default\n        fluxbox \\\n        glibc-langpack-en \\\n        hostname \\\n        procps \\\n        python-unversioned-command \\\n        subversion \\\n        sudo \\\n        screen \\\n        tigervnc-server \\\n        tmux && \\\n    cp -af /etc/skel/ /etc/vncskel/ && \\\n    echo \"export DISPLAY=1\" >>/etc/vncskel/.bashrc && \\\n    mkdir  /etc/vncskel/.vnc && \\\n    echo \"\" | vncpasswd -f > /etc/vncskel/.vnc/passwd && \\\n    chmod 0600 /etc/vncskel/.vnc/passwd && \\\n    useradd -U -m yoctouser\n\n# Install buildtools for wget\n\nCOPY install-buildtools.sh /\nRUN bash /install-buildtools.sh && \\\n    rm /install-buildtools.sh\n\nCOPY build-install-dumb-init.sh /\nRUN  bash /build-install-dumb-init.sh && \\\n     rm /build-install-dumb-init.sh && \\\n     dnf -y clean all\n\nUSER yoctouser\nWORKDIR /home/yoctouser\nCMD /bin/bash\n"
  },
  {
    "path": "dockerfiles/opensuse/opensuse-15.4/opensuse-15.4-base/Dockerfile",
    "content": "# opensuse-15.4-base\n# Copyright (C) 2015-2020 Intel Corporation\n# Copyright (C) 2022 Konsulko Group\n#\n# SPDX-License-Identifier: GPL-2.0-only\n##\n\nFROM opensuse/leap:15.4\n\n# Keep these in alphabetical order, as sorted by vim :sort\nRUN zypper --non-interactive install \\\n                   bzip2 \\\n                   chrpath \\\n                   diffstat \\\n                   gcc \\\n                   gcc-c++ \\\n                   git \\\n                   glibc-locale \\\n                   gzip \\\n                   iproute2 \\\n                   libSDL-devel \\\n                   lz4 \\\n                   make \\\n                   makeinfo \\\n                   net-tools \\\n                   patch \\\n                   python \\\n                   python-curses \\\n                   python-xml \\\n                   python3 \\\n\t\t   python3-Jinja2 \\\n                   python3-curses \\\n\t\t   python3-pexpect \\\n\t\t   python3-pip \\\n                   python3-virtualenv \\\n                   rpcgen \\\n                   socat \\\n                   subversion \\\n                   sudo \\\n                   tar \\\n                   wget \\\n                   xorg-x11-Xvnc \\\n                   xz \\\n                   zstd && \\\n    cp -af /etc/skel/ /etc/vncskel/ && \\\n    echo \"export DISPLAY=1\" >>/etc/vncskel/.bashrc && \\\n    mkdir  /etc/vncskel/.vnc && \\\n    echo \"\" | vncpasswd -f > /etc/vncskel/.vnc/passwd && \\\n    chmod 0600 /etc/vncskel/.vnc/passwd && \\\n    useradd -U -m yoctouser\n\n# Install buildtools. The original reason this was needed was due to a\n# sanity check for make 4.1.2, but now we're relying on python-3.8 so instead\n# of -make, install all the buildtools\n\nCOPY install-buildtools.sh /\nRUN bash /install-buildtools.sh && \\\n    rm /install-buildtools.sh\n\nCOPY build-install-dumb-init.sh /\nRUN  bash /build-install-dumb-init.sh && \\\n     rm /build-install-dumb-init.sh\n\nUSER yoctouser\nWORKDIR /home/yoctouser\nCMD /bin/bash\n"
  },
  {
    "path": "dockerfiles/opensuse/opensuse-15.5/opensuse-15.5-base/Dockerfile",
    "content": "# opensuse-15.5-base\n# Copyright (C) 2015-2020 Intel Corporation\n# Copyright (C) 2022-2024 Konsulko Group\n#\n# SPDX-License-Identifier: GPL-2.0-only\n##\n\nFROM opensuse/leap:15.5\n\n# Keep these in alphabetical order, as sorted by vim :sort\nRUN zypper --non-interactive install \\\n                   bzip2 \\\n                   chrpath \\\n                   diffstat \\\n                   gcc \\\n                   gcc-c++ \\\n                   git \\\n                   glibc-locale \\\n                   gzip \\\n                   iproute2 \\\n                   libSDL-devel \\\n                   lz4 \\\n                   make \\\n                   makeinfo \\\n                   net-tools \\\n                   patch \\\n                   python3 \\\n                   python3-Jinja2 \\\n                   python3-curses \\\n                   python3-pexpect \\\n                   python3-pip \\\n                   python3-virtualenv \\\n                   rpcgen \\\n                   socat \\\n                   subversion \\\n                   sudo \\\n                   tar \\\n                   wget \\\n                   xorg-x11-Xvnc \\\n                   xz \\\n                   zstd && \\\n    cp -af /etc/skel/ /etc/vncskel/ && \\\n    echo \"export DISPLAY=1\" >>/etc/vncskel/.bashrc && \\\n    mkdir  /etc/vncskel/.vnc && \\\n    echo \"\" | vncpasswd -f > /etc/vncskel/.vnc/passwd && \\\n    chmod 0600 /etc/vncskel/.vnc/passwd && \\\n    useradd -U -m yoctouser\n\n# Install buildtools. The original reason this was needed was due to a\n# sanity check for make 4.1.2, but now we're relying on python-3.8 so instead\n# of -make, install all the buildtools\n\nCOPY install-buildtools.sh /\nRUN bash /install-buildtools.sh && \\\n    rm /install-buildtools.sh\n\nCOPY build-install-dumb-init.sh /\nRUN  bash /build-install-dumb-init.sh && \\\n     rm /build-install-dumb-init.sh\n\nUSER yoctouser\nWORKDIR /home/yoctouser\nCMD /bin/bash\n"
  },
  {
    "path": "dockerfiles/opensuse/opensuse-15.6/opensuse-15.6-base/Dockerfile",
    "content": "# opensuse-15.6-base\n# Copyright (C) 2015-2020 Intel Corporation\n# Copyright (C) 2022-2024 Konsulko Group\n#\n# SPDX-License-Identifier: GPL-2.0-only\n##\n\nFROM opensuse/leap:15.6\n\n# Keep these in alphabetical order, as sorted by vim :sort\nRUN zypper --non-interactive install \\\n                   bzip2 \\\n                   chrpath \\\n                   diffstat \\\n                   gcc \\\n                   gcc-c++ \\\n                   git \\\n                   glibc-locale \\\n                   gzip \\\n                   hostname \\\n                   iproute2 \\\n                   libacl1 \\\n                   lz4 \\\n                   make \\\n                   makeinfo \\\n                   net-tools \\\n                   patch \\\n                   python3 \\\n                   python3-Jinja2 \\\n                   python3-curses \\\n                   python3-pexpect \\\n                   python3-pip \\\n                   python3-virtualenv \\\n                   rpcgen \\\n                   socat \\\n                   subversion \\\n                   sudo \\\n                   tar \\\n                   wget \\\n                   xorg-x11-Xvnc \\\n                   xz \\\n                   zstd && \\\n    cp -af /etc/skel/ /etc/vncskel/ && \\\n    echo \"export DISPLAY=1\" >>/etc/vncskel/.bashrc && \\\n    mkdir  /etc/vncskel/.vnc && \\\n    echo \"\" | vncpasswd -f > /etc/vncskel/.vnc/passwd && \\\n    chmod 0600 /etc/vncskel/.vnc/passwd && \\\n    useradd -U -m yoctouser\n\n# Install buildtools. The original reason this was needed was due to a\n# sanity check for make 4.1.2, but now we're relying on python-3.8 so instead\n# of -make, install all the buildtools\n\nCOPY install-buildtools.sh /\nRUN bash /install-buildtools.sh && \\\n    rm /install-buildtools.sh\n\nCOPY build-install-dumb-init.sh /\nRUN  bash /build-install-dumb-init.sh && \\\n     rm /build-install-dumb-init.sh\n\nUSER yoctouser\nWORKDIR /home/yoctouser\nCMD /bin/bash\n"
  },
  {
    "path": "dockerfiles/templates/Dockerfile.builder",
    "content": "# DISTRO_TO_BUILD-builder\n# Copyright (C) 2015-2021 Intel Corporation\n#\n# SPDX-License-Identifier: GPL-2.0-only\n#\n\nFROM crops/yocto:DISTRO_TO_BUILD-base\n\nUSER root\nCOPY distro-entry.sh runbitbake.py /usr/local/bin/\nRUN chown  yoctouser:yoctouser /usr/local/bin/runbitbake.py && \\\n    chmod +x /usr/local/bin/runbitbake.py && \\\n    chmod +x /usr/local/bin/distro-entry.sh\n\nUSER yoctouser\n\nWORKDIR /home/yoctouser\nENTRYPOINT [\"/usr/local/bin/distro-entry.sh\", \"/usr/local/bin/runbitbake.py\"]\n"
  },
  {
    "path": "dockerfiles/ubuntu/ubuntu-18.04/ubuntu-18.04-base/Dockerfile",
    "content": "# ubuntu-18.04-base\n# Copyright (C) 2015-2021 Intel Corporation\n#\n# SPDX-License-Identifier: GPL-2.0-only\n#\n\nFROM ubuntu:18.04\n\nARG TARGETPLATFORM\n\nRUN apt-get update && \\\n    DEBIAN_FRONTEND=noninteractive apt-get install -y \\\n        gawk \\\n        wget \\\n        git-core \\\n        subversion \\\n        diffstat \\\n        unzip \\\n        sysstat \\\n        texinfo \\\n        build-essential \\\n        chrpath \\\n        socat \\\n        python \\\n        python-virtualenv \\\n        python3 \\\n\tpython3-pip \\\n        python3-virtualenv \\\n        xz-utils  \\\n        locales \\\n        cpio \\\n        screen \\\n        tmux \\\n        sudo \\\n        iputils-ping \\\n        iproute2 \\\n        fluxbox \\\n        tightvncserver \\\n        liblz4-tool \\\n        zstd && \\\n    case ${TARGETPLATFORM} in \\\n        \"linux/amd64\") \\\n            DEBIAN_FRONTEND=noninteractive apt-get install -y \\\n                gcc-multilib \\\n                g++-multilib \\\n            ;; \\\n    esac && \\\n    cp -af /etc/skel/ /etc/vncskel/ && \\\n    echo \"export DISPLAY=1\" >>/etc/vncskel/.bashrc && \\\n    mkdir  /etc/vncskel/.vnc && \\\n    echo \"\" | vncpasswd -f > /etc/vncskel/.vnc/passwd && \\\n    chmod 0600 /etc/vncskel/.vnc/passwd && \\\n    useradd -U -m yoctouser && \\\n    /usr/sbin/locale-gen en_US.UTF-8 && \\\n    echo 'dash dash/sh boolean false' | debconf-set-selections && \\\n    DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash\n\n# Install buildtools due to python 3.8\n\nCOPY install-buildtools.sh /\nRUN bash /install-buildtools.sh && \\\n    rm /install-buildtools.sh\n\nCOPY build-install-dumb-init.sh /\nRUN  bash /build-install-dumb-init.sh && \\\n     rm /build-install-dumb-init.sh && \\\n     apt-get clean\n\nUSER yoctouser\nWORKDIR /home/yoctouser\nCMD /bin/bash\n"
  },
  {
    "path": "dockerfiles/ubuntu/ubuntu-20.04/ubuntu-20.04-base/Dockerfile",
    "content": "# ubuntu-20.04-base\n# Copyright (C) 2020-2021 Intel Corporation\n#\n# SPDX-License-Identifier: GPL-2.0-only\n#\n\nFROM ubuntu:20.04\n\nARG TARGETPLATFORM\n\nRUN apt-get update && \\\n    DEBIAN_FRONTEND=noninteractive apt-get install -y \\\n        gawk \\\n        wget \\\n        git-core \\\n        subversion \\\n        diffstat \\\n        unzip \\\n        sysstat \\\n        texinfo \\\n        build-essential \\\n        chrpath \\\n        socat \\\n        python \\\n        python3 \\\n        python3-pip \\\n        python3-pexpect \\\n        xz-utils  \\\n        locales \\\n        cpio \\\n        screen \\\n        tmux \\\n        sudo \\\n        iputils-ping \\\n        python3-git \\\n        python3-jinja2 \\\n        python3-virtualenv \\\n        libegl1-mesa \\\n        libsdl1.2-dev \\\n        pylint3 \\\n        xterm \\\n        iproute2 \\\n        fluxbox \\\n        tightvncserver \\\n        lz4 \\\n        zstd && \\\n    case ${TARGETPLATFORM} in \\\n        \"linux/amd64\") \\\n            DEBIAN_FRONTEND=noninteractive apt-get install -y \\\n                gcc-multilib \\\n                g++-multilib \\\n            ;; \\\n    esac && \\\n    cp -af /etc/skel/ /etc/vncskel/ && \\\n    echo \"export DISPLAY=1\" >>/etc/vncskel/.bashrc && \\\n    mkdir  /etc/vncskel/.vnc && \\\n    echo \"\" | vncpasswd -f > /etc/vncskel/.vnc/passwd && \\\n    chmod 0600 /etc/vncskel/.vnc/passwd && \\\n    useradd -U -m yoctouser && \\\n    /usr/sbin/locale-gen en_US.UTF-8 && \\\n    echo 'dash dash/sh boolean false' | debconf-set-selections && \\\n    DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash\n\nCOPY build-install-dumb-init.sh /\nRUN  bash /build-install-dumb-init.sh && \\\n     rm /build-install-dumb-init.sh && \\\n     apt-get clean\n\nUSER yoctouser\nWORKDIR /home/yoctouser\nCMD /bin/bash\n"
  },
  {
    "path": "dockerfiles/ubuntu/ubuntu-22.04/ubuntu-22.04-base/Dockerfile",
    "content": "# ubuntu-22.04-base\n# Copyright (C) 2020-2021 Intel Corporation\n# Copyright (C) 2022 Konsulko Group\n#\n# SPDX-License-Identifier: GPL-2.0-only\n#\n\nFROM ubuntu:22.04\n\nARG TARGETPLATFORM\n\nRUN apt-get update && \\\n    DEBIAN_FRONTEND=noninteractive apt-get install -y \\\n        gawk \\\n        wget \\\n        git-core \\\n        subversion \\\n        diffstat \\\n        unzip \\\n        sysstat \\\n        texinfo \\\n        build-essential \\\n        chrpath \\\n        socat \\\n        python3 \\\n        python3-pip \\\n        python3-pexpect \\\n        python3-virtualenv \\\n        xz-utils  \\\n        locales \\\n        cpio \\\n        screen \\\n        tmux \\\n        sudo \\\n        iputils-ping \\\n        python3-git \\\n        python3-jinja2 \\\n        libegl1-mesa \\\n        libsdl1.2-dev \\\n        pylint \\\n        xterm \\\n        iproute2 \\\n        fluxbox \\\n        tightvncserver \\\n        lz4 \\\n        zstd \\\n        file && \\\n    case ${TARGETPLATFORM} in \\\n        \"linux/amd64\") \\\n            DEBIAN_FRONTEND=noninteractive apt-get install -y \\\n                gcc-multilib \\\n                g++-multilib \\\n            ;; \\\n    esac && \\\n    cp -af /etc/skel/ /etc/vncskel/ && \\\n    echo \"export DISPLAY=1\" >>/etc/vncskel/.bashrc && \\\n    mkdir  /etc/vncskel/.vnc && \\\n    echo \"\" | vncpasswd -f > /etc/vncskel/.vnc/passwd && \\\n    chmod 0600 /etc/vncskel/.vnc/passwd && \\\n    useradd -U -m yoctouser && \\\n    /usr/sbin/locale-gen en_US.UTF-8 && \\\n    echo 'dash dash/sh boolean false' | debconf-set-selections && \\\n    DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash\n\nCOPY build-install-dumb-init.sh /\nRUN  bash /build-install-dumb-init.sh && \\\n     rm /build-install-dumb-init.sh && \\\n     apt-get clean\n\nUSER yoctouser\nWORKDIR /home/yoctouser\nCMD /bin/bash\n"
  },
  {
    "path": "dockerfiles/ubuntu/ubuntu-24.04/ubuntu-24.04-base/Dockerfile",
    "content": "# ubuntu-24.04-base\n# Copyright (C) 2020-2021 Intel Corporation\n# Copyright (C) 2022-2024 Konsulko Group\n#\n# SPDX-License-Identifier: GPL-2.0-only\n#\n\nFROM ubuntu:24.04\n\nARG TARGETPLATFORM\n\nRUN apt-get update && \\\n    DEBIAN_FRONTEND=noninteractive apt-get install -y \\\n        gawk \\\n        wget \\\n        git-core \\\n        subversion \\\n        diffstat \\\n        unzip \\\n        sysstat \\\n        texinfo \\\n        build-essential \\\n        chrpath \\\n        socat \\\n        python3 \\\n        python3-pip \\\n        python3-pexpect \\\n        python3-virtualenv \\\n        xz-utils  \\\n        locales \\\n        cpio \\\n        screen \\\n        tmux \\\n        sudo \\\n        iputils-ping \\\n        python3-git \\\n        python3-jinja2 \\\n        pylint \\\n        xterm \\\n        iproute2 \\\n        fluxbox \\\n        tightvncserver \\\n        lz4 \\\n        zstd \\\n        file && \\\n    case ${TARGETPLATFORM} in \\\n        \"linux/amd64\") \\\n            DEBIAN_FRONTEND=noninteractive apt-get install -y \\\n                gcc-multilib \\\n                g++-multilib \\\n            ;; \\\n    esac && \\\n    cp -af /etc/skel/ /etc/vncskel/ && \\\n    echo \"export DISPLAY=1\" >>/etc/vncskel/.bashrc && \\\n    mkdir  /etc/vncskel/.vnc && \\\n    echo \"\" | vncpasswd -f > /etc/vncskel/.vnc/passwd && \\\n    chmod 0600 /etc/vncskel/.vnc/passwd && \\\n    useradd -U -m yoctouser && \\\n    /usr/sbin/locale-gen en_US.UTF-8 && \\\n    echo 'dash dash/sh boolean false' | debconf-set-selections && \\\n    DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash\n\nCOPY build-install-dumb-init.sh /\nRUN  bash /build-install-dumb-init.sh && \\\n     rm /build-install-dumb-init.sh && \\\n     apt-get clean\n\nUSER yoctouser\nWORKDIR /home/yoctouser\nCMD /bin/bash\n"
  },
  {
    "path": "helpers/runbitbake.py",
    "content": "#!/usr/bin/env python3\n\n# runbitbake.py\n#\n# Copyright (C) 2016-2021 Intel Corporation\n#\n# SPDX-License-Identifier: GPL-2.0-only\n#\n\nimport argparse\nimport subprocess\nimport os\nimport tempfile\nimport shutil\nimport sys\nimport signal\n\nbitbake_process = None\n\nold_handler = {}\nold_handler[str(signal.SIGINT)] = signal.getsignal(signal.SIGINT)\nold_handler[str(signal.SIGTERM)] = signal.getsignal(signal.SIGTERM)\n\n\ndef addextra(tempdir, builddir, name, extralist):\n    # If there is no extraconf there, is no reason to do any other work\n    if extralist is None:\n        return\n\n    myf = \"{}/conf/{}\".format(builddir, name)\n    myf_orig = \"{}/{}.orig\".format(tempdir, name)\n    tmpfile = \"{}/{}.orig.tmp\".format(tempdir, name)\n\n    # copy isn't atomic so make sure that orig is created atomically so that\n    # file.orig is always correct even if file gets hosed. So that\n    # means if a user ever sees file.orig, they can be assured that it\n    # is the same as the original file with no corruption.\n    shutil.copyfile(myf, tmpfile)\n    with open(tmpfile, \"r\") as f:\n        fd = f.fileno()\n        os.fdatasync(fd)\n\n    # Remember first sync the file AND directory to make sure data\n    # is written out\n    fd = os.open(os.path.dirname(tmpfile), os.O_RDONLY)\n    os.fsync(fd)\n    os.close(fd)\n\n    # Rename should be atomic with respect to disk, yes all of this assumes\n    # linux and possibly non-network filesystems.\n    os.rename(tmpfile, myf_orig)\n\n    with open(myf, \"a\") as f:\n        if extralist:\n            for conf in extralist:\n                with open(conf) as f2:\n                    content = f2.readlines()\n                for l in content:\n                    f.write(\"%s\\n\" % format(l.strip()))\n\n\ndef restore_files(tempdir, builddir, conffiles):\n    for f in conffiles:\n        dest = os.path.join(builddir, \"conf\", f)\n        src = os.path.join(tempdir, f + \".orig\")\n\n        if os.path.exists(src):\n            os.rename(src, dest)\n\n\n# If bitbake is around let it do all the signal handling\ndef handler(signum, frame):\n    if bitbake_process:\n        # SIGINT is special if there is a tty. Because with a tty SIGINT will\n        # automatically get sent to all processes in the process group. So we\n        # don't need to send it ourselves.\n        if signum == signal.SIGINT and sys.stdin.isatty():\n            pass\n        else:\n            # If there is a bitbake process we want to let it tear down all\n            # its children itself so send the signal to bitbake.\n            bitbake_process.send_signal(signum)\n    else:\n        old_handler[str(signum)](signum, frame)\n\n\nif __name__ == '__main__':\n    signal.signal(signal.SIGINT, handler)\n    signal.signal(signal.SIGTERM, handler)\n\n    parser = argparse.ArgumentParser()\n\n    parser.add_argument(\"--extraconf\", action='append', help=\"File containing\"\n                        \"extra configuration\")\n    parser.add_argument(\"--extralayers\", action='append',\n                        help=\"File containing extra bblayers\")\n\n    parser.add_argument(\"--pokydir\", default=\"/home/yoctouser/poky\",\n                        required=True, help=\"Directory containing poky\")\n    parser.add_argument(\"--target\", \"-t\", required=True,\n                        help=\"What bitbake should build\")\n    parser.add_argument(\"--builddir\", \"-b\", required=True,\n                        help=\"Directory to build in\")\n\n    args = parser.parse_args()\n\n    builddir = args.builddir\n\n    if not os.path.isdir(builddir):\n        os.makedirs(builddir)\n\n    # tempdir is a subdirectory of builddir in case builddir and local.conf\n    # already existed. Then if something goes wrong with local.conf the user\n    # can restore it by using builddir/tempdir/local.conf.orig\n    tempdir = tempfile.mkdtemp(prefix=\"runbitbake-tmpdir\", dir=builddir)\n\n    # Have to use bash since the default on ubuntu is dash which won't work\n    try:\n        cmd = 'bash -c \". {}/oe-init-build-env {}\"'.format(args.pokydir,\n                                                           builddir)\n        subprocess.check_call(cmd, stdout=sys.stdout, stderr=sys.stderr,\n                              shell=True)\n\n        try:\n            addextra(tempdir, builddir, \"local.conf\", args.extraconf)\n            addextra(tempdir, builddir, \"bblayers.conf\", args.extralayers)\n\n            cmd = 'export LANG=en_US.UTF-8 && '\n            cmd += '. {}/oe-init-build-env {} && '.format(args.pokydir,\n                                                          builddir)\n            cmd += 'exec bitbake {}'.format(args.target)\n            bitbake_process = subprocess.Popen(['/bin/bash', '-c', cmd],\n                                               stdout=sys.stdout,\n                                               stderr=sys.stderr, shell=False)\n\n            bitbake_process.wait()\n\n            if bitbake_process.returncode != 0:\n                raise subprocess.CalledProcessError(bitbake_process.returncode,\n                                                    cmd)\n        finally:\n            restore_files(tempdir, builddir, [\"local.conf\", \"bblayers.conf\"])\n\n    except subprocess.CalledProcessError as e:\n        print(e)\n        sys.exit(1)\n\n    finally:\n        shutil.rmtree(tempdir, ignore_errors=True)\n"
  },
  {
    "path": "install-buildtools-make.sh",
    "content": "#! /bin/bash\n\n# install-buildtools-make.sh\n#\n# Copyright (C) 2020-2021 Intel Corporation\n# Copyright (C) 2022 Konsulko Group\n#\n# SPDX-License-Identifier: GPL-2.0-only\n#\nset -e\n\nRELEASE=\"4.1\"\nif [ \"$(uname -m)\" = \"aarch64\" ]; then\n    BUILDTOOLS=\"aarch64-buildtools-make-nativesdk-standalone-${RELEASE}.sh\"\n    SHA256SUM=\"ed241869743ac795d1a988246953df5931f68c22108d6f86ebc485b773d28db4\"\nelif [ \"$(uname -m)\" = \"x86_64\" ]; then\n    BUILDTOOLS=\"x86_64-buildtools-make-nativesdk-standalone-${RELEASE}.sh\"\n    SHA256SUM=\"d9cc8a4f76392e23f9b2854af78d460e99bb5e4cbb82de6ccca0f6be7506f652\"\nelse\n    echo \"Unsupported architecture, can't install buildtools-make.\"\n    exit 1\nfi\n\nwget https://downloads.yoctoproject.org/releases/yocto/yocto-${RELEASE}/buildtools/${BUILDTOOLS}\n\necho \"${SHA256SUM} ${BUILDTOOLS}\" > SHA256SUMS\nsha256sum -c SHA256SUMS\nrm SHA256SUMS\n\nbash ${BUILDTOOLS} -y\nrm ${BUILDTOOLS}\n"
  },
  {
    "path": "install-buildtools.sh",
    "content": "#! /bin/bash\n\n# install-buildtools.sh\n#\n# Copyright (C) 2020-2021 Intel Corporation\n#\n# SPDX-License-Identifier: GPL-2.0-only\n#\nset -e\n\nRELEASE=\"4.1\"\nif [ \"$(uname -m)\" = \"aarch64\" ]; then\n    BUILDTOOLS=\"aarch64-buildtools-extended-nativesdk-standalone-${RELEASE}.sh\"\n    SHA256SUM=\"d5c0dd3e43c62f0465a9335f450d9f5f6861e4b3d39b0f04174bd50e6861c96e\"\nelif [ \"$(uname -m)\" = \"x86_64\" ]; then\n    BUILDTOOLS=\"x86_64-buildtools-extended-nativesdk-standalone-${RELEASE}.sh\"\n    SHA256SUM=\"d360ac01016c848f713d6dd7848f25d0a5319e96e2dd279ab37ffcbd7320dbbe\"\nelse\n    echo \"Unsupported architecture, can't install buildtools-make.\"\n    exit 1\nfi\n\nwget https://downloads.yoctoproject.org/releases/yocto/yocto-${RELEASE}/buildtools/${BUILDTOOLS}\n\necho \"${SHA256SUM} ${BUILDTOOLS}\" > SHA256SUMS\nsha256sum -c SHA256SUMS\nrm SHA256SUMS\n\nbash ${BUILDTOOLS} -y\nrm ${BUILDTOOLS}\n"
  },
  {
    "path": "tests/container/smoke.sh",
    "content": "#!/bin/bash\n\n# smoke.sh\n#\n# Copyright (C) 2016-2021 Intel Corporation\n#\n# SPDX-License-Identifier: GPL-2.0-only\n#\n\nset -e\nset -x\n\necho $USER\nid\n\nif [ \"${ENGINE_CMD}\" = \"\" ]; then\n    ENGINE_CMD=\"docker\"\nfi\n\n# Pass in the image that was built for docker\nimage=$1\nworkdir=`mktemp -d --suffix=smoke`\npokydir=/workdir/poky\nbuilddir=/workdir/build\n\n# This is to guarantee yoctouser in the container has access to workdir\nchmod -R 777 $workdir\n\n# In each instance below where docker is started, the workdir is changed to one\n# that should be accessible for the uid:gid specified. Otherwise starting the\n# container may fail.\n\n# Ensure dumb-init is installed. This is to try and catch if\n# build-install-dumb-init.sh didn't work.\n${ENGINE_CMD} run -t --rm --entrypoint=/bin/bash -u $(id -u):$(id -g) -w '/' $image -c 'ls /usr/bin/dumb-init'\n\n# Try to build quilt-native which is small and fast to build.\ngit clone --depth 1 --branch master \\\n          git://git.yoctoproject.org/poky $workdir/poky\n${ENGINE_CMD} run -t --rm -v $workdir:/workdir -u $(id -u):$(id -g) -w '/' $image --pokydir=$pokydir \\\n                  -b $builddir -t quilt-native\n\n# Since yoctouser in the container may create files that the travis user\n# can't delete, run the container again to delete the files in the directory.\n${ENGINE_CMD} run -t --rm -v $workdir:/workdir -u $(id -u):$(id -g) -w '/' --entrypoint=/bin/rm $image \\\n                  $builddir -rf\n\nrm $workdir -rf\n"
  },
  {
    "path": "tests/container/vnc-in-container-test.sh",
    "content": "#!/bin/bash\n\n# vnc-in-container.sh\n#\n# Copyright (C) 2016-2021 Intel Corporation\n#\n# SPDX-License-Identifier: GPL-2.0-only\n#\n\nset -e\nset -x\n# this runs inside the container. Returns 0 on success.\nls -al /workdir\n# make a vncuser from the skeleton\nuseradd -m --skel=/etc/vncskel vncuser\n\n# install xdpyinfo in the distros that are missing it\nif grep -q Alma /etc/*release; then\n    dnf -y install xorg-x11-utils\nelif grep -q CentOS /etc/*release; then\n    yum -y install xorg-x11-utils\n# since fedora-34, xdpyinfo is its own package\n# since fedora-35, xorg-x11-utils has been dropped\nelif grep -q Fedora /etc/*release; then\n    dnf -y install xdpyinfo\nelif grep -q Ubuntu /etc/*release || grep -q Debian /etc/*release; then\n    # Ubuntu/debian brings in xdpyinfo by default\n    true;\nelif grep -q openSUSE /etc/*release; then\n    zypper --non-interactive install xdpyinfo\nelse\n    exit 1\nfi\n\n###\n### This runs each of the following commands as the user\n### vncuser.  Note, variables from 1 line will not be available\n### for the next.\n###\nexec sudo -H -u vncuser /bin/bash - <<EOF\n\n# start the server\nXvnc -rfbport 5900 :1 >& /home/vncuser/.vnc/Xvnc.log &\nsleep 2\n\nif grep Listening  /home/vncuser/.vnc/*.log | grep 5900 ; then\necho \"port established\"\nelse\necho \"port NOT established\"\nexit 1\nfi\nDISPLAY=:1 xdpyinfo | grep \"number of screens\"\nif DISPLAY=:1 xdpyinfo | egrep -q \"number of screens\" ; then\necho \"xdpyinfo shows screens established\";\nelse\necho \"xdpyinfo shows screens NOT established\";\nexit 1\nfi\nif grep DISPLAY /home/vncuser/.bashrc; then\necho \"DISPLAY set in bashrc\"\nelse\necho \"DISPLAY NOT set in bashrc\"\nexit 1\nfi\nEOF\n"
  },
  {
    "path": "tests/container/vnc-test.sh",
    "content": "#!/bin/bash\n\n# vnc-test.sh\n#\n# Copyright (C) 2016-2021 Intel Corporation\n#\n# SPDX-License-Identifier: GPL-2.0-only\n#\n\nset -e\nset -x\n\nif [ \"${ENGINE_CMD}\" = \"\" ]; then\n    ENGINE_CMD=\"docker\"\nfi\n\n# Pass in the image that was built for docker\nimage=$1\nworkdir=`mktemp -d --suffix=vnc`\nSCRIPT_DIR=$(dirname $(readlink -f $0))\nCONTAINER_SCRIPT=vnc-in-container-test.sh\ncp $SCRIPT_DIR/$CONTAINER_SCRIPT $workdir\n\n${ENGINE_CMD} run -t --rm -v $workdir:/workdir \\\n    --entrypoint=/workdir/$CONTAINER_SCRIPT --user=root  $image\nrm $workdir -rf\n"
  },
  {
    "path": "tests/unit/signals/bitbake",
    "content": "#!/usr/bin/env python3\n\n# bitbake.py\n#\n# Copyright (C) 2016-2021 Intel Corporation\n#\n# SPDX-License-Identifier: GPL-2.0-only\n#\n# This is for testing the signal forwarding of run_bitbake. It just waits for\n# a signal and then outputs a message telling what signal it received.\n\nimport os\nimport signal\nimport sys\nimport time\n\ndef handler(signum, frame):\n    print('Handler called with signal {}'.format(signum))\n    sys.stdout.flush()\n    sys.exit(0)\n\n# Set the signal handler\nsignal.signal(signal.SIGTERM, handler)\nsignal.signal(signal.SIGINT, handler)\n\nprint('Waiting for signal')\nsys.stdout.flush()\ntime.sleep(10)\nsys.exit(1)\n"
  },
  {
    "path": "tests/unit/test_runbitbake.py",
    "content": "#!/usr/bin/env python3\n#\n# Copyright (C) 2016-2021 Intel Corporation\n#\n# SPDX-License-Identifier: GPL-2.0-only\n#\n\nimport unittest\nimport os\nimport subprocess\nimport shutil\nimport tempfile\nimport sys\nimport stat\nimport imp\nimport shlex\nimport signal\nimport pytest\n\n\nclass RunBitbakeTestBase(unittest.TestCase):\n    def setUp(self):\n        self.tempdir = tempfile.mkdtemp(prefix=\"runbitbaketest-tmpdir\")\n\n        self.pokydir = os.path.join(self.tempdir, \"poky\")\n        os.mkdir(self.pokydir)\n\n        # runbitbake.py requires --pokydir with a \"oe-init-build-env\" script\n        self.setupscript = os.path.join(self.pokydir, \"oe-init-build-env\")\n        with open(self.setupscript, \"w\"):\n            pass\n\n        # Create a builddir and confdir as if oe-init-build-env had ran\n        self.builddir = os.path.join(self.tempdir, \"build\")\n        self.confdir = os.path.join(self.builddir, \"conf\")\n        os.mkdir(self.builddir)\n        os.mkdir(self.confdir)\n\n        # Create an executable bitbake that does nothing\n        self.bindir = os.path.join(self.tempdir, \"bin\")\n        os.mkdir(self.bindir)\n\n        self.bitbake = os.path.join(self.bindir, \"bitbake\")\n        with open(self.bitbake, \"w\") as f:\n            f.write(\"#!/bin/sh\\n\")\n            os.chmod(self.bitbake, stat.S_IRWXU)\n\n        # Make sure runbitbake.py can run our fake bitbake\n        os.environ[\"PATH\"] = \"{}:{}\".format(self.bindir, os.environ[\"PATH\"])\n\n        # We will have one line local.conf and bblayers.conf.\n        self.local_conf = os.path.join(self.confdir, \"local.conf\")\n        with open(self.local_conf, \"w\") as f:\n            f.write(\"Some data\\n\")\n\n        self.bblayers_conf = os.path.join(self.confdir, \"bblayers.conf\")\n        with open(self.bblayers_conf, \"w\") as f:\n            f.write(\"Other data\\n\")\n\n        # Create the files that contain extra data to be added to the original\n        # configuration files\n        self.extraconf = os.path.join(self.tempdir, \"extra.conf\")\n        with open(self.extraconf, \"w\") as f:\n            f.write(\"MOAR STUFF\\nEVEN MOAR!!!!\\n\")\n\n        self.extralayers = os.path.join(self.tempdir, \"bblayers_extra.conf\")\n        with open(self.extralayers, \"w\") as f:\n            f.write(\"BBLAYERS MOAR STUFF\\nEVEN MOAR BBLAYERS!!!!\\n\")\n\n    def tearDown(self):\n        shutil.rmtree(self.tempdir, ignore_errors=True)\n\n\nclass ExitCodeTest(RunBitbakeTestBase):\n    def setUp(self):\n        super(ExitCodeTest, self).setUp()\n\n        # Remove the bindir from the path so we know bitbake will fail\n        self.pathorig = os.environ['PATH']\n        os.environ['PATH'] = self.pathorig.split(':', 1)[1]\n\n    def tearDown(self):\n        os.environ['PATH'] = self.pathorig\n\n    # Make sure the exitcode is nonzero if runbitbake fails\n    def test_exit_code_non_zero(self):\n        cmd = \"\"\"python helpers/runbitbake.py --pokydir={} \"\"\" \\\n              \"\"\"-t junk -b {} \"\"\".format(self.pokydir, self.builddir)\n        rc = subprocess.call(cmd.split(), shell=False)\n        self.assertNotEqual(0, rc)\n\n\nclass ConfFilesTest(RunBitbakeTestBase):\n    def setUp(self):\n        super(ConfFilesTest, self).setUp()\n\n        # These \".orig\" files are for checking that the file is restored back\n        # to the original state\n        self.local_conf_orig = os.path.join(self.tempdir, \"local.conf.orig\")\n        self.bblayers_conf_orig = os.path.join(self.tempdir,\n                                               \"bblayers.conf.orig\")\n        shutil.copyfile(self.local_conf, self.local_conf_orig)\n        shutil.copyfile(self.bblayers_conf, self.bblayers_conf_orig)\n\n    def test_files_are_restored(self):\n        cmd = \"\"\"python helpers/runbitbake.py --pokydir={} \"\"\" \\\n              \"\"\"-t junk -b {} \"\"\" \\\n              \"\"\"--extraconf={} \"\"\" \\\n              \"\"\"--extralayers={}\"\"\".format(self.pokydir, self.builddir,\n                                            self.extraconf, self.extralayers)\n\n        subprocess.call(cmd.split(), stderr=sys.stderr, stdout=sys.stdout,\n                        shell=False)\n\n        with open(self.local_conf_orig, \"r\") as f:\n            origlines = f.readlines()\n        with open(self.local_conf, \"r\") as f:\n            newlines = f.readlines()\n        self.assertListEqual(origlines, newlines)\n\n        with open(self.bblayers_conf_orig, \"r\") as f:\n            origlines = f.readlines()\n        with open(self.bblayers_conf, \"r\") as f:\n            newlines = f.readlines()\n        self.assertListEqual(origlines, newlines)\n\n\nclass AddExtraTest(RunBitbakeTestBase):\n    def setUp(self):\n        super(AddExtraTest, self).setUp()\n        # Since we are importing a file in the source directory, this prevents\n        # cluttering the directory with a .pyc file.\n        sys.dont_write_bytecode = True\n\n        self.runbitbake = os.path.join(\"helpers\", \"runbitbake.py\")\n        self.module = imp.load_source(\"\", self.runbitbake)\n\n        self.addextra_tempdir = os.path.join(self.tempdir, \"addextratmp\")\n        os.mkdir(self.addextra_tempdir)\n\n    def test_addextra_changed_files(self):\n        addextra = self.module.addextra\n        addextra(self.addextra_tempdir, self.builddir, \"local.conf\",\n                 [self.extraconf])\n\n        with open(self.extraconf, \"r\") as f:\n            extraconflines = set(f.readlines())\n        with open(self.local_conf, \"r\") as f:\n            localconflines = set(f.readlines())\n\n        intersection = extraconflines & localconflines\n        self.assertListEqual(sorted(intersection), sorted(extraconflines))\n\n\n@pytest.fixture\ndef bitbake_signal_path():\n    oldenv = os.environ.copy()\n\n    # Add the fake bitbake to path\n    os.environ['PATH'] = \"./tests/unit/signals:\" + os.environ['PATH']\n\n    yield\n\n    os.environ = oldenv\n\n\n@pytest.fixture\ndef pokydir(tmpdir):\n    # runbitbake.py requires --pokydir with a \"oe-init-build-env\" script\n    setupscript = tmpdir.mkdir(\"poky\").join(\"oe-init-build-env\")\n    with open(str(setupscript), \"w\"):\n        pass\n\n    yield tmpdir.join(\"poky\")\n\n\ntest_signal = [signal.SIGINT, signal.SIGTERM]\n\n\n@pytest.mark.parametrize(\"test_signal\", test_signal)\ndef test_signal_forward(bitbake_signal_path, tmpdir, pokydir, test_signal):\n    import time\n    cmd = \"python helpers/runbitbake.py -t foo --pokydir {} -b {}\"\n    cmd = cmd.format(pokydir, str(tmpdir))\n\n    p = subprocess.Popen(shlex.split(cmd),\n                         stdout=subprocess.PIPE,\n                         stderr=subprocess.STDOUT, shell=False,\n                         universal_newlines=True)\n\n    # Wait til program is started before sending the signal\n    count = 0\n    while count < 30:\n        stdout = p.stdout.readline()\n\n        if 'Waiting for signal' not in stdout:\n            time.sleep(1)\n            count = count + 1\n        else:\n            break\n\n    # Now that the process is running send it a signal\n    p.send_signal(test_signal)\n\n    stdout, stderr = p.communicate()\n    assert \"Handler called with signal {}\\n\".format(test_signal) == stdout\n\nif __name__ == '__main__':\n    unittest.main()\n"
  }
]