summaryrefslogtreecommitdiffstats
path: root/loader/init.c
diff options
context:
space:
mode:
authorWill Woods <wwoods@redhat.com>2011-03-09 15:08:47 -0500
committerWill Woods <wwoods@redhat.com>2011-03-17 17:48:14 -0400
commitfe322170c352487d2bc07f0809e95c79afc3eeb2 (patch)
tree19ef7c585d79b522790bc2e00712bff508c62328 /loader/init.c
parentdac6c6ec9fde1e18ae182e3b18b81a764b114d84 (diff)
Don't fatal_error if required mounts are already mounted
Change loader/init.c so it doesn't bother checking the return value of mount(). Instead it just checks to see if the mount functions as expected - for example, after mounting /proc it checks to see if /proc/cmdline exists.
Diffstat (limited to 'loader/init.c')
-rw-r--r--loader/init.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/loader/init.c b/loader/init.c
index 83a57cb6f..9c193b4f4 100644
--- a/loader/init.c
+++ b/loader/init.c
@@ -568,7 +568,8 @@ int main(int argc, char **argv) {
printf("anaconda installer init version %s starting\n", VERSION);
printf("mounting /proc filesystem... ");
- if (mount("/proc", "/proc", "proc", 0, NULL))
+ mount("/proc", "proc", "proc", 0, NULL);
+ if (access("/proc/cmdline", R_OK) == -1)
fatal_error(1);
printf("done\n");
@@ -589,7 +590,8 @@ int main(int argc, char **argv) {
}
printf("creating /dev filesystem... ");
- if (mount("/dev", "/dev", "tmpfs", 0, NULL))
+ mount("/dev", "/dev", "tmpfs", 0, NULL);
+ if (access("/dev", W_OK) == -1)
fatal_error(1);
createDevices();
printf("done\n");
@@ -627,12 +629,14 @@ int main(int argc, char **argv) {
printf("done\n");
printf("mounting /dev/pts (unix98 pty) filesystem... ");
- if (mount("/dev/pts", "/dev/pts", "devpts", 0, NULL))
+ mount("/dev/pts", "/dev/pts", "devpts", 0, NULL);
+ if (access("/dev/pts/ptmx", F_OK) == -1)
fatal_error(1);
printf("done\n");
printf("mounting /sys filesystem... ");
- if (mount("/sys", "/sys", "sysfs", 0, NULL))
+ mount("/sys", "/sys", "sysfs", 0, NULL);
+ if (access("/sys/class/block", R_OK) == -1)
fatal_error(1);
printf("done\n");
@@ -776,7 +780,8 @@ int main(int argc, char **argv) {
mkdir("/tmp", 0755);
printf("mounting /tmp as tmpfs... ");
- if (mount("none", "/tmp", "tmpfs", 0, "size=250m"))
+ mount("none", "/tmp", "tmpfs", 0, "size=250m");
+ if (access("/tmp", W_OK) == -1)
fatal_error(1);
printf("done\n");