summaryrefslogtreecommitdiffstats
path: root/data/systemd
diff options
context:
space:
mode:
authorWill Woods <wwoods@redhat.com>2012-03-07 17:28:31 -0500
committerWill Woods <wwoods@redhat.com>2012-03-07 17:36:05 -0500
commit6f94987bad4a275ff8348f5ca1ed889f3837c14d (patch)
treedad6add1e04b57e8528776384c10bafda39e8dd5 /data/systemd
parent42987d6a86a7e97b9023517f84e66a81f7b50768 (diff)
downloadanaconda-6f94987bad4a275ff8348f5ca1ed889f3837c14d.tar.gz
anaconda-6f94987bad4a275ff8348f5ca1ed889f3837c14d.tar.xz
anaconda-6f94987bad4a275ff8348f5ca1ed889f3837c14d.zip
add fedora-import-state.service (fix NFS root: #799989)
dracut writes out an ifcfg-ethX file and a dhclient lease file for the interface used to mount the runtime. We need to pass that along to NetworkManager so it won't bring down the interface we're using for our root device. This service copies the contents of the /run/initramfs/state directory into its intended place, as would normally be done in fedora-readonly for NFS readonly-root systems.
Diffstat (limited to 'data/systemd')
-rw-r--r--data/systemd/Makefile.am4
-rw-r--r--data/systemd/anaconda.target2
-rwxr-xr-xdata/systemd/fedora-import-state8
-rw-r--r--data/systemd/fedora-import-state.service14
4 files changed, 26 insertions, 2 deletions
diff --git a/data/systemd/Makefile.am b/data/systemd/Makefile.am
index 589854cfa..ae71a966b 100644
--- a/data/systemd/Makefile.am
+++ b/data/systemd/Makefile.am
@@ -18,5 +18,7 @@
# Author: Chris Lumens <clumens@redhat.com>
systemddir = /lib/systemd/system
-dist_systemd_DATA = anaconda-shell@.service anaconda.target anaconda.service instperf.service
+dist_systemd_DATA = anaconda-shell@.service anaconda.target anaconda.service instperf.service fedora-import-state.service
+systemdscriptdir = /lib/systemd
+dist_systemd_SCRIPTS = fedora-import-state
MAINTAINERCLEANFILES = Makefile.in
diff --git a/data/systemd/anaconda.target b/data/systemd/anaconda.target
index 7796c89ea..9f7f3be07 100644
--- a/data/systemd/anaconda.target
+++ b/data/systemd/anaconda.target
@@ -4,4 +4,4 @@ Requires=basic.target
Conflicts=rescue.service rescue.target
After=basic.target rescue.service rescue.target
AllowIsolate=yes
-Wants=anaconda.service anaconda-shell@tty2.service anaconda-shell@hvc1.service
+Wants=anaconda.service anaconda-shell@tty2.service anaconda-shell@hvc1.service fedora-import-state.service
diff --git a/data/systemd/fedora-import-state b/data/systemd/fedora-import-state
new file mode 100755
index 000000000..7979e2446
--- /dev/null
+++ b/data/systemd/fedora-import-state
@@ -0,0 +1,8 @@
+#!/bin/bash
+# fedora-import-state: import state files from initramfs (e.g. network config)
+
+cd /run/initramfs/state
+cp -a -t / . || exit 1
+if [ -e /sys/fs/selinux/enforce ]; then
+ find . | ( cd /; restorecon -i -f -; ) || :
+fi
diff --git a/data/systemd/fedora-import-state.service b/data/systemd/fedora-import-state.service
new file mode 100644
index 000000000..4d403a44e
--- /dev/null
+++ b/data/systemd/fedora-import-state.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=Import network configuration from initramfs
+DefaultDependencies=no
+ConditionDirectoryNotEmpty=/run/initramfs/state
+Conflicts=shutdown.target
+Before=shutdown.target emergency.service emergency.target systemd-tmpfiles-setup.service
+After=remount-rootfs.service
+
+[Service]
+ExecStart=/lib/systemd/fedora-import-state
+Type=oneshot
+TimeoutSec=0
+RemainAfterExit=yes
+