From 7b40ce553f0ec9487077e53f5bdc46580025901c Mon Sep 17 00:00:00 2001 From: Michael Biebl Date: Sat, 9 Mar 2013 09:46:11 +0100 Subject: build-sys: don't hard-code binary paths in initrd-*.service Instead use @bindir@ for udevadm and @rootbindir@ for systemctl. --- Makefile.am | 16 ++++++++++------ units/initrd-cleanup.service | 18 ------------------ units/initrd-cleanup.service.in | 18 ++++++++++++++++++ units/initrd-parse-etc.service | 20 -------------------- units/initrd-parse-etc.service.in | 20 ++++++++++++++++++++ units/initrd-switch-root.service | 19 ------------------- units/initrd-switch-root.service.in | 19 +++++++++++++++++++ units/initrd-udevadm-cleanup-db.service | 18 ------------------ units/initrd-udevadm-cleanup-db.service.in | 18 ++++++++++++++++++ 9 files changed, 85 insertions(+), 81 deletions(-) delete mode 100644 units/initrd-cleanup.service create mode 100644 units/initrd-cleanup.service.in delete mode 100644 units/initrd-parse-etc.service create mode 100644 units/initrd-parse-etc.service.in delete mode 100644 units/initrd-switch-root.service create mode 100644 units/initrd-switch-root.service.in delete mode 100644 units/initrd-udevadm-cleanup-db.service create mode 100644 units/initrd-udevadm-cleanup-db.service.in diff --git a/Makefile.am b/Makefile.am index 05bf582e26..afd259a2e5 100644 --- a/Makefile.am +++ b/Makefile.am @@ -382,11 +382,7 @@ dist_systemunit_DATA = \ units/systemd-udevd-control.socket \ units/systemd-udevd-kernel.socket \ units/system-update.target \ - units/initrd-parse-etc.service \ - units/initrd-cleanup.service \ - units/initrd-switch-root.target \ - units/initrd-udevadm-cleanup-db.service \ - units/initrd-switch-root.service + units/initrd-switch-root.target nodist_systemunit_DATA = \ units/getty@.service \ @@ -418,7 +414,11 @@ nodist_systemunit_DATA = \ units/systemd-udevd.service \ units/systemd-udev-trigger.service \ units/systemd-udev-settle.service \ - units/debug-shell.service + units/debug-shell.service \ + units/initrd-parse-etc.service \ + units/initrd-cleanup.service \ + units/initrd-udevadm-cleanup-db.service \ + units/initrd-switch-root.service dist_userunit_DATA = \ units/user/default.target \ @@ -460,6 +460,10 @@ EXTRA_DIST += \ units/systemd-hybrid-sleep.service.in \ units/systemd-suspend.service.in \ units/quotaon.service.in \ + units/initrd-parse-etc.service.in \ + units/initrd-cleanup.service.in \ + units/initrd-udevadm-cleanup-db.service.in \ + units/initrd-switch-root.service.in \ introspect.awk \ man/custom-html.xsl diff --git a/units/initrd-cleanup.service b/units/initrd-cleanup.service deleted file mode 100644 index 89986964ea..0000000000 --- a/units/initrd-cleanup.service +++ /dev/null @@ -1,18 +0,0 @@ -# This file is part of systemd. -# -# systemd is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as published by -# the Free Software Foundation; either version 2.1 of the License, or -# (at your option) any later version. - -[Unit] -Description=Cleaning Up and Shutting Down Daemons -DefaultDependencies=no -ConditionPathExists=/etc/initrd-release -OnFailure=emergency.target -Requires=local-fs.target swap.target -After=local-fs.target swap.target - -[Service] -Type=oneshot -ExecStart=/usr/bin/systemctl --no-block isolate initrd-switch-root.target diff --git a/units/initrd-cleanup.service.in b/units/initrd-cleanup.service.in new file mode 100644 index 0000000000..e926a1eec2 --- /dev/null +++ b/units/initrd-cleanup.service.in @@ -0,0 +1,18 @@ +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +[Unit] +Description=Cleaning Up and Shutting Down Daemons +DefaultDependencies=no +ConditionPathExists=/etc/initrd-release +OnFailure=emergency.target +Requires=local-fs.target swap.target +After=local-fs.target swap.target + +[Service] +Type=oneshot +ExecStart=@rootbindir@/systemctl --no-block isolate initrd-switch-root.target diff --git a/units/initrd-parse-etc.service b/units/initrd-parse-etc.service deleted file mode 100644 index 3a71a7ec56..0000000000 --- a/units/initrd-parse-etc.service +++ /dev/null @@ -1,20 +0,0 @@ -# This file is part of systemd. -# -# systemd is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as published by -# the Free Software Foundation; either version 2.1 of the License, or -# (at your option) any later version. - -[Unit] -Description=Reload Configuration from the Real Root -DefaultDependencies=no -Requires=local-fs.target swap.target -After=local-fs.target swap.target -OnFailure=emergency.target -ConditionPathExists=/etc/initrd-release - -[Service] -Type=oneshot -ExecStartPre=/usr/bin/systemctl daemon-reload -ExecStart=/usr/bin/systemctl start local-fs.target -ExecStart=/usr/bin/systemctl --no-block start initrd-cleanup.service diff --git a/units/initrd-parse-etc.service.in b/units/initrd-parse-etc.service.in new file mode 100644 index 0000000000..1a2711ac62 --- /dev/null +++ b/units/initrd-parse-etc.service.in @@ -0,0 +1,20 @@ +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +[Unit] +Description=Reload Configuration from the Real Root +DefaultDependencies=no +Requires=local-fs.target swap.target +After=local-fs.target swap.target +OnFailure=emergency.target +ConditionPathExists=/etc/initrd-release + +[Service] +Type=oneshot +ExecStartPre=@rootbindir@/systemctl daemon-reload +ExecStart=@rootbindir@/systemctl start local-fs.target +ExecStart=@rootbindir@/systemctl --no-block start initrd-cleanup.service diff --git a/units/initrd-switch-root.service b/units/initrd-switch-root.service deleted file mode 100644 index e076b391de..0000000000 --- a/units/initrd-switch-root.service +++ /dev/null @@ -1,19 +0,0 @@ -# This file is part of systemd. -# -# systemd is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as published by -# the Free Software Foundation; either version 2.1 of the License, or -# (at your option) any later version. - -[Unit] -Description=Switch Root -DefaultDependencies=no -ConditionPathExists=/etc/initrd-release -OnFailure=emergency.target -AllowIsolate=yes - -[Service] -Type=oneshot -# we have to use "--force" here, otherwise systemd would umount /run -ExecStart=/usr/bin/systemctl --no-block --force switch-root /sysroot -KillMode=none diff --git a/units/initrd-switch-root.service.in b/units/initrd-switch-root.service.in new file mode 100644 index 0000000000..6740264149 --- /dev/null +++ b/units/initrd-switch-root.service.in @@ -0,0 +1,19 @@ +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +[Unit] +Description=Switch Root +DefaultDependencies=no +ConditionPathExists=/etc/initrd-release +OnFailure=emergency.target +AllowIsolate=yes + +[Service] +Type=oneshot +# we have to use "--force" here, otherwise systemd would umount /run +ExecStart=@rootbindir@/systemctl --no-block --force switch-root /sysroot +KillMode=none diff --git a/units/initrd-udevadm-cleanup-db.service b/units/initrd-udevadm-cleanup-db.service deleted file mode 100644 index 983189e8b0..0000000000 --- a/units/initrd-udevadm-cleanup-db.service +++ /dev/null @@ -1,18 +0,0 @@ -# This file is part of systemd. -# -# systemd is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as published by -# the Free Software Foundation; either version 2.1 of the License, or -# (at your option) any later version. - -[Unit] -Description=Cleanup udevd DB -DefaultDependencies=no -ConditionPathExists=/etc/initrd-release -Conflicts=systemd-udevd.service systemd-udevd-control.socket systemd-udevd-kernel.socket -After=systemd-udevd.service systemd-udevd-control.socket systemd-udevd-kernel.socket -Before=initrd-switch-root.target - -[Service] -Type=oneshot -ExecStart=-/usr/bin/udevadm info --cleanup-db diff --git a/units/initrd-udevadm-cleanup-db.service.in b/units/initrd-udevadm-cleanup-db.service.in new file mode 100644 index 0000000000..b800c210db --- /dev/null +++ b/units/initrd-udevadm-cleanup-db.service.in @@ -0,0 +1,18 @@ +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +[Unit] +Description=Cleanup udevd DB +DefaultDependencies=no +ConditionPathExists=/etc/initrd-release +Conflicts=systemd-udevd.service systemd-udevd-control.socket systemd-udevd-kernel.socket +After=systemd-udevd.service systemd-udevd-control.socket systemd-udevd-kernel.socket +Before=initrd-switch-root.target + +[Service] +Type=oneshot +ExecStart=-@bindir@/udevadm info --cleanup-db -- cgit v1.2.3-54-g00ecf