Installer import into contrib (real import this time)
[dragonfly.git] / contrib / bsdinstaller-1.1.6 / src / backend / lua / configure / 400_mount_target_system.lua
1 -- $Id: 400_mount_target_system.lua,v 1.13 2005/02/24 23:08:03 cpressey Exp $
2
3 require "target_system"
4
5 return {
6     name = "mount_target_system",
7     title = "Mount Target System",
8     action = function(fsm)
9         --
10         -- If there is a target system mounted, unmount it before starting.
11         --
12         if App.state.target ~= nil and App.state.target:is_mounted() then
13                 if not App.state.target:unmount() then
14                         App.ui:inform(
15                             _("Warning: already-mounted target system could " ..
16                               "not be correctly unmounted first.")
17                         )
18                         return fsm:prev()
19                 end
20         end
21
22         App.state.target = TargetSystem.new(App.state.sel_part, "mnt")
23         if not App.state.target:probe() then
24                 App.ui:inform(_(
25                     "The target system could not be successfully probed."
26                 ))
27                 return fsm:prev()
28         end
29         if not App.state.target:mount() then
30                 App.ui:inform(_(
31                     "The target system could not be successfully mounted."
32                 ))
33                 return fsm:prev()
34         end
35
36         return fsm:next()
37     end
38 }