mirror of
https://github.com/RobotechLille/cdf2018-principal
synced 2025-09-07 18:30:24 +02:00
Commit initial
This commit is contained in:
commit
e0cb79d1cc
57 changed files with 2128 additions and 0 deletions
2
raspberrypi/board/robotech/cdfprincipal/linux-extra.conf
Normal file
2
raspberrypi/board/robotech/cdfprincipal/linux-extra.conf
Normal file
|
@ -0,0 +1,2 @@
|
|||
MEDIA_SUPPORT=n
|
||||
SOUND=n
|
42
raspberrypi/board/robotech/cdfprincipal/post-build.sh
Executable file
42
raspberrypi/board/robotech/cdfprincipal/post-build.sh
Executable file
|
@ -0,0 +1,42 @@
|
|||
#!/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
|
||||
echo -e "
|
||||
auto wlan0
|
||||
iface wlan0 inet static
|
||||
address $ADDRESS
|
||||
netmask $NETMASK
|
||||
gateway $GATEWAY
|
||||
" >> ${TARGET_DIR}/etc/network/interfaces
|
||||
|
||||
# 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
|
||||
|
41
raspberrypi/board/robotech/cdfprincipal/rootfs_overlay/etc/extra.d/S40wifi
Executable file
41
raspberrypi/board/robotech/cdfprincipal/rootfs_overlay/etc/extra.d/S40wifi
Executable file
|
@ -0,0 +1,41 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Connect to Wi-Fi network
|
||||
#
|
||||
|
||||
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
|
||||
echo "OK"
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
start
|
||||
;;
|
||||
stop)
|
||||
stop
|
||||
;;
|
||||
restart|reload)
|
||||
stop
|
||||
start
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart}"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
exit $?
|
27
raspberrypi/board/robotech/cdfprincipal/rootfs_overlay/etc/extra.d/rcK
Executable file
27
raspberrypi/board/robotech/cdfprincipal/rootfs_overlay/etc/extra.d/rcK
Executable file
|
@ -0,0 +1,27 @@
|
|||
#!/bin/sh
|
||||
|
||||
|
||||
# Stop all init scripts in /etc/extra.d
|
||||
# executing them in reversed numerical order.
|
||||
#
|
||||
for i in $(ls -r /etc/extra.d/S??*) ;do
|
||||
|
||||
# Ignore dangling symlinks (if any).
|
||||
[ ! -f "$i" ] && continue
|
||||
|
||||
case "$i" in
|
||||
*.sh)
|
||||
# Source shell script for speed.
|
||||
(
|
||||
trap - INT QUIT TSTP
|
||||
set stop
|
||||
. $i
|
||||
)
|
||||
;;
|
||||
*)
|
||||
# No sh extension, so fork subprocess.
|
||||
$i stop
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
27
raspberrypi/board/robotech/cdfprincipal/rootfs_overlay/etc/extra.d/rcS
Executable file
27
raspberrypi/board/robotech/cdfprincipal/rootfs_overlay/etc/extra.d/rcS
Executable file
|
@ -0,0 +1,27 @@
|
|||
#!/bin/sh
|
||||
|
||||
|
||||
# Start all init scripts in /etc/extra.d
|
||||
# executing them in numerical order.
|
||||
#
|
||||
for i in /etc/extra.d/S??* ;do
|
||||
|
||||
# Ignore dangling symlinks (if any).
|
||||
[ ! -f "$i" ] && continue
|
||||
|
||||
case "$i" in
|
||||
*.sh)
|
||||
# Source shell script for speed.
|
||||
(
|
||||
trap - INT QUIT TSTP
|
||||
set start
|
||||
. $i
|
||||
)
|
||||
;;
|
||||
*)
|
||||
# No sh extension, so fork subprocess.
|
||||
$i start
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Changes keyboard layout to AZERTY
|
||||
#
|
||||
|
||||
start() {
|
||||
printf "Starting AZERTY keyboard: "
|
||||
loadkmap < /usr/share/keyboard/fr-latin9.bmap
|
||||
echo "OK"
|
||||
}
|
||||
|
||||
stop() {
|
||||
printf "Stopping AZERTY keyboard: "
|
||||
echo "OK"
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
start
|
||||
;;
|
||||
stop)
|
||||
stop
|
||||
;;
|
||||
restart|reload)
|
||||
stop
|
||||
start
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart}"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
exit $?
|
38
raspberrypi/board/robotech/cdfprincipal/rootfs_overlay/etc/init.d/S50chef
Executable file
38
raspberrypi/board/robotech/cdfprincipal/rootfs_overlay/etc/init.d/S50chef
Executable file
|
@ -0,0 +1,38 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Start main program
|
||||
#
|
||||
|
||||
EXEC=$(which sh)
|
||||
PIDFILE=/var/run/chef.pid
|
||||
LOGFILE=/var/run/chef.log
|
||||
|
||||
start() {
|
||||
printf "Starting chef: "
|
||||
start-stop-daemon -p "$PIDFILE" -x "$EXEC" -b -m -S -- "/opt/chef/run.sh" -l "$LOGFILE"
|
||||
echo "OK"
|
||||
}
|
||||
|
||||
stop() {
|
||||
printf "Stopping chef: "
|
||||
start-stop-daemon -p "$PIDFILE" -x "$EXEC" -K
|
||||
echo "OK"
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
start
|
||||
;;
|
||||
stop)
|
||||
stop
|
||||
;;
|
||||
restart|reload)
|
||||
stop
|
||||
start
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart}"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
exit $?
|
37
raspberrypi/board/robotech/cdfprincipal/rootfs_overlay/etc/init.d/S90extra
Executable file
37
raspberrypi/board/robotech/cdfprincipal/rootfs_overlay/etc/init.d/S90extra
Executable file
|
@ -0,0 +1,37 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Start extra services when not in debug mode
|
||||
#
|
||||
|
||||
start() {
|
||||
printf "Starting extra services: "
|
||||
if ! /opt/cdf/bin/testpin 0 1
|
||||
then
|
||||
/etc/extra.d/rcS
|
||||
fi
|
||||
echo "OK"
|
||||
}
|
||||
|
||||
stop() {
|
||||
printf "Stopping extra services: "
|
||||
/etc/extra.d/rcK
|
||||
echo "OK"
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
start
|
||||
;;
|
||||
stop)
|
||||
stop
|
||||
;;
|
||||
restart|reload)
|
||||
stop
|
||||
start
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart}"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
exit $?
|
|
@ -0,0 +1,13 @@
|
|||
#/bin/bash
|
||||
|
||||
alias la='ls -al'
|
||||
alias ll='ls -l'
|
||||
alias cp="cp -i"
|
||||
alias mv="mv -i"
|
||||
alias free='free -m'
|
||||
alias df='df -h'
|
||||
|
||||
export PS1="[\u@\h \$] "
|
||||
export PS2="> "
|
||||
export PS3="+ "
|
||||
export PS4="- "
|
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue