Hi folks, I'm writing a systemd service that I want to run it once when the raspberry PI boots, the service should run a bash script to allow TPM support, but whenever I turn the raspberry pi on I get and nothing happens after that
My service fileMy script file
Code:
done.Begin: Mounting root file system .... Begin: Runing /scripts/local-top ... doneBegin: Runing /scripts/local-premount ... done.No root device specified. Boot arguments must include a root = paramater.BusyBox v1.35.0 (Rasoan 1:1.35.0-4) build-in shell (ash)
My service file
Code:
[Unit]Description=Setup TPM on Raspberry PiAfter=graphical.target[Service]Type=oneshotExecStart=/bin/bash /boot/tpm_setup.shRemainAfterExit=true[Install]WantedBy=multi-user.target
Code:
#!/bin/bash# Update the package list and upgrade installed packagesecho "Updating and upgrading packages..."sudo apt updatesudo apt upgrade# Enable SPI and load TPM device tree overlayecho "Configuring /boot/firmware/config.txt for SPI and TPM..."sudo cp /boot/firmware/config.txt /boot/firmware/config.txt.backupgrep -q "^dtparam=spi=on" /boot/firmware/config.txt || echo "dtparam=spi=on" | sudo tee -a /boot/firmware/config.txtgrep -q "^dtoverlay=tpm-slb9670" /boot/firmware/config.txt || echo "dtoverlay=tpm-slb9670" | sudo tee -a /boot/firmware/config.txt
Statistics: Posted by mohamadkadiry — Sun Jul 14, 2024 12:52 pm