Thunderbolt control -- is there a slackbuild for bolt/boltd or similar?
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
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?
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 ...
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
# 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.
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.
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
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.