Skip to content

Commit

Permalink
--printcheck: New option to show X dependency check messages
Browse files Browse the repository at this point in the history
  • Loading branch information
mviereck committed Jul 11, 2022
1 parent b1f3542 commit 43f55d2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 22 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ Project website: https://github.com/mviereck/x11docker
## [Unreleased]
### Added
- `--xauth [=yes|trusted|untrusted|no]`: New option to configure X cookie.
- `--printcheck`: New option to show X server dependency check messages.
### Changed
- `--xoverip`: New optional arguments `yes|no|socat`.
Using `socat` allows X over TCP with Xwayland related options.
- `--hostdisplay`: Allow `--xoverip=socat`.
- `--gpu`: changed availability checks.
- `--gpu`: changed X dependency checks.
- `--hostdisplay --gpu --xc=no`: Do not enable `--ipc=host` automatically.
### Fixed
- `--user`: Fix in setup of `/etc/gshadow`.
Expand Down
36 changes: 15 additions & 21 deletions x11docker
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# Run 'x11docker --help' or scroll down to read usage information.
# More documentation at: https://github.com/mviereck/x11docker

Version="7.4.0-beta-2"
Version="7.4.0-beta-3"

# --enforce-i: Enforce running in interactive mode to allow commands tty and weston-launch in special setups.
grep -q -- "--enforce-i" <<< "$*" && case $- in
Expand Down Expand Up @@ -360,6 +360,7 @@ Output of parseable information on stdout:
Verbosity options:
-D, --debug Debug mode: Show some less verbose debug output
and enable rigorous error control.
--printcheck Show dependency check messages.
-q, --quiet Suppress x11docker terminal messages.
-v, --verbose Be verbose. Output of x11docker.log on stderr.
-V Be verbose with colored output.
Expand Down Expand Up @@ -553,14 +554,6 @@ $Line"
}
done
}
xdependsmessage() { # show and collect messages of check_xdepends()
local Notefunc
Notefunc="${1:-}"
shift
$Notefunc "$*"
Xdependsmessages="$Xdependsmessages
$*"
}

#### exit
finish() { # trap EXIT routine to clean up background processes and cache
Expand Down Expand Up @@ -2838,8 +2831,8 @@ check_xdepends() { # check dependencies on host for X server option
local Return= Message= Xcopt=

case "$Autochooseserver" in
yes) Message="xdependsmessage debugnote" ;;
no) Message="xdependsmessage note" ;;
yes) [ "$Printcheck" = "yes" ] && Message="note" || Message="debugnote" ;;
no) Message="note" ;;
esac

[ "${1:-}" = "--tty" ] && return 0
Expand Down Expand Up @@ -3150,7 +3143,7 @@ check_xdepends() { # check dependencies on host for X server option
;;
iglx)
case "${1:-}" in
--xorg) ;;
--xorg|--xwin|--runx) ;;
*)
$Message "${1:-}: --gpu=$Sharegpu not possible. You can try --gpu=virgl."
Return=1
Expand Down Expand Up @@ -3319,8 +3312,9 @@ check_xdepends() { # check dependencies on host for X server option
[ "$Return" = "1" ] && {
check_fallback
Autochooseserver="yes"
grep -q -w "note" <<< "$Message" && note "check_xdepends(): ${1:-} is not possible,
[ "$Printcheck" = "no" ] && grep -q -w "note" <<< "$Message" && note "check_xdepends(): ${1:-} is not possible,
see message(s) above. Will search for another X server option.
You can see intermediate X dependency check messages with option --printcheck.
You can disable the search with option --fallback=no."
}

Expand Down Expand Up @@ -3374,6 +3368,7 @@ check_xserver() { # check chosen X server, auto-choose X server
[ "$Winsubsystem" = "CYGWIN" ] && Xserver="--xwin"
[ "$Setupwayland" = "yes" ] && { [ -n "$Hostwaylandsocket" ] && [ "$Desktopmode" = "no" ] && Xserver="--hostwayland" || Xserver="--weston" ; }
}
[ "$Printcheck" = "yes" ] && note "--printcheck: Starting checks with $Xserver"

[ "$Autochooseserver" = "no" ] && [ "$Xserver" = "--xorg" ] && Newxvt="${Newxvt:-auto}"

Expand Down Expand Up @@ -3535,8 +3530,7 @@ check_xserver() { # check chosen X server, auto-choose X server
Xorg, or weston and Xwayland
$Wikipackagesimage
These messages from internal dependency checks might be useful:
$Xdependsmessages"
It might help you to see dependency check messages with option --printcheck."
;;
CYGWIN)
error "Did not find a possibility to provide a display.
Expand All @@ -3561,9 +3555,8 @@ $Xdependsmessages"
as the best one fitting your specified options and installed dependencies.
However, x11docker does not run another Xorg without being specified.
Please run with option --xorg.
These messages from internal dependency checks might be useful:
$Xdependsmessages"
It might help you to see dependency check messages with option --printcheck."


[ "$Autochooseserver" = "yes" ] && note "Using X server option $Xserver"
storeinfo "xserver=$Xserver"
Expand Down Expand Up @@ -5040,7 +5033,7 @@ xtool() { # run X tool command in X container if available,
;;
esac
case "${1:-}" in
note|debugnote|verbose|warning|error|xdependsmessage*)
note|debugnote|verbose|warning|error)
Message="${1:-}"
shift
;;
Expand Down Expand Up @@ -8873,7 +8866,7 @@ parse_options() { # parse cli options
Longoptions="$Longoptions,stdin,interactive" # Container interaction
Longoptions="$Longoptions,runasuser:,runfromhost:,runasroot:" # Additional commands to execute
Longoptions="$Longoptions,printenv::,printid::,printinfofile::,printpid1::" # Output of vars on stdout
Longoptions="$Longoptions,debug,quiet,verbose::" # Verbose options
Longoptions="$Longoptions,debug,printcheck,quiet,verbose::" # Verbose options
Longoptions="$Longoptions,build,cleanup,help,launcher,licence,license,version" # Special options without starting X or container
Longoptions="$Longoptions,install,remove,update,update-master" # Installation
#
Expand Down Expand Up @@ -9064,6 +9057,7 @@ ${2:-}" ; shift ;; # Add custo
--verbose) Verbose="${2:-yes}" ; shift ;; # Be verbose
-V) Verbose="${Verbose:-yes}"; Verbosecolors="yes";; # Be verbose with colored output
-q|--quiet) Silent="yes" ;; # Do not show warnings or errors
--printcheck) Printcheck="yes" ;; # Show dependency check messages
--printenv) Showdisplayenvironment="${2:-yes}" ; shift ;; # Output of display number and cookie file on stdout. Catch with: read xenv < <(x11docker --printenv)
--printid) Showcontainerid="${2:-yes}" ; shift ;; # Output of container id on stdout
--printinfofile) Showinfofile="${2:-yes}" ; shift ;; # Show path to $Storeinfofile
Expand Down Expand Up @@ -10535,7 +10529,6 @@ declare_variables() { # declare global variables
Timetosaygoodbyefifo="timetosaygoodbye.fifo" # Message channel for --init=openrc|runit|sysvinit to shut down on x11docker signal
Usemkfifo="" # Not on Windows nor with kata-runtime
Watchpidfifo="watchpid.fifo" # Message channel to transfer pids to watchpidlist()
Xdependsmessages="" # Collected messages of check_xdepends()

# Logfiles
Backendcommandfile="docker.command" # File to store generated docker command, needed for --interactive
Expand Down Expand Up @@ -10790,6 +10783,7 @@ declare_variables() { # declare global variables

# Verbosity options
Debugmode="no" # --debug: Excerpt of --verbose, also bash error checks
Printcheck="no" # --printcheck: Show X dependency check messages
Showcontainerid="" # --printid: Output of container ID on stdout
Showcontaineroutput="yes" # Show container command stdout
Showcontainerpid1pid="" # --printpid1: Output of host PID of container PID 1 on stdout
Expand Down

0 comments on commit 43f55d2

Please sign in to comment.