]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
systemd: add plymouth-switch-root.service
authorRay Strode <rstrode@redhat.com>
Mon, 23 Jul 2012 17:08:45 +0000 (13:08 -0400)
committerRay Strode <rstrode@redhat.com>
Mon, 23 Jul 2012 21:37:03 +0000 (17:37 -0400)
This service file is needed by systemdized dracut to ensure we properly
transition from the initrd to the root file system

configure.ac
systemd-units/Makefile.am
systemd-units/plymouth-switch-root.service.in [new file with mode: 0644]

index 6d8fed7ab15752ee72a6caa397b7ae8d6882de71..e7220143aecf071c3483a9152b92c1c2bb617d5b 100644 (file)
@@ -464,6 +464,7 @@ AC_CONFIG_FILES([Makefile
            systemd-units/plymouth-read-write.service
            systemd-units/plymouth-reboot.service
            systemd-units/plymouth-start.service
+           systemd-units/plymouth-switch-root.service
            systemd-units/systemd-ask-password-plymouth.path
            systemd-units/systemd-ask-password-plymouth.service
            systemd-units/Makefile
index 2f5e61f726993009486bf545c615ecb05ffb5ab9..3aa44df3e0238b2266a06d81383d42d8567f03b1 100644 (file)
@@ -1,4 +1,5 @@
 systemd_unit_templates =                                                     \
+        plymouth-switch-root.service.in                                      \
         plymouth-start.service.in                                            \
         plymouth-read-write.service.in                                       \
         plymouth-quit.service.in                                             \
@@ -16,12 +17,16 @@ systemdunit_DATA = $(systemd_unit_templates:.in=)
 
 install-data-hook:
        $(MKDIR_P) -m 0755                                                   \
+               $(DESTDIR)$(SYSTEMD_UNIT_DIR)/initrd-switch-root.target.wants\
                $(DESTDIR)$(SYSTEMD_UNIT_DIR)/sysinit.target.wants           \
                $(DESTDIR)$(SYSTEMD_UNIT_DIR)/multi-user.target.wants        \
                $(DESTDIR)$(SYSTEMD_UNIT_DIR)/reboot.target.wants            \
                $(DESTDIR)$(SYSTEMD_UNIT_DIR)/kexec.target.wants             \
                $(DESTDIR)$(SYSTEMD_UNIT_DIR)/poweroff.target.wants          \
                $(DESTDIR)$(SYSTEMD_UNIT_DIR)/halt.target.wants
+       (cd $(DESTDIR)$(SYSTEMD_UNIT_DIR)/initrd-switch-root.target.wants && \
+               rm -f plymouth-switch-root.service &&                        \
+               $(LN_S) ../plymouth-switch-root.service)
        (cd $(DESTDIR)$(SYSTEMD_UNIT_DIR)/sysinit.target.wants &&            \
                rm -f plymouth-start.service plymouth-read-write.service &&  \
                $(LN_S) ../plymouth-start.service &&                         \
@@ -45,6 +50,8 @@ install-data-hook:
 
 uninstall-hook:
        rm -f \
+       (cd $(DESTDIR)$(SYSTEMD_UNIT_DIR)/initrd-switch-root.target.wants && \
+               rm -f plymouth-switch-root.service)                          \
        (cd $(DESTDIR)$(SYSTEMD_UNIT_DIR)/sysinit.target.wants &&            \
                rm -f plymouth-start.service plymouth-read-write.service)    \
        (cd $(DESTDIR)$(SYSTEMD_UNIT_DIR)/multi-user.target.wants &&         \
diff --git a/systemd-units/plymouth-switch-root.service.in b/systemd-units/plymouth-switch-root.service.in
new file mode 100644 (file)
index 0000000..8986655
--- /dev/null
@@ -0,0 +1,12 @@
+[Unit]
+Description=Plymouth switch root service
+DefaultDependencies=no
+ConditionPathExists=/etc/initrd-release
+Before=initrd-switch-root.service
+
+[Service]
+Type=oneshot
+ExecStart=-@PLYMOUTH_CLIENT_DIR@/plymouth update-root-fs --new-root-dir=/sysroot
+StandardInput=null
+StandardOutput=null
+StandardError=null