/[smeserver]/rpms/anaconda/sme9/0009-CheckArch.patch
ViewVC logotype

Annotation of /rpms/anaconda/sme9/0009-CheckArch.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (hide annotations) (download)
Tue Dec 24 21:01:34 2013 UTC (10 years, 5 months ago) by charliebrady
Branch: MAIN
Check 'wrong architecture' and 'too many root partitions' before doing upgrade.

1 charliebrady 1.1 diff -ru work/anaconda-13.21.176/iw/examine_gui.py work+patch/anaconda-13.21.176/iw/examine_gui.py
2     --- work/anaconda-13.21.176/iw/examine_gui.py 2012-06-12 15:40:09.000000000 -0400
3     +++ work+patch/anaconda-13.21.176/iw/examine_gui.py 2012-10-05 11:13:35.000000000 -0400
4     @@ -142,7 +142,7 @@
5     self.upgradecombo.pack_start(cell, True)
6     self.upgradecombo.set_attributes(cell, markup=0)
7    
8     - for (dev, desc) in self.parts:
9     + for (dev, desc, arch) in self.parts:
10     iter = model.append()
11     if (desc is None) or len(desc) < 1:
12     desc = _("Unknown Linux system")
13     diff -ru work/anaconda-13.21.176/rescue.py work+patch/anaconda-13.21.176/rescue.py
14     --- work/anaconda-13.21.176/rescue.py 2012-06-12 15:40:09.000000000 -0400
15     +++ work+patch/anaconda-13.21.176/rescue.py 2012-10-05 11:12:56.000000000 -0400
16     @@ -340,7 +340,7 @@
17     scroll = 0
18    
19     devList = []
20     - for (device, relstr) in disks:
21     + for (device, relstr, arch) in disks:
22     if getattr(device.format, "label", None):
23     devList.append("%s (%s) - %s" % (device.name, device.format.label, relstr))
24     else:
25     diff -ru work/anaconda-13.21.176/storage/__init__.py work+patch/anaconda-13.21.176/storage/__init__.py
26     --- work/anaconda-13.21.176/storage/__init__.py 2012-09-17 14:08:23.000000000 -0400
27     +++ work+patch/anaconda-13.21.176/storage/__init__.py 2012-10-05 11:14:47.000000000 -0400
28     @@ -1294,6 +1294,9 @@
29     def getReleaseString(mountpoint):
30     relName = None
31     relVer = None
32     + arch = "32"
33     + if os.path.isdir(mountpoint + "/usr/lib64"):
34     + arch = '64'
35    
36     filename = "%s/etc/redhat-release" % mountpoint
37     if os.access(filename, os.R_OK):
38     @@ -1311,7 +1314,7 @@
39     relName = product
40     relVer = version.split()[0]
41    
42     - return (relName, relVer)
43     + return (relName, relVer, arch)
44    
45     def findExistingRootDevices(anaconda, upgradeany=False):
46     """ Return a list of all root filesystems in the device tree. """
47     @@ -1320,7 +1323,6 @@
48     if not os.path.exists(anaconda.rootPath):
49     iutil.mkdirChain(anaconda.rootPath)
50    
51     - roots = []
52     for device in anaconda.id.storage.devicetree.leaves:
53     if not device.format.linuxNative or not device.format.mountable:
54     continue
55     @@ -1345,13 +1347,13 @@
56     continue
57    
58     if os.access(anaconda.rootPath + "/etc/fstab", os.R_OK):
59     - (product, version) = getReleaseString(anaconda.rootPath)
60     + (product, version, arch) = getReleaseString(anaconda.rootPath)
61     if upgradeany or \
62     anaconda.id.instClass.productUpgradable(product, version):
63     - rootDevs.append((device, "%s %s" % (product, version)))
64     + rootDevs.append((device, "%s %s" % (product, version), arch))
65     else:
66     - log.info("product %s version %s found on %s is not upgradable"
67     - % (product, version, device.name))
68     + log.info("product %s version %s arch %s found on %s is not upgradable"
69     + % (product, version, arch, device.name))
70    
71     # this handles unmounting the filesystem
72     device.teardown(recursive=True)
73     diff -ru work/anaconda-13.21.176/upgrade.py work+patch/anaconda-13.21.176/upgrade.py
74     --- work/anaconda-13.21.176/upgrade.py 2012-06-12 15:40:09.000000000 -0400
75     +++ work+patch/anaconda-13.21.176/upgrade.py 2012-10-05 15:45:16.000000000 -0400
76     @@ -66,7 +66,7 @@
77     # kickstart can pass device as device name or uuid. No quotes allowed.
78     if anaconda.isKickstart and anaconda.id.ksdata.upgrade.root_device is not None:
79     root_device = anaconda.id.ksdata.upgrade.root_device
80     - for (dev, label) in anaconda.id.rootParts:
81     + for (dev, label, arch) in anaconda.id.rootParts:
82     if ((root_device is not None) and
83     (root_device == dev.name or root_device == "UUID=%s" % dev.format.uuid)):
84     anaconda.id.upgradeRoot.insert(0, (dev,label))
85     --- work/anaconda-13.21.195/textw/upgrade_text.py.orig 2013-03-30 17:15:24.000000000 -0400
86     +++ work/anaconda-13.21.195/textw/upgrade_text.py 2013-03-30 17:18:46.000000000 -0400
87     @@ -20,6 +20,9 @@
88     import isys
89     import iutil
90     import upgrade
91     +import rpmUtils
92     +import os
93     +import sys
94     from constants_text import *
95     from snack import *
96     from flags import flags
97     @@ -218,6 +221,11 @@
98     upgrade.setUpgradeRoot(anaconda)
99    
100     parts = anaconda.id.rootParts
101     + cur_arch = os.uname()[4]
102     + if cur_arch == 'i686':
103     + cur_arch = '32'
104     + else:
105     + cur_arch = '64'
106    
107     height = min(len(parts), 11) + 1
108     if height == 12:
109     @@ -227,19 +235,51 @@
110     partList = []
111     partList.append(_("Reinstall System"))
112    
113     - if (anaconda.id.upgrade == None and anaconda.dispatch.stepInSkipList("installtype")) or anaconda.id.upgrade:
114     + if (anaconda.id.upgrade == None and anaconda.dispatch.stepInSkipList("installtype")) or anaconda.id.upgrade:
115     default = 1
116     else:
117     default = 0
118    
119     - for (device, desc) in parts:
120     - partList.append("%s (%s)" %(desc, device.path))
121     + sys_is_not_upgradeable = 0
122     +
123     + upgradeable_partitions = len(parts)
124     + if upgradeable_partitions != 1:
125     + sys_is_not_upgradeable = 1
126     + header = _("System has problem")
127     + reason = _("Your system is not upgradeable. There is more than one SME server partition.")
128     +
129     + (drive, desc, arch) = parts[0]
130     +
131     + if arch != cur_arch:
132     + sys_is_not_upgradeable = 1
133     + header = _("Wrong SME server version")
134     + reason = _("Your system is not upgradeable using this version of SME server. The currently installed system is a %s bit version, but this version of SME server is a %s bit version.") % (arch, cur_arch)
135     +
136     + if sys_is_not_upgradeable:
137     + partList.append(_("Reboot system"))
138     + (button, choice) = ListboxChoiceWindow(screen, header,
139     + reason, partList,
140     + [ TEXT_OK_BUTTON,
141     + TEXT_BACK_BUTTON ],
142     + width = 55, scroll = scroll,
143     + height = height,
144     + help = "upgraderoot",
145     + default = 1)
146     +
147     + if button == TEXT_BACK_CHECK:
148     + return INSTALL_BACK
149     + else:
150     + if choice == 0:
151     + anaconda.dispatch.skipStep("installtype", skip = 0)
152     + anaconda.id.upgradeRoot = None
153     + return INSTALL_OK
154     + else:
155     + sys.exit(1)
156     +
157     + partList.append(_("Upgrade existing \"%s\" system") %(desc))
158    
159     (button, choice) = ListboxChoiceWindow(screen, _("System to Upgrade"),
160     - _("There seem to be one or more existing Linux installations "
161     - "on your system.\n\nPlease choose one to upgrade, "
162     - "or select 'Reinstall System' to freshly install "
163     - "your system."), partList,
164     + _("Your system is upgradeable."), partList,
165     [ TEXT_OK_BUTTON,
166     TEXT_BACK_BUTTON ],
167     width = 55, scroll = scroll,

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed