Discussion:
Running PCI arbiter on stock Debian image
Damien Zammit
2018-10-29 10:19:57 UTC
Permalink
Hi there!

I am interested in getting more driver support into the Hurd.

I started by rebasing/compiling the PCI arbiter patches and documenting
the steps required to make it all work on the stock Debian disk image.
Note you might need to extend the disk image to get more disk space
before attempting this on the actual disk image.
(I had to repartition mine which was a bit fiddly).

Please see below and attached tarball with all rebased patches:
Please note that I reconstructed this document after I completed it.
It's more a set of pseudo instructions - not just bash commands.

I hope this small effort is put to good use to get these patches ready
for merging soon before they need another rebase.

#################
# Preparation
sudo apt-get update
sudo apt-get install git vim
sudo apt-get install libc0.3-dev xutils-dev zlib1g-dev

# Get updated headers to prepare for glibc update
cd ~
git clone https://git.savannah.gnu.org/git/hurd/hurd.git
## apply patch for pci: 0001-hurd-PCI-arbiter.patch
cd hurd/hurd
sudo cp pci.defs hurd_types.{h,defs} /usr/include/hurd
sudo chmod o+r /usr/include/hurd/pci.defs

## Add to /usr/include/hurd/paths.h:
#define _SERVERS_BUS _SERVERS "bus"

# Build an updated glibc
cd ~
sudo apt-get build-dep glibc
apt-get source glibc
rm -fr glibc-2.27
git clone https://salsa.debian.org/glibc-team/glibc.git glibc-2.27
## apply my patch
0001-glibc-Add-pci-to-libhurduser-requires-change-to-hurd.patch
tar -xf glibc_2.27.orig.tar.xz
cd glibc-2.27
## Remove debian/sysdeps/hurd-i386.mk ifeq block for xen (dont build xen
port)
DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage -us -uc

## install new glibc and locales (*.deb)
## reboot

# Get upstream libpciaccess - patch and install
cd ~
git clone https://gitlab.freedesktop.org/xorg/lib/libpciaccess.git
cd libpciaccess
## apply patch: 0001-libpciaccess-New-module-for-the-Hurd.patch
autoreconf -fi
./configure --prefix=
sudo make install

# Get upstream pciutils - patch and install
cd ~
git clone git://git.kernel.org/pub/scm/utils/pciutils/pciutils.git
## apply 2x patches:
# 0001-pciutils-A-new-module-for-the-Hurd-that-accesses-PCI-bus-usin.patch
# 0002-pciutils-Add-ability-to-detect-GNU-Hurd-when-configuring.patch
./autogen.sh
make
## hack makefile to install to /sbin and headers to /usr/include
sudo apt-get remove pciutils
sudo make install

# Finally, build pci-arbiter and install it
cd ~
mkdir build-hurd
cd build-hurd
../hurd/configure --prefix=
make pci-arbiter
sudo cp pci-arbiter/pci-arbiter /hurd

# Magic
sudo mkdir -p /servers/bus/pci
sudo settrans /servers/bus/pci /hurd/pci-arbiter

sudo /sbin/lspci -A hurd
## nice output

su -
cd /servers/bus/pci/0000/...

#################

Cheers,
Damien
Samuel Thibault
2018-10-30 01:18:53 UTC
Permalink
Hello,
Thanks!

That allowed me to take the remaining time to polish & commit it and I'm
uploading it to Debian. I'll then upload a patched glibc and patched
pciutils/libpciaccess on debian-ports for people to easily try them.
(as you mentioned on IRC, netdde seems to be fine with using it)

Samuel
Samuel Thibault
2018-10-30 01:24:00 UTC
Permalink
Post by Samuel Thibault
Hello,
Thanks!
That allowed me to take the remaining time to polish & commit it and I'm
uploading it to Debian. I'll then upload a patched glibc and patched
pciutils/libpciaccess on debian-ports for people to easily try them.
(as you mentioned on IRC, netdde seems to be fine with using it)
The next step would be what I mentioned in my mails: pciutils &
libpciaccess patches should be made to be able to failback to x86
access.

Samuel
Damien Zammit
2018-11-02 12:19:02 UTC
Permalink
I have another patch for each of libpciaccess and pciutils that go on
top of my previous ones.

This provides fallback mechanism for when servers/bus/pci is unavailable
it will fall back to regular x86 access methods for both libraries.

See attached.

Thanks,
Damien
Samuel Thibault
2018-11-02 20:05:41 UTC
Permalink
Hello,
Post by Damien Zammit
I have another patch for each of libpciaccess and pciutils that go on
top of my previous ones.
This provides fallback mechanism for when servers/bus/pci is unavailable
it will fall back to regular x86 access methods for both libraries.
That looks good :) Could you submit them upstream? (you can merge the
two patches) It'll then be easy to make them cherry-picked in Debian.

Thanks!
Samuel

Loading...