Install a moduli(5) manual page.
[dragonfly.git] / contrib / bsdinstaller-1.1.6 / src / backend / lua / install / 200_select_disk.lua
1 -- $Id: 200_select_disk.lua,v 1.16 2005/02/24 23:08:04 cpressey Exp $
2
3 require "gettext"
4 require "storage_ui"
5
6 return {
7     name = "select_disk",
8     title = "Select Disk",
9     action = function(fsm)
10         App.state.sel_disk = nil
11         App.state.sel_part = nil
12
13         -- XXX there might be a better place to handle this.
14         if App.state.storage:get_disk_count() == 0 then
15                 App.ui:inform(_(
16                     "The installer could not find any disks suitable "  ..
17                     "for installation (IDE or SCSI) attached to this "  ..
18                     "computer.  If you wish to install %s"              ..
19                     " on an unorthodox storage device, you will have to " ..
20                     "exit to a LiveCD command prompt and install it "   ..
21                     "manually, using the file /README as a guide.",
22                     App.os.name)
23                 )
24                 return nil
25         end
26
27         local dd = StorageUI.select_disk({
28             sd = App.state.storage,
29             short_desc = _("Select a disk on which to install %s.",
30                 App.os.name),
31             cancel_desc = _("Return to %s", fsm:prev().title)
32         })
33
34         if dd then
35                 if dd:is_mounted() then
36                         App.ui:inform(
37                             _("One or more subpartitions of one or more " ..
38                             "primary partitions of the selected disk "    ..
39                             "are already in use (they are currently "     ..
40                             "mounted on mountpoints in the filesystem.) " ..
41                             "You should either unmount them before "      ..
42                             "proceeding, or select a different disk to "  ..
43                             "install %s on.", App.os.name))
44                         return fsm:current()
45                 end
46
47                 App.state.sel_disk = dd
48
49                 -- XXX there might be a better place to handle this.
50                 if dd:get_capacity() < App.state.disk_min then
51                         App.ui:inform(_(
52                             "WARNING: you should have a disk "  ..
53                             "at least %dM in size, or "         ..
54                             "you may encounter problems trying to " ..
55                             "install %s.",
56                             App.state.disk_min, App.os.name)
57                         )
58                 end
59
60                 return fsm:next()
61         else
62                 return fsm:prev()
63         end
64     end
65 }