Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Debian User (http://www.linux-archive.org/debian-user/)
-   -   Don't fatal_error if required mounts are already mounted (http://www.linux-archive.org/debian-user/499336-dont-fatal_error-if-required-mounts-already-mounted.html)

Will Woods 03-09-2011 07:08 PM

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.
---
loader/init.c | 15 ++++++++++-----
1 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/loader/init.c b/loader/init.c
index 39bade0..f823acd 100644
--- a/loader/init.c
+++ b/loader/init.c
@@ -569,7 +569,8 @@ int main(int argc, char **argv) {
printf("anaconda installer init version %s starting
", 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
");

@@ -590,7 +591,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
");
@@ -628,12 +630,14 @@ int main(int argc, char **argv) {
printf("done
");

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
");

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
");

@@ -777,7 +781,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
");

--
1.7.4

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


All times are GMT. The time now is 09:49 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.