DoorPi/Makefile

49 lines
1.4 KiB
Makefile
Raw Permalink 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-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
2022-11-06 18:03:11 +00:00
buildroot/.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
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-28 22:44:02 +00:00
menuconfig: buildroot/.config
2022-11-06 18:03:11 +00:00
make -C buildroot BR2_EXTERNAL=../br_external 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