From owner-freebsd-current Fri Nov 9 5:32:26 2001 Delivered-To: freebsd-current@freebsd.org Received: from castle.jp.freebsd.org (castle.jp.FreeBSD.org [210.226.20.15]) by hub.freebsd.org (Postfix) with ESMTP id 96DA837B41D for ; Fri, 9 Nov 2001 05:32:22 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) with ESMTP id WAA52197 for ; Fri, 9 Nov 2001 22:32:20 +0900 (JST) (envelope-from matusita@jp.FreeBSD.org) X-User-Agent: Mew/1.94.2 XEmacs/21.5 (alfalfa) X-FaceAnim: (-O_O-)(O_O- )(_O- )(O- )(- -)( -O)( -O_)( -O_O)(-O_O-) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Dispatcher: imput version 20000228(IM140) Lines: 71 From: Makoto Matsushita To: current@FreeBSD.org Subject: PATCH: sysinstall (libdisk) fix to detect devfs Date: Fri, 09 Nov 2001 22:32:18 +0900 Message-Id: <20011109223218B.matusita@jp.FreeBSD.org> Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG This patch is the same of PR: bin/31009. I try to send to this list for wider audience to check my patch. *** Current 5-current sysinstall has a bug; when you want to install FreeBSD to a fresh PC, and you try to make a partition except 'a' (for example, 'ad0s1e'), sysinstall fails to do newfs. This is because sysinstall misunderstands /mnt/dev filesystem is a devfs partition. In a month before, this bug is reported as bin/31009, but this patch still has a bug. Unconditionally libdisk refuses to mknod(2) a device file. It should be done *if and only if a path is on devfs*. Libdisk should check a patch is devfs or not, using a given path. It would be done with statfs(2) so I wrote a patch. I already sent this to jkh (it's sysinstall-related) but he is now in BSDcon Europe :-) Does anybody confirm that I'm doing a right thing? -- - 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 #include #include -#include +#include #include #include -#include +#include #include #include #include @@ -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-current" in the body of the message