From 28390de1850727571d8a972fa2244cc4ca8282d3 Mon Sep 17 00:00:00 2001 From: ryoon Date: Thu, 11 Feb 2021 00:15:55 +0000 Subject: [PATCH] Enable to mount Raspberry Pi Pico's USB mass storage partition Fix PR kern/55985. O.k. by thorpej@. Pull-up to netbsd-8 and netbsd-9. --- sys/fs/msdosfs/msdosfs_vfsops.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/sys/fs/msdosfs/msdosfs_vfsops.c b/sys/fs/msdosfs/msdosfs_vfsops.c index eea1856ed921..c48f404e9d7f 100644 --- a/sys/fs/msdosfs/msdosfs_vfsops.c +++ b/sys/fs/msdosfs/msdosfs_vfsops.c @@ -1,4 +1,4 @@ -/* $NetBSD: msdosfs_vfsops.c,v 1.135 2020/04/13 19:23:17 ad Exp $ */ +/* $NetBSD: msdosfs_vfsops.c,v 1.136 2021/02/11 00:15:55 ryoon Exp $ */ /*- * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank. @@ -48,7 +48,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: msdosfs_vfsops.c,v 1.135 2020/04/13 19:23:17 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: msdosfs_vfsops.c,v 1.136 2021/02/11 00:15:55 ryoon Exp $"); #if defined(_KERNEL_OPT) #include "opt_compat_netbsd.h" @@ -520,6 +520,13 @@ msdosfs_mountfs(struct vnode *devvp, struct mount *mp, struct lwp *l, struct msd b50 = (struct byte_bpb50 *)bsp->bs50.bsBPB; b710 = (struct byte_bpb710 *)bsp->bs710.bsBPB; +#if 0 + /* + * Some FAT partition, for example Raspberry Pi Pico's + * USB mass storage, does not have exptected BOOTSIGs. + * According to FreeBSD's comment, some PC-9800/9821 + * FAT floppy disks have similar problems. + */ if (!(argp->flags & MSDOSFSMNT_GEMDOSFS)) { if (bsp->bs50.bsBootSectSig0 != BOOTSIG0 || bsp->bs50.bsBootSectSig1 != BOOTSIG1) { @@ -530,6 +537,7 @@ msdosfs_mountfs(struct vnode *devvp, struct mount *mp, struct lwp *l, struct msd goto error_exit; } } +#endif pmp = malloc(sizeof(*pmp), M_MSDOSFSMNT, M_WAITOK|M_ZERO); pmp->pm_mountp = mp;