aboutsummaryrefslogtreecommitdiffstats
path: root/systemd/fedora-import-state
diff options
context:
space:
mode:
authorWill Woods <wwoods@redhat.com>2012-03-08 15:13:03 -0500
committerBill Nottingham <notting@redhat.com>2012-03-08 15:39:06 -0500
commitcb42a762e69037502d0549d3a79a41e292af8aad (patch)
tree646d32f21d0f78e87912a489c2a5ded189193e9b /systemd/fedora-import-state
parenta93d20bb3604bed86e3d1bb74513e428b21242cd (diff)
downloadinitscripts-cb42a762e69037502d0549d3a79a41e292af8aad.tar
initscripts-cb42a762e69037502d0549d3a79a41e292af8aad.tar.gz
initscripts-cb42a762e69037502d0549d3a79a41e292af8aad.tar.bz2
initscripts-cb42a762e69037502d0549d3a79a41e292af8aad.tar.xz
initscripts-cb42a762e69037502d0549d3a79a41e292af8aad.zip
add fedora-import-state.service
This service imports the contents of /run/initramfs/state into the root filesystem, where the root filesystem is writeable. This allows dracut to hand the ifcfg file and dhclient lease over to NetworkManager on network-booted Live images.
Diffstat (limited to 'systemd/fedora-import-state')
-rwxr-xr-xsystemd/fedora-import-state14
1 files changed, 14 insertions, 0 deletions
diff --git a/systemd/fedora-import-state b/systemd/fedora-import-state
new file mode 100755
index 00000000..a853ab9c
--- /dev/null
+++ b/systemd/fedora-import-state
@@ -0,0 +1,14 @@
+#!/bin/bash
+# fedora-import-state: import state files from initramfs (e.g. network config)
+
+# exit early if root isn't writeable
+[ -w / ] || exit 0
+
+# copy state into root
+cd /run/initramfs/state
+cp -a -t / .
+
+# run restorecon on the copied files
+if [ -e /sys/fs/selinux/enforce ]; then
+ find . | ( cd /; restorecon -i -f -; ) || :
+fi