diff options
author | Bill Nottingham <notting@redhat.com> | 2007-12-07 13:21:56 -0500 |
---|---|---|
committer | Bill Nottingham <notting@redhat.com> | 2007-12-07 13:21:56 -0500 |
commit | 95cd3064d592128398a1bac7af23209946940d6a (patch) | |
tree | 3971c5c4ddc3ce48d445004682f00ce0acf3ab6e /loader2/loader.c | |
parent | a4dc3d4e1e92cb39fbc6ee79238524248162c416 (diff) | |
download | anaconda-95cd3064d592128398a1bac7af23209946940d6a.tar.gz anaconda-95cd3064d592128398a1bac7af23209946940d6a.tar.xz anaconda-95cd3064d592128398a1bac7af23209946940d6a.zip |
Copy /etc and /var from /mnt/runtime to the root filesystem.
Apps running in the second stage may expect to have 'normal' files in
/etc or /var. By staging it this way, they can just be kept in the
second stage, and copied to the first stage at runtime, rather than
having to keep them in the first stage. We can't symlink to
/mnt/runtime/etc or /mnt/runtime/var, because the second stage isn't
writable. /etc/selinux is still symlinked, because it's huge.
Diffstat (limited to 'loader2/loader.c')
-rw-r--r-- | loader2/loader.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/loader2/loader.c b/loader2/loader.c index c8e69d81b..0a22bb9ec 100644 --- a/loader2/loader.c +++ b/loader2/loader.c @@ -1701,10 +1701,15 @@ int main(int argc, char ** argv) { url = doLoaderMain("/mnt/source", &loaderData, modInfo, modLoaded, &modDeps); if (!FL_TESTING(flags)) { + int ret; + /* unlink dirs and link to the ones in /mnt/runtime */ migrate_runtime_directory("/usr"); migrate_runtime_directory("/lib"); migrate_runtime_directory("/lib64"); + ret = symlink("/mnt/runtime/etc/selinux", "/etc/selinux"); + copyDirectory("/mnt/runtime/etc","/etc", copyWarnFn, copyErrorFn); + copyDirectory("/mnt/runtime/var","/var", copyWarnFn, copyErrorFn); } /* now load SELinux policy before exec'ing anaconda and the shell @@ -1714,10 +1719,6 @@ int main(int argc, char ** argv) { logMessage(ERROR, "failed to mount /selinux: %s, disabling SELinux", strerror(errno)); flags &= ~LOADER_FLAGS_SELINUX; } else { - /* FIXME: this is a bad hack for libselinux assuming things - * about paths */ - int ret; - ret = symlink("/mnt/runtime/etc/selinux", "/etc/selinux"); if (loadpolicy() == 0) { setexeccon(ANACONDA_CONTEXT); } else { |