aboutsummaryrefslogtreecommitdiffstats
path: root/systemd/rhel-import-state
blob: 109ef75770c6c57172070f5afe95121470c47d82 (plain)
1
2
3
4
5
6
7
8
9
10
11
#!/bin/bash
# rhel-import-state: import state files from initramfs (e.g. network config)

# copy state into root
cd /run/initramfs/state
find . -mindepth 1 -maxdepth 1 -exec cp -v -R --preserve=mode,ownership,timestamps,links -t / {} \;

# run restorecon on the copied files
if [ -e /sys/fs/selinux/enforce -a -x /usr/sbin/restorecon ]; then
    find . -mindepth 1 -print0 | { cd / && xargs --null restorecon -iF; }
fi