LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 06-07-2022, 08:12 PM   #1
jmarca
LQ Newbie
 
Registered: Jan 2017
Location: Costa Mesa, CA
Distribution: Slackware 15-current
Posts: 8

Rep: Reputation: Disabled
Thunderbolt control -- is there a slackbuild for bolt/boltd or similar?


I have a new System76 lemur pro, with a thunderbolt 4 port.

I have been running down how to get the usb-c/thunderbolt 4 port to work consistently.

After chasing every new kernel in -current for a few weeks, I still couldn't get it working. Today I upgraded to kernel 5.18.2 (from testing), and the port still didn't work.

By "didn't work" I mean I plug in my logitech webcam into the USB-c/thunderbolt port, and /var/log/messages shows nothing at all. If I wrap the cord with a usb-c to usb-a converter and plug into a regular usb-a port, the webcam works fine.

Following the advice from the arch linux wiki, installed the following rule in /etc/udev/rules.d/99-removable.rules

Code:
ACTION=="add", SUBSYSTEM=="thunderbolt", ATTR{authorized}=="0", ATTR{authorized}="1"
This did the trick. After rebooting, now when I plug my webcam in it works okay.

But this is NOT the right way to do things, as far as I can make out. It seems there is a userspace controller called "boltd" (used in arch, gentoo, etc) that can manage assigning permissions to devices attached to the thunderbolt port.

I tried to create a slackbuild for bolt but failed. I am rusty with sysadmin stuff these days. Has anybody else gotten bolt to work under Slackware?

Thanks in advance
 
Old 06-08-2022, 04:44 PM   #2
kjhambrick
Senior Member
 
Registered: Jul 2005
Location: Round Rock, TX
Distribution: Slackware64 15.0 + Multilib
Posts: 2,159

Rep: Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512
jmarca --

I've been casually looking for a solution for my disfunctional 'Discrete Thunderbolt Interface' without any luck

I was thinking you might have found the answer but alas, bolt is built on systemd so unless you mod the code to bypass the systemd-specific stuff, it's a no go ...

I think you are close with the udev rule but I am not sure ...

One thing that I believe you'll want to append to this thread is `lspci` and `lsusb` output for your System76 lemur pro ...

Sorry I can't help ...

-- kjh
 
Old 06-08-2022, 10:02 PM   #3
0XBF
Member
 
Registered: Nov 2018
Distribution: Slackware
Posts: 765

Rep: Reputation: 863Reputation: 863Reputation: 863Reputation: 863Reputation: 863Reputation: 863Reputation: 863
Here is a slackbuild I made up for bolt. It seems to build properly, boltctl starts the boltd daemon, but I dont have any hardware to test it out with. You can try it if you want. Just copy/paste to make these three files, download the source thats listed in the .info file, and run the slackbuild against it. I just used a slackbuild template, so it will be tagged SBo.

bolt.SlackBuild:
Code:
#!/bin/bash

# Slackware build script for bolt

# Copyright 2022 0xBF
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
#
#  THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
#  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
#  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
#  EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
#  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
#  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
#  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
#  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
#  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
#  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

cd $(dirname $0) ; CWD=$(pwd)

PRGNAM=bolt
VERSION=${VERSION:-0.9.2}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}

if [ -z "$ARCH" ]; then
  case "$( uname -m )" in
    i?86) ARCH=i586 ;;
    arm*) ARCH=arm ;;
       *) ARCH=$( uname -m ) ;;
  esac
fi

if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  exit 0
fi

TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}

if [ "$ARCH" = "i586" ]; then
  SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
  SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
  SLKCFLAGS="-O2 -fPIC"
  LIBDIRSUFFIX="64"
else
  SLKCFLAGS="-O2"
  LIBDIRSUFFIX=""
fi

set -e

rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tar.?z
cd $PRGNAM-$VERSION
chown -R root:root .
find -L . \
 \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  -o -perm 511 \) -exec chmod 755 {} \; -o \
 \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;

mkdir build
cd build
  CFLAGS="$SLKCFLAGS" \
  CXXFLAGS="$SLKCFLAGS" \
  meson .. \
    --buildtype=release \
    --infodir=/usr/info \
    --libdir=/usr/lib${LIBDIRSUFFIX} \
    --localstatedir=/var \
    --mandir=/usr/man \
    --prefix=/usr \
    --sysconfdir=/etc \
    -Dstrip=true \
    -Dsystemd=false
  "${NINJA:=ninja}"
  DESTDIR=$PKG $NINJA install
cd ..

find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
  | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true

find $PKG/usr/man -type f -exec gzip -9 {} \;
for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done

mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a \
  BUGS.md CHANGELOG.md COPYING HACKING.md README.md \
  $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild

mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc

cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE
bolt.info:
Code:
PRGNAM="bolt"
VERSION="0.9.2"
HOMEPAGE="https://gitlab.freedesktop.org/bolt/bolt"
DOWNLOAD="https://gitlab.freedesktop.org/bolt/bolt/-/archive/0.9.2/bolt-0.9.2.tar.gz"
MD5SUM="e6862790bcf868636c026c7a84583ae8"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES=""
MAINTAINER=""
EMAIL=""
slack-desc:
Code:
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description.
# Line up the first '|' above the ':' following the base package name, and
# the '|' on the right side marks the last column you can put a character in.
# You must make exactly 11 lines for the formatting to be correct.  It's also
# customary to leave one space after the ':' except on otherwise blank lines.

    |-----handy-ruler------------------------------------------------------|
bolt: bolt (Thunderbolt 3 Device Manager)
bolt:
bolt: Userspace system daemon to enable security levels for Thunderbolt on
bolt: GNU/Linux.
bolt:
bolt:
bolt:
bolt:
bolt:
bolt: https://gitlab.freedesktop.org/bolt/bolt
bolt:
Note that I have the -Dsystemd=false set as per the documented meson options, but it doesnt seem to do anything in either case and bolt builds fine with or without it. It does note that the systemd switch is depreciated so I guess it doesn't really depend on systemd.

Hope it works out for you.
 
1 members found this post helpful.
Old 06-09-2022, 12:22 PM   #4
jmarca
LQ Newbie
 
Registered: Jan 2017
Location: Costa Mesa, CA
Distribution: Slackware 15-current
Posts: 8

Original Poster
Rep: Reputation: Disabled
Thanks for the slackbuild. However, building bolt and installing via the slackbuild did not work for me.

I had an incredibly polluted system with some manual installs of bolt in different directories, so it wasn't really a fair test. However, I am not optimistic. The net effect of installing bolt via the slackbuild was to stop the system from recognizing my external camera.

I had a very difficult time reverting to a state where the video camera was recognized, but finally got there by find-ing anything under /usr/share with "*bolt*" in the name and deleting the various policies etc.

Then, with *only* the rule in /etc/udev/rules.d I copied above, the camera is detected and usable.

output of lspci -k:

Code:
00:00.0 Host bridge: Intel Corporation 11th Gen Core Processor Host Bridge/DRAM Registers (rev 01)
	Subsystem: Intel Corporation 11th Gen Core Processor Host Bridge/DRAM Registers
	Kernel modules: igen6_edac
00:02.0 VGA compatible controller: Intel Corporation TigerLake-LP GT2 [Iris Xe Graphics] (rev 01)
	DeviceName: VGA compatible controller
	Subsystem: CLEVO/KAPOK Computer TigerLake-LP GT2 [Iris Xe Graphics]
	Kernel driver in use: i915
	Kernel modules: i915
00:04.0 Signal processing controller: Intel Corporation TigerLake-LP Dynamic Tuning Processor Participant (rev 01)
	Subsystem: Intel Corporation TigerLake-LP Dynamic Tuning Processor Participant
	Kernel modules: processor_thermal_device_pci_legacy
00:06.0 PCI bridge: Intel Corporation 11th Gen Core Processor PCIe Controller (rev 01)
	Subsystem: Intel Corporation 11th Gen Core Processor PCIe Controller
	Kernel driver in use: pcieport
00:07.0 PCI bridge: Intel Corporation Tiger Lake-LP Thunderbolt 4 PCI Express Root Port #0 (rev 01)
	Subsystem: Intel Corporation Tiger Lake-LP Thunderbolt 4 PCI Express Root Port
	Kernel driver in use: pcieport
00:08.0 System peripheral: Intel Corporation GNA Scoring Accelerator module (rev 01)
	Subsystem: Intel Corporation GNA Scoring Accelerator module
00:0a.0 Signal processing controller: Intel Corporation Tigerlake Telemetry Aggregator Driver (rev 01)
	Subsystem: Intel Corporation Tigerlake Telemetry Aggregator Driver
	Kernel driver in use: intel_vsec
	Kernel modules: intel_vsec
00:0d.0 USB controller: Intel Corporation Tiger Lake-LP Thunderbolt 4 USB Controller (rev 01)
	Subsystem: Intel Corporation Tiger Lake-LP Thunderbolt 4 USB Controller
	Kernel driver in use: xhci_hcd
	Kernel modules: xhci_pci
00:0d.2 USB controller: Intel Corporation Tiger Lake-LP Thunderbolt 4 NHI #0 (rev 01)
	Subsystem: Device 2222:1111
	Kernel modules: thunderbolt
00:14.0 USB controller: Intel Corporation Tiger Lake-LP USB 3.2 Gen 2x1 xHCI Host Controller (rev 20)
	Subsystem: Intel Corporation Tiger Lake-LP USB 3.2 Gen 2x1 xHCI Host Controller
	Kernel driver in use: xhci_hcd
	Kernel modules: xhci_pci
00:14.2 RAM memory: Intel Corporation Tiger Lake-LP Shared SRAM (rev 20)
	Subsystem: Intel Corporation Tiger Lake-LP Shared SRAM
00:14.3 Network controller: Intel Corporation Wi-Fi 6 AX201 (rev 20)
	Subsystem: Intel Corporation Wi-Fi 6 AX201
	Kernel driver in use: iwlwifi
	Kernel modules: iwlwifi
00:15.0 Serial bus controller: Intel Corporation Tiger Lake-LP Serial IO I2C Controller #0 (rev 20)
	Subsystem: Intel Corporation Tiger Lake-LP Serial IO I2C Controller
	Kernel driver in use: intel-lpss
	Kernel modules: intel_lpss_pci
00:15.1 Serial bus controller: Intel Corporation Tiger Lake-LP Serial IO I2C Controller #1 (rev 20)
	Subsystem: Intel Corporation Tiger Lake-LP Serial IO I2C Controller
	Kernel driver in use: intel-lpss
	Kernel modules: intel_lpss_pci
00:16.0 Communication controller: Intel Corporation Tiger Lake-LP Management Engine Interface (rev 20)
	Subsystem: Intel Corporation Tiger Lake-LP Management Engine Interface
	Kernel driver in use: mei_me
	Kernel modules: mei_me
00:19.0 Serial bus controller: Intel Corporation Tiger Lake-LP Serial IO I2C Controller #4 (rev 20)
	Subsystem: Intel Corporation Tiger Lake-LP Serial IO I2C Controller
	Kernel driver in use: intel-lpss
	Kernel modules: intel_lpss_pci
00:19.2 Communication controller: Intel Corporation Device a0c7 (rev 20)
	Subsystem: Intel Corporation Device 7270
	Kernel driver in use: intel-lpss
	Kernel modules: intel_lpss_pci
00:1c.0 PCI bridge: Intel Corporation Tigerlake PCH-LP PCI Express Root Port #6 (rev 20)
	Subsystem: CLEVO/KAPOK Computer Tigerlake PCH-LP PCI Express Root Port
	Kernel driver in use: pcieport
00:1f.0 ISA bridge: Intel Corporation Tiger Lake-LP LPC Controller (rev 20)
	Subsystem: Intel Corporation Tiger Lake-LP LPC Controller
00:1f.3 Audio device: Intel Corporation Tiger Lake-LP Smart Sound Technology Audio Controller (rev 20)
	Subsystem: Intel Corporation Tiger Lake-LP Smart Sound Technology Audio Controller
	Kernel driver in use: snd_hda_intel
	Kernel modules: snd_hda_intel, snd_sof_pci_intel_tgl
00:1f.4 SMBus: Intel Corporation Tiger Lake-LP SMBus Controller (rev 20)
	Subsystem: Intel Corporation Tiger Lake-LP SMBus Controller
	Kernel driver in use: i801_smbus
	Kernel modules: i2c_i801
00:1f.5 Serial bus controller: Intel Corporation Tiger Lake-LP SPI Controller (rev 20)
	Subsystem: Intel Corporation Tiger Lake-LP SPI Controller
01:00.0 Non-Volatile memory controller: Samsung Electronics Co Ltd NVMe SSD Controller PM9A1/PM9A3/980PRO
	Subsystem: Samsung Electronics Co Ltd NVMe SSD Controller PM9A1/PM9A3/980PRO
	Kernel driver in use: nvme
23:00.0 SD Host controller: O2 Micro, Inc. SD/MMC Card Reader Controller (rev 01)
	Subsystem: O2 Micro, Inc. SD/MMC Card Reader Controller
	Kernel driver in use: sdhci-pci
	Kernel modules: sdhci_pci

output of lsusb:

Code:
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 003: ID 04f2:b729 Chicony Electronics Co., Ltd Chicony USB2.0 Camera
Bus 003 Device 002: ID 1209:2303 Generic Atreus
Bus 003 Device 004: ID 8087:0026 Intel Corp. AX201 Bluetooth
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 002: ID 046d:0893 Logitech, Inc. StreamCam
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
One note...with the bolt code installed, the StreamCam entry was NOT there in the output of lsusb.


I will try again tomorrow, as I have hit my tolerance for wrestling with hardware for the day!

One comment on the slackbuild. I think there needs to be an entry in /etc/rc.d to start the daemon. There is some discussion in the bolt issues about being able to start it automatically using systemd, but that isn't relevant in slackware. The gentoo build also does not seem to use systemd, but it has an entry for gentoo's openrc system. See https://gitweb.gentoo.org/repo/gento...bolt.openrc-r1

Last edited by jmarca; 06-09-2022 at 12:24 PM. Reason: added a note aboout lsusb output
 
Old 06-09-2022, 03:18 PM   #5
0XBF
Member
 
Registered: Nov 2018
Distribution: Slackware
Posts: 765

Rep: Reputation: 863Reputation: 863Reputation: 863Reputation: 863Reputation: 863Reputation: 863Reputation: 863
Yes having crud left over from a manual compile and install will probably mess with things. The slackbuild should keep things packaged and easy to remove but there may be conflicts with leftover files that haven't been cleaned up from prior experiments. I'm also not sure what udev rules you cooked up and may be interacting with the same hardware that boltd manages. It'd be best to test in a clean environment.

I noticed that the 'boltd' daemon starts up automatically when you run 'boltctl' commands, so I assumed that starting the daemon automatically at boot would be unnecessary. For testing you can probably just manually start it from its installed location /usr/libexec/boltd, or just run a boltctl command first to activate it.

The proper way would probably be to make an /etc/rc.d/rc.bolt script to do a simple start/stop/restart, with a pidfile or some check to ensure its only started once. If starting it at boot is critical then a simple "/usr/libexec/boltd &" in /etc/rc.d/rc.local should start it at boot, though a proper script would be preferred. If you get thunderbolt working manually, you can always add a start/stop script afterwards.

Like I said last post, I dont have any hardware to actually test thunderbolt with so all I did was give you a slackbuild to build and package it with. No guarantees that it works, and I have no advice on how to configure it with your hardware.
 
Old 06-09-2022, 06:35 PM   #6
jmarca
LQ Newbie
 
Registered: Jan 2017
Location: Costa Mesa, CA
Distribution: Slackware 15-current
Posts: 8

Original Poster
Rep: Reputation: Disabled
Yes I understand. I meant no disrespect, more just taking notes here on todo items as I encounter them, for myself and for anyone else following along in the future. I'm more than capable of hacking away at this on my own, and I plan to do so.

On the other hand, I am really behind the curve on udev, polkit, etc. Slackware has been working out of the box so nicely for the past few versions that I rarely have to work hard to get my hardware working anymore, so I've not been keeping up to date with all the things happening under the hood.
 
1 members found this post helpful.
  


Reply

Tags
thunderbolt



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Udoo Bolt Gear mini-PC launches with Ryzen V1000 Udoo Bolt SBC LXer Syndicated Linux News 0 05-30-2020 07:32 AM
LXer: Bolt Will Tackle Thunderbolt 3 Security on Linux LXer Syndicated Linux News 0 12-19-2017 08:29 PM
LXer: Install Bolt CMS on Centos 7 LXer Syndicated Linux News 0 11-24-2017 06:17 PM
LXer: Install Bolt CMS on an Ubuntu VPS with Nginx and MariaDB LXer Syndicated Linux News 0 05-23-2014 06:10 PM
LXer: Google Chrome OS Tablet Demo Video Like a Bolt From The Blue LXer Syndicated Linux News 0 02-03-2010 05:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 05:44 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration