summaryrefslogtreecommitdiffstats
path: root/data
diff options
context:
space:
mode:
authorWill Woods <wwoods@redhat.com>2012-03-07 17:28:31 -0500
committerWill Woods <wwoods@redhat.com>2012-03-16 12:36:58 -0400
commitb9d6b0e9c3a994f1a79f933340be268611a40d10 (patch)
tree6101718aadf0d56711b124c1e2a1a135c1a7a088 /data
parent972ebc553da365e804cd84a910895e1acdf303d9 (diff)
downloadanaconda-b9d6b0e9c3a994f1a79f933340be268611a40d10.tar.gz
anaconda-b9d6b0e9c3a994f1a79f933340be268611a40d10.tar.xz
anaconda-b9d6b0e9c3a994f1a79f933340be268611a40d10.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')
-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
+