diff options
author | Guillaume Cottenceau <gc@mandriva.com> | 2001-02-13 15:54:14 +0000 |
---|---|---|
committer | Guillaume Cottenceau <gc@mandriva.com> | 2001-02-13 15:54:14 +0000 |
commit | 79968466f45ef4eae3a69089c79002cc065bf504 (patch) | |
tree | 4d7f0e6b37fd78901db27a2f5dd0f2cd024437f6 /mdk-stage1 | |
parent | 108fd442c49a81f688af8c473288864fa1d17d94 (diff) | |
download | drakx-79968466f45ef4eae3a69089c79002cc065bf504.tar drakx-79968466f45ef4eae3a69089c79002cc065bf504.tar.gz drakx-79968466f45ef4eae3a69089c79002cc065bf504.tar.bz2 drakx-79968466f45ef4eae3a69089c79002cc065bf504.tar.xz drakx-79968466f45ef4eae3a69089c79002cc065bf504.zip |
- better log of nfs mount errors
- don't insmod modules already present (important for bzip2 slowness)
Diffstat (limited to 'mdk-stage1')
-rw-r--r-- | mdk-stage1/modules.c | 19 | ||||
-rw-r--r-- | mdk-stage1/mount.c | 4 | ||||
-rw-r--r-- | mdk-stage1/nfsmount.c | 7 |
3 files changed, 26 insertions, 4 deletions
diff --git a/mdk-stage1/modules.c b/mdk-stage1/modules.c index fe55ff15f..8194a7576 100644 --- a/mdk-stage1/modules.c +++ b/mdk-stage1/modules.c @@ -192,6 +192,22 @@ static void add_modules_conf(char * str) } +static int module_already_present(const char * name) +{ + FILE * f; + int answ = 0; + f = fopen("/proc/modules", "rb"); + while (1) { + char buf[500]; + if (!fgets(buf, sizeof(buf), f)) break; + if (!strncmp(name, buf, strlen(name))) + answ = 1; + } + fclose(f); + return answ; +} + + static int insmod_with_deps(const char * mod_name, char * options) { struct module_deps_elem * dep; @@ -210,6 +226,9 @@ static int insmod_with_deps(const char * mod_name, char * options) } } + if (module_already_present(mod_name)) + return 0; + log_message("needs %s", mod_name); return insmod_archived_file(mod_name, options); } diff --git a/mdk-stage1/mount.c b/mdk-stage1/mount.c index bcdc069ca..171bf30b5 100644 --- a/mdk-stage1/mount.c +++ b/mdk-stage1/mount.c @@ -163,10 +163,8 @@ int my_mount(char *dev, char *location, char *fs) log_message("preparing nfsmount for %s", dev); rc = nfsmount_prepare(dev, &flags, &opts); - if (rc != 0) { - log_perror(dev); + if (rc != 0) return rc; - } } #endif diff --git a/mdk-stage1/nfsmount.c b/mdk-stage1/nfsmount.c index d980860a2..77fbb530e 100644 --- a/mdk-stage1/nfsmount.c +++ b/mdk-stage1/nfsmount.c @@ -232,7 +232,12 @@ int nfsmount_prepare(const char *spec, int *flags, char **mount_opts) goto fail; if (status.fhs_status != 0) { - log_message("nfsmount prepare failed, reason given by server: %d", status.fhs_status); + if (status.fhs_status == 2) + log_message("NFS server says: No such file or directory"); + else if (status.fhs_status == 13) + log_message("NFS server says: Permission denied"); + else + log_message("nfsmount prepare failed, reason given by server: %d", status.fhs_status); goto fail; } |