Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: exec: /sbin/init: error 8



lukem%NetBSD.org@localhost wrote:

> On Tue, May 05, 2009 at 10:36:32PM +0900, Izumi Tsutsui wrote:
>   | Jeremy C. Reed wrote:
>   | > On Tue, 5 May 2009, Izumi Tsutsui wrote:
>   | > > I'm also thinking if it's worth to split module files
>   | > > from base.tgz into an independent module.tgz or so.
>   | > > (though we also have to modify sysinst(8) too)
>   | > 
>   | > Or the modules could be included in the kernel tar file. Or would it be 
>   | > okay for user using sysinst to choose different kernel and different 
>   | > modules sets?
>   | 
>   | IIUC all modules should not depend on each kernel config.
>   | (I'm not sure about misc DIAGNOSTIC/DEBUG options though)
>   | Then, if all sets are come from the same source tree
>   | I don't think it could cause any problem to put an independent
>   | module set file into installation files.
> 
> I think we need to resolve the issue of the location of the
> modules before we start adding 'modules' support to build.sh
> and creating new set tar files.

I don't see any reason why the location should be discussed
before spliting out module sets from base.tgz. Nevertheless
where modules will be moved, modules are already in base.tgz.

> I am not alone in being unhappy with the current path naming
> scheme and location of the modules and the resulting lossage

I believe independent module set files from base.tgz
reduce the lossage because kernel modules should be installed
before userland binaries, especially shared libs that are also
in base.tgz. (we can also provide module.tgz symlink in binary/kernel)

> (and lack of useful diagnostics) that occurs when you install
> a new kernel without the modules.

BTW, I think bootloader should warn more loudly (with some wait)
if it fails to load modules for root file system...
---
Index: lib/exec.c
===================================================================
RCS file: /cvsroot/src/sys/arch/i386/stand/lib/exec.c,v
retrieving revision 1.40
diff -u -r1.40 exec.c
--- lib/exec.c  21 Mar 2009 15:01:56 -0000      1.40
+++ lib/exec.c  8 May 2009 13:14:10 -0000
@@ -388,7 +388,9 @@
        boot_module_t *bm;
        size_t len;
        off_t off;
-       int err, fd;
+       int err, fd, warned;
+
+       warned = 0;
 
        switch (netbsd_elf_class) {
        case ELFCLASS32:
@@ -422,6 +424,7 @@
                fd = module_open(bm, 0);
                if (fd == -1) {
                        bm->bm_len = -1;
+                       warned = 1;
                        continue;
                }
                err = fstat(fd, &st);
@@ -429,6 +432,7 @@
                        printf("WARNING: couldn't stat %s\n", bm->bm_path);
                        close(fd);
                        bm->bm_len = -1;
+                       warned = 1;
                        continue;
                }
                bm->bm_len = st.st_size;
@@ -440,7 +444,8 @@
        btinfo_modulelist = alloc(len);
        if (btinfo_modulelist == NULL) {
                printf("WARNING: couldn't allocate module list\n");
-               return;
+               warned = 1;
+               goto out;
        }
        memset(btinfo_modulelist, 0, len);
        btinfo_modulelist_size = len;
@@ -458,6 +463,7 @@
                fd = module_open(bm, 0);
                if (fd == -1) {
                        printf("ERROR: couldn't open %s\n", bm->bm_path);
+                       warned = 1;
                        continue;
                }
                image_end = (image_end + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1);
@@ -466,6 +472,7 @@
                        if ((howto & AB_SILENT) != 0)
                                printf("Loading %s ", bm->bm_path);
                        printf(" FAILED\n");
+                       warned = 1;
                } else {
                        btinfo_modulelist->num++;
                        bi = (struct bi_modulelist_entry *)(buf + off);
@@ -482,6 +489,11 @@
                close(fd);
        }
        btinfo_modulelist->endpa = image_end;
+
+ out:
+       if (warned != 0)
+               /* give a change for users to read warning messages */
+               delay(2000000);
 }
 
 int
---
Izumi Tsutsui


Home | Main Index | Thread Index | Old Index