mirror of
https://github.com/richardghirst/PiBits.git
synced 2025-02-20 14:54:14 +01:00
split install into base install and install_autostart
This commit is contained in:
parent
38d0ea5a44
commit
dd49a2f394
@ -1,6 +1,7 @@
|
||||
KERNEL_TREE := /home/richard/github/linux
|
||||
INSTALL_PATH := /lib/modules/$(shell /bin/uname -r)/kernel/drivers/misc/servoblaster
|
||||
|
||||
.PHONY: all install install_autostart
|
||||
all: servoblaster.ko
|
||||
|
||||
servoblaster.ko: servoblaster.c servoblaster.h
|
||||
@ -12,16 +13,21 @@ servodemo: servodemo.c servoblaster.h
|
||||
gcc -Wall -g -O2 -o servodemo servodemo.c -Wl,--export-dynamic `pkg-config --cflags gtk+-3.0 gmodule-export-2.0` `pkg-config --libs gtk+-3.0 gmodule-export-2.0`
|
||||
|
||||
install: servoblaster.ko
|
||||
@echo "Installing servoblaster (requires root privileges)..."
|
||||
@sudo cp $(PWD)/udev_scripts/servoblaster /lib/udev
|
||||
@sudo cp $(PWD)/udev_scripts/20-servoblaster.rules /etc/udev/rules.d
|
||||
@sudo chmod +x /lib/udev/servoblaster
|
||||
@echo "Servoblaster udev rules complete."
|
||||
|
||||
install_autostart: install
|
||||
@echo "Enabling servoblaster autostart on boot."
|
||||
@sudo mkdir -p $(INSTALL_PATH)
|
||||
@sudo cp ./servoblaster.ko $(INSTALL_PATH)
|
||||
@if ! grep servoblaster /etc/modules > /dev/null 2>&1; then sudo sed -i '$$a\servoblaster' /etc/modules; fi
|
||||
@sudo depmod -a
|
||||
@sudo modprobe servoblaster
|
||||
@echo "Installation complete."
|
||||
@echo "ServoBlaster will now auto start on next boot."
|
||||
@echo "The following commands will start and stop the driver:"
|
||||
@echo " modprobe servoblaster"
|
||||
@echo " modprobe -r servoblaster"
|
||||
|
||||
clean:
|
||||
make -C ${KERNEL_TREE} ARCH=arm CROSS_COMPILE=/usr/bin/arm-linux-gnueabi- M=$(PWD) clean
|
||||
|
Loading…
x
Reference in New Issue
Block a user