dnschneid / crouton

Chromium OS Universal Chroot Environment
https://goo.gl/fd3zc?si=1
BSD 3-Clause "New" or "Revised" License
8.57k stars 1.24k forks source link

Xorg Fails Nvidia #4839

Closed TomTravis closed 2 years ago

TomTravis commented 2 years ago

chroot.txt

newfile.txt

Please paste the output of the following command here: sudo edit-chroot -all
chronos@localhost /media/removable/sd200/chroots $  sudo edit-chroot -c /media/removable/sd200/chroots -all
name: bcore
encrypted: no
Entering /media/removable/sd200/chroots/bcore...
crouton: version 1-20220512214808
release: bookworm
architecture: arm64
xmethod: xiwi
targets: xiwi,x11,core
host: version 15054.114.0 (Official Build) stable-channel hana 
kernel: Linux localhost 4.19.254-13653-ga5ef616743fe #1 SMP PREEMPT Thu Oct 13 19:09:54 PDT 2022 aarch64 GNU/Linux
freon: yes
Unmounting /media/removable/sd200/chroots/bcore...
name: book
encrypted: no
Entering /media/removable/sd200/chroots/book...
crouton: version 1-20221026165811~new-fix:552076e5
release: bookworm
architecture: arm64
xmethod: xorg
targets: x11
host: version 15054.114.0 (Official Build) stable-channel hana 
kernel: Linux localhost 4.19.254-13653-ga5ef616743fe #1 SMP PREEMPT Thu Oct 13 19:09:54 PDT 2022 aarch64 GNU/Linux
freon: yes
Unmounting /media/removable/sd200/chroots/book...
name: bookworm
encrypted: no
Entering /media/removable/sd200/chroots/bookworm...
crouton: version 1-20221026165811~new-fix:552076e5
release: bookworm
architecture: arm64
targets: core
host: version 15054.114.0 (Official Build) stable-channel hana 
kernel: Linux localhost 4.19.254-13653-ga5ef616743fe #1 SMP PREEMPT Thu Oct 13 19:09:54 PDT 2022 aarch64 GNU/Linux
freon: yes
Unmounting /media/removable/sd200/chroots/bookworm...
name: bullseye
encrypted: no
Entering /media/removable/sd200/chroots/bullseye...
crouton: version 1-20220512214808
release: bullseye
architecture: arm64
xmethod: xorg
targets: xiwi,x11,core
host: version 15054.114.0 (Official Build) stable-channel hana 
kernel: Linux localhost 4.19.254-13653-ga5ef616743fe #1 SMP PREEMPT Thu Oct 13 19:09:54 PDT 2022 aarch64 GNU/Linux
freon: yes
Not unmounting /media/removable/sd200/chroots/bullseye as another instance is using it.
name: focal
encrypted: no
Entering /media/removable/sd200/chroots/focal...
crouton: version 1-20220512214808
release: focal
architecture: arm64
xmethod: xorg
targets: x11,xiwi
host: version 15054.114.0 (Official Build) stable-channel hana 
kernel: Linux localhost 4.19.254-13653-ga5ef616743fe #1 SMP PREEMPT Thu Oct 13 19:09:54 PDT 2022 aarch64 aarch64 aarch64 GNU/Linux
freon: yes
Unmounting /media/removable/sd200/chroots/focal...
name: kali-rolling
encrypted: no
Entering /media/removable/sd200/chroots/kali-rolling...
crouton: version unknown
release: unknown
architecture: unknown
targets: core
host: version 15054.114.0 (Official Build) stable-channel hana 
kernel: Linux localhost 4.19.254-13653-ga5ef616743fe #1 SMP PREEMPT Thu Oct 13 19:09:54 PDT 2022 aarch64 GNU/Linux
freon: yes
Unmounting /media/removable/sd200/chroots/kali-rolling...
name: xenial
encrypted: no
Entering /media/removable/sd200/chroots/xenial...
crouton: version 1-20220512214808
release: xenial
architecture: arm64
xmethod: xorg
targets: x11,core
host: version 15054.114.0 (Official Build) stable-channel hana 
kernel: Linux localhost 4.19.254-13653-ga5ef616743fe #1 SMP PREEMPT Thu Oct 13 19:09:54 PDT 2022 aarch64 aarch64 aarch64 GNU/Linux
freon: yes
Unmounting /media/removable/sd200/chroots/xenial...
chronos@localhost /media/removable/sd200/chroots $ 

Please describe your issue:

X Protocol Version 11, Revision 0 [ 8227.381] Build Operating System: linux Debian [ 8227.383] Current Operating System: Linux localhost 4.19.255-13653-ga5ef616743fe #1 SMP PREEMPT Thu Oct 13 19:09:54 PDT 2022 aarch64 [ 8227.383] Kernel command line: cros_secure console= loglevel=7 init=/sbin/init cros_secure drm.trace=0x106 root=/dev/dm-0 rootwait ro dm_verity.error_behavior=3 dm_verity.max_bios=-1 dm_verity.dev_wait=1 dm="1 vroot none ro 1,0 4077568 verity payload=PARTUUID=1d128873-d1cb-5f47-960d-68e7a9818db0/PARTNROFF=1 hashtree=PARTUUID=1d128873-d1cb-5f47-960d-68e7a9818db0/PARTNROFF=1 hashstart=4077568 alg=sha256 root_hexdigest=e74cdb6a8b750cbf2b6dfc25ad8b7ea07cefc58b53ef98ee60834db4a684ba8d salt=4d7ed087a033cf5dfe4b11b8da0bcb302c1de1f7bdc44a92040f8aa7d59ddbdd" noinitrd vt.global_cursor_default=0 kern_guid=1d128873-d1cb-5f47-960d-68e7a9818db0 cpuidle.governor=teo
[ 8227.384] Build Date: 05 August 2022 08:00:36AM works [ 8227.439] (II) systemd-logind: logind integration requires -keeptty and -keeptty was not provided, disabling logind integration [ 8227.442] (II) xfree86: Adding drm device (/dev/dri/card2) [ 8227.443] (II) no primary bus or device found [ 8227.443] (II) LoadModule: "glx" bullseye)z@localhost:/usr/share/X11$ ls -lar total 88 drwxr-xr-x. 2 root root 4096 Oct 20 20:11 xorg.conf.d -rw-r--r--. 1 root root 8305 Feb 28 2020 xman.help drwxr-xr-x. 8 root root 4096 Oct 20 20:11 xkb lrwxrwxrwx. 1 root root 16 Feb 15 2021 rgb.txt -> /etc/X11/rgb.txt drwxr-xr-x. 64 root root 4096 Oct 20 20:08 locale -rw-r--r--. 1 root root 42077 Jul 26 2021 XErrorDB drwxr-xr-x. 440 root root 16384 Oct 25 19:47 .. drwxr-xr-x. 5 root root 4096 Oct 20 20:11 . (bullseye)z@localhost:/usr/share/X11$ cd xorg.conf.d (bullseye)z@localhost:/usr/share/X11/xorg.conf.d$ ls -la total 20 drwxr-xr-x. 2 root root 4096 Oct 20 20:11 . drwxr-xr-x. 5 root root 4096 Oct 20 20:11 .. -rw-r--r--. 1 root root 1350 Aug 5 01:00 10-quirks.conf -rw-r--r--. 1 root root 1429 Aug 17 2020 40-libinput.conf -rw-r--r--. 1 root root 2747 Jun 26 2017 70-wacom.conf (bullseye)z@localhost:/usr/share/X11/xorg.conf.d$

X.Org X Server 1.20.11 X Protocol Version 11, Revision 0 [ 8227.381] Build Operating System: linux Debian [ 8227.383] Current Operating System: Linux localhost 4.19.255-13653-ga5ef616743fe #1 SMP PREEMPT Thu Oct 13 19:09:54 PDT 2022 aarch64 [ 8227.383] Kernel command line: cros_secure console= loglevel=7 init=/sbin/init cros_secure drm.trace=0x106 root=/dev/dm-0 rootwait ro d m_verity.error_behavior=3 dm_verity.max_bios=-1 dm_verity.dev_wait=1 dm="1 vroot none ro 1,0 4077568 verity payload=PARTUUID=1d128873-d1cb -5f47-960d-68e7a9818db0/PARTNROFF=1 hashtree=PARTUUID=1d128873-d1cb-5f47-960d-68e7a9818db0/PARTNROFF=1 hashstart=4077568 alg=sha256 root_h exdigest=e74cdb6a8b750cbf2b6dfc25ad8b7ea07cefc58b53ef98ee60834db4a684ba8d salt=4d7ed087a033cf5dfe4b11b8da0bcb302c1de1f7bdc44a92040f8aa7d59 ddbdd" noinitrd vt.global_cursor_default=0 kern_guid=1d128873-d1cb-5f47-960d-68e7a9818db0 cpuidle.governor=teo

Fails

./xorg.conf.d: total 20 drwxr-xr-x. 2 root root 4096 Oct 26 20:34 . drwxr-xr-x. 5 root root 4096 Oct 26 17:56 .. -rw-r--r--. 1 root root 1350 Sep 21 22:53 10-quirks.conf -rw-r--r--. 1 root root 1429 Feb 12 2022 40-libinput.conf -rw-r--r--. 1 root root 3458 Jul 14 07:19 70-wacom.conf lrwxrwxrwx. 1 root root 50 Jun 30 11:29 nvidia-drm-outputclass.conf -> /etc/alternatives/glx--nvidia-drm-outputclass.conf

If known, describe the steps to reproduce the issue:

repair glx--nvidia-drm-outputclass.conf

TomTravis commented 2 years ago

https://download.nvidia.com/XFree86/Linux-x86_64/396.51/README/editxconfig.html

TomTravis commented 2 years ago

try to install the package debootstrap / crouton does not use this install https://packages.debian.org/bookworm/nvidia-kernel-dkms in work will add to my fork this is my GPU integrated powervr gx6250 FOSS drivers should work

TomTravis commented 2 years ago

Building for 4.19.255-13653-ga5ef616743fe and 5.19.0-2-arm64 Module build for kernel 4.19.255-13653-ga5ef616743fe was skipped since the kernel headers for this kernel do not seem to be installed. Building initial module for 5.19.0-2-arm64 Done.

nvidia-current.ko: Running module version sanity check.

nvidia-current-modeset.ko: Running module version sanity check.

nvidia-current-drm.ko: Running module version sanity check.

nvidia-current-uvm.ko: Running module version sanity check.

nvidia-current-peermem.ko: Running module version sanity check.

TomTravis commented 2 years ago

well progress after nvidia dkms and arm64 kernel update bookworm linux-headers-cloud-arm64 this update the nvidia kernel the second time with patches installed (++) Log file: "/tmp/Xorg.crouton.1.log", Time: Thu Oct 27 12:01:48 2022 (==) Using config directory: "/etc/X11/xorg.conf.d" (==) Using system config directory "/usr/share/X11/xorg.conf.d" there is no conf files installed

32460.480] (II) LoadModule: "fb" [ 32460.480] (II) Module "fb" already built-in [ 32460.480] (II) UnloadModule: "nvidia" [ 32460.480] (II) Unloading nvidia [ 32460.480] (EE) modeset(0): drmSetMaster failed: Invalid argument still fail [ 32460.480] (EE) Fatal server error: [ 32460.480] (EE) AddScreen/ScreenInit failed for driver 0 [ 32460.480] (EE) [ 32460.480] (EE) Please consult the The X.Org Foundation support at http://wiki.x.org for help. crouton code (book)z@localhost:~$ cat crx.txt

!/bin/sh -e

Copyright (c) 2016 The crouton Authors. All rights reserved.

Use of this source code is governed by a BSD-style license that can be

found in the LICENSE file.

Adds a :# to the xinit command line, where # is the first available display

number. Also adds the -- to the command line and references the global

xserverrc if it isn't already there. By putting this in /usr/local/bin, PATH

will prefer it and scripts that call xinit will automagically work.

xserverrc='/etc/X11/xinit/xserverrc' dash='--' for arg in "$@"; do if [ -z "$dash" ]; then

Check if there's a xserverrc specified.

    if [ "${arg#/}" != "$arg" ]; then
        xserverrc=''
    fi
    break
elif [ "$arg" = '--' ]; then
    dash=
fi

done

Never use display :0 (confusing if aura does not use X11)

disp=1 while [ -f "/tmp/.X$disp-lock" ]; do disp=$((disp+1)) done

If possible, switch to VT1 to avoid strangeness when launching from VT2

chvt 1 2>/dev/null || true

exec /usr/bin/xinit /usr/local/bin/croutonxinitrc-wrapper "$@" $dash $xserverrc ":$disp"

!/bin/sh -e

Copyright (c) 2016 The crouton Authors. All rights reserved.

Use of this source code is governed by a BSD-style license that can be

found in the LICENSE file.

xinitrc wrapper for crouton:

1. Runs crouton-specific commands

2. Runs the provided client (emulating xinit behaviour)

3. Runs crouton-specific commands before the server is destroyed

cmd='' extraargs='' binary='' ret=0

This part is a translation of what is found in xorg's xinit.c

if [ -z "$1" ] || [ "${1#[/.]}" = "$1" ]; then

No client parameter: find .xinitrc if possible, run xterm otherwise

required=''

if [ -n "$XINITRC" ]; then
    cmd="$XINITRC"
    required='y'
elif [ -n "$HOME" ]; then
    cmd="$HOME/.xinitrc"
fi

if [ ! -e "$cmd" ]; then
    if [ -n "$required" ]; then
        echo "Warning, no client init file \"$cmd\"" 1>&2
    fi

    # If no client is given, use default command
    cmd="xterm"
    extraargs="-geometry +1+1 -n login"
    # Make sure xterm is executed directly: let sh resolve the path
    binary='y'
fi

else cmd="$1" shift fi

Run crouton-specific commands:

Show chroot specifics for troubleshooting

croutonversion 1>&2

if [ -z "$XMETHOD" ]; then if [ -f '/etc/crouton/xmethod' ]; then read -r XMETHOD _ < /etc/crouton/xmethod export XMETHOD else echo 'X11 backend not set.' 1>&2 exit 1 fi fi xmethodtype="${XMETHOD%%-}" xmethodargs="${XMETHOD#-}"

Record the name of the chroot in the root window properties

if [ -f '/etc/crouton/name' ] && hash xprop 2>/dev/null; then xprop -root -f CROUTON_NAME 8s -set CROUTON_NAME "cat '/etc/crouton/name'" fi

Record the crouton XMETHOD in the root window properties

xprop -root -f CROUTON_XMETHOD 8s -set CROUTON_XMETHOD "$XMETHOD"

Launch the powerd poker daemon

croutonpowerd --daemon &

Launch the clipboard synchronization daemon

if hash croutonclip 2>/dev/null; then croutonclip & fi

Launch system-wide trigger daemon

croutontriggerd &

Apply the Chromebook keyboard map. Not needed for non-Freon xiwi.

if [ "$xmethodtype" != 'xiwi' -o ! -f "/sys/class/tty/tty0/active" ]; then

Apply the Chromebook keyboard map if installed.

if [ -f '/usr/share/X11/xkb/compat/chromebook' ]; then
    setxkbmap -model chromebook
fi

fi

Input-related stuff is not needed for kiwi

if [ "$xmethodtype" != "xiwi" ]; then

# Launch X-server-local key binding daemon
xbindkeys -fg /etc/crouton/xbindkeysrc.scm

# Launch touchegg if it is requested.
toucheggconf='/etc/touchegg.conf'
if [ -f "$toucheggconf" ]; then
    mkdir -p "$HOME/.config/touchegg"
    ln -sf "$toucheggconf" "$HOME/.config/touchegg/"
    touchegg 2>/dev/null &
fi

# Configure trackpad settings if needed
if synclient >/dev/null 2>&1; then
    # Elan trackpads usually like these settings
    if grep -q 'Elan Touchpad' /sys/class/input/event*/device/name; then
        SYNCLIENT="FingerLow=1 FingerHigh=5 $SYNCLIENT"
    fi
    # Other special cases
    case "`awk -F= '/_RELEASE_BOARD=/{print $2}' '/var/host/lsb-release'`" in
        butterfly*|eve*|falco*)
            SYNCLIENT="FingerLow=1 FingerHigh=5 $SYNCLIENT";;
        parrot*|peppy*|wolf*)
            SYNCLIENT="FingerLow=5 FingerHigh=10 $SYNCLIENT";;
    esac
    if [ -n "$SYNCLIENT" ]; then
        synclient $SYNCLIENT
    fi
fi

fi

Crouton-in-a-tab: Start fbserver and launch display

if [ "$xmethodtype" = 'xiwi' ]; then

The extension sends evdev key codes: fix the keyboard mapping rules

setxkbmap -rules evdev
# Reapply xkb map: This fixes autorepeat mask in "xset q"
xkbcomp "$DISPLAY" - | xkbcomp - "$DISPLAY" 2>/dev/null

# Set resolution to a default 1024x768, this is important so that the DPI
# looks reasonable when the WM/DE start.
setres 1024 768 > /dev/null
croutonfbserver "$DISPLAY" &

try=1
while ! croutoncycle force "$DISPLAY"; do
    echo "Cannot connect to extension, retrying..."
    if [ "$try" -ge 10 ]; then
        echo "\

Unable to start display, make sure the crouton extension is installed and enabled, and up to date. (download from https://goo.gl/OVQOEt)" 1>&2 ret=1 break fi sleep 1 try="$((try+1))" done if [ "$ret" -eq 0 ]; then echo "Connected to extension, launched crouton in a window." 1>&2 fi fi

if [ "$xmethodtype" = "xorg" ]; then

Since Chromium 56.0.2923.0, Chromium tries to switch off the display when

# switching VT (crbug.com/655770). For some unclear reason, running xrandr
# forces the display to be back on, and this is not needed ever again
# when switching VTs.
# The loop tries to work around a race that is more likely on xenial
try=1
while xrandr --auto 2>&1 | grep . 1>&2; do
    echo "Kicking xrandr again" 1>&2
    if [ "$try" -ge 10 ]; then
        break
    fi
    sleep 1
    try="$((try+1))"
done

fi

Only run if no error occured before (e.g. cannot connect to extension)

if [ "$ret" -eq 0 ]; then

Shell is the leader of a process group, so signals sent to this process

# are propagated to its children. We ignore signals in this process, but the
# child handles them and exits. We use a no-op handler, as "" causes the
# signal to be ignored in children as well (see NOTES in "man 2 sigaction"
# for details). This process then runs exit commands, and terminates.
trap "true" HUP INT TERM

# Run the client itself if it is executable, otherwise run it in a shell.
if [ -n "$binary" -o -x "$cmd" ]; then
    "$cmd" $extraargs "$@" || ret=$?
else
    /bin/sh "$cmd" $extraargs "$@" || ret=$?
fi

trap - HUP INT TERM

fi

Run crouton-specific commands before the server exits:

echo "Running exit commands..." 1>&2

exit "$ret"

TomTravis commented 2 years ago

i got the server to start via xorg.conf in /etc/X11 however the graphics will not connect the crouton xinit in /usrlocal/bin is being used mate starts the server will not connect yet

TomTravis commented 2 years ago

i have to admit hacking now the server starts via the crouton xorg.conf bit hangs and requires reboot xfce4... mate kde I need to read up on Xorg video Nvidia is now the game it appears maybe not the kernel has been updated in bookworm for nvidia as is Ubuntu for free86 dummy
the chromeOS I/F is still not connecting mouse and keyboard ,, this is why reboot

TomTravis commented 2 years ago

im getting very verbose message the console kit is not installed apparently so ,, cros_secure console= loglevel=7 is not happening at server start it complains tty is not present

Kernel command line: cros_secure console= loglevel=7 init=/sbin/init cros_secure drm.trace=0x106 root=/dev/dm-0 rootwait ro dm_verity.error_behavior=3 dm_verity.max_bios=-1 dm_verity.dev_wait=1 dm="1 vroot none ro 1,0 4077568 verity payload=PARTUUID=1d128873-d1cb-5f47-960d-68e7a9818db0/PARTNROFF=1 hashtree=PARTUUID=1d128873-d1cb-5f47-960d-68e7a9818db0/PARTNROFF=1 hashstart=4077568 alg=sha256 root_hexdigest=e74cdb6a8b750cbf2b6dfc25ad8b7ea07cefc58b53ef98ee60834db4a684ba8d salt=4d7ed087a033cf5dfe4b11b8da0bcb302c1de1f7bdc44a92040f8aa7d59ddbdd" noinitrd vt.global_cursor_default=0 kern_guid=1d128873-d1cb-5f47-960d-68e7a9818db0 cpuidle.governor=teo

TomTravis commented 2 years ago

My guess is to review the Intel Free86 video org install for crouton the chomeOS console works with this xiwi uses the chomeoOS console and dummy Free86 drivers this also now has issues with res and clk

dnschneid commented 2 years ago

I can't pretend I've read all of that, but if you're trying to use the proprietary nvidia drivers, you have to build the kernel modules against the ChromeOS kernel and include them in the root partition (outside the chroot). It's super messy and probably won't work. You might want to look at some of the tutorials and issues floating around for running VirtualBox in crouton; it's kind of the same problem.

You also might have better luck with nouveau?

TomTravis commented 2 years ago

debian installed them also kali have them i did not choose the nvidia drivers debootstrap debian did

TomTravis commented 2 years ago

the xorg server starts no keyboard or pointer it hangs in wait state reboot is the only way to recover the stock kernel now has nivdia modules installed https://packages.debian.org/bookworm/nvidia-kernel-dkms linux-headers-cloud-arm64 this update the nvidia kernel the second time with patches installed bookworm sid kali jammy xorg has not worked in debootstrap crouton for a long time xiwi did work not anymore

TomTravis commented 2 years ago

xorg.txt it appears some edit and change in package install for crouton kms kernels