1. 31 May, 2021 2 commits
  2. 19 Mar, 2021 1 commit
  3. 27 Nov, 2020 13 commits
  4. 14 Aug, 2020 8 commits
    • Corentin Noël's avatar
      Use 'remap' behaviour to deal with multiple devices being shared with a 9p export · 4dfa183c
      Corentin Noël authored
      Fixes warnings like:
      
      ```
      9p: Multiple devices detected in same VirtFS export, which might lead to file
      ID collisions and severe misbehaviours on guest!
      You should either use a separate export for each device shared from host or
      use virtfs option 'multidevs=remap'!
      ```
      
      Requires QEMU >= 4.2.0
      4dfa183c
    • Arnaud Rebillout's avatar
    • Arnaud Rebillout's avatar
      Add support for -e option · 2db86a91
      Arnaud Rebillout authored
      Implementation roughly copy-pasted from debos.
      
      https://github.com/go-debos/fakemachine/issues/40
      
      Signed-off-by: Arnaud Rebillout's avatarArnaud Rebillout <arnaud.rebillout@collabora.com>
      2db86a91
    • Gaël PORTAY's avatar
      machine: Make /etc/dbus-1 optional · ab5fba87
      Gaël PORTAY authored
      This directory is not necessarly present.
      ab5fba87
    • Arnaud Rebillout's avatar
      machine: writerKernelModules: Add support for modules.builtin · c925fb87
      Arnaud Rebillout authored
      
      
      In recent kernels, ArchLinux no longer compiles some of the virtio
      drivers as modules; they are compiled built-in in the kernel image
      instead. This seems to be also true for Ubuntu.
      
      This commit adds support for the `modules.builtin` file. We now read
      this file, and skip the builtin modules.
      
      Note that we can't assume that the file `modules.builtin` exist. On
      Debian, modules.builtin doesn't exist at least on the 4.19 kernels it
      does however exist on the 5.3 packaging
      Signed-off-by: Arnaud Rebillout's avatarArnaud Rebillout <arnaud.rebillout@collabora.com>
      c925fb87
    • Arnaud Rebillout's avatar
      machine: Rework the logic to find the kernel path · 2fd806d7
      Arnaud Rebillout authored
      
      
      Up to now, the assumption was that, given a kernel release `KREL`, the
      kernel was installed under `/boot/vmlinuz-$KREL`.
      
      While this is true at least on Debian and Ubuntu, this doesn't work for
      distributions like ArchLinux or Manjaro. For those distributions, there
      is no obvious way to match module directories and kernel filenames.
      
      In order to support these distributions, we need to do more than that.
      
      The solution chosen here is simply to look into the kernel binaries for
      the kernel release as a static string, followed by a space. It works on
      all the distos tested so far:
      
        # Debian
        $ strings /boot/vmlinuz-4.19.0-6-amd64 | grep '4.19.0-6-amd64 '
        4.19.0-6-amd64 (debian-kernel@lists.debian.org) #1 SMP Debian 4.19.67-2+deb10u2 (2019-11-11)
        4.19.0-6-amd64 (debian-kernel@lists.debian.org) (gcc version 8.3.0 (Debian 8.3.0-6)) #1 SMP Debian 4.19.67-2+deb10u2 (2019-11-11)
      
        # Ubuntu
        $ strings /boot/vmlinuz-4.15.0-72-generic | grep '4.15.0-72-generic '
        4.15.0-72-generic (buildd@lcy01-amd64-026) #81-Ubuntu SMP Tue Nov 26 12:20:02 UTC 2019
        4.15.0-72-generic (buildd@lcy01-amd64-026) (gcc version 7.4.0 (Ubuntu 7.4.0-1ubuntu1~18.04.1)) #81-Ubuntu SMP Tue Nov 26 12:20:02 UTC 2019
      
        # ArchLinux
        $ strings /boot/vmlinuz-linux | grep '5.4.2-arch1-1 '
        5.4.2-arch1-1 (linux@archlinux) #1 SMP PREEMPT Thu, 05 Dec 2019 12:29:40 +0000
        5.4.2-arch1-1 (linux@archlinux) (gcc version 9.2.0 (GCC)) #1 SMP PREEMPT Thu, 05 Dec 2019 12:29:40 +0000
      
        # Manjaro
        $ strings /boot/vmlinuz-4.19-x86_64 | grep '4.19.88-1-MANJARO '
        4.19.88-1-MANJARO (builder@8898125bf991) #1 SMP PREEMPT Thu Dec 5 11:04:44 UTC 2019
        4.19.88-1-MANJARO (builder@8898125bf991) (gcc version 9.2.0 (GCC)) #1 SMP PREEMPT Thu Dec 5 11:04:44 UTC 2019
      
      For reference, here's how Arch and Manjaro look like:
      
      ArchLinux:
      
        # ls -1 /lib/modules
        4.19.88-1-lts
        5.3.15.a-1-hardened
        5.4.2-arch1-1
        5.4.2-zen1-1-zen
      
        # ls -1 /boot/vmlinuz-*
        /boot/vmlinuz-linux
        /boot/vmlinuz-linux-hardened
        /boot/vmlinuz-linux-lts
        /boot/vmlinuz-linux-zen
      
      Manjaro:
      
        # ls -1 /lib/modules
        3.16.78-1-MANJARO
        4.19.72-rt26-MANJARO
        4.19.88-1-MANJARO
        5.2.21-rt14-MANJARO
        5.3.15-1-MANJARO
        5.4.2-1-MANJARO
        extramodules-3.16-MANJARO
        extramodules-4.19-MANJARO
        extramodules-4.19-rt-MANJARO
        extramodules-5.2-rt-MANJARO
        extramodules-5.3-MANJARO
        extramodules-5.4-MANJARO
      
        # ls -1 /boot/vmlinuz-*
        /boot/vmlinuz-3.16-x86_64
        /boot/vmlinuz-4.19-rt-x86_64
        /boot/vmlinuz-4.19-x86_64
        /boot/vmlinuz-5.2-rt-x86_64
        /boot/vmlinuz-5.3-x86_64
        /boot/vmlinuz-5.4-x86_64
      Signed-off-by: Arnaud Rebillout's avatarArnaud Rebillout <arnaud.rebillout@collabora.com>
      2fd806d7
    • Arnaud Rebillout's avatar
    • Arnaud Rebillout's avatar
      machine: Rework the logic to find libraries (libc and libresolv) · 3f602ad2
      Arnaud Rebillout authored
      We used to look for these libraries in (usr)/lib/x86_64-linux-gnu/, but
      this is location is Debian-specific, other distros use different paths.
      
      For example, ArchLinux puts everything in /usr/lib, while Fedora uses
      /lib64 apparently.
      
      With this commit, we assume that the libraries are installed in the same
      directory as the linker (which itself is installed at a well known-path
      per architecture as defined by [1]). This is true for ArchLinux, Fedora,
      Debian, Ubuntu, so it seems to be a savfe assumption.
      
      [1]: https://sourceware.org/glibc/wiki/ABIList
      
      Signed-off-by: Arnaud Rebillout's avatarArnaud Rebillout <arnaud.rebillout@collabora.com>
      3f602ad2
  5. 05 Aug, 2020 3 commits
    • Arnaud Rebillout's avatar
      machine: Refine the logic to find the kernel release · 8defac29
      Arnaud Rebillout authored
      
      
      Currently, the kernel release is determined by taking the last entry in
      /usr/lib/modules. This doesn't work for distributions like ArchLinux,
      which has additional entries in /usr/lib/modules:
      
          $ ls -1 /usr/lib/modules
          5.2.4-arch1-1-ARCH
          extramodules-ARCH
      
      This commit fixes it. We keep the same logic (ie. pick up the last
      kernel found in /usr/lib/modules), however we add an additional
      constraint: filter out things that don't start with a digit (because
      yes, we strongly expect that the kernel release starts with a digit).
      
      (this neat trick was taken from the mkosi source code)
      Signed-off-by: Arnaud Rebillout's avatarArnaud Rebillout <arnaud.rebillout@collabora.com>
      8defac29
    • Arnaud Rebillout's avatar
      machine: Mount /etc/ca-certificates in the fakemachine · 436f6966
      Arnaud Rebillout authored
      
      
      For now we only mount /etc/ssl into the fakemachine, however for
      distributions like ArchLinux this is not enough, as various entries
      under /etc/ssl/ are actually symlinks to /etc/ca-certificates/...:
      
          $ ls -l /etc/ssl/cert.pem
          lrwxrwxrwx 1 root root 46 Nov  9  2018 /etc/ssl/cert.pem -> ../ca-certificates/extracted/tls-ca-bundle.pem
          $ ls -l /etc/ssl/certs/ca-certificates.crt
          lrwxrwxrwx 1 root root 49 Nov  9  2018 /etc/ssl/certs/ca-certificates.crt -> ../../ca-certificates/extracted/tls-ca-bundle.pem
      
      This commit adds /etc/ca-certificates to the list of directories that
      are bind-mounted into the fakemachine.
      Signed-off-by: Arnaud Rebillout's avatarArnaud Rebillout <arnaud.rebillout@collabora.com>
      436f6966
    • Arnaud Rebillout's avatar
      machine: Make /etc/alternatives optional · e1be918a
      Arnaud Rebillout authored
      
      
      This is Debian-specific, it doesn't exist in other distributions.
      Signed-off-by: Arnaud Rebillout's avatarArnaud Rebillout <arnaud.rebillout@collabora.com>
      e1be918a
  6. 28 May, 2020 2 commits
  7. 27 May, 2020 4 commits
  8. 05 Dec, 2019 3 commits
  9. 05 Mar, 2019 1 commit
  10. 06 Feb, 2019 2 commits
  11. 05 Nov, 2018 1 commit
    • Sjoerd Simons's avatar
      Set all environment variables in one line · 93165841
      Sjoerd Simons authored
      
      
      In systemd syntax an empty rvalue unsets previously set values. Which
      meant in case no host environment variables were carried over
      `Environment=%[2]s` would cause the previous Environment setting to be
      dropped... Which in turn broke the fakemachine.InMachine() detection,
      which broke debos when not using proxies...
      
      Simply append the extra environment variables to the existing
      Environment= setting to ensure that can happens.
      Signed-off-by: Sjoerd Simons's avatarSjoerd Simons <sjoerd.simons@collabora.co.uk>
      93165841