Class: Bwrap::Args::Bind::Device
- Inherits:
-
Object
- Object
- Bwrap::Args::Bind::Device
- Includes:
- Output
- Defined in:
- lib/bwrap/args/bind/device.rb
Overview
Device related binds.
Instance Attribute Summary collapse
-
#config ⇒ Object
writeonly
Instance of Config.
Instance Method Summary collapse
-
#bind_dev_dri ⇒ Object
Arguments to bind /dev/dri from host to sandbox.
-
#bind_pci_devices ⇒ Object
Arguments to bind /sys/devices/pci0000:00 from host to sandbox.
-
#bind_sys_dev_char ⇒ Object
Arguments to bind /sys/dev/char from host to sandbox.
-
#dev_mount ⇒ Object
Arguments for mounting devtmpfs to /dev.
-
#initialize(args) ⇒ Device
constructor
A new instance of Device.
Methods included from Output
debug?, debug_output, error_output, handle_output_options, info_output, quiet?, trace?, trace_output, verb_output, verbose?, warn_output
Constructor Details
#initialize(args) ⇒ Device
Returns a new instance of Device.
14 15 16 |
# File 'lib/bwrap/args/bind/device.rb', line 14 def initialize args @args = args end |
Instance Attribute Details
#config=(value) ⇒ Object (writeonly)
Instance of Config.
11 12 13 |
# File 'lib/bwrap/args/bind/device.rb', line 11 def config=(value) @config = value end |
Instance Method Details
#bind_dev_dri ⇒ Object
Arguments to bind /dev/dri from host to sandbox.
27 28 29 30 31 |
# File 'lib/bwrap/args/bind/device.rb', line 27 def bind_dev_dri return unless @config&.graphics_acceleration @args.add :dev_mounts, %w{ --dev-bind /dev/dri /dev/dri } end |
#bind_pci_devices ⇒ Object
Arguments to bind /sys/devices/pci0000:00 from host to sandbox.
41 42 43 44 45 |
# File 'lib/bwrap/args/bind/device.rb', line 41 def bind_pci_devices return unless @config&.graphics_acceleration @args.add :dev_mounts, %w{ --ro-bind /sys/devices/pci0000:00 /sys/devices/pci0000:00 } end |
#bind_sys_dev_char ⇒ Object
Arguments to bind /sys/dev/char from host to sandbox.
34 35 36 37 38 |
# File 'lib/bwrap/args/bind/device.rb', line 34 def bind_sys_dev_char return unless @config&.graphics_acceleration @args.add :dev_mounts, %w{ --ro-bind /sys/dev/char /sys/dev/char } end |
#dev_mount ⇒ Object
Arguments for mounting devtmpfs to /dev.
19 20 21 22 23 24 |
# File 'lib/bwrap/args/bind/device.rb', line 19 def dev_mount return unless @config&.dev_mount debug "Mounting new devtmpfs to /dev" @args.add :dev_mounts, "--dev", "/dev" end |