• Reorganized the scripts into different categories

• Refactored the graphical boot screens to have separate boot and shutdown images
• Changed the reboot and shutdown code to force the display of the splash images.
• Added 'Team Onefinity.ngc' to the installer files
This commit is contained in:
David Carley
2022-07-23 20:04:17 -07:00
parent 15a98972b3
commit 41e2334484
36 changed files with 743 additions and 324 deletions

View File

@@ -0,0 +1,10 @@
KERNEL!="sd[a-z]*", GOTO="automount_end"
IMPORT{program}="/sbin/blkid -o udev -p %N"
ENV{ID_FS_TYPE}=="", GOTO="automount_end"
ENV{ID_FS_LABEL}!="", ENV{dir_name}="%E{ID_FS_LABEL}"
ENV{ID_FS_LABEL}=="", ENV{dir_name}="usb-%k"
ACTION=="add", ENV{mount_options}="relatime"
ACTION=="add", ENV{ID_FS_TYPE}=="vfat|ntfs", ENV{mount_options}="$env{mount_options},utf8,gid=100,umask=002,sync"
ACTION=="add", RUN+="/bin/mkdir -p /media/%E{dir_name}", RUN+="/bin/mount -o $env{mount_options} /dev/%k /media/%E{dir_name}"
ACTION=="remove", ENV{dir_name}!="", RUN+="/bin/umount -l /media/%E{dir_name}", RUN+="/bin/rmdir /media/%E{dir_name}"
LABEL="automount_end"

View File

@@ -0,0 +1,2 @@
xterm*faceSize: 12
xterm*faceName: DejaVu Sans Mono

View File

@@ -0,0 +1,8 @@
/var/log/bbctrl.log {
rotate 4
weekly
compress
missingok
notifempty
copytruncate
}

View File

@@ -0,0 +1,15 @@
[Unit]
Description=Buildbotics Controller
After=network.target
[Service]
User=root
ExecStart=/usr/local/bin/bbctrl -l /var/log/bbctrl.log
WorkingDirectory=/var/lib/bbctrl
Restart=always
StandardOutput=null
Nice=-10
KillMode=process
[Install]
WantedBy=multi-user.target

View File

@@ -0,0 +1 @@
@reboot root run-parts /etc/cron.reboot

View File

@@ -0,0 +1,4 @@
#!/bin/sh
test -x /usr/sbin/logrotate || exit 0
/usr/sbin/logrotate /etc/logrotate.conf

View File

@@ -0,0 +1,7 @@
startup_message off
set bgcolor black
set fgcolor white
unbind c
bind c exec x-terminal-emulator -fg white -bg black
bind C-c exec x-terminal-emulator -fg white -bg black

28
installer/config/rc.local Normal file
View File

@@ -0,0 +1,28 @@
#!/bin/bash
# Mount /boot read only
mount -o remount,ro /boot
# Load bbserial
echo 3f201000.serial > /sys/bus/amba/drivers/uart-pl011/unbind
modprobe -r bbserial
modprobe bbserial
# Set SPI GPIO mode
gpio mode 27 alt3
# Create browser memory limited cgroup
if [ -d sys/fs/cgroup/memory ]; then
CGROUP=/sys/fs/cgroup/memory/chrome
mkdir $CGROUP
chown -R pi:pi $CGROUP
echo 650000000 > $CGROUP/memory.soft_limit_in_bytes
echo 750000000 > $CGROUP/memory.limit_in_bytes
fi
# Reload udev
/etc/init.d/udev restart
# Start X in /home/pi
cd /home/pi
sudo -u pi startx

23
installer/config/xinitrc Normal file
View File

@@ -0,0 +1,23 @@
ratpoison &
xset -dpms
xset s off
xset s noblank
while true; do
tvservice -s 2>&1 | grep "state 0x40001" >/dev/null
if [ $? -ne 0 ]; then
# Clear browser errors
PREFS='/home/pi/.config/chromium/Default/Preferences'
sed -i 's/"exited_cleanly":false/"exited_cleanly":true/' $PREFS
sed -i 's/"exit_type":"Crashed"/"exit_type":"Normal"/' $PREFS
xrdb /home/pi/.Xresources
# Start browser
/usr/local/bin/browser --no-first-run --disable-infobars \
--noerrdialogs --disable-3d-apis http://localhost/
fi
sleep 1
done

View File

@@ -0,0 +1,3 @@
Section "ServerFlags"
Option "DontVTSwitch" "on"
EndSection