1
0
mirror of https://github.com/krislamo/kernmod.git synced 2024-09-19 21:30:35 +00:00
kernmod/build.sh

30 lines
823 B
Bash
Raw Normal View History

2021-11-10 06:14:16 +00:00
#!/bin/bash
2022-02-01 04:04:50 +00:00
PACKAGE="helloworld"
2022-01-14 06:54:13 +00:00
VERSION="0.1"
2022-02-01 04:04:50 +00:00
REVISION="1"
BUILDDIR="$(mktemp -d)/${PACKAGE}_$VERSION-$REVISION"
2022-01-14 06:54:13 +00:00
2022-02-01 04:04:50 +00:00
# Place sources and build package
mkdir -p "$BUILDDIR/usr/src/${PACKAGE}-$VERSION"
mkdir -p "$BUILDDIR/etc"
mkdir -p "$BUILDDIR/DEBIAN"
cp -r /vagrant/src/usr/src/* "$BUILDDIR/usr/src/${PACKAGE}-$VERSION"
cp -r /vagrant/src/etc/* "$BUILDDIR/etc"
cp -r /vagrant/src/DEBIAN/* "$BUILDDIR/DEBIAN"
cd "$BUILDDIR/.."
dpkg-deb --build "${PACKAGE}_$VERSION-$REVISION"
# Install package
2021-11-10 06:14:16 +00:00
export DEBIAN_FRONTEND=noninteractive
apt-get update
2022-02-01 04:04:50 +00:00
apt-get install -y linux-headers-$(uname -r)
apt-get install -y "./${PACKAGE}_$VERSION-$REVISION.deb"
2022-01-14 06:54:13 +00:00
# Load module and show details about it
modinfo helloworld
2021-11-10 06:14:16 +00:00
cat /proc/modules | grep helloworld
rmmod helloworld
2022-02-01 04:04:50 +00:00
modprobe helloworld
2021-11-10 06:14:16 +00:00
cat /var/log/messages | grep helloworld