Well, we’ve been discussing our swap partitioning the last few days at work, and I finally got around to implementing it. Again, it proved to be kinda hard, basically because AutoYAST decides to do things differently. After trying different things, I came up with this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
<rule> <memsize> <match>32767</match> <match_type>greater</match_type> </memsize> <result> <profile>system/swap/32G.xml</profile> <continue config:type="boolean">false</continue> <dont_merge config:type="list"> <element>partition</element> </dont_merge> </result> </rule> <rule> <memsize> <match>16383</match> <match_type>greater</match_type> </memsize> <result> <profile>system/swap/16G.xml</profile> <continue config:type="boolean">false</continue> <dont_merge config:type="list"> <element>partition</element> </dont_merge> </result> </rule> <rule> <memsize> <match>8191</match> <match_type>greater</match_type> </memsize> <result> <profile>system/swap/8G.xml</profile> <continue config:type="boolean">false</continue> <dont_merge config:type="list"> <element>partition</element> </dont_merge> </result> </rule> <rule> <memsize> <match>4095</match> <match_type>greater</match_type> </memsize> <result> <profile>system/swap/4G.xml</profile> <continue config:type="boolean">false</continue> <dont_merge config:type="list"> <element>partition</element> </dont_merge> </result> </rule> <rule> <memsize> <match>2047</match> <match_type>greater</match_type> </memsize> <result> <profile>system/swap/2G.xml</profile> <continue config:type="boolean">false</continue> <dont_merge config:type="list"> <element>partition</element> </dont_merge> </result> </rule> <rule> <memsize> <match>1023</match> <match_type>greater</match_type> </memsize> <result> <profile>system/swap/1G.xml</profile> <continue config:type="boolean">false</continue> <dont_merge config:type="list"> <element>partition</element> </dont_merge> </result> </rule> <rule> <memsize> <match>1023</match> <match_type>lower</match_type> </memsize> <result> <profile>system/swap/default.xml</profile> <continue config:type="boolean">false</continue> <dont_merge config:type="list"> <element>partition</element> </dont_merge> </result> </rule> |
The content of a profile looks like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
<partitioning config:type="list"> <drive> <partitions config:type="list"> <partition> <create config:type="boolean">true</create> <crypt_fs config:type="boolean">false</crypt_fs> <filesystem config:type="symbol">swap</filesystem> <filesystem_id config:type="integer">130</filesystem_id> <format config:type="boolean">true</format> <loop_fs config:type="boolean">false</loop_fs> <mount>swap</mount> <mountby config:type="symbol">device</mountby> <partition_id config:type="integer">130</partition_id> <partition_nr config:type="integer">2</partition_nr> <resize config:type="boolean">false</resize> <size>16G</size> </partition> </partitions> </drive> </partitioning> |
So basically what I did, was creating different classes, and depending on the size of the available RAM, AutoYAST selects the profile.