diff options
author | marcel <marcel@FreeBSD.org> | 2002-12-02 20:15:16 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2002-12-02 20:15:16 +0000 |
commit | 08185d6b24389fb9fd0169df1777d2260c978b01 (patch) | |
tree | e448534c83572001a19e32a84c82fd4857feaa95 /usr.sbin/sysinstall/misc.c | |
parent | 7b3238944ad7e75d41b5abeec125b1565b406096 (diff) | |
download | FreeBSD-src-08185d6b24389fb9fd0169df1777d2260c978b01.zip FreeBSD-src-08185d6b24389fb9fd0169df1777d2260c978b01.tar.gz |
ia64 specific.
o Mount the EFI file system as msdosfs and not ufs as it's a FAT
file system. Introduce Mount_msdos() for this to go side-by-side
with Mount().
o Also, since mounting is performed as a command (which means it's
queued, sorted, lost, found and executed), we cannot create a
directory on the file system by calling mkdir. We must make sure
the mkdir happens after the mount. Introduce Mkdir_command() to
allow mkdir operations to be queued, sorted, lost, found and
executed as well.
Approved by: re (jhb, rwatson)
Diffstat (limited to 'usr.sbin/sysinstall/misc.c')
-rw-r--r-- | usr.sbin/sysinstall/misc.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/usr.sbin/sysinstall/misc.c b/usr.sbin/sysinstall/misc.c index 0965828..e485234 100644 --- a/usr.sbin/sysinstall/misc.c +++ b/usr.sbin/sysinstall/misc.c @@ -45,6 +45,7 @@ #include <ufs/ufs/ufsmount.h> #include <sys/reboot.h> #include <sys/disklabel.h> +#include <fs/msdosfs/msdosfsmount.h> /* Quick check to see if a file is readable */ Boolean @@ -310,6 +311,12 @@ Mkdir(char *ipath) } int +Mkdir_command(char *key, void *dir) +{ + return (Mkdir((char*)dir)); +} + +int Mount(char *mountp, void *dev) { struct ufs_args ufsargs; @@ -345,6 +352,44 @@ Mount(char *mountp, void *dev) return DITEM_SUCCESS; } +int +Mount_msdosfs(char *mountp, void *dev) +{ + struct msdosfs_args mount_args; + char device[80]; + char mountpoint[FILENAME_MAX]; + + if (Fake) + return DITEM_SUCCESS; + + if (*((char *)dev) != '/') { + sprintf(device, "%s/dev/%s", RunningAsInit ? "/mnt" : "", (char *)dev); + sprintf(mountpoint, "%s%s", RunningAsInit ? "/mnt" : "", mountp); + } + else { + strcpy(device, dev); + strcpy(mountpoint, mountp); + } + + if (Mkdir(mountpoint)) { + msgConfirm("Unable to make directory mountpoint for %s!", mountpoint); + return DITEM_FAILURE; + } + if (isDebug()) + msgDebug("mount %s %s\n", device, mountpoint); + + memset(&mount_args, 0, sizeof(mount_args)); + mount_args.fspec = device; + mount_args.magic = MSDOSFS_ARGSMAGIC; + mount_args.mask = S_IRWXU | S_IRWXG | S_IRWXO; + if (mount("msdosfs", mountpoint, RunningAsInit ? MNT_ASYNC|MNT_NOATIME : 0, + (caddr_t)&mount_args) == -1) { + msgConfirm("Error mounting %s on %s : %s", device, mountpoint, strerror(errno)); + return DITEM_FAILURE; + } + return DITEM_SUCCESS; +} + WINDOW * openLayoutDialog(char *helpfile, char *title, int x, int y, int width, int height) { |