summaryrefslogtreecommitdiff
path: root/libre/update-kernel-modules.sh
blob: e4c21c6ee4c33d640beda020804a402c348191b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash

usage() {
	echo "Usage: ./${0##*/} BASEKERNEL [KERNELNAME]"
	echo
	echo "Examples:"
	echo "    ./${0##*/} 3.16        # linux-libre"
	echo "    ./${0##*/} 3.14 -lts   # linux-libre-lts"
	echo "    ./${0##*/} 3.15 -grsec # linux-libre-grsec"
}

basekernel=$1
kernelname=$2

if [[ -z $basekernel ]]; then
	usage
	exit 1
fi

for kmod in acpi_call bbswitch lirc tp_smapi vhba-module; do
	if [[ -n $kernelname ]]; then
		rm -rf $kmod-parabola$kernelname
		cp -r $kmod-parabola $kmod-parabola$kernelname
	fi
	sed -r -e "s/^(_basekernel)=.*/\1=${basekernel}/" \
	       -e "s/^(_kernelname)=.*/\1=${kernelname}/" \
	       -i $kmod-parabola$kernelname/PKGBUILD
done