• 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:
@@ -12,39 +12,41 @@ while [ $# -gt 0 ]; do
|
||||
shift 1
|
||||
done
|
||||
|
||||
|
||||
if $UPDATE_PY; then
|
||||
systemctl stop bbctrl
|
||||
|
||||
# Update service
|
||||
rm -f /etc/init.d/bbctrl
|
||||
cp scripts/bbctrl.service /etc/systemd/system/
|
||||
cp ./installer/config/bbctrl.service /etc/systemd/system/
|
||||
systemctl daemon-reload
|
||||
systemctl enable bbctrl
|
||||
fi
|
||||
|
||||
if $UPDATE_AVR; then
|
||||
chmod +x ./scripts/avr109-flash.py
|
||||
./scripts/avr109-flash.py src/avr/bbctrl-avr-firmware.hex
|
||||
chmod +x ./installer/scripts/avr109-flash.py
|
||||
./installer/scripts/avr109-flash.py src/avr/bbctrl-avr-firmware.hex
|
||||
fi
|
||||
|
||||
# Update config.txt
|
||||
./scripts/edit-boot-config max_usb_current=1 config_hdmi_boost=8 hdmi_force_hotplug=1 hdmi_group=2 hdmi_mode=82
|
||||
./installer/scripts/edit-boot-config \
|
||||
disable_overscan=1 \
|
||||
framebuffer_width=1280 \
|
||||
framebuffer_height=720 \
|
||||
nohz=on \
|
||||
dtparam=sd_overclock=100 \
|
||||
max_usb_current=1 \
|
||||
config_hdmi_boost=8 \
|
||||
disable_splash=1 \
|
||||
hdmi_force_hotplug=1 \
|
||||
hdmi_group=2 \
|
||||
hdmi_mode=82
|
||||
|
||||
# TODO Enable GPU
|
||||
#./scripts/edit-boot-config dtoverlay=vc4-kms-v3d
|
||||
#./scripts/edit-boot-config gpu_mem=16
|
||||
#./installer/scripts/edit-boot-config \
|
||||
# dtoverlay=vc4-kms-v3d \
|
||||
# gpu_mem=16
|
||||
#chmod ug+s /usr/lib/xorg/Xorg
|
||||
|
||||
# Use the full screen resolution
|
||||
# grep "^framebuffer_width=1280$" /boot/config.txt >/dev/null
|
||||
# if [ $? -eq 0 ]; then
|
||||
# mount -o remount,rw /boot &&
|
||||
# sed -i 's/^\(framebuffer_.*\)$/#\1/g' /boot/config.txt
|
||||
# mount -o remount,ro /boot
|
||||
# REBOOT=true
|
||||
# fi
|
||||
|
||||
# Fix camera
|
||||
grep dwc_otg.fiq_fsm_mask /boot/cmdline.txt >/dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
@@ -73,14 +75,20 @@ sed -i 's/^TimeoutStartSec=.*$/TimeoutStartSec=1/' \
|
||||
/etc/systemd/system/network-online.target.wants/networking.service
|
||||
|
||||
# Change to US keyboard layout
|
||||
sed -i 's/^XKBLAYOUT="gb"$/XKBLAYOUT="us" # Comment stops change on upgrade/' \
|
||||
/etc/default/keyboard
|
||||
sed -i 's/^XKBLAYOUT="gb"$/XKBLAYOUT="us" # Comment stops change on upgrade/' /etc/default/keyboard
|
||||
|
||||
# Set the default locale to en_US
|
||||
grep '^en_US.UTF-8 UTF-8' /etc/locale.gen >/dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
perl -pi -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/g' /etc/locale.gen
|
||||
locale-gen en_US.UTF-8
|
||||
update-locale en_US.UTF-8
|
||||
fi
|
||||
|
||||
# Setup USB stick automount
|
||||
diff ./scripts/11-automount.rules /etc/udev/rules.d/11-automount.rules \
|
||||
>/dev/null
|
||||
diff ./installer/config/11-automount.rules /etc/udev/rules.d/11-automount.rules >/dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
cp ./scripts/11-automount.rules /etc/udev/rules.d/
|
||||
cp ./installer/config/11-automount.rules /etc/udev/rules.d/
|
||||
sed -i 's/^\(MountFlags=slave\)/#\1/' \
|
||||
/lib/systemd/system/systemd-udevd.service
|
||||
REBOOT=true
|
||||
@@ -93,28 +101,31 @@ if [ $? -ne 0 ]; then
|
||||
REBOOT=true
|
||||
fi
|
||||
|
||||
# Set the default locale to en_US
|
||||
grep '^en_US.UTF-8 UTF-8' /etc/locale.gen >/dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
perl -pi -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/g' /etc/locale.gen
|
||||
locale-gen en_US.UTF-8
|
||||
update-locale en_US.UTF-8
|
||||
fi
|
||||
|
||||
# Install .Xresources & .xinitrc
|
||||
cp scripts/Xresources ~pi/.Xresources
|
||||
cp ./installer/config/Xresources ~pi/.Xresources
|
||||
chown pi:pi ~pi/.Xresources
|
||||
cp scripts/xinitrc ~pi/.xinitrc
|
||||
cp ./installer/config/xinitrc ~pi/.xinitrc
|
||||
chmod +x ~pi/.xinitrc
|
||||
chown pi:pi ~pi/.xinitrc
|
||||
|
||||
#Configure the "ratpoison" window manager
|
||||
# Configure the "ratpoison" window manager
|
||||
if [ ! -e ~pi/.ratpoisonrc ]; then
|
||||
cp scripts/ratpoisonrc ~pi/.ratpoisonrc
|
||||
cp ./installer/config/ratpoisonrc ~pi/.ratpoisonrc
|
||||
chmod 644 ~pi/.ratpoisonrc
|
||||
chown pi:pi ~pi/.ratpoisonrc
|
||||
fi
|
||||
|
||||
# Configure the Plymouth graphical bootloader with the Onefinity theme
|
||||
if [ ! -e /usr/share/plymouth/themes/onefinity/onefinity.plymouth ]; then
|
||||
mkdir -p /usr/share/plymouth/themes/onefinity/
|
||||
cp -av installer/splash/* /usr/share/plymouth/themes/onefinity/
|
||||
plymouth-set-default-theme -R onefinity
|
||||
fi
|
||||
grep 'quiet splash plymouth.ignore-serial-consoles logo.nologo' /boot/cmdline.txt >/dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
echo -n " quiet splash plymouth.ignore-serial-consoles logo.nologo" >> /boot/cmdline.txt
|
||||
fi
|
||||
|
||||
# Install bbserial
|
||||
MODSRC=src/bbserial/bbserial.ko
|
||||
MODDST=/lib/modules/$(uname -r)/kernel/drivers/tty/serial/bbserial.ko
|
||||
@@ -126,7 +137,7 @@ if [ $? -ne 0 ]; then
|
||||
fi
|
||||
|
||||
# Install rc.local
|
||||
cp scripts/rc.local /etc/
|
||||
cp ./installer/config/rc.local /etc/
|
||||
|
||||
# Install bbctrl
|
||||
if $UPDATE_PY; then
|
||||
@@ -135,7 +146,7 @@ if $UPDATE_PY; then
|
||||
rm -rf /usr/local/lib/python*/dist-packages/bbctrl-*
|
||||
|
||||
# Ensure python dependencies are installed
|
||||
pip3 install --no-index --find-links python-packages -r requirements.txt
|
||||
pip3 install --no-index --find-links installer/python-packages -r requirements.txt
|
||||
|
||||
./setup.py install --force
|
||||
|
||||
@@ -146,26 +157,26 @@ if $UPDATE_PY; then
|
||||
fi
|
||||
|
||||
# Expand the file system if necessary
|
||||
chmod +x ./scripts/resize_root_fs.sh
|
||||
./scripts/resize_root_fs.sh
|
||||
chmod +x ./installer/scripts/resize_root_fs.sh
|
||||
./installer/scripts/resize_root_fs.sh
|
||||
if [ $? -eq 0 ]; then
|
||||
REBOOT=true
|
||||
fi
|
||||
|
||||
# Install our logrotate config
|
||||
cp ./scripts/bbctrl-logrotate /etc/logrotate.d/bbctrl
|
||||
cp ./installer/config/bbctrl-logrotate /etc/logrotate.d/bbctrl
|
||||
chown root:root /etc/logrotate.d/bbctrl
|
||||
|
||||
# Ensure logrotate runs on every boot (for systems with no network, thus bad clock)
|
||||
if [ ! -e /etc/cron.d/reboot ]; then
|
||||
cp ./scripts/cron_d_reboot /etc/cron.d/reboot
|
||||
cp ./installer/config/cron_d_reboot /etc/cron.d/reboot
|
||||
mkdir -p /etc/cron.reboot
|
||||
cp ./scripts/cron_reboot_logrotate /etc/cron.reboot/logrotate
|
||||
cp ./installer/config/cron_reboot_logrotate /etc/cron.reboot/logrotate
|
||||
fi
|
||||
|
||||
# Delete some cookies that were left behind in older images
|
||||
chmod +x ./scripts/delete-cookies.py
|
||||
./scripts/delete-cookies.py
|
||||
chmod +x ./installer/scripts/delete-cookies.py
|
||||
./installer/scripts/delete-cookies.py
|
||||
pkill -HUP chromium # Force Chromium to restart, to see the cookie changes
|
||||
|
||||
# Get rid of some old files that were left behind in older images
|
||||
|
||||
Reference in New Issue
Block a user