DoorPi/Makefile

55 lines
1.5 KiB
Makefile
Raw Normal View History

2021-03-09 15:57:03 +00:00
BR2_EXTERNAL=../br_external
2021-03-08 20:54:21 +00:00
all: sdcard.img
2021-03-09 16:02:04 +00:00
sdcard.img: root_overlay
sdcard.img: buildroot/.config
2021-03-08 20:54:21 +00:00
make -C buildroot all
cp buildroot/output/images/sdcard.img sdcard.img
2021-03-10 21:22:22 +00:00
root_overlay: root_overlay/bin/door.py
2021-03-09 15:57:03 +00:00
root_overlay: root_overlay/etc/door_tokens
root_overlay: root_overlay/etc/dropbear/dropbear_ecdsa_host_key
2021-03-09 17:19:04 +00:00
root_overlay: root_overlay/etc/wpa_supplicant/wpa_supplicant.conf
2021-03-09 15:57:03 +00:00
root_overlay: root_overlay/root/.ssh/authorized_keys
root_overlay: root_overlay/root/key
2021-03-08 20:54:21 +00:00
root_overlay/root/.ssh/authorized_keys: ~/.ssh/id_rsa.pub
2021-03-09 18:30:35 +00:00
mkdir -p `dirname $@`
2021-03-09 18:34:06 +00:00
cp $< $@
2021-03-08 20:54:21 +00:00
buildroot/.config: config
2021-03-09 16:02:04 +00:00
ln -sf ../config $@
2021-03-08 20:54:21 +00:00
2021-03-09 15:57:03 +00:00
root_overlay/etc/door_tokens:
mkdir -p `dirname $@`
touch $@
root_overlay/root/key:
mkdir -p `dirname $@`
dd if=/dev/urandom of=$@ bs=1 count=16
2021-03-10 21:22:22 +00:00
root_overlay/bin/door.py: door_control/door.py
2021-03-09 15:57:03 +00:00
mkdir -p `dirname $@`
cp $< $@
root_overlay/etc/dropbear/dropbear_ecdsa_host_key:
2021-03-16 17:54:13 +00:00
sh -c 'if [[ ! -f $@ && ! -f $@.openssh ]]; then mkdir -p `dirname $@` && ssh-keygen -t ecdsa -f $@.openssh; fi'
2021-03-09 15:57:03 +00:00
root_overlay/etc/wpa_supplicant/wpa_supplicant.conf:
mkdir -p `dirname $@`
@echo "Please enter the passphrase for the space wifi:"
wpa_passphrase Space > $@
2021-03-08 20:54:21 +00:00
clean:
make -C buildroot clean
rm -f sdcard.img
rm -f root_overlay/root/.ssh/authorized_keys
2021-03-10 21:22:22 +00:00
rm -f root_overlay/bin/door.py
2021-03-08 20:54:21 +00:00
2021-03-28 22:44:02 +00:00
menuconfig: buildroot/.config
2021-03-08 20:54:21 +00:00
make -C buildroot menuconfig
2021-03-28 22:44:02 +00:00
if [[ ! -L buildroot/.config ]]; then mv buildroot/.config config && ln -s ../config buildroot/.config; fi
2021-03-08 20:54:21 +00:00
2021-03-16 17:54:13 +00:00
.PHONY: all clean sdcard.img menuconfig root_overlay root_overlay/etc/dropbear/dropbear_ecdsa_host_key