Date: Thu, 8 Nov 2001 08:40:03 -0800 (PST) From: Makoto Matsushita <matusita@jp.freebsd.org> To: freebsd-bugs@FreeBSD.org Subject: Re: bin/31009: Installing current snapshot fails at sysintall/install.c:installFilesystems() Message-ID: <200111081640.fA8Ge3U24274@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/31009; it has been noted by GNATS. From: Makoto Matsushita <matusita@jp.freebsd.org> To: freebsd-gnats-submit@FreeBSD.org Cc: jkh@FreeBSD.org Subject: Re: bin/31009: Installing current snapshot fails at sysintall/install.c:installFilesystems() Date: Fri, 09 Nov 2001 01:36:51 +0900 Hiroo-san's patch has a bug: if kernel does know about DEVFS, libdisk doesn't do mknod(2) even if it's actually not DEVFS. This causes that current 5-current's sysinstall(8) fails to create filesystem while a fresh installation procedure. I've reported this bug (sysinstall fails to create filesystem) from users of snapshots.jp.FreeBSD.org, and confirmed that hiroo-san's patch is not an actual fix. Jordan, would you please check my patch? If you are OK, please commit or I'll do. P.S.: I've already discussed with hiroo-san about this patch. -- - Makoto `MAR' MATSUSHITA Index: create_chunk.c =================================================================== RCS file: /home/ncvs/src/lib/libdisk/create_chunk.c,v retrieving revision 1.62 diff -u -r1.62 create_chunk.c --- create_chunk.c 10 Oct 2001 07:46:04 -0000 1.62 +++ create_chunk.c 8 Nov 2001 16:23:17 -0000 @@ -17,10 +17,10 @@ #include <ctype.h> #include <fcntl.h> #include <stdarg.h> -#include <sys/types.h> +#include <sys/param.h> #include <sys/disklabel.h> #include <sys/diskslice.h> -#include <sys/types.h> +#include <sys/mount.h> #include <sys/stat.h> #include <sys/sysctl.h> #include <grp.h> @@ -282,18 +282,22 @@ char buf[BUFSIZ], buf2[BUFSIZ]; struct group *grp; struct passwd *pwd; + struct statfs fs; uid_t owner; gid_t group; - int mib[4]; - size_t miblen; *buf2 = '\0'; - miblen = sizeof(mib)/sizeof(mib[0]); if (isDebug()) msgDebug("MakeDev: Called with %s on path %s\n", p, path); if (!strcmp(p, "X")) return 0; - if (!sysctlnametomib("vfs.devfs.generation", &mib, &miblen)) { + if (statfs(path, &fs) != 0) { +#ifdef DEBUG + warn("statfs(%s) failed\n", path); +#endif + return 0; + } + if (strcmp(fs.f_fstypename, "devfs") == 0) { if (isDebug()) msgDebug("MakeDev: No need to mknod(2) with DEVFS.\n"); return 1; To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200111081640.fA8Ge3U24274>