slackbuilds/k/kmod-i2c-ch341/get_sources.sh
Michal Cieslakiewicz c9892a0f03 k/kmod-i2c-ch341: improve versioning and building.
Module versioning schema changed, now it is DATE_COMMIT_KERNEL.
Allow to build module against any kernel source specified by KERNSRC
environment variable.

Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
2022-01-30 18:36:09 +01:00

10 lines
327 B
Bash
Executable File

#!/bin/bash
set -x
SRC=i2c-ch341
APP=kmod-${SRC}
git clone https://github.com/gmarco/${SRC}.git
VERSION=$(cd $SRC && git log -n 1 --format='%cs_%h' --abbrev=8 | sed -e 's/-//g')
mv $SRC ${APP}-${VERSION}
tar cf - ${APP}-${VERSION} | xz -c9 > ${APP}-${VERSION}.tar.xz
[ -s ${APP}-${VERSION}.tar.xz ] && rm -rf ${APP}-${VERSION}