Installer import into contrib (real import this time)
[dragonfly.git] / contrib / bsdinstaller-1.1.6 / src / backend / lua / conf / mountpoints.lua
1 -- $Id: mountpoints.lua,v 1.4 2005/02/24 23:08:03 cpressey Exp $
2
3 -- Default configuration file for suggested mountpoints.
4 --
5 -- Note that this file should return a function which takes two
6 -- numbers (the capacity of the partition and the capacity of
7 -- RAM, both in megabytes) and should return a list of tables,
8 -- each like:
9 --
10 -- {
11 --   mountpoint = "/foo",    -- name of mountpoint
12 --   capstring  = "123M"     -- suggested capacity
13 -- }
14 --
15 -- Note that the capstring can be "*" to indicate 'use the
16 -- rest of the partition.')
17
18 return function(part_cap, ram_cap)
19
20         --
21         -- First, calculate suggested swap size:
22         --
23         local swap = 2 * ram_cap
24         if ram_cap > (part_cap / 2) or part_cap < 4096 then
25                 swap = ram_cap
26         end
27         swap = tostring(swap) .. "M"
28
29         --
30         -- Now, based on the capacity of the partition,
31         -- return an appropriate list of suggested mountpoints.
32         --
33         if part_cap < 523 then
34                 return {
35                         { mountpoint = "/",     capstring = "70M" },
36                         { mountpoint = "swap",  capstring = swap },
37                         { mountpoint = "/var",  capstring = "32M" },
38                         { mountpoint = "/tmp",  capstring = "32M" },
39                         { mountpoint = "/usr",  capstring = "174M" },
40                         { mountpoint = "/home", capstring = "*" }
41                 }
42         elseif part_cap < 1024 then
43                 return {
44                         { mountpoint = "/",     capstring = "96M" },
45                         { mountpoint = "swap",  capstring = swap },
46                         { mountpoint = "/var",  capstring = "64M" },
47                         { mountpoint = "/tmp",  capstring = "64M" },
48                         { mountpoint = "/usr",  capstring = "256M" },
49                         { mountpoint = "/home", capstring = "*" }
50                 }
51         elseif part_cap < 4096 then
52                 return {
53                         { mountpoint = "/",     capstring = "128M" },
54                         { mountpoint = "swap",  capstring = swap },
55                         { mountpoint = "/var",  capstring = "128M" },
56                         { mountpoint = "/tmp",  capstring = "128M" },
57                         { mountpoint = "/usr",  capstring = "512M" },
58                         { mountpoint = "/home", capstring = "*" }
59                 }
60         elseif part_cap < 10240 then
61                 return {
62                         { mountpoint = "/",     capstring = "256M" },
63                         { mountpoint = "swap",  capstring = swap },
64                         { mountpoint = "/var",  capstring = "256M" },
65                         { mountpoint = "/tmp",  capstring = "256M" },
66                         { mountpoint = "/usr",  capstring = "3G" },
67                         { mountpoint = "/home", capstring = "*" }
68                 }
69         else
70                 return {
71                         { mountpoint = "/",     capstring = "256M" },
72                         { mountpoint = "swap",  capstring = swap },
73                         { mountpoint = "/var",  capstring = "256M" },
74                         { mountpoint = "/tmp",  capstring = "256M" },
75                         { mountpoint = "/usr",  capstring = "8G" },
76                         { mountpoint = "/home", capstring = "*" }
77                 }
78         end
79 end