Compare commits
2 commits
3fc2b97b27
...
144fa010cb
Author | SHA1 | Date | |
---|---|---|---|
|
144fa010cb | ||
|
34c2b9e8d3 |
5 changed files with 151 additions and 73 deletions
|
@ -1,62 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# This script configures the machines to auto-launch Moonlight streaming on startup.
|
|
||||||
|
|
||||||
|
|
||||||
function configureMachine() {
|
|
||||||
|
|
||||||
# Update everything.
|
|
||||||
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys D5AFC5E2A4987676 241FE6973B765FAE
|
|
||||||
apt-get -y update
|
|
||||||
apt-get -y upgrade
|
|
||||||
apt-get -y dist-upgrade
|
|
||||||
apt-get -y autoremove
|
|
||||||
|
|
||||||
# Tools for us.
|
|
||||||
apt-get -y install mc joe openssh-server
|
|
||||||
|
|
||||||
# Disable screensaver.
|
|
||||||
sed -i 's/mode:[[:space:]]*blank/mode: off/' /home/${SUDO_USER}/.xscreensaver
|
|
||||||
xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/dpms-enabled -t bool -s false
|
|
||||||
|
|
||||||
# Change clock format.
|
|
||||||
plugin_name="$( xfconf-query -c xfce4-panel -p /plugins -lv | grep -E '/plugins/plugin-[0-9]+.*clock' | cut -d" " -f '1-1' )"
|
|
||||||
xfconf-query -c xfce4-panel -p ${plugin_name}/digital-format -t "string" -s '<span font="18">%T</span>%n<span font="12">%Y-%m-%d</span>' -n
|
|
||||||
|
|
||||||
# Install Moonlight.
|
|
||||||
apt-get -y install flatpak
|
|
||||||
flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
|
|
||||||
flatpak install -y flathub com.moonlight_stream.Moonlight
|
|
||||||
|
|
||||||
# Configure Moonlight.
|
|
||||||
sudo -i -u ${SUDO_USER} flatpak run com.moonlight_stream.Moonlight quit # This generates the ~/.var/ structure for the config.
|
|
||||||
wget https://forge.duensing.digital/Duensing_Digital/chromebook-linux/raw/branch/master/Moonlight.conf
|
|
||||||
chown ${SUDO_USER}:${SUDO_USER} Moonlight.conf
|
|
||||||
mv Moonlight.conf "/home/${SUDO_USER}/.var/app/com.moonlight_stream.Moonlight/config/Moonlight Game Streaming Project/."
|
|
||||||
|
|
||||||
# Add icon to desktop
|
|
||||||
cat <<- ICON > /home/${SUDO_USER}/Desktop/Moonlight.desktop
|
|
||||||
[Desktop Entry]
|
|
||||||
Version 1.0
|
|
||||||
Type Application
|
|
||||||
Name Moonlight
|
|
||||||
Comment Game Streaming Client
|
|
||||||
Exec /home/${SUDO_USER}/moonlight.sh
|
|
||||||
icon palemoon
|
|
||||||
Path /home/${SUDO_USER}
|
|
||||||
Terminal false
|
|
||||||
StartupNotify false
|
|
||||||
ICON
|
|
||||||
|
|
||||||
# Make Moonlight run on startup.
|
|
||||||
mkdir -p /home/${SUDO_USER}/.config/autostart
|
|
||||||
ln -s /home/${SUDO_USER}/Desktop/Moonlight.desktop /home/${SUDO_USER}/.config/autostart/.
|
|
||||||
chown -R ${SUDO_USER}:${SUDO_USER} /home/${SUDO_USER}/.config
|
|
||||||
|
|
||||||
# Reboot!
|
|
||||||
reboot
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# All the config is in a function so we can stream this script from forge.duensing.digital.
|
|
||||||
sudo configureMachine
|
|
118
configure-machine.sh
Normal file
118
configure-machine.sh
Normal file
|
@ -0,0 +1,118 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
|
||||||
|
# This script configures converted Lenovo N42 ChromeBooks loaded with Linux Mint XFCE.
|
||||||
|
|
||||||
|
|
||||||
|
function configureMachine() {
|
||||||
|
|
||||||
|
# Update everything.
|
||||||
|
apt-get -y update
|
||||||
|
apt-get -y upgrade
|
||||||
|
apt-get -y dist-upgrade
|
||||||
|
apt-get -y autoremove
|
||||||
|
|
||||||
|
# Tools for us.
|
||||||
|
apt-get -y install mc joe openssh-server
|
||||||
|
|
||||||
|
# Disable screensaver/blanking/dimming.
|
||||||
|
xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/dpms-enabled -t bool -s false --create
|
||||||
|
xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/blank-on-ac -s 0 --create
|
||||||
|
xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/brightness-on-ac -s 9 --create
|
||||||
|
xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/brightness-level-on-ac -s 100 --create
|
||||||
|
|
||||||
|
# Change clock format.
|
||||||
|
plugin_name="$( xfconf-query -c xfce4-panel -p /plugins -lv | grep -E '/plugins/plugin-[0-9]+.*clock' | cut -d" " -f '1-1' )"
|
||||||
|
xfconf-query -c xfce4-panel -p ${plugin_name}/digital-time-format -t "string" -s '%l:%M:%S %P' --create
|
||||||
|
xfconf-query -c xfce4-panel -p ${plugin_name}/digital-date-format -t "string" -s '%b %d, %Y' --create
|
||||||
|
|
||||||
|
# Disable unneeded desktop services.
|
||||||
|
mkdir -p /home/${SUDO_USER}/.config/autostart
|
||||||
|
declare -a disable=("light-locker" "mintreport" "mintupdate" "mintwelcome" "nvidia-prime" "sticky" "warpinator-autostart")
|
||||||
|
for i in "${disable[@]}"; do
|
||||||
|
echo -e "[Desktop Entry]\nHidden=True\n" > /home/${SUDO_USER}/.config/autostart/${i}.desktop
|
||||||
|
done
|
||||||
|
chown -R ${SUDO_USER}:${SUDO_USER} /home/${SUDO_USER}/.config/autostart
|
||||||
|
|
||||||
|
# Install Moonlight.
|
||||||
|
flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
|
||||||
|
flatpak install -y flathub com.moonlight_stream.Moonlight
|
||||||
|
|
||||||
|
# Configure Moonlight.
|
||||||
|
sudo -i -u ${SUDO_USER} flatpak run com.moonlight_stream.Moonlight quit # This generates the ~/.var/ structure for the config.
|
||||||
|
wget https://forge.duensing.digital/Duensing_Digital/chromebook-linux/raw/branch/master/Moonlight.conf
|
||||||
|
chown ${SUDO_USER}:${SUDO_USER} Moonlight.conf
|
||||||
|
mv Moonlight.conf "/home/${SUDO_USER}/.var/app/com.moonlight_stream.Moonlight/config/Moonlight Game Streaming Project/."
|
||||||
|
|
||||||
|
# Add icon to desktop
|
||||||
|
cat <<- ICON > /home/${SUDO_USER}/Desktop/Moonlight.desktop
|
||||||
|
[Desktop Entry]
|
||||||
|
Version=1.0
|
||||||
|
Type=Application
|
||||||
|
Name=Moonlight
|
||||||
|
Comment=Game Streaming Client
|
||||||
|
Exec=/home/${SUDO_USER}/moonlight.sh
|
||||||
|
Icon=network-idle
|
||||||
|
Path=/home/${SUDO_USER}
|
||||||
|
Terminal=false
|
||||||
|
StartupNotify=false
|
||||||
|
ICON
|
||||||
|
chown ${SUDO_USER}:${SUDO_USER} /home/${SUDO_USER}/Desktop/Moonlight.desktop
|
||||||
|
|
||||||
|
|
||||||
|
:<<SKIP
|
||||||
|
# Make Moonlight run on startup.
|
||||||
|
ln -s /home/${SUDO_USER}/Desktop/Moonlight.desktop /home/${SUDO_USER}/.config/autostart/.
|
||||||
|
chown -R ${SUDO_USER}:${SUDO_USER} /home/${SUDO_USER}/.config/autostart/Moonlight.desktop
|
||||||
|
SKIP
|
||||||
|
|
||||||
|
# Remove unnwanted software.
|
||||||
|
apt-get -y purge evolution-data-server
|
||||||
|
|
||||||
|
# Create auto-update script.
|
||||||
|
apt-get -y install shc
|
||||||
|
cat <<- UPDATE > /home/${SUDO_USER}/unsafe-update.sh
|
||||||
|
#!/bin/bash
|
||||||
|
###
|
||||||
|
### THIS IS TOTALLY NOT A SECURE WAY TO UPDATE ANYTHING! ###
|
||||||
|
###
|
||||||
|
if [[ -f unsafe-update-payload.sh ]]; then
|
||||||
|
rm -f unsafe-update-payload.sh
|
||||||
|
fi
|
||||||
|
wget https://forge.duensing.digital/Duensing_Digital/chromebook-linux/raw/branch/master/unsafe-update-payload.sh
|
||||||
|
if [[ -f unsafe-update-payload.sh ]]; then
|
||||||
|
source unsafe-update-payload.sh
|
||||||
|
unsafeUpdate
|
||||||
|
fi
|
||||||
|
UPDATE
|
||||||
|
shc -S -f /home/${SUDO_USER}/unsafe-update.sh
|
||||||
|
chmod u+s /home/${SUDO_USER}/unsafe-update.sh.x
|
||||||
|
rm /home/${SUDO_USER}/unsafe-update.sh.x.c
|
||||||
|
|
||||||
|
# Add auto update icon to autostart.
|
||||||
|
cat <<- ICON > /home/${SUDO_USER}/.config/autostart/AutoUpdate.desktop
|
||||||
|
[Desktop Entry]
|
||||||
|
Version=1.0
|
||||||
|
Type=Application
|
||||||
|
Name=Auto Update
|
||||||
|
Comment=Duensing Digital Client Auto Update
|
||||||
|
Exec=/home/${SUDO_USER}/unsafe-update.sh.x
|
||||||
|
Icon=mintupdate-type-backport
|
||||||
|
Path=/home/${SUDO_USER}
|
||||||
|
Terminal=true
|
||||||
|
StartupNotify=false
|
||||||
|
ICON
|
||||||
|
chown ${SUDO_USER}:${SUDO_USER} /home/${SUDO_USER}/.config/autostart/AutoUpdate.desktop
|
||||||
|
|
||||||
|
# Reboot!
|
||||||
|
reboot
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if [[ ${EUID} -ne 0 ]]; then
|
||||||
|
echo "${0} must be run as root."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# All the config is in a function so we can stream this script from forge.duensing.digital.
|
||||||
|
configureMachine
|
19
flash-uefi.sh
Normal file → Executable file
19
flash-uefi.sh
Normal file → Executable file
|
@ -1,21 +1,18 @@
|
||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
|
|
||||||
# From: https://docs.mrchromebox.tech/docs/support/unbricking/unbrick-ch341a.html
|
# From: https://docs.mrchromebox.tech/docs/support/unbricking/unbrick-ch341a.html
|
||||||
|
|
||||||
sudo apt-get -y install flashrom
|
|
||||||
|
|
||||||
wget https://raw.githubusercontent.com/MrChromebox/scripts/refs/heads/main/sources.sh # Look in here for available boards.
|
|
||||||
source ./sources.sh
|
source ./sources.sh
|
||||||
|
|
||||||
wget "${util_source}cbfstool.tar.gz" && tar -zxf cbfstool.tar.gz && chmod +x cbfstool
|
|
||||||
wget "${util_source}gbb_utility.tar.gz" && tar -zxf gbb_utility.tar.gz && chmod +x gbb_utility
|
|
||||||
wget "${fullrom_source}${coreboot_uefi_reks}" # "reks" is the board name for the model Chromebook you have.
|
|
||||||
|
|
||||||
sudo flashrom -p ch341a_spi -r original.rom
|
sudo flashrom -p ch341a_spi -r original.rom
|
||||||
./cbfstool original.rom read -r RO_VPD -f vpd.bin
|
./cbfstool original.rom read -r RO_VPD -f vpd.bin
|
||||||
./gbb_utility original.rom --get --hwid | sed 's/^hardware_id: //' > hwid.txt
|
./gbb_utility original.rom --get --hwid | sed 's/^hardware_id: //' > hwid.txt
|
||||||
|
sudo rm original.rom
|
||||||
|
|
||||||
./cbfstool "${coreboot_uefi_reks}" write -r RO_VPD -f vpd.bin
|
cp -f "${coreboot_uefi_reks}" new.rom
|
||||||
./cbfstool "${coreboot_uefi_reks}" add -n hwid -f hwid.txt -t raw
|
./cbfstool new.rom write -r RO_VPD -f vpd.bin
|
||||||
|
./cbfstool new.rom add -n hwid -f hwid.txt -t raw
|
||||||
|
rm vpd.bin
|
||||||
|
rm hwid.txt
|
||||||
|
|
||||||
sudo flashrom -p ch341a_spi -w "${coreboot_uefi_reks}" --ifd -i bios
|
sudo flashrom -p ch341a_spi -w new.rom --ifd -i bios
|
||||||
|
|
13
get-ready.sh
Executable file
13
get-ready.sh
Executable file
|
@ -0,0 +1,13 @@
|
||||||
|
#!/bin/bash -e
|
||||||
|
|
||||||
|
# From: https://docs.mrchromebox.tech/docs/support/unbricking/unbrick-ch341a.html
|
||||||
|
|
||||||
|
sudo apt-get -y install flashrom
|
||||||
|
|
||||||
|
wget https://raw.githubusercontent.com/MrChromebox/scripts/refs/heads/main/sources.sh # Look in here for available boards.
|
||||||
|
source ./sources.sh
|
||||||
|
|
||||||
|
wget "${util_source}cbfstool.tar.gz" && tar -zxf cbfstool.tar.gz && chmod +x cbfstool
|
||||||
|
wget "${util_source}gbb_utility.tar.gz" && tar -zxf gbb_utility.tar.gz && chmod +x gbb_utility
|
||||||
|
wget "${fullrom_source}${coreboot_uefi_reks}" # "reks" is the board name for the model Chromebook you have.
|
||||||
|
|
12
unsafe-update-payload.sh
Normal file
12
unsafe-update-payload.sh
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
function unsafeUpdate() {
|
||||||
|
# Handle system updates.
|
||||||
|
apt-get update
|
||||||
|
apt-get -fy upgrade
|
||||||
|
apt-get -fy dist-upgrade
|
||||||
|
apt-get -fy autoremove
|
||||||
|
if [[ -f /var/run/reboot-required ]] then
|
||||||
|
shutdown -r now
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Additional updates.
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue