You are not logged in.
Pages: 1
Topic closed
I'm having a problem with my Surface Book where it's turning on at random in my bag. I have no idea what's causing this, but I'm trying to make it shut down after a timeout. To complicate matters, my disk is encrypted, so I need to do this in initramfs.
I copied the "timeout" program to initramfs and modified the "encrypt" hook to use it, and it works... except that the "poweroff" command doesn't work in initramfs. If I could just figure out an alternative command to shut down the system, this would work...
I suppose an alternative would be to set up a timeout in grub, if that's a feature.
Here's the code I put in the encrypt hook for timing out.
echo "A password is required to access the ${cryptname} volume:"
#try to get a password, timeout after 5 seconds
timeout 5 cryptsetup open --type luks ${resolved} ${cryptname} ${cryptargs} ${CSQUIET}
if [ $? -ne 0 ]; then
err "Timeout waiting for password."
poweroff
return 1
fi
Offline
Hi Dren,
Did you ever figure this out? I have similar issue where if I plug my xps13 into the usb-c dock it turns on the laptop automatically but because I have encryption it will sit at the password prompt screen indefinately. I want a timeout to auto poweroff laptop. How exactly did you implement your script with the encrypt hook?
Thanks,
Paul.
Offline
Dren has not been back to the forum since 2018, so I am going to consider this thread abandoned and close it.
luthepa1, welcome to the forum. Please be aware of the dates on threads and our rules about necrobumping -- if you still need help please open a new thread with your issue.
Offline
Pages: 1
Topic closed