Skip to content
  1. Feb 07, 2023
  2. Jan 16, 2023
  3. Jan 11, 2023
  4. Jan 05, 2023
    • Ryan Roberts's avatar
      Merge branch 'ryarob01/io_bug' into 'main' · c058615b
      Ryan Roberts authored
      Build: Fix "ValueError: I/O operation on closed file"
      
      See merge request !5
      c058615b
    • Ryan Roberts's avatar
      Build: Fix "ValueError: I/O operation on closed file" · 64ff603c
      Ryan Roberts authored
      
      
      Very occasionally, a build would fail with the above error. The root
      cause was that neither of the output streams for a process would be
      unregistered from the selector until both had reported EOF. This means
      that one of them could be requeued after it reported EOF, while the
      second was handled and (and the first unregistered/closed as a result).
      Then we would get around to handling the first one from the queue and
      bang.
      
      Solve this by unregistering the stream from the selector as soon as it
      reports EOF. Acomplish by refactoring _proc_deactivate() into
      _proc_stream_deactivate() + _proc_deactivate(). And also simplify some
      process shutdown code since popen is doing all the stream close() calls
      for us (proven with trace).
      
      Signed-off-by: Ryan Roberts's avatarRyan Roberts <ryan.roberts@arm.com>
      64ff603c
  5. Jan 04, 2023
    • Ryan Roberts's avatar
      Merge branch 'ryarob01/ui_improvements' into 'main' · bfd07fdd
      Ryan Roberts authored
      Various UI Improvements
      
      See merge request !4
      bfd07fdd
    • Ryan Roberts's avatar
      run: Fix extra LFs and ignored CRs in output · 0bbf27d9
      Ryan Roberts authored
      
      
      We were previously converting UART output to strings using Python's
      universal newline technique, where '\r', '\n' and '\r\n' were all
      replaced with '\n'. This caused a few issues; First, telnet would
      occasionally output '\r\r\n' which would get converted to 2 newlines,
      whereas only one was intended. Secondly, we were swallowing legitimate
      '\r's when working at the interactive shell and the cursor would
      occasionally get messed up.
      
      Solve this by never converting line endings when converting the binary
      data to string data. As a result we must be more carefull with '\r'
      since they may now exist in the stream.
      
      Signed-off-by: Ryan Roberts's avatarRyan Roberts <ryan.roberts@arm.com>
      0bbf27d9
  6. Jan 03, 2023
  7. Dec 20, 2022
  8. Dec 16, 2022
    • Ryan Roberts's avatar
      Merge branch 'ryarob01/python3.6.9' into 'main' · 5e2b6523
      Ryan Roberts authored
      core: Add support for Python 3.6.9
      
      See merge request !1
      5e2b6523
    • Ryan Roberts's avatar
      core: Add support for Python 3.6.9 · 6957fb15
      Ryan Roberts authored
      
      
      Previously we were restricting support to Python 3.7.0 and newer, due to
      that version being the first to support ordered dicts, which are relied
      upon to pretify generated config files. However it turns out that Python
      3.6 implements ordered dicts despite that version of the language not
      requiring it.
      
      Ubuntu 18.04 ships with Python 3.6.9 by default and a number of people
      are still using that release, so let's support that as the minimum
      version.
      
      In order for it to work, there are a few mods we have to make to API
      calls etc.
      
      Signed-off-by: Ryan Roberts's avatarRyan Roberts <ryan.roberts@arm.com>
      6957fb15
  9. Dec 06, 2022
  10. Nov 21, 2022
  11. Nov 17, 2022
    • Ryan Roberts's avatar
      config: Improve dt-base.yaml to support user-defined DTS. · f23fdd5b
      Ryan Roberts authored
      
      
      A higher layer config can now optionally override the DTS that gets
      compiled. While we are at it, we also change the method of injecting the
      kernel command line to be more robust (the previous method broke if the
      chosen{} node was not already present or was in an included file).
      
      Signed-off-by: Ryan Roberts's avatarRyan Roberts <ryan.roberts@arm.com>
      f23fdd5b
    • Ryan Roberts's avatar
      utils: Fix label overdraw after warnings are output. · d1251707
      Ryan Roberts authored
      
      
      When in overdraw mode, we must always output the whole block of labels
      on first draw (or first draw after a warning is output). Otherwise the
      second draw could overdraw the warning. Also fix the case where stdout
      is not a terminal.
      
      Signed-off-by: Ryan Roberts's avatarRyan Roberts <ryan.roberts@arm.com>
      d1251707
    • Ryan Roberts's avatar
      core: Support running on MacOS. · f8de2f3c
      Ryan Roberts authored
      
      
      We can run shrinkwrap on MacOS as long as docker desktop is installed.
      There are a couple of issues to work around though:
      
      - readlink on MacOS does not have the -f (follow) option. Its not really
        important, so just remove use of it entirely.
      - We were getting an error when trying to add the GID to the container
        due to Linux already having allocated the GID. So just run as root
        within the container on MacOS. The MacOS version of docker appears to
        ensure that files on the host file system have the correct permissions
        anyway.
      
      Signed-off-by: Ryan Roberts's avatarRyan Roberts <ryan.roberts@arm.com>
      f8de2f3c
    • Ryan Roberts's avatar
      utils: Fix bug where logging output would occasionally fail. · 972ddf6d
      Ryan Roberts authored
      
      
      It turns out that when setting a file descriptor to nonblocking, if that
      fd is stdin and connected to a tty, it also makes stdout nonblocking.
      Which means that prints() would occasionally fail if the output buffer
      was full.
      
      Solve this by only making file descriptors temporarily nonblocking when
      reading them. Since the application is single threaded, this means that
      the bit is never set when subsequently doing a print.
      
      Signed-off-by: Ryan Roberts's avatarRyan Roberts <ryan.roberts@arm.com>
      972ddf6d
    • Ryan Roberts's avatar
      build, clean: Output warnings by default. · 174154ea
      Ryan Roberts authored
      
      
      Modify the behavior so that even when --verbose is not specified, stderr
      is still output to the console. This means that compiler warnings and
      the like will be seen more clearly. In the absense of warnings, no
      stderr is expected to be output so the console still looks "pretty",
      with overdrawn status labels etc. If a warning occurs it is output
      consicely and labels are reset so they don't overdraw the warning.
      
      Signed-off-by: Ryan Roberts's avatarRyan Roberts <ryan.roberts@arm.com>
      174154ea
    • Ryan Roberts's avatar
      cc7dde73
    • Ryan Roberts's avatar
      docs: Tidy up runtime documentation. · 96f31675
      Ryan Roberts authored
      
      
      - Drop support for podman since it is untested. It's simple to add it
        back in future if requried.
      - Make `docker` the default runtime; this is what we want to push users
        towards.
      - Improve runtimes documentation to include discussion of the image
        variants and dependency requirements.
      
      Signed-off-by: Ryan Roberts's avatarRyan Roberts <ryan.roberts@arm.com>
      96f31675
    • Ryan Roberts's avatar
      config: Use sensible default paths for config store. · 37364393
      Ryan Roberts authored
      
      
      Requiring the user to explicitly set the SHRINKWRAP_CONFIG environment
      variable is onerous and error-prone. So pre-populate the path list with
      common locations and prepend with any (now optionally) supplied paths
      from the user. And filter so that we only keep paths that exist, which
      also resolves a pre-existing bug where shrinkwrap errored out if
      SHRINKWRAP_CONFIG contained a non-existing path.
      
      While we are at it, print the final workspace paths when --verbose is
      specified.
      
      Signed-off-by: Ryan Roberts's avatarRyan Roberts <ryan.roberts@arm.com>
      37364393
    • Ryan Roberts's avatar
      docker: Add scripts to build and publish docker images. · 2c759b93
      Ryan Roberts authored
      
      
      To build the docker images do the following:
      
        cd docker
        ./build.sh latest
      
      This will build and push the images for your native architecture (works
      for both x86_64 and aarch64). Images are currently pushed to Arm's
      internal Artifactory repo, and you will need to have docker logged in
      for this to be successful. (We plan to change this in future to publish
      to docker.io).
      
      You will need to build on both x86_64 and aarch64, then do this on one
      of the systems:
      
        ./publish.sh latest
      
      This will tie the images together to form multiarch images, such that
      docker can resolve the correct image based on the arch on which you are
      running.
      
      The following images are built:
      
        - base-slim-nofvp
        - base-slim
        - base-full-nofvp
        - base-full
      
      'slim' variants don't contain aarch32 toolchains. These are massive and
      bloat the image and most people don't need them. 'full' variants are
      based on 'slim' but add in the aarch32 toolchains. 'nofvp' variants
      don't contain an fvp. These images are intended for use as base images
      if the need arises to add a custom fvp.
      
      Currently there is no public fvp support for aarch64, so there is no fvp
      included with this arch. We hope to solve this in future.
      
      Signed-off-by: Ryan Roberts's avatarRyan Roberts <ryan.roberts@arm.com>
      2c759b93
    • Ryan Roberts's avatar
      config: Support running multiple instances of ns-edk2-* in parallel. · 5cd91671
      Ryan Roberts authored
      
      
      ns-edk2-* previously relied upon assembling all the assets required for
      semihosting in the package directory. Some of these assets were
      dynamically generated at runtime. This was problematic for running
      multiple instances in parallel.
      
      So instead, create a per-instance temporary directory for semihosting
      that is cleaned up at exit.
      
      This approach means that we no longer need to expose the
      {param:packagedir} macro, so remove that while we are at it.
      
      Signed-off-by: Ryan Roberts's avatarRyan Roberts <ryan.roberts@arm.com>
      5cd91671
    • Ryan Roberts's avatar
      run: Print environment IP address. · d48156be
      Ryan Roberts authored
      
      
      When running the FVP inside a container it can be useful to know the IP
      address for use cases such as attaching the debugger or ssh'ing into the
      hosted linux system.
      
      Signed-off-by: Ryan Roberts's avatarRyan Roberts <ryan.roberts@arm.com>
      d48156be
    • Ryan Roberts's avatar
      config: linux-base.yaml: Make building modules optional. · 8727cc68
      Ryan Roberts authored
      
      
      Building and packaging the Linux modules is expensive, even for
      incremental builds. Often this is not required, so make it optional with
      a shell variable. A derived config can add the following to the linux
      prebuild command list:
      
      export BUILD_KMODULES=false
      
      Signed-off-by: Ryan Roberts's avatarRyan Roberts <ryan.roberts@arm.com>
      8727cc68
    • Ryan Roberts's avatar
    • Ryan Roberts's avatar
      config: Move the config store out of the python package. · c5467d15
      Ryan Roberts authored
      
      
      While this will be deployed with the python package, it is not strictly
      part of it, and we want to reduce the coupling between the tool and the
      configs. The SHRINKWRAP_CONFIG environment variable must be set to tell
      Shrinkwrap where the config store location(s) are.
      
      Signed-off-by: Ryan Roberts's avatarRyan Roberts <ryan.roberts@arm.com>
      c5467d15
    • Ryan Roberts's avatar
      config: Require each component to specify their toolchain. · 3f3a52ef
      Ryan Roberts authored
      
      
      Add a 'toolchain' key to the component dictionary, which specifies the
      toolchain to use. This string is set in the CROSS_COMPILE environment
      variable before invoking any prebuild, build, postbuild or clean
      commands.
      
      When using the standard docker runtime image, the following options are
      supported. Users are free to configure their own thing when using the
      null runtime.
      
      * aarch64-none-elf-    (arm64 bare-metal, from Arm)
      * arm-none-eabi-       (arm32 bare-metal, from Arm)
      * aarch64-linux-gnu-   (arm64 linux, from Debian)
      * arm-linux-gnueabihf- (arm32 linux, from Debian)
      
      Signed-off-by: Ryan Roberts's avatarRyan Roberts <ryan.roberts@arm.com>
      3f3a52ef
    • Ryan Roberts's avatar
      core: Expand SHRINKWRAP_CONFIG to support multiple paths. · 2e4b499b
      Ryan Roberts authored
      
      
      We want to make it possible for multiple config stores to coexist. This
      enables the user to use the standard store that ships with shrinkwrap
      and add in extra stores for configs that can't be shared publicly (for
      example). References to yaml files should resolve across stores.
      
      We solve this by extending the SHRINKWRAP_CONFIG environment variable to
      behave like $PATH. It is now a colon-separated list of config store
      paths, in preference order, with the most preferred appearing first. We
      have also removed the old behaviour where shrinkwrap would default to
      the config store at its root when the variable is not set. Instead we
      now raise an error. This change is so that we can decouple the config
      store from shrinkwrap entirely.
      
      Everything works out fairly well, except for one aspect; Resolving the
      ${param:configdir} macro now requires knowing what's being looked up in
      the config store and finding the store that contains it. This is
      implemented and appears to work reliably. But means we can only allow
      the use of this macro for resolving files that already exist and are
      inputs to the process. This is not a problem for existing uses.
      
      Signed-off-by: Ryan Roberts's avatarRyan Roberts <ryan.roberts@arm.com>
      2e4b499b
    • Ryan Roberts's avatar
      f6bd6839
Loading