mirror of
https://github.com/RobotechLille/cdf2018-principal
synced 2024-12-22 05:30:37 +01:00
Remote connection via PPPoE
This commit is contained in:
parent
ad736b1a0e
commit
832306706d
|
@ -6,6 +6,8 @@ upgrade-all: upgrade-chef upgrade-arduino upgrade-fpga upgrade-filesystem
|
|||
|
||||
# Périphérique bloc à utiliser pour flasher
|
||||
SDCARD=/dev/mmcblk0
|
||||
CON_MODE=wifi
|
||||
ETH_IFACE=enp3s0
|
||||
|
||||
# SYSTÈME D'EXPLOITATION
|
||||
|
||||
|
@ -50,7 +52,12 @@ graphs:
|
|||
|
||||
# Crée un fichier de conf utilisable pour s'y connecter
|
||||
sshconf: principalconf.sh
|
||||
ifeq ($(CON_MODE), eth)
|
||||
source $$PWD/$<; echo -e "Host principal p\n User root\n Hostname $$ETHADDRESS\n PreferredAuthentications publickey\n PubkeyAuthentication yes\n IdentityFile \"$$PWD/sshkey\"" > "$@"
|
||||
source $$PWD/$<; sudo ip address add dev $(ETH_IFACE) $${ETHPEER}/20 peer $${ETHADDRESS}
|
||||
else
|
||||
source $$PWD/$<; echo -e "Host principal p\n User root\n Hostname $$ADDRESS\n PreferredAuthentications publickey\n PubkeyAuthentication yes\n IdentityFile \"$$PWD/sshkey\"" > "$@"
|
||||
endif
|
||||
source $$PWD/$<; echo -e "$$SSHCPRV" > sshkey
|
||||
chmod 600 sshkey
|
||||
|
||||
|
@ -72,10 +79,12 @@ reboot: sshconf
|
|||
upgrade-filesystem: sshconf configure
|
||||
make -C buildroot target-finalize
|
||||
@# TODO Récupérer les ACL plutot que de mettre tous les fichiers en root
|
||||
ssh -F sshconf principal true
|
||||
rsync --rsh 'ssh -F sshconf' --archive --chown root:root buildroot/output/target/ principal:/
|
||||
|
||||
# Met jour les overlays (une partie des fichiers)
|
||||
upgrade-overlays: sshconf
|
||||
ssh -F sshconf principal true
|
||||
rsync --rsh 'ssh -F sshconf' --archive --chown root:root robotech/chef/rootfs_overlay/ principal:/
|
||||
|
||||
# ARDUINO
|
||||
|
@ -97,5 +106,6 @@ chef:
|
|||
|
||||
upgrade-chef: chef
|
||||
make -C buildroot chef-reinstall
|
||||
ssh -F sshconf principal true
|
||||
rsync --rsh 'ssh -F sshconf' --archive --chown root:root buildroot/output/target/opt/chef principal:/opt/
|
||||
|
||||
|
|
|
@ -11,11 +11,17 @@ then
|
|||
|
||||
# Network configuration
|
||||
echo -e "
|
||||
auto eth0
|
||||
iface eth0 inet static
|
||||
address ${ETHADDRESS}
|
||||
netmask 255.255.255.0
|
||||
peer ${ETHPEER}
|
||||
gateway ${ETHPEER}
|
||||
|
||||
auto wlan0
|
||||
iface wlan0 inet static
|
||||
address $ADDRESS
|
||||
netmask $NETMASK
|
||||
gateway $GATEWAY
|
||||
iface wlan0 inet dhcp
|
||||
pre-up wpa_supplicant -D wext -B -iwlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf -P /var/run/wpa_supplicant.pid
|
||||
pre-down start-stop-daemon -K -q -p /var/run/wpa_supplicant.pid
|
||||
" >> ${TARGET_DIR}/etc/network/interfaces
|
||||
|
||||
# SSH configuration
|
||||
|
|
|
@ -7,15 +7,12 @@ start() {
|
|||
printf "Starting Wi-Fi connection: "
|
||||
# modprobe brcmfmac
|
||||
modprobe r8188eu
|
||||
ip link set wlan0 up
|
||||
wpa_supplicant -D wext -B -iwlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf -P /var/run/wpa_supplicant.pid
|
||||
ifup wlan0
|
||||
echo "OK"
|
||||
}
|
||||
|
||||
stop() {
|
||||
printf "Stopping Wi-Fi connection: "
|
||||
start-stop-daemon -K -q -p /var/run/wpa_supplicant.pid
|
||||
ifdown wlan0
|
||||
# rmmod brcmfmac
|
||||
rmmod r8188eu
|
||||
|
|
|
@ -1,11 +1,15 @@
|
|||
WPASSID="MySSID"
|
||||
WPAKEYMGMT="WPA-PSK"
|
||||
WPAPSK=mypassword
|
||||
ADDRESS=192.168.1.42
|
||||
ADDRESS=192.168.43.126
|
||||
NETMASK=255.255.255.0
|
||||
GATEWAY=192.168.1.1
|
||||
GATEWAY=192.168.43.1
|
||||
|
||||
ETHADDRESS=192.168.82.80
|
||||
ETHPEER=192.168.82.65
|
||||
|
||||
SSHCPUB="ecdsa-sha2-nistp256 ... principal@robotech"
|
||||
SSHCPRV="-----BEGIN EC PRIVATE KEY-----
|
||||
...
|
||||
-----END EC PRIVATE KEY-----"
|
||||
SSHSPRV="..."
|
||||
SSHSPRV="AAAAE2VjZHNhLXNo...
|
||||
|
|
Loading…
Reference in a new issue