dmsquash-live: add systemd checkisomd5 service
authorHarald Hoyer <harald@redhat.com>
Fri, 14 Dec 2012 07:57:22 +0000 (08:57 +0100)
committerHarald Hoyer <harald@redhat.com>
Fri, 14 Dec 2012 08:04:55 +0000 (09:04 +0100)
modules.d/90dmsquash-live/checkisomd5@.service [new file with mode: 0644]
modules.d/90dmsquash-live/dmsquash-live-root.sh

diff --git a/modules.d/90dmsquash-live/checkisomd5@.service b/modules.d/90dmsquash-live/checkisomd5@.service
new file mode 100644 (file)
index 0000000..20e40bd
--- /dev/null
@@ -0,0 +1,13 @@
+[Unit]
+Description=Media check on %f
+DefaultDependencies=no
+Before=shutdown.target
+
+[Service]
+Type=oneshot
+RemainAfterExit=no
+ExecStart=/bin/checkisomd5 --verbose %f
+StandardInput=tty-force
+StandardOutput=inherit
+StandardError=inherit
+TimeoutSec=0
index a7bb202..ec22977 100755 (executable)
@@ -32,7 +32,12 @@ fi
 getarg rd.live.check -d check || check=""
 if [ -n "$check" ]; then
     [ -x /bin/plymouth ] && /bin/plymouth --hide-splash
-    checkisomd5 --verbose $livedev
+    if [ -n "DRACUT_SYSTEMD" ]; then
+        p=$(str_replace "$livedev" "-" '\x2d')
+        systemctl start checkisomd5@${p}.service
+    else
+        checkisomd5 --verbose $livedev
+    fi
     if [ $? -ne 0 ]; then
         die "CD check failed!"
         exit 1