2018-02-07 17:57:01 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
if file ${BR2_EXTERNAL_CDF_PATH}/principalconf.sh &> /dev/null
|
|
|
|
then
|
|
|
|
source ${BR2_EXTERNAL_CDF_PATH}/principalconf.sh
|
|
|
|
|
|
|
|
# Wi-Fi configuration
|
|
|
|
mkdir -p ${TARGET_DIR}/etc/wpa_supplicant/
|
|
|
|
wpa_passphrase "$WPASSID" "$WPAPSK" > ${TARGET_DIR}/etc/wpa_supplicant/wpa_supplicant.conf
|
|
|
|
# Le ifup de Busybox ne supporte pas les options wpa-*, donc on utilisera les wpa_supplicant en direct
|
|
|
|
|
|
|
|
# Network configuration
|
2018-05-06 01:14:09 +02:00
|
|
|
echo -e "# Interface configuration generated by raspberrypi/board/robotech/cdfprincipal/post-build.sh
|
|
|
|
|
2018-05-04 18:40:05 +02:00
|
|
|
auto lo
|
|
|
|
iface lo inet loopback
|
|
|
|
|
2018-04-29 21:56:15 +02:00
|
|
|
auto eth0
|
|
|
|
iface eth0 inet static
|
|
|
|
address ${ETHADDRESS}
|
|
|
|
netmask 255.255.255.0
|
|
|
|
peer ${ETHPEER}
|
|
|
|
gateway ${ETHPEER}
|
|
|
|
|
2018-02-07 17:57:01 +01:00
|
|
|
auto wlan0
|
2018-04-29 21:56:15 +02:00
|
|
|
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
|
2018-05-06 01:14:09 +02:00
|
|
|
" > ${TARGET_DIR}/etc/network/interfaces
|
2018-02-07 17:57:01 +01:00
|
|
|
|
|
|
|
# SSH configuration
|
|
|
|
rm ${TARGET_DIR}/etc/dropbear &> /dev/null
|
|
|
|
mkdir -p ${TARGET_DIR}/etc/dropbear/
|
|
|
|
echo "$SSHSPRV" | base64 -d > ${TARGET_DIR}/etc/dropbear/dropbear_ecdsa_host_key
|
|
|
|
mkdir -p ${TARGET_DIR}/root/.ssh/
|
|
|
|
echo "$SSHCPUB" > ${TARGET_DIR}/root/.ssh/authorized_keys
|
|
|
|
else
|
|
|
|
echo "Récupérez le fichier principalconf.sh pour pouvoir vous connecter au vrai robot !"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Demote some services
|
|
|
|
for service in S20urandom S40network S50dropbear
|
|
|
|
do
|
|
|
|
if [ -f ${TARGET_DIR}/etc/init.d/${service} ]
|
|
|
|
then
|
|
|
|
mv ${TARGET_DIR}/etc/init.d/${service} ${TARGET_DIR}/etc/extra.d/${service}
|
|
|
|
fi
|
|
|
|
|
|
|
|
done
|
|
|
|
|
|
|
|
dd if=/dev/urandom of=${TARGET_DIR}/etc/random-seed bs=512 count=1
|
|
|
|
|