1 -- $Id: mountpoints.lua,v 1.4 2005/02/24 23:08:03 cpressey Exp $
3 -- Default configuration file for suggested mountpoints.
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,
11 -- mountpoint = "/foo", -- name of mountpoint
12 -- capstring = "123M" -- suggested capacity
15 -- Note that the capstring can be "*" to indicate 'use the
16 -- rest of the partition.')
18 return function(part_cap, ram_cap)
21 -- First, calculate suggested swap size:
23 local swap = 2 * ram_cap
24 if ram_cap > (part_cap / 2) or part_cap < 4096 then
27 swap = tostring(swap) .. "M"
30 -- Now, based on the capacity of the partition,
31 -- return an appropriate list of suggested mountpoints.
33 if part_cap < 523 then
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 = "*" }
42 elseif part_cap < 1024 then
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 = "*" }
51 elseif part_cap < 4096 then
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 = "*" }
60 elseif part_cap < 10240 then
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 = "*" }
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 = "*" }