anaconda-arm-uboot-partition.patch
by d.marlin
I have rebased a patch Dennis Gilmore submitted in August,
https://lists.fedorahosted.org/pipermail/anaconda-patches/2012-August/000...
and made some minor modifications. This is just a 'draft' at this
point, but I would appreciate any feedback on the approach (if
acceptable) and suggestions for improvement. I understand that we will
need to subclass Bootloader to add U-Boot support, but wanted to see if
I was on the right track with the platform changes.
Also, I have been testing this using livemedia-creator in F17
(backported the changes). The storage definition in the kickstart file is:
bootloader --location=none
zerombr
clearpart --all
part /boot/uboot --size 200 --fstype vfat --asprimary --label=boot
part swap --size 500 --asprimary --label=swap
part / --size 2000 --fstype ext4 --label=rootfs
This appears to do what we want for the OMAP disk image. Should I be
doing anything else here to test the changes in platform (possibly using
autopart)?
Thank you,
d.marlin
11 years, 6 months
[python-meh] [PATCH] Handle unicode strings correctly (#854959)
by Vratislav Podzimek
Signed-off-by: Vratislav Podzimek <vpodzime(a)redhat.com>
---
meh/dump.py | 2 ++
meh/handler.py | 6 +++---
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/meh/dump.py b/meh/dump.py
index 2e8c94a..e9779f0 100644
--- a/meh/dump.py
+++ b/meh/dump.py
@@ -344,6 +344,8 @@ class ExceptionDump(object):
ret += self._dumpClass(v, level + 1, parentkey = curkey, skipList=skipList)
ret += "}\n"
elif __isSimpleType(value):
+ if type(value) == types.UnicodeType:
+ value = value.encode("utf-8")
ret += "%s%s: %s\n" % (pad, curkey, value)
else:
ret += "%s%s: " % (pad, curkey)
diff --git a/meh/handler.py b/meh/handler.py
index 7958b86..576af6b 100644
--- a/meh/handler.py
+++ b/meh/handler.py
@@ -96,10 +96,10 @@ class ExceptionHandler(object):
# Save the exception to the filesystem first.
self.exn = self.exnClass((ty, value, tb), self.conf)
- (fd, self.exnFile) = self.openFile()
+ (fobj, self.exnFile) = self.openFile()
self.exnText = self.exn.traceback_and_object_dump(obj)
- fd.write(self.exnText.encode("utf-8"))
- fd.close()
+ fobj.write(self.exnText)
+ fobj.close()
self.postWriteHook((ty, value, tb), obj)
--
1.7.11.4
11 years, 6 months
More VNC fixes
by Jesse Keating
This is a pile of other VNC fixes that I thought of after sending the set
last night. These have all been tested with an updates.img against branched.
-jlk
11 years, 7 months
[rhel6-branch] use udev_resolve_devspec to resolve raid onpart members (#809641)
by Brian C. Lane
From: "Brian C. Lane" <bcl(a)redhat.com>
--onpart may be used with /dev/disk/by-* so first try to resolve it with udev
Resolves: rhbz#809641
---
kickstart.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/kickstart.py b/kickstart.py
index 05803ab..bac6ab0 100644
--- a/kickstart.py
+++ b/kickstart.py
@@ -975,7 +975,8 @@ class RaidData(commands.raid.F12_RaidData):
for member in self.members:
# if member is using --onpart, use original device
member = anaconda.id.ksdata.onPart.get(member, member)
- dev = devicetree.getDeviceByName(member)
+ dev_name = udev_resolve_devspec(member) or member
+ dev = devicetree.getDeviceByName(dev_name)
if dev and dev.format.type == "luks":
try:
dev = devicetree.getChildren(dev)[0]
--
1.7.11.4
11 years, 7 months
[rhel6-branch] fix duplicate raid error message on unsupported arch (#811197)
by Brian C. Lane
From: Kamalesh Babulal <kamalesh(a)linux.vnet.ibm.com>
This patch moves the raid runlevel check, dependent on if
arch supports raid bootable devices.
Resolves: rhbz#811197
Signed-off-by: Brian C. Lane <bcl(a)redhat.com>
---
platform.py | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/platform.py b/platform.py
index 31552ab..8c1f603 100644
--- a/platform.py
+++ b/platform.py
@@ -114,16 +114,16 @@ class Platform(object):
if not req:
return [_("You have not created a bootable partition.")]
- if req.type == "mdarray" and req.level != 1:
- errors.append(_("Bootable partitions can only be on RAID1 devices."))
-
# most arches can't have boot on a logical volume
if req.type == "lvmlv" and not self.supportsLvmBoot:
errors.append(_("Bootable partitions cannot be on a logical volume."))
# most arches can't have boot on RAID
- if req.type == "mdarray" and not self.supportsMdRaidBoot:
- errors.append(_("Bootable partitions cannot be on a RAID device."))
+ if req.type == "mdarray":
+ if not self.supportsMdRaidBoot:
+ errors.append(_("Bootable partitions cannot be on a RAID device."))
+ elif req.level != 1:
+ errors.append(_("Bootable partitions can only be on RAID1 devices."))
# Make sure /boot is on a supported FS type. This prevents crazy
# things like boot on vfat.
--
1.7.11.4
11 years, 7 months
[PATCH] KEYTABLE is now vconsole.keymap (#859298)
by Brian C. Lane
From: "Brian C. Lane" <bcl(a)redhat.com>
---
pyanaconda/keyboard.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pyanaconda/keyboard.py b/pyanaconda/keyboard.py
index 3180502..fb3f7ef 100755
--- a/pyanaconda/keyboard.py
+++ b/pyanaconda/keyboard.py
@@ -132,7 +132,7 @@ def write_layouts_config(keyboard, root):
fobj.write(get_layouts_xorg_conf(keyboard))
with open(os.path.join(sysconf_dir, sysconf_file), "w") as fobj:
- fobj.write('KEYTABLE="%s"\n' % keyboard.keyboard)
+ fobj.write('vconsole.keymap="%s"\n' % keyboard.keyboard)
except IOError as ioerr:
raise KeyboardConfigError("Cannot write keyboard configuration files")
--
1.7.11.4
11 years, 7 months
[rhel6-branch] add unsupported_hardware kickstart command (#824963)
by Brian C. Lane
From: "Brian C. Lane" <bcl(a)redhat.com>
If unsupported_hardware is included in the kickstart file skip the
interactive dialog warning and log that it is installing on
unsupported hardware.
Resolves: rhbz#824963
---
anaconda.spec.in | 2 +-
loader/kickstart.c | 10 ++++++++++
loader/kickstart.h | 1 +
loader/loader.c | 18 +++++++++++-------
loader/loader.h | 2 ++
5 files changed, 25 insertions(+), 8 deletions(-)
diff --git a/anaconda.spec.in b/anaconda.spec.in
index ff40ccb..f5ffe0d 100644
--- a/anaconda.spec.in
+++ b/anaconda.spec.in
@@ -27,7 +27,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
%define intltoolver 0.31.2-3
%define libnlver 1.0
%define libselinuxver 1.6
-%define pykickstartver 1.74.11
+%define pykickstartver 1.74.12
%define rpmpythonver 4.2-0.61
%define slangver 2.0.6-2
%define yumver 2.9.2
diff --git a/loader/kickstart.c b/loader/kickstart.c
index 0429d9d..27f5f66 100644
--- a/loader/kickstart.c
+++ b/loader/kickstart.c
@@ -89,6 +89,8 @@ static void setUpdates(struct loaderData_s * loaderData, int argc,
char ** argv);
static void setVnc(struct loaderData_s * loaderData, int argc,
char ** argv);
+static void setUnsupportedHw(struct loaderData_s * loaderData, int argc,
+ char ** argv);
struct ksCommandNames ksTable[] = {
{ KS_CMD_NFS, "nfs", setKickstartNfs },
@@ -110,6 +112,7 @@ struct ksCommandNames ksTable[] = {
{ KS_CMD_MEDIACHECK, "mediacheck", setMediaCheck },
{ KS_CMD_UPDATES, "updates", setUpdates },
{ KS_CMD_VNC, "vnc", setVnc },
+ { KS_CMD_UNSUPPORTED_HW, "unsupported_hardware", setUnsupportedHw },
{ KS_CMD_NONE, NULL, NULL }
};
@@ -435,6 +438,13 @@ void getKickstartFile(struct loaderData_s *loaderData) {
return;
}
+static void setUnsupportedHw(struct loaderData_s * loaderData, int argc,
+ char ** argv) {
+ logMessage(INFO, "kickstart setting unsupported_hardware");
+ flags |= LOADER_FLAGS_UNSUPPORTED_HW;
+ return;
+}
+
static void setVnc(struct loaderData_s * loaderData, int argc,
char ** argv) {
logMessage(INFO, "kickstart forcing graphical mode over vnc");
diff --git a/loader/kickstart.h b/loader/kickstart.h
index 24612cf..4a67940 100644
--- a/loader/kickstart.h
+++ b/loader/kickstart.h
@@ -41,6 +41,7 @@
#define KS_CMD_MEDIACHECK 17
#define KS_CMD_UPDATES 18
#define KS_CMD_VNC 19
+#define KS_CMD_UNSUPPORTED_HW 20
int ksReadCommands(char * cmdFile);
int ksGetCommand(int cmd, char ** last, int * argc, char *** argv);
diff --git a/loader/loader.c b/loader/loader.c
index 52ddc5d..8c967be 100644
--- a/loader/loader.c
+++ b/loader/loader.c
@@ -1276,13 +1276,17 @@ static void checkTaintFlag(void) {
}
if (l & (1 << 28)) {
- startNewt();
- newtWinMessage(_("Unsupported Hardware Detected"), _("OK"),
- _("This hardware (or a combination thereof) is not "
- "supported by Red Hat. For more information on "
- "supported hardware, please refer to "
- "http://www.redhat.com/hardware."));
- stopNewt();
+ if(!FL_UNSUPPORTED_HW(flags)) {
+ startNewt();
+ newtWinMessage(_("Unsupported Hardware Detected"), _("OK"),
+ _("This hardware (or a combination thereof) is not "
+ "supported by Red Hat. For more information on "
+ "supported hardware, please refer to "
+ "http://www.redhat.com/hardware."));
+ stopNewt();
+ } else {
+ logMessage(WARNING, "Installing on Unsupported Hardware.");
+ }
}
g_free(contents);
diff --git a/loader/loader.h b/loader/loader.h
index 6df95f9..564dc6c 100644
--- a/loader/loader.h
+++ b/loader/loader.h
@@ -73,6 +73,7 @@
#define LOADER_FLAGS_AUTOMODDISK (((uint64_t) 1) << 40)
#define LOADER_FLAGS_NOEJECT (((uint64_t) 1) << 41)
#define LOADER_FLAGS_NOVERIFYSSL (((uint64_t) 1) << 42)
+#define LOADER_FLAGS_UNSUPPORTED_HW (((uint64_t) 1) << 43)
#define FL_TEXT(a) ((a) & LOADER_FLAGS_TEXT)
#define FL_RESCUE(a) ((a) & LOADER_FLAGS_RESCUE)
@@ -112,6 +113,7 @@
#define FL_AUTOMODDISK(a) ((a) & LOADER_FLAGS_AUTOMODDISK)
#define FL_NOEJECT(a) ((a) & LOADER_FLAGS_NOEJECT)
#define FL_NOVERIFYSSL(a) ((a) & LOADER_FLAGS_NOVERIFYSSL)
+#define FL_UNSUPPORTED_HW(a) ((a) & LOADER_FLAGS_UNSUPPORTED_HW)
void startNewt(void);
void stopNewt(void);
--
1.7.11.4
11 years, 7 months
[PATCH] Fix a problem with storage error handling (#861376).
by Chris Lumens
---
pyanaconda/errors.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pyanaconda/errors.py b/pyanaconda/errors.py
index 8917184..18fc61c 100644
--- a/pyanaconda/errors.py
+++ b/pyanaconda/errors.py
@@ -93,7 +93,7 @@ class ErrorHandler(object):
def _partitionErrorHandler(self, *args, **kwargs):
message = _("The following errors occurred with your partitioning:\n\n%(errortxt)\n\n"
- "The installation will now terminate.") % {"errortxt": args[0]}
+ "The installation will now terminate.") % {"errortxt": str(kwargs["exception"])}
self.ui.showError(message)
return ERROR_RAISE
--
1.7.11.2
11 years, 7 months
[rhel6-branch] handle zero size package metadata (#823690)
by Brian C. Lane
From: "Brian C. Lane" <bcl(a)redhat.com>
The metadata may not have package sizes, skip dividing by 0.
Resolves: rhbz#823690
---
yuminstall.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/yuminstall.py b/yuminstall.py
index bca3d47..3cb1659 100644
--- a/yuminstall.py
+++ b/yuminstall.py
@@ -234,7 +234,10 @@ class AnacondaCallback:
self.numpkgs)
% {'donepkgs': self.donepkgs,
'numpkgs': self.numpkgs})
- self.progress.set_fraction(float(self.doneSize / self.totalSize))
+ if self.totalSize > 0:
+ self.progress.set_fraction(float(self.doneSize / self.totalSize))
+ else:
+ self.progress.set_fraction(0.0)
self.progress.processEvents()
self.inProgressPo = None
--
1.7.11.4
11 years, 7 months
[rhel6-branch] add unsupported_hardware command (#824963)
by Brian C. Lane
From: "Brian C. Lane" <bcl(a)redhat.com>
Used by RHEL6 to skip tainted hardware warning dialog during kickstart
installs.
---
pykickstart/commands/__init__.py | 4 +-
pykickstart/commands/unsupported_hardware.py | 55 ++++++++++++++++++++++++++++
pykickstart/handlers/control.py | 1 +
tests/commands/unsupported_hardware.py | 19 ++++++++++
4 files changed, 77 insertions(+), 2 deletions(-)
create mode 100644 pykickstart/commands/unsupported_hardware.py
create mode 100644 tests/commands/unsupported_hardware.py
diff --git a/pykickstart/commands/__init__.py b/pykickstart/commands/__init__.py
index da48ff5..9c38242 100644
--- a/pykickstart/commands/__init__.py
+++ b/pykickstart/commands/__init__.py
@@ -22,5 +22,5 @@ import deviceprobe, displaymode, dmraid, driverdisk, fcoe, firewall, firstboot
import group, ignoredisk, interactive, iscsi, iscsiname, key, keyboard, lang
import langsupport, lilocheck, logging, logvol, mediacheck, method, monitor
import mouse, multipath, network, partition, raid, reboot, repo, rescue, rootpw
-import selinux, services, skipx, sshpw, timezone, updates, upgrade, user, vnc
-import volgroup, xconfig, zerombr, zfcp
+import selinux, services, skipx, sshpw, timezone, updates, upgrade, user
+import unsupported_hardware, vnc, volgroup, xconfig, zerombr, zfcp
diff --git a/pykickstart/commands/unsupported_hardware.py b/pykickstart/commands/unsupported_hardware.py
new file mode 100644
index 0000000..5776ce6
--- /dev/null
+++ b/pykickstart/commands/unsupported_hardware.py
@@ -0,0 +1,55 @@
+#
+# Brian C. Lane <bcl(a)redhat.com>
+#
+# Copyright 2012 Red Hat, Inc.
+#
+# This copyrighted material is made available to anyone wishing to use, modify,
+# copy, or redistribute it subject to the terms and conditions of the GNU
+# General Public License v.2. This program is distributed in the hope that it
+# will be useful, but WITHOUT ANY WARRANTY expressed or implied, including the
+# implied warranties of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 51
+# Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Any Red Hat
+# trademarks that are incorporated in the source code or documentation are not
+# subject to the GNU General Public License and may only be used or replicated
+# with the express permission of Red Hat, Inc.
+#
+from pykickstart.base import *
+from pykickstart.errors import *
+from pykickstart.options import *
+
+import gettext
+_ = lambda x: gettext.ldgettext("pykickstart", x)
+
+class RHEL6_UnsupportedHardware(KickstartCommand):
+ removedKeywords = KickstartCommand.removedKeywords
+ removedAttrs = KickstartCommand.removedAttrs
+
+ def __init__(self, writePriority=0, *args, **kwargs):
+ KickstartCommand.__init__(self, writePriority, *args, **kwargs)
+ self.op = self._getParser()
+ self.unsupported_hardware = kwargs.get("unsupported_hardware", False)
+
+ def __str__(self):
+ retval = KickstartCommand.__str__(self)
+
+ if self.unsupported_hardware:
+ retval += "unsupported_hardware\n"
+
+ return retval
+
+ def _getParser(self):
+ op = KSOptionParser()
+ return op
+
+ def parse(self, args):
+ (opts, extra) = self.op.parse_args(args=args, lineno=self.lineno)
+
+ if len(extra) > 0:
+ raise KickstartParseError, formatErrorMsg(self.lineno, msg=_("Kickstart command %s does not take any arguments") % self.currentCmd)
+
+ self.unsupported_hardware = True
+ return self
diff --git a/pykickstart/handlers/control.py b/pykickstart/handlers/control.py
index 56d892a..cf24586 100644
--- a/pykickstart/handlers/control.py
+++ b/pykickstart/handlers/control.py
@@ -860,6 +860,7 @@ commandMap = {
"sshpw": sshpw.F13_SshPw,
"text": displaymode.FC3_DisplayMode,
"timezone": timezone.FC6_Timezone,
+ "unsupported_hardware": unsupported_hardware.RHEL6_UnsupportedHardware,
"updates": updates.F7_Updates,
"upgrade": upgrade.F11_Upgrade,
"url": method.RHEL6_Method,
diff --git a/tests/commands/unsupported_hardware.py b/tests/commands/unsupported_hardware.py
new file mode 100644
index 0000000..1348679
--- /dev/null
+++ b/tests/commands/unsupported_hardware.py
@@ -0,0 +1,19 @@
+import unittest, shlex
+import warnings
+from tests.baseclass import *
+
+from pykickstart.errors import *
+from pykickstart.commands.unsupported_hardware import *
+
+class RHEL6_TestCase(CommandTest):
+ command = "unsupported_hardware"
+
+ def runTest(self):
+ # pass
+ self.assert_parse("unsupported_hardware")
+
+ # fail
+ self.assert_parse_error("unsupported_hardware --cheese")
+
+if __name__ == "__main__":
+ unittest.main()
--
1.7.11.4
11 years, 7 months