1
0
mirror of https://github.com/tommytran732/Linux-Setup-Scripts synced 2024-11-22 09:31:34 -05:00

Fixed some issues with DKMS, added SELinux policies

This commit is contained in:
TommyTran732 2021-03-13 09:51:19 -05:00 committed by GitHub
parent 9b346da8f8
commit ec050ca765
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -201,16 +201,29 @@ sudo openssl req -new -x509 \
-outform DER -out /root/mok.priv \
-nodes -days 36500 -subj "/CN=DKMS Automatic Module Signer"
sudo bash -c 'cat > /etc/dkms/anbox-ashmem.conf' <<-'EOF'
sign_tool="/etc/dkms/sign_helper.sh"
EOF
sudo cp /etc/dkms/anbox-ashmem.conf /etc/dkms/anbox-binder.conf
sudo chmod 644 /etc/dkms/anbox-*
sudo sed -i 's^# sign_tool="/etc/dkms/sign_helper.sh"^sign_tool="/etc/dkms/sign_helper.sh"^g' /etc/dkms/framework.conf
output "It's gonna fail to load in the kernel modules here... and that's okay. We haven't imported the MOK yet :)"
sudo dkms install anbox-ashmem/1
sudo dkms install anbox-binder/1
#Add SELinux Policies for anbox
wget https://raw.githubusercontent.com/tommytran732/Fedora-Workstation-Setup/main/selinux/my-gatekeeperd.te
wget https://raw.githubusercontent.com/tommytran732/Fedora-Workstation-Setup/main/selinux/my-ndroidsettings.te
wget https://raw.githubusercontent.com/tommytran732/Fedora-Workstation-Setup/main/selinux/my-servicemanager.te
checkmodule -M -m -o my-gatekeeperd.mod my-gatekeeperd.te
checkmodule -M -m -o my-ndroidsettings.mod my-ndroidsettings.te
checkmodule -M -m -o my-servicemanager.mod my-servicemanager.te
semodule_package -o my-gatekeeperd.pp -m my-gatekeeperd.mod
semodule_package -o my-ndroidsettings.pp -m my-ndroidsettings.mod
semodule_package -o my-servicemanager -m my-servicemanager.mod
sudo semodule -i my-gatekeeperd.pp
sudo semodule -i my-ndroidsettings.pp
sudo semodule -i my-servicemanager.pp
#Setup BTRFS layout and Timeshift
sudo mkdir /btrfs_pool
sudo mount -o subvolid=5 /dev/mapper/${PARTITIONID} /btrfs_pool
@ -241,3 +254,4 @@ output "Just to avoid confusion, we are importing Akmods's key"
sudo mokutil --import /etc/pki/akmods/certs/public_key.der
output "Now we import DKMS's key"
sudo mokutil --import /root/mok.der
output "All done! You have to reboot now."