Skip to content
This repository was archived by the owner on Aug 13, 2024. It is now read-only.

Commit 7e766d8

Browse files
committed
further documentation
1 parent fb59274 commit 7e766d8

File tree

2 files changed

+36
-2
lines changed

2 files changed

+36
-2
lines changed

README.md

+9-2
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,17 @@ For Raspberry Pi (Jessie):
2222
* `sudo rpi-update` (maybe first `sudo apt-get install rpi-update`)
2323
* `git clone https://github.com/Appyx/gpio-reflect.git`
2424
* `cd gpio-reflect`
25-
* `sudo ./install.sh` (This will take some time)
25+
* `sudo ./build.sh` (This will take some time)
2626
* `sudo insmod gpio-reflect [options]`
2727

28-
The install script needs to build the right kernel tree, so it can take several minutes to complete. To speed this up you can install it manually with the tutorial linked above.
28+
The build script needs to build the right kernel tree, so it can take several minutes to complete. To speed this up you can build it manually with the tutorial linked above.
29+
30+
For a permanent installation (Raspberry Pi):
31+
32+
* copy `gpio-reflect.ko` to `/lib/modules/$(uname -r)/kernel/drivers`
33+
* add `gpio-reflect` to `/etc/modules`
34+
* create the file `/etc/modprobe.d/gpio-reflect.conf`
35+
* add the options to the file in the form: `options gpio-reflect param1=value1 param2=value2...`
2936

3037

3138
## Usage

build.sh

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
apt-get install bc
2+
echo "cloning kernel source"
3+
git clone https://github.com/raspberrypi/linux kernel
4+
cd kernel
5+
FIRMWARE_HASH=$(zgrep "* firmware as of" /usr/share/doc/raspberrypi-bootloader/changelog.Debian.gz | head -1 | awk '{ print $5 }')
6+
KERNEL_HASH=$(wget https://raw.github.com/raspberrypi/firmware/$FIRMWARE_HASH/extra/git_hash -O -)
7+
echo "checking out branch"
8+
git checkout $KERNEL_HASH
9+
echo "cleaning kernel source"
10+
make mrproper
11+
echo "applying kernel configuration"
12+
sudo modprobe configs
13+
zcat /proc/config.gz > .config
14+
make -j6 oldconfig
15+
echo "building kernel"
16+
make -j6
17+
cd ..
18+
echo "builing module"
19+
make -j6 -C kernel M=$(pwd) modules
20+
21+
22+
23+
24+
25+
26+
27+

0 commit comments

Comments
 (0)