1 |
diff -uNr anaconda-21.48.22.56__orig/pyanaconda/installclasses/fedora.py anaconda-21.48.22.56/pyanaconda/installclasses/fedora.py |
2 |
--- anaconda-21.48.22.56__orig/pyanaconda/installclasses/fedora.py 2015-10-22 17:34:02.000000000 +0100 |
3 |
+++ anaconda-21.48.22.56/pyanaconda/installclasses/fedora.py 2015-12-07 16:40:33.122000000 +0000 |
4 |
@@ -25,7 +25,7 @@ |
5 |
class FedoraBaseInstallClass(BaseInstallClass): |
6 |
name = "Fedora" |
7 |
sortPriority = 10000 |
8 |
- if productName.startswith("Red Hat "): |
9 |
+ if productName.startswith("Red Hat ") or productName.startswith("CentOS"): |
10 |
hidden = True |
11 |
|
12 |
_l10n_domain = "anaconda" |
13 |
diff -uNr anaconda-21.48.22.56__orig/pyanaconda/installclasses/centos.py anaconda-21.48.22.56/pyanaconda/installclasses/centos.py |
14 |
--- anaconda-21.48.22.56__orig/pyanaconda/installclasses/centos.py 1970-01-01 01:00:00.000000000 +0100 |
15 |
+++ anaconda-21.48.22.56/pyanaconda/installclasses/centos.py 2015-12-07 16:52:11.157000000 +0000 |
16 |
@@ -0,0 +1,97 @@ |
17 |
+# |
18 |
+# rhel.py |
19 |
+# |
20 |
+# Copyright (C) 2010 Red Hat, Inc. All rights reserved. |
21 |
+# |
22 |
+# This program is free software; you can redistribute it and/or modify |
23 |
+# it under the terms of the GNU General Public License as published by |
24 |
+# the Free Software Foundation; either version 2 of the License, or |
25 |
+# (at your option) any later version. |
26 |
+# |
27 |
+# This program is distributed in the hope that it will be useful, |
28 |
+# but WITHOUT ANY WARRANTY; without even the implied warranty of |
29 |
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
30 |
+# GNU General Public License for more details. |
31 |
+# |
32 |
+# You should have received a copy of the GNU General Public License |
33 |
+# along with this program. If not, see <http://www.gnu.org/licenses/>. |
34 |
+# |
35 |
+ |
36 |
+from pyanaconda.installclass import BaseInstallClass |
37 |
+from pyanaconda.product import productName |
38 |
+from pyanaconda import network |
39 |
+from pyanaconda import nm |
40 |
+from pyanaconda.kickstart import getAvailableDiskSpace |
41 |
+from blivet.partspec import PartSpec |
42 |
+from blivet.platform import platform |
43 |
+from blivet.devicelibs import swap |
44 |
+from blivet.size import Size |
45 |
+ |
46 |
+class RHELBaseInstallClass(BaseInstallClass): |
47 |
+ name = "CentOS Linux" |
48 |
+ sortPriority = 20001 |
49 |
+ if not productName.startswith("CentOS"): |
50 |
+ hidden = True |
51 |
+ defaultFS = "xfs" |
52 |
+ |
53 |
+ bootloaderTimeoutDefault = 5 |
54 |
+ |
55 |
+ ignoredPackages = ["ntfsprogs", "reiserfs-utils", "hfsplus-tools"] |
56 |
+ |
57 |
+ installUpdates = False |
58 |
+ |
59 |
+ _l10n_domain = "comps" |
60 |
+ |
61 |
+ efi_dir = "centos" |
62 |
+ |
63 |
+ help_placeholder = "CentOSPlaceholder.html" |
64 |
+ help_placeholder_with_links = "CentOSPlaceholder.html" |
65 |
+ |
66 |
+ def configure(self, anaconda): |
67 |
+ BaseInstallClass.configure(self, anaconda) |
68 |
+ self.setDefaultPartitioning(anaconda.storage) |
69 |
+ |
70 |
+ def setNetworkOnbootDefault(self, ksdata): |
71 |
+ if network.has_some_wired_autoconnect_device(): |
72 |
+ return |
73 |
+ # choose the device used during installation |
74 |
+ # (ie for majority of cases the one having the default route) |
75 |
+ dev = network.default_route_device() \ |
76 |
+ or network.default_route_device(family="inet6") |
77 |
+ if not dev: |
78 |
+ return |
79 |
+ # ignore wireless (its ifcfgs would need to be handled differently) |
80 |
+ if nm.nm_device_type_is_wifi(dev): |
81 |
+ return |
82 |
+ network.update_onboot_value(dev, "yes", ksdata) |
83 |
+ |
84 |
+ def __init__(self): |
85 |
+ BaseInstallClass.__init__(self) |
86 |
+ |
87 |
+class RHELAtomicInstallClass(RHELBaseInstallClass): |
88 |
+ name = "CentOS Atomic Host" |
89 |
+ sortPriority=21001 |
90 |
+ hidden = not productName.startswith(("CentOS Atomic Host", "CentOS Linux Atomic")) |
91 |
+ |
92 |
+ def setDefaultPartitioning(self, storage): |
93 |
+ autorequests = [PartSpec(mountpoint="/", fstype=storage.defaultFSType, |
94 |
+ size=Size("1GiB"), maxSize=Size("3GiB"), grow=True, lv=True)] |
95 |
+ |
96 |
+ bootreqs = platform.setDefaultPartitioning() |
97 |
+ if bootreqs: |
98 |
+ autorequests.extend(bootreqs) |
99 |
+ |
100 |
+ disk_space = getAvailableDiskSpace(storage) |
101 |
+ swp = swap.swapSuggestion(disk_space=disk_space) |
102 |
+ autorequests.append(PartSpec(fstype="swap", size=swp, grow=False, |
103 |
+ lv=True, encrypted=True)) |
104 |
+ |
105 |
+ for autoreq in autorequests: |
106 |
+ if autoreq.fstype is None: |
107 |
+ if autoreq.mountpoint == "/boot": |
108 |
+ autoreq.fstype = storage.defaultBootFSType |
109 |
+ autoreq.size = Size("300MiB") |
110 |
+ else: |
111 |
+ autoreq.fstype = storage.defaultFSType |
112 |
+ |
113 |
+ storage.autoPartitionRequests = autorequests |