Skip to content

Commit

Permalink
Remove dependency on uuidgen (canonical#626)
Browse files Browse the repository at this point in the history
`ovs-ctl` uses `uuidgen` only on the first startup when there is no
`system-id.conf` file. After the first startup, the freshly created UUID
is saved into that file for later use.

By generating the exact same kind and format of UUID ahead of time using
`systemd-id128` (readily available from core base), we can remove that
dependency on `uuidgen`.
  • Loading branch information
tomponline authored Nov 20, 2024
2 parents bd9bb80 + 72213c3 commit c300b9d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 0 additions & 3 deletions snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -686,8 +686,6 @@ parts:
autotools-configure-parameters:
- --enable-ssl
- --prefix=
stage-packages:
- uuid-runtime
organize:
sbin/: bin/
usr/bin/: bin/
Expand All @@ -696,7 +694,6 @@ parts:
- bin/ovs-vsctl
- bin/ovs-vswitchd
- bin/ovsdb-*
- bin/uuidgen
- share/openvswitch/

ovn:
Expand Down
5 changes: 5 additions & 0 deletions snapcraft/commands/daemon.start
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,11 @@ if [ "${openvswitch_builtin:-"false"}" = "true" ]; then
export OVS_SBINDIR="${SNAP}/bin/"

mkdir -p "${OVS_SYSCONFDIR}/openvswitch"
OVS_SYSTEM_ID_FILE="${OVS_SYSCONFDIR}/openvswitch/system-id.conf"
if ! [ -s "${OVS_SYSTEM_ID_FILE}" ]; then
systemd-id128 new --uuid > "${OVS_SYSTEM_ID_FILE}"
fi

(
# Close socket activation fd
exec 3<&- || true
Expand Down

0 comments on commit c300b9d

Please sign in to comment.