| Summary: | Installing the current snapshot fails when calling MakeDevChunk(). | ||
|---|---|---|---|
| Product: | Base System | Reporter: | Hiroo Ono <hiroo> |
| Component: | bin | Assignee: | matusita |
| Status: | Closed FIXED | ||
| Severity: | Affects Only Me | ||
| Priority: | Normal | ||
| Version: | Unspecified | ||
| Hardware: | Any | ||
| OS: | Any | ||
|
Description
Hiroo Ono
2001-10-03 15:50:00 UTC
----Next_Part(Fri_Oct__5_02:54:40_2001_41)--
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
I think the patch for lib/libdisk/create_chunk.c below solves the
problem. It checks the devfs MIB exists and return 1 if it exists.
As I failed to install FreeBSD-current due to this bug, I cannot test
if it works :-)
thanks to Masahide -mac- NODA, Hajimu UMEMOTO and Makoto `MAR' MATSUSHITA
for the advice.
----Next_Part(Fri_Oct__5_02:54:40_2001_41)--
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="create_chunk.c.diff"
*** create_chunk.c.orig Fri Oct 5 02:07:06 2001
--- create_chunk.c Fri Oct 5 02:31:10 2001
***************
*** 22,27 ****
--- 22,28 ----
#include <sys/diskslice.h>
#include <sys/types.h>
#include <sys/stat.h>
+ #include <sys/sysctl.h>
#include <grp.h>
#include <paths.h>
#include <pwd.h>
***************
*** 283,294 ****
--- 284,303 ----
struct passwd *pwd;
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 (isDebug())
+ msgDebug("MakeDev: No need to mknod(2) with DEVFS.\n");
+ return 1;
+ }
if (!strncmp(p, "ad", 2))
cmaj = 116, p += 2;
----Next_Part(Fri_Oct__5_02:54:40_2001_41)----
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;
matusita> Hiroo-san's patch has a bug: if kernel does know about matusita> DEVFS, libdisk doesn't do mknod(2) even if it's actually not matusita> DEVFS. This causes that current 5-current's sysinstall(8) matusita> fails to create filesystem while a fresh installation matusita> procedure. I've made a small test, and this patch seems working as expected. To make more verification, I commited this patch. I'll test with next 5-current SNAPSHOTs. If it works fine, I'll close this PR. -- - Makoto `MAR' Matsushita State Changed From-To: open->feedback I've applied my patch as src/lib/libidisk/create_chunk.c rev 1.63, and 5.0-CURRENT-20011112-JPSNAP which was included a patch seems working. Hiroo-san, would you please confirm that this bug is disappeared? Responsible Changed From-To: freebsd-bugs->matusita I'll handle this to close this PR if problem is solved. I have successfully been able to install -current with kern.flp and mfsroot.flp downloaded from ftp://current.freebsd.org/pub/FreeBSD/snapshots/i386/5.0-20011112-CURRENT. The same disks failed to install properly from 11-09, 11-10, and 11-11. It seems that the patch mentioned is working. Galen __________________________________________________ Do You Yahoo!? Find the one for you at Yahoo! Personals http://personals.yahoo.com galen_sampson> I have successfully been able to install -current with galen_sampson> kern.flp and mfsroot.flp downloaded from galen_sampson> ftp://current.freebsd.org/pub/FreeBSD/snapshots/i386/5.0-20011112-CURRENT. Glad to hear that, thank you. -- - Makoto `MAR' Matsushita State Changed From-To: feedback->closed src/lib/libdisk/create_chunk.c rev 1.63 fixes this problem. I and Galen Sampson <galen_sampson@yahoo.com> confirm that current SNAPSHOTs floppies do the right things. |