Index: live-tools-20190831.1/bin/live-medium-eject
===================================================================
--- live-tools-20190831.1.orig/bin/live-medium-eject
+++ live-tools-20190831.1/bin/live-medium-eject
@@ -1,6 +1,7 @@
 #!/bin/sh
 
 # live-tools(7) - System Support Scripts
+# Copyright (C) 2016-2020 The Debian Live team
 # Copyright (C) 2006-2015 Daniel Baumann <mail@daniel-baumann.ch>
 #
 # This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
@@ -42,6 +43,14 @@ LIVE_MEDIUM_EJECT_VERBOSE="${LIVE_MEDIUM
 # Ejecting live-medium
 _DEVICE="$(findmnt -Un -o source /run/live/medium | sed -e 's|^/dev/||')"
 
+# Systemd version >=253, the mount point for live medium is remounted dynamically when rebooting/halting.
+# Mount point is like /run/shutdown/mounts/4fefd9f5c22cea7e
+if [ -z "${_DEVICE}" ]
+then
+  live_media_mnt="$(df --output=target | grep -Ew "^/run/shutdown/mounts")"
+  _DEVICE="$(findmnt -Un -o source $live_media_mnt | sed -e 's|^/dev/||')"
+fi
+
 if [ ! -b "/dev/${_DEVICE}" ]
 then
 	exit 0
