Use /dev/.oldtmp instead of /oldtmp when moving around initrd /tmp
/dev is definitely a writeable filesystem at this point, so let's
use that for temporary storage rather than assuming that / will
always be writeable.
---
loader/init.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/loader/init.c b/loader/init.c
index 51ab2a2..6163933 100644
--- a/loader/init.c
+++ b/loader/init.c
@@ -774,7 +774,7 @@ int main(int argc, char **argv) {
/* we want our /tmp to be tmpfs, but we also want to let people hack
* their initrds to add things like a ks.cfg, so this has to be a little
* tricky */
- rename("/tmp", "/oldtmp");
+ copyDirectory("/tmp", "/dev/.oldtmp", copyErrorFn, copyErrorFn);
mkdir("/tmp", 0755);
printf("mounting /tmp as tmpfs... ");
@@ -782,8 +782,8 @@ int main(int argc, char **argv) {
fatal_error(1);
printf("done
");