1 -- $Id: 300_select_part.lua,v 1.17 2005/02/24 23:08:04 cpressey Exp $
8 title = "Select Partition",
10 App.state.sel_part = nil
12 local pd = StorageUI.select_part({
13 dd = App.state.sel_disk,
15 "Select the primary partition of %s (also " ..
16 "known as a `slice' in the BSD tradition) on " ..
17 "which to install %s.",
18 App.state.sel_disk:get_name(),
20 cancel_desc = _("Return to %s", fsm:prev().title)
24 if pd:is_mounted() then
26 _("One or more subpartitions on the selected " ..
27 "primary partition already in use (they are " ..
28 "currently mounted in the filesystem.) " ..
29 "You should either unmount them before " ..
30 "proceeding, or select a different partition " ..
31 "or disk on which to install %s.", App.os.name))
35 if pd:get_activated_swap() > 0 then
38 choices[_("Reboot")] = "reboot"
39 choices[_("Return to %s", fsm:prev().title)] = fsm:prev()
42 _("Some subpartitions on the selected primary " ..
43 "partition are already activated as swap. " ..
44 "Since there is no way to deactivate swap in " ..
45 "%s once it is activated, in order " ..
46 "to edit the subpartition layout of this " ..
47 "primary partition, you must first reboot.",
48 App.os.name), choices)
51 App.state.sel_part = pd
53 if pd:get_capacity() < App.state.disk_min then
55 "WARNING: you should have a primary " ..
56 "partition at least %dM in size, or " ..
57 "you may encounter problems trying to " ..
59 App.state.disk_min, App.os.name)
63 if App.state.sel_disk:has_been_touched() or
65 "WARNING! ALL data in primary partition #%d,\n\n%s\n\non the " ..
66 "disk\n\n%s\n\n will be IRREVOCABLY ERASED!\n\nAre you " ..
67 "ABSOLUTELY SURE you wish to take this action? This is " ..
68 "your LAST CHANCE to cancel!",
69 pd:get_number(), pd:get_desc(),
70 App.state.sel_disk:get_desc())) then
71 local cmds = CmdChain.new()
74 if cmds:execute() then
76 "Primary partition #%d was formatted.",
82 "Primary partition #%d was " ..
83 "not correctly formatted, and may " ..
84 "now be in an inconsistent state. " ..
85 "We recommend re-formatting it " ..
93 "Action cancelled - " ..
94 "no primary partitions were formatted."))