daemon: Fix type signature of mount_vfs (RHBZ#1564983).

Reported-by: Yongkui Guo.

Fixes commit 82bbd9c8a5.
This commit is contained in:
Richard W.M. Jones
2018-04-09 08:51:18 +01:00
parent b8401108c7
commit 07ead43cbb
3 changed files with 12 additions and 14 deletions

View File

@@ -39,14 +39,12 @@ let rec check_for_filesystem_on mountable vfs_type =
if vfs_type = "ufs" then ( (* Hack for the *BSDs. *)
(* FreeBSD fs is a variant of ufs called ufs2 ... *)
try
Mount.mount_vfs (Some "ro,ufstype=ufs2") (Some "ufs")
mountable "/";
Mount.mount_vfs "ro,ufstype=ufs2" "ufs" mountable "/";
true
with _ ->
(* while NetBSD and OpenBSD use another variant labeled 44bsd *)
try
Mount.mount_vfs (Some "ro,ufstype=44bsd") (Some "ufs")
mountable "/";
Mount.mount_vfs "ro,ufstype=44bsd" "ufs" mountable "/";
true
with _ -> false
) else (

View File

@@ -32,22 +32,22 @@ let mount_vfs options vfs mountable mountpoint =
(* -o options *)
(match options, mountable.m_type with
| (None | Some ""), (MountableDevice | MountablePath) -> ()
| Some options, (MountableDevice | MountablePath) ->
| "", (MountableDevice | MountablePath) -> ()
| options, (MountableDevice | MountablePath) ->
List.push_back args "-o";
List.push_back args options
| (None | Some ""), MountableBtrfsVol subvol ->
| "", MountableBtrfsVol subvol ->
List.push_back args "-o";
List.push_back args ("subvol=" ^ subvol)
| Some options, MountableBtrfsVol subvol ->
| options, MountableBtrfsVol subvol ->
List.push_back args "-o";
List.push_back args ("subvol=" ^ subvol ^ "," ^ options)
);
(* -t vfs *)
(match vfs with
| None | Some "" -> ()
| Some t ->
| "" -> ()
| t ->
List.push_back args "-t";
List.push_back args t
);
@@ -57,9 +57,9 @@ let mount_vfs options vfs mountable mountpoint =
ignore (command "mount" !args)
let mount = mount_vfs None None
let mount_ro = mount_vfs (Some "ro") None
let mount_options options = mount_vfs (Some options) None
let mount = mount_vfs "" ""
let mount_ro = mount_vfs "ro" ""
let mount_options options = mount_vfs options ""
(* Unmount everything mounted under /sysroot.
*

View File

@@ -19,6 +19,6 @@
val mount : Mountable.t -> string -> unit
val mount_ro : Mountable.t -> string -> unit
val mount_options : string -> Mountable.t -> string -> unit
val mount_vfs : string option -> string option -> Mountable.t -> string -> unit
val mount_vfs : string -> string -> Mountable.t -> string -> unit
val umount_all : unit -> unit