Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unlocking without network takes a long time #22

Open
shai8I opened this issue Mar 13, 2024 · 6 comments
Open

Unlocking without network takes a long time #22

shai8I opened this issue Mar 13, 2024 · 6 comments

Comments

@shai8I
Copy link

shai8I commented Mar 13, 2024

What's expected: After the disk unlocks, the system starts booting immediately, regardless of whether network is available.

What actually happens: Without network, it takes about 62 seconds (from the time the disk unlocks) for the system to actually start booting. (With network, it starts booting immediately.)

Reason for issue: My 'host' device is off sometimes.

P.s. Thanks for the clear guide.

@ViRb3
Copy link
Owner

ViRb3 commented Mar 14, 2024

Is this with WiFi or over Ethernet?

@shai8I
Copy link
Author

shai8I commented Mar 18, 2024

Is this with WiFi or over Ethernet?

It's over USB keyboard and without Ethernet. (I've not set up the WiFi.)

@ViRb3
Copy link
Owner

ViRb3 commented Mar 19, 2024

Sorry, I meant when you say that it works immediately with network, is that WiFi or Ethernet?

@shai8I
Copy link
Author

shai8I commented Mar 20, 2024

It works immediately with Ethernet plugged in.

@shai8I
Copy link
Author

shai8I commented Jun 7, 2024

Hi @ViRb3, thanks for your efforts in addressing the issue. I wanted to let you know that I found a solution.

Solution

Edit /usr/share/initramfs-tools/scripts/init-bottom/dropbear and reduce the timeout:

# Original
DROPBEAR_SHUTDOWN_TIMEOUT=60
# Replace with:
DROPBEAR_SHUTDOWN_TIMEOUT=3

I haven't figured out how to apply this change immediately, but it works after a major system update. Additionally, I haven't tested it with SSH yet.

Tested latest image

I'm glad to report that the guide works with the latest image (Raspberry Pi OS Lite 64-bit 2024-03-15).

The solution can be applied immediately from the latest image:

  1. Follow the guide using the latest image (note the new kernel version).
  2. Apply the solution and run sudo apt full-upgrade.
  3. The system now unlocks quickly without network.

Thanks again for taking the time to write the guide. If there's anything else I can help with, please let me know.

@ViRb3
Copy link
Owner

ViRb3 commented Jul 8, 2024

Glad you found a workaround. I did some searching, and this appears to be a bug with dropbear since at least 2020: https://groups.google.com/g/linux.debian.bugs.dist/c/8Yt_Kkc-DzQ

The author in the link above suggests another fix, but I honestly think yours is better given the circumstances. Will leave this open if/until somebody provides a better solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants