Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions debian/qubes-core-agent.install
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ etc/qubes-rpc/qubes.VMExecGUI
etc/qubes-rpc/qubes.VMRootExec
etc/qubes-rpc/qubes.WaitForSession
etc/qubes-rpc/qubes.WaitForRunningSystem
etc/qubes-rpc/qubes.WaitForNetworkUplink
etc/qubes-rpc/qubes.GetDate
etc/qubes-suspend-module-blacklist
etc/qubes/autostart/*
Expand Down
1 change: 1 addition & 0 deletions qubes-rpc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ install:
qubes.SuspendPostAll \
qubes.WaitForSession \
qubes.WaitForRunningSystem \
qubes.WaitForNetworkUplink \
qubes.DetachPciDevice \
qubes.Backup qubes.Restore \
qubes.RegisterBackupLocation \
Expand Down
21 changes: 21 additions & 0 deletions qubes-rpc/qubes.WaitForNetworkUplink
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash
# Wait with a timeout for the uplink service to be started. Used on deferred netvm.
set -eu

# shellcheck disable=SC1091
. /usr/lib/qubes/init/functions
iface="$(get_qubes_managed_iface)"
if test -z "$iface"; then
exit
fi

i=0
while test $i -le 10; do
if systemctl is-active --quiet "qubes-network-uplink@$iface.service"; then
ip link show "$iface" | grep "state UP" || exit 4
exit 0
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check if link exists and is UP. Report with exit code if it is not.

ip link show $iface and grep for state.

fi
sleep 0.3
i=$((i+1))
done
exit 3
1 change: 1 addition & 0 deletions rpm_spec/core-agent.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -903,6 +903,7 @@ rm -f %{name}-%{version}
%config(noreplace) /etc/qubes-rpc/qubes.SuspendPostAll
%config(noreplace) /etc/qubes-rpc/qubes.WaitForSession
%config(noreplace) /etc/qubes-rpc/qubes.WaitForRunningSystem
%config(noreplace) /etc/qubes-rpc/qubes.WaitForNetworkUplink
%config(noreplace) /etc/qubes-rpc/qubes.DetachPciDevice
%config(noreplace) /etc/qubes-rpc/qubes.Backup
%config(noreplace) /etc/qubes-rpc/qubes.Restore
Expand Down