From 98506d6a735529f28403b26dc66b32cc98f3329e Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sat, 13 Aug 2022 19:04:54 +0200 Subject: [PATCH] bullseye migration: add critical fix for RPi failing to get network on reboot --- src/migrations/0021_migrate_to_bullseye.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/migrations/0021_migrate_to_bullseye.py b/src/migrations/0021_migrate_to_bullseye.py index 01b846573..6b23f8086 100644 --- a/src/migrations/0021_migrate_to_bullseye.py +++ b/src/migrations/0021_migrate_to_bullseye.py @@ -185,6 +185,17 @@ class MyMigration(Migration): del services["postgresql"] _save_services(services) + # + # Critical fix for RPI otherwise network is down after rebooting + # https://forum.yunohost.org/t/20652 + # + if os.system("systemctl | grep -q dhcpcd") == 0: + os.system("mkdir -p /etc/systemd/system/dhcpcd.service.d") + write_to_file( + "/etc/systemd/system/dhcpcd.service.d/wait.conf", + '[Service]\nExecStart=\nExecStart=/usr/sbin/dhcpcd -w' + ) + # # Main upgrade #