Skip to content

Commit

Permalink
--xopt: experimental option to add X server options
Browse files Browse the repository at this point in the history
--podman -gpu --alsa: share devices with --volume #293 #255
  • Loading branch information
mviereck committed Nov 6, 2020
1 parent 0ff123f commit e205f48
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 15 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ Project website: https://github.com/mviereck/x11docker
[(x11docker/deepin:#2)](https://github.com/mviereck/dockerfile-x11docker-deepin/issues/2)
- `--podman`: Experimental `podman` support.
[(#255)](https://github.com/mviereck/x11docker/issues/255)
- `--xopt`: Experimental option to add custom X server options.
[(#296)](https://github.com/mviereck/x11docker/issues/296)
### Changed
- `--lang`: Allow multiple times to generate more than one locale.
### Fixed
Expand All @@ -25,6 +27,8 @@ Project website: https://github.com/mviereck/x11docker
[(#254)](https://github.com/mviereck/x11docker/issues/254)
- `--xpra`: version check failed in few circumstances.
[(#287)](https://github.com/mviereck/x11docker/issues/287)
- `--gpu`: share `/dev/nvmap` and `/dev/nvhost*` if present.
[(#290)](https://github.com/mviereck/x11docker/issues/290)

## [6.6.2](https://github.com/mviereck/x11docker/releases/tag/v6.6.2) - 2022-05-19
### Added
Expand Down
44 changes: 29 additions & 15 deletions x11docker
Original file line number Diff line number Diff line change
Expand Up @@ -605,8 +605,8 @@ finish() { # trap EXIT routine to clean up background proce

# remove container
[ "$Preservecachefiles" = "no" ] && [ "$Containername" ] && {
debugnote "Removing container $Containername"
$Dockerexe rm -f "$Containername" || note "Failed to remove container $Containername"
debugnote "Removing container $Containername
$($Dockerexe rm -f "$Containername" 2>&1)"
}

# Check if 'docker logs' is still running
Expand Down Expand Up @@ -2403,7 +2403,7 @@ check_xdepends() { # check dependencies on host for X server option
}
} || {
[ "$Hostdisplay" ] || {
$Message "${1:-} needs a running X server. DISPLAY is empty. Wayland support is experimental only."
$Message "${1:-} needs a running X server. DISPLAY is empty. Wayland support is experimental option."
Return=1
}
}
Expand Down Expand Up @@ -2686,8 +2686,11 @@ check_xserver() { # check chosen X server, auto-choose X server
return 0
}
create_xcommand() { ### create command to start X server and/or Wayland compositor
local Xserveroptions= Xpraoptions= Nxagentoptions= Compositorpid= Weston= Westonoutput= Count= Envvar=
local Xserveroptions_custom= Xpraoptions= Nxagentoptions= Compositorpid= Weston= Westonoutput= Count= Envvar=

Xserveroptions_custom="$Xserveroptions"
Xserveroptions=""

#### General X server options
case $Xserver in
--nxagent)
Expand Down Expand Up @@ -3264,6 +3267,10 @@ esac
;;
esac

# --xopt
Xcommand="$Xcommand \\
$Xserveroptions_custom"

case $Xserver in
--weston|--kwin|--hostwayland|--hostdisplay|--tty) Xcommand="" ;;
esac
Expand Down Expand Up @@ -4142,9 +4149,13 @@ create_dockercommand() { ### create command to run docker
;;
*)
case "$(cut -c1-5 <<< "$Line")" in
"/dev/")
Dockercommand="$Dockercommand \\
"/dev/")
Dockercommand="$Dockercommand \\
--device $(convertpath volume "$Line")"
false && case $Podman in
yes) Dockercommand="$Dockercommand \\
--volume $(convertpath volume "$Line")" ;;
esac
warning "Sharing device file: $Line"
;;
*)
Expand Down Expand Up @@ -6731,7 +6742,8 @@ check_option_interferences() { # check multiple option interferences, change se
;;
esac
case $Podman in
yes) note "Option --gpu is known to fail with --podman.
yes) note "Option --gpu is known to fail with --podman
and also needs discouraged option --privileged.
Please try with Docker instead." ;;
esac
}
Expand Down Expand Up @@ -8072,6 +8084,7 @@ declare_variables() { # declare global variables
Xpravfb="" # --xpra, --xdummy, --xvfb: vfb for --xpra: Xdummy or Xvfb
Xserver="" # X server option to use
Xoverip="" # --xoverip: Connect to X over TCP yes/no
Xserveroptions="" # --xopt: Custom X server options
Xtest="" # --xtest: Enable extension Xtest yes/no. If empty, yes for --xpra/--xdummy/--xvfb, otherwise no
Yaxis="" # Virtual screen height

Expand Down Expand Up @@ -8287,7 +8300,7 @@ parse_options() { # parse cli options
Longoptions="$Longoptions,cleanup,help,launcher,licence,license,version,wmlist" # Special options without starting X or container
Longoptions="$Longoptions,install,remove,update,update-master" # Installation
#
Longoptions="$Longoptions,iglx,keepcache,no-setup,podman,xcomposite,xorgconf:,runx" # Experimental
Longoptions="$Longoptions,iglx,keepcache,no-setup,podman,xcomposite,xopt:,xorgconf:,runx" # Experimental
Longoptions="$Longoptions,dbus-system,homedir:,no-xhost,sharedir:,sharessh,systemd" # Deprecated
Longoptions="$Longoptions,cachedir:,no-init,nothing,no-xtest,openrc,ps,runit,silent,starter,stderr,stdout" # Removed
Longoptions="$Longoptions,sys-admin,sysvinit,tini,trusted,untrusted,vcxsrv" # Removed
Expand Down Expand Up @@ -8510,20 +8523,21 @@ ${2:-}" ; shift ;; # Add custo
--launcher) Createlauncher="yes" ;; # Create application launcher on desktop and exit

#### Experimental options
--iglx) Iglx="yes" ; note "Option --iglx: experimental only." ;; # Indirect rendering; broken since Xorg ~18.2
--keepcache) Preservecachefiles="yes" ; note "Option --keepcache: experimental only." ;;
--no-setup) Containersetup="no" ; note "Option --no-setup: experimental only." ;;
--podman) Podman="yes" ; note "Option --podman: experimental only.
--iglx) Iglx="yes" ; note "Option --iglx: experimental option." ;; # Indirect rendering; broken since Xorg ~18.2
--keepcache) Preservecachefiles="yes" ; note "Option --keepcache: experimental option." ;;
--no-setup) Containersetup="no" ; note "Option --no-setup: experimental option." ;;
--podman) Podman="yes" ; note "Option --podman: experimental option.
To avoid a prompt for root password, you might have to execute:
sysctl -w kernel.unprivileged_userns_clone=1
Please report issues at: https://github.com/mviereck/x11docker/issues/255" ;;
--runasuser) Runasuser="$Runasuser
${2:-}"
shift

note "Option --runasuser: experimental only." ;; # Add custom root command in container setup script
--xcomposite) Xcomposite="yes" ; note "Option --xcomposite: experimental only." ;; # Enable X extension COMPOSITE
--xorgconf) Xorgconf="${2:-}" ; note "Option --xorgconf: eperimental only" ; shift ;; # Custom xorg.conf
note "Option --runasuser: experimental option." ;; # Add custom root command in container setup script
--xcomposite) Xcomposite="yes" ; note "Option --xcomposite: experimental option." ;; # Enable X extension COMPOSITE
--xopt) Xserveroptions="${2:-}" ; note "Option --xopt: experimental option." ; shift ;; # Custom X server options
--xorgconf) Xorgconf="${2:-}" ; note "Option --xorgconf: experimental option." ; shift ;; # Custom xorg.conf

#### Deprecated options
--dbus-system) note "Option --dbus-system is deprecated.
Expand Down

0 comments on commit e205f48

Please sign in to comment.