Skip to content

Commit

Permalink
mockbuild/buildroot: Make the FUSE device available if supported
Browse files Browse the repository at this point in the history
Without the FUSE device, we cannot use FUSE filesystems with
image builds.

This is particularly important for RPM-OSTree builds that use
FUSE as part of the image build process.
  • Loading branch information
Conan-Kudo authored and praiskup committed Jul 23, 2023
1 parent ff554be commit 836509e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions mock/py/mockbuild/buildroot.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ def __init__(self, config, uid_manager, state, plugins, bootstrap_buildroot=None
self._homedir_bindmounts = {}
self._setup_nspawn_btrfs_device()
self._setup_nspawn_devicemapper_device()
self._setup_nspawn_fuse_device()
self._setup_nspawn_loop_devices()


Expand Down Expand Up @@ -699,6 +700,13 @@ def _setup_nspawn_devicemapper_device(self):
if os.path.exists('/dev/mapper/control'):
self.config['nspawn_args'].append('--bind=/dev/mapper/control')

@traceLog()
def _setup_nspawn_fuse_device(self):
if not util.USE_NSPAWN or self.is_bootstrap:
return
if os.path.exists('/dev/fuse'):
self.config['nspawn_args'].append('--bind=/dev/fuse')

@traceLog()
def _setup_nspawn_loop_devices(self):
if not util.USE_NSPAWN or self.is_bootstrap:
Expand Down Expand Up @@ -732,6 +740,7 @@ def _setup_devices(self):
(stat.S_IFCHR | 0o666, os.makedev(5, 0), "dev/tty"),
(stat.S_IFCHR | 0o600, os.makedev(5, 1), "dev/console"),
(stat.S_IFCHR | 0o666, os.makedev(5, 2), "dev/ptmx"),
(stat.S_IFCHR | 0o666, os.makedev(10, 229), "dev/fuse"),
(stat.S_IFCHR | 0o660, os.makedev(10, 234), "dev/btrfs-control"),
(stat.S_IFCHR | 0o600, os.makedev(10, 236), "dev/mapper/control"),
(stat.S_IFCHR | 0o666, os.makedev(10, 237), "dev/loop-control"),
Expand Down

0 comments on commit 836509e

Please sign in to comment.