Date: Fri, 02 Sep 2005 13:56:43 -0400 From: Ben Thomas <bthomas@virtualiron.com> To: FreeBSD-gnats-submit@FreeBSD.org Subject: kern/85649: [patch] allow mounting msdos files systems as root device Message-ID: <4318925B.6070507@virtualiron.com> Resent-Message-ID: <200509021800.j82I0YgK055152@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 85649 >Category: kern >Synopsis: [patch] allow mounting msdos files systems as root device >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Fri Sep 02 18:00:34 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Ben Thomas >Release: FreeBSD 5.4-RELEASE i386 >Organization: Virtual Iron Software >Environment: System: FreeBSD bthomas4.katana-technology.com 5.4-RELEASE FreeBSD 5.4-RELEASE #10: Sun Aug 28 13:48:00 EDT 2005 ben@bthomas4.katana-technology.com:/usr/obj/usr/home/ben/BSD/RELENG_5_4_0_RELEASE/src/sys/BEN i386 >Description: Support mounting of msdosfs file systems as root. Yes, it's unusual. Yes, it was needed. This patch is against the 5_4_0_RELEASE code >How-To-Repeat: >Fix: --- msdosfs_vfsops.c-DIFF begins here --- --- /usr/src.original/sys/fs/msdosfs/msdosfs_vfsops.c Mon Jan 31 18:25:56 2005 +++ /usr/src/sys/fs/msdosfs/msdosfs_vfsops.c Thu Aug 11 16:16:26 2005 @@ -197,6 +197,25 @@ int error, flags; mode_t accessmode; + /* + * Use NULL path to indicate we are mounting the root filesystem. + */ + struct vnode *rootvp; + if (path == NULL) { + if ((error = bdevvp(rootdev, &rootvp))) { + printf("msdosfs_mountroot: can't find rootvp\n"); + return (error); + } + + if ((error = mountmsdosfs(rootvp, mp, td, NULL)) != 0) + return (error); + (void)VFS_STATFS(mp, &mp->mnt_stat, td); + (void) msdosfs_statfs(mp, &mp->mnt_stat, td); + args.mask = ALLPERMS; + update_mp(mp, &args, td); + return (0); + } + error = copyin(data, (caddr_t)&args, sizeof(struct msdosfs_args)); if (error) return (error); --- msdosfs_vfsops.c-DIFF ends here --- >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4318925B.6070507>