Add scripts for linux-surface and secure-boot

This commit is contained in:
Manuel Thalmann 2022-11-12 13:14:02 +01:00
parent a49500995c
commit bbf9dd197b
3 changed files with 68 additions and 0 deletions

View file

@ -8,6 +8,10 @@ sudo hostnamectl set-hostname ManuSurface
sudo apt update
sudo apt upgrade
# Install surface-linux and Secure Boot
source "$dir/../scripts/PopOS/linux-surface.sh"
source "$dir/../scripts/PopOS/secure-boot.sh"
# Install Brave
source "$dir/../scripts/PopOS/softwate/brave.sh"
source "$dir/../scripts/PopOS/software/brave-extensions.sh"

View file

@ -0,0 +1,22 @@
#!/bin/bash
# Elevate script
if [ ! "$UID" -eq 0 ]
then
exec sudo bash "$0"
fi
wget -qO - https://raw.githubusercontent.com/linux-surface/linux-surface/master/pkg/keys/surface.asc \
| gpg --dearmor | sudo dd of=/etc/apt/trusted.gpg.d/linux-surface.gpg
echo "deb [arch=amd64] https://pkg.surfacelinux.com/debian release main" \
| sudo tee /etc/apt/sources.list.d/linux-surface.list
apt update
apt install linux-image-surface linux-headers-surface iptsd libwacom-surface
systemctl enable iptsd
# Install DTX
package=$(mktemp)
wget https://github.com/linux-surface/surface-dtx-daemon/releases/download/v0.3.3-2/surface-dtx-daemon_0.3.3-2_amd64.deb -O $package
dpkg -i $package
rm -f $package

View file

@ -0,0 +1,42 @@
#!/bin/bash
# Elevate script
if [ ! "$UID" -eq 0 ]
then
exec sudo bash "$0"
fi
# Create context directory
workingDirectory=$(pwd)
contextRoot=$(mktemp -d)
cd $contextRoot
# Initialize variables
esp=/boot/efi
defaultBootDir=$esp/EFI/BOOT
microsoftBootDir=$esp/EFI/Microsoft/Boot
systemdDirName=/EFI/systemd
systemdFullName=$esp$systemdDirName
systemdFile=$systemdFullName/systemd-bootx64.efi
loaderBaseName=loader.efi
systemdLoaderFile=$systemdFullName/$loaderBaseName
# Install PreLoader
wget https://blog.hansenpartnership.com/wp-uploads/2013/HashTool.efi
wget https://blog.hansenpartnership.com/wp-uploads/2013/PreLoader.efi
cp {HashTool,PreLoader}.efi $systemdFullName
cp $systemdFile $systemdLoaderFile
efibootmgr --unicode --disk /dev/nvme0n1 --part 0 --create --label "PreLoader" --loader $systemdDirName/PreLoader.efi
# Add fallbacks
cp ./HashTool.efi $defaultBootDir
cp $systemdFile $defaultBootDir/$loaderBaseName
cp ./PreLoader.efi $defaultBootDir/BOOTx64.EFI
# Add Microsoft fallbacks
mkdir -p $microsoftBootDir
cp ./PreLoader.efi $microsoftBootDir/bootmgfw.efi
cp ./HashTool.efi $microsoftBootDir
cp $systemdFile $microsoftBootDir/$loaderBaseName