Open bpranoto opened 4 years ago
Thank you for the guide!
Thank you. Actually, I think this will be better going into the README or wiki.
Correction, the make command in dkms.conf should be:
MAKE[0]="'make' KERNELDIR=/lib/modules/${kernelver}/build"
Since p8023.ko
is no longer created by the makefile, updated dkms.conf
(including correction by @bpranoto):
MAKE[0]="'make' KERNELDIR=/lib/modules/${kernelver}/build"
CLEAN="make clean"
BUILT_MODULE_NAME[0]="ipx"
BUILT_MODULE_LOCATION[0]="./"
DEST_MODULE_LOCATION[0]="/kernel"
PACKAGE_NAME="ipx"
PACKAGE_VERSION="1.0"
AUTOINSTALL=yes
And for the sake of completeness, I whipped up full install script for this kernel module and the userspace utils. Tested on Ubuntu 24.10 with kernel 6.11.0-9-generic
#!/usr/bin/env bash
# Compile IPX kernel module using DKMS, and install IPX-Utils for management
# need to be root
if [ "$(id -u)" != "0" ]; then
echo "Must be run as root"
exit 1
fi
# sanity check
if [ "$(uname -s)" != "Linux" ]; then
echo "Only works on Linux!"
exit 1
fi
set -e # bail on any errors
# install needed packages
apt-get update
apt-get install -y build-essential automake linux-source dkms git make gcc curl unzip pahole
# fetch the latest ipx source and place it in a reasonable location
cd /tmp
if [ -f master.zip ]; then
rm master.zip
fi
if [ -d ipx-master ]; then
rm -rf ipx-master
fi
curl -LO https://github.com/pasis/ipx/archive/master.zip
unzip master.zip
rm master.zip
if [ -d "/usr/src/ipx-1.0" ]; then
rm -r "/usr/src/ipx-1.0"
fi
mv ipx-master /usr/src/ipx-1.0
cd /usr/src/ipx-1.0
# Create the DKMS configuration file
cat <<'EOF_DKMSCONF' >dkms.conf
MAKE[0]="'make' KERNELDIR=/lib/modules/${kernelver}/build"
CLEAN="make clean"
BUILT_MODULE_NAME[0]="ipx"
BUILT_MODULE_LOCATION[0]="./"
DEST_MODULE_LOCATION[0]="/kernel"
PACKAGE_NAME="ipx"
PACKAGE_VERSION="1.0"
AUTOINSTALL=yes
EOF_DKMSCONF
# add this package to DKMS database
dkms add -m ipx -v 1.0 || {
echo "looks like ipx module might already be registered, removing and re-adding"
dkms remove -m ipx -v 1.0 --all
dkms add -m ipx -v 1.0
}
# first build
dkms build -m ipx -v 1.0
# install it
dkms install -m ipx -v 1.0
# load the kernal at boot
mkdir -p /etc/modules-load.d
cat <<EOF_IPXCONF >/etc/modules-load.d/ipx.conf
p8022
psnap
p8023
ipx
EOF_IPXCONF
# compile and install IPX userspace utilities
cd /tmp
if [ -f master.zip ]; then
rm master.zip
fi
if [ -d ipx-master ]; then
rm -rf ipx-utils-master
fi
curl -LO https://github.com/pasis/ipx-utils/archive/master.zip
unzip master.zip
rm master.zip
mv ipx-utils-master /usr/src/ipx-utils-1.2
echo "compiling ipx-utils"
cd /usr/src/ipx-utils-1.2
aclocal
autoconf
automake --add-missing
./configure
make
make install
echo "Done setting up IPX kernel module and userspace utils."
echo "please reboot"
This is not a bug report but my experience how I install this modul with DKMS so whenever a kernel upgrade, this module will be automatically recompiled and reinstalled. Hope this will help other people who still needs ipx with the modern linux.
My system is ubuntu 18.04 with kernel version 5.4.0-54-generic.
Install dkms and build-essential
sudo apt install dkms build-essential
Create directory /usr/src/ipx-1.0
sudo mkdir /usr/src/ipx-1.0
Download this repository source https://github.com/pasis/ipx/archive/master.zip
Extract the zip file, place the files to /usr/src/ipx-1.0 , here is mine:
MAKE="'make'" CLEAN="make clean" BUILT_MODULE_NAME[0]="ipx" BUILT_MODULE_LOCATION[0]="./" DEST_MODULE_LOCATION[0]="/kernel" BUILT_MODULE_NAME[1]="p8023" BUILT_MODULE_LOCATION[1]="./" DEST_MODULE_LOCATION[1]="/kernel" PACKAGE_NAME="ipx" PACKAGE_VERSION="1.0" AUTOINSTALL=yes
p8022 psnap p8023 ipx
ipx 28672 0 p8023 16384 1 ipx psnap 16384 1 ipx p8022 16384 1 ipx
bambang@bambang-Vostro-1014:/usr/src/ipx-1.0$ dkms status ipx, 1.0, 5.4.0-54-generic, x86_64: installed